diff -Nrc3pad gcc-3.2.3/boehm-gc/acinclude.m4 gcc-3.3/boehm-gc/acinclude.m4 *** gcc-3.2.3/boehm-gc/acinclude.m4 2001-10-16 09:01:35.000000000 +0000 --- gcc-3.3/boehm-gc/acinclude.m4 2002-05-16 17:41:54.000000000 +0000 *************** *** 1,4 **** ! # Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved. # # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. --- 1,4 ---- ! # Copyright (c) 1999-2001, 2002 by Red Hat, Inc. All rights reserved. # # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. *************** fi *** 52,58 **** AC_CANONICAL_SYSTEM # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) AM_INIT_AUTOMAKE(gc, 6.1a1, no-define) --- 52,58 ---- AC_CANONICAL_SYSTEM # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" AC_SUBST(mkinstalldirs) AM_INIT_AUTOMAKE(gc, 6.1a1, no-define) diff -Nrc3pad gcc-3.2.3/boehm-gc/aclocal.m4 gcc-3.3/boehm-gc/aclocal.m4 *** gcc-3.2.3/boehm-gc/aclocal.m4 2003-04-22 06:56:18.000000000 +0000 --- gcc-3.3/boehm-gc/aclocal.m4 2003-05-14 00:18:14.000000000 +0000 *************** dnl but WITHOUT ANY WARRANTY, to the ext *** 10,16 **** dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. ! # Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved. # # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. --- 10,16 ---- dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. ! # Copyright (c) 1999-2001, 2002 by Red Hat, Inc. All rights reserved. # # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. *************** fi *** 64,70 **** AC_CANONICAL_SYSTEM # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) AM_INIT_AUTOMAKE(gc, 6.0, no-define) --- 64,70 ---- AC_CANONICAL_SYSTEM # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" AC_SUBST(mkinstalldirs) AM_INIT_AUTOMAKE(gc, 6.0, no-define) diff -Nrc3pad gcc-3.2.3/boehm-gc/alloc.c gcc-3.3/boehm-gc/alloc.c *** gcc-3.2.3/boehm-gc/alloc.c 2002-02-12 04:37:53.000000000 +0000 --- gcc-3.3/boehm-gc/alloc.c 2003-03-04 06:38:30.000000000 +0000 *************** void GC_maybe_gc() *** 306,311 **** --- 306,312 ---- GC_bool GC_try_to_collect_inner(stop_func) GC_stop_func stop_func; { + if (GC_dont_gc) return FALSE; if (GC_incremental && GC_collection_in_progress()) { # ifdef CONDPRINT if (GC_print_stats) { *************** int n; *** 386,391 **** --- 387,393 ---- { register int i; + if (GC_dont_gc) return; if (GC_incremental && GC_collection_in_progress()) { for (i = GC_deficit; i < GC_RATE*n; i++) { if (GC_mark_some((ptr_t)0)) { *************** GC_stop_func stop_func; *** 446,451 **** --- 448,456 ---- CLOCK_TYPE start_time, current_time; # endif + # if defined(REGISTER_LIBRARIES_EARLY) + GC_cond_register_dynamic_libraries(); + # endif STOP_WORLD(); # ifdef PRINTTIMES GET_TIME(start_time); diff -Nrc3pad gcc-3.2.3/boehm-gc/ChangeLog gcc-3.3/boehm-gc/ChangeLog *** gcc-3.2.3/boehm-gc/ChangeLog 2003-04-22 06:14:05.000000000 +0000 --- gcc-3.3/boehm-gc/ChangeLog 2003-05-14 00:08:56.000000000 +0000 *************** *** 1,10 **** ! 2003-04-22 Release Manager ! * GCC 3.2.3 Released. ! 2003-02-05 Release Manager ! * GCC 3.2.2 Released. 2003-01-27 Alexandre Oliva --- 1,61 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! ! 2003-05-13 Release Manager ! ! * GCC 3.3 Released. ! ! 2003-05-13 Release Manager ! ! * GCC 3.3 Released. ! ! 2003-04-28 Mohan Embar ! ! * configure.in: define GC_DLL under mingw if --enable-shared ! * configure: rebuilt ! * win32_threads.c: add #ifdef GC_DLL around DllMain ! ! 2003-04-09 Tom Tromey ! ! * include/private/gcconfig.h (LINUX_STACKBOTTOM): Define for ! POWERPC. ! (STACK_GRAN, HEURISTIC1): Don't define for POWERPC. ! ! 2003-03-04 Hans Boehm ! * include/private/gcconfig.h (GC_data_start): declare when needed. ! * include/private/gc_priv.h: Include gcconfig.h after ptr_t ! declaration. ! ! 2003-03-03 Hans Boehm ! * mark_rts.c (GC_cond_register_dynamic_libraries): add. ! (GC_push_roots): explicitly mark free list headers, register ! dynamic libraries only if !REGISTER_LIBRARIES_EARLY. ! * alloc.c (GC_stopped_mark): Conditionally call ! GC_cond_register_dynamic_libraries(). ! (GC_collect_a_little_inner, GC_try_to_collect_inner): Check GC_dont_gc. ! * dyn_load.c (GC_register_main_static_data): define. ! (GC_register_dyn_libraries (Linux /proc, Linux ELF versions)): ! no longer skip main data. Register main data for static executable. ! * misc.c (GC_REGISTER_MAIN_STATIC_DATA): define. ! (GC_init_inner): Make main data registration conditional. ! * include/private/gc_priv.h (GC_register_main_static_data): declare. ! * include/private/gcconfig.h (REGISTER_LIBRARIES_EARLY): define ! for LINUX. ! ! 2003-02-20 Alexandre Oliva ! ! * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to ! config.status. ! * configure: Rebuilt. ! ! 2003-02-11 Andreas Tobler ! ! * include/private/gcconfig.h: undefine MPROTECT_VDB for MACOSX 2003-01-27 Alexandre Oliva *************** *** 13,58 **** * Makefile.am (toolexecdir, toolexeclibdir): Don't override. * Makefile.in, configure: Rebuilt. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-18 Release Manager ! * GCC 3.2.1 Released. ! 2002-10-07 Kaveh R. Ghazi ! * Makefile.am (all-multi): Fix multilib parallel build. 2002-08-23 Adam Megacz * win32_threads.cc: Removed extraneous ABORT() ! 2002-08-14 Release Manager ! * GCC 3.2 Released. ! 2002-07-25 Release Manager ! * GCC 3.1.1 Released. ! 2002-06-28 Hans Boehm ! Jonathan Clark ! * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. 2002-05-08 Alexandre Oliva --- 64,158 ---- * Makefile.am (toolexecdir, toolexeclibdir): Don't override. * Makefile.in, configure: Rebuilt. ! 2002-12-31 Tom Tromey ! For PR libgcj/8933: ! * include/Makefile.in: Rebuilt. ! * include/Makefile.am (noinst_HEADERS): Renamed from ! include_HEADERS. ! 2002-11-19 Rainer Orth ! * ltconfig (osf[345]): Append $major to soname_spec. ! Reflect this in library_names_spec. ! * ltmain.sh (osf): Prefix $major with . for use as extension. ! 2002-10-02 Andreas Jaeger ! * include/private/gcconfig.h (HBLKSIZE): Define for x86-64. ! 2002-09-28 Richard Earnshaw ! * include/private/gcconfig.h: Don't check for __XSCALE__. Instead ! check for __arm__ or __thumb__. ! ! 2002-09-27 Ulrich Weigand ! ! * include/private/gcconfig: Add machine type S390. Add s390x support. ! * include/private/gc_locks.h (GC_test_and_set): Implement for s390. ! (GC_compare_and_exchange): Likewise. ! ! 2002-09-24 Jason Thorpe ! ! * include/private/gcconfig.h: Fix NetBSD/mips parameters. 2002-08-23 Adam Megacz * win32_threads.cc: Removed extraneous ABORT() ! 2002-09-22 Kaveh R. Ghazi ! * Makefile.am (all-multi): Fix multilib parallel build. ! 2002-07-18 Bo Thorsen ! * include/private/gcconfig.h: Add x86-64 definitions. ! * os_dep.c: Add x86-64 support. ! * configure.in: Likewise. ! * configure: Regenerate. ! 2002-07-18 H.J. Lu ! * mach_dep.c (GC_push_regs): Remove the unused Linux/mips code. ! 2002-07-18 H.J. Lu (hjl@gnu.org) ! * configure.in (machdep): Don't add mips_sgi_mach_dep.lo for ! Linux/mips. ! 2002-06-28 Hans Boehm ! Jonathan Clark ! * win32_threads.c (GC_push_all_stacks): Tolerate bad sp. ! ! 2002-06-09 H.J. Lu (hjl@gnu.org) ! ! * include/private/gc_locks.h (GC_test_and_set): Support ! Linux/mips. ! (GC_TEST_AND_SET_DEFINED): Likewise. ! ! * include/private/gcconfig.h (DYNAMIC_LOADING): Defined for ! Linux/mips. ! (DATAEND): Likewise. ! (LINUX_STACKBOTTOM): Likewise. ! (STACKBOTTOM): Removed for Linux/mips. ! ! Sun May 19 11:32:03 2002 Mark P Mitchell ! ! * irix_threads.cc (GC_pthread_detach): Do not use REAL_FUNC. ! (GC_pthread_create): Fix typo. ! (GC_TRY_LOCK): Likewise. ! * include/private/gc_locks.h (GC_test_and_set): Only take one ! one argument. ! (LOCK): Adjust appropriately. ! * include/private/gc_priv.h (SIG_SUSPEND): Use SIGRTMIN if ! _SIGRTMIN is unavailable. ! ! 2002-05-16 Rainer Orth ! ! * acinclude.m4: Allow for PWDCMD to override hardcoded pwd. ! * aclocal.m4: Regenerate. ! * configure: Regenerate. 2002-05-08 Alexandre Oliva *************** *** 83,99 **** SPARC Linux. 2002-04-09 Loren J. Rittle - Richard Henderson * include/private/gcconfig.h (DATAEND): Update comment example ! to match reality. Clarify comment. ! Change all likely references to linker script synthesized ! symbols to use this idiom: extern int etext[]; etext ! * os_dep.c (GC_init_linux_data_start): Fix references to ! __data_start and _end. 2002-04-08 Hans Boehm ! * include/private/gc_priv.h (WARN macro): Add "GC warning:" prefix. (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): declare. --- 183,198 ---- SPARC Linux. 2002-04-09 Loren J. Rittle * include/private/gcconfig.h (DATAEND): Update comment example ! to match reality. ! ! 2002-04-08 Loren J. Rittle ! ! * include/private/gcconfig.h (DATAEND): Clarify comment. 2002-04-08 Hans Boehm ! * include/private/gc_priv.h (WARN macro): Add "GC warning:" prefix. (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): declare. *************** *** 101,107 **** frequency for blacklist warning message. * misc.c (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): define. ! (GC_init_inner): Check GC_NO_BLACKLIST_WARNING and GC_LARGE_ALLOC_WARN_INTERVAL environment variables. * doc/README.environment (GC_NO_BLACKLIST_WARNING): Deprecate. (GC_LARGE_ALLOC_WARN_INTERVAL): Add documentation. --- 200,206 ---- frequency for blacklist warning message. * misc.c (GC_large_alloc_warn_interval, GC_large_alloc_warn_suppressed): define. ! (GC_init_inner): Check GC_NO_BLACKLIST_WARNING and GC_LARGE_ALLOC_WARN_INTERVAL environment variables. * doc/README.environment (GC_NO_BLACKLIST_WARNING): Deprecate. (GC_LARGE_ALLOC_WARN_INTERVAL): Add documentation. *************** *** 114,126 **** memory hole between the end of the initialized data segment and the start of the BSS on FreeBSD/i386. - 2002-04-01 Loren J. Rittle - - * include/private/gcconfig.h: Add unified test for FreeBSD. - Support FreeBSD/alpha. - * os_dep.c: Do not include unless available. - (GC_freebsd_stack_base): Fix types. - 2002-03-30 Krister Walfridsson * include/private/gcconfig.h: define DYNAMIC_LOADING for ELF --- 213,218 ---- *************** *** 138,147 **** Safer definition for INVALID_QTID, quick_thread_id. Fix/add comments. Rearrange tse fields. ! 2002-03-24 Jeff Sturm * linux_threads.c (GC_get_nprocs): Close file descriptor. 2002-03-15 Anthony Green * misc.c (GC_init_inner): Initialize GC_write_cs before use. --- 230,262 ---- Safer definition for INVALID_QTID, quick_thread_id. Fix/add comments. Rearrange tse fields. ! 2002-03-27 Richard Henderson ! ! * os_dep.c (GC_init_linux_data_start): Fix references to ! __data_start and _end. ! ! 2002-03-25 Loren J. Rittle ! ! * include/private/gcconfig.h: Change all likely references ! to linker script synthesized symbols to use this idiom: ! extern int etext[]; etext ! ! 2002-03-25 Jeff Sturm * linux_threads.c (GC_get_nprocs): Close file descriptor. + 2002-03-21 Loren J. Rittle + + * include/private/gcconfig.h: Add unified test for FreeBSD. + Support FreeBSD/alpha. + * os_dep.c: Do not include unless available. + (GC_freebsd_stack_base): Fix types. + + 2002-03-17 Bryce McKinlay + + * Makefile.am: Make a convenience library. + * Makefile.in: Rebuilt. + 2002-03-15 Anthony Green * misc.c (GC_init_inner): Initialize GC_write_cs before use. *************** *** 159,175 **** compiling with GCC. * mark.c (GC_mark_some): We no longer use SEH if compiling with GCC. ! 2002-03-09 Bryce McKinlay ! * include/gc_priv.h: Define ALIGN_DOUBLE on 32 bit targets if GCJ support is enabled, for hash synchronization. - 2002-03-17 Bryce McKinlay - - * Makefile.am: Make a convenience library. - * Makefile.in: Rebuilt. - 2002-02-24 Adam Megacz * Makefile.am: Added win32_threads.c to sources list. --- 274,285 ---- compiling with GCC. * mark.c (GC_mark_some): We no longer use SEH if compiling with GCC. ! 2002-03-09 Bryce McKinlay ! * include/gc_priv.h: Define ALIGN_DOUBLE on 32 bit targets if GCJ support is enabled, for hash synchronization. 2002-02-24 Adam Megacz * Makefile.am: Added win32_threads.c to sources list. *************** *** 183,190 **** 2002-02-13 Bryce McKinlay * dbg_mlc.c (GC_debug_generic_malloc): Removed. ! ! * sparc_mach_dep.S: Rename from sparc_mach_dep.s as it is a preprocessor file. * mips_sgi_mach_dep.S: Likewise. * Makefile.am: Update for above changes. --- 293,300 ---- 2002-02-13 Bryce McKinlay * dbg_mlc.c (GC_debug_generic_malloc): Removed. ! ! * sparc_mach_dep.S: Rename from sparc_mach_dep.s as it is a preprocessor file. * mips_sgi_mach_dep.S: Likewise. * Makefile.am: Update for above changes. *************** *** 231,237 **** * boehm-gc on win32 now automatically detects if it is being built as a DLL; see http://gcc.gnu.org/ml/java/2001-12/msg00240.html ! 2002-01-25 David Edelsohn * include/gc.h (GC_INIT): Add DATASTART and DATAEND roots on AIX. --- 341,347 ---- * boehm-gc on win32 now automatically detects if it is being built as a DLL; see http://gcc.gnu.org/ml/java/2001-12/msg00240.html ! 2002-01-25 David Edelsohn * include/gc.h (GC_INIT): Add DATASTART and DATAEND roots on AIX. *************** *** 252,258 **** 2001-12-16 Craig Rodrigues PR other/3725 ! * configure.in: Add AC_SUBST(target_alias). * configure: Regenerated. 2001-11-26 Loren J. Rittle --- 362,368 ---- 2001-12-16 Craig Rodrigues PR other/3725 ! * configure.in: Add AC_SUBST(target_alias). * configure: Regenerated. 2001-11-26 Loren J. Rittle *************** *** 300,306 **** * solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]: Provide special Solaris 2/Intel definition. ! * configure.in (i?86-*-solaris2.[89]*): Define SOLARIS25_PROC_VDB_BUG_FIXED. * include/private/gcconfig.h [I386 && SUNOS5]: Use it. --- 410,416 ---- * solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]: Provide special Solaris 2/Intel definition. ! * configure.in (i?86-*-solaris2.[89]*): Define SOLARIS25_PROC_VDB_BUG_FIXED. * include/private/gcconfig.h [I386 && SUNOS5]: Use it. *************** *** 485,492 **** functions. * Makefile.in: Rebuilt. * configure: Rebuilt. ! ! * linux_thread.c (GC_thr_init, GC_suspend_handler): Add SIGABRT to the list of signals which are not blocked during suspend in the NO_SIGNALS case. --- 595,602 ---- functions. * Makefile.in: Rebuilt. * configure: Rebuilt. ! ! * linux_thread.c (GC_thr_init, GC_suspend_handler): Add SIGABRT to the list of signals which are not blocked during suspend in the NO_SIGNALS case. *************** *** 513,519 **** 2000-09-30 Bryce McKinlay ! * configure.in: Define GC_GCJ_SUPPORT. Define NO_DEBUGGING in cross-compile configuration only. * Makefile.am: Build gcj_mlc.c. * configure, Makefile.in: Rebuilt. --- 623,629 ---- 2000-09-30 Bryce McKinlay ! * configure.in: Define GC_GCJ_SUPPORT. Define NO_DEBUGGING in cross-compile configuration only. * Makefile.am: Build gcj_mlc.c. * configure, Makefile.in: Rebuilt. *************** *** 596,602 **** Imported version version 5.0alpha6. * acinclude.m4: Bump version to 5.0a6. * configure.in: Don't use alpha_mach_dep.s. ! * include/private/config.h, irix_threads.c gc_watcom.asm: Delete obsolete files. * Makefile.am, Makefile.in: irix_threads.c is now hpux_irix_threads.c. --- 706,712 ---- Imported version version 5.0alpha6. * acinclude.m4: Bump version to 5.0a6. * configure.in: Don't use alpha_mach_dep.s. ! * include/private/config.h, irix_threads.c gc_watcom.asm: Delete obsolete files. * Makefile.am, Makefile.in: irix_threads.c is now hpux_irix_threads.c. *************** Fri Jan 28 17:13:20 2000 Anthony Green *** 628,634 **** 1999-12-19 Anthony Green ! * gcconfig.h: Use libgcj hack for Alpha Linux. Undefine MPROTEXT_VDB (from Jeff Sturm). * os_dep.c: Remove Alpha Linux hacks. * misc.c: Ditto. --- 738,744 ---- 1999-12-19 Anthony Green ! * gcconfig.h: Use libgcj hack for Alpha Linux. Undefine MPROTEXT_VDB (from Jeff Sturm). * os_dep.c: Remove Alpha Linux hacks. * misc.c: Ditto. *************** Mon Aug 2 23:09:41 1999 Rainer Orth < *** 825,831 **** (LTCOMPILE): Renamed; added libtool invocation. (LINK): Added libtool invocation. (.s.o): use LTCOMPILE. ! * configure.in: Call AM_PROG_LIBTOOL. (target_all): Set to libgcjgc.la. Mention `.lo' forms of object files. --- 935,941 ---- (LTCOMPILE): Renamed; added libtool invocation. (LINK): Added libtool invocation. (.s.o): use LTCOMPILE. ! * configure.in: Call AM_PROG_LIBTOOL. (target_all): Set to libgcjgc.la. Mention `.lo' forms of object files. *************** Mon Aug 2 23:09:41 1999 Rainer Orth < *** 909,915 **** * configure.in: likewise * misc.c (GC_write): add eCos support. * os_dep.c (tiny_sbrk): add eCos support. ! Thu Dec 10 18:24:34 1998 Warren Levy * misc.c (GC_init_inner): Moved STACKBASE code to os_dep.c. --- 1019,1025 ---- * configure.in: likewise * misc.c (GC_write): add eCos support. * os_dep.c (tiny_sbrk): add eCos support. ! Thu Dec 10 18:24:34 1998 Warren Levy * misc.c (GC_init_inner): Moved STACKBASE code to os_dep.c. *************** Thu Dec 10 18:24:34 1998 Warren Levy < *** 921,929 **** 1998-11-20 Andrew Haley ! * Makefile.am, Makefile.in, configure.host: tx39 build option "-G 0" added. ! 1998-11-17 Tom Tromey * configure: Rebuilt. --- 1031,1039 ---- 1998-11-20 Andrew Haley ! * Makefile.am, Makefile.in, configure.host: tx39 build option "-G 0" added. ! 1998-11-17 Tom Tromey * configure: Rebuilt. *************** Wed Apr 15 11:40:56 1998 Tom Tromey &6 ! echo "configure:597: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 604,610 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:608: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** test -z "$INSTALL_SCRIPT" && INSTALL_SCR *** 646,652 **** test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:650: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile --- 657,663 ---- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:661: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile *************** test "$program_suffix" != NONE && *** 703,709 **** test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:707: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 714,720 ---- test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:718: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 736,747 **** fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 ! echo "configure:740: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:751: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else --- 763,769 ---- return __CYGWIN__; ; return 0; } EOF ! if { (eval echo configure:767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else *************** echo "$ac_t""$ac_cv_cygwin" 1>&6 *** 769,787 **** CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ! echo "configure:773: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else --- 780,798 ---- CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ! echo "configure:784: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else *************** else { echo "configure: error: can not r *** 892,898 **** fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:896: checking host system type" >&5 host_alias=$host case "$host_alias" in --- 903,909 ---- fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:907: checking host system type" >&5 host_alias=$host case "$host_alias" in *************** host_os=`echo $host | sed 's/^\([^-]*\)- *** 913,919 **** echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 ! echo "configure:917: checking target system type" >&5 target_alias=$target case "$target_alias" in --- 924,930 ---- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 ! echo "configure:928: checking target system type" >&5 target_alias=$target case "$target_alias" in *************** target_os=`echo $target | sed 's/^\([^-] *** 931,937 **** echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:935: checking build system type" >&5 build_alias=$build case "$build_alias" in --- 942,948 ---- echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:946: checking build system type" >&5 build_alias=$build case "$build_alias" in *************** test "$host_alias" != "$target_alias" && *** 955,961 **** # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" --- 966,972 ---- # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" *************** fi *** 971,977 **** missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:975: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 982,988 ---- missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:986: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 984,990 **** fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:988: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 995,1001 ---- fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:999: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 997,1003 **** fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:1001: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1008,1014 ---- fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:1012: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 1010,1016 **** fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:1014: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1021,1027 ---- fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:1025: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 1023,1029 **** fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:1027: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1034,1040 ---- fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:1038: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** fi *** 1049,1055 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1053: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1060,1066 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1064: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -z "$CC"; then *** 1079,1085 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1083: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1090,1096 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1094: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1128,1134 **** fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1132: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1139,1145 ---- fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1143: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1137,1143 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 1148,1154 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** if test $ac_cv_prog_gcc = yes; then *** 1152,1158 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1156: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1163,1169 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1167: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** do *** 1189,1195 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1193: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1200,1206 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1204: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** test -n "$CXX" || CXX="gcc" *** 1222,1228 **** test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1226: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1233,1239 ---- test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1237: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1231,1237 **** yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no --- 1242,1248 ---- yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no *************** if test $ac_cv_prog_gxx = yes; then *** 1246,1252 **** ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1250: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1257,1263 ---- ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1261: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1279,1285 **** # NEWLIB_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:1283: checking build system type" >&5 build_alias=$build case "$build_alias" in --- 1290,1296 ---- # NEWLIB_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:1294: checking build system type" >&5 build_alias=$build case "$build_alias" in *************** echo "$ac_t""$build" 1>&6 *** 1300,1306 **** # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1304: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1311,1317 ---- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1315: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1332,1338 **** # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1336: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1343,1349 ---- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1347: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1364,1370 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1368: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1375,1381 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1379: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 1396,1402 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1400: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1407,1413 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1411: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1441,1447 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1445: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1452,1458 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1456: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** test -z "$INSTALL_DATA" && INSTALL_DATA= *** 1495,1501 **** echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:1499: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" --- 1506,1512 ---- echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:1510: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" *************** if false; then *** 1533,1539 **** echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1537: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1544,1550 ---- echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1548: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1543,1552 **** rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done --- 1554,1563 ---- rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done *************** ac_prog=ld *** 1665,1671 **** if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 ! echo "configure:1669: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw --- 1676,1682 ---- if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 ! echo "configure:1680: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw *************** echo "configure:1669: checking for ld us *** 1695,1704 **** esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 ! echo "configure:1699: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 ! echo "configure:1702: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1706,1715 ---- esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 ! echo "configure:1710: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 ! echo "configure:1713: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 1733,1739 **** fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 ! echo "configure:1737: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1744,1750 ---- fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 ! echo "configure:1748: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** with_gnu_ld=$lt_cv_prog_gnu_ld *** 1750,1756 **** echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 ! echo "configure:1754: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1761,1767 ---- echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 ! echo "configure:1765: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** reload_flag=$lt_cv_ld_reload_flag *** 1762,1768 **** test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 ! echo "configure:1766: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1773,1779 ---- test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 ! echo "configure:1777: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** NM="$lt_cv_path_NM" *** 1800,1806 **** echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:1804: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1811,1817 ---- echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:1815: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1821,1827 **** fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 ! echo "configure:1825: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1832,1838 ---- fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 ! echo "configure:1836: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** gnu*) *** 1893,1901 **** ;; hpux10.20*|hpux11*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) --- 1904,1921 ---- ;; hpux10.20*|hpux11*) ! case $host_cpu in ! hppa*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ! ;; ! ia64*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ! ;; ! esac ;; irix5* | irix6*) *************** file_magic_cmd=$lt_cv_file_magic_cmd *** 1985,1997 **** deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:1989: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:1995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; --- 2005,2017 ---- deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:2009: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:2015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *************** case $deplibs_check_method in *** 2015,2021 **** file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:2019: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2035,2041 ---- file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:2039: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2077,2083 **** if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:2081: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2097,2103 ---- if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:2101: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** esac *** 2148,2154 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2152: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2168,2174 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2172: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 2180,2186 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2184: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2200,2206 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2204: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2215,2221 **** # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2219: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2235,2241 ---- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2239: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 2247,2253 **** # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2251: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2267,2273 ---- # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2271: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** test x"$pic_mode" = xno && libtool_flags *** 2314,2321 **** case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 2318 "configure"' > conftest.$ac_ext ! if { (eval echo configure:2319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" --- 2334,2354 ---- case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 2338 "configure"' > conftest.$ac_ext ! if { (eval echo configure:2339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! if test "$lt_cv_prog_gnu_ld" = yes; then ! case `/usr/bin/file conftest.$ac_objext` in ! *32-bit*) ! LD="${LD-ld} -melf32bsmip" ! ;; ! *N32*) ! LD="${LD-ld} -melf32bmipn32" ! ;; ! *64-bit*) ! LD="${LD-ld} -melf64bmip" ! ;; ! esac ! else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" *************** case $host in *** 2327,2332 **** --- 2360,2424 ---- LD="${LD-ld} -64" ;; esac + fi + fi + rm -rf conftest* + ;; + + ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:2372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; + + x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:2388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac fi rm -rf conftest* ;; *************** case $host in *** 2336,2342 **** SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:2340: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2428,2434 ---- SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:2432: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** ac_link='${CC-cc} -o conftest${ac_exeext *** 2349,2362 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else --- 2441,2454 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else *************** echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 *** 2386,2392 **** esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:2390: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2478,2484 ---- esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:2482: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** ac_link='${CXX-g++} -o conftest${ac_exee *** 2399,2410 **** cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2491,2502 ---- cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** fi *** 2551,2557 **** echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:2555: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" --- 2643,2649 ---- echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:2647: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" *************** if false; then *** 2584,2590 **** echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:2588: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2676,2682 ---- echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:2680: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 2594,2603 **** rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:2598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done --- 2686,2695 ---- rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:2690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in ! *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done *************** ac_exeext=$EXEEXT *** 2617,2623 **** fi echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 ! echo "configure:2621: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` if test -z "$THREADS"; then THREADS=no --- 2709,2715 ---- fi echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 ! echo "configure:2713: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` if test -z "$THREADS"; then THREADS=no *************** case "$THREADS" in *** 2646,2652 **** THREADS=posix THREADLIBS=-lpthread case "$host" in ! x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux*) cat >> confdefs.h <<\EOF #define GC_LINUX_THREADS 1 EOF --- 2738,2744 ---- THREADS=posix THREADLIBS=-lpthread case "$host" in ! x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* ) cat >> confdefs.h <<\EOF #define GC_LINUX_THREADS 1 EOF *************** EOF *** 2737,2742 **** --- 2829,2840 ---- #define NO_GETENV 1 EOF + if test $enable_shared = yes; then + cat >> confdefs.h <<\EOF + #define GC_DLL 1 + EOF + + fi ;; decosf1 | irix | mach | os2 | solaris | dce | vxworks) { echo "configure: error: thread package $THREADS not yet supported" 1>&2; exit 1; } *************** esac *** 2748,2754 **** echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2752: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2846,2852 ---- echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:2850: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 2756,2762 **** ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2865,2871 ---- dlopen() ; return 0; } EOF ! if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** EOF *** 2875,2880 **** --- 2973,2980 ---- mips-dec-ultrix*) machdep="mips_ultrix_mach-dep.lo" ;; + mips*-*-linux*) + ;; mips-*-*) machdep="mips_sgi_mach_dep.lo" cat >> confdefs.h <<\EOF *************** EOF *** 2984,2990 **** EOF ;; ! x86-*-linux* | i586-*-linux* | i686-*-linux* ) cat >> confdefs.h <<\EOF #define MAKE_BACK_GRAPH 1 EOF --- 3084,3090 ---- EOF ;; ! x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* ) cat >> confdefs.h <<\EOF #define MAKE_BACK_GRAPH 1 EOF *************** trap 'rm -f $CONFIG_STATUS conftest*; ex *** 3084,3117 **** # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. ! # ! # If the first sed substitution is executed (which looks for macros that ! # take arguments), then we branch to the quote section. Otherwise, ! # look for a macro that doesn't take arguments. ! cat >confdef2opt.sed <<\_ACEOF ! t clear ! : clear ! s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g ! t quote ! s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g ! t quote ! d ! : quote ! s,[ `~#$^&*(){}\\|;'"<>?],\\&,g ! s,\[,\\&,g ! s,\],\\&,g ! s,\$,$$,g ! p ! _ACEOF ! # We use echo to avoid assuming a particular line-breaking character. ! # The extra dot is to prevent the shell from consuming trailing ! # line-breaks from the sub-command output. A line-break within ! # single-quotes doesn't work because, if this script is created in a ! # platform that uses two characters for line-breaks (e.g., DOS), tr ! # would break. ! ac_LF_and_DOT=`echo; echo .` ! DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` ! rm -f confdef2opt.sed # Without the "./", some shells look in PATH for config.status. --- 3184,3198 ---- # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. ! cat > conftest.defs <<\EOF ! s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g ! s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g ! s%\[%\\&%g ! s%\]%\\&%g ! s%\$%$$%g ! EOF ! DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` ! rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. *************** cat >> $CONFIG_STATUS <<\EOF *** 3242,3248 **** # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ! ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. --- 3323,3329 ---- # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ! ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. *************** ac_configure_args="${multilib_arg} ${ac_ *** 3344,3349 **** --- 3425,3431 ---- CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} gc_basedir=${gc_basedir} CC="${CC}" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" DEFS="$DEFS" EOF diff -Nrc3pad gcc-3.2.3/boehm-gc/configure.in gcc-3.3/boehm-gc/configure.in *** gcc-3.2.3/boehm-gc/configure.in 2003-01-28 01:44:36.000000000 +0000 --- gcc-3.3/boehm-gc/configure.in 2003-04-28 20:55:07.000000000 +0000 *************** case "$THREADS" in *** 73,79 **** THREADS=posix THREADLIBS=-lpthread case "$host" in ! x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux*) AC_DEFINE(GC_LINUX_THREADS) AC_DEFINE(_REENTRANT) if test "${enable_parallel_mark}"; then --- 73,79 ---- THREADS=posix THREADLIBS=-lpthread case "$host" in ! x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* ) AC_DEFINE(GC_LINUX_THREADS) AC_DEFINE(_REENTRANT) if test "${enable_parallel_mark}"; then *************** case "$THREADS" in *** 116,121 **** --- 116,124 ---- win32) AC_DEFINE(GC_WIN32_THREADS) AC_DEFINE(NO_GETENV) + if test $enable_shared = yes; then + AC_DEFINE(GC_DLL) + fi ;; decosf1 | irix | mach | os2 | solaris | dce | vxworks) AC_MSG_ERROR(thread package $THREADS not yet supported) *************** case "$host" in *** 182,187 **** --- 185,192 ---- mips-dec-ultrix*) machdep="mips_ultrix_mach-dep.lo" ;; + mips*-*-linux*) + ;; mips-*-*) machdep="mips_sgi_mach_dep.lo" AC_DEFINE(NO_EXECUTE_PERMISSION) *************** AC_ARG_ENABLE(full-debug, *** 257,263 **** ia64-*-linux* ) AC_DEFINE(MAKE_BACK_GRAPH) ;; ! x86-*-linux* | i586-*-linux* | i686-*-linux* ) AC_DEFINE(MAKE_BACK_GRAPH) AC_MSG_WARN("Client must not use -fomit-frame-pointer.") AC_DEFINE(SAVE_CALL_COUNT, 8) --- 262,268 ---- ia64-*-linux* ) AC_DEFINE(MAKE_BACK_GRAPH) ;; ! x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* ) AC_DEFINE(MAKE_BACK_GRAPH) AC_MSG_WARN("Client must not use -fomit-frame-pointer.") AC_DEFINE(SAVE_CALL_COUNT, 8) *************** ac_configure_args="${multilib_arg} ${ac_ *** 299,303 **** --- 304,309 ---- CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} gc_basedir=${gc_basedir} CC="${CC}" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" DEFS="$DEFS" ) diff -Nrc3pad gcc-3.2.3/boehm-gc/dyn_load.c gcc-3.3/boehm-gc/dyn_load.c *** gcc-3.2.3/boehm-gc/dyn_load.c 2002-04-09 00:03:24.000000000 +0000 --- gcc-3.3/boehm-gc/dyn_load.c 2003-03-04 06:38:30.000000000 +0000 *************** void GC_register_dynamic_libraries() *** 355,364 **** /* Stack mapping; discard */ continue; } - if (start <= datastart && end > datastart && maj_dev != 0) { - /* Main data segment; discard */ - continue; - } # ifdef THREADS if (GC_segment_is_thread_stack(start, end)) continue; # endif --- 355,360 ---- *************** void GC_register_dynamic_libraries() *** 384,389 **** --- 380,392 ---- } } + /* We now take care of the main data segment ourselves: */ + GC_bool GC_register_main_static_data() + { + return FALSE; + } + + # define HAVE_REGISTER_MAIN_STATIC_DATA // // parse_map_entry parses an entry from /proc/self/maps so we can // locate all writable data segments that belong to shared libraries. *************** static int GC_register_dynlib_callback(i *** 469,481 **** + sizeof (info->dlpi_phnum)) return -1; - /* Skip the first object - it is the main program. */ - if (*(int *)ptr == 0) - { - *(int *)ptr = 1; - return 0; - } - p = info->dlpi_phdr; for( i = 0; i < (int)(info->dlpi_phnum); ((i++),(p++)) ) { switch( p->p_type ) { --- 472,477 ---- *************** static int GC_register_dynlib_callback(i *** 491,496 **** --- 487,493 ---- } } + * (int *)ptr = 1; /* Signal that we were called */ return 0; } *************** static int GC_register_dynlib_callback(i *** 500,515 **** GC_bool GC_register_dynamic_libraries_dl_iterate_phdr() { - int tmp = 0; - if (dl_iterate_phdr) { ! dl_iterate_phdr(GC_register_dynlib_callback, &tmp); return TRUE; } else { return FALSE; } } # else /* !LINUX || version(glibc) < 2.2.4 */ /* Dynamic loading code for Linux running ELF. Somewhat tested on --- 497,527 ---- GC_bool GC_register_dynamic_libraries_dl_iterate_phdr() { if (dl_iterate_phdr) { ! int did_something = 0; ! dl_iterate_phdr(GC_register_dynlib_callback, &did_something); ! if (!did_something) { ! /* dl_iterate_phdr may forget the static data segment in */ ! /* statically linked executables. */ ! GC_add_roots_inner(DATASTART, (char *)(DATAEND), TRUE); ! # if defined(DATASTART2) ! GC_add_roots_inner(DATASTART2, (char *)(DATAEND2), TRUE); ! # endif ! } return TRUE; } else { return FALSE; } } + /* Do we need to separately register the main static data segment? */ + GC_bool GC_register_main_static_data() + { + return (dl_iterate_phdr == 0); + } + + #define HAVE_REGISTER_MAIN_STATIC_DATA + # else /* !LINUX || version(glibc) < 2.2.4 */ /* Dynamic loading code for Linux running ELF. Somewhat tested on *************** void GC_register_dynamic_libraries() *** 775,784 **** } # endif ! # ifndef MSWINCE extern GC_bool GC_no_win32_dlls; ! # endif void GC_register_dynamic_libraries() { MEMORY_BASIC_INFORMATION buf; --- 787,809 ---- } # endif ! # ifdef MSWINCE ! /* Do we need to separately register the main static data segment? */ ! GC_bool GC_register_main_static_data() ! { ! return FALSE; ! } ! # else /* win32 */ extern GC_bool GC_no_win32_dlls; ! ! GC_bool GC_register_main_static_data() ! { ! return GC_no_win32_dlls; ! } ! # endif /* win32 */ + # define HAVE_REGISTER_MAIN_STATIC_DATA + void GC_register_dynamic_libraries() { MEMORY_BASIC_INFORMATION buf; *************** void GC_register_dynamic_libraries(){} *** 1079,1082 **** --- 1104,1118 ---- int GC_no_dynamic_loading; #endif /* !PCR */ + #endif /* !DYNAMIC_LOADING */ + + #ifndef HAVE_REGISTER_MAIN_STATIC_DATA + + /* Do we need to separately register the main static data segment? */ + GC_bool GC_register_main_static_data() + { + return TRUE; + } + #endif /* HAVE_REGISTER_MAIN_STATIC_DATA */ + diff -Nrc3pad gcc-3.2.3/boehm-gc/include/Makefile.am gcc-3.3/boehm-gc/include/Makefile.am *** gcc-3.2.3/boehm-gc/include/Makefile.am 2001-09-12 01:57:03.000000000 +0000 --- gcc-3.3/boehm-gc/include/Makefile.am 2002-12-31 17:52:45.000000000 +0000 *************** *** 1,6 **** AUTOMAKE_OPTIONS = foreign ! include_HEADERS = gc.h gc_backptr.h gc_local_alloc.h \ gc_pthread_redirects.h gc_cpp.h --- 1,6 ---- AUTOMAKE_OPTIONS = foreign ! noinst_HEADERS = gc.h gc_backptr.h gc_local_alloc.h \ gc_pthread_redirects.h gc_cpp.h diff -Nrc3pad gcc-3.2.3/boehm-gc/include/Makefile.in gcc-3.3/boehm-gc/include/Makefile.in *** gcc-3.2.3/boehm-gc/include/Makefile.in 2002-02-12 04:37:56.000000000 +0000 --- gcc-3.3/boehm-gc/include/Makefile.in 2002-12-31 17:52:45.000000000 +0000 *************** target_all = @target_all@ *** 96,106 **** AUTOMAKE_OPTIONS = foreign ! include_HEADERS = gc.h gc_backptr.h gc_local_alloc.h \ gc_pthread_redirects.h gc_cpp.h CONFIG_CLEAN_FILES = ! HEADERS = $(include_HEADERS) DIST_COMMON = Makefile.am Makefile.in --- 96,106 ---- AUTOMAKE_OPTIONS = foreign ! noinst_HEADERS = gc.h gc_backptr.h gc_local_alloc.h \ gc_pthread_redirects.h gc_cpp.h CONFIG_CLEAN_FILES = ! HEADERS = $(noinst_HEADERS) DIST_COMMON = Makefile.am Makefile.in *************** Makefile: $(srcdir)/Makefile.in $(top_b *** 119,139 **** && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(includedir) - @list='$(include_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \ - done - - uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - list='$(include_HEADERS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(includedir)/$$p; \ - done - tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) --- 119,124 ---- *************** install-info: install-info-am *** 191,210 **** install-exec-am: install-exec: install-exec-am ! install-data-am: install-includeHEADERS install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am ! uninstall-am: uninstall-includeHEADERS uninstall: uninstall-am all-am: Makefile $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: - $(mkinstalldirs) $(DESTDIR)$(includedir) mostlyclean-generic: --- 176,194 ---- install-exec-am: install-exec: install-exec-am ! install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am ! uninstall-am: uninstall: uninstall-am all-am: Makefile $(HEADERS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: *************** maintainer-clean-am: maintainer-clean-t *** 236,249 **** maintainer-clean: maintainer-clean-am ! .PHONY: uninstall-includeHEADERS install-includeHEADERS tags \ ! mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ ! distdir info-am info dvi-am dvi check check-am installcheck-am \ ! installcheck install-info-am install-info install-exec-am install-exec \ ! install-data-am install-data install-am install uninstall-am uninstall \ ! all-redirect all-am all installdirs mostlyclean-generic \ ! distclean-generic clean-generic maintainer-clean-generic clean \ ! mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. --- 220,232 ---- maintainer-clean: maintainer-clean-am ! .PHONY: tags mostlyclean-tags distclean-tags clean-tags \ ! maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ ! installcheck-am installcheck install-info-am install-info \ ! install-exec-am install-exec install-data-am install-data install-am \ ! install uninstall-am uninstall all-redirect all-am all installdirs \ ! mostlyclean-generic distclean-generic clean-generic \ ! maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nrc3pad gcc-3.2.3/boehm-gc/include/private/gcconfig.h gcc-3.3/boehm-gc/include/private/gcconfig.h *** gcc-3.2.3/boehm-gc/include/private/gcconfig.h 2002-04-22 06:05:04.000000000 +0000 --- gcc-3.3/boehm-gc/include/private/gcconfig.h 2003-04-10 00:08:01.000000000 +0000 *************** *** 44,50 **** # endif /* Determine the machine type: */ ! # if defined(__XSCALE__) # define ARM32 # if !defined(LINUX) # define NOSYS --- 44,50 ---- # endif /* Determine the machine type: */ ! # if defined(__arm__) || defined(__thumb__) # define ARM32 # if !defined(LINUX) # define NOSYS *************** *** 95,102 **** # if defined(nec_ews) || defined(_nec_ews) # define EWS4800 # endif ! # if !defined(LINUX) && !defined(EWS4800) ! # if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__) # define ULTRIX # else # if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) \ --- 95,102 ---- # if defined(nec_ews) || defined(_nec_ews) # define EWS4800 # endif ! # if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD) ! # if defined(ultrix) || defined(__ultrix) # define ULTRIX # else # if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) \ *************** *** 107,115 **** # endif # endif # endif /* !LINUX */ - # if defined(__NetBSD__) && defined(__MIPSEL__) - # undef ULTRIX - # endif # define mach_type_known # endif # if defined(sequent) && (defined(i386) || defined(__i386__)) --- 107,112 ---- *************** *** 193,198 **** --- 190,199 ---- # define I386 # define mach_type_known # endif + # if defined(LINUX) && defined(__x86_64__) + # define X86_64 + # define mach_type_known + # endif # if defined(LINUX) && (defined(__ia64__) || defined(__ia64)) # define IA64 # define mach_type_known *************** *** 369,375 **** # define mach_type_known # endif # if defined(__s390__) && defined(LINUX) ! # define S370 # define mach_type_known # endif # if defined(__GNU__) --- 370,376 ---- # define mach_type_known # endif # if defined(__s390__) && defined(LINUX) ! # define S390 # define mach_type_known # endif # if defined(__GNU__) *************** *** 418,424 **** /* (CX_UX and DGUX) */ /* S370 ==> 370-like machine */ /* running Amdahl UTS4 */ ! /* or a 390 running LINUX */ /* ARM32 ==> Intel StrongARM */ /* IA64 ==> Intel IPF */ /* (e.g. Itanium) */ --- 419,426 ---- /* (CX_UX and DGUX) */ /* S370 ==> 370-like machine */ /* running Amdahl UTS4 */ ! /* S390 ==> 390-like machine */ ! /* running LINUX */ /* ARM32 ==> Intel StrongARM */ /* IA64 ==> Intel IPF */ /* (e.g. Itanium) */ *************** *** 427,432 **** --- 429,435 ---- /* (HPUX) */ /* SH ==> Hitachi SuperH */ /* (LINUX & MSWINCE) */ + /* X86_64 ==> AMD x86-64 */ /* *************** *** 666,675 **** # define ALIGNMENT 4 /* Guess. Can someone verify? */ /* This was 2, but that didn't sound right. */ # define OS_TYPE "LINUX" - # define HEURISTIC1 # define DYNAMIC_LOADING ! # undef STACK_GRAN ! # define STACK_GRAN 0x10000000 /* Stack usually starts at 0x80000000 */ # define LINUX_DATA_START extern int _end[]; --- 669,676 ---- # define ALIGNMENT 4 /* Guess. Can someone verify? */ /* This was 2, but that didn't sound right. */ # define OS_TYPE "LINUX" # define DYNAMIC_LOADING ! # define LINUX_STACKBOTTOM /* Stack usually starts at 0x80000000 */ # define LINUX_DATA_START extern int _end[]; *************** *** 682,688 **** # define DATASTART ((ptr_t) get_etext()) # define STACKBOTTOM ((ptr_t) 0xc0000000) # define DATAEND /* not needed */ ! # define MPROTECT_VDB # include # define GETPAGESIZE() getpagesize() # endif --- 683,689 ---- # define DATASTART ((ptr_t) get_etext()) # define STACKBOTTOM ((ptr_t) 0xc0000000) # define DATAEND /* not needed */ ! # undef MPROTECT_VDB # include # define GETPAGESIZE() getpagesize() # endif *************** *** 819,830 **** # define DATAEND (_end) # define SVR4 # ifdef __arch64__ - # define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, _etext) /* libc_stack_end is not set reliably for sparc64 */ # define STACKBOTTOM ((ptr_t) 0x80000000000) # else - # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext) # define LINUX_STACKBOTTOM # endif # endif # ifdef OPENBSD --- 820,831 ---- # define DATAEND (_end) # define SVR4 # ifdef __arch64__ /* libc_stack_end is not set reliably for sparc64 */ # define STACKBOTTOM ((ptr_t) 0x80000000000) + # define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, _etext) # else # define LINUX_STACKBOTTOM + # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext) # endif # endif # ifdef OPENBSD *************** *** 1141,1155 **** /* This was developed for a linuxce style platform. Probably */ /* needs to be tweaked for workstation class machines. */ # define OS_TYPE "LINUX" extern int __data_start[]; # define DATASTART ((ptr_t)(__data_start)) # define ALIGNMENT 4 # define USE_GENERIC_PUSH_REGS ! # define STACKBOTTOM ((ptr_t)0x7fff8000) ! /* Older toolchains may need 0x80000000. */ ! /* In many cases, this should probably use LINUX_STACKBOTTOM */ ! /* instead. But some kernel versions seem to give the wrong */ ! /* value from /proc. */ # endif /* Linux */ # ifdef EWS4800 # define HEURISTIC2 --- 1142,1155 ---- /* This was developed for a linuxce style platform. Probably */ /* needs to be tweaked for workstation class machines. */ # define OS_TYPE "LINUX" + # define DYNAMIC_LOADING + extern int _end[]; + # define DATAEND (_end) extern int __data_start[]; # define DATASTART ((ptr_t)(__data_start)) # define ALIGNMENT 4 # define USE_GENERIC_PUSH_REGS ! # define LINUX_STACKBOTTOM # endif /* Linux */ # ifdef EWS4800 # define HEURISTIC2 *************** *** 1222,1242 **** # define DATAEND /* not needed */ # endif # if defined(NETBSD) - /* This also checked for __MIPSEL__ . Why? NETBSD recognition */ - /* should be handled at the top of the file. */ - # define ALIGNMENT 4 # define OS_TYPE "NETBSD" # define HEURISTIC2 # define USE_GENERIC_PUSH_REGS ! # ifdef __ELF__ ! extern int etext[]; ! # define DATASTART GC_data_start ! # define NEED_FIND_LIMIT ! # define DYNAMIC_LOADING ! # else ! # define DATASTART ((ptr_t) 0x10000000) ! # define STACKBOTTOM ((ptr_t) 0x7ffff000) ! # endif /* _ELF_ */ # endif # endif --- 1222,1236 ---- # define DATAEND /* not needed */ # endif # if defined(NETBSD) # define OS_TYPE "NETBSD" + # define ALIGNMENT 4 # define HEURISTIC2 # define USE_GENERIC_PUSH_REGS ! extern int _fdata[]; ! # define DATASTART ((ptr_t)(_fdata)) ! extern int _end[]; ! # define DATAEND ((ptr_t)(_end)) ! # define DYNAMIC_LOADING # endif # endif *************** *** 1528,1539 **** # define DATAEND (_end) # define HEURISTIC2 # endif # ifdef LINUX # define OS_TYPE "LINUX" ! # define HEURISTIC1 # define DYNAMIC_LOADING extern int __data_start[]; # define DATASTART ((ptr_t)(__data_start)) # endif # endif --- 1522,1550 ---- # define DATAEND (_end) # define HEURISTIC2 # endif + # endif + + # ifdef S390 + # define MACH_TYPE "S390" + # define USE_GENERIC_PUSH_REGS + # ifndef __s390x__ + # define ALIGNMENT 4 + # define CPP_WORDSZ 32 + # else + # define ALIGNMENT 8 + # define CPP_WORDSZ 64 + # define HBLKSIZE 4096 + # endif # ifdef LINUX # define OS_TYPE "LINUX" ! # define LINUX_STACKBOTTOM # define DYNAMIC_LOADING extern int __data_start[]; # define DATASTART ((ptr_t)(__data_start)) + extern int _end[]; + # define DATAEND (_end) + # define CACHE_LINE_SIZE 256 + # define GETPAGESIZE() 4096 # endif # endif *************** *** 1625,1630 **** --- 1636,1679 ---- # define DATAEND /* not needed */ # endif + # ifdef X86_64 + # define MACH_TYPE "X86_64" + # define ALIGNMENT 8 + # define CPP_WORDSZ 64 + # define HBLKSIZE 4096 + # define CACHE_LINE_SIZE 64 + # define USE_GENERIC_PUSH_REGS + # ifdef LINUX + # define OS_TYPE "LINUX" + # define LINUX_STACKBOTTOM + # if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC) + # define MPROTECT_VDB + # else + /* We seem to get random errors in incremental mode, */ + /* possibly because Linux threads is itself a malloc client */ + /* and can't deal with the signals. */ + # endif + # ifdef __ELF__ + # define DYNAMIC_LOADING + # ifdef UNDEFINED /* includes ro data */ + extern int _etext[]; + # define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff)) + # endif + # include + # define LINUX_DATA_START + extern int _end[]; + # define DATAEND (_end) + # else + extern int etext[]; + # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff)) + # endif + # define PREFETCH(x) \ + __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x))) + # define PREFETCH_FOR_WRITE(x) \ + __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x))) + # endif + # endif + #ifdef LINUX_DATA_START /* Some Linux distributions arrange to define __data_start. Some */ /* define data_start as a weak symbol. The latter is technically */ *************** *** 1750,1755 **** --- 1799,1817 ---- # define CACHE_LINE_SIZE 32 /* Wild guess */ # endif + # ifdef LINUX + # define REGISTER_LIBRARIES_EARLY + /* We sometimes use dl_iterate_phdr, which may acquire an internal */ + /* lock. This isn't safe after the world has stopped. So we must */ + /* call GC_register_dynamic_libraries before stopping the world. */ + /* For performance reasons, this may be beneficial on other */ + /* platforms as well, though it should be avoided in win32. */ + # endif /* LINUX */ + + # if defined(SEARCH_FOR_DATA_START) && defined(GC_PRIVATE_H) + extern ptr_t GC_data_start; + # endif + # ifndef CLEAR_DOUBLE # define CLEAR_DOUBLE(x) \ ((word*)x)[0] = 0; \ *************** *** 1818,1824 **** # define CAN_SAVE_CALL_STACKS # define CAN_SAVE_CALL_ARGS #endif ! #if defined(I386) && defined(LINUX) /* SAVE_CALL_CHAIN is supported if the code is compiled to save */ /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */ # define CAN_SAVE_CALL_STACKS --- 1880,1886 ---- # define CAN_SAVE_CALL_STACKS # define CAN_SAVE_CALL_ARGS #endif ! #if (defined(I386) || defined(X86_64)) && defined(LINUX) /* SAVE_CALL_CHAIN is supported if the code is compiled to save */ /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */ # define CAN_SAVE_CALL_STACKS diff -Nrc3pad gcc-3.2.3/boehm-gc/include/private/gc_locks.h gcc-3.3/boehm-gc/include/private/gc_locks.h *** gcc-3.2.3/boehm-gc/include/private/gc_locks.h 2001-10-16 09:01:39.000000000 +0000 --- gcc-3.3/boehm-gc/include/private/gc_locks.h 2002-09-27 20:40:06.000000000 +0000 *************** *** 209,214 **** --- 209,227 ---- } # define GC_TEST_AND_SET_DEFINED # endif /* ARM32 */ + # ifdef S390 + inline static int GC_test_and_set(volatile unsigned int *addr) { + int ret; + __asm__ __volatile__ ( + " l %0,0(%2)\n" + "0: cs %0,%1,0(%2)\n" + " jl 0b" + : "=&d" (ret) + : "d" (1), "a" (addr) + : "cc", "memory"); + return ret; + } + # endif # endif /* __GNUC__ */ # if (defined(ALPHA) && !defined(__GNUC__)) # define GC_test_and_set(addr) __cxx_test_and_set_atomic(addr, 1) *************** *** 219,229 **** # define GC_TEST_AND_SET_DEFINED # endif # ifdef MIPS ! # if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) \ || !defined(_COMPILER_VERSION) || _COMPILER_VERSION < 700 ! # define GC_test_and_set(addr, v) test_and_set(addr,v) # else ! # define GC_test_and_set(addr, v) __test_and_set(addr,v) # define GC_clear(addr) __lock_release(addr); # define GC_CLEAR_DEFINED # endif --- 232,246 ---- # define GC_TEST_AND_SET_DEFINED # endif # ifdef MIPS ! # ifdef LINUX ! # include ! # define GC_test_and_set(addr) _test_and_set((int *) addr,1) ! # define GC_TEST_AND_SET_DEFINED ! # elif __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) \ || !defined(_COMPILER_VERSION) || _COMPILER_VERSION < 700 ! # define GC_test_and_set(addr) test_and_set(addr, 1) # else ! # define GC_test_and_set(addr) __test_and_set(addr,1) # define GC_clear(addr) __lock_release(addr); # define GC_CLEAR_DEFINED # endif *************** *** 326,331 **** --- 343,369 ---- } # endif /* 0 */ # endif /* IA64 */ + # if defined(S390) + # if !defined(GENERIC_COMPARE_AND_SWAP) + inline static GC_bool GC_compare_and_exchange(volatile C_word *addr, + GC_word old, GC_word new_val) + { + int retval; + __asm__ __volatile__ ( + # ifndef __s390x__ + " cs %1,%2,0(%3)\n" + # else + " csg %1,%2,0(%3)\n" + # endif + " ipm %0\n" + " srl %0,28\n" + : "=&d" (retval), "+d" (old) + : "d" (new_val), "a" (addr) + : "cc", "memory"); + return retval == 0; + } + # endif + # endif # if !defined(GENERIC_COMPARE_AND_SWAP) /* Returns the original value of *addr. */ inline static GC_word GC_atomic_add(volatile GC_word *addr, *************** *** 431,437 **** # define NO_THREAD (pthread_t)(-1) # define UNSET_LOCK_HOLDER() GC_lock_holder = NO_THREAD # define I_HOLD_LOCK() (pthread_equal(GC_lock_holder, pthread_self())) ! # define LOCK() { if (GC_test_and_set(&GC_allocate_lock, 1)) GC_lock(); } # define UNLOCK() GC_clear(&GC_allocate_lock); extern VOLATILE GC_bool GC_collecting; # define ENTER_GC() \ --- 469,475 ---- # define NO_THREAD (pthread_t)(-1) # define UNSET_LOCK_HOLDER() GC_lock_holder = NO_THREAD # define I_HOLD_LOCK() (pthread_equal(GC_lock_holder, pthread_self())) ! # define LOCK() { if (GC_test_and_set(&GC_allocate_lock)) GC_lock(); } # define UNLOCK() GC_clear(&GC_allocate_lock); extern VOLATILE GC_bool GC_collecting; # define ENTER_GC() \ diff -Nrc3pad gcc-3.2.3/boehm-gc/include/private/gc_priv.h gcc-3.3/boehm-gc/include/private/gc_priv.h *** gcc-3.2.3/boehm-gc/include/private/gc_priv.h 2002-04-09 00:03:24.000000000 +0000 --- gcc-3.3/boehm-gc/include/private/gc_priv.h 2003-03-04 17:56:49.000000000 +0000 *************** *** 44,53 **** # include "../gc_mark.h" # endif - # ifndef GCCONFIG_H - # include "gcconfig.h" - # endif - typedef GC_word word; typedef GC_signed_word signed_word; --- 44,49 ---- *************** typedef char * ptr_t; /* A generic point *** 60,65 **** --- 56,65 ---- /* Preferably identical to caddr_t, if it */ /* exists. */ + # ifndef GCCONFIG_H + # include "gcconfig.h" + # endif + # ifndef HEADERS_H # include "gc_hdrs.h" # endif *************** GC_bool GC_is_tmp_root GC_PROTO((ptr_t p *** 1462,1467 **** --- 1462,1472 ---- # endif void GC_register_dynamic_libraries GC_PROTO((void)); /* Add dynamic library data sections to the root set. */ + + GC_bool GC_register_main_static_data GC_PROTO((void)); + /* We need to register the main data segment. Returns */ + /* TRUE unless this is done implicitly as part of */ + /* dynamic library registration. */ /* Machine dependent startup routines */ ptr_t GC_get_stack_base GC_PROTO((void)); /* Cold end of stack */ *************** void GC_err_puts GC_PROTO((GC_CONST char *** 1916,1922 **** # define SIG_SUSPEND SIGPWR # endif # else /* !GC_LINUX_THREADS */ ! # define SIG_SUSPEND _SIGRTMIN + 6 # endif # endif /* !SIG_SUSPEND */ --- 1921,1931 ---- # define SIG_SUSPEND SIGPWR # endif # else /* !GC_LINUX_THREADS */ ! # if defined(_SIGRTMIN) ! # define SIG_SUSPEND _SIGRTMIN + 6 ! # else ! # define SIG_SUSPEND SIGRTMIN + 6 ! # endif # endif # endif /* !SIG_SUSPEND */ diff -Nrc3pad gcc-3.2.3/boehm-gc/irix_threads.c gcc-3.3/boehm-gc/irix_threads.c *** gcc-3.2.3/boehm-gc/irix_threads.c 2002-02-12 04:37:53.000000000 +0000 --- gcc-3.3/boehm-gc/irix_threads.c 2002-05-19 17:36:14.000000000 +0000 *************** int GC_pthread_detach(pthread_t thread) *** 519,525 **** LOCK(); thread_gc_id = GC_lookup_thread(thread); UNLOCK(); ! result = REAL_FUNC(pthread_detach)(thread); if (result == 0) { LOCK(); thread_gc_id -> flags |= DETACHED; --- 519,525 ---- LOCK(); thread_gc_id = GC_lookup_thread(thread); UNLOCK(); ! result = pthread_detach(thread); if (result == 0) { LOCK(); thread_gc_id -> flags |= DETACHED; *************** GC_pthread_create(pthread_t *new_thread, *** 599,605 **** si -> start_routine = start_routine; si -> arg = arg; LOCK(); ! if (!GC_initialized) GC_init(); if (NULL == attr) { stack = 0; (void) pthread_attr_init(&new_attr); --- 599,605 ---- si -> start_routine = start_routine; si -> arg = arg; LOCK(); ! if (!GC_is_initialized) GC_init(); if (NULL == attr) { stack = 0; (void) pthread_attr_init(&new_attr); *************** VOLATILE GC_bool GC_collecting = 0; *** 655,661 **** #define SLEEP_THRESHOLD 3 unsigned long GC_allocate_lock = 0; ! # define GC_TRY_LOCK() !GC_test_and_set(&GC_allocate_lock,1) # define GC_LOCK_TAKEN GC_allocate_lock void GC_lock() --- 655,661 ---- #define SLEEP_THRESHOLD 3 unsigned long GC_allocate_lock = 0; ! # define GC_TRY_LOCK() !GC_test_and_set(&GC_allocate_lock) # define GC_LOCK_TAKEN GC_allocate_lock void GC_lock() diff -Nrc3pad gcc-3.2.3/boehm-gc/linux_threads.c gcc-3.3/boehm-gc/linux_threads.c *** gcc-3.2.3/boehm-gc/linux_threads.c 2002-03-29 22:33:34.000000000 +0000 --- gcc-3.3/boehm-gc/linux_threads.c 2002-03-29 22:52:12.000000000 +0000 *************** void * GC_start_routine(void * arg) *** 1361,1366 **** --- 1361,1369 ---- GC_printf1("start_routine = 0x%lx\n", start); # endif start_arg = si -> arg; + # ifdef DEBUG_THREADS + GC_printf1("sem_post from 0x%lx\n", my_pthread); + # endif sem_post(&(si -> registered)); /* Last action on si. */ /* OK to deallocate. */ pthread_cleanup_push(GC_thread_exit_proc, 0); *************** WRAP_FUNC(pthread_create)(pthread_t *new *** 1429,1434 **** --- 1432,1441 ---- while (0 != sem_wait(&(si -> registered))) { if (EINTR != errno) ABORT("sem_wait failed"); } + # ifdef DEBUG_THREADS + GC_printf1("sem_wait complete from thread 0x%X\n", + pthread_self()); + # endif sem_destroy(&(si -> registered)); LOCK(); GC_INTERNAL_FREE(si); diff -Nrc3pad gcc-3.2.3/boehm-gc/ltconfig gcc-3.3/boehm-gc/ltconfig *** gcc-3.2.3/boehm-gc/ltconfig 2001-08-17 18:39:16.000000000 +0000 --- gcc-3.3/boehm-gc/ltconfig 2002-11-20 15:59:06.000000000 +0000 *************** os2*) *** 2017,2024 **** osf3* | osf4* | osf5*) version_type=osf need_version=no ! soname_spec='${libname}${release}.so' ! library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' --- 2017,2024 ---- osf3* | osf4* | osf5*) version_type=osf need_version=no ! soname_spec='${libname}${release}.so$major' ! library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' diff -Nrc3pad gcc-3.2.3/boehm-gc/ltmain.sh gcc-3.3/boehm-gc/ltmain.sh *** gcc-3.2.3/boehm-gc/ltmain.sh 2001-08-17 18:39:16.000000000 +0000 --- gcc-3.3/boehm-gc/ltmain.sh 2002-11-20 15:59:07.000000000 +0000 *************** compiler." *** 1715,1721 **** ;; osf) ! major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" --- 1715,1721 ---- ;; osf) ! major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" diff -Nrc3pad gcc-3.2.3/boehm-gc/mach_dep.c gcc-3.3/boehm-gc/mach_dep.c *** gcc-3.2.3/boehm-gc/mach_dep.c 2002-02-12 04:37:53.000000000 +0000 --- gcc-3.3/boehm-gc/mach_dep.c 2002-07-18 20:06:00.000000000 +0000 *************** void GC_push_regs() *** 81,103 **** register long TMP_SP; /* must be bound to r11 */ # endif - # if defined(MIPS) && defined(LINUX) - /* I'm not sure whether this has actually been tested. */ - # define call_push(x) asm("move $4," x ";"); asm("jal GC_push_one") - call_push("$2"); - call_push("$3"); - call_push("$16"); - call_push("$17"); - call_push("$18"); - call_push("$19"); - call_push("$20"); - call_push("$21"); - call_push("$22"); - call_push("$23"); - call_push("$30"); - # undef call_push - # endif /* MIPS && LINUX */ - # ifdef VAX /* VAX - generic code below does not work under 4.2 */ /* r1 through r5 are caller save, and therefore */ --- 81,86 ---- diff -Nrc3pad gcc-3.2.3/boehm-gc/mark_rts.c gcc-3.3/boehm-gc/mark_rts.c *** gcc-3.2.3/boehm-gc/mark_rts.c 2002-02-12 04:37:53.000000000 +0000 --- gcc-3.3/boehm-gc/mark_rts.c 2003-03-04 06:38:29.000000000 +0000 *************** void GC_push_gc_structures GC_PROTO((voi *** 506,511 **** --- 506,522 ---- void GC_mark_thread_local_free_lists(); #endif + void GC_cond_register_dynamic_libraries() + { + # if (defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE) \ + || defined(PCR)) && !defined(SRC_M3) + GC_remove_tmp_roots(); + if (!GC_no_dls) GC_register_dynamic_libraries(); + # else + GC_no_dls = TRUE; + # endif + } + /* * Call the mark routines (GC_tl_push for a single pointer, GC_push_conditional * on groups of pointers) on every top level accessible pointer. *************** void GC_push_roots(all, cold_gc_frame) *** 519,537 **** GC_bool all; ptr_t cold_gc_frame; { ! register int i; /* * Next push static data. This must happen early on, since it's * not robust against mark stack overflow. */ ! /* Reregister dynamic libraries, in case one got added. */ ! # if (defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE) \ ! || defined(PCR)) && !defined(SRC_M3) ! GC_remove_tmp_roots(); ! if (!GC_no_dls) GC_register_dynamic_libraries(); ! # else ! GC_no_dls = TRUE; # endif /* Mark everything in static data areas */ --- 530,549 ---- GC_bool all; ptr_t cold_gc_frame; { ! int i; ! int kind; /* * Next push static data. This must happen early on, since it's * not robust against mark stack overflow. */ ! /* Reregister dynamic libraries, in case one got added. */ ! /* There is some argument for doing this as late as possible, */ ! /* especially on win32, where it can change asynchronously. */ ! /* In those cases, we do it here. But on other platforms, it's */ ! /* not safe with the world stopped, so we do it earlier. */ ! # if !defined(REGISTER_LIBRARIES_EARLY) ! GC_cond_register_dynamic_libraries(); # endif /* Mark everything in static data areas */ *************** ptr_t cold_gc_frame; *** 541,546 **** --- 553,570 ---- GC_static_roots[i].r_end, all); } + /* Mark all free list header blocks, if those were allocated from */ + /* the garbage collected heap. This makes sure they don't */ + /* disappear if we are not marking from static data. It also */ + /* saves us the trouble of scanning them, and possibly that of */ + /* marking the freelists. */ + for (kind = 0; kind < GC_n_kinds; kind++) { + GC_PTR base = GC_base(GC_obj_kinds[kind].ok_freelist); + if (0 != base) { + GC_set_mark_bit(base); + } + } + /* Mark from GC internal roots if those might otherwise have */ /* been excluded. */ if (GC_no_dls || roots_were_cleared) { diff -Nrc3pad gcc-3.2.3/boehm-gc/misc.c gcc-3.3/boehm-gc/misc.c *** gcc-3.2.3/boehm-gc/misc.c 2002-04-09 00:03:24.000000000 +0000 --- gcc-3.3/boehm-gc/misc.c 2003-03-04 06:38:30.000000000 +0000 *************** *** 75,80 **** --- 75,88 ---- #undef STACKBASE #endif + /* Dont unnecessarily call GC_register_main_static_data() in case */ + /* dyn_load.c isn't linked in. */ + #ifdef DYNAMIC_LOADING + # define GC_REGISTER_MAIN_STATIC_DATA() GC_register_main_static_data() + #else + # define GC_REGISTER_MAIN_STATIC_DATA() TRUE + #endif + GC_FAR struct _GC_arrays GC_arrays /* = { 0 } */; *************** void GC_init_inner() *** 619,625 **** /* Add initial guess of root sets. Do this first, since sbrk(0) */ /* might be used. */ ! GC_register_data_segments(); GC_init_headers(); GC_bl_init(); GC_mark_init(); --- 627,633 ---- /* Add initial guess of root sets. Do this first, since sbrk(0) */ /* might be used. */ ! if (GC_REGISTER_MAIN_STATIC_DATA()) GC_register_data_segments(); GC_init_headers(); GC_bl_init(); GC_mark_init(); diff -Nrc3pad gcc-3.2.3/boehm-gc/os_dep.c gcc-3.3/boehm-gc/os_dep.c *** gcc-3.2.3/boehm-gc/os_dep.c 2002-04-10 01:18:07.000000000 +0000 --- gcc-3.3/boehm-gc/os_dep.c 2002-07-19 08:54:43.000000000 +0000 *************** SIG_PF GC_old_segv_handler; /* Also old *** 2174,2180 **** char * addr = (char *) (scp -> si_addr); # endif # ifdef LINUX ! # ifdef I386 char * addr = (char *) (sc.cr2); # else # if defined(M68K) --- 2174,2180 ---- char * addr = (char *) (scp -> si_addr); # endif # ifdef LINUX ! # if defined(I386) || defined (X86_64) char * addr = (char *) (sc.cr2); # else # if defined(M68K) diff -Nrc3pad gcc-3.2.3/boehm-gc/win32_threads.c gcc-3.3/boehm-gc/win32_threads.c *** gcc-3.2.3/boehm-gc/win32_threads.c 2002-09-24 00:59:04.000000000 +0000 --- gcc-3.3/boehm-gc/win32_threads.c 2003-04-28 20:55:07.000000000 +0000 *************** DWORD WINAPI main_thread_start(LPVOID ar *** 527,532 **** --- 527,534 ---- LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info); + #ifdef GC_DLL + /* * This isn't generally safe, since DllMain is not premptible. * If another thread holds the lock while this runs we're in trouble. *************** BOOL WINAPI DllMain(HINSTANCE inst, ULON *** 635,640 **** --- 637,644 ---- return TRUE; } + # endif /* GC_DLL */ + # endif /* !MSWINCE */ #endif /* GC_WIN32_THREADS */ diff -Nrc3pad gcc-3.2.3/fastjar/acinclude.m4 gcc-3.3/fastjar/acinclude.m4 *** gcc-3.2.3/fastjar/acinclude.m4 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/fastjar/acinclude.m4 2002-09-09 21:19:16.000000000 +0000 *************** *** 0 **** --- 1,133 ---- + + dnl Host type sizes probe. + dnl By Kaveh R. Ghazi. One typo fixed since. + dnl + AC_DEFUN([gcc_AC_COMPILE_CHECK_SIZEOF], + [changequote(<<, >>)dnl + dnl The name to #define. + define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl + dnl The cache variable name. + define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl + changequote([, ])dnl + AC_MSG_CHECKING(size of $1) + AC_CACHE_VAL(AC_CV_NAME, + [for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence. + AC_TRY_COMPILE([#include "confdefs.h" + #include + $2 + ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) + if test x$AC_CV_NAME != x ; then break; fi + done + ]) + if test x$AC_CV_NAME = x ; then + AC_MSG_ERROR([cannot determine a size for $1]) + fi + AC_MSG_RESULT($AC_CV_NAME) + AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) + undefine([AC_TYPE_NAME])dnl + undefine([AC_CV_NAME])dnl + ]) + + dnl Utility macro used by next two tests. + dnl AC_EXAMINE_OBJECT(C source code, + dnl commands examining object file, + dnl [commands to run if compile failed]): + dnl + dnl Compile the source code to an object file; then convert it into a + dnl printable representation. All unprintable characters and + dnl asterisks (*) are replaced by dots (.). All white space is + dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the + dnl output, but runs of newlines are compressed to a single newline. + dnl Finally, line breaks are forcibly inserted so that no line is + dnl longer than 80 columns and the file ends with a newline. The + dnl result of all this processing is in the file conftest.dmp, which + dnl may be examined by the commands in the second argument. + dnl + AC_DEFUN([gcc_AC_EXAMINE_OBJECT], + [AC_LANG_SAVE + AC_LANG_C + dnl Next bit cribbed from AC_TRY_COMPILE. + cat > conftest.$ac_ext < conftest.dmp + $2 + ifelse($3, , , else + $3 + )dnl + fi + rm -rf conftest* + AC_LANG_RESTORE]) + + dnl Host endianness probe. + dnl Differs from AC_C_BIGENDIAN in that it does not require + dnl running a program on the host. + dnl + AC_DEFUN([fastjar_AC_COMPILE_C_BIGENDIAN], + [AC_CACHE_CHECK(byte ordering, ac_cv_c_compile_endian, + [ac_cv_c_compile_endian=unknown + gcc_AC_EXAMINE_OBJECT([ + #ifdef HAVE_LIMITS_H + # include + #endif + /* This structure must have no internal padding. */ + struct { + char prefix[sizeof "\nendian:" - 1]; + short word; + char postfix[2]; + } tester = { + "\nendian:", + #if SIZEOF_SHORT == 4 + ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) | + #endif + ('A' << CHAR_BIT) | 'B', + 'X', '\n' + };], + [if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then + ac_cv_c_compile_endian=big-endian + elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then + ac_cv_c_compile_endian=little-endian + fi]) + ]) + if test $ac_cv_c_compile_endian = unknown; then + AC_MSG_ERROR([*** unable to determine endianness]) + elif test $ac_cv_c_compile_endian = big-endian; then + AC_DEFINE(WORDS_BIG_ENDIAN, 1, + [Define if the host machine stores words of multi-word integers in + big-endian order.]) + fi + ]) + + dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead + dnl of the usual 2. + AC_DEFUN(gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG, + [AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg, + [AC_TRY_COMPILE([ + #include + #ifdef HAVE_SYS_STAT_H + # include + #endif + #ifdef HAVE_UNISTD_H + # include + #endif + #ifdef HAVE_DIRECT_H + # include + #endif], [mkdir ("foo", 0);], + gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)]) + if test $gcc_cv_mkdir_takes_one_arg = yes ; then + AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a + single argument.]) + fi + ]) diff -Nrc3pad gcc-3.2.3/fastjar/aclocal.m4 gcc-3.3/fastjar/aclocal.m4 *** gcc-3.2.3/fastjar/aclocal.m4 2002-01-09 23:22:20.000000000 +0000 --- gcc-3.3/fastjar/aclocal.m4 2003-05-14 00:18:14.000000000 +0000 *************** dnl but WITHOUT ANY WARRANTY, to the ext *** 10,15 **** --- 10,149 ---- dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. + + dnl Host type sizes probe. + dnl By Kaveh R. Ghazi. One typo fixed since. + dnl + AC_DEFUN([gcc_AC_COMPILE_CHECK_SIZEOF], + [changequote(<<, >>)dnl + dnl The name to #define. + define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl + dnl The cache variable name. + define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl + changequote([, ])dnl + AC_MSG_CHECKING(size of $1) + AC_CACHE_VAL(AC_CV_NAME, + [for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence. + AC_TRY_COMPILE([#include "confdefs.h" + #include + $2 + ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) + if test x$AC_CV_NAME != x ; then break; fi + done + ]) + if test x$AC_CV_NAME = x ; then + AC_MSG_ERROR([cannot determine a size for $1]) + fi + AC_MSG_RESULT($AC_CV_NAME) + AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) + undefine([AC_TYPE_NAME])dnl + undefine([AC_CV_NAME])dnl + ]) + + dnl Utility macro used by next two tests. + dnl AC_EXAMINE_OBJECT(C source code, + dnl commands examining object file, + dnl [commands to run if compile failed]): + dnl + dnl Compile the source code to an object file; then convert it into a + dnl printable representation. All unprintable characters and + dnl asterisks (*) are replaced by dots (.). All white space is + dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the + dnl output, but runs of newlines are compressed to a single newline. + dnl Finally, line breaks are forcibly inserted so that no line is + dnl longer than 80 columns and the file ends with a newline. The + dnl result of all this processing is in the file conftest.dmp, which + dnl may be examined by the commands in the second argument. + dnl + AC_DEFUN([gcc_AC_EXAMINE_OBJECT], + [AC_LANG_SAVE + AC_LANG_C + dnl Next bit cribbed from AC_TRY_COMPILE. + cat > conftest.$ac_ext < conftest.dmp + $2 + ifelse($3, , , else + $3 + )dnl + fi + rm -rf conftest* + AC_LANG_RESTORE]) + + dnl Host endianness probe. + dnl Differs from AC_C_BIGENDIAN in that it does not require + dnl running a program on the host. + dnl + AC_DEFUN([fastjar_AC_COMPILE_C_BIGENDIAN], + [AC_CACHE_CHECK(byte ordering, ac_cv_c_compile_endian, + [ac_cv_c_compile_endian=unknown + gcc_AC_EXAMINE_OBJECT([ + #ifdef HAVE_LIMITS_H + # include + #endif + /* This structure must have no internal padding. */ + struct { + char prefix[sizeof "\nendian:" - 1]; + short word; + char postfix[2]; + } tester = { + "\nendian:", + #if SIZEOF_SHORT == 4 + ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) | + #endif + ('A' << CHAR_BIT) | 'B', + 'X', '\n' + };], + [if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then + ac_cv_c_compile_endian=big-endian + elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then + ac_cv_c_compile_endian=little-endian + fi]) + ]) + if test $ac_cv_c_compile_endian = unknown; then + AC_MSG_ERROR([*** unable to determine endianness]) + elif test $ac_cv_c_compile_endian = big-endian; then + AC_DEFINE(WORDS_BIG_ENDIAN, 1, + [Define if the host machine stores words of multi-word integers in + big-endian order.]) + fi + ]) + + dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead + dnl of the usual 2. + AC_DEFUN(gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG, + [AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg, + [AC_TRY_COMPILE([ + #include + #ifdef HAVE_SYS_STAT_H + # include + #endif + #ifdef HAVE_UNISTD_H + # include + #endif + #ifdef HAVE_DIRECT_H + # include + #endif], [mkdir ("foo", 0);], + gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)]) + if test $gcc_cv_mkdir_takes_one_arg = yes ; then + AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a + single argument.]) + fi + ]) + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. diff -Nrc3pad gcc-3.2.3/fastjar/ChangeLog gcc-3.3/fastjar/ChangeLog *** gcc-3.2.3/fastjar/ChangeLog 2003-04-22 06:14:21.000000000 +0000 --- gcc-3.3/fastjar/ChangeLog 2003-05-14 00:09:11.000000000 +0000 *************** *** 1,22 **** ! 2003-04-22 Release Manager ! * GCC 3.2.3 Released. ! 2003-02-05 Release Manager ! * GCC 3.2.2 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-18 Release Manager ! * GCC 3.2.1 Released. 2002-11-11 Tom Tromey --- 1,65 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-03-30 Joseph S. Myers ! * fastjar.texi: Remove @ at start of file. ! ! 2003-03-10 Mohan Embar ! ! * dostime.c: add #include for definition of NULL ! ! 2003-02-04 Joseph S. Myers ! ! * fastjar.texi: Update to GFDL 1.2. ! ! 2003-01-31 Daiki Ueno ! ! * jartool.c (extract_jar): Don't lseek to skip extra fields. ! (consume): If the stream is seekable, do lseek. ! ! 2003-01-28 Ranjit Mathew ! ! * jargrep.c: Include xregex.h from libiberty instead of ! system regex.h for better portability. ! ! 2003-01-21 Ranjit Mathew ! ! * jartool.c (list_jar): Terminate the 'ascii_date' buffer ! with a '\0' to guard against the case where the formatted ! time string is more than the size allowed by the buffer. ! ! 2002-12-30 DJ Delorie ! ! * Makefile.am (jar.1, grepjar.1): Protect against ! texi2pod/pod2man failing. ! * Makefile.in: Regenerated. ! ! 2002-12-23 Joseph S. Myers ! ! * fastjar.texi: Include Cover Texts in man page. ! ! 2002-12-04 Jakub Jelinek ! ! * fastjar.texi (jar @direntry, grepjar @direntry): Add (fastjar). ! ! 2002-11-21 Ranjit Mathew ! ! * jartool.c (extract_jar): Use "open" with O_BINARY instead of ! "creat" to create extracted files. 2002-11-11 Tom Tromey *************** *** 25,50 **** (unix2dostime): Handle years before 1980. Correctly compute month and day of month. 2002-11-07 Tom Tromey * dostime.c: Rewrote from scratch. * dostime.h (dostime): Removed. ! 2002-08-14 Release Manager ! * GCC 3.2 Released. ! 2002-07-25 Release Manager ! * GCC 3.1.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. 2002-03-18 Bryce McKinlay --- 68,145 ---- (unix2dostime): Handle years before 1980. Correctly compute month and day of month. + 2002-11-10 Jakub Jelinek + + * jartool.c (add_to_jar): Only compare file to jarfile if jarfile is + non-NULL. + + * configure.in (AC_CHECK_HEADERS): Add limits.h. + * configure, config.h.in: Rebuilt. + 2002-11-07 Tom Tromey * dostime.c: Rewrote from scratch. * dostime.h (dostime): Removed. ! 2002-10-20 Tom Tromey ! * jartool.c: Use mode 0666 when opening new file. ! 2002-10-15 Ranjit Mathew ! * configure, config.h.in: Rebuilt. ! * configure.in: Call gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG. ! 2002-09-11 Tom Tromey ! * Makefile.in: Rebuilt. ! * Makefile.am (TEXINFO_TEX): New macro. ! (info_TEXINFOS): Likewise. ! (fastjar_TEXINFOS): Likewise. ! (man_MANS): Likewise. ! (EXTRA_DIST): Likewise. ! (my_makei_flags): Likewise. ! (fastjar.info): New rule. ! (fastjar_TEXINFOS): Don't mention `$(srcdir)'. ! (TEXINFO_TEX): Likewise. ! (AUTOMAKE_OPTIONS): Added `cygnus'. ! 2002-09-11 Matthias Klose ! * Makefile.am: Revert the previous patch. ! * Makefile.in: Regenerated. ! ! 2002-09-10 Matthias Klose ! ! * fastjar.texi: New. ! * Makefile.am: Support building info docs and manpages. ! * Makefile.in: Regenerated. ! * configure.in: Set gcc_version. ! * configure: Regenerated. ! * jargrep.c: Update usage and help strings. ! ! 2002-09-09 Tom Tromey ! ! * jartool.c (mkdir): Define. ! * config.h.in: Rebuilt. ! * aclocal.m4, configure: Rebuilt. ! * acinclude.m4: New file. Copied gcc_AC_COMPILE_CHECK_SIZEOF, ! gcc_AC_EXAMINE_OBJECT, and fastjar_AC_COMPILE_C_BIGENDIAN from ! aclocal.m4. ! ! 2002-09-04 Tom Tromey ! ! From greenrd@hotmail.com: ! * jartool.c (list_jar): Correctly determine when new `filename' ! buffer must be allocated. Fixes PR java/7830. ! ! 2002-06-03 Geoffrey Keating ! ! * configure.in: Support cross-compiling. ! * configure: Regenerate. ! * aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF): New. ! (gcc_AC_EXAMINE_OBJECT): New. ! (fastjar_AC_COMPILE_C_BIGENDIAN): New. 2002-03-18 Bryce McKinlay diff -Nrc3pad gcc-3.2.3/fastjar/config.h.in gcc-3.3/fastjar/config.h.in *** gcc-3.2.3/fastjar/config.h.in 2002-01-09 23:22:20.000000000 +0000 --- gcc-3.3/fastjar/config.h.in 2002-11-10 21:04:24.000000000 +0000 *************** *** 9,33 **** /* Define if your declares struct tm. */ #undef TM_IN_SYS_TIME - /* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ - #undef WORDS_BIGENDIAN - - /* The number of bytes in a char. */ - #undef SIZEOF_CHAR - - /* The number of bytes in a int. */ - #undef SIZEOF_INT - - /* The number of bytes in a long. */ - #undef SIZEOF_LONG - - /* The number of bytes in a long long. */ - #undef SIZEOF_LONG_LONG - - /* The number of bytes in a short. */ - #undef SIZEOF_SHORT - /* Define if you have the header file. */ #undef HAVE_DIRENT_H --- 9,14 ---- *************** *** 40,45 **** --- 21,29 ---- /* Define if you have the header file. */ #undef HAVE_STDLIB_H + /* Define if you have the header file. */ + #undef HAVE_LIMITS_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H *************** *** 58,60 **** --- 42,67 ---- /* Version number of package */ #undef VERSION + /* Define if host mkdir takes a + single argument. */ + #undef MKDIR_TAKES_ONE_ARG + + /* The number of bytes in type char */ + #undef SIZEOF_CHAR + + /* The number of bytes in type short */ + #undef SIZEOF_SHORT + + /* The number of bytes in type int */ + #undef SIZEOF_INT + + /* The number of bytes in type long */ + #undef SIZEOF_LONG + + /* The number of bytes in type long long */ + #undef SIZEOF_LONG_LONG + + /* Define if the host machine stores words of multi-word integers in + big-endian order. */ + #undef WORDS_BIG_ENDIAN + diff -Nrc3pad gcc-3.2.3/fastjar/configure gcc-3.3/fastjar/configure *** gcc-3.2.3/fastjar/configure 2002-01-09 23:22:20.000000000 +0000 --- gcc-3.3/fastjar/configure 2003-05-14 00:18:14.000000000 +0000 *************** EOF *** 1691,1697 **** fi ! for ac_hdr in fcntl.h unistd.h sys/param.h stdlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 --- 1691,1697 ---- fi ! for ac_hdr in fcntl.h unistd.h sys/param.h stdlib.h limits.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 *************** EOF *** 1800,1837 **** fi echo $ac_n "checking size of char""... $ac_c" 1>&6 ! echo "configure:1805: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ! else cat > conftest.$ac_ext < ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(char)); ! exit(0); ! } EOF ! if { (eval echo configure:1824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ! then ! ac_cv_sizeof_char=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_char=0 fi ! rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_char" 1>&6 cat >> confdefs.h <&6 + echo "configure:1806: checking if mkdir takes one argument" >&5 + if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #ifdef HAVE_SYS_STAT_H + # include + #endif + #ifdef HAVE_UNISTD_H + # include + #endif + #ifdef HAVE_DIRECT_H + # include + #endif + int main() { + mkdir ("foo", 0); + ; return 0; } + EOF + if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gcc_cv_mkdir_takes_one_arg=no + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gcc_cv_mkdir_takes_one_arg=yes + fi + rm -f conftest* + fi + + echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6 + if test $gcc_cv_mkdir_takes_one_arg = yes ; then + cat >> confdefs.h <<\EOF + #define MKDIR_TAKES_ONE_ARG 1 + EOF + + fi + + echo $ac_n "checking size of char""... $ac_c" 1>&6 ! echo "configure:1850: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < ! ! ! int main() { ! switch (0) case 0: case (sizeof (char) == $ac_size):; ! ; return 0; } EOF ! if { (eval echo configure:1866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_sizeof_char=$ac_size else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi ! rm -f conftest* ! if test x$ac_cv_sizeof_char != x ; then break; fi ! done ! fi + if test x$ac_cv_sizeof_char = x ; then + { echo "configure: error: cannot determine a size for char" 1>&2; exit 1; } fi echo "$ac_t""$ac_cv_sizeof_char" 1>&6 cat >> confdefs.h <&6 ! echo "configure:1844: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ! else cat > conftest.$ac_ext < ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(short)); ! exit(0); ! } EOF ! if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ! then ! ac_cv_sizeof_short=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_short=0 fi ! rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_short" 1>&6 cat >> confdefs.h <&6 ! echo "configure:1889: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < ! ! ! int main() { ! switch (0) case 0: case (sizeof (short) == $ac_size):; ! ; return 0; } EOF ! if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_sizeof_short=$ac_size else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi ! rm -f conftest* ! if test x$ac_cv_sizeof_short != x ; then break; fi ! done ! fi + if test x$ac_cv_sizeof_short = x ; then + { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } fi echo "$ac_t""$ac_cv_sizeof_short" 1>&6 cat >> confdefs.h <&6 ! echo "configure:1883: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ! else cat > conftest.$ac_ext < ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(int)); ! exit(0); ! } EOF ! if { (eval echo configure:1902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ! then ! ac_cv_sizeof_int=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_int=0 fi ! rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_int" 1>&6 cat >> confdefs.h <&6 ! echo "configure:1928: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < ! ! ! int main() { ! switch (0) case 0: case (sizeof (int) == $ac_size):; ! ; return 0; } EOF ! if { (eval echo configure:1944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_sizeof_int=$ac_size else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi ! rm -f conftest* ! if test x$ac_cv_sizeof_int != x ; then break; fi ! done ! fi + if test x$ac_cv_sizeof_int = x ; then + { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } fi echo "$ac_t""$ac_cv_sizeof_int" 1>&6 cat >> confdefs.h <&6 ! echo "configure:1922: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ! else cat > conftest.$ac_ext < ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(long)); ! exit(0); ! } EOF ! if { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ! then ! ac_cv_sizeof_long=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_long=0 fi ! rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_long" 1>&6 cat >> confdefs.h <&6 ! echo "configure:1967: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < ! ! ! int main() { ! switch (0) case 0: case (sizeof (long) == $ac_size):; ! ; return 0; } EOF ! if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_sizeof_long=$ac_size else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi ! rm -f conftest* ! if test x$ac_cv_sizeof_long != x ; then break; fi ! done ! fi + if test x$ac_cv_sizeof_long = x ; then + { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } fi echo "$ac_t""$ac_cv_sizeof_long" 1>&6 cat >> confdefs.h <&6 ! echo "configure:1961: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ! else cat > conftest.$ac_ext < ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(long long)); ! exit(0); ! } EOF ! if { (eval echo configure:1980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ! then ! ac_cv_sizeof_long_long=`cat conftestval` else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_long_long=0 fi ! rm -fr conftest* fi fi echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 cat >> confdefs.h <&6 ! echo "configure:2006: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < ! ! ! int main() { ! switch (0) case 0: case (sizeof (long long) == $ac_size):; ! ; return 0; } EOF ! if { (eval echo configure:2022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_sizeof_long_long=$ac_size else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi ! rm -f conftest* ! if test x$ac_cv_sizeof_long_long != x ; then break; fi ! done ! fi + if test x$ac_cv_sizeof_long_long = x ; then + { echo "configure: error: cannot determine a size for long long" 1>&2; exit 1; } fi echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 cat >> confdefs.h <&6 ! echo "configure:2001: checking whether byte ordering is bigendian" >&5 ! if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! ac_cv_c_bigendian=unknown ! # See if sys/param.h defines the BYTE_ORDER macro. ! cat > conftest.$ac_ext < ! #include ! int main() { - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros - #endif - ; return 0; } - EOF - if { (eval echo configure:2019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < - #include - int main() { ! #if BYTE_ORDER != BIG_ENDIAN ! not big endian #endif ! ; return 0; } ! EOF ! if { (eval echo configure:2034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! rm -rf conftest* ! ac_cv_c_bigendian=yes ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -rf conftest* ! ac_cv_c_bigendian=no ! fi ! rm -f conftest* ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! fi ! rm -f conftest* ! if test $ac_cv_c_bigendian = unknown; then ! if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } ! else ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ! then ! ac_cv_c_bigendian=no ! else ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! rm -fr conftest* ! ac_cv_c_bigendian=yes ! fi ! rm -fr conftest* fi - fi fi ! echo "$ac_t""$ac_cv_c_bigendian" 1>&6 ! if test $ac_cv_c_bigendian = yes; then cat >> confdefs.h <<\EOF ! #define WORDS_BIGENDIAN 1 EOF fi --- 2041,2115 ---- ! echo $ac_n "checking byte ordering""... $ac_c" 1>&6 ! echo "configure:2046: checking byte ordering" >&5 ! if eval "test \"`echo '$''{'ac_cv_c_compile_endian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ! ac_cv_c_compile_endian=unknown ! ! ac_ext=c ! # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ! ac_cpp='$CPP $CPPFLAGS' ! ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ! cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext < #endif ! /* This structure must have no internal padding. */ ! struct { ! char prefix[sizeof "\nendian:" - 1]; ! short word; ! char postfix[2]; ! } tester = { ! "\nendian:", ! #if SIZEOF_SHORT == 4 ! ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) | ! #endif ! ('A' << CHAR_BIT) | 'B', ! 'X', '\n' ! }; EOF ! if { (eval echo configure:2080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! od -c conftest.o | ! sed 's/^[0-7]*[ ]*/ / ! s/\*/./g ! s/ \\n/*/g ! s/ [0-9][0-9][0-9]/./g ! s/ \\[^ ]/./g' | ! tr -d ' ! ' | tr -s '*' ' ! ' | fold | sed '$a\ ! ' > conftest.dmp ! if grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then ! ac_cv_c_compile_endian=big-endian ! elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then ! ac_cv_c_compile_endian=little-endian ! fi fi + rm -rf conftest* + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + fi ! echo "$ac_t""$ac_cv_c_compile_endian" 1>&6 ! if test $ac_cv_c_compile_endian = unknown; then ! { echo "configure: error: *** unable to determine endianness" 1>&2; exit 1; } ! elif test $ac_cv_c_compile_endian = big-endian; then cat >> confdefs.h <<\EOF ! #define WORDS_BIG_ENDIAN 1 EOF fi *************** ZINCS= *** 2100,2106 **** use_zlib=maybe if test "$with_system_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 ! echo "configure:2104: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2128,2134 ---- use_zlib=maybe if test "$with_system_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 ! echo "configure:2132: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 2108,2114 **** ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2147,2153 ---- deflate() ; return 0; } EOF ! if { (eval echo configure:2151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 2154,2159 **** --- 2182,2197 ---- + # Get the version trigger filename from the toplevel + if test "${with_gcc_version_trigger+set}" = set; then + gcc_version_trigger=$with_gcc_version_trigger + else + gcc_version_trigger=${srcdir}/version.c + fi + gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` + gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure *************** s%@CPP@%$CPP%g *** 2312,2317 **** --- 2350,2356 ---- s%@ZLIBS@%$ZLIBS%g s%@ZDEPS@%$ZDEPS%g s%@ZINCS@%$ZINCS%g + s%@gcc_version@%$gcc_version%g CEOF EOF *************** cat >> $CONFIG_STATUS <<\EOF *** 2320,2326 **** # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ! ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. --- 2359,2365 ---- # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ! ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. diff -Nrc3pad gcc-3.2.3/fastjar/configure.in gcc-3.3/fastjar/configure.in *** gcc-3.2.3/fastjar/configure.in 2002-01-09 23:22:20.000000000 +0000 --- gcc-3.3/fastjar/configure.in 2002-11-10 21:04:24.000000000 +0000 *************** dnl Checks for header files. *** 24,44 **** AC_HEADER_DIRENT AC_HEADER_STDC AC_STRUCT_TM ! AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_OFF_T AC_STRUCT_TM dnl Check for type-widths ! AC_CHECK_SIZEOF(char) ! AC_CHECK_SIZEOF(short) ! AC_CHECK_SIZEOF(int) ! AC_CHECK_SIZEOF(long) ! AC_CHECK_SIZEOF(long long) dnl Check byte order ! AC_C_BIGENDIAN AC_ARG_WITH(system-zlib, [ --with-system-zlib use installed libz]) --- 24,47 ---- AC_HEADER_DIRENT AC_HEADER_STDC AC_STRUCT_TM ! AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h stdlib.h limits.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_OFF_T AC_STRUCT_TM + # mkdir takes a single argument on some systems. + gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG + dnl Check for type-widths ! gcc_AC_COMPILE_CHECK_SIZEOF(char) ! gcc_AC_COMPILE_CHECK_SIZEOF(short) ! gcc_AC_COMPILE_CHECK_SIZEOF(int) ! gcc_AC_COMPILE_CHECK_SIZEOF(long) ! gcc_AC_COMPILE_CHECK_SIZEOF(long long) dnl Check byte order ! fastjar_AC_COMPILE_C_BIGENDIAN AC_ARG_WITH(system-zlib, [ --with-system-zlib use installed libz]) *************** AC_SUBST(ZLIBS) *** 63,66 **** --- 66,81 ---- AC_SUBST(ZDEPS) AC_SUBST(ZINCS) + # Get the version trigger filename from the toplevel + if test "${with_gcc_version_trigger+set}" = set; then + gcc_version_trigger=$with_gcc_version_trigger + else + gcc_version_trigger=${srcdir}/version.c + fi + changequote(,)dnl + gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'` + gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` + changequote([,])dnl + AC_SUBST(gcc_version) + AC_OUTPUT(Makefile install-defs.sh) diff -Nrc3pad gcc-3.2.3/fastjar/.cvsignore gcc-3.3/fastjar/.cvsignore *** gcc-3.2.3/fastjar/.cvsignore 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/fastjar/.cvsignore 2002-09-12 00:40:12.000000000 +0000 *************** *** 0 **** --- 1,3 ---- + fastjar.info + grepjar.1 + jar.1 diff -Nrc3pad gcc-3.2.3/fastjar/dostime.c gcc-3.3/fastjar/dostime.c *** gcc-3.2.3/fastjar/dostime.c 2002-11-11 22:22:31.000000000 +0000 --- gcc-3.3/fastjar/dostime.c 2003-03-10 19:53:26.000000000 +0000 *************** *** 21,26 **** --- 21,28 ---- #include + #include + #include "dostime.h" /* diff -Nrc3pad gcc-3.2.3/fastjar/fastjar.info gcc-3.3/fastjar/fastjar.info *** gcc-3.2.3/fastjar/fastjar.info 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/fastjar/fastjar.info 2003-05-14 01:25:14.000000000 +0000 *************** *** 0 **** --- 1,956 ---- + This is fastjar.info, produced by makeinfo version 4.2 from + fastjar.texi. + + INFO-DIR-SECTION Programming + START-INFO-DIR-ENTRY + * fastjar: (fastjar). GNU jar utilities + END-INFO-DIR-ENTRY + + INFO-DIR-SECTION Individual utilities + START-INFO-DIR-ENTRY + * jar: (fastjar)Invoking jar. + An archive tool for Java archives + * grepjar: (fastjar)Invoking grepjar. + Search files in a jar file for a pattern + END-INFO-DIR-ENTRY + + Copyright (C) 2002 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 or + any later version published by the Free Software Foundation; with the + Invariant Sections being "GNU General Public License", the Front-Cover + texts being (a) (see below), and with the Back-Cover Texts being (b) + (see below). A copy of the license is included in the section entitled + "GNU Free Documentation License". + + (a) The FSF's Front-Cover Text is: + + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. + +  + File: fastjar.info, Node: Top, Next: Invoking jar, Up: (dir) + + Introduction + ************ + + This manual describes how to use `jar' and `grepjar'. + + * Menu: + + * Invoking jar:: Options supported by `jar' + * Invoking grepjar:: Options supported by `grepjar' + * Copying:: The GNU General Public License + * GNU Free Documentation License:: + How you can share and copy this manual + +  + File: fastjar.info, Node: Invoking jar, Next: Invoking grepjar, Prev: Top, Up: Top + + Invoking jar + ************ + + `fastjar' is an implementation of Sun's jar utility that comes with + the JDK, written entirely in C, and runs in a fraction of the time while + being feature compatible. + + If any file is a directory then it is processed recursively. The + manifest file name and the archive file name needs to be specified in + the same order the `-m' and `-f' flags are specified. + + Exactly one of the following actions must be specified: + + `-c' + Create new archive. + + `-t' + List table of contents for archive. + + `-x' + Extract named (or all) files from archive. + + `-u' + Update existing archive. This option is disabled due to bugs + (currently fails with exit status 1 and does nothing). + + The following parameters are optional: + + `-@' + Read the names of the files to add to the archive from stdin. This + option is supported only in combination with `-c' or `-u'. Non + standard option added in the GCC version. + + `-C DIRECTORY' + Change to the DIRECTORY and include the following file. + + `-E' + Prevent fastjar from reading the content of a directory when + specifying one (and instead relying on the provided list of files + to populate the archive with regard to the directory entry). Non + standard option added in the GCC version. + + `-M' + Do not create a manifest file for the entries. + + `-0' + Store only; use no ZIP compression. + + `-V' + `--version' + Display version information. + + `-f ARCHIVE' + Specify archive file name. + + `-m MANIFEST' + Include manifest information from specified MANIFEST file. + + `-v' + Generate verbose output on standard output. + + All remaining options are considered to be names of files. + +  + File: fastjar.info, Node: Invoking grepjar, Next: Copying, Prev: Invoking jar, Up: Top + + Invoking grepjar + **************** + + The `grepjar' program can be used to search files in a jar file for + a pattern. + + `-b' + Print byte offset of match. + + `-c' + Print number of matches. + + `-i' + Compare case-insensitively. + + `-n' + Print line number of each match. + + `-s' + Suppress error messages. + + `-w' + Force PATTERN to match only whole words. + + `-e PATTERN' + Use PATTERN as regular expression. + + `--help' + Print help, then exit. + + `-V' + `--version' + Print version number, then exit. + +  + File: fastjar.info, Node: Copying, Next: GNU Free Documentation License, Prev: Invoking grepjar, Up: Top + + GNU GENERAL PUBLIC LICENSE + ************************** + + Version 2, June 1991 + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + ======== + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Library General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it in + new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, + and (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + 0. This License applies to any program or other work which contains a + notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", + below, refers to any such program or work, and a "work based on + the Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a + portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is + included without limitation in the term "modification".) Each + licensee is addressed as "you". + + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running the Program is not restricted, and the output from the + Program is covered only if its contents constitute a work based on + the Program (independent of having been made by running the + Program). Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any + warranty; and give any other recipients of the Program a copy of + this License along with the Program. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange + for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b. You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program + or any part thereof, to be licensed as a whole at no charge + to all third parties under the terms of this License. + + c. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the + program under these conditions, and telling the user how to + view a copy of this License. (Exception: if the Program + itself is interactive but does not normally print such an + announcement, your work based on the Program is not required + to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Program, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not + apply to those sections when you distribute them as separate + works. But when you distribute the same sections as part of a + whole which is a work based on the Program, the distribution of + the whole must be on the terms of this License, whose permissions + for other licensees extend to the entire whole, and thus to each + and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Program. + + In addition, mere aggregation of another work not based on the + Program with the Program (or with a work based on the Program) on + a volume of a storage or distribution medium does not bring the + other work under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms + of Sections 1 and 2 above provided that you also do one of the + following: + + a. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Sections 1 and 2 above on a medium customarily used for + software interchange; or, + + b. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + + c. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with + such an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts + used to control compilation and installation of the executable. + However, as a special exception, the source code distributed need + not include anything that is normally distributed (in either + source or binary form) with the major components (compiler, + kernel, and so on) of the operating system on which the executable + runs, unless that component itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Program (or any work + based on the Program), you indicate your acceptance of this + License to do so, and all its terms and conditions for copying, + distributing or modifying the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program + subject to these terms and conditions. You may not impose any + further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance + by third parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent + issues), conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Program at all. For example, if a patent license would not permit + royalty-free redistribution of the Program by all those who + receive copies directly or indirectly through you, then the only + way you could satisfy both it and this License would be to refrain + entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Program under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only + in or among countries not thus excluded. In such case, this + License incorporates the limitation as if written in the body of + this License. + + 9. The Free Software Foundation may publish revised and/or new + versions of the General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies a version number of this License which applies + to it and "any later version", you have the option of following + the terms and conditions either of that version or of any later + version published by the Free Software Foundation. If the Program + does not specify a version number of this License, you may choose + any version ever published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted + by the Free Software Foundation, write to the Free Software + Foundation; we sometimes make exceptions for this. Our decision + will be guided by the two goals of preserving the free status of + all derivatives of our free software and of promoting the sharing + and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT + HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT + WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE + QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY + SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY + OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + ============================================= + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these + terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Also add information on how to contact you by electronic and paper + mail. + + If the program is interactive, make it output a short notice like + this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details + type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the + appropriate parts of the General Public License. Of course, the + commands you use may be called something other than `show w' and `show + c'; they could even be mouse-clicks or menu items--whatever suits your + program. + + You should also get your employer (if you work as a programmer) or + your school, if any, to sign a "copyright disclaimer" for the program, + if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + SIGNATURE OF TY COON, 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your + program into proprietary programs. If your program is a subroutine + library, you may consider it more useful to permit linking proprietary + applications with the library. If this is what you want to do, use the + GNU Library General Public License instead of this License. + +  + File: fastjar.info, Node: GNU Free Documentation License, Prev: Copying, Up: Top + + GNU Free Documentation License + ****************************** + + Version 1.2, November 2002 + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it + can be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You + accept the license if you copy, modify or distribute the work in a + way requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. If a section does not fit the above definition of + Secondary then it is not allowed to be designated as Invariant. + The Document may contain zero Invariant Sections. If the Document + does not identify any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup, or absence of + markup, has been arranged to thwart or discourage subsequent + modification by readers is not Transparent. An image format is + not Transparent if used for any substantial amount of text. A + copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML, PostScript or PDF designed for + human modification. Examples of transparent image formats include + PNG, XCF and JPG. Opaque formats include proprietary formats that + can be read and edited only by proprietary word processors, SGML or + XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML, PostScript or PDF + produced by some word processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a computer-network location from + which the general network-using public has access to download + using public-standard network protocols a complete Transparent + copy of the Document, free of added material. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of + previous versions (which should, if there were any, be listed + in the History section of the Document). You may use the + same title as a previous version if the original publisher of + that version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on + the Title Page. If there is no section Entitled "History" in + the Document, create one stating the title, year, authors, + and publisher of the Document as given on its Title Page, + then add an item describing the Modified Version as stated in + the previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in + the "History" section. You may omit a network location for a + work that was published at least four years before the + Document itself, or if the original publisher of the version + it refers to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the + section all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section + titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warrany Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + `http://www.gnu.org/copyleft/'. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + + ADDENDUM: How to use this License for your documents + ==================================================== + + To use this License in a document you have written, include a copy of + the License in the document and put the following copyright and license + notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover + Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other + combination of the three, merge those two alternatives to suit the + situation. + + If your document contains nontrivial examples of program code, we + recommend releasing these examples in parallel under your choice of + free software license, such as the GNU General Public License, to + permit their use in free software. + + +  + Tag Table: + Node: Top1236 + Node: Invoking jar1618 + Node: Invoking grepjar3399 + Node: Copying4005 + Node: GNU Free Documentation License23222 +  + End Tag Table diff -Nrc3pad gcc-3.2.3/fastjar/fastjar.texi gcc-3.3/fastjar/fastjar.texi *** gcc-3.2.3/fastjar/fastjar.texi 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/fastjar/fastjar.texi 2003-03-30 17:01:58.000000000 +0000 *************** *** 0 **** --- 1,265 ---- + \input texinfo @c -*-texinfo-*- + @setfilename fastjar.info + @settitle Guide to GNU jar utilites + + @c Note: When reading this manual you'll find lots of strange + @c circumlocutions like ``compiler for the Java language''. + @c This is necessary due to Sun's restrictions on the use of + @c the word ``Java'. + + @c When this manual is copyrighted. + @set copyrights-fastjar 2002 + + @include gcc-common.texi + + @c Versions + @set which-gcj GCC-@value{version-GCC} + + @ifinfo + @format + @dircategory Programming + @direntry + * fastjar: (fastjar). GNU jar utilities + @end direntry + + @dircategory Individual utilities + @direntry + * jar: (fastjar)Invoking jar. + An archive tool for Java archives + * grepjar: (fastjar)Invoking grepjar. + Search files in a jar file for a pattern + @end direntry + @end format + + @c man begin COPYRIGHT + Copyright (C) @value{copyrights-fastjar} Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 or + any later version published by the Free Software Foundation; with the + Invariant Sections being ``GNU General Public License'', the Front-Cover + texts being (a) (see below), and with the Back-Cover Texts being (b) + (see below). A copy of the license is included in the + @c man end + section entitled + ``GNU Free Documentation License''. + @ignore + @c man begin COPYRIGHT + man page gfdl(7). + @c man end + @end ignore + + @c man begin COPYRIGHT + + (a) The FSF's Front-Cover Text is: + + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. + @c man end + @end ifinfo + + @titlepage + @title GNU jar utilites + @author Brian Burns + + @page + @vskip 0pt plus 1filll + Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc. + @sp 2 + For the @value{which-gcj} Version* + @sp 1 + Published by the Free Software Foundation @* + 59 Temple Place - Suite 330@* + Boston, MA 02111-1307, USA@* + @sp 1 + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 or + any later version published by the Free Software Foundation; with the + Invariant Sections being ``GNU General Public License'', the Front-Cover + texts being (a) (see below), and with the Back-Cover Texts being (b) + (see below). A copy of the license is included in the section entitled + ``GNU Free Documentation License''. + + (a) The FSF's Front-Cover Text is: + + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. + @end titlepage + @contents + @page + + + @node Top + @top Introduction + + This manual describes how to use @command{jar} and @command{grepjar}. + + @menu + * Invoking jar:: Options supported by @command{jar} + * Invoking grepjar:: Options supported by @command{grepjar} + * Copying:: The GNU General Public License + * GNU Free Documentation License:: + How you can share and copy this manual + @end menu + + @node Invoking jar + @chapter Invoking jar + + @c man title jar archive tool for Java archives + + @c man begin DESCRIPTION jar + + @code{fastjar} is an implementation of Sun's jar utility that comes with + the JDK, written entirely in C, and runs in a fraction of the time while + being feature compatible. + + If any file is a directory then it is processed recursively. The + manifest file name and the archive file name needs to be specified in + the same order the @option{-m} and @option{-f} flags are specified. + + @c man end + + @ignore + @c man begin SYNOPSIS jar + jar @option{-ctxu} [@option{OPTIONS}] [@var{jar-file}] [@var{manifest-file}] [@option{-C} @var{dir}] @var{files}@dots{} + @c man end + @c man begin SEEALSO jar + gcj(1), gij(1), grepjar(1) + and the Info entry for @file{gcj}. + @c man end + @end ignore + + @c man begin OPTIONS jar + + Exactly one of the following actions must be specified: + + @table @gcctabopt + + @item -c + Create new archive. + + @item -t + List table of contents for archive. + + @item -x + Extract named (or all) files from archive. + + @item -u + Update existing archive. This option is disabled due to bugs (currently + fails with exit status 1 and does nothing). + + @end table + + The following parameters are optional: + + @table @gcctabopt + + @item -@@ + Read the names of the files to add to the archive from stdin. This + option is supported only in combination with @option{-c} or @option{-u}. + Non standard option added in the GCC version. + + @item -C @var{directory} + Change to the @var{directory} and include the following file. + + @item -E + Prevent fastjar from reading the content of a directory when specifying + one (and instead relying on the provided list of files to populate the + archive with regard to the directory entry). Non standard option added + in the GCC version. + + @item -M + Do not create a manifest file for the entries. + + @item -0 + Store only; use no ZIP compression. + + @item -V + @itemx --version + Display version information. + + @item -f @var{archive} + Specify archive file name. + + @item -m @var{manifest} + Include manifest information from specified @var{manifest} file. + + @item -v + Generate verbose output on standard output. + + @end table + + All remaining options are considered to be names of files. + + @c man end + + @node Invoking grepjar + @chapter Invoking grepjar + + @c man title grepjar search files in a jar file for a pattern + + @c man begin DESCRIPTION grepjar + + The @code{grepjar} program can be used to search files in a jar file for + a pattern. + + @c man end + + @ignore + @c man begin SYNOPSIS grepjar + grepjar [@option{-bcinsw}] @option{-e} @var{PATTERN} | @var{PATTERN} @var{files}@dots{} + @c man end + @c man begin SEEALSO grepjar + jar(1), gcj(1), gij(1), gfdl(7) and the Info entry for @file{gcj}. + @c man end + @end ignore + + @c man begin OPTIONS grepjar + + @table @gcctabopt + @item -b + Print byte offset of match. + + @item -c + Print number of matches. + + @item -i + Compare case-insensitively. + + @item -n + Print line number of each match. + + @item -s + Suppress error messages. + + @item -w + Force @var{PATTERN} to match only whole words. + + @item -e @var{PATTERN} + Use @var{PATTERN} as regular expression. + + @item --help + Print help, then exit. + + @item -V + @itemx --version + Print version number, then exit. + @end table + + @c man end + + @include gpl.texi + + @include fdl.texi + + @bye diff -Nrc3pad gcc-3.2.3/fastjar/grepjar.1 gcc-3.3/fastjar/grepjar.1 *** gcc-3.2.3/fastjar/grepjar.1 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/fastjar/grepjar.1 2003-05-14 01:25:21.000000000 +0000 *************** *** 0 **** --- 1,202 ---- + .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 + .\" + .\" Standard preamble: + .\" ======================================================================== + .de Sh \" Subsection heading + .br + .if t .Sp + .ne 5 + .PP + \fB\\$1\fR + .PP + .. + .de Sp \" Vertical space (when we can't use .PP) + .if t .sp .5v + .if n .sp + .. + .de Vb \" Begin verbatim text + .ft CW + .nf + .ne \\$1 + .. + .de Ve \" End verbatim text + .ft R + .fi + .. + .\" Set up some character translations and predefined strings. \*(-- will + .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left + .\" double quote, and \*(R" will give a right double quote. | will give a + .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to + .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' + .\" expand to `' in nroff, nothing in troff, for use with C<>. + .tr \(*W-|\(bv\*(Tr + .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' + .ie n \{\ + . ds -- \(*W- + . ds PI pi + . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch + . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch + . ds L" "" + . ds R" "" + . ds C` "" + . ds C' "" + 'br\} + .el\{\ + . ds -- \|\(em\| + . ds PI \(*p + . ds L" `` + . ds R" '' + 'br\} + .\" + .\" If the F register is turned on, we'll generate index entries on stderr for + .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index + .\" entries marked with X<> in POD. Of course, you'll have to process the + .\" output yourself in some meaningful fashion. + .if \nF \{\ + . de IX + . tm Index:\\$1\t\\n%\t"\\$2" + .. + . nr % 0 + . rr F + .\} + .\" + .\" For nroff, turn off justification. Always turn off hyphenation; it makes + .\" way too many mistakes in technical documents. + .hy 0 + .if n .na + .\" + .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). + .\" Fear. Run. Save yourself. No user-serviceable parts. + . \" fudge factors for nroff and troff + .if n \{\ + . ds #H 0 + . ds #V .8m + . ds #F .3m + . ds #[ \f1 + . ds #] \fP + .\} + .if t \{\ + . ds #H ((1u-(\\\\n(.fu%2u))*.13m) + . ds #V .6m + . ds #F 0 + . ds #[ \& + . ds #] \& + .\} + . \" simple accents for nroff and troff + .if n \{\ + . ds ' \& + . ds ` \& + . ds ^ \& + . ds , \& + . ds ~ ~ + . ds / + .\} + .if t \{\ + . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" + . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' + . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' + . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' + . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' + . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' + .\} + . \" troff and (daisy-wheel) nroff accents + .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' + .ds 8 \h'\*(#H'\(*b\h'-\*(#H' + .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] + .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' + .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' + .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] + .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] + .ds ae a\h'-(\w'a'u*4/10)'e + .ds Ae A\h'-(\w'A'u*4/10)'E + . \" corrections for vroff + .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' + .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' + . \" for low resolution devices (crt and lpr) + .if \n(.H>23 .if \n(.V>19 \ + \{\ + . ds : e + . ds 8 ss + . ds o a + . ds d- d\h'-1'\(ga + . ds D- D\h'-1'\(hy + . ds th \o'bp' + . ds Th \o'LP' + . ds ae ae + . ds Ae AE + .\} + .rm #[ #] #H #V #F C + .\" ======================================================================== + .\" + .IX Title "GREPJAR 1" + .TH GREPJAR 1 "2003-05-14" "gcc-3.3" "GNU" + .SH "NAME" + grepjar \- search files in a jar file for a pattern + .SH "SYNOPSIS" + .IX Header "SYNOPSIS" + grepjar [\fB\-bcinsw\fR] \fB\-e\fR \fI\s-1PATTERN\s0\fR | \fI\s-1PATTERN\s0\fR \fIfiles\fR... + .SH "DESCRIPTION" + .IX Header "DESCRIPTION" + The \f(CW\*(C`grepjar\*(C'\fR program can be used to search files in a jar file for + a pattern. + .SH "OPTIONS" + .IX Header "OPTIONS" + .IP "\fB\-b\fR" 4 + .IX Item "-b" + Print byte offset of match. + .IP "\fB\-c\fR" 4 + .IX Item "-c" + Print number of matches. + .IP "\fB\-i\fR" 4 + .IX Item "-i" + Compare case\-insensitively. + .IP "\fB\-n\fR" 4 + .IX Item "-n" + Print line number of each match. + .IP "\fB\-s\fR" 4 + .IX Item "-s" + Suppress error messages. + .IP "\fB\-w\fR" 4 + .IX Item "-w" + Force \fI\s-1PATTERN\s0\fR to match only whole words. + .IP "\fB\-e\fR \fI\s-1PATTERN\s0\fR" 4 + .IX Item "-e PATTERN" + Use \fI\s-1PATTERN\s0\fR as regular expression. + .IP "\fB\-\-help\fR" 4 + .IX Item "--help" + Print help, then exit. + .IP "\fB\-V\fR" 4 + .IX Item "-V" + .PD 0 + .IP "\fB\-\-version\fR" 4 + .IX Item "--version" + .PD + Print version number, then exit. + .SH "SEE ALSO" + .IX Header "SEE ALSO" + \&\fIjar\fR\|(1), \fIgcj\fR\|(1), \fIgij\fR\|(1), \fIgfdl\fR\|(7) and the Info entry for \fIgcj\fR. + .SH "COPYRIGHT" + .IX Header "COPYRIGHT" + Copyright (C) 2002 Free Software Foundation, Inc. + .PP + Permission is granted to copy, distribute and/or modify this document + under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or + any later version published by the Free Software Foundation; with the + Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover + texts being (a) (see below), and with the Back-Cover Texts being (b) + (see below). A copy of the license is included in the + man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/fastjar/jar.1 gcc-3.3/fastjar/jar.1 *** gcc-3.2.3/fastjar/jar.1 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/fastjar/jar.1 2003-05-14 01:25:20.000000000 +0000 *************** *** 0 **** --- 1,231 ---- + .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 + .\" + .\" Standard preamble: + .\" ======================================================================== + .de Sh \" Subsection heading + .br + .if t .Sp + .ne 5 + .PP + \fB\\$1\fR + .PP + .. + .de Sp \" Vertical space (when we can't use .PP) + .if t .sp .5v + .if n .sp + .. + .de Vb \" Begin verbatim text + .ft CW + .nf + .ne \\$1 + .. + .de Ve \" End verbatim text + .ft R + .fi + .. + .\" Set up some character translations and predefined strings. \*(-- will + .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left + .\" double quote, and \*(R" will give a right double quote. | will give a + .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to + .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' + .\" expand to `' in nroff, nothing in troff, for use with C<>. + .tr \(*W-|\(bv\*(Tr + .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' + .ie n \{\ + . ds -- \(*W- + . ds PI pi + . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch + . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch + . ds L" "" + . ds R" "" + . ds C` "" + . ds C' "" + 'br\} + .el\{\ + . ds -- \|\(em\| + . ds PI \(*p + . ds L" `` + . ds R" '' + 'br\} + .\" + .\" If the F register is turned on, we'll generate index entries on stderr for + .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index + .\" entries marked with X<> in POD. Of course, you'll have to process the + .\" output yourself in some meaningful fashion. + .if \nF \{\ + . de IX + . tm Index:\\$1\t\\n%\t"\\$2" + .. + . nr % 0 + . rr F + .\} + .\" + .\" For nroff, turn off justification. Always turn off hyphenation; it makes + .\" way too many mistakes in technical documents. + .hy 0 + .if n .na + .\" + .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). + .\" Fear. Run. Save yourself. No user-serviceable parts. + . \" fudge factors for nroff and troff + .if n \{\ + . ds #H 0 + . ds #V .8m + . ds #F .3m + . ds #[ \f1 + . ds #] \fP + .\} + .if t \{\ + . ds #H ((1u-(\\\\n(.fu%2u))*.13m) + . ds #V .6m + . ds #F 0 + . ds #[ \& + . ds #] \& + .\} + . \" simple accents for nroff and troff + .if n \{\ + . ds ' \& + . ds ` \& + . ds ^ \& + . ds , \& + . ds ~ ~ + . ds / + .\} + .if t \{\ + . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" + . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' + . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' + . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' + . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' + . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' + .\} + . \" troff and (daisy-wheel) nroff accents + .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' + .ds 8 \h'\*(#H'\(*b\h'-\*(#H' + .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] + .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' + .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' + .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] + .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] + .ds ae a\h'-(\w'a'u*4/10)'e + .ds Ae A\h'-(\w'A'u*4/10)'E + . \" corrections for vroff + .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' + .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' + . \" for low resolution devices (crt and lpr) + .if \n(.H>23 .if \n(.V>19 \ + \{\ + . ds : e + . ds 8 ss + . ds o a + . ds d- d\h'-1'\(ga + . ds D- D\h'-1'\(hy + . ds th \o'bp' + . ds Th \o'LP' + . ds ae ae + . ds Ae AE + .\} + .rm #[ #] #H #V #F C + .\" ======================================================================== + .\" + .IX Title "FASTJAR 1" + .TH FASTJAR 1 "2003-05-14" "gcc-3.3" "GNU" + .SH "NAME" + jar \- archive tool for Java archives + .SH "SYNOPSIS" + .IX Header "SYNOPSIS" + jar \fB\-ctxu\fR [\fB\s-1OPTIONS\s0\fR] [\fIjar-file\fR] [\fImanifest-file\fR] [\fB\-C\fR \fIdir\fR] \fIfiles\fR... + .SH "DESCRIPTION" + .IX Header "DESCRIPTION" + \&\f(CW\*(C`fastjar\*(C'\fR is an implementation of Sun's jar utility that comes with + the \s-1JDK\s0, written entirely in C, and runs in a fraction of the time while + being feature compatible. + .PP + If any file is a directory then it is processed recursively. The + manifest file name and the archive file name needs to be specified in + the same order the \fB\-m\fR and \fB\-f\fR flags are specified. + .SH "OPTIONS" + .IX Header "OPTIONS" + Exactly one of the following actions must be specified: + .IP "\fB\-c\fR" 4 + .IX Item "-c" + Create new archive. + .IP "\fB\-t\fR" 4 + .IX Item "-t" + List table of contents for archive. + .IP "\fB\-x\fR" 4 + .IX Item "-x" + Extract named (or all) files from archive. + .IP "\fB\-u\fR" 4 + .IX Item "-u" + Update existing archive. This option is disabled due to bugs (currently + fails with exit status 1 and does nothing). + .PP + The following parameters are optional: + .IP "\fB\-@\fR" 4 + .IX Item "-@" + Read the names of the files to add to the archive from stdin. This + option is supported only in combination with \fB\-c\fR or \fB\-u\fR. + Non standard option added in the \s-1GCC\s0 version. + .IP "\fB\-C\fR \fIdirectory\fR" 4 + .IX Item "-C directory" + Change to the \fIdirectory\fR and include the following file. + .IP "\fB\-E\fR" 4 + .IX Item "-E" + Prevent fastjar from reading the content of a directory when specifying + one (and instead relying on the provided list of files to populate the + archive with regard to the directory entry). Non standard option added + in the \s-1GCC\s0 version. + .IP "\fB\-M\fR" 4 + .IX Item "-M" + Do not create a manifest file for the entries. + .IP "\fB\-0\fR" 4 + .IX Item "-0" + Store only; use no \s-1ZIP\s0 compression. + .IP "\fB\-V\fR" 4 + .IX Item "-V" + .PD 0 + .IP "\fB\-\-version\fR" 4 + .IX Item "--version" + .PD + Display version information. + .IP "\fB\-f\fR \fIarchive\fR" 4 + .IX Item "-f archive" + Specify archive file name. + .IP "\fB\-m\fR \fImanifest\fR" 4 + .IX Item "-m manifest" + Include manifest information from specified \fImanifest\fR file. + .IP "\fB\-v\fR" 4 + .IX Item "-v" + Generate verbose output on standard output. + .PP + All remaining options are considered to be names of files. + .SH "SEE ALSO" + .IX Header "SEE ALSO" + \&\fIgcj\fR\|(1), \fIgij\fR\|(1), \fIgrepjar\fR\|(1) + and the Info entry for \fIgcj\fR. + .SH "COPYRIGHT" + .IX Header "COPYRIGHT" + Copyright (C) 2002 Free Software Foundation, Inc. + .PP + Permission is granted to copy, distribute and/or modify this document + under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or + any later version published by the Free Software Foundation; with the + Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover + texts being (a) (see below), and with the Back-Cover Texts being (b) + (see below). A copy of the license is included in the + man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/fastjar/jargrep.c gcc-3.3/fastjar/jargrep.c *** gcc-3.2.3/fastjar/jargrep.c 2002-01-09 23:22:20.000000000 +0000 --- gcc-3.3/fastjar/jargrep.c 2003-01-28 22:25:27.000000000 +0000 *************** *** 1,6 **** /* jargrep.c - main functions for jargrep utility ! Copyright (C) 2002 Free Software Foundation Copyright (C) 1999, 2000 Bryan Burns Copyright (C) 2000 Cory Hollingsworth --- 1,6 ---- /* jargrep.c - main functions for jargrep utility ! Copyright (C) 2002, 2003 Free Software Foundation Copyright (C) 1999, 2000 Bryan Burns Copyright (C) 2000 Cory Hollingsworth *************** will test some other platforms later. *** 105,111 **** #include "config.h" #include #include - #include #include #include #include --- 105,110 ---- *************** will test some other platforms later. *** 115,120 **** --- 114,122 ---- #ifdef HAVE_STDLIB_H #include #endif + + #include "xregex.h" + #include "jargrep.h" #include "jartool.h" #include "pushback.h" *************** will test some other platforms later. *** 126,132 **** void version(void); void help(const char *name); ! #define Usage "Usage: %s [-bcinsw] <-e PATTERN | PATTERN> FILE ...\n" /* Function name: opt_valid --- 128,134 ---- void version(void); void help(const char *name); ! #define Usage "Usage: %s [-bcinsVw] [--version|--help] <-e PATTERN | PATTERN> FILE ...\n" /* Function name: opt_valid *************** Search files in a jar file for a pattern *** 769,775 **** -n print line number of each match\n\ -s suppress error messages\n\ -w force PATTERN to match only whole words\n\ ! -e PATTERN use PATTERN as regular exprssion\n\ "); exit (0); --- 771,779 ---- -n print line number of each match\n\ -s suppress error messages\n\ -w force PATTERN to match only whole words\n\ ! -e PATTERN use PATTERN as regular expression\n\ ! -V|--version print version number and exit\n\ ! --help print help\n\ "); exit (0); diff -Nrc3pad gcc-3.2.3/fastjar/jartool.c gcc-3.3/fastjar/jartool.c *** gcc-3.2.3/fastjar/jartool.c 2002-03-18 11:08:59.000000000 +0000 --- gcc-3.3/fastjar/jartool.c 2003-01-31 22:48:13.000000000 +0000 *************** *** 239,244 **** --- 239,250 ---- #include "pushback.h" #include "compress.h" + /* Some systems have mkdir that takes a single argument. */ + #ifdef MKDIR_TAKES_ONE_ARG + # define mkdir(a,b) mkdir(a) + #endif + + #ifdef WORDS_BIGENDIAN #define L2BI(l) ((l & 0xff000000) >> 24) | \ *************** int main(int argc, char **argv){ *** 433,440 **** /* create the jarfile */ if(action == ACTION_CREATE){ if(jarfile){ ! jarfd = open(jarfile, O_CREAT | O_BINARY | O_WRONLY | O_TRUNC, ! S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if(jarfd < 0){ fprintf(stderr, "Error opening %s for writing!\n", jarfile); --- 439,445 ---- /* create the jarfile */ if(action == ACTION_CREATE){ if(jarfile){ ! jarfd = open(jarfile, O_CREAT | O_BINARY | O_WRONLY | O_TRUNC, 0666); if(jarfd < 0){ fprintf(stderr, "Error opening %s for writing!\n", jarfile); *************** int add_to_jar(int fd, const char *new_d *** 838,844 **** } } ! if(!strcmp(file, jarfile)){ if(verbose) printf("skipping: %s\n", file); return 0; /* we don't want to add ourselves.. */ --- 843,849 ---- } } ! if(jarfile && !strcmp(file, jarfile)){ if(verbose) printf("skipping: %s\n", file); return 0; /* we don't want to add ourselves.. */ *************** int add_to_jar(int fd, const char *new_d *** 919,925 **** while(!use_explicit_list_only && (de = readdir(dir)) != NULL){ if(de->d_name[0] == '.') continue; ! if(!strcmp(de->d_name, jarfile)){ /* we don't want to add ourselves. Believe me */ if(verbose) printf("skipping: %s\n", de->d_name); continue; --- 924,931 ---- while(!use_explicit_list_only && (de = readdir(dir)) != NULL){ if(de->d_name[0] == '.') continue; ! if(jarfile && !strcmp(de->d_name, jarfile)){ ! /* we don't want to add ourselves. Believe me */ if(verbose) printf("skipping: %s\n", de->d_name); continue; *************** int extract_jar(int fd, char **files, in *** 1449,1455 **** } if(f_fd != -1 && handle){ ! f_fd = creat((const char *)filename, 00644); if(f_fd < 0){ fprintf(stderr, "Error extracting JAR archive!\n"); --- 1455,1462 ---- } if(f_fd != -1 && handle){ ! f_fd = open((const char *)filename, ! O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); if(f_fd < 0){ fprintf(stderr, "Error extracting JAR archive!\n"); *************** int extract_jar(int fd, char **files, in *** 1464,1472 **** } if(method == 8 || flags & 0x0008){ - if(seekable) - lseek(fd, eflen, SEEK_CUR); - else consume(&pbf, eflen); inflate_file(&pbf, f_fd, &ze); --- 1471,1476 ---- *************** int extract_jar(int fd, char **files, in *** 1501,1509 **** #endif } - if(seekable) - lseek(fd, eflen, SEEK_CUR); - else consume(&pbf, eflen); } --- 1505,1510 ---- *************** int list_jar(int fd, char **files, int f *** 1564,1570 **** int i, j; time_t tdate; struct tm *s_tm; ! char ascii_date[30]; zipentry ze; #ifdef DEBUG --- 1565,1571 ---- int i, j; time_t tdate; struct tm *s_tm; ! char ascii_date[31]; zipentry ze; #ifdef DEBUG *************** int list_jar(int fd, char **files, int f *** 1655,1663 **** tdate = dos2unixtime(mdate); s_tm = localtime(&tdate); strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm); } ! if(filename_len < fnlen){ if(filename != NULL) free(filename); --- 1656,1665 ---- tdate = dos2unixtime(mdate); s_tm = localtime(&tdate); strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm); + ascii_date[30] = '\0'; } ! if(filename_len < fnlen + 1){ if(filename != NULL) free(filename); *************** int list_jar(int fd, char **files, int f *** 1774,1782 **** tdate = dos2unixtime(mdate); s_tm = localtime(&tdate); strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm); } ! if(filename_len < fnlen){ if(filename != NULL) free(filename); --- 1776,1785 ---- tdate = dos2unixtime(mdate); s_tm = localtime(&tdate); strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm); + ascii_date[30] = '\0'; } ! if(filename_len < fnlen + 1){ if(filename != NULL) free(filename); *************** int consume(pb_file *pbf, int amt){ *** 1847,1852 **** --- 1850,1863 ---- printf("Consuming %d bytes\n", amt); #endif + if (seekable){ + if (amt <= (int)pbf->buff_amt) + pb_read(pbf, buff, amt); + else { + lseek(pbf->fd, amt - pbf->buff_amt, SEEK_CUR); + pb_read(pbf, buff, pbf->buff_amt); /* clear pbf */ + } + } else while(tc < amt){ rdamt = pb_read(pbf, buff, ((amt - tc) < RDSZ ? (amt - tc) : RDSZ)); #ifdef DEBUG *************** int consume(pb_file *pbf, int amt){ *** 1856,1862 **** } #ifdef DEBUG ! printf("%d bytes consumed\n", tc); #endif return 0; --- 1867,1873 ---- } #ifdef DEBUG ! printf("%d bytes consumed\n", amt); #endif return 0; diff -Nrc3pad gcc-3.2.3/fastjar/Makefile.am gcc-3.3/fastjar/Makefile.am *** gcc-3.2.3/fastjar/Makefile.am 2002-01-13 18:05:25.000000000 +0000 --- gcc-3.3/fastjar/Makefile.am 2002-12-31 01:17:12.000000000 +0000 *************** grepjar_LDADD = $(ZLIBS) $(LIBIBERTY) *** 57,59 **** --- 57,98 ---- grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY) AM_CFLAGS = @fastjar_warn_cflags@ + + TEXINFO_TEX = ../gcc/doc/include/texinfo.tex + info_TEXINFOS = fastjar.texi + fastjar_TEXINFOS = \ + ../gcc/doc/include/gcc-common.texi \ + ../gcc/doc/include/fdl.texi \ + ../gcc/doc/include/gpl.texi + man_MANS = jar.1 grepjar.1 + EXTRA_DIST = $(man_MANS) + + ## This is a hack. We can't set AM_MAKEINFOFLAGS, since that isn't + ## available in 1.4. Nor can we override or append to MAKEINFO or + ## MAKEINFOFLAGS, since these are overridden by the top-level + ## Makefile. So, we just duplicate the rules. FIXME: remove this + ## when we upgrade automake. Note that we don't include $(srcdir) in + ## my_makei_flags; makeinfo is run in srcdir. + my_makei_flags += -I ../gcc/doc/include + fastjar.info: fastjar.texi $(fastjar_TEXINFOS) + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) $(my_makei_flags) `echo $< | sed 's,.*/,,'` + + + TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl + POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@" + + $(srcdir)/jar.1: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D jar < $(srcdir)/fastjar.texi > fastjar.pod + -($(POD2MAN) --section=1 fastjar.pod > jar.1.T$$$$ && \ + mv -f jar.1.T$$$$ $(srcdir)/jar.1) || \ + (rm -f jar.1.T$$$$ && exit 1) + -rm -f fastjar.pod + + $(srcdir)/grepjar.1: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D grepjar < $(srcdir)/fastjar.texi > grepjar.pod + -($(POD2MAN) --section=1 grepjar.pod > grepjar.1.T$$$$ && \ + mv -f grepjar.1.T$$$$ $(srcdir)/grepjar.1) || \ + (rm -f grepjar.1.T$$$$ && exit 1) + -rm -f grepjar.pod diff -Nrc3pad gcc-3.2.3/fastjar/Makefile.in gcc-3.3/fastjar/Makefile.in *** gcc-3.2.3/fastjar/Makefile.in 2002-01-13 18:05:25.000000000 +0000 --- gcc-3.3/fastjar/Makefile.in 2003-05-14 00:18:14.000000000 +0000 *************** ZDEPS = @ZDEPS@ *** 73,78 **** --- 73,79 ---- ZINCS = @ZINCS@ ZLIBS = @ZLIBS@ fastjar_warn_cflags = @fastjar_warn_cflags@ + gcc_version = @gcc_version@ AUTOMAKE_OPTIONS = no-dependencies *************** grepjar_LDADD = $(ZLIBS) $(LIBIBERTY) *** 133,138 **** --- 134,154 ---- grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY) AM_CFLAGS = @fastjar_warn_cflags@ + + TEXINFO_TEX = ../gcc/doc/include/texinfo.tex + info_TEXINFOS = fastjar.texi + fastjar_TEXINFOS = \ + ../gcc/doc/include/gcc-common.texi \ + ../gcc/doc/include/fdl.texi \ + ../gcc/doc/include/gpl.texi + + man_MANS = jar.1 grepjar.1 + EXTRA_DIST = $(man_MANS) + + my_makei_flags = -I ../gcc/doc/include + + TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl + POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@" ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h *************** CFLAGS = @CFLAGS@ *** 153,173 **** COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ ! DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ ! Makefile.am Makefile.in NEWS aclocal.m4 config.h.in configure \ ! configure.in install-defs.sh.in install-sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ! TAR = tar GZIP_ENV = --best SOURCES = $(jar_SOURCES) $(grepjar_SOURCES) OBJECTS = $(jar_OBJECTS) $(grepjar_OBJECTS) all: all-redirect .SUFFIXES: ! .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile --- 169,198 ---- COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ ! TEXI2DVI = texi2dvi ! INFO_DEPS = fastjar.info ! DVIS = fastjar.dvi ! TEXINFOS = fastjar.texi ! man1dir = $(mandir)/man1 ! MANS = $(man_MANS) ! ! NROFF = nroff ! DIST_COMMON = README $(fastjar_TEXINFOS) ./stamp-h.in AUTHORS COPYING \ ! ChangeLog INSTALL Makefile.am Makefile.in NEWS acinclude.m4 aclocal.m4 \ ! config.h.in configure configure.in install-defs.sh.in install-sh \ ! missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ! TAR = gtar GZIP_ENV = --best SOURCES = $(jar_SOURCES) $(grepjar_SOURCES) OBJECTS = $(jar_OBJECTS) $(grepjar_OBJECTS) all: all-redirect .SUFFIXES: ! .SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile *************** Makefile: $(srcdir)/Makefile.in $(top_b *** 175,181 **** cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status ! $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) --- 200,206 ---- cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status ! $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) *************** grepjar$(EXEEXT): $(grepjar_OBJECTS) $(g *** 265,270 **** --- 290,451 ---- @rm -f grepjar$(EXEEXT) $(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS) + fastjar.info: fastjar.texi $(fastjar_TEXINFOS) + fastjar.dvi: fastjar.texi $(fastjar_TEXINFOS) + + + DVIPS = dvips + + .texi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + + .texi.dvi: + TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + + .texi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + + .texinfo.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + + .texinfo: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + + .texinfo.dvi: + TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + + .txi.info: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + + .txi.dvi: + TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \ + MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< + + .txi: + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) `echo $< | sed 's,.*/,,'` + .dvi.ps: + $(DVIPS) $< -o $@ + + install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(INFO_DEPS)'; \ + for file in $$list; do \ + d=$(srcdir); \ + for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + if test -f $$d/$$ifile; then \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + done; \ + else : ; fi + + uninstall-info: + $(PRE_UNINSTALL) + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + ii=yes; \ + else ii=; fi; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + test -z "$ii" \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ + done + @$(NORMAL_UNINSTALL) + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + done + + dist-info: $(INFO_DEPS) + list='$(INFO_DEPS)'; \ + for base in $$list; do \ + d=$(srcdir); \ + for file in `cd $$d && eval echo $$base*`; do \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done; \ + done + + mostlyclean-aminfo: + -rm -f fastjar.aux fastjar.cp fastjar.cps fastjar.dvi fastjar.fn \ + fastjar.fns fastjar.ky fastjar.kys fastjar.ps fastjar.log \ + fastjar.pg fastjar.toc fastjar.tp fastjar.tps fastjar.vr \ + fastjar.vrs fastjar.op fastjar.tr fastjar.cv fastjar.cn + + clean-aminfo: + + distclean-aminfo: + + maintainer-clean-aminfo: + cd $(srcdir) && for i in $(INFO_DEPS); do \ + rm -f $$i; \ + if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ + rm -f $$i-[0-9]*; \ + fi; \ + done + + install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + + uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done + install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man1 + uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 + tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) *************** distdir: $(DISTFILES) *** 335,350 **** @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ ! cp -pr $$/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done ! info-am: info: info-am ! dvi-am: dvi: dvi-am check-am: all-am check: check-am --- 516,532 ---- @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ ! cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done ! $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info ! info-am: $(INFO_DEPS) info: info-am ! dvi-am: $(DVIS) dvi: dvi-am check-am: all-am check: check-am *************** all-recursive-am: config.h *** 356,375 **** install-exec-am: install-binPROGRAMS install-exec: install-exec-am ! install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am ! uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am ! all-am: Makefile $(PROGRAMS) config.h all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: ! $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: --- 538,558 ---- install-exec-am: install-binPROGRAMS install-exec: install-exec-am ! install-data-am: install-info-am install-man install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am ! uninstall-am: uninstall-binPROGRAMS uninstall-info uninstall-man uninstall: uninstall-am ! all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: ! $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \ ! $(DESTDIR)$(mandir)/man1 mostlyclean-generic: *************** distclean-generic: *** 382,406 **** maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ ! mostlyclean-compile mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am ! clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ ! clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ ! distclean-tags distclean-generic clean-am distclean: distclean-am -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ ! maintainer-clean-compile maintainer-clean-tags \ ! maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." --- 565,591 ---- maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ ! mostlyclean-compile mostlyclean-aminfo mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am ! clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo \ ! clean-tags clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ ! distclean-aminfo distclean-tags distclean-generic \ ! clean-am distclean: distclean-am -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ ! maintainer-clean-compile maintainer-clean-aminfo \ ! maintainer-clean-tags maintainer-clean-generic \ ! distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." *************** maintainer-clean: maintainer-clean-am *** 411,424 **** mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ ! maintainer-clean-compile tags mostlyclean-tags distclean-tags \ ! clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ ! check-am installcheck-am installcheck all-recursive-am install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. --- 596,630 ---- mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ ! maintainer-clean-compile install-info-am uninstall-info \ ! mostlyclean-aminfo distclean-aminfo clean-aminfo \ ! maintainer-clean-aminfo install-man1 uninstall-man1 install-man \ ! uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ ! maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ ! installcheck-am installcheck all-recursive-am install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs \ mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean + fastjar.info: fastjar.texi $(fastjar_TEXINFOS) + @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] + cd $(srcdir) \ + && $(MAKEINFO) $(my_makei_flags) `echo $< | sed 's,.*/,,'` + + $(srcdir)/jar.1: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D jar < $(srcdir)/fastjar.texi > fastjar.pod + -($(POD2MAN) --section=1 fastjar.pod > jar.1.T$$$$ && \ + mv -f jar.1.T$$$$ $(srcdir)/jar.1) || \ + (rm -f jar.1.T$$$$ && exit 1) + -rm -f fastjar.pod + + $(srcdir)/grepjar.1: $(srcdir)/fastjar.texi + -$(TEXI2POD) -D grepjar < $(srcdir)/fastjar.texi > grepjar.pod + -($(POD2MAN) --section=1 grepjar.pod > grepjar.1.T$$$$ && \ + mv -f grepjar.1.T$$$$ $(srcdir)/grepjar.1) || \ + (rm -f grepjar.1.T$$$$ && exit 1) + -rm -f grepjar.pod # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nrc3pad gcc-3.2.3/gcc/java/boehm.c gcc-3.3/gcc/java/boehm.c *** gcc-3.2.3/gcc/java/boehm.c 2001-12-22 00:52:30.000000000 +0000 --- gcc-3.3/gcc/java/boehm.c 2002-03-29 21:46:26.000000000 +0000 *************** get_boehm_type_descriptor (tree type) *** 230,235 **** value = build_int_2 (2, 0); } ! TREE_TYPE (value) = type_for_mode (ptr_mode, 1); return value; } --- 230,235 ---- value = build_int_2 (2, 0); } ! TREE_TYPE (value) = java_type_for_mode (ptr_mode, 1); return value; } diff -Nrc3pad gcc-3.2.3/gcc/java/buffer.c gcc-3.3/gcc/java/buffer.c *** gcc-3.2.3/gcc/java/buffer.c 2001-04-04 00:46:27.000000000 +0000 --- gcc-3.3/gcc/java/buffer.c 2002-11-18 15:46:31.000000000 +0000 *************** buffer_grow (bufp, size) *** 37,50 **** { if (size < 120) size = 120; ! bufp->data = (unsigned char*) xmalloc (size); bufp->ptr = bufp->data; } else { int index = bufp->ptr - bufp->data; size += 2 * (bufp->limit - bufp->data); ! bufp->data = (unsigned char *) xrealloc (bufp->data, size); bufp->ptr = bufp->data + index; } bufp->limit = bufp->data + size; --- 37,50 ---- { if (size < 120) size = 120; ! bufp->data = xmalloc (size); bufp->ptr = bufp->data; } else { int index = bufp->ptr - bufp->data; size += 2 * (bufp->limit - bufp->data); ! bufp->data = xrealloc (bufp->data, size); bufp->ptr = bufp->data + index; } bufp->limit = bufp->data + size; diff -Nrc3pad gcc-3.2.3/gcc/java/builtins.c gcc-3.3/gcc/java/builtins.c *** gcc-3.2.3/gcc/java/builtins.c 2002-03-18 19:33:49.000000000 +0000 --- gcc-3.3/gcc/java/builtins.c 2003-03-04 14:37:22.000000000 +0000 *************** The Free Software Foundation is independ *** 30,36 **** #include "tree.h" #include "ggc.h" #include "flags.h" ! #include "java-tree.h" enum builtin_type --- 30,36 ---- #include "tree.h" #include "ggc.h" #include "flags.h" ! #include "langhooks.h" #include "java-tree.h" enum builtin_type *************** enum builtin_type *** 44,49 **** --- 44,50 ---- #define DEF_FUNCTION_TYPE_VAR_0(NAME, RETURN) NAME, #define DEF_FUNCTION_TYPE_VAR_1(NAME, RETURN, ARG1) NAME, #define DEF_FUNCTION_TYPE_VAR_2(NAME, RETURN, ARG1, ARG2) NAME, + #define DEF_FUNCTION_TYPE_VAR_3(NAME, RETURN, ARG1, ARG2, ARG3) NAME, #define DEF_POINTER_TYPE(NAME, TYPE) NAME, #include "builtin-types.def" #undef DEF_PRIMITIVE_TYPE *************** enum builtin_type *** 55,60 **** --- 56,62 ---- #undef DEF_FUNCTION_TYPE_VAR_0 #undef DEF_FUNCTION_TYPE_VAR_1 #undef DEF_FUNCTION_TYPE_VAR_2 + #undef DEF_FUNCTION_TYPE_VAR_3 #undef DEF_POINTER_TYPE BT_LAST }; *************** typedef tree builtin_creator_function PA *** 83,103 **** /* Hold a char*, before initialization, or a tree, after initialization. */ ! union string_or_tree { ! const char *s; ! tree t; }; /* Used to hold a single builtin record. */ ! struct builtin_record { ! union string_or_tree class_name; ! union string_or_tree method_name; ! builtin_creator_function *creator; }; ! static struct builtin_record java_builtins[] = { { { "java.lang.Math" }, { "min" }, min_builtin }, { { "java.lang.Math" }, { "max" }, max_builtin }, --- 85,105 ---- /* Hold a char*, before initialization, or a tree, after initialization. */ ! union string_or_tree GTY(()) { ! const char * GTY ((tag ("0"))) s; ! tree GTY ((tag ("1"))) t; }; /* Used to hold a single builtin record. */ ! struct builtin_record GTY(()) { ! union string_or_tree GTY ((desc ("1"))) class_name; ! union string_or_tree GTY ((desc ("1"))) method_name; ! builtin_creator_function * GTY((skip (""))) creator; }; ! static GTY(()) struct builtin_record java_builtins[] = { { { "java.lang.Math" }, { "min" }, min_builtin }, { { "java.lang.Math" }, { "max" }, max_builtin }, *************** initialize_builtins () *** 273,291 **** java_builtins[i].class_name.t = klass_id; java_builtins[i].method_name.t = m; - ggc_add_tree_root (&java_builtins[i].class_name.t, 1); - ggc_add_tree_root (&java_builtins[i].method_name.t, 1); } void_list_node = end_params_node; /* Work around C-specific junk in builtin-types.def. */ #define intmax_type_node NULL_TREE - #define traditional_ptr_type_node NULL_TREE - #define traditional_cptr_type_node NULL_TREE #define c_size_type_node NULL_TREE #define const_string_type_node NULL_TREE - #define traditional_len_type_node NULL_TREE #define va_list_ref_type_node NULL_TREE #define va_list_arg_type_node NULL_TREE #define flag_isoc99 0 --- 275,288 ---- *************** initialize_builtins () *** 307,325 **** #define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ builtin_types[(int) ENUM] \ = define_builtin_type (RETURN, ARG1, ARG2, ARG3, ARG4); ! #define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ builtin_types[(int) ENUM] = NULL_TREE; ! #define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ builtin_types[(int) ENUM] = NULL_TREE; #define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ builtin_types[(int) ENUM] = NULL_TREE; #define DEF_POINTER_TYPE(ENUM, TYPE) \ builtin_types[(int) ENUM] = NULL_TREE; #include "builtin-types.def" #define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, \ ! FALLBACK_P, NONANSI_P) \ define_builtin (ENUM, NAME, CLASS, builtin_types[TYPE], FALLBACK_P); #include "builtins.def" } --- 304,324 ---- #define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ builtin_types[(int) ENUM] \ = define_builtin_type (RETURN, ARG1, ARG2, ARG3, ARG4); ! #define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ builtin_types[(int) ENUM] = NULL_TREE; ! #define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \ builtin_types[(int) ENUM] = NULL_TREE; #define DEF_FUNCTION_TYPE_VAR_2(ENUM, RETURN, ARG1, ARG2) \ builtin_types[(int) ENUM] = NULL_TREE; + #define DEF_FUNCTION_TYPE_VAR_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ + builtin_types[(int) ENUM] = NULL_TREE; #define DEF_POINTER_TYPE(ENUM, TYPE) \ builtin_types[(int) ENUM] = NULL_TREE; #include "builtin-types.def" #define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, \ ! FALLBACK_P, NONANSI_P, ATTRS) \ define_builtin (ENUM, NAME, CLASS, builtin_types[TYPE], FALLBACK_P); #include "builtins.def" } *************** check_for_builtin (method, call) *** 351,353 **** --- 350,354 ---- } return call; } + + #include "gt-java-builtins.h" diff -Nrc3pad gcc-3.2.3/gcc/java/ChangeLog gcc-3.3/gcc/java/ChangeLog *** gcc-3.2.3/gcc/java/ChangeLog 2003-04-22 06:15:07.000000000 +0000 --- gcc-3.3/gcc/java/ChangeLog 2003-05-14 00:10:15.000000000 +0000 *************** *** 1,81 **** ! 2003-04-22 Release Manager ! * GCC 3.2.3 Released. ! 2003-03-17 Kaveh R. Ghazi ! Backport: ! 2002-12-05 Ranjit Mathew ! Andrew Haley ! * parse.y (source_end_java_method): Remove custom encoding of line ! numbers for a function decl before passing it to the back end. ! 2003-02-05 Gabriel Dos Reis ! * gcj.texi: Bump version. ! 2003-02-05 Release Manager ! * GCC 3.2.2 Released. ! 2003-01-28 Christian Cornelssen * Make-lang.in (java.install-common, java.uninstall) (java.install-info, java.install-man): Prepend $(DESTDIR) to destination paths in all (un)installation commands. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-18 Release Manager ! * GCC 3.2.1 Released. ! 2002-10-21 Matthias Klose ! * Backport, without whitespace change: ! 2002-06-10 Akim Demaille ! * parse.y (interface_type_list, class_member_declaration) ! (unary_expression_not_plus_minus): Remove duplicate %type. ! Whitespace changes. ! 2002-06-13 Akim Demaille ! * parse.y (class_declaration, interface_declaration): Make sure ! all their rules have an action, in order to avoid meaningless `$$ ! = $1' and their type clashes. ! * parse.y (catch_clause): Terminate with `;'. ! 2002-10-06 Roger Sayle PR optimization/6627 ! * java/lang.c (java_init): If storing the vbit in function pointers, ensure that force_align_functions_log is atleast one to aid compatability with g++ vtables. ! 2002-08-14 Release Manager ! * GCC 3.2 Released. 2002-08-04 Joseph S. Myers ! * gcj.texi (version-gcc): Increase to 3.2. ! 2002-07-25 Release Manager ! * GCC 3.1.1 Released. 2002-06-25 Andreas Schwab * expr.c (JSR): Avoid undefined operation on PC. 2002-06-10 Bryce McKinlay Don't use RTL inlining. Fix for PR java/6820. --- 1,737 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-02 Tom Tromey ! PR java/10459: ! * parse.y (finish_for_loop): Do nothing if update expression is a ! EXPR_WFL_NODE wrapping nothing. ! (java_complete_lhs) : Likewise. ! 2003-04-20 Mohan Embar ! * jcf-io.c (find_class): use DIR_SEPARATOR instead of ! '/' when computing java source filename ! ! 2003-04-10 Eric Blake ! ! PR java/10253: ! * parse.y (string_convert_int_cst): Always use at least one digit ! in string conversion. Remove ASCII dependence. ! (merge_string_cste): Fix merging of 3-byte UTF-8 characters. ! ! 2003-03-16 Mohan Embar ! ! * Make-lang.in: added win32-host.c ! * jcf.h: defined macro JCF_OPEN_EXACT_CASE which ! resolves to open() on non-Win32 platforms and ! Win32-specific jcf_open_exact_case() on Win32 ! * jcf-io.c (find_class): use JCF_OPEN_EXACT_CASE ! when trying .java and .class files ! * win32-host.c: added to repository. Defines ! Win32-specific jcf_open_exact_case() ! ! 2003-04-10 Andrew Haley ! ! * jcf-write.c (struct jcf_partial): num_jsrs: new field. ! (maybe_free_localvar): Renamed from localvar_free. ! Add new arg, really. ! (generate_bytecode_insns): Set new variable, jsrs. ! Only free local vars if no jsr insns have been emittted. ! Call maybe_free_localvar, not localvar_free. ! ! 2003-03-23 Zack Weinberg ! ! PR bootstrap/10216 ! * Make-lang.in: Link jcf-dump against $(LDEXP_LIB). ! ! 2003-03-30 Joseph S. Myers ! ! * gcj.texi: Remove @ at start of file. ! ! 2003-03-28 Zack Weinberg ! ! PR bootstrap/10216 ! * javaop.h (jfloat, jdouble): Make them structures mirroring ! the bit fields of IEEE float and double respectively. ! (JFLOAT_FINITE, JFLOAT_QNAN_MASK, JFLOAT_EXP_BIAS, ! JDOUBLE_FINITE, JDOUBLE_QNAN_MASK, JDOUBLE_EXP_BIAS): New. ! (union Word, union DWord): Delete. ! (WORD_TO_FLOAT, WORDS_TO_DOUBLE): Update to match. ! ! * gjavah.c (java_float_finite, java_double_finite, F_NAN_MASK, ! D_NAN_MASK): Delete. ! (jni_print_float, jni_print_double): New. Generate ! hexadecimal floating constants. ! (print_field_info): Use jni_print_float/double. ! ! * jcf-dump.c: Include math.h. Use ldexp/frexp to assemble ! finite floating point numbers for output; special case ! non-finite floats. ! ! 2003-03-12 Andrew Haley ! ! * gjavah.c (is_first_data_member): New global variable. ! (print_c_decl): If it's the first data member, align it as the ! superclass. ! (process_file): Set is_first_data_member. ! ! 2003-03-11 Tom Tromey ! ! * parse.y (resolve_field_access): Initialize class if field is ! found in another static field. ! * expr.c (build_class_init): Don't optimize out initialization of ! implemented interface. ! ! 2003-03-10 Ranjit Mathew ! ! * jcf-io.c (caching_stat): Account for both DIR_SEPARATOR ! and DIR_SEPARATOR_2 for a target. ! Correct minor typos. ! ! * jcf-write.c (make_class_file_name): Take both DIR_SEPARATOR ! and DIR_SEPARATOR_2 for a target into account. ! ! 2003-03-05 Ranjit Mathew ! ! * jcf.h (COMPARE_FILENAMES): New macro similar to "strcmp" to ! compare file name components depending on the case-sensitivity ! or otherwise of the host file system. ! ! * jcf-path.c (add_entry): Use COMPARE_FILENAMES instead of ! "strcmp" to compare file name components. ! Use IS_DIR_SEPARATOR instead of comparing directly against ! DIR_SEPARATOR. ! (jcf_path_extdirs_arg): Use IS_DIR_SEPARATOR instead of ! comparing directly against DIR_SEPARATOR. ! ! 2003-03-04 Roger Sayle ! ! * builtins.c (builtin_type): Handle DEF_FUNCTION_TYPE_VAR_3. ! (initialize_builtins): Handle DEF_FUNCTION_TYPE_VAR_3. ! ! 2003-02-28 Tom Tromey ! ! PR java/9695: ! * class.c (maybe_layout_super_class): Always pass a WFL to ! do_resolve_class. ! * parse.y (do_resolve_class): Updated comment to explain ! parameters. ! ! 2003-02-12 Ranjit Mathew ! ! * decl.c (java_init_decl_processing): Change ! soft_lookupjnimethod_node to reflect the change in ! signature of _Jv_LookupJNIMethod in libjava/jni.cc ! * expr.c (build_jni_stub): Calculate and pass the size ! on the stack of the arguments to a JNI function. Use ! new target macro MODIFY_JNI_METHOD_CALL to allow a ! target to modify the call to a JNI method. ! ! 2003-02-04 Joseph S. Myers ! ! * gcj.texi: Update to GFDL 1.2. ! ! 2003-01-31 Andrew Haley ! ! * parse.y (java_expand_classes): Scan the whole class list looking ! for access methods that haven't yet been expanded. ! ! 2003-01-31 Adrian Bunk ! ! Fix for java/4269: ! ! * jv-scan.c: Use HAVE_LANGINFO_CODESET instead of HAVE_NL_LANGINFO ! to fix bootstrap on sparc-unknown-netbsdelf1.5. ! * jcf-parse.c: Likewise. ! ! 2003-01-31 Mark Wielaard ! ! * gjavah.c (throwable_p): Allocate 1 more byte for string. ! ! 2003-01-30 Tom Tromey ! ! * jcf-parse.c (read_class): Update identifier's class value if it ! changed during parsing. ! ! 2003-01-29 Tom Tromey ! ! * parse.y (patch_assignment): Only transform the rhs of an ! assignment when compiling to native. ! ! 2003-01-28 Tom Tromey ! ! * lex.c (java_lex): Don't include UEOF as part of token. ! (java_read_unicode): Error if \u sequence prematurely terminated. ! ! 2003-01-27 Tom Tromey ! ! * parse.y (java_check_regular_methods): Check for construct after ! checking types in throws clause. ! ! 2003-01-26 Christian Cornelssen * Make-lang.in (java.install-common, java.uninstall) (java.install-info, java.install-man): Prepend $(DESTDIR) to destination paths in all (un)installation commands. + (java.install-common): Rewrite $(LN) command to support + DESTDIR with "ln" as well as with "ln -s". ! 2003-01-24 Kaveh R. Ghazi ! * jcf-io.c (caching_stat): Cast the 3rd arg of scandir to void*. ! * jcf-write.c (generate_bytecode_insns): Avoid signed/unsigned ! warning. ! 2003-01-21 Tom Tromey ! * parse.y (method_header): Native method can't be strictfp. ! No method can be transient or volatile. ! 2003-01-14 Andrew Haley ! * decl.c (java_init_decl_processing): _Jv_NewMultiArray is a ! varargs function -- correct. ! * parse.y (patch_assignment): Copy the rhs of an assignment into a ! temporary if the RHS is a reference. ! 2003-01-05 Kaveh R. Ghazi ! * lang.c (dump_compound_expr): Prototype. ! 2003-01-03 Tom Tromey ! Fix for PR java/8712: ! * expr.c (build_instanceof): Build an NE_EXPR, not a COND_EXPR, ! when simply checking against `null'. ! 2003-01-03 Tom Tromey ! ! * gcj.texi (Standard Properties): Document http.proxyHost and ! http.proxyPort. ! ! 2003-01-03 Tom Tromey ! ! * gcj.texi (GNU Classpath Properties): Document new properties. ! ! 2002-12-30 DJ Delorie ! ! * Make-lang.in: Protect against texi2pod/pod2man failing. ! ! 2002-12-28 Joseph S. Myers ! ! * gcj.texi: Use @copying. ! ! 2002-12-23 Joseph S. Myers ! ! * gcj.texi: Include Cover Texts in man page. ! ! 2002-12-23 Joseph S. Myers ! ! * gcj.texi: Include gcc-common.texi. ! * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Depend on ! $(srcdir)/doc/include/gcc-common.texi. ! ! 2002-12-22 Anthony Green ! ! * gcj.texi (Limitations): Add note about org.xml.sax and ! org.w3c.dom. ! ! 2002-12-20 Tom Tromey ! ! * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Handle case ! where minimum case value is Integer.MIN_VALUE. ! Fixes PR java/8955. ! ! 2002-12-18 Andrew Haley ! ! * parse.y (patch_invoke): Force evaluation order when `check' is ! set. For PR libgcj/8945. ! ! 2002-12-05 Ranjit Mathew ! Andrew Haley ! ! * parse.y (source_end_java_method): Remove custom encoding of line ! numbers for a function decl before passing it to the back end. ! ! 2002-12-03 Andrew Haley ! ! * class.c (make_class_data): New field, "chain". ! * decl.c (java_init_decl_processing): Likewise. ! ! 2002-12-02 Tom Tromey ! ! For PR java/8740: ! * parse.y (do_resolve_class): Handle qualified name via ! recursion. ! ! 2002-11-27 Kaveh R. Ghazi ! ! * decl.c (java_init_decl_processing): Use `LL' on 64-bit constant. ! ! 2002-11-25 Diego Novillo ! ! * jcf-reader.c: Don't expand JCF_readu4 inside the ! expansion of JCF_SKIP. ! ! 2002-11-22 Tom Tromey ! ! * parse.y (patch_binop): Cast right hand side of shift expression ! to `int'. Fixes PR java/8676. ! ! 2002-11-22 Ranjit Mathew ! Andrew Haley ! ! * gcc/java/jcf-write.c (write_classfile): Remove target ! class file, if it exists, before renaming the temporary ! class file to it. ! ! 2002-11-19 Jason Thorpe ! ! * jvspec.c (lang_specific_spec_functions): New. ! ! 2002-11-18 Tom Tromey ! ! Fix for PR java/7912: ! * expr.c (can_widen_reference_to): Allow cast of array to ! Cloneable or Serializable. ! * java-tree.h (java_lang_cloneable_identifier_node): Declare. ! (java_io_serializable_identifier_node): Likewise. ! * parse.y (java_lang_cloneable, java_io_serializable): Removed. ! (valid_ref_assignconv_cast_p): Use new identifier nodes. ! * lex.c (java_init_lex): Don't initialize java_lang_cloneable and ! java_io_serializable. ! * decl.c (java_init_decl_processing): Initialize ! java_lang_cloneable_identifier_node and ! java_io_serializable_identifier_node. ! (java_lang_cloneable_identifier_node): New global. ! (java_io_serializable_identifier_node): Likewise. ! ! 2002-11-14 Jens-Michael Hoffmann ! ! * buffer.c: Remove unnecessary casts. ! * check-init.c: Likewise. ! * class.c: Likewise. ! * constants.c: Likewise. ! * decl.c: Likewise. ! * except.c: Likewise. ! * gjavah.c: Likewise. ! * jcf-io.c: Likewise. ! * jcf-parse.c: Likewise. ! * jcf-path.c: Likewise. ! * jvspec.c: Likewise. ! * lang.c: Likewise. ! * lex.c: Likewise. ! * verify.c: Likewise. ! ! 2002-11-06 Tom Tromey ! ! * gjavah.c (print_stub_or_jni): Include JNIEXPORT and JNICALL in ! a JNI header. ! ! 2002-11-05 Tom Tromey ! ! Fix for PR java/6388. ! * lex.h (JAVA_INTEGRAL_RANGE_ERROR): Wrap in do...while. ! * java-tree.h (enum java_tree_index): New values ! JTI_DECIMAL_INT_MAX_NODE, JTI_DECIMAL_LONG_MAX_NODE. ! (decimal_int_max, decimal_long_max): New defines. ! * lex.c (yylex): Rewrote range checking. Sign extend literals. ! (error_if_numeric_overflow): Rewrote range checking. ! * decl.c (java_init_decl_processing): Initialize decimal_int_max, ! decimal_long_max. ! ! 2002-11-02 Tom Tromey ! ! * java-tree.h: Move JV_STATE_ERROR before JV_STATE_DONE. ! ! * class.c (make_method_value): Put class name, not signature, into ! `throws' field. For PR java/8415. ! ! 2002-10-24 Tom Tromey ! ! * gcj.texi (Invoking gij): Document --showversion. ! (Standard Properties): java.library.path now set. ! ! 2002-10-23 Tom Tromey ! ! * gjavah.c (decode_signature_piece): In JNI mode, print ! `jobjectArray' when array depth is nonzero. ! Fixes PR java/8296. ! ! 2002-10-15 Andrew Haley ! ! * parse.y (patch_invoke): Call force_evaluation_order on a static ! arg list. ! (resolve_qualified_expression_name): Call force_evaluation_order ! on a arg list that is part of a Qualified Expression Name. ! ! * lang.c (dump_compound_expr): New. ! (java_dump_tree): New. ! ! 2002-10-20 Ranjit Mathew ! ! * gcj.texi: Added item describing the GCJ runtime property ! "gnu.gcj.progname". ! ! 2002-10-15 Richard Henderson ! ! * jcf-parse.c (get_constant): Fix type warning. ! ! 2002-10-15 Andrew Haley ! ! * java-tree.h (java_inlining_merge_static_initializers): Declare. ! (java_inlining_map_static_initializers): Declare. ! ! 2002-10-14 Andrew Haley ! ! * tree-inline.c (remap_block): All local class initialization ! flags go in the outermost scope. ! (expand_call_inline): Call java_inlining_map_static_initializers. ! (expand_call_inline): Call java_inlining_merge_static_initializers. ! * java/lang.c (merge_init_test_initialization): New. ! (java_inlining_merge_static_initializers): New. ! (inline_init_test_initialization): New. ! (java_inlining_map_static_initializers): New. ! ! 2002-10-11 Mark Wielaard ! ! * gcj.texi (Compatibility): Add Limitations and Extensions section. ! ! 2002-10-10 Kaveh R. Ghazi ! ! * class.c (JAVA_TREEHASHHASH_H): Use htab_hash_pointer. ! ! 2002-10-09 Kaveh R. Ghazi ! ! * parse.y (merge_string_cste): Add parentheses around & within |. ! ! 2002-10-08 Tom Tromey ! ! * parse.y (variable_declarator_id): Simplify error path for ! array declarator error. For PR java/8003. ! ! 2002-10-08 Zack Weinberg ! ! * gjavah.c, jcf-dump.c, jv-scan.c: Globally replace GCCBUGURL with ! bug_report_url. ! ! 2002-10-08 Andrew Haley ! ! * parse.y (attach_init_test_initialization_flags): Check for ! error_mark_node. ! ! 2002-10-07 Anthony Green ! ! * parse.y (merge_string_cste): Fix bug in string concatenation. ! ! 2002-10-03 Michael Koch ! ! * gcj.texi (Standard properties): ! Change default of java.awt.toolkit to gnu.awt.gtk.GtkToolkit. ! ! 2002-10-02 Roger Sayle PR optimization/6627 ! * lang.c (java_init): If storing the vbit in function pointers, ensure that force_align_functions_log is atleast one to aid compatability with g++ vtables. ! 2002-10-01 Nathan Sidwell ! * jcf-dump.c (print_constant, case CONSTANT_float): Don't fall ! foul of type-based aliasing. ! ! 2002-09-30 Anthony Green ! ! * gcj.texi (Invoking jv-scan): Fix texinfo. ! ! 2002-09-28 Anthony Green ! ! * gcj.texi (Invoking jv-scan): Add --no-assert documentation. ! (Code Generation): Add -fno-assert documentation. ! * jv-scan.c (flag_assert): New global. ! (options): Add assert option. ! (help): Add --no-assert documentation. ! * parse-scan.y (flag_assert): New global. ! * lang.c (lang_f_options): Add -fassert/-fno-assert support. ! (flag_assert): New global. ! * java-tree.h (flag_assert): New global. ! * lex.c (java_lex): Obey flag_assert. ! * jvspec.c (jvgenmain_spec): Strip -fassert/-fno-assert when ! calling cc1. ! ! 2002-09-26 Andrew Haley ! ! * expr.c (build_java_array_length_access): Check for null pointer. ! * expr.c (expand_java_arrayload): Likewise. ! ! 2002-09-21 Richard Henderson ! ! * jcf-parse.c (get_constant): Decode from IEEE no matter ! what the target format. ! ! 2002-09-20 Kazu Hirata ! ! * ChangeLog: Follow spelling conventions. ! * class.c: Likewise. ! * decl.c: Likewise. ! * expr.c: Likewise. ! * gjavah.c: Likewise. ! * java-tree.h: Likewise. ! * jcf-dump.c: Likewise. ! * jcf-parse.c: Likewise. ! * jvspec.c: Likewise. ! * lang.c: Likewise. ! * mangle.c: Likewise. ! * parse.y: Likewise. ! ! 2002-09-17 Tom Tromey ! ! * lex.c (java_read_unicode_collapsing_terminators): Handle case ! where \r appears at EOF. Fixes PR java/7950. ! ! 2002-09-16 Geoffrey Keating ! ! * java-tree.h (union lang_tree_node): Add chain_next option. ! ! 2002-09-16 Richard Henderson ! ! * jcf-parse.c (get_constant): Runtime check for IEEE format; ! use new real.h interface. ! * jcf-write.c (find_constant_index): Use new real.h interface. ! * lex.c (IS_ZERO): Use REAL_VALUES_EQUAL. ! ! 2002-09-15 Kazu Hirata ! ! * lang.c: Follow spelling conventions. ! ! 2002-09-11 Per Bothner ! ! * parse.y (fold_constant_for_init): If a VAR_DECL, convert numerical ! constant to the type of the field. ! (java_complete_tree): Remove now-redundant code. ! ! * parse.y (fold_constant_for_init): 'null' is not a constant expr. ! ! 2002-09-03 Jesse Rosenstock ! ! For PR java/5794: ! * verify.c (verify_jvm_instructions) [OPCODE_jsr]: Only push the ! return label if a ret instruction for the jsr has been reached. ! ! 2002-09-09 Ranjit Mathew ! ! * parse.y (DIR_SEPARATOR): Don't define. ! (check_class_interface_creation): Use IS_DIR_SEPARATOR. ! ! 2002-08-28 Andrew Haley ! ! * verify.c (verify_jvm_instructions): Allow exception handler ! inside code that is being protected, but generate a warning. ! * except.c (link_handler): Initialize `expanded' in new eh_range. ! (binding_depth, is_class_level, current_pc): Declare extern. ! ! 2002-09-01 Mark Wielaard ! ! * gcj.texi: Add chapter about system properties. ! Fixed some typos. ! ! 2002-08-26 Tom Tromey ! ! * parse.y (try_builtin_assignconv): Allow narrowing primitive ! conversion if RHS_TYPE is byte, short, or char. ! ! 2002-08-22 Tom Tromey ! ! * gcj.texi (Invoking gij): Document -cp and -classpath. ! ! 2002-08-21 Tom Tromey ! ! * Make-lang.in (java/jcf-path.o): Use $(datadir), not ! $(prefix)/share. For PR libgcj/7633. ! ! For PR java/6005 and PR java/7611: ! * lang.c (LANG_HOOKS_CAN_USE_BITFIELDS_P): New define. ! (java_can_use_bit_fields_p): New function. ! ! 2002-08-16 Tom Tromey ! ! * gcj.texi (Class Initialization): Mention class initialization of ! arrays. ! ! 2002-07-30 Andrew Haley ! ! * Make-lang.in (java-tree-inline.o): New. ! (JAVA_OBJS): Add java-tree-inline.o. ! * parse.y (source_end_java_method): Call java_optimize_inline. ! (java_expand_method_bodies): Save method's tree in ! DECL_SAVED_TREE. ! (add_stmt_to_compound): Keep track of the number of statments. ! * lang.c (java_init): Enable flag_inline_trees. ! (java_post_options): If flag_inline_functions is on, enable ! flag_inline_trees instread. ! (decl_constant_value): New. ! (java_tree_inlining_walk_subtrees): New. ! * java-tree.h (DECL_NUM_STMTS): New macro. ! (java_optimize_inline): Declare. ! * expr.c (java_expand_expr): Allow a BLOCK to return a value. ! Handle a LABEL_EXPR. ! * decl.c (build_result_decl): If we already have a DECL_RESULT ! don't make another. ! (dump_function): New. ! (java_optimize_inline): New. ! (dump_function): New. ! ! 2002-08-13 Jesse Rosenstock ! ! For PR java/7483: ! * parse.y (build_assertion): Invert return from ! desiredAssertionStatus. ! ! 2002-08-08 Bryce McKinlay ! ! * jcf-write.c (get_access_flags): Return correct access flags for ! private and protected inner classes. ! ! 2002-08-08 Nathan Sidwell ! ! * java/Make-lang.in (java.mostlyclean): Remove coverage files. ! ! 2002-08-05 Geoffrey Keating ! ! * mangle_name.c: Don't include obstack.h twice. ! * xref.c: Don't include obstack.h. ! ! 2002-08-04 Geoffrey Keating ! ! * class.c: (permanent_obstack): Delete declaration. ! * constants.c: (permanent_obstack): Delete declaration. ! * except.c: (permanent_obstack): Delete declaration. ! * expr.c: (permanent_obstack): Delete declaration. ! * jcf-parse.c: (permanent_obstack): Delete declaration. ! (saveable_obstack): Delete declaration. ! * parse.h: (permanent_obstack): Delete declaration. ! * typeck.c: (permanent_obstack): Delete declaration. 2002-08-04 Joseph S. Myers ! * gcj.texi (version-gcc): Increase to 3.3. ! 2002-07-22 Tom Tromey ! * lex.c (java_lex): Check for `e' or `E' after 0. ! ! 2002-07-21 Richard Henderson ! ! * lang.c (java_unsafe_for_reeval): New. ! (LANG_HOOKS_UNSAFE_FOR_REEVAL): New. ! ! 2002-07-21 Neil Booth ! ! * jcf-path.c (GET_ENV_PATH_LIST): Remove. ! (jcf_path_init): Use GET_ENVIRONMENT. ! ! 2002-07-10 Roger Sayle ! Zack Weinberg ! ! * builtins.c (initialize_builtins): Remove defines that ! handled C/C++ specific junk hereby removed from builtins.def. ! ! 2002-07-07 Neil Booth ! ! * lang.c (java_post_options): Update prototype. ! ! 2002-07-05 Roger Sayle ! ! * builtins.c (initialize_builtins): Ignore the additional ! parameter to DEF_BUILTIN. Handle more C/C++ specific junk in ! the builtins.def file. ! ! 2002-07-01 Tom Tromey ! ! For PR libgcj/7073: ! * parse.y (patch_incomplete_class_ref): Handle VOID_TYPE ! specially. ! ! 2002-07-01 Roger Sayle ! ! * java/decl.c (builtin_function): Accept additional parameter. ! (java_init_decl_processing): Pass an additional NULL_TREE ! argument to builtin_function. ! ! 2002-06-29 T.J. Mather ! ! * gcj.texi: Fixed gcj invocation example so that it compiles. ! ! 2002-06-26 Kaveh R. Ghazi ! ! * lex.c (java_init_lex): Avoid incorrect hardcoded constant 11. ! * parse.y (mark_parser_ctxt): Likewise. ! (check_modifiers, declare_local_variables): Avoid incorrect ! hardcoded constant 10. ! ! * lex.c (java_read_char): Avoid "comparison is always true" ! warning. 2002-06-25 Andreas Schwab * expr.c (JSR): Avoid undefined operation on PC. + 2002-06-21 Kaveh R. Ghazi + + * decl.c (clear_binding_level): Const-ify. + + 2002-06-13 Akim Demaille + + * parse.y (class_declaration, interface_declaration): Make sure + all their rules have an action, in order to avoid meaningless `$$ + = $1' and their type clashes. + + 2002-06-11 Tom Tromey + + * jcf-write.c (generate_classfile): Use FIELD_SYNTHETIC. + * parse-scan.y (statement_without_trailing_substatement): Added + assert_statement. + (assert_statement): New rule. + * java-tree.h (struct lang_type) [assertions]: New field. + (TYPE_USES_ASSERTIONS): New macro. + (CLASS_USES_ASSERTIONS): Likewise. + (FIELD_SYNTHETIC): New define. + * lex.c (java_lval;): Added ASSERT_TK. + * parse.y (ASSERT_TK): Added. + (statement_without_trailing_substatement): Added assert_statement. + (assert_statement): New rule. + (build_assertion): New function. + (maybe_generate_pre_expand_clinit): Create and initialize + $assertionsDisabled. + (lookup_package_type): Removed decl. + * keyword.h: Rebuilt. + * keyword.gperf (assert): New token. + + 2002-06-10 Akim Demaille + + * parse.y (interface_type_list, class_member_declaration) + (unary_expression_not_plus_minus): Remove duplicate %type. + Whitespace changes. + + 2002-06-09 Tom Tromey + + * Make-lang.in (java/lang.o): Use LANGHOOKS_DEF_H. + + * parse.y (method_header): Give error message in all cases. + Fixes PR java/6865. + 2002-06-10 Bryce McKinlay Don't use RTL inlining. Fix for PR java/6820. *************** *** 86,98 **** (java_post_options): New function. Turn off inlining unless flag_really_inline is set. 2002-06-08 H.J. Lu (hjl@gnu.org) * jcf-path.c (jcf_path_init): Allocate 1 more byte for string. ! 2002-06-03 Mark Mitchell ! 2002-05-18 Mark Mitchell * java-tree.h (CLASS_BEING_LAIDOUT): Remove duplicate definition. * jcf-io.c (dirent.h): Include it. (fnmatch.h): Likewise. --- 742,895 ---- (java_post_options): New function. Turn off inlining unless flag_really_inline is set. + 2002-06-10 Bryce McKinlay + + * gjavah.c (throwable_p): Accept argument as either a classname or + signature fragment. Create null-terminated classname string for super + when calling itself recursively. + (decode_signature_piece): Skip first character from class name + signature when calling throwable_p. + 2002-06-08 H.J. Lu (hjl@gnu.org) * jcf-path.c (jcf_path_init): Allocate 1 more byte for string. ! 2002-06-04 Tom Tromey ! * jcf-write.c (perform_relocations): Optmize a goto to a goto. ! ! 2002-06-04 Michael Koch ! ! * gcj.texi (Input Options): Fixed typo. ! ! 2002-06-04 Zack Weinberg ! ! * java-tree.h, class.c, expr.c, jcf-parse.c, parse.y, ! typeck.c, verify.c: Remove all #if JAVA_USE_HANDLES blocks, ! all mention of CLASS_TO_HANDLE_TYPE or HANDLE_TO_CLASS_TYPE, ! and all now-pointless local variables. Rename other local ! variables to reflect their not being handles. ! ! * java-tree.h, jcf-dump.c, jcf-io.c: Remove all ! #if JCF_USE_STDIO blocks. ! ! * parse.y: Add missing semicolon at end of rule. ! ! 2002-06-03 Geoffrey Keating ! ! * check-init.c (attach_initialized_static_class): Delete, unused. ! * parse.y: Use htab_t instead of struct hashtable, update ! all uses. ! * java-tree.h: Include hashtab.h instead of hash.h. ! (struct lang_decl_func): Use htab_t, set up for gengtype. ! (struct init_test_hash_entry): Delete. ! (struct treetreehash_entry): New. ! (java_treetreehash_find): New ! (java_treetreehash_new): New prototype. ! (java_treetreehash_create): New prototype. ! (java_mark_tree): Delete prototype. ! (java_hash_hash_tree_node): Delete prototype. ! (java_hash_compare_tree_node): Delete prototype. ! (attach_initialized_static_class): Delete prototype. ! * expr.c (build_class_init): Update to use java_treetreehash ! functions. ! (java_expand_expr): Update to use htab_t. ! (emit_init_test_initialization): Likewise. ! * decl.c (java_mark_tree): Delete. ! * class.c (init_test_hash_newfunc): Delete. ! (java_hash_hash_tree_node): Delete. ! (java_hash_compare_tree_node): Delete. ! (add_method_1): Update to use java_treetreehash functions. ! (JAVA_TREEHASHHASH_H): New macro. ! (java_treetreehash_hash): New function. ! (java_treetreehash_compare): New function. ! (java_treetreehash_find): New function. ! (java_treetreehash_new): New function. ! (java_treetreehash_create): New function. ! * Make-lang.in (JAVA_TREE_H): Replace hash.h by HASHTAB_H. ! ! * Make-lang.in (java/parse.o): Depend on debug.h. ! * java-tree.h (struct lang_identifier): Use gengtype. ! (union lang_tree_node): New. ! (struct lang_decl_func): Use gengtype. ! (struct lang_decl_var): Likewise. ! (struct lang_decl): Likewise. ! * parse.y: Include debug.h. ! * lang.c (LANG_HOOKS_MARK_TREE): Delete. ! ! * lang.c (struct language_function): New dummy structure. ! ! * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Set ! descriminator for DECL_LANG_SPECIFIC. ! (struct lang_decl_func): Rename from struct lang_decl. ! (enum lang_decl_desc): New. ! (struct lang_decl): Make it a union. Update all the accessor macros. ! (struct lang_type): Use gengtype. ! * class.c (add_method_1): Set descriminator for DECL_LANG_SPECIFIC. ! * decl.c (java_dup_lang_specific_decl): All lang_decl structures ! are now the same size. ! (lang_mark_tree): Use gengtype to mark TYPE_LANG_SPECIFIC; ! use discriminator to mark DECL_LANG_SPECIFIC. ! ! * Make-lang.in (gt-java-builtins.h): New rule. ! (java/builtins.o): Add dependency on gt-.h. ! * builtins.c: Use gengtype for roots. ! (union string_or_tree): Use gengtype. ! (struct builtin_record): Use gengtype. ! * config-lang.in (gtfiles): Add builtins.c. ! ! * Make-lang.in (gt-java-class.h, gt-java-constants.h, ! gt-java-decl.h, gt-java-expr.h, gt-java-jcf-parse.h, ! gt-java-jcf-write.h, gt-java-lang.h, gt-java-mangle.h, ! gt-java-parse.h, gtype-java.h): Add rules to generate. ! (parse.o): Add dependency on gt-java-parse.h, gt-java.h. ! (class.o): Add dependency on gt-*.h. ! (constants.o): Likewise. ! (decl.o): Likewise. ! (expr.o): Likewise. ! (jcf-parse.o): Likewise. ! (jcf-write.o): Likewise. ! (lang.o): Likewise. ! * config-lang.in (gtfiles): New. ! * class.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h. ! * constants.c: Replace uses of ggc_add_* with GTY markers. ! Include gt-*.h. ! * decl.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h. ! * expr.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h. ! * java-tree.h: Replace uses of ggc_add_* with GTY markers. ! * jcf-parse.c: Replace uses of ggc_add_* with GTY markers. ! Include gt-*.h. ! * jcf-write.c: Replace uses of ggc_add_* with GTY markers. ! Include gt-*.h. ! * lang.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h. ! * mangle.c: Replace uses of ggc_add_* with GTY markers. Include ! gt-*.h. ! * parse.y: Replace uses of ggc_add_* with GTY markers. Include gt-*.h. ! Include gtype-java.h. ! ! 2002-06-02 Tom Tromey ! ! Fix for PR java/5913: ! * parse.y (patch_binop): Call patch_string on op1. ! ! 2002-06-02 Tom Tromey ! ! Fix for PR java/1343, PR java/6336: ! * parse.y (make_nested_class_name): Remove extraneous `else'; fix ! formatting. Changed return type. ! (anonymous_class_counter): Moved to top of file. ! (maybe_make_nested_class_name): Append number to class name for ! function-local classes. ! ! 2002-05-28 Zack Weinberg ! ! * decl.c, jcf-parse.c, parse.y, typeck.c: Include real.h. ! * Make-lang.in: Update dependency lists. ! ! 2002-05-18 Mark Mitchell ! ! * gjavah.c (throwable_p): Do not free the name of the class after ! passing it to find_class. * java-tree.h (CLASS_BEING_LAIDOUT): Remove duplicate definition. * jcf-io.c (dirent.h): Include it. (fnmatch.h): Likewise. *************** *** 109,131 **** * parse.y (java_expand_classes): Write the class files in reverse order. ! 2002-05-13 Mark Mitchell ! * jcf-write.c (write_classfile): Unlink the temporary file if it ! cannot be renamed. Use concat to build up the name of the ! temporary file. - 2002-05-13 Mark Mitchell * jcf-write.c (write_classfile): Unlink the temporary file if it cannot be renamed. Use concat to build up the name of the temporary file. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. 2002-04-24 Tom Tromey --- 906,970 ---- * parse.y (java_expand_classes): Write the class files in reverse order. ! 2002-05-16 Rainer Orth ! ! * Make-lang.in: Allow for PWDCMD to override hardcoded pwd. ! ! 2002-05-13 Mark Mitchell * jcf-write.c (write_classfile): Unlink the temporary file if it cannot be renamed. Use concat to build up the name of the temporary file. ! 2002-05-08 Mark Mitchell ! * jcf-write.c (write_classfile): Write the file to a ! temporary file and then rename it. ! 2002-05-07 Tom Tromey ! * gjavah.c (throwable_p): Use xstrdup, not strdup. ! ! Fix for PR java/1200: ! * gjavah.c (throwable_p): New function. ! (decode_signature_piece): Use it. A `WeakReference' isn't the ! same as a `jweak'. ! Include hashtab.h. ! (gcjh_streq): New function. ! ! 2002-05-07 Andreas Jaeger ! ! * parse.y (finish_for_loop): Fix if statement. ! ! 2002-05-06 Tom Tromey ! ! Fix for PR java/5941: ! * parse.y (finish_for_loop): Set SUPPRESS_UNREACHABLE_ERROR for ! loop update expression. ! (java_complete_lhs): Use SUPPRESS_UNREACHABLE_ERROR. ! * java-tree.h (SUPPRESS_UNREACHABLE_ERROR): New macro. ! ! 2002-05-04 Mark Wielaard ! ! For PR java/6519: ! * parse.y (build_string_concatenation): Return just op1 only when op2 ! is null and op1 is a STRING_CST, otherwise always construct a ! StringBuffer. ! ! 2002-04-27 Tom Tromey ! ! For PR java/6382: ! * parse.y (string_convert_int_cst): New function. ! (merge_string_cste): Use it. ! ! 2002-04-25 Neil Booth ! ! * java-tree.h (java_parse_file): Update. ! (java_set_yydebug): Remove. ! * jcf-parse.c (yydebug): Remove. ! (java_set_yydebug): Die. ! (java_parse_file): Update. ! * lang.c (LANG_HOOKS_SET_YYDEBUG): Remove. 2002-04-24 Tom Tromey *************** *** 139,149 **** * java-tree.h (BCODE_RETURN_TARGET): Removed - never set. (BCODE_TARGET): Remove BCODE_RETURN_TARGET. - Tue Apr 23 14:31:23 2002 Anthony Green - - * gcj.texi (Invoking rmiregistry): Fix rmiregistry command - synopsis. - 2002-04-23 Tom Tromey For PR java/6314: --- 978,983 ---- *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 165,171 **** * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned HOST_WIDE_INT for num. Use JPOOL_UINT to get it. ! CONSTANT_Double: Use JPOOL_UINT to get both halves of a double. 2002-04-18 Bryce McKinlay --- 999,1009 ---- * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned HOST_WIDE_INT for num. Use JPOOL_UINT to get it. ! CONSTANT_Double: Use JPOOL_UINT to get both halve of a double. ! ! 2002-04-18 Neil Booth ! ! * typeck.c (incomplete_type_error): Remove. 2002-04-18 Bryce McKinlay *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 250,260 **** * gcj.texi (Invocation): Document CNI invocation API. ! 2002-04-05 Nic Ferrier ! * gcj.texi: @code{gcj} becomes @command{gcj}. ! @code{gcc} becomes @command{gcc}. ! GcjRaw changed to gnu.gcc.RawData. 2002-03-29 Martin Kahlert --- 1088,1125 ---- * gcj.texi (Invocation): Document CNI invocation API. ! 2002-04-04 Neil Booth ! * expr.c (truthvalue_conversion): Rename. Update. ! (expand_compare): Update. ! * java-tree.h (java_truthvalue_conversion): New. ! * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. ! ! 2002-04-01 Neil Booth ! ! * java-tree.h (java_mark_addressable): New. ! * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. ! * typeck.c (mark_addressable): Rename, update. ! ! 2002-04-01 Neil Booth ! ! * expr.c (build_java_binop): Update. ! * java-tree.h (java_signed_type, java_unsigned_type, ! java_signed_or_unsigned_type): Update. ! * lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, ! LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. ! * parse.y (patch_binop): Update. ! * typeck.c (signed_or_unsigned_type, unsigned_type, ! signed_type): Update. ! ! 2002-03-31 Neil Booth ! ! * lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine. ! (java_dummy_print): Remove. ! (lang_print_error): Rename. Exit early if inhibiting output. ! (inhibit_error_printing_function): New. ! (java_init): Don't set hook. ! (lang_init_source): Use new boolean. 2002-03-29 Martin Kahlert *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 265,270 **** --- 1130,1146 ---- * parse.y (check_inner_circular_reference): Ignore incomplete types. + 2002-03-29 Neil Booth + + * Make-lang.in (builtins.o): Update. + * boehm.c (get_boehm_type_descriptor): Update. + * builtins.c: Include langhooks.h. + * decl.c (java_init_decl_processing): Update. + * java-tree.h (java_type_for_mode, java_type_for_size): New. + * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE): + Redefine. + * typeck.c (type_for_mode, type_for_size): Update. + 2002-03-29 Martin Kahlert * lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING. *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 281,286 **** --- 1157,1166 ---- (read_class): Call it. (java_parse_file): Likewise. + Thu Mar 28 13:22:22 CET 2002 Jan Hubicka + + * java/lang.c (java_init_options): Set flag_trapping_math to 0. + 2002-03-28 Bryce McKinlay * parse.y (resolve_package): Initialize "decl". *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 300,310 **** * expr.c (expand_invoke): Don't generate null pointer check if we're calling . 2002-03-27 Bryce McKinlay Fix for PR java/5850: * parse.y (lookup_field_wrapper): Call itself recursively for enclosing ! context if nothing was found in the current context. * expr.c (lookup_field): Don't look in enclosing contexts. 2002-03-26 Tom Tromey --- 1180,1198 ---- * expr.c (expand_invoke): Don't generate null pointer check if we're calling . + 2002-03-27 Neil Booth + + * expr.c (java_lang_expand_expr): Rename java_expand_expr, + fix prototype. + * java-tree.h (java_lang_expand_expr): Similarly. + * lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine. + (java_init): Don't set hook. + 2002-03-27 Bryce McKinlay Fix for PR java/5850: * parse.y (lookup_field_wrapper): Call itself recursively for enclosing ! context if field was not found in the current scope. * expr.c (lookup_field): Don't look in enclosing contexts. 2002-03-26 Tom Tromey *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 314,327 **** * parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12 elements, not 11. 2002-03-22 Mark Wielaard Fix for PR java/5368: * parse.y (resolve_qualified_expression_name): Use decl not field_decl when printing error message. 2002-03-22 Tom Tromey ! Andrew Haley * expr.c (build_field_ref): Don't build a check if the field is a member of `this'. --- 1202,1232 ---- * parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12 elements, not 11. + 2002-03-26 Neil Booth + + * decl.c (lang_mark_tree): Rename java_mark_tree. + * java-tree.h (java_mark_tree): New. + * java-lang.c (LANG_HOOKS_MARK_TREE): Redefine. + + 2002-03-25 Zack Weinberg + + * lex.c: Change java_perform_atof to take normal parameters + instead of a pointer to a parameter block. Call it directly + from java_lex. + 2002-03-22 Mark Wielaard Fix for PR java/5368: * parse.y (resolve_qualified_expression_name): Use decl not field_decl when printing error message. + 2002-03-25 Neil Booth + + * decl.c (maybe_build_cleanup): Remove. + 2002-03-22 Tom Tromey ! ! Andrew Haley * expr.c (build_field_ref): Don't build a check if the field is a member of `this'. *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 336,341 **** --- 1241,1263 ---- * parse.y (build_access_to_thisn): Stop when FROM is not an inner class. + 2002-03-21 Neil Booth + + * cp-tree.h (pushdecl, pushlevel, poplevel, set_block, + insert_block, getdecls, kept_level_p, global_bindings_p): New. + + 2002-03-20 Nic Ferrier + + * gcj.texi: @code{gcj} becomes @command{gcj}. + @code{gcc} becomes @command{gcc}. + GcjRaw changed to gnu.gcc.RawData. + + 2002-03-20 Neil Booth + + * decl.c (start_java_method): Use new hook. + * lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine. + (java_init): Remove old hook. + 2002-03-18 Alexandre Petit-Bianco * builtins.c (define_builtin): Do nothing if `type' is null. *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 350,355 **** --- 1272,1283 ---- * jcf-parse.c (get_constant): Delete unused variables. + 2002-03-17 Neil Booth + + * java-tree.h (java_parse_file): New. + * jcf-parse.c (yyparse): Rename java_parse_file. + * lang.c (LANG_HOOKS_PARSE_FILE): Redefine. + 2002-03-16 Bryce McKinlay * parse.y (craft_constructor): Return the constructor decl. *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 362,374 **** * jcf-parse.c (yyparse): Don't emit class registration constructor when compiling resource files. 2002-03-12 Tom Tromey * jcf-parse.c (get_constant) [CONSTANT_String]: String values are UTF-8, not UCS-2. Fixes PR java/5923. - 2002-03-12 Tom Tromey - * parse.y (qualify_ambiguous_name): Handle case where QUAL_WFL is a call_expr wrapped in a convert. Fixes PR java/5848. --- 1290,1308 ---- * jcf-parse.c (yyparse): Don't emit class registration constructor when compiling resource files. + 2002-03-12 Kaveh R. Ghazi + + * lang.c (java_tree_code_type, java_tree_code_length, + tree_code_name): Delete. + (tree_code_type, tree_code_length, tree_code_name): Define. + (java_init): Don't try to copy into the various tree_code + arrays. + 2002-03-12 Tom Tromey * jcf-parse.c (get_constant) [CONSTANT_String]: String values are UTF-8, not UCS-2. Fixes PR java/5923. * parse.y (qualify_ambiguous_name): Handle case where QUAL_WFL is a call_expr wrapped in a convert. Fixes PR java/5848. *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 412,423 **** --- 1346,1378 ---- Do the latter on if the return_pc has been verified (the jsr returns). (JSR): Now just call build_java_jsr. + 2002-03-07 Jeff Sturm + + * java/Make-lang.in (JAVA_TARGET_INSTALL_NAME): Define. + (java.install-common): Link native driver to + JAVA_TARGET_INSTALL_NAME. + 2002-03-05 David Billinghurst * builtins.c(cos_builtin): method_return_type ATTRIBUTE_UNUSED * builtins.c(sin_builtin): Likewise * builtins.c(sqrt_builtin): Likewise + 2002-03-03 Zack Weinberg + + * java/expr.c, java/jcf-parse.c, java/lex.c: + Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef + REAL_ARITHMETIC blocks unconditional. Delete some further + #ifdef blocks predicated on REAL_ARITHMETIC. + + 2002-03-03 Kaveh R. Ghazi + + * class.c (init_class_processing): Use ARRAY_SIZE in lieu of + explicit sizeof/sizeof. + * decl.c (java_init_decl_processing): Likewise. + * jcf-parse.c (init_jcf_parse): Likewise. + * parse.y (init_src_parse): Likewise. + 2002-03-02 Per Bothner Make --CLASSPATH by a synonym for --classpath and -classpath. *************** Tue Apr 23 14:31:23 2002 Anthony Green *** 480,485 **** --- 1435,1452 ---- * jvspec.c: Don't pass store-check option to jvgenmain. * lang-options.h: Add help string for -fno-store-check. + 2002-02-28 Neil Booth + + * decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl. + * java-tree.h (java_dup_lang_specific_decl): New. + * lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine. + + 2002-02-27 Zack Weinberg + + * builtins.c, decl.c: Delete traditional-mode-related code + copied from the C front end but not used, or used only to + permit the compiler to link. + 2002-02-22 Tom Tromey Fix for PR java/2369: *************** Tue Oct 23 14:02:17 2001 Richard Kenner *** 2361,2367 **** (generate_classfile): Compute the attribute count, invoke `append_gcj_attribute'. * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source' ! turned into bit fields. New bit field `right_zip.' (JCF_ZERO): Set `right_zip' to zero. * lang-options.h (-fforce-classes-archive-check): Added flag. * lang.c (flag_force_classes_archive_check): New flag. --- 3328,3334 ---- (generate_classfile): Compute the attribute count, invoke `append_gcj_attribute'. * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source' ! turned into bit-fields. New bit-field `right_zip.' (JCF_ZERO): Set `right_zip' to zero. * lang-options.h (-fforce-classes-archive-check): Added flag. * lang.c (flag_force_classes_archive_check): New flag. *************** Fri Dec 24 00:25:29 1999 Alexandre Peti *** 6443,6450 **** * jcf.h (typedef struct JCF): Field `outofsynch' deleted. (jcf_out_of_synch): Prototype deleted. * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag', ! `deprecated' and `class_err': integer turned into bit fields. ! New bit fields `saved_data_ctx' and `saved_data'. Fixed comments. * parse.y (package_list): New global. (package_declaration:): Record newly parsed package name. (extra_ctxp_pushed_p): Static global deleted. --- 7410,7417 ---- * jcf.h (typedef struct JCF): Field `outofsynch' deleted. (jcf_out_of_synch): Prototype deleted. * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag', ! `deprecated' and `class_err': integer turned into bit-fields. ! New bit-fields `saved_data_ctx' and `saved_data'. Fixed comments. * parse.y (package_list): New global. (package_declaration:): Record newly parsed package name. (extra_ctxp_pushed_p): Static global deleted. *************** Mon Apr 27 10:50:05 1998 Alexandre Peti *** 12419,12425 **** this_wfl. Call to parse_error_context uses this_wfl instead of relying on lookup_cl. (parser_check_super): Comment reflects function's new returned ! type (int). Function returns non zero value on error. (create_jdep_list, reverse_jdep_list, obtain_incomplete_type, register_incomplete_type, jdep_resolve_class): New functions to handle incomplete types in declarations. --- 13386,13392 ---- this_wfl. Call to parse_error_context uses this_wfl instead of relying on lookup_cl. (parser_check_super): Comment reflects function's new returned ! type (int). Function returns nonzero value on error. (create_jdep_list, reverse_jdep_list, obtain_incomplete_type, register_incomplete_type, jdep_resolve_class): New functions to handle incomplete types in declarations. diff -Nrc3pad gcc-3.2.3/gcc/java/check-init.c gcc-3.3/gcc/java/check-init.c *** gcc-3.2.3/gcc/java/check-init.c 2002-02-28 11:42:09.000000000 +0000 --- gcc-3.3/gcc/java/check-init.c 2002-11-18 15:46:31.000000000 +0000 *************** static tree get_variable_decl PARAMS ((t *** 108,114 **** static void final_assign_error PARAMS ((tree)); static void check_final_reassigned PARAMS ((tree, words)); ! #define ALLOC_WORDS(NUM) ((word*) xmalloc ((NUM) * sizeof (word))) #define FREE_WORDS(PTR) (free (PTR)) /* DECLARE_BUFFERS is used to allocate NUMBUFFER bit sets, each of --- 108,114 ---- static void final_assign_error PARAMS ((tree)); static void check_final_reassigned PARAMS ((tree, words)); ! #define ALLOC_WORDS(NUM) (xmalloc ((NUM) * sizeof (word))) #define FREE_WORDS(PTR) (free (PTR)) /* DECLARE_BUFFERS is used to allocate NUMBUFFER bit sets, each of *************** check_init (exp, before) *** 607,614 **** if (fndecl && METHOD_STATIC (fndecl) && (DECL_INITIAL (decl) == boolean_true_node || (index >= 0 && ASSIGNED_P (tmp, index)))) ! hash_lookup (&DECL_FUNCTION_INITIALIZED_CLASS_TABLE (fndecl), ! DECL_FUNCTION_INIT_TEST_CLASS(decl), TRUE, NULL); } DECL_BIT_INDEX (decl) = -1; } --- 607,616 ---- if (fndecl && METHOD_STATIC (fndecl) && (DECL_INITIAL (decl) == boolean_true_node || (index >= 0 && ASSIGNED_P (tmp, index)))) ! *(htab_find_slot ! (DECL_FUNCTION_INITIALIZED_CLASS_TABLE (fndecl), ! DECL_FUNCTION_INIT_TEST_CLASS (decl), INSERT)) = ! DECL_FUNCTION_INIT_TEST_CLASS (decl); } DECL_BIT_INDEX (decl) = -1; } *************** check_for_initialization (body, mdecl) *** 999,1025 **** start_current_locals = num_current_locals = 0; } - - /* Call for every element in DECL_FUNCTION_INITIALIZED_CLASS_TABLE of - a method to consider whether the type indirectly described by ENTRY - is definitly initialized and thus remembered as such. */ - - bool - attach_initialized_static_class (entry, ptr) - struct hash_entry *entry; - PTR ptr; - { - struct init_test_hash_entry *ite = (struct init_test_hash_entry *) entry; - tree fndecl = DECL_CONTEXT (ite->init_test_decl); - int index = DECL_BIT_INDEX (ite->init_test_decl); - - /* If the initializer flag has been definitly assigned (not taking - into account its first mandatory assignment which has been - already added but escaped analysis.) */ - if (fndecl && METHOD_STATIC (fndecl) - && (DECL_INITIAL (ite->init_test_decl) == boolean_true_node - || (index >= 0 && ASSIGNED_P (((word *) ptr), index)))) - hash_lookup (&DECL_FUNCTION_INITIALIZED_CLASS_TABLE (fndecl), - entry->key, TRUE, NULL); - return true; - } --- 1001,1003 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/class.c gcc-3.3/gcc/java/class.c *** gcc-3.2.3/gcc/java/class.c 2002-04-17 23:20:43.000000000 +0000 --- gcc-3.3/gcc/java/class.c 2003-02-28 20:53:07.000000000 +0000 *************** *** 1,5 **** /* Functions related to building classes and their related objects. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Functions related to building classes and their related objects. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU CC. *************** static tree get_dispatch_table PARAMS (( *** 55,69 **** static void add_interface_do PARAMS ((tree, tree, int)); static tree maybe_layout_super_class PARAMS ((tree, tree)); static int assume_compiled PARAMS ((const char *)); - static struct hash_entry *init_test_hash_newfunc PARAMS ((struct hash_entry *, - struct hash_table *, - hash_table_key)); static tree build_method_symbols_entry PARAMS ((tree)); ! static rtx registerClass_libfunc; ! static rtx registerResource_libfunc; - extern struct obstack permanent_obstack; struct obstack temporary_obstack; /* The compiler generates different code depending on whether or not --- 55,65 ---- static void add_interface_do PARAMS ((tree, tree, int)); static tree maybe_layout_super_class PARAMS ((tree, tree)); static int assume_compiled PARAMS ((const char *)); static tree build_method_symbols_entry PARAMS ((tree)); ! static GTY(()) rtx registerClass_libfunc; ! static GTY(()) rtx registerResource_libfunc; struct obstack temporary_obstack; /* The compiler generates different code depending on whether or not *************** typedef struct assume_compiled_node_stru *** 79,85 **** /* The class or package name. */ const char *ident; ! /* Non-zero if this represents an exclusion. */ int excludep; /* Pointers to other nodes in the tree. */ --- 75,81 ---- /* The class or package name. */ const char *ident; ! /* Nonzero if this represents an exclusion. */ int excludep; /* Pointers to other nodes in the tree. */ *************** static assume_compiled_node *find_assume *** 95,102 **** static assume_compiled_node *assume_compiled_tree; ! static tree class_roots[5] ! = { NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE }; #define registered_class class_roots[0] #define fields_ident class_roots[1] /* get_identifier ("fields") */ #define info_ident class_roots[2] /* get_identifier ("info") */ --- 91,97 ---- static assume_compiled_node *assume_compiled_tree; ! static GTY(()) tree class_roots[5]; #define registered_class class_roots[0] #define fields_ident class_roots[1] /* get_identifier ("fields") */ #define info_ident class_roots[2] /* get_identifier ("info") */ *************** find_assume_compiled_node (node, ident) *** 146,152 **** } /* Add a new IDENT to the include/exclude tree. It's an exclusion ! if EXCLUDEP is non-zero. */ void add_assume_compiled (ident, excludep) --- 141,147 ---- } /* Add a new IDENT to the include/exclude tree. It's an exclusion ! if EXCLUDEP is nonzero. */ void add_assume_compiled (ident, excludep) *************** add_assume_compiled (ident, excludep) *** 155,161 **** { assume_compiled_node *parent; assume_compiled_node *node = ! (assume_compiled_node *) xmalloc (sizeof (assume_compiled_node)); node->ident = xstrdup (ident); node->excludep = excludep; --- 150,156 ---- { assume_compiled_node *parent; assume_compiled_node *node = ! xmalloc (sizeof (assume_compiled_node)); node->ident = xstrdup (ident); node->excludep = excludep; *************** add_assume_compiled (ident, excludep) *** 165,172 **** if (NULL == assume_compiled_tree) { ! assume_compiled_tree = ! (assume_compiled_node *) xmalloc (sizeof (assume_compiled_node)); assume_compiled_tree->ident = ""; assume_compiled_tree->excludep = 0; assume_compiled_tree->sibling = NULL; --- 160,166 ---- if (NULL == assume_compiled_tree) { ! assume_compiled_tree = xmalloc (sizeof (assume_compiled_node)); assume_compiled_tree->ident = ""; assume_compiled_tree->excludep = 0; assume_compiled_tree->sibling = NULL; *************** add_assume_compiled (ident, excludep) *** 197,203 **** parent->child = node; } ! /* Returns non-zero if IDENT is the name of a class that the compiler should assume has been compiled to FIXME */ static int --- 191,197 ---- parent->child = node; } ! /* Returns nonzero if IDENT is the name of a class that the compiler should assume has been compiled to FIXME */ static int *************** ident_subst (old_name, old_length, prefi *** 237,243 **** #ifdef __GNUC__ char buffer[i]; #else ! char *buffer = (char *)alloca (i); #endif strcpy (buffer, prefix); for (i = 0; i < old_length; i++) --- 231,237 ---- #ifdef __GNUC__ char buffer[i]; #else ! char *buffer = alloca (i); #endif strcpy (buffer, prefix); for (i = 0; i < old_length; i++) *************** make_class () *** 286,306 **** { tree type; type = make_node (RECORD_TYPE); - #ifdef JAVA_USE_HANDLES - tree field1 = build_decl (FIELD_DECL, get_identifier ("obj"), - build_pointer_type (type)); - tree field2 = build_decl (FIELD_DECL, get_identifier ("methods"), - methodtable_ptr_type); - tree handle_type = make_node (RECORD_TYPE); - TREE_CHAIN (field1) = field2; - TYPE_FIELDS (handle_type) = field1; - TYPE_BINFO (type) = make_tree_vec (7); - TYPE_BINFO (handle_type) = make_tree_vec (7); - BINFO_HANDLE (TYPE_BINFO (handle_type)) = type; - BINFO_HANDLE (TYPE_BINFO (type)) = handle_type; - #else TYPE_BINFO (type) = make_tree_vec (6); - #endif MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type); return type; --- 280,286 ---- *************** push_class (class_type, class_name) *** 357,371 **** DECL_ARTIFICIAL (decl) = 1; pushdecl_top_level (decl); - #ifdef JAVA_USE_HANDLES - { - tree handle_name = identifier_subst (class_name, - "Handle$", '.', '.', ""); - tree handle_decl = build_decl (TYPE_DECL, handle_name, - CLASS_TO_HANDLE_TYPE (class_type)); - pushdecl (handle_decl); - } - #endif return decl; } --- 337,342 ---- *************** build_java_method_type (fntype, this_cla *** 622,670 **** { if (access_flags & ACC_STATIC) return fntype; ! return build_method_type (CLASS_TO_HANDLE_TYPE (this_class), fntype); ! } ! ! static struct hash_entry * ! init_test_hash_newfunc (entry, table, string) ! struct hash_entry *entry; ! struct hash_table *table; ! hash_table_key string ATTRIBUTE_UNUSED; ! { ! struct init_test_hash_entry *ret = (struct init_test_hash_entry *) entry; ! if (ret == NULL) ! { ! ret = ((struct init_test_hash_entry *) ! hash_allocate (table, sizeof (struct init_test_hash_entry))); ! if (ret == NULL) ! return NULL; ! } ! ret->init_test_decl = 0; ! return (struct hash_entry *) ret; ! } ! ! /* Hash table helpers. Also reused in find_applicable_accessible_methods_list ! (parse.y). The hash of a tree node is its pointer value, comparison ! is direct. */ ! ! unsigned long ! java_hash_hash_tree_node (k) ! hash_table_key k; ! { ! return (long) k; ! } ! ! bool ! java_hash_compare_tree_node (k1, k2) ! hash_table_key k1; ! hash_table_key k2; ! { ! return ((tree) k1 == (tree) k2); } tree ! add_method_1 (handle_class, access_flags, name, function_type) ! tree handle_class; int access_flags; tree name; tree function_type; --- 593,604 ---- { if (access_flags & ACC_STATIC) return fntype; ! return build_method_type (this_class, fntype); } tree ! add_method_1 (this_class, access_flags, name, function_type) ! tree this_class; int access_flags; tree name; tree function_type; *************** add_method_1 (handle_class, access_flags *** 672,708 **** tree method_type, fndecl; method_type = build_java_method_type (function_type, ! handle_class, access_flags); fndecl = build_decl (FUNCTION_DECL, name, method_type); ! DECL_CONTEXT (fndecl) = handle_class; DECL_LANG_SPECIFIC (fndecl) ! = (struct lang_decl *) ggc_alloc_cleared (sizeof (struct lang_decl)); /* Initialize the static initializer test table. */ ! hash_table_init (&DECL_FUNCTION_INIT_TEST_TABLE (fndecl), ! init_test_hash_newfunc, java_hash_hash_tree_node, ! java_hash_compare_tree_node); /* Initialize the initialized (static) class table. */ if (access_flags & ACC_STATIC) ! hash_table_init (&DECL_FUNCTION_INITIALIZED_CLASS_TABLE (fndecl), ! init_test_hash_newfunc, java_hash_hash_tree_node, ! java_hash_compare_tree_node); /* Initialize the static method invocation compound list */ DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND (fndecl) = NULL_TREE; ! TREE_CHAIN (fndecl) = TYPE_METHODS (handle_class); ! TYPE_METHODS (handle_class) = fndecl; /* Notice that this is a finalizer and update the class type accordingly. This is used to optimize instance allocation. */ if (name == finalize_identifier_node && TREE_TYPE (function_type) == void_type_node && TREE_VALUE (TYPE_ARG_TYPES (function_type)) == void_type_node) ! HAS_FINALIZER_P (handle_class) = 1; if (access_flags & ACC_PUBLIC) METHOD_PUBLIC (fndecl) = 1; if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1; --- 606,642 ---- tree method_type, fndecl; method_type = build_java_method_type (function_type, ! this_class, access_flags); fndecl = build_decl (FUNCTION_DECL, name, method_type); ! DECL_CONTEXT (fndecl) = this_class; DECL_LANG_SPECIFIC (fndecl) ! = ggc_alloc_cleared (sizeof (struct lang_decl)); ! DECL_LANG_SPECIFIC (fndecl)->desc = LANG_DECL_FUNC; /* Initialize the static initializer test table. */ ! ! DECL_FUNCTION_INIT_TEST_TABLE (fndecl) = ! java_treetreehash_create (10, 1); /* Initialize the initialized (static) class table. */ if (access_flags & ACC_STATIC) ! DECL_FUNCTION_INITIALIZED_CLASS_TABLE (fndecl) = ! htab_create_ggc (50, htab_hash_pointer, htab_eq_pointer, NULL); /* Initialize the static method invocation compound list */ DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND (fndecl) = NULL_TREE; ! TREE_CHAIN (fndecl) = TYPE_METHODS (this_class); ! TYPE_METHODS (this_class) = fndecl; /* Notice that this is a finalizer and update the class type accordingly. This is used to optimize instance allocation. */ if (name == finalize_identifier_node && TREE_TYPE (function_type) == void_type_node && TREE_VALUE (TYPE_ARG_TYPES (function_type)) == void_type_node) ! HAS_FINALIZER_P (this_class) = 1; if (access_flags & ACC_PUBLIC) METHOD_PUBLIC (fndecl) = 1; if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1; *************** add_method (this_class, access_flags, na *** 735,741 **** tree name; tree method_sig; { - tree handle_class = CLASS_TO_HANDLE_TYPE (this_class); tree function_type, fndecl; const unsigned char *sig = (const unsigned char *) IDENTIFIER_POINTER (method_sig); --- 669,674 ---- *************** add_method (this_class, access_flags, na *** 744,750 **** fatal_error ("bad method signature"); function_type = get_type_from_signature (method_sig); ! fndecl = add_method_1 (handle_class, access_flags, name, function_type); set_java_signature (TREE_TYPE (fndecl), method_sig); return fndecl; } --- 677,683 ---- fatal_error ("bad method signature"); function_type = get_type_from_signature (method_sig); ! fndecl = add_method_1 (this_class, access_flags, name, function_type); set_java_signature (TREE_TYPE (fndecl), method_sig); return fndecl; } *************** make_method_value (mdecl) *** 1351,1357 **** iter != NULL_TREE; iter = TREE_CHAIN (iter)) { ! tree sig = build_java_signature (TREE_VALUE (iter)); tree utf8 = build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (sig), IDENTIFIER_LENGTH (sig))); --- 1284,1290 ---- iter != NULL_TREE; iter = TREE_CHAIN (iter)) { ! tree sig = DECL_NAME (TYPE_NAME (TREE_VALUE (iter))); tree utf8 = build_utf8_ref (unmangle_classname (IDENTIFIER_POINTER (sig), IDENTIFIER_LENGTH (sig))); *************** make_class_data (type) *** 1566,1572 **** fields_decl = NULL_TREE; /* Build Method array. */ ! for (method = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (type)); method != NULL_TREE; method = TREE_CHAIN (method)) { tree init; --- 1499,1505 ---- fields_decl = NULL_TREE; /* Build Method array. */ ! for (method = TYPE_METHODS (type); method != NULL_TREE; method = TREE_CHAIN (method)) { tree init; *************** make_class_data (type) *** 1732,1737 **** --- 1665,1671 ---- PUSH_FIELD_VALUE (cons, "idt", null_pointer_node); PUSH_FIELD_VALUE (cons, "arrayclass", null_pointer_node); PUSH_FIELD_VALUE (cons, "protectionDomain", null_pointer_node); + PUSH_FIELD_VALUE (cons, "chain", null_pointer_node); FINISH_RECORD_CONSTRUCTOR (cons); *************** void *** 1748,1754 **** finish_class () { tree method; ! tree type_methods = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class)); int saw_native_method = 0; /* Find out if we have any native methods. We use this information --- 1682,1688 ---- finish_class () { tree method; ! tree type_methods = TYPE_METHODS (current_class); int saw_native_method = 0; /* Find out if we have any native methods. We use this information *************** maybe_layout_super_class (super_class, t *** 1932,1939 **** super_class = TREE_TYPE (super_class); else { super_class = do_resolve_class (NULL_TREE, /* FIXME? */ ! super_class, NULL_TREE, this_class); if (!super_class) return NULL_TREE; /* FIXME, NULL_TREE not checked by caller. */ super_class = TREE_TYPE (super_class); --- 1866,1884 ---- super_class = TREE_TYPE (super_class); else { + /* do_resolve_class expects an EXPR_WITH_FILE_LOCATION, so + we give it one. */ + tree this_wrap = NULL_TREE; + + if (this_class) + { + tree this_decl = TYPE_NAME (this_class); + this_wrap = build_expr_wfl (this_class, + DECL_SOURCE_FILE (this_decl), + DECL_SOURCE_LINE (this_decl), 0); + } super_class = do_resolve_class (NULL_TREE, /* FIXME? */ ! super_class, NULL_TREE, this_wrap); if (!super_class) return NULL_TREE; /* FIXME, NULL_TREE not checked by caller. */ super_class = TREE_TYPE (super_class); *************** layout_class_methods (this_class) *** 2054,2066 **** tree this_class; { tree method_decl, dtable_count; ! tree super_class, handle_type; if (TYPE_NVIRTUALS (this_class)) return; super_class = CLASSTYPE_SUPER (this_class); - handle_type = CLASS_TO_HANDLE_TYPE (this_class); if (super_class) { --- 1999,2010 ---- tree this_class; { tree method_decl, dtable_count; ! tree super_class; if (TYPE_NVIRTUALS (this_class)) return; super_class = CLASSTYPE_SUPER (this_class); if (super_class) { *************** layout_class_methods (this_class) *** 2072,2089 **** else dtable_count = integer_zero_node; ! TYPE_METHODS (handle_type) = nreverse (TYPE_METHODS (handle_type)); ! for (method_decl = TYPE_METHODS (handle_type); method_decl; method_decl = TREE_CHAIN (method_decl)) dtable_count = layout_class_method (this_class, super_class, method_decl, dtable_count); TYPE_NVIRTUALS (this_class) = dtable_count; - - #ifdef JAVA_USE_HANDLES - layout_type (handle_type); - #endif } /* Return 0 if NAME is equal to STR, -1 if STR is "less" than NAME, --- 2016,2029 ---- else dtable_count = integer_zero_node; ! TYPE_METHODS (this_class) = nreverse (TYPE_METHODS (this_class)); ! for (method_decl = TYPE_METHODS (this_class); method_decl; method_decl = TREE_CHAIN (method_decl)) dtable_count = layout_class_method (this_class, super_class, method_decl, dtable_count); TYPE_NVIRTUALS (this_class) = dtable_count; } /* Return 0 if NAME is equal to STR, -1 if STR is "less" than NAME, *************** emit_offset_symbol_table () *** 2327,2338 **** void init_class_processing () { ! registerClass_libfunc = gen_rtx (SYMBOL_REF, Pmode, "_Jv_RegisterClass"); registerResource_libfunc = ! gen_rtx (SYMBOL_REF, Pmode, "_Jv_RegisterResource"); ! ggc_add_tree_root (class_roots, sizeof (class_roots) / sizeof (tree)); fields_ident = get_identifier ("fields"); info_ident = get_identifier ("info"); - ggc_add_rtx_root (®isterClass_libfunc, 1); gcc_obstack_init (&temporary_obstack); } --- 2267,2351 ---- void init_class_processing () { ! registerClass_libfunc = gen_rtx_SYMBOL_REF (Pmode, "_Jv_RegisterClass"); registerResource_libfunc = ! gen_rtx_SYMBOL_REF (Pmode, "_Jv_RegisterResource"); fields_ident = get_identifier ("fields"); info_ident = get_identifier ("info"); gcc_obstack_init (&temporary_obstack); } + + static hashval_t java_treetreehash_hash PARAMS ((const void *)); + static int java_treetreehash_compare PARAMS ((const void *, const void *)); + + /* A hash table mapping trees to trees. Used generally. */ + + #define JAVA_TREEHASHHASH_H(t) (htab_hash_pointer (t)) + + static hashval_t + java_treetreehash_hash (k_p) + const void *k_p; + { + struct treetreehash_entry *k = (struct treetreehash_entry *) k_p; + return JAVA_TREEHASHHASH_H (k->key); + } + + static int + java_treetreehash_compare (k1_p, k2_p) + const void * k1_p; + const void * k2_p; + { + struct treetreehash_entry * k1 = (struct treetreehash_entry *) k1_p; + tree k2 = (tree) k2_p; + return (k1->key == k2); + } + + tree + java_treetreehash_find (ht, t) + htab_t ht; + tree t; + { + struct treetreehash_entry *e; + hashval_t hv = JAVA_TREEHASHHASH_H (t); + e = (struct treetreehash_entry *) htab_find_with_hash (ht, t, hv); + if (e == NULL) + return NULL; + else + return e->value; + } + + tree * + java_treetreehash_new (ht, t) + htab_t ht; + tree t; + { + PTR *e; + struct treetreehash_entry *tthe; + hashval_t hv = JAVA_TREEHASHHASH_H (t); + + e = htab_find_slot_with_hash (ht, t, hv, INSERT); + if (*e == NULL) + { + tthe = (*ht->alloc_f) (1, sizeof (*tthe)); + tthe->key = t; + *e = (PTR) tthe; + } + else + tthe = (struct treetreehash_entry *) *e; + return &tthe->value; + } + + htab_t + java_treetreehash_create (size, gc) + size_t size; + int gc; + { + if (gc) + return htab_create_ggc (size, java_treetreehash_hash, + java_treetreehash_compare, NULL); + else + return htab_create_alloc (size, java_treetreehash_hash, + java_treetreehash_compare, free, xcalloc, free); + } + + #include "gt-java-class.h" diff -Nrc3pad gcc-3.2.3/gcc/java/config-lang.in gcc-3.3/gcc/java/config-lang.in *** gcc-3.2.3/gcc/java/config-lang.in 2001-12-20 00:20:47.000000000 +0000 --- gcc-3.3/gcc/java/config-lang.in 2002-06-04 07:10:47.000000000 +0000 *************** compilers="jc1\$(exeext) jvgenmain\$(exe *** 36,41 **** --- 36,43 ---- stagestuff="jc1\$(exeext) gcj\$(exeext) jvgenmain\$(exeext) gcjh\$(exeext) jv-scan\$(exeext) jcf-dump\$(exeext)" + gtfiles="\$(srcdir)/java/java-tree.h \$(srcdir)/java/builtins.c \$(srcdir)/java/class.c \$(srcdir)/java/constants.c \$(srcdir)/java/decl.c \$(srcdir)/java/expr.c \$(srcdir)/java/jcf-parse.c \$(srcdir)/java/jcf-write.c \$(srcdir)/java/lang.c \$(srcdir)/java/mangle.c \$(srcdir)/java/parse.y" + target_libs=${libgcj_saved} lang_dirs="zlib fastjar" #build_by_default=no diff -Nrc3pad gcc-3.2.3/gcc/java/constants.c gcc-3.3/gcc/java/constants.c *** gcc-3.2.3/gcc/java/constants.c 2001-04-26 18:32:22.000000000 +0000 --- gcc-3.3/gcc/java/constants.c 2002-11-18 15:46:32.000000000 +0000 *************** The Free Software Foundation is independ *** 29,36 **** #include "toplev.h" #include "ggc.h" - extern struct obstack permanent_obstack; - static void set_constant_entry PARAMS ((CPool *, int, int, jword)); static int find_class_or_string_constant PARAMS ((CPool *, int, tree)); static int find_name_and_type_constant PARAMS ((CPool *, tree, tree)); --- 29,34 ---- *************** set_constant_entry (cpool, index, tag, v *** 49,56 **** if (cpool->data == NULL) { cpool->capacity = 100; ! cpool->tags = (uint8*) xmalloc (sizeof(uint8) * cpool->capacity); ! cpool->data = (jword*) xmalloc (sizeof(jword) * cpool->capacity); cpool->count = 1; } if (index >= cpool->capacity) --- 47,54 ---- if (cpool->data == NULL) { cpool->capacity = 100; ! cpool->tags = xmalloc (sizeof(uint8) * cpool->capacity); ! cpool->data = xmalloc (sizeof(jword) * cpool->capacity); cpool->count = 1; } if (index >= cpool->capacity) *************** set_constant_entry (cpool, index, tag, v *** 58,67 **** cpool->capacity *= 2; if (index >= cpool->capacity) cpool->capacity = index + 10; ! cpool->tags = (uint8*) xrealloc (cpool->tags, ! sizeof(uint8) * cpool->capacity); ! cpool->data = (jword*) xrealloc (cpool->data, ! sizeof(jword) * cpool->capacity); } if (index >= cpool->count) cpool->count = index + 1; --- 56,63 ---- cpool->capacity *= 2; if (index >= cpool->capacity) cpool->capacity = index + 10; ! cpool->tags = xrealloc (cpool->tags, sizeof(uint8) * cpool->capacity); ! cpool->data = xrealloc (cpool->data, sizeof(jword) * cpool->capacity); } if (index >= cpool->count) cpool->count = index + 1; *************** write_constant_pool (cpool, buffer, leng *** 326,345 **** CPool *outgoing_cpool; static tree get_tag_node (tag) int tag; { /* A Cache for build_int_2 (CONSTANT_XXX, 0). */ - static tree tag_nodes[13]; - static int initialized_p; - - /* Register the TAG_NODES with the garbage collector. */ - if (!initialized_p) - { - ggc_add_tree_root (tag_nodes, 13); - initialized_p = 1; - } if (tag_nodes[tag] == NULL_TREE) tag_nodes[tag] = build_int_2 (tag, 0); --- 322,333 ---- CPool *outgoing_cpool; + static GTY(()) tree tag_nodes[13]; static tree get_tag_node (tag) int tag; { /* A Cache for build_int_2 (CONSTANT_XXX, 0). */ if (tag_nodes[tag] == NULL_TREE) tag_nodes[tag] = build_int_2 (tag, 0); *************** build_constants_constructor () *** 492,494 **** --- 480,484 ---- FINISH_RECORD_CONSTRUCTOR (cons); return cons; } + + #include "gt-java-constants.h" diff -Nrc3pad gcc-3.2.3/gcc/java/decl.c gcc-3.3/gcc/java/decl.c *** gcc-3.2.3/gcc/java/decl.c 2002-04-17 23:20:43.000000000 +0000 --- gcc-3.3/gcc/java/decl.c 2003-02-12 23:38:02.000000000 +0000 *************** *** 1,6 **** /* Process declarations and variables for the GNU compiler for the Java(TM) language. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,6 ---- /* Process declarations and variables for the GNU compiler for the Java(TM) language. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. *************** The Free Software Foundation is independ *** 30,35 **** --- 30,36 ---- #include "system.h" #include "tree.h" #include "rtl.h" + #include "real.h" #include "toplev.h" #include "flags.h" #include "java-tree.h" *************** The Free Software Foundation is independ *** 40,48 **** #include "except.h" #include "java-except.h" #include "ggc.h" #if defined (DEBUG_JAVA_BINDING_LEVELS) ! extern void indent PROTO((void)); #endif static tree push_jvm_slot PARAMS ((int, tree)); --- 41,51 ---- #include "except.h" #include "java-except.h" #include "ggc.h" + #include "timevar.h" + #include "tree-inline.h" #if defined (DEBUG_JAVA_BINDING_LEVELS) ! extern void indent PARAMS ((void)); #endif static tree push_jvm_slot PARAMS ((int, tree)); *************** static struct binding_level *make_bindin *** 52,59 **** static tree create_primitive_vtable PARAMS ((const char *)); static tree check_local_named_variable PARAMS ((tree, tree, int, int *)); static tree check_local_unnamed_variable PARAMS ((tree, tree, tree)); ! /* Set to non-zero value in order to emit class initilization code before static field references. */ extern int always_initialize_class_p; --- 55,69 ---- static tree create_primitive_vtable PARAMS ((const char *)); static tree check_local_named_variable PARAMS ((tree, tree, int, int *)); static tree check_local_unnamed_variable PARAMS ((tree, tree, tree)); + static void dump_function PARAMS ((enum tree_dump_index, tree)); ! /* Name of the Cloneable class. */ ! tree java_lang_cloneable_identifier_node; ! ! /* Name of the Serializable class. */ ! tree java_io_serializable_identifier_node; ! ! /* Set to nonzero value in order to emit class initilization code before static field references. */ extern int always_initialize_class_p; *************** extern int always_initialize_class_p; *** 65,76 **** DECL_LOCAL_SLOT_CHAIN; the index finds the TREE_VEC element, and then we search the chain for a decl with a matching TREE_TYPE. */ ! tree decl_map; /* A list of local variables VAR_DECLs for this method that we have seen debug information, but we have not reached their starting (byte) PC yet. */ ! static tree pending_local_decls = NULL_TREE; /* Push a local variable or stack slot into the decl_map, and assign it an rtl. */ --- 75,86 ---- DECL_LOCAL_SLOT_CHAIN; the index finds the TREE_VEC element, and then we search the chain for a decl with a matching TREE_TYPE. */ ! static GTY(()) tree decl_map; /* A list of local variables VAR_DECLs for this method that we have seen debug information, but we have not reached their starting (byte) PC yet. */ ! static GTY(()) tree pending_local_decls; /* Push a local variable or stack slot into the decl_map, and assign it an rtl. */ *************** static struct binding_level *global_bind *** 307,313 **** /* Binding level structures are initialized by copying this one. */ ! static struct binding_level clear_binding_level = {NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_BINDING_LEVEL, LARGEST_PC, 0}; --- 317,323 ---- /* Binding level structures are initialized by copying this one. */ ! static const struct binding_level clear_binding_level = {NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_BINDING_LEVEL, LARGEST_PC, 0}; *************** static tree named_labels; *** 323,330 **** static tree shadowed_labels; #endif - int flag_traditional; - tree java_global_trees[JTI_MAX]; /* Build (and pushdecl) a "promoted type" for all standard --- 333,338 ---- *************** push_promoted_type (name, actual_type) *** 359,373 **** See tree.h for its possible values. If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME, ! the name to be called if we can't opencode the function. */ tree ! builtin_function (name, type, function_code, class, library_name) const char *name; tree type; int function_code; enum built_in_class class; const char *library_name; { tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); DECL_EXTERNAL (decl) = 1; --- 367,383 ---- See tree.h for its possible values. If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME, ! the name to be called if we can't opencode the function. If ! ATTRS is nonzero, use that for the function's attribute list. */ tree ! builtin_function (name, type, function_code, class, library_name, attrs) const char *name; tree type; int function_code; enum built_in_class class; const char *library_name; + tree attrs ATTRIBUTE_UNUSED; { tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); DECL_EXTERNAL (decl) = 1; *************** java_init_decl_processing () *** 443,455 **** set_sizetype (make_unsigned_type (POINTER_SIZE)); /* Define these next since types below may used them. */ ! integer_type_node = type_for_size (INT_TYPE_SIZE, 0); integer_zero_node = build_int_2 (0, 0); integer_one_node = build_int_2 (1, 0); integer_two_node = build_int_2 (2, 0); integer_four_node = build_int_2 (4, 0); integer_minus_one_node = build_int_2 (-1, -1); size_zero_node = size_int (0); size_one_node = size_int (1); bitsize_zero_node = bitsize_int (0); --- 453,479 ---- set_sizetype (make_unsigned_type (POINTER_SIZE)); /* Define these next since types below may used them. */ ! integer_type_node = java_type_for_size (INT_TYPE_SIZE, 0); integer_zero_node = build_int_2 (0, 0); integer_one_node = build_int_2 (1, 0); integer_two_node = build_int_2 (2, 0); integer_four_node = build_int_2 (4, 0); integer_minus_one_node = build_int_2 (-1, -1); + /* A few values used for range checking in the lexer. */ + decimal_int_max = build_int_2 (0x80000000, 0); + TREE_TYPE (decimal_int_max) = unsigned_int_type_node; + #if HOST_BITS_PER_WIDE_INT == 64 + decimal_long_max = build_int_2 (0x8000000000000000LL, 0); + #else + #if HOST_BITS_PER_WIDE_INT == 32 + decimal_long_max = build_int_2 (0, 0x80000000); + #else + #error "unsupported size" + #endif + #endif + TREE_TYPE (decimal_long_max) = unsigned_long_type_node; + size_zero_node = size_int (0); size_one_node = size_int (1); bitsize_zero_node = bitsize_int (0); *************** java_init_decl_processing () *** 583,588 **** --- 607,616 ---- access0_identifier_node = get_identifier ("access$0"); classdollar_identifier_node = get_identifier ("class$"); + java_lang_cloneable_identifier_node = get_identifier ("java.lang.Cloneable"); + java_io_serializable_identifier_node = + get_identifier ("java.io.Serializable"); + /* for lack of a better place to put this stub call */ init_expr_processing(); *************** java_init_decl_processing () *** 607,612 **** --- 635,641 ---- one_elt_array_domain_type = build_index_type (integer_one_node); otable_type = build_array_type (integer_type_node, one_elt_array_domain_type); + TYPE_NONALIASED_COMPONENT (otable_type) = 1; otable_ptr_type = build_pointer_type (otable_type); method_symbol_type = make_node (RECORD_TYPE); *************** java_init_decl_processing () *** 679,684 **** --- 708,714 ---- PUSH_FIELD (class_type_node, field, "idt", ptr_type_node); PUSH_FIELD (class_type_node, field, "arrayclass", ptr_type_node); PUSH_FIELD (class_type_node, field, "protectionDomain", ptr_type_node); + PUSH_FIELD (class_type_node, field, "chain", ptr_type_node); for (t = TYPE_FIELDS (class_type_node); t != NULL_TREE; t = TREE_CHAIN (t)) FIELD_PRIVATE (t) = 1; push_super_field (class_type_node, object_type_node); *************** java_init_decl_processing () *** 750,788 **** tree_cons (NULL_TREE, int_type_node, endlink)); alloc_object_node = builtin_function ("_Jv_AllocObject", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); DECL_IS_MALLOC (alloc_object_node) = 1; alloc_no_finalizer_node = builtin_function ("_Jv_AllocObjectNoFinalizer", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); DECL_IS_MALLOC (alloc_no_finalizer_node) = 1; t = tree_cons (NULL_TREE, ptr_type_node, endlink); soft_initclass_node = builtin_function ("_Jv_InitClass", build_function_type (void_type_node, t), ! 0, NOT_BUILT_IN, NULL); throw_node = builtin_function ("_Jv_Throw", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); /* Mark throw_nodes as `noreturn' functions with side effects. */ TREE_THIS_VOLATILE (throw_node) = 1; TREE_SIDE_EFFECTS (throw_node) = 1; t = build_function_type (int_type_node, endlink); soft_monitorenter_node ! = builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN, NULL); soft_monitorexit_node ! = builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN, NULL); t = tree_cons (NULL_TREE, int_type_node, tree_cons (NULL_TREE, int_type_node, endlink)); soft_newarray_node = builtin_function ("_Jv_NewPrimArray", build_function_type(ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); DECL_IS_MALLOC (soft_newarray_node) = 1; t = tree_cons (NULL_TREE, int_type_node, --- 780,820 ---- tree_cons (NULL_TREE, int_type_node, endlink)); alloc_object_node = builtin_function ("_Jv_AllocObject", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); DECL_IS_MALLOC (alloc_object_node) = 1; alloc_no_finalizer_node = builtin_function ("_Jv_AllocObjectNoFinalizer", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); DECL_IS_MALLOC (alloc_no_finalizer_node) = 1; t = tree_cons (NULL_TREE, ptr_type_node, endlink); soft_initclass_node = builtin_function ("_Jv_InitClass", build_function_type (void_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); throw_node = builtin_function ("_Jv_Throw", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); /* Mark throw_nodes as `noreturn' functions with side effects. */ TREE_THIS_VOLATILE (throw_node) = 1; TREE_SIDE_EFFECTS (throw_node) = 1; t = build_function_type (int_type_node, endlink); soft_monitorenter_node ! = builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN, ! NULL, NULL_TREE); soft_monitorexit_node ! = builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN, ! NULL, NULL_TREE); t = tree_cons (NULL_TREE, int_type_node, tree_cons (NULL_TREE, int_type_node, endlink)); soft_newarray_node = builtin_function ("_Jv_NewPrimArray", build_function_type(ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); DECL_IS_MALLOC (soft_newarray_node) = 1; t = tree_cons (NULL_TREE, int_type_node, *************** java_init_decl_processing () *** 791,812 **** soft_anewarray_node = builtin_function ("_Jv_NewObjectArray", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); DECL_IS_MALLOC (soft_anewarray_node) = 1; t = tree_cons (NULL_TREE, ptr_type_node, ! tree_cons (NULL_TREE, int_type_node, endlink)); soft_multianewarray_node = builtin_function ("_Jv_NewMultiArray", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); DECL_IS_MALLOC (soft_multianewarray_node) = 1; t = build_function_type (void_type_node, tree_cons (NULL_TREE, int_type_node, endlink)); soft_badarrayindex_node = builtin_function ("_Jv_ThrowBadArrayIndex", t, ! 0, NOT_BUILT_IN, NULL); /* Mark soft_badarrayindex_node as a `noreturn' function with side effects. */ TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1; --- 823,846 ---- soft_anewarray_node = builtin_function ("_Jv_NewObjectArray", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); DECL_IS_MALLOC (soft_anewarray_node) = 1; + /* There is no endlink here because _Jv_NewMultiArray is a varargs + function. */ t = tree_cons (NULL_TREE, ptr_type_node, ! tree_cons (NULL_TREE, int_type_node, NULL_TREE)); soft_multianewarray_node = builtin_function ("_Jv_NewMultiArray", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); DECL_IS_MALLOC (soft_multianewarray_node) = 1; t = build_function_type (void_type_node, tree_cons (NULL_TREE, int_type_node, endlink)); soft_badarrayindex_node = builtin_function ("_Jv_ThrowBadArrayIndex", t, ! 0, NOT_BUILT_IN, NULL, NULL_TREE); /* Mark soft_badarrayindex_node as a `noreturn' function with side effects. */ TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1; *************** java_init_decl_processing () *** 815,821 **** soft_nullpointer_node = builtin_function ("_Jv_ThrowNullPointerException", build_function_type (void_type_node, endlink), ! 0, NOT_BUILT_IN, NULL); /* Mark soft_nullpointer_node as a `noreturn' function with side effects. */ TREE_THIS_VOLATILE (soft_nullpointer_node) = 1; --- 849,855 ---- soft_nullpointer_node = builtin_function ("_Jv_ThrowNullPointerException", build_function_type (void_type_node, endlink), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); /* Mark soft_nullpointer_node as a `noreturn' function with side effects. */ TREE_THIS_VOLATILE (soft_nullpointer_node) = 1; *************** java_init_decl_processing () *** 826,875 **** soft_checkcast_node = builtin_function ("_Jv_CheckCast", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); t = tree_cons (NULL_TREE, object_ptr_type_node, tree_cons (NULL_TREE, class_ptr_type, endlink)); soft_instanceof_node = builtin_function ("_Jv_IsInstanceOf", build_function_type (boolean_type_node, t), ! 0, NOT_BUILT_IN, NULL); t = tree_cons (NULL_TREE, object_ptr_type_node, tree_cons (NULL_TREE, object_ptr_type_node, endlink)); soft_checkarraystore_node = builtin_function ("_Jv_CheckArrayStore", build_function_type (void_type_node, t), ! 0, NOT_BUILT_IN, NULL); t = tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, int_type_node, endlink))); soft_lookupinterfacemethod_node = builtin_function ("_Jv_LookupInterfaceMethodIdx", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); t = tree_cons (NULL_TREE, object_ptr_type_node, tree_cons (NULL_TREE, ptr_type_node, ! tree_cons (NULL_TREE, ptr_type_node, endlink))); soft_lookupjnimethod_node = builtin_function ("_Jv_LookupJNIMethod", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); t = tree_cons (NULL_TREE, ptr_type_node, endlink); soft_getjnienvnewframe_node = builtin_function ("_Jv_GetJNIEnvNewFrame", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); soft_jnipopsystemframe_node = builtin_function ("_Jv_JNI_PopSystemFrame", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL); t = tree_cons (NULL_TREE, double_type_node, tree_cons (NULL_TREE, double_type_node, endlink)); soft_fmod_node = builtin_function ("__builtin_fmod", build_function_type (double_type_node, t), ! BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmod"); #if 0 t = tree_cons (NULL_TREE, float_type_node, --- 860,911 ---- soft_checkcast_node = builtin_function ("_Jv_CheckCast", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); t = tree_cons (NULL_TREE, object_ptr_type_node, tree_cons (NULL_TREE, class_ptr_type, endlink)); soft_instanceof_node = builtin_function ("_Jv_IsInstanceOf", build_function_type (boolean_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); t = tree_cons (NULL_TREE, object_ptr_type_node, tree_cons (NULL_TREE, object_ptr_type_node, endlink)); soft_checkarraystore_node = builtin_function ("_Jv_CheckArrayStore", build_function_type (void_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); t = tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, int_type_node, endlink))); soft_lookupinterfacemethod_node = builtin_function ("_Jv_LookupInterfaceMethodIdx", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); t = tree_cons (NULL_TREE, object_ptr_type_node, tree_cons (NULL_TREE, ptr_type_node, ! tree_cons (NULL_TREE, ptr_type_node, ! tree_cons (NULL_TREE, int_type_node, ! endlink)))); soft_lookupjnimethod_node = builtin_function ("_Jv_LookupJNIMethod", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); t = tree_cons (NULL_TREE, ptr_type_node, endlink); soft_getjnienvnewframe_node = builtin_function ("_Jv_GetJNIEnvNewFrame", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); soft_jnipopsystemframe_node = builtin_function ("_Jv_JNI_PopSystemFrame", build_function_type (ptr_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); t = tree_cons (NULL_TREE, double_type_node, tree_cons (NULL_TREE, double_type_node, endlink)); soft_fmod_node = builtin_function ("__builtin_fmod", build_function_type (double_type_node, t), ! BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmod", NULL_TREE); #if 0 t = tree_cons (NULL_TREE, float_type_node, *************** java_init_decl_processing () *** 877,904 **** soft_fmodf_node = builtin_function ("__builtin_fmodf", build_function_type (float_type_node, t), ! BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmodf"); #endif soft_idiv_node = builtin_function ("_Jv_divI", build_function_type (int_type_node, t), ! 0, NOT_BUILT_IN, NULL); soft_irem_node = builtin_function ("_Jv_remI", build_function_type (int_type_node, t), ! 0, NOT_BUILT_IN, NULL); soft_ldiv_node = builtin_function ("_Jv_divJ", build_function_type (long_type_node, t), ! 0, NOT_BUILT_IN, NULL); soft_lrem_node = builtin_function ("_Jv_remJ", build_function_type (long_type_node, t), ! 0, NOT_BUILT_IN, NULL); /* Initialize variables for except.c. */ eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS --- 913,940 ---- soft_fmodf_node = builtin_function ("__builtin_fmodf", build_function_type (float_type_node, t), ! BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmodf", NULL_TREE); #endif soft_idiv_node = builtin_function ("_Jv_divI", build_function_type (int_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); soft_irem_node = builtin_function ("_Jv_remI", build_function_type (int_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); soft_ldiv_node = builtin_function ("_Jv_divJ", build_function_type (long_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); soft_lrem_node = builtin_function ("_Jv_remJ", build_function_type (long_type_node, t), ! 0, NOT_BUILT_IN, NULL, NULL_TREE); /* Initialize variables for except.c. */ eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS *************** java_init_decl_processing () *** 908,919 **** init_jcf_parse (); - /* Register nodes with the garbage collector. */ - ggc_add_tree_root (java_global_trees, - sizeof (java_global_trees) / sizeof (tree)); - ggc_add_tree_root (&decl_map, 1); - ggc_add_tree_root (&pending_local_decls, 1); - initialize_builtins (); } --- 944,949 ---- *************** static struct binding_level * *** 1168,1174 **** make_binding_level () { /* NOSTRICT */ ! return (struct binding_level *) xmalloc (sizeof (struct binding_level)); } void --- 1198,1204 ---- make_binding_level () { /* NOSTRICT */ ! return xmalloc (sizeof (struct binding_level)); } void *************** set_block (block) *** 1545,1570 **** /* integrate_decl_tree calls this function. */ void ! copy_lang_decl (node) tree node; { ! int lang_decl_size ! = TREE_CODE (node) == VAR_DECL ? sizeof (struct lang_decl_var) ! : sizeof (struct lang_decl); ! struct lang_decl *x = (struct lang_decl *) ggc_alloc (lang_decl_size); ! memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size); ! DECL_LANG_SPECIFIC (node) = x; ! } ! /* If DECL has a cleanup, build and return that cleanup here. ! This is a callback called by expand_expr. */ ! tree ! maybe_build_cleanup (decl) ! tree decl ATTRIBUTE_UNUSED; ! { ! /* There are no cleanups in Java (I think). */ ! return NULL_TREE; } void --- 1575,1593 ---- /* integrate_decl_tree calls this function. */ void ! java_dup_lang_specific_decl (node) tree node; { ! int lang_decl_size; ! struct lang_decl *x; ! if (!DECL_LANG_SPECIFIC (node)) ! return; ! lang_decl_size = sizeof (struct lang_decl); ! x = (struct lang_decl *) ggc_alloc (lang_decl_size); ! memcpy (x, DECL_LANG_SPECIFIC (node), lang_decl_size); ! DECL_LANG_SPECIFIC (node) = x; } void *************** build_result_decl (fndecl) *** 1671,1681 **** tree fndecl; { tree restype = TREE_TYPE (TREE_TYPE (fndecl)); ! /* To be compatible with C_PROMOTING_INTEGER_TYPE_P in cc1/cc1plus. */ ! if (INTEGRAL_TYPE_P (restype) ! && TYPE_PRECISION (restype) < TYPE_PRECISION (integer_type_node)) ! restype = integer_type_node; ! return (DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, restype)); } void --- 1694,1711 ---- tree fndecl; { tree restype = TREE_TYPE (TREE_TYPE (fndecl)); ! tree result = DECL_RESULT (fndecl); ! if (! result) ! { ! /* To be compatible with C_PROMOTING_INTEGER_TYPE_P in cc1/cc1plus. */ ! if (INTEGRAL_TYPE_P (restype) ! && TYPE_PRECISION (restype) < TYPE_PRECISION (integer_type_node)) ! restype = integer_type_node; ! result = build_decl (RESULT_DECL, NULL_TREE, restype); ! DECL_CONTEXT (result) = fndecl; ! DECL_RESULT (fndecl) = result; ! } ! return result; } void *************** start_java_method (fndecl) *** 1763,1772 **** i = DECL_MAX_LOCALS(fndecl) + DECL_MAX_STACK(fndecl); decl_map = make_tree_vec (i); ! type_map = (tree *) xrealloc (type_map, i * sizeof (tree)); #if defined(DEBUG_JAVA_BINDING_LEVELS) ! fprintf (stderr, "%s:\n", (*decl_printable_name) (fndecl, 2)); current_pc = 0; #endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */ pushlevel (1); /* Push parameters. */ --- 1793,1802 ---- i = DECL_MAX_LOCALS(fndecl) + DECL_MAX_STACK(fndecl); decl_map = make_tree_vec (i); ! type_map = xrealloc (type_map, i * sizeof (tree)); #if defined(DEBUG_JAVA_BINDING_LEVELS) ! fprintf (stderr, "%s:\n", lang_printable_name (fndecl, 2)); current_pc = 0; #endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */ pushlevel (1); /* Push parameters. */ *************** end_java_method () *** 1834,1897 **** current_function_decl = NULL_TREE; } ! /* Mark language-specific parts of T for garbage-collection. */ ! void ! lang_mark_tree (t) ! tree t; { ! if (TREE_CODE (t) == IDENTIFIER_NODE) ! { ! struct lang_identifier *li = (struct lang_identifier *) t; ! ggc_mark_tree (li->global_value); ! ggc_mark_tree (li->local_value); ! ggc_mark_tree (li->utf8_ref); ! } ! else if (TREE_CODE (t) == VAR_DECL ! || TREE_CODE (t) == PARM_DECL ! || TREE_CODE (t) == FIELD_DECL) ! { ! struct lang_decl_var *ldv = ! ((struct lang_decl_var *) DECL_LANG_SPECIFIC (t)); ! if (ldv) ! { ! ggc_mark (ldv); ! ggc_mark_tree (ldv->slot_chain); ! ggc_mark_tree (ldv->am); ! ggc_mark_tree (ldv->wfl); ! } ! } ! else if (TREE_CODE (t) == FUNCTION_DECL) { ! struct lang_decl *ld = DECL_LANG_SPECIFIC (t); ! ! if (ld) ! { ! ggc_mark (ld); ! ggc_mark_tree (ld->wfl); ! ggc_mark_tree (ld->throws_list); ! ggc_mark_tree (ld->function_decl_body); ! ggc_mark_tree (ld->called_constructor); ! ggc_mark_tree (ld->inner_access); ! ggc_mark_tree_hash_table (&ld->init_test_table); ! ggc_mark_tree_hash_table (&ld->ict); ! ggc_mark_tree (ld->smic); ! } } ! else if (TYPE_P (t)) { ! struct lang_type *lt = TYPE_LANG_SPECIFIC (t); ! ! if (lt) ! { ! ggc_mark (lt); ! ggc_mark_tree (lt->signature); ! ggc_mark_tree (lt->cpool_data_ref); ! ggc_mark_tree (lt->finit_stmt_list); ! ggc_mark_tree (lt->clinit_stmt_list); ! ggc_mark_tree (lt->ii_block); ! ggc_mark_tree (lt->dot_class); ! ggc_mark_tree (lt->package_list); ! } } } --- 1864,1897 ---- current_function_decl = NULL_TREE; } ! /* Dump FUNCTION_DECL FN as tree dump PHASE. */ ! static void ! dump_function (phase, fn) ! enum tree_dump_index phase; ! tree fn; { ! FILE *stream; ! int flags; ! ! stream = dump_begin (phase, &flags); ! if (stream) { ! dump_node (fn, TDF_SLIM | flags, stream); ! dump_end (phase, stream); } ! } ! ! void java_optimize_inline (fndecl) ! tree fndecl; ! { ! if (flag_inline_trees) { ! timevar_push (TV_INTEGRATION); ! optimize_inline_calls (fndecl); ! timevar_pop (TV_INTEGRATION); ! dump_function (TDI_inlined, fndecl); } } + + #include "gt-java-decl.h" diff -Nrc3pad gcc-3.2.3/gcc/java/except.c gcc-3.3/gcc/java/except.c *** gcc-3.2.3/gcc/java/except.c 2002-03-29 00:41:17.000000000 +0000 --- gcc-3.3/gcc/java/except.c 2002-11-18 15:46:32.000000000 +0000 *************** static void link_handler PARAMS ((struct *** 44,51 **** static void check_start_handlers PARAMS ((struct eh_range *, int)); static void free_eh_ranges PARAMS ((struct eh_range *range)); - extern struct obstack permanent_obstack; - struct eh_range *current_method_handlers; struct eh_range *current_try_block = NULL; --- 44,49 ---- *************** static struct eh_range *cache_next_child *** 63,71 **** struct eh_range whole_range; #if defined(DEBUG_JAVA_BINDING_LEVELS) ! int binding_depth; ! int is_class_level; ! int current_pc; extern void indent (); #endif --- 61,69 ---- struct eh_range whole_range; #if defined(DEBUG_JAVA_BINDING_LEVELS) ! extern int binding_depth; ! extern int is_class_level; ! extern int current_pc; extern void indent (); #endif *************** link_handler (range, outer) *** 155,162 **** /* Handle overlapping ranges by splitting the new range. */ if (range->start_pc < outer->start_pc || range->end_pc > outer->end_pc) { ! struct eh_range *h ! = (struct eh_range *) xmalloc (sizeof (struct eh_range)); if (range->start_pc < outer->start_pc) { h->start_pc = range->start_pc; --- 153,159 ---- /* Handle overlapping ranges by splitting the new range. */ if (range->start_pc < outer->start_pc || range->end_pc > outer->end_pc) { ! struct eh_range *h = xmalloc (sizeof (struct eh_range)); if (range->start_pc < outer->start_pc) { h->start_pc = range->start_pc; *************** link_handler (range, outer) *** 174,179 **** --- 171,177 ---- h->handlers = build_tree_list (TREE_PURPOSE (range->handlers), TREE_VALUE (range->handlers)); h->next_sibling = NULL; + h->expanded = 0; /* Restart both from the top to avoid having to make this function smart about reentrancy. */ link_handler (h, &whole_range); *************** add_handler (start_pc, end_pc, handler, *** 287,293 **** prev = ptr; } ! h = (struct eh_range *) xmalloc (sizeof (struct eh_range)); h->start_pc = start_pc; h->end_pc = end_pc; h->first_child = NULL; --- 285,291 ---- prev = ptr; } ! h = xmalloc (sizeof (struct eh_range)); h->start_pc = start_pc; h->end_pc = end_pc; h->first_child = NULL; diff -Nrc3pad gcc-3.2.3/gcc/java/expr.c gcc-3.3/gcc/java/expr.c *** gcc-3.2.3/gcc/java/expr.c 2002-06-25 13:26:04.000000000 +0000 --- gcc-3.3/gcc/java/expr.c 2003-03-11 20:34:40.000000000 +0000 *************** *** 1,5 **** /* Process expressions for the GNU compiler for the Java(TM) language. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Process expressions for the GNU compiler for the Java(TM) language. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. *************** static tree build_java_throw_out_of_boun *** 81,98 **** static tree build_java_check_indexed_type PARAMS ((tree, tree)); static tree case_identity PARAMS ((tree, tree)); static unsigned char peek_opcode_at_pc PARAMS ((struct JCF *, int, int)); ! static bool emit_init_test_initialization PARAMS ((struct hash_entry *, ! PTR ptr)); static int get_offset_table_index PARAMS ((tree)); ! static tree operand_type[59]; ! extern struct obstack permanent_obstack; ! static tree methods_ident = NULL_TREE; ! static tree ncode_ident = NULL_TREE; tree dtable_ident = NULL_TREE; ! /* Set to non-zero value in order to emit class initilization code before static field references. */ int always_initialize_class_p; --- 81,97 ---- static tree build_java_check_indexed_type PARAMS ((tree, tree)); static tree case_identity PARAMS ((tree, tree)); static unsigned char peek_opcode_at_pc PARAMS ((struct JCF *, int, int)); ! static int emit_init_test_initialization PARAMS ((void **entry, ! void * ptr)); static int get_offset_table_index PARAMS ((tree)); ! static GTY(()) tree operand_type[59]; ! static GTY(()) tree methods_ident; ! static GTY(()) tree ncode_ident; tree dtable_ident = NULL_TREE; ! /* Set to nonzero value in order to emit class initilization code before static field references. */ int always_initialize_class_p; *************** int always_initialize_class_p; *** 123,132 **** So dup cannot just add an extra element to the quick_stack, but iadd can. */ ! static tree quick_stack = NULL_TREE; /* A free-list of unused permamnet TREE_LIST nodes. */ ! static tree tree_list_free_list = NULL_TREE; /* The stack pointer of the Java virtual machine. This does include the size of the quick_stack. */ --- 122,131 ---- So dup cannot just add an extra element to the quick_stack, but iadd can. */ ! static GTY(()) tree quick_stack; /* A free-list of unused permamnet TREE_LIST nodes. */ ! static GTY((deletable (""))) tree tree_list_free_list; /* The stack pointer of the Java virtual machine. This does include the size of the quick_stack. */ *************** init_expr_processing() *** 144,158 **** operand_type[23] = operand_type[56] = float_type_node; operand_type[24] = operand_type[57] = double_type_node; operand_type[25] = operand_type[58] = ptr_type_node; - ggc_add_tree_root (operand_type, 59); - ggc_add_tree_root (&methods_ident, 1); - ggc_add_tree_root (&ncode_ident, 1); - ggc_add_tree_root (&quick_stack, 1); - ggc_add_tree_root (&tree_list_free_list, 1); } tree ! truthvalue_conversion (expr) tree expr; { /* It is simpler and generates better code to have only TRUTH_*_EXPR --- 143,152 ---- operand_type[23] = operand_type[56] = float_type_node; operand_type[24] = operand_type[57] = double_type_node; operand_type[25] = operand_type[58] = ptr_type_node; } tree ! java_truthvalue_conversion (expr) tree expr; { /* It is simpler and generates better code to have only TRUTH_*_EXPR *************** truthvalue_conversion (expr) *** 182,201 **** case ABS_EXPR: case FLOAT_EXPR: case FFS_EXPR: ! /* These don't change whether an object is non-zero or zero. */ ! return truthvalue_conversion (TREE_OPERAND (expr, 0)); case COND_EXPR: /* Distribute the conversion into the arms of a COND_EXPR. */ return fold (build (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0), ! truthvalue_conversion (TREE_OPERAND (expr, 1)), ! truthvalue_conversion (TREE_OPERAND (expr, 2)))); case NOP_EXPR: /* If this is widening the argument, we can ignore it. */ if (TYPE_PRECISION (TREE_TYPE (expr)) >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0)))) ! return truthvalue_conversion (TREE_OPERAND (expr, 0)); /* fall through to default */ default: --- 176,195 ---- case ABS_EXPR: case FLOAT_EXPR: case FFS_EXPR: ! /* These don't change whether an object is nonzero or zero. */ ! return java_truthvalue_conversion (TREE_OPERAND (expr, 0)); case COND_EXPR: /* Distribute the conversion into the arms of a COND_EXPR. */ return fold (build (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0), ! java_truthvalue_conversion (TREE_OPERAND (expr, 1)), ! java_truthvalue_conversion (TREE_OPERAND (expr, 2)))); case NOP_EXPR: /* If this is widening the argument, we can ignore it. */ if (TYPE_PRECISION (TREE_TYPE (expr)) >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0)))) ! return java_truthvalue_conversion (TREE_OPERAND (expr, 0)); /* fall through to default */ default: *************** truthvalue_conversion (expr) *** 203,224 **** } } - #ifdef JAVA_USE_HANDLES - /* Given a pointer to a handle, get a pointer to an object. */ - - tree - unhand_expr (expr) - tree expr; - { - tree field, handle_type; - expr = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (expr)), expr); - handle_type = TREE_TYPE (expr); - field = TYPE_FIELDS (handle_type); - expr = build (COMPONENT_REF, TREE_TYPE (field), expr, field); - return expr; - } - #endif - /* Save any stack slots that happen to be in the quick_stack into their home virtual register slots. --- 197,202 ---- *************** can_widen_reference_to (source_type, tar *** 409,421 **** return 1; else { - source_type = HANDLE_TO_CLASS_TYPE (source_type); - target_type = HANDLE_TO_CLASS_TYPE (target_type); if (TYPE_ARRAY_P (source_type) || TYPE_ARRAY_P (target_type)) { HOST_WIDE_INT source_length, target_length; if (TYPE_ARRAY_P (source_type) != TYPE_ARRAY_P (target_type)) ! return 0; target_length = java_array_type_length (target_type); if (target_length >= 0) { --- 387,402 ---- return 1; else { if (TYPE_ARRAY_P (source_type) || TYPE_ARRAY_P (target_type)) { HOST_WIDE_INT source_length, target_length; if (TYPE_ARRAY_P (source_type) != TYPE_ARRAY_P (target_type)) ! { ! /* An array implements Cloneable and Serializable. */ ! tree name = DECL_NAME (TYPE_NAME (target_type)); ! return (name == java_lang_cloneable_identifier_node ! || name == java_io_serializable_identifier_node); ! } target_length = java_array_type_length (target_type); if (target_length >= 0) { *************** build_java_array_length_access (node) *** 699,704 **** --- 680,694 ---- tree array_type = TREE_TYPE (type); HOST_WIDE_INT length; + /* JVM spec: If the arrayref is null, the arraylength instruction + throws a NullPointerException. The only way we could get a node + of type ptr_type_node at this point is `aconst_null; arraylength' + or something equivalent. */ + if (type == ptr_type_node) + return build (CALL_EXPR, int_type_node, + build_address_of (soft_nullpointer_node), + NULL_TREE, NULL_TREE); + if (!is_array_type_p (type)) abort (); *************** expand_java_arrayload (lhs_type_node ) *** 1052,1063 **** index_node = save_expr (index_node); array_node = save_expr (array_node); ! lhs_type_node = build_java_check_indexed_type (array_node, lhs_type_node); ! ! load_node = build_java_arrayaccess (array_node, ! lhs_type_node, ! index_node); ! if (INTEGRAL_TYPE_P (lhs_type_node) && TYPE_PRECISION (lhs_type_node) <= 32) load_node = fold (build1 (NOP_EXPR, int_type_node, load_node)); push_value (load_node); --- 1042,1062 ---- index_node = save_expr (index_node); array_node = save_expr (array_node); ! ! if (TREE_TYPE (array_node) == ptr_type_node) ! /* The only way we could get a node of type ptr_type_node at this ! point is `aconst_null; arraylength' or something equivalent, so ! unconditionally throw NullPointerException. */ ! load_node = build (CALL_EXPR, lhs_type_node, ! build_address_of (soft_nullpointer_node), ! NULL_TREE, NULL_TREE); ! else ! { ! lhs_type_node = build_java_check_indexed_type (array_node, lhs_type_node); ! load_node = build_java_arrayaccess (array_node, ! lhs_type_node, ! index_node); ! } if (INTEGRAL_TYPE_P (lhs_type_node) && TYPE_PRECISION (lhs_type_node) <= 32) load_node = fold (build1 (NOP_EXPR, int_type_node, load_node)); push_value (load_node); *************** expand_java_pushc (ival, type) *** 1108,1118 **** else if (type == float_type_node || type == double_type_node) { REAL_VALUE_TYPE x; - #ifdef REAL_ARITHMETIC REAL_VALUE_FROM_INT (x, ival, 0, TYPE_MODE (type)); - #else - x = ival; - #endif value = build_real (type, x); } else --- 1107,1113 ---- *************** build_instanceof (value, type) *** 1260,1268 **** /* Anything except `null' is an instance of Object. Likewise, if the object is known to be an instance of the class, then we only need to check for `null'. */ ! expr = build (COND_EXPR, itype, ! value, ! boolean_true_node, boolean_false_node); } else if (! TYPE_ARRAY_P (type) && ! TYPE_ARRAY_P (valtype) --- 1255,1261 ---- /* Anything except `null' is an instance of Object. Likewise, if the object is known to be an instance of the class, then we only need to check for `null'. */ ! expr = build (NE_EXPR, itype, value, null_pointer_node); } else if (! TYPE_ARRAY_P (type) && ! TYPE_ARRAY_P (valtype) *************** build_java_binop (op, type, arg1, arg2) *** 1399,1405 **** { case URSHIFT_EXPR: { ! tree u_type = unsigned_type (type); arg1 = convert (u_type, arg1); arg1 = build_java_binop (RSHIFT_EXPR, u_type, arg1, arg2); return convert (type, arg1); --- 1392,1398 ---- { case URSHIFT_EXPR: { ! tree u_type = java_unsigned_type (type); arg1 = convert (u_type, arg1); arg1 = build_java_binop (RSHIFT_EXPR, u_type, arg1, arg2); return convert (type, arg1); *************** build_field_ref (self_value, self_class, *** 1580,1591 **** && ! (DECL_P (self_value) && DECL_NAME (self_value) == this_identifier_node)); ! tree base_handle_type = promote_type (base_class); ! if (base_handle_type != TREE_TYPE (self_value)) ! self_value = fold (build1 (NOP_EXPR, base_handle_type, self_value)); ! #ifdef JAVA_USE_HANDLES ! self_value = unhand_expr (self_value); ! #endif self_value = build_java_indirect_ref (TREE_TYPE (TREE_TYPE (self_value)), self_value, check); return fold (build (COMPONENT_REF, TREE_TYPE (field_decl), --- 1573,1581 ---- && ! (DECL_P (self_value) && DECL_NAME (self_value) == this_identifier_node)); ! tree base_type = promote_type (base_class); ! if (base_type != TREE_TYPE (self_value)) ! self_value = fold (build1 (NOP_EXPR, base_type, self_value)); self_value = build_java_indirect_ref (TREE_TYPE (TREE_TYPE (self_value)), self_value, check); return fold (build (COMPONENT_REF, TREE_TYPE (field_decl), *************** expand_compare (condition, value1, value *** 1660,1666 **** { tree target = lookup_label (target_pc); tree cond = fold (build (condition, boolean_type_node, value1, value2)); ! expand_start_cond (truthvalue_conversion (cond), 0); expand_goto (target); expand_end_cond (); } --- 1650,1656 ---- { tree target = lookup_label (target_pc); tree cond = fold (build (condition, boolean_type_node, value1, value2)); ! expand_start_cond (java_truthvalue_conversion (cond), 0); expand_goto (target); expand_end_cond (); } *************** build_class_init (clas, expr) *** 1760,1767 **** tree clas, expr; { tree init; ! struct init_test_hash_entry *ite; ! if (inherits_from_p (current_class, clas)) return expr; if (always_initialize_class_p) --- 1750,1763 ---- tree clas, expr; { tree init; ! ! /* An optimization: if CLAS is a superclass of the class we're ! compiling, we don't need to initialize it. However, if CLAS is ! an interface, it won't necessarily be initialized, even if we ! implement it. */ ! if ((! CLASS_INTERFACE (TYPE_NAME (clas)) ! && inherits_from_p (current_class, clas)) ! || current_class == clas) return expr; if (always_initialize_class_p) *************** build_class_init (clas, expr) *** 1774,1798 **** } else { ! ite = (struct init_test_hash_entry *) ! hash_lookup (&DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ! (const hash_table_key) clas, ! TRUE, NULL); ! ! if (ite->init_test_decl == 0) { /* Build a declaration and mark it as a flag used to track static class initializations. */ ! ite->init_test_decl = build_decl (VAR_DECL, NULL_TREE, ! boolean_type_node); ! MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (ite->init_test_decl); ! LOCAL_CLASS_INITIALIZATION_FLAG (ite->init_test_decl) = 1; ! DECL_CONTEXT (ite->init_test_decl) = current_function_decl; ! DECL_FUNCTION_INIT_TEST_CLASS (ite->init_test_decl) = clas; /* Tell the check-init code to ignore this decl when not optimizing class initialization. */ if (!STATIC_CLASS_INIT_OPT_P ()) ! DECL_BIT_INDEX(ite->init_test_decl) = -1; } init = build (CALL_EXPR, void_type_node, --- 1770,1793 ---- } else { ! tree *init_test_decl; ! init_test_decl = java_treetreehash_new ! (DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), clas); ! ! if (*init_test_decl == NULL) { /* Build a declaration and mark it as a flag used to track static class initializations. */ ! *init_test_decl = build_decl (VAR_DECL, NULL_TREE, ! boolean_type_node); ! MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (*init_test_decl); ! LOCAL_CLASS_INITIALIZATION_FLAG (*init_test_decl) = 1; ! DECL_CONTEXT (*init_test_decl) = current_function_decl; ! DECL_FUNCTION_INIT_TEST_CLASS (*init_test_decl) = clas; /* Tell the check-init code to ignore this decl when not optimizing class initialization. */ if (!STATIC_CLASS_INIT_OPT_P ()) ! DECL_BIT_INDEX(*init_test_decl) = -1; } init = build (CALL_EXPR, void_type_node, *************** build_class_init (clas, expr) *** 1802,1813 **** TREE_SIDE_EFFECTS (init) = 1; init = build (COND_EXPR, void_type_node, build (EQ_EXPR, boolean_type_node, ! ite->init_test_decl, boolean_false_node), init, integer_zero_node); TREE_SIDE_EFFECTS (init) = 1; init = build (COMPOUND_EXPR, TREE_TYPE (expr), init, build (MODIFY_EXPR, boolean_type_node, ! ite->init_test_decl, boolean_true_node)); TREE_SIDE_EFFECTS (init) = 1; } --- 1797,1808 ---- TREE_SIDE_EFFECTS (init) = 1; init = build (COND_EXPR, void_type_node, build (EQ_EXPR, boolean_type_node, ! *init_test_decl, boolean_false_node), init, integer_zero_node); TREE_SIDE_EFFECTS (init) = 1; init = build (COMPOUND_EXPR, TREE_TYPE (expr), init, build (MODIFY_EXPR, boolean_type_node, ! *init_test_decl, boolean_true_node)); TREE_SIDE_EFFECTS (init) = 1; } *************** build_known_method_ref (method, method_t *** 1853,1859 **** methods_ident = get_identifier ("methods"); ref = build (COMPONENT_REF, method_ptr_type_node, ref, lookup_field (&class_type_node, methods_ident)); ! for (meth = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (self_type)); ; meth = TREE_CHAIN (meth)) { if (method == meth) --- 1848,1854 ---- methods_ident = get_identifier ("methods"); ref = build (COMPONENT_REF, method_ptr_type_node, ref, lookup_field (&class_type_node, methods_ident)); ! for (meth = TYPE_METHODS (self_type); ; meth = TREE_CHAIN (meth)) { if (method == meth) *************** build_invokevirtual (dtable, method) *** 1980,1990 **** return func; } tree build_invokeinterface (dtable, method) tree dtable, method; { - static tree class_ident = NULL_TREE; tree lookup_arg; tree interface; tree idx; --- 1975,1985 ---- return func; } + static GTY(()) tree class_ident; tree build_invokeinterface (dtable, method) tree dtable, method; { tree lookup_arg; tree interface; tree idx; *************** build_invokeinterface (dtable, method) *** 1999,2005 **** if (class_ident == NULL_TREE) { class_ident = get_identifier ("class"); - ggc_add_tree_root (&class_ident, 1); } dtable = build_java_indirect_ref (dtable_type, dtable, flag_check_references); --- 1994,1999 ---- *************** expand_invoke (opcode, method_ref_index, *** 2068,2078 **** layout_class_methods (self_type); if (ID_INIT_P (method_name)) ! method = lookup_java_constructor (CLASS_TO_HANDLE_TYPE (self_type), ! method_signature); else ! method = lookup_java_method (CLASS_TO_HANDLE_TYPE (self_type), ! method_name, method_signature); if (method == NULL_TREE) { error ("class '%s' has no method named '%s' matching signature '%s'", --- 2062,2070 ---- layout_class_methods (self_type); if (ID_INIT_P (method_name)) ! method = lookup_java_constructor (self_type, method_signature); else ! method = lookup_java_method (self_type, method_name, method_signature); if (method == NULL_TREE) { error ("class '%s' has no method named '%s' matching signature '%s'", *************** build_jni_stub (method) *** 2186,2191 **** --- 2178,2185 ---- tree method_args, res_type; tree meth_var; + int args_size = 0; + tree klass = DECL_CONTEXT (method); int from_class = ! CLASS_FROM_SOURCE_P (klass); klass = build_class_ref (klass); *************** build_jni_stub (method) *** 2247,2253 **** special way, we would do that here. */ args = NULL_TREE; for (tem = method_args; tem != NULL_TREE; tem = TREE_CHAIN (tem)) ! args = tree_cons (NULL_TREE, tem, args); args = nreverse (args); arg_types = TYPE_ARG_TYPES (TREE_TYPE (method)); --- 2241,2256 ---- special way, we would do that here. */ args = NULL_TREE; for (tem = method_args; tem != NULL_TREE; tem = TREE_CHAIN (tem)) ! { ! int arg_bits = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (tem))); ! #ifdef PARM_BOUNDARY ! arg_bits = (((arg_bits + PARM_BOUNDARY - 1) / PARM_BOUNDARY) ! * PARM_BOUNDARY); ! #endif ! args_size += (arg_bits / BITS_PER_UNIT); ! ! args = tree_cons (NULL_TREE, tem, args); ! } args = nreverse (args); arg_types = TYPE_ARG_TYPES (TREE_TYPE (method)); *************** build_jni_stub (method) *** 2256,2286 **** available in the argument list. */ if (METHOD_STATIC (method)) { args = tree_cons (NULL_TREE, klass, args); arg_types = tree_cons (NULL_TREE, object_ptr_type_node, arg_types); } /* The JNIEnv structure is the first argument to the JNI function. */ args = tree_cons (NULL_TREE, env_var, args); arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); /* We call _Jv_LookupJNIMethod to find the actual underlying function pointer. _Jv_LookupJNIMethod will throw the appropriate exception if this function is not found at runtime. */ method_sig = build_java_signature (TREE_TYPE (method)); ! lookup_arg = ! build_tree_list (NULL_TREE, ! build_utf8_ref (unmangle_classname ! (IDENTIFIER_POINTER (method_sig), ! IDENTIFIER_LENGTH (method_sig)))); tem = DECL_NAME (method); lookup_arg = tree_cons (NULL_TREE, klass, tree_cons (NULL_TREE, build_utf8_ref (tem), lookup_arg)); ! jni_func_type ! = build_pointer_type (build_function_type (TREE_TYPE (TREE_TYPE (method)), ! arg_types)); jnifunc = build (COND_EXPR, ptr_type_node, meth_var, meth_var, --- 2259,2296 ---- available in the argument list. */ if (METHOD_STATIC (method)) { + args_size += int_size_in_bytes (TREE_TYPE (klass)); args = tree_cons (NULL_TREE, klass, args); arg_types = tree_cons (NULL_TREE, object_ptr_type_node, arg_types); } /* The JNIEnv structure is the first argument to the JNI function. */ + args_size += int_size_in_bytes (TREE_TYPE (env_var)); args = tree_cons (NULL_TREE, env_var, args); arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); /* We call _Jv_LookupJNIMethod to find the actual underlying function pointer. _Jv_LookupJNIMethod will throw the appropriate exception if this function is not found at runtime. */ + tem = build_tree_list (NULL_TREE, build_int_2 (args_size, 0)); method_sig = build_java_signature (TREE_TYPE (method)); ! lookup_arg = tree_cons (NULL_TREE, ! build_utf8_ref (unmangle_classname ! (IDENTIFIER_POINTER (method_sig), ! IDENTIFIER_LENGTH (method_sig))), ! tem); tem = DECL_NAME (method); lookup_arg = tree_cons (NULL_TREE, klass, tree_cons (NULL_TREE, build_utf8_ref (tem), lookup_arg)); + + tem = build_function_type (TREE_TYPE (TREE_TYPE (method)), arg_types); ! #ifdef MODIFY_JNI_METHOD_CALL ! tem = MODIFY_JNI_METHOD_CALL (tem); ! #endif ! ! jni_func_type = build_pointer_type (tem); jnifunc = build (COND_EXPR, ptr_type_node, meth_var, meth_var, *************** get_primitive_array_vtable (tree elt) *** 2485,2495 **** } struct rtx_def * ! java_lang_expand_expr (exp, target, tmode, modifier) register tree exp; rtx target; enum machine_mode tmode; ! enum expand_modifier modifier; { tree current; --- 2495,2505 ---- } struct rtx_def * ! java_expand_expr (exp, target, tmode, modifier) register tree exp; rtx target; enum machine_mode tmode; ! int modifier; /* Actually an enum expand_modifier. */ { tree current; *************** java_lang_expand_expr (exp, target, tmod *** 2570,2575 **** --- 2580,2586 ---- if (BLOCK_EXPR_BODY (exp)) { tree local; + rtx last; tree body = BLOCK_EXPR_BODY (exp); /* Set to 1 or more when we found a static class initialization flag. */ *************** java_lang_expand_expr (exp, target, tmod *** 2592,2599 **** if (! always_initialize_class_p && current_function_decl && found_class_initialization_flag) ! hash_traverse ! (&DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), emit_init_test_initialization, NULL); /* Avoid deep recursion for long block. */ --- 2603,2610 ---- if (! always_initialize_class_p && current_function_decl && found_class_initialization_flag) ! htab_traverse ! (DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), emit_init_test_initialization, NULL); /* Avoid deep recursion for long block. */ *************** java_lang_expand_expr (exp, target, tmod *** 2603,2613 **** emit_queue (); body = TREE_OPERAND (body, 1); } ! expand_expr (body, const0_rtx, VOIDmode, 0); emit_queue (); expand_end_bindings (getdecls (), 1, 0); poplevel (1, 1, 0); ! return const0_rtx; } return const0_rtx; --- 2614,2624 ---- emit_queue (); body = TREE_OPERAND (body, 1); } ! last = expand_expr (body, NULL_RTX, VOIDmode, 0); emit_queue (); expand_end_bindings (getdecls (), 1, 0); poplevel (1, 1, 0); ! return last; } return const0_rtx; *************** java_lang_expand_expr (exp, target, tmod *** 2664,2669 **** --- 2675,2685 ---- return expand_expr (build_exception_object_ref (TREE_TYPE (exp)), target, tmode, modifier); + case LABEL_EXPR: + /* Used only by expanded inline functions. */ + expand_label (TREE_OPERAND (exp, 0)); + return const0_rtx; + default: internal_error ("can't expand %s", tree_code_name [TREE_CODE (exp)]); } *************** force_evaluation_order (node) *** 3466,3484 **** /* Called for every element in DECL_FUNCTION_INIT_TEST_TABLE of a method in order to emit initialization code for each test flag. */ ! static bool ! emit_init_test_initialization (entry, key) ! struct hash_entry *entry; ! hash_table_key key ATTRIBUTE_UNUSED; { ! struct init_test_hash_entry *ite = (struct init_test_hash_entry *) entry; ! tree klass = build_class_ref ((tree) entry->key); tree rhs; /* If the DECL_INITIAL of the test flag is set to true, it means that the class is already initialized the time it is in use. */ ! if (DECL_INITIAL (ite->init_test_decl) == boolean_true_node) rhs = boolean_true_node; /* Otherwise, we initialize the class init check variable by looking at the `state' field of the class to see if it is already --- 3482,3500 ---- /* Called for every element in DECL_FUNCTION_INIT_TEST_TABLE of a method in order to emit initialization code for each test flag. */ ! static int ! emit_init_test_initialization (entry, x) ! void * * entry; ! void * x ATTRIBUTE_UNUSED; { ! struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry; ! tree klass = build_class_ref (ite->key); tree rhs; /* If the DECL_INITIAL of the test flag is set to true, it means that the class is already initialized the time it is in use. */ ! if (DECL_INITIAL (ite->value) == boolean_true_node) rhs = boolean_true_node; /* Otherwise, we initialize the class init check variable by looking at the `state' field of the class to see if it is already *************** emit_init_test_initialization (entry, ke *** 3493,3498 **** build_int_2 (JV_STATE_DONE, 0)); expand_expr_stmt (build (MODIFY_EXPR, boolean_type_node, ! ite->init_test_decl, rhs)); return true; } --- 3509,3517 ---- build_int_2 (JV_STATE_DONE, 0)); expand_expr_stmt (build (MODIFY_EXPR, boolean_type_node, ! ite->value, rhs)); return true; } + + #include "gt-java-expr.h" + diff -Nrc3pad gcc-3.2.3/gcc/java/gcj.1 gcc-3.3/gcc/java/gcj.1 *** gcc-3.2.3/gcc/java/gcj.1 2003-04-22 07:07:36.000000000 +0000 --- gcc-3.3/gcc/java/gcj.1 2003-05-14 00:32:09.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:36 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,154 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "GCJ 1" ! .TH GCJ 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" ! gcj \- Ahead-of-time compiler for the Java language .SH "SYNOPSIS" .IX Header "SYNOPSIS" gcj [\fB\-I\fR\fIdir\fR...] [\fB\-d\fR \fIdir\fR...] ! [\fB\*(--CLASSPATH\fR=\fIpath\fR] [\fB\*(--classpath\fR=\fIpath\fR] ! [\fB\-f\fR\fIoption\fR...] [\fB\*(--encoding\fR=\fIname\fR] ! [\fB\*(--main\fR=\fIclassname\fR] [\fB\-D\fR\fIname\fR[=\fIvalue\fR]...] ! [\fB\-C\fR] [\fB\*(--resource\fR \fIresource-name\fR] [\fB\-d\fR \fIdirectory\fR] [\fB\-W\fR\fIwarn\fR...] \fIsourcefile\fR... .SH "DESCRIPTION" --- 126,144 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "GCJ 1" ! .TH GCJ 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" ! gcj \- Ahead\-of\-time compiler for the Java language .SH "SYNOPSIS" .IX Header "SYNOPSIS" gcj [\fB\-I\fR\fIdir\fR...] [\fB\-d\fR \fIdir\fR...] ! [\fB\-\-CLASSPATH\fR=\fIpath\fR] [\fB\-\-classpath\fR=\fIpath\fR] ! [\fB\-f\fR\fIoption\fR...] [\fB\-\-encoding\fR=\fIname\fR] ! [\fB\-\-main\fR=\fIclassname\fR] [\fB\-D\fR\fIname\fR[=\fIvalue\fR]...] ! [\fB\-C\fR] [\fB\-\-resource\fR \fIresource-name\fR] [\fB\-d\fR \fIdirectory\fR] [\fB\-W\fR\fIwarn\fR...] \fIsourcefile\fR... .SH "DESCRIPTION" *************** options specific to \fBgcj\fR. *** 163,194 **** A \fBgcj\fR command is like a \fBgcc\fR command, in that it consists of a number of options and file names. The following kinds of input file names are supported: ! .Ip "\fIfile\fR\fB.java\fR" 4 .IX Item "file.java" Java source files. ! .Ip "\fIfile\fR\fB.class\fR" 4 .IX Item "file.class" Java bytecode files. ! .Ip "\fIfile\fR\fB.zip\fR" 4 .IX Item "file.zip" .PD 0 ! .Ip "\fIfile\fR\fB.jar\fR" 4 .IX Item "file.jar" .PD An archive containing one or more \f(CW\*(C`.class\*(C'\fR files, all of which are compiled. The archive may be compressed. ! .Ip "\fB@\fR\fIfile\fR" 4 .IX Item "@file" A file containing a whitespace-separated list of input file names. (Currently, these must all be \f(CW\*(C`.java\*(C'\fR source files, but that may change.) Each named file is compiled, just as if it had been on the command line. ! .Ip "\fIlibrary\fR\fB.a\fR" 4 .IX Item "library.a" .PD 0 ! .Ip "\fIlibrary\fR\fB.so\fR" 4 .IX Item "library.so" ! .Ip "\fB\-l\fR\fIlibname\fR" 4 .IX Item "-llibname" .PD Libraries to use when linking. See the \fBgcc\fR manual. --- 153,184 ---- A \fBgcj\fR command is like a \fBgcc\fR command, in that it consists of a number of options and file names. The following kinds of input file names are supported: ! .IP "\fIfile\fR\fB.java\fR" 4 .IX Item "file.java" Java source files. ! .IP "\fIfile\fR\fB.class\fR" 4 .IX Item "file.class" Java bytecode files. ! .IP "\fIfile\fR\fB.zip\fR" 4 .IX Item "file.zip" .PD 0 ! .IP "\fIfile\fR\fB.jar\fR" 4 .IX Item "file.jar" .PD An archive containing one or more \f(CW\*(C`.class\*(C'\fR files, all of which are compiled. The archive may be compressed. ! .IP "\fB@\fR\fIfile\fR" 4 .IX Item "@file" A file containing a whitespace-separated list of input file names. (Currently, these must all be \f(CW\*(C`.java\*(C'\fR source files, but that may change.) Each named file is compiled, just as if it had been on the command line. ! .IP "\fIlibrary\fR\fB.a\fR" 4 .IX Item "library.a" .PD 0 ! .IP "\fIlibrary\fR\fB.so\fR" 4 .IX Item "library.so" ! .IP "\fB\-l\fR\fIlibname\fR" 4 .IX Item "-llibname" .PD Libraries to use when linking. See the \fBgcc\fR manual. *************** standard classes. *** 219,263 **** In the below, a directory or path component can refer either to an actual directory on the filesystem, or to a \fI.zip\fR or \fI.jar\fR file, which \fBgcj\fR will search as if it is a directory. ! .Ip "\fB\-I\fR\fIdir\fR" 4 .IX Item "-Idir" All directories specified by \f(CW\*(C`\-I\*(C'\fR are kept in order and prepended to the class path constructed from all the other options. Unless ! compatibility with tools like \f(CW\*(C`javac\*(C'\fR is imported, we recommend always using \f(CW\*(C`\-I\*(C'\fR instead of the other options for manipulating the class path. ! .Ip "\fB\*(--classpath=\fR\fIpath\fR" 4 ! .IX Item "classpath=path" This sets the class path to \fIpath\fR, a colon-separated list of paths (on Windows-based systems, a semicolon-separate list of paths). This does not override the builtin (``boot'') search path. ! .Ip "\fB\*(--CLASSPATH=\fR\fIpath\fR" 4 ! .IX Item "CLASSPATH=path" Deprecated synonym for \f(CW\*(C`\-\-classpath\*(C'\fR. ! .Ip "\fB\*(--bootclasspath=\fR\fIpath\fR" 4 ! .IX Item "bootclasspath=path" Where to find the standard builtin classes, such as \f(CW\*(C`java.lang.String\*(C'\fR. ! .Ip "\fB\*(--extdirs=\fR\fIpath\fR" 4 ! .IX Item "extdirs=path" For each directory in the \fIpath\fR, place the contents of that directory at the end of the class path. ! .Ip "\fB\s-1CLASSPATH\s0\fR" 4 .IX Item "CLASSPATH" This is an environment variable which holds a list of paths. .PP The final class path is constructed like so: ! .Ip "\(bu" 4 First come all directories specified via \f(CW\*(C`\-I\*(C'\fR. ! .Ip "\(bu" 4 ! If \fB\*(--classpath\fR is specified, its value is appended. Otherwise, if the \f(CW\*(C`CLASSPATH\*(C'\fR environment variable is specified, then its value is appended. ! Otherwise, the current directory (\f(CW\*(C`"."\*(C'\fR) is appended. ! .Ip "\(bu" 4 If \f(CW\*(C`\-\-bootclasspath\*(C'\fR was specified, append its value. Otherwise, append the built-in system directory, \fIlibgcj.jar\fR. ! .Ip "\(bu" 4 ! Finaly, if \f(CW\*(C`\-\-extdirs\*(C'\fR was specified, append the contents of the specified directories at the end of the class path. Otherwise, append the contents of the built-in extdirs at \f(CW\*(C`$(prefix)/share/java/ext\*(C'\fR. .PP --- 209,253 ---- In the below, a directory or path component can refer either to an actual directory on the filesystem, or to a \fI.zip\fR or \fI.jar\fR file, which \fBgcj\fR will search as if it is a directory. ! .IP "\fB\-I\fR\fIdir\fR" 4 .IX Item "-Idir" All directories specified by \f(CW\*(C`\-I\*(C'\fR are kept in order and prepended to the class path constructed from all the other options. Unless ! compatibility with tools like \f(CW\*(C`javac\*(C'\fR is important, we recommend always using \f(CW\*(C`\-I\*(C'\fR instead of the other options for manipulating the class path. ! .IP "\fB\-\-classpath=\fR\fIpath\fR" 4 ! .IX Item "--classpath=path" This sets the class path to \fIpath\fR, a colon-separated list of paths (on Windows-based systems, a semicolon-separate list of paths). This does not override the builtin (``boot'') search path. ! .IP "\fB\-\-CLASSPATH=\fR\fIpath\fR" 4 ! .IX Item "--CLASSPATH=path" Deprecated synonym for \f(CW\*(C`\-\-classpath\*(C'\fR. ! .IP "\fB\-\-bootclasspath=\fR\fIpath\fR" 4 ! .IX Item "--bootclasspath=path" Where to find the standard builtin classes, such as \f(CW\*(C`java.lang.String\*(C'\fR. ! .IP "\fB\-\-extdirs=\fR\fIpath\fR" 4 ! .IX Item "--extdirs=path" For each directory in the \fIpath\fR, place the contents of that directory at the end of the class path. ! .IP "\fB\s-1CLASSPATH\s0\fR" 4 .IX Item "CLASSPATH" This is an environment variable which holds a list of paths. .PP The final class path is constructed like so: ! .IP "\(bu" 4 First come all directories specified via \f(CW\*(C`\-I\*(C'\fR. ! .IP "\(bu" 4 ! If \fB\-\-classpath\fR is specified, its value is appended. Otherwise, if the \f(CW\*(C`CLASSPATH\*(C'\fR environment variable is specified, then its value is appended. ! Otherwise, the current directory (\f(CW"."\fR) is appended. ! .IP "\(bu" 4 If \f(CW\*(C`\-\-bootclasspath\*(C'\fR was specified, append its value. Otherwise, append the built-in system directory, \fIlibgcj.jar\fR. ! .IP "\(bu" 4 ! Finally, if \f(CW\*(C`\-\-extdirs\*(C'\fR was specified, append the contents of the specified directories at the end of the class path. Otherwise, append the contents of the built-in extdirs at \f(CW\*(C`$(prefix)/share/java/ext\*(C'\fR. .PP *************** attribute when loading \f(CW\*(C`java.la *** 268,274 **** if it isn't found, unless it compiles to bytecode (the option \&\f(CW\*(C`\-fforce\-classes\-archive\-check\*(C'\fR can be used to override this behavior in this particular case.) ! .Ip "\fB\-fforce-classes-archive-check\fR" 4 .IX Item "-fforce-classes-archive-check" This forces the compiler to always check for the special zero length attribute \f(CW\*(C`gnu.gcj.gcj\-compiled\*(C'\fR in \f(CW\*(C`java.lang.Object\*(C'\fR and --- 258,264 ---- if it isn't found, unless it compiles to bytecode (the option \&\f(CW\*(C`\-fforce\-classes\-archive\-check\*(C'\fR can be used to override this behavior in this particular case.) ! .IP "\fB\-fforce\-classes\-archive\-check\fR" 4 .IX Item "-fforce-classes-archive-check" This forces the compiler to always check for the special zero length attribute \f(CW\*(C`gnu.gcj.gcj\-compiled\*(C'\fR in \f(CW\*(C`java.lang.Object\*(C'\fR and *************** You can use the \f(CW\*(C`\-\-encoding=\ *** 284,290 **** encoding (of a particular character set) to use for source files. If this is not specified, the default encoding comes from your current locale. If your host system has insufficient locale support, then ! \&\fBgcj\fR assumes the default encoding to be the \fB\s-1UTF-8\s0\fR encoding of Unicode. .PP To implement \f(CW\*(C`\-\-encoding\*(C'\fR, \fBgcj\fR simply uses the host --- 274,280 ---- encoding (of a particular character set) to use for source files. If this is not specified, the default encoding comes from your current locale. If your host system has insufficient locale support, then ! \&\fBgcj\fR assumes the default encoding to be the \fB\s-1UTF\-8\s0\fR encoding of Unicode. .PP To implement \f(CW\*(C`\-\-encoding\*(C'\fR, \fBgcj\fR simply uses the host *************** platform's \f(CW\*(C`iconv\*(C'\fR conve *** 293,299 **** .PP The names allowed for the argument \f(CW\*(C`\-\-encoding\*(C'\fR vary from platform to platform (since they are not standardized anywhere). However, ! \&\fBgcj\fR implements the encoding named \fB\s-1UTF-8\s0\fR internally, so if you choose to use this for your source files you can be assured that it will work on every host. .Sh "Warnings" --- 283,289 ---- .PP The names allowed for the argument \f(CW\*(C`\-\-encoding\*(C'\fR vary from platform to platform (since they are not standardized anywhere). However, ! \&\fBgcj\fR implements the encoding named \fB\s-1UTF\-8\s0\fR internally, so if you choose to use this for your source files you can be assured that it will work on every host. .Sh "Warnings" *************** will work on every host. *** 303,325 **** warning, then \f(CW\*(C`\-Wno\-foo\*(C'\fR will disable it. Here we've chosen to document the form of the warning which will have an effect \*(-- the default being the opposite of what is listed. ! .Ip "\fB\-Wredundant-modifiers\fR" 4 .IX Item "-Wredundant-modifiers" With this flag, \fBgcj\fR will warn about redundant modifiers. For instance, it will warn if an interface method is declared \f(CW\*(C`public\*(C'\fR. ! .Ip "\fB\-Wextraneous-semicolon\fR" 4 .IX Item "-Wextraneous-semicolon" This causes \fBgcj\fR to warn about empty statements. Empty statements have been deprecated. ! .Ip "\fB\-Wno-out-of-date\fR" 4 .IX Item "-Wno-out-of-date" This option will cause \fBgcj\fR not to warn when a source file is newer than its matching class file. By default \fBgcj\fR will warn about this. ! .Ip "\fB\-Wunused\fR" 4 .IX Item "-Wunused" This is the same as \fBgcc\fR's \f(CW\*(C`\-Wunused\*(C'\fR. ! .Ip "\fB\-Wall\fR" 4 .IX Item "-Wall" This is the same as \f(CW\*(C`\-Wredundant\-modifiers \-Wextraneous\-semicolon \&\-Wunused\*(C'\fR. --- 293,315 ---- warning, then \f(CW\*(C`\-Wno\-foo\*(C'\fR will disable it. Here we've chosen to document the form of the warning which will have an effect \*(-- the default being the opposite of what is listed. ! .IP "\fB\-Wredundant\-modifiers\fR" 4 .IX Item "-Wredundant-modifiers" With this flag, \fBgcj\fR will warn about redundant modifiers. For instance, it will warn if an interface method is declared \f(CW\*(C`public\*(C'\fR. ! .IP "\fB\-Wextraneous\-semicolon\fR" 4 .IX Item "-Wextraneous-semicolon" This causes \fBgcj\fR to warn about empty statements. Empty statements have been deprecated. ! .IP "\fB\-Wno\-out\-of\-date\fR" 4 .IX Item "-Wno-out-of-date" This option will cause \fBgcj\fR not to warn when a source file is newer than its matching class file. By default \fBgcj\fR will warn about this. ! .IP "\fB\-Wunused\fR" 4 .IX Item "-Wunused" This is the same as \fBgcc\fR's \f(CW\*(C`\-Wunused\*(C'\fR. ! .IP "\fB\-Wall\fR" 4 .IX Item "-Wall" This is the same as \f(CW\*(C`\-Wredundant\-modifiers \-Wextraneous\-semicolon \&\-Wunused\*(C'\fR. *************** This is the same as \f(CW\*(C`\-Wredunda *** 327,350 **** .IX Subsection "Code Generation" In addition to the many \fBgcc\fR options controlling code generation, \&\fBgcj\fR has several options specific to itself. ! .Ip "\fB\*(--main=\fR\fI\s-1CLASSNAME\s0\fR" 4 ! .IX Item "main=CLASSNAME" This option is used when linking to specify the name of the class whose \&\f(CW\*(C`main\*(C'\fR method should be invoked when the resulting executable is run. [1] ! .Ip "\fB\-D\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]\fR" 4 .IX Item "-Dname[=value]" This option can only be used with \f(CW\*(C`\-\-main\*(C'\fR. It defines a system property named \fIname\fR with value \fIvalue\fR. If \fIvalue\fR is not specified then it defaults to the empty string. These system properties are initialized at the program's startup and can be retrieved at runtime using the \f(CW\*(C`java.lang.System.getProperty\*(C'\fR method. ! .Ip "\fB\-C\fR" 4 .IX Item "-C" This option is used to tell \fBgcj\fR to generate bytecode (\fI.class\fR files) rather than object code. ! .Ip "\fB\*(--resource\fR \fIresource-name\fR" 4 ! .IX Item "resource resource-name" This option is used to tell \fBgcj\fR to compile the contents of a given file to object code so it may be accessed at runtime with the core protocol handler as \fBcore:/\fR\fIresource-name\fR. Note that --- 317,340 ---- .IX Subsection "Code Generation" In addition to the many \fBgcc\fR options controlling code generation, \&\fBgcj\fR has several options specific to itself. ! .IP "\fB\-\-main=\fR\fI\s-1CLASSNAME\s0\fR" 4 ! .IX Item "--main=CLASSNAME" This option is used when linking to specify the name of the class whose \&\f(CW\*(C`main\*(C'\fR method should be invoked when the resulting executable is run. [1] ! .IP "\fB\-D\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]\fR" 4 .IX Item "-Dname[=value]" This option can only be used with \f(CW\*(C`\-\-main\*(C'\fR. It defines a system property named \fIname\fR with value \fIvalue\fR. If \fIvalue\fR is not specified then it defaults to the empty string. These system properties are initialized at the program's startup and can be retrieved at runtime using the \f(CW\*(C`java.lang.System.getProperty\*(C'\fR method. ! .IP "\fB\-C\fR" 4 .IX Item "-C" This option is used to tell \fBgcj\fR to generate bytecode (\fI.class\fR files) rather than object code. ! .IP "\fB\-\-resource\fR \fIresource-name\fR" 4 ! .IX Item "--resource resource-name" This option is used to tell \fBgcj\fR to compile the contents of a given file to object code so it may be accessed at runtime with the core protocol handler as \fBcore:/\fR\fIresource-name\fR. Note that *************** protocol handler as \fBcore:/\fR\fIresou *** 352,364 **** instance, it could be used in a call to \f(CW\*(C`ResourceBundle.getBundle\*(C'\fR. The actual file name to be compiled this way must be specified separately. ! .Ip "\fB\-d\fR \fIdirectory\fR" 4 .IX Item "-d directory" When used with \f(CW\*(C`\-C\*(C'\fR, this causes all generated \fI.class\fR files to be put in the appropriate subdirectory of \fIdirectory\fR. By default they will be put in subdirectories of the current working directory. ! .Ip "\fB\-fno-bounds-check\fR" 4 .IX Item "-fno-bounds-check" By default, \fBgcj\fR generates code which checks the bounds of all array indexing operations. With this option, these checks are omitted, which --- 342,354 ---- instance, it could be used in a call to \f(CW\*(C`ResourceBundle.getBundle\*(C'\fR. The actual file name to be compiled this way must be specified separately. ! .IP "\fB\-d\fR \fIdirectory\fR" 4 .IX Item "-d directory" When used with \f(CW\*(C`\-C\*(C'\fR, this causes all generated \fI.class\fR files to be put in the appropriate subdirectory of \fIdirectory\fR. By default they will be put in subdirectories of the current working directory. ! .IP "\fB\-fno\-bounds\-check\fR" 4 .IX Item "-fno-bounds-check" By default, \fBgcj\fR generates code which checks the bounds of all array indexing operations. With this option, these checks are omitted, which *************** can improve performance for code that us *** 366,381 **** can result in unpredictable behavior if the code in question actually does violate array bounds constraints. It is safe to use this option if you are sure that your code will never throw an \f(CW\*(C`ArrayIndexOutOfBoundsException\*(C'\fR. ! .Ip "\fB\-fno-store-check\fR" 4 .IX Item "-fno-store-check" Don't generate array store checks. When storing objects into arrays, a runtime check is normally generated in order to ensure that the object is assignment compatible with the component type of the array (which may not be known ! at compile-time). With this option, these checks are omitted. This can improve performance for code which stores objects into arrays frequently. It is safe to use this option if you are sure your code will never throw an \&\f(CW\*(C`ArrayStoreException\*(C'\fR. ! .Ip "\fB\-fjni\fR" 4 .IX Item "-fjni" With \fBgcj\fR there are two options for writing native methods: \s-1CNI\s0 and \s-1JNI\s0. By default \fBgcj\fR assumes you are using \s-1CNI\s0. If you are --- 356,371 ---- can result in unpredictable behavior if the code in question actually does violate array bounds constraints. It is safe to use this option if you are sure that your code will never throw an \f(CW\*(C`ArrayIndexOutOfBoundsException\*(C'\fR. ! .IP "\fB\-fno\-store\-check\fR" 4 .IX Item "-fno-store-check" Don't generate array store checks. When storing objects into arrays, a runtime check is normally generated in order to ensure that the object is assignment compatible with the component type of the array (which may not be known ! at compile\-time). With this option, these checks are omitted. This can improve performance for code which stores objects into arrays frequently. It is safe to use this option if you are sure your code will never throw an \&\f(CW\*(C`ArrayStoreException\*(C'\fR. ! .IP "\fB\-fjni\fR" 4 .IX Item "-fjni" With \fBgcj\fR there are two options for writing native methods: \s-1CNI\s0 and \s-1JNI\s0. By default \fBgcj\fR assumes you are using \s-1CNI\s0. If you are *************** compiling a class with native methods, a *** 383,391 **** using \s-1JNI\s0, then you must use \f(CW\*(C`\-fjni\*(C'\fR. This option causes \&\fBgcj\fR to generate stubs which will invoke the underlying \s-1JNI\s0 methods. ! .Ip "\fB\-fno-optimize-static-class-initialization\fR" 4 .IX Item "-fno-optimize-static-class-initialization" ! When the optimization level is greather or equal to \f(CW\*(C`\-O2\*(C'\fR, \&\fBgcj\fR will try to optimize the way calls into the runtime are made to initialize static classes upon their first use (this optimization isn't carried out if \f(CW\*(C`\-C\*(C'\fR was specified.) When compiling to native --- 373,385 ---- using \s-1JNI\s0, then you must use \f(CW\*(C`\-fjni\*(C'\fR. This option causes \&\fBgcj\fR to generate stubs which will invoke the underlying \s-1JNI\s0 methods. ! .IP "\fB\-fno\-assert\fR" 4 ! .IX Item "-fno-assert" ! Don't recognize the \f(CW\*(C`assert\*(C'\fR keyword. This is for compatibility ! with older versions of the language specification. ! .IP "\fB\-fno\-optimize\-static\-class\-initialization\fR" 4 .IX Item "-fno-optimize-static-class-initialization" ! When the optimization level is greater or equal to \f(CW\*(C`\-O2\*(C'\fR, \&\fBgcj\fR will try to optimize the way calls into the runtime are made to initialize static classes upon their first use (this optimization isn't carried out if \f(CW\*(C`\-C\*(C'\fR was specified.) When compiling to native *************** package, is configured. \f(CW\*(C`libgc *** 399,421 **** this group into a \fBspec\fR file which is read by \fBgcj\fR. These options are listed here for completeness; if you are using \f(CW\*(C`libgcj\*(C'\fR then you won't want to touch these options. ! .Ip "\fB\-fuse-boehm-gc\fR" 4 .IX Item "-fuse-boehm-gc" This enables the use of the Boehm \s-1GC\s0 bitmap marking code. In particular this causes \fBgcj\fR to put an object marking descriptor into each vtable. ! .Ip "\fB\-fhash-synchronization\fR" 4 .IX Item "-fhash-synchronization" By default, synchronization data (the data used for \f(CW\*(C`synchronize\*(C'\fR, \&\f(CW\*(C`wait\*(C'\fR, and \f(CW\*(C`notify\*(C'\fR) is pointed to by a word in each object. With this option \fBgcj\fR assumes that this information is stored in a hash table and not in the object itself. ! .Ip "\fB\-fuse-divide-subroutine\fR" 4 .IX Item "-fuse-divide-subroutine" On some systems, a library routine is called to perform integer division. This is required to get exception handling correct when dividing by zero. ! .Ip "\fB\-fcheck-references\fR" 4 .IX Item "-fcheck-references" On some systems it's necessary to insert inline checks whenever accessing an object via a reference. On other systems you won't need --- 393,415 ---- this group into a \fBspec\fR file which is read by \fBgcj\fR. These options are listed here for completeness; if you are using \f(CW\*(C`libgcj\*(C'\fR then you won't want to touch these options. ! .IP "\fB\-fuse\-boehm\-gc\fR" 4 .IX Item "-fuse-boehm-gc" This enables the use of the Boehm \s-1GC\s0 bitmap marking code. In particular this causes \fBgcj\fR to put an object marking descriptor into each vtable. ! .IP "\fB\-fhash\-synchronization\fR" 4 .IX Item "-fhash-synchronization" By default, synchronization data (the data used for \f(CW\*(C`synchronize\*(C'\fR, \&\f(CW\*(C`wait\*(C'\fR, and \f(CW\*(C`notify\*(C'\fR) is pointed to by a word in each object. With this option \fBgcj\fR assumes that this information is stored in a hash table and not in the object itself. ! .IP "\fB\-fuse\-divide\-subroutine\fR" 4 .IX Item "-fuse-divide-subroutine" On some systems, a library routine is called to perform integer division. This is required to get exception handling correct when dividing by zero. ! .IP "\fB\-fcheck\-references\fR" 4 .IX Item "-fcheck-references" On some systems it's necessary to insert inline checks whenever accessing an object via a reference. On other systems you won't need *************** this because null pointer accesses are c *** 423,429 **** processor. .SH "FOOTNOTES" .IX Header "FOOTNOTES" ! .Ip "1." 4 The linker by default looks for a global function named \&\f(CW\*(C`main\*(C'\fR. Since Java does not have global functions, and a collection of Java classes may have more than one class with a --- 417,423 ---- processor. .SH "FOOTNOTES" .IX Header "FOOTNOTES" ! .IP "1." 4 The linker by default looks for a global function named \&\f(CW\*(C`main\*(C'\fR. Since Java does not have global functions, and a collection of Java classes may have more than one class with a *************** collection of Java classes may have more *** 431,446 **** \&\f(CW\*(C`main\*(C'\fR methods it should invoke when starting the application. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcjh\fR\|(1), \fIgij\fR\|(1), \fIjv-scan\fR\|(1), \fIjcf-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 425,454 ---- \&\f(CW\*(C`main\*(C'\fR methods it should invoke when starting the application. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcjh\fR\|(1), \fIgij\fR\|(1), \fIjv\-scan\fR\|(1), \fIjcf\-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/gcjh.1 gcc-3.3/gcc/java/gcjh.1 *** gcc-3.2.3/gcc/java/gcjh.1 2003-04-22 07:07:37.000000000 +0000 --- gcc-3.3/gcc/java/gcjh.1 2003-05-14 00:32:09.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:36 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,145 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "GCJH 1" ! .TH GCJH 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" gcjh \- generate header files from Java class files .SH "SYNOPSIS" --- 126,135 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "GCJH 1" ! .TH GCJH 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" gcjh \- generate header files from Java class files .SH "SYNOPSIS" *************** gcjh \- generate header files from Java *** 147,157 **** gcjh [\fB\-stubs\fR] [\fB\-jni\fR] [\fB\-add\fR \fItext\fR] [\fB\-append\fR \fItext\fR] [\fB\-friend\fR \fItext\fR] [\fB\-preprend\fR \fItext\fR] ! [\fB\*(--classpath\fR=\fIpath\fR] [\fB\*(--CLASSPATH\fR=\fIpath\fR] [\fB\-I\fR\fIdir\fR...] [\fB\-d\fR \fIdir\fR...] [\fB\-o\fR \fIfile\fR] [\fB\-td\fR \fIdir\fR] [\fB\-M\fR] [\fB\-MM\fR] [\fB\-MD\fR] [\fB\-MMD\fR] ! [\fB\*(--version\fR] [\fB\*(--help\fR] [\fB\-v\fR] [\fB\*(--verbose\fR] \fIclassname\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" --- 137,147 ---- gcjh [\fB\-stubs\fR] [\fB\-jni\fR] [\fB\-add\fR \fItext\fR] [\fB\-append\fR \fItext\fR] [\fB\-friend\fR \fItext\fR] [\fB\-preprend\fR \fItext\fR] ! [\fB\-\-classpath\fR=\fIpath\fR] [\fB\-\-CLASSPATH\fR=\fIpath\fR] [\fB\-I\fR\fIdir\fR...] [\fB\-d\fR \fIdir\fR...] [\fB\-o\fR \fIfile\fR] [\fB\-td\fR \fIdir\fR] [\fB\-M\fR] [\fB\-MM\fR] [\fB\-MD\fR] [\fB\-MMD\fR] ! [\fB\-\-version\fR] [\fB\-\-help\fR] [\fB\-v\fR] [\fB\-\-verbose\fR] \fIclassname\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" *************** implementation files which can be used a *** 161,247 **** required native methods. .SH "OPTIONS" .IX Header "OPTIONS" ! .Ip "\fB\-stubs\fR" 4 .IX Item "-stubs" This causes \f(CW\*(C`gcjh\*(C'\fR to generate stub files instead of header files. By default the stub file will be named after the class, with a suffix of \&\fB.cc\fR. In \s-1JNI\s0 mode, the default output file will have the suffix \&\fB.c\fR. ! .Ip "\fB\-jni\fR" 4 .IX Item "-jni" This tells \f(CW\*(C`gcjh\*(C'\fR to generate a \s-1JNI\s0 header or stub. By default, \&\s-1CNI\s0 headers are generated. ! .Ip "\fB\-add\fR \fItext\fR" 4 .IX Item "-add text" Inserts \fItext\fR into the class body. This is ignored in \s-1JNI\s0 mode. ! .Ip "\fB\-append\fR \fItext\fR" 4 .IX Item "-append text" Inserts \fItext\fR into the header file after the class declaration. This is ignored in \s-1JNI\s0 mode. ! .Ip "\fB\-friend\fR \fItext\fR" 4 .IX Item "-friend text" Inserts \fItext\fR into the class as a \f(CW\*(C`friend\*(C'\fR declaration. This is ignored in \s-1JNI\s0 mode. ! .Ip "\fB\-prepend\fR \fItext\fR" 4 .IX Item "-prepend text" Inserts \fItext\fR into the header file before the class declaration. This is ignored in \s-1JNI\s0 mode. ! .Ip "\fB\*(--classpath=\fR\fIpath\fR" 4 ! .IX Item "classpath=path" .PD 0 ! .Ip "\fB\*(--CLASSPATH=\fR\fIpath\fR" 4 ! .IX Item "CLASSPATH=path" ! .Ip "\fB\-I\fR\fIdirectory\fR" 4 .IX Item "-Idirectory" ! .Ip "\fB\-d\fR \fIdirectory\fR" 4 .IX Item "-d directory" ! .Ip "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" .PD These options are all identical to the corresponding \fBgcj\fR options. ! .Ip "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" Sets the output file name. This cannot be used if there is more than one class on the command line. ! .Ip "\fB\-td\fR \fIdirectory\fR" 4 .IX Item "-td directory" Sets the name of the directory to use for temporary files. ! .Ip "\fB\-M\fR" 4 .IX Item "-M" Print all dependencies to stdout; suppress ordinary output. ! .Ip "\fB\-MM\fR" 4 .IX Item "-MM" Print non-system dependencies to stdout; suppress ordinary output. ! .Ip "\fB\-MD\fR" 4 .IX Item "-MD" Print all dependencies to stdout. ! .Ip "\fB\-MMD\fR" 4 .IX Item "-MMD" Print non-system dependencies to stdout. ! .Ip "\fB\*(--help\fR" 4 ! .IX Item "help" Print help about \f(CW\*(C`gcjh\*(C'\fR and exit. No further processing is done. ! .Ip "\fB\*(--version\fR" 4 ! .IX Item "version" Print version information for \f(CW\*(C`gcjh\*(C'\fR and exit. No further processing is done. ! .Ip "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Print extra information while running. .PP All remaining options are considered to be names of classes. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgij\fR\|(1), \fIjv-scan\fR\|(1), \fIjcf-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 151,251 ---- required native methods. .SH "OPTIONS" .IX Header "OPTIONS" ! .IP "\fB\-stubs\fR" 4 .IX Item "-stubs" This causes \f(CW\*(C`gcjh\*(C'\fR to generate stub files instead of header files. By default the stub file will be named after the class, with a suffix of \&\fB.cc\fR. In \s-1JNI\s0 mode, the default output file will have the suffix \&\fB.c\fR. ! .IP "\fB\-jni\fR" 4 .IX Item "-jni" This tells \f(CW\*(C`gcjh\*(C'\fR to generate a \s-1JNI\s0 header or stub. By default, \&\s-1CNI\s0 headers are generated. ! .IP "\fB\-add\fR \fItext\fR" 4 .IX Item "-add text" Inserts \fItext\fR into the class body. This is ignored in \s-1JNI\s0 mode. ! .IP "\fB\-append\fR \fItext\fR" 4 .IX Item "-append text" Inserts \fItext\fR into the header file after the class declaration. This is ignored in \s-1JNI\s0 mode. ! .IP "\fB\-friend\fR \fItext\fR" 4 .IX Item "-friend text" Inserts \fItext\fR into the class as a \f(CW\*(C`friend\*(C'\fR declaration. This is ignored in \s-1JNI\s0 mode. ! .IP "\fB\-prepend\fR \fItext\fR" 4 .IX Item "-prepend text" Inserts \fItext\fR into the header file before the class declaration. This is ignored in \s-1JNI\s0 mode. ! .IP "\fB\-\-classpath=\fR\fIpath\fR" 4 ! .IX Item "--classpath=path" .PD 0 ! .IP "\fB\-\-CLASSPATH=\fR\fIpath\fR" 4 ! .IX Item "--CLASSPATH=path" ! .IP "\fB\-I\fR\fIdirectory\fR" 4 .IX Item "-Idirectory" ! .IP "\fB\-d\fR \fIdirectory\fR" 4 .IX Item "-d directory" ! .IP "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" .PD These options are all identical to the corresponding \fBgcj\fR options. ! .IP "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" Sets the output file name. This cannot be used if there is more than one class on the command line. ! .IP "\fB\-td\fR \fIdirectory\fR" 4 .IX Item "-td directory" Sets the name of the directory to use for temporary files. ! .IP "\fB\-M\fR" 4 .IX Item "-M" Print all dependencies to stdout; suppress ordinary output. ! .IP "\fB\-MM\fR" 4 .IX Item "-MM" Print non-system dependencies to stdout; suppress ordinary output. ! .IP "\fB\-MD\fR" 4 .IX Item "-MD" Print all dependencies to stdout. ! .IP "\fB\-MMD\fR" 4 .IX Item "-MMD" Print non-system dependencies to stdout. ! .IP "\fB\-\-help\fR" 4 ! .IX Item "--help" Print help about \f(CW\*(C`gcjh\*(C'\fR and exit. No further processing is done. ! .IP "\fB\-\-version\fR" 4 ! .IX Item "--version" Print version information for \f(CW\*(C`gcjh\*(C'\fR and exit. No further processing is done. ! .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Print extra information while running. .PP All remaining options are considered to be names of classes. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgij\fR\|(1), \fIjv\-scan\fR\|(1), \fIjcf\-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/gcj.info gcc-3.3/gcc/java/gcj.info *** gcc-3.2.3/gcc/java/gcj.info 2003-04-22 07:07:25.000000000 +0000 --- gcc-3.3/gcc/java/gcj.info 2003-05-14 00:31:48.000000000 +0000 *************** *** 1,5 **** ! This is gcj.info, produced by makeinfo version 4.5 from gcj.texi. INFO-DIR-SECTION Programming START-INFO-DIR-ENTRY * Gcj: (gcj). Ahead-of-time compiler for the Java language --- 1,24 ---- ! This is gcj.info, produced by makeinfo version 4.2 from gcj.texi. ! ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! Permission is granted to copy, distribute and/or modify this document ! under the terms of the GNU Free Documentation License, Version 1.2 or ! any later version published by the Free Software Foundation; with the ! Invariant Sections being "GNU General Public License", the Front-Cover ! texts being (a) (see below), and with the Back-Cover Texts being (b) ! (see below). A copy of the license is included in the section entitled ! "GNU Free Documentation License". ! ! (a) The FSF's Front-Cover Text is: + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. INFO-DIR-SECTION Programming START-INFO-DIR-ENTRY * Gcj: (gcj). Ahead-of-time compiler for the Java language *************** START-INFO-DIR-ENTRY *** 22,31 **** The remote object registry. END-INFO-DIR-ENTRY ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document ! under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being "GNU General Public License", the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) --- 41,50 ---- The remote object registry. END-INFO-DIR-ENTRY ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document ! under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being "GNU General Public License", the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) *************** texts being (a) (see below), and with th *** 40,89 **** You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise ! funds for GNU development.  ! Indirect: ! gcj.info-1: 1742 ! gcj.info-2: 49300  Tag Table: ! (Indirect) ! Node: Top1742 ! Node: Copying2826 ! Node: GNU Free Documentation License22029 ! Node: Invoking gcj41913 ! Node: Input and output files42564 ! Node: Input Options43927 ! Node: Encodings47068 ! Node: Warnings48269 ! Node: Code Generation49300 ! Ref: Code Generation-Footnote-152820 ! Node: Configure-time Options53129 ! Node: Compatibility54547 ! Node: Invoking gcjh55839 ! Node: Invoking jv-scan57895 ! Node: Invoking jcf-dump58793 ! Node: Invoking gij59564 ! Node: Invoking jv-convert61446 ! Node: Invoking rmic62516 ! Node: Invoking rmiregistry63891 ! Node: About CNI64302 ! Node: Basic concepts65585 ! Node: Packages68568 ! Node: Primitive types70880 ! Node: Interfaces72528 ! Node: Objects and Classes73437 ! Node: Class Initialization75598 ! Node: Object allocation77832 ! Node: Arrays78807 ! Node: Methods81394 ! Node: Strings84145 ! Node: Mixing with C++85613 ! Node: Exception Handling87496 ! Node: Synchronization89131 ! Node: Invocation91111 ! Node: Reflection95180 ! Node: Resources95632  End Tag Table --- 59,2815 ---- You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise ! funds for GNU development. !  ! File: gcj.info, Node: Top, Next: Copying, Up: (dir) ! ! Introduction ! ************ ! ! This manual describes how to use `gcj', the GNU compiler for the ! Java programming language. `gcj' can generate both `.class' files and ! object files, and it can read both Java source code and `.class' files. ! ! * Menu: ! ! * Copying:: The GNU General Public License ! * GNU Free Documentation License:: ! How you can share and copy this manual ! * Invoking gcj:: Compiler options supported by `gcj' ! * Compatibility:: Compatibility between gcj and other tools for Java ! * Invoking gcjh:: Generate header files from class files ! * Invoking jv-scan:: Print information about source files ! * Invoking jcf-dump:: Print information about class files ! * Invoking gij:: Interpreting Java bytecodes ! * Invoking jv-convert:: Converting from one encoding to another ! * Invoking rmic:: Generate stubs for Remote Method Invocation. ! * Invoking rmiregistry:: The remote object registry. ! * About CNI:: Description of the Cygnus Native Interface ! * System properties:: Modifying runtime behavior of the libgcj library ! * Resources:: Where to look for more information  ! File: gcj.info, Node: Copying, Next: GNU Free Documentation License, Prev: Top, Up: Top ! ! GNU GENERAL PUBLIC LICENSE ! ************************** ! ! Version 2, June 1991 ! Copyright (C) 1989, 1991 Free Software Foundation, Inc. ! 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ! ! Everyone is permitted to copy and distribute verbatim copies ! of this license document, but changing it is not allowed. ! ! Preamble ! ======== ! ! The licenses for most software are designed to take away your ! freedom to share and change it. By contrast, the GNU General Public ! License is intended to guarantee your freedom to share and change free ! software--to make sure the software is free for all its users. This ! General Public License applies to most of the Free Software ! Foundation's software and to any other program whose authors commit to ! using it. (Some other Free Software Foundation software is covered by ! the GNU Library General Public License instead.) You can apply it to ! your programs, too. ! ! When we speak of free software, we are referring to freedom, not ! price. Our General Public Licenses are designed to make sure that you ! have the freedom to distribute copies of free software (and charge for ! this service if you wish), that you receive source code or can get it ! if you want it, that you can change the software or use pieces of it in ! new free programs; and that you know you can do these things. ! ! To protect your rights, we need to make restrictions that forbid ! anyone to deny you these rights or to ask you to surrender the rights. ! These restrictions translate to certain responsibilities for you if you ! distribute copies of the software, or if you modify it. ! ! For example, if you distribute copies of such a program, whether ! gratis or for a fee, you must give the recipients all the rights that ! you have. You must make sure that they, too, receive or can get the ! source code. And you must show them these terms so they know their ! rights. ! ! We protect your rights with two steps: (1) copyright the software, ! and (2) offer you this license which gives you legal permission to copy, ! distribute and/or modify the software. ! ! Also, for each author's protection and ours, we want to make certain ! that everyone understands that there is no warranty for this free ! software. If the software is modified by someone else and passed on, we ! want its recipients to know that what they have is not the original, so ! that any problems introduced by others will not reflect on the original ! authors' reputations. ! ! Finally, any free program is threatened constantly by software ! patents. We wish to avoid the danger that redistributors of a free ! program will individually obtain patent licenses, in effect making the ! program proprietary. To prevent this, we have made it clear that any ! patent must be licensed for everyone's free use or not licensed at all. ! ! The precise terms and conditions for copying, distribution and ! modification follow. ! ! TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ! 0. This License applies to any program or other work which contains a ! notice placed by the copyright holder saying it may be distributed ! under the terms of this General Public License. The "Program", ! below, refers to any such program or work, and a "work based on ! the Program" means either the Program or any derivative work under ! copyright law: that is to say, a work containing the Program or a ! portion of it, either verbatim or with modifications and/or ! translated into another language. (Hereinafter, translation is ! included without limitation in the term "modification".) Each ! licensee is addressed as "you". ! ! Activities other than copying, distribution and modification are ! not covered by this License; they are outside its scope. The act ! of running the Program is not restricted, and the output from the ! Program is covered only if its contents constitute a work based on ! the Program (independent of having been made by running the ! Program). Whether that is true depends on what the Program does. ! ! 1. You may copy and distribute verbatim copies of the Program's ! source code as you receive it, in any medium, provided that you ! conspicuously and appropriately publish on each copy an appropriate ! copyright notice and disclaimer of warranty; keep intact all the ! notices that refer to this License and to the absence of any ! warranty; and give any other recipients of the Program a copy of ! this License along with the Program. ! ! You may charge a fee for the physical act of transferring a copy, ! and you may at your option offer warranty protection in exchange ! for a fee. ! ! 2. You may modify your copy or copies of the Program or any portion ! of it, thus forming a work based on the Program, and copy and ! distribute such modifications or work under the terms of Section 1 ! above, provided that you also meet all of these conditions: ! ! a. You must cause the modified files to carry prominent notices ! stating that you changed the files and the date of any change. ! ! b. You must cause any work that you distribute or publish, that ! in whole or in part contains or is derived from the Program ! or any part thereof, to be licensed as a whole at no charge ! to all third parties under the terms of this License. ! ! c. If the modified program normally reads commands interactively ! when run, you must cause it, when started running for such ! interactive use in the most ordinary way, to print or display ! an announcement including an appropriate copyright notice and ! a notice that there is no warranty (or else, saying that you ! provide a warranty) and that users may redistribute the ! program under these conditions, and telling the user how to ! view a copy of this License. (Exception: if the Program ! itself is interactive but does not normally print such an ! announcement, your work based on the Program is not required ! to print an announcement.) ! ! These requirements apply to the modified work as a whole. If ! identifiable sections of that work are not derived from the ! Program, and can be reasonably considered independent and separate ! works in themselves, then this License, and its terms, do not ! apply to those sections when you distribute them as separate ! works. But when you distribute the same sections as part of a ! whole which is a work based on the Program, the distribution of ! the whole must be on the terms of this License, whose permissions ! for other licensees extend to the entire whole, and thus to each ! and every part regardless of who wrote it. ! ! Thus, it is not the intent of this section to claim rights or ! contest your rights to work written entirely by you; rather, the ! intent is to exercise the right to control the distribution of ! derivative or collective works based on the Program. ! ! In addition, mere aggregation of another work not based on the ! Program with the Program (or with a work based on the Program) on ! a volume of a storage or distribution medium does not bring the ! other work under the scope of this License. ! ! 3. You may copy and distribute the Program (or a work based on it, ! under Section 2) in object code or executable form under the terms ! of Sections 1 and 2 above provided that you also do one of the ! following: ! ! a. Accompany it with the complete corresponding machine-readable ! source code, which must be distributed under the terms of ! Sections 1 and 2 above on a medium customarily used for ! software interchange; or, ! ! b. Accompany it with a written offer, valid for at least three ! years, to give any third party, for a charge no more than your ! cost of physically performing source distribution, a complete ! machine-readable copy of the corresponding source code, to be ! distributed under the terms of Sections 1 and 2 above on a ! medium customarily used for software interchange; or, ! ! c. Accompany it with the information you received as to the offer ! to distribute corresponding source code. (This alternative is ! allowed only for noncommercial distribution and only if you ! received the program in object code or executable form with ! such an offer, in accord with Subsection b above.) ! ! The source code for a work means the preferred form of the work for ! making modifications to it. For an executable work, complete ! source code means all the source code for all modules it contains, ! plus any associated interface definition files, plus the scripts ! used to control compilation and installation of the executable. ! However, as a special exception, the source code distributed need ! not include anything that is normally distributed (in either ! source or binary form) with the major components (compiler, ! kernel, and so on) of the operating system on which the executable ! runs, unless that component itself accompanies the executable. ! ! If distribution of executable or object code is made by offering ! access to copy from a designated place, then offering equivalent ! access to copy the source code from the same place counts as ! distribution of the source code, even though third parties are not ! compelled to copy the source along with the object code. ! ! 4. You may not copy, modify, sublicense, or distribute the Program ! except as expressly provided under this License. Any attempt ! otherwise to copy, modify, sublicense or distribute the Program is ! void, and will automatically terminate your rights under this ! License. However, parties who have received copies, or rights, ! from you under this License will not have their licenses ! terminated so long as such parties remain in full compliance. ! ! 5. You are not required to accept this License, since you have not ! signed it. However, nothing else grants you permission to modify ! or distribute the Program or its derivative works. These actions ! are prohibited by law if you do not accept this License. ! Therefore, by modifying or distributing the Program (or any work ! based on the Program), you indicate your acceptance of this ! License to do so, and all its terms and conditions for copying, ! distributing or modifying the Program or works based on it. ! ! 6. Each time you redistribute the Program (or any work based on the ! Program), the recipient automatically receives a license from the ! original licensor to copy, distribute or modify the Program ! subject to these terms and conditions. You may not impose any ! further restrictions on the recipients' exercise of the rights ! granted herein. You are not responsible for enforcing compliance ! by third parties to this License. ! ! 7. If, as a consequence of a court judgment or allegation of patent ! infringement or for any other reason (not limited to patent ! issues), conditions are imposed on you (whether by court order, ! agreement or otherwise) that contradict the conditions of this ! License, they do not excuse you from the conditions of this ! License. If you cannot distribute so as to satisfy simultaneously ! your obligations under this License and any other pertinent ! obligations, then as a consequence you may not distribute the ! Program at all. For example, if a patent license would not permit ! royalty-free redistribution of the Program by all those who ! receive copies directly or indirectly through you, then the only ! way you could satisfy both it and this License would be to refrain ! entirely from distribution of the Program. ! ! If any portion of this section is held invalid or unenforceable ! under any particular circumstance, the balance of the section is ! intended to apply and the section as a whole is intended to apply ! in other circumstances. ! ! It is not the purpose of this section to induce you to infringe any ! patents or other property right claims or to contest validity of ! any such claims; this section has the sole purpose of protecting ! the integrity of the free software distribution system, which is ! implemented by public license practices. Many people have made ! generous contributions to the wide range of software distributed ! through that system in reliance on consistent application of that ! system; it is up to the author/donor to decide if he or she is ! willing to distribute software through any other system and a ! licensee cannot impose that choice. ! ! This section is intended to make thoroughly clear what is believed ! to be a consequence of the rest of this License. ! ! 8. If the distribution and/or use of the Program is restricted in ! certain countries either by patents or by copyrighted interfaces, ! the original copyright holder who places the Program under this ! License may add an explicit geographical distribution limitation ! excluding those countries, so that distribution is permitted only ! in or among countries not thus excluded. In such case, this ! License incorporates the limitation as if written in the body of ! this License. ! ! 9. The Free Software Foundation may publish revised and/or new ! versions of the General Public License from time to time. Such ! new versions will be similar in spirit to the present version, but ! may differ in detail to address new problems or concerns. ! ! Each version is given a distinguishing version number. If the ! Program specifies a version number of this License which applies ! to it and "any later version", you have the option of following ! the terms and conditions either of that version or of any later ! version published by the Free Software Foundation. If the Program ! does not specify a version number of this License, you may choose ! any version ever published by the Free Software Foundation. ! ! 10. If you wish to incorporate parts of the Program into other free ! programs whose distribution conditions are different, write to the ! author to ask for permission. For software which is copyrighted ! by the Free Software Foundation, write to the Free Software ! Foundation; we sometimes make exceptions for this. Our decision ! will be guided by the two goals of preserving the free status of ! all derivatives of our free software and of promoting the sharing ! and reuse of software generally. ! ! NO WARRANTY ! ! 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO ! WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE ! LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT ! HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT ! WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT ! NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ! FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE ! QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ! PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY ! SERVICING, REPAIR OR CORRECTION. ! ! 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN ! WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY ! MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE ! LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, ! INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR ! INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF ! DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU ! OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY ! OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ! ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ! ! END OF TERMS AND CONDITIONS ! ! How to Apply These Terms to Your New Programs ! ============================================= ! ! If you develop a new program, and you want it to be of the greatest ! possible use to the public, the best way to achieve this is to make it ! free software which everyone can redistribute and change under these ! terms. ! ! To do so, attach the following notices to the program. It is safest ! to attach them to the start of each source file to most effectively ! convey the exclusion of warranty; and each file should have at least ! the "copyright" line and a pointer to where the full notice is found. ! ! ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. ! Copyright (C) YEAR NAME OF AUTHOR ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software Foundation, ! Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! ! Also add information on how to contact you by electronic and paper ! mail. ! ! If the program is interactive, make it output a short notice like ! this when it starts in an interactive mode: ! ! Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR ! Gnomovision comes with ABSOLUTELY NO WARRANTY; for details ! type `show w'. ! This is free software, and you are welcome to redistribute it ! under certain conditions; type `show c' for details. ! ! The hypothetical commands `show w' and `show c' should show the ! appropriate parts of the General Public License. Of course, the ! commands you use may be called something other than `show w' and `show ! c'; they could even be mouse-clicks or menu items--whatever suits your ! program. ! ! You should also get your employer (if you work as a programmer) or ! your school, if any, to sign a "copyright disclaimer" for the program, ! if necessary. Here is a sample; alter the names: ! ! Yoyodyne, Inc., hereby disclaims all copyright interest in the program ! `Gnomovision' (which makes passes at compilers) written by James Hacker. ! ! SIGNATURE OF TY COON, 1 April 1989 ! Ty Coon, President of Vice ! ! This General Public License does not permit incorporating your ! program into proprietary programs. If your program is a subroutine ! library, you may consider it more useful to permit linking proprietary ! applications with the library. If this is what you want to do, use the ! GNU Library General Public License instead of this License. ! !  ! File: gcj.info, Node: GNU Free Documentation License, Next: Invoking gcj, Prev: Copying, Up: Top ! ! GNU Free Documentation License ! ****************************** ! ! Version 1.2, November 2002 ! Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. ! 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA ! ! Everyone is permitted to copy and distribute verbatim copies ! of this license document, but changing it is not allowed. ! ! 0. PREAMBLE ! ! The purpose of this License is to make a manual, textbook, or other ! functional and useful document "free" in the sense of freedom: to ! assure everyone the effective freedom to copy and redistribute it, ! with or without modifying it, either commercially or ! noncommercially. Secondarily, this License preserves for the ! author and publisher a way to get credit for their work, while not ! being considered responsible for modifications made by others. ! ! This License is a kind of "copyleft", which means that derivative ! works of the document must themselves be free in the same sense. ! It complements the GNU General Public License, which is a copyleft ! license designed for free software. ! ! We have designed this License in order to use it for manuals for ! free software, because free software needs free documentation: a ! free program should come with manuals providing the same freedoms ! that the software does. But this License is not limited to ! software manuals; it can be used for any textual work, regardless ! of subject matter or whether it is published as a printed book. ! We recommend this License principally for works whose purpose is ! instruction or reference. ! ! 1. APPLICABILITY AND DEFINITIONS ! ! This License applies to any manual or other work, in any medium, ! that contains a notice placed by the copyright holder saying it ! can be distributed under the terms of this License. Such a notice ! grants a world-wide, royalty-free license, unlimited in duration, ! to use that work under the conditions stated herein. The ! "Document", below, refers to any such manual or work. Any member ! of the public is a licensee, and is addressed as "you". You ! accept the license if you copy, modify or distribute the work in a ! way requiring permission under copyright law. ! ! A "Modified Version" of the Document means any work containing the ! Document or a portion of it, either copied verbatim, or with ! modifications and/or translated into another language. ! ! A "Secondary Section" is a named appendix or a front-matter section ! of the Document that deals exclusively with the relationship of the ! publishers or authors of the Document to the Document's overall ! subject (or to related matters) and contains nothing that could ! fall directly within that overall subject. (Thus, if the Document ! is in part a textbook of mathematics, a Secondary Section may not ! explain any mathematics.) The relationship could be a matter of ! historical connection with the subject or with related matters, or ! of legal, commercial, philosophical, ethical or political position ! regarding them. ! ! The "Invariant Sections" are certain Secondary Sections whose ! titles are designated, as being those of Invariant Sections, in ! the notice that says that the Document is released under this ! License. If a section does not fit the above definition of ! Secondary then it is not allowed to be designated as Invariant. ! The Document may contain zero Invariant Sections. If the Document ! does not identify any Invariant Sections then there are none. ! ! The "Cover Texts" are certain short passages of text that are ! listed, as Front-Cover Texts or Back-Cover Texts, in the notice ! that says that the Document is released under this License. A ! Front-Cover Text may be at most 5 words, and a Back-Cover Text may ! be at most 25 words. ! ! A "Transparent" copy of the Document means a machine-readable copy, ! represented in a format whose specification is available to the ! general public, that is suitable for revising the document ! straightforwardly with generic text editors or (for images ! composed of pixels) generic paint programs or (for drawings) some ! widely available drawing editor, and that is suitable for input to ! text formatters or for automatic translation to a variety of ! formats suitable for input to text formatters. A copy made in an ! otherwise Transparent file format whose markup, or absence of ! markup, has been arranged to thwart or discourage subsequent ! modification by readers is not Transparent. An image format is ! not Transparent if used for any substantial amount of text. A ! copy that is not "Transparent" is called "Opaque". ! ! Examples of suitable formats for Transparent copies include plain ! ASCII without markup, Texinfo input format, LaTeX input format, ! SGML or XML using a publicly available DTD, and ! standard-conforming simple HTML, PostScript or PDF designed for ! human modification. Examples of transparent image formats include ! PNG, XCF and JPG. Opaque formats include proprietary formats that ! can be read and edited only by proprietary word processors, SGML or ! XML for which the DTD and/or processing tools are not generally ! available, and the machine-generated HTML, PostScript or PDF ! produced by some word processors for output purposes only. ! ! The "Title Page" means, for a printed book, the title page itself, ! plus such following pages as are needed to hold, legibly, the ! material this License requires to appear in the title page. For ! works in formats which do not have any title page as such, "Title ! Page" means the text near the most prominent appearance of the ! work's title, preceding the beginning of the body of the text. ! ! A section "Entitled XYZ" means a named subunit of the Document ! whose title either is precisely XYZ or contains XYZ in parentheses ! following text that translates XYZ in another language. (Here XYZ ! stands for a specific section name mentioned below, such as ! "Acknowledgements", "Dedications", "Endorsements", or "History".) ! To "Preserve the Title" of such a section when you modify the ! Document means that it remains a section "Entitled XYZ" according ! to this definition. ! ! The Document may include Warranty Disclaimers next to the notice ! which states that this License applies to the Document. These ! Warranty Disclaimers are considered to be included by reference in ! this License, but only as regards disclaiming warranties: any other ! implication that these Warranty Disclaimers may have is void and ! has no effect on the meaning of this License. ! ! 2. VERBATIM COPYING ! ! You may copy and distribute the Document in any medium, either ! commercially or noncommercially, provided that this License, the ! copyright notices, and the license notice saying this License ! applies to the Document are reproduced in all copies, and that you ! add no other conditions whatsoever to those of this License. You ! may not use technical measures to obstruct or control the reading ! or further copying of the copies you make or distribute. However, ! you may accept compensation in exchange for copies. If you ! distribute a large enough number of copies you must also follow ! the conditions in section 3. ! ! You may also lend copies, under the same conditions stated above, ! and you may publicly display copies. ! ! 3. COPYING IN QUANTITY ! ! If you publish printed copies (or copies in media that commonly ! have printed covers) of the Document, numbering more than 100, and ! the Document's license notice requires Cover Texts, you must ! enclose the copies in covers that carry, clearly and legibly, all ! these Cover Texts: Front-Cover Texts on the front cover, and ! Back-Cover Texts on the back cover. Both covers must also clearly ! and legibly identify you as the publisher of these copies. The ! front cover must present the full title with all words of the ! title equally prominent and visible. You may add other material ! on the covers in addition. Copying with changes limited to the ! covers, as long as they preserve the title of the Document and ! satisfy these conditions, can be treated as verbatim copying in ! other respects. ! ! If the required texts for either cover are too voluminous to fit ! legibly, you should put the first ones listed (as many as fit ! reasonably) on the actual cover, and continue the rest onto ! adjacent pages. ! ! If you publish or distribute Opaque copies of the Document ! numbering more than 100, you must either include a ! machine-readable Transparent copy along with each Opaque copy, or ! state in or with each Opaque copy a computer-network location from ! which the general network-using public has access to download ! using public-standard network protocols a complete Transparent ! copy of the Document, free of added material. If you use the ! latter option, you must take reasonably prudent steps, when you ! begin distribution of Opaque copies in quantity, to ensure that ! this Transparent copy will remain thus accessible at the stated ! location until at least one year after the last time you ! distribute an Opaque copy (directly or through your agents or ! retailers) of that edition to the public. ! ! It is requested, but not required, that you contact the authors of ! the Document well before redistributing any large number of ! copies, to give them a chance to provide you with an updated ! version of the Document. ! ! 4. MODIFICATIONS ! ! You may copy and distribute a Modified Version of the Document ! under the conditions of sections 2 and 3 above, provided that you ! release the Modified Version under precisely this License, with ! the Modified Version filling the role of the Document, thus ! licensing distribution and modification of the Modified Version to ! whoever possesses a copy of it. In addition, you must do these ! things in the Modified Version: ! ! A. Use in the Title Page (and on the covers, if any) a title ! distinct from that of the Document, and from those of ! previous versions (which should, if there were any, be listed ! in the History section of the Document). You may use the ! same title as a previous version if the original publisher of ! that version gives permission. ! ! B. List on the Title Page, as authors, one or more persons or ! entities responsible for authorship of the modifications in ! the Modified Version, together with at least five of the ! principal authors of the Document (all of its principal ! authors, if it has fewer than five), unless they release you ! from this requirement. ! ! C. State on the Title page the name of the publisher of the ! Modified Version, as the publisher. ! ! D. Preserve all the copyright notices of the Document. ! ! E. Add an appropriate copyright notice for your modifications ! adjacent to the other copyright notices. ! ! F. Include, immediately after the copyright notices, a license ! notice giving the public permission to use the Modified ! Version under the terms of this License, in the form shown in ! the Addendum below. ! ! G. Preserve in that license notice the full lists of Invariant ! Sections and required Cover Texts given in the Document's ! license notice. ! ! H. Include an unaltered copy of this License. ! ! I. Preserve the section Entitled "History", Preserve its Title, ! and add to it an item stating at least the title, year, new ! authors, and publisher of the Modified Version as given on ! the Title Page. If there is no section Entitled "History" in ! the Document, create one stating the title, year, authors, ! and publisher of the Document as given on its Title Page, ! then add an item describing the Modified Version as stated in ! the previous sentence. ! ! J. Preserve the network location, if any, given in the Document ! for public access to a Transparent copy of the Document, and ! likewise the network locations given in the Document for ! previous versions it was based on. These may be placed in ! the "History" section. You may omit a network location for a ! work that was published at least four years before the ! Document itself, or if the original publisher of the version ! it refers to gives permission. ! ! K. For any section Entitled "Acknowledgements" or "Dedications", ! Preserve the Title of the section, and preserve in the ! section all the substance and tone of each of the contributor ! acknowledgements and/or dedications given therein. ! ! L. Preserve all the Invariant Sections of the Document, ! unaltered in their text and in their titles. Section numbers ! or the equivalent are not considered part of the section ! titles. ! ! M. Delete any section Entitled "Endorsements". Such a section ! may not be included in the Modified Version. ! ! N. Do not retitle any existing section to be Entitled ! "Endorsements" or to conflict in title with any Invariant ! Section. ! ! O. Preserve any Warranty Disclaimers. ! ! If the Modified Version includes new front-matter sections or ! appendices that qualify as Secondary Sections and contain no ! material copied from the Document, you may at your option ! designate some or all of these sections as invariant. To do this, ! add their titles to the list of Invariant Sections in the Modified ! Version's license notice. These titles must be distinct from any ! other section titles. ! ! You may add a section Entitled "Endorsements", provided it contains ! nothing but endorsements of your Modified Version by various ! parties--for example, statements of peer review or that the text ! has been approved by an organization as the authoritative ! definition of a standard. ! ! You may add a passage of up to five words as a Front-Cover Text, ! and a passage of up to 25 words as a Back-Cover Text, to the end ! of the list of Cover Texts in the Modified Version. Only one ! passage of Front-Cover Text and one of Back-Cover Text may be ! added by (or through arrangements made by) any one entity. If the ! Document already includes a cover text for the same cover, ! previously added by you or by arrangement made by the same entity ! you are acting on behalf of, you may not add another; but you may ! replace the old one, on explicit permission from the previous ! publisher that added the old one. ! ! The author(s) and publisher(s) of the Document do not by this ! License give permission to use their names for publicity for or to ! assert or imply endorsement of any Modified Version. ! ! 5. COMBINING DOCUMENTS ! ! You may combine the Document with other documents released under ! this License, under the terms defined in section 4 above for ! modified versions, provided that you include in the combination ! all of the Invariant Sections of all of the original documents, ! unmodified, and list them all as Invariant Sections of your ! combined work in its license notice, and that you preserve all ! their Warranty Disclaimers. ! ! The combined work need only contain one copy of this License, and ! multiple identical Invariant Sections may be replaced with a single ! copy. If there are multiple Invariant Sections with the same name ! but different contents, make the title of each such section unique ! by adding at the end of it, in parentheses, the name of the ! original author or publisher of that section if known, or else a ! unique number. Make the same adjustment to the section titles in ! the list of Invariant Sections in the license notice of the ! combined work. ! ! In the combination, you must combine any sections Entitled ! "History" in the various original documents, forming one section ! Entitled "History"; likewise combine any sections Entitled ! "Acknowledgements", and any sections Entitled "Dedications". You ! must delete all sections Entitled "Endorsements." ! ! 6. COLLECTIONS OF DOCUMENTS ! ! You may make a collection consisting of the Document and other ! documents released under this License, and replace the individual ! copies of this License in the various documents with a single copy ! that is included in the collection, provided that you follow the ! rules of this License for verbatim copying of each of the ! documents in all other respects. ! ! You may extract a single document from such a collection, and ! distribute it individually under this License, provided you insert ! a copy of this License into the extracted document, and follow ! this License in all other respects regarding verbatim copying of ! that document. ! ! 7. AGGREGATION WITH INDEPENDENT WORKS ! ! A compilation of the Document or its derivatives with other ! separate and independent documents or works, in or on a volume of ! a storage or distribution medium, is called an "aggregate" if the ! copyright resulting from the compilation is not used to limit the ! legal rights of the compilation's users beyond what the individual ! works permit. When the Document is included an aggregate, this ! License does not apply to the other works in the aggregate which ! are not themselves derivative works of the Document. ! ! If the Cover Text requirement of section 3 is applicable to these ! copies of the Document, then if the Document is less than one half ! of the entire aggregate, the Document's Cover Texts may be placed ! on covers that bracket the Document within the aggregate, or the ! electronic equivalent of covers if the Document is in electronic ! form. Otherwise they must appear on printed covers that bracket ! the whole aggregate. ! ! 8. TRANSLATION ! ! Translation is considered a kind of modification, so you may ! distribute translations of the Document under the terms of section ! 4. Replacing Invariant Sections with translations requires special ! permission from their copyright holders, but you may include ! translations of some or all Invariant Sections in addition to the ! original versions of these Invariant Sections. You may include a ! translation of this License, and all the license notices in the ! Document, and any Warrany Disclaimers, provided that you also ! include the original English version of this License and the ! original versions of those notices and disclaimers. In case of a ! disagreement between the translation and the original version of ! this License or a notice or disclaimer, the original version will ! prevail. ! ! If a section in the Document is Entitled "Acknowledgements", ! "Dedications", or "History", the requirement (section 4) to ! Preserve its Title (section 1) will typically require changing the ! actual title. ! ! 9. TERMINATION ! ! You may not copy, modify, sublicense, or distribute the Document ! except as expressly provided for under this License. Any other ! attempt to copy, modify, sublicense or distribute the Document is ! void, and will automatically terminate your rights under this ! License. However, parties who have received copies, or rights, ! from you under this License will not have their licenses ! terminated so long as such parties remain in full compliance. ! ! 10. FUTURE REVISIONS OF THIS LICENSE ! ! The Free Software Foundation may publish new, revised versions of ! the GNU Free Documentation License from time to time. Such new ! versions will be similar in spirit to the present version, but may ! differ in detail to address new problems or concerns. See ! `http://www.gnu.org/copyleft/'. ! ! Each version of the License is given a distinguishing version ! number. If the Document specifies that a particular numbered ! version of this License "or any later version" applies to it, you ! have the option of following the terms and conditions either of ! that specified version or of any later version that has been ! published (not as a draft) by the Free Software Foundation. If ! the Document does not specify a version number of this License, ! you may choose any version ever published (not as a draft) by the ! Free Software Foundation. ! ! ADDENDUM: How to use this License for your documents ! ==================================================== ! ! To use this License in a document you have written, include a copy of ! the License in the document and put the following copyright and license ! notices just after the title page: ! ! Copyright (C) YEAR YOUR NAME. ! Permission is granted to copy, distribute and/or modify this document ! under the terms of the GNU Free Documentation License, Version 1.2 ! or any later version published by the Free Software Foundation; ! with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. ! A copy of the license is included in the section entitled ``GNU ! Free Documentation License''. ! ! If you have Invariant Sections, Front-Cover Texts and Back-Cover ! Texts, replace the "with...Texts." line with this: ! ! with the Invariant Sections being LIST THEIR TITLES, with ! the Front-Cover Texts being LIST, and with the Back-Cover Texts ! being LIST. ! ! If you have Invariant Sections without Cover Texts, or some other ! combination of the three, merge those two alternatives to suit the ! situation. ! ! If your document contains nontrivial examples of program code, we ! recommend releasing these examples in parallel under your choice of ! free software license, such as the GNU General Public License, to ! permit their use in free software. ! !  ! File: gcj.info, Node: Invoking gcj, Next: Compatibility, Prev: GNU Free Documentation License, Up: Top ! ! Invoking gcj ! ************ ! ! As `gcj' is just another front end to `gcc', it supports many of the ! same options as gcc. *Note Option Summary: (gcc)Option Summary. This ! manual only documents the options specific to `gcj'. ! ! * Menu: ! ! * Input and output files:: ! * Input Options:: How gcj finds files ! * Encodings:: Options controlling source file encoding ! * Warnings:: Options controlling warnings specific to gcj ! * Code Generation:: Options controlling the output of gcj ! * Configure-time Options:: Options you won't use ! !  ! File: gcj.info, Node: Input and output files, Next: Input Options, Up: Invoking gcj ! ! Input and output files ! ====================== ! ! A `gcj' command is like a `gcc' command, in that it consists of a ! number of options and file names. The following kinds of input file ! names are supported: ! ! `FILE.java' ! Java source files. ! ! `FILE.class' ! Java bytecode files. ! ! `FILE.zip' ! `FILE.jar' ! An archive containing one or more `.class' files, all of which are ! compiled. The archive may be compressed. ! ! `@FILE' ! A file containing a whitespace-separated list of input file names. ! (Currently, these must all be `.java' source files, but that may ! change.) Each named file is compiled, just as if it had been on ! the command line. ! ! `LIBRARY.a' ! `LIBRARY.so' ! `-lLIBNAME' ! Libraries to use when linking. See the `gcc' manual. ! ! You can specify more than one input file on the `gcj' command line, ! in which case they will all be compiled. If you specify a `-o FILENAME' ! option, all the input files will be compiled together, producing a ! single output file, named FILENAME. This is allowed even when using ! `-S' or `-c', but not when using `-C' or `--resource'. (This is an ! extension beyond the what plain `gcc' allows.) (If more than one input ! file is specified, all must currently be `.java' files, though we hope ! to fix this.) ! !  ! File: gcj.info, Node: Input Options, Next: Encodings, Prev: Input and output files, Up: Invoking gcj ! ! Input Options ! ============= ! ! `gcj' has options to control where it looks to find files it needs. ! For instance, `gcj' might need to load a class that is referenced by ! the file it has been asked to compile. Like other compilers for the ! Java language, `gcj' has a notion of a "class path". There are several ! options and environment variables which can be used to manipulate the ! class path. When `gcj' looks for a given class, it searches the class ! path looking for matching `.class' or `.java' file. `gcj' comes with a ! built-in class path which points at the installed `libgcj.jar', a file ! which contains all the standard classes. ! ! In the below, a directory or path component can refer either to an ! actual directory on the filesystem, or to a `.zip' or `.jar' file, ! which `gcj' will search as if it is a directory. ! ! `-IDIR' ! All directories specified by `-I' are kept in order and prepended ! to the class path constructed from all the other options. Unless ! compatibility with tools like `javac' is important, we recommend ! always using `-I' instead of the other options for manipulating the ! class path. ! ! `--classpath=PATH' ! This sets the class path to PATH, a colon-separated list of paths ! (on Windows-based systems, a semicolon-separate list of paths). ! This does not override the builtin ("boot") search path. ! ! `--CLASSPATH=PATH' ! Deprecated synonym for `--classpath'. ! ! `--bootclasspath=PATH' ! Where to find the standard builtin classes, such as ! `java.lang.String'. ! ! `--extdirs=PATH' ! For each directory in the PATH, place the contents of that ! directory at the end of the class path. ! ! `CLASSPATH' ! This is an environment variable which holds a list of paths. ! ! The final class path is constructed like so: ! ! * First come all directories specified via `-I'. ! ! * If `--classpath' is specified, its value is appended. Otherwise, ! if the `CLASSPATH' environment variable is specified, then its ! value is appended. Otherwise, the current directory (`"."') is ! appended. ! ! * If `--bootclasspath' was specified, append its value. Otherwise, ! append the built-in system directory, `libgcj.jar'. ! ! * Finally, if `--extdirs' was specified, append the contents of the ! specified directories at the end of the class path. Otherwise, ! append the contents of the built-in extdirs at ! `$(prefix)/share/java/ext'. ! ! The classfile built by `gcj' for the class `java.lang.Object' (and ! placed in `libgcj.jar') contains a special zero length attribute ! `gnu.gcj.gcj-compiled'. The compiler looks for this attribute when ! loading `java.lang.Object' and will report an error if it isn't found, ! unless it compiles to bytecode (the option ! `-fforce-classes-archive-check' can be used to override this behavior ! in this particular case.) ! ! `-fforce-classes-archive-check' ! This forces the compiler to always check for the special zero ! length attribute `gnu.gcj.gcj-compiled' in `java.lang.Object' and ! issue an error if it isn't found. ! !  ! File: gcj.info, Node: Encodings, Next: Warnings, Prev: Input Options, Up: Invoking gcj ! ! Encodings ! ========= ! ! The Java programming language uses Unicode throughout. In an effort ! to integrate well with other locales, `gcj' allows `.java' files to be ! written using almost any encoding. `gcj' knows how to convert these ! encodings into its internal encoding at compile time. ! ! You can use the `--encoding=NAME' option to specify an encoding (of ! a particular character set) to use for source files. If this is not ! specified, the default encoding comes from your current locale. If ! your host system has insufficient locale support, then `gcj' assumes ! the default encoding to be the `UTF-8' encoding of Unicode. ! ! To implement `--encoding', `gcj' simply uses the host platform's ! `iconv' conversion routine. This means that in practice `gcj' is ! limited by the capabilities of the host platform. ! ! The names allowed for the argument `--encoding' vary from platform ! to platform (since they are not standardized anywhere). However, `gcj' ! implements the encoding named `UTF-8' internally, so if you choose to ! use this for your source files you can be assured that it will work on ! every host. ! !  ! File: gcj.info, Node: Warnings, Next: Code Generation, Prev: Encodings, Up: Invoking gcj ! ! Warnings ! ======== ! ! `gcj' implements several warnings. As with other generic `gcc' ! warnings, if an option of the form `-Wfoo' enables a warning, then ! `-Wno-foo' will disable it. Here we've chosen to document the form of ! the warning which will have an effect - the default being the opposite ! of what is listed. ! ! `-Wredundant-modifiers' ! With this flag, `gcj' will warn about redundant modifiers. For ! instance, it will warn if an interface method is declared `public'. ! ! `-Wextraneous-semicolon' ! This causes `gcj' to warn about empty statements. Empty statements ! have been deprecated. ! ! `-Wno-out-of-date' ! This option will cause `gcj' not to warn when a source file is ! newer than its matching class file. By default `gcj' will warn ! about this. ! ! `-Wunused' ! This is the same as `gcc''s `-Wunused'. ! ! `-Wall' ! This is the same as `-Wredundant-modifiers -Wextraneous-semicolon ! -Wunused'. ! !  ! File: gcj.info, Node: Code Generation, Next: Configure-time Options, Prev: Warnings, Up: Invoking gcj ! ! Code Generation ! =============== ! ! In addition to the many `gcc' options controlling code generation, ! `gcj' has several options specific to itself. ! ! `--main=CLASSNAME' ! This option is used when linking to specify the name of the class ! whose `main' method should be invoked when the resulting ! executable is run. (1) ! ! `-DNAME[=VALUE]' ! This option can only be used with `--main'. It defines a system ! property named NAME with value VALUE. If VALUE is not specified ! then it defaults to the empty string. These system properties are ! initialized at the program's startup and can be retrieved at ! runtime using the `java.lang.System.getProperty' method. ! ! `-C' ! This option is used to tell `gcj' to generate bytecode (`.class' ! files) rather than object code. ! ! `--resource RESOURCE-NAME' ! This option is used to tell `gcj' to compile the contents of a ! given file to object code so it may be accessed at runtime with ! the core protocol handler as `core:/RESOURCE-NAME'. Note that ! RESOURCE-NAME is the name of the resource as found at runtime; for ! instance, it could be used in a call to `ResourceBundle.getBundle'. ! The actual file name to be compiled this way must be specified ! separately. ! ! `-d DIRECTORY' ! When used with `-C', this causes all generated `.class' files to ! be put in the appropriate subdirectory of DIRECTORY. By default ! they will be put in subdirectories of the current working ! directory. ! ! `-fno-bounds-check' ! By default, `gcj' generates code which checks the bounds of all ! array indexing operations. With this option, these checks are ! omitted, which can improve performance for code that uses arrays ! extensively. Note that this can result in unpredictable behavior ! if the code in question actually does violate array bounds ! constraints. It is safe to use this option if you are sure that ! your code will never throw an `ArrayIndexOutOfBoundsException'. ! ! `-fno-store-check' ! Don't generate array store checks. When storing objects into ! arrays, a runtime check is normally generated in order to ensure ! that the object is assignment compatible with the component type ! of the array (which may not be known at compile-time). With this ! option, these checks are omitted. This can improve performance ! for code which stores objects into arrays frequently. It is safe ! to use this option if you are sure your code will never throw an ! `ArrayStoreException'. ! ! `-fjni' ! With `gcj' there are two options for writing native methods: CNI ! and JNI. By default `gcj' assumes you are using CNI. If you are ! compiling a class with native methods, and these methods are ! implemented using JNI, then you must use `-fjni'. This option ! causes `gcj' to generate stubs which will invoke the underlying JNI ! methods. ! ! `-fno-assert' ! Don't recognize the `assert' keyword. This is for compatibility ! with older versions of the language specification. ! ! `-fno-optimize-static-class-initialization' ! When the optimization level is greater or equal to `-O2', `gcj' ! will try to optimize the way calls into the runtime are made to ! initialize static classes upon their first use (this optimization ! isn't carried out if `-C' was specified.) When compiling to native ! code, `-fno-optimize-static-class-initialization' will turn this ! optimization off, regardless of the optimization level in use. ! ! ---------- Footnotes ---------- ! ! (1) The linker by default looks for a global function named `main'. ! Since Java does not have global functions, and a collection of Java ! classes may have more than one class with a `main' method, you need to ! let the linker know which of those `main' methods it should invoke when ! starting the application. ! !  ! File: gcj.info, Node: Configure-time Options, Prev: Code Generation, Up: Invoking gcj ! ! Configure-time Options ! ====================== ! ! Some `gcj' code generations options affect the resulting ABI, and so ! can only be meaningfully given when `libgcj', the runtime package, is ! configured. `libgcj' puts the appropriate options from this group into ! a `spec' file which is read by `gcj'. These options are listed here ! for completeness; if you are using `libgcj' then you won't want to ! touch these options. ! ! `-fuse-boehm-gc' ! This enables the use of the Boehm GC bitmap marking code. In ! particular this causes `gcj' to put an object marking descriptor ! into each vtable. ! ! `-fhash-synchronization' ! By default, synchronization data (the data used for `synchronize', ! `wait', and `notify') is pointed to by a word in each object. ! With this option `gcj' assumes that this information is stored in a ! hash table and not in the object itself. ! ! `-fuse-divide-subroutine' ! On some systems, a library routine is called to perform integer ! division. This is required to get exception handling correct when ! dividing by zero. ! ! `-fcheck-references' ! On some systems it's necessary to insert inline checks whenever ! accessing an object via a reference. On other systems you won't ! need this because null pointer accesses are caught automatically ! by the processor. ! !  ! File: gcj.info, Node: Compatibility, Next: Invoking gcjh, Prev: Invoking gcj, Up: Top ! ! Compatibility with the Java Platform ! ************************************ ! ! As we believe it is important that the Java platform not be ! fragmented, `gcj' and `libgcj' try to conform to the relevant Java ! specifications. However, limited manpower and incomplete and unclear ! documentation work against us. So, there are caveats to using `gcj'. ! ! * Menu: ! ! * Limitations:: ! * Extensions:: ! !  ! File: gcj.info, Node: Limitations, Next: Extensions, Up: Compatibility ! ! Standard features not yet supported ! =================================== ! ! This list of compatibility issues is by no means complete. ! ! * `gcj' implements the JDK 1.2 language. It supports inner classes ! and the new 1.4 `assert' keyword. It does not yet support the ! Java 2 `strictfp' keyword (it recognizes the keyword but ignores ! it). ! ! * `libgcj' is largely compatible with the JDK 1.2 libraries. ! However, `libgcj' is missing many packages, most notably ! `java.awt'. There are also individual missing classes and methods. ! We currently do not have a list showing differences between ! `libgcj' and the Java 2 platform. ! ! * Sometimes the `libgcj' implementation of a method or class differs ! from the JDK implementation. This is not always a bug. Still, if ! it affects you, it probably makes sense to report it so that we ! can discuss the appropriate response. ! ! * `gcj' does not currently allow for piecemeal replacement of ! components within `libgcj'. Unfortunately, programmers often want ! to use newer versions of certain packages, such as those provided ! by the Apache Software Foundation's Jakarta project. This has ! forced us to place the `org.w3c.dom' and `org.xml.sax' packages ! into their own libraries, separate from `libgcj'. If you intend to ! use these classes, you must link them explicitly with ! `-l-org-w3c-dom' and `-l-org-xml-sax'. Future versions of `gcj' ! may not have this restriction. ! !  ! File: gcj.info, Node: Extensions, Prev: Limitations, Up: Compatibility ! ! Extra features unique to gcj ! ============================ ! ! The main feature of `gcj' is that it can compile programs written in ! the Java programming language to native code. Most extensions that ! have been added are to facilitate this functionality. ! ! * `gcj' makes it easy and efficient to mix code written in Java and ! C++. *Note About CNI::, for more info on how to use this in your ! programs. ! ! * When you compile your classes into a shared library they can be ! automatically loaded by the `libgcj' system classloader. When ! trying to load a class `gnu.pkg.SomeClass' the system classloader ! will first try to load the shared library ! `lib-gnu-pkg-SomeClass.so', if that fails to load the class then ! it will try to load `lib-gnu-pkg.so' and finally when the class is ! still not loaded it will try to load `lib-gnu.so'. Note that all ! `.'s will be transformed into `-'s and that searching for inner ! classes starts with their outermost outer class. If the class ! cannot be found this way the system classloader tries to use the ! `libgcj' bytecode interpreter to load the class from the standard ! classpath. ! !  ! File: gcj.info, Node: Invoking gcjh, Next: Invoking jv-scan, Prev: Compatibility, Up: Top ! ! Invoking gcjh ! ************* ! ! The `gcjh' program is used to generate header files from class ! files. It can generate both CNI and JNI header files, as well as stub ! implementation files which can be used as a basis for implementing the ! required native methods. ! ! `-stubs' ! This causes `gcjh' to generate stub files instead of header files. ! By default the stub file will be named after the class, with a ! suffix of `.cc'. In JNI mode, the default output file will have ! the suffix `.c'. ! ! `-jni' ! This tells `gcjh' to generate a JNI header or stub. By default, ! CNI headers are generated. ! ! `-add TEXT' ! Inserts TEXT into the class body. This is ignored in JNI mode. ! ! `-append TEXT' ! Inserts TEXT into the header file after the class declaration. ! This is ignored in JNI mode. ! ! `-friend TEXT' ! Inserts TEXT into the class as a `friend' declaration. This is ! ignored in JNI mode. ! ! `-prepend TEXT' ! Inserts TEXT into the header file before the class declaration. ! This is ignored in JNI mode. ! ! `--classpath=PATH' ! `--CLASSPATH=PATH' ! `-IDIRECTORY' ! `-d DIRECTORY' ! `-o FILE' ! These options are all identical to the corresponding `gcj' options. ! ! `-o FILE' ! Sets the output file name. This cannot be used if there is more ! than one class on the command line. ! ! `-td DIRECTORY' ! Sets the name of the directory to use for temporary files. ! ! `-M' ! Print all dependencies to stdout; suppress ordinary output. ! ! `-MM' ! Print non-system dependencies to stdout; suppress ordinary output. ! ! `-MD' ! Print all dependencies to stdout. ! ! `-MMD' ! Print non-system dependencies to stdout. ! ! `--help' ! Print help about `gcjh' and exit. No further processing is done. ! ! `--version' ! Print version information for `gcjh' and exit. No further ! processing is done. ! ! `-v, --verbose' ! Print extra information while running. ! ! All remaining options are considered to be names of classes. ! !  ! File: gcj.info, Node: Invoking jv-scan, Next: Invoking jcf-dump, Prev: Invoking gcjh, Up: Top ! ! Invoking jv-scan ! **************** ! ! The `jv-scan' program can be used to print information about a Java ! source file (`.java' file). ! ! `--no-assert' ! Don't recognize the `assert' keyword, for backwards compatibility ! with older versions of the language specification. ! ! `--complexity' ! This prints a complexity measure, related to cyclomatic ! complexity, for each input file. ! ! `--encoding=NAME' ! This works like the corresponding `gcj' option. ! ! `--print-main' ! This prints the name of the class in this file containing a `main' ! method. ! ! `--list-class' ! This lists the names of all classes defined in the input files. ! ! `--list-filename' ! If `--list-class' is given, this option causes `jv-scan' to also ! print the name of the file in which each class was found. ! ! `-o FILE' ! Print output to the named file. ! ! `--help' ! Print help, then exit. ! ! `--version' ! Print version number, then exit. ! !  ! File: gcj.info, Node: Invoking jcf-dump, Next: Invoking gij, Prev: Invoking jv-scan, Up: Top ! ! Invoking jcf-dump ! ***************** ! ! This is a class file examiner, similar to `javap'. It will print ! information about a number of classes, which are specified by class name ! or file name. ! ! `-c' ! Disassemble method bodies. By default method bodies are not ! printed. ! ! `--javap' ! Generate output in `javap' format. The implementation of this ! feature is very incomplete. ! ! `--classpath=PATH' ! `--CLASSPATH=PATH' ! `-IDIRECTORY' ! `-o FILE' ! These options as the same as the corresponding `gcj' options. ! ! `--help' ! Print help, then exit. ! ! `--version' ! Print version number, then exit. ! ! `-v, --verbose' ! Print extra information while running. ! !  ! File: gcj.info, Node: Invoking gij, Next: Invoking jv-convert, Prev: Invoking jcf-dump, Up: Top ! ! Invoking gij ! ************ ! ! `gij' is a Java bytecode interpreter included with `libgcj'. `gij' ! is not available on every platform; porting it requires a small amount ! of assembly programming which has not been done for all the targets ! supported by `gcj'. ! ! The primary argument to `gij' is the name of a class or, with ! `-jar', a jar file. Options before this argument are interpreted by ! `gij'; remaining options are passed to the interpreted program. ! ! If a class name is specified and this class does not have a `main' ! method with the appropriate signature (a `static void' method with a ! `String[]' as its sole argument), then `gij' will print an error and ! exit. ! ! If a jar file is specified then `gij' will use information in it to ! determine which class' `main' method will be invoked. ! ! `gij' will invoke the `main' method with all the remaining ! command-line options. ! ! Note that `gij' is not limited to interpreting code. Because ! `libgcj' includes a class loader which can dynamically load shared ! objects, it is possible to give `gij' the name of a class which has ! been compiled and put into a shared library on the class path. ! ! `-cp PATH' ! `-classpath PATH' ! Set the initial class path. The class path is used for finding ! class and resource files. If specified, this option overrides the ! `CLASSPATH' environment variable. Note that this option is ! ignored if `-jar' is used. ! ! `-DNAME[=VALUE]' ! This defines a system property named NAME with value VALUE. If ! VALUE is not specified then it defaults to the empty string. ! These system properties are initialized at the program's startup ! and can be retrieved at runtime using the ! `java.lang.System.getProperty' method. ! ! `-ms=NUMBER' ! This sets the initial heap size. ! ! `-mx=NUMBER' ! This sets the maximum heap size. ! ! `-jar' ! This indicates that the name passed to `gij' should be interpreted ! as the name of a jar file, not a class. ! ! `--help' ! Print help, then exit. ! ! `--showversion' ! Print version number and continue. ! ! `--version' ! Print version number, then exit. ! !  ! File: gcj.info, Node: Invoking jv-convert, Next: Invoking rmic, Prev: Invoking gij, Up: Top ! ! Invoking jv-convert ! ******************* ! ! `jv-convert' [`OPTION'] ... [INPUTFILE [OUTPUTFILE]] ! ! `jv-convert' is a utility included with `libgcj' which converts a ! file from one encoding to another. It is similar to the Unix `iconv' ! utility. ! ! The encodings supported by `jv-convert' are platform-dependent. ! Currently there is no way to get a list of all supported encodings. ! ! `--encoding NAME' ! `--from NAME' ! Use NAME as the input encoding. The default is the current ! locale's encoding. ! ! `--to NAME' ! Use NAME as the output encoding. The default is the `JavaSrc' ! encoding; this is ASCII with `\u' escapes for non-ASCII characters. ! ! `-i FILE' ! Read from FILE. The default is to read from standard input. ! ! `-o FILE' ! Write to FILE. The default is to write to standard output. ! ! `--reverse' ! Swap the input and output encodings. ! ! `--help' ! Print a help message, then exit. ! ! `--version' ! Print version information, then exit. ! !  ! File: gcj.info, Node: Invoking rmic, Next: Invoking rmiregistry, Prev: Invoking jv-convert, Up: Top ! ! Invoking rmic ! ************* ! ! `rmic' [`OPTION'] ... CLASS ... ! ! `rmic' is a utility included with `libgcj' which generates stubs for ! remote objects. ! ! Note that this program isn't yet fully compatible with the JDK ! `rmic'. Some options, such as `-classpath', are recognized but ! currently ignored. We have left these options undocumented for now. ! ! Long options can also be given with a GNU-style leading `--'. For ! instance, `--help' is accepted. ! ! `-keep' ! `-keepgenerated' ! By default, `rmic' deletes intermediate files. Either of these ! options causes it not to delete such files. ! ! `-v1.1' ! Cause `rmic' to create stubs and skeletons for the 1.1 protocol ! version. ! ! `-vcompat' ! Cause `rmic' to create stubs and skeletons compatible with both ! the 1.1 and 1.2 protocol versions. This is the default. ! ! `-v1.2' ! Cause `rmic' to create stubs and skeletons for the 1.2 protocol ! version. ! ! `-nocompile' ! Don't compile the generated files. ! ! `-verbose' ! Print information about what `rmic' is doing. ! ! `-d DIRECTORY' ! Put output files in DIRECTORY. By default the files are put in ! the current working directory. ! ! `-help' ! Print a help message, then exit. ! ! `-version' ! Print version information, then exit. ! !  ! File: gcj.info, Node: Invoking rmiregistry, Next: About CNI, Prev: Invoking rmic, Up: Top ! ! Invoking rmiregistry ! ******************** ! ! `rmic' [`OPTION'] ... [PORT] ! ! `rmiregistry' starts a remote object registry on the current host. ! If no port number is specified, then port 1099 is used. ! ! `--help' ! Print a help message, then exit. ! ! `--version' ! Print version information, then exit. ! !  ! File: gcj.info, Node: About CNI, Next: System properties, Prev: Invoking rmiregistry, Up: Top ! ! About CNI ! ********* ! ! This documents CNI, the Cygnus Native Interface, which is is a ! convenient way to write Java native methods using C++. This is a more ! efficient, more convenient, but less portable alternative to the ! standard JNI (Java Native Interface). ! ! * Menu: ! ! * Basic concepts:: Introduction to using CNI. ! * Packages:: How packages are mapped to C++. ! * Primitive types:: Handling Java types in C++. ! * Interfaces:: How Java interfaces map to C++. ! * Objects and Classes:: C++ and Java classes. ! * Class Initialization:: How objects are initialized. ! * Object allocation:: How to create Java objects in C++. ! * Arrays:: Dealing with Java arrays in C++. ! * Methods:: Java methods in C++. ! * Strings:: Information about Java Strings. ! * Mixing with C++:: How CNI can interoperate with C++. ! * Exception Handling:: How exceptions are handled. ! * Synchronization:: Synchronizing between Java and C++. ! * Invocation:: Starting the Java runtime from C++. ! * Reflection:: Using reflection from C++. ! !  ! File: gcj.info, Node: Basic concepts, Next: Packages, Up: About CNI ! ! Basic concepts ! ============== ! ! In terms of languages features, Java is mostly a subset of C++. ! Java has a few important extensions, plus a powerful standard class ! library, but on the whole that does not change the basic similarity. ! Java is a hybrid object-oriented language, with a few native types, in ! addition to class types. It is class-based, where a class may have ! static as well as per-object fields, and static as well as instance ! methods. Non-static methods may be virtual, and may be overloaded. ! Overloading is resolved at compile time by matching the actual argument ! types against the parameter types. Virtual methods are implemented ! using indirect calls through a dispatch table (virtual function table). ! Objects are allocated on the heap, and initialized using a constructor ! method. Classes are organized in a package hierarchy. ! ! All of the listed attributes are also true of C++, though C++ has ! extra features (for example in C++ objects may be allocated not just on ! the heap, but also statically or in a local stack frame). Because ! `gcj' uses the same compiler technology as G++ (the GNU C++ compiler), ! it is possible to make the intersection of the two languages use the ! same ABI (object representation and calling conventions). The key idea ! in CNI is that Java objects are C++ objects, and all Java classes are ! C++ classes (but not the other way around). So the most important task ! in integrating Java and C++ is to remove gratuitous incompatibilities. ! ! You write CNI code as a regular C++ source file. (You do have to use ! a Java/CNI-aware C++ compiler, specifically a recent version of G++.) ! ! A CNI C++ source file must have: ! ! #include ! ! and then must include one header file for each Java class it uses, e.g.: ! ! #include ! #include ! #include ! ! These header files are automatically generated by `gcjh'. ! ! CNI provides some functions and macros to make using Java objects and ! primitive types from C++ easier. In general, these CNI functions and ! macros start with the `Jv' prefix, for example the function ! `JvNewObjectArray'. This convention is used to avoid conflicts with ! other libraries. Internal functions in CNI start with the prefix ! `_Jv_'. You should not call these; if you find a need to, let us know ! and we will try to come up with an alternate solution. (This manual ! lists `_Jv_AllocBytes' as an example; CNI should instead provide a ! `JvAllocBytes' function.) ! ! Limitations ! ----------- ! ! Whilst a Java class is just a C++ class that doesn't mean that you ! are freed from the shackles of Java, a CNI C++ class must adhere to the ! rules of the Java programming language. ! ! For example: it is not possible to declare a method in a CNI class ! that will take a C string (`char*') as an argument, or to declare a ! member variable of some non-Java datatype. ! !  ! File: gcj.info, Node: Packages, Next: Primitive types, Prev: Basic concepts, Up: About CNI ! ! Packages ! ======== ! ! The only global names in Java are class names, and packages. A ! "package" can contain zero or more classes, and also zero or more ! sub-packages. Every class belongs to either an unnamed package or a ! package that has a hierarchical and globally unique name. ! ! A Java package is mapped to a C++ "namespace". The Java class ! `java.lang.String' is in the package `java.lang', which is a ! sub-package of `java'. The C++ equivalent is the class ! `java::lang::String', which is in the namespace `java::lang' which is ! in the namespace `java'. ! ! Here is how you could express this: ! ! (// Declare the class(es), possibly in a header file: ! namespace java { ! namespace lang { ! class Object; ! class String; ! ... ! } ! } ! ! class java::lang::String : public java::lang::Object ! { ! ... ! }; ! ! The `gcjh' tool automatically generates the necessary namespace ! declarations. ! ! Leaving out package names ! ------------------------- ! ! Always using the fully-qualified name of a java class can be ! tiresomely verbose. Using the full qualified name also ties the code ! to a single package making code changes necessary should the class move ! from one package to another. The Java `package' declaration specifies ! that the following class declarations are in the named package, without ! having to explicitly name the full package qualifiers. The `package' ! declaration can be followed by zero or more `import' declarations, which ! allows either a single class or all the classes in a package to be ! named by a simple identifier. C++ provides something similar with the ! `using' declaration and directive. ! ! In Java: ! ! import PACKAGE-NAME.CLASS-NAME; ! ! allows the program text to refer to CLASS-NAME as a shorthand for the ! fully qualified name: `PACKAGE-NAME.CLASS-NAME'. ! ! To achieve the same effect C++, you have to do this: ! ! using PACKAGE-NAME::CLASS-NAME; ! ! Java can also cause imports on demand, like this: ! ! import PACKAGE-NAME.*; ! ! Doing this allows any class from the package PACKAGE-NAME to be ! referred to only by its class-name within the program text. ! ! The same effect can be achieved in C++ like this: ! ! using namespace PACKAGE-NAME; ! !  ! File: gcj.info, Node: Primitive types, Next: Interfaces, Prev: Packages, Up: About CNI ! ! Primitive types ! =============== ! ! Java provides 8 "primitives" types which represent integers, floats, ! characters and booleans (and also the void type). C++ has its own very ! similar concrete types. Such types in C++ however are not always ! implemented in the same way (an int might be 16, 32 or 64 bits for ! example) so CNI provides a special C++ type for each primitive Java ! type: ! ! *Java type* *C/C++ typename* *Description* ! `char' `jchar' 16 bit Unicode character ! `boolean' `jboolean' logical (true or false) values ! `byte' `jbyte' 8-bit signed integer ! `short' `jshort' 16 bit signed integer ! `int' `jint' 32 bit signed integer ! `long' `jlong' 64 bit signed integer ! `float' `jfloat' 32 bit IEEE floating point number ! `double' `jdouble' 64 bit IEEE floating point number ! `void' `void' no value ! ! When referring to a Java type You should always use these C++ ! typenames (e.g.: `jint') to avoid disappointment. ! ! Reference types associated with primitive types ! ----------------------------------------------- ! ! In Java each primitive type has an associated reference type, e.g.: ! `boolean' has an associated `java.lang.Boolean' class. In order to ! make working with such classes easier GCJ provides the macro ! `JvPrimClass': ! ! - macro: JvPrimClass type ! Return a pointer to the `Class' object corresponding to the type ! supplied. ! ! JvPrimClass(void) => java.lang.Void.TYPE ! ! !  ! File: gcj.info, Node: Interfaces, Next: Objects and Classes, Prev: Primitive types, Up: About CNI ! ! Interfaces ! ========== ! ! A Java class can "implement" zero or more "interfaces", in addition ! to inheriting from a single base class. ! ! CNI allows CNI code to implement methods of interfaces. You can ! also call methods through interface references, with some limitations. ! ! CNI doesn't understand interface inheritance at all yet. So, you ! can only call an interface method when the declared type of the field ! being called matches the interface which declares that method. The ! workaround is to cast the interface reference to the right ! superinterface. ! ! For example if you have: ! ! interface A ! { ! void a(); ! } ! ! interface B extends A ! { ! void b(); ! } ! ! and declare a variable of type `B' in C++, you can't call `a()' ! unless you cast it to an `A' first. ! !  ! File: gcj.info, Node: Objects and Classes, Next: Class Initialization, Prev: Interfaces, Up: About CNI ! ! Objects and Classes ! =================== ! ! Classes ! ------- ! ! All Java classes are derived from `java.lang.Object'. C++ does not ! have a unique root class, but we use the C++ class `java::lang::Object' ! as the C++ version of the `java.lang.Object' Java class. All other ! Java classes are mapped into corresponding C++ classes derived from ! `java::lang::Object'. ! ! Interface inheritance (the `implements' keyword) is currently not ! reflected in the C++ mapping. ! ! Object fields ! ------------- ! ! Each object contains an object header, followed by the instance ! fields of the class, in order. The object header consists of a single ! pointer to a dispatch or virtual function table. (There may be extra ! fields _in front of_ the object, for example for memory management, but ! this is invisible to the application, and the reference to the object ! points to the dispatch table pointer.) ! ! The fields are laid out in the same order, alignment, and size as in ! C++. Specifically, 8-bite and 16-bit native types (`byte', `short', ! `char', and `boolean') are _not_ widened to 32 bits. Note that the ! Java VM does extend 8-bit and 16-bit types to 32 bits when on the VM ! stack or temporary registers. ! ! If you include the `gcjh'-generated header for a class, you can ! access fields of Java classes in the _natural_ way. For example, given ! the following Java class: ! ! public class Int ! { ! public int i; ! public Integer (int i) { this.i = i; } ! public static zero = new Integer(0); ! } ! ! you can write: ! ! #include ; ! #include ; ! ! Int* ! mult (Int *p, jint k) ! { ! if (k == 0) ! return Int::zero; // Static member access. ! return new Int(p->i * k); ! } ! ! Access specifiers ! ----------------- ! ! CNI does not strictly enforce the Java access specifiers, because ! Java permissions cannot be directly mapped into C++ permission. ! Private Java fields and methods are mapped to private C++ fields and ! methods, but other fields and methods are mapped to public fields and ! methods. ! !  ! File: gcj.info, Node: Class Initialization, Next: Object allocation, Prev: Objects and Classes, Up: About CNI ! ! Class Initialization ! ==================== ! ! Java requires that each class be automatically initialized at the ! time of the first active use. Initializing a class involves ! initializing the static fields, running code in class initializer ! methods, and initializing base classes. There may also be some ! implementation specific actions, such as allocating `String' objects ! corresponding to string literals in the code. ! ! The GCJ compiler inserts calls to `JvInitClass' at appropriate ! places to ensure that a class is initialized when required. The C++ ! compiler does not insert these calls automatically--it is the ! programmer's responsibility to make sure classes are initialized. ! However, this is fairly painless because of the conventions assumed by ! the Java system. ! ! First, `libgcj' will make sure a class is initialized before an ! instance of that object is created. This is one of the ! responsibilities of the `new' operation. This is taken care of both in ! Java code, and in C++ code. When G++ sees a `new' of a Java class, it ! will call a routine in `libgcj' to allocate the object, and that ! routine will take care of initializing the class. Note however that ! this does not happen for Java arrays; you must allocate those using the ! appropriate CNI function. It follows that you can access an instance ! field, or call an instance (non-static) method and be safe in the ! knowledge that the class and all of its base classes have been ! initialized. ! ! Invoking a static method is also safe. This is because the Java ! compiler adds code to the start of a static method to make sure the ! class is initialized. However, the C++ compiler does not add this ! extra code. Hence, if you write a native static method using CNI, you ! are responsible for calling `JvInitClass' before doing anything else in ! the method (unless you are sure it is safe to leave it out). ! ! Accessing a static field also requires the class of the field to be ! initialized. The Java compiler will generate code to call ! `Jv_InitClass' before getting or setting the field. However, the C++ ! compiler will not generate this extra code, so it is your ! responsibility to make sure the class is initialized before you access ! a static field from C++. ! !  ! File: gcj.info, Node: Object allocation, Next: Arrays, Prev: Class Initialization, Up: About CNI ! ! Object allocation ! ================= ! ! New Java objects are allocated using a "class instance creation ! expression", e.g.: ! ! new TYPE ( ... ) ! ! The same syntax is used in C++. The main difference is that C++ ! objects have to be explicitly deleted; in Java they are automatically ! deleted by the garbage collector. Using CNI, you can allocate a new ! Java object using standard C++ syntax and the C++ compiler will allocate ! memory from the garbage collector. If you have overloaded ! constructors, the compiler will choose the correct one using standard ! C++ overload resolution rules. ! ! For example: ! ! java::util::Hashtable *ht = new java::util::Hashtable(120); ! ! - Function: void* _Jv_AllocBytes (jsize SIZE) ! Allocates SIZE bytes from the heap. The memory is not scanned by ! the garbage collector but it freed if no references to it are ! discovered. ! !  ! File: gcj.info, Node: Arrays, Next: Methods, Prev: Object allocation, Up: About CNI ! ! Arrays ! ====== ! ! While in many ways Java is similar to C and C++, it is quite ! different in its treatment of arrays. C arrays are based on the idea ! of pointer arithmetic, which would be incompatible with Java's security ! requirements. Java arrays are true objects (array types inherit from ! `java.lang.Object'). An array-valued variable is one that contains a ! reference (pointer) to an array object. ! ! Referencing a Java array in C++ code is done using the `JArray' ! template, which as defined as follows: ! ! class __JArray : public java::lang::Object ! { ! public: ! int length; ! }; ! ! template ! class JArray : public __JArray ! { ! T data[0]; ! public: ! T& operator[](jint i) { return data[i]; } ! }; ! ! There are a number of `typedef's which correspond to `typedef's from ! the JNI. Each is the type of an array holding objects of the relevant ! type: ! ! typedef __JArray *jarray; ! typedef JArray *jobjectArray; ! typedef JArray *jbooleanArray; ! typedef JArray *jbyteArray; ! typedef JArray *jcharArray; ! typedef JArray *jshortArray; ! typedef JArray *jintArray; ! typedef JArray *jlongArray; ! typedef JArray *jfloatArray; ! typedef JArray *jdoubleArray; ! ! - Method on template: T* elements (JArray ARRAY) ! This template function can be used to get a pointer to the ! elements of the `array'. For instance, you can fetch a pointer to ! the integers that make up an `int[]' like so: ! ! extern jintArray foo; ! jint *intp = elements (foo); ! ! The name of this function may change in the future. ! ! - Function: jobjectArray JvNewObjectArray (jsize LENGTH, jclass KLASS, ! jobject INIT) ! Here `klass' is the type of elements of the array and `init' is ! the initial value put into every slot in the array. ! ! Creating arrays ! --------------- ! ! For each primitive type there is a function which can be used to ! create a new array of that type. The name of the function is of the ! form: ! ! JvNewTYPEArray ! ! For example: ! ! JvNewBooleanArray ! ! can be used to create an array of Java primitive boolean types. ! ! The following function definition is the template for all such ! functions: ! ! - Function: jbooleanArray JvNewBooleanArray (jint LENGTH) ! Create's an array LENGTH indices long. ! ! - Function: jsize JvGetArrayLength (jarray ARRAY) ! Returns the length of the ARRAY. ! !  ! File: gcj.info, Node: Methods, Next: Strings, Prev: Arrays, Up: About CNI ! ! Methods ! ======= ! ! Java methods are mapped directly into C++ methods. The header files ! generated by `gcjh' include the appropriate method definitions. ! Basically, the generated methods have the same names and ! _corresponding_ types as the Java methods, and are called in the ! natural manner. ! ! Overloading ! ----------- ! ! Both Java and C++ provide method overloading, where multiple methods ! in a class have the same name, and the correct one is chosen (at ! compile time) depending on the argument types. The rules for choosing ! the correct method are (as expected) more complicated in C++ than in ! Java, but given a set of overloaded methods generated by `gcjh' the C++ ! compiler will choose the expected one. ! ! Common assemblers and linkers are not aware of C++ overloading, so ! the standard implementation strategy is to encode the parameter types ! of a method into its assembly-level name. This encoding is called ! "mangling", and the encoded name is the "mangled name". The same ! mechanism is used to implement Java overloading. For C++/Java ! interoperability, it is important that both the Java and C++ compilers ! use the _same_ encoding scheme. ! ! Static methods ! -------------- ! ! Static Java methods are invoked in CNI using the standard C++ ! syntax, using the `::' operator rather than the `.' operator. ! ! For example: ! ! jint i = java::lang::Math::round((jfloat) 2.3); ! ! C++ method definition syntax is used to define a static native method. ! For example: ! ! #include ! java::lang::Integer* ! java::lang::Integer::getInteger(jstring str) ! { ! ... ! } ! ! Object Constructors ! ------------------- ! ! Constructors are called implicitly as part of object allocation ! using the `new' operator. ! ! For example: ! ! java::lang::Integer *x = new java::lang::Integer(234); ! ! Java does not allow a constructor to be a native method. This ! limitation can be coded round however because a constructor can _call_ ! a native method. ! ! Instance methods ! ---------------- ! ! Calling a Java instance method from a C++ CNI method is done using ! the standard C++ syntax, e.g.: ! ! // First create the Java object. ! java::lang::Integer *x = new java::lang::Integer(234); ! // Now call a method. ! jint prim_value = x->intValue(); ! if (x->longValue == 0) ! ... ! ! Defining a Java native instance method is also done the natural way: ! ! #include ! ! jdouble ! java::lang:Integer::doubleValue() ! { ! return (jdouble) value; ! } ! ! Interface methods ! ----------------- ! ! In Java you can call a method using an interface reference. This is ! supported, but not completely. *Note Interfaces::. ! !  ! File: gcj.info, Node: Strings, Next: Mixing with C++, Prev: Methods, Up: About CNI ! ! Strings ! ======= ! ! CNI provides a number of utility functions for working with Java ! Java `String' objects. The names and interfaces are analogous to those ! of JNI. ! ! - Function: jstring JvNewString (const char* CHARS, jsize LEN) ! Returns a Java `String' object with characters from the C string ! CHARS up to the index LEN in that array. ! ! - Function: jstring JvNewStringLatin1 (const char* BYTES, jsize LEN) ! Returns a Java `String' made up of LEN bytes from BYTES. ! ! - Function: jstring JvNewStringLatin1 (const char* BYTES) ! As above but the length of the `String' is `strlen(BYTES)'. ! ! - Function: jstring JvNewStringUTF (const char* BYTES) ! Returns a `String' which is made up of the UTF encoded characters ! present in the C string BYTES. ! ! - Function: jchar* JvGetStringChars (jstring STR) ! Returns a pointer to an array of characters making up the `String' ! STR. ! ! - Function: int JvGetStringUTFLength (jstring STR) ! Returns the number of bytes required to encode the contents of the ! `String' STR in UTF-8. ! ! - Function: jsize JvGetStringUTFRegion (jstring STR, jsize START, ! jsize LEN, char* BUF) ! Puts the UTF-8 encoding of a region of the `String' STR into the ! buffer `buf'. The region to fetch is marked by START and LEN. ! ! Note that BUF is a buffer, not a C string. It is _not_ null ! terminated. ! !  ! File: gcj.info, Node: Mixing with C++, Next: Exception Handling, Prev: Strings, Up: About CNI ! ! Interoperating with C/C++ ! ========================= ! ! Because CNI is designed to represent Java classes and methods it ! cannot be mixed readily with C/C++ types. ! ! One important restriction is that Java classes cannot have non-Java ! type instance or static variables and cannot have methods which take ! non-Java types as arguments or return non-Java types. ! ! None of the following is possible with CNI: ! ! ! class ::MyClass : public java::lang::Object ! { ! char* variable; // char* is not a valid Java type. ! } ! ! ! uint ! ::SomeClass::someMethod (char *arg) ! { ! . ! . ! . ! } // `uint' is not a valid Java type, neither is `char*' ! ! Of course, it is ok to use C/C++ types within the scope of a method: ! ! jint ! ::SomeClass::otherMethod (jstring str) ! { ! char *arg = ... ! . ! . ! . ! } ! ! But this restriction can cause a problem so CNI includes the ! `gnu.gcj.RawData' class. The `RawData' class is a "non-scanned ! reference" type. In other words variables declared of type `RawData' ! can contain any data and are not checked by the compiler in any way. ! ! This means that you can put C/C++ data structures (including classes) ! in your CNI classes, as long as you use the appropriate cast. ! ! Here are some examples: ! ! ! class ::MyClass : public java::lang::Object ! { ! gnu.gcj.RawData string; ! ! MyClass (); ! gnu.gcj.RawData getText (); ! void printText (); ! } ! ! ::MyClass::MyClass () ! { ! char* text = ... ! string = text; ! } ! ! gnu.gcj.RawData ! ::MyClass::getText () ! { ! return string; ! } ! ! void ! ::MyClass::printText () ! { ! printf("%s\n", (char*) string); ! } ! !  ! File: gcj.info, Node: Exception Handling, Next: Synchronization, Prev: Mixing with C++, Up: About CNI ! ! Exception Handling ! ================== ! ! While C++ and Java share a common exception handling framework, ! things are not yet perfectly integrated. The main issue is that the ! run-time type information facilities of the two languages are not ! integrated. ! ! Still, things work fairly well. You can throw a Java exception from ! C++ using the ordinary `throw' construct, and this exception can be ! caught by Java code. Similarly, you can catch an exception thrown from ! Java using the C++ `catch' construct. ! ! Here is an example: ! ! if (i >= count) ! throw new java::lang::IndexOutOfBoundsException(); ! ! Normally, G++ will automatically detect when you are writing C++ ! code that uses Java exceptions, and handle them appropriately. ! However, if C++ code only needs to execute destructors when Java ! exceptions are thrown through it, GCC will guess incorrectly. Sample ! problematic code: ! ! struct S { ~S(); }; ! ! extern void bar(); // Is implemented in Java and may throw exceptions. ! ! void foo() ! { ! S s; ! bar(); ! } ! ! The usual effect of an incorrect guess is a link failure, ! complaining of a missing routine called `__gxx_personality_v0'. ! ! You can inform the compiler that Java exceptions are to be used in a ! translation unit, irrespective of what it might think, by writing ! `#pragma GCC java_exceptions' at the head of the file. This `#pragma' ! must appear before any functions that throw or catch exceptions, or run ! destructors when exceptions are thrown through them. ! !  ! File: gcj.info, Node: Synchronization, Next: Invocation, Prev: Exception Handling, Up: About CNI ! ! Synchronization ! =============== ! ! Each Java object has an implicit monitor. The Java VM uses the ! instruction `monitorenter' to acquire and lock a monitor, and ! `monitorexit' to release it. ! ! The corresponding CNI macros are `JvMonitorEnter' and ! `JvMonitorExit' (JNI has similar methods `MonitorEnter' and ! `MonitorExit'). ! ! The Java source language does not provide direct access to these ! primitives. Instead, there is a `synchronized' statement that does an ! implicit `monitorenter' before entry to the block, and does a ! `monitorexit' on exit from the block. Note that the lock has to be ! released even when the block is abnormally terminated by an exception, ! which means there is an implicit `try finally' surrounding ! synchronization locks. ! ! From C++, it makes sense to use a destructor to release a lock. CNI ! defines the following utility class: ! ! class JvSynchronize() { ! jobject obj; ! JvSynchronize(jobject o) { obj = o; JvMonitorEnter(o); } ! ~JvSynchronize() { JvMonitorExit(obj); } ! }; ! ! So this Java code: ! ! synchronized (OBJ) ! { ! CODE ! } ! ! might become this C++ code: ! ! { ! JvSynchronize dummy (OBJ); ! CODE; ! } ! ! Java also has methods with the `synchronized' attribute. This is ! equivalent to wrapping the entire method body in a `synchronized' ! statement. (Alternatively, an implementation could require the caller ! to do the synchronization. This is not practical for a compiler, ! because each virtual method call would have to test at run-time if ! synchronization is needed.) Since in `gcj' the `synchronized' ! attribute is handled by the method implementation, it is up to the ! programmer of a synchronized native method to handle the synchronization ! (in the C++ implementation of the method). In other words, you need to ! manually add `JvSynchronize' in a `native synchronized' method. ! !  ! File: gcj.info, Node: Invocation, Next: Reflection, Prev: Synchronization, Up: About CNI ! ! Invocation ! ========== ! ! CNI permits C++ applications to make calls into Java classes, in ! addition to allowing Java code to call into C++. Several functions, ! known as the "invocation API", are provided to support this. ! ! - Function: jint JvCreateJavaVM (void* VM_ARGS) ! Initializes the Java runtime. This function performs essential ! initialization of the threads interface, garbage collector, ! exception handling and other key aspects of the runtime. It must ! be called once by an application with a non-Java `main()' ! function, before any other Java or CNI calls are made. It is ! safe, but not recommended, to call `JvCreateJavaVM()' more than ! once provided it is only called from a single thread. The VMARGS ! parameter can be used to specify initialization parameters for the ! Java runtime. It may be `NULL'. This function returns `0' upon ! success, or `-1' if the runtime is already initialized. ! ! _Note:_ In GCJ 3.1, the `vm_args' parameter is ignored. It may be ! used in a future release. ! ! - Function: java::lang::Thread* JvAttachCurrentThread (jstring NAME, ! java::lang::ThreadGroup* GROUP) ! Registers an existing thread with the Java runtime. This must be ! called once from each thread, before that thread makes any other ! Java or CNI calls. It must be called after `JvCreateJavaVM'. NAME ! specifies a name for the thread. It may be `NULL', in which case a ! name will be generated. GROUP is the ThreadGroup in which this ! thread will be a member. If it is `NULL', the thread will be a ! member of the main thread group. The return value is the Java ! `Thread' object that represents the thread. It is safe to call ! `JvAttachCurrentThread()' more than once from the same thread. If ! the thread is already attached, the call is ignored and the current ! thread object is returned. ! ! - Function: jint JvDetachCurrentThread () ! Unregisters a thread from the Java runtime. This should be called ! by threads that were attached using `JvAttachCurrentThread()', ! after they have finished making calls to Java code. This ensures ! that any resources associated with the thread become eligible for ! garbage collection. This function returns `0' upon success, or ! `-1' if the current thread is not attached. ! ! Handling uncaught exceptions ! ---------------------------- ! ! If an exception is thrown from Java code called using the invocation ! API, and no handler for the exception can be found, the runtime will ! abort the application. In order to make the application more robust, it ! is recommended that code which uses the invocation API be wrapped by a ! top-level try/catch block that catches all Java exceptions. ! ! Example ! ------- ! ! The following code demonstrates the use of the invocation API. In ! this example, the C++ application initializes the Java runtime and ! attaches itself. The `java.lang.System' class is initialized in order to ! access its `out' field, and a Java string is printed. Finally, the ! thread is detached from the runtime once it has finished making Java ! calls. Everything is wrapped with a try/catch block to provide a ! default handler for any uncaught exceptions. ! ! The example can be compiled with `c++ test.cc -lgcj'. ! ! // test.cc ! #include ! #include ! #include ! #include ! ! int main(int argc, char *argv) ! { ! using namespace java::lang; ! ! try ! { ! JvCreateJavaVM(NULL); ! JvAttachCurrentThread(NULL, NULL); ! ! String *message = JvNewStringLatin1("Hello from C++"); ! JvInitClass(&System::class$); ! System::out->println(message); ! ! JvDetachCurrentThread(); ! } ! catch (Throwable *t) ! { ! System::err->println(JvNewStringLatin1("Unhandled Java exception:")); ! t->printStackTrace(); ! } ! } ! !  ! File: gcj.info, Node: Reflection, Prev: Invocation, Up: About CNI ! ! Reflection ! ========== ! ! Reflection is possible with CNI code, it functions similarly to how ! it functions with JNI. ! ! The types `jfieldID' and `jmethodID' are as in JNI. ! ! The functions: ! ! * `JvFromReflectedField', ! ! * `JvFromReflectedMethod', ! ! * `JvToReflectedField' ! ! * `JvToFromReflectedMethod' ! ! will be added shortly, as will other functions corresponding to JNI. ! !  ! File: gcj.info, Node: System properties, Next: Resources, Prev: About CNI, Up: Top ! ! System properties ! ***************** ! ! The runtime behavior of the `libgcj' library can be modified by ! setting certain system properties. These properties can be compiled ! into the program using the `-DNAME[=VALUE]' option to `gcj' or by ! setting them explicitly in the program by calling the ! `java.lang.System.setProperty()' method. Some system properties are ! only used for informational purposes (like giving a version number or a ! user name). A program can inspect the current value of a property by ! calling the `java.lang.System.getProperty()' method. ! ! * Menu: ! ! * Standard Properties:: Standard properties supported by `libgcj' ! * GNU Classpath Properties:: Properties found in Classpath based libraries ! * libgcj Runtime Properties:: Properties specific to `libgcj' ! !  ! File: gcj.info, Node: Standard Properties, Next: GNU Classpath Properties, Up: System properties ! ! Standard Properties ! =================== ! ! The following properties are normally found in all implementations ! of the core libraries for the Java language. ! ! `java.version' ! The `libgcj' version number. ! ! `java.vendor' ! Set to `The Free Software Foundation, Inc.' ! ! `java.vendor.url' ! Set to `http://gcc.gnu.org/java/'. ! ! `java.home' ! The directory where `gcj' was installed. Taken from the `--prefix' ! option given to `configure'. ! ! `java.class.version' ! The class format version number supported by the libgcj byte code ! interpreter. (Currently `46.0') ! ! `java.vm.specification.version' ! The Virtual Machine Specification version implemented by `libgcj'. ! (Currently `1.0') ! ! `java.vm.specification.vendor' ! The name of the Virtual Machine specification designer. ! ! `java.vm.specification.name' ! The name of the Virtual Machine specification (Set to `Java ! Virtual Machine Specification'). ! ! `java.vm.version' ! The `gcj' version number. ! ! `java.vm.vendor' ! Set to `The Free Software Foundation, Inc.' ! ! `java.vm.name' ! Set to `GNU libgcj'. ! ! `java.specification.version' ! The Runtime Environment specification version implemented by ! `libgcj'. (Currently set to `1.3') ! ! `java.specification.vendor' ! The Runtime Environment specification designer. ! ! `java.specification.name' ! The name of the Runtime Environment specification (Set to `Java ! Platform API Specification'). ! ! `java.class.path' ! The paths (jar files, zip files and directories) used for finding ! class files. ! ! `java.library.path' ! Directory path used for finding native libraries. ! ! `java.io.tmpdir' ! The directory used to put temporary files in. ! ! `java.compiler' ! Name of the Just In Time compiler to use by the byte code ! interpreter. Currently not used in `libgcj'. ! ! `java.ext.dirs' ! Directories containing jar files with extra libraries. Will be ! used when resolving classes. Currently not used in `libgcj'. ! ! `java.protocol.handler.pkgs' ! A `|' separated list of package names that is used to find classes ! that implement handlers for `java.net.URL'. ! ! `java.rmi.server.codebase' ! A list of URLs that is used by the `java.rmi.server.RMIClassLoader' ! to load classes from. ! ! `jdbc.drivers' ! A list of class names that will be loaded by the ! `java.sql.DriverManager' when it starts up. ! ! `file.separator' ! The separator used in when directories are included in a filename ! (normally `/' or `\' ). ! ! `file.encoding' ! The default character encoding used when converting platform ! native files to Unicode (usually set to `8859_1'). ! ! `path.separator' ! The standard separator used when a string contains multiple paths ! (normally `:' or `;'), the string is usually not a valid character ! to use in normal directory names.) ! ! `line.separator' ! The default line separator used on the platform (normally `\n', ! `\r' or a combination of those two characters). ! ! `policy.provider' ! The class name used for the default policy provider returned by ! `java.security.Policy.getPolicy'. ! ! `user.name' ! The name of the user running the program. Can be the full name, ! the login name or empty if unknown. ! ! `user.home' ! The default directory to put user specific files in. ! ! `user.dir' ! The current working directory from which the program was started. ! ! `user.language' ! The default language as used by the `java.util.Locale' class. ! ! `user.region' ! The default region as used by the `java.util.Local' class. ! ! `user.variant' ! The default variant of the language and region local used. ! ! `user.timezone' ! The default timezone as used by the `java.util.TimeZone' class. ! ! `os.name' ! The operating system/kernel name that the program runs on. ! ! `os.arch' ! The hardware that we are running on. ! ! `os.version' ! The version number of the operating system/kernel. ! ! `awt.appletWarning' ! The string to display when an untrusted applet is displayed. ! Returned by `java.awt.Window.getWarningString()' when the window is ! "insecure". ! ! `awt.toolkit' ! The class name used for initializing the default ! `java.awt.Toolkit'. Defaults to `gnu.awt.gtk.GtkToolkit'. ! ! `http.proxyHost' ! Name of proxy host for http connections. ! ! `http.proxyPort' ! Port number to use when a proxy host is in use. ! !  ! File: gcj.info, Node: GNU Classpath Properties, Next: libgcj Runtime Properties, Prev: Standard Properties, Up: System properties ! ! GNU Classpath Properties ! ======================== ! ! `libgcj' is based on the GNU Classpath (Essential Libraries for ! Java) a GNU project to create free core class libraries for use with ! virtual machines and compilers for the Java language. The following ! properties are common to libraries based on GNU Classpath. ! ! `gcj.dumpobject' ! Enables printing serialization debugging by the ! `java.io.ObjectInput' and `java.io.ObjectOutput' classes when set ! to something else then the empty string. Only used when running a ! debug build of the library. ! ! `gnu.classpath.vm.shortname' ! This is a succint name of the virtual machine. For `libgcj', this ! will always be `libgcj'. ! ! `gnu.classpath.home.url' ! A base URL used for finding system property files (e.g., ! `classpath.security'). By default this is a `file:' URL pointing ! to the `lib' directory under `java.home'. ! !  ! File: gcj.info, Node: libgcj Runtime Properties, Prev: GNU Classpath Properties, Up: System properties ! ! libgcj Runtime Properties ! ========================= ! ! The following properties are specific to the `libgcj' runtime and ! will normally not be found in other core libraries for the java ! language. ! ! `java.fullversion' ! The combination of `java.vm.name' and `java.vm.version'. ! ! `java.vm.info' ! Same as `java.fullversion'. ! ! `impl.prefix' ! Used by the `java.net.DatagramSocket' class when set to something ! else then the empty string. When set all newly created ! `DatagramSocket's will try to load a class ! `java.net.[impl.prefix]DatagramSocketImpl' instead of the normal ! `java.net.PlainDatagramSocketImpl'. ! ! `gnu.gcj.progname' ! The name that was used to invoked the program. ! ! `gnu.gcj.runtime.NameFinder.demangle' ! Whether names in a stack trace should be demangled. Defaults to ! `true'. ! ! `gnu.gcj.runtime.NameFinder.sanitize' ! Whether calls to initialize exceptions and starting the runtime ! system should be removed from the stack trace. Only done when ! names are demangled. Defaults to `true'. ! ! `gnu.gcj.runtime.NameFinder.remove_unknown' ! Whether calls to unknown functions (class and method names are ! unknown) should be removed from the stack trace. Only done when ! the stack is sanitized. Ignored if this means no stack trace ! information would be available anymore. Defaults to `true'. ! ! `gnu.gcj.runtime.NameFinder.remove_interpreter' ! Whether runtime interpreter calls (methods in the ! `_Jv_InterpMethod' class and functions starting with `ffi_') ! should be removed from the stack trace. Only done when the stack ! is sanitized. Defaults to `true'. ! ! `gnu.gcj.runtime.NameFinder.use_addr2line' ! Whether an external process (`addr2line' or `addr2name.awk') ! should be used as fallback to convert the addresses to function ! names when the runtime is unable to do it through `dladdr'. ! !  ! File: gcj.info, Node: Resources, Prev: System properties, Up: Top ! ! Resources ! ********* ! ! While writing `gcj' and `libgcj' we have, of course, relied heavily ! on documentation from Sun Microsystems. In particular we have used The ! Java Language Specification (both first and second editions), the Java ! Class Libraries (volumes one and two), and the Java Virtual Machine ! Specification. In addition we've used the online documentation at ! `http://java.sun.com/'. ! ! The current `gcj' home page is `http://gcc.gnu.org/java/'. ! ! For more information on gcc, see `http://gcc.gnu.org/'. ! ! Some `libgcj' testing is done using the Mauve test suite. This is a ! free software Java class library test suite which is being written ! because the JCK is not free. See `http://sources.redhat.com/mauve/' ! for more information. ! !  Tag Table: ! Node: Top1740 ! Node: Copying3668 ! Node: GNU Free Documentation License22868 ! Node: Invoking gcj45277 ! Node: Input and output files45928 ! Node: Input Options47291 ! Node: Encodings50434 ! Node: Warnings51635 ! Node: Code Generation52666 ! Ref: Code Generation-Footnote-156326 ! Node: Configure-time Options56635 ! Node: Compatibility58053 ! Node: Limitations58533 ! Node: Extensions60110 ! Node: Invoking gcjh61362 ! Node: Invoking jv-scan63418 ! Node: Invoking jcf-dump64458 ! Node: Invoking gij65230 ! Node: Invoking jv-convert67437 ! Node: Invoking rmic68507 ! Node: Invoking rmiregistry69882 ! Node: About CNI70286 ! Node: Basic concepts71577 ! Node: Packages74560 ! Node: Primitive types76875 ! Node: Interfaces78524 ! Node: Objects and Classes79433 ! Node: Class Initialization81594 ! Node: Object allocation83930 ! Node: Arrays84905 ! Node: Methods87492 ! Node: Strings90244 ! Node: Mixing with C++91712 ! Node: Exception Handling93595 ! Node: Synchronization95230 ! Node: Invocation97211 ! Node: Reflection101281 ! Node: System properties101733 ! Node: Standard Properties102607 ! Node: GNU Classpath Properties107064 ! Node: libgcj Runtime Properties108102 ! Node: Resources110103  End Tag Table diff -Nrc3pad gcc-3.2.3/gcc/java/gcj.info-1 gcc-3.3/gcc/java/gcj.info-1 *** gcc-3.2.3/gcc/java/gcj.info-1 2003-04-22 07:07:25.000000000 +0000 --- gcc-3.3/gcc/java/gcj.info-1 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,1012 **** - This is gcj.info, produced by makeinfo version 4.5 from gcj.texi. - - INFO-DIR-SECTION Programming - START-INFO-DIR-ENTRY - * Gcj: (gcj). Ahead-of-time compiler for the Java language - END-INFO-DIR-ENTRY - - INFO-DIR-SECTION Individual utilities - START-INFO-DIR-ENTRY - * gcjh: (gcj)Invoking gcjh. - Generate header files from Java class files - * jv-scan: (gcj)Invoking jv-scan. - Print information about Java source files - * jcf-dump: (gcj)Invoking jcf-dump. - Print information about Java class files - * gij: (gcj)Invoking gij. GNU interpreter for Java bytecode - * jv-convert: (gcj)Invoking jv-convert. - Convert file from one encoding to another - * rmic: (gcj)Invoking rmic. - Generate stubs for Remote Method Invocation. - * rmiregistry: (gcj)Invoking rmiregistry. - The remote object registry. - END-INFO-DIR-ENTRY - - Copyright (C) 2001, 2002 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 or - any later version published by the Free Software Foundation; with the - Invariant Sections being "GNU General Public License", the Front-Cover - texts being (a) (see below), and with the Back-Cover Texts being (b) - (see below). A copy of the license is included in the section entitled - "GNU Free Documentation License". - - (a) The FSF's Front-Cover Text is: - - A GNU Manual - - (b) The FSF's Back-Cover Text is: - - You have freedom to copy and modify this GNU Manual, like GNU - software. Copies published by the Free Software Foundation raise - funds for GNU development. - -  - File: gcj.info, Node: Top, Next: Copying, Up: (dir) - - Introduction - ************ - - This manual describes how to use `gcj', the GNU compiler for the - Java programming language. `gcj' can generate both `.class' files and - object files, and it can read both Java source code and `.class' files. - - * Menu: - - * Copying:: The GNU General Public License - * GNU Free Documentation License:: - How you can share and copy this manual - * Invoking gcj:: Compiler options supported by `gcj' - * Compatibility:: Compatibility between gcj and other tools for Java - * Invoking gcjh:: Generate header files from class files - * Invoking jv-scan:: Print information about source files - * Invoking jcf-dump:: Print information about class files - * Invoking gij:: Interpreting Java bytecodes - * Invoking jv-convert:: Converting from one encoding to another - * Invoking rmic:: Generate stubs for Remote Method Invocation. - * Invoking rmiregistry:: The remote object registry. - * About CNI:: Description of the Cygnus Native Interface - * Resources:: Where to look for more information - -  - File: gcj.info, Node: Copying, Next: GNU Free Documentation License, Prev: Top, Up: Top - - GNU GENERAL PUBLIC LICENSE - ************************** - - Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - ======== - - The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public - License is intended to guarantee your freedom to share and change free - software--to make sure the software is free for all its users. This - General Public License applies to most of the Free Software - Foundation's software and to any other program whose authors commit to - using it. (Some other Free Software Foundation software is covered by - the GNU Library General Public License instead.) You can apply it to - your programs, too. - - When we speak of free software, we are referring to freedom, not - price. Our General Public Licenses are designed to make sure that you - have the freedom to distribute copies of free software (and charge for - this service if you wish), that you receive source code or can get it - if you want it, that you can change the software or use pieces of it in - new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid - anyone to deny you these rights or to ask you to surrender the rights. - These restrictions translate to certain responsibilities for you if you - distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether - gratis or for a fee, you must give the recipients all the rights that - you have. You must make sure that they, too, receive or can get the - source code. And you must show them these terms so they know their - rights. - - We protect your rights with two steps: (1) copyright the software, - and (2) offer you this license which gives you legal permission to copy, - distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain - that everyone understands that there is no warranty for this free - software. If the software is modified by someone else and passed on, we - want its recipients to know that what they have is not the original, so - that any problems introduced by others will not reflect on the original - authors' reputations. - - Finally, any free program is threatened constantly by software - patents. We wish to avoid the danger that redistributors of a free - program will individually obtain patent licenses, in effect making the - program proprietary. To prevent this, we have made it clear that any - patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and - modification follow. - - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License applies to any program or other work which contains a - notice placed by the copyright holder saying it may be distributed - under the terms of this General Public License. The "Program", - below, refers to any such program or work, and a "work based on - the Program" means either the Program or any derivative work under - copyright law: that is to say, a work containing the Program or a - portion of it, either verbatim or with modifications and/or - translated into another language. (Hereinafter, translation is - included without limitation in the term "modification".) Each - licensee is addressed as "you". - - Activities other than copying, distribution and modification are - not covered by this License; they are outside its scope. The act - of running the Program is not restricted, and the output from the - Program is covered only if its contents constitute a work based on - the Program (independent of having been made by running the - Program). Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's - source code as you receive it, in any medium, provided that you - conspicuously and appropriately publish on each copy an appropriate - copyright notice and disclaimer of warranty; keep intact all the - notices that refer to this License and to the absence of any - warranty; and give any other recipients of the Program a copy of - this License along with the Program. - - You may charge a fee for the physical act of transferring a copy, - and you may at your option offer warranty protection in exchange - for a fee. - - 2. You may modify your copy or copies of the Program or any portion - of it, thus forming a work based on the Program, and copy and - distribute such modifications or work under the terms of Section 1 - above, provided that you also meet all of these conditions: - - a. You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b. You must cause any work that you distribute or publish, that - in whole or in part contains or is derived from the Program - or any part thereof, to be licensed as a whole at no charge - to all third parties under the terms of this License. - - c. If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display - an announcement including an appropriate copyright notice and - a notice that there is no warranty (or else, saying that you - provide a warranty) and that users may redistribute the - program under these conditions, and telling the user how to - view a copy of this License. (Exception: if the Program - itself is interactive but does not normally print such an - announcement, your work based on the Program is not required - to print an announcement.) - - These requirements apply to the modified work as a whole. If - identifiable sections of that work are not derived from the - Program, and can be reasonably considered independent and separate - works in themselves, then this License, and its terms, do not - apply to those sections when you distribute them as separate - works. But when you distribute the same sections as part of a - whole which is a work based on the Program, the distribution of - the whole must be on the terms of this License, whose permissions - for other licensees extend to the entire whole, and thus to each - and every part regardless of who wrote it. - - Thus, it is not the intent of this section to claim rights or - contest your rights to work written entirely by you; rather, the - intent is to exercise the right to control the distribution of - derivative or collective works based on the Program. - - In addition, mere aggregation of another work not based on the - Program with the Program (or with a work based on the Program) on - a volume of a storage or distribution medium does not bring the - other work under the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, - under Section 2) in object code or executable form under the terms - of Sections 1 and 2 above provided that you also do one of the - following: - - a. Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of - Sections 1 and 2 above on a medium customarily used for - software interchange; or, - - b. Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a - medium customarily used for software interchange; or, - - c. Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with - such an offer, in accord with Subsection b above.) - - The source code for a work means the preferred form of the work for - making modifications to it. For an executable work, complete - source code means all the source code for all modules it contains, - plus any associated interface definition files, plus the scripts - used to control compilation and installation of the executable. - However, as a special exception, the source code distributed need - not include anything that is normally distributed (in either - source or binary form) with the major components (compiler, - kernel, and so on) of the operating system on which the executable - runs, unless that component itself accompanies the executable. - - If distribution of executable or object code is made by offering - access to copy from a designated place, then offering equivalent - access to copy the source code from the same place counts as - distribution of the source code, even though third parties are not - compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense or distribute the Program is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. - - 5. You are not required to accept this License, since you have not - signed it. However, nothing else grants you permission to modify - or distribute the Program or its derivative works. These actions - are prohibited by law if you do not accept this License. - Therefore, by modifying or distributing the Program (or any work - based on the Program), you indicate your acceptance of this - License to do so, and all its terms and conditions for copying, - distributing or modifying the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the - Program), the recipient automatically receives a license from the - original licensor to copy, distribute or modify the Program - subject to these terms and conditions. You may not impose any - further restrictions on the recipients' exercise of the rights - granted herein. You are not responsible for enforcing compliance - by third parties to this License. - - 7. If, as a consequence of a court judgment or allegation of patent - infringement or for any other reason (not limited to patent - issues), conditions are imposed on you (whether by court order, - agreement or otherwise) that contradict the conditions of this - License, they do not excuse you from the conditions of this - License. If you cannot distribute so as to satisfy simultaneously - your obligations under this License and any other pertinent - obligations, then as a consequence you may not distribute the - Program at all. For example, if a patent license would not permit - royalty-free redistribution of the Program by all those who - receive copies directly or indirectly through you, then the only - way you could satisfy both it and this License would be to refrain - entirely from distribution of the Program. - - If any portion of this section is held invalid or unenforceable - under any particular circumstance, the balance of the section is - intended to apply and the section as a whole is intended to apply - in other circumstances. - - It is not the purpose of this section to induce you to infringe any - patents or other property right claims or to contest validity of - any such claims; this section has the sole purpose of protecting - the integrity of the free software distribution system, which is - implemented by public license practices. Many people have made - generous contributions to the wide range of software distributed - through that system in reliance on consistent application of that - system; it is up to the author/donor to decide if he or she is - willing to distribute software through any other system and a - licensee cannot impose that choice. - - This section is intended to make thoroughly clear what is believed - to be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in - certain countries either by patents or by copyrighted interfaces, - the original copyright holder who places the Program under this - License may add an explicit geographical distribution limitation - excluding those countries, so that distribution is permitted only - in or among countries not thus excluded. In such case, this - License incorporates the limitation as if written in the body of - this License. - - 9. The Free Software Foundation may publish revised and/or new - versions of the General Public License from time to time. Such - new versions will be similar in spirit to the present version, but - may differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the - Program specifies a version number of this License which applies - to it and "any later version", you have the option of following - the terms and conditions either of that version or of any later - version published by the Free Software Foundation. If the Program - does not specify a version number of this License, you may choose - any version ever published by the Free Software Foundation. - - 10. If you wish to incorporate parts of the Program into other free - programs whose distribution conditions are different, write to the - author to ask for permission. For software which is copyrighted - by the Free Software Foundation, write to the Free Software - Foundation; we sometimes make exceptions for this. Our decision - will be guided by the two goals of preserving the free status of - all derivatives of our free software and of promoting the sharing - and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO - WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE - LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT - HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT - WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT - NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE - QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE - PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY - SERVICING, REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN - WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY - MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE - LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, - INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR - INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF - DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU - OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY - OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - ============================================= - - If you develop a new program, and you want it to be of the greatest - possible use to the public, the best way to achieve this is to make it - free software which everyone can redistribute and change under these - terms. - - To do so, attach the following notices to the program. It is safest - to attach them to the start of each source file to most effectively - convey the exclusion of warranty; and each file should have at least - the "copyright" line and a pointer to where the full notice is found. - - ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. - Copyright (C) YEAR NAME OF AUTHOR - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - Also add information on how to contact you by electronic and paper - mail. - - If the program is interactive, make it output a short notice like - this when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details - type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - - The hypothetical commands `show w' and `show c' should show the - appropriate parts of the General Public License. Of course, the - commands you use may be called something other than `show w' and `show - c'; they could even be mouse-clicks or menu items--whatever suits your - program. - - You should also get your employer (if you work as a programmer) or - your school, if any, to sign a "copyright disclaimer" for the program, - if necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - SIGNATURE OF TY COON, 1 April 1989 - Ty Coon, President of Vice - - This General Public License does not permit incorporating your - program into proprietary programs. If your program is a subroutine - library, you may consider it more useful to permit linking proprietary - applications with the library. If this is what you want to do, use the - GNU Library General Public License instead of this License. - -  - File: gcj.info, Node: GNU Free Documentation License, Next: Invoking gcj, Prev: Copying, Up: Top - - GNU Free Documentation License - ****************************** - - Version 1.1, March 2000 - Copyright (C) 2000 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - 0. PREAMBLE - - The purpose of this License is to make a manual, textbook, or other - written document "free" in the sense of freedom: to assure everyone - the effective freedom to copy and redistribute it, with or without - modifying it, either commercially or noncommercially. Secondarily, - this License preserves for the author and publisher a way to get - credit for their work, while not being considered responsible for - modifications made by others. - - This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. - It complements the GNU General Public License, which is a copyleft - license designed for free software. - - We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a - free program should come with manuals providing the same freedoms - that the software does. But this License is not limited to - software manuals; it can be used for any textual work, regardless - of subject matter or whether it is published as a printed book. - We recommend this License principally for works whose purpose is - instruction or reference. - - 1. APPLICABILITY AND DEFINITIONS - - This License applies to any manual or other work that contains a - notice placed by the copyright holder saying it can be distributed - under the terms of this License. The "Document", below, refers to - any such manual or work. Any member of the public is a licensee, - and is addressed as "you". - - A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language. - - A "Secondary Section" is a named appendix or a front-matter - section of the Document that deals exclusively with the - relationship of the publishers or authors of the Document to the - Document's overall subject (or to related matters) and contains - nothing that could fall directly within that overall subject. - (For example, if the Document is in part a textbook of - mathematics, a Secondary Section may not explain any mathematics.) - The relationship could be a matter of historical connection with - the subject or with related matters, or of legal, commercial, - philosophical, ethical or political position regarding them. - - The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in - the notice that says that the Document is released under this - License. - - The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice - that says that the Document is released under this License. - - A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the - general public, whose contents can be viewed and edited directly - and straightforwardly with generic text editors or (for images - composed of pixels) generic paint programs or (for drawings) some - widely available drawing editor, and that is suitable for input to - text formatters or for automatic translation to a variety of - formats suitable for input to text formatters. A copy made in an - otherwise Transparent file format whose markup has been designed - to thwart or discourage subsequent modification by readers is not - Transparent. A copy that is not "Transparent" is called "Opaque". - - Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, - SGML or XML using a publicly available DTD, and - standard-conforming simple HTML designed for human modification. - Opaque formats include PostScript, PDF, proprietary formats that - can be read and edited only by proprietary word processors, SGML - or XML for which the DTD and/or processing tools are not generally - available, and the machine-generated HTML produced by some word - processors for output purposes only. - - The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the - material this License requires to appear in the title page. For - works in formats which do not have any title page as such, "Title - Page" means the text near the most prominent appearance of the - work's title, preceding the beginning of the body of the text. - - 2. VERBATIM COPYING - - You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License - applies to the Document are reproduced in all copies, and that you - add no other conditions whatsoever to those of this License. You - may not use technical measures to obstruct or control the reading - or further copying of the copies you make or distribute. However, - you may accept compensation in exchange for copies. If you - distribute a large enough number of copies you must also follow - the conditions in section 3. - - You may also lend copies, under the same conditions stated above, - and you may publicly display copies. - - 3. COPYING IN QUANTITY - - If you publish printed copies of the Document numbering more than - 100, and the Document's license notice requires Cover Texts, you - must enclose the copies in covers that carry, clearly and legibly, - all these Cover Texts: Front-Cover Texts on the front cover, and - Back-Cover Texts on the back cover. Both covers must also clearly - and legibly identify you as the publisher of these copies. The - front cover must present the full title with all words of the - title equally prominent and visible. You may add other material - on the covers in addition. Copying with changes limited to the - covers, as long as they preserve the title of the Document and - satisfy these conditions, can be treated as verbatim copying in - other respects. - - If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit - reasonably) on the actual cover, and continue the rest onto - adjacent pages. - - If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a - machine-readable Transparent copy along with each Opaque copy, or - state in or with each Opaque copy a publicly-accessible - computer-network location containing a complete Transparent copy - of the Document, free of added material, which the general - network-using public has access to download anonymously at no - charge using public-standard network protocols. If you use the - latter option, you must take reasonably prudent steps, when you - begin distribution of Opaque copies in quantity, to ensure that - this Transparent copy will remain thus accessible at the stated - location until at least one year after the last time you - distribute an Opaque copy (directly or through your agents or - retailers) of that edition to the public. - - It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of - copies, to give them a chance to provide you with an updated - version of the Document. - - 4. MODIFICATIONS - - You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you - release the Modified Version under precisely this License, with - the Modified Version filling the role of the Document, thus - licensing distribution and modification of the Modified Version to - whoever possesses a copy of it. In addition, you must do these - things in the Modified Version: - - A. Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of - previous versions (which should, if there were any, be listed - in the History section of the Document). You may use the - same title as a previous version if the original publisher of - that version gives permission. - - B. List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in - the Modified Version, together with at least five of the - principal authors of the Document (all of its principal - authors, if it has less than five). - - C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. - - D. Preserve all the copyright notices of the Document. - - E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. - - F. Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified - Version under the terms of this License, in the form shown in - the Addendum below. - - G. Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's - license notice. - - H. Include an unaltered copy of this License. - - I. Preserve the section entitled "History", and its title, and - add to it an item stating at least the title, year, new - authors, and publisher of the Modified Version as given on - the Title Page. If there is no section entitled "History" in - the Document, create one stating the title, year, authors, - and publisher of the Document as given on its Title Page, - then add an item describing the Modified Version as stated in - the previous sentence. - - J. Preserve the network location, if any, given in the Document - for public access to a Transparent copy of the Document, and - likewise the network locations given in the Document for - previous versions it was based on. These may be placed in - the "History" section. You may omit a network location for a - work that was published at least four years before the - Document itself, or if the original publisher of the version - it refers to gives permission. - - K. In any section entitled "Acknowledgments" or "Dedications", - preserve the section's title, and preserve in the section all - the substance and tone of each of the contributor - acknowledgments and/or dedications given therein. - - L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section - titles. - - M. Delete any section entitled "Endorsements". Such a section - may not be included in the Modified Version. - - N. Do not retitle any existing section as "Endorsements" or to - conflict in title with any Invariant Section. - - If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no - material copied from the Document, you may at your option - designate some or all of these sections as invariant. To do this, - add their titles to the list of Invariant Sections in the Modified - Version's license notice. These titles must be distinct from any - other section titles. - - You may add a section entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various - parties--for example, statements of peer review or that the text - has been approved by an organization as the authoritative - definition of a standard. - - You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end - of the list of Cover Texts in the Modified Version. Only one - passage of Front-Cover Text and one of Back-Cover Text may be - added by (or through arrangements made by) any one entity. If the - Document already includes a cover text for the same cover, - previously added by you or by arrangement made by the same entity - you are acting on behalf of, you may not add another; but you may - replace the old one, on explicit permission from the previous - publisher that added the old one. - - The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to - assert or imply endorsement of any Modified Version. - - 5. COMBINING DOCUMENTS - - You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for - modified versions, provided that you include in the combination - all of the Invariant Sections of all of the original documents, - unmodified, and list them all as Invariant Sections of your - combined work in its license notice. - - The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single - copy. If there are multiple Invariant Sections with the same name - but different contents, make the title of each such section unique - by adding at the end of it, in parentheses, the name of the - original author or publisher of that section if known, or else a - unique number. Make the same adjustment to the section titles in - the list of Invariant Sections in the license notice of the - combined work. - - In the combination, you must combine any sections entitled - "History" in the various original documents, forming one section - entitled "History"; likewise combine any sections entitled - "Acknowledgments", and any sections entitled "Dedications". You - must delete all sections entitled "Endorsements." - - 6. COLLECTIONS OF DOCUMENTS - - You may make a collection consisting of the Document and other - documents released under this License, and replace the individual - copies of this License in the various documents with a single copy - that is included in the collection, provided that you follow the - rules of this License for verbatim copying of each of the - documents in all other respects. - - You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert - a copy of this License into the extracted document, and follow - this License in all other respects regarding verbatim copying of - that document. - - 7. AGGREGATION WITH INDEPENDENT WORKS - - A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of - a storage or distribution medium, does not as a whole count as a - Modified Version of the Document, provided no compilation - copyright is claimed for the compilation. Such a compilation is - called an "aggregate", and this License does not apply to the - other self-contained works thus compiled with the Document, on - account of their being thus compiled, if they are not themselves - derivative works of the Document. - - If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one - quarter of the entire aggregate, the Document's Cover Texts may be - placed on covers that surround only the Document within the - aggregate. Otherwise they must appear on covers around the whole - aggregate. - - 8. TRANSLATION - - Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section - 4. Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include - translations of some or all Invariant Sections in addition to the - original versions of these Invariant Sections. You may include a - translation of this License provided that you also include the - original English version of this License. In case of a - disagreement between the translation and the original English - version of this License, the original English version will prevail. - - 9. TERMINATION - - You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. - - 10. FUTURE REVISIONS OF THIS LICENSE - - The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new - versions will be similar in spirit to the present version, but may - differ in detail to address new problems or concerns. See - `http://www.gnu.org/copyleft/'. - - Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered - version of this License "or any later version" applies to it, you - have the option of following the terms and conditions either of - that specified version or of any later version that has been - published (not as a draft) by the Free Software Foundation. If - the Document does not specify a version number of this License, - you may choose any version ever published (not as a draft) by the - Free Software Foundation. - - ADDENDUM: How to use this License for your documents - ==================================================== - - To use this License in a document you have written, include a copy of - the License in the document and put the following copyright and license - notices just after the title page: - - Copyright (C) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - A copy of the license is included in the section entitled ``GNU - Free Documentation License''. - - If you have no Invariant Sections, write "with no Invariant Sections" - instead of saying which ones are invariant. If you have no Front-Cover - Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being - LIST"; likewise for Back-Cover Texts. - - If your document contains nontrivial examples of program code, we - recommend releasing these examples in parallel under your choice of - free software license, such as the GNU General Public License, to - permit their use in free software. - -  - File: gcj.info, Node: Invoking gcj, Next: Compatibility, Prev: GNU Free Documentation License, Up: Top - - Invoking gcj - ************ - - As `gcj' is just another front end to `gcc', it supports many of the - same options as gcc. *Note Option Summary: (gcc)Option Summary. This - manual only documents the options specific to `gcj'. - - * Menu: - - * Input and output files:: - * Input Options:: How gcj finds files - * Encodings:: Options controlling source file encoding - * Warnings:: Options controlling warnings specific to gcj - * Code Generation:: Options controlling the output of gcj - * Configure-time Options:: Options you won't use - -  - File: gcj.info, Node: Input and output files, Next: Input Options, Up: Invoking gcj - - Input and output files - ====================== - - A `gcj' command is like a `gcc' command, in that it consists of a - number of options and file names. The following kinds of input file - names are supported: - - `FILE.java' - Java source files. - - `FILE.class' - Java bytecode files. - - `FILE.zip' - `FILE.jar' - An archive containing one or more `.class' files, all of which are - compiled. The archive may be compressed. - - `@FILE' - A file containing a whitespace-separated list of input file names. - (Currently, these must all be `.java' source files, but that may - change.) Each named file is compiled, just as if it had been on - the command line. - - `LIBRARY.a' - `LIBRARY.so' - `-lLIBNAME' - Libraries to use when linking. See the `gcc' manual. - - You can specify more than one input file on the `gcj' command line, - in which case they will all be compiled. If you specify a `-o FILENAME' - option, all the input files will be compiled together, producing a - single output file, named FILENAME. This is allowed even when using - `-S' or `-c', but not when using `-C' or `--resource'. (This is an - extension beyond the what plain `gcc' allows.) (If more than one input - file is specified, all must currently be `.java' files, though we hope - to fix this.) - -  - File: gcj.info, Node: Input Options, Next: Encodings, Prev: Input and output files, Up: Invoking gcj - - Input Options - ============= - - `gcj' has options to control where it looks to find files it needs. - For instance, `gcj' might need to load a class that is referenced by - the file it has been asked to compile. Like other compilers for the - Java language, `gcj' has a notion of a "class path". There are several - options and environment variables which can be used to manipulate the - class path. When `gcj' looks for a given class, it searches the class - path looking for matching `.class' or `.java' file. `gcj' comes with a - built-in class path which points at the installed `libgcj.jar', a file - which contains all the standard classes. - - In the below, a directory or path component can refer either to an - actual directory on the filesystem, or to a `.zip' or `.jar' file, - which `gcj' will search as if it is a directory. - - `-IDIR' - All directories specified by `-I' are kept in order and prepended - to the class path constructed from all the other options. Unless - compatibility with tools like `javac' is imported, we recommend - always using `-I' instead of the other options for manipulating the - class path. - - `--classpath=PATH' - This sets the class path to PATH, a colon-separated list of paths - (on Windows-based systems, a semicolon-separate list of paths). - This does not override the builtin ("boot") search path. - - `--CLASSPATH=PATH' - Deprecated synonym for `--classpath'. - - `--bootclasspath=PATH' - Where to find the standard builtin classes, such as - `java.lang.String'. - - `--extdirs=PATH' - For each directory in the PATH, place the contents of that - directory at the end of the class path. - - `CLASSPATH' - This is an environment variable which holds a list of paths. - - The final class path is constructed like so: - - * First come all directories specified via `-I'. - - * If `--classpath' is specified, its value is appended. Otherwise, - if the `CLASSPATH' environment variable is specified, then its - value is appended. Otherwise, the current directory (`"."') is - appended. - - * If `--bootclasspath' was specified, append its value. Otherwise, - append the built-in system directory, `libgcj.jar'. - - * Finaly, if `--extdirs' was specified, append the contents of the - specified directories at the end of the class path. Otherwise, - append the contents of the built-in extdirs at - `$(prefix)/share/java/ext'. - - The classfile built by `gcj' for the class `java.lang.Object' (and - placed in `libgcj.jar') contains a special zero length attribute - `gnu.gcj.gcj-compiled'. The compiler looks for this attribute when - loading `java.lang.Object' and will report an error if it isn't found, - unless it compiles to bytecode (the option - `-fforce-classes-archive-check' can be used to override this behavior - in this particular case.) - - `-fforce-classes-archive-check' - This forces the compiler to always check for the special zero - length attribute `gnu.gcj.gcj-compiled' in `java.lang.Object' and - issue an error if it isn't found. - -  - File: gcj.info, Node: Encodings, Next: Warnings, Prev: Input Options, Up: Invoking gcj - - Encodings - ========= - - The Java programming language uses Unicode throughout. In an effort - to integrate well with other locales, `gcj' allows `.java' files to be - written using almost any encoding. `gcj' knows how to convert these - encodings into its internal encoding at compile time. - - You can use the `--encoding=NAME' option to specify an encoding (of - a particular character set) to use for source files. If this is not - specified, the default encoding comes from your current locale. If - your host system has insufficient locale support, then `gcj' assumes - the default encoding to be the `UTF-8' encoding of Unicode. - - To implement `--encoding', `gcj' simply uses the host platform's - `iconv' conversion routine. This means that in practice `gcj' is - limited by the capabilities of the host platform. - - The names allowed for the argument `--encoding' vary from platform - to platform (since they are not standardized anywhere). However, `gcj' - implements the encoding named `UTF-8' internally, so if you choose to - use this for your source files you can be assured that it will work on - every host. - -  - File: gcj.info, Node: Warnings, Next: Code Generation, Prev: Encodings, Up: Invoking gcj - - Warnings - ======== - - `gcj' implements several warnings. As with other generic `gcc' - warnings, if an option of the form `-Wfoo' enables a warning, then - `-Wno-foo' will disable it. Here we've chosen to document the form of - the warning which will have an effect - the default being the opposite - of what is listed. - - `-Wredundant-modifiers' - With this flag, `gcj' will warn about redundant modifiers. For - instance, it will warn if an interface method is declared `public'. - - `-Wextraneous-semicolon' - This causes `gcj' to warn about empty statements. Empty statements - have been deprecated. - - `-Wno-out-of-date' - This option will cause `gcj' not to warn when a source file is - newer than its matching class file. By default `gcj' will warn - about this. - - `-Wunused' - This is the same as `gcc''s `-Wunused'. - - `-Wall' - This is the same as `-Wredundant-modifiers -Wextraneous-semicolon - -Wunused'. - --- 0 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/gcj.info-2 gcc-3.3/gcc/java/gcj.info-2 *** gcc-3.2.3/gcc/java/gcj.info-2 2003-04-22 07:07:25.000000000 +0000 --- gcc-3.3/gcc/java/gcj.info-2 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,1416 **** - This is gcj.info, produced by makeinfo version 4.5 from gcj.texi. - - INFO-DIR-SECTION Programming - START-INFO-DIR-ENTRY - * Gcj: (gcj). Ahead-of-time compiler for the Java language - END-INFO-DIR-ENTRY - - INFO-DIR-SECTION Individual utilities - START-INFO-DIR-ENTRY - * gcjh: (gcj)Invoking gcjh. - Generate header files from Java class files - * jv-scan: (gcj)Invoking jv-scan. - Print information about Java source files - * jcf-dump: (gcj)Invoking jcf-dump. - Print information about Java class files - * gij: (gcj)Invoking gij. GNU interpreter for Java bytecode - * jv-convert: (gcj)Invoking jv-convert. - Convert file from one encoding to another - * rmic: (gcj)Invoking rmic. - Generate stubs for Remote Method Invocation. - * rmiregistry: (gcj)Invoking rmiregistry. - The remote object registry. - END-INFO-DIR-ENTRY - - Copyright (C) 2001, 2002 Free Software Foundation, Inc. - - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 or - any later version published by the Free Software Foundation; with the - Invariant Sections being "GNU General Public License", the Front-Cover - texts being (a) (see below), and with the Back-Cover Texts being (b) - (see below). A copy of the license is included in the section entitled - "GNU Free Documentation License". - - (a) The FSF's Front-Cover Text is: - - A GNU Manual - - (b) The FSF's Back-Cover Text is: - - You have freedom to copy and modify this GNU Manual, like GNU - software. Copies published by the Free Software Foundation raise - funds for GNU development. - -  - File: gcj.info, Node: Code Generation, Next: Configure-time Options, Prev: Warnings, Up: Invoking gcj - - Code Generation - =============== - - In addition to the many `gcc' options controlling code generation, - `gcj' has several options specific to itself. - - `--main=CLASSNAME' - This option is used when linking to specify the name of the class - whose `main' method should be invoked when the resulting - executable is run. (1) - - `-DNAME[=VALUE]' - This option can only be used with `--main'. It defines a system - property named NAME with value VALUE. If VALUE is not specified - then it defaults to the empty string. These system properties are - initialized at the program's startup and can be retrieved at - runtime using the `java.lang.System.getProperty' method. - - `-C' - This option is used to tell `gcj' to generate bytecode (`.class' - files) rather than object code. - - `--resource RESOURCE-NAME' - This option is used to tell `gcj' to compile the contents of a - given file to object code so it may be accessed at runtime with - the core protocol handler as `core:/RESOURCE-NAME'. Note that - RESOURCE-NAME is the name of the resource as found at runtime; for - instance, it could be used in a call to `ResourceBundle.getBundle'. - The actual file name to be compiled this way must be specified - separately. - - `-d DIRECTORY' - When used with `-C', this causes all generated `.class' files to - be put in the appropriate subdirectory of DIRECTORY. By default - they will be put in subdirectories of the current working - directory. - - `-fno-bounds-check' - By default, `gcj' generates code which checks the bounds of all - array indexing operations. With this option, these checks are - omitted, which can improve performance for code that uses arrays - extensively. Note that this can result in unpredictable behavior - if the code in question actually does violate array bounds - constraints. It is safe to use this option if you are sure that - your code will never throw an `ArrayIndexOutOfBoundsException'. - - `-fno-store-check' - Don't generate array store checks. When storing objects into - arrays, a runtime check is normally generated in order to ensure - that the object is assignment compatible with the component type - of the array (which may not be known at compile-time). With this - option, these checks are omitted. This can improve performance - for code which stores objects into arrays frequently. It is safe - to use this option if you are sure your code will never throw an - `ArrayStoreException'. - - `-fjni' - With `gcj' there are two options for writing native methods: CNI - and JNI. By default `gcj' assumes you are using CNI. If you are - compiling a class with native methods, and these methods are - implemented using JNI, then you must use `-fjni'. This option - causes `gcj' to generate stubs which will invoke the underlying JNI - methods. - - `-fno-optimize-static-class-initialization' - When the optimization level is greather or equal to `-O2', `gcj' - will try to optimize the way calls into the runtime are made to - initialize static classes upon their first use (this optimization - isn't carried out if `-C' was specified.) When compiling to native - code, `-fno-optimize-static-class-initialization' will turn this - optimization off, regardless of the optimization level in use. - - ---------- Footnotes ---------- - - (1) The linker by default looks for a global function named `main'. - Since Java does not have global functions, and a collection of Java - classes may have more than one class with a `main' method, you need to - let the linker know which of those `main' methods it should invoke when - starting the application. - -  - File: gcj.info, Node: Configure-time Options, Prev: Code Generation, Up: Invoking gcj - - Configure-time Options - ====================== - - Some `gcj' code generations options affect the resulting ABI, and so - can only be meaningfully given when `libgcj', the runtime package, is - configured. `libgcj' puts the appropriate options from this group into - a `spec' file which is read by `gcj'. These options are listed here - for completeness; if you are using `libgcj' then you won't want to - touch these options. - - `-fuse-boehm-gc' - This enables the use of the Boehm GC bitmap marking code. In - particular this causes `gcj' to put an object marking descriptor - into each vtable. - - `-fhash-synchronization' - By default, synchronization data (the data used for `synchronize', - `wait', and `notify') is pointed to by a word in each object. - With this option `gcj' assumes that this information is stored in a - hash table and not in the object itself. - - `-fuse-divide-subroutine' - On some systems, a library routine is called to perform integer - division. This is required to get exception handling correct when - dividing by zero. - - `-fcheck-references' - On some systems it's necessary to insert inline checks whenever - accessing an object via a reference. On other systems you won't - need this because null pointer accesses are caught automatically - by the processor. - -  - File: gcj.info, Node: Compatibility, Next: Invoking gcjh, Prev: Invoking gcj, Up: Top - - Compatibility with the Java Platform - ************************************ - - As we believe it is important that the Java platform not be - fragmented, `gcj' and `libgcj' try to conform to the relevant Java - specifications. However, limited manpower and incomplete and unclear - documentation work against us. So, there are caveats to using `gcj'. - - This list of compatibility issues is by no means complete. - - * `gcj' implements the JDK 1.1 language. It supports inner classes, - though these are known to still be buggy. It does not yet support - the Java 2 `strictfp' keyword (it recognizes the keyword but - ignores it). - - * `libgcj' is largely compatible with the JDK 1.2 libraries. - However, `libgcj' is missing many packages, most notably - `java.awt'. There are also individual missing classes and methods. - We currently do not have a list showing differences between - `libgcj' and the Java 2 platform. - - * Sometimes the `libgcj' implementation of a method or class differs - from the JDK implementation. This is not always a bug. Still, if - it affects you, it probably makes sense to report it so that we - can discuss the appropriate response. - -  - File: gcj.info, Node: Invoking gcjh, Next: Invoking jv-scan, Prev: Compatibility, Up: Top - - Invoking gcjh - ************* - - The `gcjh' program is used to generate header files from class - files. It can generate both CNI and JNI header files, as well as stub - implementation files which can be used as a basis for implementing the - required native methods. - - `-stubs' - This causes `gcjh' to generate stub files instead of header files. - By default the stub file will be named after the class, with a - suffix of `.cc'. In JNI mode, the default output file will have - the suffix `.c'. - - `-jni' - This tells `gcjh' to generate a JNI header or stub. By default, - CNI headers are generated. - - `-add TEXT' - Inserts TEXT into the class body. This is ignored in JNI mode. - - `-append TEXT' - Inserts TEXT into the header file after the class declaration. - This is ignored in JNI mode. - - `-friend TEXT' - Inserts TEXT into the class as a `friend' declaration. This is - ignored in JNI mode. - - `-prepend TEXT' - Inserts TEXT into the header file before the class declaration. - This is ignored in JNI mode. - - `--classpath=PATH' - `--CLASSPATH=PATH' - `-IDIRECTORY' - `-d DIRECTORY' - `-o FILE' - These options are all identical to the corresponding `gcj' options. - - `-o FILE' - Sets the output file name. This cannot be used if there is more - than one class on the command line. - - `-td DIRECTORY' - Sets the name of the directory to use for temporary files. - - `-M' - Print all dependencies to stdout; suppress ordinary output. - - `-MM' - Print non-system dependencies to stdout; suppress ordinary output. - - `-MD' - Print all dependencies to stdout. - - `-MMD' - Print non-system dependencies to stdout. - - `--help' - Print help about `gcjh' and exit. No further processing is done. - - `--version' - Print version information for `gcjh' and exit. No further - processing is done. - - `-v, --verbose' - Print extra information while running. - - All remaining options are considered to be names of classes. - -  - File: gcj.info, Node: Invoking jv-scan, Next: Invoking jcf-dump, Prev: Invoking gcjh, Up: Top - - Invoking jv-scan - **************** - - The `jv-scan' program can be used to print information about a Java - source file (`.java' file). - - `--complexity' - This prints a complexity measure, related to cyclomatic - complexity, for each input file. - - `--encoding=NAME' - This works like the corresponding `gcj' option. - - `--print-main' - This prints the name of the class in this file containing a `main' - method. - - `--list-class' - This lists the names of all classes defined in the input files. - - `--list-filename' - If `--list-class' is given, this option causes `jv-scan' to also - print the name of the file in which each class was found. - - `-o FILE' - Print output to the named file. - - `--help' - Print help, then exit. - - `--version' - Print version number, then exit. - -  - File: gcj.info, Node: Invoking jcf-dump, Next: Invoking gij, Prev: Invoking jv-scan, Up: Top - - Invoking jcf-dump - ***************** - - This is a class file examiner, similar to `javap'. It will print - information about a number of classes, which are specifed by class name - or file name. - - `-c' - Disassemble method bodies. By default method bodies are not - printed. - - `--javap' - Generate output in `javap' format. The implementation of this - feature is very incomplete. - - `--classpath=PATH' - `--CLASSPATH=PATH' - `-IDIRECTORY' - `-o FILE' - These options as the same as the corresponding `gcj' options. - - `--help' - Print help, then exit. - - `--version' - Print version number, then exit. - - `-v, --verbose' - Print extra information while running. - -  - File: gcj.info, Node: Invoking gij, Next: Invoking jv-convert, Prev: Invoking jcf-dump, Up: Top - - Invoking gij - ************ - - `gij' is a Java bytecode interpreter included with `libgcj'. `gij' - is not available on every platform; porting it requires a small amount - of assembly programming which has not been done for all the targets - supported by `gcj'. - - The primary argument to `gij' is the name of a class or, with - `-jar', a jar file. Options before this argument are interpreted by - `gij'; remaining options are passed to the interpreted program. - - If a class name is specified and this class does not have a `main' - method with the appropriate signature (a `static void' method with a - `String[]' as its sole argument), then `gij' will print an error and - exit. - - If a jar file is specified then `gij' will use information in it to - determine which class' `main' method will be invoked. - - `gij' will invoke the `main' method with all the remaining - command-line options. - - Note that `gij' is not limited to interpreting code. Because - `libgcj' includes a class loader which can dynamically load shared - objects, it is possible to give `gij' the name of a class which has - been compiled and put into a shared library on the class path. - - `-DNAME[=VALUE]' - This defines a system property named NAME with value VALUE. If - VALUE is not specified then it defaults to the empty string. - These system properties are initialized at the program's startup - and can be retrieved at runtime using the - `java.lang.System.getProperty' method. - - `-ms=NUMBER' - This sets the initial heap size. - - `-mx=NUMBER' - This sets the maximum heap size. - - `-jar' - This indicates that the name passed to `gij' should be interpreted - as the name of a jar file, not a class. - - `--help' - Print help, then exit. - - `--version' - Print version number, then exit. - -  - File: gcj.info, Node: Invoking jv-convert, Next: Invoking rmic, Prev: Invoking gij, Up: Top - - Invoking jv-convert - ******************* - - `jv-convert' [`OPTION'] ... [INPUTFILE [OUTPUTFILE]] - - `jv-convert' is a utility included with `libgcj' which converts a - file from one encoding to another. It is similar to the Unix `iconv' - utility. - - The encodings supported by `jv-convert' are platform-dependent. - Currently there is no way to get a list of all supported encodings. - - `--encoding NAME' - `--from NAME' - Use NAME as the input encoding. The default is the current - locale's encoding. - - `--to NAME' - Use NAME as the output encoding. The default is the `JavaSrc' - encoding; this is ASCII with `\u' escapes for non-ASCII characters. - - `-i FILE' - Read from FILE. The default is to read from standard input. - - `-o FILE' - Write to FILE. The default is to write to standard output. - - `--reverse' - Swap the input and output encodings. - - `--help' - Print a help message, then exit. - - `--version' - Print version information, then exit. - -  - File: gcj.info, Node: Invoking rmic, Next: Invoking rmiregistry, Prev: Invoking jv-convert, Up: Top - - Invoking rmic - ************* - - `rmic' [`OPTION'] ... CLASS ... - - `rmic' is a utility included with `libgcj' which generates stubs for - remote objects. - - Note that this program isn't yet fully compatible with the JDK - `rmic'. Some options, such as `-classpath', are recognized but - currently ignored. We have left these options undocumented for now. - - Long options can also be given with a GNU-style leading `--'. For - instance, `--help' is accepted. - - `-keep' - `-keepgenerated' - By default, `rmic' deletes intermediate files. Either of these - options causes it not to delete such files. - - `-v1.1' - Cause `rmic' to create stubs and skeletons for the 1.1 protocol - version. - - `-vcompat' - Cause `rmic' to create stubs and skeletons compatible with both - the 1.1 and 1.2 protocol versions. This is the default. - - `-v1.2' - Cause `rmic' to create stubs and skeletons for the 1.2 protocol - version. - - `-nocompile' - Don't compile the generated files. - - `-verbose' - Print information about what `rmic' is doing. - - `-d DIRECTORY' - Put output files in DIRECTORY. By default the files are put in - the current working directory. - - `-help' - Print a help message, then exit. - - `-version' - Print version information, then exit. - -  - File: gcj.info, Node: Invoking rmiregistry, Next: About CNI, Prev: Invoking rmic, Up: Top - - Invoking rmiregistry - ******************** - - `rmiregistry' [`OPTION'] ... [PORT] - - `rmiregistry' starts a remote object registry on the current host. - If no port number is specified, then port 1099 is used. - - `--help' - Print a help message, then exit. - - `--version' - Print version information, then exit. - -  - File: gcj.info, Node: About CNI, Next: Resources, Prev: Invoking rmiregistry, Up: Top - - About CNI - ********* - - This documents CNI, the Cygnus Native Interface, which is is a - convenient way to write Java native methods using C++. This is a more - efficient, more convenient, but less portable alternative to the - standard JNI (Java Native Interface). - - * Menu: - - * Basic concepts:: Introduction to using CNI. - * Packages:: How packages are mapped to C++. - * Primitive types:: Handling Java types in C++. - * Interfaces:: How Java interfaces map to C++. - * Objects and Classes:: C++ and Java classes. - * Class Initialization:: How objects are initialized. - * Object allocation:: How to create Java objects in C++. - * Arrays:: Dealing with Java arrays in C++. - * Methods:: Java methods in C++. - * Strings:: Information about Java Strings. - * Mixing with C++:: How CNI can interoperate with C++. - * Exception Handling:: How exceptions are handled. - * Synchronization:: Synchronizing between Java and C++. - * Invocation:: Starting the Java runtime from C++. - * Reflection:: Using reflection from C++. - -  - File: gcj.info, Node: Basic concepts, Next: Packages, Up: About CNI - - Basic concepts - ============== - - In terms of languages features, Java is mostly a subset of C++. - Java has a few important extensions, plus a powerful standard class - library, but on the whole that does not change the basic similarity. - Java is a hybrid object-oriented language, with a few native types, in - addition to class types. It is class-based, where a class may have - static as well as per-object fields, and static as well as instance - methods. Non-static methods may be virtual, and may be overloaded. - Overloading is resolved at compile time by matching the actual argument - types against the parameter types. Virtual methods are implemented - using indirect calls through a dispatch table (virtual function table). - Objects are allocated on the heap, and initialized using a constructor - method. Classes are organized in a package hierarchy. - - All of the listed attributes are also true of C++, though C++ has - extra features (for example in C++ objects may be allocated not just on - the heap, but also statically or in a local stack frame). Because - `gcj' uses the same compiler technology as G++ (the GNU C++ compiler), - it is possible to make the intersection of the two languages use the - same ABI (object representation and calling conventions). The key idea - in CNI is that Java objects are C++ objects, and all Java classes are - C++ classes (but not the other way around). So the most important task - in integrating Java and C++ is to remove gratuitous incompatibilities. - - You write CNI code as a regular C++ source file. (You do have to use - a Java/CNI-aware C++ compiler, specifically a recent version of G++.) - - A CNI C++ source file must have: - - #include - - and then must include one header file for each Java class it uses, e.g.: - - #include - #include - #include - - These header files are automatically generated by `gcjh'. - - CNI provides some functions and macros to make using Java objects and - primitive types from C++ easier. In general, these CNI functions and - macros start with the `Jv' prefix, for example the function - `JvNewObjectArray'. This convention is used to avoid conflicts with - other libraries. Internal functions in CNI start with the prefix - `_Jv_'. You should not call these; if you find a need to, let us know - and we will try to come up with an alternate solution. (This manual - lists `_Jv_AllocBytes' as an example; CNI should instead provide a - `JvAllocBytes' function.) - - Limitations - ----------- - - Whilst a Java class is just a C++ class that doesn't mean that you - are freed from the shackles of Java, a CNI C++ class must adhere to the - rules of the Java programming language. - - For example: it is not possible to declare a method in a CNI class - that will take a C string (`char*') as an argument, or to declare a - member variable of some non-Java datatype. - -  - File: gcj.info, Node: Packages, Next: Primitive types, Prev: Basic concepts, Up: About CNI - - Packages - ======== - - The only global names in Java are class names, and packages. A - "package" can contain zero or more classes, and also zero or more - sub-packages. Every class belongs to either an unnamed package or a - package that has a hierarchical and globally unique name. - - A Java package is mapped to a C++ "namespace". The Java class - `java.lang.String' is in the package `java.lang', which is a - sub-package of `java'. The C++ equivalent is the class - `java::lang::String', which is in the namespace `java::lang' which is - in the namespace `java'. - - Here is how you could express this: - - (// Declare the class(es), possibly in a header file: - namespace java { - namespace lang { - class Object; - class String; - ... - } - } - - class java::lang::String : public java::lang::Object - { - ... - }; - - The `gcjh' tool automatically generates the nessary namespace - declarations. - - Leaving out package names - ------------------------- - - Always using the fully-qualified name of a java class can be - tiresomely verbose. Using the full qualified name also ties the code - to a single package making code changes necessary should the class move - from one package to another. The Java `package' declaration specifies - that the following class declarations are in the named package, without - having to explicitly name the full package qualifiers. The `package' - declaration can be followed by zero or more `import' declarations, which - allows either a single class or all the classes in a package to be - named by a simple identifier. C++ provides something similar with the - `using' declaration and directive. - - In Java: - - import PACKAGE-NAME.CLASS-NAME; - - allows the program text to refer to CLASS-NAME as a shorthand for the - fully qualified name: `PACKAGE-NAME.CLASS-NAME'. - - To achieve the same effect C++, you have to do this: - - using PACKAGE-NAME::CLASS-NAME; - - Java can also cause imports on demand, like this: - - import PACKAGE-NAME.*; - - Doing this allows any class from the package PACKAGE-NAME to be refered - to only by its class-name within the program text. - - The same effect can be achieved in C++ like this: - - using namespace PACKAGE-NAME; - -  - File: gcj.info, Node: Primitive types, Next: Interfaces, Prev: Packages, Up: About CNI - - Primitive types - =============== - - Java provides 8 "primitives" types which represent integers, floats, - characters and booleans (and also the void type). C++ has its own very - similar concrete types. Such types in C++ however are not always - implemented in the same way (an int might be 16, 32 or 64 bits for - example) so CNI provides a special C++ type for each primitive Java - type: - - *Java type* *C/C++ typename* *Description* - `char' `jchar' 16 bit Unicode character - `boolean' `jboolean' logical (true or false) values - `byte' `jbyte' 8-bit signed integer - `short' `jshort' 16 bit signed integer - `int' `jint' 32 bit signed integer - `long' `jlong' 64 bit signed integer - `float' `jfloat' 32 bit IEEE floating point number - `double' `jdouble' 64 bit IEEE floating point number - `void' `void' no value - - When refering to a Java type You should always use these C++ - typenames (e.g.: `jint') to avoid disappointment. - - Reference types associated with primitive types - ----------------------------------------------- - - In Java each primitive type has an associated reference type, e.g.: - `boolean' has an associated `java.lang.Boolean' class. In order to - make working with such classes easier GCJ provides the macro - `JvPrimClass': - - - macro: JvPrimClass type - Return a pointer to the `Class' object corresponding to the type - supplied. - - JvPrimClass(void) => java.lang.Void.TYPE - - -  - File: gcj.info, Node: Interfaces, Next: Objects and Classes, Prev: Primitive types, Up: About CNI - - Interfaces - ========== - - A Java class can "implement" zero or more "interfaces", in addition - to inheriting from a single base class. - - CNI allows CNI code to implement methods of interfaces. You can - also call methods through interface references, with some limitations. - - CNI doesn't understand interface inheritance at all yet. So, you - can only call an interface method when the declared type of the field - being called matches the interface which declares that method. The - workaround is to cast the interface reference to the right - superinterface. - - For example if you have: - - interface A - { - void a(); - } - - interface B extends A - { - void b(); - } - - and declare a variable of type `B' in C++, you can't call `a()' - unless you cast it to an `A' first. - -  - File: gcj.info, Node: Objects and Classes, Next: Class Initialization, Prev: Interfaces, Up: About CNI - - Objects and Classes - =================== - - Classes - ------- - - All Java classes are derived from `java.lang.Object'. C++ does not - have a unique root class, but we use the C++ class `java::lang::Object' - as the C++ version of the `java.lang.Object' Java class. All other - Java classes are mapped into corresponding C++ classes derived from - `java::lang::Object'. - - Interface inheritance (the `implements' keyword) is currently not - reflected in the C++ mapping. - - Object fields - ------------- - - Each object contains an object header, followed by the instance - fields of the class, in order. The object header consists of a single - pointer to a dispatch or virtual function table. (There may be extra - fields _in front of_ the object, for example for memory management, but - this is invisible to the application, and the reference to the object - points to the dispatch table pointer.) - - The fields are laid out in the same order, alignment, and size as in - C++. Specifically, 8-bite and 16-bit native types (`byte', `short', - `char', and `boolean') are _not_ widened to 32 bits. Note that the - Java VM does extend 8-bit and 16-bit types to 32 bits when on the VM - stack or temporary registers. - - If you include the `gcjh'-generated header for a class, you can - access fields of Java classes in the _natural_ way. For example, given - the following Java class: - - public class Int - { - public int i; - public Integer (int i) { this.i = i; } - public static zero = new Integer(0); - } - - you can write: - - #include ; - #include ; - - Int* - mult (Int *p, jint k) - { - if (k == 0) - return Int::zero; // Static member access. - return new Int(p->i * k); - } - - Access specifiers - ----------------- - - CNI does not strictly enforce the Java access specifiers, because - Java permissions cannot be directly mapped into C++ permission. - Private Java fields and methods are mapped to private C++ fields and - methods, but other fields and methods are mapped to public fields and - methods. - -  - File: gcj.info, Node: Class Initialization, Next: Object allocation, Prev: Objects and Classes, Up: About CNI - - Class Initialization - ==================== - - Java requires that each class be automatically initialized at the - time of the first active use. Initializing a class involves - initializing the static fields, running code in class initializer - methods, and initializing base classes. There may also be some - implementation specific actions, such as allocating `String' objects - corresponding to string literals in the code. - - The GCJ compiler inserts calls to `JvInitClass' at appropriate - places to ensure that a class is initialized when required. The C++ - compiler does not insert these calls automatically--it is the - programmer's responsibility to make sure classes are initialized. - However, this is fairly painless because of the conventions assumed by - the Java system. - - First, `libgcj' will make sure a class is initialized before an - instance of that object is created. This is one of the - responsibilities of the `new' operation. This is taken care of both in - Java code, and in C++ code. (When the G++ compiler sees a `new' of a - Java class, it will call a routine in `libgcj' to allocate the object, - and that routine will take care of initializing the class.) It follows - that you can access an instance field, or call an instance (non-static) - method and be safe in the knowledge that the class and all of its base - classes have been initialized. - - Invoking a static method is also safe. This is because the Java - compiler adds code to the start of a static method to make sure the - class is initialized. However, the C++ compiler does not add this - extra code. Hence, if you write a native static method using CNI, you - are responsible for calling `JvInitClass' before doing anything else in - the method (unless you are sure it is safe to leave it out). - - Accessing a static field also requires the class of the field to be - initialized. The Java compiler will generate code to call - `Jv_InitClass' before getting or setting the field. However, the C++ - compiler will not generate this extra code, so it is your - responsibility to make sure the class is initialized before you access - a static field from C++. - -  - File: gcj.info, Node: Object allocation, Next: Arrays, Prev: Class Initialization, Up: About CNI - - Object allocation - ================= - - New Java objects are allocated using a "class instance creation - expression", e.g.: - - new TYPE ( ... ) - - The same syntax is used in C++. The main difference is that C++ - objects have to be explicitly deleted; in Java they are automatically - deleted by the garbage collector. Using CNI, you can allocate a new - Java object using standard C++ syntax and the C++ compiler will allocate - memory from the garbage collector. If you have overloaded - constructors, the compiler will choose the correct one using standard - C++ overload resolution rules. - - For example: - - java::util::Hashtable *ht = new java::util::Hashtable(120); - - - Function: void* _Jv_AllocBytes (jsize SIZE) - Allocates SIZE bytes from the heap. The memory is not scanned by - the garbage collector but it freed if no references to it are - discovered. - -  - File: gcj.info, Node: Arrays, Next: Methods, Prev: Object allocation, Up: About CNI - - Arrays - ====== - - While in many ways Java is similar to C and C++, it is quite - different in its treatment of arrays. C arrays are based on the idea - of pointer arithmetic, which would be incompatible with Java's security - requirements. Java arrays are true objects (array types inherit from - `java.lang.Object'). An array-valued variable is one that contains a - reference (pointer) to an array object. - - Referencing a Java array in C++ code is done using the `JArray' - template, which as defined as follows: - - class __JArray : public java::lang::Object - { - public: - int length; - }; - - template - class JArray : public __JArray - { - T data[0]; - public: - T& operator[](jint i) { return data[i]; } - }; - - There are a number of `typedef's which correspond to `typedef's from - the JNI. Each is the type of an array holding objects of the relevant - type: - - typedef __JArray *jarray; - typedef JArray *jobjectArray; - typedef JArray *jbooleanArray; - typedef JArray *jbyteArray; - typedef JArray *jcharArray; - typedef JArray *jshortArray; - typedef JArray *jintArray; - typedef JArray *jlongArray; - typedef JArray *jfloatArray; - typedef JArray *jdoubleArray; - - - Method on template: T* elements (JArray ARRAY) - This template function can be used to get a pointer to the - elements of the `array'. For instance, you can fetch a pointer to - the integers that make up an `int[]' like so: - - extern jintArray foo; - jint *intp = elements (foo); - - The name of this function may change in the future. - - - Function: jobjectArray JvNewObjectArray (jsize LENGTH, jclass KLASS, - jobject INIT) - Here `klass' is the type of elements of the array and `init' is - the initial value put into every slot in the array. - - Creating arrays - --------------- - - For each primitive type there is a function which can be used to - create a new array of that type. The name of the function is of the - form: - - JvNewTYPEArray - - For example: - - JvNewBooleanArray - - can be used to create an array of Java primitive boolean types. - - The following function definition is the template for all such - functions: - - - Function: jbooleanArray JvNewBooleanArray (jint LENGTH) - Create's an array LENGTH indices long. - - - Function: jsize JvGetArrayLength (jarray ARRAY) - Returns the length of the ARRAY. - -  - File: gcj.info, Node: Methods, Next: Strings, Prev: Arrays, Up: About CNI - - Methods - ======= - - Java methods are mapped directly into C++ methods. The header files - generated by `gcjh' include the appropriate method definitions. - Basically, the generated methods have the same names and - _corresponding_ types as the Java methods, and are called in the - natural manner. - - Overloading - ----------- - - Both Java and C++ provide method overloading, where multiple methods - in a class have the same name, and the correct one is chosen (at - compile time) depending on the argument types. The rules for choosing - the correct method are (as expected) more complicated in C++ than in - Java, but given a set of overloaded methods generated by `gcjh' the C++ - compiler will choose the expected one. - - Common assemblers and linkers are not aware of C++ overloading, so - the standard implementation strategy is to encode the parameter types - of a method into its assembly-level name. This encoding is called - "mangling", and the encoded name is the "mangled name". The same - mechanism is used to implement Java overloading. For C++/Java - interoperability, it is important that both the Java and C++ compilers - use the _same_ encoding scheme. - - Static methods - -------------- - - Static Java methods are invoked in CNI using the standard C++ - syntax, using the `::' operator rather than the `.' operator. - - For example: - - jint i = java::lang::Math::round((jfloat) 2.3); - - C++ method definition syntax is used to define a static native method. - For example: - - #include - java::lang::Integer* - java::lang::Integer::getInteger(jstring str) - { - ... - } - - Object Constructors - ------------------- - - Constructors are called implicitly as part of object allocation - using the `new' operator. - - For example: - - java::lang::Integer *x = new java::lang::Integer(234); - - Java does not allow a constructor to be a native method. This - limitation can be coded round however because a constructor can _call_ - a native method. - - Instance methods - ---------------- - - Calling a Java instance method from a C++ CNI method is done using - the standard C++ syntax, e.g.: - - // First create the Java object. - java::lang::Integer *x = new java::lang::Integer(234); - // Now call a method. - jint prim_value = x->intValue(); - if (x->longValue == 0) - ... - - Defining a Java native instance method is also done the natural way: - - #include - - jdouble - java::lang:Integer::doubleValue() - { - return (jdouble) value; - } - - Interface methods - ----------------- - - In Java you can call a method using an interface reference. This is - supported, but not completly. *Note Interfaces::. - -  - File: gcj.info, Node: Strings, Next: Mixing with C++, Prev: Methods, Up: About CNI - - Strings - ======= - - CNI provides a number of utility functions for working with Java - Java `String' objects. The names and interfaces are analogous to those - of JNI. - - - Function: jstring JvNewString (const char* CHARS, jsize LEN) - Returns a Java `String' object with characters from the C string - CHARS up to the index LEN in that array. - - - Function: jstring JvNewStringLatin1 (const char* BYTES, jsize LEN) - Returns a Java `String' made up of LEN bytes from BYTES. - - - Function: jstring JvNewStringLatin1 (const char* BYTES) - As above but the length of the `String' is `strlen(BYTES)'. - - - Function: jstring JvNewStringUTF (const char* BYTES) - Returns a `String' which is made up of the UTF encoded characters - present in the C string BYTES. - - - Function: jchar* JvGetStringChars (jstring STR) - Returns a pointer to an array of characters making up the `String' - STR. - - - Function: int JvGetStringUTFLength (jstring STR) - Returns the number of bytes required to encode the contents of the - `String' STR in UTF-8. - - - Function: jsize JvGetStringUTFRegion (jstring STR, jsize START, - jsize LEN, char* BUF) - Puts the UTF-8 encoding of a region of the `String' STR into the - buffer `buf'. The region to fetch is marked by START and LEN. - - Note that BUF is a buffer, not a C string. It is _not_ null - terminated. - -  - File: gcj.info, Node: Mixing with C++, Next: Exception Handling, Prev: Strings, Up: About CNI - - Interoperating with C/C++ - ========================= - - Because CNI is designed to represent Java classes and methods it - cannot be mixed readily with C/C++ types. - - One important restriction is that Java classes cannot have non-Java - type instance or static variables and cannot have methods which take - non-Java types as arguments or return non-Java types. - - None of the following is possible with CNI: - - - class ::MyClass : public java::lang::Object - { - char* variable; // char* is not a valid Java type. - } - - - uint - ::SomeClass::someMethod (char *arg) - { - . - . - . - } // `uint' is not a valid Java type, neither is `char*' - - Of course, it is ok to use C/C++ types within the scope of a method: - - jint - ::SomeClass::otherMethod (jstring str) - { - char *arg = ... - . - . - . - } - - But this restriction can cause a problem so CNI includes the - `gnu.gcj.RawData' class. The `RawData' class is a "non-scanned - reference" type. In other words variables declared of type `RawData' - can contain any data and are not checked by the compiler in any way. - - This means that you can put C/C++ data structures (including classes) - in your CNI classes, as long as you use the appropriate cast. - - Here are some examples: - - - class ::MyClass : public java::lang::Object - { - gnu.gcj.RawData string; - - MyClass (); - gnu.gcj.RawData getText (); - void printText (); - } - - ::MyClass::MyClass () - { - char* text = ... - string = text; - } - - gnu.gcj.RawData - ::MyClass::getText () - { - return string; - } - - void - ::MyClass::printText () - { - printf("%s\n", (char*) string); - } - -  - File: gcj.info, Node: Exception Handling, Next: Synchronization, Prev: Mixing with C++, Up: About CNI - - Exception Handling - ================== - - While C++ and Java share a common exception handling framework, - things are not yet perfectly integrated. The main issue is that the - run-time type information facilities of the two languages are not - integrated. - - Still, things work fairly well. You can throw a Java exception from - C++ using the ordinary `throw' construct, and this exception can be - caught by Java code. Similarly, you can catch an exception thrown from - Java using the C++ `catch' construct. - - Here is an example: - - if (i >= count) - throw new java::lang::IndexOutOfBoundsException(); - - Normally, G++ will automatically detect when you are writing C++ - code that uses Java exceptions, and handle them appropriately. - However, if C++ code only needs to execute destructors when Java - exceptions are thrown through it, GCC will guess incorrectly. Sample - problematic code: - - struct S { ~S(); }; - - extern void bar(); // Is implemented in Java and may throw exceptions. - - void foo() - { - S s; - bar(); - } - - The usual effect of an incorrect guess is a link failure, - complaining of a missing routine called `__gxx_personality_v0'. - - You can inform the compiler that Java exceptions are to be used in a - translation unit, irrespective of what it might think, by writing - `#pragma GCC java_exceptions' at the head of the file. This `#pragma' - must appear before any functions that throw or catch exceptions, or run - destructors when exceptions are thrown through them. - -  - File: gcj.info, Node: Synchronization, Next: Invocation, Prev: Exception Handling, Up: About CNI - - Synchronization - =============== - - Each Java object has an implicit monitor. The Java VM uses the - instruction `monitorenter' to acquire and lock a monitor, and - `monitorexit' to release it. - - The corresponding CNI macros are `JvMonitorEnter' and - `JvMonitorExit' (JNI has similar methods `MonitorEnter' and - `MonitorExit'). - - The Java source language does not provide direct access to these - primitives. Instead, there is a `synchronized' statement that does an - implicit `monitorenter' before entry to the block, and does a - `monitorexit' on exit from the block. Note that the lock has to be - released even when the block is abnormally terminated by an exception, - which means there is an implicit `try finally' surrounding - synchronization locks. - - From C++, it makes sense to use a destructor to release a lock. CNI - defines the following utility class: - - class JvSynchronize() { - jobject obj; - JvSynchronize(jobject o) { obj = o; JvMonitorEnter(o); } - ~JvSynchronize() { JvMonitorExit(obj); } - }; - - So this Java code: - - synchronized (OBJ) - { - CODE - } - - might become this C++ code: - - { - JvSynchronize dummy (OBJ); - CODE; - } - - Java also has methods with the `synchronized' attribute. This is - equivalent to wrapping the entire method body in a `synchronized' - statement. (Alternatively, an implementation could require the caller - to do the synchronization. This is not practical for a compiler, - because each virtual method call would have to test at run-time if - synchronization is needed.) Since in `gcj' the `synchronized' - attribute is handled by the method implementation, it is up to the - programmer of a synchronized native method to handle the synchronization - (in the C++ implementation of the method). In otherwords, you need to - manually add `JvSynchronize' in a `native synchornized' method. - -  - File: gcj.info, Node: Invocation, Next: Reflection, Prev: Synchronization, Up: About CNI - - Invocation - ========== - - CNI permits C++ applications to make calls into Java classes, in - addition to allowing Java code to call into C++. Several functions, - known as the "invocation API", are provided to support this. - - - Function: jint JvCreateJavaVM (void* VM_ARGS) - Initializes the Java runtime. This function performs essential - initialization of the threads interface, garbage collector, - exception handling and other key aspects of the runtime. It must - be called once by an application with a non-Java `main()' - function, before any other Java or CNI calls are made. It is - safe, but not recommended, to call `JvCreateJavaVM()' more than - once provided it is only called from a single thread. The VMARGS - parameter can be used to specify initialization parameters for the - Java runtime. It may be `NULL'. This function returns `0' upon - success, or `-1' if the runtime is already initialized. - - _Note:_ In GCJ 3.1, the `vm_args' parameter is ignored. It may be - used in a future release. - - - Function: java::lang::Thread* JvAttachCurrentThread (jstring NAME, - java::lang::ThreadGroup* GROUP) - Registers an existing thread with the Java runtime. This must be - called once from each thread, before that thread makes any other - Java or CNI calls. It must be called after `JvCreateJavaVM'. NAME - specifies a name for the thread. It may be `NULL', in which case a - name will be generated. GROUP is the ThreadGroup in which this - thread will be a member. If it is `NULL', the thread will be a - member of the main thread group. The return value is the Java - `Thread' object that represents the thread. It is safe to call - `JvAttachCurrentThread()' more than once from the same thread. If - the thread is already attached, the call is ignored and the current - thread object is returned. - - - Function: jint JvDetachCurrentThread () - Unregisters a thread from the Java runtime. This should be called - by threads that were attached using `JvAttachCurrentThread()', - after they have finished making calls to Java code. This ensures - that any resources associated with the thread become eligible for - garbage collection. This function returns `0' upon success, or - `-1' if the current thread is not attached. - - Handling uncaught exceptions - ---------------------------- - - If an exception is thrown from Java code called using the invocation - API, and no handler for the exception can be found, the runtime will - abort the application. In order to make the application more robust, it - is recommended that code which uses the invocation API be wrapped by a - top-level try/catch block that catches all Java exceptions. - - Example - ------- - - The following code demonstrates the use of the invocation API. In - this example, the C++ application initializes the Java runtime and - attaches itself. The `java.lang.System' class is initialized in order to - access its `out' field, and a Java string is printed. Finally, the - thread is detached from the runtime once it has finished making Java - calls. Everything is wrapped with a try/catch block to provide a - default handler for any uncaught exceptions. - - The example can be compiled with `c++ test.cc -lgcj'. - - // test.cc - #include - #include - #include - #include - - int main(int argc, char *argv) - { - using namespace java::lang; - - try - { - JvCreateJavaVM(NULL); - JvAttachCurrentThread(NULL, NULL); - - String *message = JvNewStringLatin1("Hello from C++"); - JvInitClass(&System.class$); - System::out->println(message); - - JvDetachCurrentThread(); - } - catch (Throwable *t) - { - System::err->println(JvNewStringLatin1("Unhandled Java exception:")); - t->printStackTrace(); - } - } - -  - File: gcj.info, Node: Reflection, Prev: Invocation, Up: About CNI - - Reflection - ========== - - Reflection is possible with CNI code, it functions similarly to how - it functions with JNI. - - The types `jfieldID' and `jmethodID' are as in JNI. - - The functions: - - * `JvFromReflectedField', - - * `JvFromReflectedMethod', - - * `JvToReflectedField' - - * `JvToFromReflectedMethod' - - will be added shortly, as will other functions corresponding to JNI. - -  - File: gcj.info, Node: Resources, Prev: About CNI, Up: Top - - Resources - ********* - - While writing `gcj' and `libgcj' we have, of course, relied heavily - on documentation from Sun Microsystems. In particular we have used The - Java Language Specification (both first and second editions), the Java - Class Libraries (volumes one and two), and the Java Virtual Machine - Specification. In addition we've used the online documentation at - `http://java.sun.com/'. - - The current `gcj' home page is `http://gcc.gnu.org/java/'. - - For more information on gcc, see `http://gcc.gnu.org/'. - - Some `libgcj' testing is done using the Mauve test suite. This is a - free software Java class library test suite which is being written - because the JCK is not free. See `http://sources.redhat.com/mauve/' - for more information. - - --- 0 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/gcj.texi gcc-3.3/gcc/java/gcj.texi *** gcc-3.2.3/gcc/java/gcj.texi 2003-02-05 05:09:15.000000000 +0000 --- gcc-3.3/gcc/java/gcj.texi 2003-03-30 17:01:58.000000000 +0000 *************** *** 1,7 **** ! @\input texinfo @c -*-texinfo-*- @setfilename gcj.info @settitle Guide to GNU gcj @c Note: When reading this manual you'll find lots of strange @c circumlocutions like ``compiler for the Java language''. @c This is necessary due to Sun's restrictions on the use of --- 1,9 ---- ! \input texinfo @c -*-texinfo-*- @setfilename gcj.info @settitle Guide to GNU gcj + @include gcc-common.texi + @c Note: When reading this manual you'll find lots of strange @c circumlocutions like ``compiler for the Java language''. @c This is necessary due to Sun's restrictions on the use of *************** *** 11,22 **** @set copyrights-gcj 2001, 2002 @c Versions ! @set version-gcc 3.2.3 ! @set which-gcj GCC-@value{version-gcc} ! @macro gcctabopt{body} ! @code{\body\} ! @end macro @ifinfo @format --- 13,52 ---- @set copyrights-gcj 2001, 2002 @c Versions ! @set which-gcj GCC-@value{version-GCC} ! @copying ! @c man begin COPYRIGHT ! Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc. ! ! Permission is granted to copy, distribute and/or modify this document ! under the terms of the GNU Free Documentation License, Version 1.2 or ! any later version published by the Free Software Foundation; with the ! Invariant Sections being ``GNU General Public License'', the Front-Cover ! texts being (a) (see below), and with the Back-Cover Texts being (b) ! (see below). A copy of the license is included in the ! @c man end ! section entitled ! ``GNU Free Documentation License''. ! @ignore ! @c man begin COPYRIGHT ! man page gfdl(7). ! @c man end ! @end ignore ! ! @c man begin COPYRIGHT ! ! (a) The FSF's Front-Cover Text is: ! ! A GNU Manual ! ! (b) The FSF's Back-Cover Text is: ! ! You have freedom to copy and modify this GNU Manual, like GNU ! software. Copies published by the Free Software Foundation raise ! funds for GNU development. ! @c man end ! @end copying @ifinfo @format *************** *** 43,75 **** @end direntry @end format ! @c man begin COPYRIGHT ! Copyright (C) @value{copyrights-gcj} Free Software Foundation, Inc. ! ! Permission is granted to copy, distribute and/or modify this document ! under the terms of the GNU Free Documentation License, Version 1.1 or ! any later version published by the Free Software Foundation; with the ! Invariant Sections being ``GNU General Public License'', the Front-Cover ! texts being (a) (see below), and with the Back-Cover Texts being (b) ! (see below). A copy of the license is included in the ! @c man end ! section entitled ! ``GNU Free Documentation License''. ! @ignore ! @c man begin COPYRIGHT ! man page gfdl(7). ! @c man end ! @end ignore ! ! (a) The FSF's Front-Cover Text is: ! ! A GNU Manual ! ! (b) The FSF's Back-Cover Text is: ! ! You have freedom to copy and modify this GNU Manual, like GNU ! software. Copies published by the Free Software Foundation raise ! funds for GNU development. @end ifinfo @titlepage --- 73,79 ---- @end direntry @end format ! @insertcopying @end ifinfo @titlepage *************** man page gfdl(7). *** 78,108 **** @page @vskip 0pt plus 1filll - Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc. - @sp 2 For the @value{which-gcj} Version* @sp 1 Published by the Free Software Foundation @* 59 Temple Place - Suite 330@* Boston, MA 02111-1307, USA@* @sp 1 ! Permission is granted to copy, distribute and/or modify this document ! under the terms of the GNU Free Documentation License, Version 1.1 or ! any later version published by the Free Software Foundation; with the ! Invariant Sections being ``GNU General Public License'', the Front-Cover ! texts being (a) (see below), and with the Back-Cover Texts being (b) ! (see below). A copy of the license is included in the section entitled ! ``GNU Free Documentation License''. ! ! (a) The FSF's Front-Cover Text is: ! ! A GNU Manual ! ! (b) The FSF's Back-Cover Text is: ! ! You have freedom to copy and modify this GNU Manual, like GNU ! software. Copies published by the Free Software Foundation raise ! funds for GNU development. @end titlepage @contents @page --- 82,94 ---- @page @vskip 0pt plus 1filll For the @value{which-gcj} Version* @sp 1 Published by the Free Software Foundation @* 59 Temple Place - Suite 330@* Boston, MA 02111-1307, USA@* @sp 1 ! @insertcopying @end titlepage @contents @page *************** files and object files, and it can read *** 130,135 **** --- 116,122 ---- * Invoking rmic:: Generate stubs for Remote Method Invocation. * Invoking rmiregistry:: The remote object registry. * About CNI:: Description of the Cygnus Native Interface + * System properties:: Modifying runtime behavior of the libgcj library * Resources:: Where to look for more information @end menu *************** file, which @command{gcj} will search as *** 242,248 **** @item -I@var{dir} All directories specified by @code{-I} are kept in order and prepended to the class path constructed from all the other options. Unless ! compatibility with tools like @code{javac} is imported, we recommend always using @code{-I} instead of the other options for manipulating the class path. --- 229,235 ---- @item -I@var{dir} All directories specified by @code{-I} are kept in order and prepended to the class path constructed from all the other options. Unless ! compatibility with tools like @code{javac} is important, we recommend always using @code{-I} instead of the other options for manipulating the class path. *************** If @code{--bootclasspath} was specified, *** 282,288 **** Otherwise, append the built-in system directory, @file{libgcj.jar}. @item ! Finaly, if @code{--extdirs} was specified, append the contents of the specified directories at the end of the class path. Otherwise, append the contents of the built-in extdirs at @code{$(prefix)/share/java/ext}. @end itemize --- 269,275 ---- Otherwise, append the built-in system directory, @file{libgcj.jar}. @item ! Finally, if @code{--extdirs} was specified, append the contents of the specified directories at the end of the class path. Otherwise, append the contents of the built-in extdirs at @code{$(prefix)/share/java/ext}. @end itemize *************** using JNI, then you must use @code{-fjni *** 427,434 **** @command{gcj} to generate stubs which will invoke the underlying JNI methods. @item -fno-optimize-static-class-initialization ! When the optimization level is greather or equal to @code{-O2}, @command{gcj} will try to optimize the way calls into the runtime are made to initialize static classes upon their first use (this optimization isn't carried out if @code{-C} was specified.) When compiling to native --- 414,425 ---- @command{gcj} to generate stubs which will invoke the underlying JNI methods. + @item -fno-assert + Don't recognize the @code{assert} keyword. This is for compatibility + with older versions of the language specification. + @item -fno-optimize-static-class-initialization ! When the optimization level is greater or equal to @code{-O2}, @command{gcj} will try to optimize the way calls into the runtime are made to initialize static classes upon their first use (this optimization isn't carried out if @code{-C} was specified.) When compiling to native *************** specifications. However, limited manpow *** 482,495 **** documentation work against us. So, there are caveats to using @command{gcj}. This list of compatibility issues is by no means complete. @itemize @bullet @item ! @command{gcj} implements the JDK 1.1 language. It supports inner classes, ! though these are known to still be buggy. It does not yet support the ! Java 2 @code{strictfp} keyword (it recognizes the keyword but ignores ! it). @item @code{libgcj} is largely compatible with the JDK 1.2 libraries. --- 473,493 ---- documentation work against us. So, there are caveats to using @command{gcj}. + @menu + * Limitations:: + * Extensions:: + @end menu + + @node Limitations + @section Standard features not yet supported + This list of compatibility issues is by no means complete. @itemize @bullet @item ! @command{gcj} implements the JDK 1.2 language. It supports inner classes ! and the new 1.4 @code{assert} keyword. It does not yet support the Java 2 ! @code{strictfp} keyword (it recognizes the keyword but ignores it). @item @code{libgcj} is largely compatible with the JDK 1.2 libraries. *************** Sometimes the @code{libgcj} implementati *** 503,510 **** --- 501,544 ---- from the JDK implementation. This is not always a bug. Still, if it affects you, it probably makes sense to report it so that we can discuss the appropriate response. + + @item + @command{gcj} does not currently allow for piecemeal replacement of + components within @code{libgcj}. Unfortunately, programmers often want + to use newer versions of certain packages, such as those provided by + the Apache Software Foundation's Jakarta project. This has forced us + to place the @code{org.w3c.dom} and @code{org.xml.sax} packages into + their own libraries, separate from @code{libgcj}. If you intend to + use these classes, you must link them explicitly with + @code{-l-org-w3c-dom} and @code{-l-org-xml-sax}. Future versions of + @command{gcj} may not have this restriction. @end itemize + @node Extensions + @section Extra features unique to gcj + + The main feature of @command{gcj} is that it can compile programs + written in the Java programming language to native code. Most + extensions that have been added are to facilitate this functionality. + + @itemize @bullet + @item + @command{gcj} makes it easy and efficient to mix code written in Java and C++. + @xref{About CNI}, for more info on how to use this in your programs. + + @item + When you compile your classes into a shared library they can be automatically + loaded by the @code{libgcj} system classloader. When trying to load a class + @code{gnu.pkg.SomeClass} the system classloader will first try to load the + shared library @file{lib-gnu-pkg-SomeClass.so}, if that fails to load the + class then it will try to load @file{lib-gnu-pkg.so} and finally when the + class is still not loaded it will try to load @file{lib-gnu.so}. Note that + all @samp{.}s will be transformed into @samp{-}s and that searching + for inner classes starts with their outermost outer class. If the class + cannot be found this way the system classloader tries to use + the @code{libgcj} bytecode interpreter to load the class from the standard + classpath. + @end itemize @node Invoking gcjh @chapter Invoking gcjh *************** source file (@file{.java} file). *** 621,628 **** @ignore @c man begin SYNOPSIS jv-scan ! jv-scan [@option{--complexity}] [@option{--encoding}=@var{name}] ! [@option{--print-main}] [@option{--list-class}] [@option{--list-filename}] [@option{--version}] [@option{--help}] [@option{-o} @var{file}] @var{inputfile}@dots{} @c man end --- 655,663 ---- @ignore @c man begin SYNOPSIS jv-scan ! jv-scan [@option{--no-assert}] [@option{--complexity}] ! [@option{--encoding}=@var{name}] [@option{--print-main}] ! [@option{--list-class}] [@option{--list-filename}] [@option{--version}] [@option{--help}] [@option{-o} @var{file}] @var{inputfile}@dots{} @c man end *************** and the Info entries for @file{gcj} and *** 635,640 **** --- 670,679 ---- @c man begin OPTIONS jv-scan @table @gcctabopt + @item --no-assert + Don't recognize the @code{assert} keyword, for backwards compatibility + with older versions of the language specification. + @item --complexity This prints a complexity measure, related to cyclomatic complexity, for each input file. *************** and the Info entries for @file{gcj} and *** 687,693 **** @c man begin DESCRIPTION jcf-dump This is a class file examiner, similar to @code{javap}. It will print ! information about a number of classes, which are specifed by class name or file name. @c man end --- 726,732 ---- @c man begin DESCRIPTION jcf-dump This is a class file examiner, similar to @code{javap}. It will print ! information about a number of classes, which are specified by class name or file name. @c man end *************** Print extra information while running. *** 730,738 **** gij [@option{OPTION}] @dots{} @var{JARFILE} [@var{ARGS}@dots{}] gij [@option{-jar}] [@option{OPTION}] @dots{} @var{CLASS} [@var{ARGS}@dots{}] [@option{-D}@var{name}[=@var{value}]@dots{}] [@option{-ms=}@var{number}] [@option{-mx=}@var{number}] ! [@option{--version}] [@option{--help}] @c man end @c man begin SEEALSO gij gcc(1), gcj(1), gcjh(1), jv-scan(1), jcf-dump(1), gfdl(7), --- 769,778 ---- gij [@option{OPTION}] @dots{} @var{JARFILE} [@var{ARGS}@dots{}] gij [@option{-jar}] [@option{OPTION}] @dots{} @var{CLASS} [@var{ARGS}@dots{}] + [@option{-cp} @var{path}] [@option{-classpath} @var{path}] [@option{-D}@var{name}[=@var{value}]@dots{}] [@option{-ms=}@var{number}] [@option{-mx=}@var{number}] ! [@option{--showversion}] [@option{--version}] [@option{--help}] @c man end @c man begin SEEALSO gij gcc(1), gcj(1), gcjh(1), jv-scan(1), jcf-dump(1), gfdl(7), *************** been compiled and put into a shared libr *** 772,777 **** --- 812,824 ---- @c man begin OPTIONS gij @table @gcctabopt + @item -cp @var{path} + @itemx -classpath @var{path} + Set the initial class path. The class path is used for finding + class and resource files. If specified, this option overrides the + @code{CLASSPATH} environment variable. Note that this option is + ignored if @code{-jar} is used. + @item -D@var{name}[=@var{value}] This defines a system property named @var{name} with value @var{value}. If @var{value} is not specified then it defaults to the empty string. *************** as the name of a jar file, not a class. *** 792,797 **** --- 839,847 ---- @item --help Print help, then exit. + @item --showversion + Print version number and continue. + @item --version Print version number, then exit. @end table *************** Print version information, then exit. *** 942,948 **** @c man title rmiregistry Remote object registry @c man begin SYNOPSIS rmiregistry ! @command{rmiregistry} [@option{OPTION}] @dots{} [@var{port}] @ignore [@option{--help}] [@option{--version}] --- 992,998 ---- @c man title rmiregistry Remote object registry @c man begin SYNOPSIS rmiregistry ! @command{rmic} [@option{OPTION}] @dots{} [@var{port}] @ignore [@option{--help}] [@option{--version}] *************** class java::lang::String : public java:: *** 1100,1106 **** @}; @end example ! @noindent The @code{gcjh} tool automatically generates the nessary namespace declarations. --- 1150,1156 ---- @}; @end example ! @noindent The @code{gcjh} tool automatically generates the necessary namespace declarations. *************** import @var{package-name}.*; *** 1142,1148 **** @end example @noindent Doing this allows any class from the package @var{package-name} to be ! refered to only by its class-name within the program text. @noindent The same effect can be achieved in C++ like this: --- 1192,1198 ---- @end example @noindent Doing this allows any class from the package @var{package-name} to be ! referred to only by its class-name within the program text. @noindent The same effect can be achieved in C++ like this: *************** so CNI provides a special C++ type for e *** 1174,1180 **** @item @code{void} @tab @code{void} @tab no value @end multitable ! When refering to a Java type You should always use these C++ typenames (e.g.: @code{jint}) to avoid disappointment. --- 1224,1230 ---- @item @code{void} @tab @code{void} @tab no value @end multitable ! When referring to a Java type You should always use these C++ typenames (e.g.: @code{jint}) to avoid disappointment. *************** programmer's responsibility to make sure *** 1316,1331 **** However, this is fairly painless because of the conventions assumed by the Java system. ! First, @code{libgcj} will make sure a class is initialized ! before an instance of that object is created. This is one ! of the responsibilities of the @code{new} operation. This is ! taken care of both in Java code, and in C++ code. (When the G++ ! compiler sees a @code{new} of a Java class, it will call ! a routine in @code{libgcj} to allocate the object, and that ! routine will take care of initializing the class.) It follows that you can ! access an instance field, or call an instance (non-static) ! method and be safe in the knowledge that the class and all ! of its base classes have been initialized. Invoking a static method is also safe. This is because the Java compiler adds code to the start of a static method to make sure --- 1366,1382 ---- However, this is fairly painless because of the conventions assumed by the Java system. ! First, @code{libgcj} will make sure a class is initialized before an ! instance of that object is created. This is one of the ! responsibilities of the @code{new} operation. This is taken care of ! both in Java code, and in C++ code. When G++ sees a @code{new} of a ! Java class, it will call a routine in @code{libgcj} to allocate the ! object, and that routine will take care of initializing the class. ! Note however that this does not happen for Java arrays; you must ! allocate those using the appropriate CNI function. It follows that ! you can access an instance field, or call an instance (non-static) ! method and be safe in the knowledge that the class and all of its base ! classes have been initialized. Invoking a static method is also safe. This is because the Java compiler adds code to the start of a static method to make sure *************** java::lang:Integer::doubleValue() *** 1571,1577 **** @subsection Interface methods In Java you can call a method using an interface reference. This is ! supported, but not completly. @xref{Interfaces}. --- 1622,1628 ---- @subsection Interface methods In Java you can call a method using an interface reference. This is ! supported, but not completely. @xref{Interfaces}. *************** the @code{synchronized} attribute is han *** 1815,1822 **** method implementation, it is up to the programmer of a synchronized native method to handle the synchronization (in the C++ implementation of the method). ! In otherwords, you need to manually add @code{JvSynchronize} ! in a @code{native synchornized} method. @node Invocation @section Invocation --- 1866,1873 ---- method implementation, it is up to the programmer of a synchronized native method to handle the synchronization (in the C++ implementation of the method). ! In other words, you need to manually add @code{JvSynchronize} ! in a @code{native synchronized} method. @node Invocation @section Invocation *************** int main(int argc, char *argv) *** 1901,1907 **** JvAttachCurrentThread(NULL, NULL); String *message = JvNewStringLatin1("Hello from C++"); ! JvInitClass(&System.class$); System::out->println(message); JvDetachCurrentThread(); --- 1952,1958 ---- JvAttachCurrentThread(NULL, NULL); String *message = JvNewStringLatin1("Hello from C++"); ! JvInitClass(&System::class$); System::out->println(message); JvDetachCurrentThread(); *************** are as in JNI@. *** 1936,1941 **** --- 1987,2240 ---- @noindent will be added shortly, as will other functions corresponding to JNI@. + @node System properties + @chapter System properties + + The runtime behavior of the @code{libgcj} library can be modified by setting + certain system properties. These properties can be compiled into the program + using the @code{-D@var{name}[=@var{value}]} option to @command{gcj} or by + setting them explicitly in the program by calling the + @code{java.lang.System.setProperty()} method. Some system properties are only + used for informational purposes (like giving a version number or a user name). + A program can inspect the current value of a property by calling the + @code{java.lang.System.getProperty()} method. + + @menu + * Standard Properties:: Standard properties supported by @code{libgcj} + * GNU Classpath Properties:: Properties found in Classpath based libraries + * libgcj Runtime Properties:: Properties specific to @code{libgcj} + @end menu + + @node Standard Properties + @section Standard Properties + + The following properties are normally found in all implementations of the core + libraries for the Java language. + + @table @gcctabopt + + @item java.version + The @code{libgcj} version number. + + @item java.vendor + Set to @samp{The Free Software Foundation, Inc.} + + @item java.vendor.url + Set to @uref{http://gcc.gnu.org/java/}. + + @item java.home + The directory where @code{gcj} was installed. Taken from the @code{--prefix} + option given to @command{configure}. + + @item java.class.version + The class format version number supported by the libgcj byte code interpreter. + (Currently @samp{46.0}) + + @item java.vm.specification.version + The Virtual Machine Specification version implemented by @code{libgcj}. + (Currently @samp{1.0}) + + @item java.vm.specification.vendor + The name of the Virtual Machine specification designer. + + @item java.vm.specification.name + The name of the Virtual Machine specification + (Set to @samp{Java Virtual Machine Specification}). + + @item java.vm.version + The @command{gcj} version number. + + @item java.vm.vendor + Set to @samp{The Free Software Foundation, Inc.} + + @item java.vm.name + Set to @samp{GNU libgcj}. + + @item java.specification.version + The Runtime Environment specification version implemented by @code{libgcj}. + (Currently set to @samp{1.3}) + + @item java.specification.vendor + The Runtime Environment specification designer. + + @item java.specification.name + The name of the Runtime Environment specification + (Set to @samp{Java Platform API Specification}). + + @item java.class.path + The paths (jar files, zip files and directories) used for finding class files. + + @item java.library.path + Directory path used for finding native libraries. + + @item java.io.tmpdir + The directory used to put temporary files in. + + @item java.compiler + Name of the Just In Time compiler to use by the byte code interpreter. + Currently not used in @code{libgcj}. + + @item java.ext.dirs + Directories containing jar files with extra libraries. Will be used when + resolving classes. Currently not used in @code{libgcj}. + + @item java.protocol.handler.pkgs + A @samp{|} separated list of package names that is used to find classes that + implement handlers for @code{java.net.URL}. + + @item java.rmi.server.codebase + A list of URLs that is used by the @code{java.rmi.server.RMIClassLoader} + to load classes from. + + @item jdbc.drivers + A list of class names that will be loaded by the @code{java.sql.DriverManager} + when it starts up. + + @item file.separator + The separator used in when directories are included in a filename + (normally @samp{/} or @samp{\} ). + + @item file.encoding + The default character encoding used when converting platform native files to + Unicode (usually set to @samp{8859_1}). + + @item path.separator + The standard separator used when a string contains multiple paths + (normally @samp{:} or @samp{;}), the string is usually not a valid character + to use in normal directory names.) + + @item line.separator + The default line separator used on the platform (normally @samp{\n}, @samp{\r} + or a combination of those two characters). + + @item policy.provider + The class name used for the default policy provider returned by + @code{java.security.Policy.getPolicy}. + + @item user.name + The name of the user running the program. Can be the full name, the login name + or empty if unknown. + + @item user.home + The default directory to put user specific files in. + + @item user.dir + The current working directory from which the program was started. + + @item user.language + The default language as used by the @code{java.util.Locale} class. + + @item user.region + The default region as used by the @code{java.util.Local} class. + + @item user.variant + The default variant of the language and region local used. + + @item user.timezone + The default timezone as used by the @code{java.util.TimeZone} class. + + @item os.name + The operating system/kernel name that the program runs on. + + @item os.arch + The hardware that we are running on. + + @item os.version + The version number of the operating system/kernel. + + @item awt.appletWarning + The string to display when an untrusted applet is displayed. + Returned by @code{java.awt.Window.getWarningString()} when the window is + ``insecure''. + + @item awt.toolkit + The class name used for initializing the default @code{java.awt.Toolkit}. + Defaults to @code{gnu.awt.gtk.GtkToolkit}. + + @item http.proxyHost + Name of proxy host for http connections. + + @item http.proxyPort + Port number to use when a proxy host is in use. + + @end table + + @node GNU Classpath Properties + @section GNU Classpath Properties + + @code{libgcj} is based on the GNU Classpath (Essential Libraries for Java) a + GNU project to create free core class libraries for use with virtual machines + and compilers for the Java language. The following properties are common to + libraries based on GNU Classpath. + + @table @gcctabopt + + @item gcj.dumpobject + Enables printing serialization debugging by the @code{java.io.ObjectInput} and + @code{java.io.ObjectOutput} classes when set to something else then the empty + string. Only used when running a debug build of the library. + + @item gnu.classpath.vm.shortname + This is a succint name of the virtual machine. For @code{libgcj}, + this will always be @samp{libgcj}. + + @item gnu.classpath.home.url + A base URL used for finding system property files (e.g., + @file{classpath.security}). By default this is a @samp{file:} URL + pointing to the @file{lib} directory under @samp{java.home}. + + @end table + + @node libgcj Runtime Properties + @section libgcj Runtime Properties + + The following properties are specific to the @code{libgcj} runtime and will + normally not be found in other core libraries for the java language. + + @table @gcctabopt + + @item java.fullversion + The combination of @code{java.vm.name} and @code{java.vm.version}. + + @item java.vm.info + Same as @code{java.fullversion}. + + @item impl.prefix + Used by the @code{java.net.DatagramSocket} class when set to something else + then the empty string. When set all newly created @code{DatagramSocket}s will + try to load a class @code{java.net.[impl.prefix]DatagramSocketImpl} instead of + the normal @code{java.net.PlainDatagramSocketImpl}. + + @item gnu.gcj.progname + The name that was used to invoked the program. + + @item gnu.gcj.runtime.NameFinder.demangle + Whether names in a stack trace should be demangled. Defaults to @code{true}. + + @item gnu.gcj.runtime.NameFinder.sanitize + Whether calls to initialize exceptions and starting the runtime system + should be removed from the stack trace. Only done when names are + demangled. Defaults to @code{true}. + + @item gnu.gcj.runtime.NameFinder.remove_unknown + Whether calls to unknown functions (class and method names are unknown) + should be removed from the stack trace. Only done when the stack is + sanitized. Ignored if this means no stack trace information would be + available anymore. Defaults to @code{true}. + + @item gnu.gcj.runtime.NameFinder.remove_interpreter + Whether runtime interpreter calls (methods in the @code{_Jv_InterpMethod} class + and functions starting with @samp{ffi_}) should be removed from the stack + trace. Only done when the stack is sanitized. Defaults to @code{true}. + + + @item gnu.gcj.runtime.NameFinder.use_addr2line + Whether an external process (@command{addr2line} or @command{addr2name.awk}) + should be used as fallback to convert the addresses to function names when + the runtime is unable to do it through @code{dladdr}. + + @end table + @node Resources @chapter Resources diff -Nrc3pad gcc-3.2.3/gcc/java/gij.1 gcc-3.3/gcc/java/gij.1 *** gcc-3.2.3/gcc/java/gij.1 2003-04-22 07:07:38.000000000 +0000 --- gcc-3.3/gcc/java/gij.1 2003-05-14 00:32:11.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:38 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,155 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "GIJ 1" ! .TH GIJ 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" ! gij \- \s-1GNU\s0 interpreter for Java bytecode .SH "SYNOPSIS" .IX Header "SYNOPSIS" gij [\fB\s-1OPTION\s0\fR] ... \fI\s-1JARFILE\s0\fR [\fI\s-1ARGS\s0\fR...] .PP gij [\fB\-jar\fR] [\fB\s-1OPTION\s0\fR] ... \fI\s-1CLASS\s0\fR [\fI\s-1ARGS\s0\fR...] [\fB\-D\fR\fIname\fR[=\fIvalue\fR]...] [\fB\-ms=\fR\fInumber\fR] [\fB\-mx=\fR\fInumber\fR] ! [\fB\*(--version\fR] [\fB\*(--help\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`gij\*(C'\fR is a Java bytecode interpreter included with \f(CW\*(C`libgcj\*(C'\fR. --- 126,146 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "GIJ 1" ! .TH GIJ 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" ! gij \- GNU interpreter for Java bytecode .SH "SYNOPSIS" .IX Header "SYNOPSIS" gij [\fB\s-1OPTION\s0\fR] ... \fI\s-1JARFILE\s0\fR [\fI\s-1ARGS\s0\fR...] .PP gij [\fB\-jar\fR] [\fB\s-1OPTION\s0\fR] ... \fI\s-1CLASS\s0\fR [\fI\s-1ARGS\s0\fR...] + [\fB\-cp\fR \fIpath\fR] [\fB\-classpath\fR \fIpath\fR] [\fB\-D\fR\fIname\fR[=\fIvalue\fR]...] [\fB\-ms=\fR\fInumber\fR] [\fB\-mx=\fR\fInumber\fR] ! [\fB\-\-showversion\fR] [\fB\-\-version\fR] [\fB\-\-help\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`gij\*(C'\fR is a Java bytecode interpreter included with \f(CW\*(C`libgcj\*(C'\fR. *************** objects, it is possible to give \f(CW\*( *** 178,218 **** been compiled and put into a shared library on the class path. .SH "OPTIONS" .IX Header "OPTIONS" ! .Ip "\fB\-D\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]\fR" 4 .IX Item "-Dname[=value]" This defines a system property named \fIname\fR with value \fIvalue\fR. If \fIvalue\fR is not specified then it defaults to the empty string. These system properties are initialized at the program's startup and can be retrieved at runtime using the \f(CW\*(C`java.lang.System.getProperty\*(C'\fR method. ! .Ip "\fB\-ms=\fR\fInumber\fR" 4 .IX Item "-ms=number" This sets the initial heap size. ! .Ip "\fB\-mx=\fR\fInumber\fR" 4 .IX Item "-mx=number" This sets the maximum heap size. ! .Ip "\fB\-jar\fR" 4 .IX Item "-jar" This indicates that the name passed to \f(CW\*(C`gij\*(C'\fR should be interpreted as the name of a jar file, not a class. ! .Ip "\fB\*(--help\fR" 4 ! .IX Item "help" Print help, then exit. ! .Ip "\fB\*(--version\fR" 4 ! .IX Item "version" Print version number, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgcjh\fR\|(1), \fIjv-scan\fR\|(1), \fIjcf-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 169,236 ---- been compiled and put into a shared library on the class path. .SH "OPTIONS" .IX Header "OPTIONS" ! .IP "\fB\-cp\fR \fIpath\fR" 4 ! .IX Item "-cp path" ! .PD 0 ! .IP "\fB\-classpath\fR \fIpath\fR" 4 ! .IX Item "-classpath path" ! .PD ! Set the initial class path. The class path is used for finding ! class and resource files. If specified, this option overrides the ! \&\f(CW\*(C`CLASSPATH\*(C'\fR environment variable. Note that this option is ! ignored if \f(CW\*(C`\-jar\*(C'\fR is used. ! .IP "\fB\-D\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]\fR" 4 .IX Item "-Dname[=value]" This defines a system property named \fIname\fR with value \fIvalue\fR. If \fIvalue\fR is not specified then it defaults to the empty string. These system properties are initialized at the program's startup and can be retrieved at runtime using the \f(CW\*(C`java.lang.System.getProperty\*(C'\fR method. ! .IP "\fB\-ms=\fR\fInumber\fR" 4 .IX Item "-ms=number" This sets the initial heap size. ! .IP "\fB\-mx=\fR\fInumber\fR" 4 .IX Item "-mx=number" This sets the maximum heap size. ! .IP "\fB\-jar\fR" 4 .IX Item "-jar" This indicates that the name passed to \f(CW\*(C`gij\*(C'\fR should be interpreted as the name of a jar file, not a class. ! .IP "\fB\-\-help\fR" 4 ! .IX Item "--help" Print help, then exit. ! .IP "\fB\-\-showversion\fR" 4 ! .IX Item "--showversion" ! Print version number and continue. ! .IP "\fB\-\-version\fR" 4 ! .IX Item "--version" Print version number, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgcjh\fR\|(1), \fIjv\-scan\fR\|(1), \fIjcf\-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/gjavah.c gcc-3.3/gcc/java/gjavah.c *** gcc-3.2.3/gcc/java/gjavah.c 2002-04-10 13:08:59.000000000 +0000 --- gcc-3.3/gcc/java/gjavah.c 2003-03-28 22:18:48.000000000 +0000 *************** *** 1,7 **** /* Program to write C++-suitable header files from a Java(TM) .class file. This is similar to SUN's javah. ! Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,7 ---- /* Program to write C++-suitable header files from a Java(TM) .class file. This is similar to SUN's javah. ! Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** The Free Software Foundation is independ *** 33,38 **** --- 33,39 ---- #include "javaop.h" #include "java-tree.h" #include "java-opcodes.h" + #include "hashtab.h" #include *************** static int found_error = 0; *** 47,53 **** /* Nonzero if we're generating JNI output. */ static int flag_jni = 0; ! /* When non zero, warn when source file is newer than matching class file. */ int flag_newer = 1; --- 48,54 ---- /* Nonzero if we're generating JNI output. */ static int flag_jni = 0; ! /* When nonzero, warn when source file is newer than matching class file. */ int flag_newer = 1; *************** static void print_full_cxx_name PARAMS ( *** 130,137 **** static void decompile_method PARAMS ((FILE*, JCF*, int)); static void add_class_decl PARAMS ((FILE*, JCF*, JCF_u2)); ! static int java_float_finite PARAMS ((jfloat)); ! static int java_double_finite PARAMS ((jdouble)); static void print_name PARAMS ((FILE *, JCF *, int)); static void print_base_classname PARAMS ((FILE *, JCF *, int)); static int utf8_cmp PARAMS ((const unsigned char *, int, const char *)); --- 131,139 ---- static void decompile_method PARAMS ((FILE*, JCF*, int)); static void add_class_decl PARAMS ((FILE*, JCF*, JCF_u2)); ! static void jni_print_float PARAMS ((FILE *, jfloat)); ! static void jni_print_double PARAMS ((FILE *, jdouble)); ! static void print_name PARAMS ((FILE *, JCF *, int)); static void print_base_classname PARAMS ((FILE *, JCF *, int)); static int utf8_cmp PARAMS ((const unsigned char *, int, const char *)); *************** static char *get_field_name PARAMS ((JCF *** 142,147 **** --- 144,151 ---- static void print_field_name PARAMS ((FILE *, JCF *, int, JCF_u2)); static const unsigned char *super_class_name PARAMS ((JCF *, int *)); static void print_include PARAMS ((FILE *, const unsigned char *, int)); + static int gcjh_streq PARAMS ((const void *p1, const void *p2)); + static int throwable_p PARAMS ((const unsigned char *signature)); static const unsigned char *decode_signature_piece PARAMS ((FILE *, const unsigned char *, const unsigned char *, int *)); static void print_class_decls PARAMS ((FILE *, JCF *, int)); *************** static int method_printed = 0; *** 190,195 **** --- 194,202 ---- static int method_synthetic = 0; static int method_signature = 0; + /* Set to 1 while the very first data member of a class is being handled. */ + static int is_first_data_member = 0; + #define HANDLE_METHOD(ACCESS_FLAGS, NAME, SIGNATURE, ATTRIBUTE_COUNT) \ { \ method_synthetic = 0; \ *************** static int decompiled = 0; *** 237,274 **** #include "jcf-reader.c" ! /* Some useful constants. */ ! #define F_NAN_MASK 0x7f800000 ! #if (1 == HOST_FLOAT_WORDS_BIG_ENDIAN) && ! defined (HOST_WORDS_BIG_ENDIAN) ! #define D_NAN_MASK 0x000000007ff00000LL ! #else ! #define D_NAN_MASK 0x7ff0000000000000LL ! #endif ! ! /* Return 1 if F is not Inf or NaN. */ ! static int ! java_float_finite (f) ! jfloat f; { ! union Word u; ! u.f = f; ! ! /* We happen to know that F_NAN_MASK will match all NaN values, and ! also positive and negative infinity. That's why we only need one ! test here. See The Java Language Specification, section 20.9. */ ! return (u.i & F_NAN_MASK) != F_NAN_MASK; } ! /* Return 1 if D is not Inf or NaN. */ ! static int ! java_double_finite (d) ! jdouble d; { ! union DWord u; ! u.d = d; ! ! /* Now check for all NaNs. */ ! return (u.l & D_NAN_MASK) != D_NAN_MASK; } /* Print a character, appropriately mangled for JNI. */ --- 244,297 ---- #include "jcf-reader.c" ! /* Print a single-precision float, suitable for parsing by g++. */ ! static void ! jni_print_float (FILE *stream, jfloat f) { ! /* It'd be nice to use __builtin_nan/__builtin_inf here but they don't ! work in data initializers. FIXME. */ ! if (JFLOAT_FINITE (f)) ! { ! fputs (" = ", stream); ! if (f.negative) ! putc ('-', stream); ! if (f.exponent) ! fprintf (stream, "0x1.%.6xp%+df", ! ((unsigned int)f.mantissa) << 1, ! f.exponent - JFLOAT_EXP_BIAS); ! else ! /* Exponent of 0x01 is -125; exponent of 0x00 is *also* -125, ! because the implicit leading 1 bit is no longer present. */ ! fprintf (stream, "0x0.%.6xp%+df", ! ((unsigned int)f.mantissa) << 1, ! f.exponent + 1 - JFLOAT_EXP_BIAS); ! } ! fputs (";\n", stream); } ! /* Print a double-precision float, suitable for parsing by g++. */ ! static void ! jni_print_double (FILE *stream, jdouble f) { ! /* It'd be nice to use __builtin_nan/__builtin_inf here but they don't ! work in data initializers. FIXME. */ ! if (JDOUBLE_FINITE (f)) ! { ! fputs (" = ", stream); ! if (f.negative) ! putc ('-', stream); ! if (f.exponent) ! fprintf (stream, "0x1.%.5x%.8xp%+d", ! f.mantissa0, f.mantissa1, ! f.exponent - JDOUBLE_EXP_BIAS); ! else ! /* Exponent of 0x001 is -1022; exponent of 0x000 is *also* -1022, ! because the implicit leading 1 bit is no longer present. */ ! fprintf (stream, "0x0.%.5x%.8xp%+d", ! f.mantissa0, f.mantissa1, ! f.exponent + 1 - JDOUBLE_EXP_BIAS); ! } ! fputs (";\n", stream); } /* Print a character, appropriately mangled for JNI. */ *************** DEFUN(print_field_info, (stream, jcf, na *** 750,759 **** jfloat fnum = JPOOL_FLOAT (jcf, current_field_value); fputs ("const jfloat ", out); print_field_name (out, jcf, name_index, 0); ! if (! java_float_finite (fnum)) ! fputs (";\n", out); ! else ! fprintf (out, " = %.10g;\n", fnum); } break; case CONSTANT_Double: --- 773,779 ---- jfloat fnum = JPOOL_FLOAT (jcf, current_field_value); fputs ("const jfloat ", out); print_field_name (out, jcf, name_index, 0); ! jni_print_float (out, fnum); } break; case CONSTANT_Double: *************** DEFUN(print_field_info, (stream, jcf, na *** 761,770 **** jdouble dnum = JPOOL_DOUBLE (jcf, current_field_value); fputs ("const jdouble ", out); print_field_name (out, jcf, name_index, 0); ! if (! java_double_finite (dnum)) ! fputs (";\n", out); ! else ! fprintf (out, " = %.17g;\n", dnum); } break; default: --- 781,787 ---- jdouble dnum = JPOOL_DOUBLE (jcf, current_field_value); fputs ("const jdouble ", out); print_field_name (out, jcf, name_index, 0); ! jni_print_double (out, dnum); } break; default: *************** DEFUN(print_method_info, (stream, jcf, n *** 831,843 **** { struct method_name *nn; ! nn = (struct method_name *) xmalloc (sizeof (struct method_name)); ! nn->name = (char *) xmalloc (length); memcpy (nn->name, str, length); nn->length = length; nn->next = method_name_list; nn->sig_length = JPOOL_UTF_LENGTH (jcf, sig_index); ! nn->signature = (char *) xmalloc (nn->sig_length); memcpy (nn->signature, JPOOL_UTF_DATA (jcf, sig_index), nn->sig_length); method_name_list = nn; --- 848,860 ---- { struct method_name *nn; ! nn = xmalloc (sizeof (struct method_name)); ! nn->name = xmalloc (length); memcpy (nn->name, str, length); nn->length = length; nn->next = method_name_list; nn->sig_length = JPOOL_UTF_LENGTH (jcf, sig_index); ! nn->signature = xmalloc (nn->sig_length); memcpy (nn->signature, JPOOL_UTF_DATA (jcf, sig_index), nn->sig_length); method_name_list = nn; *************** decompile_method (out, jcf, code_len) *** 1091,1096 **** --- 1108,1224 ---- } } + /* Like strcmp, but invert the return result for the hash table. This + should probably be in hashtab.c to complement the existing string + hash function. */ + static int + gcjh_streq (p1, p2) + const void *p1, *p2; + { + return ! strcmp ((char *) p1, (char *) p2); + } + + /* Return 1 if the initial part of CLNAME names a subclass of throwable, + or 0 if not. CLNAME may be extracted from a signature, and can be + terminated with either `;' or NULL. */ + static int + throwable_p (clname) + const unsigned char *clname; + { + int length; + unsigned char *current; + int i; + int result = 0; + + /* We keep two hash tables of class names. In one we list all the + classes which are subclasses of Throwable. In the other we will + all other classes. We keep two tables to make the code a bit + simpler; we don't have to have a structure mapping class name to + a `throwable?' bit. */ + static htab_t throw_hash; + static htab_t non_throw_hash; + static int init_done = 0; + + if (! init_done) + { + PTR *slot; + const unsigned char *str; + + /* Self-initializing. The cost of this really doesn't matter. + We also don't care about freeing these, either. */ + throw_hash = htab_create (10, htab_hash_string, gcjh_streq, + (htab_del) free); + non_throw_hash = htab_create (10, htab_hash_string, gcjh_streq, + (htab_del) free); + + /* Make sure the root classes show up in the tables. */ + str = xstrdup ("java.lang.Throwable"); + slot = htab_find_slot (throw_hash, str, INSERT); + *slot = (PTR) str; + + str = xstrdup ("java.lang.Object"); + slot = htab_find_slot (non_throw_hash, str, INSERT); + *slot = (PTR) str; + + init_done = 1; + } + + for (length = 0; clname[length] != ';' && clname[length] != '\0'; ++length) + ; + current = ALLOC (length + 1); + for (i = 0; i < length; ++i) + current[i] = clname[i] == '/' ? '.' : clname[i]; + current[length] = '\0'; + + /* We don't compute the hash slot here because the table might be + modified by the recursion. In that case the slot could be + invalidated. */ + if (htab_find (throw_hash, current)) + result = 1; + else if (htab_find (non_throw_hash, current)) + result = 0; + else + { + JCF jcf; + PTR *slot; + unsigned char *super, *tmp; + int super_length = -1; + const char *classfile_name = find_class (current, strlen (current), + &jcf, 0); + + if (! classfile_name) + { + fprintf (stderr, "couldn't find class %s\n", current); + found_error = 1; + return 0; + } + if (jcf_parse_preamble (&jcf) != 0 + || jcf_parse_constant_pool (&jcf) != 0 + || verify_constant_pool (&jcf) > 0) + { + fprintf (stderr, "parse error while reading %s\n", classfile_name); + found_error = 1; + return 0; + } + jcf_parse_class (&jcf); + + tmp = (unsigned char *) super_class_name (&jcf, &super_length); + super = ALLOC (super_length + 1); + memcpy (super, tmp, super_length); + super[super_length] = '\0'; + + result = throwable_p (super); + slot = htab_find_slot (result ? throw_hash : non_throw_hash, + current, INSERT); + *slot = current; + current = NULL; + + JCF_FINISH (&jcf); + } + + return result; + } + /* Print one piece of a signature. Returns pointer to next parseable character on success, NULL on error. */ static const unsigned char * *************** decode_signature_piece (stream, signatur *** 1175,1181 **** /* If the previous iterations left us with something to print, print it. For JNI, we always print `jobjectArray' in the nested cases. */ ! if (flag_jni && ctype == NULL) { ctype = "jobjectArray"; *need_space = 1; --- 1303,1309 ---- /* If the previous iterations left us with something to print, print it. For JNI, we always print `jobjectArray' in the nested cases. */ ! if (flag_jni && (ctype == NULL || array_depth > 0)) { ctype = "jobjectArray"; *need_space = 1; *************** decode_signature_piece (stream, signatur *** 1204,1227 **** case 'L': if (flag_jni) { ! /* We know about certain types and special-case their ! names. ! FIXME: something like java.lang.Exception should be ! printed as `jthrowable', because it is a subclass. This ! means that gcjh must read the entire hierarchy and ! comprehend it. */ if (! strncmp (signature, "Ljava/lang/String;", sizeof ("Ljava/lang/String;") -1)) ctype = "jstring"; else if (! strncmp (signature, "Ljava/lang/Class;", sizeof ("Ljava/lang/Class;") - 1)) ctype = "jclass"; ! else if (! strncmp (signature, "Ljava/lang/Throwable;", ! sizeof ("Ljava/lang/Throwable;") - 1)) ctype = "jthrowable"; - else if (! strncmp (signature, "Ljava/lang/ref/WeakReference;", - sizeof ("Ljava/lang/ref/WeakReference;") - 1)) - ctype = "jweak"; else ctype = "jobject"; --- 1332,1347 ---- case 'L': if (flag_jni) { ! /* We know about certain types and special-case their names. */ if (! strncmp (signature, "Ljava/lang/String;", sizeof ("Ljava/lang/String;") -1)) ctype = "jstring"; else if (! strncmp (signature, "Ljava/lang/Class;", sizeof ("Ljava/lang/Class;") - 1)) ctype = "jclass"; ! /* Skip leading 'L' for throwable_p call. */ ! else if (throwable_p (signature + 1)) ctype = "jthrowable"; else ctype = "jobject"; *************** DEFUN(print_c_decl, (stream, jcf, name_i *** 1314,1319 **** --- 1434,1450 ---- } } + /* Force the alignment of the first data member. This is + because the "new" C++ ABI changed the alignemnt of non-POD + classes. gcj, however, still uses the "old" alignment. */ + if (is_first_data_member && ! (flags & ACC_STATIC) && ! is_method) + { + is_first_data_member = 0; + print_cxx_classname (out, " __attribute__((aligned(__alignof__( ", + jcf, jcf->super_class); + fputs (" )))) ", stream); + } + /* Now print the name of the thing. */ if (need_space) fputs (" ", stream); *************** DEFUN(print_stub_or_jni, (stream, jcf, n *** 1459,1465 **** return; if (flag_jni && ! stubs) ! fputs ("extern ", stream); /* If printing a method, skip to the return signature and print that first. However, there is no return value if this is a --- 1590,1596 ---- return; if (flag_jni && ! stubs) ! fputs ("extern JNIEXPORT ", stream); /* If printing a method, skip to the return signature and print that first. However, there is no return value if this is a *************** DEFUN(print_stub_or_jni, (stream, jcf, n *** 1491,1496 **** --- 1622,1630 ---- /* When printing a JNI header we need to respect the space. In other cases we're just going to insert a newline anyway. */ fputs (need_space && ! stubs ? " " : "\n", stream); + + if (flag_jni && ! stubs) + fputs ("JNICALL ", stream); /* Now print the name of the thing. */ print_name_for_stub_or_jni (stream, jcf, name_index, *************** print_include (out, utf8, len) *** 1624,1630 **** return; } ! incl = (struct include *) xmalloc (sizeof (struct include)); incl->name = xmalloc (len + 1); strncpy (incl->name, utf8, len); incl->name[len] = '\0'; --- 1758,1764 ---- return; } ! incl = xmalloc (sizeof (struct include)); incl->name = xmalloc (len + 1); strncpy (incl->name, utf8, len); incl->name[len] = '\0'; *************** add_namelet (name, name_limit, parent) *** 1711,1717 **** if (n == NULL) { ! n = (struct namelet *) xmalloc (sizeof (struct namelet)); n->name = xmalloc (p - name + 1); strncpy (n->name, name, p - name); n->name[p - name] = '\0'; --- 1845,1851 ---- if (n == NULL) { ! n = xmalloc (sizeof (struct namelet)); n->name = xmalloc (p - name + 1); strncpy (n->name, name, p - name); n->name[p - name] = '\0'; *************** DEFUN(process_file, (jcf, out), *** 2041,2046 **** --- 2175,2182 ---- } /* Now go back for second pass over methods and fields. */ + is_first_data_member = 1; + JCF_SEEK (jcf, method_start); method_pass = 1; jcf_parse_methods (jcf); *************** help () *** 2183,2189 **** /* We omit -MG until it is implemented. */ printf ("\n"); printf ("For bug reporting instructions, please see:\n"); ! printf ("%s.\n", GCCBUGURL); exit (0); } --- 2319,2325 ---- /* We omit -MG until it is implemented. */ printf ("\n"); printf ("For bug reporting instructions, please see:\n"); ! printf ("%s.\n", bug_report_url); exit (0); } *************** DEFUN(main, (argc, argv), *** 2267,2291 **** case OPT_PREPEND: if (prepend_count == 0) ! prepend_specs = (char**) ALLOC (argc * sizeof (char*)); prepend_specs[prepend_count++] = optarg; break; case OPT_FRIEND: if (friend_count == 0) ! friend_specs = (char**) ALLOC (argc * sizeof (char*)); friend_specs[friend_count++] = optarg; break; case OPT_ADD: if (add_count == 0) ! add_specs = (char**) ALLOC (argc * sizeof (char*)); add_specs[add_count++] = optarg; break; case OPT_APPEND: if (append_count == 0) ! append_specs = (char**) ALLOC (argc * sizeof (char*)); append_specs[append_count++] = optarg; break; --- 2403,2427 ---- case OPT_PREPEND: if (prepend_count == 0) ! prepend_specs = ALLOC (argc * sizeof (char*)); prepend_specs[prepend_count++] = optarg; break; case OPT_FRIEND: if (friend_count == 0) ! friend_specs = ALLOC (argc * sizeof (char*)); friend_specs[friend_count++] = optarg; break; case OPT_ADD: if (add_count == 0) ! add_specs = ALLOC (argc * sizeof (char*)); add_specs[add_count++] = optarg; break; case OPT_APPEND: if (append_count == 0) ! append_specs = ALLOC (argc * sizeof (char*)); append_specs[append_count++] = optarg; break; *************** DEFUN(main, (argc, argv), *** 2372,2378 **** { int dir_len = strlen (output_directory); int i, classname_length = strlen (classname); ! current_output_file = (char*) ALLOC (dir_len + classname_length + 5); strcpy (current_output_file, output_directory); if (dir_len > 0 && output_directory[dir_len-1] != '/') current_output_file[dir_len++] = '/'; --- 2508,2514 ---- { int dir_len = strlen (output_directory); int i, classname_length = strlen (classname); ! current_output_file = ALLOC (dir_len + classname_length + 5); strcpy (current_output_file, output_directory); if (dir_len > 0 && output_directory[dir_len-1] != '/') current_output_file[dir_len++] = '/'; diff -Nrc3pad gcc-3.2.3/gcc/java/javaop.h gcc-3.3/gcc/java/javaop.h *** gcc-3.2.3/gcc/java/javaop.h 2001-05-26 01:31:47.000000000 +0000 --- gcc-3.3/gcc/java/javaop.h 2003-03-28 22:18:48.000000000 +0000 *************** typedef int32 jint; *** 57,77 **** typedef int64 jlong; typedef void* jref; ! /* A 32-bit IEEE single-precision float. */ ! #ifndef jfloat ! #define jfloat float ! #endif ! ! /* A 32-bit IEEE double-precision float. */ ! #ifndef jdouble ! #define jdouble double ! #endif ! union Word { ! jint i; ! jfloat f; ! void *p; ! }; /* A jword is an unsigned integral type big enough for a 32-bit jint or jfloat *or* a pointer. It is the type appropriate for stack --- 57,82 ---- typedef int64 jlong; typedef void* jref; ! /* A 32-bit big-endian IEEE single-precision float. */ ! typedef struct _jfloat { ! unsigned int negative : 1; ! unsigned int exponent : 8; ! unsigned int mantissa : 23; ! } jfloat; ! #define JFLOAT_FINITE(f) ((f).exponent != 0xFF) ! #define JFLOAT_QNAN_MASK 0x400000 ! #define JFLOAT_EXP_BIAS 0x7f ! /* A 32-bit big-endian IEEE double-precision float. */ ! typedef struct _jdouble { ! unsigned int negative : 1; ! unsigned int exponent : 11; ! unsigned int mantissa0: 20; ! unsigned int mantissa1: 32; ! } jdouble; ! #define JDOUBLE_FINITE(f) ((f).exponent != 0x7FF) ! #define JDOUBLE_QNAN_MASK 0x80000 /* apply to mantissa0 */ ! #define JDOUBLE_EXP_BIAS 0x3ff /* A jword is an unsigned integral type big enough for a 32-bit jint or jfloat *or* a pointer. It is the type appropriate for stack *************** union Word { *** 104,112 **** static inline jfloat WORD_TO_FLOAT(jword w) ! { union Word wu; ! wu.i = w; ! return wu.f; } /* Sign extend w. If the host on which this cross-compiler runs uses --- 109,122 ---- static inline jfloat WORD_TO_FLOAT(jword w) ! { ! jfloat f; ! ! f.negative = (w & 0x80000000) >> 31; ! f.exponent = (w & 0x7f800000) >> 23; ! f.mantissa = (w & 0x007fffff); ! ! return f; } /* Sign extend w. If the host on which this cross-compiler runs uses *************** WORDS_TO_LONG(jword hi, jword lo) *** 128,148 **** return ((jlong) hi << 32) | ((jlong)lo & (((jlong)1 << 32) -1)); } - union DWord { - jdouble d; - jlong l; - jword w[2]; - }; - static inline jdouble WORDS_TO_DOUBLE(jword hi, jword lo) ! { union DWord wu; ! #if (1 == HOST_FLOAT_WORDS_BIG_ENDIAN) ! wu.l = WORDS_TO_LONG(lo, hi); ! #else ! wu.l = WORDS_TO_LONG(hi, lo); ! #endif ! return wu.d; } /* If PREFIX_CHAR is the first character of the Utf8 encoding of a character, --- 138,154 ---- return ((jlong) hi << 32) | ((jlong)lo & (((jlong)1 << 32) -1)); } static inline jdouble WORDS_TO_DOUBLE(jword hi, jword lo) ! { ! jdouble d; ! ! d.negative = (hi & 0x80000000) >> 31; ! d.exponent = (hi & 0x7ff00000) >> 20; ! d.mantissa0 = (hi & 0x000fffff); ! d.mantissa1 = lo; ! ! return d; } /* If PREFIX_CHAR is the first character of the Utf8 encoding of a character, diff -Nrc3pad gcc-3.2.3/gcc/java/java-tree.h gcc-3.3/gcc/java/java-tree.h *** gcc-3.2.3/gcc/java/java-tree.h 2002-06-04 16:45:52.000000000 +0000 --- gcc-3.3/gcc/java/java-tree.h 2002-11-18 18:13:35.000000000 +0000 *************** The Free Software Foundation is independ *** 26,32 **** /* Hacked by Per Bothner February 1996. */ ! #include "hash.h" /* Java language-specific tree codes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, --- 26,32 ---- /* Hacked by Per Bothner February 1996. */ ! #include "hashtab.h" /* Java language-specific tree codes. */ #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, *************** struct JCF; *** 43,48 **** --- 43,49 ---- 0: IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (in IDENTIFIER_NODE) RESOLVE_EXPRESSION_NAME_P (in EXPR_WITH_FILE_LOCATION) FOR_LOOP_P (in LOOP_EXPR) + SUPPRESS_UNREACHABLE_ERROR (for other _EXPR nodes) ANONYMOUS_CLASS_P (in RECORD_TYPE) ARG_FINAL_P (in TREE_LIST) 1: CLASS_HAS_SUPER_FLAG (in TREE_VEC). *************** struct JCF; *** 91,96 **** --- 92,98 ---- CLASS_PUBLIC (in TYPE_DECL). 2: METHOD_STATIC (in FUNCTION_DECL). (But note that FIELD_STATIC uses TREE_STATIC!) + FIELD_SYNTHETIC (in FIELD_DECL) CLASS_COMPLETE_P (in TYPE_DECL) 3: METHOD_FINAL (in FUNCTION_DECL) FIELD_FINAL (in FIELD_DECL) *************** extern int flag_emit_class_files; *** 158,177 **** extern int flag_filelist_file; ! /* When non zero, assume all native functions are implemented with JNI, not CNI. */ extern int flag_jni; ! /* When non zero, report the now deprecated empty statements. */ extern int flag_extraneous_semicolon; ! /* When non zero, always check for a non gcj generated classes archive. */ extern int flag_force_classes_archive_check; ! /* When non zero, we emit xref strings. Values of the flag for xref backends are defined in xref.h. */ extern int flag_emit_xref; --- 160,183 ---- extern int flag_filelist_file; ! /* When nonzero, permit the use of the assert keyword. */ ! ! extern int flag_assert; ! ! /* When nonzero, assume all native functions are implemented with JNI, not CNI. */ extern int flag_jni; ! /* When nonzero, report the now deprecated empty statements. */ extern int flag_extraneous_semicolon; ! /* When nonzero, always check for a non gcj generated classes archive. */ extern int flag_force_classes_archive_check; ! /* When nonzero, we emit xref strings. Values of the flag for xref backends are defined in xref.h. */ extern int flag_emit_xref; *************** extern int flag_redundant; *** 188,215 **** extern int flag_not_overriding; extern int flag_static_local_jdk1_1; ! /* When non zero, warn when source file is newer than matching class file. */ extern int flag_newer; ! /* When non zero, call a library routine to do integer divisions. */ extern int flag_use_divide_subroutine; ! /* When non zero, generate code for the Boehm GC. */ extern int flag_use_boehm_gc; ! /* When non zero, assume the runtime uses a hash table to map an object to its synchronization structure. */ extern int flag_hash_synchronization; ! /* When non zero, generate checks for references to NULL. */ extern int flag_check_references; /* Used through STATIC_CLASS_INIT_OPT_P to check whether static initialization optimization should be performed. */ extern int flag_optimize_sci; ! /* When non zero, use offset tables for virtual method calls in order to improve binary compatibility. */ extern int flag_indirect_dispatch; --- 194,221 ---- extern int flag_not_overriding; extern int flag_static_local_jdk1_1; ! /* When nonzero, warn when source file is newer than matching class file. */ extern int flag_newer; ! /* When nonzero, call a library routine to do integer divisions. */ extern int flag_use_divide_subroutine; ! /* When nonzero, generate code for the Boehm GC. */ extern int flag_use_boehm_gc; ! /* When nonzero, assume the runtime uses a hash table to map an object to its synchronization structure. */ extern int flag_hash_synchronization; ! /* When nonzero, generate checks for references to NULL. */ extern int flag_check_references; /* Used through STATIC_CLASS_INIT_OPT_P to check whether static initialization optimization should be performed. */ extern int flag_optimize_sci; ! /* When nonzero, use offset tables for virtual method calls in order to improve binary compatibility. */ extern int flag_indirect_dispatch; *************** typedef struct CPool constant_pool; *** 252,257 **** --- 258,266 ---- #define COMPONENT_REF_SIGNATURE(CPOOL, IDX) \ NAME_AND_TYPE_SIGNATURE (CPOOL, COMPONENT_REF_NAME_AND_TYPE(CPOOL, IDX)) + extern GTY(()) tree java_lang_cloneable_identifier_node; + extern GTY(()) tree java_io_serializable_identifier_node; + enum java_tree_index { JTI_PROMOTED_BYTE_TYPE_NODE, *************** enum java_tree_index *** 269,274 **** --- 278,286 ---- JTI_UNSIGNED_INT_TYPE_NODE, JTI_UNSIGNED_LONG_TYPE_NODE, + JTI_DECIMAL_INT_MAX_NODE, + JTI_DECIMAL_LONG_MAX_NODE, + JTI_BOOLEAN_TYPE_NODE, JTI_OBJECT_TYPE_NODE, *************** enum java_tree_index *** 403,409 **** JTI_MAX }; ! extern tree java_global_trees[JTI_MAX]; /* "Promoted types" that are used for primitive types smaller than int. We could use int_type_node, but then we would lose --- 415,421 ---- JTI_MAX }; ! extern GTY(()) tree java_global_trees[JTI_MAX]; /* "Promoted types" that are used for primitive types smaller than int. We could use int_type_node, but then we would lose *************** extern tree java_global_trees[JTI_MAX]; *** 435,440 **** --- 447,457 ---- #define unsigned_long_type_node \ java_global_trees[JTI_UNSIGNED_LONG_TYPE_NODE] + #define decimal_int_max \ + java_global_trees[JTI_DECIMAL_INT_MAX_NODE] + #define decimal_long_max \ + java_global_trees[JTI_DECIMAL_LONG_MAX_NODE] + #define boolean_type_node \ java_global_trees[JTI_BOOLEAN_TYPE_NODE] *************** extern struct CPool *outgoing_cpool; *** 678,693 **** extern const char *cyclic_inheritance_report; ! struct lang_identifier { struct tree_identifier ignore; ! tree global_value, local_value; /* If non-NULL: An ADDR_REF to a VAR_DECL that contains * the Utf8Const representation of the identifier. */ tree utf8_ref; }; /* Macros for access to language-specific slots in an identifier. */ /* Unless specified, each of these slots contains a DECL node or null. */ --- 695,722 ---- extern const char *cyclic_inheritance_report; ! struct lang_identifier GTY(()) { struct tree_identifier ignore; ! tree global_value; ! tree local_value; /* If non-NULL: An ADDR_REF to a VAR_DECL that contains * the Utf8Const representation of the identifier. */ tree utf8_ref; }; + /* The resulting tree type. */ + union lang_tree_node + GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"), + chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)"))) + { + union tree_node GTY ((tag ("0"), + desc ("tree_node_structure (&%h)"))) + generic; + struct lang_identifier GTY ((tag ("1"))) identifier; + }; + /* Macros for access to language-specific slots in an identifier. */ /* Unless specified, each of these slots contains a DECL node or null. */ *************** struct lang_identifier *** 727,767 **** /* For a FUNCTION_DECL, if we are compiling a .class file, then this is the position in the .class file of the method code. Specifically, this is the code itself, not the code attribute. */ ! #define DECL_CODE_OFFSET(DECL) (DECL_LANG_SPECIFIC(DECL)->code_offset) /* Similarly, the length of the bytecode. */ ! #define DECL_CODE_LENGTH(DECL) (DECL_LANG_SPECIFIC(DECL)->code_length) /* Similarly, the position of the LineNumberTable attribute. */ #define DECL_LINENUMBERS_OFFSET(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->linenumbers_offset) /* Similarly, the position of the LocalVariableTable attribute (following the standard attribute header). */ #define DECL_LOCALVARIABLES_OFFSET(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->localvariables_offset) ! #define DECL_MAX_LOCALS(DECL) (DECL_LANG_SPECIFIC(DECL)->max_locals) ! #define DECL_MAX_STACK(DECL) (DECL_LANG_SPECIFIC(DECL)->max_stack) /* Number of local variable slots needed for the arguments of this function. */ ! #define DECL_ARG_SLOT_COUNT(DECL) (DECL_LANG_SPECIFIC(DECL)->arg_slot_count) /* Information on declaration location */ ! #define DECL_FUNCTION_WFL(DECL) (DECL_LANG_SPECIFIC(DECL)->wfl) /* List of checked thrown exceptions, as specified with the `throws' keyword */ ! #define DECL_FUNCTION_THROWS(DECL) (DECL_LANG_SPECIFIC(DECL)->throws_list) /* List of other constructors of the same class that this constructor calls */ #define DECL_CONSTRUCTOR_CALLS(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->called_constructor) /* When the function is an access function, the DECL it was trying to access */ #define DECL_FUNCTION_ACCESS_DECL(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->called_constructor) /* The identifier of the access method used to invoke this method from an inner class. */ #define DECL_FUNCTION_INNER_ACCESS(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->inner_access) /* Pointer to the function's current's COMPOUND_EXPR tree (while completing its body) or the function's block */ ! #define DECL_FUNCTION_BODY(DECL) (DECL_LANG_SPECIFIC(DECL)->function_decl_body) /* How specific the function is (for method selection - Java source code front-end */ #define DECL_SPECIFIC_COUNT(DECL) DECL_ARG_SLOT_COUNT(DECL) --- 756,798 ---- /* For a FUNCTION_DECL, if we are compiling a .class file, then this is the position in the .class file of the method code. Specifically, this is the code itself, not the code attribute. */ ! #define DECL_CODE_OFFSET(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.code_offset) /* Similarly, the length of the bytecode. */ ! #define DECL_CODE_LENGTH(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.code_length) /* Similarly, the position of the LineNumberTable attribute. */ #define DECL_LINENUMBERS_OFFSET(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.linenumbers_offset) /* Similarly, the position of the LocalVariableTable attribute (following the standard attribute header). */ #define DECL_LOCALVARIABLES_OFFSET(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.localvariables_offset) ! #define DECL_MAX_LOCALS(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.max_locals) ! #define DECL_MAX_STACK(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.max_stack) /* Number of local variable slots needed for the arguments of this function. */ ! #define DECL_ARG_SLOT_COUNT(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.arg_slot_count) /* Information on declaration location */ ! #define DECL_FUNCTION_WFL(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.wfl) /* List of checked thrown exceptions, as specified with the `throws' keyword */ ! #define DECL_FUNCTION_THROWS(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.throws_list) /* List of other constructors of the same class that this constructor calls */ #define DECL_CONSTRUCTOR_CALLS(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.called_constructor) /* When the function is an access function, the DECL it was trying to access */ #define DECL_FUNCTION_ACCESS_DECL(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.called_constructor) /* The identifier of the access method used to invoke this method from an inner class. */ #define DECL_FUNCTION_INNER_ACCESS(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.inner_access) /* Pointer to the function's current's COMPOUND_EXPR tree (while completing its body) or the function's block */ ! #define DECL_FUNCTION_BODY(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.function_decl_body) /* How specific the function is (for method selection - Java source code front-end */ #define DECL_SPECIFIC_COUNT(DECL) DECL_ARG_SLOT_COUNT(DECL) *************** struct lang_identifier *** 770,800 **** boolean decls. The variables are intended to be TRUE when the class has been initialized in this function, and FALSE otherwise. */ #define DECL_FUNCTION_INIT_TEST_TABLE(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->init_test_table) /* If LOCAL_CLASS_INITIALIZATION_FLAG_P(decl), give class it initializes. */ #define DECL_FUNCTION_INIT_TEST_CLASS(DECL) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(DECL))->slot_chain) /* For each static function decl, itc contains a hash table whose entries are keyed on class named that are definitively initialized in DECL. */ #define DECL_FUNCTION_INITIALIZED_CLASS_TABLE(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->ict) /* A list of all the static method calls in the method DECL (if optimizing). Actually each TREE_VALUE points to a COMPONT_EXPR that wraps the invoation so we can later patch it. */ #define DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->smic) /* The Number of Artificial Parameters (NAP) DECL contains. this$ is excluded, because sometimes created as a parameter before the function decl exists. */ ! #define DECL_FUNCTION_NAP(DECL) (DECL_LANG_SPECIFIC(DECL)->nap) /* True if DECL is a synthetic ctor. */ #define DECL_FUNCTION_SYNTHETIC_CTOR(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->synthetic_ctor) ! #define DECL_FIXED_CONSTRUCTOR_P(DECL) (DECL_LANG_SPECIFIC(DECL)->fixed_ctor) /* A constructor that calls this. */ ! #define DECL_INIT_CALLS_THIS(DECL) (DECL_LANG_SPECIFIC(DECL)->init_calls_this) /* True when DECL aliases an outer context local variable. */ #define FIELD_LOCAL_ALIAS(DECL) DECL_LANG_FLAG_6 (DECL) --- 801,836 ---- boolean decls. The variables are intended to be TRUE when the class has been initialized in this function, and FALSE otherwise. */ #define DECL_FUNCTION_INIT_TEST_TABLE(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.init_test_table) /* If LOCAL_CLASS_INITIALIZATION_FLAG_P(decl), give class it initializes. */ #define DECL_FUNCTION_INIT_TEST_CLASS(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.v.slot_chain) /* For each static function decl, itc contains a hash table whose entries are keyed on class named that are definitively initialized in DECL. */ #define DECL_FUNCTION_INITIALIZED_CLASS_TABLE(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.ict) /* A list of all the static method calls in the method DECL (if optimizing). Actually each TREE_VALUE points to a COMPONT_EXPR that wraps the invoation so we can later patch it. */ #define DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.smic) /* The Number of Artificial Parameters (NAP) DECL contains. this$ is excluded, because sometimes created as a parameter before the function decl exists. */ ! #define DECL_FUNCTION_NAP(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.nap) /* True if DECL is a synthetic ctor. */ #define DECL_FUNCTION_SYNTHETIC_CTOR(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.synthetic_ctor) ! #define DECL_FIXED_CONSTRUCTOR_P(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.fixed_ctor) /* A constructor that calls this. */ ! #define DECL_INIT_CALLS_THIS(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.f.init_calls_this) ! ! /* True when DECL (a field) is Synthetic. */ ! #define FIELD_SYNTHETIC(DECL) DECL_LANG_FLAG_2 (DECL) /* True when DECL aliases an outer context local variable. */ #define FIELD_LOCAL_ALIAS(DECL) DECL_LANG_FLAG_6 (DECL) *************** struct lang_identifier *** 857,887 **** /* The slot number for this local variable. */ #define DECL_LOCAL_SLOT_NUMBER(NODE) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->slot_number) /* The start (bytecode) pc for the valid range of this local variable. */ #define DECL_LOCAL_START_PC(NODE) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->start_pc) /* The end (bytecode) pc for the valid range of this local variable. */ #define DECL_LOCAL_END_PC(NODE) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->end_pc) /* For a VAR_DECLor PARM_DECL, used to chain decls with the same slot_number in decl_map. */ #define DECL_LOCAL_SLOT_CHAIN(NODE) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->slot_chain) /* For a FIELD_DECL, holds the name of the access method. Used to read/write the content of the field from an inner class. */ #define FIELD_INNER_ACCESS(DECL) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(DECL))->am) /* Safely tests whether FIELD_INNER_ACCESS exists or not. */ #define FIELD_INNER_ACCESS_P(DECL) \ DECL_LANG_SPECIFIC (DECL) && FIELD_INNER_ACCESS (DECL) /* True if a final variable was initialized upon its declaration, or (if a field) in an initializer. Set after definite assignment. */ #define DECL_FIELD_FINAL_IUD(NODE) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->final_iud) /* The original WFL of a final variable. */ #define DECL_FIELD_FINAL_WFL(NODE) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->wfl) /* True if NODE is a local variable final. */ #define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE)) /* True if NODE is a final field. */ --- 893,929 ---- /* The slot number for this local variable. */ #define DECL_LOCAL_SLOT_NUMBER(NODE) \ ! (DECL_LANG_SPECIFIC(NODE)->u.v.slot_number) /* The start (bytecode) pc for the valid range of this local variable. */ #define DECL_LOCAL_START_PC(NODE) \ ! (DECL_LANG_SPECIFIC(NODE)->u.v.start_pc) /* The end (bytecode) pc for the valid range of this local variable. */ #define DECL_LOCAL_END_PC(NODE) \ ! (DECL_LANG_SPECIFIC(NODE)->u.v.end_pc) /* For a VAR_DECLor PARM_DECL, used to chain decls with the same slot_number in decl_map. */ #define DECL_LOCAL_SLOT_CHAIN(NODE) \ ! (DECL_LANG_SPECIFIC(NODE)->u.v.slot_chain) /* For a FIELD_DECL, holds the name of the access method. Used to read/write the content of the field from an inner class. */ #define FIELD_INNER_ACCESS(DECL) \ ! (DECL_LANG_SPECIFIC(DECL)->u.v.am) /* Safely tests whether FIELD_INNER_ACCESS exists or not. */ #define FIELD_INNER_ACCESS_P(DECL) \ DECL_LANG_SPECIFIC (DECL) && FIELD_INNER_ACCESS (DECL) /* True if a final variable was initialized upon its declaration, or (if a field) in an initializer. Set after definite assignment. */ #define DECL_FIELD_FINAL_IUD(NODE) \ ! (DECL_LANG_SPECIFIC(NODE)->u.v.final_iud) /* The original WFL of a final variable. */ #define DECL_FIELD_FINAL_WFL(NODE) \ ! (DECL_LANG_SPECIFIC(NODE)->u.v.wfl) ! /* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is ! the approximate number of statements in this function. There is ! no need for this number to be exact; it is only used in various ! heuristics regarding optimization. */ ! #define DECL_NUM_STMTS(NODE) \ ! (FUNCTION_DECL_CHECK (NODE)->decl.u1.i) /* True if NODE is a local variable final. */ #define LOCAL_FINAL_P(NODE) (DECL_LANG_SPECIFIC (NODE) && DECL_FINAL (NODE)) /* True if NODE is a final field. */ *************** struct lang_identifier *** 892,898 **** /* True if NODE is a class initialization flag. This macro accesses the flag to read or set it. */ #define LOCAL_CLASS_INITIALIZATION_FLAG(NODE) \ ! (((struct lang_decl_var*)DECL_LANG_SPECIFIC(NODE))->cif) /* True if NODE is a class initialization flag. */ #define LOCAL_CLASS_INITIALIZATION_FLAG_P(NODE) \ (DECL_LANG_SPECIFIC (NODE) && LOCAL_CLASS_INITIALIZATION_FLAG(NODE)) --- 934,940 ---- /* True if NODE is a class initialization flag. This macro accesses the flag to read or set it. */ #define LOCAL_CLASS_INITIALIZATION_FLAG(NODE) \ ! (DECL_LANG_SPECIFIC(NODE)->u.v.cif) /* True if NODE is a class initialization flag. */ #define LOCAL_CLASS_INITIALIZATION_FLAG_P(NODE) \ (DECL_LANG_SPECIFIC (NODE) && LOCAL_CLASS_INITIALIZATION_FLAG(NODE)) *************** struct lang_identifier *** 902,908 **** { \ DECL_LANG_SPECIFIC ((T)) \ = ((struct lang_decl *) \ ! ggc_alloc_cleared (sizeof (struct lang_decl_var))); \ } /* A ConstantExpression, after folding and name resolution. */ --- 944,951 ---- { \ DECL_LANG_SPECIFIC ((T)) \ = ((struct lang_decl *) \ ! ggc_alloc_cleared (sizeof (struct lang_decl))); \ ! DECL_LANG_SPECIFIC (T)->desc = LANG_DECL_VAR; \ } /* A ConstantExpression, after folding and name resolution. */ *************** struct lang_identifier *** 919,925 **** #define DECL_BIT_INDEX(DECL) (DECL_CHECK (DECL)->decl.pointer_alias_set) /* DECL_LANG_SPECIFIC for FUNCTION_DECLs. */ ! struct lang_decl { /* tree chain; not yet used. */ long code_offset; --- 962,968 ---- #define DECL_BIT_INDEX(DECL) (DECL_CHECK (DECL)->decl.pointer_alias_set) /* DECL_LANG_SPECIFIC for FUNCTION_DECLs. */ ! struct lang_decl_func GTY(()) { /* tree chain; not yet used. */ long code_offset; *************** struct lang_decl *** 927,941 **** long linenumbers_offset; long localvariables_offset; int arg_slots; ! int max_locals, max_stack, arg_slot_count; tree wfl; /* Information on the original location */ tree throws_list; /* Exception specified by `throws' */ tree function_decl_body; /* Hold all function's statements */ tree called_constructor; /* When decl is a constructor, the list of other constructor it calls */ ! struct hash_table init_test_table; ! /* Class initialization test variables */ ! struct hash_table ict; /* Initialized (static) Class Table */ tree smic; /* Static method invocation compound */ tree inner_access; /* The identifier of the access method used for invocation from inner classes */ --- 970,990 ---- long linenumbers_offset; long localvariables_offset; int arg_slots; ! int max_locals; ! int max_stack; ! int arg_slot_count; tree wfl; /* Information on the original location */ tree throws_list; /* Exception specified by `throws' */ tree function_decl_body; /* Hold all function's statements */ tree called_constructor; /* When decl is a constructor, the list of other constructor it calls */ ! ! /* Class initialization test variables */ ! htab_t GTY ((param_is (struct treetreehash_entry))) init_test_table; ! ! /* Initialized (static) Class Table */ ! htab_t GTY ((param_is (union tree_node))) ict; ! tree smic; /* Static method invocation compound */ tree inner_access; /* The identifier of the access method used for invocation from inner classes */ *************** struct lang_decl *** 948,963 **** unsigned int strictfp : 1; }; ! /* init_test_table hash table entry structure. */ ! struct init_test_hash_entry { ! struct hash_entry root; ! tree init_test_decl; }; /* DECL_LANG_SPECIFIC for VAR_DECL, PARM_DECL and sometimes FIELD_DECL (access methods on outer class fields) and final fields. */ ! struct lang_decl_var { int slot_number; int start_pc; --- 997,1015 ---- unsigned int strictfp : 1; }; ! struct treetreehash_entry GTY(()) { ! tree key; ! tree value; }; + extern tree java_treetreehash_find PARAMS ((htab_t, tree)); + extern tree * java_treetreehash_new PARAMS ((htab_t, tree)); + extern htab_t java_treetreehash_create PARAMS ((size_t size, int ggc)); + /* DECL_LANG_SPECIFIC for VAR_DECL, PARM_DECL and sometimes FIELD_DECL (access methods on outer class fields) and final fields. */ ! struct lang_decl_var GTY(()) { int slot_number; int start_pc; *************** struct lang_decl_var *** 969,974 **** --- 1021,1042 ---- unsigned int cif : 1; /* True: decl is a class initialization flag */ }; + /* This is what 'lang_decl' really points to. */ + + enum lang_decl_desc { + LANG_DECL_FUNC, + LANG_DECL_VAR + }; + + struct lang_decl GTY(()) + { + enum lang_decl_desc desc; + union lang_decl_u { + struct lang_decl_func GTY ((tag ("LANG_DECL_FUNC"))) f; + struct lang_decl_var GTY ((tag ("LANG_DECL_VAR"))) v; + } GTY ((desc ("%0.desc"))) u; + }; + /* Macro to access fields in `struct lang_type'. */ #define TYPE_SIGNATURE(T) (TYPE_LANG_SPECIFIC(T)->signature) *************** struct lang_decl_var *** 995,1006 **** #define TYPE_PRIVATE_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->pic) #define TYPE_PROTECTED_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->poic) #define TYPE_STRICTFP(T) (TYPE_LANG_SPECIFIC(T)->strictfp) ! struct lang_type { tree signature; ! struct JCF *jcf; ! struct CPool *cpool; tree cpool_data_ref; /* Cached */ tree finit_stmt_list; /* List of statements finit$ will use */ tree clinit_stmt_list; /* List of statements will use */ --- 1063,1075 ---- #define TYPE_PRIVATE_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->pic) #define TYPE_PROTECTED_INNER_CLASS(T) (TYPE_LANG_SPECIFIC(T)->poic) #define TYPE_STRICTFP(T) (TYPE_LANG_SPECIFIC(T)->strictfp) + #define TYPE_USES_ASSERTIONS(T) (TYPE_LANG_SPECIFIC(T)->assertions) ! struct lang_type GTY(()) { tree signature; ! struct JCF * GTY ((skip (""))) jcf; ! struct CPool * GTY ((skip (""))) cpool; tree cpool_data_ref; /* Cached */ tree finit_stmt_list; /* List of statements finit$ will use */ tree clinit_stmt_list; /* List of statements will use */ *************** struct lang_type *** 1015,1042 **** unsigned pic:1; /* Private Inner Class. */ unsigned poic:1; /* Protected Inner Class. */ unsigned strictfp:1; /* `strictfp' class. */ }; - #ifdef JAVA_USE_HANDLES - /* TYPE_BINFO_HANDLE points from a handle-class to its corresponding - non-handle-class, and vice verse. */ - - #define BINFO_HANDLE(NODE) TREE_VEC_ELT ((NODE), 6) - - /* Given a RECORD_TYPE for a handle type, return the corresponding class. */ - #define HANDLE_TO_CLASS_TYPE(HTYPE) BINFO_HANDLE (TYPE_BINFO (HTYPE)) - - /* Given a RECORD_TYPE for a class, return the corresponding handle type. */ - #define CLASS_TO_HANDLE_TYPE(TYPE) BINFO_HANDLE (TYPE_BINFO (TYPE)) - #else - #define HANDLE_TO_CLASS_TYPE(HTYPE) (HTYPE) - #define CLASS_TO_HANDLE_TYPE(TYPE) (TYPE) - #endif - #define JCF_u4 unsigned long #define JCF_u2 unsigned short ! extern void java_set_yydebug PARAMS ((int)); extern void add_assume_compiled PARAMS ((const char *, int)); extern tree lookup_class PARAMS ((tree)); extern tree lookup_java_constructor PARAMS ((tree, tree)); --- 1084,1103 ---- unsigned pic:1; /* Private Inner Class. */ unsigned poic:1; /* Protected Inner Class. */ unsigned strictfp:1; /* `strictfp' class. */ + unsigned assertions:1; /* Any method uses `assert'. */ }; #define JCF_u4 unsigned long #define JCF_u2 unsigned short ! extern void java_parse_file PARAMS ((int)); ! extern bool java_mark_addressable PARAMS ((tree)); ! extern tree java_type_for_mode PARAMS ((enum machine_mode, int)); ! extern tree java_type_for_size PARAMS ((unsigned int, int)); ! extern tree java_unsigned_type PARAMS ((tree)); ! extern tree java_signed_type PARAMS ((tree)); ! extern tree java_signed_or_unsigned_type PARAMS ((int, tree)); ! extern tree java_truthvalue_conversion PARAMS ((tree)); extern void add_assume_compiled PARAMS ((const char *, int)); extern tree lookup_class PARAMS ((tree)); extern tree lookup_java_constructor PARAMS ((tree, tree)); *************** extern tree ident_subst PARAMS ((const c *** 1071,1077 **** --- 1132,1147 ---- const char*, int, int, const char*)); extern tree identifier_subst PARAMS ((const tree, const char *, int, int, const char *)); + extern int global_bindings_p PARAMS ((void)); + extern int kept_level_p PARAMS ((void)); + extern tree getdecls PARAMS ((void)); + extern void pushlevel PARAMS ((int)); + extern tree poplevel PARAMS ((int,int, int)); + extern void insert_block PARAMS ((tree)); + extern void set_block PARAMS ((tree)); + extern tree pushdecl PARAMS ((tree)); extern void java_init_decl_processing PARAMS ((void)); + extern void java_dup_lang_specific_decl PARAMS ((tree)); extern tree build_java_signature PARAMS ((tree)); extern tree build_java_argument_signature PARAMS ((tree)); extern void set_java_signature PARAMS ((tree, tree)); *************** extern void jcf_print_utf8 PARAMS ((FILE *** 1203,1226 **** extern void jcf_print_char PARAMS ((FILE *, int)); extern void jcf_print_utf8_replace PARAMS ((FILE *, const unsigned char *, int, int, int)); - # if JCF_USE_STDIO - extern const char* open_class PARAMS ((const char *, struct JCF *, - FILE *, const char *)); - # else extern const char* open_class PARAMS ((const char *, struct JCF *, int, const char *)); - # endif /* JCF_USE_STDIO */ #endif extern void java_debug_context PARAMS ((void)); extern void safe_layout_class PARAMS ((tree)); extern tree get_boehm_type_descriptor PARAMS ((tree)); extern bool class_has_finalize_method PARAMS ((tree)); - extern unsigned long java_hash_hash_tree_node PARAMS ((hash_table_key)); - extern bool java_hash_compare_tree_node PARAMS ((hash_table_key, - hash_table_key)); - extern bool attach_initialized_static_class PARAMS ((struct hash_entry *, - PTR)); extern void java_check_methods PARAMS ((tree)); extern void init_jcf_parse PARAMS((void)); extern void init_src_parse PARAMS((void)); --- 1273,1286 ---- *************** extern void append_gpp_mangled_name PARA *** 1236,1247 **** extern void add_predefined_file PARAMS ((tree)); extern int predefined_filename_p PARAMS ((tree)); ! /* We use ARGS_SIZE_RTX to indicate that gcc/expr.h has been included ! to declare `enum expand_modifier'. */ ! #if defined (TREE_CODE) && defined(RTX_CODE) && defined (HAVE_MACHINE_MODES) && defined (ARGS_SIZE_RTX) ! struct rtx_def * java_lang_expand_expr PARAMS ((tree, rtx, enum machine_mode, ! enum expand_modifier)); ! #endif /* TREE_CODE && RTX_CODE && HAVE_MACHINE_MODES && ARGS_SIZE_RTX */ #define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL) --- 1296,1310 ---- extern void add_predefined_file PARAMS ((tree)); extern int predefined_filename_p PARAMS ((tree)); ! extern void java_optimize_inline PARAMS ((tree)); ! extern tree decl_constant_value PARAMS ((tree)); ! ! #if defined(RTX_CODE) && defined (HAVE_MACHINE_MODES) ! struct rtx_def * java_expand_expr PARAMS ((tree, rtx, enum machine_mode, ! int)); ! #endif ! extern void java_inlining_merge_static_initializers PARAMS ((tree, void *)); ! extern void java_inlining_map_static_initializers PARAMS ((tree, void *)); #define DECL_FINAL(DECL) DECL_LANG_FLAG_3 (DECL) *************** struct rtx_def * java_lang_expand_expr P *** 1253,1262 **** #define METHOD_STATIC(DECL) DECL_LANG_FLAG_2 (DECL) #define METHOD_FINAL(DECL) DECL_FINAL (DECL) #define METHOD_SYNCHRONIZED(DECL) DECL_LANG_FLAG_4 (DECL) ! #define METHOD_NATIVE(DECL) (DECL_LANG_SPECIFIC(DECL)->native) #define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL) #define METHOD_TRANSIENT(DECL) DECL_LANG_FLAG_6 (DECL) ! #define METHOD_STRICTFP(DECL) (DECL_LANG_SPECIFIC (DECL)->strictfp) #define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE) #define CLASS_FILE_P(NODE) TREE_LANG_FLAG_3 (NODE) --- 1316,1325 ---- #define METHOD_STATIC(DECL) DECL_LANG_FLAG_2 (DECL) #define METHOD_FINAL(DECL) DECL_FINAL (DECL) #define METHOD_SYNCHRONIZED(DECL) DECL_LANG_FLAG_4 (DECL) ! #define METHOD_NATIVE(DECL) (DECL_LANG_SPECIFIC(DECL)->u.f.native) #define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL) #define METHOD_TRANSIENT(DECL) DECL_LANG_FLAG_6 (DECL) ! #define METHOD_STRICTFP(DECL) (DECL_LANG_SPECIFIC (DECL)->u.f.strictfp) #define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE) #define CLASS_FILE_P(NODE) TREE_LANG_FLAG_3 (NODE) *************** struct rtx_def * java_lang_expand_expr P *** 1300,1305 **** --- 1363,1369 ---- #define CLASS_PRIVATE(DECL) (TYPE_PRIVATE_INNER_CLASS (TREE_TYPE (DECL))) #define CLASS_PROTECTED(DECL) (TYPE_PROTECTED_INNER_CLASS (TREE_TYPE (DECL))) #define CLASS_STRICTFP(DECL) (TYPE_STRICTFP (TREE_TYPE (DECL))) + #define CLASS_USES_ASSERTIONS(DECL) (TYPE_USES_ASSERTIONS (TREE_TYPE (DECL))) /* @deprecated marker flag on methods, fields and classes */ *************** extern tree *type_map; *** 1483,1488 **** --- 1547,1558 ---- declared with the final modifier */ #define ARG_FINAL_P(NODE) TREE_LANG_FLAG_0 (NODE) + /* True if NODE (some kind of EXPR, but not a WFL) should not give an + error if it is found to be unreachable. This can only be applied + to those EXPRs which can be used as the update expression of a + `for' loop. In particular it can't be set on a LOOP_EXPR. */ + #define SUPPRESS_UNREACHABLE_ERROR(NODE) TREE_LANG_FLAG_0 (NODE) + /* True if EXPR (a WFL in that case) resolves into a package name */ #define RESOLVE_PACKAGE_NAME_P(WFL) TREE_LANG_FLAG_3 (WFL) *************** extern tree *type_map; *** 1646,1652 **** TREE_SIDE_EFFECTS (WHERE) = 1; \ } ! /* Non zero if TYPE is an unchecked exception */ #define IS_UNCHECKED_EXCEPTION_P(TYPE) \ (inherits_from_p ((TYPE), runtime_exception_type_node) \ || inherits_from_p ((TYPE), error_exception_type_node)) --- 1716,1722 ---- TREE_SIDE_EFFECTS (WHERE) = 1; \ } ! /* Nonzero if TYPE is an unchecked exception */ #define IS_UNCHECKED_EXCEPTION_P(TYPE) \ (inherits_from_p ((TYPE), runtime_exception_type_node) \ || inherits_from_p ((TYPE), error_exception_type_node)) *************** enum *** 1681,1689 **** JV_STATE_LINKED = 9, /* Strings interned. */ JV_STATE_IN_PROGRESS = 10, /* running. */ ! JV_STATE_DONE = 12, - JV_STATE_ERROR = 14 /* must be last. */ }; #undef DEBUG_JAVA_BINDING_LEVELS --- 1751,1760 ---- JV_STATE_LINKED = 9, /* Strings interned. */ JV_STATE_IN_PROGRESS = 10, /* running. */ ! JV_STATE_ERROR = 12, ! ! JV_STATE_DONE = 14 /* Must be last. */ }; #undef DEBUG_JAVA_BINDING_LEVELS diff -Nrc3pad gcc-3.2.3/gcc/java/jcf-dump.1 gcc-3.3/gcc/java/jcf-dump.1 *** gcc-3.2.3/gcc/java/jcf-dump.1 2003-04-22 07:07:37.000000000 +0000 --- gcc-3.3/gcc/java/jcf-dump.1 2003-05-14 00:32:10.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:37 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,200 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "JCF-DUMP 1" ! .TH JCF-DUMP 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" ! jcf-dump \- print information about Java class files .SH "SYNOPSIS" .IX Header "SYNOPSIS" ! jcf-dump [\fB\-c\fR] [\fB\*(--javap\fR] ! [\fB\*(--classpath\fR=\fIpath\fR] [\fB\*(--CLASSPATH\fR=\fIpath\fR] [\fB\-I\fR\fIdir\fR...] [\fB\-o\fR \fIfile\fR] ! [\fB\*(--version\fR] [\fB\*(--help\fR] [\fB\-v\fR] [\fB\*(--verbose\fR] \fIclassname\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a class file examiner, similar to \f(CW\*(C`javap\*(C'\fR. It will print ! information about a number of classes, which are specifed by class name or file name. .SH "OPTIONS" .IX Header "OPTIONS" ! .Ip "\fB\-c\fR" 4 .IX Item "-c" Disassemble method bodies. By default method bodies are not printed. ! .Ip "\fB\*(--javap\fR" 4 ! .IX Item "javap" Generate output in \f(CW\*(C`javap\*(C'\fR format. The implementation of this feature is very incomplete. ! .Ip "\fB\*(--classpath=\fR\fIpath\fR" 4 ! .IX Item "classpath=path" .PD 0 ! .Ip "\fB\*(--CLASSPATH=\fR\fIpath\fR" 4 ! .IX Item "CLASSPATH=path" ! .Ip "\fB\-I\fR\fIdirectory\fR" 4 .IX Item "-Idirectory" ! .Ip "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" .PD These options as the same as the corresponding \fBgcj\fR options. ! .Ip "\fB\*(--help\fR" 4 ! .IX Item "help" Print help, then exit. ! .Ip "\fB\*(--version\fR" 4 ! .IX Item "version" Print version number, then exit. ! .Ip "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Print extra information while running. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgcjh\fR\|(1), \fIgij\fR\|(1), \fIjcf-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 126,204 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "JCF-DUMP 1" ! .TH JCF-DUMP 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" ! jcf\-dump \- print information about Java class files .SH "SYNOPSIS" .IX Header "SYNOPSIS" ! jcf-dump [\fB\-c\fR] [\fB\-\-javap\fR] ! [\fB\-\-classpath\fR=\fIpath\fR] [\fB\-\-CLASSPATH\fR=\fIpath\fR] [\fB\-I\fR\fIdir\fR...] [\fB\-o\fR \fIfile\fR] ! [\fB\-\-version\fR] [\fB\-\-help\fR] [\fB\-v\fR] [\fB\-\-verbose\fR] \fIclassname\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a class file examiner, similar to \f(CW\*(C`javap\*(C'\fR. It will print ! information about a number of classes, which are specified by class name or file name. .SH "OPTIONS" .IX Header "OPTIONS" ! .IP "\fB\-c\fR" 4 .IX Item "-c" Disassemble method bodies. By default method bodies are not printed. ! .IP "\fB\-\-javap\fR" 4 ! .IX Item "--javap" Generate output in \f(CW\*(C`javap\*(C'\fR format. The implementation of this feature is very incomplete. ! .IP "\fB\-\-classpath=\fR\fIpath\fR" 4 ! .IX Item "--classpath=path" .PD 0 ! .IP "\fB\-\-CLASSPATH=\fR\fIpath\fR" 4 ! .IX Item "--CLASSPATH=path" ! .IP "\fB\-I\fR\fIdirectory\fR" 4 .IX Item "-Idirectory" ! .IP "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" .PD These options as the same as the corresponding \fBgcj\fR options. ! .IP "\fB\-\-help\fR" 4 ! .IX Item "--help" Print help, then exit. ! .IP "\fB\-\-version\fR" 4 ! .IX Item "--version" Print version number, then exit. ! .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Print extra information while running. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgcjh\fR\|(1), \fIgij\fR\|(1), \fIjcf\-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/jcf-dump.c gcc-3.3/gcc/java/jcf-dump.c *** gcc-3.2.3/gcc/java/jcf-dump.c 2002-04-10 13:09:00.000000000 +0000 --- gcc-3.3/gcc/java/jcf-dump.c 2003-03-28 22:18:48.000000000 +0000 *************** The Free Software Foundation is independ *** 56,61 **** --- 56,62 ---- #include "version.h" #include + #include /* Outout file. */ FILE *out; *************** int flag_print_fields = 1; *** 71,77 **** int flag_print_methods = 1; int flag_print_attributes = 1; ! /* When non zero, warn when source file is newer than matching class file. */ int flag_newer = 1; --- 72,78 ---- int flag_print_methods = 1; int flag_print_attributes = 1; ! /* When nonzero, warn when source file is newer than matching class file. */ int flag_newer = 1; *************** DEFUN(print_constant, (out, jcf, index, *** 505,519 **** case CONSTANT_Float: { jfloat fnum = JPOOL_FLOAT (jcf, index); ! fprintf (out, "%s%.10g", verbosity > 0 ? "Float " : "", (double) fnum); if (verbosity > 1) ! fprintf (out, ", bits = 0x%08lx", (long) (* (int32 *) &fnum)); break; } case CONSTANT_Double: { jdouble dnum = JPOOL_DOUBLE (jcf, index); ! fprintf (out, "%s%.20g", verbosity > 0 ? "Double " : "", dnum); if (verbosity > 1) { int32 hi, lo; --- 506,590 ---- case CONSTANT_Float: { jfloat fnum = JPOOL_FLOAT (jcf, index); ! ! if (verbosity > 0) ! fputs ("Float ", out); ! ! if (fnum.negative) ! putc ('-', out); ! ! if (JFLOAT_FINITE (fnum)) ! { ! int dummy; ! int exponent = fnum.exponent - JFLOAT_EXP_BIAS; ! double f; ! uint32 mantissa = fnum.mantissa; ! if (fnum.exponent == 0) ! /* Denormal. */ ! exponent++; ! else ! /* Normal; add the implicit bit. */ ! mantissa |= ((uint32)1 << 23); ! ! f = frexp (mantissa, &dummy); ! f = ldexp (f, exponent + 1); ! fprintf (out, "%.10g", f); ! } ! else ! { ! if (fnum.mantissa == 0) ! fputs ("Inf", out); ! else if (fnum.mantissa & JFLOAT_QNAN_MASK) ! fprintf (out, "QNaN(%u)", (fnum.mantissa & ~JFLOAT_QNAN_MASK)); ! else ! fprintf (out, "SNaN(%u)", (fnum.mantissa & ~JFLOAT_QNAN_MASK)); ! } ! if (verbosity > 1) ! fprintf (out, ", bits = 0x%08lx", JPOOL_UINT (jcf, index)); ! break; } case CONSTANT_Double: { jdouble dnum = JPOOL_DOUBLE (jcf, index); ! ! if (verbosity > 0) ! fputs ("Double ", out); ! ! if (dnum.negative) ! putc ('-', out); ! ! if (JDOUBLE_FINITE (dnum)) ! { ! int dummy; ! int exponent = dnum.exponent - JDOUBLE_EXP_BIAS; ! double d; ! uint64 mantissa = ((((uint64) dnum.mantissa0) << 32) ! + dnum.mantissa1); ! if (dnum.exponent == 0) ! /* Denormal. */ ! exponent++; ! else ! /* Normal; add the implicit bit. */ ! mantissa |= ((uint64)1 << 52); ! ! d = frexp (mantissa, &dummy); ! d = ldexp (d, exponent + 1); ! fprintf (out, "%.20g", d); ! } ! else ! { ! uint64 mantissa = dnum.mantissa0 & ~JDOUBLE_QNAN_MASK; ! mantissa = (mantissa << 32) + dnum.mantissa1; ! ! if (dnum.mantissa0 == 0 && dnum.mantissa1 == 0) ! fputs ("Inf", out); ! else if (dnum.mantissa0 & JDOUBLE_QNAN_MASK) ! fprintf (out, "QNaN(%llu)", (unsigned long long)mantissa); ! else ! fprintf (out, "SNaN(%llu)", (unsigned long long)mantissa); ! } if (verbosity > 1) { int32 hi, lo; *************** help () *** 821,827 **** printf (" -v, --verbose Print extra information while running\n"); printf ("\n"); printf ("For bug reporting instructions, please see:\n"); ! printf ("%s.\n", GCCBUGURL); exit (0); } --- 892,898 ---- printf (" -v, --verbose Print extra information while running\n"); printf ("\n"); printf ("For bug reporting instructions, please see:\n"); ! printf ("%s.\n", bug_report_url); exit (0); } *************** DEFUN(main, (argc, argv), *** 939,949 **** if (optind >= argc) { fprintf (out, "Reading .class from .\n"); - #if JCF_USE_STDIO - open_class ("", jcf, stdin, NULL); - #else open_class ("", jcf, 0, NULL); - #endif process_class (jcf); } else --- 1010,1016 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/jcf.h gcc-3.3/gcc/java/jcf.h *** gcc-3.2.3/gcc/java/jcf.h 2002-06-04 16:45:55.000000000 +0000 --- gcc-3.3/gcc/java/jcf.h 2003-04-10 14:54:08.000000000 +0000 *************** *** 1,6 **** /* Utility macros to read Java(TM) .class files and byte codes. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,7 ---- /* Utility macros to read Java(TM) .class files and byte codes. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 ! Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** The Free Software Foundation is independ *** 71,76 **** --- 72,104 ---- #define JCF_USE_SCANDIR 0 #endif + /* On case-insensitive file systems, file name components must be + compared using "strcasecmp", if available, instead of "strcmp". + Assumes "config.h" has already been included. */ + #if defined (HAVE_DOS_BASED_FILE_SYSTEM) && defined (HAVE_STRCASECMP) + #define COMPARE_FILENAMES(X, Y) strcasecmp ((X), (Y)) + #else + #define COMPARE_FILENAMES(X, Y) strcmp ((X), (Y)) + #endif + + /* On case-insensitive file systems, we need to ensure that a request + to open a .java or .class file is honored only if the file to be + opened is of the exact case we are asking for. In other words, we + want to override the inherent case insensitivity of the underlying + file system. On other platforms, this macro becomes the vanilla + open() call. + + If you want to add another host, add your define to the list below + (i.e. defined(WIN32) || defined(YOUR_HOST)) and add an host-specific + .c file to Make-lang.in similar to win32-host.c */ + #if defined(WIN32) + extern int + jcf_open_exact_case (const char* filename, int oflag); + #define JCF_OPEN_EXACT_CASE(X, Y) jcf_open_exact_case (X, Y) + #else + #define JCF_OPEN_EXACT_CASE open + #endif /* WIN32 */ + struct JCF; typedef int (*jcf_filbuf_t) PARAMS ((struct JCF*, int needed)); diff -Nrc3pad gcc-3.2.3/gcc/java/jcf-io.c gcc-3.3/gcc/java/jcf-io.c *** gcc-3.2.3/gcc/java/jcf-io.c 2002-06-04 16:45:54.000000000 +0000 --- gcc-3.3/gcc/java/jcf-io.c 2003-04-20 22:44:04.000000000 +0000 *************** DEFUN(read_zip_member, (jcf, zipd, zipf) *** 231,260 **** return 0; } - #if JCF_USE_STDIO - const char * - DEFUN(open_class, (filename, jcf, stream, dep_name), - const char *filename AND JCF *jcf AND FILE* stream - AND const char *dep_name) - { - if (jcf) - { - if (dep_name != NULL) - jcf_dependency_add_file (dep_name, 0); - JCF_ZERO (jcf); - jcf->buffer = NULL; - jcf->buffer_end = NULL; - jcf->read_ptr = NULL; - jcf->read_end = NULL; - jcf->read_state = stream; - jcf->filename = filename; - jcf->filbuf = jcf_filbuf_from_stdio; - } - else - fclose (stream); - return filename; - } - #else const char * DEFUN(open_class, (filename, jcf, fd, dep_name), const char *filename AND JCF *jcf AND int fd AND const char *dep_name) --- 231,236 ---- *************** DEFUN(open_class, (filename, jcf, fd, de *** 289,312 **** close (fd); return filename; } - #endif const char * DEFUN(find_classfile, (filename, jcf, dep_name), char *filename AND JCF *jcf AND const char *dep_name) { - #if JCF_USE_STDIO - FILE *stream = fopen (filename, "rb"); - if (stream == NULL) - return NULL; - return open_class (arg, jcf, stream, dep_name); - #else int fd = open (filename, O_RDONLY | O_BINARY); if (fd < 0) return NULL; return open_class (filename, jcf, fd, dep_name); - #endif } #if JCF_USE_SCANDIR --- 265,280 ---- *************** DEFUN(caching_stat, (filename, buf), *** 375,380 **** --- 343,349 ---- { #if JCF_USE_SCANDIR char *sep; + char origsep = 0; char *base; memoized_dirlist_entry *dent; void **slot; *************** DEFUN(caching_stat, (filename, buf), *** 388,402 **** /* Get the name of the directory. */ sep = strrchr (filename, DIR_SEPARATOR); if (sep) { *sep = '\0'; base = sep + 1; } else base = filename; ! /* Obtain the entry for this directory form the hash table. */ slot = htab_find_slot (memoized_dirlists, filename, INSERT); if (!*slot) { --- 357,376 ---- /* Get the name of the directory. */ sep = strrchr (filename, DIR_SEPARATOR); + #ifdef DIR_SEPARATOR_2 + if (! sep) + sep = strrchr (filename, DIR_SEPARATOR_2); + #endif if (sep) { + origsep = *sep; *sep = '\0'; base = sep + 1; } else base = filename; ! /* Obtain the entry for this directory from the hash table. */ slot = htab_find_slot (memoized_dirlists, filename, INSERT); if (!*slot) { *************** DEFUN(caching_stat, (filename, buf), *** 407,426 **** /* Unfortunately, scandir is not fully standardized. In particular, the type of the function pointer passed as the third argument sometimes takes a "const struct dirent *" ! parameter, and sometimes just a "struct dirent *". We rely ! on the ability to interchange these two types of function ! pointers. */ dent->num_files = scandir (filename, &dent->files, ! java_or_class_file, alphasort); *slot = dent; } else dent = *((memoized_dirlist_entry **) slot); ! /* Put the spearator back. */ if (sep) ! *sep = DIR_SEPARATOR; /* If the file is not in the list, there is no need to stat it; it does not exist. */ --- 381,399 ---- /* Unfortunately, scandir is not fully standardized. In particular, the type of the function pointer passed as the third argument sometimes takes a "const struct dirent *" ! parameter, and sometimes just a "struct dirent *". We cast ! to (void *) so that either way it is quietly accepted. */ dent->num_files = scandir (filename, &dent->files, ! (void *) java_or_class_file, alphasort); *slot = dent; } else dent = *((memoized_dirlist_entry **) slot); ! /* Put the separator back. */ if (sep) ! *sep = origsep; /* If the file is not in the list, there is no need to stat it; it does not exist. */ *************** DEFUN(find_class, (classname, classname_ *** 461,471 **** const char *classname AND int classname_length AND JCF *jcf AND int source_ok) { - #if JCF_USE_STDIO - FILE *stream; - #else int fd; - #endif int i, k, java = -1, class = -1; struct stat java_buf, class_buf; char *dep_file; --- 434,440 ---- *************** DEFUN(find_class, (classname, classname_ *** 491,500 **** /* Allocate and zero out the buffer, since we don't explicitly put a null pointer when we're copying it below. */ buflen = jcf_path_max_len () + classname_length + 10; ! buffer = (char *) ALLOC (buflen); memset (buffer, 0, buflen); ! java_buffer = (char *) alloca (buflen); jcf->java_source = 0; --- 460,469 ---- /* Allocate and zero out the buffer, since we don't explicitly put a null pointer when we're copying it below. */ buflen = jcf_path_max_len () + classname_length + 10; ! buffer = ALLOC (buflen); memset (buffer, 0, buflen); ! java_buffer = alloca (buflen); jcf->java_source = 0; *************** DEFUN(find_class, (classname, classname_ *** 554,560 **** strcpy (java_buffer, path_name); l = strlen (java_buffer); for (m = 0; m < classname_length; ++m) ! java_buffer[m + l] = (classname[m] == '.' ? '/' : classname[m]); strcpy (java_buffer + m + l, ".java"); java = caching_stat (java_buffer, &java_buf); if (java == 0) --- 523,530 ---- strcpy (java_buffer, path_name); l = strlen (java_buffer); for (m = 0; m < classname_length; ++m) ! java_buffer[m + l] = (classname[m] == '.' ! ? DIR_SEPARATOR : classname[m]); strcpy (java_buffer + m + l, ".java"); java = caching_stat (java_buffer, &java_buf); if (java == 0) *************** DEFUN(find_class, (classname, classname_ *** 578,611 **** dep_file = java_buffer; else dep_file = buffer; - #if JCF_USE_STDIO - if (!class) - { - SOURCE_FRONTEND_DEBUG (("Trying %s", buffer)); - stream = fopen (buffer, "rb"); - if (stream) - goto found; - } - /* Give .java a try, if necessary */ - if (!java) - { - strcpy (buffer, java_buffer); - SOURCE_FRONTEND_DEBUG (("Trying %s", buffer)); - stream = fopen (buffer, "r"); - if (stream) - { - jcf->java_source = 1; - goto found; - } - } - #else if (!class) { SOURCE_FRONTEND_DEBUG ((stderr, "[Class selected: %s]\n", classname+classname_length- (classname_length <= 30 ? classname_length : 30))); ! fd = open (buffer, O_RDONLY | O_BINARY); if (fd >= 0) goto found; } --- 548,560 ---- dep_file = java_buffer; else dep_file = buffer; if (!class) { SOURCE_FRONTEND_DEBUG ((stderr, "[Class selected: %s]\n", classname+classname_length- (classname_length <= 30 ? classname_length : 30))); ! fd = JCF_OPEN_EXACT_CASE (buffer, O_RDONLY | O_BINARY); if (fd >= 0) goto found; } *************** DEFUN(find_class, (classname, classname_ *** 617,630 **** classname+classname_length- (classname_length <= 30 ? classname_length : 30))); ! fd = open (buffer, O_RDONLY); if (fd >= 0) { jcf->java_source = 1; goto found; } } - #endif free (buffer); --- 566,578 ---- classname+classname_length- (classname_length <= 30 ? classname_length : 30))); ! fd = JCF_OPEN_EXACT_CASE (buffer, O_RDONLY); if (fd >= 0) { jcf->java_source = 1; goto found; } } free (buffer); *************** DEFUN(find_class, (classname, classname_ *** 635,646 **** return NULL; found: - #if JCF_USE_STDIO - if (jcf->java_source) - return NULL; /* FIXME */ - else - return open_class (buffer, jcf, stream, dep_file); - #else if (jcf->java_source) { JCF_ZERO (jcf); /* JCF_FINISH relies on this */ --- 583,588 ---- *************** DEFUN(find_class, (classname, classname_ *** 652,658 **** buffer = (char *) open_class (buffer, jcf, fd, dep_file); jcf->classname = xstrdup (classname); return buffer; - #endif } void --- 594,599 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/jcf-parse.c gcc-3.3/gcc/java/jcf-parse.c *** gcc-3.2.3/gcc/java/jcf-parse.c 2002-04-22 20:36:47.000000000 +0000 --- gcc-3.3/gcc/java/jcf-parse.c 2003-02-03 14:06:32.000000000 +0000 *************** *** 1,5 **** /* Parser for Java(TM) .class files. ! Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Parser for Java(TM) .class files. ! Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU CC. *************** The Free Software Foundation is independ *** 28,33 **** --- 28,34 ---- #include "config.h" #include "system.h" #include "tree.h" + #include "real.h" #include "obstack.h" #include "flags.h" #include "java-except.h" *************** The Free Software Foundation is independ *** 43,49 **** #include #endif ! #ifdef HAVE_NL_LANGINFO #include #endif --- 44,50 ---- #include #endif ! #ifdef HAVE_LANGINFO_CODESET #include #endif *************** The Free Software Foundation is independ *** 65,79 **** #include "jcf.h" - extern struct obstack *saveable_obstack; extern struct obstack temporary_obstack; - extern struct obstack permanent_obstack; ! /* Set to non-zero value in order to emit class initilization code before static field references. */ extern int always_initialize_class_p; ! static tree parse_roots[3] = { NULL_TREE, NULL_TREE, NULL_TREE }; /* The FIELD_DECL for the current field. */ #define current_field parse_roots[0] --- 66,78 ---- #include "jcf.h" extern struct obstack temporary_obstack; ! /* Set to nonzero value in order to emit class initilization code before static field references. */ extern int always_initialize_class_p; ! static GTY(()) tree parse_roots[3]; /* The FIELD_DECL for the current field. */ #define current_field parse_roots[0] *************** set_source_filename (jcf, index) *** 192,200 **** DECL_LINENUMBERS_OFFSET (current_method) = 0) #define HANDLE_END_METHODS() \ ! { tree handle_type = CLASS_TO_HANDLE_TYPE (current_class); \ ! if (handle_type != current_class) layout_type (handle_type); \ ! current_method = NULL_TREE; } #define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH) \ { DECL_MAX_STACK (current_method) = (MAX_STACK); \ --- 191,197 ---- DECL_LINENUMBERS_OFFSET (current_method) = 0) #define HANDLE_END_METHODS() \ ! { current_method = NULL_TREE; } #define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH) \ { DECL_MAX_STACK (current_method) = (MAX_STACK); \ *************** set_source_filename (jcf, index) *** 247,254 **** #include "jcf-reader.c" - static int yydebug; - tree parse_signature (jcf, sig_index) JCF *jcf; --- 244,249 ---- *************** parse_signature (jcf, sig_index) *** 262,274 **** JPOOL_UTF_LENGTH (jcf, sig_index)); } - void - java_set_yydebug (value) - int value; - { - yydebug = value; - } - tree get_constant (jcf, index) JCF *jcf; --- 257,262 ---- *************** get_constant (jcf, index) *** 302,363 **** force_fit_type (value, 0); break; } ! #if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT case CONSTANT_Float: { jint num = JPOOL_INT(jcf, index); REAL_VALUE_TYPE d; ! #ifdef REAL_ARITHMETIC ! d = REAL_VALUE_FROM_TARGET_SINGLE (num); ! #else ! union { float f; jint i; } u; ! u.i = num; ! d = u.f; ! #endif value = build_real (float_type_node, d); break; } case CONSTANT_Double: { ! HOST_WIDE_INT num[2]; REAL_VALUE_TYPE d; - HOST_WIDE_INT lo, hi; - num[0] = JPOOL_UINT (jcf, index); - lshift_double (num[0], 0, 32, 64, &lo, &hi, 0); - num[0] = JPOOL_UINT (jcf, index+1); - add_double (lo, hi, num[0], 0, &lo, &hi); ! /* Since ereal_from_double expects an array of HOST_WIDE_INT ! in the target's format, we swap the elements for big endian ! targets, unless HOST_WIDE_INT is sufficiently large to ! contain a target double, in which case the 2nd element ! is ignored. ! FIXME: Is this always right for cross targets? */ ! if (FLOAT_WORDS_BIG_ENDIAN && sizeof(num[0]) < 8) ! { ! num[0] = hi; ! num[1] = lo; ! } else ! { ! num[0] = lo; ! num[1] = hi; ! } ! #ifdef REAL_ARITHMETIC ! d = REAL_VALUE_FROM_TARGET_DOUBLE (num); ! #else ! { ! union { double d; jint i[2]; } u; ! u.i[0] = (jint) num[0]; ! u.i[1] = (jint) num[1]; ! d = u.d; ! } ! #endif value = build_real (double_type_node, d); break; } ! #endif /* TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT */ case CONSTANT_String: { tree name = get_name_constant (jcf, JPOOL_USHORT1 (jcf, index)); --- 290,325 ---- force_fit_type (value, 0); break; } ! case CONSTANT_Float: { jint num = JPOOL_INT(jcf, index); + long buf = num; REAL_VALUE_TYPE d; ! ! real_from_target_fmt (&d, &buf, &ieee_single_format); value = build_real (float_type_node, d); break; } + case CONSTANT_Double: { ! long buf[2], lo, hi; REAL_VALUE_TYPE d; ! hi = JPOOL_UINT (jcf, index); ! lo = JPOOL_UINT (jcf, index+1); ! if (FLOAT_WORDS_BIG_ENDIAN) ! buf[0] = hi, buf[1] = lo; else ! buf[0] = lo, buf[1] = hi; ! ! real_from_target_fmt (&d, buf, &ieee_double_format); value = build_real (double_type_node, d); break; } ! case CONSTANT_String: { tree name = get_name_constant (jcf, JPOOL_USHORT1 (jcf, index)); *************** get_name_constant (jcf, index) *** 408,414 **** return name; } ! /* Handle reading innerclass attributes. If a non zero entry (denoting a non anonymous entry) is found, We augment the inner class list of the outer context with the newly resolved innerclass. */ --- 370,376 ---- return name; } ! /* Handle reading innerclass attributes. If a nonzero entry (denoting a non anonymous entry) is found, We augment the inner class list of the outer context with the newly resolved innerclass. */ *************** read_class (name) *** 586,591 **** --- 548,557 ---- read_zip_member(current_jcf, current_jcf->zipd, current_jcf->zipd->zipf); jcf_parse (current_jcf); + /* Parsing might change the class, in which case we have to + put it back where we found it. */ + if (current_class != class && icv != NULL_TREE) + TREE_TYPE (icv) = current_class; class = current_class; java_pop_parser_context (0); java_parser_context_restore_global (); *************** load_class (class_or_name, verbose) *** 635,643 **** break; /* We failed loading name. Now consider that we might be looking ! for a inner class. */ if ((separator = strrchr (IDENTIFIER_POINTER (name), '$')) ! || (separator = strrchr (IDENTIFIER_POINTER (name), '.'))) { int c = *separator; *separator = '\0'; --- 601,609 ---- break; /* We failed loading name. Now consider that we might be looking ! for a inner class. */ if ((separator = strrchr (IDENTIFIER_POINTER (name), '$')) ! || (separator = strrchr (IDENTIFIER_POINTER (name), '.'))) { int c = *separator; *separator = '\0'; *************** void *** 746,752 **** init_outgoing_cpool () { current_constant_pool_data_ref = NULL_TREE; ! outgoing_cpool = (struct CPool *)xmalloc (sizeof (struct CPool)); memset (outgoing_cpool, 0, sizeof (struct CPool)); } --- 712,718 ---- init_outgoing_cpool () { current_constant_pool_data_ref = NULL_TREE; ! outgoing_cpool = xmalloc (sizeof (struct CPool)); memset (outgoing_cpool, 0, sizeof (struct CPool)); } *************** parse_class_file () *** 768,779 **** compiling from class files. */ always_initialize_class_p = 1; ! for (field = TYPE_FIELDS (CLASS_TO_HANDLE_TYPE (current_class)); field != NULL_TREE; field = TREE_CHAIN (field)) if (FIELD_STATIC (field)) DECL_EXTERNAL (field) = 0; ! for (method = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class)); method != NULL_TREE; method = TREE_CHAIN (method)) { JCF *jcf = current_jcf; --- 734,745 ---- compiling from class files. */ always_initialize_class_p = 1; ! for (field = TYPE_FIELDS (current_class); field != NULL_TREE; field = TREE_CHAIN (field)) if (FIELD_STATIC (field)) DECL_EXTERNAL (field) = 0; ! for (method = TYPE_METHODS (current_class); method != NULL_TREE; method = TREE_CHAIN (method)) { JCF *jcf = current_jcf; *************** parse_source_file_1 (file, finput) *** 876,882 **** /* There's no point in trying to find the current encoding unless we are going to do something intelligent with it -- hence the test for iconv. */ ! #if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_NL_LANGINFO) setlocale (LC_CTYPE, ""); if (current_encoding == NULL) current_encoding = nl_langinfo (CODESET); --- 842,848 ---- /* There's no point in trying to find the current encoding unless we are going to do something intelligent with it -- hence the test for iconv. */ ! #if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_LANGINFO_CODESET) setlocale (LC_CTYPE, ""); if (current_encoding == NULL) current_encoding = nl_langinfo (CODESET); *************** predefined_filename_p (node) *** 934,941 **** return 0; } ! int ! yyparse () { int filename_count = 0; char *list, *next; --- 900,908 ---- return 0; } ! void ! java_parse_file (set_yydebug) ! int set_yydebug ATTRIBUTE_UNUSED; { int filename_count = 0; char *list, *next; *************** yyparse () *** 1072,1078 **** resource_filename = IDENTIFIER_POINTER (TREE_VALUE (current_file_list)); compile_resource_file (resource_name, resource_filename); ! return 0; } current_jcf = main_jcf; --- 1039,1045 ---- resource_filename = IDENTIFIER_POINTER (TREE_VALUE (current_file_list)); compile_resource_file (resource_name, resource_filename); ! return; } current_jcf = main_jcf; *************** yyparse () *** 1096,1102 **** fatal_io_error ("can't open %s", IDENTIFIER_POINTER (name)); #ifdef IO_BUFFER_SIZE ! setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE); #endif input_filename = IDENTIFIER_POINTER (name); --- 1063,1069 ---- fatal_io_error ("can't open %s", IDENTIFIER_POINTER (name)); #ifdef IO_BUFFER_SIZE ! setvbuf (finput, xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE); #endif input_filename = IDENTIFIER_POINTER (name); *************** yyparse () *** 1153,1159 **** parse_source_file_2 (); } ! for (ctxp = ctxp_for_generation; ctxp; ctxp = ctxp->next) { input_filename = ctxp->filename; parse_source_file_3 (); --- 1120,1126 ---- parse_source_file_2 (); } ! for (ctxp = ctxp_for_generation; ctxp; ctxp = ctxp->next) { input_filename = ctxp->filename; parse_source_file_3 (); *************** yyparse () *** 1181,1187 **** if (flag_indirect_dispatch) emit_offset_symbol_table (); } - return 0; } /* Process all class entries found in the zip file. */ --- 1148,1153 ---- *************** void *** 1293,1301 **** init_jcf_parse () { /* Register roots with the garbage collector. */ - ggc_add_tree_root (parse_roots, sizeof (parse_roots) / sizeof(tree)); - ggc_add_root (¤t_jcf, 1, sizeof (JCF), (void (*)(void *))ggc_mark_jcf); init_src_parse (); } --- 1259,1267 ---- init_jcf_parse () { /* Register roots with the garbage collector. */ ggc_add_root (¤t_jcf, 1, sizeof (JCF), (void (*)(void *))ggc_mark_jcf); init_src_parse (); } + + #include "gt-java-jcf-parse.h" diff -Nrc3pad gcc-3.2.3/gcc/java/jcf-path.c gcc-3.3/gcc/java/jcf-path.c *** gcc-3.2.3/gcc/java/jcf-path.c 2002-06-08 16:33:46.000000000 +0000 --- gcc-3.3/gcc/java/jcf-path.c 2003-03-07 04:39:46.000000000 +0000 *************** *** 1,6 **** /* Handle CLASSPATH, -classpath, and path searching. ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,7 ---- /* Handle CLASSPATH, -classpath, and path searching. ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software ! Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** The Free Software Foundation is independ *** 30,41 **** #include "jcf.h" - /* Some boilerplate that really belongs in a header. */ - - #ifndef GET_ENV_PATH_LIST - #define GET_ENV_PATH_LIST(VAR,NAME) do { (VAR) = getenv (NAME); } while (0) - #endif - /* By default, colon separates directories in a path. */ #ifndef PATH_SEPARATOR #define PATH_SEPARATOR ':' --- 31,36 ---- *************** add_entry (entp, filename, is_system) *** 149,177 **** int len; struct entry *n; ! n = (struct entry *) ALLOC (sizeof (struct entry)); n->flags = is_system ? FLAG_SYSTEM : 0; n->next = NULL; len = strlen (filename); ! if (len > 4 && (strcmp (filename + len - 4, ".zip") == 0 ! || strcmp (filename + len - 4, ".jar") == 0)) { n->flags |= FLAG_ZIP; /* If the user uses -classpath then he'll have to include libgcj.jar in the value. We check for this in a simplistic way. Symlinks will fool this test. This is only used for -MM and -MMD, so it probably isn't terribly important. */ ! if (! strcmp (filename, LIBGCJ_ZIP_FILE)) n->flags |= FLAG_SYSTEM; } /* Note that we add a trailing separator to `.zip' names as well. This is a little hack that lets the searching code in jcf-io.c work more easily. Eww. */ ! if (filename[len - 1] != '/' && filename[len - 1] != DIR_SEPARATOR) { ! char *f2 = (char *) alloca (len + 2); strcpy (f2, filename); f2[len] = DIR_SEPARATOR; f2[len + 1] = '\0'; --- 144,173 ---- int len; struct entry *n; ! n = ALLOC (sizeof (struct entry)); n->flags = is_system ? FLAG_SYSTEM : 0; n->next = NULL; len = strlen (filename); ! ! if (len > 4 && (COMPARE_FILENAMES (filename + len - 4, ".zip") == 0 ! || COMPARE_FILENAMES (filename + len - 4, ".jar") == 0)) { n->flags |= FLAG_ZIP; /* If the user uses -classpath then he'll have to include libgcj.jar in the value. We check for this in a simplistic way. Symlinks will fool this test. This is only used for -MM and -MMD, so it probably isn't terribly important. */ ! if (! COMPARE_FILENAMES (filename, LIBGCJ_ZIP_FILE)) n->flags |= FLAG_SYSTEM; } /* Note that we add a trailing separator to `.zip' names as well. This is a little hack that lets the searching code in jcf-io.c work more easily. Eww. */ ! if (! IS_DIR_SEPARATOR (filename[len - 1])) { ! char *f2 = alloca (len + 2); strcpy (f2, filename); f2[len] = DIR_SEPARATOR; f2[len + 1] = '\0'; *************** add_path (entp, cp, is_system) *** 197,203 **** if (cp) { ! char *buf = (char *) alloca (strlen (cp) + 3); startp = endp = cp; while (1) { --- 193,199 ---- if (cp) { ! char *buf = alloca (strlen (cp) + 3); startp = endp = cp; while (1) { *************** jcf_path_init () *** 244,250 **** sep[0] = DIR_SEPARATOR; sep[1] = '\0'; ! GET_ENV_PATH_LIST (cp, "GCC_EXEC_PREFIX"); if (cp) { try = alloca (strlen (cp) + 50); --- 240,246 ---- sep[0] = DIR_SEPARATOR; sep[1] = '\0'; ! GET_ENVIRONMENT (cp, "GCC_EXEC_PREFIX"); if (cp) { try = alloca (strlen (cp) + 50); *************** jcf_path_init () *** 305,311 **** /* Desperation: use the installed one. */ char *extdirs; add_entry (&sys_dirs, LIBGCJ_ZIP_FILE, 1); ! extdirs = (char *) alloca (strlen (LIBGCJ_ZIP_FILE) + 1); strcpy (extdirs, LIBGCJ_ZIP_FILE); strcpy (&extdirs[strlen (LIBGCJ_ZIP_FILE) - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")], --- 301,307 ---- /* Desperation: use the installed one. */ char *extdirs; add_entry (&sys_dirs, LIBGCJ_ZIP_FILE, 1); ! extdirs = alloca (strlen (LIBGCJ_ZIP_FILE) + 1); strcpy (extdirs, LIBGCJ_ZIP_FILE); strcpy (&extdirs[strlen (LIBGCJ_ZIP_FILE) - strlen ("libgcj-" DEFAULT_TARGET_VERSION ".jar")], *************** jcf_path_init () *** 315,321 **** jcf_path_extdirs_arg (extdirs); } ! GET_ENV_PATH_LIST (cp, "CLASSPATH"); add_path (&classpath_env, cp, 0); } --- 311,317 ---- jcf_path_extdirs_arg (extdirs); } ! GET_ENVIRONMENT (cp, "CLASSPATH"); add_path (&classpath_env, cp, 0); } *************** jcf_path_extdirs_arg (cp) *** 352,358 **** if (cp) { ! char *buf = (char *) alloca (strlen (cp) + 3); startp = endp = cp; while (1) { --- 348,354 ---- if (cp) { ! char *buf = alloca (strlen (cp) + 3); startp = endp = cp; while (1) { *************** jcf_path_extdirs_arg (cp) *** 381,391 **** if (direntp->d_name[0] != '.') { ! char *name = ! (char *) alloca (dirname_length ! + strlen (direntp->d_name) + 2); strcpy (name, buf); ! if (name[dirname_length-1] != DIR_SEPARATOR) { name[dirname_length] = DIR_SEPARATOR; name[dirname_length+1] = 0; --- 377,386 ---- if (direntp->d_name[0] != '.') { ! char *name = alloca (dirname_length ! + strlen (direntp->d_name) + 2); strcpy (name, buf); ! if (! IS_DIR_SEPARATOR (name[dirname_length-1])) { name[dirname_length] = DIR_SEPARATOR; name[dirname_length+1] = 0; diff -Nrc3pad gcc-3.2.3/gcc/java/jcf-reader.c gcc-3.3/gcc/java/jcf-reader.c *** gcc-3.2.3/gcc/java/jcf-reader.c 2001-03-23 19:42:25.000000000 +0000 --- gcc-3.3/gcc/java/jcf-reader.c 2002-11-25 14:22:06.000000000 +0000 *************** skip_attribute (jcf, number_of_attribute *** 96,104 **** { while (number_of_attribute--) { JCF_FILL (jcf, 6); (void) JCF_readu2 (jcf); ! JCF_SKIP (jcf, JCF_readu4 (jcf)); } } #endif --- 96,106 ---- { while (number_of_attribute--) { + JCF_u4 N; JCF_FILL (jcf, 6); (void) JCF_readu2 (jcf); ! N = JCF_readu4 (jcf); ! JCF_SKIP (jcf, N); } } #endif diff -Nrc3pad gcc-3.2.3/gcc/java/jcf-write.c gcc-3.3/gcc/java/jcf-write.c *** gcc-3.2.3/gcc/java/jcf-write.c 2002-06-04 16:45:54.000000000 +0000 --- gcc-3.3/gcc/java/jcf-write.c 2003-04-10 14:54:08.000000000 +0000 *************** struct jcf_partial *** 276,281 **** --- 276,284 ---- /* Information about the current switch statement. */ struct jcf_switch_state *sw_state; + + /* The count of jsr instructions that have been emmitted. */ + long num_jsrs; }; static void generate_bytecode_insns PARAMS ((tree, int, struct jcf_partial *)); *************** static void define_jcf_label PARAMS ((st *** 292,298 **** static struct jcf_block * get_jcf_label_here PARAMS ((struct jcf_partial *)); static void put_linenumber PARAMS ((int, struct jcf_partial *)); static void localvar_alloc PARAMS ((tree, struct jcf_partial *)); ! static void localvar_free PARAMS ((tree, struct jcf_partial *)); static int get_access_flags PARAMS ((tree)); static void write_chunks PARAMS ((FILE *, struct chunk *)); static int adjust_typed_op PARAMS ((tree, int)); --- 295,301 ---- static struct jcf_block * get_jcf_label_here PARAMS ((struct jcf_partial *)); static void put_linenumber PARAMS ((int, struct jcf_partial *)); static void localvar_alloc PARAMS ((tree, struct jcf_partial *)); ! static void maybe_free_localvar PARAMS ((tree, struct jcf_partial *, int)); static int get_access_flags PARAMS ((tree)); static void write_chunks PARAMS ((FILE *, struct chunk *)); static int adjust_typed_op PARAMS ((tree, int)); *************** localvar_alloc (decl, state) *** 626,634 **** } static void ! localvar_free (decl, state) tree decl; struct jcf_partial *state; { struct jcf_block *end_label = get_jcf_label_here (state); int index = DECL_LOCAL_INDEX (decl); --- 629,638 ---- } static void ! maybe_free_localvar (decl, state, really) tree decl; struct jcf_partial *state; + int really; { struct jcf_block *end_label = get_jcf_label_here (state); int index = DECL_LOCAL_INDEX (decl); *************** localvar_free (decl, state) *** 640,645 **** --- 644,651 ---- if (info->decl != decl) abort (); + if (! really) + return; ptr[0] = NULL; if (wide) { *************** get_access_flags (decl) *** 683,688 **** --- 689,698 ---- flags |= ACC_INTERFACE; if (CLASS_STATIC (decl)) flags |= ACC_STATIC; + if (CLASS_PRIVATE (decl)) + flags |= ACC_PRIVATE; + if (CLASS_PROTECTED (decl)) + flags |= ACC_PROTECTED; if (ANONYMOUS_CLASS_P (TREE_TYPE (decl)) || LOCAL_CLASS_P (TREE_TYPE (decl))) flags |= ACC_PRIVATE; *************** find_constant_index (value, state) *** 822,842 **** else if (TREE_CODE (value) == REAL_CST) { long words[2]; if (TYPE_PRECISION (TREE_TYPE (value)) == 32) ! { ! words[0] = etarsingle (TREE_REAL_CST (value)) & 0xFFFFFFFF; ! return find_constant1 (&state->cpool, CONSTANT_Float, ! (jword)words[0]); ! } else ! { ! etardouble (TREE_REAL_CST (value), words); ! return find_constant2 (&state->cpool, CONSTANT_Double, ! (jword)(words[1-FLOAT_WORDS_BIG_ENDIAN] & ! 0xFFFFFFFF), ! (jword)(words[FLOAT_WORDS_BIG_ENDIAN] & ! 0xFFFFFFFF)); ! } } else if (TREE_CODE (value) == STRING_CST) return find_string_constant (&state->cpool, value); --- 832,849 ---- else if (TREE_CODE (value) == REAL_CST) { long words[2]; + + real_to_target (words, &TREE_REAL_CST (value), + TYPE_MODE (TREE_TYPE (value))); + words[0] &= 0xffffffff; + words[1] &= 0xffffffff; + if (TYPE_PRECISION (TREE_TYPE (value)) == 32) ! return find_constant1 (&state->cpool, CONSTANT_Float, (jword)words[0]); else ! return find_constant2 (&state->cpool, CONSTANT_Double, ! (jword)words[1-FLOAT_WORDS_BIG_ENDIAN], ! (jword)words[FLOAT_WORDS_BIG_ENDIAN]); } else if (TREE_CODE (value) == STRING_CST) return find_string_constant (&state->cpool, value); *************** emit_jsr (target, state) *** 1143,1148 **** --- 1150,1156 ---- OP1 (OPCODE_jsr); /* Value is 1 byte from reloc back to start of instruction. */ emit_reloc (RELOCATION_VALUE_1, OPCODE_jsr_w, target, state); + state->num_jsrs++; } /* Generate code to evaluate EXP. If the result is true, *************** generate_bytecode_return (exp, state) *** 1430,1436 **** emit_store (state->return_value_decl, state); call_cleanups (NULL, state); emit_load (state->return_value_decl, state); ! /* If we call localvar_free (state->return_value_decl, state), then we risk the save decl erroneously re-used in the finalizer. Instead, we keep the state->return_value_decl allocated through the rest of the method. This is not --- 1438,1444 ---- emit_store (state->return_value_decl, state); call_cleanups (NULL, state); emit_load (state->return_value_decl, state); ! /* If we call maybe_free_localvar (state->return_value_decl, state, 1), then we risk the save decl erroneously re-used in the finalizer. Instead, we keep the state->return_value_decl allocated through the rest of the method. This is not *************** generate_bytecode_insns (exp, target, st *** 1470,1475 **** --- 1478,1484 ---- { tree local; tree body = BLOCK_EXPR_BODY (exp); + long jsrs = state->num_jsrs; for (local = BLOCK_EXPR_DECLS (exp); local; ) { tree next = TREE_CHAIN (local); *************** generate_bytecode_insns (exp, target, st *** 1483,1492 **** body = TREE_OPERAND (body, 1); } generate_bytecode_insns (body, target, state); for (local = BLOCK_EXPR_DECLS (exp); local; ) { tree next = TREE_CHAIN (local); ! localvar_free (local, state); local = next; } } --- 1492,1502 ---- body = TREE_OPERAND (body, 1); } generate_bytecode_insns (body, target, state); + for (local = BLOCK_EXPR_DECLS (exp); local; ) { tree next = TREE_CHAIN (local); ! maybe_free_localvar (local, state, state->num_jsrs <= jsrs); local = next; } } *************** generate_bytecode_insns (exp, target, st *** 1743,1748 **** --- 1753,1759 ---- else { HOST_WIDE_INT i; + unsigned HOST_WIDE_INT delta; /* Copy the chain of relocs into a sorted array. */ struct jcf_relocation **relocs = (struct jcf_relocation **) xmalloc (sw_state.num_cases * sizeof (struct jcf_relocation *)); *************** generate_bytecode_insns (exp, target, st *** 1775,1782 **** handled by the parser. */ } ! if (2 * sw_state.num_cases ! >= sw_state.max_case - sw_state.min_case) { /* Use tableswitch. */ int index = 0; RESERVE (13 + 4 * (sw_state.max_case - sw_state.min_case + 1)); --- 1786,1796 ---- handled by the parser. */ } ! /* We could have DELTA < 0 if sw_state.min_case is ! something like Integer.MIN_VALUE. That is why delta is ! unsigned. */ ! delta = sw_state.max_case - sw_state.min_case; ! if (2 * (unsigned) sw_state.num_cases >= delta) { /* Use tableswitch. */ int index = 0; RESERVE (13 + 4 * (sw_state.max_case - sw_state.min_case + 1)); *************** generate_bytecode_insns (exp, target, st *** 2436,2443 **** if (CAN_COMPLETE_NORMALLY (finally)) { maybe_wide (OPCODE_ret, DECL_LOCAL_INDEX (return_link), state); ! localvar_free (exception_decl, state); ! localvar_free (return_link, state); define_jcf_label (finished_label, state); } } --- 2450,2457 ---- if (CAN_COMPLETE_NORMALLY (finally)) { maybe_wide (OPCODE_ret, DECL_LOCAL_INDEX (return_link), state); ! maybe_free_localvar (exception_decl, state, 1); ! maybe_free_localvar (return_link, state, 1); define_jcf_label (finished_label, state); } } *************** perform_relocations (state) *** 2677,2682 **** --- 2691,2727 ---- shrink += 3; } + /* Optimize GOTO L; ... L: GOTO X by changing the first goto to + jump directly to X. We're careful here to avoid an infinite + loop if the `goto's themselves form one. We do this + optimization because we can generate a goto-to-goto for some + try/finally blocks. */ + while (reloc != NULL + && reloc->kind == OPCODE_goto_w + && reloc->label != block + && reloc->label->v.chunk->data != NULL + && reloc->label->v.chunk->data[0] == OPCODE_goto) + { + /* Find the reloc for the first instruction of the + destination block. */ + struct jcf_relocation *first_reloc; + for (first_reloc = reloc->label->u.relocations; + first_reloc; + first_reloc = first_reloc->next) + { + if (first_reloc->offset == 1 + && first_reloc->kind == OPCODE_goto_w) + { + reloc->label = first_reloc->label; + break; + } + } + + /* If we didn't do anything, exit the loop. */ + if (first_reloc == NULL) + break; + } + for (reloc = block->u.relocations; reloc != NULL; reloc = reloc->next) { if (reloc->kind == SWITCH_ALIGN_RELOC) *************** release_jcf_state (state) *** 2853,2858 **** --- 2898,2904 ---- in the .class file representation. The list can be written to a .class file using write_chunks. Allocate chunks from obstack WORK. */ + static GTY(()) tree SourceFile_node; static struct chunk * generate_classfile (clas, state) tree clas; *************** generate_classfile (clas, state) *** 2866,2872 **** int fields_count = 0; char *methods_count_ptr; int methods_count = 0; - static tree SourceFile_node = NULL_TREE; tree part; int total_supers = clas == object_type_node ? 0 --- 2912,2917 ---- *************** generate_classfile (clas, state) *** 2931,2937 **** if (have_value) attr_count++; ! if (FIELD_THISN (part) || FIELD_LOCAL_ALIAS (part)) attr_count++; PUT2 (attr_count); /* attributes_count */ --- 2976,2982 ---- if (have_value) attr_count++; ! if (FIELD_THISN (part) || FIELD_LOCAL_ALIAS (part) || FIELD_SYNTHETIC (part)) attr_count++; PUT2 (attr_count); /* attributes_count */ *************** generate_classfile (clas, state) *** 2949,2956 **** PUT4 (2); /* attribute_length */ i = find_constant_index (init, state); PUT2 (i); } ! /* Emit the "Synthetic" attribute for val$ and this$ fields. */ ! if (FIELD_THISN (part) || FIELD_LOCAL_ALIAS (part)) ptr = append_synthetic_attribute (state); fields_count++; } --- 2994,3003 ---- PUT4 (2); /* attribute_length */ i = find_constant_index (init, state); PUT2 (i); } ! /* Emit the "Synthetic" attribute for val$ and this$ ! fields and other fields which need it. */ ! if (FIELD_THISN (part) || FIELD_LOCAL_ALIAS (part) ! || FIELD_SYNTHETIC (part)) ptr = append_synthetic_attribute (state); fields_count++; } *************** generate_classfile (clas, state) *** 3009,3014 **** --- 3056,3062 ---- get_jcf_label_here (state); /* Force a first block. */ for (t = DECL_ARGUMENTS (part); t != NULL_TREE; t = TREE_CHAIN (t)) localvar_alloc (t, state); + state->num_jsrs = 0; generate_bytecode_insns (body, IGNORE_TARGET, state); if (CAN_COMPLETE_NORMALLY (body)) { *************** generate_classfile (clas, state) *** 3018,3026 **** OP1 (OPCODE_return); } for (t = DECL_ARGUMENTS (part); t != NULL_TREE; t = TREE_CHAIN (t)) ! localvar_free (t, state); if (state->return_value_decl != NULL_TREE) ! localvar_free (state->return_value_decl, state); finish_jcf_block (state); perform_relocations (state); --- 3066,3074 ---- OP1 (OPCODE_return); } for (t = DECL_ARGUMENTS (part); t != NULL_TREE; t = TREE_CHAIN (t)) ! maybe_free_localvar (t, state, 1); if (state->return_value_decl != NULL_TREE) ! maybe_free_localvar (state->return_value_decl, state, 1); finish_jcf_block (state); perform_relocations (state); *************** generate_classfile (clas, state) *** 3154,3160 **** if (SourceFile_node == NULL_TREE) { SourceFile_node = get_identifier ("SourceFile"); - ggc_add_tree_root (&SourceFile_node, 1); } i = find_utf8_constant (&state->cpool, SourceFile_node); --- 3202,3207 ---- *************** generate_classfile (clas, state) *** 3174,3191 **** return state->first; } static unsigned char * append_synthetic_attribute (state) struct jcf_partial *state; { - static tree Synthetic_node = NULL_TREE; unsigned char *ptr = append_chunk (NULL, 6, state); int i; if (Synthetic_node == NULL_TREE) { Synthetic_node = get_identifier ("Synthetic"); - ggc_add_tree_root (&Synthetic_node, 1); } i = find_utf8_constant (&state->cpool, Synthetic_node); PUT2 (i); /* Attribute string index */ --- 3221,3237 ---- return state->first; } + static GTY(()) tree Synthetic_node; static unsigned char * append_synthetic_attribute (state) struct jcf_partial *state; { unsigned char *ptr = append_chunk (NULL, 6, state); int i; if (Synthetic_node == NULL_TREE) { Synthetic_node = get_identifier ("Synthetic"); } i = find_utf8_constant (&state->cpool, Synthetic_node); PUT2 (i); /* Attribute string index */ *************** append_gcj_attribute (state, class) *** 3212,3223 **** PUT4 (0); /* Attribute length */ } static void append_innerclasses_attribute (state, class) struct jcf_partial *state; tree class; { - static tree InnerClasses_node = NULL_TREE; tree orig_decl = TYPE_NAME (class); tree current, decl; int length = 0, i; --- 3258,3269 ---- PUT4 (0); /* Attribute length */ } + static tree InnerClasses_node; static void append_innerclasses_attribute (state, class) struct jcf_partial *state; tree class; { tree orig_decl = TYPE_NAME (class); tree current, decl; int length = 0, i; *************** append_innerclasses_attribute (state, cl *** 3231,3237 **** if (InnerClasses_node == NULL_TREE) { InnerClasses_node = get_identifier ("InnerClasses"); - ggc_add_tree_root (&InnerClasses_node, 1); } i = find_utf8_constant (&state->cpool, InnerClasses_node); PUT2 (i); --- 3277,3282 ---- *************** make_class_file_name (clas) *** 3302,3307 **** --- 3347,3353 ---- const char *dname, *cname, *slash; char *r; struct stat sb; + char sep; cname = IDENTIFIER_POINTER (identifier_subst (DECL_NAME (TYPE_NAME (clas)), "", '.', DIR_SEPARATOR, *************** make_class_file_name (clas) *** 3313,3336 **** char *t; dname = DECL_SOURCE_FILE (TYPE_NAME (clas)); slash = strrchr (dname, DIR_SEPARATOR); if (! slash) ! { ! dname = "."; ! slash = dname + 1; ! } t = strrchr (cname, DIR_SEPARATOR); if (t) cname = t + 1; } else { dname = jcf_write_base_directory; slash = dname + strlen (dname); } r = xmalloc (slash - dname + strlen (cname) + 2); strncpy (r, dname, slash - dname); ! r[slash - dname] = DIR_SEPARATOR; strcpy (&r[slash - dname + 1], cname); /* We try to make new directories when we need them. We only do --- 3359,3403 ---- char *t; dname = DECL_SOURCE_FILE (TYPE_NAME (clas)); slash = strrchr (dname, DIR_SEPARATOR); + #ifdef DIR_SEPARATOR_2 if (! slash) ! slash = strrchr (dname, DIR_SEPARATOR_2); ! #endif ! if (! slash) ! { ! dname = "."; ! slash = dname + 1; ! sep = DIR_SEPARATOR; ! } ! else ! sep = *slash; ! t = strrchr (cname, DIR_SEPARATOR); if (t) cname = t + 1; } else { + char *s; + dname = jcf_write_base_directory; + + s = strrchr (dname, DIR_SEPARATOR); + #ifdef DIR_SEPARATOR_2 + if (! s) + s = strrchr (dname, DIR_SEPARATOR_2); + #endif + if (s) + sep = *s; + else + sep = DIR_SEPARATOR; + slash = dname + strlen (dname); } r = xmalloc (slash - dname + strlen (cname) + 2); strncpy (r, dname, slash - dname); ! r[slash - dname] = sep; strcpy (&r[slash - dname + 1], cname); /* We try to make new directories when we need them. We only do *************** make_class_file_name (clas) *** 3342,3348 **** dname = r + (slash - dname) + 1; while (1) { ! char *s = strchr (dname, DIR_SEPARATOR); if (s == NULL) break; *s = '\0'; --- 3409,3415 ---- dname = r + (slash - dname) + 1; while (1) { ! char *s = strchr (dname, sep); if (s == NULL) break; *s = '\0'; *************** make_class_file_name (clas) *** 3351,3359 **** && mkdir (r, 0755) == -1) fatal_io_error ("can't create directory %s", r); ! *s = DIR_SEPARATOR; /* Skip consecutive separators. */ ! for (dname = s + 1; *dname && *dname == DIR_SEPARATOR; ++dname) ; } --- 3418,3426 ---- && mkdir (r, 0755) == -1) fatal_io_error ("can't create directory %s", r); ! *s = sep; /* Skip consecutive separators. */ ! for (dname = s + 1; *dname && *dname == sep; ++dname) ; } *************** write_classfile (clas) *** 3391,3396 **** --- 3458,3472 ---- write_chunks (stream, chunks); if (fclose (stream)) fatal_io_error ("error closing %s", temporary_file_name); + + /* If a file named by the string pointed to by `new' exists + prior to the call to the `rename' function, the bahaviour + is implementation-defined. ISO 9899-1990 7.9.4.2. + + For example, on Win32 with MSVCRT, it is an error. */ + + unlink (class_file_name); + if (rename (temporary_file_name, class_file_name) == -1) { remove (temporary_file_name); *************** write_classfile (clas) *** 3406,3408 **** --- 3482,3486 ---- string concatenation synchronized statement */ + + #include "gt-java-jcf-write.h" diff -Nrc3pad gcc-3.2.3/gcc/java/jv-convert.1 gcc-3.3/gcc/java/jv-convert.1 *** gcc-3.2.3/gcc/java/jv-convert.1 2003-04-22 07:07:38.000000000 +0000 --- gcc-3.3/gcc/java/jv-convert.1 2003-05-14 00:32:12.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:38 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,147 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "JV-CONVERT 1" ! .TH JV-CONVERT 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" ! jv-convert \- Convert file from one encoding to another .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBjv-convert\fR [\fB\s-1OPTION\s0\fR] ... [\fI\s-1INPUTFILE\s0\fR [\fI\s-1OUTPUTFILE\s0\fR]] --- 126,137 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "JV-CONVERT 1" ! .TH JV-CONVERT 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" ! jv\-convert \- Convert file from one encoding to another .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBjv-convert\fR [\fB\s-1OPTION\s0\fR] ... [\fI\s-1INPUTFILE\s0\fR [\fI\s-1OUTPUTFILE\s0\fR]] *************** jv-convert \- Convert file from one enco *** 151,198 **** converts a file from one encoding to another. It is similar to the Unix \&\fBiconv\fR utility. .PP ! The encodings supported by \fBjv-convert\fR are platform-dependent. Currently there is no way to get a list of all supported encodings. .SH "OPTIONS" .IX Header "OPTIONS" ! .Ip "\fB\*(--encoding\fR \fIname\fR" 4 ! .IX Item "encoding name" .PD 0 ! .Ip "\fB\*(--from\fR \fIname\fR" 4 ! .IX Item "from name" .PD Use \fIname\fR as the input encoding. The default is the current locale's encoding. ! .Ip "\fB\*(--to\fR \fIname\fR" 4 ! .IX Item "to name" Use \fIname\fR as the output encoding. The default is the \&\f(CW\*(C`JavaSrc\*(C'\fR encoding; this is \s-1ASCII\s0 with \fB\eu\fR escapes for non-ASCII characters. ! .Ip "\fB\-i\fR \fIfile\fR" 4 .IX Item "-i file" Read from \fIfile\fR. The default is to read from standard input. ! .Ip "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" Write to \fIfile\fR. The default is to write to standard output. ! .Ip "\fB\*(--reverse\fR" 4 ! .IX Item "reverse" Swap the input and output encodings. ! .Ip "\fB\*(--help\fR" 4 ! .IX Item "help" Print a help message, then exit. ! .Ip "\fB\*(--version\fR" 4 ! .IX Item "version" Print version information, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 141,202 ---- converts a file from one encoding to another. It is similar to the Unix \&\fBiconv\fR utility. .PP ! The encodings supported by \fBjv-convert\fR are platform\-dependent. Currently there is no way to get a list of all supported encodings. .SH "OPTIONS" .IX Header "OPTIONS" ! .IP "\fB\-\-encoding\fR \fIname\fR" 4 ! .IX Item "--encoding name" .PD 0 ! .IP "\fB\-\-from\fR \fIname\fR" 4 ! .IX Item "--from name" .PD Use \fIname\fR as the input encoding. The default is the current locale's encoding. ! .IP "\fB\-\-to\fR \fIname\fR" 4 ! .IX Item "--to name" Use \fIname\fR as the output encoding. The default is the \&\f(CW\*(C`JavaSrc\*(C'\fR encoding; this is \s-1ASCII\s0 with \fB\eu\fR escapes for non-ASCII characters. ! .IP "\fB\-i\fR \fIfile\fR" 4 .IX Item "-i file" Read from \fIfile\fR. The default is to read from standard input. ! .IP "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" Write to \fIfile\fR. The default is to write to standard output. ! .IP "\fB\-\-reverse\fR" 4 ! .IX Item "--reverse" Swap the input and output encodings. ! .IP "\fB\-\-help\fR" 4 ! .IX Item "--help" Print a help message, then exit. ! .IP "\fB\-\-version\fR" 4 ! .IX Item "--version" Print version information, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/jv-scan.1 gcc-3.3/gcc/java/jv-scan.1 *** gcc-3.2.3/gcc/java/jv-scan.1 2003-04-22 07:07:37.000000000 +0000 --- gcc-3.3/gcc/java/jv-scan.1 2003-05-14 00:32:10.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:37 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,152 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "JV-SCAN 1" ! .TH JV-SCAN 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" ! jv-scan \- print information about Java source file .SH "SYNOPSIS" .IX Header "SYNOPSIS" ! jv-scan [\fB\*(--complexity\fR] [\fB\*(--encoding\fR=\fIname\fR] ! [\fB\*(--print-main\fR] [\fB\*(--list-class\fR] [\fB\*(--list-filename\fR] ! [\fB\*(--version\fR] [\fB\*(--help\fR] [\fB\-o\fR \fIfile\fR] \fIinputfile\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" --- 126,143 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "JV-SCAN 1" ! .TH JV-SCAN 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" ! jv\-scan \- print information about Java source file .SH "SYNOPSIS" .IX Header "SYNOPSIS" ! jv-scan [\fB\-\-no\-assert\fR] [\fB\-\-complexity\fR] ! [\fB\-\-encoding\fR=\fIname\fR] [\fB\-\-print\-main\fR] ! [\fB\-\-list\-class\fR] [\fB\-\-list\-filename\fR] ! [\fB\-\-version\fR] [\fB\-\-help\fR] [\fB\-o\fR \fIfile\fR] \fIinputfile\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" *************** The \f(CW\*(C`jv\-scan\*(C'\fR program c *** 154,198 **** source file (\fI.java\fR file). .SH "OPTIONS" .IX Header "OPTIONS" ! .Ip "\fB\*(--complexity\fR" 4 ! .IX Item "complexity" This prints a complexity measure, related to cyclomatic complexity, for each input file. ! .Ip "\fB\*(--encoding=\fR\fIname\fR" 4 ! .IX Item "encoding=name" This works like the corresponding \fBgcj\fR option. ! .Ip "\fB\*(--print-main\fR" 4 ! .IX Item "print-main" This prints the name of the class in this file containing a \f(CW\*(C`main\*(C'\fR method. ! .Ip "\fB\*(--list-class\fR" 4 ! .IX Item "list-class" This lists the names of all classes defined in the input files. ! .Ip "\fB\*(--list-filename\fR" 4 ! .IX Item "list-filename" If \f(CW\*(C`\-\-list\-class\*(C'\fR is given, this option causes \f(CW\*(C`jv\-scan\*(C'\fR to also print the name of the file in which each class was found. ! .Ip "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" Print output to the named file. ! .Ip "\fB\*(--help\fR" 4 ! .IX Item "help" Print help, then exit. ! .Ip "\fB\*(--version\fR" 4 ! .IX Item "version" Print version number, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgcjh\fR\|(1), \fIgij\fR\|(1), \fIjcf-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 145,207 ---- source file (\fI.java\fR file). .SH "OPTIONS" .IX Header "OPTIONS" ! .IP "\fB\-\-no\-assert\fR" 4 ! .IX Item "--no-assert" ! Don't recognize the \f(CW\*(C`assert\*(C'\fR keyword, for backwards compatibility ! with older versions of the language specification. ! .IP "\fB\-\-complexity\fR" 4 ! .IX Item "--complexity" This prints a complexity measure, related to cyclomatic complexity, for each input file. ! .IP "\fB\-\-encoding=\fR\fIname\fR" 4 ! .IX Item "--encoding=name" This works like the corresponding \fBgcj\fR option. ! .IP "\fB\-\-print\-main\fR" 4 ! .IX Item "--print-main" This prints the name of the class in this file containing a \f(CW\*(C`main\*(C'\fR method. ! .IP "\fB\-\-list\-class\fR" 4 ! .IX Item "--list-class" This lists the names of all classes defined in the input files. ! .IP "\fB\-\-list\-filename\fR" 4 ! .IX Item "--list-filename" If \f(CW\*(C`\-\-list\-class\*(C'\fR is given, this option causes \f(CW\*(C`jv\-scan\*(C'\fR to also print the name of the file in which each class was found. ! .IP "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" Print output to the named file. ! .IP "\fB\-\-help\fR" 4 ! .IX Item "--help" Print help, then exit. ! .IP "\fB\-\-version\fR" 4 ! .IX Item "--version" Print version number, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" ! \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgcjh\fR\|(1), \fIgij\fR\|(1), \fIjcf\-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/jv-scan.c gcc-3.3/gcc/java/jv-scan.c *** gcc-3.2.3/gcc/java/jv-scan.c 2002-02-01 21:07:31.000000000 +0000 --- gcc-3.3/gcc/java/jv-scan.c 2003-02-03 14:06:32.000000000 +0000 *************** Boston, MA 02111-1307, USA. */ *** 30,36 **** #include #endif ! #ifdef HAVE_NL_LANGINFO #include #endif --- 30,36 ---- #include #endif ! #ifdef HAVE_LANGINFO_CODESET #include #endif *************** int flag_find_main = 0; *** 64,69 **** --- 64,70 ---- int flag_dump_class = 0; int flag_list_filename = 0; int flag_complexity = 0; + int flag_assert = 1; int pedantic = 0; *************** static const struct option options[] = *** 85,90 **** --- 86,93 ---- { "list-class", no_argument, &flag_dump_class, 1 }, { "encoding", required_argument, NULL, OPT_ENCODING }, { "complexity", no_argument, &flag_complexity, 1 }, + { "no-assert", no_argument, &flag_assert, 0 }, + { "assert", no_argument, &flag_assert, 1 }, { NULL, no_argument, NULL, 0 } }; *************** help () *** 100,105 **** --- 103,109 ---- { printf ("Usage: jv-scan [OPTION]... FILE...\n\n"); printf ("Print useful information read from Java source files.\n\n"); + printf (" --no-assert Don't recognize the assert keyword\n"); printf (" --complexity Print cyclomatic complexity of input file\n"); printf (" --encoding NAME Specify encoding of input file\n"); printf (" --print-main Print name of class containing `main'\n"); *************** help () *** 111,117 **** printf (" --version Print version number, then exit\n"); printf ("\n"); printf ("For bug reporting instructions, please see:\n"); ! printf ("%s.\n", GCCBUGURL); exit (0); } --- 115,121 ---- printf (" --version Print version number, then exit\n"); printf ("\n"); printf ("For bug reporting instructions, please see:\n"); ! printf ("%s.\n", bug_report_url); exit (0); } *************** DEFUN (main, (argc, argv), *** 199,205 **** /* There's no point in trying to find the current encoding unless we are going to do something intelligent with it -- hence the test for iconv. */ ! #if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_NL_LANGINFO) setlocale (LC_CTYPE, ""); if (encoding == NULL) encoding = nl_langinfo (CODESET); --- 203,209 ---- /* There's no point in trying to find the current encoding unless we are going to do something intelligent with it -- hence the test for iconv. */ ! #if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_LANGINFO_CODESET) setlocale (LC_CTYPE, ""); if (encoding == NULL) encoding = nl_langinfo (CODESET); diff -Nrc3pad gcc-3.2.3/gcc/java/jvspec.c gcc-3.3/gcc/java/jvspec.c *** gcc-3.2.3/gcc/java/jvspec.c 2002-04-23 22:55:00.000000000 +0000 --- gcc-3.3/gcc/java/jvspec.c 2002-11-19 04:37:50.000000000 +0000 *************** static const char jvgenmain_spec[] = *** 62,68 **** %{v:-version} %{pg:-p} %{p}\ %{= MIN_WORD_LENGTH) --- 105,173 ---- { static const struct java_keyword wordlist[] = { ! {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"else", ELSE_TK}, {"true", TRUE_TK}, {"case", CASE_TK}, + {"assert", ASSERT_TK}, + {"default", DEFAULT_TK}, {"", 0}, ! {"abstract", ABSTRACT_TK}, {"continue", CONTINUE_TK}, {"extends", EXTENDS_TK}, {"const", CONST_TK}, {"static", STATIC_TK}, {"this", THIS_TK}, ! {"long", LONG_TK}, {"class", CLASS_TK}, ! {"", 0}, {"synchronized", SYNCHRONIZED_TK}, ! {"do", DO_TK}, ! {"null", NULL_TK}, ! {"final", FINAL_TK}, ! {"float", FLOAT_TK}, {"super", SUPER_TK}, {"short", SHORT_TK}, {"", 0}, + {"false", FALSE_TK}, + {"transient", TRANSIENT_TK}, + {"catch", CATCH_TK}, {"int", INT_TK}, ! {"throws", THROWS_TK}, ! {"switch", SWITCH_TK}, {"for", FOR_TK}, + {"char", CHAR_TK}, {"", 0}, {"interface", INTERFACE_TK}, ! {"byte", BYTE_TK}, ! {"try", TRY_TK}, ! {"double", DOUBLE_TK}, ! {"while", WHILE_TK}, ! {"return", RETURN_TK}, {"implements", IMPLEMENTS_TK}, {"void", VOID_TK}, ! {"public", PUBLIC_TK}, {"if", IF_TK}, + {"protected", PROTECTED_TK}, + {"volatile", VOLATILE_TK}, + {"goto", GOTO_TK}, + {"", 0}, + {"native", NATIVE_TK}, {"break", BREAK_TK}, {"", 0}, + {"import", IMPORT_TK}, {"new", NEW_TK}, {"instanceof", INSTANCEOF_TK}, + {"package", PACKAGE_TK}, + {"boolean", BOOLEAN_TK}, {"", 0}, + {"finally", FINALLY_TK}, {"throw", THROW_TK}, + {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, ! {"strictfp", STRICT_TK}, ! {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, ! {"private", PRIVATE_TK} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) diff -Nrc3pad gcc-3.2.3/gcc/java/lang.c gcc-3.3/gcc/java/lang.c *** gcc-3.2.3/gcc/java/lang.c 2002-10-06 23:02:12.000000000 +0000 --- gcc-3.3/gcc/java/lang.c 2003-01-05 15:03:25.000000000 +0000 *************** *** 1,5 **** /* Java(TM) language-specific utility routines. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,5 ---- /* Java(TM) language-specific utility routines. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. *************** The Free Software Foundation is independ *** 40,45 **** --- 40,48 ---- #include "xref.h" #include "ggc.h" #include "diagnostic.h" + #include "tree-inline.h" + #include "splay-tree.h" + #include "tree-dump.h" struct string_option { *************** struct string_option *** 51,66 **** static const char *java_init PARAMS ((const char *)); static void java_finish PARAMS ((void)); static void java_init_options PARAMS ((void)); ! static void java_post_options PARAMS ((void)); static int java_decode_option PARAMS ((int, char **)); static void put_decl_string PARAMS ((const char *, int)); static void put_decl_node PARAMS ((tree)); ! static void java_dummy_print PARAMS ((diagnostic_context *, const char *)); ! static void lang_print_error PARAMS ((diagnostic_context *, const char *)); static int process_option_with_no PARAMS ((const char *, const struct string_option *, int)); #ifndef TARGET_OBJECT_SUFFIX # define TARGET_OBJECT_SUFFIX ".o" --- 54,82 ---- static const char *java_init PARAMS ((const char *)); static void java_finish PARAMS ((void)); static void java_init_options PARAMS ((void)); ! static bool java_post_options PARAMS ((void)); static int java_decode_option PARAMS ((int, char **)); static void put_decl_string PARAMS ((const char *, int)); static void put_decl_node PARAMS ((tree)); ! static void java_print_error_function PARAMS ((diagnostic_context *, ! const char *)); static int process_option_with_no PARAMS ((const char *, const struct string_option *, int)); + static tree java_tree_inlining_walk_subtrees PARAMS ((tree *, + int *, + walk_tree_fn, + void *, + void *)); + static int java_unsafe_for_reeval PARAMS ((tree)); + static int merge_init_test_initialization PARAMS ((void * *, + void *)); + static int inline_init_test_initialization PARAMS ((void * *, + void *)); + static bool java_can_use_bit_fields_p PARAMS ((void)); + static int java_dump_tree PARAMS ((void *, tree)); + static void dump_compound_expr PARAMS ((dump_info_p, tree)); #ifndef TARGET_OBJECT_SUFFIX # define TARGET_OBJECT_SUFFIX ".o" *************** static int process_option_with_no PARAMS *** 72,78 **** #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, ! static const char java_tree_code_type[] = { 'x', #include "java-tree.def" }; --- 88,95 ---- #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, ! const char tree_code_type[] = { ! #include "tree.def" 'x', #include "java-tree.def" }; *************** static const char java_tree_code_type[] *** 84,90 **** #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH, ! static const int java_tree_code_length[] = { 0, #include "java-tree.def" }; --- 101,108 ---- #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH, ! const unsigned char tree_code_length[] = { ! #include "tree.def" 0, #include "java-tree.def" }; *************** static const int java_tree_code_length[] *** 94,105 **** Used for printing out the tree and error messages. */ #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME, ! static const char *const java_tree_code_name[] = { "@@dummy", #include "java-tree.def" }; #undef DEFTREECODE int compiling_from_source; char * resource_name; --- 112,128 ---- Used for printing out the tree and error messages. */ #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME, ! const char *const tree_code_name[] = { ! #include "tree.def" "@@dummy", #include "java-tree.def" }; #undef DEFTREECODE + /* Used to avoid printing error messages with bogus function + prototypes. Starts out false. */ + static bool inhibit_error_function_printing; + int compiling_from_source; char * resource_name; *************** int flag_emit_class_files = 0; *** 110,171 **** int flag_filelist_file = 0; ! /* When non zero, we emit xref strings. Values of the flag for xref backends are defined in xref_flag_table, xref.c. */ int flag_emit_xref = 0; ! /* When non zero, -Wall was turned on. */ int flag_wall = 0; ! /* When non zero, check for redundant modifier uses. */ int flag_redundant = 0; ! /* When non zero, call a library routine to do integer divisions. */ int flag_use_divide_subroutine = 1; ! /* When non zero, generate code for the Boehm GC. */ int flag_use_boehm_gc = 0; ! /* When non zero, assume the runtime uses a hash table to map an object to its synchronization structure. */ int flag_hash_synchronization; ! /* When non zero, assume all native functions are implemented with JNI, not CNI. */ int flag_jni = 0; ! /* When non zero, warn when source file is newer than matching class file. */ int flag_newer = 1; ! /* When non zero, generate checks for references to NULL. */ int flag_check_references = 0; /* The encoding of the source file. */ const char *current_encoding = NULL; ! /* When non zero, report the now deprecated empty statements. */ int flag_extraneous_semicolon; ! /* When non zero, always check for a non gcj generated classes archive. */ int flag_force_classes_archive_check; /* When zero, don't optimize static class initialization. This flag shouldn't be tested alone, use STATIC_CLASS_INITIALIZATION_OPTIMIZATION_P instead. */ int flag_optimize_sci = 1; ! /* When non zero, use offset tables for virtual method calls in order to improve binary compatibility. */ int flag_indirect_dispatch = 0; /* When zero, don't generate runtime array store checks. */ int flag_store_check = 1; ! /* When non zero, print extra version information. */ static int version_flag = 0; ! /* Set non-zero if the user specified -finline-functions on the command line. */ int flag_really_inline = 0; --- 133,197 ---- int flag_filelist_file = 0; ! /* When nonzero, we emit xref strings. Values of the flag for xref backends are defined in xref_flag_table, xref.c. */ int flag_emit_xref = 0; ! /* When nonzero, -Wall was turned on. */ int flag_wall = 0; ! /* When nonzero, check for redundant modifier uses. */ int flag_redundant = 0; ! /* When nonzero, call a library routine to do integer divisions. */ int flag_use_divide_subroutine = 1; ! /* When nonzero, generate code for the Boehm GC. */ int flag_use_boehm_gc = 0; ! /* When nonzero, assume the runtime uses a hash table to map an object to its synchronization structure. */ int flag_hash_synchronization; ! /* When nonzero, permit the use of the assert keyword. */ ! int flag_assert = 1; ! ! /* When nonzero, assume all native functions are implemented with JNI, not CNI. */ int flag_jni = 0; ! /* When nonzero, warn when source file is newer than matching class file. */ int flag_newer = 1; ! /* When nonzero, generate checks for references to NULL. */ int flag_check_references = 0; /* The encoding of the source file. */ const char *current_encoding = NULL; ! /* When nonzero, report the now deprecated empty statements. */ int flag_extraneous_semicolon; ! /* When nonzero, always check for a non gcj generated classes archive. */ int flag_force_classes_archive_check; /* When zero, don't optimize static class initialization. This flag shouldn't be tested alone, use STATIC_CLASS_INITIALIZATION_OPTIMIZATION_P instead. */ int flag_optimize_sci = 1; ! /* When nonzero, use offset tables for virtual method calls in order to improve binary compatibility. */ int flag_indirect_dispatch = 0; /* When zero, don't generate runtime array store checks. */ int flag_store_check = 1; ! /* When nonzero, print extra version information. */ static int version_flag = 0; ! /* Set nonzero if the user specified -finline-functions on the command line. */ int flag_really_inline = 0; *************** lang_f_options[] = *** 189,195 **** {"force-classes-archive-check", &flag_force_classes_archive_check, 1}, {"optimize-static-class-initialization", &flag_optimize_sci, 1 }, {"indirect-dispatch", &flag_indirect_dispatch, 1}, ! {"store-check", &flag_store_check, 1} }; static const struct string_option --- 215,222 ---- {"force-classes-archive-check", &flag_force_classes_archive_check, 1}, {"optimize-static-class-initialization", &flag_optimize_sci, 1 }, {"indirect-dispatch", &flag_indirect_dispatch, 1}, ! {"store-check", &flag_store_check, 1}, ! {"assert", &flag_assert, 1} }; static const struct string_option *************** static int dependency_tracking = 0; *** 212,217 **** --- 239,249 ---- #define DEPEND_TARGET_SET 4 #define DEPEND_FILE_ALREADY_SET 8 + struct language_function GTY(()) + { + int unused; + }; + #undef LANG_HOOKS_NAME #define LANG_HOOKS_NAME "GNU Java" #undef LANG_HOOKS_INIT *************** static int dependency_tracking = 0; *** 224,231 **** #define LANG_HOOKS_DECODE_OPTION java_decode_option #undef LANG_HOOKS_POST_OPTIONS #define LANG_HOOKS_POST_OPTIONS java_post_options ! #undef LANG_HOOKS_SET_YYDEBUG ! #define LANG_HOOKS_SET_YYDEBUG java_set_yydebug /* Each front end provides its own. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; --- 256,296 ---- #define LANG_HOOKS_DECODE_OPTION java_decode_option #undef LANG_HOOKS_POST_OPTIONS #define LANG_HOOKS_POST_OPTIONS java_post_options ! #undef LANG_HOOKS_PARSE_FILE ! #define LANG_HOOKS_PARSE_FILE java_parse_file ! #undef LANG_HOOKS_UNSAFE_FOR_REEVAL ! #define LANG_HOOKS_UNSAFE_FOR_REEVAL java_unsafe_for_reeval ! #undef LANG_HOOKS_MARK_ADDRESSABLE ! #define LANG_HOOKS_MARK_ADDRESSABLE java_mark_addressable ! #undef LANG_HOOKS_EXPAND_EXPR ! #define LANG_HOOKS_EXPAND_EXPR java_expand_expr ! #undef LANG_HOOKS_TRUTHVALUE_CONVERSION ! #define LANG_HOOKS_TRUTHVALUE_CONVERSION java_truthvalue_conversion ! #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL ! #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl ! #undef LANG_HOOKS_DECL_PRINTABLE_NAME ! #define LANG_HOOKS_DECL_PRINTABLE_NAME lang_printable_name ! #undef LANG_HOOKS_PRINT_ERROR_FUNCTION ! #define LANG_HOOKS_PRINT_ERROR_FUNCTION java_print_error_function ! #undef LANG_HOOKS_CAN_USE_BIT_FIELDS_P ! #define LANG_HOOKS_CAN_USE_BIT_FIELDS_P java_can_use_bit_fields_p ! ! #undef LANG_HOOKS_TYPE_FOR_MODE ! #define LANG_HOOKS_TYPE_FOR_MODE java_type_for_mode ! #undef LANG_HOOKS_TYPE_FOR_SIZE ! #define LANG_HOOKS_TYPE_FOR_SIZE java_type_for_size ! #undef LANG_HOOKS_SIGNED_TYPE ! #define LANG_HOOKS_SIGNED_TYPE java_signed_type ! #undef LANG_HOOKS_UNSIGNED_TYPE ! #define LANG_HOOKS_UNSIGNED_TYPE java_unsigned_type ! #undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE ! #define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE java_signed_or_unsigned_type ! ! #undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES ! #define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES java_tree_inlining_walk_subtrees ! ! #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN ! #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN java_dump_tree /* Each front end provides its own. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; *************** process_option_with_no (p, table, table_ *** 260,266 **** /* * process java-specific compiler command-line options ! * return 0, but do not complain if the option is not recognised. */ static int java_decode_option (argc, argv) --- 325,331 ---- /* * process java-specific compiler command-line options ! * return 0, but do not complain if the option is not recognized. */ static int java_decode_option (argc, argv) *************** java_init (filename) *** 458,463 **** --- 523,531 ---- flag_minimal_debug = 0; #endif + if (flag_inline_functions) + flag_inline_trees = 1; + /* Force minimum function alignment if g++ uses the least significant bit of function pointers to store the virtual bit. This is required to keep vtables compatible. */ *************** java_init (filename) *** 492,499 **** error ("couldn't determine target name for dependency tracking"); else { ! char *buf = (char *) xmalloc (dot - filename + ! 3 + sizeof (TARGET_OBJECT_SUFFIX)); strncpy (buf, filename, dot - filename); /* If emitting class files, we might have multiple --- 560,567 ---- error ("couldn't determine target name for dependency tracking"); else { ! char *buf = xmalloc (dot - filename + ! 3 + sizeof (TARGET_OBJECT_SUFFIX)); strncpy (buf, filename, dot - filename); /* If emitting class files, we might have multiple *************** java_init (filename) *** 529,551 **** jcf_path_init (); jcf_path_seal (version_flag); - decl_printable_name = lang_printable_name; - print_error_function = lang_print_error; - lang_expand_expr = java_lang_expand_expr; - - /* Append to Gcc tree node definition arrays */ - - memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE, - java_tree_code_type, - (int)LAST_JAVA_TREE_CODE - (int)LAST_AND_UNUSED_TREE_CODE); - memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE, - java_tree_code_length, - (LAST_JAVA_TREE_CODE - - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (int)); - memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE, - java_tree_code_name, - (LAST_JAVA_TREE_CODE - - (int)LAST_AND_UNUSED_TREE_CODE) * sizeof (char *)); java_init_decl_processing (); using_eh_for_cleanups (); --- 597,602 ---- *************** put_decl_string (str, len) *** 583,594 **** if (decl_buf == NULL) { decl_buflen = len + 100; ! decl_buf = (char *) xmalloc (decl_buflen); } else { decl_buflen *= 2; ! decl_buf = (char *) xrealloc (decl_buf, decl_buflen); } } strcpy (decl_buf + decl_bufpos, str); --- 634,645 ---- if (decl_buf == NULL) { decl_buflen = len + 100; ! decl_buf = xmalloc (decl_buflen); } else { decl_buflen *= 2; ! decl_buf = xrealloc (decl_buf, decl_buflen); } } strcpy (decl_buf + decl_bufpos, str); *************** put_decl_node (node) *** 671,677 **** /* Return a user-friendly name for DECL. The resulting string is only valid until the next call. The value of the hook decl_printable_name is this function, ! which is also called directly by lang_print_error. */ const char * lang_printable_name (decl, v) --- 722,728 ---- /* Return a user-friendly name for DECL. The resulting string is only valid until the next call. The value of the hook decl_printable_name is this function, ! which is also called directly by java_print_error_function. */ const char * lang_printable_name (decl, v) *************** lang_printable_name_wls (decl, v) *** 700,724 **** } /* Print on stderr the current class and method context. This function ! is the value of the hook print_error_function, called from toplev.c. */ static void ! lang_print_error (context, file) diagnostic_context *context __attribute__((__unused__)); const char *file; { ! static tree last_error_function_context = NULL_TREE; ! static tree last_error_function = NULL; ! static int initialized_p; ! ! /* Register LAST_ERROR_FUNCTION_CONTEXT and LAST_ERROR_FUNCTION with ! the garbage collector. */ ! if (!initialized_p) ! { ! ggc_add_tree_root (&last_error_function_context, 1); ! ggc_add_tree_root (&last_error_function, 1); ! initialized_p = 1; ! } if (current_function_decl != NULL && DECL_CONTEXT (current_function_decl) != last_error_function_context) --- 751,768 ---- } /* Print on stderr the current class and method context. This function ! is the value of the hook print_error_function. */ + static GTY(()) tree last_error_function_context; + static GTY(()) tree last_error_function; static void ! java_print_error_function (context, file) diagnostic_context *context __attribute__((__unused__)); const char *file; { ! /* Don't print error messages with bogus function prototypes. */ ! if (inhibit_error_function_printing) ! return; if (current_function_decl != NULL && DECL_CONTEXT (current_function_decl) != last_error_function_context) *************** lang_print_error (context, file) *** 751,781 **** } - /* This doesn't do anything on purpose. It's used to satisfy the - print_error_function hook we don't print error messages with bogus - function prototypes. */ - - static void - java_dummy_print (c, s) - diagnostic_context *c __attribute__ ((__unused__)); - const char *s __attribute__ ((__unused__)); - { - } - /* Called to install the PRINT_ERROR_FUNCTION hook differently according to LEVEL. LEVEL is 1 during early parsing, when function ! prototypes aren't fully resolved. print_error_function is set so it ! doesn't print incomplete function prototypes. When LEVEL is 2, ! function prototypes are fully resolved and can be printed when reporting errors. */ void lang_init_source (level) int level; { ! if (level == 1) ! print_error_function = java_dummy_print; ! else ! print_error_function = lang_print_error; } static void --- 795,811 ---- } /* Called to install the PRINT_ERROR_FUNCTION hook differently according to LEVEL. LEVEL is 1 during early parsing, when function ! prototypes aren't fully resolved. java_print_error_function is set ! so it doesn't print incomplete function prototypes. When LEVEL is ! 2, function prototypes are fully resolved and can be printed when reporting errors. */ void lang_init_source (level) int level; { ! inhibit_error_function_printing = (level == 1); } static void *************** java_init_options () *** 784,799 **** flag_bounds_check = 1; flag_exceptions = 1; flag_non_call_exceptions = 1; } /* Post-switch processing. */ ! static void java_post_options () { ! /* Turn off RTL inliner unless -finline-functions was really specified. */ ! if (flag_really_inline == 0) { ! flag_no_inline = 1; ! flag_inline_functions = 0; } } --- 814,1159 ---- flag_bounds_check = 1; flag_exceptions = 1; flag_non_call_exceptions = 1; + + /* In Java floating point operations never trap. */ + flag_trapping_math = 0; + } + + static bool + java_can_use_bit_fields_p () + { + /* The bit-field optimizations cause problems when generating class + files. */ + return flag_emit_class_files ? false : true; } /* Post-switch processing. */ ! static bool java_post_options () { ! /* Use tree inlining if possible. Function instrumentation is only ! done in the RTL level, so we disable tree inlining. */ ! if (! flag_instrument_function_entry_exit) { ! if (!flag_no_inline) ! flag_no_inline = 1; ! if (flag_inline_functions) ! { ! flag_inline_trees = 2; ! flag_inline_functions = 0; ! } ! } ! ! /* Initialize the compiler back end. */ ! return false; ! } ! ! /* Return either DECL or its known constant value (if it has one). */ ! ! tree ! decl_constant_value (decl) ! tree decl; ! { ! if (/* Don't change a variable array bound or initial value to a constant ! in a place where a variable is invalid. */ ! current_function_decl != 0 ! && ! TREE_THIS_VOLATILE (decl) ! && TREE_READONLY (decl) ! && DECL_INITIAL (decl) != 0 ! && TREE_CODE (DECL_INITIAL (decl)) != ERROR_MARK ! /* This is invalid if initial value is not constant. ! If it has either a function call, a memory reference, ! or a variable, then re-evaluating it could give different results. */ ! && TREE_CONSTANT (DECL_INITIAL (decl)) ! /* Check for cases where this is sub-optimal, even though valid. */ ! && TREE_CODE (DECL_INITIAL (decl)) != CONSTRUCTOR) ! return DECL_INITIAL (decl); ! return decl; ! } ! ! /* Walk the language specific tree nodes during inlining. */ ! ! static tree ! java_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab) ! tree *tp ATTRIBUTE_UNUSED; ! int *subtrees ATTRIBUTE_UNUSED; ! walk_tree_fn func ATTRIBUTE_UNUSED; ! void *data ATTRIBUTE_UNUSED; ! void *htab ATTRIBUTE_UNUSED; ! { ! enum tree_code code; ! tree result; ! ! #define WALK_SUBTREE(NODE) \ ! do \ ! { \ ! result = walk_tree (&(NODE), func, data, htab); \ ! if (result) \ ! return result; \ ! } \ ! while (0) ! ! tree t = *tp; ! if (!t) ! return NULL_TREE; ! ! code = TREE_CODE (t); ! switch (code) ! { ! case BLOCK: ! if (BLOCK_EXPR_BODY (t)) ! { ! tree *prev = &BLOCK_EXPR_BODY (*tp); ! while (*prev) ! { ! WALK_SUBTREE (*prev); ! prev = &TREE_CHAIN (*prev); ! } ! } ! return NULL_TREE; ! break; ! ! default: ! return NULL_TREE; ! } ! } ! ! /* Called from unsafe_for_reeval. */ ! static int ! java_unsafe_for_reeval (t) ! tree t; ! { ! switch (TREE_CODE (t)) ! { ! case BLOCK: ! /* Our expander tries to expand the variables twice. Boom. */ ! if (BLOCK_EXPR_DECLS (t) != NULL) ! return 2; ! return unsafe_for_reeval (BLOCK_EXPR_BODY (t)); ! ! default: ! break; ! } ! ! return -1; ! } ! ! /* Every call to a static constructor has an associated boolean ! variable which is in the outermost scope of the calling method. ! This variable is used to avoid multiple calls to the static ! constructor for each class. ! ! It looks somthing like this: ! ! foo () ! { ! boolean dummy = OtherClass.is_initialized; ! ! ... ! ! if (! dummy) ! OtherClass.initialize(); ! ! ... use OtherClass.data ... ! } ! ! Each of these boolean variables has an entry in the ! DECL_FUNCTION_INIT_TEST_TABLE of a method. When inlining a method ! we must merge the DECL_FUNCTION_INIT_TEST_TABLE from the function ! being linlined and create the boolean variables in the outermost ! scope of the method being inlined into. */ ! ! /* Create a mapping from a boolean variable in a method being inlined ! to one in the scope of the method being inlined into. */ ! ! static int ! merge_init_test_initialization (entry, x) ! void * * entry; ! void * x; ! { ! struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry; ! splay_tree decl_map = (splay_tree)x; ! splay_tree_node n; ! tree *init_test_decl; ! ! /* See if we have remapped this declaration. If we haven't there's ! a bug in the inliner. */ ! n = splay_tree_lookup (decl_map, (splay_tree_key) ite->value); ! if (! n) ! abort (); ! ! /* Create a new entry for the class and its remapped boolean ! variable. If we already have a mapping for this class we've ! already initialized it, so don't overwrite the value. */ ! init_test_decl = java_treetreehash_new ! (DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ite->key); ! if (!*init_test_decl) ! *init_test_decl = (tree)n->value; ! ! return true; ! } ! ! /* Merge the DECL_FUNCTION_INIT_TEST_TABLE from the function we're ! inlining. */ ! ! void ! java_inlining_merge_static_initializers (fn, decl_map) ! tree fn; ! void *decl_map; ! { ! htab_traverse ! (DECL_FUNCTION_INIT_TEST_TABLE (fn), ! merge_init_test_initialization, decl_map); ! } ! ! /* Lookup a DECL_FUNCTION_INIT_TEST_TABLE entry in the method we're ! inlining into. If we already have a corresponding entry in that ! class we don't need to create another one, so we create a mapping ! from the variable in the inlined class to the corresponding ! pre-existing one. */ ! ! static int ! inline_init_test_initialization (entry, x) ! void * * entry; ! void * x; ! { ! struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry; ! splay_tree decl_map = (splay_tree)x; ! ! tree h = java_treetreehash_find ! (DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ite->key); ! if (! h) ! return true; ! ! splay_tree_insert (decl_map, ! (splay_tree_key) ite->value, ! (splay_tree_value) h); ! ! return true; ! } ! ! /* Look up the boolean variables in the DECL_FUNCTION_INIT_TEST_TABLE ! of a method being inlined. For each hone, if we already have a ! variable associated with the same class in the method being inlined ! into, create a new mapping for it. */ ! ! void ! java_inlining_map_static_initializers (fn, decl_map) ! tree fn; ! void *decl_map; ! { ! htab_traverse ! (DECL_FUNCTION_INIT_TEST_TABLE (fn), ! inline_init_test_initialization, decl_map); ! } ! ! /* Avoid voluminous output for deep recursion of compound exprs. */ ! ! static void ! dump_compound_expr (di, t) ! dump_info_p di; ! tree t; ! { ! int i; ! ! for (i=0; i<2; i++) ! { ! switch (TREE_CODE (TREE_OPERAND (t, i))) ! { ! case COMPOUND_EXPR: ! dump_compound_expr (di, TREE_OPERAND (t, i)); ! break; ! ! case EXPR_WITH_FILE_LOCATION: ! { ! tree wfl_node = EXPR_WFL_NODE (TREE_OPERAND (t, i)); ! dump_child ("expr", wfl_node); ! break; ! } ! ! default: ! dump_child ("expr", TREE_OPERAND (t, i)); ! } ! } ! } ! ! static int ! java_dump_tree (dump_info, t) ! void *dump_info; ! tree t; ! { ! enum tree_code code; ! dump_info_p di = (dump_info_p) dump_info; ! ! /* Figure out what kind of node this is. */ ! code = TREE_CODE (t); ! ! switch (code) ! { ! case FUNCTION_DECL: ! dump_child ("args", DECL_ARGUMENTS (t)); ! if (DECL_EXTERNAL (t)) ! dump_string (di, "undefined"); ! if (TREE_PUBLIC (t)) ! dump_string (di, "extern"); ! else ! dump_string (di, "static"); ! if (DECL_LANG_SPECIFIC (t)) ! dump_child ("body", DECL_FUNCTION_BODY (t)); ! if (DECL_LANG_SPECIFIC (t) && !dump_flag (di, TDF_SLIM, t)) ! dump_child ("inline body", DECL_SAVED_TREE (t)); ! return 1; ! ! case RETURN_EXPR: ! dump_child ("expr", TREE_OPERAND (t, 0)); ! return 1; ! ! case GOTO_EXPR: ! dump_child ("goto", TREE_OPERAND (t, 0)); ! return 1; ! ! case LABEL_EXPR: ! dump_child ("label", TREE_OPERAND (t, 0)); ! return 1; ! ! case LABELED_BLOCK_EXPR: ! dump_child ("label", TREE_OPERAND (t, 0)); ! dump_child ("block", TREE_OPERAND (t, 1)); ! return 1; ! ! case EXIT_BLOCK_EXPR: ! dump_child ("block", TREE_OPERAND (t, 0)); ! dump_child ("val", TREE_OPERAND (t, 1)); ! return 1; ! ! case BLOCK: ! if (BLOCK_EXPR_BODY (t)) ! { ! tree local = BLOCK_VARS (t); ! while (local) ! { ! tree next = TREE_CHAIN (local); ! dump_child ("var", local); ! local = next; ! } ! ! { ! tree block = BLOCK_EXPR_BODY (t); ! dump_child ("body", block); ! block = TREE_CHAIN (block); ! } ! } ! return 1; ! ! case COMPOUND_EXPR: ! if (!dump_flag (di, TDF_SLIM, t)) ! return 0; ! dump_compound_expr (di, t); ! return 1; ! ! default: ! break; } + return 0; } + #include "gt-java-lang.h" diff -Nrc3pad gcc-3.2.3/gcc/java/lex.c gcc-3.3/gcc/java/lex.c *** gcc-3.2.3/gcc/java/lex.c 2002-03-29 19:31:09.000000000 +0000 --- gcc-3.3/gcc/java/lex.c 2003-01-28 18:48:16.000000000 +0000 *************** java_init_lex (finput, encoding) *** 91,100 **** if (!java_lang_id) java_lang_id = get_identifier ("java.lang"); - if (!java_lang_cloneable) - java_lang_cloneable = get_identifier ("java.lang.Cloneable"); - if (!java_io_serializable) - java_io_serializable = get_identifier ("java.io.Serializable"); if (!inst_id) inst_id = get_identifier ("inst$"); if (!wpv_id) --- 91,96 ---- *************** java_init_lex (finput, encoding) *** 128,135 **** CPC_INITIALIZER_LIST (ctxp) = CPC_STATIC_INITIALIZER_LIST (ctxp) = CPC_INSTANCE_INITIALIZER_LIST (ctxp) = NULL_TREE; ! memset ((PTR) ctxp->modifier_ctx, 0, 11*sizeof (ctxp->modifier_ctx[0])); ! memset ((PTR) current_jcf, 0, sizeof (JCF)); ctxp->current_parsed_class = NULL; ctxp->package = NULL_TREE; #endif --- 124,131 ---- CPC_INITIALIZER_LIST (ctxp) = CPC_STATIC_INITIALIZER_LIST (ctxp) = CPC_INSTANCE_INITIALIZER_LIST (ctxp) = NULL_TREE; ! memset (ctxp->modifier_ctx, 0, sizeof (ctxp->modifier_ctx)); ! memset (current_jcf, 0, sizeof (JCF)); ctxp->current_parsed_class = NULL; ctxp->package = NULL_TREE; #endif *************** java_allocate_new_line () *** 196,207 **** if (!ctxp->c_line) { ! ctxp->c_line = (struct java_line *)xmalloc (sizeof (struct java_line)); ctxp->c_line->max = JAVA_LINE_MAX; ! ctxp->c_line->line = (unicode_t *)xmalloc ! (sizeof (unicode_t)*ctxp->c_line->max); ctxp->c_line->unicode_escape_p = ! (char *)xmalloc (sizeof (char)*ctxp->c_line->max); ctxp->c_line->white_space_only = 0; } --- 192,202 ---- if (!ctxp->c_line) { ! ctxp->c_line = xmalloc (sizeof (struct java_line)); ctxp->c_line->max = JAVA_LINE_MAX; ! ctxp->c_line->line = xmalloc (sizeof (unicode_t)*ctxp->c_line->max); ctxp->c_line->unicode_escape_p = ! xmalloc (sizeof (char)*ctxp->c_line->max); ctxp->c_line->white_space_only = 0; } *************** java_new_lexer (finput, encoding) *** 226,232 **** FILE *finput; const char *encoding; { ! java_lexer *lex = (java_lexer *) xmalloc (sizeof (java_lexer)); int enc_error = 0; lex->finput = finput; --- 221,227 ---- FILE *finput; const char *encoding; { ! java_lexer *lex = xmalloc (sizeof (java_lexer)); int enc_error = 0; lex->finput = finput; *************** java_read_char (lex) *** 494,501 **** + (c2 & 0x3f)); /* Check for valid 3-byte characters. Don't allow surrogate, \ufffe or \uffff. */ ! if (r >= 0x800 && r <= 0xffff ! && ! (r >= 0xd800 && r <= 0xdfff) && r != 0xfffe && r != 0xffff) return r; } --- 489,496 ---- + (c2 & 0x3f)); /* Check for valid 3-byte characters. Don't allow surrogate, \ufffe or \uffff. */ ! if (IN_RANGE (r, 0x800, 0xffff) ! && ! IN_RANGE (r, 0xd800, 0xdfff) && r != 0xfffe && r != 0xffff) return r; } *************** java_store_unicode (l, c, unicode_escape *** 522,530 **** if (l->size == l->max) { l->max += JAVA_LINE_MAX; ! l->line = (unicode_t *) xrealloc (l->line, sizeof (unicode_t)*l->max); ! l->unicode_escape_p = (char *) xrealloc (l->unicode_escape_p, ! sizeof (char)*l->max); } l->line [l->size] = c; l->unicode_escape_p [l->size++] = unicode_escape_p; --- 517,525 ---- if (l->size == l->max) { l->max += JAVA_LINE_MAX; ! l->line = xrealloc (l->line, sizeof (unicode_t)*l->max); ! l->unicode_escape_p = xrealloc (l->unicode_escape_p, ! sizeof (char)*l->max); } l->line [l->size] = c; l->unicode_escape_p [l->size++] = unicode_escape_p; *************** java_read_unicode (lex, unicode_escape_p *** 560,582 **** while ((c = java_read_char (lex)) == 'u') ; ! /* Unget the most recent character as it is not a `u'. */ ! if (c == UEOF) ! return UEOF; ! lex->unget_value = c; ! ! /* Next should be 4 hex digits, otherwise it's an error. ! The hex value is converted into the unicode, pushed into ! the Unicode stream. */ ! for (shift = 12; shift >= 0; shift -= 4) { ! if ((c = java_read_char (lex)) == UEOF) ! return UEOF; if (hex_p (c)) unicode |= (unicode_t)(hex_value (c) << shift); else ! java_lex_error ("Non hex digit in Unicode escape sequence", 0); } lex->bs_count = 0; *unicode_escape_p = 1; return unicode; --- 555,585 ---- while ((c = java_read_char (lex)) == 'u') ; ! shift = 12; ! do { ! if (c == UEOF) ! { ! java_lex_error ("prematurely terminated \\u sequence", 0); ! return UEOF; ! } ! if (hex_p (c)) unicode |= (unicode_t)(hex_value (c) << shift); else ! { ! java_lex_error ("non-hex digit in \\u sequence", 0); ! break; ! } ! ! c = java_read_char (lex); ! shift -= 4; } + while (shift >= 0); + + if (c != UEOF) + lex->unget_value = c; + lex->bs_count = 0; *unicode_escape_p = 1; return unicode; *************** java_read_unicode_collapsing_terminators *** 599,605 **** return a single line terminator. */ int dummy; c = java_read_unicode (lex, &dummy); ! if (c != '\n') lex->unget_value = c; /* In either case we must return a newline. */ c = '\n'; --- 602,608 ---- return a single line terminator. */ int dummy; c = java_read_unicode (lex, &dummy); ! if (c != '\n' && c != UEOF) lex->unget_value = c; /* In either case we must return a newline. */ c = '\n'; *************** java_parse_escape_sequence () *** 833,874 **** } } - /* Isolate the code which may raise an arithmetic exception in its - own function. */ - #ifndef JC1_LITE ! struct jpa_args ! { ! YYSTYPE *java_lval; ! char *literal_token; ! int fflag; ! int number_beginning; ! }; ! #ifdef REAL_ARITHMETIC ! #define IS_ZERO(X) (ereal_cmp (X, dconst0) == 0) ! #else ! #define IS_ZERO(X) ((X) == 0) ! #endif ! static void java_perform_atof PARAMS ((PTR)); static void ! java_perform_atof (av) ! PTR av; { - struct jpa_args *a = (struct jpa_args *)av; - YYSTYPE *java_lval = a->java_lval; - int number_beginning = a->number_beginning; REAL_VALUE_TYPE value; ! tree type = (a->fflag ? FLOAT_TYPE_NODE : DOUBLE_TYPE_NODE); SET_REAL_VALUE_ATOF (value, ! REAL_VALUE_ATOF (a->literal_token, TYPE_MODE (type))); if (REAL_VALUE_ISINF (value) || REAL_VALUE_ISNAN (value)) { ! JAVA_FLOAT_RANGE_ERROR ((a->fflag ? "float" : "double")); value = DCONST0; } else if (IS_ZERO (value)) --- 836,868 ---- } } #ifndef JC1_LITE ! #define IS_ZERO(X) REAL_VALUES_EQUAL (X, dconst0) ! /* Subroutine of java_lex: converts floating-point literals to tree ! nodes. LITERAL_TOKEN is the input literal, JAVA_LVAL is where to ! store the result. FFLAG indicates whether the literal was tagged ! with an 'f', indicating it is of type 'float'; NUMBER_BEGINNING ! is the line number on which to report any error. */ ! static void java_perform_atof PARAMS ((YYSTYPE *, char *, int, int)); static void ! java_perform_atof (java_lval, literal_token, fflag, number_beginning) ! YYSTYPE *java_lval; ! char *literal_token; ! int fflag; ! int number_beginning; { REAL_VALUE_TYPE value; ! tree type = (fflag ? FLOAT_TYPE_NODE : DOUBLE_TYPE_NODE); SET_REAL_VALUE_ATOF (value, ! REAL_VALUE_ATOF (literal_token, TYPE_MODE (type))); if (REAL_VALUE_ISINF (value) || REAL_VALUE_ISNAN (value)) { ! JAVA_FLOAT_RANGE_ERROR (fflag ? "float" : "double"); value = DCONST0; } else if (IS_ZERO (value)) *************** java_perform_atof (av) *** 876,882 **** /* We check to see if the value is really 0 or if we've found an underflow. We do this in the most primitive imaginable way. */ int really_zero = 1; ! char *p = a->literal_token; if (*p == '-') ++p; while (*p && *p != 'e' && *p != 'E') --- 870,876 ---- /* We check to see if the value is really 0 or if we've found an underflow. We do this in the most primitive imaginable way. */ int really_zero = 1; ! char *p = literal_token; if (*p == '-') ++p; while (*p && *p != 'e' && *p != 'E') *************** java_lex (java_lval) *** 1032,1040 **** } else if (JAVA_ASCII_DIGIT (c)) radix = 8; ! else if (c == '.') { ! /* Push the '.' back and prepare for a FP parsing... */ java_unget_unicode (); c = '0'; } --- 1026,1035 ---- } else if (JAVA_ASCII_DIGIT (c)) radix = 8; ! else if (c == '.' || c == 'e' || c =='E') { ! /* Push the '.', 'e', or 'E' back and prepare for a FP ! parsing... */ java_unget_unicode (); c = '0'; } *************** java_lex (java_lval) *** 1170,1178 **** } else { - #ifndef JC1_LITE - struct jpa_args a; - #endif if (stage != 4) /* Don't push back fF/dD. */ java_unget_unicode (); --- 1165,1170 ---- *************** java_lex (java_lval) *** 1185,1201 **** JAVA_LEX_LIT (literal_token, radix); #ifndef JC1_LITE ! a.literal_token = literal_token; ! a.fflag = fflag; ! a.java_lval = java_lval; ! a.number_beginning = number_beginning; ! if (do_float_handler (java_perform_atof, (PTR) &a)) ! return FP_LIT_TK; ! ! JAVA_FLOAT_RANGE_ERROR ((fflag ? "float" : "double")); ! #else ! return FP_LIT_TK; #endif } } } /* JAVA_ASCII_FPCHAR (c) */ --- 1177,1186 ---- JAVA_LEX_LIT (literal_token, radix); #ifndef JC1_LITE ! java_perform_atof (java_lval, literal_token, ! fflag, number_beginning); #endif + return FP_LIT_TK; } } } /* JAVA_ASCII_FPCHAR (c) */ *************** java_lex (java_lval) *** 1236,1269 **** } /* End borrowed section. */ /* Range checking. */ ! if (long_suffix) { ! /* 9223372036854775808L is valid if operand of a '-'. Otherwise ! 9223372036854775807L is the biggest `long' literal that can be ! expressed using a 10 radix. For other radices, everything that ! fits withing 64 bits is OK. */ ! int hb = (high >> 31); ! if (overflow || (hb && low && radix == 10) ! || (hb && high & 0x7fffffff && radix == 10)) JAVA_INTEGRAL_RANGE_ERROR ("Numeric overflow for `long' literal"); ! } ! else ! { ! /* 2147483648 is valid if operand of a '-'. Otherwise, ! 2147483647 is the biggest `int' literal that can be ! expressed using a 10 radix. For other radices, everything ! that fits within 32 bits is OK. As all literals are ! signed, we sign extend here. */ ! int hb = (low >> 31) & 0x1; ! if (overflow || high || (hb && low & 0x7fffffff && radix == 10)) JAVA_INTEGRAL_RANGE_ERROR ("Numeric overflow for `int' literal"); - high = -hb; } ! #ifndef JC1_LITE ! value = build_int_2 (low, high); JAVA_RADIX10_FLAG (value) = radix == 10; - SET_LVAL_NODE_TYPE (value, long_suffix ? long_type_node : int_type_node); #else SET_LVAL_NODE_TYPE (build_int_2 (low, high), long_suffix ? long_type_node : int_type_node); --- 1221,1255 ---- } /* End borrowed section. */ + #ifndef JC1_LITE /* Range checking. */ ! value = build_int_2 (low, high); ! /* Temporarily set type to unsigned. */ ! SET_LVAL_NODE_TYPE (value, (long_suffix ! ? unsigned_long_type_node ! : unsigned_int_type_node)); ! ! /* For base 10 numbers, only values up to the highest value ! (plus one) can be written. For instance, only ints up to ! 2147483648 can be written. The special case of the largest ! negative value is handled elsewhere. For other bases, any ! number can be represented. */ ! if (overflow || (radix == 10 ! && tree_int_cst_lt (long_suffix ! ? decimal_long_max ! : decimal_int_max, ! value))) { ! if (long_suffix) JAVA_INTEGRAL_RANGE_ERROR ("Numeric overflow for `long' literal"); ! else JAVA_INTEGRAL_RANGE_ERROR ("Numeric overflow for `int' literal"); } ! ! /* Sign extend the value. */ ! SET_LVAL_NODE_TYPE (value, (long_suffix ? long_type_node : int_type_node)); ! force_fit_type (value, 0); JAVA_RADIX10_FLAG (value) = radix == 10; #else SET_LVAL_NODE_TYPE (build_int_2 (low, high), long_suffix ? long_type_node : int_type_node); *************** java_lex (java_lval) *** 1558,1564 **** /* Keyword, boolean literal or null literal. */ for (first_unicode = c, all_ascii = 1, ascii_index = 0; ! JAVA_PART_CHAR_P (c); c = java_get_unicode ()) { java_unicode_2_utf8 (c); if (all_ascii && c >= 128) --- 1544,1550 ---- /* Keyword, boolean literal or null literal. */ for (first_unicode = c, all_ascii = 1, ascii_index = 0; ! c != UEOF && JAVA_PART_CHAR_P (c); c = java_get_unicode ()) { java_unicode_2_utf8 (c); if (all_ascii && c >= 128) *************** java_lex (java_lval) *** 1568,1574 **** obstack_1grow (&temporary_obstack, '\0'); string = obstack_finish (&temporary_obstack); ! java_unget_unicode (); /* If we have something all ascii, we consider a keyword, a boolean literal, a null literal or an all ASCII identifier. Otherwise, --- 1554,1561 ---- obstack_1grow (&temporary_obstack, '\0'); string = obstack_finish (&temporary_obstack); ! if (c != UEOF) ! java_unget_unicode (); /* If we have something all ascii, we consider a keyword, a boolean literal, a null literal or an all ASCII identifier. Otherwise, *************** java_lex (java_lval) *** 1622,1627 **** --- 1609,1623 ---- SET_LVAL_NODE (null_pointer_node); return NULL_TK; + case ASSERT_TK: + if (flag_assert) + { + BUILD_OPERATOR (kw->token); + return kw->token; + } + else + break; + /* Some keyword we want to retain information on the location they where found. */ case CASE_TK: *************** static void *** 1670,1693 **** error_if_numeric_overflow (value) tree value; { ! if (TREE_CODE (value) == INTEGER_CST && JAVA_RADIX10_FLAG (value)) { - unsigned HOST_WIDE_INT lo, hi; - - lo = TREE_INT_CST_LOW (value); - hi = TREE_INT_CST_HIGH (value); if (TREE_TYPE (value) == long_type_node) ! { ! int hb = (hi >> 31); ! if (hb && !(hi & 0x7fffffff)) ! java_lex_error ("Numeric overflow for `long' literal", 0); ! } else ! { ! int hb = (lo >> 31) & 0x1; ! if (hb && !(lo & 0x7fffffff)) ! java_lex_error ("Numeric overflow for `int' literal", 0); ! } } } #endif /* JC1_LITE */ --- 1666,1679 ---- error_if_numeric_overflow (value) tree value; { ! if (TREE_CODE (value) == INTEGER_CST ! && JAVA_RADIX10_FLAG (value) ! && tree_int_cst_sgn (value) < 0) { if (TREE_TYPE (value) == long_type_node) ! java_lex_error ("Numeric overflow for `long' literal", 0); else ! java_lex_error ("Numeric overflow for `int' literal", 0); } } #endif /* JC1_LITE */ diff -Nrc3pad gcc-3.2.3/gcc/java/lex.h gcc-3.3/gcc/java/lex.h *** gcc-3.2.3/gcc/java/lex.h 2001-10-21 21:32:11.000000000 +0000 --- gcc-3.3/gcc/java/lex.h 2002-11-06 00:01:01.000000000 +0000 *************** *** 1,5 **** /* Language lexer definitions for the GNU compiler for the Java(TM) language. ! Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GNU CC. --- 1,5 ---- /* Language lexer definitions for the GNU compiler for the Java(TM) language. ! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GNU CC. *************** extern void java_destroy_lexer PARAMS (( *** 185,191 **** #define SET_LVAL_NODE_TYPE(NODE, TYPE) #define BUILD_ID_WFL(EXP) (EXP) #define JAVA_FLOAT_RANGE_ERROR(S) {} ! #define JAVA_INTEGRAL_RANGE_ERROR(S) {} #else --- 185,191 ---- #define SET_LVAL_NODE_TYPE(NODE, TYPE) #define BUILD_ID_WFL(EXP) (EXP) #define JAVA_FLOAT_RANGE_ERROR(S) {} ! #define JAVA_INTEGRAL_RANGE_ERROR(S) do { } while (0) #else *************** extern void java_destroy_lexer PARAMS (( *** 237,248 **** ctxp->c_line->current = i; \ } #define JAVA_INTEGRAL_RANGE_ERROR(m) \ ! { \ int i = ctxp->c_line->current; \ ctxp->c_line->current = number_beginning; \ java_lex_error (m, 0); \ ctxp->c_line->current = i; \ ! } #endif /* Definitions for jc1 compilation only */ --- 237,248 ---- ctxp->c_line->current = i; \ } #define JAVA_INTEGRAL_RANGE_ERROR(m) \ ! do { \ int i = ctxp->c_line->current; \ ctxp->c_line->current = number_beginning; \ java_lex_error (m, 0); \ ctxp->c_line->current = i; \ ! } while (0) #endif /* Definitions for jc1 compilation only */ diff -Nrc3pad gcc-3.2.3/gcc/java/Make-lang.in gcc-3.3/gcc/java/Make-lang.in *** gcc-3.2.3/gcc/java/Make-lang.in 2003-01-28 21:52:53.000000000 +0000 --- gcc-3.3/gcc/java/Make-lang.in 2003-04-10 14:54:08.000000000 +0000 *************** *** 43,48 **** --- 43,49 ---- # Actual names to use when installing a native compiler. JAVA_INSTALL_NAME = `echo gcj|sed '$(program_transform_name)'` + JAVA_TARGET_INSTALL_NAME = $(target_alias)-`echo gcj|sed '$(program_transform_name)'` # Actual names to use when installing a cross-compiler. JAVA_CROSS_NAME = `echo gcj|sed '$(program_transform_cross_name)'` *************** $(srcdir)/java/keyword.h: $(srcdir)/java *** 97,117 **** exit 1; } ; \ mv -f k$$$$.h keyword.h) # Executables built by this Makefile: JAVA_OBJS = java/parse.o java/class.o java/decl.o java/expr.o \ java/constants.o java/lang.o java/typeck.o java/except.o java/verify.o \ ! java/zextract.o java/jcf-io.o java/jcf-parse.o java/mangle.o \ ! java/mangle_name.o java/builtins.o \ java/jcf-write.o java/buffer.o java/check-init.o java/jcf-depend.o \ ! java/jcf-path.o java/xref.o java/boehm.o mkdeps.o ! GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \ ! java/zextract.o version.o mkdeps.o errors.o JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o ! JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \ ! java/zextract.o errors.o version.o mkdeps.o JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o --- 98,123 ---- exit 1; } ; \ mv -f k$$$$.h keyword.h) + gt-java-class.h gt-java-constants.h gt-java-decl.h : s-gtype ; @true + gt-java-expr.h gt-java-jcf-parse.h gt-java-jcf-write.h : s-gtype ; @true + gt-java-lang.h gt-java-mangle.h gt-java-parse.h : s-gtype ; @true + gt-java-builtins.h gtype-java.h : s-gtype ; @true + # Executables built by this Makefile: JAVA_OBJS = java/parse.o java/class.o java/decl.o java/expr.o \ java/constants.o java/lang.o java/typeck.o java/except.o java/verify.o \ ! java/zextract.o java/jcf-io.o java/win32-host.o java/jcf-parse.o \ ! java/mangle.o java/mangle_name.o java/builtins.o \ java/jcf-write.o java/buffer.o java/check-init.o java/jcf-depend.o \ ! java/jcf-path.o java/xref.o java/boehm.o java/java-tree-inline.o mkdeps.o ! GCJH_OBJS = java/gjavah.o java/jcf-io.o java/win32-host.o java/jcf-depend.o \ ! java/jcf-path.o java/zextract.o version.o mkdeps.o errors.o JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o ! JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/win32-host.o java/jcf-depend.o \ ! java/jcf-path.o java/zextract.o errors.o version.o mkdeps.o JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o *************** jv-scan$(exeext): $(JVSCAN_OBJS) $(LIBDE *** 133,139 **** jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIBDEPS) rm -f $@ ! $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) $(ZLIB) $(LIBS) jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS) rm -f $@ --- 139,146 ---- jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIBDEPS) rm -f $@ ! $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \ ! $(ZLIB) $(LDEXP_LIB) $(LIBS) jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS) rm -f $@ *************** java.install-common: installdirs *** 171,176 **** --- 178,186 ---- rm -f $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ chmod a+x $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \ + rm -f $(DESTDIR)$(bindir)/$(JAVA_TARGET_INSTALL_NAME)$(exeext); \ + ( cd $(DESTDIR)$(bindir) && \ + $(LN) $(JAVA_INSTALL_NAME)$(exeext) $(JAVA_TARGET_INSTALL_NAME)$(exeext) ); \ fi ; \ fi ; \ for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \ *************** java.install-info: installdirs *** 219,224 **** --- 229,235 ---- java.mostlyclean: -rm -f java/*$(objext) $(DEMANGLER_PROG) + -rm -f java/*$(coverageexts) -rm -f jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext) s-java java.clean: java.distclean: *************** java.stage4: stage4-start *** 248,258 **** # # .o:.h dependencies. ! JAVA_TREE_H = $(TREE_H) java/java-tree.h java/java-tree.def JAVA_LEX_C = java/lex.c java/keyword.h java/chartables.h java/parse.o: java/parse.c java/jcf-reader.c $(CONFIG_H) $(SYSTEM_H) \ ! function.h $(JAVA_TREE_H) $(JAVA_LEX_C) java/parse.h java/lex.h $(GGC_H) java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/jcf-dump.c \ java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def version.h java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/gjavah.c \ --- 259,270 ---- # # .o:.h dependencies. ! JAVA_TREE_H = $(TREE_H) $(HASHTAB_H) java/java-tree.h java/java-tree.def JAVA_LEX_C = java/lex.c java/keyword.h java/chartables.h java/parse.o: java/parse.c java/jcf-reader.c $(CONFIG_H) $(SYSTEM_H) \ ! function.h $(JAVA_TREE_H) $(JAVA_LEX_C) java/parse.h java/lex.h $(GGC_H) \ ! debug.h gt-java-parse.h gtype-java.h java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/jcf-dump.c \ java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def version.h java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) java/gjavah.c \ *************** java/boehm.o: java/boehm.c $(CONFIG_H) $ *** 261,303 **** java/parse.h toplev.h java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) toplev.h java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) \ ! $(GGC_H) flags.h java/check-init.o: java/check-init.c $(CONFIG_H) \ $(JAVA_TREE_H) $(SYSTEM_H) toplev.h java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \ ! java/parse.h toplev.h $(SYSTEM_H) output.h $(GGC_H) $(TARGET_H) function.h java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ ! toplev.h $(SYSTEM_H) $(GGC_H) java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \ toplev.h flags.h $(SYSTEM_H) function.h expr.h libfuncs.h except.h \ ! java/java-except.h $(GGC_H) java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \ $(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \ toplev.h $(SYSTEM_H) function.h java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \ $(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \ java/java-except.h java/java-except.h java/parse.h toplev.h \ ! $(SYSTEM_H) $(GGC_H) java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) flags.h \ input.h java/java-except.h $(SYSTEM_H) toplev.h java/parse.h $(GGC_H) \ ! debug.h java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ $(RTL_H) java/java-opcodes.h java/parse.h java/buffer.h $(SYSTEM_H) \ ! toplev.h $(GGC_H) java/jv-scan.o: java/jv-scan.c $(CONFIG_H) $(SYSTEM_H) version.h java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \ toplev.h $(SYSTEM_H) $(RTL_H) $(EXPR_H) diagnostic.h langhooks.h \ ! langhooks-def.h java/mangle.o: java/mangle.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) $(SYSTEM_H) \ ! toplev.h $(GGC_H) java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) \ $(SYSTEM_H) toplev.h $(GGC_H) java/parse-scan.o: $(CONFIG_H) $(SYSTEM_H) toplev.h $(JAVA_LEX_C) java/parse.h \ java/lex.h java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ ! java/convert.h toplev.h $(SYSTEM_H) $(GGC_H) java/verify.o: java/verify.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ java/javaop.h java/java-opcodes.h java/java-except.h toplev.h $(SYSTEM_H) java/xref.o: java/xref.c java/xref.h $(CONFIG_H) $(JAVA_TREE_H) toplev.h \ --- 273,324 ---- java/parse.h toplev.h java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) toplev.h java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) \ ! $(GGC_H) flags.h builtin-types.def langhooks.h gt-java-builtins.h java/check-init.o: java/check-init.c $(CONFIG_H) \ $(JAVA_TREE_H) $(SYSTEM_H) toplev.h java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \ ! java/parse.h toplev.h $(SYSTEM_H) output.h $(GGC_H) $(TARGET_H) function.h \ ! gt-java-class.h java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ ! toplev.h $(SYSTEM_H) $(GGC_H) gt-java-constants.h java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \ toplev.h flags.h $(SYSTEM_H) function.h expr.h libfuncs.h except.h \ ! java/java-except.h $(GGC_H) real.h gt-java-decl.h java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \ $(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \ toplev.h $(SYSTEM_H) function.h java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \ $(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \ java/java-except.h java/java-except.h java/parse.h toplev.h \ ! $(SYSTEM_H) $(GGC_H) gt-java-expr.h ! java/java-tree-inline.o: tree-inline.c $(CONFIG_H) $(SYSTEM_H) \ ! $(TREE_H) $(RTL_H) expr.h flags.h params.h input.h insn-config.h \ ! $(INTEGRATE_H) $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \ ! langhooks.h $(C_COMMON_H) $(srcdir)/tree-inline.h ! $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ ! -DINLINER_FOR_JAVA=1 \ ! $(srcdir)/tree-inline.c -o $@ java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) flags.h \ input.h java/java-except.h $(SYSTEM_H) toplev.h java/parse.h $(GGC_H) \ ! debug.h real.h gt-java-jcf-parse.h ! java/win32-host.o: java/win32-host.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ $(RTL_H) java/java-opcodes.h java/parse.h java/buffer.h $(SYSTEM_H) \ ! toplev.h $(GGC_H) gt-java-jcf-write.h java/jv-scan.o: java/jv-scan.c $(CONFIG_H) $(SYSTEM_H) version.h java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \ toplev.h $(SYSTEM_H) $(RTL_H) $(EXPR_H) diagnostic.h langhooks.h \ ! $(LANGHOOKS_DEF_H) gt-java-lang.h java/mangle.o: java/mangle.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) $(SYSTEM_H) \ ! toplev.h $(GGC_H) gt-java-mangle.h java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) \ $(SYSTEM_H) toplev.h $(GGC_H) java/parse-scan.o: $(CONFIG_H) $(SYSTEM_H) toplev.h $(JAVA_LEX_C) java/parse.h \ java/lex.h java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ ! java/convert.h toplev.h $(SYSTEM_H) $(GGC_H) real.h java/verify.o: java/verify.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ java/javaop.h java/java-opcodes.h java/java-except.h toplev.h $(SYSTEM_H) java/xref.o: java/xref.c java/xref.h $(CONFIG_H) $(JAVA_TREE_H) toplev.h \ *************** java/jcf-io.o: java/jcf-io.c $(CONFIG_H) *** 312,389 **** # jcf-path.o needs a -D. java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ ! -DLIBGCJ_ZIP_FILE='"$(prefix)/share/java/libgcj-$(version).jar"' \ -DDEFAULT_TARGET_VERSION=\"$(version)\" \ $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION) # Documentation $(srcdir)/java/gcj.info: $(srcdir)/java/gcj.texi \ ! $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gpl.texi if test "x$(BUILD_INFO)" = xinfo; then \ rm -f $(srcdir)/java/gcc.info*; \ cd $(srcdir)/java && $(MAKEINFO) -I../doc/include -o gcj.info gcj.texi; \ else true; fi java/gcj.dvi: $(srcdir)/java/gcj.texi $(srcdir)/doc/include/fdl.texi \ ! $(srcdir)/doc/include/gpl.texi ! s=`cd $(srcdir); pwd`; export s; \ cd java && $(TEXI2DVI) -I $$s/doc/include $$s/java/gcj.texi $(srcdir)/java/gcj.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D gcj < $(srcdir)/java/gcj.texi > java/gcj.pod ! ($(POD2MAN) --section=1 java/gcj.pod > java/gcj.1.T$$$$ && \ mv -f java/gcj.1.T$$$$ $(srcdir)/java/gcj.1) || \ (rm -f java/gcj.1.T$$$$ && exit 1) ! rm -f java/gcj.pod $(srcdir)/java/gcjh.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D gcjh < $(srcdir)/java/gcj.texi > java/gcjh.pod ! ($(POD2MAN) --section=1 java/gcjh.pod > java/gcjh.1.T$$$$ && \ mv -f java/gcjh.1.T$$$$ $(srcdir)/java/gcjh.1) || \ (rm -f java/gcjh.1.T$$$$ && exit 1) ! rm -f java/gcjh.pod $(srcdir)/java/jv-scan.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D jv-scan < $(srcdir)/java/gcj.texi > java/jv-scan.pod ! ($(POD2MAN) --section=1 java/jv-scan.pod > java/jv-scan.1.T$$$$ && \ mv -f java/jv-scan.1.T$$$$ $(srcdir)/java/jv-scan.1) || \ (rm -f java/jv-scan.1.T$$$$ && exit 1) ! rm -f java/jv-scan.pod $(srcdir)/java/jcf-dump.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D jcf-dump < $(srcdir)/java/gcj.texi > java/jcf-dump.pod ! ($(POD2MAN) --section=1 java/jcf-dump.pod > java/jcf-dump.1.T$$$$ && \ mv -f java/jcf-dump.1.T$$$$ $(srcdir)/java/jcf-dump.1) || \ (rm -f java/jcf-dump.1.T$$$$ && exit 1) ! rm -f java/jcf-dump.pod $(srcdir)/java/gij.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D gij < $(srcdir)/java/gcj.texi > java/gij.pod ! ($(POD2MAN) --section=1 java/gij.pod > java/gij.1.T$$$$ && \ mv -f java/gij.1.T$$$$ $(srcdir)/java/gij.1) || \ (rm -f java/gij.1.T$$$$ && exit 1) ! rm -f java/gij.pod $(srcdir)/java/jv-convert.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D jv-convert < $(srcdir)/java/gcj.texi > java/jv-convert.pod ! ($(POD2MAN) --section=1 java/jv-convert.pod > java/jv-convert.1.T$$$$ && \ mv -f java/jv-convert.1.T$$$$ $(srcdir)/java/jv-convert.1) || \ (rm -f java/jv-convert.1.T$$$$ && exit 1) ! rm -f java/jv-convert.pod $(srcdir)/java/rmic.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D rmic < $(srcdir)/java/gcj.texi > java/rmic.pod ! ($(POD2MAN) --section=1 java/rmic.pod > java/rmic.1.T$$$$ && \ mv -f java/rmic.1.T$$$$ $(srcdir)/java/rmic.1) || \ (rm -f java/rmic.1.T$$$$ && exit 1) ! rm -f java/rmic.pod $(srcdir)/java/rmiregistry.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D rmiregistry < $(srcdir)/java/gcj.texi > java/rmiregistry.pod ! ($(POD2MAN) --section=1 java/rmiregistry.pod > java/rmiregistry.1.T$$$$ && \ mv -f java/rmiregistry.1.T$$$$ $(srcdir)/java/rmiregistry.1) || \ (rm -f java/rmiregistry.1.T$$$$ && exit 1) ! rm -f java/rmiregistry.pod # Install the man pages. java.install-man: installdirs $(GENERATED_JAVA_MANPAGES) --- 333,411 ---- # jcf-path.o needs a -D. java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ ! -DLIBGCJ_ZIP_FILE='"$(datadir)/java/libgcj-$(version).jar"' \ -DDEFAULT_TARGET_VERSION=\"$(version)\" \ $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION) # Documentation $(srcdir)/java/gcj.info: $(srcdir)/java/gcj.texi \ ! $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gpl.texi \ ! $(srcdir)/doc/include/gcc-common.texi if test "x$(BUILD_INFO)" = xinfo; then \ rm -f $(srcdir)/java/gcc.info*; \ cd $(srcdir)/java && $(MAKEINFO) -I../doc/include -o gcj.info gcj.texi; \ else true; fi java/gcj.dvi: $(srcdir)/java/gcj.texi $(srcdir)/doc/include/fdl.texi \ ! $(srcdir)/doc/include/gpl.texi $(srcdir)/doc/include/gcc-common.texi ! s=`cd $(srcdir); ${PWD}`; export s; \ cd java && $(TEXI2DVI) -I $$s/doc/include $$s/java/gcj.texi $(srcdir)/java/gcj.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D gcj < $(srcdir)/java/gcj.texi > java/gcj.pod ! -($(POD2MAN) --section=1 java/gcj.pod > java/gcj.1.T$$$$ && \ mv -f java/gcj.1.T$$$$ $(srcdir)/java/gcj.1) || \ (rm -f java/gcj.1.T$$$$ && exit 1) ! -rm -f java/gcj.pod $(srcdir)/java/gcjh.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D gcjh < $(srcdir)/java/gcj.texi > java/gcjh.pod ! -($(POD2MAN) --section=1 java/gcjh.pod > java/gcjh.1.T$$$$ && \ mv -f java/gcjh.1.T$$$$ $(srcdir)/java/gcjh.1) || \ (rm -f java/gcjh.1.T$$$$ && exit 1) ! -rm -f java/gcjh.pod $(srcdir)/java/jv-scan.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D jv-scan < $(srcdir)/java/gcj.texi > java/jv-scan.pod ! -($(POD2MAN) --section=1 java/jv-scan.pod > java/jv-scan.1.T$$$$ && \ mv -f java/jv-scan.1.T$$$$ $(srcdir)/java/jv-scan.1) || \ (rm -f java/jv-scan.1.T$$$$ && exit 1) ! -rm -f java/jv-scan.pod $(srcdir)/java/jcf-dump.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D jcf-dump < $(srcdir)/java/gcj.texi > java/jcf-dump.pod ! -($(POD2MAN) --section=1 java/jcf-dump.pod > java/jcf-dump.1.T$$$$ && \ mv -f java/jcf-dump.1.T$$$$ $(srcdir)/java/jcf-dump.1) || \ (rm -f java/jcf-dump.1.T$$$$ && exit 1) ! -rm -f java/jcf-dump.pod $(srcdir)/java/gij.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D gij < $(srcdir)/java/gcj.texi > java/gij.pod ! -($(POD2MAN) --section=1 java/gij.pod > java/gij.1.T$$$$ && \ mv -f java/gij.1.T$$$$ $(srcdir)/java/gij.1) || \ (rm -f java/gij.1.T$$$$ && exit 1) ! -rm -f java/gij.pod $(srcdir)/java/jv-convert.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D jv-convert < $(srcdir)/java/gcj.texi > java/jv-convert.pod ! -($(POD2MAN) --section=1 java/jv-convert.pod > java/jv-convert.1.T$$$$ && \ mv -f java/jv-convert.1.T$$$$ $(srcdir)/java/jv-convert.1) || \ (rm -f java/jv-convert.1.T$$$$ && exit 1) ! -rm -f java/jv-convert.pod $(srcdir)/java/rmic.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D rmic < $(srcdir)/java/gcj.texi > java/rmic.pod ! -($(POD2MAN) --section=1 java/rmic.pod > java/rmic.1.T$$$$ && \ mv -f java/rmic.1.T$$$$ $(srcdir)/java/rmic.1) || \ (rm -f java/rmic.1.T$$$$ && exit 1) ! -rm -f java/rmic.pod $(srcdir)/java/rmiregistry.1: $(srcdir)/java/gcj.texi -$(TEXI2POD) -D rmiregistry < $(srcdir)/java/gcj.texi > java/rmiregistry.pod ! -($(POD2MAN) --section=1 java/rmiregistry.pod > java/rmiregistry.1.T$$$$ && \ mv -f java/rmiregistry.1.T$$$$ $(srcdir)/java/rmiregistry.1) || \ (rm -f java/rmiregistry.1.T$$$$ && exit 1) ! -rm -f java/rmiregistry.pod # Install the man pages. java.install-man: installdirs $(GENERATED_JAVA_MANPAGES) diff -Nrc3pad gcc-3.2.3/gcc/java/mangle.c gcc-3.3/gcc/java/mangle.c *** gcc-3.2.3/gcc/java/mangle.c 2001-12-20 22:48:51.000000000 +0000 --- gcc-3.3/gcc/java/mangle.c 2002-09-21 02:19:44.000000000 +0000 *************** mangle_method_decl (mdecl) *** 170,176 **** } /* This mangles a member name, like a function name or a field ! name. Handle cases were `name' is a C++ keyword. Return a non zero value if unicode encoding was required. */ static void --- 170,176 ---- } /* This mangles a member name, like a function name or a field ! name. Handle cases were `name' is a C++ keyword. Return a nonzero value if unicode encoding was required. */ static void *************** mangle_type (type) *** 245,251 **** COMPRESSION_NEXT is the index to the location of the next insertion of an element. */ ! static tree compression_table; static int compression_next; /* Find a POINTER_TYPE in the compression table. Use a special --- 245,251 ---- COMPRESSION_NEXT is the index to the location of the next insertion of an element. */ ! static GTY(()) tree compression_table; static int compression_next; /* Find a POINTER_TYPE in the compression table. Use a special *************** find_compression_record_match (type, nex *** 340,346 **** return match; } ! /* Mangle a record type. If a non zero value is returned, it means that a 'N' was emitted (so that a matching 'E' can be emitted if necessary.) FOR_POINTER indicates that this element is for a pointer symbol, meaning it was preceded by a 'P'. */ --- 340,346 ---- return match; } ! /* Mangle a record type. If a nonzero value is returned, it means that a 'N' was emitted (so that a matching 'E' can be emitted if necessary.) FOR_POINTER indicates that this element is for a pointer symbol, meaning it was preceded by a 'P'. */ *************** mangle_pointer_type (type) *** 431,442 **** the template indicator where already used an compress appropriately. It handles pointers. */ static void mangle_array_type (p_type) tree p_type; { - /* atms: array template mangled string. */ - static tree atms = NULL_TREE; tree type, elt_type; int match; --- 431,442 ---- the template indicator where already used an compress appropriately. It handles pointers. */ + /* atms: array template mangled string. */ + static GTY(()) tree atms; static void mangle_array_type (p_type) tree p_type; { tree type, elt_type; int match; *************** mangle_array_type (p_type) *** 450,456 **** if (!atms) { atms = get_identifier ("6JArray"); - ggc_add_tree_root (&atms, 1); } /* Maybe we have what we're looking in the compression table. */ --- 450,455 ---- *************** compression_table_add (type) *** 602,610 **** for (i = 0; i < compression_next; i++) TREE_VEC_ELT (new, i) = TREE_VEC_ELT (compression_table, i); - ggc_del_root (&compression_table); compression_table = new; - ggc_add_tree_root (&compression_table, 1); } TREE_VEC_ELT (compression_table, compression_next++) = type; } --- 601,607 ---- *************** init_mangling (obstack) *** 624,632 **** /* Mangled name are to be suffixed */ obstack_grow (mangle_obstack, "_Z", 2); - - /* Register the compression table with the GC */ - ggc_add_tree_root (&compression_table, 1); } /* Mangling finalization routine. The mangled name is returned as a --- 621,626 ---- *************** finish_mangling () *** 641,647 **** /* Mangling already finished. */ abort (); - ggc_del_root (&compression_table); compression_table = NULL_TREE; compression_next = 0; obstack_1grow (mangle_obstack, '\0'); --- 635,640 ---- *************** finish_mangling () *** 652,654 **** --- 645,649 ---- #endif return result; } + + #include "gt-java-mangle.h" diff -Nrc3pad gcc-3.2.3/gcc/java/mangle_name.c gcc-3.3/gcc/java/mangle_name.c *** gcc-3.2.3/gcc/java/mangle_name.c 2001-12-20 22:48:51.000000000 +0000 --- gcc-3.3/gcc/java/mangle_name.c 2002-08-05 18:46:37.000000000 +0000 *************** The Free Software Foundation is independ *** 32,38 **** #include "java-tree.h" #include "obstack.h" #include "toplev.h" - #include "obstack.h" static void append_unicode_mangled_name PARAMS ((const char *, int)); #ifndef HAVE_AS_UTF8 --- 32,37 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/parse.c gcc-3.3/gcc/java/parse.c *** gcc-3.2.3/gcc/java/parse.c 2003-04-22 08:16:52.000000000 +0000 --- gcc-3.3/gcc/java/parse.c 2003-05-14 00:59:30.000000000 +0000 *************** *** 1,297 **** ! /* A Bison parser, made by GNU Bison 1.875. */ ! ! /* Skeleton parser for Yacc-like parsing with Bison, ! Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, ! Boston, MA 02111-1307, USA. */ ! ! /* As a special exception, when this file is copied by Bison into a ! Bison output file, you may use that output file without restriction. ! This special exception was added by the Free Software Foundation ! in version 1.24 of Bison. */ ! ! /* Written by Richard Stallman by simplifying the original so called ! ``semantic'' parser. */ ! ! /* All symbols defined below should begin with yy or YY, to avoid ! infringing on user name space. This should be done even for local ! variables, as they might otherwise be expanded by user macros. ! There are some unavoidable exceptions within include files to ! define necessary library symbols; they are noted "INFRINGES ON ! USER NAME SPACE" below. */ ! ! /* Identify Bison output. */ ! #define YYBISON 1 ! ! /* Skeleton name. */ ! #define YYSKELETON_NAME "yacc.c" ! ! /* Pure parsers. */ ! #define YYPURE 1 ! /* Using locations. */ ! #define YYLSP_NEEDED 0 - /* If NAME_PREFIX is specified substitute the variables and functions - names. */ #define yyparse java_parse ! #define yylex java_lex #define yyerror java_error ! #define yylval java_lval ! #define yychar java_char #define yydebug java_debug #define yynerrs java_nerrs ! ! /* Tokens. */ ! #ifndef YYTOKENTYPE ! # define YYTOKENTYPE ! /* Put the tokens into the symbol table, so that GDB and other debuggers ! know about them. */ ! enum yytokentype { ! PLUS_TK = 258, ! MINUS_TK = 259, ! MULT_TK = 260, ! DIV_TK = 261, ! REM_TK = 262, ! LS_TK = 263, ! SRS_TK = 264, ! ZRS_TK = 265, ! AND_TK = 266, ! XOR_TK = 267, ! OR_TK = 268, ! BOOL_AND_TK = 269, ! BOOL_OR_TK = 270, ! EQ_TK = 271, ! NEQ_TK = 272, ! GT_TK = 273, ! GTE_TK = 274, ! LT_TK = 275, ! LTE_TK = 276, ! PLUS_ASSIGN_TK = 277, ! MINUS_ASSIGN_TK = 278, ! MULT_ASSIGN_TK = 279, ! DIV_ASSIGN_TK = 280, ! REM_ASSIGN_TK = 281, ! LS_ASSIGN_TK = 282, ! SRS_ASSIGN_TK = 283, ! ZRS_ASSIGN_TK = 284, ! AND_ASSIGN_TK = 285, ! XOR_ASSIGN_TK = 286, ! OR_ASSIGN_TK = 287, ! PUBLIC_TK = 288, ! PRIVATE_TK = 289, ! PROTECTED_TK = 290, ! STATIC_TK = 291, ! FINAL_TK = 292, ! SYNCHRONIZED_TK = 293, ! VOLATILE_TK = 294, ! TRANSIENT_TK = 295, ! NATIVE_TK = 296, ! PAD_TK = 297, ! ABSTRACT_TK = 298, ! STRICT_TK = 299, ! MODIFIER_TK = 300, ! DECR_TK = 301, ! INCR_TK = 302, ! DEFAULT_TK = 303, ! IF_TK = 304, ! THROW_TK = 305, ! BOOLEAN_TK = 306, ! DO_TK = 307, ! IMPLEMENTS_TK = 308, ! THROWS_TK = 309, ! BREAK_TK = 310, ! IMPORT_TK = 311, ! ELSE_TK = 312, ! INSTANCEOF_TK = 313, ! RETURN_TK = 314, ! VOID_TK = 315, ! CATCH_TK = 316, ! INTERFACE_TK = 317, ! CASE_TK = 318, ! EXTENDS_TK = 319, ! FINALLY_TK = 320, ! SUPER_TK = 321, ! WHILE_TK = 322, ! CLASS_TK = 323, ! SWITCH_TK = 324, ! CONST_TK = 325, ! TRY_TK = 326, ! FOR_TK = 327, ! NEW_TK = 328, ! CONTINUE_TK = 329, ! GOTO_TK = 330, ! PACKAGE_TK = 331, ! THIS_TK = 332, ! BYTE_TK = 333, ! SHORT_TK = 334, ! INT_TK = 335, ! LONG_TK = 336, ! CHAR_TK = 337, ! INTEGRAL_TK = 338, ! FLOAT_TK = 339, ! DOUBLE_TK = 340, ! FP_TK = 341, ! ID_TK = 342, ! REL_QM_TK = 343, ! REL_CL_TK = 344, ! NOT_TK = 345, ! NEG_TK = 346, ! ASSIGN_ANY_TK = 347, ! ASSIGN_TK = 348, ! OP_TK = 349, ! CP_TK = 350, ! OCB_TK = 351, ! CCB_TK = 352, ! OSB_TK = 353, ! CSB_TK = 354, ! SC_TK = 355, ! C_TK = 356, ! DOT_TK = 357, ! STRING_LIT_TK = 358, ! CHAR_LIT_TK = 359, ! INT_LIT_TK = 360, ! FP_LIT_TK = 361, ! TRUE_TK = 362, ! FALSE_TK = 363, ! BOOL_LIT_TK = 364, ! NULL_TK = 365 ! }; ! #endif ! #define PLUS_TK 258 ! #define MINUS_TK 259 ! #define MULT_TK 260 ! #define DIV_TK 261 ! #define REM_TK 262 ! #define LS_TK 263 ! #define SRS_TK 264 ! #define ZRS_TK 265 ! #define AND_TK 266 ! #define XOR_TK 267 ! #define OR_TK 268 ! #define BOOL_AND_TK 269 ! #define BOOL_OR_TK 270 ! #define EQ_TK 271 ! #define NEQ_TK 272 ! #define GT_TK 273 ! #define GTE_TK 274 ! #define LT_TK 275 ! #define LTE_TK 276 ! #define PLUS_ASSIGN_TK 277 ! #define MINUS_ASSIGN_TK 278 ! #define MULT_ASSIGN_TK 279 ! #define DIV_ASSIGN_TK 280 ! #define REM_ASSIGN_TK 281 ! #define LS_ASSIGN_TK 282 ! #define SRS_ASSIGN_TK 283 ! #define ZRS_ASSIGN_TK 284 ! #define AND_ASSIGN_TK 285 ! #define XOR_ASSIGN_TK 286 ! #define OR_ASSIGN_TK 287 ! #define PUBLIC_TK 288 ! #define PRIVATE_TK 289 ! #define PROTECTED_TK 290 ! #define STATIC_TK 291 ! #define FINAL_TK 292 ! #define SYNCHRONIZED_TK 293 ! #define VOLATILE_TK 294 ! #define TRANSIENT_TK 295 ! #define NATIVE_TK 296 ! #define PAD_TK 297 ! #define ABSTRACT_TK 298 ! #define STRICT_TK 299 ! #define MODIFIER_TK 300 ! #define DECR_TK 301 ! #define INCR_TK 302 ! #define DEFAULT_TK 303 ! #define IF_TK 304 ! #define THROW_TK 305 ! #define BOOLEAN_TK 306 ! #define DO_TK 307 ! #define IMPLEMENTS_TK 308 ! #define THROWS_TK 309 ! #define BREAK_TK 310 ! #define IMPORT_TK 311 ! #define ELSE_TK 312 ! #define INSTANCEOF_TK 313 ! #define RETURN_TK 314 ! #define VOID_TK 315 ! #define CATCH_TK 316 ! #define INTERFACE_TK 317 ! #define CASE_TK 318 ! #define EXTENDS_TK 319 ! #define FINALLY_TK 320 ! #define SUPER_TK 321 ! #define WHILE_TK 322 ! #define CLASS_TK 323 ! #define SWITCH_TK 324 ! #define CONST_TK 325 ! #define TRY_TK 326 ! #define FOR_TK 327 ! #define NEW_TK 328 ! #define CONTINUE_TK 329 ! #define GOTO_TK 330 ! #define PACKAGE_TK 331 ! #define THIS_TK 332 ! #define BYTE_TK 333 ! #define SHORT_TK 334 ! #define INT_TK 335 ! #define LONG_TK 336 ! #define CHAR_TK 337 ! #define INTEGRAL_TK 338 ! #define FLOAT_TK 339 ! #define DOUBLE_TK 340 ! #define FP_TK 341 ! #define ID_TK 342 ! #define REL_QM_TK 343 ! #define REL_CL_TK 344 ! #define NOT_TK 345 ! #define NEG_TK 346 ! #define ASSIGN_ANY_TK 347 ! #define ASSIGN_TK 348 ! #define OP_TK 349 ! #define CP_TK 350 ! #define OCB_TK 351 ! #define CCB_TK 352 ! #define OSB_TK 353 ! #define CSB_TK 354 ! #define SC_TK 355 ! #define C_TK 356 ! #define DOT_TK 357 ! #define STRING_LIT_TK 358 ! #define CHAR_LIT_TK 359 ! #define INT_LIT_TK 360 ! #define FP_LIT_TK 361 ! #define TRUE_TK 362 ! #define FALSE_TK 363 ! #define BOOL_LIT_TK 364 ! #define NULL_TK 365 ! ! ! ! ! /* Copy the first part of user declarations. */ ! #line 48 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" #include "config.h" #include "system.h" #include #include "tree.h" #include "rtl.h" #include "obstack.h" #include "toplev.h" #include "flags.h" --- 1,133 ---- ! /* A Bison parser, made from /home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y ! by GNU bison 1.35. */ ! #define YYBISON 1 /* Identify Bison output. */ #define yyparse java_parse ! #define yylex java_lex #define yyerror java_error ! #define yylval java_lval ! #define yychar java_char #define yydebug java_debug #define yynerrs java_nerrs + # define PLUS_TK 257 + # define MINUS_TK 258 + # define MULT_TK 259 + # define DIV_TK 260 + # define REM_TK 261 + # define LS_TK 262 + # define SRS_TK 263 + # define ZRS_TK 264 + # define AND_TK 265 + # define XOR_TK 266 + # define OR_TK 267 + # define BOOL_AND_TK 268 + # define BOOL_OR_TK 269 + # define EQ_TK 270 + # define NEQ_TK 271 + # define GT_TK 272 + # define GTE_TK 273 + # define LT_TK 274 + # define LTE_TK 275 + # define PLUS_ASSIGN_TK 276 + # define MINUS_ASSIGN_TK 277 + # define MULT_ASSIGN_TK 278 + # define DIV_ASSIGN_TK 279 + # define REM_ASSIGN_TK 280 + # define LS_ASSIGN_TK 281 + # define SRS_ASSIGN_TK 282 + # define ZRS_ASSIGN_TK 283 + # define AND_ASSIGN_TK 284 + # define XOR_ASSIGN_TK 285 + # define OR_ASSIGN_TK 286 + # define PUBLIC_TK 287 + # define PRIVATE_TK 288 + # define PROTECTED_TK 289 + # define STATIC_TK 290 + # define FINAL_TK 291 + # define SYNCHRONIZED_TK 292 + # define VOLATILE_TK 293 + # define TRANSIENT_TK 294 + # define NATIVE_TK 295 + # define PAD_TK 296 + # define ABSTRACT_TK 297 + # define STRICT_TK 298 + # define MODIFIER_TK 299 + # define DECR_TK 300 + # define INCR_TK 301 + # define DEFAULT_TK 302 + # define IF_TK 303 + # define THROW_TK 304 + # define BOOLEAN_TK 305 + # define DO_TK 306 + # define IMPLEMENTS_TK 307 + # define THROWS_TK 308 + # define BREAK_TK 309 + # define IMPORT_TK 310 + # define ELSE_TK 311 + # define INSTANCEOF_TK 312 + # define RETURN_TK 313 + # define VOID_TK 314 + # define CATCH_TK 315 + # define INTERFACE_TK 316 + # define CASE_TK 317 + # define EXTENDS_TK 318 + # define FINALLY_TK 319 + # define SUPER_TK 320 + # define WHILE_TK 321 + # define CLASS_TK 322 + # define SWITCH_TK 323 + # define CONST_TK 324 + # define TRY_TK 325 + # define FOR_TK 326 + # define NEW_TK 327 + # define CONTINUE_TK 328 + # define GOTO_TK 329 + # define PACKAGE_TK 330 + # define THIS_TK 331 + # define ASSERT_TK 332 + # define BYTE_TK 333 + # define SHORT_TK 334 + # define INT_TK 335 + # define LONG_TK 336 + # define CHAR_TK 337 + # define INTEGRAL_TK 338 + # define FLOAT_TK 339 + # define DOUBLE_TK 340 + # define FP_TK 341 + # define ID_TK 342 + # define REL_QM_TK 343 + # define REL_CL_TK 344 + # define NOT_TK 345 + # define NEG_TK 346 + # define ASSIGN_ANY_TK 347 + # define ASSIGN_TK 348 + # define OP_TK 349 + # define CP_TK 350 + # define OCB_TK 351 + # define CCB_TK 352 + # define OSB_TK 353 + # define CSB_TK 354 + # define SC_TK 355 + # define C_TK 356 + # define DOT_TK 357 + # define STRING_LIT_TK 358 + # define CHAR_LIT_TK 359 + # define INT_LIT_TK 360 + # define FP_LIT_TK 361 + # define TRUE_TK 362 + # define FALSE_TK 363 + # define BOOL_LIT_TK 364 + # define NULL_TK 365 ! #line 48 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" #include "config.h" #include "system.h" #include #include "tree.h" #include "rtl.h" + #include "real.h" #include "obstack.h" #include "toplev.h" #include "flags.h" *************** *** 306,315 **** #include "function.h" #include "except.h" #include "ggc.h" ! ! #ifndef DIR_SEPARATOR ! #define DIR_SEPARATOR '/' ! #endif /* Local function prototypes */ static char *java_accstring_lookup PARAMS ((int)); --- 142,149 ---- #include "function.h" #include "except.h" #include "ggc.h" ! #include "debug.h" ! #include "tree-inline.h" /* Local function prototypes */ static char *java_accstring_lookup PARAMS ((int)); *************** static void check_abstract_method_header *** 356,362 **** static tree lookup_java_interface_method2 PARAMS ((tree, tree)); static tree resolve_expression_name PARAMS ((tree, tree *)); static tree maybe_create_class_interface_decl PARAMS ((tree, tree, tree, tree)); ! static int check_class_interface_creation PARAMS ((int, int, tree, tree, tree, tree)); static tree patch_method_invocation PARAMS ((tree, tree, tree, int, int *, tree *)); --- 190,196 ---- static tree lookup_java_interface_method2 PARAMS ((tree, tree)); static tree resolve_expression_name PARAMS ((tree, tree *)); static tree maybe_create_class_interface_decl PARAMS ((tree, tree, tree, tree)); ! static int check_class_interface_creation PARAMS ((int, int, tree, tree, tree, tree)); static tree patch_method_invocation PARAMS ((tree, tree, tree, int, int *, tree *)); *************** static tree resolve_and_layout PARAMS (( *** 366,374 **** static tree qualify_and_find PARAMS ((tree, tree, tree)); static tree resolve_no_layout PARAMS ((tree, tree)); static int invocation_mode PARAMS ((tree, int)); ! static tree find_applicable_accessible_methods_list PARAMS ((int, tree, tree, tree)); ! static void search_applicable_methods_list PARAMS ((int, tree, tree, tree, tree *, tree *)); static tree find_most_specific_methods_list PARAMS ((tree)); static int argument_types_convertible PARAMS ((tree, tree)); --- 200,208 ---- static tree qualify_and_find PARAMS ((tree, tree, tree)); static tree resolve_no_layout PARAMS ((tree, tree)); static int invocation_mode PARAMS ((tree, int)); ! static tree find_applicable_accessible_methods_list PARAMS ((int, tree, tree, tree)); ! static void search_applicable_methods_list PARAMS ((int, tree, tree, tree, tree *, tree *)); static tree find_most_specific_methods_list PARAMS ((tree)); static int argument_types_convertible PARAMS ((tree, tree)); *************** static tree patch_array_ref PARAMS ((tre *** 420,426 **** static tree make_qualified_name PARAMS ((tree, tree, int)); static tree merge_qualified_name PARAMS ((tree, tree)); static tree make_qualified_primary PARAMS ((tree, tree, int)); ! static int resolve_qualified_expression_name PARAMS ((tree, tree *, tree *, tree *)); static void qualify_ambiguous_name PARAMS ((tree)); static tree resolve_field_access PARAMS ((tree, tree *, tree *)); --- 254,260 ---- static tree make_qualified_name PARAMS ((tree, tree, int)); static tree merge_qualified_name PARAMS ((tree, tree)); static tree make_qualified_primary PARAMS ((tree, tree, int)); ! static int resolve_qualified_expression_name PARAMS ((tree, tree *, tree *, tree *)); static void qualify_ambiguous_name PARAMS ((tree)); static tree resolve_field_access PARAMS ((tree, tree *, tree *)); *************** static tree build_return PARAMS ((int, t *** 433,439 **** static tree patch_return PARAMS ((tree)); static tree maybe_access_field PARAMS ((tree, tree, tree)); static int complete_function_arguments PARAMS ((tree)); ! static int check_for_static_method_reference PARAMS ((tree, tree, tree, tree, tree)); static int not_accessible_p PARAMS ((tree, tree, tree, int)); static void check_deprecation PARAMS ((tree, tree)); --- 267,273 ---- static tree patch_return PARAMS ((tree)); static tree maybe_access_field PARAMS ((tree, tree, tree)); static int complete_function_arguments PARAMS ((tree)); ! static int check_for_static_method_reference PARAMS ((tree, tree, tree, tree, tree)); static int not_accessible_p PARAMS ((tree, tree, tree, int)); static void check_deprecation PARAMS ((tree, tree)); *************** static tree build_string_concatenation P *** 459,464 **** --- 293,299 ---- static tree patch_string_cst PARAMS ((tree)); static tree patch_string PARAMS ((tree)); static tree encapsulate_with_try_catch PARAMS ((int, tree, tree, tree)); + static tree build_assertion PARAMS ((int, tree, tree)); static tree build_try_statement PARAMS ((int, tree, tree)); static tree build_try_finally_statement PARAMS ((int, tree, tree)); static tree patch_try_statement PARAMS ((tree)); *************** static int pop_current_osb PARAMS ((stru *** 535,545 **** /* JDK 1.1 work. FIXME */ static tree maybe_make_nested_class_name PARAMS ((tree)); ! static void make_nested_class_name PARAMS ((tree)); static void set_nested_class_simple_name_value PARAMS ((tree, int)); static void link_nested_class_to_enclosing PARAMS ((void)); ! static tree resolve_inner_class PARAMS ((struct hash_table *, tree, tree *, ! tree *, tree)); static tree find_as_inner_class PARAMS ((tree, tree, tree)); static tree find_as_inner_class_do PARAMS ((tree, tree)); static int check_inner_class_redefinition PARAMS ((tree, tree)); --- 370,379 ---- /* JDK 1.1 work. FIXME */ static tree maybe_make_nested_class_name PARAMS ((tree)); ! static int make_nested_class_name PARAMS ((tree)); static void set_nested_class_simple_name_value PARAMS ((tree, int)); static void link_nested_class_to_enclosing PARAMS ((void)); ! static tree resolve_inner_class PARAMS ((htab_t, tree, tree *, tree *, tree)); static tree find_as_inner_class PARAMS ((tree, tree, tree)); static tree find_as_inner_class_do PARAMS ((tree, tree)); static int check_inner_class_redefinition PARAMS ((tree, tree)); *************** static tree maybe_build_thisn_access_met *** 551,557 **** static tree build_outer_field_access PARAMS ((tree, tree)); static tree build_outer_field_access_methods PARAMS ((tree)); ! static tree build_outer_field_access_expr PARAMS ((int, tree, tree, tree, tree)); static tree build_outer_method_access_method PARAMS ((tree)); static tree build_new_access_id PARAMS ((void)); --- 385,391 ---- static tree build_outer_field_access PARAMS ((tree, tree)); static tree build_outer_field_access_methods PARAMS ((tree)); ! static tree build_outer_field_access_expr PARAMS ((int, tree, tree, tree, tree)); static tree build_outer_method_access_method PARAMS ((tree)); static tree build_new_access_id PARAMS ((void)); *************** static tree build_outer_field_access_met *** 559,565 **** tree, tree)); static int outer_field_access_p PARAMS ((tree, tree)); ! static int outer_field_expanded_access_p PARAMS ((tree, tree *, tree *, tree *)); static tree outer_field_access_fix PARAMS ((tree, tree, tree)); static tree build_incomplete_class_ref PARAMS ((int, tree)); --- 393,399 ---- tree, tree)); static int outer_field_access_p PARAMS ((tree, tree)); ! static int outer_field_expanded_access_p PARAMS ((tree, tree *, tree *, tree *)); static tree outer_field_access_fix PARAMS ((tree, tree, tree)); static tree build_incomplete_class_ref PARAMS ((int, tree)); *************** static void create_new_parser_context PA *** 574,592 **** static void mark_parser_ctxt PARAMS ((void *)); static tree maybe_build_class_init_for_field PARAMS ((tree, tree)); ! static bool attach_init_test_initialization_flags PARAMS ((struct hash_entry *, ! PTR)); ! static bool emit_test_initialization PARAMS ((struct hash_entry *, PTR)); /* Number of error found so far. */ ! int java_error_count; /* Number of warning found so far. */ int java_warning_count; /* Tell when not to fold, when doing xrefs */ int do_not_fold; /* Cyclic inheritance report, as it can be set by layout_class */ const char *cyclic_inheritance_report; ! /* The current parser context */ struct parser_ctxt *ctxp; --- 408,427 ---- static void mark_parser_ctxt PARAMS ((void *)); static tree maybe_build_class_init_for_field PARAMS ((tree, tree)); ! static int attach_init_test_initialization_flags PARAMS ((PTR *, PTR)); ! static int emit_test_initialization PARAMS ((PTR *, PTR)); ! ! static char *string_convert_int_cst PARAMS ((tree)); /* Number of error found so far. */ ! int java_error_count; /* Number of warning found so far. */ int java_warning_count; /* Tell when not to fold, when doing xrefs */ int do_not_fold; /* Cyclic inheritance report, as it can be set by layout_class */ const char *cyclic_inheritance_report; ! /* The current parser context */ struct parser_ctxt *ctxp; *************** struct parser_ctxt *ctxp_for_generation *** 598,607 **** covers both integral/floating point division. The code is changed once the type of both operator is worked out. */ ! static const enum tree_code binop_lookup[19] = ! { PLUS_EXPR, MINUS_EXPR, MULT_EXPR, RDIV_EXPR, TRUNC_MOD_EXPR, ! LSHIFT_EXPR, RSHIFT_EXPR, URSHIFT_EXPR, BIT_AND_EXPR, BIT_XOR_EXPR, BIT_IOR_EXPR, TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, EQ_EXPR, NE_EXPR, GT_EXPR, GE_EXPR, LT_EXPR, LE_EXPR, --- 433,442 ---- covers both integral/floating point division. The code is changed once the type of both operator is worked out. */ ! static const enum tree_code binop_lookup[19] = ! { PLUS_EXPR, MINUS_EXPR, MULT_EXPR, RDIV_EXPR, TRUNC_MOD_EXPR, ! LSHIFT_EXPR, RSHIFT_EXPR, URSHIFT_EXPR, BIT_AND_EXPR, BIT_XOR_EXPR, BIT_IOR_EXPR, TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, EQ_EXPR, NE_EXPR, GT_EXPR, GE_EXPR, LT_EXPR, LE_EXPR, *************** static const enum tree_code binop_lookup *** 614,667 **** #define BINOP_COMPOUND_CANDIDATES 11 /* The "$L" identifier we use to create labels. */ ! static tree label_id = NULL_TREE; /* The "StringBuffer" identifier used for the String `+' operator. */ ! static tree wfl_string_buffer = NULL_TREE; /* The "append" identifier used for String `+' operator. */ ! static tree wfl_append = NULL_TREE; /* The "toString" identifier used for String `+' operator. */ ! static tree wfl_to_string = NULL_TREE; /* The "java.lang" import qualified name. */ ! static tree java_lang_id = NULL_TREE; /* The generated `inst$' identifier used for generated enclosing instance/field access functions. */ ! static tree inst_id = NULL_TREE; ! ! /* The "java.lang.Cloneable" qualified name. */ ! static tree java_lang_cloneable = NULL_TREE; ! ! /* The "java.io.Serializable" qualified name. */ ! static tree java_io_serializable = NULL_TREE; /* Context and flag for static blocks */ ! static tree current_static_block = NULL_TREE; /* The generated `write_parm_value$' identifier. */ ! static tree wpv_id; /* The list of all packages we've seen so far */ ! static tree package_list = NULL_TREE; ! /* Hold THIS for the scope of the current method decl. */ ! static tree current_this; /* Hold a list of catch clauses list. The first element of this list is the list of the catch clauses of the currently analysed try block. */ ! static tree currently_caught_type_list; /* This holds a linked list of all the case labels for the current switch statement. It is only used when checking to see if there are duplicate labels. FIXME: probably this should just be attached to the switch itself; then it could be referenced via `ctxp->current_loop'. */ ! static tree case_label_list; ! static tree src_parse_roots[1]; /* All classes seen from source code */ #define gclass_list src_parse_roots[0] --- 449,500 ---- #define BINOP_COMPOUND_CANDIDATES 11 /* The "$L" identifier we use to create labels. */ ! static GTY(()) tree label_id; /* The "StringBuffer" identifier used for the String `+' operator. */ ! static GTY(()) tree wfl_string_buffer; /* The "append" identifier used for String `+' operator. */ ! static GTY(()) tree wfl_append; /* The "toString" identifier used for String `+' operator. */ ! static GTY(()) tree wfl_to_string; /* The "java.lang" import qualified name. */ ! static GTY(()) tree java_lang_id; /* The generated `inst$' identifier used for generated enclosing instance/field access functions. */ ! static GTY(()) tree inst_id; /* Context and flag for static blocks */ ! static GTY(()) tree current_static_block; /* The generated `write_parm_value$' identifier. */ ! static GTY(()) tree wpv_id; /* The list of all packages we've seen so far */ ! static GTY(()) tree package_list; ! /* Hold THIS for the scope of the current method decl. */ ! static GTY(()) tree current_this; /* Hold a list of catch clauses list. The first element of this list is the list of the catch clauses of the currently analysed try block. */ ! static GTY(()) tree currently_caught_type_list; /* This holds a linked list of all the case labels for the current switch statement. It is only used when checking to see if there are duplicate labels. FIXME: probably this should just be attached to the switch itself; then it could be referenced via `ctxp->current_loop'. */ ! static GTY(()) tree case_label_list; ! /* Anonymous class counter. Will be reset to 1 every time a non ! anonymous class gets created. */ ! static int anonymous_class_counter = 1; ! ! static GTY(()) tree src_parse_roots[1]; /* All classes seen from source code */ #define gclass_list src_parse_roots[0] *************** static tree src_parse_roots[1]; *** 674,681 **** #define check_modifiers(__message, __value, __mask) do { \ if ((__value) & ~(__mask)) \ { \ ! int i, remainder = (__value) & ~(__mask); \ ! for (i = 0; i <= 10; i++) \ if ((1 << i) & remainder) \ parse_error_context (ctxp->modifier_ctx [i], (__message), \ java_accstring_lookup (1 << i)); \ --- 507,514 ---- #define check_modifiers(__message, __value, __mask) do { \ if ((__value) & ~(__mask)) \ { \ ! size_t i, remainder = (__value) & ~(__mask); \ ! for (i = 0; i < ARRAY_SIZE (ctxp->modifier_ctx); i++) \ if ((1 << i) & remainder) \ parse_error_context (ctxp->modifier_ctx [i], (__message), \ java_accstring_lookup (1 << i)); \ *************** static tree src_parse_roots[1]; *** 683,705 **** } while (0) ! ! /* Enabling traces. */ ! #ifndef YYDEBUG ! # define YYDEBUG 1 ! #endif ! ! /* Enabling verbose error messages. */ ! #ifdef YYERROR_VERBOSE ! # undef YYERROR_VERBOSE ! # define YYERROR_VERBOSE 1 ! #else ! # define YYERROR_VERBOSE 0 ! #endif ! ! #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) ! #line 446 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! typedef union YYSTYPE { tree node; int sub_token; struct { --- 516,524 ---- } while (0) ! #line 444 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! #ifndef YYSTYPE ! typedef union { tree node; int sub_token; struct { *************** typedef union YYSTYPE { *** 707,848 **** int location; } operator; int value; ! } YYSTYPE; ! /* Line 191 of yacc.c. */ ! #line 712 "p2378.c" ! # define yystype YYSTYPE /* obsolescent; will be withdrawn */ ! # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif ! ! ! ! /* Copy the second part of user declarations. */ ! #line 456 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" #include "lex.c" ! ! ! /* Line 214 of yacc.c. */ ! #line 727 "p2378.c" ! ! #if ! defined (yyoverflow) || YYERROR_VERBOSE ! ! /* The parser invokes alloca or malloc; define the necessary symbols. */ ! ! # if YYSTACK_USE_ALLOCA ! # define YYSTACK_ALLOC alloca ! # else ! # ifndef YYSTACK_USE_ALLOCA ! # if defined (alloca) || defined (_ALLOCA_H) ! # define YYSTACK_ALLOC alloca ! # else ! # ifdef __GNUC__ ! # define YYSTACK_ALLOC __builtin_alloca ! # endif ! # endif ! # endif ! # endif ! ! # ifdef YYSTACK_ALLOC ! /* Pacify GCC's `empty if-body' warning. */ ! # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) ! # else ! # if defined (__STDC__) || defined (__cplusplus) ! # include /* INFRINGES ON USER NAME SPACE */ ! # define YYSIZE_T size_t ! # endif ! # define YYSTACK_ALLOC malloc ! # define YYSTACK_FREE free ! # endif ! #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ ! ! ! #if (! defined (yyoverflow) \ ! && (! defined (__cplusplus) \ ! || (YYSTYPE_IS_TRIVIAL))) ! ! /* A type that is properly aligned for any stack member. */ ! union yyalloc ! { ! short yyss; ! YYSTYPE yyvs; ! }; ! ! /* The size of the maximum gap between one aligned stack and the next. */ ! # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) ! ! /* The size of an array large to enough to hold all stacks, each with ! N elements. */ ! # define YYSTACK_BYTES(N) \ ! ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ ! + YYSTACK_GAP_MAXIMUM) ! ! /* Copy COUNT objects from FROM to TO. The source and destination do ! not overlap. */ ! # ifndef YYCOPY ! # if 1 < __GNUC__ ! # define YYCOPY(To, From, Count) \ ! __builtin_memcpy (To, From, (Count) * sizeof (*(From))) ! # else ! # define YYCOPY(To, From, Count) \ ! do \ ! { \ ! register YYSIZE_T yyi; \ ! for (yyi = 0; yyi < (Count); yyi++) \ ! (To)[yyi] = (From)[yyi]; \ ! } \ ! while (0) ! # endif ! # endif ! ! /* Relocate STACK from its old location to the new one. The ! local variables YYSIZE and YYSTACKSIZE give the old and new number of ! elements in the stack, and YYPTR gives the new location of the ! stack. Advance YYPTR to a properly aligned location for the next ! stack. */ ! # define YYSTACK_RELOCATE(Stack) \ ! do \ ! { \ ! YYSIZE_T yynewbytes; \ ! YYCOPY (&yyptr->Stack, Stack, yysize); \ ! Stack = &yyptr->Stack; \ ! yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ ! yyptr += yynewbytes / sizeof (*yyptr); \ ! } \ ! while (0) ! ! #endif ! ! #if defined (__STDC__) || defined (__cplusplus) ! typedef signed char yysigned_char; ! #else ! typedef short yysigned_char; #endif - /* YYFINAL -- State number of the termination state. */ - #define YYFINAL 3 - /* YYLAST -- Last index in YYTABLE. */ - #define YYLAST 5469 - /* YYNTOKENS -- Number of terminals. */ - #define YYNTOKENS 111 - /* YYNNTS -- Number of nonterminals. */ - #define YYNNTS 164 - /* YYNRULES -- Number of rules. */ - #define YYNRULES 506 - /* YYNRULES -- Number of states. */ - #define YYNSTATES 778 ! /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ ! #define YYUNDEFTOK 2 ! #define YYMAXUTOK 365 ! #define YYTRANSLATE(YYX) \ ! ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) ! /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ ! static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, --- 526,553 ---- int location; } operator; int value; ! } yystype; ! # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif ! #line 454 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" #include "lex.c" ! #ifndef YYDEBUG ! # define YYDEBUG 1 #endif ! #define YYFINAL 787 ! #define YYFLAG -32768 ! #define YYNTBASE 112 ! /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ ! #define YYTRANSLATE(x) ((unsigned)(x) <= 365 ? yytranslate[x] : 276) ! /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ ! static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, *************** static const unsigned char yytranslate[] *** 869,1187 **** 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ! 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, ! 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ! 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ! 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, ! 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, ! 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, ! 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, ! 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ! 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, ! 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, ! 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, ! 105, 106, 107, 108, 109, 110 }; #if YYDEBUG ! /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in ! YYRHS. */ ! static const unsigned short yyprhs[] = { ! 0, 0, 3, 4, 7, 9, 11, 13, 15, 17, ! 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, ! 39, 42, 45, 47, 49, 51, 55, 57, 58, 60, ! 62, 64, 67, 70, 73, 77, 79, 82, 84, 87, ! 91, 94, 98, 100, 102, 106, 109, 113, 119, 124, ! 130, 132, 134, 136, 138, 140, 143, 144, 152, 153, ! 160, 164, 167, 171, 176, 177, 180, 184, 187, 188, ! 191, 194, 196, 200, 204, 207, 211, 213, 216, 218, ! 220, 222, 224, 226, 228, 230, 232, 234, 238, 243, ! 245, 249, 253, 255, 259, 263, 268, 270, 274, 277, ! 281, 285, 287, 289, 290, 294, 297, 301, 305, 310, ! 315, 318, 322, 325, 329, 332, 336, 341, 345, 349, ! 353, 355, 359, 363, 366, 370, 373, 377, 379, 380, ! 383, 386, 388, 392, 396, 398, 400, 403, 405, 406, ! 410, 413, 417, 421, 426, 429, 433, 437, 442, 444, ! 449, 455, 463, 470, 472, 474, 475, 480, 481, 487, ! 488, 494, 495, 502, 506, 511, 514, 518, 521, 525, ! 528, 532, 534, 537, 539, 541, 543, 545, 547, 550, ! 553, 556, 560, 564, 569, 571, 575, 579, 582, 586, ! 588, 590, 592, 595, 597, 599, 601, 604, 607, 611, ! 613, 615, 617, 619, 621, 623, 625, 627, 629, 631, ! 633, 635, 637, 639, 641, 643, 645, 647, 649, 651, ! 653, 655, 657, 660, 663, 666, 669, 672, 675, 678, ! 681, 685, 690, 695, 701, 706, 712, 719, 727, 734, ! 736, 738, 740, 742, 744, 746, 748, 754, 757, 761, ! 766, 774, 782, 783, 787, 792, 795, 799, 805, 808, ! 812, 816, 821, 823, 826, 829, 831, 834, 838, 841, ! 844, 848, 851, 856, 859, 862, 866, 871, 874, 876, ! 884, 892, 899, 903, 909, 914, 922, 929, 932, 935, ! 939, 942, 943, 945, 947, 950, 951, 953, 955, 959, ! 963, 966, 970, 973, 977, 980, 984, 987, 991, 994, ! 998, 1001, 1005, 1009, 1012, 1016, 1022, 1028, 1031, 1036, ! 1040, 1042, 1046, 1050, 1055, 1058, 1060, 1063, 1066, 1071, ! 1074, 1078, 1083, 1086, 1089, 1091, 1093, 1095, 1097, 1101, ! 1103, 1105, 1107, 1109, 1111, 1115, 1119, 1123, 1127, 1131, ! 1135, 1139, 1143, 1147, 1153, 1158, 1160, 1165, 1171, 1177, ! 1184, 1188, 1192, 1197, 1203, 1206, 1210, 1211, 1219, 1220, ! 1227, 1231, 1235, 1237, 1241, 1245, 1249, 1253, 1258, 1263, ! 1268, 1273, 1277, 1281, 1283, 1286, 1290, 1294, 1297, 1300, ! 1304, 1308, 1312, 1316, 1319, 1323, 1328, 1334, 1341, 1347, ! 1354, 1359, 1364, 1369, 1374, 1378, 1383, 1387, 1392, 1394, ! 1396, 1398, 1400, 1403, 1406, 1408, 1410, 1413, 1415, 1418, ! 1420, 1423, 1426, 1429, 1432, 1435, 1438, 1440, 1443, 1446, ! 1448, 1451, 1454, 1460, 1465, 1470, 1476, 1481, 1484, 1490, ! 1495, 1501, 1503, 1507, 1511, 1515, 1519, 1523, 1527, 1529, ! 1533, 1537, 1541, 1545, 1547, 1551, 1555, 1559, 1563, 1567, ! 1571, 1573, 1577, 1581, 1585, 1589, 1593, 1597, 1601, 1605, ! 1609, 1613, 1615, 1619, 1623, 1627, 1631, 1633, 1637, 1641, ! 1643, 1647, 1651, 1653, 1657, 1661, 1663, 1667, 1671, 1673, ! 1677, 1681, 1683, 1689, 1694, 1698, 1704, 1706, 1708, 1712, ! 1716, 1718, 1720, 1722, 1724, 1726, 1728 }; - - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { ! 112, 0, -1, -1, 113, 126, -1, 105, -1, 106, ! -1, 109, -1, 104, -1, 103, -1, 110, -1, 116, ! -1, 117, -1, 83, -1, 86, -1, 51, -1, 118, ! -1, 121, -1, 122, -1, 118, -1, 118, -1, 116, ! 245, -1, 122, 245, -1, 123, -1, 124, -1, 125, ! -1, 122, 102, 125, -1, 87, -1, -1, 129, -1, ! 127, -1, 128, -1, 129, 127, -1, 129, 128, -1, ! 127, 128, -1, 129, 127, 128, -1, 130, -1, 127, ! 130, -1, 133, -1, 128, 133, -1, 76, 122, 100, ! -1, 76, 1, -1, 76, 122, 1, -1, 131, -1, ! 132, -1, 56, 122, 100, -1, 56, 1, -1, 56, ! 122, 1, -1, 56, 122, 102, 5, 100, -1, 56, ! 122, 102, 1, -1, 56, 122, 102, 5, 1, -1, ! 135, -1, 170, -1, 193, -1, 1, -1, 45, -1, ! 134, 45, -1, -1, 134, 68, 125, 138, 139, 136, ! 141, -1, -1, 68, 125, 138, 139, 137, 141, -1, ! 134, 68, 1, -1, 68, 1, -1, 68, 125, 1, ! -1, 134, 68, 125, 1, -1, -1, 64, 119, -1, ! 64, 119, 1, -1, 64, 1, -1, -1, 53, 140, ! -1, 53, 1, -1, 120, -1, 140, 101, 120, -1, ! 140, 101, 1, -1, 96, 97, -1, 96, 142, 97, ! -1, 143, -1, 142, 143, -1, 144, -1, 160, -1, ! 162, -1, 183, -1, 145, -1, 150, -1, 135, -1, ! 170, -1, 193, -1, 115, 146, 100, -1, 134, 115, ! 146, 100, -1, 147, -1, 146, 101, 147, -1, 146, ! 101, 1, -1, 148, -1, 148, 93, 149, -1, 148, ! 93, 1, -1, 148, 93, 149, 1, -1, 125, -1, ! 148, 98, 99, -1, 125, 1, -1, 148, 98, 1, ! -1, 148, 99, 1, -1, 273, -1, 181, -1, -1, ! 152, 151, 159, -1, 152, 1, -1, 115, 153, 157, ! -1, 60, 153, 157, -1, 134, 115, 153, 157, -1, ! 134, 60, 153, 157, -1, 115, 1, -1, 134, 115, ! 1, -1, 60, 1, -1, 134, 60, 1, -1, 134, ! 1, -1, 125, 94, 95, -1, 125, 94, 154, 95, ! -1, 153, 98, 99, -1, 125, 94, 1, -1, 153, ! 98, 1, -1, 155, -1, 154, 101, 155, -1, 154, ! 101, 1, -1, 115, 148, -1, 156, 115, 148, -1, ! 115, 1, -1, 156, 115, 1, -1, 134, -1, -1, ! 54, 158, -1, 54, 1, -1, 119, -1, 158, 101, ! 119, -1, 158, 101, 1, -1, 183, -1, 100, -1, ! 161, 183, -1, 134, -1, -1, 164, 163, 166, -1, ! 165, 157, -1, 134, 165, 157, -1, 123, 94, 95, ! -1, 123, 94, 154, 95, -1, 184, 167, -1, 184, ! 168, 167, -1, 184, 186, 167, -1, 184, 168, 186, ! 167, -1, 185, -1, 169, 94, 95, 100, -1, 169, ! 94, 241, 95, 100, -1, 122, 102, 66, 94, 241, ! 95, 100, -1, 122, 102, 66, 94, 95, 100, -1, ! 77, -1, 66, -1, -1, 62, 125, 171, 176, -1, ! -1, 134, 62, 125, 172, 176, -1, -1, 62, 125, ! 175, 173, 176, -1, -1, 134, 62, 125, 175, 174, ! 176, -1, 62, 125, 1, -1, 134, 62, 125, 1, ! -1, 64, 120, -1, 175, 101, 120, -1, 64, 1, ! -1, 175, 101, 1, -1, 96, 97, -1, 96, 177, ! 97, -1, 178, -1, 177, 178, -1, 179, -1, 180, ! -1, 135, -1, 170, -1, 145, -1, 152, 100, -1, ! 152, 1, -1, 96, 97, -1, 96, 101, 97, -1, ! 96, 182, 97, -1, 96, 182, 101, 97, -1, 149, ! -1, 182, 101, 149, -1, 182, 101, 1, -1, 96, ! 97, -1, 184, 186, 185, -1, 96, -1, 97, -1, ! 187, -1, 186, 187, -1, 188, -1, 190, -1, 135, ! -1, 189, 100, -1, 115, 146, -1, 156, 115, 146, ! -1, 192, -1, 195, -1, 199, -1, 200, -1, 211, ! -1, 215, -1, 192, -1, 196, -1, 201, -1, 212, ! -1, 216, -1, 183, -1, 193, -1, 197, -1, 202, ! -1, 214, -1, 222, -1, 223, -1, 224, -1, 226, ! -1, 225, -1, 228, -1, 100, -1, 125, 89, -1, ! 194, 190, -1, 125, 1, -1, 194, 191, -1, 198, ! 100, -1, 1, 100, -1, 1, 96, -1, 1, 97, ! -1, 169, 94, 1, -1, 169, 94, 95, 1, -1, ! 169, 94, 241, 1, -1, 169, 94, 241, 95, 1, ! -1, 122, 102, 66, 1, -1, 122, 102, 66, 94, ! 1, -1, 122, 102, 66, 94, 241, 1, -1, 122, ! 102, 66, 94, 241, 95, 1, -1, 122, 102, 66, ! 94, 95, 1, -1, 270, -1, 254, -1, 255, -1, ! 250, -1, 251, -1, 247, -1, 236, -1, 49, 94, ! 273, 95, 190, -1, 49, 1, -1, 49, 94, 1, ! -1, 49, 94, 273, 1, -1, 49, 94, 273, 95, ! 191, 57, 190, -1, 49, 94, 273, 95, 191, 57, ! 191, -1, -1, 204, 203, 205, -1, 69, 94, 273, ! 95, -1, 69, 1, -1, 69, 94, 1, -1, 69, ! 94, 273, 95, 1, -1, 96, 97, -1, 96, 208, ! 97, -1, 96, 206, 97, -1, 96, 206, 208, 97, ! -1, 207, -1, 206, 207, -1, 208, 186, -1, 209, ! -1, 208, 209, -1, 63, 274, 89, -1, 48, 89, ! -1, 63, 1, -1, 63, 274, 1, -1, 48, 1, ! -1, 67, 94, 273, 95, -1, 210, 190, -1, 67, ! 1, -1, 67, 94, 1, -1, 67, 94, 273, 1, ! -1, 210, 191, -1, 52, -1, 213, 190, 67, 94, ! 273, 95, 100, -1, 218, 100, 273, 100, 220, 95, ! 190, -1, 218, 100, 100, 220, 95, 190, -1, 218, ! 100, 1, -1, 218, 100, 273, 100, 1, -1, 218, ! 100, 100, 1, -1, 218, 100, 273, 100, 220, 95, ! 191, -1, 218, 100, 100, 220, 95, 191, -1, 72, ! 94, -1, 72, 1, -1, 72, 94, 1, -1, 217, ! 219, -1, -1, 221, -1, 189, -1, 221, 1, -1, ! -1, 221, -1, 198, -1, 221, 101, 198, -1, 221, ! 101, 1, -1, 55, 100, -1, 55, 125, 100, -1, ! 55, 1, -1, 55, 125, 1, -1, 74, 100, -1, ! 74, 125, 100, -1, 74, 1, -1, 74, 125, 1, ! -1, 59, 100, -1, 59, 273, 100, -1, 59, 1, ! -1, 59, 273, 1, -1, 50, 273, 100, -1, 50, ! 1, -1, 50, 273, 1, -1, 227, 94, 273, 95, ! 183, -1, 227, 94, 273, 95, 1, -1, 227, 1, ! -1, 227, 94, 1, 95, -1, 227, 94, 1, -1, ! 134, -1, 71, 183, 229, -1, 71, 183, 232, -1, ! 71, 183, 229, 232, -1, 71, 1, -1, 230, -1, ! 229, 230, -1, 231, 183, -1, 61, 94, 155, 95, ! -1, 61, 1, -1, 61, 94, 1, -1, 61, 94, ! 1, 95, -1, 65, 183, -1, 65, 1, -1, 234, ! -1, 242, -1, 114, -1, 77, -1, 94, 273, 95, ! -1, 236, -1, 246, -1, 247, -1, 248, -1, 235, ! -1, 122, 102, 77, -1, 94, 273, 1, -1, 122, ! 102, 1, -1, 116, 102, 1, -1, 60, 102, 1, ! -1, 122, 102, 68, -1, 121, 102, 68, -1, 116, ! 102, 68, -1, 60, 102, 68, -1, 73, 119, 94, ! 241, 95, -1, 73, 119, 94, 95, -1, 237, -1, ! 240, 125, 94, 95, -1, 240, 125, 94, 95, 141, ! -1, 240, 125, 94, 241, 95, -1, 240, 125, 94, ! 241, 95, 141, -1, 73, 1, 100, -1, 73, 119, ! 1, -1, 73, 119, 94, 1, -1, 73, 119, 94, ! 241, 1, -1, 240, 1, -1, 240, 125, 1, -1, ! -1, 73, 119, 94, 241, 95, 238, 141, -1, -1, ! 73, 119, 94, 95, 239, 141, -1, 122, 102, 73, ! -1, 233, 102, 73, -1, 273, -1, 241, 101, 273, ! -1, 241, 101, 1, -1, 73, 116, 243, -1, 73, ! 118, 243, -1, 73, 116, 243, 245, -1, 73, 118, ! 243, 245, -1, 73, 118, 245, 181, -1, 73, 116, ! 245, 181, -1, 73, 1, 99, -1, 73, 1, 98, ! -1, 244, -1, 243, 244, -1, 98, 273, 99, -1, ! 98, 273, 1, -1, 98, 1, -1, 98, 99, -1, ! 245, 98, 99, -1, 245, 98, 1, -1, 233, 102, ! 125, -1, 66, 102, 125, -1, 66, 1, -1, 122, ! 94, 95, -1, 122, 94, 241, 95, -1, 233, 102, ! 125, 94, 95, -1, 233, 102, 125, 94, 241, 95, ! -1, 66, 102, 125, 94, 95, -1, 66, 102, 125, ! 94, 241, 95, -1, 66, 102, 1, 95, -1, 66, ! 102, 1, 102, -1, 122, 98, 273, 99, -1, 234, ! 98, 273, 99, -1, 122, 98, 1, -1, 122, 98, ! 273, 1, -1, 234, 98, 1, -1, 234, 98, 273, ! 1, -1, 233, -1, 122, -1, 250, -1, 251, -1, ! 249, 47, -1, 249, 46, -1, 254, -1, 255, -1, ! 3, 253, -1, 256, -1, 3, 1, -1, 252, -1, ! 4, 252, -1, 4, 1, -1, 47, 253, -1, 47, ! 1, -1, 46, 253, -1, 46, 1, -1, 249, -1, ! 90, 253, -1, 91, 253, -1, 257, -1, 90, 1, ! -1, 91, 1, -1, 94, 116, 245, 95, 253, -1, ! 94, 116, 95, 253, -1, 94, 273, 95, 256, -1, ! 94, 122, 245, 95, 256, -1, 94, 116, 98, 1, ! -1, 94, 1, -1, 94, 116, 245, 95, 1, -1, ! 94, 116, 95, 1, -1, 94, 122, 245, 95, 1, ! -1, 253, -1, 258, 5, 253, -1, 258, 6, 253, ! -1, 258, 7, 253, -1, 258, 5, 1, -1, 258, ! 6, 1, -1, 258, 7, 1, -1, 258, -1, 259, ! 3, 258, -1, 259, 4, 258, -1, 259, 3, 1, ! -1, 259, 4, 1, -1, 259, -1, 260, 8, 259, ! -1, 260, 9, 259, -1, 260, 10, 259, -1, 260, ! 8, 1, -1, 260, 9, 1, -1, 260, 10, 1, ! -1, 260, -1, 261, 20, 260, -1, 261, 18, 260, ! -1, 261, 21, 260, -1, 261, 19, 260, -1, 261, ! 58, 117, -1, 261, 20, 1, -1, 261, 18, 1, ! -1, 261, 21, 1, -1, 261, 19, 1, -1, 261, ! 58, 1, -1, 261, -1, 262, 16, 261, -1, 262, ! 17, 261, -1, 262, 16, 1, -1, 262, 17, 1, ! -1, 262, -1, 263, 11, 262, -1, 263, 11, 1, ! -1, 263, -1, 264, 12, 263, -1, 264, 12, 1, ! -1, 264, -1, 265, 13, 264, -1, 265, 13, 1, ! -1, 265, -1, 266, 14, 265, -1, 266, 14, 1, ! -1, 266, -1, 267, 15, 266, -1, 267, 15, 1, ! -1, 267, -1, 267, 88, 273, 89, 268, -1, 267, ! 88, 89, 1, -1, 267, 88, 1, -1, 267, 88, ! 273, 89, 1, -1, 268, -1, 270, -1, 271, 272, ! 269, -1, 271, 272, 1, -1, 122, -1, 246, -1, ! 248, -1, 92, -1, 93, -1, 269, -1, 273, -1 }; ! /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ ! static const unsigned short yyrline[] = { ! 0, 606, 606, 606, 636, 637, 638, 639, 640, 641, ! 646, 647, 651, 652, 653, 657, 658, 662, 666, 670, ! 674, 682, 694, 695, 699, 703, 708, 713, 714, 715, ! 716, 717, 718, 719, 720, 724, 728, 735, 736, 740, ! 745, 747, 752, 753, 757, 783, 785, 790, 808, 810, ! 815, 817, 819, 820, 831, 835, 852, 851, 856, 855, ! 859, 861, 863, 868, 873, 874, 876, 878, 883, 884, ! 886, 894, 899, 904, 909, 917, 928, 929, 933, 934, ! 935, 936, 947, 948, 949, 951, 953, 958, 960, 972, ! 973, 975, 980, 982, 989, 995, 1004, 1005, 1007, 1009, ! 1019, 1024, 1025, 1031, 1030, 1041, 1046, 1048, 1050, 1052, ! 1054, 1059, 1061, 1063, 1065, 1073, 1078, 1080, 1089, 1091, ! 1096, 1100, 1105, 1110, 1114, 1119, 1124, 1132, 1142, 1143, ! 1145, 1150, 1152, 1154, 1159, 1160, 1165, 1174, 1191, 1190, ! 1200, 1202, 1207, 1212, 1220, 1225, 1227, 1229, 1234, 1239, ! 1245, 1253, 1255, 1260, 1266, 1278, 1277, 1282, 1281, 1286, ! 1285, 1290, 1289, 1293, 1295, 1300, 1305, 1310, 1312, 1317, ! 1319, 1324, 1325, 1329, 1330, 1331, 1333, 1338, 1342, 1347, ! 1353, 1355, 1357, 1359, 1364, 1369, 1373, 1379, 1387, 1392, ! 1397, 1411, 1412, 1416, 1417, 1419, 1427, 1431, 1433, 1438, ! 1439, 1440, 1441, 1442, 1443, 1448, 1449, 1450, 1451, 1452, ! 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, ! 1467, 1471, 1489, 1500, 1502, 1507, 1514, 1523, 1528, 1533, ! 1538, 1540, 1545, 1547, 1552, 1554, 1556, 1558, 1560, 1565, ! 1566, 1567, 1568, 1569, 1570, 1571, 1575, 1580, 1582, 1584, ! 1589, 1594, 1600, 1599, 1615, 1620, 1622, 1624, 1632, 1634, ! 1636, 1638, 1643, 1644, 1648, 1652, 1653, 1657, 1663, 1669, ! 1671, 1673, 1678, 1686, 1688, 1690, 1692, 1697, 1702, 1711, ! 1716, 1722, 1729, 1731, 1733, 1738, 1740, 1750, 1756, 1758, ! 1763, 1776, 1777, 1783, 1789, 1794, 1795, 1800, 1802, 1804, ! 1809, 1811, 1813, 1815, 1820, 1822, 1824, 1826, 1831, 1833, ! 1835, 1837, 1842, 1847, 1849, 1854, 1860, 1862, 1864, 1866, ! 1871, 1883, 1885, 1887, 1892, 1897, 1898, 1906, 1915, 1931, ! 1933, 1938, 1943, 1945, 1951, 1952, 1956, 1957, 1959, 1961, ! 1962, 1963, 1964, 1965, 1969, 1974, 1976, 1978, 1980, 1985, ! 1987, 1989, 1991, 1999, 2001, 2003, 2007, 2013, 2014, 2020, ! 2021, 2023, 2025, 2027, 2029, 2031, 2042, 2041, 2075, 2074, ! 2092, 2094, 2099, 2104, 2109, 2114, 2116, 2118, 2120, 2124, ! 2135, 2144, 2146, 2151, 2153, 2158, 2168, 2170, 2179, 2205, ! 2207, 2212, 2216, 2222, 2227, 2229, 2231, 2242, 2253, 2258, ! 2267, 2269, 2274, 2276, 2278, 2283, 2288, 2293, 2301, 2302, ! 2303, 2304, 2308, 2313, 2318, 2319, 2320, 2322, 2323, 2328, ! 2333, 2335, 2340, 2342, 2347, 2349, 2354, 2355, 2357, 2359, ! 2360, 2362, 2367, 2375, 2377, 2379, 2393, 2395, 2400, 2402, ! 2404, 2409, 2410, 2415, 2420, 2425, 2427, 2429, 2434, 2435, ! 2440, 2445, 2447, 2452, 2453, 2458, 2463, 2468, 2470, 2472, ! 2477, 2478, 2483, 2488, 2493, 2498, 2500, 2502, 2504, 2506, ! 2508, 2513, 2514, 2519, 2524, 2526, 2531, 2532, 2537, 2542, ! 2543, 2548, 2553, 2554, 2559, 2564, 2565, 2570, 2575, 2576, ! 2581, 2586, 2587, 2592, 2598, 2600, 2605, 2606, 2610, 2612, ! 2620, 2621, 2622, 2626, 2627, 2631, 2635 }; #endif ! #if YYDEBUG || YYERROR_VERBOSE ! /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. ! First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { ! "$end", "error", "$undefined", "PLUS_TK", "MINUS_TK", "MULT_TK", "DIV_TK", "REM_TK", "LS_TK", "SRS_TK", "ZRS_TK", "AND_TK", "XOR_TK", "OR_TK", "BOOL_AND_TK", "BOOL_OR_TK", "EQ_TK", "NEQ_TK", "GT_TK", "GTE_TK", "LT_TK", "LTE_TK", "PLUS_ASSIGN_TK", "MINUS_ASSIGN_TK", --- 574,896 ---- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ! 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, ! 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ! 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, ! 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, ! 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, ! 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, ! 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, ! 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ! 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, ! 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, ! 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, ! 106, 107, 108, 109, 110, 111 }; #if YYDEBUG ! static const short yyprhs[] = { ! 0, 0, 1, 4, 6, 8, 10, 12, 14, 16, ! 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, ! 39, 42, 44, 46, 48, 52, 54, 55, 57, 59, ! 61, 64, 67, 70, 74, 76, 79, 81, 84, 88, ! 91, 95, 97, 99, 103, 106, 110, 116, 121, 127, ! 129, 131, 133, 135, 137, 140, 141, 149, 150, 157, ! 161, 164, 168, 173, 174, 177, 181, 184, 185, 188, ! 191, 193, 197, 201, 204, 208, 210, 213, 215, 217, ! 219, 221, 223, 225, 227, 229, 231, 235, 240, 242, ! 246, 250, 252, 256, 260, 265, 267, 271, 274, 278, ! 282, 284, 286, 287, 291, 294, 298, 302, 307, 312, ! 315, 319, 322, 326, 329, 333, 338, 342, 346, 350, ! 352, 356, 360, 363, 367, 370, 374, 376, 377, 380, ! 383, 385, 389, 393, 395, 397, 400, 402, 403, 407, ! 410, 414, 418, 423, 426, 430, 434, 439, 441, 446, ! 452, 460, 467, 469, 471, 472, 477, 478, 484, 485, ! 491, 492, 499, 503, 508, 511, 515, 518, 522, 525, ! 529, 531, 534, 536, 538, 540, 542, 544, 547, 550, ! 553, 557, 561, 566, 568, 572, 576, 579, 583, 585, ! 587, 589, 592, 594, 596, 598, 601, 604, 608, 610, ! 612, 614, 616, 618, 620, 622, 624, 626, 628, 630, ! 632, 634, 636, 638, 640, 642, 644, 646, 648, 650, ! 652, 654, 656, 659, 662, 665, 668, 671, 674, 677, ! 680, 684, 689, 694, 700, 705, 711, 718, 726, 733, ! 735, 737, 739, 741, 743, 745, 747, 753, 756, 760, ! 765, 773, 781, 782, 786, 791, 794, 798, 804, 807, ! 811, 815, 820, 822, 825, 828, 830, 833, 837, 840, ! 843, 847, 850, 855, 858, 861, 865, 870, 873, 875, ! 883, 891, 898, 902, 908, 913, 921, 928, 931, 934, ! 938, 941, 942, 944, 946, 949, 950, 952, 954, 958, ! 962, 965, 969, 972, 976, 979, 983, 986, 990, 993, ! 997, 1000, 1004, 1008, 1011, 1015, 1021, 1025, 1028, 1032, ! 1038, 1044, 1047, 1052, 1056, 1058, 1062, 1066, 1071, 1074, ! 1076, 1079, 1082, 1087, 1090, 1094, 1099, 1102, 1105, 1107, ! 1109, 1111, 1113, 1117, 1119, 1121, 1123, 1125, 1127, 1131, ! 1135, 1139, 1143, 1147, 1151, 1155, 1159, 1163, 1169, 1174, ! 1176, 1181, 1187, 1193, 1200, 1204, 1208, 1213, 1219, 1222, ! 1226, 1227, 1235, 1236, 1243, 1247, 1251, 1253, 1257, 1261, ! 1265, 1269, 1274, 1279, 1284, 1289, 1293, 1297, 1299, 1302, ! 1306, 1310, 1313, 1316, 1320, 1324, 1328, 1332, 1335, 1339, ! 1344, 1350, 1357, 1363, 1370, 1375, 1380, 1385, 1390, 1394, ! 1399, 1403, 1408, 1410, 1412, 1414, 1416, 1419, 1422, 1424, ! 1426, 1429, 1431, 1434, 1436, 1439, 1442, 1445, 1448, 1451, ! 1454, 1456, 1459, 1462, 1464, 1467, 1470, 1476, 1481, 1486, ! 1492, 1497, 1500, 1506, 1511, 1517, 1519, 1523, 1527, 1531, ! 1535, 1539, 1543, 1545, 1549, 1553, 1557, 1561, 1563, 1567, ! 1571, 1575, 1579, 1583, 1587, 1589, 1593, 1597, 1601, 1605, ! 1609, 1613, 1617, 1621, 1625, 1629, 1631, 1635, 1639, 1643, ! 1647, 1649, 1653, 1657, 1659, 1663, 1667, 1669, 1673, 1677, ! 1679, 1683, 1687, 1689, 1693, 1697, 1699, 1705, 1710, 1714, ! 1720, 1722, 1724, 1728, 1732, 1734, 1736, 1738, 1740, 1742, ! 1744 }; static const short yyrhs[] = { ! -1, 113, 126, 0, 106, 0, 107, 0, 110, 0, ! 105, 0, 104, 0, 111, 0, 116, 0, 117, 0, ! 84, 0, 87, 0, 51, 0, 118, 0, 121, 0, ! 122, 0, 118, 0, 118, 0, 116, 246, 0, 122, ! 246, 0, 123, 0, 124, 0, 125, 0, 122, 103, ! 125, 0, 88, 0, 0, 129, 0, 127, 0, 128, ! 0, 129, 127, 0, 129, 128, 0, 127, 128, 0, ! 129, 127, 128, 0, 130, 0, 127, 130, 0, 133, ! 0, 128, 133, 0, 76, 122, 101, 0, 76, 1, ! 0, 76, 122, 1, 0, 131, 0, 132, 0, 56, ! 122, 101, 0, 56, 1, 0, 56, 122, 1, 0, ! 56, 122, 103, 5, 101, 0, 56, 122, 103, 1, ! 0, 56, 122, 103, 5, 1, 0, 135, 0, 170, ! 0, 193, 0, 1, 0, 45, 0, 134, 45, 0, ! 0, 134, 68, 125, 138, 139, 136, 141, 0, 0, ! 68, 125, 138, 139, 137, 141, 0, 134, 68, 1, ! 0, 68, 1, 0, 68, 125, 1, 0, 134, 68, ! 125, 1, 0, 0, 64, 119, 0, 64, 119, 1, ! 0, 64, 1, 0, 0, 53, 140, 0, 53, 1, ! 0, 120, 0, 140, 102, 120, 0, 140, 102, 1, ! 0, 97, 98, 0, 97, 142, 98, 0, 143, 0, ! 142, 143, 0, 144, 0, 160, 0, 162, 0, 183, ! 0, 145, 0, 150, 0, 135, 0, 170, 0, 193, ! 0, 115, 146, 101, 0, 134, 115, 146, 101, 0, ! 147, 0, 146, 102, 147, 0, 146, 102, 1, 0, ! 148, 0, 148, 94, 149, 0, 148, 94, 1, 0, ! 148, 94, 149, 1, 0, 125, 0, 148, 99, 100, ! 0, 125, 1, 0, 148, 99, 1, 0, 148, 100, ! 1, 0, 274, 0, 181, 0, 0, 152, 151, 159, ! 0, 152, 1, 0, 115, 153, 157, 0, 60, 153, ! 157, 0, 134, 115, 153, 157, 0, 134, 60, 153, ! 157, 0, 115, 1, 0, 134, 115, 1, 0, 60, ! 1, 0, 134, 60, 1, 0, 134, 1, 0, 125, ! 95, 96, 0, 125, 95, 154, 96, 0, 153, 99, ! 100, 0, 125, 95, 1, 0, 153, 99, 1, 0, ! 155, 0, 154, 102, 155, 0, 154, 102, 1, 0, ! 115, 148, 0, 156, 115, 148, 0, 115, 1, 0, ! 156, 115, 1, 0, 134, 0, 0, 54, 158, 0, ! 54, 1, 0, 119, 0, 158, 102, 119, 0, 158, ! 102, 1, 0, 183, 0, 101, 0, 161, 183, 0, ! 134, 0, 0, 164, 163, 166, 0, 165, 157, 0, ! 134, 165, 157, 0, 123, 95, 96, 0, 123, 95, ! 154, 96, 0, 184, 167, 0, 184, 168, 167, 0, ! 184, 186, 167, 0, 184, 168, 186, 167, 0, 185, ! 0, 169, 95, 96, 101, 0, 169, 95, 242, 96, ! 101, 0, 122, 103, 66, 95, 242, 96, 101, 0, ! 122, 103, 66, 95, 96, 101, 0, 77, 0, 66, ! 0, 0, 62, 125, 171, 176, 0, 0, 134, 62, ! 125, 172, 176, 0, 0, 62, 125, 175, 173, 176, ! 0, 0, 134, 62, 125, 175, 174, 176, 0, 62, ! 125, 1, 0, 134, 62, 125, 1, 0, 64, 120, ! 0, 175, 102, 120, 0, 64, 1, 0, 175, 102, ! 1, 0, 97, 98, 0, 97, 177, 98, 0, 178, ! 0, 177, 178, 0, 179, 0, 180, 0, 135, 0, ! 170, 0, 145, 0, 152, 101, 0, 152, 1, 0, ! 97, 98, 0, 97, 102, 98, 0, 97, 182, 98, ! 0, 97, 182, 102, 98, 0, 149, 0, 182, 102, ! 149, 0, 182, 102, 1, 0, 97, 98, 0, 184, ! 186, 185, 0, 97, 0, 98, 0, 187, 0, 186, ! 187, 0, 188, 0, 190, 0, 135, 0, 189, 101, ! 0, 115, 146, 0, 156, 115, 146, 0, 192, 0, ! 195, 0, 199, 0, 200, 0, 211, 0, 215, 0, ! 192, 0, 196, 0, 201, 0, 212, 0, 216, 0, ! 183, 0, 193, 0, 197, 0, 202, 0, 214, 0, ! 222, 0, 223, 0, 224, 0, 227, 0, 225, 0, ! 229, 0, 226, 0, 101, 0, 125, 90, 0, 194, ! 190, 0, 125, 1, 0, 194, 191, 0, 198, 101, ! 0, 1, 101, 0, 1, 97, 0, 1, 98, 0, ! 169, 95, 1, 0, 169, 95, 96, 1, 0, 169, ! 95, 242, 1, 0, 169, 95, 242, 96, 1, 0, ! 122, 103, 66, 1, 0, 122, 103, 66, 95, 1, ! 0, 122, 103, 66, 95, 242, 1, 0, 122, 103, ! 66, 95, 242, 96, 1, 0, 122, 103, 66, 95, ! 96, 1, 0, 271, 0, 255, 0, 256, 0, 251, ! 0, 252, 0, 248, 0, 237, 0, 49, 95, 274, ! 96, 190, 0, 49, 1, 0, 49, 95, 1, 0, ! 49, 95, 274, 1, 0, 49, 95, 274, 96, 191, ! 57, 190, 0, 49, 95, 274, 96, 191, 57, 191, ! 0, 0, 204, 203, 205, 0, 69, 95, 274, 96, ! 0, 69, 1, 0, 69, 95, 1, 0, 69, 95, ! 274, 96, 1, 0, 97, 98, 0, 97, 208, 98, ! 0, 97, 206, 98, 0, 97, 206, 208, 98, 0, ! 207, 0, 206, 207, 0, 208, 186, 0, 209, 0, ! 208, 209, 0, 63, 275, 90, 0, 48, 90, 0, ! 63, 1, 0, 63, 275, 1, 0, 48, 1, 0, ! 67, 95, 274, 96, 0, 210, 190, 0, 67, 1, ! 0, 67, 95, 1, 0, 67, 95, 274, 1, 0, ! 210, 191, 0, 52, 0, 213, 190, 67, 95, 274, ! 96, 101, 0, 218, 101, 274, 101, 220, 96, 190, ! 0, 218, 101, 101, 220, 96, 190, 0, 218, 101, ! 1, 0, 218, 101, 274, 101, 1, 0, 218, 101, ! 101, 1, 0, 218, 101, 274, 101, 220, 96, 191, ! 0, 218, 101, 101, 220, 96, 191, 0, 72, 95, ! 0, 72, 1, 0, 72, 95, 1, 0, 217, 219, ! 0, 0, 221, 0, 189, 0, 221, 1, 0, 0, ! 221, 0, 198, 0, 221, 102, 198, 0, 221, 102, ! 1, 0, 55, 101, 0, 55, 125, 101, 0, 55, ! 1, 0, 55, 125, 1, 0, 74, 101, 0, 74, ! 125, 101, 0, 74, 1, 0, 74, 125, 1, 0, ! 59, 101, 0, 59, 274, 101, 0, 59, 1, 0, ! 59, 274, 1, 0, 50, 274, 101, 0, 50, 1, ! 0, 50, 274, 1, 0, 78, 274, 90, 274, 101, ! 0, 78, 274, 101, 0, 78, 1, 0, 78, 274, ! 1, 0, 228, 95, 274, 96, 183, 0, 228, 95, ! 274, 96, 1, 0, 228, 1, 0, 228, 95, 1, ! 96, 0, 228, 95, 1, 0, 134, 0, 71, 183, ! 230, 0, 71, 183, 233, 0, 71, 183, 230, 233, ! 0, 71, 1, 0, 231, 0, 230, 231, 0, 232, ! 183, 0, 61, 95, 155, 96, 0, 61, 1, 0, ! 61, 95, 1, 0, 61, 95, 1, 96, 0, 65, ! 183, 0, 65, 1, 0, 235, 0, 243, 0, 114, ! 0, 77, 0, 95, 274, 96, 0, 237, 0, 247, ! 0, 248, 0, 249, 0, 236, 0, 122, 103, 77, ! 0, 95, 274, 1, 0, 122, 103, 1, 0, 116, ! 103, 1, 0, 60, 103, 1, 0, 122, 103, 68, ! 0, 121, 103, 68, 0, 116, 103, 68, 0, 60, ! 103, 68, 0, 73, 119, 95, 242, 96, 0, 73, ! 119, 95, 96, 0, 238, 0, 241, 125, 95, 96, ! 0, 241, 125, 95, 96, 141, 0, 241, 125, 95, ! 242, 96, 0, 241, 125, 95, 242, 96, 141, 0, ! 73, 1, 101, 0, 73, 119, 1, 0, 73, 119, ! 95, 1, 0, 73, 119, 95, 242, 1, 0, 241, ! 1, 0, 241, 125, 1, 0, 0, 73, 119, 95, ! 242, 96, 239, 141, 0, 0, 73, 119, 95, 96, ! 240, 141, 0, 122, 103, 73, 0, 234, 103, 73, ! 0, 274, 0, 242, 102, 274, 0, 242, 102, 1, ! 0, 73, 116, 244, 0, 73, 118, 244, 0, 73, ! 116, 244, 246, 0, 73, 118, 244, 246, 0, 73, ! 118, 246, 181, 0, 73, 116, 246, 181, 0, 73, ! 1, 100, 0, 73, 1, 99, 0, 245, 0, 244, ! 245, 0, 99, 274, 100, 0, 99, 274, 1, 0, ! 99, 1, 0, 99, 100, 0, 246, 99, 100, 0, ! 246, 99, 1, 0, 234, 103, 125, 0, 66, 103, ! 125, 0, 66, 1, 0, 122, 95, 96, 0, 122, ! 95, 242, 96, 0, 234, 103, 125, 95, 96, 0, ! 234, 103, 125, 95, 242, 96, 0, 66, 103, 125, ! 95, 96, 0, 66, 103, 125, 95, 242, 96, 0, ! 66, 103, 1, 96, 0, 66, 103, 1, 103, 0, ! 122, 99, 274, 100, 0, 235, 99, 274, 100, 0, ! 122, 99, 1, 0, 122, 99, 274, 1, 0, 235, ! 99, 1, 0, 235, 99, 274, 1, 0, 234, 0, ! 122, 0, 251, 0, 252, 0, 250, 47, 0, 250, ! 46, 0, 255, 0, 256, 0, 3, 254, 0, 257, ! 0, 3, 1, 0, 253, 0, 4, 253, 0, 4, ! 1, 0, 47, 254, 0, 47, 1, 0, 46, 254, ! 0, 46, 1, 0, 250, 0, 91, 254, 0, 92, ! 254, 0, 258, 0, 91, 1, 0, 92, 1, 0, ! 95, 116, 246, 96, 254, 0, 95, 116, 96, 254, ! 0, 95, 274, 96, 257, 0, 95, 122, 246, 96, ! 257, 0, 95, 116, 99, 1, 0, 95, 1, 0, ! 95, 116, 246, 96, 1, 0, 95, 116, 96, 1, ! 0, 95, 122, 246, 96, 1, 0, 254, 0, 259, ! 5, 254, 0, 259, 6, 254, 0, 259, 7, 254, ! 0, 259, 5, 1, 0, 259, 6, 1, 0, 259, ! 7, 1, 0, 259, 0, 260, 3, 259, 0, 260, ! 4, 259, 0, 260, 3, 1, 0, 260, 4, 1, ! 0, 260, 0, 261, 8, 260, 0, 261, 9, 260, ! 0, 261, 10, 260, 0, 261, 8, 1, 0, 261, ! 9, 1, 0, 261, 10, 1, 0, 261, 0, 262, ! 20, 261, 0, 262, 18, 261, 0, 262, 21, 261, ! 0, 262, 19, 261, 0, 262, 58, 117, 0, 262, ! 20, 1, 0, 262, 18, 1, 0, 262, 21, 1, ! 0, 262, 19, 1, 0, 262, 58, 1, 0, 262, ! 0, 263, 16, 262, 0, 263, 17, 262, 0, 263, ! 16, 1, 0, 263, 17, 1, 0, 263, 0, 264, ! 11, 263, 0, 264, 11, 1, 0, 264, 0, 265, ! 12, 264, 0, 265, 12, 1, 0, 265, 0, 266, ! 13, 265, 0, 266, 13, 1, 0, 266, 0, 267, ! 14, 266, 0, 267, 14, 1, 0, 267, 0, 268, ! 15, 267, 0, 268, 15, 1, 0, 268, 0, 268, ! 89, 274, 90, 269, 0, 268, 89, 90, 1, 0, ! 268, 89, 1, 0, 268, 89, 274, 90, 1, 0, ! 269, 0, 271, 0, 272, 273, 270, 0, 272, 273, ! 1, 0, 122, 0, 247, 0, 249, 0, 93, 0, ! 94, 0, 270, 0, 274, 0 }; ! #endif ! ! #if YYDEBUG ! /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ ! static const short yyrline[] = { ! 0, 605, 605, 621, 623, 624, 625, 626, 627, 631, ! 633, 636, 638, 639, 642, 644, 647, 651, 655, 659, ! 668, 679, 681, 684, 688, 693, 698, 700, 701, 702, ! 703, 704, 705, 706, 709, 714, 720, 722, 725, 731, ! 733, 737, 739, 742, 769, 771, 775, 794, 796, 800, ! 803, 805, 806, 816, 821, 836, 836, 841, 841, 845, ! 847, 849, 854, 858, 860, 862, 864, 868, 870, 872, ! 879, 885, 890, 894, 903, 913, 915, 918, 920, 921, ! 922, 932, 934, 935, 937, 939, 943, 946, 956, 959, ! 961, 965, 968, 975, 981, 989, 991, 993, 995, 1000, ! 1004, 1006, 1010, 1010, 1022, 1026, 1029, 1031, 1033, 1035, ! 1040, 1045, 1050, 1055, 1062, 1068, 1070, 1079, 1081, 1085, ! 1090, 1095, 1099, 1104, 1109, 1114, 1121, 1131, 1133, 1135, ! 1139, 1142, 1144, 1148, 1150, 1154, 1163, 1179, 1179, 1189, ! 1192, 1196, 1202, 1206, 1215, 1217, 1219, 1223, 1228, 1235, ! 1243, 1245, 1249, 1256, 1266, 1266, 1271, 1271, 1275, 1275, ! 1279, 1279, 1283, 1285, 1289, 1295, 1300, 1302, 1306, 1309, ! 1313, 1315, 1318, 1320, 1321, 1323, 1327, 1331, 1337, 1342, ! 1345, 1347, 1349, 1353, 1359, 1363, 1368, 1377, 1381, 1386, ! 1400, 1402, 1405, 1407, 1409, 1416, 1420, 1423, 1427, 1429, ! 1430, 1431, 1432, 1433, 1437, 1439, 1440, 1441, 1442, 1446, ! 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, ! 1458, 1461, 1479, 1490, 1493, 1497, 1504, 1514, 1519, 1524, ! 1529, 1531, 1536, 1538, 1543, 1545, 1547, 1549, 1551, 1555, ! 1557, 1558, 1559, 1560, 1561, 1562, 1565, 1571, 1573, 1575, ! 1579, 1584, 1589, 1589, 1605, 1611, 1613, 1615, 1622, 1625, ! 1627, 1629, 1633, 1635, 1638, 1642, 1644, 1647, 1654, 1660, ! 1662, 1664, 1668, 1676, 1679, 1681, 1683, 1687, 1692, 1701, ! 1706, 1713, 1720, 1722, 1724, 1728, 1731, 1740, 1747, 1749, ! 1753, 1766, 1768, 1774, 1780, 1784, 1786, 1790, 1793, 1795, ! 1799, 1802, 1804, 1806, 1810, 1813, 1815, 1817, 1821, 1824, ! 1826, 1828, 1832, 1838, 1840, 1844, 1849, 1853, 1855, 1859, ! 1866, 1868, 1870, 1872, 1876, 1888, 1891, 1893, 1898, 1902, ! 1904, 1911, 1920, 1937, 1939, 1944, 1948, 1951, 1956, 1958, ! 1961, 1963, 1965, 1967, 1968, 1969, 1970, 1971, 1975, 1980, ! 1982, 1984, 1986, 1990, 1993, 1995, 1997, 2004, 2007, 2009, ! 2013, 2019, 2020, 2026, 2027, 2029, 2031, 2033, 2035, 2037, ! 2046, 2046, 2080, 2080, 2097, 2100, 2104, 2110, 2115, 2119, ! 2122, 2124, 2126, 2130, 2141, 2150, 2152, 2156, 2159, 2163, ! 2174, 2176, 2184, 2211, 2213, 2217, 2222, 2228, 2232, 2235, ! 2237, 2248, 2259, 2264, 2273, 2275, 2279, 2282, 2284, 2289, ! 2294, 2299, 2306, 2308, 2309, 2310, 2313, 2318, 2323, 2325, ! 2326, 2328, 2329, 2333, 2339, 2341, 2345, 2348, 2352, 2355, ! 2359, 2361, 2363, 2365, 2366, 2368, 2372, 2381, 2383, 2385, ! 2399, 2401, 2406, 2408, 2410, 2414, 2416, 2421, 2426, 2431, ! 2433, 2435, 2439, 2441, 2446, 2451, 2453, 2457, 2459, 2464, ! 2469, 2474, 2476, 2478, 2482, 2484, 2489, 2494, 2499, 2504, ! 2506, 2508, 2510, 2512, 2514, 2518, 2520, 2525, 2530, 2532, ! 2536, 2538, 2543, 2547, 2549, 2554, 2558, 2560, 2565, 2569, ! 2571, 2576, 2580, 2582, 2587, 2591, 2593, 2598, 2604, 2606, ! 2610, 2612, 2615, 2618, 2625, 2627, 2628, 2631, 2633, 2636, ! 2640 }; #endif ! ! #if (YYDEBUG) || defined YYERROR_VERBOSE ! ! /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { ! "$", "error", "$undefined.", "PLUS_TK", "MINUS_TK", "MULT_TK", "DIV_TK", "REM_TK", "LS_TK", "SRS_TK", "ZRS_TK", "AND_TK", "XOR_TK", "OR_TK", "BOOL_AND_TK", "BOOL_OR_TK", "EQ_TK", "NEQ_TK", "GT_TK", "GTE_TK", "LT_TK", "LTE_TK", "PLUS_ASSIGN_TK", "MINUS_ASSIGN_TK", *************** static const char *const yytname[] = *** 1195,1207 **** "ELSE_TK", "INSTANCEOF_TK", "RETURN_TK", "VOID_TK", "CATCH_TK", "INTERFACE_TK", "CASE_TK", "EXTENDS_TK", "FINALLY_TK", "SUPER_TK", "WHILE_TK", "CLASS_TK", "SWITCH_TK", "CONST_TK", "TRY_TK", "FOR_TK", ! "NEW_TK", "CONTINUE_TK", "GOTO_TK", "PACKAGE_TK", "THIS_TK", "BYTE_TK", ! "SHORT_TK", "INT_TK", "LONG_TK", "CHAR_TK", "INTEGRAL_TK", "FLOAT_TK", ! "DOUBLE_TK", "FP_TK", "ID_TK", "REL_QM_TK", "REL_CL_TK", "NOT_TK", ! "NEG_TK", "ASSIGN_ANY_TK", "ASSIGN_TK", "OP_TK", "CP_TK", "OCB_TK", ! "CCB_TK", "OSB_TK", "CSB_TK", "SC_TK", "C_TK", "DOT_TK", ! "STRING_LIT_TK", "CHAR_LIT_TK", "INT_LIT_TK", "FP_LIT_TK", "TRUE_TK", ! "FALSE_TK", "BOOL_LIT_TK", "NULL_TK", "$accept", "goal", "@1", "literal", "type", "primitive_type", "reference_type", "class_or_interface_type", "class_type", "interface_type", "array_type", "name", "simple_name", "qualified_name", "identifier", --- 904,916 ---- "ELSE_TK", "INSTANCEOF_TK", "RETURN_TK", "VOID_TK", "CATCH_TK", "INTERFACE_TK", "CASE_TK", "EXTENDS_TK", "FINALLY_TK", "SUPER_TK", "WHILE_TK", "CLASS_TK", "SWITCH_TK", "CONST_TK", "TRY_TK", "FOR_TK", ! "NEW_TK", "CONTINUE_TK", "GOTO_TK", "PACKAGE_TK", "THIS_TK", ! "ASSERT_TK", "BYTE_TK", "SHORT_TK", "INT_TK", "LONG_TK", "CHAR_TK", ! "INTEGRAL_TK", "FLOAT_TK", "DOUBLE_TK", "FP_TK", "ID_TK", "REL_QM_TK", ! "REL_CL_TK", "NOT_TK", "NEG_TK", "ASSIGN_ANY_TK", "ASSIGN_TK", "OP_TK", ! "CP_TK", "OCB_TK", "CCB_TK", "OSB_TK", "CSB_TK", "SC_TK", "C_TK", ! "DOT_TK", "STRING_LIT_TK", "CHAR_LIT_TK", "INT_LIT_TK", "FP_LIT_TK", ! "TRUE_TK", "FALSE_TK", "BOOL_LIT_TK", "NULL_TK", "goal", "@1", "literal", "type", "primitive_type", "reference_type", "class_or_interface_type", "class_type", "interface_type", "array_type", "name", "simple_name", "qualified_name", "identifier", *************** static const char *const yytname[] = *** 1238,1246 **** "for_statement_nsi", "for_header", "for_begin", "for_init", "for_update", "statement_expression_list", "break_statement", "continue_statement", "return_statement", "throw_statement", ! "synchronized_statement", "synchronized", "try_statement", "catches", ! "catch_clause", "catch_clause_parameter", "finally", "primary", ! "primary_no_new_array", "type_literals", "class_instance_creation_expression", "anonymous_class_creation", "@11", "@12", "something_dot_new", "argument_list", "array_creation_expression", "dim_exprs", "dim_expr", "dims", --- 947,955 ---- "for_statement_nsi", "for_header", "for_begin", "for_init", "for_update", "statement_expression_list", "break_statement", "continue_statement", "return_statement", "throw_statement", ! "assert_statement", "synchronized_statement", "synchronized", ! "try_statement", "catches", "catch_clause", "catch_clause_parameter", ! "finally", "primary", "primary_no_new_array", "type_literals", "class_instance_creation_expression", "anonymous_class_creation", "@11", "@12", "something_dot_new", "argument_list", "array_creation_expression", "dim_exprs", "dim_expr", "dims", *************** static const char *const yytname[] = *** 1259,1308 **** }; #endif ! # ifdef YYPRINT ! /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to ! token YYLEX-NUM. */ ! static const unsigned short yytoknum[] = ! { ! 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, ! 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, ! 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, ! 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, ! 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, ! 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, ! 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, ! 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, ! 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, ! 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, ! 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, ! 365 ! }; ! # endif ! ! /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ ! static const unsigned short yyr1[] = { ! 0, 111, 113, 112, 114, 114, 114, 114, 114, 114, ! 115, 115, 116, 116, 116, 117, 117, 118, 119, 120, ! 121, 121, 122, 122, 123, 124, 125, 126, 126, 126, ! 126, 126, 126, 126, 126, 127, 127, 128, 128, 129, ! 129, 129, 130, 130, 131, 131, 131, 132, 132, 132, ! 133, 133, 133, 133, 134, 134, 136, 135, 137, 135, ! 135, 135, 135, 135, 138, 138, 138, 138, 139, 139, ! 139, 140, 140, 140, 141, 141, 142, 142, 143, 143, ! 143, 143, 144, 144, 144, 144, 144, 145, 145, 146, ! 146, 146, 147, 147, 147, 147, 148, 148, 148, 148, ! 148, 149, 149, 151, 150, 150, 152, 152, 152, 152, ! 152, 152, 152, 152, 152, 153, 153, 153, 153, 153, ! 154, 154, 154, 155, 155, 155, 155, 156, 157, 157, ! 157, 158, 158, 158, 159, 159, 160, 161, 163, 162, ! 164, 164, 165, 165, 166, 166, 166, 166, 167, 168, ! 168, 168, 168, 169, 169, 171, 170, 172, 170, 173, ! 170, 174, 170, 170, 170, 175, 175, 175, 175, 176, ! 176, 177, 177, 178, 178, 178, 178, 179, 180, 180, ! 181, 181, 181, 181, 182, 182, 182, 183, 183, 184, ! 185, 186, 186, 187, 187, 187, 188, 189, 189, 190, ! 190, 190, 190, 190, 190, 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, 194, 195, 195, 196, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 198, --- 968,997 ---- }; #endif ! /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ ! static const short yyr1[] = { ! 0, 113, 112, 114, 114, 114, 114, 114, 114, 115, ! 115, 116, 116, 116, 117, 117, 118, 119, 120, 121, ! 121, 122, 122, 123, 124, 125, 126, 126, 126, 126, ! 126, 126, 126, 126, 127, 127, 128, 128, 129, 129, ! 129, 130, 130, 131, 131, 131, 132, 132, 132, 133, ! 133, 133, 133, 134, 134, 136, 135, 137, 135, 135, ! 135, 135, 135, 138, 138, 138, 138, 139, 139, 139, ! 140, 140, 140, 141, 141, 142, 142, 143, 143, 143, ! 143, 144, 144, 144, 144, 144, 145, 145, 146, 146, ! 146, 147, 147, 147, 147, 148, 148, 148, 148, 148, ! 149, 149, 151, 150, 150, 152, 152, 152, 152, 152, ! 152, 152, 152, 152, 153, 153, 153, 153, 153, 154, ! 154, 154, 155, 155, 155, 155, 156, 157, 157, 157, ! 158, 158, 158, 159, 159, 160, 161, 163, 162, 164, ! 164, 165, 165, 166, 166, 166, 166, 167, 168, 168, ! 168, 168, 169, 169, 171, 170, 172, 170, 173, 170, ! 174, 170, 170, 170, 175, 175, 175, 175, 176, 176, ! 177, 177, 178, 178, 178, 178, 179, 180, 180, 181, ! 181, 181, 181, 182, 182, 182, 183, 183, 184, 185, ! 186, 186, 187, 187, 187, 188, 189, 189, 190, 190, ! 190, 190, 190, 190, 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, 194, 195, 195, 196, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 198, *************** static const unsigned short yyr1[] = *** 1313,1363 **** 215, 215, 215, 215, 215, 216, 216, 217, 217, 217, 218, 219, 219, 219, 219, 220, 220, 221, 221, 221, 222, 222, 222, 222, 223, 223, 223, 223, 224, 224, ! 224, 224, 225, 225, 225, 226, 226, 226, 226, 226, ! 227, 228, 228, 228, 228, 229, 229, 230, 231, 231, ! 231, 231, 232, 232, 233, 233, 234, 234, 234, 234, ! 234, 234, 234, 234, 234, 234, 234, 234, 234, 235, ! 235, 235, 235, 236, 236, 236, 236, 236, 236, 236, ! 236, 236, 236, 236, 236, 236, 238, 237, 239, 237, ! 240, 240, 241, 241, 241, 242, 242, 242, 242, 242, ! 242, 242, 242, 243, 243, 244, 244, 244, 245, 245, ! 245, 246, 246, 246, 247, 247, 247, 247, 247, 247, ! 247, 247, 248, 248, 248, 248, 248, 248, 249, 249, ! 249, 249, 250, 251, 252, 252, 252, 252, 252, 253, ! 253, 253, 254, 254, 255, 255, 256, 256, 256, 256, ! 256, 256, 257, 257, 257, 257, 257, 257, 257, 257, ! 257, 258, 258, 258, 258, 258, 258, 258, 259, 259, ! 259, 259, 259, 260, 260, 260, 260, 260, 260, 260, ! 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, ! 261, 262, 262, 262, 262, 262, 263, 263, 263, 264, ! 264, 264, 265, 265, 265, 266, 266, 266, 267, 267, ! 267, 268, 268, 268, 268, 268, 269, 269, 270, 270, ! 271, 271, 271, 272, 272, 273, 274 }; ! /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ! static const unsigned char yyr2[] = { ! 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ! 2, 2, 1, 1, 1, 3, 1, 0, 1, 1, ! 1, 2, 2, 2, 3, 1, 2, 1, 2, 3, ! 2, 3, 1, 1, 3, 2, 3, 5, 4, 5, ! 1, 1, 1, 1, 1, 2, 0, 7, 0, 6, ! 3, 2, 3, 4, 0, 2, 3, 2, 0, 2, ! 2, 1, 3, 3, 2, 3, 1, 2, 1, 1, ! 1, 1, 1, 1, 1, 1, 1, 3, 4, 1, ! 3, 3, 1, 3, 3, 4, 1, 3, 2, 3, ! 3, 1, 1, 0, 3, 2, 3, 3, 4, 4, ! 2, 3, 2, 3, 2, 3, 4, 3, 3, 3, ! 1, 3, 3, 2, 3, 2, 3, 1, 0, 2, ! 2, 1, 3, 3, 1, 1, 2, 1, 0, 3, ! 2, 3, 3, 4, 2, 3, 3, 4, 1, 4, ! 5, 7, 6, 1, 1, 0, 4, 0, 5, 0, ! 5, 0, 6, 3, 4, 2, 3, 2, 3, 2, ! 3, 1, 2, 1, 1, 1, 1, 1, 2, 2, ! 2, 3, 3, 4, 1, 3, 3, 2, 3, 1, ! 1, 1, 2, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, --- 1002,1053 ---- 215, 215, 215, 215, 215, 216, 216, 217, 217, 217, 218, 219, 219, 219, 219, 220, 220, 221, 221, 221, 222, 222, 222, 222, 223, 223, 223, 223, 224, 224, ! 224, 224, 225, 225, 225, 226, 226, 226, 226, 227, ! 227, 227, 227, 227, 228, 229, 229, 229, 229, 230, ! 230, 231, 232, 232, 232, 232, 233, 233, 234, 234, ! 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, ! 235, 235, 235, 236, 236, 236, 236, 237, 237, 237, ! 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, ! 239, 238, 240, 238, 241, 241, 242, 242, 242, 243, ! 243, 243, 243, 243, 243, 243, 243, 244, 244, 245, ! 245, 245, 246, 246, 246, 247, 247, 247, 248, 248, ! 248, 248, 248, 248, 248, 248, 249, 249, 249, 249, ! 249, 249, 250, 250, 250, 250, 251, 252, 253, 253, ! 253, 253, 253, 254, 254, 254, 255, 255, 256, 256, ! 257, 257, 257, 257, 257, 257, 258, 258, 258, 258, ! 258, 258, 258, 258, 258, 259, 259, 259, 259, 259, ! 259, 259, 260, 260, 260, 260, 260, 261, 261, 261, ! 261, 261, 261, 261, 262, 262, 262, 262, 262, 262, ! 262, 262, 262, 262, 262, 263, 263, 263, 263, 263, ! 264, 264, 264, 265, 265, 265, 266, 266, 266, 267, ! 267, 267, 268, 268, 268, 269, 269, 269, 269, 269, ! 270, 270, 271, 271, 272, 272, 272, 273, 273, 274, ! 275 }; ! /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ! static const short yyr2[] = { ! 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, ! 2, 1, 1, 1, 3, 1, 0, 1, 1, 1, ! 2, 2, 2, 3, 1, 2, 1, 2, 3, 2, ! 3, 1, 1, 3, 2, 3, 5, 4, 5, 1, ! 1, 1, 1, 1, 2, 0, 7, 0, 6, 3, ! 2, 3, 4, 0, 2, 3, 2, 0, 2, 2, ! 1, 3, 3, 2, 3, 1, 2, 1, 1, 1, ! 1, 1, 1, 1, 1, 1, 3, 4, 1, 3, ! 3, 1, 3, 3, 4, 1, 3, 2, 3, 3, ! 1, 1, 0, 3, 2, 3, 3, 4, 4, 2, ! 3, 2, 3, 2, 3, 4, 3, 3, 3, 1, ! 3, 3, 2, 3, 2, 3, 1, 0, 2, 2, ! 1, 3, 3, 1, 1, 2, 1, 0, 3, 2, ! 3, 3, 4, 2, 3, 3, 4, 1, 4, 5, ! 7, 6, 1, 1, 0, 4, 0, 5, 0, 5, ! 0, 6, 3, 4, 2, 3, 2, 3, 2, 3, ! 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, ! 3, 3, 4, 1, 3, 3, 2, 3, 1, 1, ! 1, 2, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, *************** static const unsigned char yyr2[] = *** 1369,2801 **** 7, 6, 3, 5, 4, 7, 6, 2, 2, 3, 2, 0, 1, 1, 2, 0, 1, 1, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, ! 2, 3, 3, 2, 3, 5, 5, 2, 4, 3, ! 1, 3, 3, 4, 2, 1, 2, 2, 4, 2, ! 3, 4, 2, 2, 1, 1, 1, 1, 3, 1, ! 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, ! 3, 3, 3, 5, 4, 1, 4, 5, 5, 6, ! 3, 3, 4, 5, 2, 3, 0, 7, 0, 6, ! 3, 3, 1, 3, 3, 3, 3, 4, 4, 4, ! 4, 3, 3, 1, 2, 3, 3, 2, 2, 3, ! 3, 3, 3, 2, 3, 4, 5, 6, 5, 6, ! 4, 4, 4, 4, 3, 4, 3, 4, 1, 1, ! 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, ! 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, ! 2, 2, 5, 4, 4, 5, 4, 2, 5, 4, ! 5, 1, 3, 3, 3, 3, 3, 3, 1, 3, ! 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, ! 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, ! 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, ! 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, ! 3, 1, 5, 4, 3, 5, 1, 1, 3, 3, ! 1, 1, 1, 1, 1, 1, 1 }; ! /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state ! STATE-NUM when YYTABLE doesn't specify something else to do. Zero ! means the default is an error. */ ! static const unsigned short yydefact[] = { ! 2, 0, 0, 1, 53, 54, 0, 0, 0, 0, ! 221, 3, 0, 0, 0, 35, 42, 43, 37, 0, ! 50, 51, 52, 45, 26, 0, 22, 23, 24, 0, ! 61, 0, 40, 0, 0, 36, 38, 0, 0, 55, ! 0, 0, 46, 44, 0, 163, 0, 0, 159, 62, ! 0, 68, 41, 39, 0, 0, 0, 60, 0, 48, ! 0, 25, 167, 19, 165, 17, 0, 156, 0, 0, ! 67, 18, 0, 0, 58, 164, 0, 161, 63, 68, ! 49, 47, 14, 0, 12, 13, 169, 0, 10, 11, ! 15, 16, 17, 0, 175, 177, 0, 176, 0, 171, ! 173, 174, 168, 166, 160, 66, 70, 71, 69, 0, ! 158, 0, 56, 112, 0, 128, 110, 0, 0, 89, ! 92, 128, 0, 20, 21, 114, 0, 0, 179, 178, ! 170, 172, 0, 0, 59, 162, 0, 0, 0, 0, ! 107, 98, 87, 0, 0, 0, 0, 106, 388, 0, ! 113, 128, 111, 0, 128, 73, 72, 189, 74, 22, ! 0, 84, 0, 76, 78, 82, 83, 0, 79, 0, ! 80, 138, 128, 85, 81, 0, 86, 57, 118, 115, ! 0, 127, 0, 120, 0, 130, 131, 129, 119, 117, ! 91, 0, 90, 94, 0, 0, 0, 0, 0, 0, ! 0, 337, 0, 0, 0, 0, 8, 7, 4, 5, ! 6, 9, 336, 0, 0, 409, 0, 102, 408, 334, ! 343, 339, 355, 0, 335, 340, 341, 342, 426, 410, ! 411, 419, 441, 414, 415, 417, 429, 448, 453, 460, ! 471, 476, 479, 482, 485, 488, 491, 496, 505, 497, ! 0, 101, 99, 97, 100, 390, 389, 109, 88, 108, ! 187, 0, 128, 75, 77, 105, 0, 136, 0, 140, ! 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, ! 0, 0, 337, 0, 0, 10, 16, 409, 0, 127, ! 195, 0, 0, 210, 0, 191, 193, 0, 194, 199, ! 211, 0, 200, 212, 0, 201, 202, 213, 252, 0, ! 203, 0, 214, 204, 291, 0, 215, 216, 217, 219, ! 218, 0, 220, 245, 244, 0, 242, 243, 240, 241, ! 239, 125, 123, 116, 0, 0, 0, 418, 409, 340, ! 342, 416, 421, 420, 425, 424, 423, 422, 0, 393, ! 0, 0, 0, 18, 0, 430, 427, 431, 428, 437, ! 0, 409, 0, 180, 0, 184, 0, 0, 0, 0, ! 0, 0, 95, 0, 0, 364, 0, 413, 412, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 503, 504, 0, 142, 0, 141, 135, 104, 134, 189, ! 139, 0, 228, 229, 227, 247, 0, 313, 0, 302, ! 300, 0, 310, 308, 0, 274, 0, 255, 0, 324, ! 0, 288, 0, 306, 304, 0, 0, 197, 0, 224, ! 222, 0, 0, 190, 188, 192, 196, 409, 320, 223, ! 226, 0, 273, 0, 409, 293, 297, 290, 0, 0, ! 317, 0, 122, 121, 126, 124, 133, 132, 348, 352, ! 0, 392, 382, 381, 360, 0, 375, 383, 0, 376, ! 0, 361, 0, 0, 0, 20, 21, 345, 338, 181, ! 182, 0, 347, 351, 350, 394, 0, 372, 404, 0, ! 346, 349, 370, 344, 371, 391, 406, 0, 365, 0, ! 445, 442, 446, 443, 447, 444, 451, 449, 452, 450, ! 457, 454, 458, 455, 459, 456, 467, 462, 469, 464, ! 466, 461, 468, 463, 470, 0, 465, 474, 472, 475, ! 473, 478, 477, 481, 480, 484, 483, 487, 486, 490, ! 489, 494, 0, 0, 499, 498, 143, 409, 144, 0, ! 0, 148, 0, 248, 0, 314, 312, 303, 301, 311, ! 309, 275, 0, 256, 0, 0, 0, 321, 325, 0, ! 322, 289, 307, 305, 338, 0, 198, 230, 0, 0, ! 0, 253, 0, 294, 0, 282, 0, 0, 319, 0, ! 400, 401, 0, 387, 0, 384, 377, 380, 378, 379, ! 362, 354, 0, 439, 433, 436, 0, 0, 434, 186, ! 183, 185, 395, 0, 405, 402, 0, 407, 403, 356, ! 0, 493, 0, 0, 145, 0, 0, 146, 249, 0, ! 276, 272, 0, 329, 0, 333, 332, 326, 323, 327, ! 234, 0, 231, 232, 0, 0, 0, 258, 0, 262, ! 0, 265, 0, 299, 298, 284, 0, 296, 0, 318, ! 0, 398, 0, 386, 385, 0, 363, 353, 438, 432, ! 440, 435, 374, 373, 396, 0, 357, 358, 495, 492, ! 0, 147, 0, 0, 0, 246, 0, 199, 0, 206, ! 207, 0, 208, 209, 0, 257, 330, 0, 235, 0, ! 0, 233, 271, 268, 269, 506, 0, 260, 263, 0, ! 259, 0, 266, 0, 0, 283, 0, 316, 315, 399, ! 369, 0, 397, 359, 0, 149, 0, 0, 0, 225, ! 277, 0, 331, 328, 238, 236, 0, 270, 267, 261, ! 0, 281, 0, 367, 0, 0, 150, 0, 250, 0, ! 0, 237, 279, 280, 152, 0, 0, 0, 0, 151, ! 0, 0, 0, 0, 286, 0, 251, 285 }; - /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { ! -1, 1, 2, 212, 284, 213, 89, 90, 72, 64, ! 214, 215, 26, 27, 28, 11, 12, 13, 14, 15, ! 16, 17, 18, 448, 290, 136, 109, 51, 74, 108, ! 134, 162, 163, 164, 95, 118, 119, 120, 216, 166, ! 266, 96, 115, 182, 183, 291, 140, 187, 407, 168, ! 169, 170, 268, 171, 172, 410, 558, 559, 292, 21, ! 47, 76, 69, 111, 48, 67, 98, 99, 100, 101, ! 217, 366, 293, 175, 561, 721, 295, 296, 297, 298, ! 696, 299, 300, 301, 302, 699, 303, 304, 305, 306, ! 700, 307, 451, 308, 591, 658, 659, 660, 661, 309, ! 310, 702, 311, 312, 313, 703, 314, 315, 457, 666, ! 667, 316, 317, 318, 319, 320, 321, 322, 577, 578, ! 579, 580, 218, 219, 220, 221, 222, 731, 675, 223, ! 496, 224, 476, 477, 124, 225, 226, 227, 228, 229, ! 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, ! 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, ! 250, 402, 497, 716 }; - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ - #define YYPACT_NINF -650 static const short yypact[] = { ! -650, 33, 200, -650, -650, -650, 353, -42, 478, 491, ! -650, -650, 224, 349, 407, -650, -650, -650, -650, 601, ! -650, -650, -650, -650, -650, 15, -650, -650, -650, 358, ! -650, 214, -650, 21, 459, -650, -650, 444, 513, -650, ! -42, 502, -650, -650, 460, -650, 531, -27, 170, -650, ! 540, 283, -650, -650, -42, 590, 424, -650, 420, -650, ! 36, -650, -650, -650, -650, 300, 901, -650, 541, -27, ! -650, -650, 414, 549, -650, -650, -27, 170, -650, 283, ! -650, -650, -650, 585, -650, -650, -650, 586, 322, -650, ! -650, -650, 400, 1120, -650, -650, 71, -650, 1586, -650, ! -650, -650, -650, -650, -650, -650, -650, -650, 370, 330, ! -650, -27, -650, -650, 382, -28, -650, 137, -11, -650, ! 425, -28, 426, 438, 438, -650, 620, 633, -650, -650, ! -650, -650, 655, 1277, -650, -650, 330, 616, 684, 60, ! -650, -650, -650, 687, 1530, 87, 575, -650, -650, 93, ! -650, -28, -650, 243, -28, -650, -650, 495, -650, 510, ! 821, -650, 1355, -650, -650, -650, -650, 50, -650, 545, ! -650, -650, 632, -650, -650, 1976, -650, -650, -650, -650, ! 693, 612, 473, -650, 776, -650, -650, 609, -650, -650, ! -650, 84, -650, -650, 2784, 1188, 2845, 2896, 651, 35, ! 556, -650, 2957, 3008, 3069, 4998, -650, -650, -650, -650, ! -650, -650, -650, 573, 668, 921, 67, -650, 717, 624, ! -650, -650, -650, 697, -650, 756, -650, 867, 755, -650, ! -650, -650, -650, -650, -650, -650, -650, 942, 964, 970, ! 797, 966, 767, 801, 811, 812, 10, -650, -650, -650, ! 919, -650, -650, -650, -650, -650, -650, -650, -650, -650, ! -650, 959, 632, -650, -650, -650, 654, -650, 740, -650, ! 819, 180, 3120, -650, 121, 2173, 26, 226, 303, 316, ! 341, 141, 762, 5283, -42, 573, 668, 883, 636, 537, ! -650, 776, 783, -650, 1907, -650, -650, 761, -650, -650, ! -650, 2045, -650, -650, 780, -650, -650, -650, -650, 2045, ! -650, 2045, -650, -650, 5334, 791, -650, -650, -650, -650, ! -650, 445, -650, 372, 832, 755, 985, 991, -650, -650, ! -650, -650, 960, -650, 676, 700, 711, -650, 646, -650, ! -650, -650, -650, -650, -650, -650, -650, -650, 13, -650, ! 718, 949, 798, 798, 452, -650, -650, -650, -650, -650, ! 709, 921, 53, -650, 816, -650, 823, 23, 830, 5059, ! 2224, 587, -650, -8, 3181, -650, 485, -650, -650, 3232, ! 3293, 3344, 3405, 3456, 3517, 3568, 3629, 3680, 3741, 3792, ! 3853, 690, 3904, 3965, 4016, 4077, 4128, 4189, 4240, 2285, ! -650, -650, 4301, -650, 592, -650, -650, -650, -650, -650, ! -650, 1907, -650, -650, -650, -650, 4352, -650, 172, -650, ! -650, 211, -650, -650, 219, -650, 4413, -650, 4464, -650, ! 860, -650, 1469, -650, -650, 225, 212, 822, 658, -650, ! -650, -42, 2336, -650, -650, -650, -650, 958, 612, -650, ! -650, 831, -650, 866, 990, -650, -650, -650, 117, 2397, ! -650, 4525, -650, -650, -650, 960, -650, -650, -650, -650, ! 204, 842, -650, -650, -650, 2448, 798, -650, 660, 798, ! 660, -650, 2509, 4576, 107, 203, 439, -650, 5359, -650, ! -650, 748, -650, -650, -650, -650, 775, -650, -650, 222, ! -650, -650, -650, -650, -650, 844, -650, 249, -650, 5110, ! -650, -650, -650, -650, -650, -650, -650, 942, -650, 942, ! -650, 964, -650, 964, -650, 964, -650, 970, -650, 970, ! -650, 970, -650, 970, -650, 322, -650, -650, 797, -650, ! 797, -650, 966, -650, 767, -650, 801, -650, 811, -650, ! 812, -650, 944, 854, -650, -650, -650, 1008, -650, 1907, ! 857, -650, 1907, -650, 276, -650, -650, -650, -650, -650, ! -650, -650, 333, -650, 861, 500, 328, 860, -650, 545, ! -650, -650, -650, -650, -650, 504, 822, -650, 961, 138, ! -20, -650, 870, -650, 4973, -650, 4861, 871, 879, 895, ! -650, -650, 5171, -650, 265, -650, 438, -650, 438, -650, ! -650, 896, 151, -650, -650, -650, 4637, 1021, -650, -650, ! -650, -650, -650, 4688, -650, -650, 5222, -650, -650, 330, ! 789, -650, 4749, 713, -650, 1907, 2560, -650, -650, 2112, ! -650, -650, 346, -650, 746, -650, -650, -650, -650, -650, ! -650, 2621, -650, -650, 998, 58, 4800, -650, 603, -650, ! 1684, -650, 5283, -650, -650, -650, 922, 934, 4912, -650, ! 352, -650, 805, -650, -650, 330, -650, 924, -650, -650, ! -650, -650, -650, -650, -650, 808, -650, 330, -650, -650, ! 508, -650, 241, 156, 514, -650, 987, 996, 2112, -650, ! -650, 2112, -650, -650, 965, -650, 972, 974, -650, 1073, ! 159, -650, -650, -650, -650, -650, 433, -650, -650, 1759, ! -650, 1833, -650, 980, 2045, -650, 984, -650, -650, -650, ! -650, 330, -650, -650, 2672, -650, 258, 4352, 2045, -650, ! -650, 2733, -650, -650, -650, -650, 1084, -650, -650, -650, ! 986, -650, 2045, -650, 263, 186, -650, 356, -650, 4861, ! 997, -650, -650, -650, -650, 269, 2112, 1004, 4912, -650, ! 1046, 2112, 1010, 2112, -650, 2112, -650, -650 }; - /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { ! -650, -650, -650, -650, -59, -51, 726, 3, -120, 493, ! 306, -6, 470, -650, 122, -650, 1106, 752, -650, 325, ! -650, -650, 837, 18, 517, -650, -650, 1064, 1044, -650, ! -135, -650, 967, -650, -104, -123, 989, -171, -197, -650, ! -650, -67, 760, 874, -328, -127, -58, -650, -650, -650, ! -650, -650, -650, -650, 968, -650, 174, -650, 725, 329, ! -650, -650, -650, -650, 1081, -12, -650, 1040, -650, -650, ! 332, -650, -121, 872, 845, -158, -289, -650, 827, -288, ! 139, -601, 610, -440, -650, -650, -650, -312, -650, -650, ! -650, -650, -650, -650, -650, -650, 486, 487, -614, -405, ! -650, -650, -650, -650, -650, -650, -650, -202, -650, -649, ! 829, -650, -650, -650, -650, -650, -650, -650, -650, 569, ! -650, 571, -650, -650, -650, 234, -650, -650, -650, -650, ! -407, -650, 796, 229, -38, 1110, 305, 1315, 395, 474, ! 617, 955, -90, 628, 707, -477, -650, 679, 705, 607, ! 648, 757, 758, 759, 763, 754, -650, 524, 765, 891, ! -650, -650, -61, -650 }; ! /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If ! positive, shift that token. If negative, reduce the rule which ! number is the opposite. If zero, do what YYDEFACT says. ! If YYTABLE_NINF, syntax error. */ ! #define YYTABLE_NINF -503 static const short yytable[] = { ! 25, 177, 456, 33, 153, 445, 463, 87, 365, 332, ! 184, 618, 174, 449, 468, 88, 42, 294, 186, 726, ! 19, 452, 52, 453, 492, 398, 138, 349, 655, 165, ! 19, 19, 19, 3, 127, 589, 349, 80, 697, 87, ! 65, 174, 88, 656, 65, 24, 722, 88, 267, 63, ! 123, 265, 19, 71, 487, 19, 19, 104, 165, 712, ! 92, 188, 65, 147, 110, 504, 167, 65, 372, 66, ! 139, 63, 128, 19, 87, 612, 63, 657, 180, 24, ! 354, 469, 88, 251, 93, 141, 88, 92, 252, 142, ! 143, 493, 92, 257, 255, 167, 259, 697, 399, 135, ! 697, 127, 630, 87, 341, 722, 345, 347, 615, 88, ! 767, 88, 356, 358, 269, 43, 93, 44, 593, 772, ! -154, 53, 419, 54, 285, 335, 65, 92, 350, 29, ! 31, 92, 65, 88, 184, 63, 81, 350, 141, 653, ! 681, 71, 433, 362, 251, 408, -103, 713, 488, 352, ! -103, 160, 676, 360, 92, 181, 92, 653, 430, 189, ! 745, 437, 56, 58, 465, 697, 61, -93, -93, 287, ! 697, 129, 697, 565, 697, 123, 61, -96, 92, -96, ! 160, 415, -96, -96, -96, -96, 253, 745, 338, 338, ! 338, 338, 256, 289, 65, 672, 338, 338, 361, 698, ! -27, 4, 180, 353, 405, 114, 148, 184, 24, 117, ! 88, 418, 567, 487, 424, 49, 467, -292, 594, 685, ! 569, 420, 436, 624, -29, 4, 582, 425, 24, 693, ! -96, 137, 441, 654, 701, -96, -96, -96, -96, 623, ! 88, 434, 652, 285, 710, 5, 677, 123, 114, 117, ! 627, 736, 623, 562, 746, 92, 6, 623, 698, 711, ! 623, 698, 7, 285, 744, 191, 673, -64, 8, 5, ! 761, 68, 566, 445, 416, 180, 9, 638, 50, 181, ! 6, 765, 664, 88, 456, 92, 7, 623, 287, 511, ! 513, 515, 8, 701, 621, 447, 701, 288, 616, 600, ! 10, 149, 191, 447, 427, 447, 601, 584, 454, 499, ! -64, 568, 289, 507, 478, 480, 707, 429, 586, 570, ! 426, 625, 485, 486, 10, 583, 698, 755, 92, 645, ! 65, 698, 181, 698, 640, 698, 73, 35, 553, 71, ! 535, 735, 431, 258, 143, 376, 445, 705, 628, -30, ! 4, 695, 181, 727, 23, 564, 456, 638, 756, 45, ! 285, 701, 35, 764, 674, 572, 701, 574, 701, 769, ! 701, 639, 91, 338, 338, 338, 338, 338, 338, 338, ! 338, 338, 338, 338, 338, 92, 338, 338, 338, 338, ! 338, 338, 338, 614, 5, 97, 421, 428, 597, 91, ! 599, 635, 54, 435, 91, 557, 191, -28, 4, 323, ! 449, 7, 157, 452, 604, 105, 288, 8, -339, -339, ! 122, 78, 46, 288, 157, 75, 133, 97, 641, 289, ! 251, 288, 445, 288, 747, 432, 751, 704, 606, 91, ! 24, 608, -254, 91, -31, 4, 460, 456, 157, 10, ! 758, 766, 5, 481, -155, 646, 456, 191, 649, -33, ! 4, 59, 173, 6, 763, 60, 91, -65, 91, 7, ! -339, 132, 471, -64, -339, 8, 137, 338, 695, 30, ! 324, 286, 338, 751, 50, 758, 508, 763, 46, 5, ! 91, 173, 32, 61, 686, 505, 704, 123, 122, 704, ! 6, 643, 54, 57, 5, 650, 7, 10, 285, 650, ! -65, 285, 8, -32, 4, 415, -64, 184, 144, 20, ! -157, 7, 748, 145, 146, 148, 679, 8, 323, 20, ! 20, 20, 62, 288, 617, 323, 149, 149, -320, 461, ! 730, 70, 102, 323, 10, 323, 482, 24, 323, 728, ! 106, 20, 733, 287, 20, 20, 287, 351, 5, 10, ! 61, 103, 683, 191, 704, 24, 107, 91, 333, 704, ! 325, 704, 20, 704, 334, 7, 254, 289, 24, 509, ! 289, 8, 39, 94, 285, 180, 113, 116, 500, 24, ! -34, 4, 260, 88, 644, 715, 753, 91, 651, 324, ! 286, 723, 734, 159, 261, 41, 324, 82, 737, 285, ! 338, 338, 22, 10, 324, 94, 324, 178, 24, 324, ! 286, 150, 22, 22, 22, 156, 338, 24, 24, 287, ! 159, -320, 159, 447, 152, 5, 24, 439, 92, 84, ! 91, 157, 85, 24, 22, 323, 39, 22, 22, 326, ! 161, 655, 7, 289, 287, 501, 155, 39, 8, 500, ! 502, 5, 181, 40, 503, 22, 656, 82, 285, 41, ! 285, 122, 24, 24, 24, 367, 757, 462, 289, 161, ! 760, 288, -24, -24, 288, 185, 138, 556, 190, 325, ! 10, 534, 447, 334, 331, 447, 325, 91, 375, 84, ! 717, 464, 85, 24, 325, 605, 325, 24, 605, 325, ! 336, 179, 466, 287, 500, 287, 324, 286, 447, 470, ! 24, 5, 374, -24, 585, 440, 501, 82, -24, -24, ! -24, 502, 447, 634, -24, 503, 637, 289, -24, 289, ! 369, 82, 24, 176, 370, 24, 447, 706, 371, 619, ! 157, 194, 195, 348, 406, 61, 205, 288, 149, 84, ! 447, 288, 85, 24, 34, 447, 38, 447, 326, 447, ! 368, 24, 176, 84, 24, 326, 85, 24, 394, 690, ! 24, 501, 288, 326, 24, 326, 502, 24, 326, 55, ! 503, 5, 327, 323, 196, 197, 323, 82, 24, 82, ! 24, 377, 378, 328, 483, 24, 325, 484, 198, 691, ! 607, 367, 609, 395, 199, 387, 388, 389, 390, 373, ! 288, 200, 125, 288, 396, 201, 397, 82, 323, 84, ! 323, 84, 85, 24, 85, 24, 409, 739, 202, 203, ! 740, 288, 204, 288, 205, 620, 288, 121, -501, -501, ! 36, 206, 207, 208, 209, 391, -153, 210, 211, 84, ! 288, 446, 85, 24, 324, 286, 39, 324, 286, 323, ! 622, 36, 82, 323, 288, 36, 623, 442, -341, -341, ! 450, 126, 329, 40, 687, 326, 151, 154, 288, 41, ! 623, 459, 36, 288, 323, 288, 475, 288, 494, 324, ! 729, 324, 323, 732, 84, 770, 623, 85, 24, 623, ! 774, 327, 776, 489, 777, 412, 413, -137, 327, 414, ! 490, 575, 328, 143, 491, 576, 327, 590, 327, 328, ! -341, 327, 323, 592, -341, 323, 602, 328, 626, 328, ! 324, 286, 328, 632, 324, 631, 5, 379, 380, 381, ! 91, 636, 82, 323, 325, 323, 642, 325, 323, -502, ! -502, 83, 652, 7, 662, 324, 286, 382, 383, 8, ! -17, 668, 323, 324, 669, -500, -500, 369, 384, 385, ! 386, 370, 392, 393, 84, 438, 323, 85, 24, 325, ! 670, 325, -368, 323, 527, 529, 531, 533, 86, 711, ! 323, 329, 323, 324, 5, 323, 324, 323, 329, 323, ! 82, 400, 401, -500, -500, 369, 329, 724, 329, 370, ! -366, 329, 680, 371, 324, 286, 324, 286, 327, 324, ! 325, -410, -410, 326, 325, 594, 326, -411, -411, 328, ! 538, 540, 84, 324, 738, 85, 24, 472, 473, 474, ! -500, -500, 369, -205, 403, 325, 370, 324, 145, 146, ! 438, 517, 519, 325, 324, 741, 330, 742, 326, 743, ! 326, 324, 82, 324, 744, 750, 324, -17, 324, 752, ! 324, 198, -500, -500, 369, 761, 762, 199, 370, 521, ! 523, 525, 371, 325, 200, -17, 325, 768, 201, 771, ! -500, -500, 369, 773, 84, 775, 370, 85, 24, 326, ! 633, 202, 203, 326, 325, 204, 325, 536, 329, 325, ! 37, 125, 79, 112, 206, 207, 208, 209, 262, 264, ! 210, 211, 192, 325, 326, 404, 560, 77, 131, 444, ! 411, 455, 326, 458, 718, 719, 647, 325, 648, 479, ! 343, 542, 550, 544, 325, 546, 689, 0, 0, 0, ! 548, 325, 0, 325, 0, 39, 325, 555, 325, 0, ! 325, 82, 326, 0, 0, 326, 327, 0, 0, 327, ! 126, 0, 40, 0, 0, 330, 0, 328, 41, 342, ! 328, 194, 330, 326, 0, 326, 0, 0, 326, 0, ! 330, 0, 330, 84, 0, 330, 85, 24, 0, 0, ! 0, 327, 326, 327, 0, 0, 0, 0, 0, 0, ! 0, 0, 328, 0, 328, 0, 326, 0, 0, 0, ! 0, 0, 0, 326, 196, 197, 0, 0, 0, 82, ! 326, 0, 326, 0, 0, 326, 0, 326, 198, 326, ! 0, 0, 327, 0, 199, 0, 327, 0, 0, 0, ! 0, 200, 0, 328, 0, 201, 329, 328, 0, 329, ! 0, 84, 0, 0, 85, 24, 0, 327, 202, 203, ! 0, 0, 204, 0, 0, 327, 0, 0, 328, 0, ! 0, 206, 207, 208, 209, 0, 328, 210, 211, 0, ! 0, 329, 330, 329, 339, 339, 339, 339, 0, 0, ! 0, 0, 339, 339, 0, 327, 0, 0, 327, 0, ! 0, 0, 5, 0, 0, 0, 328, 0, 82, 328, ! 0, 0, 0, 0, 0, 0, 327, 83, 327, 7, ! 0, 327, 329, 0, 0, 8, 329, 328, 0, 328, ! 0, 0, 328, 0, 0, 327, 0, 0, 0, 0, ! 84, 0, 0, 85, 24, 0, 328, 329, 0, 327, ! 0, 0, 0, 157, 158, 329, 327, 10, 0, 0, ! 328, 0, 0, 327, 0, 327, 0, 328, 327, 0, ! 327, 0, 327, 0, 328, 0, 328, 0, 0, 328, ! 5, 328, 0, 328, 0, 329, 82, 0, 329, 0, ! 0, 0, 0, 0, 0, 83, 0, 7, 0, 0, ! 0, 0, 0, 8, 0, 0, 329, 0, 329, 0, ! 0, 329, 0, 0, 0, 0, 0, 0, 84, 0, ! 0, 85, 24, 0, 0, 329, 0, 0, 0, 0, ! 330, 157, 263, 330, 0, 10, 0, 0, 0, 329, ! 0, 0, 0, 0, 0, 0, 329, 0, 0, 0, ! 581, 0, 0, 329, 0, 329, 0, 0, 329, 0, ! 329, 0, 329, 0, 0, 330, 0, 330, 0, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, ! 339, 0, 339, 339, 339, 339, 339, 339, 339, 340, ! 340, 340, 340, 0, -287, -287, -287, 340, 340, 0, ! -287, 0, 0, 0, 0, 0, 330, 0, 0, -287, ! 330, 193, 0, 194, 195, -287, 0, 0, 0, 0, ! 0, 0, -287, 0, 0, 0, -287, 0, 0, 0, ! 0, 330, -287, 0, 0, -287, -287, 0, 0, 330, ! 0, 0, 0, -287, 0, 0, 0, 0, 0, -287, ! 0, 0, -287, -287, -287, -287, 196, 197, -287, -287, ! 0, 82, 0, 0, 0, 0, 0, 0, 0, 330, ! 198, 0, 330, 339, 0, 0, 199, 0, 339, 0, ! 0, 0, 0, 200, 0, 0, 0, 201, 0, 0, ! 330, 0, 330, 84, 0, 330, 85, 24, 0, 0, ! 202, 203, 0, 0, 204, 0, 205, 0, 0, 330, ! 0, 5, 0, 206, 207, 208, 209, 82, 0, 210, ! 211, 0, 0, 330, 0, 0, 83, 0, 7, 0, ! 330, 0, 0, 0, 8, 0, 0, 330, 0, 330, ! 0, 0, 330, 0, 330, 0, 330, 0, 0, 84, ! 0, 0, 85, 24, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 130, 0, 270, 0, 0, 0, 0, ! 0, 0, 0, 0, 340, 340, 340, 340, 340, 340, ! 340, 340, 340, 340, 340, 340, 0, 340, 340, 340, ! 340, 340, 340, 340, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 339, 339, 0, 5, ! 196, 197, 655, 271, 272, 82, 273, 0, 0, 274, ! 0, 0, 339, 275, 198, 0, 0, 656, 0, 0, ! 276, 277, 8, 278, 0, 279, 280, 200, 281, 0, ! 270, 282, 0, 0, 0, 0, 0, 84, 0, 0, ! 85, 24, 0, 0, 0, 0, 0, 0, 283, 0, ! 157, 720, 0, 0, 10, 0, 0, 206, 207, 208, ! 209, 0, 0, 210, 211, 0, 0, 0, 340, 0, ! 0, 0, 0, 340, 5, 196, 197, 655, 271, 272, ! 82, 273, 0, 0, 274, 0, 0, 0, 275, 198, ! 0, 0, 656, 0, 0, 276, 277, 8, 278, 0, ! 279, 280, 200, 281, 270, 0, 282, 0, 0, 0, ! 0, 0, 84, 0, 0, 85, 24, 0, 0, 0, ! 0, 0, 0, 283, 0, 157, 749, 0, 0, 10, ! 0, 0, 206, 207, 208, 209, 0, 0, 210, 211, ! 0, 0, 0, 0, 0, 0, 0, 0, 5, 196, ! 197, -264, 271, 272, 82, 273, 0, 0, 274, 0, ! 0, 0, 275, 198, 0, 0, -264, 0, 0, 276, ! 277, 8, 278, 0, 279, 280, 200, 281, 270, 0, ! 282, 0, 0, 0, 0, 0, 84, 0, 0, 85, ! 24, 0, 0, 0, 0, 0, 0, 283, 0, 157, ! -264, 340, 340, 10, 0, 0, 206, 207, 208, 209, ! 0, 0, 210, 211, 0, 0, 0, 340, 0, 0, ! 0, 0, 5, 196, 197, 0, 271, 272, 82, 273, ! 0, 0, 274, 0, 0, 0, 275, 198, 0, 0, ! 0, 0, 0, 276, 277, 8, 278, 270, 279, 280, ! 200, 281, 0, 0, 282, 0, 0, 0, 0, 0, ! 84, 0, 0, 85, 24, 0, 0, 0, 0, 0, ! 0, 283, 0, 157, 443, 0, 0, 10, 0, 0, ! 206, 207, 208, 209, 0, 0, 210, 211, 0, 0, ! 0, 5, 196, 197, 0, 271, 272, 82, 273, 0, ! 0, 274, 0, 0, 0, 275, 198, 0, 0, 0, ! 0, 0, 276, 277, 8, 278, 270, 279, 280, 200, ! 281, 0, 0, 282, 0, 0, 0, 0, 0, 84, ! 0, 0, 85, 24, 0, 0, 0, 0, 0, 0, ! 283, 0, 157, 0, 0, 0, 10, 0, 0, 206, ! 207, 208, 209, 0, 0, 210, 211, 0, 0, 0, ! 5, 196, 197, 0, 271, 272, 82, 273, 0, 0, ! 274, 0, 0, 0, 275, 198, 0, 0, 0, 0, ! 0, 276, 277, 270, 278, 0, 279, 280, 200, 281, ! 0, 0, 282, 0, 0, 0, 0, 0, 84, 0, ! 0, 85, 24, 0, 0, 0, 0, 0, 0, 283, ! 0, 157, 0, 0, 0, 10, 0, 0, 206, 207, ! 208, 209, 0, 0, 210, 211, 0, 5, 196, 197, ! 0, 694, 272, 82, 273, 0, 0, 274, 0, 0, ! 0, 275, 198, 0, 422, 0, 194, 195, 276, 277, ! 0, 278, 0, 279, 280, 200, 281, 0, 0, 282, ! 0, 0, 0, 0, 0, 84, 0, 0, 85, 24, ! 0, 0, 0, 0, 0, 0, 283, 0, 157, 0, ! 0, 0, 10, 0, 0, 206, 207, 208, 209, 196, ! 197, 210, 211, 0, 82, 498, 0, 194, 195, 0, ! 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, ! 201, 0, 0, 0, 0, 0, 84, 0, 0, 85, ! 24, 0, 0, 202, 203, 0, 0, 204, 0, 0, ! 196, 197, 0, 423, 0, 82, 206, 207, 208, 209, ! 0, 0, 210, 211, 198, 0, 551, 0, 194, 195, ! 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, ! 0, 201, 0, 0, 0, 0, 0, 84, 0, 0, ! 85, 24, 0, 0, 202, 203, 0, 0, 204, 0, ! 0, 0, 0, 148, 0, 0, 0, 206, 207, 208, ! 209, 196, 197, 210, 211, 0, 82, 587, 0, 194, ! 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 200, 0, ! 0, 0, 201, 0, 0, 0, 0, 0, 84, 0, ! 0, 85, 24, 0, 552, 202, 203, 0, 0, 204, ! 0, 0, 196, 197, 0, 0, 0, 82, 206, 207, ! 208, 209, 0, 0, 210, 211, 198, 0, 595, 0, ! 194, 195, 199, 0, 0, 0, 0, 0, 0, 200, ! 0, 0, 0, 201, 0, 0, 0, 0, 0, 84, ! 0, 0, 85, 24, 0, 0, 202, 203, 0, 0, ! 204, 588, 0, 0, 0, 0, 0, 0, 0, 206, ! 207, 208, 209, 196, 197, 210, 211, 0, 82, 603, ! 0, 194, 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 200, 0, 0, 0, 201, 0, 0, 0, 0, 0, ! 84, 0, 0, 85, 24, 0, 0, 202, 203, 0, ! 0, 204, 0, 0, 196, 197, 0, 596, 0, 82, ! 206, 207, 208, 209, 0, 0, 210, 211, 198, 0, ! 610, 0, 194, 195, 199, 0, 0, 0, 0, 0, ! 0, 200, 0, 0, 0, 201, 0, 0, 0, 0, ! 0, 84, 0, 0, 85, 24, 0, 0, 202, 203, ! 0, 0, 204, 0, 0, 0, 0, 148, 0, 0, ! 0, 206, 207, 208, 209, 196, 197, 210, 211, 0, ! 82, 587, 0, 194, 195, 0, 0, 0, 0, 198, ! 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 200, 0, 0, 0, 201, 0, 0, 0, ! 0, 0, 84, 0, 0, 85, 24, 0, 0, 202, ! 203, 0, 0, 204, 611, 0, 196, 197, 0, 0, ! 0, 82, 206, 207, 208, 209, 0, 0, 210, 211, ! 198, 0, 708, 0, 194, 195, 199, 0, 0, 0, ! 0, 0, 0, 200, 0, 0, 0, 201, 0, 0, ! 0, 0, 0, 84, 0, 0, 85, 24, 0, 0, ! 202, 203, 0, 0, 204, 692, 0, 0, 0, 0, ! 0, 0, 0, 206, 207, 208, 209, 196, 197, 210, ! 211, 0, 82, 708, 0, 194, 195, 0, 0, 0, ! 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 200, 0, 0, 0, 201, 0, ! 0, 0, 0, 0, 84, 0, 0, 85, 24, 0, ! 0, 202, 203, 0, 0, 204, 709, 0, 196, 197, ! 0, 0, 0, 82, 206, 207, 208, 209, 0, 0, ! 210, 211, 198, 0, 595, 0, 194, 195, 199, 0, ! 0, 0, 0, 0, 0, 200, 0, 0, 0, 201, ! 0, 0, 0, 0, 0, 84, 0, 0, 85, 24, ! 0, 0, 202, 203, 0, 0, 204, 754, 0, 0, ! 0, 0, 0, 0, 0, 206, 207, 208, 209, 196, ! 197, 210, 211, 0, 82, 337, 0, 194, 195, 0, ! 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, ! 201, 0, 0, 0, 0, 0, 84, 0, 0, 85, ! 24, 0, 0, 202, 203, 0, 0, 204, 0, 0, ! 196, 197, 0, 759, 0, 82, 206, 207, 208, 209, ! 0, 0, 210, 211, 198, 0, 344, 0, 194, 195, ! 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, ! 0, 201, 0, 0, 0, 0, 0, 84, 0, 0, ! 85, 24, 0, 0, 202, 203, 0, 0, 204, 0, ! 0, 0, 0, 0, 0, 0, 0, 206, 207, 208, ! 209, 196, 197, 210, 211, 0, 82, 346, 0, 194, ! 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 200, 0, ! 0, 0, 201, 0, 0, 0, 0, 0, 84, 0, ! 0, 85, 24, 0, 0, 202, 203, 0, 0, 204, ! 0, 0, 196, 197, 0, 0, 0, 82, 206, 207, ! 208, 209, 0, 0, 210, 211, 198, 0, 355, 0, ! 194, 195, 199, 0, 0, 0, 0, 0, 0, 200, ! 0, 0, 0, 201, 0, 0, 0, 0, 0, 84, ! 0, 0, 85, 24, 0, 0, 202, 203, 0, 0, ! 204, 0, 0, 0, 0, 0, 0, 0, 0, 206, ! 207, 208, 209, 196, 197, 210, 211, 0, 82, 357, ! 0, 194, 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 200, 0, 0, 0, 201, 0, 0, 0, 0, 0, ! 84, 0, 0, 85, 24, 0, 0, 202, 203, 0, ! 0, 204, 0, 0, 196, 197, 0, 0, 0, 82, ! 206, 207, 208, 209, 0, 0, 210, 211, 198, 0, ! 359, 0, 194, 195, 199, 0, 0, 0, 0, 0, ! 0, 200, 0, 0, 0, 201, 0, 0, 0, 0, ! 0, 84, 0, 0, 85, 24, 0, 0, 202, 203, ! 0, 0, 204, 0, 0, 0, 0, 0, 0, 0, ! 0, 206, 207, 208, 209, 196, 197, 210, 211, 0, ! 82, 417, 0, 194, 195, 0, 0, 0, 0, 198, ! 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 200, 0, 0, 0, 201, 0, 0, 0, ! 0, 0, 84, 0, 0, 85, 24, 0, 0, 202, ! 203, 0, 0, 204, 0, 0, 196, 197, 0, 0, ! 0, 82, 206, 207, 208, 209, 0, 0, 210, 211, ! 198, 0, 506, 0, 194, 195, 199, 0, 0, 0, ! 0, 0, 0, 200, 0, 0, 0, 201, 0, 0, ! 0, 0, 0, 84, 0, 0, 85, 24, 0, 0, ! 202, 203, 0, 0, 204, 0, 0, 0, 0, 0, ! 0, 0, 0, 206, 207, 208, 209, 196, 197, 210, ! 211, 0, 82, 510, 0, 194, 195, 0, 0, 0, ! 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 200, 0, 0, 0, 201, 0, ! 0, 0, 0, 0, 84, 0, 0, 85, 24, 0, ! 0, 202, 203, 0, 0, 204, 0, 0, 196, 197, ! 0, 0, 0, 82, 206, 207, 208, 209, 0, 0, ! 210, 211, 198, 0, 512, 0, 194, 195, 199, 0, ! 0, 0, 0, 0, 0, 200, 0, 0, 0, 201, ! 0, 0, 0, 0, 0, 84, 0, 0, 85, 24, ! 0, 0, 202, 203, 0, 0, 204, 0, 0, 0, ! 0, 0, 0, 0, 0, 206, 207, 208, 209, 196, ! 197, 210, 211, 0, 82, 514, 0, 194, 195, 0, ! 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, ! 201, 0, 0, 0, 0, 0, 84, 0, 0, 85, ! 24, 0, 0, 202, 203, 0, 0, 204, 0, 0, ! 196, 197, 0, 0, 0, 82, 206, 207, 208, 209, ! 0, 0, 210, 211, 198, 0, 516, 0, 194, 195, ! 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, ! 0, 201, 0, 0, 0, 0, 0, 84, 0, 0, ! 85, 24, 0, 0, 202, 203, 0, 0, 204, 0, ! 0, 0, 0, 0, 0, 0, 0, 206, 207, 208, ! 209, 196, 197, 210, 211, 0, 82, 518, 0, 194, ! 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 200, 0, ! 0, 0, 201, 0, 0, 0, 0, 0, 84, 0, ! 0, 85, 24, 0, 0, 202, 203, 0, 0, 204, ! 0, 0, 196, 197, 0, 0, 0, 82, 206, 207, ! 208, 209, 0, 0, 210, 211, 198, 0, 520, 0, ! 194, 195, 199, 0, 0, 0, 0, 0, 0, 200, ! 0, 0, 0, 201, 0, 0, 0, 0, 0, 84, ! 0, 0, 85, 24, 0, 0, 202, 203, 0, 0, ! 204, 0, 0, 0, 0, 0, 0, 0, 0, 206, ! 207, 208, 209, 196, 197, 210, 211, 0, 82, 522, ! 0, 194, 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 200, 0, 0, 0, 201, 0, 0, 0, 0, 0, ! 84, 0, 0, 85, 24, 0, 0, 202, 203, 0, ! 0, 204, 0, 0, 196, 197, 0, 0, 0, 82, ! 206, 207, 208, 209, 0, 0, 210, 211, 198, 0, ! 524, 0, 194, 195, 199, 0, 0, 0, 0, 0, ! 0, 200, 0, 0, 0, 201, 0, 0, 0, 0, ! 0, 84, 0, 0, 85, 24, 0, 0, 202, 203, ! 0, 0, 204, 0, 0, 0, 0, 0, 0, 0, ! 0, 206, 207, 208, 209, 196, 197, 210, 211, 0, ! 82, 526, 0, 194, 195, 0, 0, 0, 0, 198, ! 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 200, 0, 0, 0, 201, 0, 0, 0, ! 0, 0, 84, 0, 0, 85, 24, 0, 0, 202, ! 203, 0, 0, 204, 0, 0, 196, 197, 0, 0, ! 0, 82, 206, 207, 208, 209, 0, 0, 210, 211, ! 198, 0, 528, 0, 194, 195, 199, 0, 0, 0, ! 0, 0, 0, 200, 0, 0, 0, 201, 0, 0, ! 0, 0, 0, 84, 0, 0, 85, 24, 0, 0, ! 202, 203, 0, 0, 204, 0, 0, 0, 0, 0, ! 0, 0, 0, 206, 207, 208, 209, 196, 197, 210, ! 211, 0, 82, 530, 0, 194, 195, 0, 0, 0, ! 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 200, 0, 0, 0, 201, 0, ! 0, 0, 0, 0, 84, 0, 0, 85, 24, 0, ! 0, 202, 203, 0, 0, 204, 0, 0, 196, 197, ! 0, 0, 0, 82, 206, 207, 208, 209, 0, 0, ! 210, 211, 198, 0, 532, 0, 194, 195, 199, 0, ! 0, 0, 0, 0, 0, 200, 0, 0, 0, 201, ! 0, 0, 0, 0, 0, 84, 0, 0, 85, 24, ! 0, 0, 202, 203, 0, 0, 204, 0, 0, 0, ! 0, 0, 0, 0, 0, 206, 207, 208, 209, 196, ! 197, 210, 211, 0, 82, 537, 0, 194, 195, 0, ! 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, ! 201, 0, 0, 0, 0, 0, 84, 0, 0, 85, ! 24, 0, 0, 202, 203, 0, 0, 204, 0, 0, ! 196, 197, 0, 0, 0, 82, 206, 207, 208, 209, ! 0, 0, 210, 211, 198, 0, 539, 0, 194, 195, ! 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, ! 0, 201, 0, 0, 0, 0, 0, 84, 0, 0, ! 85, 24, 0, 0, 202, 203, 0, 0, 204, 0, ! 0, 0, 0, 0, 0, 0, 0, 206, 207, 208, ! 209, 196, 197, 210, 211, 0, 82, 541, 0, 194, ! 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 200, 0, ! 0, 0, 201, 0, 0, 0, 0, 0, 84, 0, ! 0, 85, 24, 0, 0, 202, 203, 0, 0, 204, ! 0, 0, 196, 197, 0, 0, 0, 82, 206, 207, ! 208, 209, 0, 0, 210, 211, 198, 0, 543, 0, ! 194, 195, 199, 0, 0, 0, 0, 0, 0, 200, ! 0, 0, 0, 201, 0, 0, 0, 0, 0, 84, ! 0, 0, 85, 24, 0, 0, 202, 203, 0, 0, ! 204, 0, 0, 0, 0, 0, 0, 0, 0, 206, ! 207, 208, 209, 196, 197, 210, 211, 0, 82, 545, ! 0, 194, 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 200, 0, 0, 0, 201, 0, 0, 0, 0, 0, ! 84, 0, 0, 85, 24, 0, 0, 202, 203, 0, ! 0, 204, 0, 0, 196, 197, 0, 0, 0, 82, ! 206, 207, 208, 209, 0, 0, 210, 211, 198, 0, ! 547, 0, 194, 195, 199, 0, 0, 0, 0, 0, ! 0, 200, 0, 0, 0, 201, 0, 0, 0, 0, ! 0, 84, 0, 0, 85, 24, 0, 0, 202, 203, ! 0, 0, 204, 0, 0, 0, 0, 0, 0, 0, ! 0, 206, 207, 208, 209, 196, 197, 210, 211, 0, ! 82, 549, 0, 194, 195, 0, 0, 0, 0, 198, ! 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 200, 0, 0, 0, 201, 0, 0, 0, ! 0, 0, 84, 0, 0, 85, 24, 0, 0, 202, ! 203, 0, 0, 204, 0, 0, 196, 197, 0, 0, ! 0, 82, 206, 207, 208, 209, 0, 0, 210, 211, ! 198, 0, 554, 0, 194, 195, 199, 0, 0, 0, ! 0, 0, 0, 200, 0, 0, 0, 201, 0, 0, ! 0, 0, 0, 84, 0, 0, 85, 24, 0, 0, ! 202, 203, 0, 0, 204, 0, 0, 0, 0, 0, ! 0, 0, 0, 206, 207, 208, 209, 196, 197, 210, ! 211, 0, 82, 563, 0, 194, 195, 0, 0, 0, ! 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 200, 0, 0, 0, 201, 0, ! 0, 0, 0, 0, 84, 0, 0, 85, 24, 0, ! 0, 202, 203, 0, 0, 204, 0, 0, 196, 197, ! 0, 0, 0, 82, 206, 207, 208, 209, 0, 0, ! 210, 211, 198, 0, 571, 0, 194, 195, 199, 0, ! 0, 0, 0, 0, 0, 200, 0, 0, 0, 201, ! 0, 0, 0, 0, 0, 84, 0, 0, 85, 24, ! 0, 0, 202, 203, 0, 0, 204, 0, 0, 0, ! 0, 0, 0, 0, 0, 206, 207, 208, 209, 196, ! 197, 210, 211, 0, 82, 573, 0, 194, 195, 0, ! 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, ! 201, 0, 0, 0, 0, 0, 84, 0, 0, 85, ! 24, 0, 0, 202, 203, 0, 0, 204, 0, 0, ! 196, 197, 0, 0, 0, 82, 206, 207, 208, 209, ! 0, 0, 210, 211, 198, 0, 598, 0, 194, 195, ! 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, ! 0, 201, 0, 0, 0, 0, 0, 84, 0, 0, ! 85, 24, 0, 0, 202, 203, 0, 0, 204, 0, ! 0, 0, 0, 0, 0, 0, 0, 206, 207, 208, ! 209, 196, 197, 210, 211, 0, 82, 613, 0, 194, ! 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 200, 0, ! 0, 0, 201, 0, 0, 0, 0, 0, 84, 0, ! 0, 85, 24, 0, 0, 202, 203, 0, 0, 204, ! 0, 0, 196, 197, 0, 0, 0, 82, 206, 207, ! 208, 209, 0, 0, 210, 211, 198, 0, 678, 0, ! 194, 195, 199, 0, 0, 0, 0, 0, 0, 200, ! 0, 0, 0, 201, 0, 0, 0, 0, 0, 84, ! 0, 0, 85, 24, 0, 0, 202, 203, 0, 0, ! 204, 0, 0, 0, 0, 0, 0, 0, 0, 206, ! 207, 208, 209, 196, 197, 210, 211, 0, 82, 682, ! 0, 194, 195, 0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 200, 0, 0, 0, 201, 0, 0, 0, 0, 0, ! 84, 0, 0, 85, 24, 0, 0, 202, 203, 0, ! 0, 204, 0, 0, 196, 197, 0, 0, 0, 82, ! 206, 207, 208, 209, 0, 0, 210, 211, 198, 0, ! 688, 0, 194, 195, 199, 0, 0, 0, 0, 0, ! 0, 200, 0, 0, 0, 201, 0, 0, 0, 0, ! 0, 84, 0, 0, 85, 24, 0, 0, 202, 203, ! 0, 0, 204, 0, 0, 0, 0, 0, 0, 0, ! 0, 206, 207, 208, 209, 196, 197, 210, 211, 0, ! 82, 714, 0, 194, 195, 0, 0, 0, 0, 198, ! 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 200, 0, 0, 0, 201, 0, 0, 0, ! 0, 0, 84, 0, 0, 85, 24, 0, 0, 202, ! 203, 0, 0, 204, 0, 0, 196, 197, 0, 0, ! 0, 82, 206, 207, 208, 209, 0, 0, 210, 211, ! 198, 0, 665, 0, 0, 0, 199, 0, 0, 0, ! 0, 0, 0, 200, 0, 0, 0, 201, 0, 0, ! 0, 0, 0, 84, 0, 0, 85, 24, 0, 0, ! 202, 203, 0, 0, 204, 0, 0, 0, 0, 0, ! 0, 0, 0, 206, 207, 208, 209, 196, 197, 210, ! 211, 0, 82, 725, 0, 0, 0, 0, 0, 0, ! 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 200, 0, 0, 0, 201, 0, ! 0, 0, 0, 0, 84, 0, 0, 85, 24, 0, ! 0, 0, 0, 0, 0, 283, -295, 0, 196, 197, ! 0, 0, 0, 82, 206, 207, 208, 209, 0, 0, ! 210, 211, 198, 0, 663, 0, 0, 0, 199, 0, ! 0, 0, 0, 0, 0, 200, 0, 0, 0, 201, ! 0, 0, 0, 0, 0, 84, 0, 0, 85, 24, ! 0, 194, 195, 0, 0, 0, 283, -295, 0, 0, ! 0, 0, 0, 0, 0, 206, 207, 208, 209, 196, ! 197, 210, 211, 0, 82, 0, 0, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, ! 0, 0, 0, 0, 196, 197, 200, 0, 0, 82, ! 201, 0, 0, 0, 0, 0, 84, 0, 198, 85, ! 24, 0, 194, 195, 199, 0, 0, 283, 0, 0, ! 0, 200, 0, 0, 0, 201, 206, 207, 208, 209, ! 0, 84, 210, 211, 85, 24, 0, 0, 202, 203, ! 0, 0, 204, 0, 205, 363, 0, 0, 0, 364, ! 0, 206, 207, 208, 209, 196, 197, 210, 211, 0, ! 82, 0, 0, 194, 195, 0, 0, 0, 0, 198, ! 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 200, 0, 0, 0, 201, 0, 0, 0, ! 0, 0, 84, 0, 0, 85, 24, 0, 0, 202, ! 203, 0, 0, 204, 495, 0, 196, 197, 0, 0, ! 0, 82, 206, 207, 208, 209, 0, 0, 210, 211, ! 198, 0, 0, 0, 194, 195, 199, 0, 0, 0, ! 0, 0, 0, 200, 0, 0, 0, 201, 0, 0, ! 0, 0, 0, 84, 0, 0, 85, 24, 0, 0, ! 202, 203, 0, 0, 204, 629, 0, 0, 0, 0, ! 0, 0, 0, 206, 207, 208, 209, 196, 197, 210, ! 211, 0, 82, 0, 0, 194, 195, 0, 0, 0, ! 0, 198, 0, 0, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 200, 0, 0, 0, 201, 0, ! 0, 0, 0, 0, 84, 0, 0, 85, 24, 0, ! 0, 202, 203, 0, 0, 204, 671, 0, 196, 197, ! 0, 0, 0, 82, 206, 207, 208, 209, 0, 0, ! 210, 211, 198, 0, 0, 0, 194, 195, 199, 0, ! 0, 0, 0, 0, 0, 200, 0, 0, 0, 201, ! 0, 0, 0, 0, 0, 84, 0, 0, 85, 24, ! 0, 0, 202, 203, 0, 0, 204, 684, 0, 0, ! 0, 0, 0, 0, 0, 206, 207, 208, 209, 196, ! 197, 210, 211, 0, 82, 0, 0, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, ! 201, 0, 0, 0, 0, 0, 84, 0, 0, 85, ! 24, 0, 0, 202, 203, 0, 0, 204, 0, 5, ! 196, 197, 0, 0, 0, 82, 206, 207, 208, 209, ! 0, 0, 210, 211, 198, 0, 0, 0, 0, 0, ! 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, ! 82, 201, 0, 0, 0, 0, 0, 84, 0, 198, ! 85, 24, 0, 0, 0, 199, 0, 0, 283, 0, ! 0, 0, 200, 0, 0, 0, 201, 206, 207, 208, ! 209, 0, 84, 210, 211, 85, 24, 0, 0, 202, ! 203, 0, 0, 204, 0, 0, 0, 0, 0, 0, ! 0, 0, 206, 207, 208, 209, 0, 0, 210, 211 }; static const short yycheck[] = { ! 6, 136, 314, 9, 127, 294, 334, 66, 205, 180, ! 137, 488, 133, 301, 1, 66, 1, 175, 138, 668, ! 2, 309, 1, 311, 1, 15, 54, 1, 48, 133, ! 12, 13, 14, 0, 93, 442, 1, 1, 639, 98, ! 46, 162, 93, 63, 50, 87, 660, 98, 169, 46, ! 88, 1, 34, 50, 1, 37, 38, 69, 162, 1, ! 66, 1, 68, 121, 76, 73, 133, 73, 1, 96, ! 98, 68, 1, 55, 133, 482, 73, 97, 137, 87, ! 200, 68, 133, 144, 66, 1, 137, 93, 1, 100, ! 101, 68, 98, 151, 1, 162, 154, 698, 88, 111, ! 701, 160, 509, 162, 194, 719, 196, 197, 1, 160, ! 759, 162, 202, 203, 172, 100, 98, 102, 1, 768, ! 94, 100, 1, 102, 175, 184, 132, 133, 102, 7, ! 8, 137, 138, 184, 261, 132, 100, 102, 1, 1, ! 617, 138, 1, 204, 205, 266, 96, 89, 95, 200, ! 100, 133, 1, 204, 160, 137, 162, 1, 279, 99, ! 1, 284, 40, 41, 335, 766, 44, 100, 101, 175, ! 771, 100, 773, 1, 775, 213, 54, 93, 184, 95, ! 162, 1, 98, 99, 100, 101, 99, 1, 194, 195, ! 196, 197, 99, 175, 200, 602, 202, 203, 204, 639, ! 0, 1, 261, 200, 262, 83, 99, 334, 87, 87, ! 261, 272, 1, 1, 275, 1, 336, 100, 101, 626, ! 1, 100, 283, 1, 0, 1, 1, 1, 87, 636, ! 93, 94, 291, 95, 639, 98, 99, 100, 101, 101, ! 291, 100, 1, 294, 651, 45, 95, 285, 126, 127, ! 1, 95, 101, 411, 95, 261, 56, 101, 698, 1, ! 101, 701, 62, 314, 1, 143, 1, 53, 68, 45, ! 1, 101, 100, 562, 94, 334, 76, 1, 64, 261, ! 56, 95, 594, 334, 596, 291, 62, 101, 294, 379, ! 380, 381, 68, 698, 491, 301, 701, 175, 95, 95, ! 100, 98, 180, 309, 1, 311, 102, 95, 314, 370, ! 96, 100, 294, 374, 352, 353, 644, 1, 441, 100, ! 94, 99, 360, 361, 100, 100, 766, 734, 334, 1, ! 336, 771, 314, 773, 1, 775, 53, 12, 399, 336, ! 391, 100, 1, 100, 101, 223, 635, 1, 99, 0, ! 1, 639, 334, 1, 1, 416, 668, 1, 100, 1, ! 411, 766, 37, 100, 99, 426, 771, 428, 773, 100, ! 775, 95, 66, 379, 380, 381, 382, 383, 384, 385, ! 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, ! 396, 397, 398, 483, 45, 66, 274, 94, 459, 93, ! 461, 559, 102, 281, 98, 411, 284, 0, 1, 175, ! 698, 62, 96, 701, 475, 1, 294, 68, 46, 47, ! 98, 1, 64, 301, 96, 1, 96, 98, 95, 411, ! 491, 309, 721, 311, 1, 94, 724, 639, 476, 133, ! 87, 479, 96, 137, 0, 1, 1, 759, 96, 100, ! 738, 95, 45, 1, 96, 576, 768, 335, 579, 0, ! 1, 1, 133, 56, 752, 5, 160, 53, 162, 62, ! 98, 101, 350, 53, 102, 68, 94, 483, 766, 1, ! 175, 175, 488, 771, 64, 773, 1, 775, 64, 45, ! 184, 162, 1, 371, 629, 373, 698, 535, 98, 701, ! 56, 1, 102, 1, 45, 1, 62, 100, 559, 1, ! 96, 562, 68, 0, 1, 1, 96, 644, 93, 2, ! 96, 62, 89, 98, 99, 99, 616, 68, 294, 12, ! 13, 14, 1, 411, 95, 301, 98, 98, 1, 94, ! 675, 1, 1, 309, 100, 311, 94, 87, 314, 670, ! 1, 34, 687, 559, 37, 38, 562, 1, 45, 100, ! 438, 68, 623, 441, 766, 87, 73, 261, 95, 771, ! 175, 773, 55, 775, 101, 62, 1, 559, 87, 94, ! 562, 68, 45, 66, 635, 644, 1, 1, 1, 87, ! 0, 1, 97, 644, 94, 656, 731, 291, 94, 294, ! 294, 662, 94, 133, 94, 68, 301, 51, 94, 660, ! 616, 617, 2, 100, 309, 98, 311, 1, 87, 314, ! 314, 1, 12, 13, 14, 132, 632, 87, 87, 635, ! 160, 94, 162, 639, 1, 45, 87, 1, 644, 83, ! 334, 96, 86, 87, 34, 411, 45, 37, 38, 175, ! 133, 48, 62, 635, 660, 68, 1, 45, 68, 1, ! 73, 45, 644, 62, 77, 55, 63, 51, 719, 68, ! 721, 98, 87, 87, 87, 102, 737, 1, 660, 162, ! 741, 559, 46, 47, 562, 1, 54, 95, 1, 294, ! 100, 1, 698, 101, 1, 701, 301, 391, 1, 83, ! 97, 1, 86, 87, 309, 476, 311, 87, 479, 314, ! 101, 95, 1, 719, 1, 721, 411, 411, 724, 1, ! 87, 45, 98, 87, 66, 89, 68, 51, 92, 93, ! 94, 73, 738, 559, 98, 77, 562, 719, 102, 721, ! 94, 51, 87, 133, 98, 87, 752, 1, 102, 1, ! 96, 3, 4, 102, 100, 633, 96, 635, 98, 83, ! 766, 639, 86, 87, 12, 771, 14, 773, 294, 775, ! 102, 87, 162, 83, 87, 301, 86, 87, 11, 66, ! 87, 68, 660, 309, 87, 311, 73, 87, 314, 37, ! 77, 45, 175, 559, 46, 47, 562, 51, 87, 51, ! 87, 46, 47, 175, 95, 87, 411, 98, 60, 635, ! 478, 102, 480, 12, 66, 18, 19, 20, 21, 102, ! 698, 73, 1, 701, 13, 77, 14, 51, 594, 83, ! 596, 83, 86, 87, 86, 87, 96, 698, 90, 91, ! 701, 719, 94, 721, 96, 97, 724, 87, 92, 93, ! 13, 103, 104, 105, 106, 58, 94, 109, 110, 83, ! 738, 100, 86, 87, 559, 559, 45, 562, 562, 635, ! 95, 34, 51, 639, 752, 38, 101, 94, 46, 47, ! 100, 60, 175, 62, 95, 411, 126, 127, 766, 68, ! 101, 100, 55, 771, 660, 773, 98, 775, 68, 594, ! 95, 596, 668, 95, 83, 766, 101, 86, 87, 101, ! 771, 294, 773, 97, 775, 96, 97, 96, 301, 100, ! 97, 61, 294, 101, 101, 65, 309, 96, 311, 301, ! 98, 314, 698, 67, 102, 701, 94, 309, 94, 311, ! 635, 635, 314, 89, 639, 1, 45, 5, 6, 7, ! 644, 94, 51, 719, 559, 721, 95, 562, 724, 92, ! 93, 60, 1, 62, 94, 660, 660, 3, 4, 68, ! 87, 100, 738, 668, 95, 92, 93, 94, 8, 9, ! 10, 98, 16, 17, 83, 102, 752, 86, 87, 594, ! 95, 596, 96, 759, 387, 388, 389, 390, 97, 1, ! 766, 294, 768, 698, 45, 771, 701, 773, 301, 775, ! 51, 92, 93, 92, 93, 94, 309, 95, 311, 98, ! 96, 314, 1, 102, 719, 719, 721, 721, 411, 724, ! 635, 46, 47, 559, 639, 101, 562, 46, 47, 411, ! 392, 393, 83, 738, 57, 86, 87, 98, 99, 100, ! 92, 93, 94, 57, 95, 660, 98, 752, 98, 99, ! 102, 382, 383, 668, 759, 100, 175, 95, 594, 95, ! 596, 766, 51, 768, 1, 95, 771, 87, 773, 95, ! 775, 60, 92, 93, 94, 1, 100, 66, 98, 384, ! 385, 386, 102, 698, 73, 87, 701, 100, 77, 95, ! 92, 93, 94, 57, 83, 95, 98, 86, 87, 635, ! 102, 90, 91, 639, 719, 94, 721, 391, 411, 724, ! 14, 1, 58, 79, 103, 104, 105, 106, 160, 162, ! 109, 110, 143, 738, 660, 261, 411, 56, 98, 294, ! 268, 314, 668, 314, 658, 658, 577, 752, 577, 353, ! 195, 394, 398, 395, 759, 396, 632, -1, -1, -1, ! 397, 766, -1, 768, -1, 45, 771, 402, 773, -1, ! 775, 51, 698, -1, -1, 701, 559, -1, -1, 562, ! 60, -1, 62, -1, -1, 294, -1, 559, 68, 1, ! 562, 3, 301, 719, -1, 721, -1, -1, 724, -1, ! 309, -1, 311, 83, -1, 314, 86, 87, -1, -1, ! -1, 594, 738, 596, -1, -1, -1, -1, -1, -1, ! -1, -1, 594, -1, 596, -1, 752, -1, -1, -1, ! -1, -1, -1, 759, 46, 47, -1, -1, -1, 51, ! 766, -1, 768, -1, -1, 771, -1, 773, 60, 775, ! -1, -1, 635, -1, 66, -1, 639, -1, -1, -1, ! -1, 73, -1, 635, -1, 77, 559, 639, -1, 562, ! -1, 83, -1, -1, 86, 87, -1, 660, 90, 91, ! -1, -1, 94, -1, -1, 668, -1, -1, 660, -1, ! -1, 103, 104, 105, 106, -1, 668, 109, 110, -1, ! -1, 594, 411, 596, 194, 195, 196, 197, -1, -1, ! -1, -1, 202, 203, -1, 698, -1, -1, 701, -1, ! -1, -1, 45, -1, -1, -1, 698, -1, 51, 701, ! -1, -1, -1, -1, -1, -1, 719, 60, 721, 62, ! -1, 724, 635, -1, -1, 68, 639, 719, -1, 721, ! -1, -1, 724, -1, -1, 738, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, 738, 660, -1, 752, ! -1, -1, -1, 96, 97, 668, 759, 100, -1, -1, ! 752, -1, -1, 766, -1, 768, -1, 759, 771, -1, ! 773, -1, 775, -1, 766, -1, 768, -1, -1, 771, ! 45, 773, -1, 775, -1, 698, 51, -1, 701, -1, ! -1, -1, -1, -1, -1, 60, -1, 62, -1, -1, ! -1, -1, -1, 68, -1, -1, 719, -1, 721, -1, ! -1, 724, -1, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, 738, -1, -1, -1, -1, ! 559, 96, 97, 562, -1, 100, -1, -1, -1, 752, -1, -1, -1, -1, -1, -1, 759, -1, -1, -1, ! 1, -1, -1, 766, -1, 768, -1, -1, 771, -1, ! 773, -1, 775, -1, -1, 594, -1, 596, -1, 379, ! 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, ! 390, -1, 392, 393, 394, 395, 396, 397, 398, 194, ! 195, 196, 197, -1, 45, 46, 47, 202, 203, -1, ! 51, -1, -1, -1, -1, -1, 635, -1, -1, 60, ! 639, 1, -1, 3, 4, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, 660, 83, -1, -1, 86, 87, -1, -1, 668, ! -1, -1, -1, 94, -1, -1, -1, -1, -1, 100, ! -1, -1, 103, 104, 105, 106, 46, 47, 109, 110, ! -1, 51, -1, -1, -1, -1, -1, -1, -1, 698, ! 60, -1, 701, 483, -1, -1, 66, -1, 488, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! 719, -1, 721, 83, -1, 724, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, -1, 96, -1, -1, 738, ! -1, 45, -1, 103, 104, 105, 106, 51, -1, 109, ! 110, -1, -1, 752, -1, -1, 60, -1, 62, -1, ! 759, -1, -1, -1, 68, -1, -1, 766, -1, 768, ! -1, -1, 771, -1, 773, -1, 775, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, 97, -1, 1, -1, -1, -1, -1, ! -1, -1, -1, -1, 379, 380, 381, 382, 383, 384, ! 385, 386, 387, 388, 389, 390, -1, 392, 393, 394, ! 395, 396, 397, 398, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, -1, -1, 616, 617, -1, 45, ! 46, 47, 48, 49, 50, 51, 52, -1, -1, 55, ! -1, -1, 632, 59, 60, -1, -1, 63, -1, -1, ! 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, ! 1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, -1, -1, -1, -1, 94, -1, ! 96, 97, -1, -1, 100, -1, -1, 103, 104, 105, ! 106, -1, -1, 109, 110, -1, -1, -1, 483, -1, ! -1, -1, -1, 488, 45, 46, 47, 48, 49, 50, ! 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, ! -1, -1, 63, -1, -1, 66, 67, 68, 69, -1, ! 71, 72, 73, 74, 1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, -1, ! -1, -1, -1, 94, -1, 96, 97, -1, -1, 100, ! -1, -1, 103, 104, 105, 106, -1, -1, 109, 110, ! -1, -1, -1, -1, -1, -1, -1, -1, 45, 46, ! 47, 48, 49, 50, 51, 52, -1, -1, 55, -1, ! -1, -1, 59, 60, -1, -1, 63, -1, -1, 66, ! 67, 68, 69, -1, 71, 72, 73, 74, 1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, -1, -1, -1, -1, 94, -1, 96, ! 97, 616, 617, 100, -1, -1, 103, 104, 105, 106, ! -1, -1, 109, 110, -1, -1, -1, 632, -1, -1, ! -1, -1, 45, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, ! -1, -1, -1, 66, 67, 68, 69, 1, 71, 72, ! 73, 74, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, -1, -1, -1, ! -1, 94, -1, 96, 97, -1, -1, 100, -1, -1, ! 103, 104, 105, 106, -1, -1, 109, 110, -1, -1, ! -1, 45, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, ! -1, -1, 66, 67, 68, 69, 1, 71, 72, 73, ! 74, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, -1, -1, -1, -1, ! 94, -1, 96, -1, -1, -1, 100, -1, -1, 103, ! 104, 105, 106, -1, -1, 109, 110, -1, -1, -1, ! 45, 46, 47, -1, 49, 50, 51, 52, -1, -1, ! 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, ! -1, 66, 67, 1, 69, -1, 71, 72, 73, 74, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, -1, -1, -1, -1, 94, ! -1, 96, -1, -1, -1, 100, -1, -1, 103, 104, ! 105, 106, -1, -1, 109, 110, -1, 45, 46, 47, ! -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, ! -1, 59, 60, -1, 1, -1, 3, 4, 66, 67, ! -1, 69, -1, 71, 72, 73, 74, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, -1, -1, -1, -1, 94, -1, 96, -1, ! -1, -1, 100, -1, -1, 103, 104, 105, 106, 46, ! 47, 109, 110, -1, 51, 1, -1, 3, 4, -1, ! -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, 90, 91, -1, -1, 94, -1, -1, ! 46, 47, -1, 100, -1, 51, 103, 104, 105, 106, ! -1, -1, 109, 110, 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, 90, 91, -1, -1, 94, -1, ! -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, ! 106, 46, 47, 109, 110, -1, 51, 1, -1, 3, ! 4, -1, -1, -1, -1, 60, -1, -1, -1, -1, ! -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, 89, 90, 91, -1, -1, 94, ! -1, -1, 46, 47, -1, -1, -1, 51, 103, 104, ! 105, 106, -1, -1, 109, 110, 60, -1, 1, -1, ! 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, 90, 91, -1, -1, ! 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, ! 104, 105, 106, 46, 47, 109, 110, -1, 51, 1, ! -1, 3, 4, -1, -1, -1, -1, 60, -1, -1, ! -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, ! 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, 90, 91, -1, ! -1, 94, -1, -1, 46, 47, -1, 100, -1, 51, ! 103, 104, 105, 106, -1, -1, 109, 110, 60, -1, ! 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, -1, -1, -1, 99, -1, -1, ! -1, 103, 104, 105, 106, 46, 47, 109, 110, -1, ! 51, 1, -1, 3, 4, -1, -1, -1, -1, 60, ! -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, 95, -1, 46, 47, -1, -1, ! -1, 51, 103, 104, 105, 106, -1, -1, 109, 110, ! 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, 95, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, 46, 47, 109, ! 110, -1, 51, 1, -1, 3, 4, -1, -1, -1, ! -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, ! -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, 90, 91, -1, -1, 94, 95, -1, 46, 47, ! -1, -1, -1, 51, 103, 104, 105, 106, -1, -1, ! 109, 110, 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, 90, 91, -1, -1, 94, 95, -1, -1, ! -1, -1, -1, -1, -1, 103, 104, 105, 106, 46, ! 47, 109, 110, -1, 51, 1, -1, 3, 4, -1, ! -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, 90, 91, -1, -1, 94, -1, -1, ! 46, 47, -1, 100, -1, 51, 103, 104, 105, 106, ! -1, -1, 109, 110, 60, -1, 1, -1, 3, 4, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, 90, 91, -1, -1, 94, -1, ! -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, ! 106, 46, 47, 109, 110, -1, 51, 1, -1, 3, ! 4, -1, -1, -1, -1, 60, -1, -1, -1, -1, ! -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, 90, 91, -1, -1, 94, ! -1, -1, 46, 47, -1, -1, -1, 51, 103, 104, ! 105, 106, -1, -1, 109, 110, 60, -1, 1, -1, ! 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, 90, 91, -1, -1, ! 94, -1, -1, -1, -1, -1, -1, -1, -1, 103, ! 104, 105, 106, 46, 47, 109, 110, -1, 51, 1, ! -1, 3, 4, -1, -1, -1, -1, 60, -1, -1, ! -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, ! 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, 90, 91, -1, ! -1, 94, -1, -1, 46, 47, -1, -1, -1, 51, ! 103, 104, 105, 106, -1, -1, 109, 110, 60, -1, ! 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, ! -1, 103, 104, 105, 106, 46, 47, 109, 110, -1, ! 51, 1, -1, 3, 4, -1, -1, -1, -1, 60, ! -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, -1, -1, 46, 47, -1, -1, ! -1, 51, 103, 104, 105, 106, -1, -1, 109, 110, ! 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, -1, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, 46, 47, 109, ! 110, -1, 51, 1, -1, 3, 4, -1, -1, -1, ! -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, ! -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, 90, 91, -1, -1, 94, -1, -1, 46, 47, ! -1, -1, -1, 51, 103, 104, 105, 106, -1, -1, ! 109, 110, 60, -1, 1, -1, 3, 4, 66, -1, ! -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, 90, 91, -1, -1, 94, -1, -1, -1, ! -1, -1, -1, -1, -1, 103, 104, 105, 106, 46, ! 47, 109, 110, -1, 51, 1, -1, 3, 4, -1, ! -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, 90, 91, -1, -1, 94, -1, -1, ! 46, 47, -1, -1, -1, 51, 103, 104, 105, 106, ! -1, -1, 109, 110, 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, 90, 91, -1, -1, 94, -1, ! -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, ! 106, 46, 47, 109, 110, -1, 51, 1, -1, 3, ! 4, -1, -1, -1, -1, 60, -1, -1, -1, -1, ! -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, 90, 91, -1, -1, 94, ! -1, -1, 46, 47, -1, -1, -1, 51, 103, 104, ! 105, 106, -1, -1, 109, 110, 60, -1, 1, -1, ! 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, 90, 91, -1, -1, ! 94, -1, -1, -1, -1, -1, -1, -1, -1, 103, ! 104, 105, 106, 46, 47, 109, 110, -1, 51, 1, ! -1, 3, 4, -1, -1, -1, -1, 60, -1, -1, ! -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, ! 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, 90, 91, -1, ! -1, 94, -1, -1, 46, 47, -1, -1, -1, 51, ! 103, 104, 105, 106, -1, -1, 109, 110, 60, -1, ! 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, ! -1, 103, 104, 105, 106, 46, 47, 109, 110, -1, ! 51, 1, -1, 3, 4, -1, -1, -1, -1, 60, ! -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, -1, -1, 46, 47, -1, -1, ! -1, 51, 103, 104, 105, 106, -1, -1, 109, 110, ! 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, -1, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, 46, 47, 109, ! 110, -1, 51, 1, -1, 3, 4, -1, -1, -1, ! -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, ! -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, 90, 91, -1, -1, 94, -1, -1, 46, 47, ! -1, -1, -1, 51, 103, 104, 105, 106, -1, -1, ! 109, 110, 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, 90, 91, -1, -1, 94, -1, -1, -1, ! -1, -1, -1, -1, -1, 103, 104, 105, 106, 46, ! 47, 109, 110, -1, 51, 1, -1, 3, 4, -1, ! -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, 90, 91, -1, -1, 94, -1, -1, ! 46, 47, -1, -1, -1, 51, 103, 104, 105, 106, ! -1, -1, 109, 110, 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, 90, 91, -1, -1, 94, -1, ! -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, ! 106, 46, 47, 109, 110, -1, 51, 1, -1, 3, ! 4, -1, -1, -1, -1, 60, -1, -1, -1, -1, ! -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, 90, 91, -1, -1, 94, ! -1, -1, 46, 47, -1, -1, -1, 51, 103, 104, ! 105, 106, -1, -1, 109, 110, 60, -1, 1, -1, ! 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, 90, 91, -1, -1, ! 94, -1, -1, -1, -1, -1, -1, -1, -1, 103, ! 104, 105, 106, 46, 47, 109, 110, -1, 51, 1, ! -1, 3, 4, -1, -1, -1, -1, 60, -1, -1, ! -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, ! 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, 90, 91, -1, ! -1, 94, -1, -1, 46, 47, -1, -1, -1, 51, ! 103, 104, 105, 106, -1, -1, 109, 110, 60, -1, ! 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, ! -1, 103, 104, 105, 106, 46, 47, 109, 110, -1, ! 51, 1, -1, 3, 4, -1, -1, -1, -1, 60, ! -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, -1, -1, 46, 47, -1, -1, ! -1, 51, 103, 104, 105, 106, -1, -1, 109, 110, ! 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, -1, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, 46, 47, 109, ! 110, -1, 51, 1, -1, 3, 4, -1, -1, -1, ! -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, ! -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, 90, 91, -1, -1, 94, -1, -1, 46, 47, ! -1, -1, -1, 51, 103, 104, 105, 106, -1, -1, ! 109, 110, 60, -1, 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, 90, 91, -1, -1, 94, -1, -1, -1, ! -1, -1, -1, -1, -1, 103, 104, 105, 106, 46, ! 47, 109, 110, -1, 51, 1, -1, 3, 4, -1, ! -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, 90, 91, -1, -1, 94, -1, -1, ! 46, 47, -1, -1, -1, 51, 103, 104, 105, 106, ! -1, -1, 109, 110, 60, -1, 1, -1, 3, 4, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, 90, 91, -1, -1, 94, -1, ! -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, ! 106, 46, 47, 109, 110, -1, 51, 1, -1, 3, ! 4, -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, 90, 91, -1, -1, 94, ! -1, -1, 46, 47, -1, -1, -1, 51, 103, 104, ! 105, 106, -1, -1, 109, 110, 60, -1, 1, -1, ! 3, 4, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, 90, 91, -1, -1, ! 94, -1, -1, -1, -1, -1, -1, -1, -1, 103, ! 104, 105, 106, 46, 47, 109, 110, -1, 51, 1, ! -1, 3, 4, -1, -1, -1, -1, 60, -1, -1, ! -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, 90, 91, -1, ! -1, 94, -1, -1, 46, 47, -1, -1, -1, 51, ! 103, 104, 105, 106, -1, -1, 109, 110, 60, -1, ! 1, -1, 3, 4, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, ! -1, 103, 104, 105, 106, 46, 47, 109, 110, -1, ! 51, 1, -1, 3, 4, -1, -1, -1, -1, 60, ! -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, -1, -1, 46, 47, -1, -1, ! -1, 51, 103, 104, 105, 106, -1, -1, 109, 110, ! 60, -1, 1, -1, -1, -1, 66, -1, -1, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, -1, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, 46, 47, 109, ! 110, -1, 51, 1, -1, -1, -1, -1, -1, -1, ! -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, ! -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, -1, -1, -1, -1, 94, 95, -1, 46, 47, ! -1, -1, -1, 51, 103, 104, 105, 106, -1, -1, ! 109, 110, 60, -1, 1, -1, -1, -1, 66, -1, ! -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, 3, 4, -1, -1, -1, 94, 95, -1, -1, ! -1, -1, -1, -1, -1, 103, 104, 105, 106, 46, ! 47, 109, 110, -1, 51, -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, 46, 47, 73, -1, -1, 51, ! 77, -1, -1, -1, -1, -1, 83, -1, 60, 86, ! 87, -1, 3, 4, 66, -1, -1, 94, -1, -1, ! -1, 73, -1, -1, -1, 77, 103, 104, 105, 106, ! -1, 83, 109, 110, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, 96, 97, -1, -1, -1, 101, ! -1, 103, 104, 105, 106, 46, 47, 109, 110, -1, ! 51, -1, -1, 3, 4, -1, -1, -1, -1, 60, ! -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, 95, -1, 46, 47, -1, -1, ! -1, 51, 103, 104, 105, 106, -1, -1, 109, 110, ! 60, -1, -1, -1, 3, 4, 66, -1, -1, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, 95, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, 46, 47, 109, ! 110, -1, 51, -1, -1, 3, 4, -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, 90, 91, -1, -1, 94, 95, -1, 46, 47, ! -1, -1, -1, 51, 103, 104, 105, 106, -1, -1, ! 109, 110, 60, -1, -1, -1, 3, 4, 66, -1, ! -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, 90, 91, -1, -1, 94, 95, -1, -1, ! -1, -1, -1, -1, -1, 103, 104, 105, 106, 46, ! 47, 109, 110, -1, 51, -1, -1, -1, -1, -1, ! -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, 90, 91, -1, -1, 94, -1, 45, ! 46, 47, -1, -1, -1, 51, 103, 104, 105, 106, ! -1, -1, 109, 110, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! 51, 77, -1, -1, -1, -1, -1, 83, -1, 60, ! 86, 87, -1, -1, -1, 66, -1, -1, 94, -1, ! -1, -1, 73, -1, -1, -1, 77, 103, 104, 105, ! 106, -1, 83, 109, 110, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, -1, -1, -1, -1, -1, -1, ! -1, -1, 103, 104, 105, 106, -1, -1, 109, 110 }; ! /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing ! symbol of state STATE-NUM. */ ! static const unsigned short yystos[] = { ! 0, 112, 113, 0, 1, 45, 56, 62, 68, 76, ! 100, 126, 127, 128, 129, 130, 131, 132, 133, 134, ! 135, 170, 193, 1, 87, 122, 123, 124, 125, 125, ! 1, 125, 1, 122, 128, 130, 133, 127, 128, 45, ! 62, 68, 1, 100, 102, 1, 64, 171, 175, 1, ! 64, 138, 1, 100, 102, 128, 125, 1, 125, 1, ! 5, 125, 1, 118, 120, 122, 96, 176, 101, 173, ! 1, 118, 119, 53, 139, 1, 172, 175, 1, 138, ! 1, 100, 51, 60, 83, 86, 97, 115, 116, 117, ! 118, 121, 122, 134, 135, 145, 152, 170, 177, 178, ! 179, 180, 1, 120, 176, 1, 1, 120, 140, 137, ! 176, 174, 139, 1, 125, 153, 1, 125, 146, 147, ! 148, 153, 98, 245, 245, 1, 60, 115, 1, 100, ! 97, 178, 101, 96, 141, 176, 136, 94, 54, 98, ! 157, 1, 100, 101, 93, 98, 99, 157, 99, 98, ! 1, 153, 1, 146, 153, 1, 120, 96, 97, 123, ! 134, 135, 142, 143, 144, 145, 150, 152, 160, 161, ! 162, 164, 165, 170, 183, 184, 193, 141, 1, 95, ! 115, 134, 154, 155, 156, 1, 119, 158, 1, 99, ! 1, 125, 147, 1, 3, 4, 46, 47, 60, 66, ! 73, 77, 90, 91, 94, 96, 103, 104, 105, 106, ! 109, 110, 114, 116, 121, 122, 149, 181, 233, 234, ! 235, 236, 237, 240, 242, 246, 247, 248, 249, 250, ! 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, ! 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, ! 271, 273, 1, 99, 1, 1, 99, 157, 100, 157, ! 97, 94, 165, 97, 143, 1, 151, 183, 163, 157, ! 1, 49, 50, 52, 55, 59, 66, 67, 69, 71, ! 72, 74, 77, 94, 115, 116, 121, 122, 125, 134, ! 135, 156, 169, 183, 186, 187, 188, 189, 190, 192, ! 193, 194, 195, 197, 198, 199, 200, 202, 204, 210, ! 211, 213, 214, 215, 217, 218, 222, 223, 224, 225, ! 226, 227, 228, 236, 247, 249, 250, 251, 254, 255, ! 270, 1, 148, 95, 101, 115, 101, 1, 122, 246, ! 248, 253, 1, 252, 1, 253, 1, 253, 102, 1, ! 102, 1, 116, 118, 119, 1, 253, 1, 253, 1, ! 116, 122, 273, 97, 101, 149, 182, 102, 102, 94, ! 98, 102, 1, 102, 98, 1, 125, 46, 47, 5, ! 6, 7, 3, 4, 8, 9, 10, 18, 19, 20, ! 21, 58, 16, 17, 11, 12, 13, 14, 15, 88, ! 92, 93, 272, 95, 154, 157, 100, 159, 183, 96, ! 166, 184, 96, 97, 100, 1, 94, 1, 273, 1, ! 100, 125, 1, 100, 273, 1, 94, 1, 94, 1, ! 183, 1, 94, 1, 100, 125, 273, 146, 102, 1, ! 89, 115, 94, 97, 185, 187, 100, 122, 134, 190, ! 100, 203, 190, 190, 122, 189, 198, 219, 221, 100, ! 1, 94, 1, 155, 1, 148, 1, 119, 1, 68, ! 1, 125, 98, 99, 100, 98, 243, 244, 245, 243, ! 245, 1, 94, 95, 98, 245, 245, 1, 95, 97, ! 97, 101, 1, 68, 68, 95, 241, 273, 1, 273, ! 1, 68, 73, 77, 73, 125, 1, 273, 1, 94, ! 1, 253, 1, 253, 1, 253, 1, 258, 1, 258, ! 1, 259, 1, 259, 1, 259, 1, 260, 1, 260, ! 1, 260, 1, 260, 1, 116, 117, 1, 261, 1, ! 261, 1, 262, 1, 263, 1, 264, 1, 265, 1, ! 266, 1, 89, 273, 1, 269, 95, 122, 167, 168, ! 169, 185, 186, 1, 273, 1, 100, 1, 100, 1, ! 100, 1, 273, 1, 273, 61, 65, 229, 230, 231, ! 232, 1, 1, 100, 95, 66, 146, 1, 95, 241, ! 96, 205, 67, 1, 101, 1, 100, 273, 1, 273, ! 95, 102, 94, 1, 273, 244, 245, 181, 245, 181, ! 1, 95, 241, 1, 253, 1, 95, 95, 256, 1, ! 97, 149, 95, 101, 1, 99, 94, 1, 99, 95, ! 241, 1, 89, 102, 167, 186, 94, 167, 1, 95, ! 1, 95, 95, 1, 94, 1, 183, 230, 232, 183, ! 1, 94, 1, 1, 95, 48, 63, 97, 206, 207, ! 208, 209, 94, 1, 198, 1, 220, 221, 100, 95, ! 95, 95, 241, 1, 99, 239, 1, 95, 1, 253, ! 1, 256, 1, 273, 95, 241, 141, 95, 1, 268, ! 66, 167, 95, 241, 49, 190, 191, 192, 194, 196, ! 201, 210, 212, 216, 218, 1, 1, 155, 1, 95, ! 241, 1, 1, 89, 1, 273, 274, 97, 207, 208, ! 97, 186, 209, 273, 95, 1, 220, 1, 183, 95, ! 141, 238, 95, 141, 94, 100, 95, 94, 57, 191, ! 191, 100, 95, 95, 1, 1, 95, 1, 89, 97, ! 95, 190, 95, 141, 95, 241, 100, 273, 190, 100, ! 273, 1, 100, 190, 100, 95, 95, 220, 100, 100, ! 191, 95, 220, 57, 191, 95, 191, 191 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif --- 1059,2599 ---- 7, 6, 3, 5, 4, 7, 6, 2, 2, 3, 2, 0, 1, 1, 2, 0, 1, 1, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, ! 2, 3, 3, 2, 3, 5, 3, 2, 3, 5, ! 5, 2, 4, 3, 1, 3, 3, 4, 2, 1, ! 2, 2, 4, 2, 3, 4, 2, 2, 1, 1, ! 1, 1, 3, 1, 1, 1, 1, 1, 3, 3, ! 3, 3, 3, 3, 3, 3, 3, 5, 4, 1, ! 4, 5, 5, 6, 3, 3, 4, 5, 2, 3, ! 0, 7, 0, 6, 3, 3, 1, 3, 3, 3, ! 3, 4, 4, 4, 4, 3, 3, 1, 2, 3, ! 3, 2, 2, 3, 3, 3, 3, 2, 3, 4, ! 5, 6, 5, 6, 4, 4, 4, 4, 3, 4, ! 3, 4, 1, 1, 1, 1, 2, 2, 1, 1, ! 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, ! 1, 2, 2, 1, 2, 2, 5, 4, 4, 5, ! 4, 2, 5, 4, 5, 1, 3, 3, 3, 3, ! 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, ! 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, ! 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, ! 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, ! 3, 3, 1, 3, 3, 1, 5, 4, 3, 5, ! 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, ! 1 }; ! /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE ! doesn't specify something else to do. Zero means the default is an ! error. */ ! static const short yydefact[] = { ! 1, 0, 52, 53, 0, 0, 0, 0, 221, 2, ! 0, 0, 0, 34, 41, 42, 36, 0, 49, 50, ! 51, 44, 25, 0, 21, 22, 23, 0, 60, 0, ! 39, 0, 0, 35, 37, 0, 0, 54, 0, 0, ! 45, 43, 0, 162, 0, 0, 158, 61, 0, 67, ! 40, 38, 0, 0, 0, 59, 0, 47, 0, 24, ! 166, 18, 164, 16, 0, 155, 0, 0, 66, 17, ! 0, 0, 57, 163, 0, 160, 62, 67, 48, 46, ! 13, 0, 11, 12, 168, 0, 9, 10, 14, 15, ! 16, 0, 174, 176, 0, 175, 0, 170, 172, 173, ! 167, 165, 159, 65, 69, 70, 68, 0, 157, 0, ! 55, 111, 0, 127, 109, 0, 0, 88, 91, 127, ! 0, 19, 20, 113, 0, 0, 178, 177, 169, 171, ! 0, 0, 58, 161, 0, 0, 0, 0, 106, 97, ! 86, 0, 0, 0, 0, 105, 392, 0, 112, 127, ! 110, 0, 127, 72, 71, 188, 73, 21, 0, 83, ! 0, 75, 77, 81, 82, 0, 78, 0, 79, 137, ! 127, 84, 80, 0, 85, 56, 117, 114, 0, 126, ! 0, 119, 0, 129, 130, 128, 118, 116, 90, 0, ! 89, 93, 0, 0, 0, 0, 0, 0, 0, 341, ! 0, 0, 0, 0, 7, 6, 3, 4, 5, 8, ! 340, 0, 0, 413, 0, 101, 412, 338, 347, 343, ! 359, 0, 339, 344, 345, 346, 430, 414, 415, 423, ! 445, 418, 419, 421, 433, 452, 457, 464, 475, 480, ! 483, 486, 489, 492, 495, 500, 509, 501, 0, 100, ! 98, 96, 99, 394, 393, 108, 87, 107, 186, 0, ! 127, 74, 76, 104, 0, 135, 0, 139, 0, 0, ! 0, 278, 0, 0, 0, 0, 0, 0, 0, 0, ! 341, 0, 0, 0, 9, 15, 413, 0, 126, 194, ! 0, 0, 209, 0, 190, 192, 0, 193, 198, 210, ! 0, 199, 211, 0, 200, 201, 212, 252, 0, 202, ! 0, 213, 203, 291, 0, 214, 215, 216, 218, 220, ! 217, 0, 219, 245, 244, 0, 242, 243, 240, 241, ! 239, 124, 122, 115, 0, 0, 0, 422, 413, 344, ! 346, 420, 425, 424, 429, 428, 427, 426, 0, 397, ! 0, 0, 0, 17, 0, 434, 431, 435, 432, 441, ! 0, 413, 0, 179, 0, 183, 0, 0, 0, 0, ! 0, 0, 94, 0, 0, 368, 0, 417, 416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 507, 508, 0, 141, 0, 140, 134, 103, 133, 188, ! 138, 0, 228, 229, 227, 247, 0, 313, 0, 302, ! 300, 0, 310, 308, 0, 274, 0, 255, 0, 328, ! 0, 288, 0, 306, 304, 0, 317, 0, 0, 196, ! 0, 224, 222, 0, 0, 189, 187, 191, 195, 413, ! 324, 223, 226, 0, 273, 0, 413, 293, 297, 290, ! 0, 0, 321, 0, 121, 120, 125, 123, 132, 131, ! 352, 356, 0, 396, 386, 385, 364, 0, 379, 387, ! 0, 380, 0, 365, 0, 0, 0, 19, 20, 349, ! 342, 180, 181, 0, 351, 355, 354, 398, 0, 376, ! 408, 0, 350, 353, 374, 348, 375, 395, 410, 0, ! 369, 0, 449, 446, 450, 447, 451, 448, 455, 453, ! 456, 454, 461, 458, 462, 459, 463, 460, 471, 466, ! 473, 468, 470, 465, 472, 467, 474, 0, 469, 478, ! 476, 479, 477, 482, 481, 485, 484, 488, 487, 491, ! 490, 494, 493, 498, 0, 0, 503, 502, 142, 413, ! 143, 0, 0, 147, 0, 248, 0, 314, 312, 303, ! 301, 311, 309, 275, 0, 256, 0, 0, 0, 325, ! 329, 0, 326, 289, 307, 305, 318, 0, 316, 342, ! 0, 197, 230, 0, 0, 0, 253, 0, 294, 0, ! 282, 0, 0, 323, 0, 404, 405, 0, 391, 0, ! 388, 381, 384, 382, 383, 366, 358, 0, 443, 437, ! 440, 0, 0, 438, 185, 182, 184, 399, 0, 409, ! 406, 0, 411, 407, 360, 0, 497, 0, 0, 144, ! 0, 0, 145, 249, 0, 276, 272, 0, 333, 0, ! 337, 336, 330, 327, 331, 0, 234, 0, 231, 232, ! 0, 0, 0, 258, 0, 262, 0, 265, 0, 299, ! 298, 284, 0, 296, 0, 322, 0, 402, 0, 390, ! 389, 0, 367, 357, 442, 436, 444, 439, 378, 377, ! 400, 0, 361, 362, 499, 496, 0, 146, 0, 0, ! 0, 246, 0, 198, 0, 205, 206, 0, 207, 208, ! 0, 257, 334, 0, 315, 235, 0, 0, 233, 271, ! 268, 269, 510, 0, 260, 263, 0, 259, 0, 266, ! 0, 0, 283, 0, 320, 319, 403, 373, 0, 401, ! 363, 0, 148, 0, 0, 0, 225, 277, 0, 335, ! 332, 238, 236, 0, 270, 267, 261, 0, 281, 0, ! 371, 0, 0, 149, 0, 250, 0, 0, 237, 279, ! 280, 151, 0, 0, 0, 0, 150, 0, 0, 0, ! 0, 286, 0, 251, 285, 0, 0, 0 }; static const short yydefgoto[] = { ! 785, 1, 210, 283, 211, 87, 88, 70, 62, 212, ! 213, 24, 25, 26, 9, 10, 11, 12, 13, 14, ! 15, 16, 450, 289, 134, 107, 49, 72, 106, 132, ! 160, 161, 162, 93, 116, 117, 118, 214, 164, 264, ! 94, 113, 180, 181, 290, 138, 185, 407, 166, 167, ! 168, 266, 169, 170, 410, 560, 561, 291, 19, 45, ! 74, 67, 109, 46, 65, 96, 97, 98, 99, 215, ! 366, 292, 173, 563, 728, 294, 295, 296, 297, 702, ! 298, 299, 300, 301, 705, 302, 303, 304, 305, 706, ! 306, 453, 307, 596, 664, 665, 666, 667, 308, 309, ! 708, 310, 311, 312, 709, 313, 314, 459, 672, 673, ! 315, 316, 317, 318, 319, 320, 321, 322, 579, 580, ! 581, 582, 216, 217, 218, 219, 220, 738, 681, 221, ! 498, 222, 478, 479, 122, 223, 224, 225, 226, 227, ! 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, ! 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, ! 248, 402, 499, 723 }; static const short yypact[] = { ! -32768, 421,-32768,-32768, 525, -19, 526, 532,-32768,-32768, ! 472, 401, 605,-32768,-32768,-32768,-32768, 473,-32768,-32768, ! -32768,-32768,-32768, 22,-32768,-32768,-32768, 309,-32768, 479, ! -32768, 40, 681,-32768,-32768, 629, 683,-32768, -19, 553, ! -32768,-32768, 570,-32768, 576, -9, -1,-32768, 607, 53, ! -32768,-32768, -19, 692, 334,-32768, 510,-32768, 44,-32768, ! -32768,-32768,-32768, 143, 1008,-32768, 611, -9,-32768,-32768, ! 58, 633,-32768,-32768, -9, -1,-32768, 53,-32768,-32768, ! -32768, 662,-32768,-32768,-32768, 677, -6,-32768,-32768,-32768, ! 134, 1155,-32768,-32768, 71,-32768, 1370,-32768,-32768,-32768, ! -32768,-32768,-32768,-32768,-32768,-32768, 205, 263,-32768, -9, ! -32768,-32768, 340, -5,-32768, 239, 326,-32768, 658, -5, ! 303, 344, 344,-32768, 679, 689,-32768,-32768,-32768,-32768, ! 695, 1201,-32768,-32768, 263, 887, 706, 12,-32768,-32768, ! -32768, 711, 1293, 38, 464,-32768,-32768, 60,-32768, -5, ! -32768, 757, -5,-32768,-32768, 390,-32768, 418, 765,-32768, ! 1264,-32768,-32768,-32768,-32768, 47,-32768, 426,-32768,-32768, ! 442,-32768,-32768, 2020,-32768,-32768,-32768,-32768, 714, 533, ! -17,-32768, 954,-32768,-32768, 495,-32768,-32768,-32768, 160, ! -32768,-32768, 2824, 5062, 2876, 2942, 499, 25, 626,-32768, ! 2994, 3060, 3112, 5259,-32768,-32768,-32768,-32768,-32768,-32768, ! -32768, 200, 534, 962, 28,-32768, 556, 580,-32768,-32768, ! -32768, 716,-32768, 791,-32768, 796, 850,-32768,-32768,-32768, ! -32768,-32768,-32768,-32768,-32768, 1020, 930, 1026, 932, 931, ! 687, 707, 743, 733, 15,-32768,-32768,-32768, 892,-32768, ! -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 820, ! 442,-32768,-32768,-32768, 378,-32768, 665,-32768, 875, 185, ! 3178,-32768, 33, 1518, 56, 242, 266, 67, 366, 180, ! 669, 3230, 5561, -19, 200, 534, 905, 492, 414,-32768, ! 954, 673,-32768, 1951,-32768,-32768, 672,-32768,-32768,-32768, ! 2089,-32768,-32768, 710,-32768,-32768,-32768,-32768, 2089,-32768, ! 2089,-32768,-32768, 5613, 719,-32768,-32768,-32768,-32768,-32768, ! -32768, 404,-32768, 725, 795, 850, 960, 1005,-32768,-32768, ! -32768,-32768, 972,-32768, 873, 724, 731,-32768, 784,-32768, ! -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 31,-32768, ! 734, 1003, 691, 691, 413,-32768,-32768,-32768,-32768,-32768, ! 747, 962, 300,-32768, 688,-32768, 517, 41, 735, 5325, ! 2234, 515,-32768, -10, 3296,-32768, 424,-32768,-32768, 3348, ! 3414, 3466, 3532, 3584, 3650, 3702, 3768, 3820, 3886, 3938, ! 4004, 708, 4056, 4122, 4174, 4240, 4292, 4358, 4410, 2286, ! -32768,-32768, 4476,-32768, 188,-32768,-32768,-32768,-32768,-32768, ! -32768, 1951,-32768,-32768,-32768,-32768, 4528,-32768, 73,-32768, ! -32768, 81,-32768,-32768, 83,-32768, 4594,-32768, 4646,-32768, ! 574,-32768, 5114,-32768,-32768, 123,-32768, 102, 348, 686, ! 555,-32768,-32768, -19, 2352,-32768,-32768,-32768,-32768, 1076, ! 533,-32768,-32768, 712,-32768, 750, 951,-32768,-32768,-32768, ! 51, 2404,-32768, 4712,-32768,-32768,-32768, 972,-32768,-32768, ! -32768,-32768, -23, 728,-32768,-32768,-32768, 2470, 691,-32768, ! 126, 691, 126,-32768, 2522, 4764, 95, 192, 468,-32768, ! 5638,-32768,-32768, 1028,-32768,-32768,-32768,-32768, 272,-32768, ! -32768, 231,-32768,-32768,-32768,-32768,-32768, 736,-32768, 243, ! -32768, 5377,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1020, ! -32768, 1020,-32768, 930,-32768, 930,-32768, 930,-32768, 1026, ! -32768, 1026,-32768, 1026,-32768, 1026,-32768, -6,-32768,-32768, ! 932,-32768, 932,-32768, 931,-32768, 687,-32768, 707,-32768, ! 743,-32768, 733,-32768, 825, 739,-32768,-32768,-32768, 1064, ! -32768, 1951, 744,-32768, 1951,-32768, 354,-32768,-32768,-32768, ! -32768,-32768,-32768,-32768, 358,-32768, 748, 425, 116, 574, ! -32768, 426,-32768,-32768,-32768,-32768,-32768, 5561,-32768,-32768, ! 477, 686,-32768, 855, 69, 360,-32768, 768,-32768, 5207, ! -32768, 5139, 781, 803, 805,-32768,-32768, 5443,-32768, 257, ! -32768, 344,-32768, 344,-32768,-32768, 818, 227,-32768,-32768, ! -32768, 4830, 565,-32768,-32768,-32768,-32768,-32768, 4882,-32768, ! -32768, 5495,-32768,-32768, 263, 316,-32768, 4948, 578,-32768, ! 1951, 2588,-32768,-32768, 2156,-32768,-32768, 268,-32768, 904, ! -32768,-32768,-32768,-32768,-32768, 816,-32768, 2640,-32768,-32768, ! 925, 256, 5000,-32768, 389,-32768, 1696,-32768, 5561,-32768, ! -32768,-32768, 832, 829, 5182,-32768, 269,-32768, 446,-32768, ! -32768, 263,-32768, 839,-32768,-32768,-32768,-32768,-32768,-32768, ! -32768, 459,-32768, 263,-32768,-32768, 503,-32768, 201, 240, ! 509,-32768, 885, 888, 2156,-32768,-32768, 2156,-32768,-32768, ! 853,-32768, 860, 863,-32768,-32768, 965, 251,-32768,-32768, ! -32768,-32768,-32768, 410,-32768,-32768, 1787,-32768, 1882,-32768, ! 893, 2089,-32768, 898,-32768,-32768,-32768,-32768, 263,-32768, ! -32768, 2706,-32768, 204, 4528, 2089,-32768,-32768, 2758,-32768, ! -32768,-32768,-32768, 996,-32768,-32768,-32768, 900,-32768, 2089, ! -32768, 217, 262,-32768, 399,-32768, 5139, 920,-32768,-32768, ! -32768,-32768, 220, 2156, 947, 5182,-32768, 966, 2156, 964, ! 2156,-32768, 2156,-32768,-32768, 1047, 1058,-32768 }; static const short yypgoto[] = { ! -32768,-32768,-32768, -60, -40, 671, -28, -121, 163, 140, ! -4, 603,-32768, 141,-32768, 1052, 589,-32768, 48,-32768, ! -32768, 859, 104, 558,-32768,-32768, 1013, 1010,-32768, -128, ! -32768, 922,-32768, -84, -117, 939, -168, -201,-32768,-32768, ! 184, 690, 831, -322, -124, 68,-32768,-32768,-32768,-32768, ! -32768,-32768,-32768, 933,-32768, 178,-32768, 682, 308,-32768, ! -32768,-32768,-32768, 1044, 620,-32768, 1011,-32768,-32768, 258, ! -32768, -114, 833, 817, -166, -292,-32768, 800, -275, 157, ! -531, 54, -495,-32768,-32768,-32768, -304,-32768,-32768,-32768, ! -32768,-32768,-32768,-32768,-32768, 445, 450, -629, -428,-32768, ! -32768,-32768,-32768,-32768,-32768,-32768, -288,-32768, -656, 804, ! -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 539, ! -32768, 542,-32768,-32768,-32768, 147,-32768,-32768,-32768,-32768, ! -430,-32768, 769, 327, -36, 1281, 236, 1341, 237, 423, ! 547, 935, -173, 720, 773, -485,-32768, 702, 758, 590, ! 685, 730, 741, 749, 732, 742,-32768, 513, 745, 927, ! -32768,-32768, 767,-32768 }; ! ! #define YYLAST 5749 ! ! static const short yytable[] = { ! 23, 447, 365, 31, 85, 623, 175, 293, 151, 458, ! 332, 182, 465, 186, 594, 184, 61, 172, 733, 341, ! 69, 345, 347, 40, 86, 451, 349, 356, 358, 372, ! 398, 125, 470, 454, 419, 455, 85, 729, 61, 250, ! 63, 50, 494, 61, 63, 78, 172, 163, 263, 136, ! 121, 86, 598, 265, 617, 20, 86, 349, 33, 103, ! 90, 253, 63, 506, 20, 20, 20, 63, 429, 22, ! 659, 85, 126, 605, 567, 178, 163, 354, 22, 333, ! 606, 635, 569, 33, 571, 334, 20, 90, 64, 20, ! 20, 86, 90, 120, 137, 86, 620, 729, 125, 471, ! 85, 66, 61, 586, 399, 17, 71, 20, 69, 495, ! 774, -64, 187, 703, 17, 17, 17, 650, 86, 779, ! 86, 22, 335, 41, 584, 42, 63, 90, 350, -92, ! -92, 90, 63, 284, 420, 182, 17, 687, 251, 17, ! 17, 51, 86, 52, -102, 79, 27, 29, -102, 704, ! 408, -153, -292, 599, 90, -64, 90, 17, 352, 350, ! 254, 139, 360, 430, 155, 660, 439, 467, 91, 286, ! 353, 628, 127, 703, 568, 121, 703, 678, 90, 54, ! 56, 433, 570, 59, 572, 174, 415, 145, 338, 338, ! 338, 338, 587, 59, 63, 146, 338, 338, 361, 178, ! 91, 691, 658, 588, 89, 718, 513, 515, 517, 704, ! 182, 699, 704, 155, 174, 469, 707, 255, 751, 86, ! 257, 768, 112, 203, 585, 147, 115, 717, 682, 101, ! 443, 89, 629, 120, 105, 158, 89, 52, 267, 179, ! 139, 659, 703, 425, 632, 564, 52, 703, 121, 703, ! 86, 703, 752, 284, -95, 90, -95, 719, 679, -95, ! -95, -95, -95, 752, 158, 112, 115, 427, 22, 711, ! 734, 89, 447, 284, 178, 89, 707, 288, 704, 707, ! 416, 434, 189, 704, 558, 704, 90, 704, 621, 286, ! 334, 147, 626, 154, 86, 670, 449, 458, 89, 120, ! 89, 489, 742, 367, 449, 763, 449, 130, 69, 456, ! 43, 762, 619, 285, 287, 165, 480, 482, 771, 189, ! 323, 776, 89, 683, 487, 488, 591, 713, 405, 628, ! 90, 630, 63, -95, 135, 73, 743, 426, -95, -95, ! -95, -95, 628, 633, 165, 707, 720, 753, 447, 489, ! 707, 537, 707, 628, 707, 643, 710, 680, 772, 645, ! 131, 428, 376, 179, 628, -254, 155, 431, 627, 701, ! 458, 284, 95, 44, 628, 338, 338, 338, 338, 338, ! 338, 338, 338, 338, 338, 338, 338, 90, 338, 338, ! 338, 338, 338, 338, 338, 640, 490, 288, 44, 89, ! 643, -29, 2, 146, 95, 462, -154, 559, 661, 324, ! 325, 754, 693, 421, 483, -324, 710, 179, 628, 710, ! 435, -26, 2, 662, 189, 510, 648, 140, 141, 451, ! 89, -156, 454, 285, 287, 135, 447, 661, 179, 171, ! 323, 287, 611, 147, 589, 613, 3, 323, 685, 287, ! 644, 287, 662, 285, 646, 323, 758, 323, 663, 37, ! 323, 432, 458, 5, 651, 252, 3, 654, 171, 6, ! 765, 458, -28, 2, 89, 155, 189, 4, 656, 406, ! 47, 338, 39, 5, 770, 710, 338, 724, 258, 6, ! 710, 473, 710, 441, 710, 773, 136, 7, 701, 463, ! 755, 121, 8, 758, 656, 765, 692, 770, 484, -324, ! 415, 76, 59, 259, 507, 288, 502, 3, 37, 511, ! 649, 284, 8, 155, 284, 182, 21, 28, 4, 324, ! 325, 89, -63, 30, 5, 38, 324, 325, -23, -23, ! 6, 39, 736, 48, 324, 325, 324, 325, 628, 324, ! 325, 285, 287, 737, 55, 739, 502, 286, 323, 18, ! 286, 628, 735, -63, 622, 740, 686, 147, 18, 18, ! 18, 57, 657, 8, 48, 58, -63, 60, 37, 502, ! -23, 59, 442, 503, 189, -23, -23, -23, 504, 178, ! 18, -23, 505, 18, 18, -23, 326, 336, 741, 32, ! 284, 36, 348, 22, 744, -27, 2, -63, 68, 86, ! 760, 18, 100, 22, 22, 492, 80, 338, 338, 493, ! 22, 590, 92, 503, 53, 196, 284, 351, 504, -30, ! 2, 197, 505, 338, 104, 577, 286, 368, 198, 578, ! 449, 22, 199, 22, 696, 90, 503, 324, 325, 82, ! 3, 504, 83, 22, 92, 505, 200, 201, 22, 373, ! 202, 4, 286, 111, 22, 288, 22, 5, 288, 204, ! 205, 206, 207, 6, 3, 208, 209, 80, 114, 374, ! 148, -32, 2, -31, 2, 4, 284, 102, 284, 159, ! 150, 5, -33, 2, 108, 22, 153, 6, 394, 22, ! 449, 285, 287, 449, 285, 287, 8, 183, 323, 536, ! 82, 323, 188, 83, 22, 331, 326, 375, 159, 395, ! 327, 22, 286, 326, 286, 466, 3, 449, 3, 133, ! 8, 326, 468, 326, 157, 472, 326, 3, 612, 639, ! 614, 449, 642, 5, 288, 5, 323, 397, 323, 6, ! 22, 6, 142, 179, 5, 449, 396, 143, 144, 80, ! 6, 157, 409, 157, -152, 22, 123, 22, 444, 449, ! 288, -343, -343, 448, 449, 119, 449, 22, 449, 59, ! 285, 287, 8, 22, 8, 287, 491, 323, 141, 89, ! 477, 323, 82, 8, 22, 83, 22, 324, 325, 22, ! 324, 325, 22, 496, 22, 610, 285, 287, 610, 595, ! 37, 452, 22, 323, 149, 152, 80, 597, 697, 22, ! 461, 323, 22, 607, -343, 124, 636, 38, -343, 637, ! 288, 631, 288, 39, 326, 324, 325, 324, 325, 641, ! 327, -345, -345, 485, 647, 287, 486, 327, 287, 82, ! 367, 323, 83, 22, 323, 327, 658, 327, 256, 141, ! 327, 746, -136, 668, 747, 3, 285, 287, 285, 287, ! 34, 80, 287, 323, 464, 323, 324, 325, 323, 369, ! 324, 325, 674, 370, -505, -505, 287, 371, 176, -506, ! -506, 34, 323, 328, -345, 34, 377, 378, -345, 675, ! 287, 676, 324, 325, 82, 712, 323, 83, 22, 249, ! 324, 325, 34, 323, 287, -372, 403, 714, 3, 287, ! 323, 287, 323, 287, 80, 323, 718, 323, 731, 323, ! 777, 599, 3, 382, 383, 781, -370, 783, 80, 784, ! 324, 325, 745, 324, 325, -204, 329, 392, 393, 3, ! 387, 388, 389, 390, 748, 80, 749, 82, 327, 750, ! 83, 22, 324, 325, 324, 325, 751, 324, 325, 362, ! 249, 82, 412, 413, 83, 22, 414, 529, 531, 533, ! 535, 324, 325, 177, 326, 400, 401, 326, 82, 757, ! 391, 83, 22, -16, 759, 324, 325, 768, -504, -504, ! 369, 769, 324, 325, 370, 80, -414, -414, 440, 324, ! 325, 324, 325, 328, 324, 325, 324, 325, 324, 325, ! 328, 775, 326, 780, 326, 379, 380, 381, 328, 624, ! 328, 192, 193, 328, 384, 385, 386, 418, 82, -16, ! 424, 83, 22, 778, -504, -504, 369, 786, 437, 438, ! 370, -415, -415, 3, 371, -504, -504, 369, 787, 80, ! 782, 370, 538, 326, 35, 371, 329, 326, 81, 77, ! 5, 143, 144, 329, 194, 195, 6, 540, 542, 80, ! 190, 329, 262, 329, 519, 521, 329, 110, 196, 326, ! 404, 260, 82, 562, 197, 83, 22, 326, 75, 411, ! 330, 198, 474, 475, 476, 199, 84, 129, 327, 725, ! 446, 327, 82, 457, 726, 83, 22, 460, 652, 200, ! 201, 653, 481, 202, 544, 203, 625, 326, 343, 550, ! 326, 328, 204, 205, 206, 207, 546, 501, 208, 209, ! 552, 509, 523, 525, 527, 548, 327, 557, 327, 326, ! 695, 326, -16, 0, 326, 0, 123, -504, -504, 369, ! 0, 0, 0, 370, 0, 0, 555, 638, 326, -504, ! -504, 369, 0, 0, 0, 370, 0, 0, 0, 440, ! 0, 0, 326, 566, 329, 0, 0, 327, 0, 326, ! 0, 327, 0, 574, 0, 576, 326, 0, 326, 0, ! 37, 326, 0, 326, 0, 326, 80, 0, 0, 0, ! 0, 0, 0, 327, 0, 124, 0, 38, 0, 0, ! 330, 327, 0, 39, 0, 0, 0, 330, 602, 0, ! 604, 0, 0, 0, 0, 330, 0, 330, 0, 82, ! 330, 0, 83, 22, 609, 0, 3, 0, 0, 0, ! 0, 327, 80, 0, 327, 0, 0, 0, 0, 0, ! 249, 81, 0, 5, 0, 0, 0, 0, 0, 6, ! 0, 0, 0, 327, 0, 327, 0, 0, 327, 0, ! 0, 328, 0, 0, 328, 82, 0, 0, 83, 22, ! 0, 0, 327, 0, 191, 0, 192, 193, 155, 156, ! 0, 0, 8, 0, 0, 0, 327, 0, 0, 3, ! 0, 0, 0, 327, 0, 80, 0, 0, 0, 328, ! 327, 328, 327, 0, 81, 327, 5, 327, 0, 327, ! 0, 0, 6, 0, 329, 0, 0, 329, 330, 194, ! 195, 0, 0, 0, 80, 0, 0, 0, 82, 0, ! 0, 83, 22, 196, 655, 0, 0, 0, 0, 197, ! 328, 155, 261, 0, 328, 8, 198, 0, 0, 0, ! 199, 0, 329, 0, 329, 0, 0, 82, 0, 0, ! 83, 22, 0, 0, 200, 201, 328, 0, 202, 0, ! 203, 0, 0, 0, 328, 689, 0, 204, 205, 206, ! 207, 0, 0, 208, 209, 0, 0, 0, 0, 0, ! 0, 0, 0, 329, 0, 3, 0, 329, 0, 0, ! 0, 80, 0, 0, 328, 0, 0, 328, 0, 722, ! 81, 0, 5, 0, 0, 730, 0, 0, 6, 329, ! 0, 0, 0, 0, 0, 0, 328, 329, 328, 0, ! 0, 328, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 0, 0, 0, 0, 328, 0, 0, 128, 0, ! 0, 0, 0, 339, 339, 339, 339, 329, 0, 328, ! 329, 339, 339, 0, 0, 0, 328, 0, 330, 0, ! 0, 330, 0, 328, 0, 328, 0, 0, 328, 329, ! 328, 329, 328, 0, 329, 0, 0, 0, 0, 0, ! 0, 764, 0, 0, 0, 767, 0, 0, 329, 422, ! 0, 192, 193, 0, 0, 0, 330, 0, 330, 0, ! 0, 0, 329, 340, 340, 340, 340, 0, 0, 329, ! 0, 340, 340, 0, 0, 0, 329, 0, 329, 0, ! 0, 329, 0, 329, 0, 329, 0, 0, 0, 0, ! 0, 0, 0, 0, 194, 195, 0, 330, 0, 80, ! 0, 330, 0, 0, 0, 0, 0, 0, 196, 0, ! 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, ! 0, 198, 0, 330, 0, 199, 0, 0, 0, 0, ! 0, 330, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 0, 0, 0, 423, ! 0, 0, 204, 205, 206, 207, 0, 0, 208, 209, ! 0, 330, 0, 0, 330, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 330, 0, 330, 0, 0, 330, 0, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, ! 339, 339, 330, 339, 339, 339, 339, 339, 339, 339, ! 0, 0, 0, 0, 0, 0, 330, 0, 0, 0, ! 0, 0, 0, 330, 0, 0, 0, 268, 0, 0, ! 330, 0, 330, 0, 0, 330, 0, 330, 0, 330, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, ! 340, 340, 0, 340, 340, 340, 340, 340, 340, 340, ! 0, 3, 194, 195, 661, 269, 270, 80, 271, 0, ! 0, 272, 0, 0, 0, 273, 196, 0, 0, 662, ! 0, 0, 274, 275, 6, 276, 339, 277, 278, 198, ! 279, 339, 0, 280, 281, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 0, 268, 0, ! 0, 282, 0, 155, 727, 0, 0, 8, 0, 0, ! 204, 205, 206, 207, 0, 0, 208, 209, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 340, 0, 0, 0, ! 0, 340, 3, 194, 195, 661, 269, 270, 80, 271, ! 0, 0, 272, 0, 0, 0, 273, 196, 0, 0, ! 662, 0, 0, 274, 275, 6, 276, 0, 277, 278, ! 198, 279, 0, 0, 280, 281, 0, 0, 0, 0, ! 0, 82, 0, 0, 83, 22, 0, 0, 0, 0, ! 0, 0, 282, 268, 155, 756, 0, 0, 8, 0, ! 0, 204, 205, 206, 207, 0, 0, 208, 209, 0, ! 0, 0, 339, 339, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 339, 0, ! 0, 0, 0, 0, 0, 0, 0, 3, 194, 195, ! -264, 269, 270, 80, 271, 0, 0, 272, 0, 0, ! 0, 273, 196, 0, 0, -264, 0, 0, 274, 275, ! 6, 276, 268, 277, 278, 198, 279, 0, 0, 280, ! 281, 0, 340, 340, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 0, 0, 0, 0, 282, 340, 155, ! -264, 0, 0, 8, 0, 0, 204, 205, 206, 207, ! 0, 0, 208, 209, 0, 0, 3, 194, 195, 0, ! 269, 270, 80, 271, 0, 0, 272, 0, 0, 0, ! 273, 196, 0, 0, 0, 0, 0, 274, 275, 6, ! 276, 268, 277, 278, 198, 279, 0, 0, 280, 281, ! 0, 0, 0, 0, 0, 82, 0, 0, 83, 22, ! 0, 0, 0, 0, 0, 0, 282, 0, 155, 445, ! 0, 0, 8, 0, 0, 204, 205, 206, 207, 0, ! 0, 208, 209, 0, 0, 3, 194, 195, 0, 269, ! 270, 80, 271, 0, 0, 272, 0, 0, 0, 273, ! 196, 0, 0, 0, 0, 0, 274, 275, 6, 276, ! 268, 277, 278, 198, 279, 0, 0, 280, 281, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 0, 0, 0, 0, 282, 0, 155, 0, 0, ! 0, 8, 0, 0, 204, 205, 206, 207, 0, 0, ! 208, 209, 0, 0, 3, 194, 195, 0, 269, 270, ! 80, 271, 0, 0, 272, 0, 0, 0, 273, 196, ! 0, 0, 0, 0, 0, 274, 275, 268, 276, 0, ! 277, 278, 198, 279, 0, 0, 280, 281, 0, 0, ! 0, 0, 0, 82, 0, 0, 83, 22, 0, 0, ! 0, 0, 0, 0, 282, 0, 155, 0, 0, 0, ! 8, 0, 0, 204, 205, 206, 207, 0, 0, 208, ! 209, 3, 194, 195, 0, 700, 270, 80, 271, 0, ! 0, 272, 0, 0, 0, 273, 196, 0, 0, 0, ! 0, 0, 274, 275, 0, 276, 0, 277, 278, 198, ! 279, 0, 0, 280, 281, 500, 0, 192, 193, 0, ! 82, 0, 0, 83, 22, 0, 0, 0, 0, 0, ! 0, 282, 0, 155, 0, 0, 0, 8, 0, 0, ! 204, 205, 206, 207, 0, 0, 208, 209, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 194, 195, 0, 0, 0, 80, 0, 553, 0, 192, ! 193, 0, 0, 0, 196, 0, 0, 0, 0, 0, ! 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 194, 195, 146, 0, 0, 80, 204, 205, ! 206, 207, 0, 0, 208, 209, 196, 0, 0, 0, ! 0, 0, 197, 592, 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 554, 200, 201, 0, ! 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, ! 204, 205, 206, 207, 0, 0, 208, 209, 194, 195, ! 0, 0, 0, 80, 0, 600, 0, 192, 193, 0, ! 0, 0, 196, 0, 0, 0, 0, 0, 197, 0, ! 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 593, 0, ! 194, 195, 0, 0, 0, 80, 204, 205, 206, 207, ! 0, 0, 208, 209, 196, 0, 0, 0, 0, 0, ! 197, 608, 0, 192, 193, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 0, 0, 0, 601, 0, 0, 204, 205, ! 206, 207, 0, 0, 208, 209, 194, 195, 0, 0, ! 0, 80, 0, 615, 0, 192, 193, 0, 0, 0, ! 196, 0, 0, 0, 0, 0, 197, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 194, 195, ! 146, 0, 0, 80, 204, 205, 206, 207, 0, 0, ! 208, 209, 196, 0, 0, 0, 0, 0, 197, 592, ! 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 616, 0, ! 0, 0, 0, 0, 0, 0, 204, 205, 206, 207, ! 0, 0, 208, 209, 194, 195, 0, 0, 0, 80, ! 0, 715, 0, 192, 193, 0, 0, 0, 196, 0, ! 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 698, 0, 194, 195, 0, 0, ! 0, 80, 204, 205, 206, 207, 0, 0, 208, 209, ! 196, 0, 0, 0, 0, 0, 197, 715, 0, 192, ! 193, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 716, 0, 0, 0, ! 0, 0, 0, 0, 204, 205, 206, 207, 0, 0, ! 208, 209, 194, 195, 0, 0, 0, 80, 0, 600, ! 0, 192, 193, 0, 0, 0, 196, 0, 0, 0, ! 0, 0, 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 761, 0, 194, 195, 0, 0, 0, 80, ! 204, 205, 206, 207, 0, 0, 208, 209, 196, 0, ! 0, 0, 0, 0, 197, 337, 0, 192, 193, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 0, 0, 0, 766, ! 0, 0, 204, 205, 206, 207, 0, 0, 208, 209, ! 194, 195, 0, 0, 0, 80, 0, 344, 0, 192, ! 193, 0, 0, 0, 196, 0, 0, 0, 0, 0, ! 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 194, 195, 0, 0, 0, 80, 204, 205, ! 206, 207, 0, 0, 208, 209, 196, 0, 0, 0, ! 0, 0, 197, 346, 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, ! 204, 205, 206, 207, 0, 0, 208, 209, 194, 195, ! 0, 0, 0, 80, 0, 355, 0, 192, 193, 0, ! 0, 0, 196, 0, 0, 0, 0, 0, 197, 0, ! 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 194, 195, 0, 0, 0, 80, 204, 205, 206, 207, ! 0, 0, 208, 209, 196, 0, 0, 0, 0, 0, ! 197, 357, 0, 192, 193, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, ! 206, 207, 0, 0, 208, 209, 194, 195, 0, 0, ! 0, 80, 0, 359, 0, 192, 193, 0, 0, 0, ! 196, 0, 0, 0, 0, 0, 197, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 194, 195, ! 0, 0, 0, 80, 204, 205, 206, 207, 0, 0, ! 208, 209, 196, 0, 0, 0, 0, 0, 197, 417, ! 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 0, 0, 0, 0, 0, 0, 204, 205, 206, 207, ! 0, 0, 208, 209, 194, 195, 0, 0, 0, 80, ! 0, 436, 0, 192, 193, 0, 0, 0, 196, 0, ! 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 194, 195, 0, 0, ! 0, 80, 204, 205, 206, 207, 0, 0, 208, 209, ! 196, 0, 0, 0, 0, 0, 197, 508, 0, 192, ! 193, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 0, 0, ! 0, 0, 0, 0, 204, 205, 206, 207, 0, 0, ! 208, 209, 194, 195, 0, 0, 0, 80, 0, 512, ! 0, 192, 193, 0, 0, 0, 196, 0, 0, 0, ! 0, 0, 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 0, 0, 194, 195, 0, 0, 0, 80, ! 204, 205, 206, 207, 0, 0, 208, 209, 196, 0, ! 0, 0, 0, 0, 197, 514, 0, 192, 193, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 0, 0, 0, 0, ! 0, 0, 204, 205, 206, 207, 0, 0, 208, 209, ! 194, 195, 0, 0, 0, 80, 0, 516, 0, 192, ! 193, 0, 0, 0, 196, 0, 0, 0, 0, 0, ! 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 194, 195, 0, 0, 0, 80, 204, 205, ! 206, 207, 0, 0, 208, 209, 196, 0, 0, 0, ! 0, 0, 197, 518, 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, ! 204, 205, 206, 207, 0, 0, 208, 209, 194, 195, ! 0, 0, 0, 80, 0, 520, 0, 192, 193, 0, ! 0, 0, 196, 0, 0, 0, 0, 0, 197, 0, ! 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 194, 195, 0, 0, 0, 80, 204, 205, 206, 207, ! 0, 0, 208, 209, 196, 0, 0, 0, 0, 0, ! 197, 522, 0, 192, 193, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, ! 206, 207, 0, 0, 208, 209, 194, 195, 0, 0, ! 0, 80, 0, 524, 0, 192, 193, 0, 0, 0, ! 196, 0, 0, 0, 0, 0, 197, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 194, 195, ! 0, 0, 0, 80, 204, 205, 206, 207, 0, 0, ! 208, 209, 196, 0, 0, 0, 0, 0, 197, 526, ! 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 0, 0, 0, 0, 0, 0, 204, 205, 206, 207, ! 0, 0, 208, 209, 194, 195, 0, 0, 0, 80, ! 0, 528, 0, 192, 193, 0, 0, 0, 196, 0, ! 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 194, 195, 0, 0, ! 0, 80, 204, 205, 206, 207, 0, 0, 208, 209, ! 196, 0, 0, 0, 0, 0, 197, 530, 0, 192, ! 193, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 0, 0, ! 0, 0, 0, 0, 204, 205, 206, 207, 0, 0, ! 208, 209, 194, 195, 0, 0, 0, 80, 0, 532, ! 0, 192, 193, 0, 0, 0, 196, 0, 0, 0, ! 0, 0, 197, 0, 0, 0, 0, 0, 0, 198, ! 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 0, 0, 194, 195, 0, 0, 0, 80, ! 204, 205, 206, 207, 0, 0, 208, 209, 196, 0, ! 0, 0, 0, 0, 197, 534, 0, 192, 193, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 0, 0, 0, 0, ! 0, 0, 204, 205, 206, 207, 0, 0, 208, 209, ! 194, 195, 0, 0, 0, 80, 0, 539, 0, 192, ! 193, 0, 0, 0, 196, 0, 0, 0, 0, 0, ! 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 194, 195, 0, 0, 0, 80, 204, 205, ! 206, 207, 0, 0, 208, 209, 196, 0, 0, 0, ! 0, 0, 197, 541, 0, 192, 193, 0, 0, 198, ! 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, ! 204, 205, 206, 207, 0, 0, 208, 209, 194, 195, ! 0, 0, 0, 80, 0, 543, 0, 192, 193, 0, ! 0, 0, 196, 0, 0, 0, 0, 0, 197, 0, ! 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 194, 195, 0, 0, 0, 80, 204, 205, 206, 207, ! 0, 0, 208, 209, 196, 0, 0, 0, 0, 0, ! 197, 545, 0, 192, 193, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, ! 206, 207, 0, 0, 208, 209, 194, 195, 0, 0, ! 0, 80, 0, 547, 0, 192, 193, 0, 0, 0, ! 196, 0, 0, 0, 0, 0, 197, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 194, 195, ! 0, 0, 0, 80, 204, 205, 206, 207, 0, 0, ! 208, 209, 196, 0, 0, 0, 0, 0, 197, 549, ! 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 0, 0, 0, 0, 0, 0, 204, 205, 206, 207, ! 0, 0, 208, 209, 194, 195, 0, 0, 0, 80, ! 0, 551, 0, 192, 193, 0, 0, 0, 196, 0, ! 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 194, 195, 0, 0, ! 0, 80, 204, 205, 206, 207, 0, 0, 208, 209, ! 196, 0, 0, 0, 0, 0, 197, 556, 0, 192, ! 193, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 0, 0, ! 0, 0, 0, 0, 204, 205, 206, 207, 0, 0, ! 208, 209, 194, 195, 0, 0, 0, 80, 0, 565, ! 0, 192, 193, 0, 0, 0, 196, 0, 0, 0, ! 0, 0, 197, 0, 0, 0, 0, 0, 0, 198, ! 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 0, 0, 194, 195, 0, 0, 0, 80, ! 204, 205, 206, 207, 0, 0, 208, 209, 196, 0, ! 0, 0, 0, 0, 197, 573, 0, 192, 193, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 0, 0, 0, 0, ! 0, 0, 204, 205, 206, 207, 0, 0, 208, 209, ! 194, 195, 0, 0, 0, 80, 0, 575, 0, 192, ! 193, 0, 0, 0, 196, 0, 0, 0, 0, 0, ! 197, 0, 0, 0, 0, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 194, 195, 0, 0, 0, 80, 204, 205, ! 206, 207, 0, 0, 208, 209, 196, 0, 0, 0, ! 0, 0, 197, 603, 0, 192, 193, 0, 0, 198, ! 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, ! 82, 0, 0, 83, 22, 0, 0, 200, 201, 0, ! 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, ! 204, 205, 206, 207, 0, 0, 208, 209, 194, 195, ! 0, 0, 0, 80, 0, 618, 0, 192, 193, 0, ! 0, 0, 196, 0, 0, 0, 0, 0, 197, 0, ! 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 194, 195, 0, 0, 0, 80, 204, 205, 206, 207, ! 0, 0, 208, 209, 196, 0, 0, 0, 0, 0, ! 197, 684, 0, 192, 193, 0, 0, 198, 0, 0, ! 0, 199, 0, 0, 0, 0, 0, 0, 82, 0, ! 0, 83, 22, 0, 0, 200, 201, 0, 0, 202, ! 0, 0, 0, 0, 0, 0, 0, 0, 204, 205, ! 206, 207, 0, 0, 208, 209, 194, 195, 0, 0, ! 0, 80, 0, 688, 0, 192, 193, 0, 0, 0, ! 196, 0, 0, 0, 0, 0, 197, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 194, 195, ! 0, 0, 0, 80, 204, 205, 206, 207, 0, 0, ! 208, 209, 196, 0, 0, 0, 0, 0, 197, 694, ! 0, 192, 193, 0, 0, 198, 0, 0, 0, 199, ! 0, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, 0, ! 0, 0, 0, 0, 0, 0, 204, 205, 206, 207, ! 0, 0, 208, 209, 194, 195, 0, 0, 0, 80, ! 0, 721, 0, 192, 193, 0, 0, 0, 196, 0, ! 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, ! 0, 198, 0, 0, 0, 199, 0, 0, 0, 0, ! 0, 0, 82, 0, 0, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 194, 195, 0, 0, ! 0, 80, 204, 205, 206, 207, 0, 0, 208, 209, ! 196, 0, 0, 342, 0, 192, 197, 0, 0, 0, ! 0, 0, 0, 198, 0, 0, 0, 199, 0, 0, ! 0, 0, 0, 0, 82, 0, 0, 83, 22, 0, ! 0, 200, 201, 0, 0, 202, 0, 0, 0, 0, ! 0, 0, 0, 0, 204, 205, 206, 207, 194, 195, ! 208, 209, 0, 80, 0, 583, 0, 0, 0, 0, ! 0, 0, 196, 0, 0, 0, 0, 0, 197, 0, ! 0, 0, 0, 0, 0, 198, 0, 0, 0, 199, ! 671, 0, 0, 0, 0, 0, 82, 0, 0, 83, ! 22, 0, 0, 200, 201, 0, 0, 202, 0, -287, ! -287, -287, 0, 0, 0, -287, 204, 205, 206, 207, ! 0, 0, 208, 209, -287, 0, 0, 0, 0, 0, ! -287, 0, 0, 732, 0, 194, 195, -287, 0, 0, ! 80, -287, 0, 0, 0, 0, 0, 0, -287, 196, ! 0, -287, -287, 0, 0, 197, 0, 0, 669, -287, ! 0, 0, 198, 0, 0, -287, 199, 0, -287, -287, ! -287, -287, 0, 82, -287, -287, 83, 22, 194, 195, ! 0, 0, 0, 80, 282, -295, 0, 0, 0, 0, ! 0, 0, 196, 204, 205, 206, 207, 0, 197, 208, ! 209, 0, 0, 194, 195, 198, 0, 0, 80, 199, ! 0, 0, 192, 193, 0, 0, 82, 196, 0, 83, ! 22, 0, 0, 197, 0, 0, 0, 282, -295, 0, ! 198, 0, 0, 0, 199, 0, 204, 205, 206, 207, ! 0, 82, 208, 209, 83, 22, 0, 0, 0, 0, ! 0, 0, 282, 0, 0, 194, 195, 0, 0, 0, ! 80, 204, 205, 206, 207, 0, 0, 208, 209, 196, ! 0, 0, 0, 0, 0, 197, 0, 0, 192, 193, ! 0, 0, 198, 0, 0, 0, 199, 0, 0, 0, ! 0, 0, 0, 82, 0, 0, 83, 22, 0, 0, ! 200, 201, 0, 0, 202, 0, 203, 363, 0, 0, ! 0, 364, 0, 204, 205, 206, 207, 0, 0, 208, ! 209, 194, 195, 0, 0, 0, 80, 0, 0, 0, ! 192, 193, 0, 0, 0, 196, 0, 0, 0, 0, ! 0, 197, 0, 0, 0, 0, 0, 0, 198, 0, ! 0, 0, 199, 0, 0, 0, 0, 0, 0, 82, ! 0, 0, 83, 22, 0, 0, 200, 201, 0, 0, ! 202, 497, 0, 194, 195, 0, 0, 0, 80, 204, ! 205, 206, 207, 0, 0, 208, 209, 196, 0, 0, ! 0, 0, 0, 197, 0, 0, 192, 193, 0, 0, ! 198, 0, 0, 0, 199, 0, 0, 0, 0, 0, ! 0, 82, 0, 0, 83, 22, 0, 0, 200, 201, ! 0, 0, 202, 634, 0, 0, 0, 0, 0, 0, ! 0, 204, 205, 206, 207, 0, 0, 208, 209, 194, ! 195, 0, 0, 0, 80, 0, 0, 0, 192, 193, ! 0, 0, 0, 196, 0, 0, 0, 0, 0, 197, ! 0, 0, 0, 0, 0, 0, 198, 0, 0, 0, ! 199, 0, 0, 0, 0, 0, 0, 82, 0, 0, ! 83, 22, 0, 0, 200, 201, 0, 0, 202, 677, ! 0, 194, 195, 0, 0, 0, 80, 204, 205, 206, ! 207, 0, 0, 208, 209, 196, 0, 0, 0, 0, ! 0, 197, 0, 0, 192, 193, 0, 0, 198, 0, ! 0, 0, 199, 0, 0, 0, 0, 0, 0, 82, ! 0, 0, 83, 22, 0, 0, 200, 201, 0, 0, ! 202, 690, 0, 0, 0, 0, 0, 0, 0, 204, ! 205, 206, 207, 0, 0, 208, 209, 194, 195, 0, ! 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, ! 0, 196, 0, 0, 0, 0, 0, 197, 0, 0, ! 0, 0, 0, 0, 198, 0, 0, 0, 199, 0, ! 0, 0, 0, 0, 0, 82, 0, 0, 83, 22, ! 0, 0, 200, 201, 0, 0, 202, 0, 3, 194, ! 195, 0, 0, 0, 80, 204, 205, 206, 207, 0, ! 0, 208, 209, 196, 0, 0, 0, 0, 0, 197, ! 0, 0, 0, 0, 0, 0, 198, 0, 0, 80, ! 199, 0, 0, 0, 0, 0, 0, 82, 196, 0, ! 83, 22, 0, 0, 197, 0, 0, 0, 282, 0, ! 0, 198, 0, 0, 0, 199, 0, 204, 205, 206, ! 207, 0, 82, 208, 209, 83, 22, 0, 0, 200, ! 201, 0, 0, 202, 0, 0, 0, 0, 0, 0, ! 0, 0, 204, 205, 206, 207, 0, 0, 208, 209 }; static const short yycheck[] = { ! 4, 293, 203, 7, 64, 490, 134, 173, 125, 313, ! 178, 135, 334, 1, 444, 136, 44, 131, 674, 192, ! 48, 194, 195, 1, 64, 300, 1, 200, 201, 1, ! 15, 91, 1, 308, 1, 310, 96, 666, 66, 1, ! 44, 1, 1, 71, 48, 1, 160, 131, 1, 54, ! 86, 91, 1, 167, 484, 1, 96, 1, 10, 1, ! 64, 1, 66, 73, 10, 11, 12, 71, 1, 88, ! 1, 131, 1, 96, 1, 135, 160, 198, 88, 96, ! 103, 511, 1, 35, 1, 102, 32, 91, 97, 35, ! 36, 131, 96, 99, 99, 135, 1, 726, 158, 68, ! 160, 102, 130, 1, 89, 1, 53, 53, 136, 68, ! 766, 53, 100, 644, 10, 11, 12, 1, 158, 775, ! 160, 88, 182, 101, 1, 103, 130, 131, 103, 101, ! 102, 135, 136, 173, 101, 259, 32, 622, 100, 35, ! 36, 101, 182, 103, 97, 101, 5, 6, 101, 644, ! 264, 95, 101, 102, 158, 97, 160, 53, 198, 103, ! 100, 1, 202, 277, 97, 96, 283, 335, 64, 173, ! 198, 102, 101, 704, 101, 211, 707, 607, 182, 38, ! 39, 1, 101, 42, 101, 131, 1, 119, 192, 193, ! 194, 195, 90, 52, 198, 100, 200, 201, 202, 259, ! 96, 631, 1, 101, 64, 1, 379, 380, 381, 704, ! 334, 641, 707, 97, 160, 336, 644, 149, 1, 259, ! 152, 1, 81, 97, 101, 99, 85, 657, 1, 66, ! 290, 91, 1, 99, 71, 131, 96, 103, 170, 135, ! 1, 1, 773, 1, 1, 411, 103, 778, 284, 780, ! 290, 782, 1, 293, 94, 259, 96, 1, 1, 99, ! 100, 101, 102, 1, 160, 124, 125, 1, 88, 1, ! 1, 131, 564, 313, 334, 135, 704, 173, 773, 707, ! 95, 101, 141, 778, 96, 780, 290, 782, 96, 293, ! 102, 99, 493, 130, 334, 599, 300, 601, 158, 99, ! 160, 1, 101, 103, 308, 101, 310, 102, 336, 313, ! 1, 741, 485, 173, 173, 131, 352, 353, 101, 178, ! 173, 101, 182, 96, 360, 361, 443, 649, 260, 102, ! 334, 100, 336, 94, 95, 1, 96, 95, 99, 100, ! 101, 102, 102, 100, 160, 773, 90, 96, 640, 1, ! 778, 391, 780, 102, 782, 1, 644, 100, 96, 1, ! 97, 95, 221, 259, 102, 97, 97, 1, 96, 644, ! 674, 411, 64, 64, 102, 379, 380, 381, 382, 383, ! 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, ! 394, 395, 396, 397, 398, 561, 96, 293, 64, 259, ! 1, 0, 1, 100, 96, 1, 97, 411, 48, 173, ! 173, 1, 96, 272, 1, 1, 704, 313, 102, 707, ! 279, 0, 1, 63, 283, 1, 1, 101, 102, 704, ! 290, 97, 707, 293, 293, 95, 728, 48, 334, 131, ! 293, 300, 478, 99, 96, 481, 45, 300, 621, 308, ! 96, 310, 63, 313, 96, 308, 731, 310, 98, 45, ! 313, 95, 766, 62, 578, 1, 45, 581, 160, 68, ! 745, 775, 0, 1, 334, 97, 335, 56, 1, 101, ! 1, 485, 68, 62, 759, 773, 490, 98, 98, 68, ! 778, 350, 780, 1, 782, 96, 54, 76, 773, 95, ! 90, 537, 101, 778, 1, 780, 634, 782, 95, 95, ! 1, 1, 371, 95, 373, 411, 1, 45, 45, 95, ! 95, 561, 101, 97, 564, 649, 1, 1, 56, 293, ! 293, 391, 53, 1, 62, 62, 300, 300, 46, 47, ! 68, 68, 96, 64, 308, 308, 310, 310, 102, 313, ! 313, 411, 411, 681, 1, 96, 1, 561, 411, 1, ! 564, 102, 676, 53, 96, 693, 1, 99, 10, 11, ! 12, 1, 95, 101, 64, 5, 97, 1, 45, 1, ! 88, 440, 90, 68, 443, 93, 94, 95, 73, 649, ! 32, 99, 77, 35, 36, 103, 173, 102, 95, 10, ! 640, 12, 103, 88, 95, 0, 1, 97, 1, 649, ! 738, 53, 1, 88, 88, 98, 51, 621, 622, 102, ! 88, 66, 64, 68, 35, 60, 666, 1, 73, 0, ! 1, 66, 77, 637, 1, 61, 640, 103, 73, 65, ! 644, 88, 77, 88, 66, 649, 68, 411, 411, 84, ! 45, 73, 87, 88, 96, 77, 91, 92, 88, 103, ! 95, 56, 666, 1, 88, 561, 88, 62, 564, 104, ! 105, 106, 107, 68, 45, 110, 111, 51, 1, 99, ! 1, 0, 1, 0, 1, 56, 726, 67, 728, 131, ! 1, 62, 0, 1, 74, 88, 1, 68, 11, 88, ! 704, 561, 561, 707, 564, 564, 101, 1, 561, 1, ! 84, 564, 1, 87, 88, 1, 293, 1, 160, 12, ! 173, 88, 726, 300, 728, 1, 45, 731, 45, 109, ! 101, 308, 1, 310, 131, 1, 313, 45, 480, 561, ! 482, 745, 564, 62, 640, 62, 599, 14, 601, 68, ! 88, 68, 94, 649, 62, 759, 13, 99, 100, 51, ! 68, 158, 97, 160, 95, 88, 1, 88, 95, 773, ! 666, 46, 47, 101, 778, 85, 780, 88, 782, 638, ! 640, 640, 101, 88, 101, 644, 98, 640, 102, 649, ! 99, 644, 84, 101, 88, 87, 88, 561, 561, 88, ! 564, 564, 88, 68, 88, 478, 666, 666, 481, 97, ! 45, 101, 88, 666, 124, 125, 51, 67, 640, 88, ! 101, 674, 88, 95, 99, 60, 1, 62, 103, 90, ! 726, 95, 728, 68, 411, 599, 599, 601, 601, 95, ! 293, 46, 47, 96, 96, 704, 99, 300, 707, 84, ! 103, 704, 87, 88, 707, 308, 1, 310, 101, 102, ! 313, 704, 97, 95, 707, 45, 726, 726, 728, 728, ! 11, 51, 731, 726, 1, 728, 640, 640, 731, 95, ! 644, 644, 101, 99, 93, 94, 745, 103, 1, 93, ! 94, 32, 745, 173, 99, 36, 46, 47, 103, 96, ! 759, 96, 666, 666, 84, 1, 759, 87, 88, 142, ! 674, 674, 53, 766, 773, 97, 96, 101, 45, 778, ! 773, 780, 775, 782, 51, 778, 1, 780, 96, 782, ! 773, 102, 45, 3, 4, 778, 97, 780, 51, 782, ! 704, 704, 57, 707, 707, 57, 173, 16, 17, 45, ! 18, 19, 20, 21, 101, 51, 96, 84, 411, 96, ! 87, 88, 726, 726, 728, 728, 1, 731, 731, 202, ! 203, 84, 97, 98, 87, 88, 101, 387, 388, 389, ! 390, 745, 745, 96, 561, 93, 94, 564, 84, 96, ! 58, 87, 88, 88, 96, 759, 759, 1, 93, 94, ! 95, 101, 766, 766, 99, 51, 46, 47, 103, 773, ! 773, 775, 775, 293, 778, 778, 780, 780, 782, 782, ! 300, 101, 599, 57, 601, 5, 6, 7, 308, 1, ! 310, 3, 4, 313, 8, 9, 10, 270, 84, 88, ! 273, 87, 88, 96, 93, 94, 95, 0, 281, 282, ! 99, 46, 47, 45, 103, 93, 94, 95, 0, 51, ! 96, 99, 391, 640, 12, 103, 293, 644, 60, 56, ! 62, 99, 100, 300, 46, 47, 68, 392, 393, 51, ! 141, 308, 160, 310, 382, 383, 313, 77, 60, 666, ! 259, 158, 84, 411, 66, 87, 88, 674, 54, 266, ! 173, 73, 99, 100, 101, 77, 98, 96, 561, 664, ! 293, 564, 84, 313, 664, 87, 88, 313, 579, 91, ! 92, 579, 353, 95, 394, 97, 98, 704, 193, 397, ! 707, 411, 104, 105, 106, 107, 395, 370, 110, 111, ! 398, 374, 384, 385, 386, 396, 599, 402, 601, 726, ! 637, 728, 88, -1, 731, -1, 1, 93, 94, 95, ! -1, -1, -1, 99, -1, -1, 399, 103, 745, 93, ! 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, ! -1, -1, 759, 416, 411, -1, -1, 640, -1, 766, ! -1, 644, -1, 426, -1, 428, 773, -1, 775, -1, ! 45, 778, -1, 780, -1, 782, 51, -1, -1, -1, ! -1, -1, -1, 666, -1, 60, -1, 62, -1, -1, ! 293, 674, -1, 68, -1, -1, -1, 300, 461, -1, ! 463, -1, -1, -1, -1, 308, -1, 310, -1, 84, ! 313, -1, 87, 88, 477, -1, 45, -1, -1, -1, ! -1, 704, 51, -1, 707, -1, -1, -1, -1, -1, ! 493, 60, -1, 62, -1, -1, -1, -1, -1, 68, ! -1, -1, -1, 726, -1, 728, -1, -1, 731, -1, ! -1, 561, -1, -1, 564, 84, -1, -1, 87, 88, ! -1, -1, 745, -1, 1, -1, 3, 4, 97, 98, ! -1, -1, 101, -1, -1, -1, 759, -1, -1, 45, ! -1, -1, -1, 766, -1, 51, -1, -1, -1, 599, ! 773, 601, 775, -1, 60, 778, 62, 780, -1, 782, ! -1, -1, 68, -1, 561, -1, -1, 564, 411, 46, ! 47, -1, -1, -1, 51, -1, -1, -1, 84, -1, ! -1, 87, 88, 60, 587, -1, -1, -1, -1, 66, ! 640, 97, 98, -1, 644, 101, 73, -1, -1, -1, ! 77, -1, 599, -1, 601, -1, -1, 84, -1, -1, ! 87, 88, -1, -1, 91, 92, 666, -1, 95, -1, ! 97, -1, -1, -1, 674, 628, -1, 104, 105, 106, ! 107, -1, -1, 110, 111, -1, -1, -1, -1, -1, ! -1, -1, -1, 640, -1, 45, -1, 644, -1, -1, ! -1, 51, -1, -1, 704, -1, -1, 707, -1, 662, ! 60, -1, 62, -1, -1, 668, -1, -1, 68, 666, ! -1, -1, -1, -1, -1, -1, 726, 674, 728, -1, ! -1, 731, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, -1, -1, -1, -1, 745, -1, -1, 98, -1, ! -1, -1, -1, 192, 193, 194, 195, 704, -1, 759, ! 707, 200, 201, -1, -1, -1, 766, -1, 561, -1, ! -1, 564, -1, 773, -1, 775, -1, -1, 778, 726, ! 780, 728, 782, -1, 731, -1, -1, -1, -1, -1, ! -1, 744, -1, -1, -1, 748, -1, -1, 745, 1, ! -1, 3, 4, -1, -1, -1, 599, -1, 601, -1, ! -1, -1, 759, 192, 193, 194, 195, -1, -1, 766, ! -1, 200, 201, -1, -1, -1, 773, -1, 775, -1, ! -1, 778, -1, 780, -1, 782, -1, -1, -1, -1, ! -1, -1, -1, -1, 46, 47, -1, 640, -1, 51, ! -1, 644, -1, -1, -1, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, 666, -1, 77, -1, -1, -1, -1, ! -1, 674, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, -1, -1, -1, 101, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! -1, 704, -1, -1, 707, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, 726, -1, 728, -1, -1, 731, -1, ! 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, ! 389, 390, 745, 392, 393, 394, 395, 396, 397, 398, -1, -1, -1, -1, -1, -1, 759, -1, -1, -1, ! -1, -1, -1, 766, -1, -1, -1, 1, -1, -1, ! 773, -1, 775, -1, -1, 778, -1, 780, -1, 782, ! -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, ! 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, ! -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, ! -1, 55, -1, -1, -1, 59, 60, -1, -1, 63, ! -1, -1, 66, 67, 68, 69, 485, 71, 72, 73, ! 74, 490, -1, 77, 78, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, -1, 1, -1, ! -1, 95, -1, 97, 98, -1, -1, 101, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, -1, -1, ! -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, -1, -1, 485, -1, -1, -1, ! -1, 490, 45, 46, 47, 48, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, ! 63, -1, -1, 66, 67, 68, 69, -1, 71, 72, ! 73, 74, -1, -1, 77, 78, -1, -1, -1, -1, ! -1, 84, -1, -1, 87, 88, -1, -1, -1, -1, ! -1, -1, 95, 1, 97, 98, -1, -1, 101, -1, ! -1, 104, 105, 106, 107, -1, -1, 110, 111, -1, ! -1, -1, 621, 622, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, -1, -1, -1, -1, 637, -1, ! -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, ! 48, 49, 50, 51, 52, -1, -1, 55, -1, -1, ! -1, 59, 60, -1, -1, 63, -1, -1, 66, 67, ! 68, 69, 1, 71, 72, 73, 74, -1, -1, 77, ! 78, -1, 621, 622, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, -1, -1, -1, -1, 95, 637, 97, ! 98, -1, -1, 101, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, -1, -1, 45, 46, 47, -1, ! 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, ! 59, 60, -1, -1, -1, -1, -1, 66, 67, 68, ! 69, 1, 71, 72, 73, 74, -1, -1, 77, 78, ! -1, -1, -1, -1, -1, 84, -1, -1, 87, 88, ! -1, -1, -1, -1, -1, -1, 95, -1, 97, 98, ! -1, -1, 101, -1, -1, 104, 105, 106, 107, -1, ! -1, 110, 111, -1, -1, 45, 46, 47, -1, 49, ! 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, ! 60, -1, -1, -1, -1, -1, 66, 67, 68, 69, ! 1, 71, 72, 73, 74, -1, -1, 77, 78, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, -1, -1, -1, -1, 95, -1, 97, -1, -1, ! -1, 101, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, -1, -1, 45, 46, 47, -1, 49, 50, ! 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, ! -1, -1, -1, -1, -1, 66, 67, 1, 69, -1, ! 71, 72, 73, 74, -1, -1, 77, 78, -1, -1, ! -1, -1, -1, 84, -1, -1, 87, 88, -1, -1, ! -1, -1, -1, -1, 95, -1, 97, -1, -1, -1, ! 101, -1, -1, 104, 105, 106, 107, -1, -1, 110, ! 111, 45, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, ! -1, -1, 66, 67, -1, 69, -1, 71, 72, 73, ! 74, -1, -1, 77, 78, 1, -1, 3, 4, -1, ! 84, -1, -1, 87, 88, -1, -1, -1, -1, -1, ! -1, 95, -1, 97, -1, -1, -1, 101, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, -1, -1, ! -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! 46, 47, -1, -1, -1, 51, -1, 1, -1, 3, ! 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, 46, 47, 100, -1, -1, 51, 104, 105, ! 106, 107, -1, -1, 110, 111, 60, -1, -1, -1, ! -1, -1, 66, 1, -1, 3, 4, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, 90, 91, 92, -1, ! -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 46, 47, ! -1, -1, -1, 51, -1, 1, -1, 3, 4, -1, ! -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, 96, -1, ! 46, 47, -1, -1, -1, 51, 104, 105, 106, 107, ! -1, -1, 110, 111, 60, -1, -1, -1, -1, -1, ! 66, 1, -1, 3, 4, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, -1, -1, -1, 101, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 46, 47, -1, -1, ! -1, 51, -1, 1, -1, 3, 4, -1, -1, -1, ! 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, 46, 47, ! 100, -1, -1, 51, 104, 105, 106, 107, -1, -1, ! 110, 111, 60, -1, -1, -1, -1, -1, 66, 1, ! -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, 96, -1, ! -1, -1, -1, -1, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 46, 47, -1, -1, -1, 51, ! -1, 1, -1, 3, 4, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, 96, -1, 46, 47, -1, -1, ! -1, 51, 104, 105, 106, 107, -1, -1, 110, 111, ! 60, -1, -1, -1, -1, -1, 66, 1, -1, 3, ! 4, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, 96, -1, -1, -1, ! -1, -1, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, 46, 47, -1, -1, -1, 51, -1, 1, ! -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, 96, -1, 46, 47, -1, -1, -1, 51, ! 104, 105, 106, 107, -1, -1, 110, 111, 60, -1, ! -1, -1, -1, -1, 66, 1, -1, 3, 4, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, -1, -1, -1, 101, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! 46, 47, -1, -1, -1, 51, -1, 1, -1, 3, ! 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, 46, 47, -1, -1, -1, 51, 104, 105, ! 106, 107, -1, -1, 110, 111, 60, -1, -1, -1, ! -1, -1, 66, 1, -1, 3, 4, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 46, 47, ! -1, -1, -1, 51, -1, 1, -1, 3, 4, -1, ! -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, ! -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! 46, 47, -1, -1, -1, 51, 104, 105, 106, 107, ! -1, -1, 110, 111, 60, -1, -1, -1, -1, -1, ! 66, 1, -1, 3, 4, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, -1, -1, -1, -1, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 46, 47, -1, -1, ! -1, 51, -1, 1, -1, 3, 4, -1, -1, -1, ! 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, 46, 47, ! -1, -1, -1, 51, 104, 105, 106, 107, -1, -1, ! 110, 111, 60, -1, -1, -1, -1, -1, 66, 1, ! -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! -1, -1, -1, -1, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 46, 47, -1, -1, -1, 51, ! -1, 1, -1, 3, 4, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, 46, 47, -1, -1, ! -1, 51, 104, 105, 106, 107, -1, -1, 110, 111, ! 60, -1, -1, -1, -1, -1, 66, 1, -1, 3, ! 4, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, -1, -1, ! -1, -1, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, 46, 47, -1, -1, -1, 51, -1, 1, ! -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, 46, 47, -1, -1, -1, 51, ! 104, 105, 106, 107, -1, -1, 110, 111, 60, -1, ! -1, -1, -1, -1, 66, 1, -1, 3, 4, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, -1, -1, -1, -1, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! 46, 47, -1, -1, -1, 51, -1, 1, -1, 3, ! 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, 46, 47, -1, -1, -1, 51, 104, 105, ! 106, 107, -1, -1, 110, 111, 60, -1, -1, -1, ! -1, -1, 66, 1, -1, 3, 4, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 46, 47, ! -1, -1, -1, 51, -1, 1, -1, 3, 4, -1, ! -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, ! -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! 46, 47, -1, -1, -1, 51, 104, 105, 106, 107, ! -1, -1, 110, 111, 60, -1, -1, -1, -1, -1, ! 66, 1, -1, 3, 4, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, -1, -1, -1, -1, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 46, 47, -1, -1, ! -1, 51, -1, 1, -1, 3, 4, -1, -1, -1, ! 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, 46, 47, ! -1, -1, -1, 51, 104, 105, 106, 107, -1, -1, ! 110, 111, 60, -1, -1, -1, -1, -1, 66, 1, ! -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! -1, -1, -1, -1, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 46, 47, -1, -1, -1, 51, ! -1, 1, -1, 3, 4, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, 46, 47, -1, -1, ! -1, 51, 104, 105, 106, 107, -1, -1, 110, 111, ! 60, -1, -1, -1, -1, -1, 66, 1, -1, 3, ! 4, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, -1, -1, ! -1, -1, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, 46, 47, -1, -1, -1, 51, -1, 1, ! -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, 46, 47, -1, -1, -1, 51, ! 104, 105, 106, 107, -1, -1, 110, 111, 60, -1, ! -1, -1, -1, -1, 66, 1, -1, 3, 4, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, -1, -1, -1, -1, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! 46, 47, -1, -1, -1, 51, -1, 1, -1, 3, ! 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, 46, 47, -1, -1, -1, 51, 104, 105, ! 106, 107, -1, -1, 110, 111, 60, -1, -1, -1, ! -1, -1, 66, 1, -1, 3, 4, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 46, 47, ! -1, -1, -1, 51, -1, 1, -1, 3, 4, -1, ! -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! 46, 47, -1, -1, -1, 51, 104, 105, 106, 107, ! -1, -1, 110, 111, 60, -1, -1, -1, -1, -1, ! 66, 1, -1, 3, 4, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, -1, -1, -1, -1, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 46, 47, -1, -1, ! -1, 51, -1, 1, -1, 3, 4, -1, -1, -1, ! 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, 46, 47, ! -1, -1, -1, 51, 104, 105, 106, 107, -1, -1, ! 110, 111, 60, -1, -1, -1, -1, -1, 66, 1, ! -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! -1, -1, -1, -1, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 46, 47, -1, -1, -1, 51, ! -1, 1, -1, 3, 4, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, 46, 47, -1, -1, ! -1, 51, 104, 105, 106, 107, -1, -1, 110, 111, ! 60, -1, -1, -1, -1, -1, 66, 1, -1, 3, ! 4, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, -1, -1, ! -1, -1, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, 46, 47, -1, -1, -1, 51, -1, 1, ! -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, 46, 47, -1, -1, -1, 51, ! 104, 105, 106, 107, -1, -1, 110, 111, 60, -1, ! -1, -1, -1, -1, 66, 1, -1, 3, 4, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, -1, -1, -1, -1, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! 46, 47, -1, -1, -1, 51, -1, 1, -1, 3, ! 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, 46, 47, -1, -1, -1, 51, 104, 105, ! 106, 107, -1, -1, 110, 111, 60, -1, -1, -1, ! -1, -1, 66, 1, -1, 3, 4, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, -1, -1, -1, -1, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 46, 47, ! -1, -1, -1, 51, -1, 1, -1, 3, 4, -1, ! -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, ! -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! 46, 47, -1, -1, -1, 51, 104, 105, 106, 107, ! -1, -1, 110, 111, 60, -1, -1, -1, -1, -1, ! 66, 1, -1, 3, 4, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, -1, -1, -1, -1, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 46, 47, -1, -1, ! -1, 51, -1, 1, -1, 3, 4, -1, -1, -1, ! 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, 46, 47, ! -1, -1, -1, 51, 104, 105, 106, 107, -1, -1, ! 110, 111, 60, -1, -1, -1, -1, -1, 66, 1, ! -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! -1, -1, -1, -1, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 46, 47, -1, -1, -1, 51, ! -1, 1, -1, 3, 4, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, 46, 47, -1, -1, ! -1, 51, 104, 105, 106, 107, -1, -1, 110, 111, ! 60, -1, -1, 1, -1, 3, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, -1, -1, ! -1, -1, -1, -1, 104, 105, 106, 107, 46, 47, ! 110, 111, -1, 51, -1, 1, -1, -1, -1, -1, ! -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! 1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, 45, ! 46, 47, -1, -1, -1, 51, 104, 105, 106, 107, ! -1, -1, 110, 111, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, 1, -1, 46, 47, 73, -1, -1, ! 51, 77, -1, -1, -1, -1, -1, -1, 84, 60, ! -1, 87, 88, -1, -1, 66, -1, -1, 1, 95, ! -1, -1, 73, -1, -1, 101, 77, -1, 104, 105, ! 106, 107, -1, 84, 110, 111, 87, 88, 46, 47, ! -1, -1, -1, 51, 95, 96, -1, -1, -1, -1, ! -1, -1, 60, 104, 105, 106, 107, -1, 66, 110, ! 111, -1, -1, 46, 47, 73, -1, -1, 51, 77, ! -1, -1, 3, 4, -1, -1, 84, 60, -1, 87, ! 88, -1, -1, 66, -1, -1, -1, 95, 96, -1, ! 73, -1, -1, -1, 77, -1, 104, 105, 106, 107, ! -1, 84, 110, 111, 87, 88, -1, -1, -1, -1, ! -1, -1, 95, -1, -1, 46, 47, -1, -1, -1, ! 51, 104, 105, 106, 107, -1, -1, 110, 111, 60, ! -1, -1, -1, -1, -1, 66, -1, -1, 3, 4, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, -1, 84, -1, -1, 87, 88, -1, -1, ! 91, 92, -1, -1, 95, -1, 97, 98, -1, -1, ! -1, 102, -1, 104, 105, 106, 107, -1, -1, 110, ! 111, 46, 47, -1, -1, -1, 51, -1, -1, -1, ! 3, 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, -1, 84, ! -1, -1, 87, 88, -1, -1, 91, 92, -1, -1, ! 95, 96, -1, 46, 47, -1, -1, -1, 51, 104, ! 105, 106, 107, -1, -1, 110, 111, 60, -1, -1, ! -1, -1, -1, 66, -1, -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! -1, 84, -1, -1, 87, 88, -1, -1, 91, 92, ! -1, -1, 95, 96, -1, -1, -1, -1, -1, -1, ! -1, 104, 105, 106, 107, -1, -1, 110, 111, 46, ! 47, -1, -1, -1, 51, -1, -1, -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, -1, 84, -1, -1, ! 87, 88, -1, -1, 91, 92, -1, -1, 95, 96, ! -1, 46, 47, -1, -1, -1, 51, 104, 105, 106, ! 107, -1, -1, 110, 111, 60, -1, -1, -1, -1, ! -1, 66, -1, -1, 3, 4, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, -1, 84, ! -1, -1, 87, 88, -1, -1, 91, 92, -1, -1, ! 95, 96, -1, -1, -1, -1, -1, -1, -1, 104, ! 105, 106, 107, -1, -1, 110, 111, 46, 47, -1, ! -1, -1, 51, -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, -1, 84, -1, -1, 87, 88, ! -1, -1, 91, 92, -1, -1, 95, -1, 45, 46, ! 47, -1, -1, -1, 51, 104, 105, 106, 107, -1, ! -1, 110, 111, 60, -1, -1, -1, -1, -1, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, 51, ! 77, -1, -1, -1, -1, -1, -1, 84, 60, -1, ! 87, 88, -1, -1, 66, -1, -1, -1, 95, -1, ! -1, 73, -1, -1, -1, 77, -1, 104, 105, 106, ! 107, -1, 84, 110, 111, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, -1, -1, -1, -1, -1, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111 }; + #define YYPURE 1 ! /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ ! #line 3 "/usr/share/bison/bison.simple" ! ! /* Skeleton output parser for bison, ! ! Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software ! Foundation, Inc. ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, ! Boston, MA 02111-1307, USA. */ ! ! /* As a special exception, when this file is copied by Bison into a ! Bison output file, you may use that output file without restriction. ! This special exception was added by the Free Software Foundation ! in version 1.24 of Bison. */ ! ! /* This is the parser code that is written into each bison parser when ! the %semantic_parser declaration is not specified in the grammar. ! It was written by Richard Stallman by simplifying the hairy parser ! used when %semantic_parser is specified. */ ! ! /* All symbols defined below should begin with yy or YY, to avoid ! infringing on user name space. This should be done even for local ! variables, as they might otherwise be expanded by user macros. ! There are some unavoidable exceptions within include files to ! define necessary library symbols; they are noted "INFRINGES ON ! USER NAME SPACE" below. */ ! ! #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) ! ! /* The parser invokes alloca or malloc; define the necessary symbols. */ ! ! # if YYSTACK_USE_ALLOCA ! # define YYSTACK_ALLOC alloca ! # else ! # ifndef YYSTACK_USE_ALLOCA ! # if defined (alloca) || defined (_ALLOCA_H) ! # define YYSTACK_ALLOC alloca ! # else ! # ifdef __GNUC__ ! # define YYSTACK_ALLOC __builtin_alloca ! # endif ! # endif ! # endif ! # endif ! ! # ifdef YYSTACK_ALLOC ! /* Pacify GCC's `empty if-body' warning. */ ! # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) ! # else ! # if defined (__STDC__) || defined (__cplusplus) ! # include /* INFRINGES ON USER NAME SPACE */ ! # define YYSIZE_T size_t ! # endif ! # define YYSTACK_ALLOC malloc ! # define YYSTACK_FREE free ! # endif ! #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ ! ! ! #if (! defined (yyoverflow) \ ! && (! defined (__cplusplus) \ ! || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) ! ! /* A type that is properly aligned for any stack member. */ ! union yyalloc { ! short yyss; ! YYSTYPE yyvs; ! # if YYLSP_NEEDED ! YYLTYPE yyls; ! # endif }; + /* The size of the maximum gap between one aligned stack and the next. */ + # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) + + /* The size of an array large to enough to hold all stacks, each with + N elements. */ + # if YYLSP_NEEDED + # define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAX) + # else + # define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) + # endif + + /* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ + # ifndef YYCOPY + # if 1 < __GNUC__ + # define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) + # else + # define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) + # endif + # endif + + /* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ + # define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + + #endif + + #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif *************** static const unsigned short yystos[] = *** 2814,2847 **** #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) ! #define YYEMPTY (-2) #define YYEOF 0 - #define YYACCEPT goto yyacceptlab ! #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 - /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ ! yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ ! yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) --- 2612,2640 ---- #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) ! #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab ! #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ ! yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ ! yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) *************** while (0) *** 2849,2872 **** #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions ! are run). */ #ifndef YYLLOC_DEFAULT ! # define YYLLOC_DEFAULT(Current, Rhs, N) \ ! Current.first_line = Rhs[1].first_line; \ ! Current.first_column = Rhs[1].first_column; \ ! Current.last_line = Rhs[N].last_line; \ ! Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ ! #ifdef YYLEX_PARAM ! # define YYLEX yylex (&yylval, YYLEX_PARAM) ! #else ! # define YYLEX yylex (&yylval) ! #endif /* Enable debugging if requested. */ #if YYDEBUG --- 2642,2682 ---- #define YYTERROR 1 #define YYERRCODE 256 + /* YYLLOC_DEFAULT -- Compute the default location (before the actions ! are run). ! ! When YYLLOC_DEFAULT is run, CURRENT is set the location of the ! first token. By default, to implement support for ranges, extend ! its range to the last symbol. */ #ifndef YYLLOC_DEFAULT ! # define YYLLOC_DEFAULT(Current, Rhs, N) \ ! Current.last_line = Rhs[N].last_line; \ ! Current.last_column = Rhs[N].last_column; #endif + /* YYLEX -- calling `yylex' with the right arguments. */ ! #if YYPURE ! # if YYLSP_NEEDED ! # ifdef YYLEX_PARAM ! # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) ! # else ! # define YYLEX yylex (&yylval, &yylloc) ! # endif ! # else /* !YYLSP_NEEDED */ ! # ifdef YYLEX_PARAM ! # define YYLEX yylex (&yylval, YYLEX_PARAM) ! # else ! # define YYLEX yylex (&yylval) ! # endif ! # endif /* !YYLSP_NEEDED */ ! #else /* !YYPURE */ ! # define YYLEX yylex () ! #endif /* !YYPURE */ ! /* Enable debugging if requested. */ #if YYDEBUG *************** do { \ *** 2881,2973 **** if (yydebug) \ YYFPRINTF Args; \ } while (0) - - # define YYDSYMPRINT(Args) \ - do { \ - if (yydebug) \ - yysymprint Args; \ - } while (0) - - # define YYDSYMPRINTF(Title, Token, Value, Location) \ - do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ - } while (0) - - /*------------------------------------------------------------------. - | yy_stack_print -- Print the state stack from its BOTTOM up to its | - | TOP (cinluded). | - `------------------------------------------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yy_stack_print (short *bottom, short *top) - #else - static void - yy_stack_print (bottom, top) - short *bottom; - short *top; - #endif - { - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); - } - - # define YY_STACK_PRINT(Bottom, Top) \ - do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ - } while (0) - - - /*------------------------------------------------. - | Report that the YYRULE is going to be reduced. | - `------------------------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yy_reduce_print (int yyrule) - #else - static void - yy_reduce_print (yyrule) - int yyrule; - #endif - { - int yyi; - unsigned int yylineno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylineno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); - } - - # define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ - } while (0) - /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) - # define YYDSYMPRINT(Args) - # define YYDSYMPRINTF(Title, Token, Value, Location) - # define YY_STACK_PRINT(Bottom, Top) - # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ - /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 --- 2691,2703 ---- *************** int yydebug; *** 2987,2996 **** #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif - ! ! #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) --- 2717,2724 ---- #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif ! #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) *************** yystpcpy (yydest, yysrc) *** 3040,3165 **** } # endif # endif - - #endif /* !YYERROR_VERBOSE */ - - - - #if YYDEBUG - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) - #else - static void - yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; - #endif - { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - # ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); - # endif - } - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); - } - - #endif /* ! YYDEBUG */ - /*-----------------------------------------------. - | Release the memory associated to this symbol. | - `-----------------------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yydestruct (int yytype, YYSTYPE *yyvaluep) - #else - static void - yydestruct (yytype, yyvaluep) - int yytype; - YYSTYPE *yyvaluep; #endif - { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - switch (yytype) - { - - default: - break; - } - } ! /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) ! int yyparse (void *YYPARSE_PARAM); # else ! int yyparse (); # endif ! #else /* ! YYPARSE_PARAM */ ! #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); ! #else ! int yyparse (); #endif - #endif /* ! YYPARSE_PARAM */ ! /*----------. ! | yyparse. | ! `----------*/ - #ifdef YYPARSE_PARAM - # if defined (__STDC__) || defined (__cplusplus) - int yyparse (void *YYPARSE_PARAM) - # else - int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; - # endif - #else /* ! YYPARSE_PARAM */ - #if defined (__STDC__) || defined (__cplusplus) - int - yyparse (void) - #else int ! yyparse () ! ! #endif ! #endif { ! /* The lookahead symbol. */ ! int yychar; ! ! /* The semantic value of the lookahead symbol. */ ! YYSTYPE yylval; ! ! /* Number of syntax errors so far. */ ! int yynerrs; register int yystate; register int yyn; --- 2768,2845 ---- } # endif # endif #endif + #line 315 "/usr/share/bison/bison.simple" ! ! /* The user can define YYPARSE_PARAM as the name of an argument to be passed ! into yyparse. The argument should have type void *. ! It should actually point to an object. ! Grammar actions can access the variable by casting it ! to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) ! # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM ! # define YYPARSE_PARAM_DECL # else ! # define YYPARSE_PARAM_ARG YYPARSE_PARAM ! # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif ! #else /* !YYPARSE_PARAM */ ! # define YYPARSE_PARAM_ARG ! # define YYPARSE_PARAM_DECL ! #endif /* !YYPARSE_PARAM */ ! ! /* Prevent warning if -Wstrict-prototypes. */ ! #ifdef __GNUC__ ! # ifdef YYPARSE_PARAM ! int yyparse (void *); ! # else int yyparse (void); ! # endif #endif + /* YY_DECL_VARIABLES -- depending whether we use a pure parser, + variables are global, or local to YYPARSE. */ + #define YY_DECL_NON_LSP_VARIABLES \ + /* The lookahead symbol. */ \ + int yychar; \ + \ + /* The semantic value of the lookahead symbol. */ \ + YYSTYPE yylval; \ + \ + /* Number of parse errors so far. */ \ + int yynerrs; + #if YYLSP_NEEDED + # define YY_DECL_VARIABLES \ + YY_DECL_NON_LSP_VARIABLES \ + \ + /* Location data for the lookahead symbol. */ \ + YYLTYPE yylloc; + #else + # define YY_DECL_VARIABLES \ + YY_DECL_NON_LSP_VARIABLES + #endif + /* If nonreentrant, generate the variables here. */ ! #if !YYPURE ! YY_DECL_VARIABLES ! #endif /* !YYPURE */ int ! yyparse (YYPARSE_PARAM_ARG) ! YYPARSE_PARAM_DECL { ! /* If reentrant, generate the variables here. */ ! #if YYPURE ! YY_DECL_VARIABLES ! #endif /* !YYPURE */ register int yystate; register int yyn; *************** int yynerrs; *** 3167,3173 **** /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ ! int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, --- 2847,2853 ---- /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ ! int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, *************** int yynerrs; *** 3177,3183 **** Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ ! /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; --- 2857,2863 ---- Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ ! /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; *************** int yynerrs; *** 3187,3205 **** YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; ! ! #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; ! /* When reducing, the number of symbols on the RHS of the reduced ! rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); --- 2867,2897 ---- YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; + #if YYLSP_NEEDED + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + #endif ! #if YYLSP_NEEDED ! # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) ! #else ! # define YYPOPSTACK (yyvsp--, yyssp--) ! #endif YYSIZE_T yystacksize = YYINITDEPTH; + /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; ! #if YYLSP_NEEDED ! YYLTYPE yyloc; ! #endif /* When reducing, the number of symbols on the RHS of the reduced ! rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); *************** int yynerrs; *** 3216,3222 **** yyssp = yyss; yyvsp = yyvs; ! goto yysetstate; /*------------------------------------------------------------. --- 2908,2916 ---- yyssp = yyss; yyvsp = yyvs; ! #if YYLSP_NEEDED ! yylsp = yyls; ! #endif goto yysetstate; /*------------------------------------------------------------. *************** int yynerrs; *** 3231,3237 **** yysetstate: *yyssp = yystate; ! if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; --- 2925,2931 ---- yysetstate: *yyssp = yystate; ! if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; *************** int yynerrs; *** 3244,3260 **** YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the ! data in use in that stack, in bytes. This used to be a ! conditional around just the two extra args, but that might ! be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), ! &yystacksize); ! yyss = yyss1; yyvs = yyvs1; } --- 2938,2961 ---- YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the ! data in use in that stack, in bytes. */ ! # if YYLSP_NEEDED ! YYLTYPE *yyls1 = yyls; ! /* This used to be a conditional around just the two extra args, ! but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), ! &yyls1, yysize * sizeof (*yylsp), &yystacksize); ! yyls = yyls1; ! # else ! yyoverflow ("parser stack overflow", ! &yyss1, yysize * sizeof (*yyssp), ! &yyvs1, yysize * sizeof (*yyvsp), ! &yystacksize); ! # endif yyss = yyss1; yyvs = yyvs1; } *************** int yynerrs; *** 3263,3272 **** goto yyoverflowlab; # else /* Extend the stack our own way. */ ! if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; ! if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { --- 2964,2973 ---- goto yyoverflowlab; # else /* Extend the stack our own way. */ ! if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; ! if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { *************** int yynerrs; *** 3277,3284 **** goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); ! ! # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } --- 2978,2987 ---- goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); ! # if YYLSP_NEEDED ! YYSTACK_RELOCATE (yyls); ! # endif ! # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } *************** int yynerrs; *** 3287,3298 **** yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; ! YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); ! if (yyss + yystacksize - 1 <= yyssp) YYABORT; } --- 2990,3003 ---- yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; ! #if YYLSP_NEEDED ! yylsp = yyls + yysize - 1; ! #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); ! if (yyssp >= yyss + yystacksize - 1) YYABORT; } *************** int yynerrs; *** 3300,3305 **** --- 3005,3011 ---- goto yybackup; + /*-----------. | yybackup. | `-----------*/ *************** yybackup: *** 3312,3366 **** /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; ! if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ ! /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } ! if (yychar <= YYEOF) { ! yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { ! yytoken = YYTRANSLATE (yychar); ! YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } ! /* If the proper action on seeing token YYTOKEN is to reduce or to ! detect an error, take that action. */ ! yyn += yytoken; ! if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; ! if (yyn <= 0) { ! if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ ! YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; ! /* Count tokens shifted since error; after three, turn off error status. */ --- 3018,3105 ---- /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; ! if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ ! /* yychar is either YYEMPTY or YYEOF ! or a valid token in external form. */ ! if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } ! /* Convert token to internal form (in yychar1) for indexing tables with */ ! ! if (yychar <= 0) /* This means end of input. */ { ! yychar1 = 0; ! yychar = YYEOF; /* Don't call YYLEX any more */ ! YYDPRINTF ((stderr, "Now at end of input.\n")); } else { ! yychar1 = YYTRANSLATE (yychar); ! ! #if YYDEBUG ! /* We have to keep this `#if YYDEBUG', since we use variables ! which are defined only if `YYDEBUG' is set. */ ! if (yydebug) ! { ! YYFPRINTF (stderr, "Next token is %d (%s", ! yychar, yytname[yychar1]); ! /* Give the individual parser a way to print the precise ! meaning of a token, for further debugging info. */ ! # ifdef YYPRINT ! YYPRINT (stderr, yychar, yylval); ! # endif ! YYFPRINTF (stderr, ")\n"); ! } ! #endif } ! yyn += yychar1; ! if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; + yyn = yytable[yyn]; ! ! /* yyn is what to do for this token type in this state. ! Negative => reduce, -yyn is rule number. ! Positive => shift, yyn is new state. ! New state is final state => don't bother to shift, ! just return success. ! 0, or most negative number => error. */ ! ! if (yyn < 0) { ! if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ ! YYDPRINTF ((stderr, "Shifting token %d (%s), ", ! yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; ! #if YYLSP_NEEDED ! *++yylsp = yylloc; ! #endif /* Count tokens shifted since error; after three, turn off error status. */ *************** yyreduce: *** 3391,3507 **** /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. ! Otherwise, the following line sets YYVAL to garbage. ! This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; ! YY_REDUCE_PRINT (yyn); ! switch (yyn) ! { ! case 2: ! #line 606 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" { /* Register static variables with the garbage collector. */ ! ggc_add_tree_root (&label_id, 1); ! ggc_add_tree_root (&wfl_string_buffer, 1); ! ggc_add_tree_root (&wfl_append, 1); ! ggc_add_tree_root (&wfl_to_string, 1); ! ggc_add_tree_root (&java_lang_id, 1); ! ggc_add_tree_root (&inst_id, 1); ! ggc_add_tree_root (&java_lang_cloneable, 1); ! ggc_add_tree_root (&java_io_serializable, 1); ! ggc_add_tree_root (¤t_static_block, 1); ! ggc_add_tree_root (&wpv_id, 1); ! ggc_add_tree_root (&package_list, 1); ! ggc_add_tree_root (¤t_this, 1); ! ggc_add_tree_root (¤tly_caught_type_list, 1); ! ggc_add_tree_root (&case_label_list, 1); ! ggc_add_root (&ctxp, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); ! ggc_add_root (&ctxp_for_generation, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); ! ;} ! break; ! ! case 3: ! #line 631 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {;} ! break; ! ! case 20: ! #line 675 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { int osb = pop_current_osb (ctxp); tree t = build_java_array_type ((yyvsp[-1].node), -1); while (--osb) t = build_unresolved_array_type (t); yyval.node = t; ! ;} ! break; ! ! case 21: ! #line 683 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { int osb = pop_current_osb (ctxp); tree t = yyvsp[-1].node; while (osb--) t = build_unresolved_array_type (t); yyval.node = t; ! ;} ! break; ! ! case 25: ! #line 704 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = make_qualified_name (yyvsp[-2].node, yyvsp[0].node, yyvsp[-1].operator.location); ;} ! break; ! ! case 27: ! #line 713 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = NULL;;} ! break; ! ! case 35: ! #line 725 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL; ! ;} ! break; ! ! case 36: ! #line 729 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL; ! ;} ! break; ! ! case 39: ! #line 741 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->package = EXPR_WFL_NODE (yyvsp[-1].node); register_package (ctxp->package); ! ;} ! break; ! ! case 40: ! #line 746 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing name"); RECOVER;;} ! break; ! ! case 41: ! #line 748 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 44: ! #line 758 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree name = EXPR_WFL_NODE (yyvsp[-1].node), last_name; int i = IDENTIFIER_LENGTH (name)-1; const char *last = &IDENTIFIER_POINTER (name)[i]; --- 3130,3243 ---- /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. ! Otherwise, the following line sets YYVAL to the semantic value of ! the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; + #if YYLSP_NEEDED + /* Similarly for the default location. Let the user run additional + commands if for instance locations are ranges. */ + yyloc = yylsp[1-yylen]; + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + #endif ! #if YYDEBUG ! /* We have to keep this `#if YYDEBUG', since we use variables which ! are defined only if `YYDEBUG' is set. */ ! if (yydebug) { + int yyi; + + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } + #endif + + switch (yyn) { + + case 1: + #line 606 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" + { /* Register static variables with the garbage collector. */ ! ggc_add_root (&ctxp, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); ! ggc_add_root (&ctxp_for_generation, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); ! ; ! break;} ! case 2: ! #line 617 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {; ! break;} ! case 19: ! #line 661 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { int osb = pop_current_osb (ctxp); tree t = build_java_array_type ((yyvsp[-1].node), -1); while (--osb) t = build_unresolved_array_type (t); yyval.node = t; ! ; ! break;} ! case 20: ! #line 669 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { int osb = pop_current_osb (ctxp); tree t = yyvsp[-1].node; while (osb--) t = build_unresolved_array_type (t); yyval.node = t; ! ; ! break;} ! case 24: ! #line 690 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = make_qualified_name (yyvsp[-2].node, yyvsp[0].node, yyvsp[-1].operator.location); ; ! break;} ! case 26: ! #line 699 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = NULL;; ! break;} ! case 34: ! #line 711 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL; ! ; ! break;} ! case 35: ! #line 715 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL; ! ; ! break;} ! case 38: ! #line 727 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->package = EXPR_WFL_NODE (yyvsp[-1].node); register_package (ctxp->package); ! ; ! break;} ! case 39: ! #line 732 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing name"); RECOVER;; ! break;} ! case 40: ! #line 734 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 43: ! #line 744 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree name = EXPR_WFL_NODE (yyvsp[-1].node), last_name; int i = IDENTIFIER_LENGTH (name)-1; const char *last = &IDENTIFIER_POINTER (name)[i]; *************** yyreduce: *** 3518,3546 **** if (err && err != name) parse_error_context (yyvsp[-1].node, "Ambiguous class: `%s' and `%s'", ! IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (err)); else REGISTER_IMPORT (yyvsp[-1].node, last_name); } else REGISTER_IMPORT (yyvsp[-1].node, last_name); ! ;} ! break; ! ! case 45: ! #line 784 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing name"); RECOVER;;} ! break; ! ! case 46: ! #line 786 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 47: ! #line 791 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree name = EXPR_WFL_NODE (yyvsp[-3].node); tree it; /* Search for duplicates. */ --- 3254,3279 ---- if (err && err != name) parse_error_context (yyvsp[-1].node, "Ambiguous class: `%s' and `%s'", ! IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (err)); else REGISTER_IMPORT (yyvsp[-1].node, last_name); } else REGISTER_IMPORT (yyvsp[-1].node, last_name); ! ; ! break;} ! case 44: ! #line 770 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing name"); RECOVER;; ! break;} ! case 45: ! #line 772 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 46: ! #line 777 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree name = EXPR_WFL_NODE (yyvsp[-3].node); tree it; /* Search for duplicates. */ *************** yyreduce: *** 3552,4772 **** if (! it) { read_import_dir (yyvsp[-3].node); ! ctxp->import_demand_list = chainon (ctxp->import_demand_list, build_tree_list (yyvsp[-3].node, NULL_TREE)); } ! ;} ! break; ! ! case 48: ! #line 809 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'*' expected"); RECOVER;;} ! break; ! ! case 49: ! #line 811 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 50: ! #line 816 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { end_class_declaration (0); ;} ! break; ! ! case 51: ! #line 818 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { end_class_declaration (0); ;} ! break; ! ! case 53: ! #line 821 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { YYERROR_NOW; yyerror ("Class or interface declaration expected"); ! ;} ! break; ! ! case 54: ! #line 832 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.value = (1 << yyvsp[0].value); ! ;} ! break; ! ! case 55: ! #line 836 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { int acc = (1 << yyvsp[0].value); if (yyval.value & acc) ! parse_error_context (ctxp->modifier_ctx [yyvsp[0].value], "Modifier `%s' declared twice", java_accstring_lookup (acc)); else { yyval.value |= acc; } ! ;} ! break; ! ! case 56: ! #line 852 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_class (yyvsp[-4].value, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 57: ! #line 854 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {;;} ! break; ! ! case 58: ! #line 856 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_class (0, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 59: ! #line 858 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {;;} ! break; ! ! case 60: ! #line 860 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing class name"); RECOVER;;} ! break; ! ! case 61: ! #line 862 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing class name"); RECOVER;;} ! break; ! ! case 62: ! #line 864 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! if (!ctxp->class_err) yyerror ("'{' expected"); DRECOVER(class1); ! ;} ! break; ! ! case 63: ! #line 869 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {if (!ctxp->class_err) yyerror ("'{' expected"); RECOVER;;} ! break; ! ! case 64: ! #line 873 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL; ;} ! break; ! ! case 65: ! #line 875 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 66: ! #line 877 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); ctxp->class_err=1;;} ! break; ! ! case 67: ! #line 879 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing super class name"); ctxp->class_err=1;;} ! break; ! ! case 68: ! #line 883 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 69: ! #line 885 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 70: ! #line 887 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->class_err=1; ! yyerror ("Missing interface name"); ! ;} ! break; ! ! case 71: ! #line 895 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->interface_number = 1; yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); ! ;} ! break; ! ! case 72: ! #line 900 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->interface_number++; yyval.node = chainon (yyvsp[-2].node, build_tree_list (yyvsp[0].node, NULL_TREE)); ! ;} ! break; ! ! case 73: ! #line 905 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing interface name"); RECOVER;;} ! break; ! ! case 74: ! #line 910 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); yyval.node = GET_CPC (); ! ;} ! break; ! ! case 75: ! #line 918 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); yyval.node = GET_CPC (); ! ;} ! break; ! ! case 81: ! #line 937 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { if (yyvsp[0].node != empty_stmt_node) { TREE_CHAIN (yyvsp[0].node) = CPC_INSTANCE_INITIALIZER_STMT (ctxp); SET_CPC_INSTANCE_INITIALIZER_STMT (ctxp, yyvsp[0].node); } ! ;} ! break; ! ! case 84: ! #line 950 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { end_class_declaration (1); ;} ! break; ! ! case 85: ! #line 952 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { end_class_declaration (1); ;} ! break; ! ! case 87: ! #line 959 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { register_fields (0, yyvsp[-2].node, yyvsp[-1].node); ;} ! break; ! ! case 88: ! #line 961 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! check_modifiers ("Illegal modifier `%s' for field declaration", yyvsp[-3].value, FIELD_MODIFIERS); check_modifiers_consistency (yyvsp[-3].value); register_fields (yyvsp[-3].value, yyvsp[-2].node, yyvsp[-1].node); ! ;} ! break; ! ! case 90: ! #line 974 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = chainon (yyvsp[-2].node, yyvsp[0].node); ;} ! break; ! ! case 91: ! #line 976 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 92: ! #line 981 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); ;} ! break; ! ! case 93: ! #line 983 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { if (java_error_count) yyvsp[0].node = NULL_TREE; ! yyval.node = build_tree_list (yyvsp[-2].node, build_assignment (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node)); ! ;} ! break; ! ! case 94: ! #line 990 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Missing variable initializer"); yyval.node = build_tree_list (yyvsp[-2].node, NULL_TREE); RECOVER; ! ;} ! break; ! ! case 95: ! #line 996 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("';' expected"); yyval.node = build_tree_list (yyvsp[-3].node, NULL_TREE); RECOVER; ! ;} ! break; ! ! case 97: ! #line 1006 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_unresolved_array_type (yyvsp[-2].node); ;} ! break; ! ! case 98: ! #line 1008 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Invalid declaration"); DRECOVER(vdi);;} ! break; ! ! case 99: ! #line 1010 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! tree node = java_lval.node; ! if (node && (TREE_CODE (node) == INTEGER_CST ! || TREE_CODE (node) == EXPR_WITH_FILE_LOCATION)) ! yyerror ("Can't specify array dimension in a declaration"); ! else ! yyerror ("']' expected"); DRECOVER(vdi); ! ;} ! break; ! ! case 100: ! #line 1020 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Unbalanced ']'"); DRECOVER(vdi);;} ! break; ! ! case 103: ! #line 1031 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { current_function_decl = yyvsp[0].node; if (current_function_decl && TREE_CODE (current_function_decl) == FUNCTION_DECL) source_start_java_method (current_function_decl); else current_function_decl = NULL_TREE; ! ;} ! break; ! ! case 104: ! #line 1040 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { finish_method_declaration (yyvsp[0].node); ;} ! break; ! ! case 105: ! #line 1042 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {YYNOT_TWICE yyerror ("'{' expected"); RECOVER;;} ! break; ! ! case 106: ! #line 1047 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_header (0, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 107: ! #line 1049 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_header (0, void_type_node, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 108: ! #line 1051 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_header (yyvsp[-3].value, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 109: ! #line 1053 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_header (yyvsp[-3].value, void_type_node, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 110: ! #line 1055 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Invalid method declaration, method name required"); RECOVER; ! ;} ! break; ! ! case 111: ! #line 1060 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {RECOVER;;} ! break; ! ! case 112: ! #line 1062 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Identifier expected"); RECOVER;;} ! break; ! ! case 113: ! #line 1064 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Identifier expected"); RECOVER;;} ! break; ! ! case 114: ! #line 1066 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Invalid method declaration, return type required"); RECOVER; ! ;} ! break; ! ! case 115: ! #line 1074 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number = 0; yyval.node = method_declarator (yyvsp[-2].node, NULL_TREE); ! ;} ! break; ! ! case 116: ! #line 1079 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_declarator (yyvsp[-3].node, yyvsp[-1].node); ;} ! break; ! ! case 117: ! #line 1081 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { EXPR_WFL_LINECOL (wfl_operator) = yyvsp[-1].operator.location; ! TREE_PURPOSE (yyvsp[-2].node) = build_unresolved_array_type (TREE_PURPOSE (yyvsp[-2].node)); ! parse_warning_context ! (wfl_operator, "Discouraged form of returned type specification"); ! ;} ! break; ! ! case 118: ! #line 1090 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); DRECOVER(method_declarator);;} ! break; ! ! case 119: ! #line 1092 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("']' expected"); RECOVER;;} ! break; ! ! case 120: ! #line 1097 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number = 1; ! ;} ! break; ! ! case 121: ! #line 1101 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number += 1; yyval.node = chainon (yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 122: ! #line 1106 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Missing formal parameter term"); RECOVER; ;} ! break; ! ! case 123: ! #line 1111 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, yyvsp[-1].node); ! ;} ! break; ! ! case 124: ! #line 1115 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, yyvsp[-1].node); ARG_FINAL_P (yyval.node) = 1; ! ;} ! break; ! ! case 125: ! #line 1120 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Missing identifier"); RECOVER; yyval.node = NULL_TREE; ! ;} ! break; ! ! case 126: ! #line 1125 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Missing identifier"); RECOVER; yyval.node = NULL_TREE; ! ;} ! break; ! ! case 127: ! #line 1133 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { check_modifiers ("Illegal modifier `%s'. Only `final' was expected here", yyvsp[0].value, ACC_FINAL); if (yyvsp[0].value != ACC_FINAL) MODIFIER_WFL (FINAL_TK) = build_wfl_node (NULL_TREE); ! ;} ! break; ! ! case 128: ! #line 1142 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 129: ! #line 1144 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 130: ! #line 1146 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing class type term"); RECOVER;;} ! break; ! ! case 131: ! #line 1151 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, yyvsp[0].node); ;} ! break; ! ! case 132: ! #line 1153 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = tree_cons (yyvsp[0].node, yyvsp[0].node, yyvsp[-2].node); ;} ! break; ! ! case 133: ! #line 1155 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing class type term"); RECOVER;;} ! break; ! ! case 135: ! #line 1160 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 136: ! #line 1166 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { TREE_CHAIN (yyvsp[0].node) = CPC_STATIC_INITIALIZER_STMT (ctxp); SET_CPC_STATIC_INITIALIZER_STMT (ctxp, yyvsp[0].node); current_static_block = NULL_TREE; ! ;} ! break; ! ! case 137: ! #line 1175 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { check_modifiers ("Illegal modifier `%s' for static initializer", yyvsp[0].value, ACC_STATIC); /* Can't have a static initializer in an innerclass */ if (yyvsp[0].value | ACC_STATIC && GET_CPC_LIST () && !TOPLEVEL_CLASS_DECL_P (GET_CPC ())) ! parse_error_context (MODIFIER_WFL (STATIC_TK), "Can't define static initializer in class `%s'. Static initializer can only be defined in top-level classes", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ()))); SOURCE_FRONTEND_DEBUG (("Modifiers: %d", yyvsp[0].value)); ! ;} ! break; ! ! case 138: ! #line 1191 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { current_function_decl = yyvsp[0].node; source_start_java_method (current_function_decl); ! ;} ! break; ! ! case 139: ! #line 1196 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { finish_method_declaration (yyvsp[0].node); ;} ! break; ! ! case 140: ! #line 1201 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_header (0, NULL_TREE, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 141: ! #line 1203 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_header (yyvsp[-2].value, NULL_TREE, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 142: ! #line 1208 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! ctxp->formal_parameter_number = 0; yyval.node = method_declarator (yyvsp[-2].node, NULL_TREE); ! ;} ! break; ! ! case 143: ! #line 1213 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = method_declarator (yyvsp[-3].node, yyvsp[-1].node); ;} ! break; ! ! case 144: ! #line 1221 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { BLOCK_EXPR_BODY (yyvsp[0].node) = empty_stmt_node; yyval.node = yyvsp[0].node; ! ;} ! break; ! ! case 145: ! #line 1226 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 146: ! #line 1228 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 147: ! #line 1230 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 149: ! #line 1240 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = build_method_invocation (yyvsp[-3].node, NULL_TREE); yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-3].node), yyval.node); yyval.node = java_method_add_stmt (current_function_decl, yyval.node); ! ;} ! break; ! ! case 150: ! #line 1246 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = build_method_invocation (yyvsp[-4].node, yyvsp[-2].node); yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-4].node), yyval.node); yyval.node = java_method_add_stmt (current_function_decl, yyval.node); ! ;} ! break; ! ! case 151: ! #line 1254 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = parse_jdk1_1_error ("explicit constructor invocation"); ;} ! break; ! ! case 152: ! #line 1256 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = parse_jdk1_1_error ("explicit constructor invocation"); ;} ! break; ! ! case 153: ! #line 1261 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree wfl = build_wfl_node (this_identifier_node); EXPR_WFL_LINECOL (wfl) = yyvsp[0].operator.location; yyval.node = wfl; ! ;} ! break; ! ! case 154: ! #line 1267 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree wfl = build_wfl_node (super_identifier_node); EXPR_WFL_LINECOL (wfl) = yyvsp[0].operator.location; yyval.node = wfl; ! ;} ! break; ! ! case 155: ! #line 1278 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_interface (0, yyvsp[0].node, NULL_TREE); ;} ! break; ! ! case 156: ! #line 1280 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ; ;} ! break; ! ! case 157: ! #line 1282 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_interface (yyvsp[-2].value, yyvsp[0].node, NULL_TREE); ;} ! break; ! ! case 158: ! #line 1284 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ; ;} ! break; ! ! case 159: ! #line 1286 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_interface (0, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 160: ! #line 1288 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ; ;} ! break; ! ! case 161: ! #line 1290 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_interface (yyvsp[-3].value, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 162: ! #line 1292 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ; ;} ! break; ! ! case 163: ! #line 1294 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER;;} ! break; ! ! case 164: ! #line 1296 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER;;} ! break; ! ! case 165: ! #line 1301 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->interface_number = 1; yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); ! ;} ! break; ! ! case 166: ! #line 1306 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->interface_number++; yyval.node = chainon (yyvsp[-2].node, build_tree_list (yyvsp[0].node, NULL_TREE)); ! ;} ! break; ! ! case 167: ! #line 1311 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Invalid interface type"); RECOVER;;} ! break; ! ! case 168: ! #line 1313 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 169: ! #line 1318 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 170: ! #line 1320 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 175: ! #line 1332 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { end_class_declaration (1); ;} ! break; ! ! case 176: ! #line 1334 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { end_class_declaration (1); ;} ! break; ! ! case 178: ! #line 1343 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { check_abstract_method_header (yyvsp[-1].node); current_function_decl = NULL_TREE; /* FIXME ? */ ! ;} ! break; ! ! case 179: ! #line 1348 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 180: ! #line 1354 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-1].operator.location, NULL_TREE); ;} ! break; ! ! case 181: ! #line 1356 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-2].operator.location, NULL_TREE); ;} ! break; ! ! case 182: ! #line 1358 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-2].operator.location, yyvsp[-1].node); ;} ! break; ! ! case 183: ! #line 1360 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-3].operator.location, yyvsp[-2].node); ;} ! break; ! ! case 184: ! #line 1365 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = tree_cons (maybe_build_array_element_wfl (yyvsp[0].node), yyvsp[0].node, NULL_TREE); ! ;} ! break; ! ! case 185: ! #line 1370 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = tree_cons (maybe_build_array_element_wfl (yyvsp[0].node), yyvsp[0].node, yyvsp[-2].node); ! ;} ! break; ! ! case 186: ! #line 1374 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 187: ! #line 1380 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); ! yyval.node = empty_stmt_node; ! ;} ! break; ! ! case 188: ! #line 1388 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 189: ! #line 1393 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { enter_block (); ;} ! break; ! ! case 190: ! #line 1398 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { maybe_absorb_scoping_blocks (); /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = ! EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); yyval.node = exit_block (); if (!BLOCK_SUBBLOCKS (yyval.node)) BLOCK_SUBBLOCKS (yyval.node) = empty_stmt_node; ! ;} ! break; ! ! case 194: ! #line 1418 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { java_method_add_stmt (current_function_decl, yyvsp[0].node); ;} ! break; ! ! case 195: ! #line 1420 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { LOCAL_CLASS_P (TREE_TYPE (GET_CPC ())) = 1; end_class_declaration (1); ! ;} ! break; ! ! case 197: ! #line 1432 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { declare_local_variables (0, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 198: ! #line 1434 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { declare_local_variables (yyvsp[-2].value, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 204: ! #line 1444 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = exit_block (); ;} ! break; ! ! case 209: ! #line 1453 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = exit_block (); ;} ! break; ! ! case 221: ! #line 1472 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! if (flag_extraneous_semicolon ! && ! current_static_block ! && (! current_function_decl || /* Verify we're not in a inner class declaration */ (GET_CPC () != TYPE_NAME (DECL_CONTEXT (current_function_decl))))) ! { EXPR_WFL_SET_LINECOL (wfl_operator, lineno, -1); parse_warning_context (wfl_operator, "An empty declaration is a deprecated feature that should not be used"); } yyval.node = empty_stmt_node; ! ;} ! break; ! ! case 222: ! #line 1490 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = build_labeled_block (EXPR_WFL_LINECOL (yyvsp[-1].node), EXPR_WFL_NODE (yyvsp[-1].node)); pushlevel (2); push_labeled_block (yyval.node); PUSH_LABELED_BLOCK (yyval.node); ! ;} ! break; ! ! case 223: ! #line 1501 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_labeled_statement (yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 224: ! #line 1503 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("':' expected"); RECOVER;;} ! break; ! ! case 225: ! #line 1508 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_labeled_statement (yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 226: ! #line 1515 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* We have a statement. Generate a WFL around it so we can debug it */ yyval.node = build_expr_wfl (yyvsp[-1].node, input_filename, lineno, 0); /* We know we have a statement, so set the debug info to be eventually generate here. */ yyval.node = JAVA_MAYBE_GENERATE_DEBUG_INFO (yyval.node); ! ;} ! break; ! ! case 227: ! #line 1524 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); ! ;} ! break; ! ! case 228: ! #line 1529 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); ! ;} ! break; ! ! case 229: ! #line 1534 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); ! ;} ! break; ! ! case 230: ! #line 1539 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 231: ! #line 1541 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { parse_ctor_invocation_error (); RECOVER; ! ;} ! break; ! ! case 232: ! #line 1546 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 233: ! #line 1548 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { parse_ctor_invocation_error (); RECOVER; ! ;} ! break; ! ! case 234: ! #line 1553 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;;} ! break; ! ! case 235: ! #line 1555 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 236: ! #line 1557 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 237: ! #line 1559 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 238: ! #line 1561 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 246: ! #line 1576 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = build_if_else_statement (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node, NULL_TREE); ! ;} ! break; ! ! case 247: ! #line 1581 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;;} ! break; ! ! case 248: ! #line 1583 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 249: ! #line 1585 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 250: ! #line 1590 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_if_else_statement (yyvsp[-5].operator.location, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ;} ! break; ! ! case 251: ! #line 1595 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_if_else_statement (yyvsp[-5].operator.location, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ;} ! break; ! ! case 252: ! #line 1600 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { enter_block (); ! ;} ! break; ! ! case 253: ! #line 1604 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* Make into "proper list" of COMPOUND_EXPRs. I.e. make the last statement also have its own COMPOUND_EXPR. */ maybe_absorb_scoping_blocks (); TREE_OPERAND (yyvsp[-2].node, 1) = exit_block (); yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-2].node), yyvsp[-2].node); ! ;} ! break; ! ! case 254: ! #line 1616 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build (SWITCH_EXPR, NULL_TREE, yyvsp[-1].node, NULL_TREE); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-2].operator.location; ! ;} ! break; ! ! case 255: ! #line 1621 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;;} ! break; ! ! case 256: ! #line 1623 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term or ')'"); DRECOVER(switch_statement);;} ! break; ! ! case 257: ! #line 1625 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER;;} ! break; ! ! case 258: ! #line 1633 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 259: ! #line 1635 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 260: ! #line 1637 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 261: ! #line 1639 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ;} ! break; ! ! case 267: ! #line 1658 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree lab = build1 (CASE_EXPR, NULL_TREE, yyvsp[-1].node); EXPR_WFL_LINECOL (lab) = yyvsp[-2].operator.location; java_method_add_stmt (current_function_decl, lab); ! ;} ! break; ! ! case 268: ! #line 1664 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree lab = build (DEFAULT_EXPR, NULL_TREE, NULL_TREE); EXPR_WFL_LINECOL (lab) = yyvsp[-1].operator.location; java_method_add_stmt (current_function_decl, lab); ! ;} ! break; ! ! case 269: ! #line 1670 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing or invalid constant expression"); RECOVER;;} ! break; ! ! case 270: ! #line 1672 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("':' expected"); RECOVER;;} ! break; ! ! case 271: ! #line 1674 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("':' expected"); RECOVER;;} ! break; ! ! case 272: ! #line 1679 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree body = build_loop_body (yyvsp[-2].operator.location, yyvsp[-1].node, 0); yyval.node = build_new_loop (body); ! ;} ! break; ! ! case 273: ! #line 1687 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_loop_body (0, NULL_TREE, yyvsp[0].node, 0); ;} ! break; ! ! case 274: ! #line 1689 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {YYERROR_NOW; yyerror ("'(' expected"); RECOVER;;} ! break; ! ! case 275: ! #line 1691 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term and ')' expected"); RECOVER;;} ! break; ! ! case 276: ! #line 1693 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 277: ! #line 1698 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_loop_body (0, NULL_TREE, yyvsp[0].node, 0); ;} ! break; ! ! case 278: ! #line 1703 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree body = build_loop_body (0, NULL_TREE, 1); yyval.node = build_new_loop (body); ! ;} ! break; ! ! case 279: ! #line 1712 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_loop_body (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[-5].node, 1); ;} ! break; ! ! case 280: ! #line 1717 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-4].node)) == 'c') yyvsp[-4].node = build_wfl_node (yyvsp[-4].node); yyval.node = finish_for_loop (EXPR_WFL_LINECOL (yyvsp[-4].node), yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 281: ! #line 1723 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_for_loop (0, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY (yyval.node), 0) = empty_stmt_node; ! ;} ! break; ! ! case 282: ! #line 1730 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Invalid control expression"); RECOVER;;} ! break; ! ! case 283: ! #line 1732 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Invalid update expression"); RECOVER;;} ! break; ! ! case 284: ! #line 1734 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Invalid update expression"); RECOVER;;} ! break; ! ! case 285: ! #line 1739 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_for_loop (EXPR_WFL_LINECOL (yyvsp[-4].node), yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node);;} ! break; ! ! case 286: ! #line 1741 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = finish_for_loop (0, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY (yyval.node), 0) = empty_stmt_node; ! ;} ! break; ! ! case 287: ! #line 1751 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* This scope defined for local variable that may be defined within the scope of the for loop */ ! enter_block (); ! ;} ! break; ! ! case 288: ! #line 1757 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); DRECOVER(for_1);;} ! break; ! ! case 289: ! #line 1759 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Invalid init statement"); RECOVER;;} ! break; ! ! case 290: ! #line 1764 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* We now declare the loop body. The loop is declared as a for loop. */ tree body = build_loop_body (0, NULL_TREE, 0); --- 3285,4322 ---- if (! it) { read_import_dir (yyvsp[-3].node); ! ctxp->import_demand_list = chainon (ctxp->import_demand_list, build_tree_list (yyvsp[-3].node, NULL_TREE)); } ! ; ! break;} ! case 47: ! #line 795 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'*' expected"); RECOVER;; ! break;} ! case 48: ! #line 797 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 49: ! #line 802 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { end_class_declaration (0); ; ! break;} ! case 50: ! #line 804 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { end_class_declaration (0); ; ! break;} ! case 52: ! #line 807 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { YYERROR_NOW; yyerror ("Class or interface declaration expected"); ! ; ! break;} ! case 53: ! #line 818 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.value = (1 << yyvsp[0].value); ! ; ! break;} ! case 54: ! #line 822 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { int acc = (1 << yyvsp[0].value); if (yyval.value & acc) ! parse_error_context (ctxp->modifier_ctx [yyvsp[0].value], "Modifier `%s' declared twice", java_accstring_lookup (acc)); else { yyval.value |= acc; } ! ; ! break;} ! case 55: ! #line 838 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_class (yyvsp[-4].value, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 56: ! #line 840 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {;; ! break;} ! case 57: ! #line 842 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_class (0, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 58: ! #line 844 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {;; ! break;} ! case 59: ! #line 846 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing class name"); RECOVER; ; ! break;} ! case 60: ! #line 848 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing class name"); RECOVER; ; ! break;} ! case 61: ! #line 850 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! if (!ctxp->class_err) yyerror ("'{' expected"); DRECOVER(class1); ! ; ! break;} ! case 62: ! #line 855 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { if (!ctxp->class_err) yyerror ("'{' expected"); RECOVER; ; ! break;} ! case 63: ! #line 859 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL; ; ! break;} ! case 64: ! #line 861 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 65: ! #line 863 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); ctxp->class_err=1;; ! break;} ! case 66: ! #line 865 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing super class name"); ctxp->class_err=1;; ! break;} ! case 67: ! #line 869 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 68: ! #line 871 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 69: ! #line 873 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->class_err=1; ! yyerror ("Missing interface name"); ! ; ! break;} ! case 70: ! #line 881 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->interface_number = 1; yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); ! ; ! break;} ! case 71: ! #line 886 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->interface_number++; yyval.node = chainon (yyvsp[-2].node, build_tree_list (yyvsp[0].node, NULL_TREE)); ! ; ! break;} ! case 72: ! #line 891 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing interface name"); RECOVER;; ! break;} ! case 73: ! #line 896 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); yyval.node = GET_CPC (); ! ; ! break;} ! case 74: ! #line 904 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); yyval.node = GET_CPC (); ! ; ! break;} ! case 80: ! #line 923 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { if (yyvsp[0].node != empty_stmt_node) { TREE_CHAIN (yyvsp[0].node) = CPC_INSTANCE_INITIALIZER_STMT (ctxp); SET_CPC_INSTANCE_INITIALIZER_STMT (ctxp, yyvsp[0].node); } ! ; ! break;} ! case 83: ! #line 936 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { end_class_declaration (1); ; ! break;} ! case 84: ! #line 938 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { end_class_declaration (1); ; ! break;} ! case 86: ! #line 945 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { register_fields (0, yyvsp[-2].node, yyvsp[-1].node); ; ! break;} ! case 87: ! #line 947 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! check_modifiers ("Illegal modifier `%s' for field declaration", yyvsp[-3].value, FIELD_MODIFIERS); check_modifiers_consistency (yyvsp[-3].value); register_fields (yyvsp[-3].value, yyvsp[-2].node, yyvsp[-1].node); ! ; ! break;} ! case 89: ! #line 960 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = chainon (yyvsp[-2].node, yyvsp[0].node); ; ! break;} ! case 90: ! #line 962 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 91: ! #line 967 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); ; ! break;} ! case 92: ! #line 969 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { if (java_error_count) yyvsp[0].node = NULL_TREE; ! yyval.node = build_tree_list (yyvsp[-2].node, build_assignment (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node)); ! ; ! break;} ! case 93: ! #line 976 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing variable initializer"); yyval.node = build_tree_list (yyvsp[-2].node, NULL_TREE); RECOVER; ! ; ! break;} ! case 94: ! #line 982 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("';' expected"); yyval.node = build_tree_list (yyvsp[-3].node, NULL_TREE); RECOVER; ! ; ! break;} ! case 96: ! #line 992 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_unresolved_array_type (yyvsp[-2].node); ; ! break;} ! case 97: ! #line 994 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Invalid declaration"); DRECOVER(vdi);; ! break;} ! case 98: ! #line 996 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyerror ("']' expected"); DRECOVER(vdi); ! ; ! break;} ! case 99: ! #line 1001 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Unbalanced ']'"); DRECOVER(vdi);; ! break;} ! case 102: ! #line 1012 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { current_function_decl = yyvsp[0].node; if (current_function_decl && TREE_CODE (current_function_decl) == FUNCTION_DECL) source_start_java_method (current_function_decl); else current_function_decl = NULL_TREE; ! ; ! break;} ! case 103: ! #line 1021 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { finish_method_declaration (yyvsp[0].node); ; ! break;} ! case 104: ! #line 1023 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {YYNOT_TWICE yyerror ("'{' expected"); RECOVER;; ! break;} ! case 105: ! #line 1028 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_header (0, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 106: ! #line 1030 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_header (0, void_type_node, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 107: ! #line 1032 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_header (yyvsp[-3].value, yyvsp[-2].node, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 108: ! #line 1034 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_header (yyvsp[-3].value, void_type_node, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 109: ! #line 1036 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Invalid method declaration, method name required"); RECOVER; ! ; ! break;} ! case 110: ! #line 1041 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyerror ("Identifier expected"); ! RECOVER; ! ; ! break;} ! case 111: ! #line 1046 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyerror ("Identifier expected"); ! RECOVER; ! ; ! break;} ! case 112: ! #line 1051 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyerror ("Identifier expected"); ! RECOVER; ! ; ! break;} ! case 113: ! #line 1056 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Invalid method declaration, return type required"); RECOVER; ! ; ! break;} ! case 114: ! #line 1064 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number = 0; yyval.node = method_declarator (yyvsp[-2].node, NULL_TREE); ! ; ! break;} ! case 115: ! #line 1069 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_declarator (yyvsp[-3].node, yyvsp[-1].node); ; ! break;} ! case 116: ! #line 1071 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { EXPR_WFL_LINECOL (wfl_operator) = yyvsp[-1].operator.location; ! TREE_PURPOSE (yyvsp[-2].node) = build_unresolved_array_type (TREE_PURPOSE (yyvsp[-2].node)); ! parse_warning_context ! (wfl_operator, "Discouraged form of returned type specification"); ! ; ! break;} ! case 117: ! #line 1080 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); DRECOVER(method_declarator);; ! break;} ! case 118: ! #line 1082 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("']' expected"); RECOVER;; ! break;} ! case 119: ! #line 1087 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number = 1; ! ; ! break;} ! case 120: ! #line 1091 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number += 1; yyval.node = chainon (yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 121: ! #line 1096 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing formal parameter term"); RECOVER; ; ! break;} ! case 122: ! #line 1101 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, yyvsp[-1].node); ! ; ! break;} ! case 123: ! #line 1105 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, yyvsp[-1].node); ARG_FINAL_P (yyval.node) = 1; ! ; ! break;} ! case 124: ! #line 1110 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing identifier"); RECOVER; yyval.node = NULL_TREE; ! ; ! break;} ! case 125: ! #line 1115 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing identifier"); RECOVER; yyval.node = NULL_TREE; ! ; ! break;} ! case 126: ! #line 1123 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { check_modifiers ("Illegal modifier `%s'. Only `final' was expected here", yyvsp[0].value, ACC_FINAL); if (yyvsp[0].value != ACC_FINAL) MODIFIER_WFL (FINAL_TK) = build_wfl_node (NULL_TREE); ! ; ! break;} ! case 127: ! #line 1132 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 128: ! #line 1134 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 129: ! #line 1136 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing class type term"); RECOVER;; ! break;} ! case 130: ! #line 1141 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (yyvsp[0].node, yyvsp[0].node); ; ! break;} ! case 131: ! #line 1143 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = tree_cons (yyvsp[0].node, yyvsp[0].node, yyvsp[-2].node); ; ! break;} ! case 132: ! #line 1145 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing class type term"); RECOVER;; ! break;} ! case 134: ! #line 1150 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 135: ! #line 1156 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { TREE_CHAIN (yyvsp[0].node) = CPC_STATIC_INITIALIZER_STMT (ctxp); SET_CPC_STATIC_INITIALIZER_STMT (ctxp, yyvsp[0].node); current_static_block = NULL_TREE; ! ; ! break;} ! case 136: ! #line 1165 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { check_modifiers ("Illegal modifier `%s' for static initializer", yyvsp[0].value, ACC_STATIC); /* Can't have a static initializer in an innerclass */ if (yyvsp[0].value | ACC_STATIC && GET_CPC_LIST () && !TOPLEVEL_CLASS_DECL_P (GET_CPC ())) ! parse_error_context (MODIFIER_WFL (STATIC_TK), "Can't define static initializer in class `%s'. Static initializer can only be defined in top-level classes", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ()))); SOURCE_FRONTEND_DEBUG (("Modifiers: %d", yyvsp[0].value)); ! ; ! break;} ! case 137: ! #line 1181 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { current_function_decl = yyvsp[0].node; source_start_java_method (current_function_decl); ! ; ! break;} ! case 138: ! #line 1186 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { finish_method_declaration (yyvsp[0].node); ; ! break;} ! case 139: ! #line 1191 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_header (0, NULL_TREE, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 140: ! #line 1193 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_header (yyvsp[-2].value, NULL_TREE, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 141: ! #line 1198 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! ctxp->formal_parameter_number = 0; yyval.node = method_declarator (yyvsp[-2].node, NULL_TREE); ! ; ! break;} ! case 142: ! #line 1203 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = method_declarator (yyvsp[-3].node, yyvsp[-1].node); ; ! break;} ! case 143: ! #line 1211 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { BLOCK_EXPR_BODY (yyvsp[0].node) = empty_stmt_node; yyval.node = yyvsp[0].node; ! ; ! break;} ! case 144: ! #line 1216 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 145: ! #line 1218 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 146: ! #line 1220 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 148: ! #line 1230 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_method_invocation (yyvsp[-3].node, NULL_TREE); yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-3].node), yyval.node); yyval.node = java_method_add_stmt (current_function_decl, yyval.node); ! ; ! break;} ! case 149: ! #line 1236 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_method_invocation (yyvsp[-4].node, yyvsp[-2].node); yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-4].node), yyval.node); yyval.node = java_method_add_stmt (current_function_decl, yyval.node); ! ; ! break;} ! case 150: ! #line 1244 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = parse_jdk1_1_error ("explicit constructor invocation"); ; ! break;} ! case 151: ! #line 1246 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = parse_jdk1_1_error ("explicit constructor invocation"); ; ! break;} ! case 152: ! #line 1251 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree wfl = build_wfl_node (this_identifier_node); EXPR_WFL_LINECOL (wfl) = yyvsp[0].operator.location; yyval.node = wfl; ! ; ! break;} ! case 153: ! #line 1257 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree wfl = build_wfl_node (super_identifier_node); EXPR_WFL_LINECOL (wfl) = yyvsp[0].operator.location; yyval.node = wfl; ! ; ! break;} ! case 154: ! #line 1268 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_interface (0, yyvsp[0].node, NULL_TREE); ; ! break;} ! case 155: ! #line 1270 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ; ; ! break;} ! case 156: ! #line 1272 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_interface (yyvsp[-2].value, yyvsp[0].node, NULL_TREE); ; ! break;} ! case 157: ! #line 1274 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ; ; ! break;} ! case 158: ! #line 1276 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_interface (0, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 159: ! #line 1278 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ; ; ! break;} ! case 160: ! #line 1280 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_interface (yyvsp[-3].value, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 161: ! #line 1282 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ; ; ! break;} ! case 162: ! #line 1284 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("'{' expected"); RECOVER; ; ! break;} ! case 163: ! #line 1286 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("'{' expected"); RECOVER; ; ! break;} ! case 164: ! #line 1291 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->interface_number = 1; yyval.node = build_tree_list (yyvsp[0].node, NULL_TREE); ! ; ! break;} ! case 165: ! #line 1296 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->interface_number++; yyval.node = chainon (yyvsp[-2].node, build_tree_list (yyvsp[0].node, NULL_TREE)); ! ; ! break;} ! case 166: ! #line 1301 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Invalid interface type"); RECOVER;; ! break;} ! case 167: ! #line 1303 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 168: ! #line 1308 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 169: ! #line 1310 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 174: ! #line 1322 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { end_class_declaration (1); ; ! break;} ! case 175: ! #line 1324 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { end_class_declaration (1); ; ! break;} ! case 177: ! #line 1333 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { check_abstract_method_header (yyvsp[-1].node); current_function_decl = NULL_TREE; /* FIXME ? */ ! ; ! break;} ! case 178: ! #line 1338 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 179: ! #line 1344 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-1].operator.location, NULL_TREE); ; ! break;} ! case 180: ! #line 1346 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-2].operator.location, NULL_TREE); ; ! break;} ! case 181: ! #line 1348 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-2].operator.location, yyvsp[-1].node); ; ! break;} ! case 182: ! #line 1350 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_new_array_init (yyvsp[-3].operator.location, yyvsp[-2].node); ; ! break;} ! case 183: ! #line 1355 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = tree_cons (maybe_build_array_element_wfl (yyvsp[0].node), yyvsp[0].node, NULL_TREE); ! ; ! break;} ! case 184: ! #line 1360 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = tree_cons (maybe_build_array_element_wfl (yyvsp[0].node), yyvsp[0].node, yyvsp[-2].node); ! ; ! break;} ! case 185: ! #line 1364 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 186: ! #line 1370 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); ! yyval.node = empty_stmt_node; ! ; ! break;} ! case 187: ! #line 1378 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 188: ! #line 1383 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { enter_block (); ; ! break;} ! case 189: ! #line 1388 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { maybe_absorb_scoping_blocks (); /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = ! EXPR_WFL_ADD_COL (yyvsp[0].operator.location, 1); yyval.node = exit_block (); if (!BLOCK_SUBBLOCKS (yyval.node)) BLOCK_SUBBLOCKS (yyval.node) = empty_stmt_node; ! ; ! break;} ! case 193: ! #line 1408 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { java_method_add_stmt (current_function_decl, yyvsp[0].node); ; ! break;} ! case 194: ! #line 1410 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { LOCAL_CLASS_P (TREE_TYPE (GET_CPC ())) = 1; end_class_declaration (1); ! ; ! break;} ! case 196: ! #line 1422 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { declare_local_variables (0, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 197: ! #line 1424 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { declare_local_variables (yyvsp[-2].value, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 203: ! #line 1434 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = exit_block (); ; ! break;} ! case 208: ! #line 1443 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = exit_block (); ; ! break;} ! case 221: ! #line 1463 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! if (flag_extraneous_semicolon ! && ! current_static_block ! && (! current_function_decl || /* Verify we're not in a inner class declaration */ (GET_CPC () != TYPE_NAME (DECL_CONTEXT (current_function_decl))))) ! { EXPR_WFL_SET_LINECOL (wfl_operator, lineno, -1); parse_warning_context (wfl_operator, "An empty declaration is a deprecated feature that should not be used"); } yyval.node = empty_stmt_node; ! ; ! break;} ! case 222: ! #line 1481 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_labeled_block (EXPR_WFL_LINECOL (yyvsp[-1].node), EXPR_WFL_NODE (yyvsp[-1].node)); pushlevel (2); push_labeled_block (yyval.node); PUSH_LABELED_BLOCK (yyval.node); ! ; ! break;} ! case 223: ! #line 1492 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_labeled_statement (yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 224: ! #line 1494 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("':' expected"); RECOVER;; ! break;} ! case 225: ! #line 1499 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_labeled_statement (yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 226: ! #line 1506 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* We have a statement. Generate a WFL around it so we can debug it */ yyval.node = build_expr_wfl (yyvsp[-1].node, input_filename, lineno, 0); /* We know we have a statement, so set the debug info to be eventually generate here. */ yyval.node = JAVA_MAYBE_GENERATE_DEBUG_INFO (yyval.node); ! ; ! break;} ! case 227: ! #line 1515 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); ! ; ! break;} ! case 228: ! #line 1520 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); ! ; ! break;} ! case 229: ! #line 1525 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); ! ; ! break;} ! case 230: ! #line 1530 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 231: ! #line 1532 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { parse_ctor_invocation_error (); RECOVER; ! ; ! break;} ! case 232: ! #line 1537 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 233: ! #line 1539 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { parse_ctor_invocation_error (); RECOVER; ! ; ! break;} ! case 234: ! #line 1544 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;; ! break;} ! case 235: ! #line 1546 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 236: ! #line 1548 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 237: ! #line 1550 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 238: ! #line 1552 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 246: ! #line 1567 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_if_else_statement (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node, NULL_TREE); ! ; ! break;} ! case 247: ! #line 1572 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;; ! break;} ! case 248: ! #line 1574 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 249: ! #line 1576 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 250: ! #line 1581 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_if_else_statement (yyvsp[-5].operator.location, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ; ! break;} ! case 251: ! #line 1586 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_if_else_statement (yyvsp[-5].operator.location, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ; ! break;} ! case 252: ! #line 1591 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { enter_block (); ! ; ! break;} ! case 253: ! #line 1595 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* Make into "proper list" of COMPOUND_EXPRs. I.e. make the last statement also have its own COMPOUND_EXPR. */ maybe_absorb_scoping_blocks (); TREE_OPERAND (yyvsp[-2].node, 1) = exit_block (); yyval.node = build_debugable_stmt (EXPR_WFL_LINECOL (yyvsp[-2].node), yyvsp[-2].node); ! ; ! break;} ! case 254: ! #line 1607 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build (SWITCH_EXPR, NULL_TREE, yyvsp[-1].node, NULL_TREE); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-2].operator.location; ! ; ! break;} ! case 255: ! #line 1612 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;; ! break;} ! case 256: ! #line 1614 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term or ')'"); DRECOVER(switch_statement);; ! break;} ! case 257: ! #line 1616 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER;; ! break;} ! case 258: ! #line 1624 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 259: ! #line 1626 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 260: ! #line 1628 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 261: ! #line 1630 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = NULL_TREE; ; ! break;} ! case 267: ! #line 1649 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree lab = build1 (CASE_EXPR, NULL_TREE, yyvsp[-1].node); EXPR_WFL_LINECOL (lab) = yyvsp[-2].operator.location; java_method_add_stmt (current_function_decl, lab); ! ; ! break;} ! case 268: ! #line 1655 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree lab = build (DEFAULT_EXPR, NULL_TREE, NULL_TREE); EXPR_WFL_LINECOL (lab) = yyvsp[-1].operator.location; java_method_add_stmt (current_function_decl, lab); ! ; ! break;} ! case 269: ! #line 1661 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing or invalid constant expression"); RECOVER;; ! break;} ! case 270: ! #line 1663 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("':' expected"); RECOVER;; ! break;} ! case 271: ! #line 1665 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("':' expected"); RECOVER;; ! break;} ! case 272: ! #line 1670 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree body = build_loop_body (yyvsp[-2].operator.location, yyvsp[-1].node, 0); yyval.node = build_new_loop (body); ! ; ! break;} ! case 273: ! #line 1678 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_loop_body (0, NULL_TREE, yyvsp[0].node, 0); ; ! break;} ! case 274: ! #line 1680 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {YYERROR_NOW; yyerror ("'(' expected"); RECOVER;; ! break;} ! case 275: ! #line 1682 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term and ')' expected"); RECOVER;; ! break;} ! case 276: ! #line 1684 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 277: ! #line 1689 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_loop_body (0, NULL_TREE, yyvsp[0].node, 0); ; ! break;} ! case 278: ! #line 1694 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree body = build_loop_body (0, NULL_TREE, 1); yyval.node = build_new_loop (body); ! ; ! break;} ! case 279: ! #line 1703 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_loop_body (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[-5].node, 1); ; ! break;} ! case 280: ! #line 1708 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { if (TREE_CODE_CLASS (TREE_CODE (yyvsp[-4].node)) == 'c') yyvsp[-4].node = build_wfl_node (yyvsp[-4].node); yyval.node = finish_for_loop (EXPR_WFL_LINECOL (yyvsp[-4].node), yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 281: ! #line 1714 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_for_loop (0, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY (yyval.node), 0) = empty_stmt_node; ! ; ! break;} ! case 282: ! #line 1721 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Invalid control expression"); RECOVER;; ! break;} ! case 283: ! #line 1723 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Invalid update expression"); RECOVER;; ! break;} ! case 284: ! #line 1725 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Invalid update expression"); RECOVER;; ! break;} ! case 285: ! #line 1730 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_for_loop (EXPR_WFL_LINECOL (yyvsp[-4].node), yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node);; ! break;} ! case 286: ! #line 1732 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = finish_for_loop (0, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY (yyval.node), 0) = empty_stmt_node; ! ; ! break;} ! case 287: ! #line 1742 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* This scope defined for local variable that may be defined within the scope of the for loop */ ! enter_block (); ! ; ! break;} ! case 288: ! #line 1748 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); DRECOVER(for_1);; ! break;} ! case 289: ! #line 1750 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Invalid init statement"); RECOVER;; ! break;} ! case 290: ! #line 1755 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* We now declare the loop body. The loop is declared as a for loop. */ tree body = build_loop_body (0, NULL_TREE, 0); *************** yyreduce: *** 4775,5169 **** /* The loop is added to the current block the for statement is defined within */ java_method_add_stmt (current_function_decl, yyval.node); ! ;} ! break; ! ! case 291: ! #line 1776 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = empty_stmt_node; ;} ! break; ! ! case 292: ! #line 1778 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* Init statement recorded within the previously defined block scope */ yyval.node = java_method_add_stmt (current_function_decl, yyvsp[0].node); ! ;} ! break; ! ! case 293: ! #line 1784 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* Local variable are recorded within the previously defined block scope */ yyval.node = NULL_TREE; ! ;} ! break; ! ! case 294: ! #line 1790 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); DRECOVER(for_init_1);;} ! break; ! ! case 295: ! #line 1794 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = empty_stmt_node;;} ! break; ! ! case 296: ! #line 1796 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_debugable_stmt (BUILD_LOCATION (), yyvsp[0].node); ;} ! break; ! ! case 297: ! #line 1801 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = add_stmt_to_compound (NULL_TREE, NULL_TREE, yyvsp[0].node); ;} ! break; ! ! case 298: ! #line 1803 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = add_stmt_to_compound (yyvsp[-2].node, NULL_TREE, yyvsp[0].node); ;} ! break; ! ! case 299: ! #line 1805 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 300: ! #line 1810 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-1].operator.location, 1, NULL_TREE); ;} ! break; ! ! case 301: ! #line 1812 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-2].operator.location, 1, yyvsp[-1].node); ;} ! break; ! ! case 302: ! #line 1814 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 303: ! #line 1816 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 304: ! #line 1821 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-1].operator.location, 0, NULL_TREE); ;} ! break; ! ! case 305: ! #line 1823 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-2].operator.location, 0, yyvsp[-1].node); ;} ! break; ! ! case 306: ! #line 1825 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 307: ! #line 1827 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 308: ! #line 1832 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_return (yyvsp[-1].operator.location, NULL_TREE); ;} ! break; ! ! case 309: ! #line 1834 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_return (yyvsp[-2].operator.location, yyvsp[-1].node); ;} ! break; ! ! case 310: ! #line 1836 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 311: ! #line 1838 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 312: ! #line 1843 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build1 (THROW_EXPR, NULL_TREE, yyvsp[-1].node); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-2].operator.location; ! ;} ! break; ! ! case 313: ! #line 1848 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 314: ! #line 1850 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;;} ! break; ! ! case 315: ! #line 1855 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build (SYNCHRONIZED_EXPR, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); ! EXPR_WFL_LINECOL (yyval.node) = EXPR_WFL_LINECOL (MODIFIER_WFL (SYNCHRONIZED_TK)); ! ;} ! break; ! ! case 316: ! #line 1861 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER;;} ! break; ! ! case 317: ! #line 1863 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;;} ! break; ! ! case 318: ! #line 1865 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 319: ! #line 1867 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 320: ! #line 1872 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { check_modifiers ( "Illegal modifier `%s'. Only `synchronized' was expected here", yyvsp[0].value, ACC_SYNCHRONIZED); if (yyvsp[0].value != ACC_SYNCHRONIZED) ! MODIFIER_WFL (SYNCHRONIZED_TK) = build_wfl_node (NULL_TREE); ! ;} ! break; ! ! case 321: ! #line 1884 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_try_statement (yyvsp[-2].operator.location, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 322: ! #line 1886 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_try_finally_statement (yyvsp[-2].operator.location, yyvsp[-1].node, yyvsp[0].node); ;} ! break; ! ! case 323: ! #line 1888 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_try_finally_statement (yyvsp[-3].operator.location, build_try_statement (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[-1].node), yyvsp[0].node); ! ;} ! break; ! ! case 324: ! #line 1893 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); DRECOVER (try_statement);;} ! break; ! ! case 326: ! #line 1899 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { TREE_CHAIN (yyvsp[0].node) = yyvsp[-1].node; yyval.node = yyvsp[0].node; ! ;} ! break; ! ! case 327: ! #line 1907 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { java_method_add_stmt (current_function_decl, yyvsp[0].node); exit_block (); yyval.node = yyvsp[-1].node; ! ;} ! break; ! ! case 328: ! #line 1916 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { /* We add a block to define a scope for formal_parameter (CCBP). The formal parameter is declared initialized by the appropriate function call */ tree ccpb = enter_block (); tree init = build_assignment ! (ASSIGN_TK, yyvsp[-2].operator.location, TREE_PURPOSE (yyvsp[-1].node), build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); declare_local_variables (0, TREE_VALUE (yyvsp[-1].node), build_tree_list (TREE_PURPOSE (yyvsp[-1].node), init)); yyval.node = build1 (CATCH_EXPR, NULL_TREE, ccpb); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-3].operator.location; ! ;} ! break; ! ! case 329: ! #line 1932 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER; yyval.node = NULL_TREE;;} ! break; ! ! case 330: ! #line 1934 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyerror ("Missing term or ')' expected"); RECOVER; yyval.node = NULL_TREE; ! ;} ! break; ! ! case 331: ! #line 1939 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; yyval.node = NULL_TREE;;} ! break; ! ! case 332: ! #line 1944 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ;} ! break; ! ! case 333: ! #line 1946 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER; ;} ! break; ! ! case 337: ! #line 1958 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_this (yyvsp[0].operator.location); ;} ! break; ! ! case 338: ! #line 1960 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = yyvsp[-1].node;;} ! break; ! ! case 344: ! #line 1970 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree wfl = build_wfl_node (this_identifier_node); yyval.node = make_qualified_primary (yyvsp[-2].node, wfl, EXPR_WFL_LINECOL (yyvsp[-2].node)); ! ;} ! break; ! ! case 345: ! #line 1975 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 346: ! #line 1977 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'class' or 'this' expected" ); RECOVER;;} ! break; ! ! case 347: ! #line 1979 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'class' expected" ); RECOVER;;} ! break; ! ! case 348: ! #line 1981 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'class' expected" ); RECOVER;;} ! break; ! ! case 349: ! #line 1986 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, yyvsp[-2].node); ;} ! break; ! ! case 350: ! #line 1988 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, yyvsp[-2].node); ;} ! break; ! ! case 351: ! #line 1990 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, yyvsp[-2].node); ;} ! break; ! ! case 352: ! #line 1992 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, void_type_node); ! ;} ! break; ! ! case 353: ! #line 2000 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_new_invocation (yyvsp[-3].node, yyvsp[-1].node); ;} ! break; ! ! case 354: ! #line 2002 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_new_invocation (yyvsp[-2].node, NULL_TREE); ;} ! break; ! ! case 356: ! #line 2008 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree ctor = build_new_invocation (yyvsp[-2].node, NULL_TREE); ! yyval.node = make_qualified_primary (yyvsp[-3].node, ctor, EXPR_WFL_LINECOL (yyvsp[-3].node)); ! ;} ! break; ! ! case 358: ! #line 2015 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree ctor = build_new_invocation (yyvsp[-3].node, yyvsp[-1].node); ! yyval.node = make_qualified_primary (yyvsp[-4].node, ctor, EXPR_WFL_LINECOL (yyvsp[-4].node)); ! ;} ! break; ! ! case 360: ! #line 2022 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); DRECOVER(new_1);;} ! break; ! ! case 361: ! #line 2024 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;;} ! break; ! ! case 362: ! #line 2026 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' or term expected"); RECOVER;;} ! break; ! ! case 363: ! #line 2028 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;;} ! break; ! ! case 364: ! #line 2030 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {YYERROR_NOW; yyerror ("Identifier expected"); RECOVER;;} ! break; ! ! case 365: ! #line 2032 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;;} ! break; ! ! case 366: ! #line 2042 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_anonymous_class (yyvsp[-4].operator.location, yyvsp[-3].node); ;} ! break; ! ! case 367: ! #line 2044 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL (yyvsp[-5].node); --- 4325,4674 ---- /* The loop is added to the current block the for statement is defined within */ java_method_add_stmt (current_function_decl, yyval.node); ! ; ! break;} ! case 291: ! #line 1767 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = empty_stmt_node; ; ! break;} ! case 292: ! #line 1769 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* Init statement recorded within the previously defined block scope */ yyval.node = java_method_add_stmt (current_function_decl, yyvsp[0].node); ! ; ! break;} ! case 293: ! #line 1775 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* Local variable are recorded within the previously defined block scope */ yyval.node = NULL_TREE; ! ; ! break;} ! case 294: ! #line 1781 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); DRECOVER(for_init_1);; ! break;} ! case 295: ! #line 1785 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = empty_stmt_node;; ! break;} ! case 296: ! #line 1787 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_debugable_stmt (BUILD_LOCATION (), yyvsp[0].node); ; ! break;} ! case 297: ! #line 1792 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = add_stmt_to_compound (NULL_TREE, NULL_TREE, yyvsp[0].node); ; ! break;} ! case 298: ! #line 1794 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = add_stmt_to_compound (yyvsp[-2].node, NULL_TREE, yyvsp[0].node); ; ! break;} ! case 299: ! #line 1796 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 300: ! #line 1801 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-1].operator.location, 1, NULL_TREE); ; ! break;} ! case 301: ! #line 1803 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-2].operator.location, 1, yyvsp[-1].node); ; ! break;} ! case 302: ! #line 1805 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 303: ! #line 1807 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 304: ! #line 1812 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-1].operator.location, 0, NULL_TREE); ; ! break;} ! case 305: ! #line 1814 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_bc_statement (yyvsp[-2].operator.location, 0, yyvsp[-1].node); ; ! break;} ! case 306: ! #line 1816 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 307: ! #line 1818 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 308: ! #line 1823 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_return (yyvsp[-1].operator.location, NULL_TREE); ; ! break;} ! case 309: ! #line 1825 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_return (yyvsp[-2].operator.location, yyvsp[-1].node); ; ! break;} ! case 310: ! #line 1827 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 311: ! #line 1829 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 312: ! #line 1834 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build1 (THROW_EXPR, NULL_TREE, yyvsp[-1].node); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-2].operator.location; ! ; ! break;} ! case 313: ! #line 1839 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 314: ! #line 1841 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 315: ! #line 1846 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_assertion (yyvsp[-4].operator.location, yyvsp[-3].node, yyvsp[-1].node); ! ; ! break;} ! case 316: ! #line 1850 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_assertion (yyvsp[-2].operator.location, yyvsp[-1].node, NULL_TREE); ! ; ! break;} ! case 317: ! #line 1854 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 318: ! #line 1856 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 319: ! #line 1861 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build (SYNCHRONIZED_EXPR, NULL_TREE, yyvsp[-2].node, yyvsp[0].node); ! EXPR_WFL_LINECOL (yyval.node) = EXPR_WFL_LINECOL (MODIFIER_WFL (SYNCHRONIZED_TK)); ! ; ! break;} ! case 320: ! #line 1867 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER;; ! break;} ! case 321: ! #line 1869 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;; ! break;} ! case 322: ! #line 1871 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 323: ! #line 1873 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 324: ! #line 1878 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { check_modifiers ( "Illegal modifier `%s'. Only `synchronized' was expected here", yyvsp[0].value, ACC_SYNCHRONIZED); if (yyvsp[0].value != ACC_SYNCHRONIZED) ! MODIFIER_WFL (SYNCHRONIZED_TK) = build_wfl_node (NULL_TREE); ! ; ! break;} ! case 325: ! #line 1890 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_try_statement (yyvsp[-2].operator.location, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 326: ! #line 1892 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_try_finally_statement (yyvsp[-2].operator.location, yyvsp[-1].node, yyvsp[0].node); ; ! break;} ! case 327: ! #line 1894 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_try_finally_statement (yyvsp[-3].operator.location, build_try_statement (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[-1].node), yyvsp[0].node); ! ; ! break;} ! case 328: ! #line 1899 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); DRECOVER (try_statement);; ! break;} ! case 330: ! #line 1905 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { TREE_CHAIN (yyvsp[0].node) = yyvsp[-1].node; yyval.node = yyvsp[0].node; ! ; ! break;} ! case 331: ! #line 1913 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { java_method_add_stmt (current_function_decl, yyvsp[0].node); exit_block (); yyval.node = yyvsp[-1].node; ! ; ! break;} ! case 332: ! #line 1922 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { /* We add a block to define a scope for formal_parameter (CCBP). The formal parameter is declared initialized by the appropriate function call */ tree ccpb = enter_block (); tree init = build_assignment ! (ASSIGN_TK, yyvsp[-2].operator.location, TREE_PURPOSE (yyvsp[-1].node), build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); declare_local_variables (0, TREE_VALUE (yyvsp[-1].node), build_tree_list (TREE_PURPOSE (yyvsp[-1].node), init)); yyval.node = build1 (CATCH_EXPR, NULL_TREE, ccpb); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-3].operator.location; ! ; ! break;} ! case 333: ! #line 1938 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER; yyval.node = NULL_TREE;; ! break;} ! case 334: ! #line 1940 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyerror ("Missing term or ')' expected"); RECOVER; yyval.node = NULL_TREE; ! ; ! break;} ! case 335: ! #line 1945 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; yyval.node = NULL_TREE;; ! break;} ! case 336: ! #line 1950 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[0].node; ; ! break;} ! case 337: ! #line 1952 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'{' expected"); RECOVER; ; ! break;} ! case 341: ! #line 1964 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_this (yyvsp[0].operator.location); ; ! break;} ! case 342: ! #line 1966 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = yyvsp[-1].node;; ! break;} ! case 348: ! #line 1976 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree wfl = build_wfl_node (this_identifier_node); yyval.node = make_qualified_primary (yyvsp[-2].node, wfl, EXPR_WFL_LINECOL (yyvsp[-2].node)); ! ; ! break;} ! case 349: ! #line 1981 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 350: ! #line 1983 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'class' or 'this' expected" ); RECOVER;; ! break;} ! case 351: ! #line 1985 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'class' expected" ); RECOVER;; ! break;} ! case 352: ! #line 1987 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'class' expected" ); RECOVER;; ! break;} ! case 353: ! #line 1992 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, yyvsp[-2].node); ; ! break;} ! case 354: ! #line 1994 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, yyvsp[-2].node); ; ! break;} ! case 355: ! #line 1996 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, yyvsp[-2].node); ; ! break;} ! case 356: ! #line 1998 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_incomplete_class_ref (yyvsp[-1].operator.location, void_type_node); ! ; ! break;} ! case 357: ! #line 2006 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_new_invocation (yyvsp[-3].node, yyvsp[-1].node); ; ! break;} ! case 358: ! #line 2008 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_new_invocation (yyvsp[-2].node, NULL_TREE); ; ! break;} ! case 360: ! #line 2014 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree ctor = build_new_invocation (yyvsp[-2].node, NULL_TREE); ! yyval.node = make_qualified_primary (yyvsp[-3].node, ctor, EXPR_WFL_LINECOL (yyvsp[-3].node)); ! ; ! break;} ! case 362: ! #line 2021 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree ctor = build_new_invocation (yyvsp[-3].node, yyvsp[-1].node); ! yyval.node = make_qualified_primary (yyvsp[-4].node, ctor, EXPR_WFL_LINECOL (yyvsp[-4].node)); ! ; ! break;} ! case 364: ! #line 2028 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); DRECOVER(new_1);; ! break;} ! case 365: ! #line 2030 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;; ! break;} ! case 366: ! #line 2032 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' or term expected"); RECOVER;; ! break;} ! case 367: ! #line 2034 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("')' expected"); RECOVER;; ! break;} ! case 368: ! #line 2036 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {YYERROR_NOW; yyerror ("Identifier expected"); RECOVER;; ! break;} ! case 369: ! #line 2038 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'(' expected"); RECOVER;; ! break;} ! case 370: ! #line 2048 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_anonymous_class (yyvsp[-4].operator.location, yyvsp[-3].node); ; ! break;} ! case 371: ! #line 2050 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL (yyvsp[-5].node); *************** yyreduce: *** 5185,5208 **** must be generated following the hints provided by the `new' expression. Whether a super constructor of that nature exists or not is to be verified ! later on in verify_constructor_super. It's during the expansion of a `new' statement refering to an anonymous class that a ctor will be generated for the anonymous class, with the right arguments. */ ! ;} ! break; ! ! case 368: ! #line 2075 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { create_anonymous_class (yyvsp[-3].operator.location, yyvsp[-2].node); ;} ! break; ! ! case 369: ! #line 2077 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL (yyvsp[-4].node); --- 4690,4711 ---- must be generated following the hints provided by the `new' expression. Whether a super constructor of that nature exists or not is to be verified ! later on in verify_constructor_super. It's during the expansion of a `new' statement refering to an anonymous class that a ctor will be generated for the anonymous class, with the right arguments. */ ! ; ! break;} ! case 372: ! #line 2081 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { create_anonymous_class (yyvsp[-3].operator.location, yyvsp[-2].node); ; ! break;} ! case 373: ! #line 2083 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL (yyvsp[-4].node); *************** yyreduce: *** 5213,5275 **** constructor can be generated, since its signature is already known. */ yyval.node = build_new_invocation (id, NULL_TREE); ! ;} ! break; ! ! case 370: ! #line 2093 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[-2].node; ;} ! break; ! ! case 371: ! #line 2095 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = yyvsp[-2].node; ;} ! break; ! ! case 372: ! #line 2100 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, NULL_TREE); ! ctxp->formal_parameter_number = 1; ! ;} ! break; ! ! case 373: ! #line 2105 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number += 1; yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, yyvsp[-2].node); ! ;} ! break; ! ! case 374: ! #line 2110 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 375: ! #line 2115 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-1].node, yyvsp[0].node, 0); ;} ! break; ! ! case 376: ! #line 2117 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-1].node, yyvsp[0].node, 0); ;} ! break; ! ! case 377: ! #line 2119 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-2].node, yyvsp[-1].node, pop_current_osb (ctxp));;} ! break; ! ! case 378: ! #line 2121 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-2].node, yyvsp[-1].node, pop_current_osb (ctxp));;} ! break; ! ! case 379: ! #line 2125 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { char *sig; int osb = pop_current_osb (ctxp); while (osb--) --- 4716,4768 ---- constructor can be generated, since its signature is already known. */ yyval.node = build_new_invocation (id, NULL_TREE); ! ; ! break;} ! case 374: ! #line 2099 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[-2].node; ; ! break;} ! case 375: ! #line 2101 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = yyvsp[-2].node; ; ! break;} ! case 376: ! #line 2106 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, NULL_TREE); ! ctxp->formal_parameter_number = 1; ! ; ! break;} ! case 377: ! #line 2111 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ctxp->formal_parameter_number += 1; yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, yyvsp[-2].node); ! ; ! break;} ! case 378: ! #line 2116 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 379: ! #line 2121 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-1].node, yyvsp[0].node, 0); ; ! break;} ! case 380: ! #line 2123 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-1].node, yyvsp[0].node, 0); ; ! break;} ! case 381: ! #line 2125 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-2].node, yyvsp[-1].node, pop_current_osb (ctxp));; ! break;} ! case 382: ! #line 2127 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_newarray_node (yyvsp[-2].node, yyvsp[-1].node, pop_current_osb (ctxp));; ! break;} ! case 383: ! #line 2131 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { char *sig; int osb = pop_current_osb (ctxp); while (osb--) *************** yyreduce: *** 5278,5321 **** sig = obstack_finish (&temporary_obstack); yyval.node = build (NEW_ANONYMOUS_ARRAY_EXPR, NULL_TREE, yyvsp[-2].node, get_identifier (sig), yyvsp[0].node); ! ;} ! break; ! ! case 380: ! #line 2136 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { int osb = pop_current_osb (ctxp); tree type = yyvsp[-2].node; while (osb--) type = build_java_array_type (type, -1); ! yyval.node = build (NEW_ANONYMOUS_ARRAY_EXPR, NULL_TREE, build_pointer_type (type), NULL_TREE, yyvsp[0].node); ! ;} ! break; ! ! case 381: ! #line 2145 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("'[' expected"); DRECOVER ("]");;} ! break; ! ! case 382: ! #line 2147 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("']' expected"); RECOVER;;} ! break; ! ! case 383: ! #line 2152 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (NULL_TREE, yyvsp[0].node); ;} ! break; ! ! case 384: ! #line 2154 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, yyval.node); ;} ! break; ! ! case 385: ! #line 2159 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { if (JNUMERIC_TYPE_P (TREE_TYPE (yyvsp[-1].node))) { yyvsp[-1].node = build_wfl_node (yyvsp[-1].node); --- 4771,4808 ---- sig = obstack_finish (&temporary_obstack); yyval.node = build (NEW_ANONYMOUS_ARRAY_EXPR, NULL_TREE, yyvsp[-2].node, get_identifier (sig), yyvsp[0].node); ! ; ! break;} ! case 384: ! #line 2142 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { int osb = pop_current_osb (ctxp); tree type = yyvsp[-2].node; while (osb--) type = build_java_array_type (type, -1); ! yyval.node = build (NEW_ANONYMOUS_ARRAY_EXPR, NULL_TREE, build_pointer_type (type), NULL_TREE, yyvsp[0].node); ! ; ! break;} ! case 385: ! #line 2151 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("'[' expected"); DRECOVER ("]");; ! break;} ! case 386: ! #line 2153 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("']' expected"); RECOVER;; ! break;} ! case 387: ! #line 2158 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_tree_list (NULL_TREE, yyvsp[0].node); ; ! break;} ! case 388: ! #line 2160 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = tree_cons (NULL_TREE, yyvsp[0].node, yyval.node); ; ! break;} ! case 389: ! #line 2165 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { if (JNUMERIC_TYPE_P (TREE_TYPE (yyvsp[-1].node))) { yyvsp[-1].node = build_wfl_node (yyvsp[-1].node); *************** yyreduce: *** 5323,5348 **** } EXPR_WFL_LINECOL (yyvsp[-1].node) = yyvsp[-2].operator.location; yyval.node = yyvsp[-1].node; ! ;} ! break; ! ! case 386: ! #line 2169 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("']' expected"); RECOVER;;} ! break; ! ! case 387: ! #line 2171 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Missing term"); yyerror ("']' expected"); RECOVER; ! ;} ! break; ! ! case 388: ! #line 2180 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { int allocate = 0; /* If not initialized, allocate memory for the osb numbers stack */ --- 4810,4832 ---- } EXPR_WFL_LINECOL (yyvsp[-1].node) = yyvsp[-2].operator.location; yyval.node = yyvsp[-1].node; ! ; ! break;} ! case 390: ! #line 2175 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("']' expected"); RECOVER;; ! break;} ! case 391: ! #line 2177 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing term"); yyerror ("']' expected"); RECOVER; ! ; ! break;} ! case 392: ! #line 2186 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { int allocate = 0; /* If not initialized, allocate memory for the osb numbers stack */ *************** yyreduce: *** 5354,5360 **** /* If capacity overflown, reallocate a bigger chunk */ else if (ctxp->osb_depth+1 == ctxp->osb_limit) allocate = ctxp->osb_limit << 1; ! if (allocate) { allocate *= sizeof (int); --- 4838,4844 ---- /* If capacity overflown, reallocate a bigger chunk */ else if (ctxp->osb_depth+1 == ctxp->osb_limit) allocate = ctxp->osb_limit << 1; ! if (allocate) { allocate *= sizeof (int); *************** yyreduce: *** 5366,5614 **** } ctxp->osb_depth++; CURRENT_OSB (ctxp) = 1; ! ;} ! break; ! ! case 389: ! #line 2206 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { CURRENT_OSB (ctxp)++; ;} ! break; ! ! case 390: ! #line 2208 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("']' expected"); RECOVER;;} ! break; ! ! case 391: ! #line 2213 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = make_qualified_primary (yyvsp[-2].node, yyvsp[0].node, yyvsp[-1].operator.location); ;} ! break; ! ! case 392: ! #line 2217 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree super_wfl = build_wfl_node (super_identifier_node); EXPR_WFL_LINECOL (super_wfl) = yyvsp[-2].operator.location; yyval.node = make_qualified_name (super_wfl, yyvsp[0].node, yyvsp[-1].operator.location); ! ;} ! break; ! ! case 393: ! #line 2223 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Field expected"); DRECOVER (super_field_acces);;} ! break; ! ! case 394: ! #line 2228 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_method_invocation (yyvsp[-2].node, NULL_TREE); ;} ! break; ! ! case 395: ! #line 2230 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_method_invocation (yyvsp[-3].node, yyvsp[-1].node); ;} ! break; ! ! case 396: ! #line 2232 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { if (TREE_CODE (yyvsp[-4].node) == THIS_EXPR) ! yyval.node = build_this_super_qualified_invocation (1, yyvsp[-2].node, NULL_TREE, 0, yyvsp[-3].operator.location); else { tree invok = build_method_invocation (yyvsp[-2].node, NULL_TREE); yyval.node = make_qualified_primary (yyvsp[-4].node, invok, yyvsp[-3].operator.location); } ! ;} ! break; ! ! case 397: ! #line 2243 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { if (TREE_CODE (yyvsp[-5].node) == THIS_EXPR) ! yyval.node = build_this_super_qualified_invocation (1, yyvsp[-3].node, yyvsp[-1].node, 0, yyvsp[-4].operator.location); else { tree invok = build_method_invocation (yyvsp[-3].node, yyvsp[-1].node); yyval.node = make_qualified_primary (yyvsp[-5].node, invok, yyvsp[-4].operator.location); } ! ;} ! break; ! ! case 398: ! #line 2254 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = build_this_super_qualified_invocation (0, yyvsp[-2].node, NULL_TREE, yyvsp[-4].operator.location, yyvsp[-3].operator.location); ! ;} ! break; ! ! case 399: ! #line 2259 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = build_this_super_qualified_invocation (0, yyvsp[-3].node, yyvsp[-1].node, yyvsp[-5].operator.location, yyvsp[-4].operator.location); ! ;} ! break; ! ! case 400: ! #line 2268 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("'(' expected"); DRECOVER (method_invocation); ;} ! break; ! ! case 401: ! #line 2270 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("'(' expected"); DRECOVER (method_invocation); ;} ! break; ! ! case 402: ! #line 2275 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_array_ref (yyvsp[-2].operator.location, yyvsp[-3].node, yyvsp[-1].node); ;} ! break; ! ! case 403: ! #line 2277 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_array_ref (yyvsp[-2].operator.location, yyvsp[-3].node, yyvsp[-1].node); ;} ! break; ! ! case 404: ! #line 2279 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Missing term and ']' expected"); DRECOVER(array_access); ! ;} ! break; ! ! case 405: ! #line 2284 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("']' expected"); DRECOVER(array_access); ! ;} ! break; ! ! case 406: ! #line 2289 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("Missing term and ']' expected"); DRECOVER(array_access); ! ;} ! break; ! ! case 407: ! #line 2294 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyerror ("']' expected"); DRECOVER(array_access); ! ;} ! break; ! ! case 412: ! #line 2309 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_incdec (yyvsp[0].operator.token, yyvsp[0].operator.location, yyvsp[-1].node, 1); ;} ! break; ! ! case 413: ! #line 2314 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_incdec (yyvsp[0].operator.token, yyvsp[0].operator.location, yyvsp[-1].node, 1); ;} ! break; ! ! case 416: ! #line 2321 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ;} ! break; ! ! case 418: ! #line 2324 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;} ! break; ! ! case 419: ! #line 2329 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { error_if_numeric_overflow (yyvsp[0].node); yyval.node = yyvsp[0].node; ! ;} ! break; ! ! case 420: ! #line 2334 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ;} ! break; ! ! case 421: ! #line 2336 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;} ! break; ! ! case 422: ! #line 2341 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = build_incdec (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node, 0); ;} ! break; ! ! case 423: ! #line 2343 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;} ! break; ! ! case 424: ! #line 2348 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = build_incdec (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node, 0); ;} ! break; ! ! case 425: ! #line 2350 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;} ! break; ! ! case 427: ! #line 2356 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ;} ! break; ! ! case 428: ! #line 2358 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ;} ! break; ! ! case 430: ! #line 2361 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;} ! break; ! ! case 431: ! #line 2363 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;} ! break; ! ! case 432: ! #line 2368 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { tree type = yyvsp[-3].node; int osb = pop_current_osb (ctxp); while (osb--) type = build_java_array_type (type, -1); ! yyval.node = build_cast (yyvsp[-4].operator.location, type, yyvsp[0].node); ! ;} ! break; ! ! case 433: ! #line 2376 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_cast (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node); ;} ! break; ! ! case 434: ! #line 2378 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_cast (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node); ;} ! break; ! ! case 435: ! #line 2380 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { const char *ptr; ! int osb = pop_current_osb (ctxp); ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE (yyvsp[-3].node)), IDENTIFIER_LENGTH (EXPR_WFL_NODE (yyvsp[-3].node))); while (osb--) --- 4850,5060 ---- } ctxp->osb_depth++; CURRENT_OSB (ctxp) = 1; ! ; ! break;} ! case 393: ! #line 2212 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { CURRENT_OSB (ctxp)++; ; ! break;} ! case 394: ! #line 2214 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("']' expected"); RECOVER;; ! break;} ! case 395: ! #line 2219 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = make_qualified_primary (yyvsp[-2].node, yyvsp[0].node, yyvsp[-1].operator.location); ; ! break;} ! case 396: ! #line 2223 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree super_wfl = build_wfl_node (super_identifier_node); EXPR_WFL_LINECOL (super_wfl) = yyvsp[-2].operator.location; yyval.node = make_qualified_name (super_wfl, yyvsp[0].node, yyvsp[-1].operator.location); ! ; ! break;} ! case 397: ! #line 2229 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Field expected"); DRECOVER (super_field_acces);; ! break;} ! case 398: ! #line 2234 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_method_invocation (yyvsp[-2].node, NULL_TREE); ; ! break;} ! case 399: ! #line 2236 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_method_invocation (yyvsp[-3].node, yyvsp[-1].node); ; ! break;} ! case 400: ! #line 2238 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { if (TREE_CODE (yyvsp[-4].node) == THIS_EXPR) ! yyval.node = build_this_super_qualified_invocation (1, yyvsp[-2].node, NULL_TREE, 0, yyvsp[-3].operator.location); else { tree invok = build_method_invocation (yyvsp[-2].node, NULL_TREE); yyval.node = make_qualified_primary (yyvsp[-4].node, invok, yyvsp[-3].operator.location); } ! ; ! break;} ! case 401: ! #line 2249 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { if (TREE_CODE (yyvsp[-5].node) == THIS_EXPR) ! yyval.node = build_this_super_qualified_invocation (1, yyvsp[-3].node, yyvsp[-1].node, 0, yyvsp[-4].operator.location); else { tree invok = build_method_invocation (yyvsp[-3].node, yyvsp[-1].node); yyval.node = make_qualified_primary (yyvsp[-5].node, invok, yyvsp[-4].operator.location); } ! ; ! break;} ! case 402: ! #line 2260 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_this_super_qualified_invocation (0, yyvsp[-2].node, NULL_TREE, yyvsp[-4].operator.location, yyvsp[-3].operator.location); ! ; ! break;} ! case 403: ! #line 2265 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_this_super_qualified_invocation (0, yyvsp[-3].node, yyvsp[-1].node, yyvsp[-5].operator.location, yyvsp[-4].operator.location); ! ; ! break;} ! case 404: ! #line 2274 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("'(' expected"); DRECOVER (method_invocation); ; ! break;} ! case 405: ! #line 2276 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("'(' expected"); DRECOVER (method_invocation); ; ! break;} ! case 406: ! #line 2281 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_array_ref (yyvsp[-2].operator.location, yyvsp[-3].node, yyvsp[-1].node); ; ! break;} ! case 407: ! #line 2283 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_array_ref (yyvsp[-2].operator.location, yyvsp[-3].node, yyvsp[-1].node); ; ! break;} ! case 408: ! #line 2285 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing term and ']' expected"); DRECOVER(array_access); ! ; ! break;} ! case 409: ! #line 2290 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("']' expected"); DRECOVER(array_access); ! ; ! break;} ! case 410: ! #line 2295 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("Missing term and ']' expected"); DRECOVER(array_access); ! ; ! break;} ! case 411: ! #line 2300 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyerror ("']' expected"); DRECOVER(array_access); ! ; ! break;} ! case 416: ! #line 2315 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_incdec (yyvsp[0].operator.token, yyvsp[0].operator.location, yyvsp[-1].node, 1); ; ! break;} ! case 417: ! #line 2320 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_incdec (yyvsp[0].operator.token, yyvsp[0].operator.location, yyvsp[-1].node, 1); ; ! break;} ! case 420: ! #line 2327 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; ! break;} ! case 422: ! #line 2330 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; ! break;} ! case 423: ! #line 2335 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { error_if_numeric_overflow (yyvsp[0].node); yyval.node = yyvsp[0].node; ! ; ! break;} ! case 424: ! #line 2340 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; ! break;} ! case 425: ! #line 2342 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; ! break;} ! case 426: ! #line 2347 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = build_incdec (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node, 0); ; ! break;} ! case 427: ! #line 2349 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; ! break;} ! case 428: ! #line 2354 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = build_incdec (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node, 0); ; ! break;} ! case 429: ! #line 2356 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; ! break;} ! case 431: ! #line 2362 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; ! break;} ! case 432: ! #line 2364 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyval.node = build_unaryop (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[0].node); ; ! break;} ! case 434: ! #line 2367 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; ! break;} ! case 435: ! #line 2369 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER; ! break;} ! case 436: ! #line 2374 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { tree type = yyvsp[-3].node; int osb = pop_current_osb (ctxp); while (osb--) type = build_java_array_type (type, -1); ! yyval.node = build_cast (yyvsp[-4].operator.location, type, yyvsp[0].node); ! ; ! break;} ! case 437: ! #line 2382 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_cast (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node); ; ! break;} ! case 438: ! #line 2384 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_cast (yyvsp[-3].operator.location, yyvsp[-2].node, yyvsp[0].node); ; ! break;} ! case 439: ! #line 2386 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { const char *ptr; ! int osb = pop_current_osb (ctxp); ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE (yyvsp[-3].node)), IDENTIFIER_LENGTH (EXPR_WFL_NODE (yyvsp[-3].node))); while (osb--) *************** yyreduce: *** 5617,5964 **** ptr = obstack_finish (&temporary_obstack); EXPR_WFL_NODE (yyvsp[-3].node) = get_identifier (ptr); yyval.node = build_cast (yyvsp[-4].operator.location, yyvsp[-3].node, yyvsp[0].node); ! ;} ! break; ! ! case 436: ! #line 2394 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("']' expected, invalid type expression");;} ! break; ! ! case 437: ! #line 2396 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid type expression"); RECOVER; RECOVER; ! ;} ! break; ! ! case 438: ! #line 2401 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 439: ! #line 2403 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 440: ! #line 2405 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 442: ! #line 2411 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { ! yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 443: ! #line 2416 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 444: ! #line 2421 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 445: ! #line 2426 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 446: ! #line 2428 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 447: ! #line 2430 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 449: ! #line 2436 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 450: ! #line 2441 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 451: ! #line 2446 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 452: ! #line 2448 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 454: ! #line 2454 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 455: ! #line 2459 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 456: ! #line 2464 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 457: ! #line 2469 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 458: ! #line 2471 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 459: ! #line 2473 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 461: ! #line 2479 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 462: ! #line 2484 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 463: ! #line 2489 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 464: ! #line 2494 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 465: ! #line 2499 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (INSTANCEOF_EXPR, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ;} ! break; ! ! case 466: ! #line 2501 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 467: ! #line 2503 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 468: ! #line 2505 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 469: ! #line 2507 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 470: ! #line 2509 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Invalid reference type"); RECOVER;;} ! break; ! ! case 472: ! #line 2515 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 473: ! #line 2520 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 474: ! #line 2525 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 475: ! #line 2527 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 477: ! #line 2533 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 478: ! #line 2538 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 480: ! #line 2544 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 481: ! #line 2549 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 483: ! #line 2555 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 484: ! #line 2560 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 486: ! #line 2566 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 487: ! #line 2571 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 489: ! #line 2577 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ;} ! break; ! ! case 490: ! #line 2582 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;;} ! break; ! ! case 492: ! #line 2588 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build (CONDITIONAL_EXPR, NULL_TREE, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-3].operator.location; ! ;} ! break; ! ! case 493: ! #line 2593 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { YYERROR_NOW; yyerror ("Missing term"); DRECOVER (1); ! ;} ! break; ! ! case 494: ! #line 2599 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); DRECOVER (2);;} ! break; ! ! case 495: ! #line 2601 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! {yyerror ("Missing term"); DRECOVER (3);;} ! break; ! ! case 498: ! #line 2611 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { yyval.node = build_assignment (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ;} ! break; ! ! case 499: ! #line 2613 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Missing term"); DRECOVER (assign); ! ;} ! break; ! ! } - /* Line 991 of yacc.c. */ - #line 5952 "p2378.c" yyvsp -= yylen; yyssp -= yylen; ! ! YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; ! /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule --- 5063,5370 ---- ptr = obstack_finish (&temporary_obstack); EXPR_WFL_NODE (yyvsp[-3].node) = get_identifier (ptr); yyval.node = build_cast (yyvsp[-4].operator.location, yyvsp[-3].node, yyvsp[0].node); ! ; ! break;} ! case 440: ! #line 2400 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("']' expected, invalid type expression");; ! break;} ! case 441: ! #line 2402 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Invalid type expression"); RECOVER; RECOVER; ! ; ! break;} ! case 442: ! #line 2407 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 443: ! #line 2409 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 444: ! #line 2411 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 446: ! #line 2417 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { ! yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 447: ! #line 2422 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 448: ! #line 2427 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 449: ! #line 2432 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 450: ! #line 2434 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 451: ! #line 2436 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 453: ! #line 2442 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 454: ! #line 2447 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 455: ! #line 2452 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 456: ! #line 2454 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 458: ! #line 2460 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 459: ! #line 2465 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 460: ! #line 2470 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 461: ! #line 2475 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 462: ! #line 2477 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 463: ! #line 2479 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 465: ! #line 2485 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 466: ! #line 2490 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 467: ! #line 2495 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 468: ! #line 2500 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 469: ! #line 2505 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (INSTANCEOF_EXPR, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ; ! break;} ! case 470: ! #line 2507 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 471: ! #line 2509 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 472: ! #line 2511 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 473: ! #line 2513 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 474: ! #line 2515 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Invalid reference type"); RECOVER;; ! break;} ! case 476: ! #line 2521 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 477: ! #line 2526 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 478: ! #line 2531 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 479: ! #line 2533 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 481: ! #line 2539 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 482: ! #line 2544 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 484: ! #line 2550 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 485: ! #line 2555 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 487: ! #line 2561 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 488: ! #line 2566 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 490: ! #line 2572 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 491: ! #line 2577 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 493: ! #line 2583 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_binop (BINOP_LOOKUP (yyvsp[-1].operator.token), yyvsp[-1].operator.location, ! yyvsp[-2].node, yyvsp[0].node); ! ; ! break;} ! case 494: ! #line 2588 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 496: ! #line 2594 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build (CONDITIONAL_EXPR, NULL_TREE, yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); EXPR_WFL_LINECOL (yyval.node) = yyvsp[-3].operator.location; ! ; ! break;} ! case 497: ! #line 2599 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { YYERROR_NOW; yyerror ("Missing term"); DRECOVER (1); ! ; ! break;} ! case 498: ! #line 2605 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); DRECOVER (2);; ! break;} ! case 499: ! #line 2607 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! {yyerror ("Missing term"); DRECOVER (3);; ! break;} ! case 502: ! #line 2617 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { yyval.node = build_assignment (yyvsp[-1].operator.token, yyvsp[-1].operator.location, yyvsp[-2].node, yyvsp[0].node); ; ! break;} ! case 503: ! #line 2619 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" ! { YYNOT_TWICE yyerror ("Missing term"); DRECOVER (assign); ! ; ! break;} ! } ! #line 705 "/usr/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; + #if YYLSP_NEEDED + yylsp -= yylen; + #endif ! #if YYDEBUG ! if (yydebug) ! { ! short *yyssp1 = yyss - 1; ! YYFPRINTF (stderr, "state stack now"); ! while (yyssp1 != yyssp) ! YYFPRINTF (stderr, " %d", *++yyssp1); ! YYFPRINTF (stderr, "\n"); ! } ! #endif *++yyvsp = yyval; ! #if YYLSP_NEEDED ! *++yylsp = yyloc; ! #endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule *************** yyreduce: *** 5966,5976 **** yyn = yyr1[yyn]; ! yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; ! if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else ! yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; --- 5372,5382 ---- yyn = yyr1[yyn]; ! yystate = yypgoto[yyn - YYNTBASE] + *yyssp; ! if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else ! yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; *************** yyerrlab: *** 5983,5995 **** if (!yyerrstatus) { ++yynerrs; ! #if YYERROR_VERBOSE yyn = yypact[yystate]; ! if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; --- 5389,5401 ---- if (!yyerrstatus) { ++yynerrs; ! ! #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; ! if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; *************** yyerrlab: *** 5998,6012 **** YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; ! yysize += yystrlen ("syntax error, unexpected ") + 1; ! yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { ! char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); ! yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { --- 5404,5418 ---- YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; ! yysize += yystrlen ("parse error, unexpected ") + 1; ! yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { ! char *yyp = yystpcpy (yymsg, "parse error, unexpected "); ! yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { *************** yyerrlab: *** 6014,6020 **** for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); --- 5420,5426 ---- for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); *************** yyerrlab: *** 6026,6117 **** YYSTACK_FREE (yymsg); } else ! yyerror ("syntax error; also virtual memory exhausted"); } else ! #endif /* YYERROR_VERBOSE */ ! yyerror ("syntax error"); } ! if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ ! /* Return failure if at end of input. */ if (yychar == YYEOF) ! { ! /* Pop the error token. */ ! YYPOPSTACK; ! /* Pop the rest of the stack. */ ! while (yyss < yyssp) ! { ! YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ! yydestruct (yystos[*yyssp], yyvsp); ! YYPOPSTACK; ! } ! YYABORT; ! } ! ! YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); ! yydestruct (yytoken, &yylval); yychar = YYEMPTY; - } /* Else will try to reuse lookahead token after shifting the error token. */ - goto yyerrlab2; ! /*----------------------------------------------------. ! | yyerrlab1 -- error raised explicitly by an action. | ! `----------------------------------------------------*/ ! yyerrlab1: - /* Suppress GCC warning that yyerrlab1 is unused when no action - invokes YYERROR. */ - #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) - __attribute__ ((__unused__)); - #endif ! goto yyerrlab2; /*---------------------------------------------------------------. ! | yyerrlab2 -- pop states until the error token can be shifted. | `---------------------------------------------------------------*/ ! yyerrlab2: ! yyerrstatus = 3; /* Each real token shifted decrements this. */ ! for (;;) { ! yyn = yypact[yystate]; ! if (yyn != YYPACT_NINF) ! { ! yyn += YYTERROR; ! if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) ! { ! yyn = yytable[yyn]; ! if (0 < yyn) ! break; ! } ! } ! /* Pop the current state because it cannot handle the error token. */ ! if (yyssp == yyss) ! YYABORT; ! YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ! yydestruct (yystos[yystate], yyvsp); ! yyvsp--; ! yystate = *--yyssp; ! YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; --- 5432,5533 ---- YYSTACK_FREE (yymsg); } else ! yyerror ("parse error; also virtual memory exhausted"); } else ! #endif /* defined (YYERROR_VERBOSE) */ ! yyerror ("parse error"); } + goto yyerrlab1; ! /*--------------------------------------------------. ! | yyerrlab1 -- error raised explicitly by an action | ! `--------------------------------------------------*/ ! yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ ! /* return failure if at end of input */ if (yychar == YYEOF) ! YYABORT; ! YYDPRINTF ((stderr, "Discarding token %d (%s).\n", ! yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ + yyerrstatus = 3; /* Each real token shifted decrements this */ ! goto yyerrhandle; + /*-------------------------------------------------------------------. + | yyerrdefault -- current state does not do anything special for the | + | error token. | + `-------------------------------------------------------------------*/ + yyerrdefault: + #if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ ! /* If its default is to accept any token, ok. Otherwise pop it. */ ! yyn = yydefact[yystate]; ! if (yyn) ! goto yydefault; ! #endif /*---------------------------------------------------------------. ! | yyerrpop -- pop the current state because it cannot handle the | ! | error token | `---------------------------------------------------------------*/ ! yyerrpop: ! if (yyssp == yyss) ! YYABORT; ! yyvsp--; ! yystate = *--yyssp; ! #if YYLSP_NEEDED ! yylsp--; ! #endif ! #if YYDEBUG ! if (yydebug) { ! short *yyssp1 = yyss - 1; ! YYFPRINTF (stderr, "Error: state stack now"); ! while (yyssp1 != yyssp) ! YYFPRINTF (stderr, " %d", *++yyssp1); ! YYFPRINTF (stderr, "\n"); ! } ! #endif ! /*--------------. ! | yyerrhandle. | ! `--------------*/ ! yyerrhandle: ! yyn = yypact[yystate]; ! if (yyn == YYFLAG) ! goto yyerrdefault; ! yyn += YYTERROR; ! if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) ! goto yyerrdefault; ! yyn = yytable[yyn]; ! if (yyn < 0) ! { ! if (yyn == YYFLAG) ! goto yyerrpop; ! yyn = -yyn; ! goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; *************** yyerrlab2: *** 6119,6125 **** YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; ! yystate = yyn; goto yynewstate; --- 5535,5543 ---- YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; ! #if YYLSP_NEEDED ! *++yylsp = yylloc; ! #endif yystate = yyn; goto yynewstate; *************** yyabortlab: *** 6139,6153 **** yyresult = 1; goto yyreturn; ! #ifndef yyoverflow ! /*----------------------------------------------. ! | yyoverflowlab -- parser overflow comes here. | ! `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ - #endif yyreturn: #ifndef yyoverflow --- 5557,5569 ---- yyresult = 1; goto yyreturn; ! /*---------------------------------------------. ! | yyoverflowab -- parser overflow comes here. | ! `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow *************** yyreturn: *** 6156,6164 **** #endif return yyresult; } ! ! ! #line 2638 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse.y" /* Helper function to retrieve an OSB count. Should be used when the --- 5572,5578 ---- #endif return yyresult; } ! #line 2644 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse.y" /* Helper function to retrieve an OSB count. Should be used when the *************** pop_current_osb (ctxp) *** 6172,6181 **** if (ctxp->osb_depth < 0) abort (); ! to_return = CURRENT_OSB (ctxp); ctxp->osb_depth--; ! return to_return; } --- 5586,5595 ---- if (ctxp->osb_depth < 0) abort (); ! to_return = CURRENT_OSB (ctxp); ctxp->osb_depth--; ! return to_return; } *************** pop_current_osb (ctxp) *** 6185,6191 **** Add mode documentation here. FIXME */ /* Helper function. Create a new parser context. With ! COPY_FROM_PREVIOUS set to a non zero value, content of the previous context is copied, otherwise, the new context is zeroed. The newly created context becomes the current one. */ --- 5599,5605 ---- Add mode documentation here. FIXME */ /* Helper function. Create a new parser context. With ! COPY_FROM_PREVIOUS set to a nonzero value, content of the previous context is copied, otherwise, the new context is zeroed. The newly created context becomes the current one. */ *************** create_new_parser_context (copy_from_pre *** 6203,6209 **** } else memset ((PTR) new, 0, sizeof (struct parser_ctxt)); ! new->next = ctxp; ctxp = new; } --- 5617,5623 ---- } else memset ((PTR) new, 0, sizeof (struct parser_ctxt)); ! new->next = ctxp; ctxp = new; } *************** void *** 6214,6222 **** java_push_parser_context () { create_new_parser_context (0); ! } ! void java_pop_parser_context (generate) int generate; { --- 5628,5636 ---- java_push_parser_context () { create_new_parser_context (0); ! } ! void java_pop_parser_context (generate) int generate; { *************** java_pop_parser_context (generate) *** 6247,6253 **** if ((ctxp = next)) /* Assignment is really meant here */ for (current = ctxp->import_list; current; current = TREE_CHAIN (current)) IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 1; ! /* If we pushed a context to parse a class intended to be generated, we keep it so we can remember the class. What we could actually do is to just update a list of class names. */ --- 5661,5667 ---- if ((ctxp = next)) /* Assignment is really meant here */ for (current = ctxp->import_list; current; current = TREE_CHAIN (current)) IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 1; ! /* If we pushed a context to parse a class intended to be generated, we keep it so we can remember the class. What we could actually do is to just update a list of class names. */ *************** java_parser_context_resume () *** 6354,6360 **** ctxp = restored; /* Re-installed the data for the parsing to carry on */ ! memcpy (&ctxp->marker_begining, &old->marker_begining, (size_t)(&ctxp->marker_end - &ctxp->marker_begining)); /* Buffer context can now be discarded */ --- 5768,5774 ---- ctxp = restored; /* Re-installed the data for the parsing to carry on */ ! memcpy (&ctxp->marker_begining, &old->marker_begining, (size_t)(&ctxp->marker_end - &ctxp->marker_begining)); /* Buffer context can now be discarded */ *************** java_parser_context_pop_initialized_fiel *** 6405,6411 **** if (CPC_STATIC_INITIALIZER_LIST (ctxp)) { stmts = CPC_STATIC_INITIALIZER_STMT (ctxp); ! CPC_STATIC_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_STATIC_INITIALIZER_LIST (ctxp)); /* Keep initialization in order to enforce 8.5 */ if (stmts && !java_error_count) --- 5819,5825 ---- if (CPC_STATIC_INITIALIZER_LIST (ctxp)) { stmts = CPC_STATIC_INITIALIZER_STMT (ctxp); ! CPC_STATIC_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_STATIC_INITIALIZER_LIST (ctxp)); /* Keep initialization in order to enforce 8.5 */ if (stmts && !java_error_count) *************** java_parser_context_pop_initialized_fiel *** 6416,6422 **** if (CPC_INSTANCE_INITIALIZER_LIST (ctxp)) { stmts = CPC_INSTANCE_INITIALIZER_STMT (ctxp); ! CPC_INSTANCE_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_INSTANCE_INITIALIZER_LIST (ctxp)); if (stmts && !java_error_count) TYPE_II_STMT_LIST (class_type) = nreverse (stmts); --- 5830,5836 ---- if (CPC_INSTANCE_INITIALIZER_LIST (ctxp)) { stmts = CPC_INSTANCE_INITIALIZER_STMT (ctxp); ! CPC_INSTANCE_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_INSTANCE_INITIALIZER_LIST (ctxp)); if (stmts && !java_error_count) TYPE_II_STMT_LIST (class_type) = nreverse (stmts); *************** reorder_static_initialized (list) *** 6432,6441 **** keep them in lexical order. */ tree marker, previous = NULL_TREE; for (marker = list; marker; previous = marker, marker = TREE_CHAIN (marker)) ! if (TREE_CODE (marker) == TREE_LIST && !TREE_VALUE (marker) && !TREE_PURPOSE (marker)) break; ! /* No static initialized, the list is fine as is */ if (!previous) list = TREE_CHAIN (marker); --- 5846,5855 ---- keep them in lexical order. */ tree marker, previous = NULL_TREE; for (marker = list; marker; previous = marker, marker = TREE_CHAIN (marker)) ! if (TREE_CODE (marker) == TREE_LIST && !TREE_VALUE (marker) && !TREE_PURPOSE (marker)) break; ! /* No static initialized, the list is fine as is */ if (!previous) list = TREE_CHAIN (marker); *************** java_debug_context_do (tab) *** 6475,6481 **** fprintf (stderr, "lineno: %d\n", copy->lineno); TAB_CONTEXT (tab); fprintf (stderr, "package: %s\n", ! (copy->package ? IDENTIFIER_POINTER (copy->package) : "")); TAB_CONTEXT (tab); fprintf (stderr, "context for saving: %d\n", copy->saved_data_ctx); --- 5889,5895 ---- fprintf (stderr, "lineno: %d\n", copy->lineno); TAB_CONTEXT (tab); fprintf (stderr, "package: %s\n", ! (copy->package ? IDENTIFIER_POINTER (copy->package) : "")); TAB_CONTEXT (tab); fprintf (stderr, "context for saving: %d\n", copy->saved_data_ctx); *************** static void *** 6508,6514 **** parse_ctor_invocation_error () { if (DECL_CONSTRUCTOR_P (current_function_decl)) ! yyerror ("Constructor invocation must be first thing in a constructor"); else yyerror ("Only constructors can invoke constructors"); } --- 5922,5928 ---- parse_ctor_invocation_error () { if (DECL_CONSTRUCTOR_P (current_function_decl)) ! yyerror ("Constructor invocation must be first thing in a constructor"); else yyerror ("Only constructors can invoke constructors"); } *************** yyerror (msg) *** 6536,6542 **** int save_lineno; char *remainder, *code_from_source; ! if (!force_error && prev_lineno == lineno) return; --- 5950,5956 ---- int save_lineno; char *remainder, *code_from_source; ! if (!force_error && prev_lineno == lineno) return; *************** yyerror (msg) *** 6563,6569 **** java_warning_count++; else java_error_count++; ! if (elc.col == 0 && msg && msg[1] == ';') { elc.col = ctxp->p_line->char_col-1; --- 5977,5983 ---- java_warning_count++; else java_error_count++; ! if (elc.col == 0 && msg && msg[1] == ';') { elc.col = ctxp->p_line->char_col-1; *************** yyerror (msg) *** 6575,6581 **** prev_msg = msg; code_from_source = java_get_line_col (ctxp->filename, elc.line, elc.col); ! obstack_grow0 (&temporary_obstack, code_from_source, strlen (code_from_source)); remainder = obstack_finish (&temporary_obstack); if (do_warning) --- 5989,5995 ---- prev_msg = msg; code_from_source = java_get_line_col (ctxp->filename, elc.line, elc.col); ! obstack_grow0 (&temporary_obstack, code_from_source, strlen (code_from_source)); remainder = obstack_finish (&temporary_obstack); if (do_warning) *************** issue_warning_error_from_context (cl, ms *** 6603,6609 **** force_error = 1; ctxp->elc.line = EXPR_WFL_LINENO (cl); ! ctxp->elc.col = (EXPR_WFL_COLNO (cl) == 0xfff ? -1 : (EXPR_WFL_COLNO (cl) == 0xffe ? -2 : EXPR_WFL_COLNO (cl))); /* We have a CL, that's a good reason for using it if it contains data */ --- 6017,6023 ---- force_error = 1; ctxp->elc.line = EXPR_WFL_LINENO (cl); ! ctxp->elc.col = (EXPR_WFL_COLNO (cl) == 0xfff ? -1 : (EXPR_WFL_COLNO (cl) == 0xffe ? -2 : EXPR_WFL_COLNO (cl))); /* We have a CL, that's a good reason for using it if it contains data */ *************** find_expr_with_wfl (node) *** 6671,6677 **** case LOOP_EXPR: node = TREE_OPERAND (node, 0); continue; ! case LABELED_BLOCK_EXPR: node = TREE_OPERAND (node, 1); continue; --- 6085,6091 ---- case LOOP_EXPR: node = TREE_OPERAND (node, 0); continue; ! case LABELED_BLOCK_EXPR: node = TREE_OPERAND (node, 1); continue; *************** int *** 6724,6730 **** java_report_errors () { if (java_error_count) ! fprintf (stderr, "%d error%s", java_error_count, (java_error_count == 1 ? "" : "s")); if (java_warning_count) fprintf (stderr, "%s%d warning%s", (java_error_count ? ", " : ""), --- 6138,6144 ---- java_report_errors () { if (java_error_count) ! fprintf (stderr, "%d error%s", java_error_count, (java_error_count == 1 ? "" : "s")); if (java_warning_count) fprintf (stderr, "%s%d warning%s", (java_error_count ? ", " : ""), *************** classitf_redefinition_error (context, id *** 6768,6775 **** const char *context; tree id, decl, cl; { ! parse_error_context (cl, "%s `%s' already defined in %s:%d", ! context, IDENTIFIER_POINTER (id), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); /* Here we should point out where its redefined. It's a unicode. FIXME */ } --- 6182,6189 ---- const char *context; tree id, decl, cl; { ! parse_error_context (cl, "%s `%s' already defined in %s:%d", ! context, IDENTIFIER_POINTER (id), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); /* Here we should point out where its redefined. It's a unicode. FIXME */ } *************** variable_redefinition_error (context, na *** 6788,6794 **** type_name = lang_printable_name (type, 0); parse_error_context (context, ! "Variable `%s' is already defined in this method and was declared `%s %s' at line %d", IDENTIFIER_POINTER (name), type_name, IDENTIFIER_POINTER (name), line); } --- 6202,6208 ---- type_name = lang_printable_name (type, 0); parse_error_context (context, ! "Variable `%s' is already defined in this method and was declared `%s %s' at line %d", IDENTIFIER_POINTER (name), type_name, IDENTIFIER_POINTER (name), line); } *************** build_array_from_name (type, type_wfl, n *** 6823,6829 **** /* Eventually get more dims */ more_dims = build_type_name_from_array_name (name, &name); ! /* If we have, then craft a new type for this variable */ if (more_dims) { --- 6237,6243 ---- /* Eventually get more dims */ more_dims = build_type_name_from_array_name (name, &name); ! /* If we have, then craft a new type for this variable */ if (more_dims) { *************** check_class_interface_creation (is_inter *** 6918,6926 **** int uaaf = CLASS_MODIFIERS; /* Usually allowed access flags */ if (!quiet_flag) ! fprintf (stderr, " %s%s %s", (CPC_INNER_P () ? "inner" : ""), ! (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name)); /* Scope of an interface/class type name: --- 6332,6340 ---- int uaaf = CLASS_MODIFIERS; /* Usually allowed access flags */ if (!quiet_flag) ! fprintf (stderr, " %s%s %s", (CPC_INNER_P () ? "inner" : ""), ! (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name)); /* Scope of an interface/class type name: *************** check_class_interface_creation (is_inter *** 6930,6936 **** && (node = find_name_in_single_imports (raw_name)) && !CPC_INNER_P ()) { ! parse_error_context (cl, "%s name `%s' clashes with imported type `%s'", (is_interface ? "Interface" : "Class"), IDENTIFIER_POINTER (raw_name), IDENTIFIER_POINTER (node)); --- 6344,6350 ---- && (node = find_name_in_single_imports (raw_name)) && !CPC_INNER_P ()) { ! parse_error_context (cl, "%s name `%s' clashes with imported type `%s'", (is_interface ? "Interface" : "Class"), IDENTIFIER_POINTER (raw_name), IDENTIFIER_POINTER (node)); *************** check_class_interface_creation (is_inter *** 6938,6944 **** } if (decl && CLASS_COMPLETE_P (decl)) { ! classitf_redefinition_error ((is_interface ? "Interface" : "Class"), qualified_name, decl, cl); return 1; } --- 6352,6358 ---- } if (decl && CLASS_COMPLETE_P (decl)) { ! classitf_redefinition_error ((is_interface ? "Interface" : "Class"), qualified_name, decl, cl); return 1; } *************** check_class_interface_creation (is_inter *** 6952,6969 **** { const char *f; ! /* Contains OS dependent assumption on path separator. FIXME */ ! for (f = &input_filename [strlen (input_filename)]; ! f != input_filename && f[0] != '/' && f[0] != DIR_SEPARATOR; f--) ; ! if (f[0] == '/' || f[0] == DIR_SEPARATOR) f++; ! if (strncmp (IDENTIFIER_POINTER (raw_name), f , IDENTIFIER_LENGTH (raw_name)) || f [IDENTIFIER_LENGTH (raw_name)] != '.') parse_error_context ! (cl, "Public %s `%s' must be defined in a file called `%s.java'", (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name), IDENTIFIER_POINTER (raw_name)); --- 6366,6382 ---- { const char *f; ! for (f = &input_filename [strlen (input_filename)]; ! f != input_filename && ! IS_DIR_SEPARATOR (f[0]); f--) ; ! if (IS_DIR_SEPARATOR (f[0])) f++; ! if (strncmp (IDENTIFIER_POINTER (raw_name), f , IDENTIFIER_LENGTH (raw_name)) || f [IDENTIFIER_LENGTH (raw_name)] != '.') parse_error_context ! (cl, "Public %s `%s' must be defined in a file called `%s.java'", (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name), IDENTIFIER_POINTER (raw_name)); *************** check_class_interface_creation (is_inter *** 6978,6984 **** complaining a second time */ if (CPC_INNER_P () && !TOPLEVEL_CLASS_DECL_P (GET_CPC())) { ! parse_error_context (cl, "Inner class `%s' can't be static. Static classes can only occur in interfaces and top-level classes", IDENTIFIER_POINTER (qualified_name)); sca = ACC_STATIC; } --- 6391,6397 ---- complaining a second time */ if (CPC_INNER_P () && !TOPLEVEL_CLASS_DECL_P (GET_CPC())) { ! parse_error_context (cl, "Inner class `%s' can't be static. Static classes can only occur in interfaces and top-level classes", IDENTIFIER_POINTER (qualified_name)); sca = ACC_STATIC; } *************** check_class_interface_creation (is_inter *** 7006,7019 **** } } ! if (is_interface) { if (CPC_INNER_P ()) uaaf = INTERFACE_INNER_MODIFIERS; else uaaf = INTERFACE_MODIFIERS; ! ! check_modifiers ("Illegal modifier `%s' for interface declaration", flags, uaaf); } else --- 6419,6432 ---- } } ! if (is_interface) { if (CPC_INNER_P ()) uaaf = INTERFACE_INNER_MODIFIERS; else uaaf = INTERFACE_MODIFIERS; ! ! check_modifiers ("Illegal modifier `%s' for interface declaration", flags, uaaf); } else *************** check_class_interface_creation (is_inter *** 7024,7047 **** return 0; } ! static void make_nested_class_name (cpc_list) tree cpc_list; { tree name; if (!cpc_list) ! return; ! else ! make_nested_class_name (TREE_CHAIN (cpc_list)); /* Pick the qualified name when dealing with the first upmost enclosing class */ ! name = (TREE_CHAIN (cpc_list) ? ! TREE_PURPOSE (cpc_list) : DECL_NAME (TREE_VALUE (cpc_list))); obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); obstack_1grow (&temporary_obstack, '$'); } /* Can't redefine a class already defined in an earlier scope. */ --- 6437,6464 ---- return 0; } ! /* Construct a nested class name. If the final component starts with ! a digit, return true. Otherwise return false. */ ! static int make_nested_class_name (cpc_list) tree cpc_list; { tree name; if (!cpc_list) ! return 0; ! ! make_nested_class_name (TREE_CHAIN (cpc_list)); /* Pick the qualified name when dealing with the first upmost enclosing class */ ! name = (TREE_CHAIN (cpc_list) ! ? TREE_PURPOSE (cpc_list) : DECL_NAME (TREE_VALUE (cpc_list))); obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); obstack_1grow (&temporary_obstack, '$'); + + return ISDIGIT (IDENTIFIER_POINTER (name)[0]); } /* Can't redefine a class already defined in an earlier scope. */ *************** check_inner_class_redefinition (raw_name *** 7052,7062 **** { tree scope_list; ! for (scope_list = GET_CPC_LIST (); scope_list; scope_list = GET_NEXT_ENCLOSING_CPC (scope_list)) if (raw_name == GET_CPC_UN_NODE (scope_list)) { ! parse_error_context (cl, "The class name `%s' is already defined in this scope. An inner class may not have the same simple name as any of its enclosing classes", IDENTIFIER_POINTER (raw_name)); return 1; --- 6469,6479 ---- { tree scope_list; ! for (scope_list = GET_CPC_LIST (); scope_list; scope_list = GET_NEXT_ENCLOSING_CPC (scope_list)) if (raw_name == GET_CPC_UN_NODE (scope_list)) { ! parse_error_context (cl, "The class name `%s' is already defined in this scope. An inner class may not have the same simple name as any of its enclosing classes", IDENTIFIER_POINTER (raw_name)); return 1; *************** check_inner_class_redefinition (raw_name *** 7069,7075 **** static tree resolve_inner_class (circularity_hash, cl, enclosing, super, class_type) ! struct hash_table *circularity_hash; tree cl, *enclosing, *super, class_type; { tree local_enclosing = *enclosing; --- 6486,6492 ---- static tree resolve_inner_class (circularity_hash, cl, enclosing, super, class_type) ! htab_t circularity_hash; tree cl, *enclosing, *super, class_type; { tree local_enclosing = *enclosing; *************** resolve_inner_class (circularity_hash, c *** 7079,7086 **** { tree intermediate, decl; ! hash_lookup (circularity_hash, ! (const hash_table_key) local_enclosing, TRUE, NULL); if ((decl = find_as_inner_class (local_enclosing, class_type, cl))) return decl; --- 6496,6503 ---- { tree intermediate, decl; ! *htab_find_slot (circularity_hash, local_enclosing, INSERT) = ! local_enclosing; if ((decl = find_as_inner_class (local_enclosing, class_type, cl))) return decl; *************** resolve_inner_class (circularity_hash, c *** 7108,7119 **** /* We may not have checked for circular inheritance yet, so do so here to prevent an infinite loop. */ ! if (hash_lookup (circularity_hash, ! (const hash_table_key) local_super, FALSE, NULL)) { if (!cl) cl = lookup_cl (local_enclosing); ! parse_error_context (cl, "Cyclic inheritance involving %s", IDENTIFIER_POINTER (DECL_NAME (local_enclosing))); --- 6525,6535 ---- /* We may not have checked for circular inheritance yet, so do so here to prevent an infinite loop. */ ! if (htab_find (circularity_hash, local_super) != NULL) { if (!cl) cl = lookup_cl (local_enclosing); ! parse_error_context (cl, "Cyclic inheritance involving %s", IDENTIFIER_POINTER (DECL_NAME (local_enclosing))); *************** find_as_inner_class (enclosing, name, cl *** 7150,7156 **** qual = build_tree_list (cl, NULL_TREE); else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! if ((to_return = find_as_inner_class_do (qual, enclosing))) return to_return; --- 6566,6572 ---- qual = build_tree_list (cl, NULL_TREE); else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! if ((to_return = find_as_inner_class_do (qual, enclosing))) return to_return; *************** find_as_inner_class (enclosing, name, cl *** 7160,7169 **** { tree acc = NULL_TREE, decl = NULL_TREE, ptr; ! for (qual = EXPR_WFL_QUALIFICATION (cl); qual && !decl; qual = TREE_CHAIN (qual)) { ! acc = merge_qualified_name (acc, EXPR_WFL_NODE (TREE_PURPOSE (qual))); BUILD_PTR_FROM_NAME (ptr, acc); decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl); --- 6576,6585 ---- { tree acc = NULL_TREE, decl = NULL_TREE, ptr; ! for (qual = EXPR_WFL_QUALIFICATION (cl); qual && !decl; qual = TREE_CHAIN (qual)) { ! acc = merge_qualified_name (acc, EXPR_WFL_NODE (TREE_PURPOSE (qual))); BUILD_PTR_FROM_NAME (ptr, acc); decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl); *************** find_as_inner_class (enclosing, name, cl *** 7171,7177 **** /* A NULL qual and a decl means that the search ended successfully?!? We have to do something then. FIXME */ ! if (decl) enclosing = decl; else --- 6587,6593 ---- /* A NULL qual and a decl means that the search ended successfully?!? We have to do something then. FIXME */ ! if (decl) enclosing = decl; else *************** find_as_inner_class (enclosing, name, cl *** 7180,7186 **** /* Otherwise, create a qual for the other part of the resolution. */ else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! return find_as_inner_class_do (qual, enclosing); } --- 6596,6602 ---- /* Otherwise, create a qual for the other part of the resolution. */ else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! return find_as_inner_class_do (qual, enclosing); } *************** set_nested_class_simple_name_value (oute *** 7226,7232 **** tree l; for (l = DECL_INNER_CLASS_LIST (outer); l; l = TREE_CHAIN (l)) ! IDENTIFIER_GLOBAL_VALUE (TREE_VALUE (l)) = (set ? TREE_PURPOSE (l) : NULL_TREE); } --- 6642,6648 ---- tree l; for (l = DECL_INNER_CLASS_LIST (outer); l; l = TREE_CHAIN (l)) ! IDENTIFIER_GLOBAL_VALUE (TREE_VALUE (l)) = (set ? TREE_PURPOSE (l) : NULL_TREE); } *************** link_nested_class_to_enclosing () *** 7236,7242 **** if (GET_ENCLOSING_CPC ()) { tree enclosing = GET_ENCLOSING_CPC_CONTEXT (); ! DECL_INNER_CLASS_LIST (enclosing) = tree_cons (GET_CPC (), GET_CPC_UN (), DECL_INNER_CLASS_LIST (enclosing)); } --- 6652,6658 ---- if (GET_ENCLOSING_CPC ()) { tree enclosing = GET_ENCLOSING_CPC_CONTEXT (); ! DECL_INNER_CLASS_LIST (enclosing) = tree_cons (GET_CPC (), GET_CPC_UN (), DECL_INNER_CLASS_LIST (enclosing)); } *************** maybe_make_nested_class_name (name) *** 7250,7258 **** if (CPC_INNER_P ()) { ! make_nested_class_name (GET_CPC_LIST ()); obstack_grow0 (&temporary_obstack, ! IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); id = get_identifier (obstack_finish (&temporary_obstack)); if (ctxp->package) --- 6666,6687 ---- if (CPC_INNER_P ()) { ! /* If we're in a function, we must append a number to create the ! nested class name. However, we don't do this if the class we ! are constructing is anonymous, because in that case we'll ! already have a number as the class name. */ ! if (! make_nested_class_name (GET_CPC_LIST ()) ! && current_function_decl != NULL_TREE ! && ! ISDIGIT (IDENTIFIER_POINTER (name)[0])) ! { ! char buf[10]; ! sprintf (buf, "%d", anonymous_class_counter); ! ++anonymous_class_counter; ! obstack_grow (&temporary_obstack, buf, strlen (buf)); ! obstack_1grow (&temporary_obstack, '$'); ! } obstack_grow0 (&temporary_obstack, ! IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); id = get_identifier (obstack_finish (&temporary_obstack)); if (ctxp->package) *************** maybe_create_class_interface_decl (decl, *** 7297,7303 **** /* Install a new dependency list element */ create_jdep_list (ctxp); ! SOURCE_FRONTEND_DEBUG (("Defining class/interface %s", IDENTIFIER_POINTER (qualified_name))); return decl; } --- 6726,6732 ---- /* Install a new dependency list element */ create_jdep_list (ctxp); ! SOURCE_FRONTEND_DEBUG (("Defining class/interface %s", IDENTIFIER_POINTER (qualified_name))); return decl; } *************** create_interface (flags, id, super) *** 7348,7354 **** EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */ ! /* Basic checks: scope, redefinition, modifiers */ if (check_class_interface_creation (1, flags, raw_name, q_name, decl, id)) { PUSH_ERROR (); --- 6777,6783 ---- EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */ ! /* Basic checks: scope, redefinition, modifiers */ if (check_class_interface_creation (1, flags, raw_name, q_name, decl, id)) { PUSH_ERROR (); *************** create_interface (flags, id, super) *** 7373,7379 **** - abstract is obsolete (comes first, it's a warning, or should be) - Can't use twice the same (checked in the modifier rule) */ if ((flags & ACC_ABSTRACT) && flag_redundant) ! parse_warning_context (MODIFIER_WFL (ABSTRACT_TK), "Redundant use of `abstract' modifier. Interface `%s' is implicitly abstract", IDENTIFIER_POINTER (raw_name)); --- 6802,6808 ---- - abstract is obsolete (comes first, it's a warning, or should be) - Can't use twice the same (checked in the modifier rule) */ if ((flags & ACC_ABSTRACT) && flag_redundant) ! parse_warning_context (MODIFIER_WFL (ABSTRACT_TK), "Redundant use of `abstract' modifier. Interface `%s' is implicitly abstract", IDENTIFIER_POINTER (raw_name)); *************** create_interface (flags, id, super) *** 7381,7387 **** decl = maybe_create_class_interface_decl (decl, raw_name, q_name, id); /* Set super info and mark the class a complete */ ! set_super_info (ACC_INTERFACE | flags, TREE_TYPE (decl), object_type_node, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; --- 6810,6816 ---- decl = maybe_create_class_interface_decl (decl, raw_name, q_name, id); /* Set super info and mark the class a complete */ ! set_super_info (ACC_INTERFACE | flags, TREE_TYPE (decl), object_type_node, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; *************** create_interface (flags, id, super) *** 7390,7399 **** return decl; } - /* Anonymous class counter. Will be reset to 1 every time a non - anonymous class gets created. */ - static int anonymous_class_counter = 1; - /* Patch anonymous class CLASS, by either extending or implementing DEP. */ --- 6819,6824 ---- *************** create_class (flags, id, super, interfac *** 7498,7504 **** PUSH_ERROR (); return NULL_TREE; } ! /* Suspend the current parsing context if we're parsing an inner class or an anonymous class. */ if (CPC_INNER_P ()) --- 6923,6929 ---- PUSH_ERROR (); return NULL_TREE; } ! /* Suspend the current parsing context if we're parsing an inner class or an anonymous class. */ if (CPC_INNER_P ()) *************** create_class (flags, id, super, interfac *** 7508,7520 **** if (CLASS_INTERFACE (GET_CPC ())) flags |= ACC_PUBLIC; } ! /* Push a new context for (static) initialized upon declaration fields */ java_parser_context_push_initialized_field (); ! /* Class modifier check: - Allowed modifier (already done at that point) ! - abstract AND final forbidden - Public classes defined in the correct file */ if ((flags & ACC_ABSTRACT) && (flags & ACC_FINAL)) parse_error_context --- 6933,6945 ---- if (CLASS_INTERFACE (GET_CPC ())) flags |= ACC_PUBLIC; } ! /* Push a new context for (static) initialized upon declaration fields */ java_parser_context_push_initialized_field (); ! /* Class modifier check: - Allowed modifier (already done at that point) ! - abstract AND final forbidden - Public classes defined in the correct file */ if ((flags & ACC_ABSTRACT) && (flags & ACC_FINAL)) parse_error_context *************** create_class (flags, id, super, interfac *** 7534,7540 **** return NULL_TREE; } ! super_decl_type = register_incomplete_type (JDEP_SUPER, super, decl, NULL_TREE); } else if (TREE_TYPE (decl) != object_type_node) --- 6959,6965 ---- return NULL_TREE; } ! super_decl_type = register_incomplete_type (JDEP_SUPER, super, decl, NULL_TREE); } else if (TREE_TYPE (decl) != object_type_node) *************** create_class (flags, id, super, interfac *** 7551,7557 **** } /* Set super info and mark the class as complete. */ ! set_super_info (flags, TREE_TYPE (decl), super_decl_type, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; --- 6976,6982 ---- } /* Set super info and mark the class as complete. */ ! set_super_info (flags, TREE_TYPE (decl), super_decl_type, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; *************** add_inner_class_fields (class_decl, fct_ *** 7615,7628 **** f = add_field (TREE_TYPE (class_decl), build_current_thisn (TREE_TYPE (class_decl)), ! build_pointer_type (TREE_TYPE (DECL_CONTEXT (class_decl))), ACC_PRIVATE); FIELD_THISN (f) = 1; if (!fct_decl) return; ! ! for (block = GET_CURRENT_BLOCK (fct_decl); block && TREE_CODE (block) == BLOCK; block = BLOCK_SUPERCONTEXT (block)) { tree decl; --- 7040,7053 ---- f = add_field (TREE_TYPE (class_decl), build_current_thisn (TREE_TYPE (class_decl)), ! build_pointer_type (TREE_TYPE (DECL_CONTEXT (class_decl))), ACC_PRIVATE); FIELD_THISN (f) = 1; if (!fct_decl) return; ! ! for (block = GET_CURRENT_BLOCK (fct_decl); block && TREE_CODE (block) == BLOCK; block = BLOCK_SUPERCONTEXT (block)) { tree decl; *************** add_inner_class_fields (class_decl, fct_ *** 7630,7640 **** { tree name, pname; tree wfl, init, list; ! /* Avoid non final arguments. */ if (!LOCAL_FINAL_P (decl)) continue; ! MANGLE_OUTER_LOCAL_VARIABLE_NAME (name, DECL_NAME (decl)); MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID (pname, DECL_NAME (decl)); wfl = build_wfl_node (name); --- 7055,7065 ---- { tree name, pname; tree wfl, init, list; ! /* Avoid non final arguments. */ if (!LOCAL_FINAL_P (decl)) continue; ! MANGLE_OUTER_LOCAL_VARIABLE_NAME (name, DECL_NAME (decl)); MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID (pname, DECL_NAME (decl)); wfl = build_wfl_node (name); *************** add_inner_class_fields (class_decl, fct_ *** 7646,7652 **** invoking it (hence the constructor will also feature a hidden parameter, set to the value of the outer context local at the time the inner class is created.) ! Note: we take into account all possible locals that can be accessed by the inner class. It's actually not trivial to minimize these aliases down to the ones really --- 7071,7077 ---- invoking it (hence the constructor will also feature a hidden parameter, set to the value of the outer context local at the time the inner class is created.) ! Note: we take into account all possible locals that can be accessed by the inner class. It's actually not trivial to minimize these aliases down to the ones really *************** add_inner_class_fields (class_decl, fct_ *** 7661,7674 **** identify locals really used in the inner class. We leave the flag FIELD_LOCAL_ALIAS_USED around for that future use. ! On the other hand, it only affect local inner classes, whose constructors (and finit$ call) will be featuring unecessary arguments. It's easy for a developper to keep this number of parameter down by using the `final' keyword only when necessary. For the time being, we can issue a warning on unecessary finals. FIXME */ ! init = build_assignment (ASSIGN_TK, EXPR_WFL_LINECOL (wfl), wfl, init); /* Register the field. The TREE_LIST holding the part --- 7086,7099 ---- identify locals really used in the inner class. We leave the flag FIELD_LOCAL_ALIAS_USED around for that future use. ! On the other hand, it only affect local inner classes, whose constructors (and finit$ call) will be featuring unecessary arguments. It's easy for a developper to keep this number of parameter down by using the `final' keyword only when necessary. For the time being, we can issue a warning on unecessary finals. FIXME */ ! init = build_assignment (ASSIGN_TK, EXPR_WFL_LINECOL (wfl), wfl, init); /* Register the field. The TREE_LIST holding the part *************** duplicate_declaration_error_p (new_field *** 7762,7780 **** if (decl) { char *t1 = xstrdup (purify_type_name ! ((TREE_CODE (new_type) == POINTER_TYPE && TREE_TYPE (new_type) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (new_type)) : lang_printable_name (new_type, 1))); /* The type may not have been completed by the time we report the error */ char *t2 = xstrdup (purify_type_name ! ((TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE && TREE_TYPE (TREE_TYPE (decl)) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl))) : lang_printable_name (TREE_TYPE (decl), 1))); ! parse_error_context ! (cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)", t1, IDENTIFIER_POINTER (new_field_name), t2, IDENTIFIER_POINTER (DECL_NAME (decl)), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); --- 7187,7205 ---- if (decl) { char *t1 = xstrdup (purify_type_name ! ((TREE_CODE (new_type) == POINTER_TYPE && TREE_TYPE (new_type) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (new_type)) : lang_printable_name (new_type, 1))); /* The type may not have been completed by the time we report the error */ char *t2 = xstrdup (purify_type_name ! ((TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE && TREE_TYPE (TREE_TYPE (decl)) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl))) : lang_printable_name (TREE_TYPE (decl), 1))); ! parse_error_context ! (cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)", t1, IDENTIFIER_POINTER (new_field_name), t2, IDENTIFIER_POINTER (DECL_NAME (decl)), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); *************** register_fields (flags, type, variable_l *** 7827,7833 **** /* If TYPE is fully resolved and we don't have a reference, make one */ PROMOTE_RECORD_IF_COMPLETE (type, must_chain); ! for (current = variable_list, saved_type = type; current; current = TREE_CHAIN (current), type = saved_type) { tree real_type; --- 7252,7258 ---- /* If TYPE is fully resolved and we don't have a reference, make one */ PROMOTE_RECORD_IF_COMPLETE (type, must_chain); ! for (current = variable_list, saved_type = type; current; current = TREE_CHAIN (current), type = saved_type) { tree real_type; *************** register_fields (flags, type, variable_l *** 7839,7845 **** /* Can't declare non-final static fields in inner classes */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (class_type) && !(flags & ACC_FINAL)) ! parse_error_context (cl, "Field `%s' can't be static in inner class `%s' unless it is final", IDENTIFIER_POINTER (EXPR_WFL_NODE (cl)), lang_printable_name (class_type, 0)); --- 7264,7270 ---- /* Can't declare non-final static fields in inner classes */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (class_type) && !(flags & ACC_FINAL)) ! parse_error_context (cl, "Field `%s' can't be static in inner class `%s' unless it is final", IDENTIFIER_POINTER (EXPR_WFL_NODE (cl)), lang_printable_name (class_type, 0)); *************** register_fields (flags, type, variable_l *** 7893,7903 **** FIELD_LOCAL_ALIAS (field_decl) = 1; FIELD_FINAL (field_decl) = 0; } ! /* Check if we must chain. */ if (must_chain) register_incomplete_type (JDEP_FIELD, wfl, field_decl, type); ! /* If we have an initialization value tied to the field */ if (init) { --- 7318,7328 ---- FIELD_LOCAL_ALIAS (field_decl) = 1; FIELD_FINAL (field_decl) = 0; } ! /* Check if we must chain. */ if (must_chain) register_incomplete_type (JDEP_FIELD, wfl, field_decl, type); ! /* If we have an initialization value tied to the field */ if (init) { *************** register_fields (flags, type, variable_l *** 7912,7918 **** appropriately. */ TREE_CHAIN (init) = CPC_STATIC_INITIALIZER_STMT (ctxp); SET_CPC_STATIC_INITIALIZER_STMT (ctxp, init); ! if (TREE_OPERAND (init, 1) && TREE_CODE (TREE_OPERAND (init, 1)) == NEW_ARRAY_INIT) TREE_STATIC (TREE_OPERAND (init, 1)) = 1; } --- 7337,7343 ---- appropriately. */ TREE_CHAIN (init) = CPC_STATIC_INITIALIZER_STMT (ctxp); SET_CPC_STATIC_INITIALIZER_STMT (ctxp, init); ! if (TREE_OPERAND (init, 1) && TREE_CODE (TREE_OPERAND (init, 1)) == NEW_ARRAY_INIT) TREE_STATIC (TREE_OPERAND (init, 1)) = 1; } *************** generate_finit (class_type) *** 7944,7951 **** tree list = TYPE_FINIT_STMT_LIST (class_type); tree mdecl, current, parms; ! parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, NULL_TREE, &count); CRAFTED_PARAM_LIST_FIXUP (parms); mdecl = create_artificial_method (class_type, ACC_PRIVATE, void_type_node, --- 7369,7376 ---- tree list = TYPE_FINIT_STMT_LIST (class_type); tree mdecl, current, parms; ! parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, NULL_TREE, &count); CRAFTED_PARAM_LIST_FIXUP (parms); mdecl = create_artificial_method (class_type, ACC_PRIVATE, void_type_node, *************** generate_finit (class_type) *** 7957,7964 **** start_artificial_method_body (mdecl); for (current = list; current; current = TREE_CHAIN (current)) ! java_method_add_stmt (mdecl, ! build_debugable_stmt (EXPR_WFL_LINECOL (current), current)); end_artificial_method_body (mdecl); return mdecl; --- 7382,7389 ---- start_artificial_method_body (mdecl); for (current = list; current; current = TREE_CHAIN (current)) ! java_method_add_stmt (mdecl, ! build_debugable_stmt (EXPR_WFL_LINECOL (current), current)); end_artificial_method_body (mdecl); return mdecl; *************** generate_instinit (class_type) *** 7987,7993 **** mdecl, NULL_TREE); /* Gather all the statements in a compound */ ! for (current = TYPE_II_STMT_LIST (class_type); current; current = TREE_CHAIN (current)) compound = add_stmt_to_compound (compound, NULL_TREE, current); --- 7412,7418 ---- mdecl, NULL_TREE); /* Gather all the statements in a compound */ ! for (current = TYPE_II_STMT_LIST (class_type); current; current = TREE_CHAIN (current)) compound = add_stmt_to_compound (compound, NULL_TREE, current); *************** generate_instinit (class_type) *** 7996,8005 **** We do that only if all ctors of CLASS_TYPE are set to catch a checked exception. This doesn't apply to anonymous classes (since they don't have declared ctors.) */ ! if (!ANONYMOUS_CLASS_P (class_type) && ctors_unchecked_throws_clause_p (class_type)) { ! compound = encapsulate_with_try_catch (0, exception_type_node, compound, build1 (THROW_EXPR, NULL_TREE, build_wfl_node (wpv_id))); DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, --- 7421,7430 ---- We do that only if all ctors of CLASS_TYPE are set to catch a checked exception. This doesn't apply to anonymous classes (since they don't have declared ctors.) */ ! if (!ANONYMOUS_CLASS_P (class_type) && ctors_unchecked_throws_clause_p (class_type)) { ! compound = encapsulate_with_try_catch (0, exception_type_node, compound, build1 (THROW_EXPR, NULL_TREE, build_wfl_node (wpv_id))); DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, *************** method_header (flags, type, mdecl, throw *** 8062,8068 **** return error_mark_node; meth = TREE_VALUE (mdecl); id = TREE_PURPOSE (mdecl); ! check_modifiers_consistency (flags); if (GET_CPC ()) --- 7487,7493 ---- return error_mark_node; meth = TREE_VALUE (mdecl); id = TREE_PURPOSE (mdecl); ! check_modifiers_consistency (flags); if (GET_CPC ()) *************** method_header (flags, type, mdecl, throw *** 8070,8076 **** if (!this_class || this_class == error_mark_node) return NULL_TREE; ! /* There are some forbidden modifiers for an abstract method and its class must be abstract as well. */ if (type && (flags & ACC_ABSTRACT)) --- 7495,7501 ---- if (!this_class || this_class == error_mark_node) return NULL_TREE; ! /* There are some forbidden modifiers for an abstract method and its class must be abstract as well. */ if (type && (flags & ACC_ABSTRACT)) *************** method_header (flags, type, mdecl, throw *** 8083,8094 **** ABSTRACT_CHECK (flags, ACC_STRICT, id, "Strictfp"); if (!CLASS_ABSTRACT (TYPE_NAME (this_class)) && !CLASS_INTERFACE (TYPE_NAME (this_class))) ! parse_error_context ! (id, "Class `%s' must be declared abstract to define abstract method `%s'", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ())), IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); } /* Things to be checked when declaring a constructor */ if (!type) { --- 7508,7531 ---- ABSTRACT_CHECK (flags, ACC_STRICT, id, "Strictfp"); if (!CLASS_ABSTRACT (TYPE_NAME (this_class)) && !CLASS_INTERFACE (TYPE_NAME (this_class))) ! parse_error_context ! (id, "Class `%s' must be declared abstract to define abstract method `%s'", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ())), IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); } + /* A native method can't be strictfp. */ + if ((flags & ACC_NATIVE) && (flags & ACC_STRICT)) + parse_error_context (id, "native method `%s' can't be strictfp", + IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); + /* No such thing as a transient or volatile method. */ + if ((flags & ACC_TRANSIENT)) + parse_error_context (id, "method `%s' can't be transient", + IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); + if ((flags & ACC_VOLATILE)) + parse_error_context (id, "method `%s' can't be volatile", + IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); + /* Things to be checked when declaring a constructor */ if (!type) { *************** method_header (flags, type, mdecl, throw *** 8096,8102 **** /* 8.6: Constructor declarations: we might be trying to define a method without specifying a return type. */ if (EXPR_WFL_NODE (id) != GET_CPC_UN ()) ! parse_error_context (id, "Invalid method declaration, return type required"); /* 8.6.3: Constructor modifiers */ else --- 7533,7539 ---- /* 8.6: Constructor declarations: we might be trying to define a method without specifying a return type. */ if (EXPR_WFL_NODE (id) != GET_CPC_UN ()) ! parse_error_context (id, "Invalid method declaration, return type required"); /* 8.6.3: Constructor modifiers */ else *************** method_header (flags, type, mdecl, throw *** 8135,8141 **** /* Inner class can't declare static methods */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (this_class)) { ! parse_error_context (id, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", IDENTIFIER_POINTER (EXPR_WFL_NODE (id)), lang_printable_name (this_class, 0)); --- 7572,7578 ---- /* Inner class can't declare static methods */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (this_class)) { ! parse_error_context (id, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", IDENTIFIER_POINTER (EXPR_WFL_NODE (id)), lang_printable_name (this_class, 0)); *************** method_header (flags, type, mdecl, throw *** 8177,8183 **** /* When defining an abstract or interface method, the curly bracket at level 1 doesn't exist because there is no function body */ ! lineno = (ctxp->first_ccb_indent1 ? ctxp->first_ccb_indent1 : EXPR_WFL_LINENO (id)); /* Remember the original argument list */ --- 7614,7620 ---- /* When defining an abstract or interface method, the curly bracket at level 1 doesn't exist because there is no function body */ ! lineno = (ctxp->first_ccb_indent1 ? ctxp->first_ccb_indent1 : EXPR_WFL_LINENO (id)); /* Remember the original argument list */ *************** method_header (flags, type, mdecl, throw *** 8198,8204 **** register_incomplete_type (JDEP_METHOD_END, NULL_TREE, meth, NULL_TREE); } else ! meth = add_method (this_class, flags, meth_name, build_java_signature (meth)); /* Remember final parameters */ --- 7635,7641 ---- register_incomplete_type (JDEP_METHOD_END, NULL_TREE, meth, NULL_TREE); } else ! meth = add_method (this_class, flags, meth_name, build_java_signature (meth)); /* Remember final parameters */ *************** method_header (flags, type, mdecl, throw *** 8224,8230 **** { register_incomplete_type (JDEP_EXCEPTION, TREE_VALUE (current), NULL_TREE, NULL_TREE); ! JDEP_GET_PATCH (CLASSD_LAST (ctxp->classd_list)) = &TREE_VALUE (current); } DECL_FUNCTION_THROWS (meth) = throws; --- 7661,7667 ---- { register_incomplete_type (JDEP_EXCEPTION, TREE_VALUE (current), NULL_TREE, NULL_TREE); ! JDEP_GET_PATCH (CLASSD_LAST (ctxp->classd_list)) = &TREE_VALUE (current); } DECL_FUNCTION_THROWS (meth) = throws; *************** method_header (flags, type, mdecl, throw *** 8239,8245 **** DECL_CONSTRUCTOR_P (meth) = 1; /* Compute and store the number of artificial parameters declared for this constructor */ ! for (count = 0, current = TYPE_FIELDS (this_class); current; current = TREE_CHAIN (current)) if (FIELD_LOCAL_ALIAS (current)) count++; --- 7676,7682 ---- DECL_CONSTRUCTOR_P (meth) = 1; /* Compute and store the number of artificial parameters declared for this constructor */ ! for (count = 0, current = TYPE_FIELDS (this_class); current; current = TREE_CHAIN (current)) if (FIELD_LOCAL_ALIAS (current)) count++; *************** finish_method_declaration (method_body) *** 8292,8298 **** if ((flags & ACC_ABSTRACT || flags & ACC_NATIVE) && method_body) { tree name = DECL_NAME (current_function_decl); ! parse_error_context (DECL_FUNCTION_WFL (current_function_decl), "%s method `%s' can't have a body defined", (METHOD_NATIVE (current_function_decl) ? "Native" : "Abstract"), --- 7729,7735 ---- if ((flags & ACC_ABSTRACT || flags & ACC_NATIVE) && method_body) { tree name = DECL_NAME (current_function_decl); ! parse_error_context (DECL_FUNCTION_WFL (current_function_decl), "%s method `%s' can't have a body defined", (METHOD_NATIVE (current_function_decl) ? "Native" : "Abstract"), *************** finish_method_declaration (method_body) *** 8303,8317 **** { tree name = DECL_NAME (current_function_decl); parse_error_context ! (DECL_FUNCTION_WFL (current_function_decl), "Non native and non abstract method `%s' must have a body defined", IDENTIFIER_POINTER (name)); method_body = NULL_TREE; } ! if (flag_emit_class_files && method_body ! && TREE_CODE (method_body) == NOP_EXPR ! && TREE_TYPE (current_function_decl) && TREE_TYPE (TREE_TYPE (current_function_decl)) == void_type_node) method_body = build1 (RETURN_EXPR, void_type_node, NULL); --- 7740,7754 ---- { tree name = DECL_NAME (current_function_decl); parse_error_context ! (DECL_FUNCTION_WFL (current_function_decl), "Non native and non abstract method `%s' must have a body defined", IDENTIFIER_POINTER (name)); method_body = NULL_TREE; } ! if (flag_emit_class_files && method_body ! && TREE_CODE (method_body) == NOP_EXPR ! && TREE_TYPE (current_function_decl) && TREE_TYPE (TREE_TYPE (current_function_decl)) == void_type_node) method_body = build1 (RETURN_EXPR, void_type_node, NULL); *************** finish_method_declaration (method_body) *** 8328,8334 **** ARG_FINAL_P parameter that might have been set on some of this function parameters. */ UNMARK_FINAL_PARMS (current_function_decl); ! /* So we don't have an irrelevant function declaration context for the next static block we'll see. */ current_function_decl = NULL_TREE; --- 7765,7771 ---- ARG_FINAL_P parameter that might have been set on some of this function parameters. */ UNMARK_FINAL_PARMS (current_function_decl); ! /* So we don't have an irrelevant function declaration context for the next static block we'll see. */ current_function_decl = NULL_TREE; *************** constructor_circularity_msg (from, to) *** 8350,8404 **** /* Verify a circular call to METH. Return 1 if an error is found, 0 otherwise. */ static int verify_constructor_circularity (meth, current) tree meth, current; { - static tree list = NULL_TREE; - static int initialized_p; tree c; - /* If we haven't already registered LIST with the garbage collector, - do so now. */ - if (!initialized_p) - { - ggc_add_tree_root (&list, 1); - initialized_p = 1; - } - for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { if (TREE_VALUE (c) == meth) { char *t; ! if (list) { tree liste; ! list = nreverse (list); ! for (liste = list; liste; liste = TREE_CHAIN (liste)) { ! parse_error_context (TREE_PURPOSE (TREE_PURPOSE (liste)), "%s", constructor_circularity_msg ! (TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste)))); java_error_count--; } } t = xstrdup (lang_printable_name (meth, 0)); ! parse_error_context (TREE_PURPOSE (c), "%s: recursive invocation of constructor `%s'", constructor_circularity_msg (current, meth), t); free (t); ! list = NULL_TREE; return 1; } } for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { ! list = tree_cons (c, current, list); if (verify_constructor_circularity (meth, TREE_VALUE (c))) return 1; ! list = TREE_CHAIN (list); } return 0; } --- 7787,7832 ---- /* Verify a circular call to METH. Return 1 if an error is found, 0 otherwise. */ + static GTY(()) tree vcc_list; static int verify_constructor_circularity (meth, current) tree meth, current; { tree c; for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { if (TREE_VALUE (c) == meth) { char *t; ! if (vcc_list) { tree liste; ! vcc_list = nreverse (vcc_list); ! for (liste = vcc_list; liste; liste = TREE_CHAIN (liste)) { ! parse_error_context (TREE_PURPOSE (TREE_PURPOSE (liste)), "%s", constructor_circularity_msg ! (TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste)))); java_error_count--; } } t = xstrdup (lang_printable_name (meth, 0)); ! parse_error_context (TREE_PURPOSE (c), "%s: recursive invocation of constructor `%s'", constructor_circularity_msg (current, meth), t); free (t); ! vcc_list = NULL_TREE; return 1; } } for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { ! vcc_list = tree_cons (c, current, vcc_list); if (verify_constructor_circularity (meth, TREE_VALUE (c))) return 1; ! vcc_list = TREE_CHAIN (vcc_list); } return 0; } *************** check_abstract_method_header (meth) *** 8439,8445 **** OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (ABSTRACT_TK), flags, ACC_ABSTRACT, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); ! OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (PUBLIC_TK), flags, ACC_PUBLIC, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); --- 7867,7873 ---- OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (ABSTRACT_TK), flags, ACC_ABSTRACT, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); ! OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (PUBLIC_TK), flags, ACC_PUBLIC, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); *************** method_declarator (id, list) *** 8469,8481 **** this$ decl in the name field of its parameter declaration. We also might have to hide the outer context local alias initializers. Not done when the class is a toplevel class. */ ! if (PURE_INNER_CLASS_DECL_P (GET_CPC ()) && EXPR_WFL_NODE (id) == GET_CPC_UN ()) { tree aliases_list, type, thisn; /* First the aliases, linked to the regular parameters */ aliases_list = ! build_alias_initializer_parameter_list (AIPL_FUNCTION_DECLARATION, TREE_TYPE (GET_CPC ()), NULL_TREE, NULL); list = chainon (nreverse (aliases_list), list); --- 7897,7909 ---- this$ decl in the name field of its parameter declaration. We also might have to hide the outer context local alias initializers. Not done when the class is a toplevel class. */ ! if (PURE_INNER_CLASS_DECL_P (GET_CPC ()) && EXPR_WFL_NODE (id) == GET_CPC_UN ()) { tree aliases_list, type, thisn; /* First the aliases, linked to the regular parameters */ aliases_list = ! build_alias_initializer_parameter_list (AIPL_FUNCTION_DECLARATION, TREE_TYPE (GET_CPC ()), NULL_TREE, NULL); list = chainon (nreverse (aliases_list), list); *************** method_declarator (id, list) *** 8486,8492 **** list = tree_cons (build_wfl_node (thisn), build_pointer_type (type), list); } ! for (current = list; current; current = TREE_CHAIN (current)) { int must_chain = 0; --- 7914,7920 ---- list = tree_cons (build_wfl_node (thisn), build_pointer_type (type), list); } ! for (current = list; current; current = TREE_CHAIN (current)) { int must_chain = 0; *************** method_declarator (id, list) *** 8529,8535 **** if (must_chain) { patch_stage = JDEP_METHOD; ! type = register_incomplete_type (patch_stage, type_wfl, wfl_name, type); jdep = CLASSD_LAST (ctxp->classd_list); JDEP_MISC (jdep) = id; --- 7957,7963 ---- if (must_chain) { patch_stage = JDEP_METHOD; ! type = register_incomplete_type (patch_stage, type_wfl, wfl_name, type); jdep = CLASSD_LAST (ctxp->classd_list); JDEP_MISC (jdep) = id; *************** method_declarator (id, list) *** 8539,8545 **** arg_node = build_tree_list (name, real_type); /* Remeber arguments declared final. */ ARG_FINAL_P (arg_node) = ARG_FINAL_P (current); ! if (jdep) JDEP_GET_PATCH (jdep) = &TREE_VALUE (arg_node); TREE_CHAIN (arg_node) = arg_types; --- 7967,7973 ---- arg_node = build_tree_list (name, real_type); /* Remeber arguments declared final. */ ARG_FINAL_P (arg_node) = ARG_FINAL_P (current); ! if (jdep) JDEP_GET_PATCH (jdep) = &TREE_VALUE (arg_node); TREE_CHAIN (arg_node) = arg_types; *************** static int *** 8554,8560 **** unresolved_type_p (wfl, returned) tree wfl; tree *returned; ! { if (TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION) { --- 7982,7988 ---- unresolved_type_p (wfl, returned) tree wfl; tree *returned; ! { if (TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION) { *************** parser_qualified_classname (name) *** 8589,8595 **** if (ctxp->package) return merge_qualified_name (ctxp->package, name); ! else return name; } --- 8017,8023 ---- if (ctxp->package) return merge_qualified_name (ctxp->package, name); ! else return name; } *************** parser_check_super_interface (super_decl *** 8605,8613 **** /* Has to be an interface */ if (!CLASS_INTERFACE (super_decl)) { ! parse_error_context (this_wfl, "%s `%s' can't implement/extend %s `%s'", ! (CLASS_INTERFACE (TYPE_NAME (TREE_TYPE (this_decl))) ? "Interface" : "Class"), IDENTIFIER_POINTER (DECL_NAME (this_decl)), (TYPE_ARRAY_P (super_type) ? "array" : "class"), --- 8033,8041 ---- /* Has to be an interface */ if (!CLASS_INTERFACE (super_decl)) { ! parse_error_context (this_wfl, "%s `%s' can't implement/extend %s `%s'", ! (CLASS_INTERFACE (TYPE_NAME (TREE_TYPE (this_decl))) ? "Interface" : "Class"), IDENTIFIER_POINTER (DECL_NAME (this_decl)), (TYPE_ARRAY_P (super_type) ? "array" : "class"), *************** parser_check_super_interface (super_decl *** 8615,8621 **** return 1; } ! /* Check top-level interface access. Inner classes are subject to member access rules (6.6.1). */ if (! INNER_CLASS_P (super_type) && check_pkg_class_access (DECL_NAME (super_decl), --- 8043,8049 ---- return 1; } ! /* Check top-level interface access. Inner classes are subject to member access rules (6.6.1). */ if (! INNER_CLASS_P (super_type) && check_pkg_class_access (DECL_NAME (super_decl), *************** parser_check_super (super_decl, this_dec *** 8640,8646 **** /* SUPER should be a CLASS (neither an array nor an interface) */ if (TYPE_ARRAY_P (super_type) || CLASS_INTERFACE (TYPE_NAME (super_type))) { ! parse_error_context (wfl, "Class `%s' can't subclass %s `%s'", IDENTIFIER_POINTER (DECL_NAME (this_decl)), (CLASS_INTERFACE (TYPE_NAME (super_type)) ? "interface" : "array"), --- 8068,8074 ---- /* SUPER should be a CLASS (neither an array nor an interface) */ if (TYPE_ARRAY_P (super_type) || CLASS_INTERFACE (TYPE_NAME (super_type))) { ! parse_error_context (wfl, "Class `%s' can't subclass %s `%s'", IDENTIFIER_POINTER (DECL_NAME (this_decl)), (CLASS_INTERFACE (TYPE_NAME (super_type)) ? "interface" : "array"), *************** parser_check_super (super_decl, this_dec *** 8660,8666 **** if (! INNER_CLASS_P (super_type) && (check_pkg_class_access (DECL_NAME (super_decl), wfl, true))) return 1; ! SOURCE_FRONTEND_DEBUG (("Completing class %s with %s", IDENTIFIER_POINTER (DECL_NAME (this_decl)), IDENTIFIER_POINTER (DECL_NAME (super_decl)))); --- 8088,8094 ---- if (! INNER_CLASS_P (super_type) && (check_pkg_class_access (DECL_NAME (super_decl), wfl, true))) return 1; ! SOURCE_FRONTEND_DEBUG (("Completing class %s with %s", IDENTIFIER_POINTER (DECL_NAME (this_decl)), IDENTIFIER_POINTER (DECL_NAME (super_decl)))); *************** static void *** 8674,8680 **** create_jdep_list (ctxp) struct parser_ctxt *ctxp; { ! jdeplist *new = (jdeplist *)xmalloc (sizeof (jdeplist)); new->first = new->last = NULL; new->next = ctxp->classd_list; ctxp->classd_list = new; --- 8102,8108 ---- create_jdep_list (ctxp) struct parser_ctxt *ctxp; { ! jdeplist *new = (jdeplist *)xmalloc (sizeof (jdeplist)); new->first = new->last = NULL; new->next = ctxp->classd_list; ctxp->classd_list = new; *************** register_incomplete_type (kind, wfl, dec *** 8744,8750 **** && GET_ENCLOSING_CPC ()) JDEP_ENCLOSING (new) = TREE_VALUE (GET_ENCLOSING_CPC ()); else if (kind == JDEP_SUPER) ! JDEP_ENCLOSING (new) = (GET_ENCLOSING_CPC () ? TREE_VALUE (GET_ENCLOSING_CPC ()) : NULL_TREE); else JDEP_ENCLOSING (new) = GET_CPC (); --- 8172,8178 ---- && GET_ENCLOSING_CPC ()) JDEP_ENCLOSING (new) = TREE_VALUE (GET_ENCLOSING_CPC ()); else if (kind == JDEP_SUPER) ! JDEP_ENCLOSING (new) = (GET_ENCLOSING_CPC () ? TREE_VALUE (GET_ENCLOSING_CPC ()) : NULL_TREE); else JDEP_ENCLOSING (new) = GET_CPC (); *************** check_circular_reference (type) *** 8827,8833 **** return lookup_cl (TYPE_NAME (type)); return NULL_TREE; } ! for (i = 0; i < TREE_VEC_LENGTH (basetype_vec); i++) { tree vec_elt = TREE_VEC_ELT (basetype_vec, i); --- 8255,8261 ---- return lookup_cl (TYPE_NAME (type)); return NULL_TREE; } ! for (i = 0; i < TREE_VEC_LENGTH (basetype_vec); i++) { tree vec_elt = TREE_VEC_ELT (basetype_vec, i); *************** build_alias_initializer_parameter_list ( *** 8883,8889 **** switch (mode) { case AIPL_FUNCTION_DECLARATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); purpose = build_wfl_node (mangled_id); if (TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE) --- 8311,8317 ---- switch (mode) { case AIPL_FUNCTION_DECLARATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); purpose = build_wfl_node (mangled_id); if (TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE) *************** build_alias_initializer_parameter_list ( *** 8899,8905 **** break; case AIPL_FUNCTION_FINIT_INVOCATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); /* Now, this is wrong. purpose should always be the NAME of something and value its matching value (decl, type, --- 8327,8333 ---- break; case AIPL_FUNCTION_FINIT_INVOCATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); /* Now, this is wrong. purpose should always be the NAME of something and value its matching value (decl, type, *************** build_alias_initializer_parameter_list ( *** 8932,8938 **** } if (additional_parms) { ! if (ANONYMOUS_CLASS_P (class_type) && mode == AIPL_FUNCTION_CTOR_INVOCATION) additional_parms = nreverse (additional_parms); parm = chainon (additional_parms, parm); --- 8360,8366 ---- } if (additional_parms) { ! if (ANONYMOUS_CLASS_P (class_type) && mode == AIPL_FUNCTION_CTOR_INVOCATION) additional_parms = nreverse (additional_parms); parm = chainon (additional_parms, parm); *************** craft_constructor (class_decl, args) *** 8956,8962 **** int i = 0, artificial = 0; tree decl, ctor_name; char buffer [80]; ! /* The constructor name is unless we're dealing with an anonymous class, in which case the name will be fixed after having be expanded. */ --- 8384,8390 ---- int i = 0, artificial = 0; tree decl, ctor_name; char buffer [80]; ! /* The constructor name is unless we're dealing with an anonymous class, in which case the name will be fixed after having be expanded. */ *************** craft_constructor (class_decl, args) *** 8976,8982 **** /* Some more arguments to be hidden here. The values of the local variables of the outer context that the inner class needs to see. */ parm = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, parm, &artificial); } --- 8404,8410 ---- /* Some more arguments to be hidden here. The values of the local variables of the outer context that the inner class needs to see. */ parm = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, parm, &artificial); } *************** craft_constructor (class_decl, args) *** 8988,8994 **** } CRAFTED_PARAM_LIST_FIXUP (parm); ! decl = create_artificial_method (class_type, flags, void_type_node, ctor_name, parm); fix_method_argument_names (parm, decl); /* Now, mark the artificial parameters. */ --- 8416,8422 ---- } CRAFTED_PARAM_LIST_FIXUP (parm); ! decl = create_artificial_method (class_type, flags, void_type_node, ctor_name, parm); fix_method_argument_names (parm, decl); /* Now, mark the artificial parameters. */ *************** jdep_resolve_class (dep) *** 9067,9073 **** JDEP_DECL (dep), JDEP_WFL (dep)); JDEP_RESOLVED (dep, decl); } ! if (!decl) complete_class_report_errors (dep); else if (PURE_INNER_CLASS_DECL_P (decl)) --- 8495,8501 ---- JDEP_DECL (dep), JDEP_WFL (dep)); JDEP_RESOLVED (dep, decl); } ! if (!decl) complete_class_report_errors (dep); else if (PURE_INNER_CLASS_DECL_P (decl)) *************** java_complete_class () *** 9097,9108 **** /* Process imports */ process_imports (); ! /* Rever things so we have the right order */ ctxp->class_list = nreverse (ctxp->class_list); ctxp->classd_list = reverse_jdep_list (ctxp); ! for (cclassd = ctxp->classd_list, cclass = ctxp->class_list; ! cclass && cclassd; cclass = TREE_CHAIN (cclass), cclassd = CLASSD_CHAIN (cclassd)) { jdep *dep; --- 8525,8536 ---- /* Process imports */ process_imports (); ! /* Reverse things so we have the right order */ ctxp->class_list = nreverse (ctxp->class_list); ctxp->classd_list = reverse_jdep_list (ctxp); ! for (cclassd = ctxp->classd_list, cclass = ctxp->class_list; ! cclass && cclassd; cclass = TREE_CHAIN (cclass), cclassd = CLASSD_CHAIN (cclassd)) { jdep *dep; *************** java_complete_class () *** 9126,9132 **** /* Simply patch super */ if (parser_check_super (decl, JDEP_DECL (dep), JDEP_WFL (dep))) continue; ! BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (TREE_TYPE (JDEP_DECL (dep)))), 0)) = TREE_TYPE (decl); break; --- 8554,8560 ---- /* Simply patch super */ if (parser_check_super (decl, JDEP_DECL (dep), JDEP_WFL (dep))) continue; ! BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (TREE_TYPE (JDEP_DECL (dep)))), 0)) = TREE_TYPE (decl); break; *************** java_complete_class () *** 9141,9147 **** DECL_ALIGN (field_decl) = 0; DECL_USER_ALIGN (field_decl) = 0; layout_decl (field_decl, 0); ! SOURCE_FRONTEND_DEBUG (("Completed field/var decl `%s' with `%s'", IDENTIFIER_POINTER (DECL_NAME (field_decl)), IDENTIFIER_POINTER (DECL_NAME (decl)))); --- 8569,8575 ---- DECL_ALIGN (field_decl) = 0; DECL_USER_ALIGN (field_decl) = 0; layout_decl (field_decl, 0); ! SOURCE_FRONTEND_DEBUG (("Completed field/var decl `%s' with `%s'", IDENTIFIER_POINTER (DECL_NAME (field_decl)), IDENTIFIER_POINTER (DECL_NAME (decl)))); *************** java_complete_class () *** 9158,9168 **** if (TREE_CODE (type) == RECORD_TYPE) type = promote_type (type); JDEP_APPLY_PATCH (dep, type); ! SOURCE_FRONTEND_DEBUG (((JDEP_KIND (dep) == JDEP_METHOD_RETURN ? "Completing fct `%s' with ret type `%s'": "Completing arg `%s' with type `%s'"), ! IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep))), IDENTIFIER_POINTER (DECL_NAME (decl)))); } --- 8586,8596 ---- if (TREE_CODE (type) == RECORD_TYPE) type = promote_type (type); JDEP_APPLY_PATCH (dep, type); ! SOURCE_FRONTEND_DEBUG (((JDEP_KIND (dep) == JDEP_METHOD_RETURN ? "Completing fct `%s' with ret type `%s'": "Completing arg `%s' with type `%s'"), ! IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep))), IDENTIFIER_POINTER (DECL_NAME (decl)))); } *************** java_complete_class () *** 9207,9220 **** case JDEP_TYPE: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing a random type dependency on a '%s' node", tree_code_name [TREE_CODE (JDEP_DECL (dep))])); break; case JDEP_EXCEPTION: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing `%s' `throws' argument node", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep))))); break; --- 8635,8648 ---- case JDEP_TYPE: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing a random type dependency on a '%s' node", tree_code_name [TREE_CODE (JDEP_DECL (dep))])); break; case JDEP_EXCEPTION: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing `%s' `throws' argument node", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep))))); break; *************** resolve_class (enclosing, class_type, de *** 9242,9248 **** tree resolved_type = TREE_TYPE (class_type); int array_dims = 0; tree resolved_type_decl; ! if (resolved_type != NULL_TREE) { tree resolved_type_decl = TYPE_NAME (resolved_type); --- 8670,8676 ---- tree resolved_type = TREE_TYPE (class_type); int array_dims = 0; tree resolved_type_decl; ! if (resolved_type != NULL_TREE) { tree resolved_type_decl = TYPE_NAME (resolved_type); *************** resolve_class (enclosing, class_type, de *** 9263,9274 **** WFL_STRIP_BRACKET (cl, cl); /* 2- Resolve the bare type */ ! if (!(resolved_type_decl = do_resolve_class (enclosing, class_type, decl, cl))) return NULL_TREE; resolved_type = TREE_TYPE (resolved_type_decl); ! /* 3- If we have and array, reconstruct the array down to its nesting */ if (array_dims) { for (; array_dims; array_dims--) --- 8691,8702 ---- WFL_STRIP_BRACKET (cl, cl); /* 2- Resolve the bare type */ ! if (!(resolved_type_decl = do_resolve_class (enclosing, class_type, decl, cl))) return NULL_TREE; resolved_type = TREE_TYPE (resolved_type_decl); ! /* 3- If we have an array, reconstruct the array down to its nesting */ if (array_dims) { for (; array_dims; array_dims--) *************** resolve_class (enclosing, class_type, de *** 9279,9289 **** return resolved_type_decl; } ! /* Effectively perform the resolution of class CLASS_TYPE. DECL or CL ! are used to report error messages. Do not try to replace TYPE_NAME ! (class_type) by a variable, since it is changed by ! find_in_imports{_on_demand} and (but it doesn't really matter) ! qualify_and_find. */ tree do_resolve_class (enclosing, class_type, decl, cl) --- 8707,8717 ---- return resolved_type_decl; } ! /* Effectively perform the resolution of class CLASS_TYPE. DECL or CL ! are used to report error messages; CL must either be NULL_TREE or a ! WFL wrapping a class. Do not try to replace TYPE_NAME (class_type) ! by a variable, since it is changed by find_in_imports{_on_demand} ! and (but it doesn't really matter) qualify_and_find. */ tree do_resolve_class (enclosing, class_type, decl, cl) *************** do_resolve_class (enclosing, class_type, *** 9292,9330 **** tree new_class_decl = NULL_TREE, super = NULL_TREE; tree saved_enclosing_type = enclosing ? TREE_TYPE (enclosing) : NULL_TREE; tree decl_result; ! struct hash_table _ht, *circularity_hash = &_ht; ! /* This hash table is used to register the classes we're going ! through when searching the current class as an inner class, in ! order to detect circular references. Remember to free it before ! returning the section 0- of this function. */ ! hash_table_init (circularity_hash, hash_newfunc, ! java_hash_hash_tree_node, java_hash_compare_tree_node); ! /* 0- Search in the current class as an inner class. ! Maybe some code here should be added to load the class or ! something, at least if the class isn't an inner class and ended ! being loaded from class file. FIXME. */ ! while (enclosing) { ! new_class_decl = resolve_inner_class (circularity_hash, cl, &enclosing, ! &super, class_type); ! if (new_class_decl) ! break; ! /* If we haven't found anything because SUPER reached Object and ! ENCLOSING happens to be an innerclass, try the enclosing context. */ ! if ((!super || super == object_type_node) && ! enclosing && INNER_CLASS_DECL_P (enclosing)) ! enclosing = DECL_CONTEXT (enclosing); ! else ! enclosing = NULL_TREE; ! } ! hash_table_free (circularity_hash); ! if (new_class_decl) ! return new_class_decl; /* 1- Check for the type in single imports. This will change TYPE_NAME() if something relevant is found */ --- 8720,8779 ---- tree new_class_decl = NULL_TREE, super = NULL_TREE; tree saved_enclosing_type = enclosing ? TREE_TYPE (enclosing) : NULL_TREE; tree decl_result; ! htab_t circularity_hash; ! if (QUALIFIED_P (TYPE_NAME (class_type))) ! { ! /* If the type name is of the form `Q . Id', then Q is either a ! package name or a class name. First we try to find Q as a ! class and then treat Id as a member type. If we can't find Q ! as a class then we fall through. */ ! tree q, left, left_type, right; ! breakdown_qualified (&left, &right, TYPE_NAME (class_type)); ! BUILD_PTR_FROM_NAME (left_type, left); ! q = do_resolve_class (enclosing, left_type, decl, cl); ! if (q) ! { ! enclosing = q; ! saved_enclosing_type = TREE_TYPE (q); ! BUILD_PTR_FROM_NAME (class_type, right); ! } ! } ! if (enclosing) { ! /* This hash table is used to register the classes we're going ! through when searching the current class as an inner class, in ! order to detect circular references. Remember to free it before ! returning the section 0- of this function. */ ! circularity_hash = htab_create (20, htab_hash_pointer, htab_eq_pointer, ! NULL); ! /* 0- Search in the current class as an inner class. ! Maybe some code here should be added to load the class or ! something, at least if the class isn't an inner class and ended ! being loaded from class file. FIXME. */ ! while (enclosing) ! { ! new_class_decl = resolve_inner_class (circularity_hash, cl, &enclosing, ! &super, class_type); ! if (new_class_decl) ! break; ! /* If we haven't found anything because SUPER reached Object and ! ENCLOSING happens to be an innerclass, try the enclosing context. */ ! if ((!super || super == object_type_node) && ! enclosing && INNER_CLASS_DECL_P (enclosing)) ! enclosing = DECL_CONTEXT (enclosing); ! else ! enclosing = NULL_TREE; ! } ! htab_delete (circularity_hash); ! ! if (new_class_decl) ! return new_class_decl; ! } /* 1- Check for the type in single imports. This will change TYPE_NAME() if something relevant is found */ *************** do_resolve_class (enclosing, class_type, *** 9353,9359 **** if (find_in_imports_on_demand (saved_enclosing_type, class_type)) return NULL_TREE; ! /* If found in find_in_imports_on_demant, the type has already been loaded. */ if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)))) return new_class_decl; --- 8802,8808 ---- if (find_in_imports_on_demand (saved_enclosing_type, class_type)) return NULL_TREE; ! /* If found in find_in_imports_on_demand, the type has already been loaded. */ if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)))) return new_class_decl; *************** do_resolve_class (enclosing, class_type, *** 9365,9386 **** /* If there is a current package (ctxp->package), it's the first element of package_list and we can skip it. */ ! for (package = (ctxp->package ? TREE_CHAIN (package_list) : package_list); package; package = TREE_CHAIN (package)) if ((new_class_decl = qualify_and_find (class_type, ! TREE_PURPOSE (package), TYPE_NAME (class_type)))) return new_class_decl; } ! /* 5- Check an other compilation unit that bears the name of type */ load_class (TYPE_NAME (class_type), 0); ! if (!cl) cl = lookup_cl (decl); ! ! /* If we don't have a value for CL, then we're being called recursively. We can't check package access just yet, but it will be taken care of by the caller. */ if (cl) --- 8814,8835 ---- /* If there is a current package (ctxp->package), it's the first element of package_list and we can skip it. */ ! for (package = (ctxp->package ? TREE_CHAIN (package_list) : package_list); package; package = TREE_CHAIN (package)) if ((new_class_decl = qualify_and_find (class_type, ! TREE_PURPOSE (package), TYPE_NAME (class_type)))) return new_class_decl; } ! /* 5- Check another compilation unit that bears the name of type */ load_class (TYPE_NAME (class_type), 0); ! if (!cl) cl = lookup_cl (decl); ! ! /* If we don't have a value for CL, then we're being called recursively. We can't check package access just yet, but it will be taken care of by the caller. */ if (cl) *************** resolve_and_layout (something, cl) *** 9495,9501 **** /* Check methods */ if (CLASS_FROM_SOURCE_P (decl_type)) java_check_methods (decl); ! /* Layout the type if necessary */ if (decl_type != current_class && !CLASS_LOADED_P (decl_type)) safe_layout_class (decl_type); --- 8944,8950 ---- /* Check methods */ if (CLASS_FROM_SOURCE_P (decl_type)) java_check_methods (decl); ! /* Layout the type if necessary */ if (decl_type != current_class && !CLASS_LOADED_P (decl_type)) safe_layout_class (decl_type); *************** resolve_no_layout (name, cl) *** 9514,9520 **** java_parser_context_save_global (); decl = resolve_class (TYPE_NAME (current_class), ptr, NULL_TREE, cl); java_parser_context_restore_global (); ! return decl; } --- 8963,8969 ---- java_parser_context_save_global (); decl = resolve_class (TYPE_NAME (current_class), ptr, NULL_TREE, cl); java_parser_context_restore_global (); ! return decl; } *************** complete_class_report_errors (dep) *** 9554,9560 **** switch (JDEP_KIND (dep)) { case JDEP_SUPER: ! parse_error_context (JDEP_WFL (dep), "Superclass `%s' of class `%s' not found", purify_type_name (name), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); --- 9003,9009 ---- switch (JDEP_KIND (dep)) { case JDEP_SUPER: ! parse_error_context (JDEP_WFL (dep), "Superclass `%s' of class `%s' not found", purify_type_name (name), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); *************** complete_class_report_errors (dep) *** 9574,9580 **** break; case JDEP_METHOD_RETURN: /* Covers return type */ parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the return type of method `%s'", purify_type_name (name), IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep)))); break; --- 9023,9029 ---- break; case JDEP_METHOD_RETURN: /* Covers return type */ parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the return type of method `%s'", purify_type_name (name), IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep)))); break; *************** complete_class_report_errors (dep) *** 9587,9599 **** break; case JDEP_VARIABLE: parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the local variable `%s'", ! purify_type_name (IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); break; case JDEP_EXCEPTION: /* As specified by `throws' */ ! parse_error_context (JDEP_WFL (dep), "Class `%s' not found in `throws'", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))); break; --- 9036,9048 ---- break; case JDEP_VARIABLE: parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the local variable `%s'", ! purify_type_name (IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); break; case JDEP_EXCEPTION: /* As specified by `throws' */ ! parse_error_context (JDEP_WFL (dep), "Class `%s' not found in `throws'", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))); break; *************** get_printable_method_name (decl) *** 9620,9630 **** name = DECL_NAME (decl); DECL_NAME (decl) = DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))); } ! to_return = lang_printable_name (decl, 0); if (DECL_CONSTRUCTOR_P (decl)) DECL_NAME (decl) = name; ! return to_return; } --- 9069,9079 ---- name = DECL_NAME (decl); DECL_NAME (decl) = DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))); } ! to_return = lang_printable_name (decl, 0); if (DECL_CONSTRUCTOR_P (decl)) DECL_NAME (decl) = name; ! return to_return; } *************** check_method_redefinition (class, method *** 9652,9658 **** && sig == TYPE_ARGUMENT_SIGNATURE (TREE_TYPE (redef)) && !DECL_ARTIFICIAL (method)) { ! parse_error_context (DECL_FUNCTION_WFL (method), "Duplicate %s declaration `%s'", (DECL_CONSTRUCTOR_P (redef) ? "constructor" : "method"), get_printable_method_name (redef)); --- 9101,9107 ---- && sig == TYPE_ARGUMENT_SIGNATURE (TREE_TYPE (redef)) && !DECL_ARTIFICIAL (method)) { ! parse_error_context (DECL_FUNCTION_WFL (method), "Duplicate %s declaration `%s'", (DECL_CONSTRUCTOR_P (redef) ? "constructor" : "method"), get_printable_method_name (redef)); *************** check_abstract_method_definitions (do_in *** 9678,9691 **** tree other_super, other_method, method_sig, method_name; int found = 0; int end_type_reached = 0; ! if (!METHOD_ABSTRACT (method) || METHOD_FINAL (method)) continue; ! /* Now verify that somewhere in between TYPE and CLASS, abstract method METHOD gets a non abstract definition that is inherited by CLASS. */ ! method_sig = build_java_signature (TREE_TYPE (method)); method_name = DECL_NAME (method); if (TREE_CODE (method_name) == EXPR_WITH_FILE_LOCATION) --- 9127,9140 ---- tree other_super, other_method, method_sig, method_name; int found = 0; int end_type_reached = 0; ! if (!METHOD_ABSTRACT (method) || METHOD_FINAL (method)) continue; ! /* Now verify that somewhere in between TYPE and CLASS, abstract method METHOD gets a non abstract definition that is inherited by CLASS. */ ! method_sig = build_java_signature (TREE_TYPE (method)); method_name = DECL_NAME (method); if (TREE_CODE (method_name) == EXPR_WITH_FILE_LOCATION) *************** check_abstract_method_definitions (do_in *** 9695,9708 **** do { if (other_super == end_type) end_type_reached = 1; ! /* Method search */ for (other_method = TYPE_METHODS (other_super); other_method; other_method = TREE_CHAIN (other_method)) { tree s = build_java_signature (TREE_TYPE (other_method)); tree other_name = DECL_NAME (other_method); ! if (TREE_CODE (other_name) == EXPR_WITH_FILE_LOCATION) other_name = EXPR_WFL_NODE (other_name); if (!DECL_CLINIT_P (other_method) --- 9144,9157 ---- do { if (other_super == end_type) end_type_reached = 1; ! /* Method search */ for (other_method = TYPE_METHODS (other_super); other_method; other_method = TREE_CHAIN (other_method)) { tree s = build_java_signature (TREE_TYPE (other_method)); tree other_name = DECL_NAME (other_method); ! if (TREE_CODE (other_name) == EXPR_WITH_FILE_LOCATION) other_name = EXPR_WFL_NODE (other_name); if (!DECL_CLINIT_P (other_method) *************** check_abstract_method_definitions (do_in *** 9717,9737 **** } other_super = CLASSTYPE_SUPER (other_super); } while (!end_type_reached); ! /* Report that abstract METHOD didn't find an implementation that CLASS can use. */ if (!found) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0)); tree ccn = DECL_NAME (TYPE_NAME (DECL_CONTEXT (method))); ! ! parse_error_context (lookup_cl (class_decl), "Class `%s' doesn't define the abstract method `%s %s' from %s `%s'. This method must be defined or %s `%s' must be declared abstract", IDENTIFIER_POINTER (DECL_NAME (class_decl)), ! t, lang_printable_name (method, 0), ! (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))) ? "interface" : "class"), IDENTIFIER_POINTER (ccn), (CLASS_INTERFACE (class_decl) ? "interface" : "class"), --- 9166,9186 ---- } other_super = CLASSTYPE_SUPER (other_super); } while (!end_type_reached); ! /* Report that abstract METHOD didn't find an implementation that CLASS can use. */ if (!found) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0)); tree ccn = DECL_NAME (TYPE_NAME (DECL_CONTEXT (method))); ! ! parse_error_context (lookup_cl (class_decl), "Class `%s' doesn't define the abstract method `%s %s' from %s `%s'. This method must be defined or %s `%s' must be declared abstract", IDENTIFIER_POINTER (DECL_NAME (class_decl)), ! t, lang_printable_name (method, 0), ! (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))) ? "interface" : "class"), IDENTIFIER_POINTER (ccn), (CLASS_INTERFACE (class_decl) ? "interface" : "class"), *************** check_method_types_complete (decl) *** 9799,9805 **** if (!INCOMPLETE_TYPE_P (TREE_TYPE (type))) return 0; ! args = TYPE_ARG_TYPES (type); if (TREE_CODE (type) == METHOD_TYPE) args = TREE_CHAIN (args); --- 9248,9254 ---- if (!INCOMPLETE_TYPE_P (TREE_TYPE (type))) return 0; ! args = TYPE_ARG_TYPES (type); if (TREE_CODE (type) == METHOD_TYPE) args = TREE_CHAIN (args); *************** java_check_methods (class_decl) *** 9823,9829 **** java_check_abstract_methods (class_decl); else java_check_regular_methods (class_decl); ! CLASS_METHOD_CHECKED_P (TREE_TYPE (class_decl)) = 1; } --- 9272,9278 ---- java_check_abstract_methods (class_decl); else java_check_regular_methods (class_decl); ! CLASS_METHOD_CHECKED_P (TREE_TYPE (class_decl)) = 1; } *************** java_check_regular_methods (class_decl) *** 9838,9844 **** { int saw_constructor = ANONYMOUS_CLASS_P (TREE_TYPE (class_decl)); tree method; ! tree class = CLASS_TO_HANDLE_TYPE (TREE_TYPE (class_decl)); tree found = NULL_TREE; tree mthrows; --- 9287,9293 ---- { int saw_constructor = ANONYMOUS_CLASS_P (TREE_TYPE (class_decl)); tree method; ! tree class = TREE_TYPE (class_decl); tree found = NULL_TREE; tree mthrows; *************** java_check_regular_methods (class_decl) *** 9860,9886 **** if (check_method_redefinition (class, method)) continue; ! /* If we see one constructor a mark so we don't generate the ! default one. Also skip other verifications: constructors ! can't be inherited hence hiden or overriden */ ! if (DECL_CONSTRUCTOR_P (method)) ! { ! saw_constructor = 1; ! continue; ! } ! ! /* We verify things thrown by the method. They must inherits from ! java.lang.Throwable */ for (mthrows = DECL_FUNCTION_THROWS (method); mthrows; mthrows = TREE_CHAIN (mthrows)) { if (!inherits_from_p (TREE_VALUE (mthrows), throwable_type_node)) ! parse_error_context (TREE_PURPOSE (mthrows), "Class `%s' in `throws' clause must be a subclass of class `java.lang.Throwable'", ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows))))); } sig = build_java_argument_signature (TREE_TYPE (method)); found = lookup_argument_method2 (class, DECL_NAME (method), sig); --- 9309,9335 ---- if (check_method_redefinition (class, method)) continue; ! /* We verify things thrown by the method. They must inherit from ! java.lang.Throwable. */ for (mthrows = DECL_FUNCTION_THROWS (method); mthrows; mthrows = TREE_CHAIN (mthrows)) { if (!inherits_from_p (TREE_VALUE (mthrows), throwable_type_node)) ! parse_error_context (TREE_PURPOSE (mthrows), "Class `%s' in `throws' clause must be a subclass of class `java.lang.Throwable'", ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows))))); } + /* If we see one constructor a mark so we don't generate the + default one. Also skip other verifications: constructors + can't be inherited hence hidden or overridden. */ + if (DECL_CONSTRUCTOR_P (method)) + { + saw_constructor = 1; + continue; + } + sig = build_java_argument_signature (TREE_TYPE (method)); found = lookup_argument_method2 (class, DECL_NAME (method), sig); *************** java_check_regular_methods (class_decl) *** 9888,9894 **** if (METHOD_STATIC (method) && !TOPLEVEL_CLASS_DECL_P (class_decl)) { char *t = xstrdup (lang_printable_name (class, 0)); ! parse_error_context (method_wfl, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", lang_printable_name (method, 0), t); free (t); --- 9337,9343 ---- if (METHOD_STATIC (method) && !TOPLEVEL_CLASS_DECL_P (class_decl)) { char *t = xstrdup (lang_printable_name (class, 0)); ! parse_error_context (method_wfl, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", lang_printable_name (method, 0), t); free (t); *************** java_check_regular_methods (class_decl) *** 9905,9911 **** /* If `found' is declared in an interface, make sure the modifier matches. */ ! if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && clinit_identifier_node != DECL_NAME (found) && !METHOD_PUBLIC (method)) { --- 9354,9360 ---- /* If `found' is declared in an interface, make sure the modifier matches. */ ! if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && clinit_identifier_node != DECL_NAME (found) && !METHOD_PUBLIC (method)) { *************** java_check_regular_methods (class_decl) *** 9920,9932 **** types. */ if (TREE_TYPE (TREE_TYPE (found)) != TREE_TYPE (TREE_TYPE (method))) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (method_wfl, ! "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); } --- 9369,9381 ---- types. */ if (TREE_TYPE (TREE_TYPE (found)) != TREE_TYPE (TREE_TYPE (method))) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (method_wfl, ! "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); } *************** java_check_regular_methods (class_decl) *** 9939,9945 **** /* Static *can* override static */ if (METHOD_STATIC (found) && METHOD_STATIC (method)) continue; ! parse_error_context (method_wfl, "%s methods can't be overriden. Method `%s' is %s in class `%s'", (METHOD_FINAL (found) ? "Final" : "Static"), --- 9388,9394 ---- /* Static *can* override static */ if (METHOD_STATIC (found) && METHOD_STATIC (method)) continue; ! parse_error_context (method_wfl, "%s methods can't be overriden. Method `%s' is %s in class `%s'", (METHOD_FINAL (found) ? "Final" : "Static"), *************** java_check_regular_methods (class_decl) *** 9953,9959 **** /* Static method can't override instance method. */ if (METHOD_STATIC (method)) { ! parse_error_context (method_wfl, "Instance methods can't be overriden by a static method. Method `%s' is an instance method in class `%s'", lang_printable_name (found, 0), --- 9402,9408 ---- /* Static method can't override instance method. */ if (METHOD_STATIC (method)) { ! parse_error_context (method_wfl, "Instance methods can't be overriden by a static method. Method `%s' is an instance method in class `%s'", lang_printable_name (found, 0), *************** java_check_regular_methods (class_decl) *** 9971,9987 **** taken care of. */ if (!CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && ((METHOD_PUBLIC (found) && !METHOD_PUBLIC (method)) ! || (METHOD_PROTECTED (found) && !(METHOD_PUBLIC (method) || METHOD_PROTECTED (method))) || (!(aflags & (ACC_PUBLIC | ACC_PRIVATE | ACC_STATIC)) && METHOD_PRIVATE (method)))) { ! parse_error_context (method_wfl, "Methods can't be overridden to be more private. Method `%s' is not %s in class `%s'", lang_printable_name (method, 0), ! (METHOD_PUBLIC (method) ? "public" : (METHOD_PRIVATE (method) ? "private" : "protected")), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); continue; } --- 9420,9436 ---- taken care of. */ if (!CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && ((METHOD_PUBLIC (found) && !METHOD_PUBLIC (method)) ! || (METHOD_PROTECTED (found) && !(METHOD_PUBLIC (method) || METHOD_PROTECTED (method))) || (!(aflags & (ACC_PUBLIC | ACC_PRIVATE | ACC_STATIC)) && METHOD_PRIVATE (method)))) { ! parse_error_context (method_wfl, "Methods can't be overridden to be more private. Method `%s' is not %s in class `%s'", lang_printable_name (method, 0), ! (METHOD_PUBLIC (method) ? "public" : (METHOD_PRIVATE (method) ? "private" : "protected")), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); continue; } *************** java_check_regular_methods (class_decl) *** 9992,9998 **** /* Inheriting multiple methods with the same signature. FIXME */ } ! if (!TYPE_NVIRTUALS (class)) TYPE_METHODS (class) = nreverse (TYPE_METHODS (class)); --- 9441,9447 ---- /* Inheriting multiple methods with the same signature. FIXME */ } ! if (!TYPE_NVIRTUALS (class)) TYPE_METHODS (class) = nreverse (TYPE_METHODS (class)); *************** java_check_regular_methods (class_decl) *** 10004,10010 **** abort (); } ! /* Return a non zero value if the `throws' clause of METHOD (if any) is incompatible with the `throws' clause of FOUND (if any). */ static void --- 9453,9459 ---- abort (); } ! /* Return a nonzero value if the `throws' clause of METHOD (if any) is incompatible with the `throws' clause of FOUND (if any). */ static void *************** check_throws_clauses (method, method_wfl *** 10024,10040 **** if (IS_UNCHECKED_EXCEPTION_P (TREE_VALUE (mthrows))) continue; /* Checked expression must be compatible */ ! for (fthrows = DECL_FUNCTION_THROWS (found); fthrows; fthrows = TREE_CHAIN (fthrows)) if (inherits_from_p (TREE_VALUE (mthrows), TREE_VALUE (fthrows))) break; if (!fthrows) { ! parse_error_context (method_wfl, "Invalid checked exception class `%s' in `throws' clause. The exception must be a subclass of an exception thrown by `%s' from class `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows)))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } --- 9473,9489 ---- if (IS_UNCHECKED_EXCEPTION_P (TREE_VALUE (mthrows))) continue; /* Checked expression must be compatible */ ! for (fthrows = DECL_FUNCTION_THROWS (found); fthrows; fthrows = TREE_CHAIN (fthrows)) if (inherits_from_p (TREE_VALUE (mthrows), TREE_VALUE (fthrows))) break; if (!fthrows) { ! parse_error_context (method_wfl, "Invalid checked exception class `%s' in `throws' clause. The exception must be a subclass of an exception thrown by `%s' from class `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows)))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } *************** java_check_abstract_methods (interface_d *** 10063,10073 **** { char *t; t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (DECL_FUNCTION_WFL (found), "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); continue; --- 9512,9522 ---- { char *t; t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (DECL_FUNCTION_WFL (found), "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); continue; *************** java_check_abstract_methods (interface_d *** 10085,10107 **** if (!vec_elt) continue; sub_interface = BINFO_TYPE (vec_elt); ! for (sub_interface_method = TYPE_METHODS (sub_interface); sub_interface_method; sub_interface_method = TREE_CHAIN (sub_interface_method)) { ! found = lookup_java_interface_method2 (interface, sub_interface_method); if (found && (found != sub_interface_method)) { ! parse_error_context (lookup_cl (sub_interface_method), "Interface `%s' inherits method `%s' from interface `%s'. This method is redefined with a different return type in interface `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (interface))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER ! (DECL_NAME (TYPE_NAME (DECL_CONTEXT (sub_interface_method)))), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } --- 9534,9556 ---- if (!vec_elt) continue; sub_interface = BINFO_TYPE (vec_elt); ! for (sub_interface_method = TYPE_METHODS (sub_interface); sub_interface_method; sub_interface_method = TREE_CHAIN (sub_interface_method)) { ! found = lookup_java_interface_method2 (interface, sub_interface_method); if (found && (found != sub_interface_method)) { ! parse_error_context (lookup_cl (sub_interface_method), "Interface `%s' inherits method `%s' from interface `%s'. This method is redefined with a different return type in interface `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (interface))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER ! (DECL_NAME (TYPE_NAME (DECL_CONTEXT (sub_interface_method)))), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } *************** lookup_java_interface_method2 (class, me *** 10126,10138 **** { tree vec_elt = TREE_VEC_ELT (basetype_vec, i), to_return; if ((BINFO_TYPE (vec_elt) != object_type_node) ! && (to_return = lookup_java_method2 (BINFO_TYPE (vec_elt), method_decl, 1))) return to_return; } for (i = 0; i < n; i++) { ! to_return = lookup_java_interface_method2 (BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)), method_decl); if (to_return) return to_return; --- 9575,9587 ---- { tree vec_elt = TREE_VEC_ELT (basetype_vec, i), to_return; if ((BINFO_TYPE (vec_elt) != object_type_node) ! && (to_return = lookup_java_method2 (BINFO_TYPE (vec_elt), method_decl, 1))) return to_return; } for (i = 0; i < n; i++) { ! to_return = lookup_java_interface_method2 (BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)), method_decl); if (to_return) return to_return; *************** lookup_java_method2 (clas, method_decl, *** 10153,10159 **** method_signature = build_java_argument_signature (TREE_TYPE (method_decl)); name = DECL_NAME (method_decl); ! method_name = (TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name); method_type = TREE_TYPE (TREE_TYPE (method_decl)); --- 9602,9608 ---- method_signature = build_java_argument_signature (TREE_TYPE (method_decl)); name = DECL_NAME (method_decl); ! method_name = (TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name); method_type = TREE_TYPE (TREE_TYPE (method_decl)); *************** lookup_java_method2 (clas, method_decl, *** 10166,10172 **** tree name = DECL_NAME (method); if ((TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name) == method_name ! && method_sig == method_signature && TREE_TYPE (TREE_TYPE (method)) != method_type) return method; } --- 9615,9621 ---- tree name = DECL_NAME (method); if ((TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name) == method_name ! && method_sig == method_signature && TREE_TYPE (TREE_TYPE (method)) != method_type) return method; } *************** lookup_java_method2 (clas, method_decl, *** 10178,10211 **** /* Return the line that matches DECL line number, and try its best to position the column number. Used during error reports. */ static tree lookup_cl (decl) tree decl; { - static tree cl = NULL_TREE; char *line, *found; ! if (!decl) return NULL_TREE; ! if (cl == NULL_TREE) { ! cl = build_expr_wfl (NULL_TREE, NULL, 0, 0); ! ggc_add_tree_root (&cl, 1); } ! EXPR_WFL_FILENAME_NODE (cl) = get_identifier (DECL_SOURCE_FILE (decl)); ! EXPR_WFL_SET_LINECOL (cl, DECL_SOURCE_LINE_FIRST (decl), -1); ! line = java_get_line_col (EXPR_WFL_FILENAME (cl), ! EXPR_WFL_LINENO (cl), EXPR_WFL_COLNO (cl)); ! found = strstr ((const char *)line, (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); if (found) ! EXPR_WFL_SET_LINECOL (cl, EXPR_WFL_LINENO (cl), found - line); ! return cl; } /* Look for a simple name in the single-type import list */ --- 9627,9659 ---- /* Return the line that matches DECL line number, and try its best to position the column number. Used during error reports. */ + static GTY(()) tree cl_v; static tree lookup_cl (decl) tree decl; { char *line, *found; ! if (!decl) return NULL_TREE; ! if (cl_v == NULL_TREE) { ! cl_v = build_expr_wfl (NULL_TREE, NULL, 0, 0); } ! EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (DECL_SOURCE_FILE (decl)); ! EXPR_WFL_SET_LINECOL (cl_v, DECL_SOURCE_LINE_FIRST (decl), -1); ! line = java_get_line_col (EXPR_WFL_FILENAME (cl_v), ! EXPR_WFL_LINENO (cl_v), EXPR_WFL_COLNO (cl_v)); ! found = strstr ((const char *)line, (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); if (found) ! EXPR_WFL_SET_LINECOL (cl_v, EXPR_WFL_LINENO (cl_v), found - line); ! return cl_v; } /* Look for a simple name in the single-type import list */ *************** process_imports () *** 10244,10250 **** /* Don't load twice something already defined. */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) continue; ! while (1) { tree left; --- 9692,9698 ---- /* Don't load twice something already defined. */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) continue; ! while (1) { tree left; *************** process_imports () *** 10253,10259 **** load_class (to_be_found, 0); error_found = check_pkg_class_access (to_be_found, TREE_PURPOSE (import), true); ! /* We found it, we can bail out */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) break; --- 9701,9707 ---- load_class (to_be_found, 0); error_found = check_pkg_class_access (to_be_found, TREE_PURPOSE (import), true); ! /* We found it, we can bail out */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) break; *************** find_in_imports (enclosing_type, class_t *** 10290,10296 **** tree enclosing_type; tree class_type; { ! tree import = (enclosing_type ? TYPE_IMPORT_LIST (enclosing_type) : ctxp->import_list); while (import) { --- 9738,9744 ---- tree enclosing_type; tree class_type; { ! tree import = (enclosing_type ? TYPE_IMPORT_LIST (enclosing_type) : ctxp->import_list); while (import) { *************** read_import_dir (wfl) *** 10378,10384 **** int current_entry_len = zipd->filename_length; if (current_entry_len >= BUFFER_LENGTH (filename) ! && strncmp (filename->data, current_entry, BUFFER_LENGTH (filename)) != 0) continue; found |= note_possible_classname (current_entry, --- 9826,9832 ---- int current_entry_len = zipd->filename_length; if (current_entry_len >= BUFFER_LENGTH (filename) ! && strncmp (filename->data, current_entry, BUFFER_LENGTH (filename)) != 0) continue; found |= note_possible_classname (current_entry, *************** read_import_dir (wfl) *** 10405,10411 **** *filename->ptr++ = '/'; for (;;) { ! int len; const char *d_name; struct dirent *direntp = readdir (dirp); if (!direntp) --- 9853,9859 ---- *filename->ptr++ = '/'; for (;;) { ! int len; const char *d_name; struct dirent *direntp = readdir (dirp); if (!direntp) *************** read_import_dir (wfl) *** 10447,10453 **** /* Possibly find a type in the import on demands specified types. Returns 1 if an error occurred, 0 otherwise. Run through the entire list, to detected potential double definitions. */ ! static int find_in_imports_on_demand (enclosing_type, class_type) tree enclosing_type; --- 9895,9901 ---- /* Possibly find a type in the import on demands specified types. Returns 1 if an error occurred, 0 otherwise. Run through the entire list, to detected potential double definitions. */ ! static int find_in_imports_on_demand (enclosing_type, class_type) tree enclosing_type; *************** find_in_imports_on_demand (enclosing_typ *** 10468,10482 **** const char *id_name; tree decl, type_name_copy; ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE (TREE_PURPOSE (import))), IDENTIFIER_LENGTH (EXPR_WFL_NODE (TREE_PURPOSE (import)))); obstack_1grow (&temporary_obstack, '.'); ! obstack_grow0 (&temporary_obstack, IDENTIFIER_POINTER (class_type_name), IDENTIFIER_LENGTH (class_type_name)); id_name = obstack_finish (&temporary_obstack); ! if (! (node = maybe_get_identifier (id_name))) continue; --- 9916,9930 ---- const char *id_name; tree decl, type_name_copy; ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE (TREE_PURPOSE (import))), IDENTIFIER_LENGTH (EXPR_WFL_NODE (TREE_PURPOSE (import)))); obstack_1grow (&temporary_obstack, '.'); ! obstack_grow0 (&temporary_obstack, IDENTIFIER_POINTER (class_type_name), IDENTIFIER_LENGTH (class_type_name)); id_name = obstack_finish (&temporary_obstack); ! if (! (node = maybe_get_identifier (id_name))) continue; *************** find_in_imports_on_demand (enclosing_typ *** 10514,10520 **** TYPE_NAME (class_type) = type_name_copy; continue; } ! /* If the loaded class is accessible, we keep a tab on it to detect and report multiple inclusions. */ if (IS_A_CLASSFILE_NAME (node)) --- 9962,9968 ---- TYPE_NAME (class_type) = type_name_copy; continue; } ! /* If the loaded class is accessible, we keep a tab on it to detect and report multiple inclusions. */ if (IS_A_CLASSFILE_NAME (node)) *************** find_in_imports_on_demand (enclosing_typ *** 10527,10539 **** else if (seen_once >= 0) { tree location = (cl ? cl : TREE_PURPOSE (import)); ! tree package = (cl ? EXPR_WFL_NODE (cl) : EXPR_WFL_NODE (TREE_PURPOSE (import))); seen_once++; ! parse_error_context (location, "Type `%s' also potentially defined in package `%s'", ! IDENTIFIER_POINTER (TYPE_NAME (class_type)), IDENTIFIER_POINTER (package)); } } --- 9975,9987 ---- else if (seen_once >= 0) { tree location = (cl ? cl : TREE_PURPOSE (import)); ! tree package = (cl ? EXPR_WFL_NODE (cl) : EXPR_WFL_NODE (TREE_PURPOSE (import))); seen_once++; ! parse_error_context (location, "Type `%s' also potentially defined in package `%s'", ! IDENTIFIER_POINTER (TYPE_NAME (class_type)), IDENTIFIER_POINTER (package)); } } *************** find_in_imports_on_demand (enclosing_typ *** 10546,10552 **** return (seen_once < 0 ? 0 : seen_once); /* It's ok not to have found */ } ! /* Add package NAME to the list of package encountered so far. To speed up class lookup in do_resolve_class, we make sure a particular package is added only once. */ --- 9994,10000 ---- return (seen_once < 0 ? 0 : seen_once); /* It's ok not to have found */ } ! /* Add package NAME to the list of packages encountered so far. To speed up class lookup in do_resolve_class, we make sure a particular package is added only once. */ *************** static void *** 10554,10572 **** register_package (name) tree name; { ! static struct hash_table _pht, *pht = NULL; ! if (!pht) ! { ! hash_table_init (&_pht, hash_newfunc, ! java_hash_hash_tree_node, java_hash_compare_tree_node); ! pht = &_pht; ! } ! ! if (!hash_lookup (pht, (const hash_table_key) name, FALSE, NULL)) { package_list = chainon (package_list, build_tree_list (name, NULL)); ! hash_lookup (pht, (const hash_table_key) name, TRUE, NULL); } } --- 10002,10018 ---- register_package (name) tree name; { ! static htab_t pht; ! PTR *e; ! if (pht == NULL) ! pht = htab_create (50, htab_hash_pointer, htab_eq_pointer, NULL); ! ! e = htab_find_slot (pht, name, INSERT); ! if (*e == NULL) { package_list = chainon (package_list, build_tree_list (name, NULL)); ! *e = name; } } *************** resolve_package (pkg, next, type_name) *** 10586,10599 **** /* Try to progressively construct a type name */ if (TREE_CODE (pkg) == EXPR_WITH_FILE_LOCATION) ! for (current = EXPR_WFL_QUALIFICATION (pkg); current; current = TREE_CHAIN (current)) { /* If we don't have what we're expecting, exit now. TYPE_NAME will be null and the error caught later. */ if (TREE_CODE (QUAL_WFL (current)) != EXPR_WITH_FILE_LOCATION) break; ! *type_name = merge_qualified_name (*type_name, EXPR_WFL_NODE (QUAL_WFL (current))); if ((decl = resolve_no_layout (*type_name, NULL_TREE))) { --- 10032,10045 ---- /* Try to progressively construct a type name */ if (TREE_CODE (pkg) == EXPR_WITH_FILE_LOCATION) ! for (current = EXPR_WFL_QUALIFICATION (pkg); current; current = TREE_CHAIN (current)) { /* If we don't have what we're expecting, exit now. TYPE_NAME will be null and the error caught later. */ if (TREE_CODE (QUAL_WFL (current)) != EXPR_WITH_FILE_LOCATION) break; ! *type_name = merge_qualified_name (*type_name, EXPR_WFL_NODE (QUAL_WFL (current))); if ((decl = resolve_no_layout (*type_name, NULL_TREE))) { *************** resolve_package (pkg, next, type_name) *** 10608,10614 **** } ! /* Check accessibility of inner classes according to member access rules. DECL is the inner class, ENCLOSING_DECL is the class from which the access is being attempted. */ --- 10054,10060 ---- } ! /* Check accessibility of inner classes according to member access rules. DECL is the inner class, ENCLOSING_DECL is the class from which the access is being attempted. */ *************** check_inner_class_access (decl, enclosin *** 10635,10645 **** class in which DECL is declared. */ tree top_level = decl; while (DECL_CONTEXT (top_level)) ! top_level = DECL_CONTEXT (top_level); while (DECL_CONTEXT (enclosing_decl)) enclosing_decl = DECL_CONTEXT (enclosing_decl); if (top_level == enclosing_decl) ! return; access = "private"; } else if (CLASS_PROTECTED (decl)) --- 10081,10091 ---- class in which DECL is declared. */ tree top_level = decl; while (DECL_CONTEXT (top_level)) ! top_level = DECL_CONTEXT (top_level); while (DECL_CONTEXT (enclosing_decl)) enclosing_decl = DECL_CONTEXT (enclosing_decl); if (top_level == enclosing_decl) ! return; access = "private"; } else if (CLASS_PROTECTED (decl)) *************** check_inner_class_access (decl, enclosin *** 10648,10654 **** /* Access is permitted from within the same package... */ if (in_same_package (decl, enclosing_decl)) return; ! /* ... or from within the body of a subtype of the context in which DECL is declared. */ decl_context = DECL_CONTEXT (decl); --- 10094,10100 ---- /* Access is permitted from within the same package... */ if (in_same_package (decl, enclosing_decl)) return; ! /* ... or from within the body of a subtype of the context in which DECL is declared. */ decl_context = DECL_CONTEXT (decl); *************** check_inner_class_access (decl, enclosin *** 10656,10674 **** { if (CLASS_INTERFACE (decl)) { ! if (interface_of_p (TREE_TYPE (decl_context), enclosing_decl_type)) return; } else { /* Eww. The order of the arguments is different!! */ ! if (inherits_from_p (enclosing_decl_type, TREE_TYPE (decl_context))) return; } enclosing_decl = DECL_CONTEXT (enclosing_decl); ! } access = "protected"; } else if (! CLASS_PUBLIC (decl)) --- 10102,10120 ---- { if (CLASS_INTERFACE (decl)) { ! if (interface_of_p (TREE_TYPE (decl_context), enclosing_decl_type)) return; } else { /* Eww. The order of the arguments is different!! */ ! if (inherits_from_p (enclosing_decl_type, TREE_TYPE (decl_context))) return; } enclosing_decl = DECL_CONTEXT (enclosing_decl); ! } access = "protected"; } else if (! CLASS_PUBLIC (decl)) *************** check_pkg_class_access (class_name, cl, *** 10720,10726 **** return 0; if (verbose) ! parse_error_context (cl, "Can't access %s `%s'. Only public classes and interfaces in other packages can be accessed", (CLASS_INTERFACE (TYPE_NAME (type)) ? "interface" : "class"), IDENTIFIER_POINTER (class_name)); --- 10166,10172 ---- return 0; if (verbose) ! parse_error_context (cl, "Can't access %s `%s'. Only public classes and interfaces in other packages can be accessed", (CLASS_INTERFACE (TYPE_NAME (type)) ? "interface" : "class"), IDENTIFIER_POINTER (class_name)); *************** declare_local_variables (modifier, type, *** 10752,10765 **** if (modifier) { ! int i; ! for (i = 0; i <= 10; i++) if (1 << i & modifier) break; if (modifier == ACC_FINAL) final_p = 1; ! else { ! parse_error_context ! (ctxp->modifier_ctx [i], "Only `final' is allowed as a local variables modifier"); return; } --- 10198,10213 ---- if (modifier) { ! size_t i; ! for (i = 0; i < ARRAY_SIZE (ctxp->modifier_ctx); i++) ! if (1 << i & modifier) ! break; if (modifier == ACC_FINAL) final_p = 1; ! else { ! parse_error_context ! (ctxp->modifier_ctx [i], "Only `final' is allowed as a local variables modifier"); return; } *************** declare_local_variables (modifier, type, *** 10805,10820 **** MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); DECL_FINAL (decl) = final_p; BLOCK_CHAIN_DECL (decl); ! /* If doing xreferencing, replace the line number with the WFL compound value */ if (flag_emit_xref) DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl); ! /* Don't try to use an INIT statement when an error was found */ if (init && java_error_count) init = NULL_TREE; ! /* Add the initialization function to the current function's code */ if (init) { --- 10253,10268 ---- MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); DECL_FINAL (decl) = final_p; BLOCK_CHAIN_DECL (decl); ! /* If doing xreferencing, replace the line number with the WFL compound value */ if (flag_emit_xref) DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl); ! /* Don't try to use an INIT statement when an error was found */ if (init && java_error_count) init = NULL_TREE; ! /* Add the initialization function to the current function's code */ if (init) { *************** declare_local_variables (modifier, type, *** 10825,10831 **** build_debugable_stmt (EXPR_WFL_LINECOL (init), init)); } ! /* Setup dependency the type of the decl */ if (must_chain) { --- 10273,10279 ---- build_debugable_stmt (EXPR_WFL_LINECOL (init), init)); } ! /* Setup dependency the type of the decl */ if (must_chain) { *************** source_start_java_method (fndecl) *** 10860,10866 **** { tree type = TREE_VALUE (tem); tree name = TREE_PURPOSE (tem); ! /* If type is incomplete. Create an incomplete decl and ask for the decl to be patched later */ if (INCOMPLETE_TYPE_P (type)) --- 10308,10314 ---- { tree type = TREE_VALUE (tem); tree name = TREE_PURPOSE (tem); ! /* If type is incomplete. Create an incomplete decl and ask for the decl to be patched later */ if (INCOMPLETE_TYPE_P (type)) *************** create_artificial_method (class, flags, *** 10905,10917 **** tree mdecl; java_parser_context_save_global (); ! lineno = 0; ! mdecl = make_node (FUNCTION_TYPE); TREE_TYPE (mdecl) = type; TYPE_ARG_TYPES (mdecl) = args; ! mdecl = add_method (class, flags, name, build_java_signature (mdecl)); java_parser_context_restore_global (); ! DECL_ARTIFICIAL (mdecl) = 1; return mdecl; } --- 10353,10365 ---- tree mdecl; java_parser_context_save_global (); ! lineno = 0; ! mdecl = make_node (FUNCTION_TYPE); TREE_TYPE (mdecl) = type; TYPE_ARG_TYPES (mdecl) = args; ! mdecl = add_method (class, flags, name, build_java_signature (mdecl)); java_parser_context_restore_global (); ! DECL_ARTIFICIAL (mdecl) = 1; return mdecl; } *************** dump_java_tree (phase, t) *** 10950,10955 **** --- 10398,10404 ---- int flags; stream = dump_begin (phase, &flags); + flags |= TDF_SLIM; if (stream) { dump_node (t, flags, stream); *************** source_end_java_method () *** 10980,10985 **** --- 10429,10436 ---- patched. Dump it to a file if the user requested it. */ dump_java_tree (TDI_original, fndecl); + java_optimize_inline (fndecl); + /* Generate function's code */ if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) && ! flag_emit_class_files *************** add_stmt_to_block (b, type, stmt) *** 11024,11033 **** tree b, type, stmt; { tree body = BLOCK_EXPR_BODY (b), c; ! if (java_error_count) return body; ! if ((c = add_stmt_to_compound (body, type, stmt)) == body) return body; --- 10475,10484 ---- tree b, type, stmt; { tree body = BLOCK_EXPR_BODY (b), c; ! if (java_error_count) return body; ! if ((c = add_stmt_to_compound (body, type, stmt)) == body) return body; *************** static tree *** 11043,11048 **** --- 10494,10503 ---- add_stmt_to_compound (existing, type, stmt) tree existing, type, stmt; { + /* Keep track of this for inlining. */ + if (current_function_decl) + ++DECL_NUM_STMTS (current_function_decl); + if (existing) return build (COMPOUND_EXPR, type, existing, stmt); else *************** void java_layout_seen_class_methods () *** 11057,11066 **** while (1) { ! for (current = previous_list; current != end; current = TREE_CHAIN (current)) layout_class_methods (TREE_TYPE (TREE_VALUE (current))); ! if (previous_list != all_class_list) { end = previous_list; --- 10512,10521 ---- while (1) { ! for (current = previous_list; current != end; current = TREE_CHAIN (current)) layout_class_methods (TREE_TYPE (TREE_VALUE (current))); ! if (previous_list != all_class_list) { end = previous_list; *************** void java_layout_seen_class_methods () *** 11071,11090 **** } } void java_reorder_fields () { - static tree stop_reordering = NULL_TREE; - static int initialized_p; tree current; - /* Register STOP_REORDERING with the garbage collector. */ - if (!initialized_p) - { - ggc_add_tree_root (&stop_reordering, 1); - initialized_p = 1; - } - for (current = gclass_list; current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); --- 10526,10537 ---- } } + static GTY(()) tree stop_reordering; void java_reorder_fields () { tree current; for (current = gclass_list; current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); *************** java_reorder_fields () *** 11109,11115 **** after having reversed the fields */ else { ! TYPE_FIELDS (current_class) = nreverse (TYPE_FIELDS (current_class)); TYPE_SIZE (current_class) = NULL_TREE; } --- 10556,10562 ---- after having reversed the fields */ else { ! TYPE_FIELDS (current_class) = nreverse (TYPE_FIELDS (current_class)); TYPE_SIZE (current_class) = NULL_TREE; } *************** java_complete_expand_methods (class_decl *** 11239,11245 **** if (!DECL_CONSTRUCTOR_P (decl)) continue; ! no_body = !DECL_FUNCTION_BODY (decl); /* Don't generate debug info on line zero when expanding a generated constructor. */ --- 10686,10692 ---- if (!DECL_CONSTRUCTOR_P (decl)) continue; ! no_body = !DECL_FUNCTION_BODY (decl); /* Don't generate debug info on line zero when expanding a generated constructor. */ *************** java_complete_expand_methods (class_decl *** 11258,11264 **** /* Ctors aren't part of this batch. */ if (DECL_CONSTRUCTOR_P (decl) || DECL_CLINIT_P (decl)) continue; ! /* Skip abstract or native methods -- but do handle native methods when generating JNI stubs. */ if (METHOD_ABSTRACT (decl) || (! flag_jni && METHOD_NATIVE (decl))) --- 10705,10711 ---- /* Ctors aren't part of this batch. */ if (DECL_CONSTRUCTOR_P (decl) || DECL_CLINIT_P (decl)) continue; ! /* Skip abstract or native methods -- but do handle native methods when generating JNI stubs. */ if (METHOD_ABSTRACT (decl) || (! flag_jni && METHOD_NATIVE (decl))) *************** java_complete_expand_methods (class_decl *** 11286,11292 **** java_complete_expand_method (clinit); ctxp->explicit_constructor_p = 0; } ! /* We might have generated a class$ that we now want to expand */ if (TYPE_DOT_CLASS (current_class)) java_complete_expand_method (TYPE_DOT_CLASS (current_class)); --- 10733,10739 ---- java_complete_expand_method (clinit); ctxp->explicit_constructor_p = 0; } ! /* We might have generated a class$ that we now want to expand */ if (TYPE_DOT_CLASS (current_class)) java_complete_expand_method (TYPE_DOT_CLASS (current_class)); *************** java_complete_expand_methods (class_decl *** 11295,11301 **** prove wrong.) */ if (!CLASS_INTERFACE (class_decl)) for (decl = TYPE_METHODS (current_class); decl; decl = TREE_CHAIN (decl)) ! if (DECL_CONSTRUCTOR_P (decl) && verify_constructor_circularity (decl, decl)) break; --- 10742,10748 ---- prove wrong.) */ if (!CLASS_INTERFACE (class_decl)) for (decl = TYPE_METHODS (current_class); decl; decl = TREE_CHAIN (decl)) ! if (DECL_CONSTRUCTOR_P (decl) && verify_constructor_circularity (decl, decl)) break; *************** maybe_generate_pre_expand_clinit (class_ *** 11316,11322 **** return NULL_TREE; /* Go through all static fields and pre expand them */ ! for (current = TYPE_FIELDS (class_type); current; current = TREE_CHAIN (current)) if (FIELD_STATIC (current)) build_field_ref (NULL_TREE, class_type, DECL_NAME (current)); --- 10763,10769 ---- return NULL_TREE; /* Go through all static fields and pre expand them */ ! for (current = TYPE_FIELDS (class_type); current; current = TREE_CHAIN (current)) if (FIELD_STATIC (current)) build_field_ref (NULL_TREE, class_type, DECL_NAME (current)); *************** analyze_clinit_body (this_class, bbody) *** 11376,11392 **** case BLOCK: bbody = BLOCK_EXPR_BODY (bbody); break; ! case EXPR_WITH_FILE_LOCATION: bbody = EXPR_WFL_NODE (bbody); break; ! case COMPOUND_EXPR: if (analyze_clinit_body (this_class, TREE_OPERAND (bbody, 0))) return 1; bbody = TREE_OPERAND (bbody, 1); break; ! case MODIFY_EXPR: /* If we're generating to class file and we're dealing with an array initialization, we return 1 to keep */ --- 10823,10839 ---- case BLOCK: bbody = BLOCK_EXPR_BODY (bbody); break; ! case EXPR_WITH_FILE_LOCATION: bbody = EXPR_WFL_NODE (bbody); break; ! case COMPOUND_EXPR: if (analyze_clinit_body (this_class, TREE_OPERAND (bbody, 0))) return 1; bbody = TREE_OPERAND (bbody, 1); break; ! case MODIFY_EXPR: /* If we're generating to class file and we're dealing with an array initialization, we return 1 to keep */ *************** maybe_yank_clinit (mdecl) *** 11421,11427 **** { tree type, current; tree fbody, bbody; ! if (!DECL_CLINIT_P (mdecl)) return 0; --- 10868,10874 ---- { tree type, current; tree fbody, bbody; ! if (!DECL_CLINIT_P (mdecl)) return 0; *************** maybe_yank_clinit (mdecl) *** 11440,11446 **** type = DECL_CONTEXT (mdecl); current = TYPE_FIELDS (type); ! for (current = (current ? TREE_CHAIN (current) : current); current; current = TREE_CHAIN (current)) { tree f_init; --- 10887,10893 ---- type = DECL_CONTEXT (mdecl); current = TYPE_FIELDS (type); ! for (current = (current ? TREE_CHAIN (current) : current); current; current = TREE_CHAIN (current)) { tree f_init; *************** maybe_yank_clinit (mdecl) *** 11475,11481 **** if (TYPE_METHODS (type) == mdecl) TYPE_METHODS (type) = TREE_CHAIN (mdecl); else ! for (current = TYPE_METHODS (type); current; current = TREE_CHAIN (current)) if (TREE_CHAIN (current) == mdecl) { --- 10922,10928 ---- if (TYPE_METHODS (type) == mdecl) TYPE_METHODS (type) = TREE_CHAIN (mdecl); else ! for (current = TYPE_METHODS (type); current; current = TREE_CHAIN (current)) if (TREE_CHAIN (current) == mdecl) { *************** start_complete_expand_method (mdecl) *** 11501,11507 **** for (; tem; tem = TREE_CHAIN (tem)) { ! /* TREE_CHAIN (tem) will change after pushdecl. */ tree next = TREE_CHAIN (tem); tree type = TREE_TYPE (tem); if (PROMOTE_PROTOTYPES --- 10948,10954 ---- for (; tem; tem = TREE_CHAIN (tem)) { ! /* TREE_CHAIN (tem) will change after pushdecl. */ tree next = TREE_CHAIN (tem); tree type = TREE_TYPE (tem); if (PROMOTE_PROTOTYPES *************** java_complete_expand_method (mdecl) *** 11533,11539 **** /* Fix constructors before expanding them */ if (DECL_CONSTRUCTOR_P (mdecl)) fix_constructors (mdecl); ! /* Expand functions that have a body */ if (!DECL_FUNCTION_BODY (mdecl)) return; --- 10980,10986 ---- /* Fix constructors before expanding them */ if (DECL_CONSTRUCTOR_P (mdecl)) fix_constructors (mdecl); ! /* Expand functions that have a body */ if (!DECL_FUNCTION_BODY (mdecl)) return; *************** java_complete_expand_method (mdecl) *** 11550,11584 **** announce_function (mdecl); if (! quiet_flag) fprintf (stderr, "]"); ! /* Prepare the function for tree completion */ start_complete_expand_method (mdecl); /* Install the current this */ ! current_this = (!METHOD_STATIC (mdecl) ? BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (mdecl)) : NULL_TREE); /* Purge the `throws' list of unchecked exceptions (we save a copy of the list and re-install it later.) */ exception_copy = copy_list (DECL_FUNCTION_THROWS (mdecl)); purge_unchecked_exceptions (mdecl); ! /* Install exceptions thrown with `throws' */ PUSH_EXCEPTIONS (DECL_FUNCTION_THROWS (mdecl)); ! if (block_body != NULL_TREE) { block_body = java_complete_tree (block_body); ! /* Before we check initialization, attached all class initialization variable to the block_body */ ! hash_traverse (&DECL_FUNCTION_INIT_TEST_TABLE (mdecl), attach_init_test_initialization_flags, block_body); ! if (! flag_emit_xref && ! METHOD_NATIVE (mdecl)) { check_for_initialization (block_body, mdecl); ! /* Go through all the flags marking the initialization of static variables and see whether they're definitively assigned, in which case the type is remembered as --- 10997,11031 ---- announce_function (mdecl); if (! quiet_flag) fprintf (stderr, "]"); ! /* Prepare the function for tree completion */ start_complete_expand_method (mdecl); /* Install the current this */ ! current_this = (!METHOD_STATIC (mdecl) ? BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (mdecl)) : NULL_TREE); /* Purge the `throws' list of unchecked exceptions (we save a copy of the list and re-install it later.) */ exception_copy = copy_list (DECL_FUNCTION_THROWS (mdecl)); purge_unchecked_exceptions (mdecl); ! /* Install exceptions thrown with `throws' */ PUSH_EXCEPTIONS (DECL_FUNCTION_THROWS (mdecl)); ! if (block_body != NULL_TREE) { block_body = java_complete_tree (block_body); ! /* Before we check initialization, attached all class initialization variable to the block_body */ ! htab_traverse (DECL_FUNCTION_INIT_TEST_TABLE (mdecl), attach_init_test_initialization_flags, block_body); ! if (! flag_emit_xref && ! METHOD_NATIVE (mdecl)) { check_for_initialization (block_body, mdecl); ! /* Go through all the flags marking the initialization of static variables and see whether they're definitively assigned, in which case the type is remembered as *************** java_complete_expand_method (mdecl) *** 11589,11604 **** MDECL. This used with caution helps removing extra initialization of self. */ if (METHOD_STATIC (mdecl)) ! hash_lookup (&DECL_FUNCTION_INITIALIZED_CLASS_TABLE (mdecl), ! (hash_table_key) DECL_CONTEXT (mdecl), ! TRUE, NULL); } } ctxp->explicit_constructor_p = 0; } ! BLOCK_EXPR_BODY (fbody) = block_body; ! /* If we saw a return but couldn't evaluate it properly, we'll have an error_mark_node here. */ if (block_body != error_mark_node --- 11036,11053 ---- MDECL. This used with caution helps removing extra initialization of self. */ if (METHOD_STATIC (mdecl)) ! { ! *(htab_find_slot ! (DECL_FUNCTION_INITIALIZED_CLASS_TABLE (mdecl), ! DECL_CONTEXT (mdecl), INSERT)) = DECL_CONTEXT (mdecl); ! } } } ctxp->explicit_constructor_p = 0; } ! BLOCK_EXPR_BODY (fbody) = block_body; ! /* If we saw a return but couldn't evaluate it properly, we'll have an error_mark_node here. */ if (block_body != error_mark_node *************** java_expand_method_bodies (class) *** 11638,11643 **** --- 11087,11097 ---- current_function_decl = decl; + /* Save the function for inlining. */ + if (flag_inline_trees) + DECL_SAVED_TREE (decl) = + BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (decl)); + /* It's time to assign the variable flagging static class initialization based on which classes invoked static methods are definitely initializing. This should be flagged. */ *************** java_expand_method_bodies (class) *** 11659,11665 **** /* For each class definitely initialized in CALLED_METHOD, fill ASSIGNMENT_COMPOUND with assignment to the class initialization flag. */ ! hash_traverse (&DECL_FUNCTION_INITIALIZED_CLASS_TABLE (called_method), emit_test_initialization, assignment_compound_list); --- 11113,11119 ---- /* For each class definitely initialized in CALLED_METHOD, fill ASSIGNMENT_COMPOUND with assignment to the class initialization flag. */ ! htab_traverse (DECL_FUNCTION_INITIALIZED_CLASS_TABLE (called_method), emit_test_initialization, assignment_compound_list); *************** java_expand_method_bodies (class) *** 11669,11675 **** } } ! /* Prepare the function for RTL expansion */ start_complete_expand_method (decl); /* Expand function start, generate initialization flag --- 11123,11129 ---- } } ! /* Prepare the function for RTL expansion */ start_complete_expand_method (decl); /* Expand function start, generate initialization flag *************** build_outer_field_access (id, decl) *** 11710,11716 **** && (!FIELD_PRIVATE (decl) || !flag_emit_class_files )) { tree thisn = build_current_thisn (current_class); ! access = make_qualified_primary (build_wfl_node (thisn), id, EXPR_WFL_LINECOL (id)); } /* Otherwise, generate access methods to outer this and access the --- 11164,11170 ---- && (!FIELD_PRIVATE (decl) || !flag_emit_class_files )) { tree thisn = build_current_thisn (current_class); ! access = make_qualified_primary (build_wfl_node (thisn), id, EXPR_WFL_LINECOL (id)); } /* Otherwise, generate access methods to outer this and access the *************** build_outer_field_access (id, decl) *** 11741,11758 **** return resolve_expression_name (access, NULL); } ! /* Return a non zero value if NODE describes an outer field inner access. */ static int outer_field_access_p (type, decl) tree type, decl; { ! if (!INNER_CLASS_TYPE_P (type) || TREE_CODE (decl) != FIELD_DECL || DECL_CONTEXT (decl) == type) return 0; ! /* If the inner class extends the declaration context of the field we're try to acces, then this isn't an outer field access */ if (inherits_from_p (type, DECL_CONTEXT (decl))) --- 11195,11212 ---- return resolve_expression_name (access, NULL); } ! /* Return a nonzero value if NODE describes an outer field inner access. */ static int outer_field_access_p (type, decl) tree type, decl; { ! if (!INNER_CLASS_TYPE_P (type) || TREE_CODE (decl) != FIELD_DECL || DECL_CONTEXT (decl) == type) return 0; ! /* If the inner class extends the declaration context of the field we're try to acces, then this isn't an outer field access */ if (inherits_from_p (type, DECL_CONTEXT (decl))) *************** outer_field_access_p (type, decl) *** 11777,11783 **** return 0; } ! /* Return a non zero value if NODE represents an outer field inner access that was been already expanded. As a side effect, it returns the name of the field being accessed and the argument passed to the access function, suitable for a regeneration of the access method --- 11231,11237 ---- return 0; } ! /* Return a nonzero value if NODE represents an outer field inner access that was been already expanded. As a side effect, it returns the name of the field being accessed and the argument passed to the access function, suitable for a regeneration of the access method *************** outer_field_expanded_access_p (node, nam *** 11795,11815 **** /* Well, gcj generates slightly different tree nodes when compiling to native or bytecodes. It's the case for function calls. */ ! if (flag_emit_class_files && TREE_CODE (node) == CALL_EXPR && OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0)))) identified = 1; else if (!flag_emit_class_files) { node = TREE_OPERAND (node, 0); ! if (node && TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR) { node = TREE_OPERAND (node, 0); if (TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == FUNCTION_DECL ! && (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0))))) identified = 1; } --- 11249,11269 ---- /* Well, gcj generates slightly different tree nodes when compiling to native or bytecodes. It's the case for function calls. */ ! if (flag_emit_class_files && TREE_CODE (node) == CALL_EXPR && OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0)))) identified = 1; else if (!flag_emit_class_files) { node = TREE_OPERAND (node, 0); ! if (node && TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR) { node = TREE_OPERAND (node, 0); if (TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == FUNCTION_DECL ! && (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0))))) identified = 1; } *************** outer_field_access_fix (wfl, node, rhs) *** 11835,11844 **** tree wfl, node, rhs; { tree name, arg_type, arg; ! if (outer_field_expanded_access_p (node, &name, &arg_type, &arg)) { ! node = build_outer_field_access_expr (EXPR_WFL_LINECOL (wfl), arg_type, name, arg, rhs); return java_complete_tree (node); } --- 11289,11298 ---- tree wfl, node, rhs; { tree name, arg_type, arg; ! if (outer_field_expanded_access_p (node, &name, &arg_type, &arg)) { ! node = build_outer_field_access_expr (EXPR_WFL_LINECOL (wfl), arg_type, name, arg, rhs); return java_complete_tree (node); } *************** outer_field_access_fix (wfl, node, rhs) *** 11846,11852 **** } /* Construct the expression that calls an access method: ! .access$( [, ]); ARG2 can be NULL and will be omitted in that case. It will denote a read access. */ --- 11300,11306 ---- } /* Construct the expression that calls an access method: ! .access$( [, ]); ARG2 can be NULL and will be omitted in that case. It will denote a read access. */ *************** build_outer_field_access_expr (lc, type, *** 11858,11864 **** { tree args, cn, access; ! args = arg1 ? arg1 : build_wfl_node (build_current_thisn (current_class)); args = build_tree_list (NULL_TREE, args); --- 11312,11318 ---- { tree args, cn, access; ! args = arg1 ? arg1 : build_wfl_node (build_current_thisn (current_class)); args = build_tree_list (NULL_TREE, args); *************** build_outer_field_access_methods (decl) *** 11899,11910 **** tree decl; { tree id, args, stmt, mdecl; ! if (FIELD_INNER_ACCESS_P (decl)) return FIELD_INNER_ACCESS (decl); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); ! /* Create the identifier and a function named after it. */ id = build_new_access_id (); --- 11353,11364 ---- tree decl; { tree id, args, stmt, mdecl; ! if (FIELD_INNER_ACCESS_P (decl)) return FIELD_INNER_ACCESS (decl); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); ! /* Create the identifier and a function named after it. */ id = build_new_access_id (); *************** build_outer_field_access_methods (decl) *** 11918,11931 **** stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, stmt); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), TREE_TYPE (decl), id, args, stmt); DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; /* Create the write access method. No write access for final variable */ if (!FIELD_FINAL (decl)) { ! args = build_tree_list (inst_id, build_pointer_type (DECL_CONTEXT (decl))); TREE_CHAIN (args) = build_tree_list (wpv_id, TREE_TYPE (decl)); TREE_CHAIN (TREE_CHAIN (args)) = end_params_node; --- 11372,11385 ---- stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, stmt); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), TREE_TYPE (decl), id, args, stmt); DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; /* Create the write access method. No write access for final variable */ if (!FIELD_FINAL (decl)) { ! args = build_tree_list (inst_id, build_pointer_type (DECL_CONTEXT (decl))); TREE_CHAIN (args) = build_tree_list (wpv_id, TREE_TYPE (decl)); TREE_CHAIN (TREE_CHAIN (args)) = end_params_node; *************** build_outer_field_access_methods (decl) *** 11933,11940 **** build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, build_assignment (ASSIGN_TK, 0, stmt, build_wfl_node (wpv_id))); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), ! TREE_TYPE (decl), id, args, stmt); } DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; --- 11387,11394 ---- build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, build_assignment (ASSIGN_TK, 0, stmt, build_wfl_node (wpv_id))); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), ! TREE_TYPE (decl), id, args, stmt); } DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; *************** build_outer_field_access_methods (decl) *** 11945,11951 **** /* Build an field access method NAME. */ ! static tree build_outer_field_access_method (class, type, name, args, body) tree class, type, name, args, body; { --- 11399,11405 ---- /* Build an field access method NAME. */ ! static tree build_outer_field_access_method (class, type, name, args, body) tree class, type, name, args, body; { *************** build_outer_method_access_method (decl) *** 11996,12012 **** carg = TYPE_ARG_TYPES (TREE_TYPE (decl)); /* Create the arguments, as much as the original */ ! for (; carg && carg != end_params_node; carg = TREE_CHAIN (carg)) { sprintf (buffer, "write_parm_value$%d", parm_id_count++); ! args = chainon (args, build_tree_list (get_identifier (buffer), TREE_VALUE (carg))); } args = chainon (args, end_params_node); /* Create the method */ ! mdecl = create_artificial_method (class, ACC_STATIC, TREE_TYPE (TREE_TYPE (decl)), id, args); layout_class_method (class, NULL_TREE, mdecl, NULL_TREE); /* There is a potential bug here. We should be able to use --- 11450,11466 ---- carg = TYPE_ARG_TYPES (TREE_TYPE (decl)); /* Create the arguments, as much as the original */ ! for (; carg && carg != end_params_node; carg = TREE_CHAIN (carg)) { sprintf (buffer, "write_parm_value$%d", parm_id_count++); ! args = chainon (args, build_tree_list (get_identifier (buffer), TREE_VALUE (carg))); } args = chainon (args, end_params_node); /* Create the method */ ! mdecl = create_artificial_method (class, ACC_STATIC, TREE_TYPE (TREE_TYPE (decl)), id, args); layout_class_method (class, NULL_TREE, mdecl, NULL_TREE); /* There is a potential bug here. We should be able to use *************** build_outer_method_access_method (decl) *** 12030,12039 **** call_args = tree_cons (NULL_TREE, build_wfl_node (TREE_PURPOSE (carg)), call_args); ! body = build_method_invocation (build_wfl_node (DECL_NAME (decl)), call_args); if (!METHOD_STATIC (decl)) ! body = make_qualified_primary (build_wfl_node (TREE_PURPOSE (args)), body, 0); if (TREE_TYPE (TREE_TYPE (decl)) != void_type_node) body = build_return (0, body); --- 11484,11493 ---- call_args = tree_cons (NULL_TREE, build_wfl_node (TREE_PURPOSE (carg)), call_args); ! body = build_method_invocation (build_wfl_node (DECL_NAME (decl)), call_args); if (!METHOD_STATIC (decl)) ! body = make_qualified_primary (build_wfl_node (TREE_PURPOSE (args)), body, 0); if (TREE_TYPE (TREE_TYPE (decl)) != void_type_node) body = build_return (0, body); *************** build_outer_method_access_method (decl) *** 12053,12059 **** the enclosing instance of an inner class. The enclosing instance is kept in a generated field called this$, with being the inner class nesting level (starting from 0.) */ ! /* Build an access to a given this$, always chaining access call to others. Access methods to this$ are build on the fly if necessary. This CAN'T be used to solely access this$ from --- 11507,11513 ---- the enclosing instance of an inner class. The enclosing instance is kept in a generated field called this$, with being the inner class nesting level (starting from 0.) */ ! /* Build an access to a given this$, always chaining access call to others. Access methods to this$ are build on the fly if necessary. This CAN'T be used to solely access this$ from *************** build_access_to_thisn (from, to, lc) *** 12099,12105 **** /* Build an access function to the this$ local to TYPE. NULL_TREE is returned if nothing needs to be generated. Otherwise, the method ! generated and a method decl is returned. NOTE: These generated methods should be declared in a class file attribute so that they can't be referred to directly. */ --- 11553,11559 ---- /* Build an access function to the this$ local to TYPE. NULL_TREE is returned if nothing needs to be generated. Otherwise, the method ! generated and a method decl is returned. NOTE: These generated methods should be declared in a class file attribute so that they can't be referred to directly. */ *************** maybe_build_thisn_access_method (type) *** 12127,12133 **** fix_method_argument_names (args, mdecl); layout_class_method (type, NULL_TREE, mdecl, NULL_TREE); stmt = build_current_thisn (type); ! stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (stmt), 0); stmt = build_return (0, stmt); --- 11581,11587 ---- fix_method_argument_names (args, mdecl); layout_class_method (type, NULL_TREE, mdecl, NULL_TREE); stmt = build_current_thisn (type); ! stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (stmt), 0); stmt = build_return (0, stmt); *************** maybe_build_thisn_access_method (type) *** 12147,12183 **** This function can be invoked with TYPE to NULL, available and then has to count the parser context. */ static tree build_current_thisn (type) tree type; { static int saved_i = -1; - static tree saved_thisn = NULL_TREE; - static tree saved_type = NULL_TREE; static int saved_type_i = 0; - static int initialized_p; tree decl; char buffer [24]; int i = 0; - /* Register SAVED_THISN and SAVED_TYPE with the garbage collector. */ - if (!initialized_p) - { - ggc_add_tree_root (&saved_thisn, 1); - ggc_add_tree_root (&saved_type, 1); - initialized_p = 1; - } - if (type) { if (type == saved_type) i = saved_type_i; else { ! for (i = -1, decl = DECL_CONTEXT (TYPE_NAME (type)); decl; decl = DECL_CONTEXT (decl), i++) ; ! saved_type = type; saved_type_i = i; } --- 11601,11629 ---- This function can be invoked with TYPE to NULL, available and then has to count the parser context. */ + static GTY(()) tree saved_thisn; + static GTY(()) tree saved_type; + static tree build_current_thisn (type) tree type; { static int saved_i = -1; static int saved_type_i = 0; tree decl; char buffer [24]; int i = 0; if (type) { if (type == saved_type) i = saved_type_i; else { ! for (i = -1, decl = DECL_CONTEXT (TYPE_NAME (type)); decl; decl = DECL_CONTEXT (decl), i++) ; ! saved_type = type; saved_type_i = i; } *************** build_current_thisn (type) *** 12187,12193 **** if (i == saved_i) return saved_thisn; ! sprintf (buffer, "this$%d", i); saved_i = i; saved_thisn = get_identifier (buffer); --- 11633,11639 ---- if (i == saved_i) return saved_thisn; ! sprintf (buffer, "this$%d", i); saved_i = i; saved_thisn = get_identifier (buffer); *************** build_thisn_assign () *** 12224,12229 **** --- 11670,11678 ---- throw new NoClassDefFoundError(e.getMessage());} } */ + static GTY(()) tree get_message_wfl; + static GTY(()) tree type_parm_wfl; + static tree build_dot_class_method (class) tree class; *************** build_dot_class_method (class) *** 12233,12246 **** tree args, tmp, saved_current_function_decl, mdecl; tree stmt, throw_stmt; - static tree get_message_wfl, type_parm_wfl; - if (!get_message_wfl) { get_message_wfl = build_wfl_node (get_identifier ("getMessage")); type_parm_wfl = build_wfl_node (get_identifier ("type$")); - ggc_add_tree_root (&get_message_wfl, 1); - ggc_add_tree_root (&type_parm_wfl, 1); } /* Build the arguments */ --- 11682,11691 ---- *************** build_dot_class_method (class) *** 12249,12280 **** TREE_CHAIN (args) = end_params_node; /* Build the qualified name java.lang.Class.forName */ ! tmp = MQN (MQN (MQN (BWF ("java"), BWF ("lang")), BWF ("Class")), BWF ("forName")); load_class (class_not_found_type_node, 1); load_class (no_class_def_found_type_node, 1); ! /* Create the "class$" function */ ! mdecl = create_artificial_method (class, ACC_STATIC, build_pointer_type (class_type_node), classdollar_identifier_node, args); ! DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, no_class_def_found_type_node); /* We start by building the try block. We need to build: return (java.lang.Class.forName (type)); */ ! stmt = build_method_invocation (tmp, build_tree_list (NULL_TREE, type_parm_wfl)); stmt = build_return (0, stmt); /* Now onto the catch block. We start by building the expression throwing a new exception: throw new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = make_qualified_name (build_wfl_node (wpv_id), get_message_wfl, 0); throw_stmt = build_method_invocation (throw_stmt, NULL_TREE); ! /* Build new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = build_new_invocation (build_wfl_node (get_identifier ("NoClassDefFoundError")), build_tree_list (build_pointer_type (string_type_node), throw_stmt)); --- 11694,11725 ---- TREE_CHAIN (args) = end_params_node; /* Build the qualified name java.lang.Class.forName */ ! tmp = MQN (MQN (MQN (BWF ("java"), BWF ("lang")), BWF ("Class")), BWF ("forName")); load_class (class_not_found_type_node, 1); load_class (no_class_def_found_type_node, 1); ! /* Create the "class$" function */ ! mdecl = create_artificial_method (class, ACC_STATIC, build_pointer_type (class_type_node), classdollar_identifier_node, args); ! DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, no_class_def_found_type_node); /* We start by building the try block. We need to build: return (java.lang.Class.forName (type)); */ ! stmt = build_method_invocation (tmp, build_tree_list (NULL_TREE, type_parm_wfl)); stmt = build_return (0, stmt); /* Now onto the catch block. We start by building the expression throwing a new exception: throw new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = make_qualified_name (build_wfl_node (wpv_id), get_message_wfl, 0); throw_stmt = build_method_invocation (throw_stmt, NULL_TREE); ! /* Build new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = build_new_invocation (build_wfl_node (get_identifier ("NoClassDefFoundError")), build_tree_list (build_pointer_type (string_type_node), throw_stmt)); *************** build_dot_class_method_invocation (type) *** 12312,12318 **** sig_id = unmangle_classname (IDENTIFIER_POINTER (sig_id), IDENTIFIER_LENGTH (sig_id)); ! s = build_string (IDENTIFIER_LENGTH (sig_id), IDENTIFIER_POINTER (sig_id)); return build_method_invocation (build_wfl_node (classdollar_identifier_node), build_tree_list (NULL_TREE, s)); --- 11757,11763 ---- sig_id = unmangle_classname (IDENTIFIER_POINTER (sig_id), IDENTIFIER_LENGTH (sig_id)); ! s = build_string (IDENTIFIER_LENGTH (sig_id), IDENTIFIER_POINTER (sig_id)); return build_method_invocation (build_wfl_node (classdollar_identifier_node), build_tree_list (NULL_TREE, s)); *************** fix_constructors (mdecl) *** 12349,12365 **** const char *n = IDENTIFIER_POINTER (DECL_NAME (sclass_decl)); DECL_NAME (mdecl) = DECL_NAME (sclass_decl); parse_error_context ! (lookup_cl (TYPE_NAME (class_type)), "No constructor matching `%s' found in class `%s'", lang_printable_name (mdecl, 0), n); DECL_NAME (mdecl) = save; } ! /* The constructor body must be crafted by hand. It's the constructor we defined when we realize we didn't have the CLASSNAME() constructor */ start_artificial_method_body (mdecl); ! /* Insert an assignment to the this$ hidden field, if necessary */ if ((thisn_assign = build_thisn_assign ())) --- 11794,11810 ---- const char *n = IDENTIFIER_POINTER (DECL_NAME (sclass_decl)); DECL_NAME (mdecl) = DECL_NAME (sclass_decl); parse_error_context ! (lookup_cl (TYPE_NAME (class_type)), "No constructor matching `%s' found in class `%s'", lang_printable_name (mdecl, 0), n); DECL_NAME (mdecl) = save; } ! /* The constructor body must be crafted by hand. It's the constructor we defined when we realize we didn't have the CLASSNAME() constructor */ start_artificial_method_body (mdecl); ! /* Insert an assignment to the this$ hidden field, if necessary */ if ((thisn_assign = build_thisn_assign ())) *************** fix_constructors (mdecl) *** 12377,12389 **** end_artificial_method_body (mdecl); } /* Search for an explicit constructor invocation */ ! else { int found = 0; int invokes_this = 0; tree found_call = NULL_TREE; tree main_block = BLOCK_EXPR_BODY (body); ! while (body) switch (TREE_CODE (body)) { --- 11822,11834 ---- end_artificial_method_body (mdecl); } /* Search for an explicit constructor invocation */ ! else { int found = 0; int invokes_this = 0; tree found_call = NULL_TREE; tree main_block = BLOCK_EXPR_BODY (body); ! while (body) switch (TREE_CODE (body)) { *************** fix_constructors (mdecl) *** 12423,12429 **** TREE_OPERAND (found_call, 0)); TREE_OPERAND (found_call, 0) = empty_stmt_node; } ! DECL_INIT_CALLS_THIS (mdecl) = invokes_this; /* Insert the instance initializer block right after. */ --- 11868,11874 ---- TREE_OPERAND (found_call, 0)); TREE_OPERAND (found_call, 0) = empty_stmt_node; } ! DECL_INIT_CALLS_THIS (mdecl) = invokes_this; /* Insert the instance initializer block right after. */ *************** verify_constructor_super (mdecl) *** 12467,12478 **** tree arg_type = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (sdecl))); if (super_inner) arg_type = TREE_CHAIN (arg_type); ! for (m_arg_type = mdecl_arg_type; ! (arg_type != end_params_node && m_arg_type != end_params_node); ! arg_type = TREE_CHAIN (arg_type), m_arg_type = TREE_CHAIN (m_arg_type)) ! if (!valid_method_invocation_conversion_p (TREE_VALUE (arg_type), TREE_VALUE (m_arg_type))) break; --- 11912,11923 ---- tree arg_type = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (sdecl))); if (super_inner) arg_type = TREE_CHAIN (arg_type); ! for (m_arg_type = mdecl_arg_type; ! (arg_type != end_params_node && m_arg_type != end_params_node); ! arg_type = TREE_CHAIN (arg_type), m_arg_type = TREE_CHAIN (m_arg_type)) ! if (!valid_method_invocation_conversion_p (TREE_VALUE (arg_type), TREE_VALUE (m_arg_type))) break; *************** verify_constructor_super (mdecl) *** 12497,12502 **** --- 11942,11948 ---- /* Generate code for all context remembered for code generation. */ + static GTY(()) tree reversed_class_list; void java_expand_classes () { *************** java_expand_classes () *** 12547,12557 **** } } /* If we've found error at that stage, don't try to generate anything, unless we're emitting xrefs or checking the syntax only (but not using -fsyntax-only for the purpose of generating bytecode. */ ! if (java_error_count && !flag_emit_xref && (!flag_syntax_only && !flag_emit_class_files)) return; --- 11993,12062 ---- } } + /* Expanding the constructors of anonymous classes generates access + methods. Scan all the methods looking for null DECL_RESULTs -- + this will be the case if a method hasn't been expanded. */ + for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) + { + tree current; + ctxp = cur_ctxp; + for (current = ctxp->class_list; current; current = TREE_CHAIN (current)) + { + tree d; + current_class = TREE_TYPE (current); + for (d = TYPE_METHODS (current_class); d; d = TREE_CHAIN (d)) + { + if (DECL_RESULT (d) == NULL_TREE) + { + restore_line_number_status (1); + java_complete_expand_method (d); + restore_line_number_status (0); + } + } + } + } + + /* ??? Instead of all this we could iterate around the list of + classes until there were no more un-expanded methods. It would + take a little longer -- one pass over the whole list of methods + -- but it would be simpler. Like this: */ + #if 0 + { + int something_changed; + + do + { + something_changed = 0; + for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) + { + tree current; + ctxp = cur_ctxp; + for (current = ctxp->class_list; current; current = TREE_CHAIN (current)) + { + tree d; + current_class = TREE_TYPE (current); + for (d = TYPE_METHODS (current_class); d; d = TREE_CHAIN (d)) + { + if (DECL_RESULT (d) == NULL_TREE) + { + something_changed = 1; + restore_line_number_status (1); + java_complete_expand_method (d); + restore_line_number_status (0); + } + } + } + } + } + while (something_changed); + } + #endif + /* If we've found error at that stage, don't try to generate anything, unless we're emitting xrefs or checking the syntax only (but not using -fsyntax-only for the purpose of generating bytecode. */ ! if (java_error_count && !flag_emit_xref && (!flag_syntax_only && !flag_emit_class_files)) return; *************** java_expand_classes () *** 12578,12584 **** for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) { tree current; ! tree reversed_class_list = NULL; ctxp = cur_ctxp; --- 12083,12089 ---- for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) { tree current; ! reversed_class_list = NULL; ctxp = cur_ctxp; *************** java_expand_classes () *** 12590,12604 **** situation, the compiler cannot fall back to the original source, having already read the outer class, so we must prevent that situation. */ ! for (current = ctxp->class_list; ! current; current = TREE_CHAIN (current)) reversed_class_list = tree_cons (NULL_TREE, current, reversed_class_list); - ggc_add_tree_root (&reversed_class_list, 1); ! for (current = reversed_class_list; ! current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); --- 12095,12108 ---- situation, the compiler cannot fall back to the original source, having already read the outer class, so we must prevent that situation. */ ! for (current = ctxp->class_list; ! current; current = TREE_CHAIN (current)) reversed_class_list = tree_cons (NULL_TREE, current, reversed_class_list); ! for (current = reversed_class_list; ! current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); *************** java_expand_classes () *** 12613,12620 **** finish_class (); } } - - ggc_del_root (&reversed_class_list); } } --- 12117,12122 ---- *************** make_qualified_name (left, right, locati *** 12701,12707 **** EXPR_WFL_LINECOL (wfl) = EXPR_WFL_LINECOL (left); EXPR_WFL_QUALIFICATION (left) = build_tree_list (wfl, NULL_TREE); } ! wfl = build_expr_wfl (right_id, ctxp->filename, 0, 0); EXPR_WFL_LINECOL (wfl) = location; chainon (EXPR_WFL_QUALIFICATION (left), build_tree_list (wfl, NULL_TREE)); --- 12203,12209 ---- EXPR_WFL_LINECOL (wfl) = EXPR_WFL_LINECOL (left); EXPR_WFL_QUALIFICATION (left) = build_tree_list (wfl, NULL_TREE); } ! wfl = build_expr_wfl (right_id, ctxp->filename, 0, 0); EXPR_WFL_LINECOL (wfl) = location; chainon (EXPR_WFL_QUALIFICATION (left), build_tree_list (wfl, NULL_TREE)); *************** resolve_expression_name (id, orig) *** 12751,12757 **** return decl; /* 15.13.1: NAME can appear within a class declaration */ ! else { decl = lookup_field_wrapper (current_class, name); if (decl) --- 12253,12259 ---- return decl; /* 15.13.1: NAME can appear within a class declaration */ ! else { decl = lookup_field_wrapper (current_class, name); if (decl) *************** resolve_expression_name (id, orig) *** 12826,12838 **** /* We've got an error here */ if (INNER_CLASS_TYPE_P (current_class)) ! parse_error_context (id, "Local variable `%s' can't be accessed from within the inner class `%s' unless it is declared final", IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); else ! parse_error_context (id, "Undefined variable `%s'", IDENTIFIER_POINTER (name)); return error_mark_node; --- 12328,12340 ---- /* We've got an error here */ if (INNER_CLASS_TYPE_P (current_class)) ! parse_error_context (id, "Local variable `%s' can't be accessed from within the inner class `%s' unless it is declared final", IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); else ! parse_error_context (id, "Undefined variable `%s'", IDENTIFIER_POINTER (name)); return error_mark_node; *************** static void *** 12842,12851 **** static_ref_err (wfl, field_id, class_type) tree wfl, field_id, class_type; { ! parse_error_context ! (wfl, "Can't make a static reference to nonstatic variable `%s' in class `%s'", ! IDENTIFIER_POINTER (field_id), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class_type)))); } --- 12344,12353 ---- static_ref_err (wfl, field_id, class_type) tree wfl, field_id, class_type; { ! parse_error_context ! (wfl, "Can't make a static reference to nonstatic variable `%s' in class `%s'", ! IDENTIFIER_POINTER (field_id), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class_type)))); } *************** resolve_field_access (qual_wfl, field_de *** 12868,12875 **** return error_mark_node; /* Resolve the LENGTH field of an array here */ ! if (DECL_P (decl) && DECL_NAME (decl) == length_identifier_node ! && type_found && TYPE_ARRAY_P (type_found) && ! flag_emit_class_files && ! flag_emit_xref) { tree length = build_java_array_length_access (where_found); --- 12370,12377 ---- return error_mark_node; /* Resolve the LENGTH field of an array here */ ! if (DECL_P (decl) && DECL_NAME (decl) == length_identifier_node ! && type_found && TYPE_ARRAY_P (type_found) && ! flag_emit_class_files && ! flag_emit_xref) { tree length = build_java_array_length_access (where_found); *************** resolve_field_access (qual_wfl, field_de *** 12896,12908 **** if (!type_found) type_found = DECL_CONTEXT (decl); is_static = FIELD_STATIC (decl); ! field_ref = build_field_ref ((is_static && !flag_emit_xref? ! NULL_TREE : where_found), type_found, DECL_NAME (decl)); if (field_ref == error_mark_node) return error_mark_node; if (is_static) field_ref = maybe_build_class_init_for_field (decl, field_ref); } else field_ref = decl; --- 12398,12423 ---- if (!type_found) type_found = DECL_CONTEXT (decl); is_static = FIELD_STATIC (decl); ! field_ref = build_field_ref ((is_static && !flag_emit_xref? ! NULL_TREE : where_found), type_found, DECL_NAME (decl)); if (field_ref == error_mark_node) return error_mark_node; if (is_static) field_ref = maybe_build_class_init_for_field (decl, field_ref); + + /* If we're looking at a static field, we may need to generate a + class initialization for it. This can happen when the access + looks like `field.ref', where `field' is a static field in an + interface we implement. */ + if (!flag_emit_class_files + && !flag_emit_xref + && TREE_CODE (where_found) == VAR_DECL + && FIELD_STATIC (where_found)) + { + build_static_field_ref (where_found); + field_ref = build_class_init (DECL_CONTEXT (where_found), field_ref); + } } else field_ref = decl; *************** resolve_field_access (qual_wfl, field_de *** 12910,12916 **** if (field_decl) *field_decl = decl; if (field_type) ! *field_type = (QUAL_DECL_TYPE (decl) ? QUAL_DECL_TYPE (decl) : TREE_TYPE (decl)); return field_ref; } --- 12425,12431 ---- if (field_decl) *field_decl = decl; if (field_type) ! *field_type = (QUAL_DECL_TYPE (decl) ? QUAL_DECL_TYPE (decl) : TREE_TYPE (decl)); return field_ref; } *************** resolve_qualified_expression_name (wfl, *** 12954,12960 **** int is_static; tree decl = NULL_TREE, type = NULL_TREE, q; /* For certain for of inner class instantiation */ ! tree saved_current, saved_this; #define RESTORE_THIS_AND_CURRENT_CLASS \ { current_class = saved_current; current_this = saved_this;} --- 12469,12475 ---- int is_static; tree decl = NULL_TREE, type = NULL_TREE, q; /* For certain for of inner class instantiation */ ! tree saved_current, saved_this; #define RESTORE_THIS_AND_CURRENT_CLASS \ { current_class = saved_current; current_this = saved_this;} *************** resolve_qualified_expression_name (wfl, *** 12975,12981 **** build the code to access it. */ if (JDECL_P (decl) && !FIELD_STATIC (decl)) { ! decl = maybe_access_field (decl, *where_found, DECL_CONTEXT (decl)); if (decl == error_mark_node) return 1; --- 12490,12496 ---- build the code to access it. */ if (JDECL_P (decl) && !FIELD_STATIC (decl)) { ! decl = maybe_access_field (decl, *where_found, DECL_CONTEXT (decl)); if (decl == error_mark_node) return 1; *************** resolve_qualified_expression_name (wfl, *** 12991,12997 **** saved and restored shortly after */ saved_current = current_class; saved_this = current_this; ! if (decl && (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR || from_qualified_this)) { --- 12506,12512 ---- saved and restored shortly after */ saved_current = current_class; saved_this = current_this; ! if (decl && (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR || from_qualified_this)) { *************** resolve_qualified_expression_name (wfl, *** 13023,13034 **** } *type_found = type = QUAL_DECL_TYPE (*where_found); /* If we're creating an inner class instance, check for that an enclosing instance is in scope */ if (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR && INNER_ENCLOSING_SCOPE_CHECK (type)) { ! parse_error_context (qual_wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (type, 0), (!current_this ? "" : --- 12538,12551 ---- } *type_found = type = QUAL_DECL_TYPE (*where_found); + *where_found = force_evaluation_order (*where_found); + /* If we're creating an inner class instance, check for that an enclosing instance is in scope */ if (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR && INNER_ENCLOSING_SCOPE_CHECK (type)) { ! parse_error_context (qual_wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (type, 0), (!current_this ? "" : *************** resolve_qualified_expression_name (wfl, *** 13042,13049 **** RESTORE_THIS_AND_CURRENT_CLASS; /* EH check. No check on access$ functions */ ! if (location ! && !OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl))) check_thrown_exceptions (location, ret_decl); --- 12559,12566 ---- RESTORE_THIS_AND_CURRENT_CLASS; /* EH check. No check on access$ functions */ ! if (location ! && !OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl))) check_thrown_exceptions (location, ret_decl); *************** resolve_qualified_expression_name (wfl, *** 13137,13143 **** { if (!current_this) { ! parse_error_context (wfl, "Keyword `this' used outside allowed context"); return 1; } --- 12654,12660 ---- { if (!current_this) { ! parse_error_context (wfl, "Keyword `this' used outside allowed context"); return 1; } *************** resolve_qualified_expression_name (wfl, *** 13160,13167 **** if (!enclosing_context_p (type, current_class)) { char *p = xstrdup (lang_printable_name (type, 0)); ! parse_error_context (qual_wfl, "Can't use variable `%s.this': type `%s' isn't an outer type of type `%s'", ! p, p, lang_printable_name (current_class, 0)); free (p); return 1; --- 12677,12684 ---- if (!enclosing_context_p (type, current_class)) { char *p = xstrdup (lang_printable_name (type, 0)); ! parse_error_context (qual_wfl, "Can't use variable `%s.this': type `%s' isn't an outer type of type `%s'", ! p, p, lang_printable_name (current_class, 0)); free (p); return 1; *************** resolve_qualified_expression_name (wfl, *** 13192,13203 **** if (METHOD_STATIC (current_function_decl) || current_class == object_type_node) { ! parse_error_context (wfl, "Keyword `super' used outside allowed context"); return 1; } /* Otherwise, treat SUPER as (SUPER_CLASS)THIS */ ! node = build_cast (EXPR_WFL_LINECOL (qual_wfl), CLASSTYPE_SUPER (current_class), build_this (EXPR_WFL_LINECOL (qual_wfl))); *where_found = decl = java_complete_tree (node); --- 12709,12720 ---- if (METHOD_STATIC (current_function_decl) || current_class == object_type_node) { ! parse_error_context (wfl, "Keyword `super' used outside allowed context"); return 1; } /* Otherwise, treat SUPER as (SUPER_CLASS)THIS */ ! node = build_cast (EXPR_WFL_LINECOL (qual_wfl), CLASSTYPE_SUPER (current_class), build_this (EXPR_WFL_LINECOL (qual_wfl))); *where_found = decl = java_complete_tree (node); *************** resolve_qualified_expression_name (wfl, *** 13239,13245 **** else { if (from_super || from_cast) ! parse_error_context ((from_cast ? qual_wfl : wfl), "No variable `%s' defined in class `%s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), --- 12756,12762 ---- else { if (from_super || from_cast) ! parse_error_context ((from_cast ? qual_wfl : wfl), "No variable `%s' defined in class `%s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), *************** resolve_qualified_expression_name (wfl, *** 13261,13267 **** /* Sneak preview. If next we see a `new', we're facing a qualification with resulted in a type being selected instead of a field. Report the error */ ! if(TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR) { parse_error_context (qual_wfl, "Undefined variable `%s'", --- 12778,12784 ---- /* Sneak preview. If next we see a `new', we're facing a qualification with resulted in a type being selected instead of a field. Report the error */ ! if(TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR) { parse_error_context (qual_wfl, "Undefined variable `%s'", *************** resolve_qualified_expression_name (wfl, *** 13271,13277 **** if (not_accessible_p (TREE_TYPE (decl), decl, type, 0)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", java_accstring_lookup (get_access_flags_from_decl (decl)), GET_TYPE_NAME (type), --- 12788,12794 ---- if (not_accessible_p (TREE_TYPE (decl), decl, type, 0)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", java_accstring_lookup (get_access_flags_from_decl (decl)), GET_TYPE_NAME (type), *************** resolve_qualified_expression_name (wfl, *** 13285,13291 **** from_type = 1; } /* We resolve an expression name */ ! else { tree field_decl = NULL_TREE; --- 12802,12808 ---- from_type = 1; } /* We resolve an expression name */ ! else { tree field_decl = NULL_TREE; *************** resolve_qualified_expression_name (wfl, *** 13343,13356 **** if (!from_type && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `%s' in `%s %s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), lang_printable_name (type, 0), IDENTIFIER_POINTER (DECL_NAME (decl))); return 1; } ! field_decl = lookup_field_wrapper (type, EXPR_WFL_NODE (qual_wfl)); --- 12860,12873 ---- if (!from_type && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `%s' in `%s %s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), lang_printable_name (type, 0), IDENTIFIER_POINTER (DECL_NAME (decl))); return 1; } ! field_decl = lookup_field_wrapper (type, EXPR_WFL_NODE (qual_wfl)); *************** resolve_qualified_expression_name (wfl, *** 13364,13370 **** inner_decl = resolve_class (decl, ptr, NULL_TREE, qual_wfl); if (inner_decl) { ! check_inner_class_access (inner_decl, decl, qual_wfl); type = TREE_TYPE (inner_decl); decl = inner_decl; from_type = 1; --- 12881,12887 ---- inner_decl = resolve_class (decl, ptr, NULL_TREE, qual_wfl); if (inner_decl) { ! check_inner_class_access (inner_decl, decl, qual_wfl); type = TREE_TYPE (inner_decl); decl = inner_decl; from_type = 1; *************** resolve_qualified_expression_name (wfl, *** 13374,13382 **** if (field_decl == NULL_TREE) { ! parse_error_context (qual_wfl, "No variable `%s' defined in type `%s'", ! IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), GET_TYPE_NAME (type)); return 1; } --- 12891,12899 ---- if (field_decl == NULL_TREE) { ! parse_error_context (qual_wfl, "No variable `%s' defined in type `%s'", ! IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), GET_TYPE_NAME (type)); return 1; } *************** resolve_qualified_expression_name (wfl, *** 13391,13427 **** field_decl_type = TREE_TYPE (TREE_TYPE (field_decl)); else field_decl_type = TREE_TYPE (field_decl); ! if (!JPRIMITIVE_TYPE_P (field_decl_type) && !CLASS_LOADED_P (field_decl_type) && !TYPE_ARRAY_P (field_decl_type)) resolve_and_layout (field_decl_type, NULL_TREE); ! /* Check on accessibility here */ if (not_accessible_p (current_class, field_decl, DECL_CONTEXT (field_decl), from_super)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", ! java_accstring_lookup (get_access_flags_from_decl (field_decl)), GET_TYPE_NAME (type), IDENTIFIER_POINTER (DECL_NAME (field_decl)), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); return 1; } check_deprecation (qual_wfl, field_decl); ! /* There are things to check when fields are accessed from type. There are no restrictions on a static declaration of the field when it is accessed from an interface */ is_static = FIELD_STATIC (field_decl); ! if (!from_super && from_type ! && !TYPE_INTERFACE_P (type) ! && !is_static ! && (current_function_decl && METHOD_STATIC (current_function_decl))) { static_ref_err (qual_wfl, EXPR_WFL_NODE (qual_wfl), type); --- 12908,12944 ---- field_decl_type = TREE_TYPE (TREE_TYPE (field_decl)); else field_decl_type = TREE_TYPE (field_decl); ! if (!JPRIMITIVE_TYPE_P (field_decl_type) && !CLASS_LOADED_P (field_decl_type) && !TYPE_ARRAY_P (field_decl_type)) resolve_and_layout (field_decl_type, NULL_TREE); ! /* Check on accessibility here */ if (not_accessible_p (current_class, field_decl, DECL_CONTEXT (field_decl), from_super)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", ! java_accstring_lookup (get_access_flags_from_decl (field_decl)), GET_TYPE_NAME (type), IDENTIFIER_POINTER (DECL_NAME (field_decl)), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); return 1; } check_deprecation (qual_wfl, field_decl); ! /* There are things to check when fields are accessed from type. There are no restrictions on a static declaration of the field when it is accessed from an interface */ is_static = FIELD_STATIC (field_decl); ! if (!from_super && from_type ! && !TYPE_INTERFACE_P (type) ! && !is_static ! && (current_function_decl && METHOD_STATIC (current_function_decl))) { static_ref_err (qual_wfl, EXPR_WFL_NODE (qual_wfl), type); *************** resolve_qualified_expression_name (wfl, *** 13466,13476 **** /* Sneak preview. If decl is qualified by a `new', report the error here to be accurate on the peculiar construct */ ! if (TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `new' in a `%s'", lang_printable_name (type, 0)); return 1; } --- 12983,12993 ---- /* Sneak preview. If decl is qualified by a `new', report the error here to be accurate on the peculiar construct */ ! if (TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `new' in a `%s'", lang_printable_name (type, 0)); return 1; } *************** not_accessible_p (reference, member, whe *** 13506,13512 **** /* Access always granted for members declared public */ if (access_flag & ACC_PUBLIC) return 0; ! /* Check access on protected members */ if (access_flag & ACC_PROTECTED) { --- 13023,13029 ---- /* Access always granted for members declared public */ if (access_flag & ACC_PUBLIC) return 0; ! /* Check access on protected members */ if (access_flag & ACC_PROTECTED) { *************** check_deprecation (wfl, decl) *** 13574,13580 **** /* Complain if the field is deprecated and the file it was defined in isn't compiled at the same time the file which contains its use is */ ! if (DECL_DEPRECATED (decl) && !IS_A_COMMAND_LINE_FILENAME_P (get_identifier (file))) { char the [20]; --- 13091,13097 ---- /* Complain if the field is deprecated and the file it was defined in isn't compiled at the same time the file which contains its use is */ ! if (DECL_DEPRECATED (decl) && !IS_A_COMMAND_LINE_FILENAME_P (get_identifier (file))) { char the [20]; *************** check_deprecation (wfl, decl) *** 13597,13604 **** /* Don't issue a message if the context as been deprecated as a whole. */ if (! CLASS_DEPRECATED (TYPE_NAME (DECL_CONTEXT (decl)))) ! parse_warning_context ! (wfl, "The %s `%s' in class `%s' has been deprecated", the, lang_printable_name (decl, 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))))); } --- 13114,13121 ---- /* Don't issue a message if the context as been deprecated as a whole. */ if (! CLASS_DEPRECATED (TYPE_NAME (DECL_CONTEXT (decl)))) ! parse_warning_context ! (wfl, "The %s `%s' in class `%s' has been deprecated", the, lang_printable_name (decl, 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))))); } *************** check_deprecation (wfl, decl) *** 13606,13620 **** /* Returns 1 if class was declared in the current package, 0 otherwise */ static int class_in_current_package (class) tree class; { - static tree cache = NULL_TREE; int qualified_flag; tree left; ! if (cache == class) return 1; qualified_flag = QUALIFIED_P (DECL_NAME (TYPE_NAME (class))); --- 13123,13137 ---- /* Returns 1 if class was declared in the current package, 0 otherwise */ + static GTY(()) tree cicp_cache; static int class_in_current_package (class) tree class; { int qualified_flag; tree left; ! if (cicp_cache == class) return 1; qualified_flag = QUALIFIED_P (DECL_NAME (TYPE_NAME (class))); *************** class_in_current_package (class) *** 13635,13649 **** breakdown_qualified (&left, NULL, DECL_NAME (TYPE_NAME (class))); if (ctxp->package == left) { ! static int initialized_p; ! /* Register CACHE with the garbage collector. */ ! if (!initialized_p) ! { ! ggc_add_tree_root (&cache, 1); ! initialized_p = 1; ! } ! ! cache = class; return 1; } return 0; --- 13152,13158 ---- breakdown_qualified (&left, NULL, DECL_NAME (TYPE_NAME (class))); if (ctxp->package == left) { ! cicp_cache = class; return 1; } return 0; *************** maybe_access_field (decl, where, type) *** 13658,13664 **** { if (TREE_CODE (decl) == FIELD_DECL && decl != current_this && !FIELD_STATIC (decl)) ! decl = build_field_ref (where ? where : current_this, (type ? type : DECL_CONTEXT (decl)), DECL_NAME (decl)); return decl; --- 13167,13173 ---- { if (TREE_CODE (decl) == FIELD_DECL && decl != current_this && !FIELD_STATIC (decl)) ! decl = build_field_ref (where ? where : current_this, (type ? type : DECL_CONTEXT (decl)), DECL_NAME (decl)); return decl; *************** patch_method_invocation (patch, primary, *** 13684,13690 **** int is_super_init = 0; tree this_arg = NULL_TREE; int is_array_clone_call = 0; ! /* Should be overriden if everything goes well. Otherwise, if something fails, it should keep this value. It stop the evaluation of a bogus assignment. See java_complete_tree, --- 13193,13199 ---- int is_super_init = 0; tree this_arg = NULL_TREE; int is_array_clone_call = 0; ! /* Should be overriden if everything goes well. Otherwise, if something fails, it should keep this value. It stop the evaluation of a bogus assignment. See java_complete_tree, *************** patch_method_invocation (patch, primary, *** 13707,13720 **** data during error report. */ identifier_wfl = cut_identifier_in_qualified (wfl); identifier = EXPR_WFL_NODE (identifier_wfl); ! /* Given the context, IDENTIFIER is syntactically qualified as a MethodName. We need to qualify what's before */ qualify_ambiguous_name (wfl); resolved = resolve_field_access (wfl, NULL, NULL); if (TREE_CODE (resolved) == VAR_DECL && FIELD_STATIC (resolved) ! && FIELD_FINAL (resolved) && !inherits_from_p (DECL_CONTEXT (resolved), current_class) && !flag_emit_class_files && !flag_emit_xref) resolved = build_class_init (DECL_CONTEXT (resolved), resolved); --- 13216,13229 ---- data during error report. */ identifier_wfl = cut_identifier_in_qualified (wfl); identifier = EXPR_WFL_NODE (identifier_wfl); ! /* Given the context, IDENTIFIER is syntactically qualified as a MethodName. We need to qualify what's before */ qualify_ambiguous_name (wfl); resolved = resolve_field_access (wfl, NULL, NULL); if (TREE_CODE (resolved) == VAR_DECL && FIELD_STATIC (resolved) ! && FIELD_FINAL (resolved) && !inherits_from_p (DECL_CONTEXT (resolved), current_class) && !flag_emit_class_files && !flag_emit_xref) resolved = build_class_init (DECL_CONTEXT (resolved), resolved); *************** patch_method_invocation (patch, primary, *** 13724,13737 **** type = GET_SKIP_TYPE (resolved); resolve_and_layout (type, NULL_TREE); ! if (JPRIMITIVE_TYPE_P (type)) { parse_error_context (identifier_wfl, "Can't invoke a method on primitive type `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); ! PATCH_METHOD_RETURN_ERROR (); } list = lookup_method_invoke (0, identifier_wfl, type, identifier, args); --- 13233,13246 ---- type = GET_SKIP_TYPE (resolved); resolve_and_layout (type, NULL_TREE); ! if (JPRIMITIVE_TYPE_P (type)) { parse_error_context (identifier_wfl, "Can't invoke a method on primitive type `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); ! PATCH_METHOD_RETURN_ERROR (); } list = lookup_method_invoke (0, identifier_wfl, type, identifier, args); *************** patch_method_invocation (patch, primary, *** 13745,13761 **** parse_error_context (identifier_wfl, "Can't make static reference to method `%s' in interface `%s'", ! IDENTIFIER_POINTER (identifier), IDENTIFIER_POINTER (name)); PATCH_METHOD_RETURN_ERROR (); } if (list && !METHOD_STATIC (list)) { char *fct_name = xstrdup (lang_printable_name (list, 0)); ! parse_error_context (identifier_wfl, "Can't make static reference to method `%s %s' in class `%s'", ! lang_printable_name (TREE_TYPE (TREE_TYPE (list)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); free (fct_name); PATCH_METHOD_RETURN_ERROR (); --- 13254,13270 ---- parse_error_context (identifier_wfl, "Can't make static reference to method `%s' in interface `%s'", ! IDENTIFIER_POINTER (identifier), IDENTIFIER_POINTER (name)); PATCH_METHOD_RETURN_ERROR (); } if (list && !METHOD_STATIC (list)) { char *fct_name = xstrdup (lang_printable_name (list, 0)); ! parse_error_context (identifier_wfl, "Can't make static reference to method `%s %s' in class `%s'", ! lang_printable_name (TREE_TYPE (TREE_TYPE (list)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); free (fct_name); PATCH_METHOD_RETURN_ERROR (); *************** patch_method_invocation (patch, primary, *** 13763,13772 **** } else this_arg = primary = resolved; ! if (TYPE_ARRAY_P (type) && identifier == get_identifier ("clone")) is_array_clone_call = 1; ! /* IDENTIFIER_WFL will be used to report any problem further */ wfl = identifier_wfl; } --- 13272,13281 ---- } else this_arg = primary = resolved; ! if (TYPE_ARRAY_P (type) && identifier == get_identifier ("clone")) is_array_clone_call = 1; ! /* IDENTIFIER_WFL will be used to report any problem further */ wfl = identifier_wfl; } *************** patch_method_invocation (patch, primary, *** 13776,13788 **** { tree class_to_search = NULL_TREE; int lc; /* Looking for Constructor */ ! /* We search constructor in their target class */ if (CALL_CONSTRUCTOR_P (patch)) { if (TREE_CODE (patch) == NEW_CLASS_EXPR) class_to_search = EXPR_WFL_NODE (wfl); ! else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == this_identifier_node) class_to_search = NULL_TREE; else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == --- 13285,13297 ---- { tree class_to_search = NULL_TREE; int lc; /* Looking for Constructor */ ! /* We search constructor in their target class */ if (CALL_CONSTRUCTOR_P (patch)) { if (TREE_CODE (patch) == NEW_CLASS_EXPR) class_to_search = EXPR_WFL_NODE (wfl); ! else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == this_identifier_node) class_to_search = NULL_TREE; else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == *************** patch_method_invocation (patch, primary, *** 13790,13796 **** { is_super_init = 1; if (CLASSTYPE_SUPER (current_class)) ! class_to_search = DECL_NAME (TYPE_NAME (CLASSTYPE_SUPER (current_class))); else { --- 13299,13305 ---- { is_super_init = 1; if (CLASSTYPE_SUPER (current_class)) ! class_to_search = DECL_NAME (TYPE_NAME (CLASSTYPE_SUPER (current_class))); else { *************** patch_method_invocation (patch, primary, *** 13806,13824 **** if (!class_to_search) { ! parse_error_context (wfl, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); } ! /* Can't instantiate an abstract class, but we can invoke it's constructor. It's use within the `new' context is denied here. */ ! if (CLASS_ABSTRACT (class_to_search) && TREE_CODE (patch) == NEW_CLASS_EXPR) { ! parse_error_context (wfl, "Class `%s' is an abstract class. It can't be instantiated", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); --- 13315,13333 ---- if (!class_to_search) { ! parse_error_context (wfl, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); } ! /* Can't instantiate an abstract class, but we can invoke it's constructor. It's use within the `new' context is denied here. */ ! if (CLASS_ABSTRACT (class_to_search) && TREE_CODE (patch) == NEW_CLASS_EXPR) { ! parse_error_context (wfl, "Class `%s' is an abstract class. It can't be instantiated", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); *************** patch_method_invocation (patch, primary, *** 13870,13882 **** can't be executed then. */ if (!list) PATCH_METHOD_RETURN_ERROR (); ! if (TYPE_ARRAY_P (class_to_search) && DECL_NAME (list) == get_identifier ("clone")) is_array_clone_call = 1; /* Check for static reference if non static methods */ ! if (check_for_static_method_reference (wfl, patch, list, class_to_search, primary)) PATCH_METHOD_RETURN_ERROR (); --- 13379,13391 ---- can't be executed then. */ if (!list) PATCH_METHOD_RETURN_ERROR (); ! if (TYPE_ARRAY_P (class_to_search) && DECL_NAME (list) == get_identifier ("clone")) is_array_clone_call = 1; /* Check for static reference if non static methods */ ! if (check_for_static_method_reference (wfl, patch, list, class_to_search, primary)) PATCH_METHOD_RETURN_ERROR (); *************** patch_method_invocation (patch, primary, *** 13886,13892 **** && INNER_ENCLOSING_SCOPE_CHECK (class_to_search) && !DECL_INIT_P (current_function_decl)) { ! parse_error_context (wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (class_to_search, 0), (!current_this ? "" : --- 13395,13401 ---- && INNER_ENCLOSING_SCOPE_CHECK (class_to_search) && !DECL_INIT_P (current_function_decl)) { ! parse_error_context (wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (class_to_search, 0), (!current_this ? "" : *************** patch_method_invocation (patch, primary, *** 13914,13930 **** x(a1,...,an) into TYPE_OF(this$).x(a1,....an) 2) We're generating bytecodes: ! - LIST is non static. It's invocation is transformed from x(a1,....,an) into access$(this$,a1,...,an). - LIST is static. It's invocation is transformed from x(a1,....,an) into TYPE_OF(this$).x(a1,....an). Of course, this$ can be abitrary complex, ranging from ! this$0 (the immediate outer context) to ! access$0(access$0(...(this$0))). ! ! maybe_use_access_method returns a non zero value if the this_arg has to be moved into the (then generated) stub argument list. In the meantime, the selected function might have be replaced by a generated stub. */ --- 13423,13439 ---- x(a1,...,an) into TYPE_OF(this$).x(a1,....an) 2) We're generating bytecodes: ! - LIST is non static. It's invocation is transformed from x(a1,....,an) into access$(this$,a1,...,an). - LIST is static. It's invocation is transformed from x(a1,....,an) into TYPE_OF(this$).x(a1,....an). Of course, this$ can be abitrary complex, ranging from ! this$0 (the immediate outer context) to ! access$0(access$0(...(this$0))). ! ! maybe_use_access_method returns a nonzero value if the this_arg has to be moved into the (then generated) stub argument list. In the meantime, the selected function might have be replaced by a generated stub. */ *************** patch_method_invocation (patch, primary, *** 13939,13951 **** /* Merge point of all resolution schemes. If we have nothing, this is an error, already signaled */ ! if (!list) PATCH_METHOD_RETURN_ERROR (); /* Check accessibility, position the is_static flag, build and return the call */ if (not_accessible_p (DECL_CONTEXT (current_function_decl), list, ! (primary ? TREE_TYPE (TREE_TYPE (primary)) : NULL_TREE), from_super) /* Calls to clone() on array types are permitted as a special-case. */ && !is_array_clone_call) --- 13448,13460 ---- /* Merge point of all resolution schemes. If we have nothing, this is an error, already signaled */ ! if (!list) PATCH_METHOD_RETURN_ERROR (); /* Check accessibility, position the is_static flag, build and return the call */ if (not_accessible_p (DECL_CONTEXT (current_function_decl), list, ! (primary ? TREE_TYPE (TREE_TYPE (primary)) : NULL_TREE), from_super) /* Calls to clone() on array types are permitted as a special-case. */ && !is_array_clone_call) *************** patch_method_invocation (patch, primary, *** 13976,13982 **** /* If invoking a innerclass constructor, there are hidden parameters to pass */ ! if (TREE_CODE (patch) == NEW_CLASS_EXPR && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { /* And make sure we add the accessed local variables to be saved --- 13485,13491 ---- /* If invoking a innerclass constructor, there are hidden parameters to pass */ ! if (TREE_CODE (patch) == NEW_CLASS_EXPR && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { /* And make sure we add the accessed local variables to be saved *************** patch_method_invocation (patch, primary, *** 14020,14031 **** /* This handles the situation where a constructor invocation needs to have an enclosing context passed as a second parameter (the constructor is one of an inner class). */ ! if ((is_super_init || (TREE_CODE (patch) == CALL_EXPR && name == this_identifier_node)) && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { tree dest = TYPE_NAME (DECL_CONTEXT (list)); ! tree extra_arg = build_access_to_thisn (current_class, DECL_CONTEXT (dest), 0); extra_arg = java_complete_tree (extra_arg); args = tree_cons (NULL_TREE, extra_arg, args); --- 13529,13540 ---- /* This handles the situation where a constructor invocation needs to have an enclosing context passed as a second parameter (the constructor is one of an inner class). */ ! if ((is_super_init || (TREE_CODE (patch) == CALL_EXPR && name == this_identifier_node)) && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { tree dest = TYPE_NAME (DECL_CONTEXT (list)); ! tree extra_arg = build_access_to_thisn (current_class, DECL_CONTEXT (dest), 0); extra_arg = java_complete_tree (extra_arg); args = tree_cons (NULL_TREE, extra_arg, args); *************** patch_method_invocation (patch, primary, *** 14039,14046 **** invoke any method relying on `this'. Exceptions are: we're invoking a static function, primary exists and is not the current this, we're creating a new object. */ ! if (ctxp->explicit_constructor_p ! && !is_static_flag && (!primary || primary == current_this) && (TREE_CODE (patch) != NEW_CLASS_EXPR)) { --- 13548,13555 ---- invoke any method relying on `this'. Exceptions are: we're invoking a static function, primary exists and is not the current this, we're creating a new object. */ ! if (ctxp->explicit_constructor_p ! && !is_static_flag && (!primary || primary == current_this) && (TREE_CODE (patch) != NEW_CLASS_EXPR)) { *************** patch_method_invocation (patch, primary, *** 14048,14054 **** PATCH_METHOD_RETURN_ERROR (); } java_parser_context_restore_global (); ! if (is_static) *is_static = is_static_flag; /* Sometimes, we want the decl of the selected method. Such as for EH checking */ --- 13557,13563 ---- PATCH_METHOD_RETURN_ERROR (); } java_parser_context_restore_global (); ! if (is_static) *is_static = is_static_flag; /* Sometimes, we want the decl of the selected method. Such as for EH checking */ *************** patch_method_invocation (patch, primary, *** 14060,14071 **** if (is_super_init && CLASS_HAS_FINIT_P (current_class)) { tree finit_parms, finit_call; ! /* Prepare to pass hidden parameters to finit$, if any. */ ! finit_parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_FINIT_INVOCATION, current_class, NULL_TREE, NULL); ! ! finit_call = build_method_invocation (build_wfl_node (finit_identifier_node), finit_parms); --- 13569,13580 ---- if (is_super_init && CLASS_HAS_FINIT_P (current_class)) { tree finit_parms, finit_call; ! /* Prepare to pass hidden parameters to finit$, if any. */ ! finit_parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_FINIT_INVOCATION, current_class, NULL_TREE, NULL); ! ! finit_call = build_method_invocation (build_wfl_node (finit_identifier_node), finit_parms); *************** static int *** 14086,14097 **** check_for_static_method_reference (wfl, node, method, where, primary) tree wfl, node, method, where, primary; { ! if (METHOD_STATIC (current_function_decl) && !METHOD_STATIC (method) && !primary && !CALL_CONSTRUCTOR_P (node)) { char *fct_name = xstrdup (lang_printable_name (method, 0)); ! parse_error_context ! (wfl, "Can't make static reference to method `%s %s' in class `%s'", lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (where)))); free (fct_name); --- 13595,13606 ---- check_for_static_method_reference (wfl, node, method, where, primary) tree wfl, node, method, where, primary; { ! if (METHOD_STATIC (current_function_decl) && !METHOD_STATIC (method) && !primary && !CALL_CONSTRUCTOR_P (node)) { char *fct_name = xstrdup (lang_printable_name (method, 0)); ! parse_error_context ! (wfl, "Can't make static reference to method `%s %s' in class `%s'", lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (where)))); free (fct_name); *************** maybe_use_access_method (is_super_init, *** 14115,14127 **** int to_return = 0; int non_static_context = !METHOD_STATIC (md); ! if (is_super_init || DECL_CONTEXT (md) == current_class ! || !PURE_INNER_CLASS_TYPE_P (current_class) || DECL_FINIT_P (md) || DECL_INSTINIT_P (md)) return 0; ! /* If we're calling a method found in an enclosing class, generate what it takes to retrieve the right this. Don't do that if we're invoking a static method. Note that if MD's type is unrelated to --- 13624,13636 ---- int to_return = 0; int non_static_context = !METHOD_STATIC (md); ! if (is_super_init || DECL_CONTEXT (md) == current_class ! || !PURE_INNER_CLASS_TYPE_P (current_class) || DECL_FINIT_P (md) || DECL_INSTINIT_P (md)) return 0; ! /* If we're calling a method found in an enclosing class, generate what it takes to retrieve the right this. Don't do that if we're invoking a static method. Note that if MD's type is unrelated to *************** maybe_use_access_method (is_super_init, *** 14146,14152 **** ta = build_access_to_thisn (ctx, type, 0); break; } ! type = (DECL_CONTEXT (TYPE_NAME (type)) ? TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type))) : NULL_TREE); } } --- 13655,13661 ---- ta = build_access_to_thisn (ctx, type, 0); break; } ! type = (DECL_CONTEXT (TYPE_NAME (type)) ? TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type))) : NULL_TREE); } } *************** maybe_use_access_method (is_super_init, *** 14165,14171 **** *mdecl = md; *this_arg = ta; ! /* Returnin a non zero value indicates we were doing a non static method invokation that is now a static invocation. It will have callee displace `this' to insert it in the regular argument list. */ --- 13674,13680 ---- *mdecl = md; *this_arg = ta; ! /* Returnin a nonzero value indicates we were doing a non static method invokation that is now a static invocation. It will have callee displace `this' to insert it in the regular argument list. */ *************** patch_invoke (patch, method, args) *** 14190,14196 **** t = TYPE_ARG_TYPES (TREE_TYPE (method)); if (TREE_CODE (patch) == NEW_CLASS_EXPR) t = TREE_CHAIN (t); ! for (ta = args; t != end_params_node && ta; t = TREE_CHAIN (t), ta = TREE_CHAIN (ta)) if (JPRIMITIVE_TYPE_P (TREE_TYPE (TREE_VALUE (ta))) && TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t)) --- 13699,13705 ---- t = TYPE_ARG_TYPES (TREE_TYPE (method)); if (TREE_CODE (patch) == NEW_CLASS_EXPR) t = TREE_CHAIN (t); ! for (ta = args; t != end_params_node && ta; t = TREE_CHAIN (t), ta = TREE_CHAIN (ta)) if (JPRIMITIVE_TYPE_P (TREE_TYPE (TREE_VALUE (ta))) && TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t)) *************** patch_invoke (patch, method, args) *** 14281,14287 **** new = build (CALL_EXPR, promote_type (class), build_address_of (alloc_node), tree_cons (NULL_TREE, build_class_ref (class), ! build_tree_list (NULL_TREE, size_in_bytes (class))), NULL_TREE); saved_new = save_expr (new); --- 13790,13796 ---- new = build (CALL_EXPR, promote_type (class), build_address_of (alloc_node), tree_cons (NULL_TREE, build_class_ref (class), ! build_tree_list (NULL_TREE, size_in_bytes (class))), NULL_TREE); saved_new = save_expr (new); *************** patch_invoke (patch, method, args) *** 14296,14302 **** is NULL. */ if (check != NULL_TREE) { ! patch = build (COMPOUND_EXPR, TREE_TYPE (patch), check, patch); TREE_SIDE_EFFECTS (patch) = 1; } --- 13805,13815 ---- is NULL. */ if (check != NULL_TREE) { ! /* We have to call force_evaluation_order now because creating a ! COMPOUND_EXPR wraps the arg list in a way that makes it ! unrecognizable by force_evaluation_order later. Yuk. */ ! patch = build (COMPOUND_EXPR, TREE_TYPE (patch), check, ! force_evaluation_order (patch)); TREE_SIDE_EFFECTS (patch) = 1; } *************** patch_invoke (patch, method, args) *** 14312,14318 **** { tree list; tree fndecl = current_function_decl; ! tree save = save_expr (patch); tree type = TREE_TYPE (patch); patch = build (COMPOUND_EXPR, type, save, empty_stmt_node); --- 13825,13834 ---- { tree list; tree fndecl = current_function_decl; ! /* We have to call force_evaluation_order now because creating a ! COMPOUND_EXPR wraps the arg list in a way that makes it ! unrecognizable by force_evaluation_order later. Yuk. */ ! tree save = save_expr (force_evaluation_order (patch)); tree type = TREE_TYPE (patch); patch = build (COMPOUND_EXPR, type, save, empty_stmt_node); *************** lookup_method_invoke (lc, cl, class, nam *** 14419,14425 **** char string [4096]; if (!cm || not_accessible_p (class, cm, NULL_TREE, 0)) continue; ! sprintf (string, " `%s' in `%s'%s", get_printable_method_name (cm), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (cm)))), --- 13935,13941 ---- char string [4096]; if (!cm || not_accessible_p (class, cm, NULL_TREE, 0)) continue; ! sprintf (string, " `%s' in `%s'%s", get_printable_method_name (cm), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (cm)))), *************** find_applicable_accessible_methods_list *** 14451,14478 **** int lc; tree class, name, arglist; { ! static struct hash_table t, *searched_classes = NULL; static int search_not_done = 0; tree list = NULL_TREE, all_list = NULL_TREE; ! /* Check the hash table to determine if this class has been searched already. */ if (searched_classes) { ! if (hash_lookup (searched_classes, ! (const hash_table_key) class, FALSE, NULL)) ! return NULL; } else { ! hash_table_init (&t, hash_newfunc, java_hash_hash_tree_node, ! java_hash_compare_tree_node); ! searched_classes = &t; } ! search_not_done++; ! hash_lookup (searched_classes, ! (const hash_table_key) class, TRUE, NULL); if (!CLASS_LOADED_P (class) && !CLASS_FROM_SOURCE_P (class)) { --- 13967,13991 ---- int lc; tree class, name, arglist; { ! static htab_t searched_classes; static int search_not_done = 0; tree list = NULL_TREE, all_list = NULL_TREE; ! /* Check the hash table to determine if this class has been searched already. */ if (searched_classes) { ! if (htab_find (searched_classes, class) != NULL) ! return NULL; } else { ! searched_classes = htab_create (10, htab_hash_pointer, ! htab_eq_pointer, NULL); } ! search_not_done++; ! *htab_find_slot (searched_classes, class, INSERT) = class; if (!CLASS_LOADED_P (class) && !CLASS_FROM_SOURCE_P (class)) { *************** find_applicable_accessible_methods_list *** 14481,14492 **** } /* Search interfaces */ ! if (TREE_CODE (TYPE_NAME (class)) == TYPE_DECL && CLASS_INTERFACE (TYPE_NAME (class))) { int i, n; tree basetype_vec = TYPE_BINFO_BASETYPES (class); ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); n = TREE_VEC_LENGTH (basetype_vec); for (i = 1; i < n; i++) --- 13994,14005 ---- } /* Search interfaces */ ! if (TREE_CODE (TYPE_NAME (class)) == TYPE_DECL && CLASS_INTERFACE (TYPE_NAME (class))) { int i, n; tree basetype_vec = TYPE_BINFO_BASETYPES (class); ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); n = TREE_VEC_LENGTH (basetype_vec); for (i = 1; i < n; i++) *************** find_applicable_accessible_methods_list *** 14494,14500 **** tree t = BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)); tree rlist; ! rlist = find_applicable_accessible_methods_list (lc, t, name, arglist); list = chainon (rlist, list); } --- 14007,14013 ---- tree t = BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)); tree rlist; ! rlist = find_applicable_accessible_methods_list (lc, t, name, arglist); list = chainon (rlist, list); } *************** find_applicable_accessible_methods_list *** 14502,14508 **** /* Search classes */ else { ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); /* When looking finit$, class$ or instinit$, we turn LC to 1 so --- 14015,14021 ---- /* Search classes */ else { ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); /* When looking finit$, class$ or instinit$, we turn LC to 1 so *************** find_applicable_accessible_methods_list *** 14538,14544 **** { tree rlist; class = CLASSTYPE_SUPER (class); ! rlist = find_applicable_accessible_methods_list (lc, class, name, arglist); list = chainon (rlist, list); } --- 14051,14057 ---- { tree rlist; class = CLASSTYPE_SUPER (class); ! rlist = find_applicable_accessible_methods_list (lc, class, name, arglist); list = chainon (rlist, list); } *************** find_applicable_accessible_methods_list *** 14552,14566 **** { if (!lc && TYPE_METHODS (object_type_node) ! && !hash_lookup (searched_classes, ! (const hash_table_key) object_type_node, ! FALSE, NULL)) { ! search_applicable_methods_list (lc, TYPE_METHODS (object_type_node), name, arglist, &list, &all_list); } ! hash_table_free (searched_classes); searched_classes = NULL; } --- 14065,14077 ---- { if (!lc && TYPE_METHODS (object_type_node) ! && htab_find (searched_classes, object_type_node) == NULL) { ! search_applicable_methods_list (lc, TYPE_METHODS (object_type_node), name, arglist, &list, &all_list); } ! htab_delete (searched_classes); searched_classes = NULL; } *************** find_applicable_accessible_methods_list *** 14571,14577 **** /* Effectively search for the appropriate method in method */ ! static void search_applicable_methods_list (lc, method, name, arglist, list, all_list) int lc; tree method, name, arglist; --- 14082,14088 ---- /* Effectively search for the appropriate method in method */ ! static void search_applicable_methods_list (lc, method, name, arglist, list, all_list) int lc; tree method, name, arglist; *************** search_applicable_methods_list (lc, meth *** 14583,14596 **** other classes */ if (lc && !DECL_CONSTRUCTOR_P (method)) continue; ! else if (!lc && (DECL_CONSTRUCTOR_P (method) || (DECL_NAME (method) != name))) continue; if (argument_types_convertible (method, arglist)) { /* Retain accessible methods only */ ! if (!not_accessible_p (DECL_CONTEXT (current_function_decl), method, NULL_TREE, 0)) *list = tree_cons (NULL_TREE, method, *list); else --- 14094,14107 ---- other classes */ if (lc && !DECL_CONSTRUCTOR_P (method)) continue; ! else if (!lc && (DECL_CONSTRUCTOR_P (method) || (DECL_NAME (method) != name))) continue; if (argument_types_convertible (method, arglist)) { /* Retain accessible methods only */ ! if (!not_accessible_p (DECL_CONTEXT (current_function_decl), method, NULL_TREE, 0)) *list = tree_cons (NULL_TREE, method, *list); else *************** find_most_specific_methods_list (list) *** 14627,14639 **** /* Compare arguments and location where methods where declared */ if (argument_types_convertible (method_v, current_v)) { ! if (valid_method_invocation_conversion_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)) || (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) && enclosing_context_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)))) { ! int v = (DECL_SPECIFIC_COUNT (current_v) += (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) ? 2 : 1)); max = (v > max ? v : max); } --- 14138,14150 ---- /* Compare arguments and location where methods where declared */ if (argument_types_convertible (method_v, current_v)) { ! if (valid_method_invocation_conversion_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)) || (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) && enclosing_context_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)))) { ! int v = (DECL_SPECIFIC_COUNT (current_v) += (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) ? 2 : 1)); max = (v > max ? v : max); } *************** find_most_specific_methods_list (list) *** 14690,14714 **** corresponding parameter of M1. Implementation expects M2_OR_ARGLIST to change less often than M1. */ static int argument_types_convertible (m1, m2_or_arglist) tree m1, m2_or_arglist; { - static tree m2_arg_value = NULL_TREE; - static tree m2_arg_cache = NULL_TREE; - static int initialized_p; - register tree m1_arg, m2_arg; - /* Register M2_ARG_VALUE and M2_ARG_CACHE with the garbage - collector. */ - if (!initialized_p) - { - ggc_add_tree_root (&m2_arg_value, 1); - ggc_add_tree_root (&m2_arg_cache, 1); - initialized_p = 1; - } - SKIP_THIS_AND_ARTIFICIAL_PARMS (m1_arg, m1) if (m2_arg_value == m2_or_arglist) --- 14201,14215 ---- corresponding parameter of M1. Implementation expects M2_OR_ARGLIST to change less often than M1. */ + static GTY(()) tree m2_arg_value; + static GTY(()) tree m2_arg_cache; + static int argument_types_convertible (m1, m2_or_arglist) tree m1, m2_or_arglist; { register tree m1_arg, m2_arg; SKIP_THIS_AND_ARTIFICIAL_PARMS (m1_arg, m1) if (m2_arg_value == m2_or_arglist) *************** qualify_ambiguous_name (id) *** 14837,14843 **** else if (code == TREE_LIST) name = EXPR_WFL_NODE (TREE_PURPOSE (qual_wfl)); ! else if (code == STRING_CST || code == CONDITIONAL_EXPR || code == PLUS_EXPR) { qual = TREE_CHAIN (qual); --- 14338,14344 ---- else if (code == TREE_LIST) name = EXPR_WFL_NODE (TREE_PURPOSE (qual_wfl)); ! else if (code == STRING_CST || code == CONDITIONAL_EXPR || code == PLUS_EXPR) { qual = TREE_CHAIN (qual); *************** qualify_ambiguous_name (id) *** 14862,14868 **** if (TREE_CODE (TREE_PURPOSE (qual)) == ARRAY_REF && TREE_CODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == EXPR_WITH_FILE_LOCATION ! && EXPR_WFL_NODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == this_identifier_node) { qual = TREE_OPERAND (TREE_PURPOSE (qual), 0); --- 14363,14369 ---- if (TREE_CODE (TREE_PURPOSE (qual)) == ARRAY_REF && TREE_CODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == EXPR_WITH_FILE_LOCATION ! && EXPR_WFL_NODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == this_identifier_node) { qual = TREE_OPERAND (TREE_PURPOSE (qual), 0); *************** qualify_ambiguous_name (id) *** 14895,14906 **** super_found = again = 1; } } while (again); ! /* If name appears within the scope of a local variable declaration or parameter declaration, then it is an expression name. We don't carry this test out if we're in the context of the use of SUPER or THIS */ ! if (!this_found && !super_found && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST && (decl = IDENTIFIER_LOCAL_VALUE (name))) { --- 14396,14407 ---- super_found = again = 1; } } while (again); ! /* If name appears within the scope of a local variable declaration or parameter declaration, then it is an expression name. We don't carry this test out if we're in the context of the use of SUPER or THIS */ ! if (!this_found && !super_found && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST && (decl = IDENTIFIER_LOCAL_VALUE (name))) { *************** qualify_ambiguous_name (id) *** 14926,14932 **** - NAME is declared in an another compilation unit of the package of the compilation unit containing NAME, - NAME is declared by exactly on type-import-on-demand declaration ! of the compilation unit containing NAME. - NAME is actually a STRING_CST. This can't happen if the expression was qualified by `this.' */ else if (! this_found && --- 14427,14433 ---- - NAME is declared in an another compilation unit of the package of the compilation unit containing NAME, - NAME is declared by exactly on type-import-on-demand declaration ! of the compilation unit containing NAME. - NAME is actually a STRING_CST. This can't happen if the expression was qualified by `this.' */ else if (! this_found && *************** qualify_ambiguous_name (id) *** 14950,14956 **** containing NAME. FIXME */ /* Otherwise, NAME is reclassified as a package name */ ! else RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1; /* Propagate the qualification accross other components of the --- 14451,14457 ---- containing NAME. FIXME */ /* Otherwise, NAME is reclassified as a package name */ ! else RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1; /* Propagate the qualification accross other components of the *************** qualify_ambiguous_name (id) *** 14960,14966 **** { if (RESOLVE_PACKAGE_NAME_P (qual_wfl)) RESOLVE_PACKAGE_NAME_P (QUAL_WFL (qual)) = 1; ! else RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (qual)) = 1; } --- 14461,14467 ---- { if (RESOLVE_PACKAGE_NAME_P (qual_wfl)) RESOLVE_PACKAGE_NAME_P (QUAL_WFL (qual)) = 1; ! else RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (qual)) = 1; } *************** breakdown_qualified (left, right, source *** 14982,14998 **** tree *left, *right, source; { char *p, *base; ! int l = IDENTIFIER_LENGTH (source); base = alloca (l + 1); memcpy (base, IDENTIFIER_POINTER (source), l + 1); ! /* Breakdown NAME into REMAINDER . IDENTIFIER */ p = base + l - 1; while (*p != '.' && p != base) p--; ! /* We didn't find a '.'. Return an error */ if (p == base) return 1; --- 14483,14499 ---- tree *left, *right, source; { char *p, *base; ! int l = IDENTIFIER_LENGTH (source); base = alloca (l + 1); memcpy (base, IDENTIFIER_POINTER (source), l + 1); ! /* Breakdown NAME into REMAINDER . IDENTIFIER. */ p = base + l - 1; while (*p != '.' && p != base) p--; ! /* We didn't find a '.'. Return an error. */ if (p == base) return 1; *************** breakdown_qualified (left, right, source *** 15000,15006 **** if (right) *right = get_identifier (p+1); *left = get_identifier (base); ! return 0; } --- 14501,14507 ---- if (right) *right = get_identifier (p+1); *left = get_identifier (base); ! return 0; } *************** in_same_package (name1, name2) *** 15013,15019 **** tree tmp; tree pkg1; tree pkg2; ! if (TREE_CODE (name1) == TYPE_DECL) name1 = DECL_NAME (name1); if (TREE_CODE (name2) == TYPE_DECL) --- 14514,14520 ---- tree tmp; tree pkg1; tree pkg2; ! if (TREE_CODE (name1) == TYPE_DECL) name1 = DECL_NAME (name1); if (TREE_CODE (name2) == TYPE_DECL) *************** in_same_package (name1, name2) *** 15029,15035 **** breakdown_qualified (&pkg1, &tmp, name1); breakdown_qualified (&pkg2, &tmp, name2); ! return (pkg1 == pkg2); } --- 14530,14536 ---- breakdown_qualified (&pkg1, &tmp, name1); breakdown_qualified (&pkg2, &tmp, name2); ! return (pkg1 == pkg2); } *************** java_complete_tree (node) *** 15046,15067 **** && DECL_INITIAL (node) != NULL_TREE && !flag_emit_xref) { ! tree value = DECL_INITIAL (node); ! DECL_INITIAL (node) = NULL_TREE; ! value = fold_constant_for_init (value, node); ! DECL_INITIAL (node) = value; if (value != NULL_TREE) ! { ! /* fold_constant_for_init sometimes widens the original type ! of the constant (i.e. byte to int). It's not desirable, ! especially if NODE is a function argument. */ ! if ((TREE_CODE (value) == INTEGER_CST ! || TREE_CODE (value) == REAL_CST) ! && TREE_TYPE (node) != TREE_TYPE (value)) ! return convert (TREE_TYPE (node), value); ! else ! return value; ! } } return node; } --- 14547,14555 ---- && DECL_INITIAL (node) != NULL_TREE && !flag_emit_xref) { ! tree value = fold_constant_for_init (node, node); if (value != NULL_TREE) ! return value; } return node; } *************** java_complete_lhs (node) *** 15122,15128 **** int error_seen = 0; if (TREE_CODE (stmt) == COMPOUND_EXPR) { ! /* Re-order from (((A; B); C); ...; Z) to (A; (B; (C ; (...; Z)))). This makes it easier to scan the statements left-to-right without using recursion (which might overflow the stack --- 14610,14616 ---- int error_seen = 0; if (TREE_CODE (stmt) == COMPOUND_EXPR) { ! /* Re-order from (((A; B); C); ...; Z) to (A; (B; (C ; (...; Z)))). This makes it easier to scan the statements left-to-right without using recursion (which might overflow the stack *************** java_complete_lhs (node) *** 15268,15278 **** nn = ctxp->current_loop; /* It must be assignable to the type of the switch expression. */ ! if (!try_builtin_assignconv (NULL_TREE, TREE_TYPE (TREE_OPERAND (nn, 0)), cn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Incompatible type for case. Can't convert `%s' to `int'", lang_printable_name (TREE_TYPE (cn), 0)); --- 14756,14766 ---- nn = ctxp->current_loop; /* It must be assignable to the type of the switch expression. */ ! if (!try_builtin_assignconv (NULL_TREE, TREE_TYPE (TREE_OPERAND (nn, 0)), cn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Incompatible type for case. Can't convert `%s' to `int'", lang_printable_name (TREE_TYPE (cn), 0)); *************** java_complete_lhs (node) *** 15303,15309 **** if (SWITCH_HAS_DEFAULT (nn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Duplicate case label: `default'"); return error_mark_node; } --- 14791,14797 ---- if (SWITCH_HAS_DEFAULT (nn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Duplicate case label: `default'"); return error_mark_node; } *************** java_complete_lhs (node) *** 15378,15384 **** /* 3- Expression section */ case COMPOUND_EXPR: wfl_op2 = TREE_OPERAND (node, 1); ! TREE_OPERAND (node, 0) = nn = java_complete_tree (TREE_OPERAND (node, 0)); if (wfl_op2 == empty_stmt_node) CAN_COMPLETE_NORMALLY (node) = CAN_COMPLETE_NORMALLY (nn); --- 14866,14872 ---- /* 3- Expression section */ case COMPOUND_EXPR: wfl_op2 = TREE_OPERAND (node, 1); ! TREE_OPERAND (node, 0) = nn = java_complete_tree (TREE_OPERAND (node, 0)); if (wfl_op2 == empty_stmt_node) CAN_COMPLETE_NORMALLY (node) = CAN_COMPLETE_NORMALLY (nn); *************** java_complete_lhs (node) *** 15391,15400 **** nn = wfl_op2; if (TREE_CODE (nn) == EXPR_WITH_FILE_LOCATION) nn = EXPR_WFL_NODE (nn); ! if (TREE_CODE (nn) != EXIT_EXPR) { SET_WFL_OPERATOR (wfl_operator, node, wfl_op2); ! parse_error_context (wfl_operator, "Unreachable statement"); } } TREE_OPERAND (node, 1) = java_complete_tree (TREE_OPERAND (node, 1)); --- 14879,14900 ---- nn = wfl_op2; if (TREE_CODE (nn) == EXPR_WITH_FILE_LOCATION) nn = EXPR_WFL_NODE (nn); ! /* NN can be NULL_TREE exactly when UPDATE is, in ! finish_for_loop. */ ! if (nn != NULL_TREE && TREE_CODE (nn) != EXIT_EXPR) { SET_WFL_OPERATOR (wfl_operator, node, wfl_op2); ! if (SUPPRESS_UNREACHABLE_ERROR (nn)) ! { ! /* Perhaps this warning should have an ! associated flag. The code being compiled is ! pedantically correct, but useless. */ ! parse_warning_context (wfl_operator, ! "Unreachable statement"); ! } ! else ! parse_error_context (wfl_operator, ! "Unreachable statement"); } } TREE_OPERAND (node, 1) = java_complete_tree (TREE_OPERAND (node, 1)); *************** java_complete_lhs (node) *** 15455,15461 **** } else TREE_TYPE (node) = TREE_TYPE (EXPR_WFL_NODE (node)); ! } break; --- 14955,14961 ---- } else TREE_TYPE (node) = TREE_TYPE (EXPR_WFL_NODE (node)); ! } break; *************** java_complete_lhs (node) *** 15465,15471 **** for (cn = TREE_OPERAND (node, 1); cn; cn = TREE_CHAIN (cn)) { int location = EXPR_WFL_LINECOL (TREE_VALUE (cn)); ! tree dim = convert (int_type_node, java_complete_tree (TREE_VALUE (cn))); if (dim == error_mark_node) { --- 14965,14971 ---- for (cn = TREE_OPERAND (node, 1); cn; cn = TREE_CHAIN (cn)) { int location = EXPR_WFL_LINECOL (TREE_VALUE (cn)); ! tree dim = convert (int_type_node, java_complete_tree (TREE_VALUE (cn))); if (dim == error_mark_node) { *************** java_complete_lhs (node) *** 15477,15483 **** TREE_VALUE (cn) = dim; /* Setup the location of the current dimension, for later error report. */ ! TREE_PURPOSE (cn) = build_expr_wfl (NULL_TREE, input_filename, 0, 0); EXPR_WFL_LINECOL (TREE_PURPOSE (cn)) = location; } --- 14977,14983 ---- TREE_VALUE (cn) = dim; /* Setup the location of the current dimension, for later error report. */ ! TREE_PURPOSE (cn) = build_expr_wfl (NULL_TREE, input_filename, 0, 0); EXPR_WFL_LINECOL (TREE_PURPOSE (cn)) = location; } *************** java_complete_lhs (node) *** 15526,15533 **** check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl); /* If we call this(...), register signature and positions */ if (in_this) ! DECL_CONSTRUCTOR_CALLS (current_function_decl) = ! tree_cons (wfl, decl, DECL_CONSTRUCTOR_CALLS (current_function_decl)); CAN_COMPLETE_NORMALLY (node) = 1; return force_evaluation_order (node); --- 15026,15033 ---- check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl); /* If we call this(...), register signature and positions */ if (in_this) ! DECL_CONSTRUCTOR_CALLS (current_function_decl) = ! tree_cons (wfl, decl, DECL_CONSTRUCTOR_CALLS (current_function_decl)); CAN_COMPLETE_NORMALLY (node) = 1; return force_evaluation_order (node); *************** java_complete_lhs (node) *** 15537,15556 **** /* Save potential wfls */ wfl_op1 = TREE_OPERAND (node, 0); TREE_OPERAND (node, 0) = nn = java_complete_lhs (wfl_op1); ! if (MODIFY_EXPR_FROM_INITIALIZATION_P (node) && TREE_CODE (nn) == VAR_DECL && TREE_STATIC (nn) && DECL_INITIAL (nn) != NULL_TREE) { tree value; ! value = fold_constant_for_init (nn, nn); /* When we have a primitype type, or a string and we're not emitting a class file, we actually don't want to generate anything for the assignment. */ if (value != NULL_TREE && ! (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) || (TREE_TYPE (value) == string_ptr_type_node && ! flag_emit_class_files))) { --- 15037,15056 ---- /* Save potential wfls */ wfl_op1 = TREE_OPERAND (node, 0); TREE_OPERAND (node, 0) = nn = java_complete_lhs (wfl_op1); ! if (MODIFY_EXPR_FROM_INITIALIZATION_P (node) && TREE_CODE (nn) == VAR_DECL && TREE_STATIC (nn) && DECL_INITIAL (nn) != NULL_TREE) { tree value; ! value = fold_constant_for_init (nn, nn); /* When we have a primitype type, or a string and we're not emitting a class file, we actually don't want to generate anything for the assignment. */ if (value != NULL_TREE && ! (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) || (TREE_TYPE (value) == string_ptr_type_node && ! flag_emit_class_files))) { *************** java_complete_lhs (node) *** 15586,15596 **** { /* This might break when accessing outer field from inner class. TESTME, FIXME */ ! tree lvalue = java_stabilize_reference (TREE_OPERAND (node, 0)); /* Hand stabilize the lhs on both places */ TREE_OPERAND (node, 0) = lvalue; ! TREE_OPERAND (TREE_OPERAND (node, 1), 0) = (flag_emit_class_files ? lvalue : save_expr (lvalue)); /* 15.25.2.a: Left hand is not an array access. FIXME */ --- 15086,15096 ---- { /* This might break when accessing outer field from inner class. TESTME, FIXME */ ! tree lvalue = java_stabilize_reference (TREE_OPERAND (node, 0)); /* Hand stabilize the lhs on both places */ TREE_OPERAND (node, 0) = lvalue; ! TREE_OPERAND (TREE_OPERAND (node, 1), 0) = (flag_emit_class_files ? lvalue : save_expr (lvalue)); /* 15.25.2.a: Left hand is not an array access. FIXME */ *************** java_complete_lhs (node) *** 15600,15608 **** if ((cn = patch_string (nn))) nn = cn; ! /* The last part of the rewrite for E1 op= E2 is to have E1 = (T)(E1 op E2), with T being the type of E1. */ ! nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn)); /* If the assignment is compound and has reference type, --- 15100,15108 ---- if ((cn = patch_string (nn))) nn = cn; ! /* The last part of the rewrite for E1 op= E2 is to have E1 = (T)(E1 op E2), with T being the type of E1. */ ! nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn)); /* If the assignment is compound and has reference type, *************** java_complete_lhs (node) *** 15656,15662 **** if (node == error_mark_node) return error_mark_node; /* Reorganize the tree if necessary. */ ! if (flag && (!JREFERENCE_TYPE_P (TREE_TYPE (node)) || JSTRING_P (TREE_TYPE (node)))) node = java_refold (node); } --- 15156,15162 ---- if (node == error_mark_node) return error_mark_node; /* Reorganize the tree if necessary. */ ! if (flag && (!JREFERENCE_TYPE_P (TREE_TYPE (node)) || JSTRING_P (TREE_TYPE (node)))) node = java_refold (node); } *************** java_complete_lhs (node) *** 15665,15673 **** undergone a conversion in patch_assignment. We do that only when it's necessary to have DECL_INITIAL properly set. */ nn = TREE_OPERAND (node, 0); ! if (TREE_CODE (nn) == VAR_DECL && DECL_INITIAL (nn) && CONSTANT_VALUE_P (DECL_INITIAL (nn)) ! && FIELD_STATIC (nn) && FIELD_FINAL (nn) && (JPRIMITIVE_TYPE_P (TREE_TYPE (nn)) || TREE_TYPE (nn) == string_ptr_type_node)) DECL_INITIAL (nn) = TREE_OPERAND (node, 1); --- 15165,15173 ---- undergone a conversion in patch_assignment. We do that only when it's necessary to have DECL_INITIAL properly set. */ nn = TREE_OPERAND (node, 0); ! if (TREE_CODE (nn) == VAR_DECL && DECL_INITIAL (nn) && CONSTANT_VALUE_P (DECL_INITIAL (nn)) ! && FIELD_STATIC (nn) && FIELD_FINAL (nn) && (JPRIMITIVE_TYPE_P (TREE_TYPE (nn)) || TREE_TYPE (nn) == string_ptr_type_node)) DECL_INITIAL (nn) = TREE_OPERAND (node, 1); *************** java_complete_lhs (node) *** 15689,15695 **** case RDIV_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: --- 15189,15195 ---- case RDIV_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: *************** java_complete_lhs (node) *** 15808,15820 **** if (ctxp->explicit_constructor_p) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Can't reference `this' or `super' before the superclass constructor has been called"); TREE_TYPE (node) = error_mark_node; return error_mark_node; } return current_this; ! case CLASS_LITERAL: CAN_COMPLETE_NORMALLY (node) = 1; node = patch_incomplete_class_ref (node); --- 15308,15320 ---- if (ctxp->explicit_constructor_p) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Can't reference `this' or `super' before the superclass constructor has been called"); TREE_TYPE (node) = error_mark_node; return error_mark_node; } return current_this; ! case CLASS_LITERAL: CAN_COMPLETE_NORMALLY (node) = 1; node = patch_incomplete_class_ref (node); *************** java_complete_lhs (node) *** 15834,15840 **** return node; } ! /* Complete function call's argument. Return a non zero value is an error was found. */ static int --- 15334,15340 ---- return node; } ! /* Complete function call's argument. Return a nonzero value is an error was found. */ static int *************** enter_block () *** 15911,15917 **** for the first time for a given function. The current function body (DECL_FUNCTION_BODY) is set to be block B. */ ! tree fndecl = current_function_decl; if (!fndecl) { BLOCK_SUPERCONTEXT (b) = current_static_block; --- 15411,15417 ---- for the first time for a given function. The current function body (DECL_FUNCTION_BODY) is set to be block B. */ ! tree fndecl = current_function_decl; if (!fndecl) { BLOCK_SUPERCONTEXT (b) = current_static_block; *************** lookup_name_in_blocks (name) *** 15973,15979 **** if (TREE_CODE (b) != BLOCK) abort (); ! for (current = BLOCK_EXPR_DECLS (b); current; current = TREE_CHAIN (current)) if (DECL_NAME (current) == name) return current; --- 15473,15479 ---- if (TREE_CODE (b) != BLOCK) abort (); ! for (current = BLOCK_EXPR_DECLS (b); current; current = TREE_CHAIN (current)) if (DECL_NAME (current) == name) return current; *************** build_wfl_wrap (node, location) *** 16006,16012 **** int location; { tree wfl, node_to_insert = node; ! /* We want to process THIS . xxx symbolicaly, to keep it consistent with the way we're processing SUPER. A THIS from a primary as a different form than a SUPER. Turn THIS into something symbolic */ --- 15506,15512 ---- int location; { tree wfl, node_to_insert = node; ! /* We want to process THIS . xxx symbolicaly, to keep it consistent with the way we're processing SUPER. A THIS from a primary as a different form than a SUPER. Turn THIS into something symbolic */ *************** build_this_super_qualified_invocation (u *** 16054,16060 **** int lloc, rloc; { tree invok; ! tree wfl = build_wfl_node (use_this ? this_identifier_node : super_identifier_node); EXPR_WFL_LINECOL (wfl) = lloc; invok = build_method_invocation (name, args); --- 15554,15560 ---- int lloc, rloc; { tree invok; ! tree wfl = build_wfl_node (use_this ? this_identifier_node : super_identifier_node); EXPR_WFL_LINECOL (wfl) = lloc; invok = build_method_invocation (name, args); *************** build_assignment (op, op_location, lhs, *** 16108,16115 **** return assignment; } ! /* Print an INTEGER_CST node in a static buffer, and return the buffer. */ char * print_int_node (node) tree node; --- 15608,15691 ---- return assignment; } ! /* Print an INTEGER_CST node as decimal in a static buffer, and return ! the buffer. This is used only for string conversion. */ ! static char * ! string_convert_int_cst (node) ! tree node; ! { ! /* Long.MIN_VALUE is -9223372036854775808, 20 characters. */ ! static char buffer[21]; ! ! unsigned HOST_WIDE_INT lo = TREE_INT_CST_LOW (node); ! unsigned HOST_WIDE_INT hi = TREE_INT_CST_HIGH (node); ! char *p = buffer + sizeof (buffer); ! int neg = 0; ! ! unsigned HOST_WIDE_INT hibit = (((unsigned HOST_WIDE_INT) 1) ! << (HOST_BITS_PER_WIDE_INT - 1)); ! ! *--p = '\0'; ! ! /* If negative, note the fact and negate the value. */ ! if ((hi & hibit)) ! { ! lo = ~lo; ! hi = ~hi; ! if (++lo == 0) ! ++hi; ! neg = 1; ! } ! ! /* Divide by 10 until there are no bits left. */ ! do ! { ! unsigned HOST_WIDE_INT acc = 0; ! unsigned HOST_WIDE_INT outhi = 0, outlo = 0; ! unsigned int i; ! ! /* Use long division to compute the result and the remainder. */ ! for (i = 0; i < 2 * HOST_BITS_PER_WIDE_INT; ++i) ! { ! /* Shift a bit into accumulator. */ ! acc <<= 1; ! if ((hi & hibit)) ! acc |= 1; ! ! /* Shift the value. */ ! hi <<= 1; ! if ((lo & hibit)) ! hi |= 1; ! lo <<= 1; ! ! /* Shift the correct bit into the result. */ ! outhi <<= 1; ! if ((outlo & hibit)) ! outhi |= 1; ! outlo <<= 1; ! if (acc >= 10) ! { ! acc -= 10; ! outlo |= 1; ! } ! } ! ! /* '0' == 060 in Java, but might not be here (think EBCDIC). */ ! *--p = '\060' + acc; ! ! hi = outhi; ! lo = outlo; ! } ! while (hi || lo); ! ! if (neg) ! *--p = '\055'; /* '-' == 055 in Java, but might not be here. */ + return p; + } + + /* Print an INTEGER_CST node in a static buffer, and return the + buffer. This is used only for error handling. */ char * print_int_node (node) tree node; *************** print_int_node (node) *** 16117,16123 **** static char buffer [80]; if (TREE_CONSTANT_OVERFLOW (node)) sprintf (buffer, ""); ! if (TREE_INT_CST_HIGH (node) == 0) sprintf (buffer, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node)); --- 15693,15699 ---- static char buffer [80]; if (TREE_CONSTANT_OVERFLOW (node)) sprintf (buffer, ""); ! if (TREE_INT_CST_HIGH (node) == 0) sprintf (buffer, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node)); *************** patch_assignment (node, wfl_op1) *** 16187,16193 **** { lhs_type = TREE_TYPE (lvalue); } ! else { parse_error_context (wfl_op1, "Invalid left hand side of assignment"); error_found = 1; --- 15763,15769 ---- { lhs_type = TREE_TYPE (lvalue); } ! else { parse_error_context (wfl_op1, "Invalid left hand side of assignment"); error_found = 1; *************** patch_assignment (node, wfl_op1) *** 16260,16271 **** /* 10.10: Array Store Exception runtime check */ if (!flag_emit_class_files && !flag_emit_xref ! && lvalue_from_array && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type))) { tree array, store_check, base, index_expr; ! ! /* Save RHS so that it doesn't get re-evaluated by the store check. */ new_rhs = save_expr (new_rhs); /* Get the INDIRECT_REF. */ --- 15836,15847 ---- /* 10.10: Array Store Exception runtime check */ if (!flag_emit_class_files && !flag_emit_xref ! && lvalue_from_array && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type))) { tree array, store_check, base, index_expr; ! ! /* Save RHS so that it doesn't get re-evaluated by the store check. */ new_rhs = save_expr (new_rhs); /* Get the INDIRECT_REF. */ *************** patch_assignment (node, wfl_op1) *** 16273,16299 **** /* Get the array pointer expr. */ array = TREE_OPERAND (array, 0); store_check = build_java_arraystore_check (array, new_rhs); ! index_expr = TREE_OPERAND (lvalue, 1); ! if (TREE_CODE (index_expr) == COMPOUND_EXPR) { ! /* A COMPOUND_EXPR here is a bounds check. The bounds check must happen before the store check, so prepare to insert the store check within the second operand of the existing COMPOUND_EXPR. */ base = index_expr; } else base = lvalue; ! index_expr = TREE_OPERAND (base, 1); ! TREE_OPERAND (base, 1) = build (COMPOUND_EXPR, TREE_TYPE (index_expr), store_check, index_expr); } /* Final locals can be used as case values in switch statement. Prepare them for this eventuality. */ ! if (TREE_CODE (lvalue) == VAR_DECL && DECL_FINAL (lvalue) && TREE_CONSTANT (new_rhs) && IDENTIFIER_LOCAL_VALUE (DECL_NAME (lvalue)) --- 15849,15875 ---- /* Get the array pointer expr. */ array = TREE_OPERAND (array, 0); store_check = build_java_arraystore_check (array, new_rhs); ! index_expr = TREE_OPERAND (lvalue, 1); ! if (TREE_CODE (index_expr) == COMPOUND_EXPR) { ! /* A COMPOUND_EXPR here is a bounds check. The bounds check must happen before the store check, so prepare to insert the store check within the second operand of the existing COMPOUND_EXPR. */ base = index_expr; } else base = lvalue; ! index_expr = TREE_OPERAND (base, 1); ! TREE_OPERAND (base, 1) = build (COMPOUND_EXPR, TREE_TYPE (index_expr), store_check, index_expr); } /* Final locals can be used as case values in switch statement. Prepare them for this eventuality. */ ! if (TREE_CODE (lvalue) == VAR_DECL && DECL_FINAL (lvalue) && TREE_CONSTANT (new_rhs) && IDENTIFIER_LOCAL_VALUE (DECL_NAME (lvalue)) *************** patch_assignment (node, wfl_op1) *** 16304,16309 **** --- 15880,15922 ---- DECL_INITIAL (lvalue) = new_rhs; } + /* Copy the rhs if it's a reference. */ + if (! flag_check_references && ! flag_emit_class_files && optimize > 0) + { + switch (TREE_CODE (new_rhs)) + { + case ARRAY_REF: + case INDIRECT_REF: + case COMPONENT_REF: + /* Transform a = foo.bar + into a = { int tmp; tmp = foo.bar; tmp; ). + We need to ensure that if a read from memory fails + because of a NullPointerException, a destination variable + will remain unchanged. An explicit temporary does what + we need. + + If flag_check_references is set, this is unnecessary + because we'll check each reference before doing any + reads. If optimize is not set the result will never be + written to a stack slot that contains the LHS. */ + { + tree tmp = build_decl (VAR_DECL, get_identifier (""), + TREE_TYPE (new_rhs)); + tree block = build (BLOCK, TREE_TYPE (new_rhs), NULL); + tree assignment + = build (MODIFY_EXPR, TREE_TYPE (new_rhs), tmp, fold (new_rhs)); + BLOCK_VARS (block) = tmp; + BLOCK_EXPR_BODY (block) + = build (COMPOUND_EXPR, TREE_TYPE (new_rhs), assignment, tmp); + TREE_SIDE_EFFECTS (block) = 1; + new_rhs = block; + } + break; + default: + break; + } + } + TREE_OPERAND (node, 0) = lvalue; TREE_OPERAND (node, 1) = new_rhs; TREE_TYPE (node) = lhs_type; *************** try_builtin_assignconv (wfl_op1, lhs_typ *** 16362,16381 **** else if (valid_builtin_assignconv_identity_widening_p (lhs_type, rhs_type)) new_rhs = convert (lhs_type, rhs); ! /* Try a narrowing primitive conversion (5.1.3): ! - expression is a constant expression of type int AND - variable is byte, short or char AND ! - The value of the expression is representable in the type of the variable */ ! else if (rhs_type == int_type_node && TREE_CONSTANT (rhs) && (lhs_type == byte_type_node || lhs_type == char_type_node || lhs_type == short_type_node)) { if (int_fits_type_p (rhs, lhs_type)) new_rhs = convert (lhs_type, rhs); else if (wfl_op1) /* Might be called with a NULL */ ! parse_warning_context ! (wfl_op1, "Constant expression `%s' too wide for narrowing primitive conversion to `%s'", print_int_node (rhs), lang_printable_name (lhs_type, 0)); /* Reported a warning that will turn into an error further down, so we don't return */ --- 15975,15997 ---- else if (valid_builtin_assignconv_identity_widening_p (lhs_type, rhs_type)) new_rhs = convert (lhs_type, rhs); ! /* Try a narrowing primitive conversion (5.1.3): ! - expression is a constant expression of type byte, short, char, ! or int, AND - variable is byte, short or char AND ! - The value of the expression is representable in the type of the variable */ ! else if ((rhs_type == byte_type_node || rhs_type == short_type_node ! || rhs_type == char_type_node || rhs_type == int_type_node) ! && TREE_CONSTANT (rhs) && (lhs_type == byte_type_node || lhs_type == char_type_node || lhs_type == short_type_node)) { if (int_fits_type_p (rhs, lhs_type)) new_rhs = convert (lhs_type, rhs); else if (wfl_op1) /* Might be called with a NULL */ ! parse_warning_context ! (wfl_op1, "Constant expression `%s' too wide for narrowing primitive conversion to `%s'", print_int_node (rhs), lang_printable_name (lhs_type, 0)); /* Reported a warning that will turn into an error further down, so we don't return */ *************** valid_builtin_assignconv_identity_wideni *** 16420,16426 **** /* From here, an integral is widened if its precision is smaller than the precision of the LHS or if the LHS is a floating point type, or the RHS is a float and the RHS a double. */ ! if ((JINTEGRAL_TYPE_P (rhs_type) && JINTEGRAL_TYPE_P (lhs_type) && (TYPE_PRECISION (rhs_type) < TYPE_PRECISION (lhs_type))) || (JINTEGRAL_TYPE_P (rhs_type) && JFLOAT_TYPE_P (lhs_type)) || (rhs_type == float_type_node && lhs_type == double_type_node)) --- 16036,16042 ---- /* From here, an integral is widened if its precision is smaller than the precision of the LHS or if the LHS is a floating point type, or the RHS is a float and the RHS a double. */ ! if ((JINTEGRAL_TYPE_P (rhs_type) && JINTEGRAL_TYPE_P (lhs_type) && (TYPE_PRECISION (rhs_type) < TYPE_PRECISION (lhs_type))) || (JINTEGRAL_TYPE_P (rhs_type) && JFLOAT_TYPE_P (lhs_type)) || (rhs_type == float_type_node && lhs_type == double_type_node)) *************** valid_ref_assignconv_cast_p (source, des *** 16468,16474 **** if (TYPE_CLASS_P (source)) { if (TYPE_CLASS_P (dest)) ! return (source == dest || inherits_from_p (source, dest) || (cast && inherits_from_p (dest, source))); if (TYPE_INTERFACE_P (dest)) --- 16084,16090 ---- if (TYPE_CLASS_P (source)) { if (TYPE_CLASS_P (dest)) ! return (source == dest || inherits_from_p (source, dest) || (cast && inherits_from_p (dest, source))); if (TYPE_INTERFACE_P (dest)) *************** valid_ref_assignconv_cast_p (source, des *** 16509,16524 **** tree source_type; tree source_sig; tree source_name; ! for (method_source = TYPE_METHODS (source); method_source; method_source = TREE_CHAIN (method_source)) { ! source_sig = build_java_argument_signature (TREE_TYPE (method_source)); source_type = TREE_TYPE (TREE_TYPE (method_source)); source_name = DECL_NAME (method_source); for (method_dest = TYPE_METHODS (dest); method_dest; method_dest = TREE_CHAIN (method_dest)) ! if (source_sig == build_java_argument_signature (TREE_TYPE (method_dest)) && source_name == DECL_NAME (method_dest) && source_type != TREE_TYPE (TREE_TYPE (method_dest))) --- 16125,16140 ---- tree source_type; tree source_sig; tree source_name; ! for (method_source = TYPE_METHODS (source); method_source; method_source = TREE_CHAIN (method_source)) { ! source_sig = build_java_argument_signature (TREE_TYPE (method_source)); source_type = TREE_TYPE (TREE_TYPE (method_source)); source_name = DECL_NAME (method_source); for (method_dest = TYPE_METHODS (dest); method_dest; method_dest = TREE_CHAIN (method_dest)) ! if (source_sig == build_java_argument_signature (TREE_TYPE (method_dest)) && source_name == DECL_NAME (method_dest) && source_type != TREE_TYPE (TREE_TYPE (method_dest))) *************** valid_ref_assignconv_cast_p (source, des *** 16533,16541 **** { /* Array */ return (cast ! && (DECL_NAME (TYPE_NAME (source)) == java_lang_cloneable || (DECL_NAME (TYPE_NAME (source)) ! == java_io_serializable))); } } if (TYPE_ARRAY_P (source)) --- 16149,16158 ---- { /* Array */ return (cast ! && (DECL_NAME (TYPE_NAME (source)) ! == java_lang_cloneable_identifier_node || (DECL_NAME (TYPE_NAME (source)) ! == java_io_serializable_identifier_node))); } } if (TYPE_ARRAY_P (source)) *************** valid_ref_assignconv_cast_p (source, des *** 16545,16557 **** /* Can't cast an array to an interface unless the interface is java.lang.Cloneable or java.io.Serializable. */ if (TYPE_INTERFACE_P (dest)) ! return (DECL_NAME (TYPE_NAME (dest)) == java_lang_cloneable ! || DECL_NAME (TYPE_NAME (dest)) == java_io_serializable); else /* Arrays */ { tree source_element_type = TYPE_ARRAY_ELEMENT (source); tree dest_element_type = TYPE_ARRAY_ELEMENT (dest); ! /* In case of severe errors, they turn out null */ if (!dest_element_type || !source_element_type) return 0; --- 16162,16176 ---- /* Can't cast an array to an interface unless the interface is java.lang.Cloneable or java.io.Serializable. */ if (TYPE_INTERFACE_P (dest)) ! return (DECL_NAME (TYPE_NAME (dest)) ! == java_lang_cloneable_identifier_node ! || (DECL_NAME (TYPE_NAME (dest)) ! == java_io_serializable_identifier_node)); else /* Arrays */ { tree source_element_type = TYPE_ARRAY_ELEMENT (source); tree dest_element_type = TYPE_ARRAY_ELEMENT (dest); ! /* In case of severe errors, they turn out null */ if (!dest_element_type || !source_element_type) return 0; *************** do_unary_numeric_promotion (arg) *** 16599,16605 **** return arg; } ! /* Return a non zero value if SOURCE can be converted into DEST using the method invocation conversion rule (5.3). */ static int valid_method_invocation_conversion_p (dest, source) --- 16218,16224 ---- return arg; } ! /* Return a nonzero value if SOURCE can be converted into DEST using the method invocation conversion rule (5.3). */ static int valid_method_invocation_conversion_p (dest, source) *************** operator_string (node) *** 16643,16649 **** sprintf (buffer, "%s%s", S, (COMPOUND_ASSIGN_P (node) ? "=" : "")); \ return buffer; \ } ! static char buffer [10]; switch (TREE_CODE (node)) { --- 16262,16268 ---- sprintf (buffer, "%s%s", S, (COMPOUND_ASSIGN_P (node) ? "=" : "")); \ return buffer; \ } ! static char buffer [10]; switch (TREE_CODE (node)) { *************** java_decl_equiv (var_acc1, var_acc2) *** 16690,16696 **** { if (JDECL_P (var_acc1)) return (var_acc1 == var_acc2); ! return (TREE_CODE (var_acc1) == COMPONENT_REF && TREE_CODE (var_acc2) == COMPONENT_REF && TREE_OPERAND (TREE_OPERAND (var_acc1, 0), 0) --- 16309,16315 ---- { if (JDECL_P (var_acc1)) return (var_acc1 == var_acc2); ! return (TREE_CODE (var_acc1) == COMPONENT_REF && TREE_CODE (var_acc2) == COMPONENT_REF && TREE_OPERAND (TREE_OPERAND (var_acc1, 0), 0) *************** java_decl_equiv (var_acc1, var_acc2) *** 16698,16704 **** && TREE_OPERAND (var_acc1, 1) == TREE_OPERAND (var_acc2, 1)); } ! /* Return a non zero value if CODE is one of the operators that can be used in conjunction with the `=' operator in a compound assignment. */ static int --- 16317,16323 ---- && TREE_OPERAND (var_acc1, 1) == TREE_OPERAND (var_acc2, 1)); } ! /* Return a nonzero value if CODE is one of the operators that can be used in conjunction with the `=' operator in a compound assignment. */ static int *************** java_refold (t) *** 16732,16738 **** /* Now the left branch of the binary operator. */ b = TREE_OPERAND (TREE_OPERAND (c, 1), 0); ! if (! (b && TREE_CODE (b) == NOP_EXPR && TREE_CODE (TREE_OPERAND (b, 0)) == SAVE_EXPR)) return t; --- 16351,16357 ---- /* Now the left branch of the binary operator. */ b = TREE_OPERAND (TREE_OPERAND (c, 1), 0); ! if (! (b && TREE_CODE (b) == NOP_EXPR && TREE_CODE (TREE_OPERAND (b, 0)) == SAVE_EXPR)) return t; *************** patch_binop (node, wfl_op1, wfl_op2) *** 16786,16792 **** error situation, unless it's too early to tell (in case we're handling a `+', `==', `!=' or `instanceof'.) We want to set op_type correctly so the error can be later on reported accurately. */ ! if (! (code == PLUS_EXPR || code == NE_EXPR || code == EQ_EXPR || code == INSTANCEOF_EXPR)) { tree n; --- 16405,16411 ---- error situation, unless it's too early to tell (in case we're handling a `+', `==', `!=' or `instanceof'.) We want to set op_type correctly so the error can be later on reported accurately. */ ! if (! (code == PLUS_EXPR || code == NE_EXPR || code == EQ_EXPR || code == INSTANCEOF_EXPR)) { tree n; *************** patch_binop (node, wfl_op1, wfl_op2) *** 16831,16837 **** parse_warning_context (wfl_operator, "Evaluating this expression will result in an arithmetic exception being thrown"); TREE_CONSTANT (node) = 0; } ! /* Change the division operator if necessary */ if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE) TREE_SET_CODE (node, TRUNC_DIV_EXPR); --- 16450,16456 ---- parse_warning_context (wfl_operator, "Evaluating this expression will result in an arithmetic exception being thrown"); TREE_CONSTANT (node) = 0; } ! /* Change the division operator if necessary */ if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE) TREE_SET_CODE (node, TRUNC_DIV_EXPR); *************** patch_binop (node, wfl_op1, wfl_op2) *** 16854,16860 **** && ! flag_emit_class_files && (code == RDIV_EXPR || code == TRUNC_MOD_EXPR)) return build_java_soft_divmod (TREE_CODE (node), prom_type, op1, op2); ! /* This one is more complicated. FLOATs are processed by a function call to soft_fmod. Duplicate the value of the COMPOUND_ASSIGN_P flag. */ --- 16473,16479 ---- && ! flag_emit_class_files && (code == RDIV_EXPR || code == TRUNC_MOD_EXPR)) return build_java_soft_divmod (TREE_CODE (node), prom_type, op1, op2); ! /* This one is more complicated. FLOATs are processed by a function call to soft_fmod. Duplicate the value of the COMPOUND_ASSIGN_P flag. */ *************** patch_binop (node, wfl_op1, wfl_op2) *** 16876,16882 **** purpose of the a previous usage of the String concatenation operator */ ! if (TREE_CODE (op1) == STRING_CST || TREE_CODE (op2) == STRING_CST || JSTRING_TYPE_P (op1_type) || JSTRING_TYPE_P (op2_type) --- 16495,16501 ---- purpose of the a previous usage of the String concatenation operator */ ! if (TREE_CODE (op1) == STRING_CST || TREE_CODE (op2) == STRING_CST || JSTRING_TYPE_P (op1_type) || JSTRING_TYPE_P (op2_type) *************** patch_binop (node, wfl_op1, wfl_op2) *** 16916,16922 **** lang_printable_name (op2_type, 0)); else parse_error_context (wfl_operator, ! "Incompatible type for `%s'. Can't convert shift distance from `%s' to integral", operator_string (node), lang_printable_name (op2_type, 0)); } --- 16535,16541 ---- lang_printable_name (op2_type, 0)); else parse_error_context (wfl_operator, ! "Incompatible type for `%s'. Can't convert shift distance from `%s' to integral", operator_string (node), lang_printable_name (op2_type, 0)); } *************** patch_binop (node, wfl_op1, wfl_op2) *** 16930,16952 **** op1 = do_unary_numeric_promotion (op1); op2 = do_unary_numeric_promotion (op2); /* The type of the shift expression is the type of the promoted type of the left-hand operand */ prom_type = TREE_TYPE (op1); /* Shift int only up to 0x1f and long up to 0x3f */ if (prom_type == int_type_node) ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x1f, 0))); else ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x3f, 0))); /* The >>> operator is a >> operating on unsigned quantities */ if (code == URSHIFT_EXPR && ! flag_emit_class_files) { tree to_return; ! tree utype = unsigned_type (prom_type); op1 = convert (utype, op1); TREE_SET_CODE (node, RSHIFT_EXPR); TREE_OPERAND (node, 0) = op1; --- 16549,16576 ---- op1 = do_unary_numeric_promotion (op1); op2 = do_unary_numeric_promotion (op2); + /* If the right hand side is of type `long', first cast it to + `int'. */ + if (TREE_TYPE (op2) == long_type_node) + op2 = build1 (CONVERT_EXPR, int_type_node, op2); + /* The type of the shift expression is the type of the promoted type of the left-hand operand */ prom_type = TREE_TYPE (op1); /* Shift int only up to 0x1f and long up to 0x3f */ if (prom_type == int_type_node) ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x1f, 0))); else ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x3f, 0))); /* The >>> operator is a >> operating on unsigned quantities */ if (code == URSHIFT_EXPR && ! flag_emit_class_files) { tree to_return; ! tree utype = java_unsigned_type (prom_type); op1 = convert (utype, op1); TREE_SET_CODE (node, RSHIFT_EXPR); TREE_OPERAND (node, 0) = op1; *************** patch_binop (node, wfl_op1, wfl_op2) *** 16966,16971 **** --- 16590,16604 ---- TREE_TYPE (node) = boolean_type_node; + /* OP1_TYPE might be NULL when OP1 is a string constant. */ + if ((cn = patch_string (op1))) + { + op1 = cn; + op1_type = TREE_TYPE (op1); + } + if (op1_type == NULL_TREE) + abort (); + if (!(op2_type = resolve_type_during_patch (op2))) return error_mark_node; *************** patch_binop (node, wfl_op1, wfl_op2) *** 17004,17016 **** { char *t1 = xstrdup (lang_printable_name (op1_type, 0)); SET_WFL_OPERATOR (wfl_operator, node, wfl_op1); ! parse_error_context (wfl_operator, "Impossible for `%s' to be instance of `%s'", t1, lang_printable_name (op2_type, 0)); free (t1); error_found = 1; } ! break; /* 15.21 Bitwise and Logical Operators */ --- 16637,16649 ---- { char *t1 = xstrdup (lang_printable_name (op1_type, 0)); SET_WFL_OPERATOR (wfl_operator, node, wfl_op1); ! parse_error_context (wfl_operator, "Impossible for `%s' to be instance of `%s'", t1, lang_printable_name (op2_type, 0)); free (t1); error_found = 1; } ! break; /* 15.21 Bitwise and Logical Operators */ *************** patch_binop (node, wfl_op1, wfl_op2) *** 17022,17028 **** expression retain that type */ prom_type = binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op1_type) == BOOLEAN_TYPE) /* The type of the bitwise operator expression is BOOLEAN */ prom_type = boolean_type_node; --- 16655,16661 ---- expression retain that type */ prom_type = binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op1_type) == BOOLEAN_TYPE) /* The type of the bitwise operator expression is BOOLEAN */ prom_type = boolean_type_node; *************** patch_binop (node, wfl_op1, wfl_op2) *** 17044,17050 **** /* 15.23 Conditional-Or Operator */ case TRUTH_ORIF_EXPR: /* Operands must be of BOOLEAN type */ ! if (TREE_CODE (op1_type) != BOOLEAN_TYPE || TREE_CODE (op2_type) != BOOLEAN_TYPE) { if (TREE_CODE (op1_type) != BOOLEAN_TYPE) --- 16677,16683 ---- /* 15.23 Conditional-Or Operator */ case TRUTH_ORIF_EXPR: /* Operands must be of BOOLEAN type */ ! if (TREE_CODE (op1_type) != BOOLEAN_TYPE || TREE_CODE (op2_type) != BOOLEAN_TYPE) { if (TREE_CODE (op1_type) != BOOLEAN_TYPE) *************** patch_binop (node, wfl_op1, wfl_op2) *** 17094,17141 **** case EQ_EXPR: case NE_EXPR: /* It's time for us to patch the strings. */ ! if ((cn = patch_string (op1))) { op1 = cn; op1_type = TREE_TYPE (op1); } ! if ((cn = patch_string (op2))) { op2 = cn; op2_type = TREE_TYPE (op2); } ! /* 15.20.1 Numerical Equality Operators == and != */ /* Binary numeric promotion is performed on the operands */ if (JNUMERIC_TYPE_P (op1_type) && JNUMERIC_TYPE_P (op2_type)) binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! /* 15.20.2 Boolean Equality Operators == and != */ else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op2_type) == BOOLEAN_TYPE) ; /* Nothing to do here */ ! /* 15.20.3 Reference Equality Operators == and != */ /* Types have to be either references or the null type. If they're references, it must be possible to convert either type to the other by casting conversion. */ ! else if (op1 == null_pointer_node || op2 == null_pointer_node || (JREFERENCE_TYPE_P (op1_type) && JREFERENCE_TYPE_P (op2_type) && (valid_ref_assignconv_cast_p (op1_type, op2_type, 1) ! || valid_ref_assignconv_cast_p (op2_type, op1_type, 1)))) ; /* Nothing to do here */ ! /* Else we have an error figure what can't be converted into what and report the error */ else { char *t1; t1 = xstrdup (lang_printable_name (op1_type, 0)); ! parse_error_context (wfl_operator, "Incompatible type for `%s'. Can't convert `%s' to `%s'", ! operator_string (node), t1, lang_printable_name (op2_type, 0)); free (t1); TREE_TYPE (node) = boolean_type_node; --- 16727,16774 ---- case EQ_EXPR: case NE_EXPR: /* It's time for us to patch the strings. */ ! if ((cn = patch_string (op1))) { op1 = cn; op1_type = TREE_TYPE (op1); } ! if ((cn = patch_string (op2))) { op2 = cn; op2_type = TREE_TYPE (op2); } ! /* 15.20.1 Numerical Equality Operators == and != */ /* Binary numeric promotion is performed on the operands */ if (JNUMERIC_TYPE_P (op1_type) && JNUMERIC_TYPE_P (op2_type)) binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! /* 15.20.2 Boolean Equality Operators == and != */ else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op2_type) == BOOLEAN_TYPE) ; /* Nothing to do here */ ! /* 15.20.3 Reference Equality Operators == and != */ /* Types have to be either references or the null type. If they're references, it must be possible to convert either type to the other by casting conversion. */ ! else if (op1 == null_pointer_node || op2 == null_pointer_node || (JREFERENCE_TYPE_P (op1_type) && JREFERENCE_TYPE_P (op2_type) && (valid_ref_assignconv_cast_p (op1_type, op2_type, 1) ! || valid_ref_assignconv_cast_p (op2_type, op1_type, 1)))) ; /* Nothing to do here */ ! /* Else we have an error figure what can't be converted into what and report the error */ else { char *t1; t1 = xstrdup (lang_printable_name (op1_type, 0)); ! parse_error_context (wfl_operator, "Incompatible type for `%s'. Can't convert `%s' to `%s'", ! operator_string (node), t1, lang_printable_name (op2_type, 0)); free (t1); TREE_TYPE (node) = boolean_type_node; *************** patch_binop (node, wfl_op1, wfl_op2) *** 17155,17161 **** TREE_OPERAND (node, 1) = op2; TREE_TYPE (node) = prom_type; TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2); ! if (flag_emit_xref) return node; --- 16788,16794 ---- TREE_OPERAND (node, 1) = op2; TREE_TYPE (node) = prom_type; TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2); ! if (flag_emit_xref) return node; *************** do_merge_string_cste (cste, string, stri *** 17198,17239 **** } /* Tries to merge OP1 (a STRING_CST) and OP2 (if suitable). Return a ! new STRING_CST on success, NULL_TREE on failure */ static tree merge_string_cste (op1, op2, after) tree op1, op2; int after; { ! /* Handle two string constants right away */ if (TREE_CODE (op2) == STRING_CST) ! return do_merge_string_cste (op1, TREE_STRING_POINTER (op2), TREE_STRING_LENGTH (op2), after); ! ! /* Reasonable integer constant can be treated right away */ if (TREE_CODE (op2) == INTEGER_CST && !TREE_CONSTANT_OVERFLOW (op2)) { static const char *const boolean_true = "true"; static const char *const boolean_false = "false"; static const char *const null_pointer = "null"; ! char ch[3]; const char *string; ! if (op2 == boolean_true_node) string = boolean_true; else if (op2 == boolean_false_node) string = boolean_false; else if (op2 == null_pointer_node) string = null_pointer; else if (TREE_TYPE (op2) == char_type_node) { ! ch[0] = (char )TREE_INT_CST_LOW (op2); ! ch[1] = '\0'; string = ch; } else ! string = print_int_node (op2); ! return do_merge_string_cste (op1, string, strlen (string), after); } return NULL_TREE; --- 16831,16891 ---- } /* Tries to merge OP1 (a STRING_CST) and OP2 (if suitable). Return a ! new STRING_CST on success, NULL_TREE on failure. */ static tree merge_string_cste (op1, op2, after) tree op1, op2; int after; { ! /* Handle two string constants right away. */ if (TREE_CODE (op2) == STRING_CST) ! return do_merge_string_cste (op1, TREE_STRING_POINTER (op2), TREE_STRING_LENGTH (op2), after); ! ! /* Reasonable integer constant can be treated right away. */ if (TREE_CODE (op2) == INTEGER_CST && !TREE_CONSTANT_OVERFLOW (op2)) { static const char *const boolean_true = "true"; static const char *const boolean_false = "false"; static const char *const null_pointer = "null"; ! char ch[4]; const char *string; ! if (op2 == boolean_true_node) string = boolean_true; else if (op2 == boolean_false_node) string = boolean_false; else if (op2 == null_pointer_node) + /* FIXME: null is not a compile-time constant, so it is only safe to + merge if the overall expression is non-constant. However, this + code always merges without checking the overall expression. */ string = null_pointer; else if (TREE_TYPE (op2) == char_type_node) { ! /* Convert the character into UTF-8. */ ! unsigned int c = (unsigned int) TREE_INT_CST_LOW (op2); ! unsigned char *p = (unsigned char *) ch; ! if (0x01 <= c && c <= 0x7f) ! *p++ = (unsigned char) c; ! else if (c < 0x7ff) ! { ! *p++ = (unsigned char) (c >> 6 | 0xc0); ! *p++ = (unsigned char) ((c & 0x3f) | 0x80); ! } ! else ! { ! *p++ = (unsigned char) (c >> 12 | 0xe0); ! *p++ = (unsigned char) (((c >> 6) & 0x3f) | 0x80); ! *p++ = (unsigned char) ((c & 0x3f) | 0x80); ! } ! *p = '\0'; ! string = ch; } else ! string = string_convert_int_cst (op2); ! return do_merge_string_cste (op1, string, strlen (string), after); } return NULL_TREE; *************** string_constant_concatenation (op1, op2) *** 17255,17265 **** { tree string, rest; int invert; ! string = (TREE_CODE (op1) == STRING_CST ? op1 : op2); rest = (string == op1 ? op2 : op1); invert = (string == op1 ? 0 : 1 ); ! /* Walk REST, only if it looks reasonable */ if (TREE_CODE (rest) != STRING_CST && !IS_CRAFTED_STRING_BUFFER_P (rest) --- 16907,16917 ---- { tree string, rest; int invert; ! string = (TREE_CODE (op1) == STRING_CST ? op1 : op2); rest = (string == op1 ? op2 : op1); invert = (string == op1 ? 0 : 1 ); ! /* Walk REST, only if it looks reasonable */ if (TREE_CODE (rest) != STRING_CST && !IS_CRAFTED_STRING_BUFFER_P (rest) *************** build_string_concatenation (op1, op2) *** 17291,17297 **** if (flag_emit_xref) return build (PLUS_EXPR, string_type_node, op1, op2); ! /* Try to do some static optimization */ if ((result = string_constant_concatenation (op1, op2))) return result; --- 16943,16949 ---- if (flag_emit_xref) return build (PLUS_EXPR, string_type_node, op1, op2); ! /* Try to do some static optimization */ if ((result = string_constant_concatenation (op1, op2))) return result; *************** build_string_concatenation (op1, op2) *** 17312,17326 **** op2 = patch_string_cst (op2); /* If either one of the constant is null and the other non null ! operand is a String object, return it. */ ! if (JSTRING_TYPE_P (TREE_TYPE (op1)) && !op2) return op1; /* If OP1 isn't already a StringBuffer, create and initialize a new one */ if (!IS_CRAFTED_STRING_BUFFER_P (op1)) { ! /* Two solutions here: 1) OP1 is a constant string reference, we call new StringBuffer(OP1) 2) OP1 is something else, we call new StringBuffer().append(OP1). */ if (TREE_CONSTANT (op1) && JSTRING_TYPE_P (TREE_TYPE (op1))) --- 16964,16978 ---- op2 = patch_string_cst (op2); /* If either one of the constant is null and the other non null ! operand is a String constant, return it. */ ! if ((TREE_CODE (op1) == STRING_CST) && !op2) return op1; /* If OP1 isn't already a StringBuffer, create and initialize a new one */ if (!IS_CRAFTED_STRING_BUFFER_P (op1)) { ! /* Two solutions here: 1) OP1 is a constant string reference, we call new StringBuffer(OP1) 2) OP1 is something else, we call new StringBuffer().append(OP1). */ if (TREE_CONSTANT (op1) && JSTRING_TYPE_P (TREE_TYPE (op1))) *************** build_incdec (op_token, op_location, op1 *** 17431,17449 **** tree op1; int is_post_p; { ! static const enum tree_code lookup [2][2] = { { PREDECREMENT_EXPR, PREINCREMENT_EXPR, }, { POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, }, }; ! tree node = build (lookup [is_post_p][(op_token - DECR_TK)], NULL_TREE, op1, NULL_TREE); TREE_SIDE_EFFECTS (node) = 1; /* Store the location of the operator, for better error report. The string of the operator will be rebuild based on the OP value. */ EXPR_WFL_LINECOL (node) = op_location; return node; ! } /* Build an incomplete cast operator, based on the use of the CONVERT_EXPR. Note that TREE_TYPE of the constructed node is --- 17083,17101 ---- tree op1; int is_post_p; { ! static const enum tree_code lookup [2][2] = { { PREDECREMENT_EXPR, PREINCREMENT_EXPR, }, { POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, }, }; ! tree node = build (lookup [is_post_p][(op_token - DECR_TK)], NULL_TREE, op1, NULL_TREE); TREE_SIDE_EFFECTS (node) = 1; /* Store the location of the operator, for better error report. The string of the operator will be rebuild based on the OP value. */ EXPR_WFL_LINECOL (node) = op_location; return node; ! } /* Build an incomplete cast operator, based on the use of the CONVERT_EXPR. Note that TREE_TYPE of the constructed node is *************** patch_incomplete_class_ref (node) *** 17482,17488 **** if (!(ref_type = resolve_type_during_patch (type))) return error_mark_node; ! if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type)) { tree dot = build_class_ref (ref_type); /* A class referenced by `foo.class' is initialized. */ --- 17134,17141 ---- if (!(ref_type = resolve_type_during_patch (type))) return error_mark_node; ! if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type) ! || TREE_CODE (ref_type) == VOID_TYPE) { tree dot = build_class_ref (ref_type); /* A class referenced by `foo.class' is initialized. */ *************** patch_unaryop (node, wfl_op) *** 17544,17550 **** decl = DECL_FUNCTION_ACCESS_DECL (decl); } /* We really should have a JAVA_ARRAY_EXPR to avoid this */ ! else if (!JDECL_P (decl) && TREE_CODE (decl) != COMPONENT_REF && !(flag_emit_class_files && TREE_CODE (decl) == ARRAY_REF) && TREE_CODE (decl) != INDIRECT_REF --- 17197,17203 ---- decl = DECL_FUNCTION_ACCESS_DECL (decl); } /* We really should have a JAVA_ARRAY_EXPR to avoid this */ ! else if (!JDECL_P (decl) && TREE_CODE (decl) != COMPONENT_REF && !(flag_emit_class_files && TREE_CODE (decl) == ARRAY_REF) && TREE_CODE (decl) != INDIRECT_REF *************** patch_unaryop (node, wfl_op) *** 17555,17561 **** TREE_TYPE (node) = error_mark_node; error_found = 1; } ! /* From now on, we know that op if a variable and that it has a valid wfl. We use wfl_op to locate errors related to the ++/-- operand. */ --- 17208,17214 ---- TREE_TYPE (node) = error_mark_node; error_found = 1; } ! /* From now on, we know that op if a variable and that it has a valid wfl. We use wfl_op to locate errors related to the ++/-- operand. */ *************** patch_unaryop (node, wfl_op) *** 17579,17586 **** else { value = build_int_2 (1, 0); ! TREE_TYPE (node) = ! binary_numeric_promotion (op_type, TREE_TYPE (value), &op, &value); } --- 17232,17239 ---- else { value = build_int_2 (1, 0); ! TREE_TYPE (node) = ! binary_numeric_promotion (op_type, TREE_TYPE (value), &op, &value); } *************** patch_unaryop (node, wfl_op) *** 17588,17597 **** if (outer_field_flag) { /* We re-generate an access to the field */ ! value = build (PLUS_EXPR, TREE_TYPE (op), build_outer_field_access (wfl_op, decl), value); ! ! /* And we patch the original access$() into a write with plus_op as a rhs */ return outer_field_access_fix (node, op, value); } --- 17241,17250 ---- if (outer_field_flag) { /* We re-generate an access to the field */ ! value = build (PLUS_EXPR, TREE_TYPE (op), build_outer_field_access (wfl_op, decl), value); ! ! /* And we patch the original access$() into a write with plus_op as a rhs */ return outer_field_access_fix (node, op, value); } *************** patch_unaryop (node, wfl_op) *** 17676,17682 **** } break; } ! if (error_found) return error_mark_node; --- 17329,17335 ---- } break; } ! if (error_found) return error_mark_node; *************** resolve_type_during_patch (type) *** 17702,17708 **** tree type_decl = resolve_and_layout (EXPR_WFL_NODE (type), type); if (!type_decl) { ! parse_error_context (type, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (type))); return NULL_TREE; --- 17355,17361 ---- tree type_decl = resolve_and_layout (EXPR_WFL_NODE (type), type); if (!type_decl) { ! parse_error_context (type, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (type))); return NULL_TREE; *************** patch_cast (node, wfl_op) *** 17761,17767 **** /* The remaining legal casts involve conversion between reference types. Check for their compile time correctness. */ ! if (JREFERENCE_TYPE_P (op_type) && JREFERENCE_TYPE_P (cast_type) && valid_ref_assignconv_cast_p (op_type, cast_type, 1)) { TREE_TYPE (node) = promote_type (cast_type); --- 17414,17420 ---- /* The remaining legal casts involve conversion between reference types. Check for their compile time correctness. */ ! if (JREFERENCE_TYPE_P (op_type) && JREFERENCE_TYPE_P (cast_type) && valid_ref_assignconv_cast_p (op_type, cast_type, 1)) { TREE_TYPE (node) = promote_type (cast_type); *************** patch_array_ref (node) *** 17840,17846 **** /* The array reference must be an array */ if (!TYPE_ARRAY_P (array_type)) { ! parse_error_context (wfl_operator, "`[]' can only be applied to arrays. It can't be applied to `%s'", lang_printable_name (array_type, 0)); --- 17493,17499 ---- /* The array reference must be an array */ if (!TYPE_ARRAY_P (array_type)) { ! parse_error_context (wfl_operator, "`[]' can only be applied to arrays. It can't be applied to `%s'", lang_printable_name (array_type, 0)); *************** build_newarray_node (type, dims, extra_d *** 17890,17896 **** int extra_dims; { tree node = ! build (NEW_ARRAY_EXPR, NULL_TREE, type, nreverse (dims), build_int_2 (extra_dims, 0)); return node; } --- 17543,17549 ---- int extra_dims; { tree node = ! build (NEW_ARRAY_EXPR, NULL_TREE, type, nreverse (dims), build_int_2 (extra_dims, 0)); return node; } *************** patch_newarray (node) *** 17932,17940 **** /* Report errors on types here */ if (dim_error) { ! parse_error_context ! (TREE_PURPOSE (cdim), ! "Incompatible type for dimension in array creation expression. %s convert `%s' to `int'", (valid_cast_to_p (TREE_TYPE (dim), int_type_node) ? "Explicit cast needed to" : "Can't"), lang_printable_name (TREE_TYPE (dim), 0)); --- 17585,17593 ---- /* Report errors on types here */ if (dim_error) { ! parse_error_context ! (TREE_PURPOSE (cdim), ! "Incompatible type for dimension in array creation expression. %s convert `%s' to `int'", (valid_cast_to_p (TREE_TYPE (dim), int_type_node) ? "Explicit cast needed to" : "Can't"), lang_printable_name (TREE_TYPE (dim), 0)); *************** patch_newarray (node) *** 17983,17995 **** (primitive or not) matters. */ if (ndims == 1) return build_new_array (type, TREE_VALUE (dims)); ! /* Can't reuse what's already written in expr.c because it uses the JVM stack representation. Provide a build_multianewarray. FIXME */ return build (CALL_EXPR, array_type, build_address_of (soft_multianewarray_node), tree_cons (NULL_TREE, build_class_ref (TREE_TYPE (array_type)), ! tree_cons (NULL_TREE, build_int_2 (ndims, 0), dims )), NULL_TREE); } --- 17636,17648 ---- (primitive or not) matters. */ if (ndims == 1) return build_new_array (type, TREE_VALUE (dims)); ! /* Can't reuse what's already written in expr.c because it uses the JVM stack representation. Provide a build_multianewarray. FIXME */ return build (CALL_EXPR, array_type, build_address_of (soft_multianewarray_node), tree_cons (NULL_TREE, build_class_ref (TREE_TYPE (array_type)), ! tree_cons (NULL_TREE, build_int_2 (ndims, 0), dims )), NULL_TREE); } *************** patch_new_array_init (type, node) *** 18070,18076 **** TREE_PURPOSE (current) = NULL_TREE; all_constant = 0; } ! if (elt && TREE_CODE (elt) == TREE_LIST && TREE_VALUE (elt) == error_mark_node) error_seen = 1; } --- 17723,17729 ---- TREE_PURPOSE (current) = NULL_TREE; all_constant = 0; } ! if (elt && TREE_CODE (elt) == TREE_LIST && TREE_VALUE (elt) == error_mark_node) error_seen = 1; } *************** array_constructor_check_entry (type, ent *** 18110,18118 **** value = patched; if (value == error_mark_node) return 1; ! type_value = TREE_TYPE (value); ! /* At anytime, try_builtin_assignconv can report a warning on constant overflow during narrowing. */ SET_WFL_OPERATOR (wfl_operator, TREE_PURPOSE (entry), wfl_value); --- 17763,17771 ---- value = patched; if (value == error_mark_node) return 1; ! type_value = TREE_TYPE (value); ! /* At anytime, try_builtin_assignconv can report a warning on constant overflow during narrowing. */ SET_WFL_OPERATOR (wfl_operator, TREE_PURPOSE (entry), wfl_value); *************** array_constructor_check_entry (type, ent *** 18127,18138 **** "Can't" : "Explicit cast needed to"); if (!array_type_string) array_type_string = xstrdup (lang_printable_name (type, 1)); ! parse_error_context (wfl_operator, "Incompatible type for array. %s convert `%s' to `%s'", msg, lang_printable_name (type_value, 1), array_type_string); error_seen = 1; } ! if (new_value) TREE_VALUE (entry) = new_value; --- 17780,17791 ---- "Can't" : "Explicit cast needed to"); if (!array_type_string) array_type_string = xstrdup (lang_printable_name (type, 1)); ! parse_error_context (wfl_operator, "Incompatible type for array. %s convert `%s' to `%s'", msg, lang_printable_name (type_value, 1), array_type_string); error_seen = 1; } ! if (new_value) TREE_VALUE (entry) = new_value; *************** patch_return (node) *** 18193,18199 **** isn't declared with the keyword `void' */ if (!return_exp && (mtype != void_type_node && !DECL_CONSTRUCTOR_P (meth))) error_found = 2; ! if (DECL_INSTINIT_P (current_function_decl)) error_found = 1; --- 17846,17852 ---- isn't declared with the keyword `void' */ if (!return_exp && (mtype != void_type_node && !DECL_CONSTRUCTOR_P (meth))) error_found = 2; ! if (DECL_INSTINIT_P (current_function_decl)) error_found = 1; *************** patch_return (node) *** 18202,18208 **** if (DECL_INSTINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside instance initializer"); ! else if (DECL_CLINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside static initializer"); --- 17855,17861 ---- if (DECL_INSTINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside instance initializer"); ! else if (DECL_CLINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside static initializer"); *************** patch_return (node) *** 18210,18223 **** else if (!DECL_CONSTRUCTOR_P (meth)) { char *t = xstrdup (lang_printable_name (mtype, 0)); ! parse_error_context (wfl_operator, "`return' with%s value from `%s %s'", ! (error_found == 1 ? "" : "out"), t, lang_printable_name (meth, 0)); free (t); } else ! parse_error_context (wfl_operator, "`return' with value from constructor `%s'", lang_printable_name (meth, 0)); return error_mark_node; --- 17863,17876 ---- else if (!DECL_CONSTRUCTOR_P (meth)) { char *t = xstrdup (lang_printable_name (mtype, 0)); ! parse_error_context (wfl_operator, "`return' with%s value from `%s %s'", ! (error_found == 1 ? "" : "out"), t, lang_printable_name (meth, 0)); free (t); } else ! parse_error_context (wfl_operator, "`return' with value from constructor `%s'", lang_printable_name (meth, 0)); return error_mark_node; *************** patch_return (node) *** 18233,18239 **** if ((patched = patch_string (exp))) exp = patched; ! modify = build (MODIFY_EXPR, NULL_TREE, DECL_RESULT (meth), exp); EXPR_WFL_LINECOL (modify) = EXPR_WFL_LINECOL (node); modify = java_complete_tree (modify); --- 17886,17892 ---- if ((patched = patch_string (exp))) exp = patched; ! modify = build (MODIFY_EXPR, NULL_TREE, DECL_RESULT (meth), exp); EXPR_WFL_LINECOL (modify) = EXPR_WFL_LINECOL (node); modify = java_complete_tree (modify); *************** patch_if_else_statement (node) *** 18283,18295 **** if (TREE_TYPE (expression) != boolean_type_node && TREE_TYPE (expression) != promoted_boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for `if'. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } ! if (TREE_CODE (expression) == INTEGER_CST) { if (integer_zerop (expression)) --- 17936,17948 ---- if (TREE_TYPE (expression) != boolean_type_node && TREE_TYPE (expression) != promoted_boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for `if'. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } ! if (TREE_CODE (expression) == INTEGER_CST) { if (integer_zerop (expression)) *************** build_labeled_block (location, label) *** 18335,18341 **** parse_error_context (wfl_operator, "Declaration of `%s' shadows a previous label declaration", IDENTIFIER_POINTER (label)); ! EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (IDENTIFIER_LOCAL_VALUE (label_name)); parse_error_context (wfl_operator, "This is the location of the previous declaration of label `%s'", --- 17988,17994 ---- parse_error_context (wfl_operator, "Declaration of `%s' shadows a previous label declaration", IDENTIFIER_POINTER (label)); ! EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (IDENTIFIER_LOCAL_VALUE (label_name)); parse_error_context (wfl_operator, "This is the location of the previous declaration of label `%s'", *************** build_new_loop (loop_body) *** 18385,18395 **** COMPOUND_EXPR (loop main body) EXIT_EXPR (this order is for while/for loops. LABELED_BLOCK_EXPR the order is reversed for do loops) ! LABEL_DECL (a continue occurring here branches at the BODY end of this labeled block) INCREMENT (if any) ! REVERSED, if non zero, tells that the loop condition expr comes after the body, like in the do-while loop. To obtain a loop, the loop body structure described above is --- 18038,18048 ---- COMPOUND_EXPR (loop main body) EXIT_EXPR (this order is for while/for loops. LABELED_BLOCK_EXPR the order is reversed for do loops) ! LABEL_DECL (a continue occurring here branches at the BODY end of this labeled block) INCREMENT (if any) ! REVERSED, if nonzero, tells that the loop condition expr comes after the body, like in the do-while loop. To obtain a loop, the loop body structure described above is *************** build_loop_body (location, condition, re *** 18416,18423 **** body = build_labeled_block (0, continue_identifier_node); first = (reversed ? body : condition); second = (reversed ? condition : body); ! return ! build (COMPOUND_EXPR, NULL_TREE, build (COMPOUND_EXPR, NULL_TREE, first, second), empty_stmt_node); } --- 18069,18076 ---- body = build_labeled_block (0, continue_identifier_node); first = (reversed ? body : condition); second = (reversed ? condition : body); ! return ! build (COMPOUND_EXPR, NULL_TREE, build (COMPOUND_EXPR, NULL_TREE, first, second), empty_stmt_node); } *************** finish_for_loop (location, condition, up *** 18459,18465 **** /* Put the condition and the loop body in place */ tree loop = finish_loop_body (location, condition, body, 0); /* LOOP is the current loop which has been now popped of the loop ! stack. Install the update block */ LOOP_EXPR_BODY_UPDATE_BLOCK (LOOP_EXPR_BODY (loop)) = update; return loop; } --- 18112,18138 ---- /* Put the condition and the loop body in place */ tree loop = finish_loop_body (location, condition, body, 0); /* LOOP is the current loop which has been now popped of the loop ! stack. Mark the update block as reachable and install it. We do ! this because the (current interpretation of the) JLS requires ! that the update expression be considered reachable even if the ! for loop's body doesn't complete normally. */ ! if (update != NULL_TREE && update != empty_stmt_node) ! { ! tree up2 = update; ! if (TREE_CODE (up2) == EXPR_WITH_FILE_LOCATION) ! up2 = EXPR_WFL_NODE (up2); ! /* It is possible for the update expression to be an ! EXPR_WFL_NODE wrapping nothing. */ ! if (up2 != NULL_TREE && up2 != empty_stmt_node) ! { ! /* Try to detect constraint violations. These would be ! programming errors somewhere. */ ! if (! IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (up2))) ! || TREE_CODE (up2) == LOOP_EXPR) ! abort (); ! SUPPRESS_UNREACHABLE_ERROR (up2) = 1; ! } ! } LOOP_EXPR_BODY_UPDATE_BLOCK (LOOP_EXPR_BODY (loop)) = update; return loop; } *************** build_bc_statement (location, is_break, *** 18546,18552 **** if (name) { ! if (!(label_block_expr = IDENTIFIER_LOCAL_VALUE (merge_qualified_name (label_id, EXPR_WFL_NODE (name))))) /* Null means that we don't have a target for this named break/continue. In this case, we make the target to be the --- 18219,18225 ---- if (name) { ! if (!(label_block_expr = IDENTIFIER_LOCAL_VALUE (merge_qualified_name (label_id, EXPR_WFL_NODE (name))))) /* Null means that we don't have a target for this named break/continue. In this case, we make the target to be the *************** build_bc_statement (location, is_break, *** 18556,18562 **** } /* Unlabeled break/continue will be handled during the break/continue patch operation */ ! break_continue = build (EXIT_BLOCK_EXPR, NULL_TREE, label_block_expr, NULL_TREE); IS_BREAK_STMT_P (break_continue) = is_break; --- 18229,18235 ---- } /* Unlabeled break/continue will be handled during the break/continue patch operation */ ! break_continue = build (EXIT_BLOCK_EXPR, NULL_TREE, label_block_expr, NULL_TREE); IS_BREAK_STMT_P (break_continue) = is_break; *************** patch_bc_statement (node) *** 18575,18581 **** tree bc_label = EXIT_BLOCK_LABELED_BLOCK (node), target_stmt; tree labeled_block = ctxp->current_labeled_block; EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! /* Having an identifier here means that the target is unknown. */ if (bc_label != NULL_TREE && TREE_CODE (bc_label) == IDENTIFIER_NODE) { --- 18248,18254 ---- tree bc_label = EXIT_BLOCK_LABELED_BLOCK (node), target_stmt; tree labeled_block = ctxp->current_labeled_block; EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! /* Having an identifier here means that the target is unknown. */ if (bc_label != NULL_TREE && TREE_CODE (bc_label) == IDENTIFIER_NODE) { *************** patch_bc_statement (node) *** 18594,18600 **** parse_error_context (wfl_operator, "`continue' must be in loop"); else ! parse_error_context (wfl_operator, "continue label `%s' does not name a loop", IDENTIFIER_POINTER (bc_label)); return error_mark_node; --- 18267,18273 ---- parse_error_context (wfl_operator, "`continue' must be in loop"); else ! parse_error_context (wfl_operator, "continue label `%s' does not name a loop", IDENTIFIER_POINTER (bc_label)); return error_mark_node; *************** patch_bc_statement (node) *** 18610,18616 **** } } else if (!bc_label) ! { for (;; labeled_block = TREE_CHAIN (labeled_block)) { if (labeled_block == NULL_TREE) --- 18283,18289 ---- } } else if (!bc_label) ! { for (;; labeled_block = TREE_CHAIN (labeled_block)) { if (labeled_block == NULL_TREE) *************** patch_exit_expr (node) *** 18656,18670 **** /* The type of expression must be boolean */ if (TREE_TYPE (expression) != boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for loop conditional. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } /* Now we know things are allright, invert the condition, fold and return */ ! TREE_OPERAND (node, 0) = fold (build1 (TRUTH_NOT_EXPR, boolean_type_node, expression)); if (! integer_zerop (TREE_OPERAND (node, 0)) --- 18329,18343 ---- /* The type of expression must be boolean */ if (TREE_TYPE (expression) != boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for loop conditional. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } /* Now we know things are allright, invert the condition, fold and return */ ! TREE_OPERAND (node, 0) = fold (build1 (TRUTH_NOT_EXPR, boolean_type_node, expression)); if (! integer_zerop (TREE_OPERAND (node, 0)) *************** patch_switch_statement (node) *** 18750,18760 **** TREE_TYPE (node) = void_type_node; TREE_SIDE_EFFECTS (node) = 1; CAN_COMPLETE_NORMALLY (node) ! = CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 1)) || ! SWITCH_HAS_DEFAULT (node); return node; } /* 14.18 The try/catch statements */ /* Encapsulate TRY_STMTS' in a try catch sequence. The catch clause --- 18423,18511 ---- TREE_TYPE (node) = void_type_node; TREE_SIDE_EFFECTS (node) = 1; CAN_COMPLETE_NORMALLY (node) ! = CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 1)) || ! SWITCH_HAS_DEFAULT (node); return node; } + /* Assertions. */ + + /* Build an assertion expression for `assert CONDITION : VALUE'; VALUE + might be NULL_TREE. */ + static tree + build_assertion (location, condition, value) + int location; + tree condition, value; + { + tree node; + tree klass = GET_CPC (); + + if (! CLASS_USES_ASSERTIONS (klass)) + { + tree field, classdollar, id, call; + tree class_type = TREE_TYPE (klass); + + field = add_field (class_type, + get_identifier ("$assertionsDisabled"), + boolean_type_node, + ACC_PRIVATE | ACC_STATIC | ACC_FINAL); + MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (field); + FIELD_SYNTHETIC (field) = 1; + + if (!TYPE_DOT_CLASS (class_type)) + build_dot_class_method (class_type); + classdollar = build_dot_class_method_invocation (class_type); + + /* Call CLASS.desiredAssertionStatus(). */ + id = build_wfl_node (get_identifier ("desiredAssertionStatus")); + call = build (CALL_EXPR, NULL_TREE, id, NULL_TREE, NULL_TREE); + call = make_qualified_primary (classdollar, call, location); + TREE_SIDE_EFFECTS (call) = 1; + + /* Invert to obtain !CLASS.desiredAssertionStatus(). This may + seem odd, but we do it to generate code identical to that of + the JDK. */ + call = build1 (TRUTH_NOT_EXPR, NULL_TREE, call); + TREE_SIDE_EFFECTS (call) = 1; + DECL_INITIAL (field) = call; + + /* Record the initializer in the initializer statement list. */ + call = build (MODIFY_EXPR, NULL_TREE, field, call); + TREE_CHAIN (call) = CPC_STATIC_INITIALIZER_STMT (ctxp); + SET_CPC_STATIC_INITIALIZER_STMT (ctxp, call); + MODIFY_EXPR_FROM_INITIALIZATION_P (call) = 1; + + CLASS_USES_ASSERTIONS (klass) = 1; + } + + if (value != NULL_TREE) + value = tree_cons (NULL_TREE, value, NULL_TREE); + + node = build_wfl_node (get_identifier ("java")); + node = make_qualified_name (node, build_wfl_node (get_identifier ("lang")), + location); + node = make_qualified_name (node, build_wfl_node (get_identifier ("AssertionError")), + location); + + node = build (NEW_CLASS_EXPR, NULL_TREE, node, value, NULL_TREE); + TREE_SIDE_EFFECTS (node) = 1; + /* It is too early to use BUILD_THROW. */ + node = build1 (THROW_EXPR, NULL_TREE, node); + TREE_SIDE_EFFECTS (node) = 1; + + /* We invert the condition; if we just put NODE as the `else' part + then we generate weird-looking bytecode. */ + condition = build1 (TRUTH_NOT_EXPR, NULL_TREE, condition); + /* Check $assertionsDisabled. */ + condition + = build (TRUTH_ANDIF_EXPR, NULL_TREE, + build1 (TRUTH_NOT_EXPR, NULL_TREE, + build_wfl_node (get_identifier ("$assertionsDisabled"))), + condition); + node = build_if_else_statement (location, condition, node, NULL_TREE); + return node; + } + /* 14.18 The try/catch statements */ /* Encapsulate TRY_STMTS' in a try catch sequence. The catch clause *************** encapsulate_with_try_catch (location, ty *** 18771,18781 **** try_block = build_expr_block (try_stmts, NULL_TREE); /* Build a catch block: we need a catch clause parameter */ ! catch_clause_param = build_decl (VAR_DECL, wpv_id, build_pointer_type (type)); /* And a block */ catch_block = build_expr_block (NULL_TREE, catch_clause_param); ! /* Initialize the variable and store in the block */ catch = build (MODIFY_EXPR, NULL_TREE, catch_clause_param, build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); --- 18522,18532 ---- try_block = build_expr_block (try_stmts, NULL_TREE); /* Build a catch block: we need a catch clause parameter */ ! catch_clause_param = build_decl (VAR_DECL, wpv_id, build_pointer_type (type)); /* And a block */ catch_block = build_expr_block (NULL_TREE, catch_clause_param); ! /* Initialize the variable and store in the block */ catch = build (MODIFY_EXPR, NULL_TREE, catch_clause_param, build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); *************** patch_try_statement (node) *** 18846,18852 **** only parameter of the clause statement in of class Throwable or a subclass of Throwable, but that was done earlier. The catch clause parameter type has also been resolved. */ ! /* Just make sure that the catch clause parameter type inherits from java.lang.Throwable */ if (!inherits_from_p (carg_type, throwable_type_node)) --- 18597,18603 ---- only parameter of the clause statement in of class Throwable or a subclass of Throwable, but that was done earlier. The catch clause parameter type has also been resolved. */ ! /* Just make sure that the catch clause parameter type inherits from java.lang.Throwable */ if (!inherits_from_p (carg_type, throwable_type_node)) *************** patch_try_statement (node) *** 18858,18864 **** error_found = 1; continue; } ! /* Partial check for unreachable catch statement: The catch clause is reachable iff is no earlier catch block A in the try statement such that the type of the catch --- 18609,18615 ---- error_found = 1; continue; } ! /* Partial check for unreachable catch statement: The catch clause is reachable iff is no earlier catch block A in the try statement such that the type of the catch *************** patch_try_statement (node) *** 18875,18881 **** if (inherits_from_p (carg_type, TREE_TYPE (TREE_TYPE (decl)))) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (current); ! parse_error_context (wfl_operator, "`catch' not reached because of the catch clause at line %d", EXPR_WFL_LINENO (sub_current)); --- 18626,18632 ---- if (inherits_from_p (carg_type, TREE_TYPE (TREE_TYPE (decl)))) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (current); ! parse_error_context (wfl_operator, "`catch' not reached because of the catch clause at line %d", EXPR_WFL_LINENO (sub_current)); *************** patch_try_statement (node) *** 18911,18917 **** POP_EXCEPTIONS (); /* Verification ends here */ ! if (error_found) return error_mark_node; TREE_OPERAND (node, 0) = try; --- 18662,18668 ---- POP_EXCEPTIONS (); /* Verification ends here */ ! if (error_found) return error_mark_node; TREE_OPERAND (node, 0) = try; *************** patch_synchronized_statement (node, wfl_ *** 18962,18968 **** that the handler that catches all throw exception calls _Jv_MonitorExit and then rethrow the exception. The synchronized statement is then implemented as: ! TRY { _Jv_MonitorEnter (expression) synchronized_block --- 18713,18719 ---- that the handler that catches all throw exception calls _Jv_MonitorExit and then rethrow the exception. The synchronized statement is then implemented as: ! TRY { _Jv_MonitorEnter (expression) synchronized_block *************** patch_throw_statement (node, wfl_op1) *** 19024,19040 **** is explicitly declared in the `throws' clause of each constructor. This doesn't apply to anonymous classes, since they don't have declared constructors. */ ! if (!unchecked_ok && DECL_INSTINIT_P (current_function_decl) && !ANONYMOUS_CLASS_P (current_class)) { tree current; ! for (current = TYPE_METHODS (current_class); current; current = TREE_CHAIN (current)) ! if (DECL_CONSTRUCTOR_P (current) && !check_thrown_exceptions_do (TREE_TYPE (expr))) { ! parse_error_context (wfl_operator, "Checked exception `%s' can't be thrown in instance initializer (not all declared constructor are declaring it in their `throws' clause)", lang_printable_name (TREE_TYPE (expr), 0)); return error_mark_node; } --- 18775,18791 ---- is explicitly declared in the `throws' clause of each constructor. This doesn't apply to anonymous classes, since they don't have declared constructors. */ ! if (!unchecked_ok && DECL_INSTINIT_P (current_function_decl) && !ANONYMOUS_CLASS_P (current_class)) { tree current; ! for (current = TYPE_METHODS (current_class); current; current = TREE_CHAIN (current)) ! if (DECL_CONSTRUCTOR_P (current) && !check_thrown_exceptions_do (TREE_TYPE (expr))) { ! parse_error_context (wfl_operator, "Checked exception `%s' can't be thrown in instance initializer (not all declared constructor are declaring it in their `throws' clause)", lang_printable_name (TREE_TYPE (expr), 0)); return error_mark_node; } *************** patch_throw_statement (node, wfl_op1) *** 19063,19069 **** /* We report that the exception can't be throw from a try block in all circumstances but when the `throw' is inside a static block. */ ! else if (!EXCEPTIONS_P (currently_caught_type_list) && !tryblock_throws_ok) { if (DECL_CLINIT_P (current_function_decl)) --- 18814,18820 ---- /* We report that the exception can't be throw from a try block in all circumstances but when the `throw' is inside a static block. */ ! else if (!EXCEPTIONS_P (currently_caught_type_list) && !tryblock_throws_ok) { if (DECL_CLINIT_P (current_function_decl)) *************** patch_throw_statement (node, wfl_op1) *** 19072,19084 **** lang_printable_name (type, 0)); else parse_error_context (wfl_operator, ! "Checked exception `%s' isn't thrown from a `try' block", lang_printable_name (type, 0)); } /* Otherwise, the current method doesn't have the appropriate throws declaration */ else ! parse_error_context (wfl_operator, "Checked exception `%s' doesn't match any of current method's `throws' declaration(s)", lang_printable_name (type, 0)); return error_mark_node; } --- 18823,18835 ---- lang_printable_name (type, 0)); else parse_error_context (wfl_operator, ! "Checked exception `%s' isn't thrown from a `try' block", lang_printable_name (type, 0)); } /* Otherwise, the current method doesn't have the appropriate throws declaration */ else ! parse_error_context (wfl_operator, "Checked exception `%s' doesn't match any of current method's `throws' declaration(s)", lang_printable_name (type, 0)); return error_mark_node; } *************** check_thrown_exceptions (location, decl) *** 19102,19109 **** { tree throws; /* For all the unchecked exceptions thrown by DECL */ ! for (throws = DECL_FUNCTION_THROWS (decl); throws; ! throws = TREE_CHAIN (throws)) if (!check_thrown_exceptions_do (TREE_VALUE (throws))) { #if 1 --- 18853,18860 ---- { tree throws; /* For all the unchecked exceptions thrown by DECL */ ! for (throws = DECL_FUNCTION_THROWS (decl); throws; ! throws = TREE_CHAIN (throws)) if (!check_thrown_exceptions_do (TREE_VALUE (throws))) { #if 1 *************** check_thrown_exceptions (location, decl) *** 19116,19125 **** parse_error_context (wfl_operator, "Exception `%s' can't be thrown in initializer", lang_printable_name (TREE_VALUE (throws), 0)); ! else { ! parse_error_context ! (wfl_operator, "Exception `%s' must be caught, or it must be declared in the `throws' clause of `%s'", lang_printable_name (TREE_VALUE (throws), 0), (DECL_INIT_P (current_function_decl) ? IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))) : --- 18867,18876 ---- parse_error_context (wfl_operator, "Exception `%s' can't be thrown in initializer", lang_printable_name (TREE_VALUE (throws), 0)); ! else { ! parse_error_context ! (wfl_operator, "Exception `%s' must be caught, or it must be declared in the `throws' clause of `%s'", lang_printable_name (TREE_VALUE (throws), 0), (DECL_INIT_P (current_function_decl) ? IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))) : *************** patch_conditional_expr (node, wfl_cond, *** 19242,19248 **** /* Second and third can be numeric, boolean (i.e. primitive), references or null. Anything else results in an error */ if (!((JNUMERIC_TYPE_P (t1) && JNUMERIC_TYPE_P (t2)) ! || ((JREFERENCE_TYPE_P (t1) || op1 == null_pointer_node) && (JREFERENCE_TYPE_P (t2) || op2 == null_pointer_node)) || (t1 == boolean_type_node && t2 == boolean_type_node))) error_found = 1; --- 18993,18999 ---- /* Second and third can be numeric, boolean (i.e. primitive), references or null. Anything else results in an error */ if (!((JNUMERIC_TYPE_P (t1) && JNUMERIC_TYPE_P (t2)) ! || ((JREFERENCE_TYPE_P (t1) || op1 == null_pointer_node) && (JREFERENCE_TYPE_P (t2) || op2 == null_pointer_node)) || (t1 == boolean_type_node && t2 == boolean_type_node))) error_found = 1; *************** patch_conditional_expr (node, wfl_cond, *** 19274,19282 **** /* Otherwise, binary numeric promotion is applied and the resulting type is the promoted type of operand 1 and 2 */ ! else ! resulting_type = binary_numeric_promotion (t1, t2, ! &TREE_OPERAND (node, 1), &TREE_OPERAND (node, 2)); } --- 19025,19033 ---- /* Otherwise, binary numeric promotion is applied and the resulting type is the promoted type of operand 1 and 2 */ ! else ! resulting_type = binary_numeric_promotion (t1, t2, ! &TREE_OPERAND (node, 1), &TREE_OPERAND (node, 2)); } *************** fold_constant_for_init (node, context) *** 19357,19364 **** switch (code) { - case STRING_CST: case INTEGER_CST: case REAL_CST: return node; --- 19108,19117 ---- switch (code) { case INTEGER_CST: + if (node == null_pointer_node) + return NULL_TREE; + case STRING_CST: case REAL_CST: return node; *************** fold_constant_for_init (node, context) *** 19375,19381 **** case BIT_IOR_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: --- 19128,19134 ---- case BIT_IOR_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: *************** fold_constant_for_init (node, context) *** 19431,19436 **** --- 19184,19191 ---- /* Guard against infinite recursion. */ DECL_INITIAL (node) = NULL_TREE; val = fold_constant_for_init (val, node); + if (val != NULL_TREE && TREE_CODE (val) != STRING_CST) + val = try_builtin_assignconv (NULL_TREE, TREE_TYPE (node), val); DECL_INITIAL (node) = val; return val; *************** fold_constant_for_init (node, context) *** 19446,19452 **** else if (! QUALIFIED_P (name)) { decl = lookup_field_wrapper (DECL_CONTEXT (context), name); ! if (decl == NULL_TREE || (! FIELD_STATIC (decl) && ! FIELD_FINAL (decl))) return NULL_TREE; return fold_constant_for_init (decl, decl); --- 19201,19207 ---- else if (! QUALIFIED_P (name)) { decl = lookup_field_wrapper (DECL_CONTEXT (context), name); ! if (decl == NULL_TREE || (! FIELD_STATIC (decl) && ! FIELD_FINAL (decl))) return NULL_TREE; return fold_constant_for_init (decl, decl); *************** mark_parser_ctxt (p) *** 19514,19526 **** void *p; { struct parser_ctxt *pc = *((struct parser_ctxt **) p); ! int i; if (!pc) return; #ifndef JC1_LITE ! for (i = 0; i < 11; ++i) ggc_mark_tree (pc->modifier_ctx[i]); ggc_mark_tree (pc->class_type); ggc_mark_tree (pc->function_decl); --- 19269,19283 ---- void *p; { struct parser_ctxt *pc = *((struct parser_ctxt **) p); ! #ifndef JC1_LITE ! size_t i; ! #endif if (!pc) return; #ifndef JC1_LITE ! for (i = 0; i < ARRAY_SIZE (pc->modifier_ctx); ++i) ggc_mark_tree (pc->modifier_ctx[i]); ggc_mark_tree (pc->class_type); ggc_mark_tree (pc->function_decl); *************** mark_parser_ctxt (p) *** 19544,19555 **** void init_src_parse () { - /* Register roots with the garbage collector. */ - ggc_add_tree_root (src_parse_roots, sizeof (src_parse_roots) / sizeof(tree)); - /* Sanity check; we've been bit by this before. */ ! if (sizeof (ctxp->modifier_ctx) / sizeof (tree) != ! MODIFIER_TK - PUBLIC_TK) abort (); } --- 19301,19308 ---- void init_src_parse () { /* Sanity check; we've been bit by this before. */ ! if (ARRAY_SIZE (ctxp->modifier_ctx) != MODIFIER_TK - PUBLIC_TK) abort (); } *************** init_src_parse () *** 19560,19575 **** /* Attach to PTR (a block) the declaration found in ENTRY. */ ! static bool attach_init_test_initialization_flags (entry, ptr) ! struct hash_entry *entry; PTR ptr; { tree block = (tree)ptr; ! struct init_test_hash_entry *ite = (struct init_test_hash_entry *) entry; ! ! TREE_CHAIN (ite->init_test_decl) = BLOCK_EXPR_DECLS (block); ! BLOCK_EXPR_DECLS (block) = ite->init_test_decl; return true; } --- 19313,19331 ---- /* Attach to PTR (a block) the declaration found in ENTRY. */ ! static int attach_init_test_initialization_flags (entry, ptr) ! PTR *entry; PTR ptr; { tree block = (tree)ptr; ! struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry; ! ! if (block != error_mark_node) ! { ! TREE_CHAIN (ite->value) = BLOCK_EXPR_DECLS (block); ! BLOCK_EXPR_DECLS (block) = ite->value; ! } return true; } *************** attach_init_test_initialization_flags (e *** 19579,19609 **** initialized static class flags if a flag already existed, otherwise a new one is created. */ ! static bool ! emit_test_initialization (entry, info) ! struct hash_entry *entry; PTR info; { tree l = (tree) info; tree decl, init; ! ! struct init_test_hash_entry *ite = (struct init_test_hash_entry *) ! hash_lookup (&DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ! entry->key, ! current_function_decl != TREE_PURPOSE (l), NULL); /* If we haven't found a flag and we're dealing with self registered with current_function_decl, then don't do anything. Self is always added as definitely initialized but this information is valid only if used outside the current function. */ ! if (! ite) return true; /* If we don't have a variable, create one and install it. */ ! if (! ite->init_test_decl) { tree block; ! decl = build_decl (VAR_DECL, NULL_TREE, boolean_type_node); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); LOCAL_CLASS_INITIALIZATION_FLAG (decl) = 1; --- 19335,19366 ---- initialized static class flags if a flag already existed, otherwise a new one is created. */ ! static int ! emit_test_initialization (entry_p, info) ! PTR *entry_p; PTR info; { tree l = (tree) info; tree decl, init; ! tree key = (tree) *entry_p; ! tree *ite; ! htab_t cf_ht = DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl); /* If we haven't found a flag and we're dealing with self registered with current_function_decl, then don't do anything. Self is always added as definitely initialized but this information is valid only if used outside the current function. */ ! if (current_function_decl == TREE_PURPOSE (l) ! && java_treetreehash_find (cf_ht, key) == NULL) return true; + ite = java_treetreehash_new (cf_ht, key); + /* If we don't have a variable, create one and install it. */ ! if (*ite == NULL) { tree block; ! decl = build_decl (VAR_DECL, NULL_TREE, boolean_type_node); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); LOCAL_CLASS_INITIALIZATION_FLAG (decl) = 1; *************** emit_test_initialization (entry, info) *** 19614,19623 **** block = BLOCK_SUBBLOCKS (GET_CURRENT_BLOCK (current_function_decl)); TREE_CHAIN (decl) = BLOCK_EXPR_DECLS (block); BLOCK_EXPR_DECLS (block) = decl; ! ite->init_test_decl = decl; } else ! decl = ite->init_test_decl; /* Now simply augment the compound that holds all the assignments pertaining to this method invocation. */ --- 19371,19380 ---- block = BLOCK_SUBBLOCKS (GET_CURRENT_BLOCK (current_function_decl)); TREE_CHAIN (decl) = BLOCK_EXPR_DECLS (block); BLOCK_EXPR_DECLS (block) = decl; ! *ite = decl; } else ! decl = *ite; /* Now simply augment the compound that holds all the assignments pertaining to this method invocation. */ *************** emit_test_initialization (entry, info) *** 19629,19632 **** return true; } ! --- 19386,19390 ---- return true; } ! #include "gt-java-parse.h" ! #include "gtype-java.h" diff -Nrc3pad gcc-3.2.3/gcc/java/parse.h gcc-3.3/gcc/java/parse.h *** gcc-3.2.3/gcc/java/parse.h 2002-04-17 08:24:44.000000000 +0000 --- gcc-3.3/gcc/java/parse.h 2002-08-04 22:45:31.000000000 +0000 *************** The Free Software Foundation is independ *** 31,37 **** /* Extern global variable declarations */ extern int java_error_count; extern struct obstack temporary_obstack; - extern struct obstack permanent_obstack; extern int quiet_flag; #ifndef JC1_LITE --- 31,36 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/parse-scan.c gcc-3.3/gcc/java/parse-scan.c *** gcc-3.2.3/gcc/java/parse-scan.c 2003-04-22 08:18:55.000000000 +0000 --- gcc-3.3/gcc/java/parse-scan.c 2003-05-14 01:01:24.000000000 +0000 *************** *** 1,282 **** ! /* A Bison parser, made by GNU Bison 1.875. */ ! ! /* Skeleton parser for Yacc-like parsing with Bison, ! Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, ! Boston, MA 02111-1307, USA. */ ! ! /* As a special exception, when this file is copied by Bison into a ! Bison output file, you may use that output file without restriction. ! This special exception was added by the Free Software Foundation ! in version 1.24 of Bison. */ ! ! /* Written by Richard Stallman by simplifying the original so called ! ``semantic'' parser. */ ! ! /* All symbols defined below should begin with yy or YY, to avoid ! infringing on user name space. This should be done even for local ! variables, as they might otherwise be expanded by user macros. ! There are some unavoidable exceptions within include files to ! define necessary library symbols; they are noted "INFRINGES ON ! USER NAME SPACE" below. */ ! ! /* Identify Bison output. */ ! #define YYBISON 1 ! ! /* Skeleton name. */ ! #define YYSKELETON_NAME "yacc.c" ! ! /* Pure parsers. */ ! #define YYPURE 1 ! ! /* Using locations. */ ! #define YYLSP_NEEDED 0 ! ! ! ! /* Tokens. */ ! #ifndef YYTOKENTYPE ! # define YYTOKENTYPE ! /* Put the tokens into the symbol table, so that GDB and other debuggers ! know about them. */ ! enum yytokentype { ! PLUS_TK = 258, ! MINUS_TK = 259, ! MULT_TK = 260, ! DIV_TK = 261, ! REM_TK = 262, ! LS_TK = 263, ! SRS_TK = 264, ! ZRS_TK = 265, ! AND_TK = 266, ! XOR_TK = 267, ! OR_TK = 268, ! BOOL_AND_TK = 269, ! BOOL_OR_TK = 270, ! EQ_TK = 271, ! NEQ_TK = 272, ! GT_TK = 273, ! GTE_TK = 274, ! LT_TK = 275, ! LTE_TK = 276, ! PLUS_ASSIGN_TK = 277, ! MINUS_ASSIGN_TK = 278, ! MULT_ASSIGN_TK = 279, ! DIV_ASSIGN_TK = 280, ! REM_ASSIGN_TK = 281, ! LS_ASSIGN_TK = 282, ! SRS_ASSIGN_TK = 283, ! ZRS_ASSIGN_TK = 284, ! AND_ASSIGN_TK = 285, ! XOR_ASSIGN_TK = 286, ! OR_ASSIGN_TK = 287, ! PUBLIC_TK = 288, ! PRIVATE_TK = 289, ! PROTECTED_TK = 290, ! STATIC_TK = 291, ! FINAL_TK = 292, ! SYNCHRONIZED_TK = 293, ! VOLATILE_TK = 294, ! TRANSIENT_TK = 295, ! NATIVE_TK = 296, ! PAD_TK = 297, ! ABSTRACT_TK = 298, ! MODIFIER_TK = 299, ! STRICT_TK = 300, ! DECR_TK = 301, ! INCR_TK = 302, ! DEFAULT_TK = 303, ! IF_TK = 304, ! THROW_TK = 305, ! BOOLEAN_TK = 306, ! DO_TK = 307, ! IMPLEMENTS_TK = 308, ! THROWS_TK = 309, ! BREAK_TK = 310, ! IMPORT_TK = 311, ! ELSE_TK = 312, ! INSTANCEOF_TK = 313, ! RETURN_TK = 314, ! VOID_TK = 315, ! CATCH_TK = 316, ! INTERFACE_TK = 317, ! CASE_TK = 318, ! EXTENDS_TK = 319, ! FINALLY_TK = 320, ! SUPER_TK = 321, ! WHILE_TK = 322, ! CLASS_TK = 323, ! SWITCH_TK = 324, ! CONST_TK = 325, ! TRY_TK = 326, ! FOR_TK = 327, ! NEW_TK = 328, ! CONTINUE_TK = 329, ! GOTO_TK = 330, ! PACKAGE_TK = 331, ! THIS_TK = 332, ! BYTE_TK = 333, ! SHORT_TK = 334, ! INT_TK = 335, ! LONG_TK = 336, ! CHAR_TK = 337, ! INTEGRAL_TK = 338, ! FLOAT_TK = 339, ! DOUBLE_TK = 340, ! FP_TK = 341, ! ID_TK = 342, ! REL_QM_TK = 343, ! REL_CL_TK = 344, ! NOT_TK = 345, ! NEG_TK = 346, ! ASSIGN_ANY_TK = 347, ! ASSIGN_TK = 348, ! OP_TK = 349, ! CP_TK = 350, ! OCB_TK = 351, ! CCB_TK = 352, ! OSB_TK = 353, ! CSB_TK = 354, ! SC_TK = 355, ! C_TK = 356, ! DOT_TK = 357, ! STRING_LIT_TK = 358, ! CHAR_LIT_TK = 359, ! INT_LIT_TK = 360, ! FP_LIT_TK = 361, ! TRUE_TK = 362, ! FALSE_TK = 363, ! BOOL_LIT_TK = 364, ! NULL_TK = 365 ! }; ! #endif ! #define PLUS_TK 258 ! #define MINUS_TK 259 ! #define MULT_TK 260 ! #define DIV_TK 261 ! #define REM_TK 262 ! #define LS_TK 263 ! #define SRS_TK 264 ! #define ZRS_TK 265 ! #define AND_TK 266 ! #define XOR_TK 267 ! #define OR_TK 268 ! #define BOOL_AND_TK 269 ! #define BOOL_OR_TK 270 ! #define EQ_TK 271 ! #define NEQ_TK 272 ! #define GT_TK 273 ! #define GTE_TK 274 ! #define LT_TK 275 ! #define LTE_TK 276 ! #define PLUS_ASSIGN_TK 277 ! #define MINUS_ASSIGN_TK 278 ! #define MULT_ASSIGN_TK 279 ! #define DIV_ASSIGN_TK 280 ! #define REM_ASSIGN_TK 281 ! #define LS_ASSIGN_TK 282 ! #define SRS_ASSIGN_TK 283 ! #define ZRS_ASSIGN_TK 284 ! #define AND_ASSIGN_TK 285 ! #define XOR_ASSIGN_TK 286 ! #define OR_ASSIGN_TK 287 ! #define PUBLIC_TK 288 ! #define PRIVATE_TK 289 ! #define PROTECTED_TK 290 ! #define STATIC_TK 291 ! #define FINAL_TK 292 ! #define SYNCHRONIZED_TK 293 ! #define VOLATILE_TK 294 ! #define TRANSIENT_TK 295 ! #define NATIVE_TK 296 ! #define PAD_TK 297 ! #define ABSTRACT_TK 298 ! #define MODIFIER_TK 299 ! #define STRICT_TK 300 ! #define DECR_TK 301 ! #define INCR_TK 302 ! #define DEFAULT_TK 303 ! #define IF_TK 304 ! #define THROW_TK 305 ! #define BOOLEAN_TK 306 ! #define DO_TK 307 ! #define IMPLEMENTS_TK 308 ! #define THROWS_TK 309 ! #define BREAK_TK 310 ! #define IMPORT_TK 311 ! #define ELSE_TK 312 ! #define INSTANCEOF_TK 313 ! #define RETURN_TK 314 ! #define VOID_TK 315 ! #define CATCH_TK 316 ! #define INTERFACE_TK 317 ! #define CASE_TK 318 ! #define EXTENDS_TK 319 ! #define FINALLY_TK 320 ! #define SUPER_TK 321 ! #define WHILE_TK 322 ! #define CLASS_TK 323 ! #define SWITCH_TK 324 ! #define CONST_TK 325 ! #define TRY_TK 326 ! #define FOR_TK 327 ! #define NEW_TK 328 ! #define CONTINUE_TK 329 ! #define GOTO_TK 330 ! #define PACKAGE_TK 331 ! #define THIS_TK 332 ! #define BYTE_TK 333 ! #define SHORT_TK 334 ! #define INT_TK 335 ! #define LONG_TK 336 ! #define CHAR_TK 337 ! #define INTEGRAL_TK 338 ! #define FLOAT_TK 339 ! #define DOUBLE_TK 340 ! #define FP_TK 341 ! #define ID_TK 342 ! #define REL_QM_TK 343 ! #define REL_CL_TK 344 ! #define NOT_TK 345 ! #define NEG_TK 346 ! #define ASSIGN_ANY_TK 347 ! #define ASSIGN_TK 348 ! #define OP_TK 349 ! #define CP_TK 350 ! #define OCB_TK 351 ! #define CCB_TK 352 ! #define OSB_TK 353 ! #define CSB_TK 354 ! #define SC_TK 355 ! #define C_TK 356 ! #define DOT_TK 357 ! #define STRING_LIT_TK 358 ! #define CHAR_LIT_TK 359 ! #define INT_LIT_TK 360 ! #define FP_LIT_TK 361 ! #define TRUE_TK 362 ! #define FALSE_TK 363 ! #define BOOL_LIT_TK 364 ! #define NULL_TK 365 ! ! /* Copy the first part of user declarations. */ ! #line 37 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" #define JC1_LITE --- 1,119 ---- ! /* A Bison parser, made from /home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y ! by GNU bison 1.35. */ + #define YYBISON 1 /* Identify Bison output. */ + # define PLUS_TK 257 + # define MINUS_TK 258 + # define MULT_TK 259 + # define DIV_TK 260 + # define REM_TK 261 + # define LS_TK 262 + # define SRS_TK 263 + # define ZRS_TK 264 + # define AND_TK 265 + # define XOR_TK 266 + # define OR_TK 267 + # define BOOL_AND_TK 268 + # define BOOL_OR_TK 269 + # define EQ_TK 270 + # define NEQ_TK 271 + # define GT_TK 272 + # define GTE_TK 273 + # define LT_TK 274 + # define LTE_TK 275 + # define PLUS_ASSIGN_TK 276 + # define MINUS_ASSIGN_TK 277 + # define MULT_ASSIGN_TK 278 + # define DIV_ASSIGN_TK 279 + # define REM_ASSIGN_TK 280 + # define LS_ASSIGN_TK 281 + # define SRS_ASSIGN_TK 282 + # define ZRS_ASSIGN_TK 283 + # define AND_ASSIGN_TK 284 + # define XOR_ASSIGN_TK 285 + # define OR_ASSIGN_TK 286 + # define PUBLIC_TK 287 + # define PRIVATE_TK 288 + # define PROTECTED_TK 289 + # define STATIC_TK 290 + # define FINAL_TK 291 + # define SYNCHRONIZED_TK 292 + # define VOLATILE_TK 293 + # define TRANSIENT_TK 294 + # define NATIVE_TK 295 + # define PAD_TK 296 + # define ABSTRACT_TK 297 + # define MODIFIER_TK 298 + # define STRICT_TK 299 + # define DECR_TK 300 + # define INCR_TK 301 + # define DEFAULT_TK 302 + # define IF_TK 303 + # define THROW_TK 304 + # define BOOLEAN_TK 305 + # define DO_TK 306 + # define IMPLEMENTS_TK 307 + # define THROWS_TK 308 + # define BREAK_TK 309 + # define IMPORT_TK 310 + # define ELSE_TK 311 + # define INSTANCEOF_TK 312 + # define RETURN_TK 313 + # define VOID_TK 314 + # define CATCH_TK 315 + # define INTERFACE_TK 316 + # define CASE_TK 317 + # define EXTENDS_TK 318 + # define FINALLY_TK 319 + # define SUPER_TK 320 + # define WHILE_TK 321 + # define CLASS_TK 322 + # define SWITCH_TK 323 + # define CONST_TK 324 + # define TRY_TK 325 + # define FOR_TK 326 + # define NEW_TK 327 + # define CONTINUE_TK 328 + # define GOTO_TK 329 + # define PACKAGE_TK 330 + # define THIS_TK 331 + # define ASSERT_TK 332 + # define BYTE_TK 333 + # define SHORT_TK 334 + # define INT_TK 335 + # define LONG_TK 336 + # define CHAR_TK 337 + # define INTEGRAL_TK 338 + # define FLOAT_TK 339 + # define DOUBLE_TK 340 + # define FP_TK 341 + # define ID_TK 342 + # define REL_QM_TK 343 + # define REL_CL_TK 344 + # define NOT_TK 345 + # define NEG_TK 346 + # define ASSIGN_ANY_TK 347 + # define ASSIGN_TK 348 + # define OP_TK 349 + # define CP_TK 350 + # define OCB_TK 351 + # define CCB_TK 352 + # define OSB_TK 353 + # define CSB_TK 354 + # define SC_TK 355 + # define C_TK 356 + # define DOT_TK 357 + # define STRING_LIT_TK 358 + # define CHAR_LIT_TK 359 + # define INT_LIT_TK 360 + # define FP_LIT_TK 361 + # define TRUE_TK 362 + # define FALSE_TK 363 + # define BOOL_LIT_TK 364 + # define NULL_TK 365 ! #line 37 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" #define JC1_LITE *************** *** 286,291 **** --- 123,131 ---- #include "obstack.h" #include "toplev.h" + #define obstack_chunk_alloc xmalloc + #define obstack_chunk_free free + extern char *input_filename; extern FILE *finput, *out; *************** int lineno; *** 305,317 **** static int absorber; #define USE_ABSORBER absorber = 0 ! /* Keep track of the current class name and package name. */ ! static char *current_class; static const char *package_name; - /* Keep track of the current inner class qualifier. */ - static int current_class_length; - /* Keep track of whether things have be listed before. */ static int previous_output; --- 145,153 ---- static int absorber; #define USE_ABSORBER absorber = 0 ! /* Keep track of the current package name. */ static const char *package_name; /* Keep track of whether things have be listed before. */ static int previous_output; *************** static int bracket_count; *** 328,333 **** --- 164,185 ---- /* Numbers anonymous classes */ static int anonymous_count; + /* This is used to record the current class context. */ + struct class_context + { + char *name; + struct class_context *next; + }; + + /* The global class context. */ + static struct class_context *current_class_context; + + /* A special constant used to represent an anonymous context. */ + static const char *anonymous_context = "ANONYMOUS"; + + /* Count of method depth. */ + static int method_depth; + /* Record a method declaration */ struct method_declarator { const char *method_name; *************** struct method_declarator { *** 342,347 **** --- 194,202 ---- } /* Two actions for this grammar */ + static int make_class_name_recursive PARAMS ((struct obstack *stack, + struct class_context *ctx)); + static char *get_class_name PARAMS ((void)); static void report_class_declaration PARAMS ((const char *)); static void report_main_declaration PARAMS ((struct method_declarator *)); static void push_class_context PARAMS ((const char *)); *************** void report PARAMS ((void)); *** 352,513 **** #include "lex.h" #include "parse.h" ! ! /* Enabling traces. */ ! #ifndef YYDEBUG ! # define YYDEBUG 1 ! #endif ! ! /* Enabling verbose error messages. */ ! #ifdef YYERROR_VERBOSE ! # undef YYERROR_VERBOSE ! # define YYERROR_VERBOSE 1 ! #else ! # define YYERROR_VERBOSE 0 ! #endif ! ! #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) ! #line 113 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! typedef union YYSTYPE { char *node; struct method_declarator *declarator; int value; /* For modifiers */ ! } YYSTYPE; ! /* Line 191 of yacc.c. */ ! #line 377 "ps2505.c" ! # define yystype YYSTYPE /* obsolescent; will be withdrawn */ ! # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif ! ! ! /* Copy the second part of user declarations. */ ! #line 119 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" #include "lex.c" ! ! ! /* Line 214 of yacc.c. */ ! #line 392 "ps2505.c" ! ! #if ! defined (yyoverflow) || YYERROR_VERBOSE ! ! /* The parser invokes alloca or malloc; define the necessary symbols. */ ! ! # if YYSTACK_USE_ALLOCA ! # define YYSTACK_ALLOC alloca ! # else ! # ifndef YYSTACK_USE_ALLOCA ! # if defined (alloca) || defined (_ALLOCA_H) ! # define YYSTACK_ALLOC alloca ! # else ! # ifdef __GNUC__ ! # define YYSTACK_ALLOC __builtin_alloca ! # endif ! # endif ! # endif ! # endif ! ! # ifdef YYSTACK_ALLOC ! /* Pacify GCC's `empty if-body' warning. */ ! # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) ! # else ! # if defined (__STDC__) || defined (__cplusplus) ! # include /* INFRINGES ON USER NAME SPACE */ ! # define YYSIZE_T size_t ! # endif ! # define YYSTACK_ALLOC malloc ! # define YYSTACK_FREE free ! # endif ! #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ ! ! ! #if (! defined (yyoverflow) \ ! && (! defined (__cplusplus) \ ! || (YYSTYPE_IS_TRIVIAL))) ! ! /* A type that is properly aligned for any stack member. */ ! union yyalloc ! { ! short yyss; ! YYSTYPE yyvs; ! }; ! ! /* The size of the maximum gap between one aligned stack and the next. */ ! # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) ! ! /* The size of an array large to enough to hold all stacks, each with ! N elements. */ ! # define YYSTACK_BYTES(N) \ ! ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ ! + YYSTACK_GAP_MAXIMUM) ! ! /* Copy COUNT objects from FROM to TO. The source and destination do ! not overlap. */ ! # ifndef YYCOPY ! # if 1 < __GNUC__ ! # define YYCOPY(To, From, Count) \ ! __builtin_memcpy (To, From, (Count) * sizeof (*(From))) ! # else ! # define YYCOPY(To, From, Count) \ ! do \ ! { \ ! register YYSIZE_T yyi; \ ! for (yyi = 0; yyi < (Count); yyi++) \ ! (To)[yyi] = (From)[yyi]; \ ! } \ ! while (0) ! # endif ! # endif ! ! /* Relocate STACK from its old location to the new one. The ! local variables YYSIZE and YYSTACKSIZE give the old and new number of ! elements in the stack, and YYPTR gives the new location of the ! stack. Advance YYPTR to a properly aligned location for the next ! stack. */ ! # define YYSTACK_RELOCATE(Stack) \ ! do \ ! { \ ! YYSIZE_T yynewbytes; \ ! YYCOPY (&yyptr->Stack, Stack, yysize); \ ! Stack = &yyptr->Stack; \ ! yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ ! yyptr += yynewbytes / sizeof (*yyptr); \ ! } \ ! while (0) ! #endif - #if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; - #else - typedef short yysigned_char; - #endif - /* YYFINAL -- State number of the termination state. */ - #define YYFINAL 28 - /* YYLAST -- Last index in YYTABLE. */ - #define YYLAST 3238 ! /* YYNTOKENS -- Number of terminals. */ ! #define YYNTOKENS 111 ! /* YYNNTS -- Number of nonterminals. */ ! #define YYNNTS 152 ! /* YYNRULES -- Number of rules. */ ! #define YYNRULES 351 ! /* YYNRULES -- Number of states. */ ! #define YYNSTATES 606 ! ! /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ ! #define YYUNDEFTOK 2 ! #define YYMAXUTOK 365 ! #define YYTRANSLATE(YYX) \ ! ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) ! /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ ! static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, --- 207,242 ---- #include "lex.h" #include "parse.h" ! #line 131 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! #ifndef YYSTYPE ! typedef union { char *node; struct method_declarator *declarator; int value; /* For modifiers */ ! } yystype; ! # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif + #line 137 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! extern int flag_assert; #include "lex.c" ! #ifndef YYDEBUG ! # define YYDEBUG 1 #endif ! #define YYFINAL 616 ! #define YYFLAG -32768 ! #define YYNTBASE 112 ! /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ ! #define YYTRANSLATE(x) ((unsigned)(x) <= 365 ? yytranslate[x] : 265) ! /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ ! static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, *************** static const unsigned char yytranslate[] *** 534,763 **** 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ! 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, ! 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ! 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ! 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, ! 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, ! 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, ! 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, ! 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ! 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, ! 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, ! 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, ! 105, 106, 107, 108, 109, 110 }; #if YYDEBUG ! /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in ! YYRHS. */ ! static const unsigned short yyprhs[] = { ! 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, ! 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, ! 40, 43, 45, 47, 49, 53, 55, 56, 58, 60, ! 62, 65, 68, 71, 75, 77, 80, 82, 85, 89, ! 91, 93, 97, 103, 105, 107, 109, 111, 114, 115, ! 123, 124, 131, 132, 135, 136, 139, 141, 145, 148, ! 152, 154, 157, 159, 161, 163, 165, 167, 169, 171, ! 173, 175, 179, 184, 186, 190, 192, 196, 198, 202, ! 204, 206, 209, 213, 217, 222, 227, 231, 236, 240, ! 242, 246, 249, 253, 254, 257, 259, 263, 265, 267, ! 270, 272, 276, 281, 286, 292, 296, 301, 304, 308, ! 312, 317, 322, 328, 336, 343, 345, 347, 348, 353, ! 354, 360, 361, 367, 368, 375, 378, 382, 385, 389, ! 391, 394, 396, 398, 400, 402, 404, 407, 410, 414, ! 418, 423, 425, 429, 432, 436, 438, 441, 443, 445, ! 447, 450, 453, 457, 459, 461, 463, 465, 467, 469, ! 471, 473, 475, 477, 479, 481, 483, 485, 487, 489, ! 491, 493, 495, 497, 499, 501, 503, 506, 509, 512, ! 515, 517, 519, 521, 523, 525, 527, 529, 535, 543, ! 551, 557, 560, 564, 568, 573, 575, 578, 581, 583, ! 586, 590, 593, 598, 601, 604, 606, 614, 622, 629, ! 637, 644, 647, 650, 651, 653, 655, 656, 658, 660, ! 664, 667, 671, 674, 678, 681, 685, 689, 695, 701, ! 703, 707, 711, 716, 718, 721, 727, 730, 732, 734, ! 736, 738, 742, 744, 746, 748, 750, 752, 756, 760, ! 764, 768, 772, 778, 783, 785, 790, 796, 802, 809, ! 810, 817, 818, 826, 830, 834, 836, 840, 844, 848, ! 852, 857, 862, 867, 872, 874, 877, 881, 884, 888, ! 892, 896, 900, 905, 911, 918, 924, 931, 936, 941, ! 943, 945, 947, 949, 952, 955, 957, 959, 962, 965, ! 967, 970, 973, 975, 978, 981, 983, 989, 994, 999, ! 1005, 1007, 1011, 1015, 1019, 1021, 1025, 1029, 1031, 1035, ! 1039, 1043, 1045, 1049, 1053, 1057, 1061, 1065, 1067, 1071, ! 1075, 1077, 1081, 1083, 1087, 1089, 1093, 1095, 1099, 1101, ! 1105, 1107, 1113, 1115, 1117, 1121, 1123, 1125, 1127, 1129, ! 1131, 1133 }; - - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { ! 112, 0, -1, 125, -1, 105, -1, 106, -1, 109, ! -1, 104, -1, 103, -1, 110, -1, 115, -1, 116, ! -1, 83, -1, 86, -1, 51, -1, 117, -1, 120, ! -1, 121, -1, 117, -1, 117, -1, 115, 234, -1, ! 121, 234, -1, 122, -1, 123, -1, 124, -1, 121, ! 102, 124, -1, 87, -1, -1, 128, -1, 126, -1, ! 127, -1, 128, 126, -1, 128, 127, -1, 126, 127, ! -1, 128, 126, 127, -1, 129, -1, 126, 129, -1, ! 132, -1, 127, 132, -1, 76, 121, 100, -1, 130, ! -1, 131, -1, 56, 121, 100, -1, 56, 121, 102, ! 5, 100, -1, 134, -1, 164, -1, 185, -1, 44, ! -1, 133, 44, -1, -1, 133, 68, 124, 137, 138, ! 135, 140, -1, -1, 68, 124, 137, 138, 136, 140, ! -1, -1, 64, 118, -1, -1, 53, 139, -1, 119, ! -1, 139, 101, 119, -1, 96, 97, -1, 96, 141, ! 97, -1, 142, -1, 141, 142, -1, 143, -1, 157, ! -1, 159, -1, 177, -1, 144, -1, 149, -1, 134, ! -1, 164, -1, 185, -1, 114, 145, 100, -1, 133, ! 114, 145, 100, -1, 146, -1, 145, 101, 146, -1, ! 147, -1, 147, 93, 148, -1, 124, -1, 147, 98, ! 99, -1, 261, -1, 175, -1, 150, 156, -1, 114, ! 151, 154, -1, 60, 151, 154, -1, 133, 114, 151, ! 154, -1, 133, 60, 151, 154, -1, 124, 94, 95, ! -1, 124, 94, 152, 95, -1, 151, 98, 99, -1, ! 153, -1, 152, 101, 153, -1, 114, 147, -1, 133, ! 114, 147, -1, -1, 54, 155, -1, 118, -1, 155, ! 101, 118, -1, 177, -1, 100, -1, 158, 177, -1, ! 44, -1, 160, 154, 161, -1, 133, 160, 154, 161, ! -1, 160, 154, 161, 100, -1, 133, 160, 154, 161, ! 100, -1, 122, 94, 95, -1, 122, 94, 152, 95, ! -1, 96, 97, -1, 96, 162, 97, -1, 96, 178, ! 97, -1, 96, 162, 178, 97, -1, 163, 94, 95, ! 100, -1, 163, 94, 230, 95, 100, -1, 121, 102, ! 66, 94, 230, 95, 100, -1, 121, 102, 66, 94, ! 95, 100, -1, 77, -1, 66, -1, -1, 62, 124, ! 165, 170, -1, -1, 133, 62, 124, 166, 170, -1, ! -1, 62, 124, 169, 167, 170, -1, -1, 133, 62, ! 124, 169, 168, 170, -1, 64, 119, -1, 169, 101, ! 119, -1, 96, 97, -1, 96, 171, 97, -1, 172, ! -1, 171, 172, -1, 173, -1, 174, -1, 134, -1, ! 164, -1, 144, -1, 150, 100, -1, 96, 97, -1, ! 96, 176, 97, -1, 96, 101, 97, -1, 96, 176, ! 101, 97, -1, 148, -1, 176, 101, 148, -1, 96, ! 97, -1, 96, 178, 97, -1, 179, -1, 178, 179, ! -1, 180, -1, 182, -1, 134, -1, 181, 100, -1, ! 114, 145, -1, 133, 114, 145, -1, 184, -1, 187, ! -1, 191, -1, 192, -1, 201, -1, 205, -1, 184, ! -1, 188, -1, 193, -1, 202, -1, 206, -1, 177, ! -1, 185, -1, 189, -1, 194, -1, 204, -1, 212, ! -1, 213, -1, 214, -1, 216, -1, 215, -1, 218, ! -1, 100, -1, 124, 89, -1, 186, 182, -1, 186, ! 183, -1, 190, 100, -1, 258, -1, 242, -1, 243, ! -1, 239, -1, 240, -1, 236, -1, 225, -1, 49, ! 94, 261, 95, 182, -1, 49, 94, 261, 95, 183, ! 57, 182, -1, 49, 94, 261, 95, 183, 57, 183, ! -1, 69, 94, 261, 95, 195, -1, 96, 97, -1, ! 96, 198, 97, -1, 96, 196, 97, -1, 96, 196, ! 198, 97, -1, 197, -1, 196, 197, -1, 198, 178, ! -1, 199, -1, 198, 199, -1, 63, 262, 89, -1, ! 48, 89, -1, 67, 94, 261, 95, -1, 200, 182, ! -1, 200, 183, -1, 52, -1, 203, 182, 67, 94, ! 261, 95, 100, -1, 208, 100, 261, 100, 210, 95, ! 182, -1, 208, 100, 100, 210, 95, 182, -1, 208, ! 100, 261, 100, 210, 95, 183, -1, 208, 100, 100, ! 210, 95, 183, -1, 72, 94, -1, 207, 209, -1, ! -1, 211, -1, 181, -1, -1, 211, -1, 190, -1, ! 211, 101, 190, -1, 55, 100, -1, 55, 124, 100, ! -1, 74, 100, -1, 74, 124, 100, -1, 59, 100, ! -1, 59, 261, 100, -1, 50, 261, 100, -1, 217, ! 94, 261, 95, 177, -1, 217, 94, 261, 95, 1, ! -1, 44, -1, 71, 177, 219, -1, 71, 177, 221, ! -1, 71, 177, 219, 221, -1, 220, -1, 219, 220, ! -1, 61, 94, 153, 95, 177, -1, 65, 177, -1, ! 223, -1, 231, -1, 113, -1, 77, -1, 94, 261, ! 95, -1, 225, -1, 235, -1, 236, -1, 237, -1, ! 224, -1, 121, 102, 77, -1, 121, 102, 68, -1, ! 120, 102, 68, -1, 115, 102, 68, -1, 60, 102, ! 68, -1, 73, 118, 94, 230, 95, -1, 73, 118, ! 94, 95, -1, 226, -1, 229, 124, 94, 95, -1, ! 229, 124, 94, 95, 140, -1, 229, 124, 94, 230, ! 95, -1, 229, 124, 94, 230, 95, 140, -1, -1, ! 73, 118, 94, 95, 227, 140, -1, -1, 73, 118, ! 94, 230, 95, 228, 140, -1, 121, 102, 73, -1, ! 222, 102, 73, -1, 261, -1, 230, 101, 261, -1, ! 230, 101, 1, -1, 73, 115, 232, -1, 73, 117, ! 232, -1, 73, 115, 232, 234, -1, 73, 117, 232, ! 234, -1, 73, 117, 234, 175, -1, 73, 115, 234, ! 175, -1, 233, -1, 232, 233, -1, 98, 261, 99, ! -1, 98, 99, -1, 234, 98, 99, -1, 222, 102, ! 124, -1, 66, 102, 124, -1, 121, 94, 95, -1, ! 121, 94, 230, 95, -1, 222, 102, 124, 94, 95, ! -1, 222, 102, 124, 94, 230, 95, -1, 66, 102, ! 124, 94, 95, -1, 66, 102, 124, 94, 230, 95, ! -1, 121, 98, 261, 99, -1, 223, 98, 261, 99, ! -1, 222, -1, 121, -1, 239, -1, 240, -1, 238, ! 47, -1, 238, 46, -1, 242, -1, 243, -1, 3, ! 241, -1, 4, 241, -1, 244, -1, 47, 241, -1, ! 46, 241, -1, 238, -1, 90, 241, -1, 91, 241, ! -1, 245, -1, 94, 115, 234, 95, 241, -1, 94, ! 115, 95, 241, -1, 94, 261, 95, 244, -1, 94, ! 121, 234, 95, 244, -1, 241, -1, 246, 5, 241, ! -1, 246, 6, 241, -1, 246, 7, 241, -1, 246, ! -1, 247, 3, 246, -1, 247, 4, 246, -1, 247, ! -1, 248, 8, 247, -1, 248, 9, 247, -1, 248, ! 10, 247, -1, 248, -1, 249, 20, 248, -1, 249, ! 18, 248, -1, 249, 21, 248, -1, 249, 19, 248, ! -1, 249, 58, 116, -1, 249, -1, 250, 16, 249, ! -1, 250, 17, 249, -1, 250, -1, 251, 11, 250, ! -1, 251, -1, 252, 12, 251, -1, 252, -1, 253, ! 13, 252, -1, 253, -1, 254, 14, 253, -1, 254, ! -1, 255, 15, 254, -1, 255, -1, 255, 88, 261, ! 89, 256, -1, 256, -1, 258, -1, 259, 260, 257, ! -1, 121, -1, 235, -1, 237, -1, 92, -1, 93, ! -1, 257, -1, 261, -1 }; ! /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ ! static const unsigned short yyrline[] = { ! 0, 190, 190, 195, 196, 197, 198, 199, 200, 205, ! 206, 210, 215, 220, 228, 229, 233, 237, 241, 245, ! 250, 259, 260, 264, 268, 275, 279, 280, 281, 282, ! 283, 284, 285, 286, 290, 291, 295, 296, 300, 305, ! 306, 310, 314, 318, 319, 320, 327, 335, 348, 347, ! 354, 353, 358, 359, 362, 363, 367, 369, 374, 376, ! 381, 382, 386, 387, 388, 389, 393, 394, 395, 396, ! 397, 402, 404, 410, 411, 415, 416, 420, 422, 427, ! 428, 433, 437, 439, 440, 442, 450, 456, 462, 466, ! 467, 474, 489, 505, 506, 510, 512, 517, 518, 523, ! 527, 537, 538, 541, 543, 550, 552, 557, 558, 559, ! 560, 565, 566, 569, 571, 576, 577, 584, 583, 587, ! 586, 590, 589, 593, 592, 598, 599, 603, 605, 610, ! 611, 615, 616, 617, 618, 622, 626, 631, 632, 633, ! 634, 638, 639, 644, 645, 649, 650, 654, 655, 656, ! 660, 664, 666, 671, 672, 673, 674, 675, 676, 680, ! 681, 682, 683, 684, 688, 689, 690, 691, 692, 693, ! 694, 695, 696, 697, 698, 702, 706, 711, 715, 721, ! 725, 726, 727, 728, 729, 730, 731, 735, 739, 744, ! 749, 753, 754, 755, 756, 760, 761, 765, 770, 771, ! 775, 776, 780, 784, 788, 792, 796, 801, 802, 806, ! 807, 811, 815, 817, 818, 819, 822, 823, 827, 828, ! 832, 833, 839, 840, 844, 845, 849, 853, 854, 858, ! 863, 864, 865, 869, 870, 874, 878, 883, 884, 888, ! 889, 890, 891, 892, 893, 894, 895, 899, 904, 906, ! 908, 910, 915, 916, 917, 918, 919, 920, 921, 926, ! 925, 929, 928, 934, 936, 940, 941, 942, 946, 947, ! 948, 949, 952, 953, 957, 958, 962, 966, 968, 973, ! 974, 981, 983, 985, 986, 987, 988, 992, 994, 998, ! 999, 1001, 1002, 1006, 1010, 1014, 1015, 1016, 1017, 1018, ! 1022, 1026, 1030, 1031, 1032, 1033, 1037, 1038, 1039, 1040, ! 1044, 1045, 1046, 1047, 1051, 1052, 1053, 1057, 1058, 1059, ! 1060, 1064, 1065, 1066, 1067, 1068, 1069, 1073, 1074, 1075, ! 1079, 1080, 1084, 1085, 1089, 1090, 1094, 1095, 1100, 1101, ! 1106, 1107, 1112, 1113, 1117, 1121, 1123, 1124, 1128, 1129, ! 1133, 1137 }; #endif ! #if YYDEBUG || YYERROR_VERBOSE ! /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. ! First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { ! "$end", "error", "$undefined", "PLUS_TK", "MINUS_TK", "MULT_TK", "DIV_TK", "REM_TK", "LS_TK", "SRS_TK", "ZRS_TK", "AND_TK", "XOR_TK", "OR_TK", "BOOL_AND_TK", "BOOL_OR_TK", "EQ_TK", "NEQ_TK", "GT_TK", "GTE_TK", "LT_TK", "LTE_TK", "PLUS_ASSIGN_TK", "MINUS_ASSIGN_TK", --- 263,494 ---- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ! 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, ! 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ! 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, ! 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, ! 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, ! 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, ! 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, ! 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, ! 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, ! 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, ! 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, ! 106, 107, 108, 109, 110, 111 }; #if YYDEBUG ! static const short yyprhs[] = { ! 0, 0, 2, 4, 6, 8, 10, 12, 14, 16, ! 18, 20, 22, 24, 26, 28, 30, 32, 34, 37, ! 40, 42, 44, 46, 50, 52, 53, 55, 57, 59, ! 62, 65, 68, 72, 74, 77, 79, 82, 86, 88, ! 90, 94, 100, 102, 104, 106, 108, 111, 112, 120, ! 121, 128, 129, 132, 133, 136, 138, 142, 145, 149, ! 151, 154, 156, 158, 160, 162, 164, 166, 168, 170, ! 172, 176, 181, 183, 187, 189, 193, 195, 199, 201, ! 203, 204, 208, 212, 216, 221, 226, 230, 235, 239, ! 241, 245, 248, 252, 253, 256, 258, 262, 264, 266, ! 269, 271, 275, 280, 285, 291, 295, 300, 303, 307, ! 311, 316, 321, 327, 335, 342, 344, 346, 347, 352, ! 353, 359, 360, 366, 367, 374, 377, 381, 384, 388, ! 390, 393, 395, 397, 399, 401, 403, 406, 409, 413, ! 417, 422, 424, 428, 431, 435, 437, 440, 442, 444, ! 446, 449, 452, 456, 458, 460, 462, 464, 466, 468, ! 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, ! 490, 492, 494, 496, 498, 500, 502, 504, 507, 510, ! 513, 516, 518, 520, 522, 524, 526, 528, 530, 536, ! 544, 552, 558, 561, 565, 569, 574, 576, 579, 582, ! 584, 587, 591, 594, 599, 602, 605, 607, 615, 623, ! 630, 638, 645, 648, 651, 652, 654, 656, 657, 659, ! 661, 665, 668, 672, 675, 679, 682, 686, 690, 696, ! 700, 703, 707, 713, 719, 721, 725, 729, 734, 736, ! 739, 745, 748, 750, 752, 754, 756, 760, 762, 764, ! 766, 768, 770, 774, 778, 782, 786, 790, 796, 801, ! 803, 808, 814, 820, 827, 828, 835, 836, 844, 848, ! 852, 854, 858, 862, 866, 870, 875, 880, 885, 890, ! 892, 895, 899, 902, 906, 910, 914, 918, 923, 929, ! 936, 942, 949, 954, 959, 961, 963, 965, 967, 970, ! 973, 975, 977, 980, 983, 985, 988, 991, 993, 996, ! 999, 1001, 1007, 1012, 1017, 1023, 1025, 1029, 1033, 1037, ! 1039, 1043, 1047, 1049, 1053, 1057, 1061, 1063, 1067, 1071, ! 1075, 1079, 1083, 1085, 1089, 1093, 1095, 1099, 1101, 1105, ! 1107, 1111, 1113, 1117, 1119, 1123, 1125, 1131, 1133, 1135, ! 1139, 1141, 1143, 1145, 1147, 1149, 1151 }; static const short yyrhs[] = { ! 125, 0, 106, 0, 107, 0, 110, 0, 105, 0, ! 104, 0, 111, 0, 115, 0, 116, 0, 84, 0, ! 87, 0, 51, 0, 117, 0, 120, 0, 121, 0, ! 117, 0, 117, 0, 115, 236, 0, 121, 236, 0, ! 122, 0, 123, 0, 124, 0, 121, 103, 124, 0, ! 88, 0, 0, 128, 0, 126, 0, 127, 0, 128, ! 126, 0, 128, 127, 0, 126, 127, 0, 128, 126, ! 127, 0, 129, 0, 126, 129, 0, 132, 0, 127, ! 132, 0, 76, 121, 101, 0, 130, 0, 131, 0, ! 56, 121, 101, 0, 56, 121, 103, 5, 101, 0, ! 134, 0, 165, 0, 186, 0, 44, 0, 133, 44, ! 0, 0, 133, 68, 124, 137, 138, 135, 140, 0, ! 0, 68, 124, 137, 138, 136, 140, 0, 0, 64, ! 118, 0, 0, 53, 139, 0, 119, 0, 139, 102, ! 119, 0, 97, 98, 0, 97, 141, 98, 0, 142, ! 0, 141, 142, 0, 143, 0, 158, 0, 160, 0, ! 178, 0, 144, 0, 149, 0, 134, 0, 165, 0, ! 186, 0, 114, 145, 101, 0, 133, 114, 145, 101, ! 0, 146, 0, 145, 102, 146, 0, 147, 0, 147, ! 94, 148, 0, 124, 0, 147, 99, 100, 0, 263, ! 0, 176, 0, 0, 151, 150, 157, 0, 114, 152, ! 155, 0, 60, 152, 155, 0, 133, 114, 152, 155, ! 0, 133, 60, 152, 155, 0, 124, 95, 96, 0, ! 124, 95, 153, 96, 0, 152, 99, 100, 0, 154, ! 0, 153, 102, 154, 0, 114, 147, 0, 133, 114, ! 147, 0, 0, 54, 156, 0, 118, 0, 156, 102, ! 118, 0, 178, 0, 101, 0, 159, 178, 0, 44, ! 0, 161, 155, 162, 0, 133, 161, 155, 162, 0, ! 161, 155, 162, 101, 0, 133, 161, 155, 162, 101, ! 0, 122, 95, 96, 0, 122, 95, 153, 96, 0, ! 97, 98, 0, 97, 163, 98, 0, 97, 179, 98, ! 0, 97, 163, 179, 98, 0, 164, 95, 96, 101, ! 0, 164, 95, 232, 96, 101, 0, 121, 103, 66, ! 95, 232, 96, 101, 0, 121, 103, 66, 95, 96, ! 101, 0, 77, 0, 66, 0, 0, 62, 124, 166, ! 171, 0, 0, 133, 62, 124, 167, 171, 0, 0, ! 62, 124, 170, 168, 171, 0, 0, 133, 62, 124, ! 170, 169, 171, 0, 64, 119, 0, 170, 102, 119, ! 0, 97, 98, 0, 97, 172, 98, 0, 173, 0, ! 172, 173, 0, 174, 0, 175, 0, 134, 0, 165, ! 0, 144, 0, 151, 101, 0, 97, 98, 0, 97, ! 177, 98, 0, 97, 102, 98, 0, 97, 177, 102, ! 98, 0, 148, 0, 177, 102, 148, 0, 97, 98, ! 0, 97, 179, 98, 0, 180, 0, 179, 180, 0, ! 181, 0, 183, 0, 134, 0, 182, 101, 0, 114, ! 145, 0, 133, 114, 145, 0, 185, 0, 188, 0, ! 192, 0, 193, 0, 202, 0, 206, 0, 185, 0, ! 189, 0, 194, 0, 203, 0, 207, 0, 178, 0, ! 186, 0, 190, 0, 195, 0, 205, 0, 213, 0, ! 214, 0, 215, 0, 218, 0, 216, 0, 220, 0, ! 217, 0, 101, 0, 124, 90, 0, 187, 183, 0, ! 187, 184, 0, 191, 101, 0, 260, 0, 244, 0, ! 245, 0, 241, 0, 242, 0, 238, 0, 227, 0, ! 49, 95, 263, 96, 183, 0, 49, 95, 263, 96, ! 184, 57, 183, 0, 49, 95, 263, 96, 184, 57, ! 184, 0, 69, 95, 263, 96, 196, 0, 97, 98, ! 0, 97, 199, 98, 0, 97, 197, 98, 0, 97, ! 197, 199, 98, 0, 198, 0, 197, 198, 0, 199, ! 179, 0, 200, 0, 199, 200, 0, 63, 264, 90, ! 0, 48, 90, 0, 67, 95, 263, 96, 0, 201, ! 183, 0, 201, 184, 0, 52, 0, 204, 183, 67, ! 95, 263, 96, 101, 0, 209, 101, 263, 101, 211, ! 96, 183, 0, 209, 101, 101, 211, 96, 183, 0, ! 209, 101, 263, 101, 211, 96, 184, 0, 209, 101, ! 101, 211, 96, 184, 0, 72, 95, 0, 208, 210, ! 0, 0, 212, 0, 182, 0, 0, 212, 0, 191, ! 0, 212, 102, 191, 0, 55, 101, 0, 55, 124, ! 101, 0, 74, 101, 0, 74, 124, 101, 0, 59, ! 101, 0, 59, 263, 101, 0, 50, 263, 101, 0, ! 78, 263, 90, 263, 101, 0, 78, 263, 101, 0, ! 78, 1, 0, 78, 263, 1, 0, 219, 95, 263, ! 96, 178, 0, 219, 95, 263, 96, 1, 0, 44, ! 0, 71, 178, 221, 0, 71, 178, 223, 0, 71, ! 178, 221, 223, 0, 222, 0, 221, 222, 0, 61, ! 95, 154, 96, 178, 0, 65, 178, 0, 225, 0, ! 233, 0, 113, 0, 77, 0, 95, 263, 96, 0, ! 227, 0, 237, 0, 238, 0, 239, 0, 226, 0, ! 121, 103, 77, 0, 121, 103, 68, 0, 120, 103, ! 68, 0, 115, 103, 68, 0, 60, 103, 68, 0, ! 73, 118, 95, 232, 96, 0, 73, 118, 95, 96, ! 0, 228, 0, 231, 124, 95, 96, 0, 231, 124, ! 95, 96, 140, 0, 231, 124, 95, 232, 96, 0, ! 231, 124, 95, 232, 96, 140, 0, 0, 73, 118, ! 95, 96, 229, 140, 0, 0, 73, 118, 95, 232, ! 96, 230, 140, 0, 121, 103, 73, 0, 224, 103, ! 73, 0, 263, 0, 232, 102, 263, 0, 232, 102, ! 1, 0, 73, 115, 234, 0, 73, 117, 234, 0, ! 73, 115, 234, 236, 0, 73, 117, 234, 236, 0, ! 73, 117, 236, 176, 0, 73, 115, 236, 176, 0, ! 235, 0, 234, 235, 0, 99, 263, 100, 0, 99, ! 100, 0, 236, 99, 100, 0, 224, 103, 124, 0, ! 66, 103, 124, 0, 121, 95, 96, 0, 121, 95, ! 232, 96, 0, 224, 103, 124, 95, 96, 0, 224, ! 103, 124, 95, 232, 96, 0, 66, 103, 124, 95, ! 96, 0, 66, 103, 124, 95, 232, 96, 0, 121, ! 99, 263, 100, 0, 225, 99, 263, 100, 0, 224, ! 0, 121, 0, 241, 0, 242, 0, 240, 47, 0, ! 240, 46, 0, 244, 0, 245, 0, 3, 243, 0, ! 4, 243, 0, 246, 0, 47, 243, 0, 46, 243, ! 0, 240, 0, 91, 243, 0, 92, 243, 0, 247, ! 0, 95, 115, 236, 96, 243, 0, 95, 115, 96, ! 243, 0, 95, 263, 96, 246, 0, 95, 121, 236, ! 96, 246, 0, 243, 0, 248, 5, 243, 0, 248, ! 6, 243, 0, 248, 7, 243, 0, 248, 0, 249, ! 3, 248, 0, 249, 4, 248, 0, 249, 0, 250, ! 8, 249, 0, 250, 9, 249, 0, 250, 10, 249, ! 0, 250, 0, 251, 20, 250, 0, 251, 18, 250, ! 0, 251, 21, 250, 0, 251, 19, 250, 0, 251, ! 58, 116, 0, 251, 0, 252, 16, 251, 0, 252, ! 17, 251, 0, 252, 0, 253, 11, 252, 0, 253, ! 0, 254, 12, 253, 0, 254, 0, 255, 13, 254, ! 0, 255, 0, 256, 14, 255, 0, 256, 0, 257, ! 15, 256, 0, 257, 0, 257, 89, 263, 90, 258, ! 0, 258, 0, 260, 0, 261, 262, 259, 0, 121, ! 0, 237, 0, 239, 0, 93, 0, 94, 0, 259, ! 0, 263, 0 }; ! #endif ! ! #if YYDEBUG ! /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ ! static const short yyrline[] = { ! 0, 210, 215, 217, 218, 219, 220, 221, 225, 227, ! 230, 236, 241, 248, 250, 253, 257, 261, 265, 271, ! 279, 281, 284, 288, 295, 300, 301, 302, 303, 304, ! 305, 306, 307, 310, 312, 315, 317, 320, 325, 327, ! 330, 334, 338, 340, 341, 347, 356, 367, 367, 374, ! 374, 379, 380, 383, 384, 387, 390, 394, 397, 401, ! 403, 406, 408, 409, 410, 413, 415, 416, 417, 418, ! 422, 425, 429, 432, 435, 437, 440, 443, 447, 449, ! 453, 453, 460, 463, 464, 466, 473, 480, 486, 489, ! 491, 497, 513, 529, 530, 533, 536, 540, 542, 546, ! 550, 560, 562, 565, 567, 573, 576, 580, 582, 583, ! 584, 588, 590, 593, 595, 599, 601, 606, 606, 610, ! 610, 613, 613, 616, 616, 621, 623, 626, 629, 633, ! 635, 638, 640, 641, 642, 645, 649, 654, 656, 657, ! 658, 661, 663, 667, 669, 672, 674, 677, 679, 680, ! 683, 687, 690, 694, 696, 697, 698, 699, 700, 703, ! 705, 706, 707, 708, 711, 713, 714, 715, 716, 717, ! 718, 719, 720, 721, 722, 723, 726, 730, 735, 739, ! 745, 749, 751, 752, 753, 754, 755, 756, 759, 763, ! 768, 773, 777, 779, 780, 781, 784, 786, 789, 794, ! 796, 799, 801, 804, 808, 812, 816, 820, 825, 827, ! 830, 832, 835, 839, 842, 843, 844, 847, 848, 851, ! 853, 856, 858, 863, 865, 868, 870, 873, 877, 879, ! 880, 882, 885, 887, 890, 895, 897, 898, 901, 903, ! 906, 910, 915, 917, 920, 922, 923, 924, 925, 926, ! 927, 928, 932, 936, 939, 941, 943, 947, 949, 950, ! 951, 952, 953, 954, 957, 957, 961, 961, 966, 969, ! 972, 974, 975, 978, 980, 981, 982, 985, 986, 989, ! 991, 994, 998, 1001, 1005, 1007, 1013, 1016, 1018, 1019, ! 1020, 1021, 1024, 1027, 1030, 1032, 1034, 1035, 1038, 1042, ! 1046, 1048, 1049, 1050, 1051, 1054, 1058, 1062, 1064, 1065, ! 1066, 1069, 1071, 1072, 1073, 1076, 1078, 1079, 1080, 1083, ! 1085, 1086, 1089, 1091, 1092, 1093, 1096, 1098, 1099, 1100, ! 1101, 1102, 1105, 1107, 1108, 1111, 1113, 1116, 1118, 1121, ! 1123, 1126, 1128, 1132, 1134, 1138, 1140, 1144, 1146, 1149, ! 1153, 1156, 1157, 1160, 1162, 1165, 1169 }; #endif ! ! #if (YYDEBUG) || defined YYERROR_VERBOSE ! ! /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { ! "$", "error", "$undefined.", "PLUS_TK", "MINUS_TK", "MULT_TK", "DIV_TK", "REM_TK", "LS_TK", "SRS_TK", "ZRS_TK", "AND_TK", "XOR_TK", "OR_TK", "BOOL_AND_TK", "BOOL_OR_TK", "EQ_TK", "NEQ_TK", "GT_TK", "GTE_TK", "LT_TK", "LTE_TK", "PLUS_ASSIGN_TK", "MINUS_ASSIGN_TK", *************** static const char *const yytname[] = *** 771,783 **** "ELSE_TK", "INSTANCEOF_TK", "RETURN_TK", "VOID_TK", "CATCH_TK", "INTERFACE_TK", "CASE_TK", "EXTENDS_TK", "FINALLY_TK", "SUPER_TK", "WHILE_TK", "CLASS_TK", "SWITCH_TK", "CONST_TK", "TRY_TK", "FOR_TK", ! "NEW_TK", "CONTINUE_TK", "GOTO_TK", "PACKAGE_TK", "THIS_TK", "BYTE_TK", ! "SHORT_TK", "INT_TK", "LONG_TK", "CHAR_TK", "INTEGRAL_TK", "FLOAT_TK", ! "DOUBLE_TK", "FP_TK", "ID_TK", "REL_QM_TK", "REL_CL_TK", "NOT_TK", ! "NEG_TK", "ASSIGN_ANY_TK", "ASSIGN_TK", "OP_TK", "CP_TK", "OCB_TK", ! "CCB_TK", "OSB_TK", "CSB_TK", "SC_TK", "C_TK", "DOT_TK", ! "STRING_LIT_TK", "CHAR_LIT_TK", "INT_LIT_TK", "FP_LIT_TK", "TRUE_TK", ! "FALSE_TK", "BOOL_LIT_TK", "NULL_TK", "$accept", "goal", "literal", "type", "primitive_type", "reference_type", "class_or_interface_type", "class_type", "interface_type", "array_type", "name", "simple_name", "qualified_name", "identifier", "compilation_unit", --- 502,514 ---- "ELSE_TK", "INSTANCEOF_TK", "RETURN_TK", "VOID_TK", "CATCH_TK", "INTERFACE_TK", "CASE_TK", "EXTENDS_TK", "FINALLY_TK", "SUPER_TK", "WHILE_TK", "CLASS_TK", "SWITCH_TK", "CONST_TK", "TRY_TK", "FOR_TK", ! "NEW_TK", "CONTINUE_TK", "GOTO_TK", "PACKAGE_TK", "THIS_TK", ! "ASSERT_TK", "BYTE_TK", "SHORT_TK", "INT_TK", "LONG_TK", "CHAR_TK", ! "INTEGRAL_TK", "FLOAT_TK", "DOUBLE_TK", "FP_TK", "ID_TK", "REL_QM_TK", ! "REL_CL_TK", "NOT_TK", "NEG_TK", "ASSIGN_ANY_TK", "ASSIGN_TK", "OP_TK", ! "CP_TK", "OCB_TK", "CCB_TK", "OSB_TK", "CSB_TK", "SC_TK", "C_TK", ! "DOT_TK", "STRING_LIT_TK", "CHAR_LIT_TK", "INT_LIT_TK", "FP_LIT_TK", ! "TRUE_TK", "FALSE_TK", "BOOL_LIT_TK", "NULL_TK", "goal", "literal", "type", "primitive_type", "reference_type", "class_or_interface_type", "class_type", "interface_type", "array_type", "name", "simple_name", "qualified_name", "identifier", "compilation_unit", *************** static const char *const yytname[] = *** 789,800 **** "class_body_declaration", "class_member_declaration", "field_declaration", "variable_declarators", "variable_declarator", "variable_declarator_id", "variable_initializer", "method_declaration", ! "method_header", "method_declarator", "formal_parameter_list", "formal_parameter", "throws", "class_type_list", "method_body", "static_initializer", "static", "constructor_declaration", "constructor_declarator", "constructor_body", "explicit_constructor_invocation", "this_or_super", ! "interface_declaration", "@3", "@4", "@5", "@6", "extends_interfaces", "interface_body", "interface_member_declarations", "interface_member_declaration", "constant_declaration", "abstract_method_declaration", "array_initializer", --- 520,531 ---- "class_body_declaration", "class_member_declaration", "field_declaration", "variable_declarators", "variable_declarator", "variable_declarator_id", "variable_initializer", "method_declaration", ! "@3", "method_header", "method_declarator", "formal_parameter_list", "formal_parameter", "throws", "class_type_list", "method_body", "static_initializer", "static", "constructor_declaration", "constructor_declarator", "constructor_body", "explicit_constructor_invocation", "this_or_super", ! "interface_declaration", "@4", "@5", "@6", "@7", "extends_interfaces", "interface_body", "interface_member_declarations", "interface_member_declaration", "constant_declaration", "abstract_method_declaration", "array_initializer", *************** static const char *const yytname[] = *** 811,821 **** "for_statement", "for_statement_nsi", "for_header", "for_begin", "for_init", "for_update", "statement_expression_list", "break_statement", "continue_statement", "return_statement", ! "throw_statement", "synchronized_statement", "synchronized", ! "try_statement", "catches", "catch_clause", "finally", "primary", ! "primary_no_new_array", "type_literals", ! "class_instance_creation_expression", "anonymous_class_creation", "@7", ! "@8", "something_dot_new", "argument_list", "array_creation_expression", "dim_exprs", "dim_expr", "dims", "field_access", "method_invocation", "array_access", "postfix_expression", "post_increment_expression", "post_decrement_expression", "unary_expression", --- 542,552 ---- "for_statement", "for_statement_nsi", "for_header", "for_begin", "for_init", "for_update", "statement_expression_list", "break_statement", "continue_statement", "return_statement", ! "throw_statement", "assert_statement", "synchronized_statement", ! "synchronized", "try_statement", "catches", "catch_clause", "finally", ! "primary", "primary_no_new_array", "type_literals", ! "class_instance_creation_expression", "anonymous_class_creation", "@8", ! "@9", "something_dot_new", "argument_list", "array_creation_expression", "dim_exprs", "dim_expr", "dims", "field_access", "method_invocation", "array_access", "postfix_expression", "post_increment_expression", "post_decrement_expression", "unary_expression", *************** static const char *const yytname[] = *** 831,909 **** }; #endif ! # ifdef YYPRINT ! /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to ! token YYLEX-NUM. */ ! static const unsigned short yytoknum[] = ! { ! 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, ! 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, ! 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, ! 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, ! 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, ! 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, ! 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, ! 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, ! 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, ! 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, ! 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, ! 365 ! }; ! # endif ! ! /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ ! static const unsigned short yyr1[] = { ! 0, 111, 112, 113, 113, 113, 113, 113, 113, 114, ! 114, 115, 115, 115, 116, 116, 117, 118, 119, 120, ! 120, 121, 121, 122, 123, 124, 125, 125, 125, 125, ! 125, 125, 125, 125, 126, 126, 127, 127, 128, 129, ! 129, 130, 131, 132, 132, 132, 133, 133, 135, 134, ! 136, 134, 137, 137, 138, 138, 139, 139, 140, 140, ! 141, 141, 142, 142, 142, 142, 143, 143, 143, 143, ! 143, 144, 144, 145, 145, 146, 146, 147, 147, 148, ! 148, 149, 150, 150, 150, 150, 151, 151, 151, 152, ! 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, ! 158, 159, 159, 159, 159, 160, 160, 161, 161, 161, ! 161, 162, 162, 162, 162, 163, 163, 165, 164, 166, ! 164, 167, 164, 168, 164, 169, 169, 170, 170, 171, ! 171, 172, 172, 172, 172, 173, 174, 175, 175, 175, ! 175, 176, 176, 177, 177, 178, 178, 179, 179, 179, ! 180, 181, 181, 182, 182, 182, 182, 182, 182, 183, ! 183, 183, 183, 183, 184, 184, 184, 184, 184, 184, ! 184, 184, 184, 184, 184, 185, 186, 187, 188, 189, ! 190, 190, 190, 190, 190, 190, 190, 191, 192, 193, ! 194, 195, 195, 195, 195, 196, 196, 197, 198, 198, ! 199, 199, 200, 201, 202, 203, 204, 205, 205, 206, ! 206, 207, 208, 209, 209, 209, 210, 210, 211, 211, ! 212, 212, 213, 213, 214, 214, 215, 216, 216, 217, ! 218, 218, 218, 219, 219, 220, 221, 222, 222, 223, ! 223, 223, 223, 223, 223, 223, 223, 223, 224, 224, ! 224, 224, 225, 225, 225, 225, 225, 225, 225, 227, ! 226, 228, 226, 229, 229, 230, 230, 230, 231, 231, ! 231, 231, 231, 231, 232, 232, 233, 234, 234, 235, ! 235, 236, 236, 236, 236, 236, 236, 237, 237, 238, ! 238, 238, 238, 239, 240, 241, 241, 241, 241, 241, ! 242, 243, 244, 244, 244, 244, 245, 245, 245, 245, ! 246, 246, 246, 246, 247, 247, 247, 248, 248, 248, ! 248, 249, 249, 249, 249, 249, 249, 250, 250, 250, ! 251, 251, 252, 252, 253, 253, 254, 254, 255, 255, ! 256, 256, 257, 257, 258, 259, 259, 259, 260, 260, ! 261, 262 }; ! /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ! static const unsigned char yyr2[] = { ! 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, ! 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, ! 2, 1, 1, 1, 3, 1, 0, 1, 1, 1, ! 2, 2, 2, 3, 1, 2, 1, 2, 3, 1, ! 1, 3, 5, 1, 1, 1, 1, 2, 0, 7, ! 0, 6, 0, 2, 0, 2, 1, 3, 2, 3, ! 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, ! 1, 3, 4, 1, 3, 1, 3, 1, 3, 1, ! 1, 2, 3, 3, 4, 4, 3, 4, 3, 1, 3, 2, 3, 0, 2, 1, 3, 1, 1, 2, 1, 3, 4, 4, 5, 3, 4, 2, 3, 3, 4, 4, 5, 7, 6, 1, 1, 0, 4, 0, --- 562,620 ---- }; #endif ! /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ ! static const short yyr1[] = { ! 0, 112, 113, 113, 113, 113, 113, 113, 114, 114, ! 115, 115, 115, 116, 116, 117, 118, 119, 120, 120, ! 121, 121, 122, 123, 124, 125, 125, 125, 125, 125, ! 125, 125, 125, 126, 126, 127, 127, 128, 129, 129, ! 130, 131, 132, 132, 132, 133, 133, 135, 134, 136, ! 134, 137, 137, 138, 138, 139, 139, 140, 140, 141, ! 141, 142, 142, 142, 142, 143, 143, 143, 143, 143, ! 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, ! 150, 149, 151, 151, 151, 151, 152, 152, 152, 153, ! 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, ! 159, 160, 160, 160, 160, 161, 161, 162, 162, 162, ! 162, 163, 163, 163, 163, 164, 164, 166, 165, 167, ! 165, 168, 165, 169, 165, 170, 170, 171, 171, 172, ! 172, 173, 173, 173, 173, 174, 175, 176, 176, 176, ! 176, 177, 177, 178, 178, 179, 179, 180, 180, 180, ! 181, 182, 182, 183, 183, 183, 183, 183, 183, 184, ! 184, 184, 184, 184, 185, 185, 185, 185, 185, 185, ! 185, 185, 185, 185, 185, 185, 186, 187, 188, 189, ! 190, 191, 191, 191, 191, 191, 191, 191, 192, 193, ! 194, 195, 196, 196, 196, 196, 197, 197, 198, 199, ! 199, 200, 200, 201, 202, 203, 204, 205, 206, 206, ! 207, 207, 208, 209, 210, 210, 210, 211, 211, 212, ! 212, 213, 213, 214, 214, 215, 215, 216, 217, 217, ! 217, 217, 218, 218, 219, 220, 220, 220, 221, 221, ! 222, 223, 224, 224, 225, 225, 225, 225, 225, 225, ! 225, 225, 225, 226, 226, 226, 226, 227, 227, 227, ! 227, 227, 227, 227, 229, 228, 230, 228, 231, 231, ! 232, 232, 232, 233, 233, 233, 233, 233, 233, 234, ! 234, 235, 236, 236, 237, 237, 238, 238, 238, 238, ! 238, 238, 239, 239, 240, 240, 240, 240, 241, 242, ! 243, 243, 243, 243, 243, 244, 245, 246, 246, 246, ! 246, 247, 247, 247, 247, 248, 248, 248, 248, 249, ! 249, 249, 250, 250, 250, 250, 251, 251, 251, 251, ! 251, 251, 252, 252, 252, 253, 253, 254, 254, 255, ! 255, 256, 256, 257, 257, 258, 258, 259, 259, 260, ! 261, 261, 261, 262, 262, 263, 264 }; ! /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ ! static const short yyr2[] = { ! 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, ! 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, ! 1, 1, 1, 3, 1, 0, 1, 1, 1, 2, ! 2, 2, 3, 1, 2, 1, 2, 3, 1, 1, ! 3, 5, 1, 1, 1, 1, 2, 0, 7, 0, ! 6, 0, 2, 0, 2, 1, 3, 2, 3, 1, ! 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, ! 3, 4, 1, 3, 1, 3, 1, 3, 1, 1, ! 0, 3, 3, 3, 4, 4, 3, 4, 3, 1, 3, 2, 3, 0, 2, 1, 3, 1, 1, 2, 1, 3, 4, 4, 5, 3, 4, 2, 3, 3, 4, 4, 5, 7, 6, 1, 1, 0, 4, 0, *************** static const unsigned char yyr2[] = *** 912,1844 **** 4, 1, 3, 2, 3, 1, 2, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ! 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, ! 1, 1, 1, 1, 1, 1, 1, 5, 7, 7, ! 5, 2, 3, 3, 4, 1, 2, 2, 1, 2, ! 3, 2, 4, 2, 2, 1, 7, 7, 6, 7, ! 6, 2, 2, 0, 1, 1, 0, 1, 1, 3, ! 2, 3, 2, 3, 2, 3, 3, 5, 5, 1, ! 3, 3, 4, 1, 2, 5, 2, 1, 1, 1, ! 1, 3, 1, 1, 1, 1, 1, 3, 3, 3, ! 3, 3, 5, 4, 1, 4, 5, 5, 6, 0, ! 6, 0, 7, 3, 3, 1, 3, 3, 3, 3, ! 4, 4, 4, 4, 1, 2, 3, 2, 3, 3, ! 3, 3, 4, 5, 6, 5, 6, 4, 4, 1, ! 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, ! 2, 2, 1, 2, 2, 1, 5, 4, 4, 5, ! 1, 3, 3, 3, 1, 3, 3, 1, 3, 3, ! 3, 1, 3, 3, 3, 3, 3, 1, 3, 3, ! 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, ! 1, 5, 1, 1, 3, 1, 1, 1, 1, 1, ! 1, 1 }; ! /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state ! STATE-NUM when YYTABLE doesn't specify something else to do. Zero ! means the default is an error. */ ! static const unsigned short yydefact[] = { ! 26, 46, 0, 0, 0, 0, 175, 0, 2, 28, ! 29, 27, 34, 39, 40, 36, 0, 43, 44, 45, ! 25, 0, 21, 22, 23, 117, 52, 0, 1, 32, ! 35, 37, 30, 31, 47, 0, 0, 41, 0, 0, ! 0, 121, 0, 54, 38, 0, 33, 119, 52, 0, ! 24, 18, 125, 16, 0, 118, 0, 0, 17, 53, ! 0, 50, 0, 123, 54, 42, 13, 0, 11, 12, ! 127, 0, 9, 10, 14, 15, 16, 0, 133, 135, ! 0, 134, 0, 129, 131, 132, 126, 122, 56, 55, ! 0, 120, 0, 48, 0, 93, 77, 0, 73, 75, ! 93, 0, 19, 20, 0, 0, 136, 128, 130, 0, ! 0, 51, 124, 0, 0, 0, 0, 83, 71, 0, ! 0, 0, 82, 277, 0, 93, 0, 93, 57, 46, ! 0, 58, 21, 0, 68, 0, 60, 62, 66, 67, ! 0, 63, 0, 64, 93, 69, 65, 70, 49, 86, ! 0, 0, 0, 89, 95, 94, 88, 77, 74, 0, ! 0, 0, 0, 0, 0, 0, 240, 0, 0, 0, ! 0, 7, 6, 3, 4, 5, 8, 239, 0, 0, ! 290, 76, 80, 289, 237, 246, 242, 254, 0, 238, ! 243, 244, 245, 302, 291, 292, 310, 295, 296, 299, ! 305, 314, 317, 321, 327, 330, 332, 334, 336, 338, ! 340, 342, 350, 343, 0, 79, 78, 278, 85, 72, ! 84, 46, 0, 0, 205, 0, 0, 0, 0, 0, ! 0, 0, 0, 143, 0, 9, 15, 290, 23, 0, ! 149, 164, 0, 145, 147, 0, 148, 153, 165, 0, ! 154, 166, 0, 155, 156, 167, 0, 157, 0, 168, ! 158, 213, 0, 169, 170, 171, 173, 172, 0, 174, ! 242, 244, 0, 183, 184, 181, 182, 180, 0, 93, ! 59, 61, 98, 81, 97, 99, 0, 91, 0, 87, ! 0, 0, 290, 243, 245, 297, 298, 301, 300, 0, ! 0, 0, 17, 0, 303, 304, 0, 290, 0, 137, ! 0, 141, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 294, 293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 348, 349, 0, 0, 0, 220, ! 0, 224, 0, 0, 0, 0, 211, 222, 0, 0, ! 151, 176, 0, 144, 146, 150, 229, 177, 179, 203, ! 0, 0, 215, 218, 212, 214, 0, 0, 105, 0, ! 0, 0, 101, 92, 90, 96, 251, 280, 0, 268, ! 274, 0, 269, 0, 0, 0, 19, 20, 241, 139, ! 138, 0, 250, 249, 281, 0, 265, 0, 248, 263, ! 247, 264, 279, 0, 0, 311, 312, 313, 315, 316, ! 318, 319, 320, 323, 325, 322, 324, 0, 326, 328, ! 329, 331, 333, 335, 337, 339, 0, 344, 0, 226, ! 221, 225, 0, 0, 0, 0, 230, 233, 231, 223, ! 241, 152, 0, 0, 216, 0, 0, 106, 102, 116, ! 240, 107, 290, 0, 0, 0, 103, 0, 0, 275, ! 270, 273, 271, 272, 253, 0, 307, 0, 0, 308, ! 140, 142, 282, 0, 287, 0, 288, 255, 0, 0, ! 0, 202, 0, 0, 236, 234, 232, 0, 219, 0, ! 217, 216, 0, 104, 0, 108, 0, 0, 109, 285, ! 0, 276, 0, 252, 306, 309, 267, 266, 283, 0, ! 256, 257, 341, 0, 187, 0, 153, 0, 160, 161, ! 0, 162, 163, 0, 0, 190, 0, 0, 0, 0, ! 228, 227, 0, 110, 0, 0, 286, 260, 0, 284, ! 258, 0, 0, 178, 204, 0, 0, 0, 191, 0, ! 195, 0, 198, 0, 0, 208, 0, 0, 111, 0, ! 262, 0, 188, 216, 0, 201, 351, 0, 193, 196, ! 0, 192, 197, 199, 235, 206, 207, 0, 0, 112, ! 0, 0, 216, 200, 194, 114, 0, 0, 0, 0, ! 113, 0, 210, 0, 189, 209 }; - /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { ! -1, 7, 177, 234, 178, 73, 74, 59, 52, 179, ! 180, 22, 23, 24, 8, 9, 10, 11, 12, 13, ! 14, 15, 239, 240, 113, 90, 43, 61, 89, 111, ! 135, 136, 137, 79, 97, 98, 99, 181, 139, 80, ! 95, 152, 153, 117, 155, 283, 141, 142, 143, 144, ! 382, 463, 464, 18, 40, 62, 57, 92, 41, 55, ! 82, 83, 84, 85, 182, 312, 241, 582, 243, 244, ! 245, 246, 525, 247, 248, 249, 250, 528, 251, 252, ! 253, 254, 529, 255, 535, 559, 560, 561, 562, 256, ! 257, 531, 258, 259, 260, 532, 261, 262, 374, 499, ! 500, 263, 264, 265, 266, 267, 268, 269, 446, 447, ! 448, 183, 184, 185, 186, 187, 512, 548, 188, 405, ! 189, 389, 390, 103, 190, 191, 192, 193, 194, 195, ! 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, ! 206, 207, 208, 209, 210, 211, 212, 213, 214, 346, ! 406, 577 }; - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ - #define YYPACT_NINF -489 static const short yypact[] = { ! 55, -489, -68, -68, -68, -68, -489, 61, -489, -22, ! 100, -22, -489, -489, -489, -489, 104, -489, -489, -489, ! -489, 191, -489, -489, -489, 77, 114, 203, -489, 100, ! -489, -489, -22, 100, -489, -68, -68, -489, 4, -68, ! -25, 87, -68, 65, -489, -68, 100, 77, 114, 121, ! -489, -489, -489, 97, 303, -489, -68, -25, -489, -489, ! -68, -489, -25, 87, 65, -489, -489, -68, -489, -489, ! -489, -68, 116, -489, -489, -489, 190, 451, -489, -489, ! 132, -489, 431, -489, -489, -489, -489, -489, -489, 136, ! 149, -489, -25, -489, 196, -39, 196, 6, -489, 36, ! -39, 223, 204, 204, -68, -68, -489, -489, -489, -68, ! 542, -489, -489, 149, 224, -68, 263, -489, -489, -68, ! 1668, 270, -489, -489, 285, -39, 159, -39, -489, 229, ! 2541, -489, 340, 451, -489, 674, -489, -489, -489, -489, ! 238, -489, 343, -489, 394, -489, -489, -489, -489, -489, ! -68, 84, 139, -489, -489, 296, -489, -489, -489, 2340, ! 2340, 2340, 2340, 356, 368, 143, -489, 2340, 2340, 2340, ! 1541, -489, -489, -489, -489, -489, -489, -489, 237, 371, ! 645, -489, -489, 392, 383, -489, -489, -489, -68, -489, ! 188, -489, 300, 379, -489, -489, -489, -489, -489, -489, ! -489, 461, 475, 488, 425, 490, 489, 500, 502, 509, ! 9, -489, -489, -489, 429, -489, -489, -489, -489, -489, ! -489, 442, 445, 2340, -489, 89, 1719, 449, 452, 343, ! 454, 119, 2340, -489, -68, 237, 371, 283, 436, 265, ! -489, -489, 2608, -489, -489, 450, -489, -489, -489, 3010, ! -489, -489, 457, -489, -489, -489, 3010, -489, 3010, -489, ! -489, 3128, 464, -489, -489, -489, -489, -489, 458, -489, ! 169, 217, 379, 521, 526, -489, -489, -489, 245, 394, ! -489, -489, -489, -489, -489, -489, 473, 483, -68, -489, ! 344, -68, 338, -489, -489, -489, -489, -489, -489, 514, ! -68, 494, 494, 505, -489, -489, 118, 645, 506, -489, ! 510, -489, 256, 538, 540, 1780, 1831, 493, 96, 2340, ! 515, -489, -489, 2340, 2340, 2340, 2340, 2340, 2340, 2340, ! 2340, 2340, 2340, 2340, 2340, 143, 2340, 2340, 2340, 2340, ! 2340, 2340, 2340, 2340, -489, -489, 2340, 2340, 511, -489, ! 512, -489, 513, 2340, 2340, 318, -489, -489, 519, 525, ! 520, -489, -68, -489, -489, -489, -489, -489, -489, -489, ! 555, 84, -489, -489, -489, 523, 1892, 2340, -489, 157, ! 473, 2675, 527, 483, -489, -489, -489, 539, 1831, 494, ! -489, 378, 494, 378, 1943, 2340, -77, 59, 1073, -489, ! -489, 1607, -489, -489, -489, 225, -489, 532, -489, -489, ! -489, -489, 543, 535, 2004, -489, -489, -489, 461, 461, ! 475, 475, 475, 488, 488, 488, 488, 116, -489, 425, ! 425, 490, 489, 500, 502, 509, 552, -489, 549, -489, ! -489, -489, 550, 553, 556, 343, 318, -489, -489, -489, ! -489, 520, 557, 1150, 1150, 559, 560, -489, 563, 368, ! 558, -489, 609, 2742, 566, 2809, -489, 2055, 567, -489, ! 204, -489, 204, -489, 561, 255, -489, 2340, 1073, -489, ! -489, -489, -489, 1476, -489, 2116, -489, 149, 301, 2340, ! 3077, -489, 573, 344, -489, -489, -489, 2340, -489, 576, ! 523, 1150, 7, -489, 314, -489, 2876, 2167, -489, -489, ! 346, -489, 149, 577, -489, -489, -489, -489, -489, 355, ! -489, 149, -489, 578, -489, 618, 619, 3077, -489, -489, ! 3077, -489, -489, 579, 17, -489, 582, 587, 3010, 589, ! -489, -489, 591, -489, 592, 360, -489, -489, 149, -489, ! -489, 2340, 3010, -489, -489, 2228, 608, 2340, -489, 18, ! -489, 2407, -489, 343, 598, -489, 3010, 2279, -489, 600, ! -489, 613, -489, 1150, 612, -489, -489, 620, -489, -489, ! 2474, -489, 2943, -489, -489, -489, -489, 614, 370, -489, ! 3077, 621, 1150, -489, -489, -489, 615, 656, 3077, 622, ! -489, 3077, -489, 3077, -489, -489 }; - /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { ! -489, -489, -489, 194, 375, 384, -19, -111, 0, 23, ! 82, -82, -489, -3, -489, 710, 166, -489, 54, -489, ! -489, 253, 16, 695, -489, -489, 678, 658, -489, -84, ! -489, 594, -489, -60, -95, 611, -139, -163, -489, -52, ! 152, 455, -285, -70, -489, -489, -489, -489, -489, 599, ! 364, -489, -489, -15, -489, -489, -489, -489, 688, -45, ! -489, 666, -489, -489, 99, -489, -104, -127, -240, -489, ! 479, 327, -458, -438, 778, -417, -489, -489, -489, -218, ! -489, -489, -489, -489, -489, -489, 192, 205, -468, -408, ! -489, -489, -489, -489, -489, -489, -489, -303, -489, -488, ! 491, -489, -489, -489, -489, -489, -489, -489, -489, 304, ! 307, -489, -489, -489, 88, -489, -489, -489, -489, -306, ! -489, 456, -313, -28, 1131, 193, 1179, 374, 432, 537, ! 43, 642, 776, -384, -489, 264, 226, 199, 260, 424, ! 426, 423, 427, 434, -489, 278, 435, 821, -489, -489, ! 942, -489 }; ! /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If ! positive, shift that token. If negative, reduce the rule which ! number is the opposite. If zero, do what YYDEFACT says. ! If YYTABLE_NINF, syntax error. */ ! #define YYTABLE_NINF -348 static const short yytable[] = { ! 25, 26, 364, 242, 154, 384, 146, 311, 540, 49, ! 126, 287, 87, 539, 479, 115, 16, 91, 477, 20, ! 51, 124, 1, 58, 342, 16, 16, 16, 132, 148, ! 122, 146, 47, 48, 2, 50, 284, 51, 285, 81, ! 3, 51, 50, 373, 102, 16, 4, 112, 16, 16, ! 138, 132, 526, 132, 303, 218, 86, 220, 140, 116, ! 88, 28, 16, 30, 94, 556, 556, 81, 96, 553, ! 77, 54, 554, 527, 286, 138, 469, 75, 6, 469, ! 557, 557, 530, 140, 21, 591, 30, 27, 475, 526, ! 51, 20, 526, 583, 515, 145, 58, 343, 77, 1, ! 75, 94, 96, 130, 599, 75, 118, 119, 488, 128, ! 527, 2, 583, 527, 558, 578, 157, 3, 60, 530, ! 145, 53, 530, 4, 53, 355, 133, 238, 34, 120, ! 151, 5, 597, 75, 121, 66, 76, 75, 53, 360, ! 602, 39, 53, 604, 1, 605, 302, 157, 34, 383, ! 102, 133, 526, 236, 478, 6, 75, 124, 75, 76, ! 526, 510, 3, 526, 76, 526, 35, 68, 4, 411, ! 69, 20, 36, 527, 75, 29, 20, 33, 42, 519, ! 385, 527, 530, 20, 527, 320, 527, 533, 56, 349, ! 530, 53, 76, 530, 66, 530, 76, 53, 46, 45, ! 6, 545, 295, 296, 297, 298, 20, 102, 536, 380, ! 304, 305, 237, 395, 101, 76, 101, 76, 270, 357, ! 313, 65, 350, 100, 533, 364, 68, 533, 358, 69, ! 20, 157, 106, 76, 289, 498, 373, 109, 481, 238, ! 290, 292, 292, 292, 292, 110, 238, 53, 71, 292, ! 292, 307, 457, 238, 465, 238, 125, 127, 290, 219, ! 119, 588, 75, 31, -186, 236, 364, 451, 1, -186, ! -186, 105, 58, 391, 393, 66, 71, 371, 396, 397, ! -346, -346, 31, 373, 236, 157, 31, 533, 101, 1, ! 114, 37, 45, 38, 151, 533, 66, 387, 533, 31, ! 533, 75, 124, 44, 71, 45, 151, 68, 150, 34, ! 69, 20, -185, 75, 50, 412, 66, -185, -185, 149, ! 482, 76, 123, 271, 237, -100, 483, 105, 68, 71, ! 270, 69, 20, 36, 130, 101, 506, 270, 282, 313, ! 378, 494, 364, 237, 270, 288, 270, 1, 68, 270, ! 513, 69, 20, 400, 66, 373, 483, 401, 75, 157, ! 76, 470, 156, 67, 472, 3, 415, 416, 417, 216, ! -16, 4, 76, 53, 373, -345, -345, 315, 238, 444, ! 542, 316, 408, 445, 217, 317, 68, 409, 1, 69, ! 20, 410, -347, -347, 75, 66, 521, 291, 541, 102, ! 70, 20, 483, 520, 236, 292, 292, 292, 292, 292, ! 292, 292, 292, 292, 292, 292, 292, 76, 292, 292, ! 292, 292, 292, 292, 292, 321, 322, 68, 547, 72, ! 69, 20, 315, 362, 278, 271, 316, 550, 476, 130, ! 317, 546, 271, 331, 332, 333, 334, 483, 115, 271, ! 549, 271, 72, 76, 271, 569, 483, 72, 299, 584, ! 238, 483, 238, 462, 570, 596, 323, 324, 325, 270, ! 300, 483, 150, 314, 170, 1, 124, 292, 326, 327, ! 292, 319, 66, 335, 150, 72, 236, 238, 236, 72, ! 471, 67, 473, 3, 318, 34, 328, 329, 330, 4, ! 338, 50, 66, 238, 272, 235, 336, 337, 72, 151, ! 72, 104, 339, 35, 68, 340, 75, 69, 20, 36, ! 514, 344, 345, 341, 238, 361, 72, 238, 107, 236, ! 423, 424, 425, 426, 68, 238, -229, 69, 20, 347, ! 301, 270, 270, 353, 306, 237, 354, 237, 356, 238, ! 365, 270, 377, 270, 420, 421, 422, 368, 238, 292, ! 292, 408, 273, 238, 376, 362, 409, -291, -291, 381, ! 410, 292, -292, -292, 271, 76, 367, 238, 270, 238, ! 20, 121, 386, 369, 236, 370, 129, 238, 237, 270, ! 418, 419, 388, 66, 270, 238, 429, 430, 238, 394, ! 238, 398, 67, 236, 3, 236, 402, 399, 403, 414, ! 4, 439, 440, 441, 72, 270, 272, 235, 270, 449, ! 450, 119, 452, 272, 453, 68, 270, 466, 69, 20, ! 272, 484, 272, 467, 486, 272, 235, 485, 130, 131, ! 270, 489, 6, 237, 490, 491, 271, 271, 492, 270, ! 493, 497, -115, 72, 270, 502, 271, -259, 271, 501, ! 507, 270, 237, 503, 237, 72, 511, 274, 270, 534, ! 270, 538, 551, -261, 273, 552, -159, 563, 270, 555, ! 270, 273, 564, 271, 566, 567, 270, 150, 273, 270, ! 273, 270, 568, 273, 271, 17, -16, 575, 585, 271, ! 589, -345, -345, 315, 17, 17, 17, 316, 590, 593, ! 427, 504, 592, 601, 595, 600, 598, 603, 129, 428, ! 271, 32, 93, 271, 17, 66, 64, 17, 17, 281, ! 158, 271, 279, 379, 67, 63, 3, -345, -345, 315, ! 372, 17, 4, 316, 458, 271, 72, 317, 108, 78, ! 495, 579, 375, 496, 271, 272, 235, 68, 392, 271, ! 69, 20, 431, 433, 580, 432, 271, 522, 434, 0, ! 130, 280, 275, 271, 6, 271, 435, 78, 19, 274, ! 0, 437, 0, 271, 0, 271, 274, 19, 19, 19, ! 0, 271, 0, 274, 271, 274, 271, 0, 274, 0, ! 0, 0, 0, 0, 0, 134, 0, 19, 0, 0, ! 19, 19, 0, 273, 0, 0, 0, 524, 0, 0, ! 0, 0, 0, 0, 19, 0, 0, 272, 272, 0, ! 134, 0, 0, 0, 0, 0, 0, 272, 235, 272, ! 235, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 367, 0, 0, 369, 0, 0, ! 0, 0, 0, 0, 272, 565, 0, 0, 72, 0, ! 0, 0, 0, 0, 0, 272, 0, 0, 0, 572, ! 272, 235, 0, 0, 275, 273, 273, 0, 147, 0, ! 0, 275, 0, 586, 0, 273, 0, 273, 275, 0, ! 275, 272, 0, 275, 272, 0, 276, 0, 0, 0, ! 0, 0, 272, 147, 0, 0, 0, 524, 274, 0, ! 0, 0, 273, 0, 0, 565, 272, 0, 572, 0, ! 586, 0, 0, 273, 0, 272, 235, 0, 273, 0, ! 272, 0, 0, 0, 0, 0, 0, 272, 0, 0, ! 0, 277, 0, 0, 272, 235, 272, 235, 0, 273, ! 0, 0, 273, 0, 272, 0, 272, 0, 0, 0, ! 273, 0, 272, 0, 0, 272, 0, 272, 0, 0, ! 0, 0, 0, 0, 273, 0, 0, 0, 0, 0, ! 274, 274, 0, 273, 0, 0, 0, 0, 273, 0, ! 274, 0, 274, 0, 0, 273, 0, 0, 0, 0, ! 0, 0, 273, 0, 273, 0, 0, 0, 276, 0, ! 0, 0, 273, 275, 273, 276, 0, 274, 0, 0, ! 273, 0, 276, 273, 276, 273, 0, 276, 274, 0, ! 0, 0, 0, 274, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 215, 277, 274, 0, 0, 274, 0, 0, ! 277, 0, 0, 0, 0, 274, 0, 277, 0, 277, ! 0, 0, 277, 0, 0, 0, 0, 0, 0, 274, ! 0, 0, 0, 0, 0, 275, 275, 0, 274, 0, ! 0, 0, 0, 274, 0, 275, 0, 275, 0, 0, ! 274, 308, 215, 0, 0, 0, 0, 274, 0, 274, ! 0, 0, 0, 0, 66, 0, 0, 274, 0, 274, ! 0, 0, 275, 163, 0, 274, 0, 0, 274, 164, ! 274, 0, 0, 275, 0, 0, 165, 0, 275, 0, ! 166, 0, 0, 0, 0, 0, 68, 276, 0, 69, ! 20, 0, 0, 167, 168, 348, 0, 169, 352, 275, ! 0, 0, 275, 0, 359, 0, 171, 172, 173, 174, ! 275, 0, 175, 176, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 275, 0, 161, 162, 0, 0, ! 0, 66, 277, 275, 0, 0, 0, 0, 275, 0, ! 163, 0, 0, 0, 0, 275, 164, 0, 0, 0, ! 0, 0, 275, 165, 275, 0, 0, 166, 0, 276, ! 276, 0, 275, 68, 275, 0, 69, 20, 0, 276, ! 275, 276, 0, 275, 232, 275, 0, 0, 0, 0, ! 0, 0, 0, 171, 172, 173, 174, 0, 407, 175, ! 176, 413, 0, 0, 0, 0, 276, 0, 0, 0, ! 0, 0, 0, 0, 277, 277, 0, 276, 0, 0, ! 0, 0, 276, 0, 277, 436, 277, 0, 0, 438, ! 293, 293, 293, 293, 0, 442, 443, 0, 293, 293, ! 0, 0, 0, 276, 0, 0, 276, 0, 0, 0, ! 0, 277, 0, 0, 276, 0, 0, 0, 455, 456, ! 0, 0, 277, 0, 0, 0, 0, 277, 276, 0, ! 468, 0, 0, 0, 0, 0, 0, 276, 294, 294, ! 294, 294, 276, 215, 0, 0, 294, 294, 277, 276, ! 0, 277, 0, 0, 0, 0, 276, 0, 276, 277, ! 0, 0, 0, 0, 0, 0, 276, 0, 276, 0, ! 0, 0, 0, 277, 276, 0, 0, 276, 0, 276, ! 0, 0, 277, 0, 0, 0, 0, 277, 0, 0, ! 0, 0, 0, 0, 277, 0, 0, 0, 0, 0, ! 0, 277, 0, 277, 0, 0, 0, 0, 0, 0, ! 0, 277, 0, 277, 0, 0, 0, 0, 0, 277, ! 0, 0, 277, 0, 277, 517, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 293, 293, 293, 293, 293, 293, ! 293, 293, 293, 293, 293, 293, 0, 293, 293, 293, ! 293, 293, 293, 293, 0, 0, 0, 516, 0, 159, ! 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 571, 0, 0, 0, 574, 0, 576, ! 0, 0, 294, 294, 294, 294, 294, 294, 294, 294, ! 294, 294, 294, 294, 0, 294, 294, 294, 294, 294, ! 294, 294, 161, 162, 0, 0, 293, 66, 0, 293, ! 0, 0, 0, 0, 0, 0, 163, 0, 0, 0, ! 0, 0, 164, 0, 159, 160, 0, 0, 0, 165, ! 0, 0, 0, 166, 0, 0, 0, 0, 0, 68, ! 0, 0, 69, 20, 0, 0, 167, 168, 0, 0, ! 169, 0, 0, 0, 294, 0, 0, 294, 0, 171, ! 172, 173, 174, 0, 0, 175, 176, 161, 162, 0, ! 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, ! 0, 163, 0, 0, 0, 0, 0, 164, 293, 293, ! 159, 160, 0, 0, 165, 0, 0, 0, 166, 0, ! 293, 0, 0, 0, 68, 0, 0, 69, 20, 0, ! 0, 167, 168, 0, 0, 169, 0, 170, 309, 0, ! 0, 0, 310, 0, 171, 172, 173, 174, 0, 0, ! 175, 176, 0, 161, 162, 0, 294, 294, 66, 0, ! 0, 0, 0, 0, 0, 0, 0, 163, 294, 0, ! 0, 159, 160, 164, 0, 0, 0, 0, 0, 0, ! 165, 0, 0, 0, 166, 0, 0, 0, 0, 0, ! 68, 0, 0, 69, 20, 0, 0, 167, 168, 0, ! 0, 169, 0, 170, 480, 0, 0, 0, 0, 0, ! 171, 172, 173, 174, 161, 162, 175, 176, 0, 66, ! 0, 0, 159, 160, 0, 0, 0, 0, 163, 0, ! 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, ! 0, 165, 0, 0, 0, 166, 0, 0, 0, 0, ! 0, 68, 0, 0, 69, 20, 0, 0, 167, 168, ! 0, 0, 169, 0, 170, 161, 162, 0, 0, 0, ! 66, 171, 172, 173, 174, 0, 0, 175, 176, 163, ! 0, 0, 0, 159, 160, 164, 0, 0, 0, 0, ! 0, 0, 165, 0, 0, 0, 166, 0, 0, 0, ! 0, 0, 68, 0, 0, 69, 20, 0, 0, 167, ! 168, 0, 0, 169, 0, 0, 0, 0, 0, 351, ! 0, 0, 171, 172, 173, 174, 161, 162, 175, 176, ! 0, 66, 0, 0, 159, 160, 0, 0, 0, 0, ! 163, 0, 0, 0, 0, 0, 164, 0, 0, 0, ! 0, 0, 0, 165, 0, 0, 0, 166, 0, 0, ! 0, 0, 0, 68, 0, 0, 69, 20, 0, 0, ! 167, 168, 0, 0, 169, 404, 0, 161, 162, 0, ! 0, 0, 66, 171, 172, 173, 174, 0, 0, 175, ! 176, 163, 0, 0, 0, 159, 160, 164, 0, 0, ! 0, 0, 0, 0, 165, 0, 0, 0, 166, 0, ! 0, 0, 0, 0, 68, 0, 0, 69, 20, 0, ! 0, 167, 168, 0, 0, 169, 0, 0, 0, 0, ! 123, 0, 0, 0, 171, 172, 173, 174, 161, 162, ! 175, 176, 0, 66, 0, 0, 159, 160, 0, 0, ! 0, 0, 163, 0, 0, 0, 0, 0, 164, 0, ! 0, 0, 0, 0, 0, 165, 0, 0, 0, 166, ! 0, 0, 0, 0, 0, 68, 0, 0, 69, 20, ! 0, 0, 167, 168, 0, 0, 169, 0, 0, 161, ! 162, 0, 454, 0, 66, 171, 172, 173, 174, 0, ! 0, 175, 176, 163, 0, 0, 0, 159, 160, 164, ! 0, 0, 0, 0, 0, 0, 165, 0, 0, 0, ! 166, 0, 0, 0, 0, 0, 68, 0, 0, 69, ! 20, 0, 0, 167, 168, 0, 0, 169, 474, 0, ! 0, 0, 0, 0, 0, 0, 171, 172, 173, 174, ! 161, 162, 175, 176, 0, 66, 0, 0, 159, 160, ! 0, 0, 0, 0, 163, 0, 0, 0, 0, 0, ! 164, 0, 0, 0, 0, 0, 0, 165, 0, 0, ! 0, 166, 0, 0, 0, 0, 0, 68, 0, 0, ! 69, 20, 0, 0, 167, 168, 0, 0, 169, 487, ! 0, 161, 162, 0, 0, 0, 66, 171, 172, 173, ! 174, 0, 0, 175, 176, 163, 0, 0, 0, 159, ! 160, 164, 0, 0, 0, 0, 0, 0, 165, 0, ! 0, 0, 166, 0, 0, 0, 0, 0, 68, 0, ! 0, 69, 20, 0, 0, 167, 168, 0, 0, 169, ! 509, 0, 0, 0, 0, 0, 0, 0, 171, 172, ! 173, 174, 161, 162, 175, 176, 0, 66, 0, 0, ! 159, 160, 0, 0, 0, 0, 163, 0, 0, 0, ! 0, 0, 164, 0, 0, 0, 0, 0, 0, 165, ! 0, 0, 0, 166, 0, 0, 0, 0, 0, 68, ! 0, 0, 69, 20, 0, 0, 167, 168, 0, 0, ! 169, 518, 0, 161, 162, 0, 0, 0, 66, 171, ! 172, 173, 174, 0, 0, 175, 176, 163, 0, 0, ! 0, 159, 160, 164, 0, 0, 0, 0, 0, 0, ! 165, 0, 0, 0, 166, 0, 0, 0, 0, 0, ! 68, 0, 0, 69, 20, 0, 0, 167, 168, 0, ! 0, 169, 544, 0, 0, 0, 0, 0, 0, 0, ! 171, 172, 173, 174, 161, 162, 175, 176, 0, 66, ! 0, 0, 159, 160, 0, 0, 0, 0, 163, 0, ! 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, ! 0, 165, 0, 0, 0, 166, 0, 0, 0, 0, ! 0, 68, 0, 0, 69, 20, 0, 0, 167, 168, ! 0, 0, 169, 0, 0, 161, 162, 0, 573, 0, ! 66, 171, 172, 173, 174, 0, 0, 175, 176, 163, ! 0, 0, 0, 159, 160, 164, 0, 0, 0, 0, ! 0, 0, 165, 0, 0, 0, 166, 0, 0, 0, ! 0, 0, 68, 0, 0, 69, 20, 0, 0, 167, ! 168, 0, 0, 169, 587, 0, 0, 0, 0, 0, ! 0, 0, 171, 172, 173, 174, 161, 162, 175, 176, ! 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, ! 163, 0, 0, 0, 0, 0, 164, 0, 0, 0, ! 0, 0, 0, 165, 0, 0, 0, 166, 0, 0, ! 0, 0, 0, 68, 0, 0, 69, 20, 0, 0, ! 167, 168, 0, 0, 169, 0, 0, 0, 0, 0, ! 0, 0, 0, 171, 172, 173, 174, 0, 0, 175, ! 176, 221, 0, 161, 162, 556, 222, 223, 66, 224, ! 0, 0, 225, 0, 0, 0, 226, 163, 0, 0, ! 557, 0, 0, 164, 227, 4, 228, 0, 229, 230, ! 165, 231, 0, 0, 166, 0, 0, 0, 0, 0, ! 68, 0, 0, 69, 20, 0, 0, 0, 0, 0, ! 0, 232, 0, 130, 581, 0, 0, 6, 0, 0, ! 171, 172, 173, 174, 0, 0, 175, 176, 221, 0, ! 161, 162, 556, 222, 223, 66, 224, 0, 0, 225, ! 0, 0, 0, 226, 163, 0, 0, 557, 0, 0, ! 164, 227, 4, 228, 0, 229, 230, 165, 231, 0, ! 0, 166, 0, 0, 0, 0, 0, 68, 0, 0, ! 69, 20, 0, 0, 0, 0, 0, 0, 232, 0, ! 130, 594, 0, 0, 6, 0, 0, 171, 172, 173, ! 174, 0, 0, 175, 176, 221, 0, 161, 162, 0, ! 222, 223, 66, 224, 0, 0, 225, 0, 0, 0, ! 226, 163, 0, 0, 0, 0, 0, 164, 227, 4, ! 228, 0, 229, 230, 165, 231, 0, 0, 166, 0, ! 0, 0, 0, 0, 68, 0, 0, 69, 20, 0, ! 0, 0, 0, 0, 0, 232, 0, 130, 233, 0, ! 0, 6, 0, 0, 171, 172, 173, 174, 0, 0, ! 175, 176, 221, 0, 161, 162, 0, 222, 223, 66, ! 224, 0, 0, 225, 0, 0, 0, 226, 163, 0, ! 0, 0, 0, 0, 164, 227, 4, 228, 0, 229, ! 230, 165, 231, 0, 0, 166, 0, 0, 0, 0, ! 0, 68, 0, 0, 69, 20, 0, 0, 0, 0, ! 0, 0, 232, 0, 130, 363, 0, 0, 6, 0, ! 0, 171, 172, 173, 174, 0, 0, 175, 176, 221, ! 0, 161, 162, 0, 222, 223, 66, 224, 0, 0, ! 225, 0, 0, 0, 226, 163, 0, 0, 0, 0, ! 0, 459, 227, 4, 228, 0, 229, 230, 165, 231, ! 0, 0, 460, 0, 0, 0, 0, 0, 68, 0, ! 0, 69, 20, 0, 0, 0, 0, 0, 0, 232, ! 0, 130, 461, 0, 0, 6, 0, 0, 171, 172, ! 173, 174, 0, 0, 175, 176, 221, 0, 161, 162, ! 0, 222, 223, 66, 224, 0, 0, 225, 0, 0, ! 0, 226, 163, 0, 0, 0, 0, 0, 164, 227, ! 4, 228, 0, 229, 230, 165, 231, 0, 0, 166, ! 0, 0, 0, 0, 0, 68, 0, 0, 69, 20, ! 0, 0, 0, 0, 0, 0, 232, 0, 130, 505, ! 0, 0, 6, 0, 0, 171, 172, 173, 174, 0, ! 0, 175, 176, 221, 0, 161, 162, 0, 222, 223, ! 66, 224, 0, 0, 225, 0, 0, 0, 226, 163, ! 0, 0, 0, 0, 0, 164, 227, 4, 228, 0, ! 229, 230, 165, 231, 0, 0, 166, 0, 0, 0, ! 0, 0, 68, 0, 0, 69, 20, 0, 0, 0, ! 0, 0, 0, 232, 0, 130, 508, 0, 0, 6, ! 0, 0, 171, 172, 173, 174, 0, 0, 175, 176, ! 221, 0, 161, 162, 0, 222, 223, 66, 224, 0, ! 0, 225, 0, 0, 0, 226, 163, 0, 0, 0, ! 0, 0, 164, 227, 4, 228, 0, 229, 230, 165, ! 231, 0, 0, 166, 0, 0, 0, 0, 0, 68, ! 0, 0, 69, 20, 0, 0, 0, 0, 0, 0, ! 232, 0, 130, 543, 0, 0, 6, 0, 0, 171, ! 172, 173, 174, 0, 0, 175, 176, 221, 0, 161, ! 162, 0, 222, 223, 66, 224, 0, 0, 225, 0, ! 0, 0, 226, 163, 0, 0, 0, 0, 0, 164, ! 227, 4, 228, 0, 229, 230, 165, 231, 0, 0, ! 166, 0, 0, 0, 0, 0, 68, 0, 0, 69, ! 20, 0, 0, 0, 0, 0, 0, 232, 0, 130, ! 0, 0, 0, 6, 0, 0, 171, 172, 173, 174, ! 0, 0, 175, 176, 366, 0, 161, 162, 0, 222, ! 223, 66, 224, 0, 0, 225, 0, 0, 0, 226, ! 163, 0, 0, 0, 0, 0, 164, 227, 0, 228, ! 0, 229, 230, 165, 231, 0, 0, 166, 0, 0, ! 0, 0, 0, 68, 0, 0, 69, 20, 0, 0, ! 0, 0, 0, 0, 232, 0, 130, 0, 0, 0, ! 6, 0, 0, 171, 172, 173, 174, 0, 0, 175, ! 176, 366, 0, 161, 162, 0, 523, 223, 66, 224, ! 0, 0, 225, 0, 0, 0, 226, 163, 0, 0, ! 0, 0, 0, 164, 227, 0, 228, 0, 229, 230, ! 165, 231, 0, 0, 166, 0, 0, 0, 0, 0, ! 68, 0, 0, 69, 20, 0, 0, 0, 0, 0, ! 0, 232, 1, 130, 161, 162, 0, 6, 0, 66, ! 171, 172, 173, 174, 0, 0, 175, 176, 163, 0, ! 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, ! 0, 165, 0, 0, 0, 166, 0, 0, 0, 0, ! 0, 68, 0, 0, 69, 20, 0, 0, 0, 0, ! 0, 0, 232, 0, 0, 0, 0, 0, 0, 0, ! 0, 171, 172, 173, 174, 0, 0, 175, 176 }; static const short yycheck[] = { ! 3, 4, 242, 130, 115, 290, 110, 170, 1, 5, ! 105, 150, 57, 501, 398, 54, 0, 62, 95, 87, ! 39, 98, 44, 42, 15, 9, 10, 11, 110, 113, ! 100, 135, 35, 36, 56, 38, 140, 56, 142, 54, ! 62, 60, 45, 261, 72, 29, 68, 92, 32, 33, ! 110, 133, 490, 135, 165, 125, 56, 127, 110, 98, ! 60, 0, 46, 9, 67, 48, 48, 82, 71, 527, ! 54, 96, 530, 490, 144, 135, 389, 54, 100, 392, ! 63, 63, 490, 135, 2, 573, 32, 5, 394, 527, ! 109, 87, 530, 561, 478, 110, 115, 88, 82, 44, ! 77, 104, 105, 96, 592, 82, 100, 101, 414, 109, ! 527, 56, 580, 530, 97, 97, 119, 62, 53, 527, ! 135, 39, 530, 68, 42, 229, 110, 130, 44, 93, ! 114, 76, 590, 110, 98, 51, 54, 114, 56, 234, ! 598, 64, 60, 601, 44, 603, 165, 150, 44, 288, ! 178, 135, 590, 130, 95, 100, 133, 98, 135, 77, ! 598, 467, 62, 601, 82, 603, 62, 83, 68, 73, ! 86, 87, 68, 590, 151, 9, 87, 11, 64, 485, ! 291, 598, 590, 87, 601, 188, 603, 490, 101, 100, ! 598, 109, 110, 601, 51, 603, 114, 115, 32, 102, ! 100, 507, 159, 160, 161, 162, 87, 235, 493, 279, ! 167, 168, 130, 95, 98, 133, 98, 135, 130, 100, ! 102, 100, 225, 71, 527, 465, 83, 530, 231, 86, ! 87, 234, 100, 151, 95, 453, 454, 101, 401, 242, ! 101, 159, 160, 161, 162, 96, 249, 165, 54, 167, ! 168, 169, 95, 256, 381, 258, 104, 105, 101, 100, ! 101, 567, 239, 10, 95, 242, 506, 362, 44, 100, ! 101, 77, 291, 301, 302, 51, 82, 261, 306, 307, ! 92, 93, 29, 501, 261, 288, 33, 590, 98, 44, ! 94, 100, 102, 102, 278, 598, 51, 300, 601, 46, ! 603, 278, 98, 100, 110, 102, 290, 83, 114, 44, ! 86, 87, 95, 290, 317, 318, 51, 100, 101, 95, ! 95, 239, 99, 130, 242, 96, 101, 133, 83, 135, ! 242, 86, 87, 68, 96, 98, 463, 249, 100, 102, ! 95, 445, 582, 261, 256, 151, 258, 44, 83, 261, ! 95, 86, 87, 97, 51, 573, 101, 101, 335, 362, ! 278, 389, 99, 60, 392, 62, 323, 324, 325, 99, ! 87, 68, 290, 291, 592, 92, 93, 94, 381, 61, ! 66, 98, 68, 65, 99, 102, 83, 73, 44, 86, ! 87, 77, 92, 93, 371, 51, 95, 101, 502, 427, ! 97, 87, 101, 487, 381, 323, 324, 325, 326, 327, ! 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, ! 338, 339, 340, 341, 342, 46, 47, 83, 512, 54, ! 86, 87, 94, 239, 94, 242, 98, 521, 395, 96, ! 102, 95, 249, 18, 19, 20, 21, 101, 54, 256, ! 95, 258, 77, 371, 261, 95, 101, 82, 102, 563, ! 463, 101, 465, 381, 548, 95, 5, 6, 7, 381, ! 102, 101, 278, 102, 96, 44, 98, 395, 3, 4, ! 398, 98, 51, 58, 290, 110, 463, 490, 465, 114, ! 391, 60, 393, 62, 102, 44, 8, 9, 10, 68, ! 11, 504, 51, 506, 130, 130, 16, 17, 133, 493, ! 135, 60, 12, 62, 83, 13, 493, 86, 87, 68, ! 477, 92, 93, 14, 527, 89, 151, 530, 97, 506, ! 331, 332, 333, 334, 83, 538, 94, 86, 87, 94, ! 165, 453, 454, 94, 169, 463, 94, 465, 94, 552, ! 100, 463, 94, 465, 328, 329, 330, 100, 561, 477, ! 478, 68, 130, 566, 100, 371, 73, 46, 47, 96, ! 77, 489, 46, 47, 381, 493, 249, 580, 490, 582, ! 87, 98, 68, 256, 561, 258, 44, 590, 506, 501, ! 326, 327, 98, 51, 506, 598, 336, 337, 601, 94, ! 603, 95, 60, 580, 62, 582, 68, 97, 68, 94, ! 68, 100, 100, 100, 239, 527, 242, 242, 530, 100, ! 95, 101, 67, 249, 101, 83, 538, 100, 86, 87, ! 256, 99, 258, 94, 99, 261, 261, 94, 96, 97, ! 552, 89, 100, 561, 95, 95, 453, 454, 95, 561, ! 94, 94, 94, 278, 566, 95, 463, 96, 465, 100, ! 94, 573, 580, 100, 582, 290, 99, 130, 580, 96, ! 582, 95, 94, 96, 242, 57, 57, 95, 590, 100, ! 592, 249, 95, 490, 95, 94, 598, 493, 256, 601, ! 258, 603, 100, 261, 501, 0, 87, 89, 100, 506, ! 100, 92, 93, 94, 9, 10, 11, 98, 95, 89, ! 335, 102, 100, 57, 100, 100, 95, 95, 44, 335, ! 527, 11, 64, 530, 29, 51, 48, 32, 33, 135, ! 119, 538, 133, 278, 60, 47, 62, 92, 93, 94, ! 261, 46, 68, 98, 380, 552, 371, 102, 82, 54, ! 446, 559, 261, 446, 561, 381, 381, 83, 302, 566, ! 86, 87, 338, 340, 559, 339, 573, 489, 341, -1, ! 96, 97, 130, 580, 100, 582, 342, 82, 0, 242, ! -1, 346, -1, 590, -1, 592, 249, 9, 10, 11, ! -1, 598, -1, 256, 601, 258, 603, -1, 261, -1, ! -1, -1, -1, -1, -1, 110, -1, 29, -1, -1, ! 32, 33, -1, 381, -1, -1, -1, 490, -1, -1, ! -1, -1, -1, -1, 46, -1, -1, 453, 454, -1, ! 135, -1, -1, -1, -1, -1, -1, 463, 463, 465, ! 465, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, 527, -1, -1, 530, -1, -1, ! -1, -1, -1, -1, 490, 538, -1, -1, 493, -1, ! -1, -1, -1, -1, -1, 501, -1, -1, -1, 552, ! 506, 506, -1, -1, 242, 453, 454, -1, 110, -1, ! -1, 249, -1, 566, -1, 463, -1, 465, 256, -1, ! 258, 527, -1, 261, 530, -1, 130, -1, -1, -1, ! -1, -1, 538, 135, -1, -1, -1, 590, 381, -1, ! -1, -1, 490, -1, -1, 598, 552, -1, 601, -1, ! 603, -1, -1, 501, -1, 561, 561, -1, 506, -1, ! 566, -1, -1, -1, -1, -1, -1, 573, -1, -1, ! -1, 130, -1, -1, 580, 580, 582, 582, -1, 527, ! -1, -1, 530, -1, 590, -1, 592, -1, -1, -1, ! 538, -1, 598, -1, -1, 601, -1, 603, -1, -1, ! -1, -1, -1, -1, 552, -1, -1, -1, -1, -1, ! 453, 454, -1, 561, -1, -1, -1, -1, 566, -1, ! 463, -1, 465, -1, -1, 573, -1, -1, -1, -1, ! -1, -1, 580, -1, 582, -1, -1, -1, 242, -1, ! -1, -1, 590, 381, 592, 249, -1, 490, -1, -1, ! 598, -1, 256, 601, 258, 603, -1, 261, 501, -1, ! -1, -1, -1, 506, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! -1, -1, 120, 242, 527, -1, -1, 530, -1, -1, ! 249, -1, -1, -1, -1, 538, -1, 256, -1, 258, ! -1, -1, 261, -1, -1, -1, -1, -1, -1, 552, ! -1, -1, -1, -1, -1, 453, 454, -1, 561, -1, ! -1, -1, -1, 566, -1, 463, -1, 465, -1, -1, ! 573, 169, 170, -1, -1, -1, -1, 580, -1, 582, ! -1, -1, -1, -1, 51, -1, -1, 590, -1, 592, ! -1, -1, 490, 60, -1, 598, -1, -1, 601, 66, ! 603, -1, -1, 501, -1, -1, 73, -1, 506, -1, ! 77, -1, -1, -1, -1, -1, 83, 381, -1, 86, ! 87, -1, -1, 90, 91, 223, -1, 94, 226, 527, ! -1, -1, 530, -1, 232, -1, 103, 104, 105, 106, ! 538, -1, 109, 110, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, 552, -1, 46, 47, -1, -1, ! -1, 51, 381, 561, -1, -1, -1, -1, 566, -1, ! 60, -1, -1, -1, -1, 573, 66, -1, -1, -1, ! -1, -1, 580, 73, 582, -1, -1, 77, -1, 453, ! 454, -1, 590, 83, 592, -1, 86, 87, -1, 463, ! 598, 465, -1, 601, 94, 603, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, -1, 316, 109, ! 110, 319, -1, -1, -1, -1, 490, -1, -1, -1, ! -1, -1, -1, -1, 453, 454, -1, 501, -1, -1, ! -1, -1, 506, -1, 463, 343, 465, -1, -1, 347, ! 159, 160, 161, 162, -1, 353, 354, -1, 167, 168, ! -1, -1, -1, 527, -1, -1, 530, -1, -1, -1, ! -1, 490, -1, -1, 538, -1, -1, -1, 376, 377, ! -1, -1, 501, -1, -1, -1, -1, 506, 552, -1, ! 388, -1, -1, -1, -1, -1, -1, 561, 159, 160, ! 161, 162, 566, 401, -1, -1, 167, 168, 527, 573, ! -1, 530, -1, -1, -1, -1, 580, -1, 582, 538, ! -1, -1, -1, -1, -1, -1, 590, -1, 592, -1, ! -1, -1, -1, 552, 598, -1, -1, 601, -1, 603, ! -1, -1, 561, -1, -1, -1, -1, 566, -1, -1, ! -1, -1, -1, -1, 573, -1, -1, -1, -1, -1, ! -1, 580, -1, 582, -1, -1, -1, -1, -1, -1, ! -1, 590, -1, 592, -1, -1, -1, -1, -1, 598, ! -1, -1, 601, -1, 603, 483, -1, -1, -1, -1, ! -1, -1, -1, -1, -1, -1, -1, -1, -1, 497, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, 323, 324, 325, 326, 327, 328, ! 329, 330, 331, 332, 333, 334, -1, 336, 337, 338, ! 339, 340, 341, 342, -1, -1, -1, 1, -1, 3, ! 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, 551, -1, -1, -1, 555, -1, 557, ! -1, -1, 323, 324, 325, 326, 327, 328, 329, 330, ! 331, 332, 333, 334, -1, 336, 337, 338, 339, 340, ! 341, 342, 46, 47, -1, -1, 395, 51, -1, 398, ! -1, -1, -1, -1, -1, -1, 60, -1, -1, -1, ! -1, -1, 66, -1, 3, 4, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, 90, 91, -1, -1, ! 94, -1, -1, -1, 395, -1, -1, 398, -1, 103, ! 104, 105, 106, -1, -1, 109, 110, 46, 47, -1, ! -1, -1, 51, -1, -1, -1, -1, -1, -1, -1, ! -1, 60, -1, -1, -1, -1, -1, 66, 477, 478, ! 3, 4, -1, -1, 73, -1, -1, -1, 77, -1, ! 489, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, 90, 91, -1, -1, 94, -1, 96, 97, -1, ! -1, -1, 101, -1, 103, 104, 105, 106, -1, -1, ! 109, 110, -1, 46, 47, -1, 477, 478, 51, -1, ! -1, -1, -1, -1, -1, -1, -1, 60, 489, -1, ! -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, ! 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, 90, 91, -1, ! -1, 94, -1, 96, 97, -1, -1, -1, -1, -1, ! 103, 104, 105, 106, 46, 47, 109, 110, -1, 51, ! -1, -1, 3, 4, -1, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, 96, 46, 47, -1, -1, -1, ! 51, 103, 104, 105, 106, -1, -1, 109, 110, 60, ! -1, -1, -1, 3, 4, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, -1, -1, -1, -1, -1, 100, ! -1, -1, 103, 104, 105, 106, 46, 47, 109, 110, ! -1, 51, -1, -1, 3, 4, -1, -1, -1, -1, ! 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, ! -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, 95, -1, 46, 47, -1, ! -1, -1, 51, 103, 104, 105, 106, -1, -1, 109, ! 110, 60, -1, -1, -1, 3, 4, 66, -1, -1, ! -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, 90, 91, -1, -1, 94, -1, -1, -1, -1, ! 99, -1, -1, -1, 103, 104, 105, 106, 46, 47, ! 109, 110, -1, 51, -1, -1, 3, 4, -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, 90, 91, -1, -1, 94, -1, -1, 46, ! 47, -1, 100, -1, 51, 103, 104, 105, 106, -1, ! -1, 109, 110, 60, -1, -1, -1, 3, 4, 66, ! -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, 90, 91, -1, -1, 94, 95, -1, ! -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, ! 46, 47, 109, 110, -1, 51, -1, -1, 3, 4, ! -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, 90, 91, -1, -1, 94, 95, ! -1, 46, 47, -1, -1, -1, 51, 103, 104, 105, ! 106, -1, -1, 109, 110, 60, -1, -1, -1, 3, ! 4, 66, -1, -1, -1, -1, -1, -1, 73, -1, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, 90, 91, -1, -1, 94, ! 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, ! 105, 106, 46, 47, 109, 110, -1, 51, -1, -1, ! 3, 4, -1, -1, -1, -1, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, 90, 91, -1, -1, ! 94, 95, -1, 46, 47, -1, -1, -1, 51, 103, ! 104, 105, 106, -1, -1, 109, 110, 60, -1, -1, ! -1, 3, 4, 66, -1, -1, -1, -1, -1, -1, ! 73, -1, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, 90, 91, -1, ! -1, 94, 95, -1, -1, -1, -1, -1, -1, -1, ! 103, 104, 105, 106, 46, 47, 109, 110, -1, 51, ! -1, -1, 3, 4, -1, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, 90, 91, ! -1, -1, 94, -1, -1, 46, 47, -1, 100, -1, ! 51, 103, 104, 105, 106, -1, -1, 109, 110, 60, ! -1, -1, -1, 3, 4, 66, -1, -1, -1, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, 90, ! 91, -1, -1, 94, 95, -1, -1, -1, -1, -1, ! -1, -1, 103, 104, 105, 106, 46, 47, 109, 110, ! -1, 51, -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! 90, 91, -1, -1, 94, -1, -1, -1, -1, -1, ! -1, -1, -1, 103, 104, 105, 106, -1, -1, 109, ! 110, 44, -1, 46, 47, 48, 49, 50, 51, 52, ! -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, ! 63, -1, -1, 66, 67, 68, 69, -1, 71, 72, ! 73, 74, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, -1, -1, -1, ! -1, 94, -1, 96, 97, -1, -1, 100, -1, -1, ! 103, 104, 105, 106, -1, -1, 109, 110, 44, -1, ! 46, 47, 48, 49, 50, 51, 52, -1, -1, 55, ! -1, -1, -1, 59, 60, -1, -1, 63, -1, -1, ! 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, ! -1, 77, -1, -1, -1, -1, -1, 83, -1, -1, ! 86, 87, -1, -1, -1, -1, -1, -1, 94, -1, ! 96, 97, -1, -1, 100, -1, -1, 103, 104, 105, ! 106, -1, -1, 109, 110, 44, -1, 46, 47, -1, ! 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, ! 59, 60, -1, -1, -1, -1, -1, 66, 67, 68, ! 69, -1, 71, 72, 73, 74, -1, -1, 77, -1, ! -1, -1, -1, -1, 83, -1, -1, 86, 87, -1, ! -1, -1, -1, -1, -1, 94, -1, 96, 97, -1, ! -1, 100, -1, -1, 103, 104, 105, 106, -1, -1, ! 109, 110, 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, ! -1, -1, -1, -1, 66, 67, 68, 69, -1, 71, ! 72, 73, 74, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, -1, -1, ! -1, -1, 94, -1, 96, 97, -1, -1, 100, -1, ! -1, 103, 104, 105, 106, -1, -1, 109, 110, 44, ! -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, ! 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, ! -1, 66, 67, 68, 69, -1, 71, 72, 73, 74, ! -1, -1, 77, -1, -1, -1, -1, -1, 83, -1, ! -1, 86, 87, -1, -1, -1, -1, -1, -1, 94, ! -1, 96, 97, -1, -1, 100, -1, -1, 103, 104, ! 105, 106, -1, -1, 109, 110, 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, ! -1, -1, -1, -1, -1, 83, -1, -1, 86, 87, ! -1, -1, -1, -1, -1, -1, 94, -1, 96, 97, ! -1, -1, 100, -1, -1, 103, 104, 105, 106, -1, ! -1, 109, 110, 44, -1, 46, 47, -1, 49, 50, ! 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, ! -1, -1, -1, -1, -1, 66, 67, 68, 69, -1, ! 71, 72, 73, 74, -1, -1, 77, -1, -1, -1, ! -1, -1, 83, -1, -1, 86, 87, -1, -1, -1, ! -1, -1, -1, 94, -1, 96, 97, -1, -1, 100, ! -1, -1, 103, 104, 105, 106, -1, -1, 109, 110, 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, 66, 67, 68, 69, -1, 71, 72, 73, ! 74, -1, -1, 77, -1, -1, -1, -1, -1, 83, ! -1, -1, 86, 87, -1, -1, -1, -1, -1, -1, ! 94, -1, 96, 97, -1, -1, 100, -1, -1, 103, ! 104, 105, 106, -1, -1, 109, 110, 44, -1, 46, ! 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, ! -1, -1, 59, 60, -1, -1, -1, -1, -1, 66, ! 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, ! 77, -1, -1, -1, -1, -1, 83, -1, -1, 86, ! 87, -1, -1, -1, -1, -1, -1, 94, -1, 96, ! -1, -1, -1, 100, -1, -1, 103, 104, 105, 106, ! -1, -1, 109, 110, 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, 66, 67, -1, 69, ! -1, 71, 72, 73, 74, -1, -1, 77, -1, -1, ! -1, -1, -1, 83, -1, -1, 86, 87, -1, -1, ! -1, -1, -1, -1, 94, -1, 96, -1, -1, -1, ! 100, -1, -1, 103, 104, 105, 106, -1, -1, 109, ! 110, 44, -1, 46, 47, -1, 49, 50, 51, 52, ! -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, ! -1, -1, -1, 66, 67, -1, 69, -1, 71, 72, ! 73, 74, -1, -1, 77, -1, -1, -1, -1, -1, ! 83, -1, -1, 86, 87, -1, -1, -1, -1, -1, ! -1, 94, 44, 96, 46, 47, -1, 100, -1, 51, ! 103, 104, 105, 106, -1, -1, 109, 110, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, 83, -1, -1, 86, 87, -1, -1, -1, -1, ! -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, ! -1, 103, 104, 105, 106, -1, -1, 109, 110 }; ! /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing ! symbol of state STATE-NUM. */ ! static const unsigned short yystos[] = { ! 0, 44, 56, 62, 68, 76, 100, 112, 125, 126, ! 127, 128, 129, 130, 131, 132, 133, 134, 164, 185, ! 87, 121, 122, 123, 124, 124, 124, 121, 0, 127, ! 129, 132, 126, 127, 44, 62, 68, 100, 102, 64, ! 165, 169, 64, 137, 100, 102, 127, 124, 124, 5, ! 124, 117, 119, 121, 96, 170, 101, 167, 117, 118, ! 53, 138, 166, 169, 137, 100, 51, 60, 83, 86, ! 97, 114, 115, 116, 117, 120, 121, 133, 134, 144, ! 150, 164, 171, 172, 173, 174, 119, 170, 119, 139, ! 136, 170, 168, 138, 124, 151, 124, 145, 146, 147, ! 151, 98, 234, 234, 60, 114, 100, 97, 172, 101, ! 96, 140, 170, 135, 94, 54, 98, 154, 100, 101, ! 93, 98, 154, 99, 98, 151, 145, 151, 119, 44, ! 96, 97, 122, 133, 134, 141, 142, 143, 144, 149, ! 150, 157, 158, 159, 160, 164, 177, 185, 140, 95, ! 114, 133, 152, 153, 118, 155, 99, 124, 146, 3, ! 4, 46, 47, 60, 66, 73, 77, 90, 91, 94, ! 96, 103, 104, 105, 106, 109, 110, 113, 115, 120, ! 121, 148, 175, 222, 223, 224, 225, 226, 229, 231, ! 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, ! 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, ! 255, 256, 257, 258, 259, 261, 99, 99, 154, 100, ! 154, 44, 49, 50, 52, 55, 59, 67, 69, 71, ! 72, 74, 94, 97, 114, 115, 120, 121, 124, 133, ! 134, 177, 178, 179, 180, 181, 182, 184, 185, 186, ! 187, 189, 190, 191, 192, 194, 200, 201, 203, 204, ! 205, 207, 208, 212, 213, 214, 215, 216, 217, 218, ! 225, 236, 238, 239, 240, 242, 243, 258, 94, 160, ! 97, 142, 100, 156, 177, 177, 154, 147, 114, 95, ! 101, 101, 121, 235, 237, 241, 241, 241, 241, 102, ! 102, 115, 117, 118, 241, 241, 115, 121, 261, 97, ! 101, 148, 176, 102, 102, 94, 98, 102, 102, 98, ! 124, 46, 47, 5, 6, 7, 3, 4, 8, 9, ! 10, 18, 19, 20, 21, 58, 16, 17, 11, 12, ! 13, 14, 15, 88, 92, 93, 260, 94, 261, 100, ! 124, 100, 261, 94, 94, 177, 94, 100, 124, 261, ! 145, 89, 114, 97, 179, 100, 44, 182, 100, 182, ! 182, 133, 181, 190, 209, 211, 100, 94, 95, 152, ! 154, 96, 161, 147, 153, 118, 68, 124, 98, 232, ! 233, 234, 232, 234, 94, 95, 234, 234, 95, 97, ! 97, 101, 68, 68, 95, 230, 261, 261, 68, 73, ! 77, 73, 124, 261, 94, 241, 241, 241, 246, 246, ! 247, 247, 247, 248, 248, 248, 248, 115, 116, 249, ! 249, 250, 251, 252, 253, 254, 261, 257, 261, 100, ! 100, 100, 261, 261, 61, 65, 219, 220, 221, 100, ! 95, 145, 67, 101, 100, 261, 261, 95, 161, 66, ! 77, 97, 121, 162, 163, 178, 100, 94, 261, 233, ! 234, 175, 234, 175, 95, 230, 241, 95, 95, 244, ! 97, 148, 95, 101, 99, 94, 99, 95, 230, 89, ! 95, 95, 95, 94, 177, 220, 221, 94, 190, 210, ! 211, 100, 95, 100, 102, 97, 178, 94, 97, 95, ! 230, 99, 227, 95, 241, 244, 1, 261, 95, 230, ! 140, 95, 256, 49, 182, 183, 184, 186, 188, 193, ! 200, 202, 206, 208, 96, 195, 153, 261, 95, 210, ! 1, 177, 66, 97, 95, 230, 95, 140, 228, 95, ! 140, 94, 57, 183, 183, 100, 48, 63, 97, 196, ! 197, 198, 199, 95, 95, 182, 95, 94, 100, 95, ! 140, 261, 182, 100, 261, 89, 261, 262, 97, 197, ! 198, 97, 178, 199, 177, 100, 182, 95, 230, 100, ! 95, 210, 100, 89, 97, 100, 95, 183, 95, 210, ! 100, 57, 183, 95, 183, 183 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif --- 623,1635 ---- 4, 1, 3, 2, 3, 1, 2, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ! 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, ! 2, 1, 1, 1, 1, 1, 1, 1, 5, 7, ! 7, 5, 2, 3, 3, 4, 1, 2, 2, 1, ! 2, 3, 2, 4, 2, 2, 1, 7, 7, 6, ! 7, 6, 2, 2, 0, 1, 1, 0, 1, 1, ! 3, 2, 3, 2, 3, 2, 3, 3, 5, 3, ! 2, 3, 5, 5, 1, 3, 3, 4, 1, 2, ! 5, 2, 1, 1, 1, 1, 3, 1, 1, 1, ! 1, 1, 3, 3, 3, 3, 3, 5, 4, 1, ! 4, 5, 5, 6, 0, 6, 0, 7, 3, 3, ! 1, 3, 3, 3, 3, 4, 4, 4, 4, 1, ! 2, 3, 2, 3, 3, 3, 3, 4, 5, 6, ! 5, 6, 4, 4, 1, 1, 1, 1, 2, 2, ! 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, ! 1, 5, 4, 4, 5, 1, 3, 3, 3, 1, ! 3, 3, 1, 3, 3, 3, 1, 3, 3, 3, ! 3, 3, 1, 3, 3, 1, 3, 1, 3, 1, ! 3, 1, 3, 1, 3, 1, 5, 1, 1, 3, ! 1, 1, 1, 1, 1, 1, 1 }; ! /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE ! doesn't specify something else to do. Zero means the default is an ! error. */ ! static const short yydefact[] = { ! 25, 45, 0, 0, 0, 0, 176, 1, 27, 28, ! 26, 33, 38, 39, 35, 0, 42, 43, 44, 24, ! 0, 20, 21, 22, 117, 51, 0, 31, 34, 36, ! 29, 30, 46, 0, 0, 40, 0, 0, 0, 121, ! 0, 53, 37, 0, 32, 119, 51, 0, 23, 17, ! 125, 15, 0, 118, 0, 0, 16, 52, 0, 49, ! 0, 123, 53, 41, 12, 0, 10, 11, 127, 0, ! 8, 9, 13, 14, 15, 0, 133, 135, 0, 134, ! 0, 129, 131, 132, 126, 122, 55, 54, 0, 120, ! 0, 47, 0, 93, 76, 0, 72, 74, 93, 0, ! 18, 19, 0, 0, 136, 128, 130, 0, 0, 50, ! 124, 0, 0, 0, 0, 83, 70, 0, 0, 0, ! 82, 282, 0, 93, 0, 93, 56, 45, 0, 57, ! 20, 0, 67, 0, 59, 61, 65, 66, 80, 62, ! 0, 63, 93, 68, 64, 69, 48, 86, 0, 0, ! 0, 89, 95, 94, 88, 76, 73, 0, 0, 0, ! 0, 0, 0, 0, 245, 0, 0, 0, 0, 6, ! 5, 2, 3, 4, 7, 244, 0, 0, 295, 75, ! 79, 294, 242, 251, 247, 259, 0, 243, 248, 249, ! 250, 307, 296, 297, 315, 300, 301, 304, 310, 319, ! 322, 326, 332, 335, 337, 339, 341, 343, 345, 347, ! 355, 348, 0, 78, 77, 283, 85, 71, 84, 45, ! 0, 0, 206, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 143, 0, 8, 14, 295, 22, 0, 149, ! 164, 0, 145, 147, 0, 148, 153, 165, 0, 154, ! 166, 0, 155, 156, 167, 0, 157, 0, 168, 158, ! 214, 0, 169, 170, 171, 173, 175, 172, 0, 174, ! 247, 249, 0, 184, 185, 182, 183, 181, 0, 93, ! 58, 60, 0, 99, 0, 91, 0, 87, 0, 0, ! 295, 248, 250, 302, 303, 306, 305, 0, 0, 0, ! 16, 0, 308, 309, 0, 295, 0, 137, 0, 141, ! 0, 0, 0, 0, 0, 0, 0, 0, 0, 299, ! 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 353, 354, 0, 0, 0, 221, 0, 225, ! 0, 0, 0, 0, 212, 223, 0, 230, 0, 0, ! 151, 177, 0, 144, 146, 150, 234, 178, 180, 204, ! 0, 0, 216, 219, 213, 215, 0, 0, 105, 0, ! 0, 98, 81, 97, 0, 101, 92, 90, 96, 256, ! 285, 0, 273, 279, 0, 274, 0, 0, 0, 18, ! 19, 246, 139, 138, 0, 255, 254, 286, 0, 270, ! 0, 253, 268, 252, 269, 284, 0, 0, 316, 317, ! 318, 320, 321, 323, 324, 325, 328, 330, 327, 329, ! 0, 331, 333, 334, 336, 338, 340, 342, 344, 0, ! 349, 0, 227, 222, 226, 0, 0, 0, 0, 235, ! 238, 236, 224, 231, 0, 229, 246, 152, 0, 0, ! 217, 0, 0, 106, 102, 116, 245, 107, 295, 0, ! 0, 0, 103, 0, 0, 280, 275, 278, 276, 277, ! 258, 0, 312, 0, 0, 313, 140, 142, 287, 0, ! 292, 0, 293, 260, 0, 0, 0, 203, 0, 0, ! 241, 239, 237, 0, 0, 220, 0, 218, 217, 0, ! 104, 0, 108, 0, 0, 109, 290, 0, 281, 0, ! 257, 311, 314, 272, 271, 288, 0, 261, 262, 346, ! 0, 188, 0, 153, 0, 160, 161, 0, 162, 163, ! 0, 0, 191, 0, 228, 0, 0, 0, 233, 232, ! 0, 110, 0, 0, 291, 265, 0, 289, 263, 0, ! 0, 179, 205, 0, 0, 0, 192, 0, 196, 0, ! 199, 0, 0, 209, 0, 0, 111, 0, 267, 0, ! 189, 217, 0, 202, 356, 0, 194, 197, 0, 193, ! 198, 200, 240, 207, 208, 0, 0, 112, 0, 0, ! 217, 201, 195, 114, 0, 0, 0, 0, 113, 0, ! 211, 0, 190, 210, 0, 0, 0 }; static const short yydefgoto[] = { ! 614, 175, 233, 176, 71, 72, 57, 50, 177, 178, ! 21, 22, 23, 7, 8, 9, 10, 11, 12, 13, ! 14, 238, 239, 111, 88, 41, 59, 87, 109, 133, ! 134, 135, 77, 95, 96, 97, 179, 137, 282, 78, ! 93, 150, 151, 115, 153, 382, 139, 140, 141, 142, ! 385, 469, 470, 17, 38, 60, 55, 90, 39, 53, ! 80, 81, 82, 83, 180, 310, 240, 590, 242, 243, ! 244, 245, 532, 246, 247, 248, 249, 535, 250, 251, ! 252, 253, 536, 254, 542, 567, 568, 569, 570, 255, ! 256, 538, 257, 258, 259, 539, 260, 261, 374, 506, ! 507, 262, 263, 264, 265, 266, 267, 268, 269, 449, ! 450, 451, 181, 182, 183, 184, 185, 519, 556, 186, ! 408, 187, 392, 393, 101, 188, 189, 190, 191, 192, ! 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, ! 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, ! 344, 409, 585 }; static const short yypact[] = { ! 128,-32768, -71, -71, -71, -71,-32768,-32768, 187, 87, ! 187,-32768,-32768,-32768,-32768, 150,-32768,-32768,-32768,-32768, ! 213,-32768,-32768,-32768, -40, -26, 303, 87,-32768,-32768, ! 187, 87,-32768, -71, -71,-32768, 7, -71, -37, -28, ! -71, 68,-32768, -71, 87, -40, -26, 60,-32768,-32768, ! -32768, 114, 906,-32768, -71, -37,-32768,-32768, -71,-32768, ! -37, -28, 68,-32768,-32768, -71,-32768,-32768,-32768, -71, ! 110,-32768,-32768,-32768, 136, 369,-32768,-32768, 139,-32768, ! 1354,-32768,-32768,-32768,-32768,-32768,-32768, 28, 161,-32768, ! -37,-32768, 175, -34, 175, 344,-32768, 86, -34, 177, ! 212, 212, -71, -71,-32768,-32768,-32768, -71, 1200,-32768, ! -32768, 161, 407, -71, 191,-32768,-32768, -71, 1604, 255, ! -32768,-32768, 282, -34, 353, -34,-32768, 227, 2516,-32768, ! 253, 369,-32768, 1359,-32768,-32768,-32768,-32768,-32768,-32768, ! 315,-32768, 367,-32768,-32768,-32768,-32768,-32768, -71, 202, ! 16,-32768,-32768, 330,-32768,-32768,-32768, 2312, 2312, 2312, ! 2312, 336, 345, 243,-32768, 2312, 2312, 2312, 1472,-32768, ! -32768,-32768,-32768,-32768,-32768,-32768, 181, 347, 323,-32768, ! -32768, 361, 360,-32768,-32768,-32768, -71,-32768, 368,-32768, ! 395, 450,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 429, ! 533, 471, 455, 542, 472, 480, 489, 491, 0,-32768, ! -32768,-32768, 476,-32768,-32768,-32768,-32768,-32768,-32768, 421, ! 430, 2312,-32768, -19, 1656, 434, 437, 315, 443, 66, ! 1219, 2312,-32768, -71, 181, 347, 612, 451, 90,-32768, ! -32768, 2584,-32768,-32768, 445,-32768,-32768,-32768, 2992,-32768, ! -32768, 454,-32768,-32768,-32768, 2992,-32768, 2992,-32768,-32768, ! 3112, 461,-32768,-32768,-32768,-32768,-32768,-32768, 457,-32768, ! 171, 208, 450, 528, 530,-32768,-32768,-32768, 496, 367, ! -32768,-32768, 224,-32768, 467, 468, -71,-32768, 248, -71, ! 133,-32768,-32768,-32768,-32768,-32768,-32768, 504, -71, 483, ! 483, 493,-32768,-32768, 160, 323, 490,-32768, 498,-32768, ! 239, 521, 523, 1722, 1774, 266, 50, 2312, 499,-32768, ! -32768, 2312, 2312, 2312, 2312, 2312, 2312, 2312, 2312, 2312, ! 2312, 2312, 2312, 243, 2312, 2312, 2312, 2312, 2312, 2312, ! 2312, 2312,-32768,-32768, 2312, 2312, 500,-32768, 501,-32768, ! 506, 2312, 2312, 295,-32768,-32768, 511,-32768, 18, 509, ! 513,-32768, -71,-32768,-32768,-32768,-32768,-32768,-32768,-32768, ! 551, 202,-32768,-32768,-32768, 518, 1840, 2312,-32768, 48, ! 467,-32768,-32768,-32768, 2652, 520, 468,-32768,-32768,-32768, ! 529, 1774, 483,-32768, 310, 483, 310, 1892, 2312, -13, ! 169, 3179,-32768,-32768, 1538,-32768,-32768,-32768, 74,-32768, ! 532,-32768,-32768,-32768,-32768, 538, 534, 1958,-32768,-32768, ! -32768, 429, 429, 533, 533, 533, 471, 471, 471, 471, ! 110,-32768, 455, 455, 542, 472, 480, 489, 491, 545, ! -32768, 527,-32768,-32768,-32768, 540, 547, 544, 315, 295, ! -32768,-32768,-32768,-32768, 2312,-32768,-32768, 513, 546, 3137, ! 3137, 537, 550,-32768, 548, 345, 555,-32768, 658, 2720, ! 556, 2788,-32768, 2010, 552,-32768, 212,-32768, 212,-32768, ! 558, 99,-32768, 2312, 3179,-32768,-32768,-32768,-32768, 1393, ! -32768, 2076,-32768, 161, 106, 2312, 3060,-32768, 559, 248, ! -32768,-32768,-32768, 564, 2312,-32768, 557, 518, 3137, 8, ! -32768, 317,-32768, 2856, 2128,-32768,-32768, 250,-32768, 161, ! 570,-32768,-32768,-32768,-32768,-32768, 290,-32768, 161,-32768, ! 573,-32768, 613, 615, 3060,-32768,-32768, 3060,-32768,-32768, ! 575, -22,-32768, 578,-32768, 581, 2992, 582,-32768,-32768, ! 584,-32768, 579, 291,-32768,-32768, 161,-32768,-32768, 2312, ! 2992,-32768,-32768, 2194, 591, 2312,-32768, 94,-32768, 2380, ! -32768, 315, 583,-32768, 2992, 2246,-32768, 585,-32768, 586, ! -32768, 3137, 592,-32768,-32768, 597,-32768,-32768, 2448,-32768, ! 2924,-32768,-32768,-32768,-32768, 594, 301,-32768, 3060, 596, ! 3137,-32768,-32768,-32768, 607, 641, 3060, 620,-32768, 3060, ! -32768, 3060,-32768,-32768, 709, 718,-32768 }; static const short yypgoto[] = { ! -32768,-32768, 111, -27, 387, 30, -107, 10, 189, 40, ! 117,-32768, -3,-32768, 711, 13,-32768, 21,-32768,-32768, ! 19, 27, 617,-32768,-32768, 677, 662,-32768, -109,-32768, ! 595,-32768, -86, -100, 610, -140, -157,-32768,-32768, -5, ! 63, 452, -283, -64,-32768,-32768,-32768,-32768,-32768, 598, ! 357,-32768,-32768, -36,-32768,-32768,-32768,-32768, 691, 167, ! -32768, 661,-32768,-32768, 29,-32768, -101, -118, -237,-32768, ! 485, -146, -313, -482, 704, -447,-32768,-32768,-32768, -185, ! -32768,-32768,-32768,-32768,-32768,-32768, 180, 182, -413, -94, ! -32768,-32768,-32768,-32768,-32768,-32768,-32768, 31,-32768, -490, ! 495,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, ! 307, 311,-32768,-32768,-32768, 85,-32768,-32768,-32768,-32768, ! -304,-32768, 459, -113, 3, 1033, 230, 1053, 273, 356, ! 462, 341, 543, 626, -388,-32768, 254, 192, 219, 265, ! 426, 428, 425, 427, 431,-32768, 275, 424, 669,-32768, ! -32768, 785,-32768 }; ! ! #define YYLAST 3290 ! ! static const short yytable[] = { ! 24, 25, 146, 124, 364, 387, 152, 144, 285, 548, ! 241, 309, 47, 485, 533, 340, 79, 19, 547, 453, ! 113, 27, 136, 31, 37, 70, 564, 15, 29, 28, ! 45, 46, 144, 48, 120, 15, 15, 15, 40, 283, ! 48, 565, 20, 44, 79, 26, 29, 136, 70, 534, ! 29, 28, 533, 70, 15, 533, 301, 15, 15, 216, ! 52, 218, 92, 29, 84, 114, 94, 49, 86, 19, ! 56, 15, 143, 100, 54, 373, 566, 51, 284, 75, ! 51, 70, 347, 483, 49, 70, 122, 534, 49, 341, ! 534, 599, 74, 481, 51, 19, 522, 143, 51, 92, ! 94, 234, 367, 138, 70, 128, 70, 75, 454, 369, ! 607, 370, 287, 494, 155, 74, 533, 126, 288, 455, ! 74, 58, 70, 414, 533, 237, 353, 533, 138, 533, ! 107, 1, 98, 360, 32, 131, 299, 49, 19, 149, ! 304, 64, 564, 56, 463, 155, 386, 51, 74, 3, ! 288, 534, 74, 51, 19, 4, 591, 565, 34, 534, ! 131, 63, 534, 69, 534, 123, 125, 355, 236, 517, ! 488, 74, 1, 74, 66, 591, 489, 67, 19, 100, ! 118, 383, 388, 318, 2, 119, 103, 526, 6, 74, ! 3, 69, 586, 300, 32, 520, 4, 290, 290, 290, ! 290, 489, 528, 51, 5, 290, 290, 305, 489, 99, ! 553, 70, 33, 270, 234, 380, 543, 43, 34, 69, ! 348, 561, 85, 148, 562, 130, 356, 89, 313, 6, ! 155, 1, 314, 234, 364, 99, 315, 100, 237, 43, ! 104, 73, 103, 2, 69, 237, 32, 487, 130, 3, ! 130, 70, 237, 64, 237, 4, 398, 110, 108, 99, ! 286, 70, 457, 311, 73, 484, 471, -187, 122, 73, ! 112, 596, -187, -187, 505, 373, 364, 121, 74, 475, ! 99, 236, 475, 155, 311, 605, 66, 371, 6, 67, ! 19, 154, 1, 610, 64, 390, 612, 73, 613, 64, ! 236, 73, 394, 396, -186, 149, 430, 399, 400, -186, ! -186, 122, 48, 415, 35, 149, 36, 235, 74, 56, ! 73, 128, 73, 373, -100, 381, 270, 66, 74, 51, ! 67, 19, 66, 270, 411, 67, 19, 403, 73, 412, ! 270, 404, 270, 413, 70, 270, 554, 500, 278, 362, ! 531, 513, 489, 364, 19, 214, 447, 234, 271, 155, ! 448, 290, 290, 290, 290, 290, 290, 290, 290, 290, ! 290, 290, 290, 74, 290, 290, 290, 290, 290, 290, ! 290, 237, 215, 550, 527, 411, 557, 577, 367, 148, ! 412, 369, 489, 489, 413, 476, 373, 604, 478, 148, ! 573, 272, 537, 489, 42, 19, 43, 168, 549, 122, ! 555, 74, 128, 32, 580, 373, -350, -350, 313, 558, ! 64, 113, 314, 477, 468, 479, 315, 73, 594, 102, ! 235, 33, 289, 100, 321, 322, 323, 34, 290, 297, ! 537, 290, 234, 537, 234, 116, 117, 578, 298, 235, ! 312, 1, 531, 66, 217, 117, 67, 19, 64, 317, ! 573, -351, -351, 580, 316, 594, 237, 73, 237, 270, ! 592, 271, 70, 329, 330, 331, 332, 73, 271, 326, ! 327, 328, 362, 336, 273, 271, 234, 271, -352, -352, ! 271, 66, 337, 237, 67, 19, 319, 320, 293, 294, ! 295, 296, 338, 147, 537, 339, 302, 303, 48, 236, ! 237, 236, 537, 333, 272, 537, -234, 537, 423, 424, ! 425, 272, 73, 290, 290, 345, 149, 540, 272, 351, ! 272, 237, 352, 272, 237, 290, 324, 325, 354, 74, ! 1, 361, 234, 237, 270, 270, 365, 64, 426, 427, ! 428, 429, 377, 236, 270, 368, 270, 237, 334, 335, ! 73, 234, 376, 234, 384, 540, 237, 119, 540, 342, ! 343, 237, 389, 235, -296, -296, -297, -297, 421, 422, ! 66, 270, 391, 67, 19, 237, 401, 237, 397, 405, ! 274, 406, 378, 270, 417, 237, 402, 273, 270, 432, ! 433, 442, 443, 237, 273, 456, 237, 444, 237, 236, ! 148, 273, 452, 273, 271, 117, 273, 16, 458, 270, ! 459, 472, 270, 496, 473, 16, 16, 16, 236, 540, ! 236, 270, 490, 491, 492, 495, 497, 540, 508, 499, ! 540, 504, 540, 498, 16, 270, 509, 16, 16, 510, ! -115, 514, 518, 546, 270, -264, 541, 272, 235, 270, ! 235, 16, 418, 419, 420, 544, 270, -266, 559, 76, ! 560, 275, -159, 270, 571, 270, 563, 572, 574, 575, ! 576, 583, 598, 270, 593, 270, 597, 601, 73, 271, ! 271, 270, 606, 600, 270, 603, 270, 76, 609, 271, ! -15, 271, 235, 274, 18, -350, -350, 313, 608, 615, ! 274, 314, 18, 18, 18, 315, 611, 274, 616, 274, ! 431, 30, 274, 62, 91, 132, 271, 156, 281, 279, ! 379, 18, 272, 272, 18, 18, 61, 464, 271, 482, ! 273, 106, 272, 271, 272, 372, -15, 587, 18, 588, ! 132, -350, -350, 313, 276, 375, 501, 314, 235, 395, ! 502, 511, 434, 436, 271, 435, 437, 271, 440, 272, ! 529, 438, 0, 0, 0, 0, 271, 235, 0, 235, ! 0, 272, 0, 0, 275, 0, 272, 0, 0, 0, ! 271, 275, 0, 0, 0, 0, 0, 277, 275, 271, ! 275, 0, 0, 275, 271, 0, 0, 272, 0, 0, ! 272, 271, 145, 0, 0, 273, 273, 0, 271, 272, ! 271, 0, 0, 0, 521, 273, 0, 273, 271, 0, ! 271, 0, 0, 272, 0, 0, 271, 145, 0, 271, ! 0, 271, 272, 0, 0, 0, 274, 272, 0, 0, ! 0, 0, 273, 0, 272, 0, 0, 0, 0, 0, ! 0, 272, 0, 272, 273, 0, 0, 276, 0, 273, ! 0, 272, 0, 272, 276, 0, 0, 0, 0, 272, ! 0, 276, 272, 276, 272, 0, 276, 0, 0, 0, ! 273, 0, 0, 273, 0, 0, 0, 0, 0, 0, ! 0, 0, 273, 213, 0, 0, 0, 0, 0, 0, ! 277, 0, 0, 0, 0, 0, 273, 277, 0, 0, ! 0, 274, 274, 0, 277, 273, 277, 275, 0, 277, ! 273, 274, 0, 274, 0, 0, 0, 273, 0, 0, ! 0, 0, 0, 0, 273, 0, 273, 0, 0, 0, ! 1, 0, 306, 213, 273, 0, 273, 64, 274, 0, ! 0, 0, 273, 0, 0, 273, 65, 273, 3, 0, ! 274, 0, 0, 0, 4, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 66, 0, 0, 67, 19, 0, 274, 0, 0, 274, ! 0, 0, 275, 275, 68, 0, 346, 0, 274, 350, ! 276, 0, 275, 0, 275, 358, 359, 0, 0, 0, ! 0, 0, 274, 0, 0, 0, 0, 0, 0, 0, ! 0, 274, 0, 0, 0, 0, 274, 0, 0, 275, ! 0, 0, 0, 274, 0, 0, 0, 0, 0, 0, ! 274, 275, 274, 277, 0, 0, 275, 0, 0, 0, ! 274, 0, 274, 0, 0, 0, 0, 0, 274, 0, ! 0, 274, 0, 274, 0, 0, 0, 275, 0, 0, ! 275, 0, 0, 0, 0, 276, 276, 0, 0, 275, ! 0, 0, 0, 0, 0, 276, 0, 276, 0, 410, ! 0, 0, 416, 275, 0, 0, 0, 0, 0, 0, ! 0, 0, 275, 0, 0, 0, 0, 275, 0, 0, ! 0, 0, 276, 0, 275, 0, 439, 0, 277, 277, ! 441, 275, 0, 275, 276, 0, 445, 446, 277, 276, ! 277, 275, 0, 275, 0, 0, 0, 0, 0, 275, ! 0, 0, 275, 0, 275, 0, 0, 0, 0, 0, ! 276, 461, 462, 276, 0, 277, 0, 0, 0, 0, ! 0, 0, 276, 0, 0, 0, 474, 277, 0, 0, ! 0, 0, 277, 0, 0, 0, 276, 0, 0, 213, ! 291, 291, 291, 291, 0, 276, 0, 0, 291, 291, ! 276, 0, 0, 277, 0, 0, 277, 276, 0, 0, ! 292, 292, 292, 292, 276, 277, 276, 0, 292, 292, ! 357, 0, 157, 158, 276, 0, 276, 0, 0, 277, ! 0, 0, 276, 0, 0, 276, 0, 276, 277, 503, ! 0, 0, 0, 277, 127, 0, 0, 0, 0, 0, ! 277, 64, 0, 0, 0, 0, 0, 277, 0, 277, ! 65, 0, 3, 0, 0, 159, 160, 277, 4, 277, ! 64, 0, 0, 0, 524, 277, 0, 0, 277, 161, ! 277, 0, 0, 0, 66, 162, 0, 67, 19, 545, ! 0, 0, 163, 0, 0, 0, 164, 128, 129, 0, ! 0, 6, 0, 66, 0, 0, 67, 19, 0, 0, ! 165, 166, 0, 0, 167, 0, 0, 0, 0, 0, ! 0, 0, 0, 169, 170, 171, 172, 0, 0, 173, ! 174, 0, 0, 0, 0, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 579, 0, 0, 0, 582, 0, ! 584, 0, 0, 0, 291, 291, 291, 291, 291, 291, ! 291, 291, 291, 291, 291, 291, 0, 291, 291, 291, ! 291, 291, 291, 291, 292, 292, 292, 292, 292, 292, ! 292, 292, 292, 292, 292, 292, 0, 292, 292, 292, ! 292, 292, 292, 292, 523, 0, 157, 158, 1, 0, ! 0, 0, 0, 127, 0, 64, 0, 0, 0, 0, ! 64, 0, 0, 0, 65, 0, 3, 0, 0, 65, ! 0, 3, 4, 0, 0, 0, 0, 4, 0, 0, ! 0, 291, 0, 0, 291, 0, 0, 0, 66, 159, ! 160, 67, 19, 66, 64, 0, 67, 19, 0, 0, ! 0, 292, 105, 161, 292, 0, 128, 280, 0, 162, ! 6, 0, 0, 0, 0, 0, 163, 0, 0, 0, ! 164, 0, 0, 0, 0, 157, 158, 66, 0, 0, ! 67, 19, 0, 0, 165, 166, 0, 0, 167, 0, ! 0, 0, 0, 0, 0, 0, 0, 169, 170, 171, ! 172, 0, 0, 173, 174, 0, 0, 0, 0, 0, ! 0, 0, 0, 0, 0, 0, 291, 291, 159, 160, ! 0, 0, 0, 64, 0, 0, 0, 0, 291, 0, ! 0, 0, 161, 0, 0, 0, 292, 292, 162, 0, ! 0, 157, 158, 0, 0, 163, 0, 0, 292, 164, ! 0, 0, 0, 0, 0, 0, 66, 0, 0, 67, ! 19, 0, 0, 165, 166, 0, 0, 167, 0, 168, ! 307, 0, 0, 0, 308, 0, 169, 170, 171, 172, ! 0, 0, 173, 174, 159, 160, 0, 0, 0, 64, ! 0, 0, 0, 0, 0, 0, 0, 0, 161, 0, ! 0, 0, 0, 0, 162, 0, 0, 157, 158, 0, ! 0, 163, 0, 0, 0, 164, 0, 0, 0, 0, ! 0, 0, 66, 0, 0, 67, 19, 0, 0, 165, ! 166, 0, 0, 167, 0, 168, 486, 0, 0, 0, ! 0, 0, 169, 170, 171, 172, 0, 0, 173, 174, ! 159, 160, 0, 0, 0, 64, 0, 0, 0, 157, ! 158, 0, 0, 0, 161, 0, 0, 0, 0, 0, ! 162, 0, 0, 0, 0, 0, 0, 163, 0, 0, ! 0, 164, 0, 0, 0, 0, 0, 0, 66, 0, ! 0, 67, 19, 0, 0, 165, 166, 0, 0, 167, ! 0, 168, 159, 160, 0, 0, 0, 64, 169, 170, ! 171, 172, 0, 0, 173, 174, 161, 0, 0, 0, ! 0, 0, 162, 0, 0, 157, 158, 0, 0, 163, ! 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, ! 66, 0, 0, 67, 19, 0, 0, 165, 166, 0, ! 0, 167, 0, 0, 0, 0, 0, 349, 0, 0, ! 169, 170, 171, 172, 0, 0, 173, 174, 159, 160, ! 0, 0, 0, 64, 0, 0, 0, 157, 158, 0, ! 0, 0, 161, 0, 0, 0, 0, 0, 162, 0, ! 0, 0, 0, 0, 0, 163, 0, 0, 0, 164, ! 0, 0, 0, 0, 0, 0, 66, 0, 0, 67, ! 19, 0, 0, 165, 166, 0, 0, 167, 407, 0, ! 159, 160, 0, 0, 0, 64, 169, 170, 171, 172, ! 0, 0, 173, 174, 161, 0, 0, 0, 0, 0, ! 162, 0, 0, 157, 158, 0, 0, 163, 0, 0, ! 0, 164, 0, 0, 0, 0, 0, 0, 66, 0, ! 0, 67, 19, 0, 0, 165, 166, 0, 0, 167, ! 0, 0, 0, 0, 121, 0, 0, 0, 169, 170, ! 171, 172, 0, 0, 173, 174, 159, 160, 0, 0, ! 0, 64, 0, 0, 0, 157, 158, 0, 0, 0, ! 161, 0, 0, 0, 0, 0, 162, 0, 0, 0, ! 0, 0, 0, 163, 0, 0, 0, 164, 0, 0, ! 0, 0, 0, 0, 66, 0, 0, 67, 19, 0, ! 0, 165, 166, 0, 0, 167, 0, 0, 159, 160, ! 0, 460, 0, 64, 169, 170, 171, 172, 0, 0, ! 173, 174, 161, 0, 0, 0, 0, 0, 162, 0, ! 0, 157, 158, 0, 0, 163, 0, 0, 0, 164, ! 0, 0, 0, 0, 0, 0, 66, 0, 0, 67, ! 19, 0, 0, 165, 166, 0, 0, 167, 480, 0, ! 0, 0, 0, 0, 0, 0, 169, 170, 171, 172, ! 0, 0, 173, 174, 159, 160, 0, 0, 0, 64, ! 0, 0, 0, 157, 158, 0, 0, 0, 161, 0, ! 0, 0, 0, 0, 162, 0, 0, 0, 0, 0, ! 0, 163, 0, 0, 0, 164, 0, 0, 0, 0, ! 0, 0, 66, 0, 0, 67, 19, 0, 0, 165, ! 166, 0, 0, 167, 493, 0, 159, 160, 0, 0, ! 0, 64, 169, 170, 171, 172, 0, 0, 173, 174, ! 161, 0, 0, 0, 0, 0, 162, 0, 0, 157, ! 158, 0, 0, 163, 0, 0, 0, 164, 0, 0, ! 0, 0, 0, 0, 66, 0, 0, 67, 19, 0, ! 0, 165, 166, 0, 0, 167, 516, 0, 0, 0, ! 0, 0, 0, 0, 169, 170, 171, 172, 0, 0, ! 173, 174, 159, 160, 0, 0, 0, 64, 0, 0, ! 0, 157, 158, 0, 0, 0, 161, 0, 0, 0, ! 0, 0, 162, 0, 0, 0, 0, 0, 0, 163, ! 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, ! 66, 0, 0, 67, 19, 0, 0, 165, 166, 0, ! 0, 167, 525, 0, 159, 160, 0, 0, 0, 64, ! 169, 170, 171, 172, 0, 0, 173, 174, 161, 0, ! 0, 0, 0, 0, 162, 0, 0, 157, 158, 0, ! 0, 163, 0, 0, 0, 164, 0, 0, 0, 0, ! 0, 0, 66, 0, 0, 67, 19, 0, 0, 165, ! 166, 0, 0, 167, 552, 0, 0, 0, 0, 0, ! 0, 0, 169, 170, 171, 172, 0, 0, 173, 174, ! 159, 160, 0, 0, 0, 64, 0, 0, 0, 157, ! 158, 0, 0, 0, 161, 0, 0, 0, 0, 0, ! 162, 0, 0, 0, 0, 0, 0, 163, 0, 0, ! 0, 164, 0, 0, 0, 0, 0, 0, 66, 0, ! 0, 67, 19, 0, 0, 165, 166, 0, 0, 167, ! 0, 0, 159, 160, 0, 581, 0, 64, 169, 170, ! 171, 172, 0, 0, 173, 174, 161, 0, 0, 0, ! 0, 0, 162, 0, 0, 157, 158, 0, 0, 163, ! 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, ! 66, 0, 0, 67, 19, 0, 0, 165, 166, 0, ! 0, 167, 595, 0, 0, 0, 0, 0, 0, 0, ! 169, 170, 171, 172, 0, 0, 173, 174, 159, 160, ! 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, ! 0, 0, 161, 0, 0, 0, 0, 0, 162, 0, ! 0, 0, 0, 0, 0, 163, 0, 0, 0, 164, ! 0, 0, 0, 0, 0, 0, 66, 0, 0, 67, ! 19, 0, 0, 165, 166, 0, 0, 167, 0, 0, ! 0, 0, 0, 0, 0, 0, 169, 170, 171, 172, ! 0, 0, 173, 174, 219, 0, 159, 160, 564, 220, ! 221, 64, 222, 0, 0, 223, 0, 0, 0, 224, ! 161, 0, 0, 565, 0, 0, 162, 225, 4, 226, ! 0, 227, 228, 163, 229, 0, 0, 164, 230, 0, ! 0, 0, 0, 0, 66, 0, 0, 67, 19, 0, ! 0, 0, 0, 0, 0, 231, 0, 128, 589, 0, ! 0, 6, 0, 0, 169, 170, 171, 172, 0, 0, ! 173, 174, 219, 0, 159, 160, 564, 220, 221, 64, ! 222, 0, 0, 223, 0, 0, 0, 224, 161, 0, ! 0, 565, 0, 0, 162, 225, 4, 226, 0, 227, ! 228, 163, 229, 0, 0, 164, 230, 0, 0, 0, ! 0, 0, 66, 0, 0, 67, 19, 0, 0, 0, ! 0, 0, 0, 231, 0, 128, 602, 0, 0, 6, ! 0, 0, 169, 170, 171, 172, 0, 0, 173, 174, ! 219, 0, 159, 160, 0, 220, 221, 64, 222, 0, ! 0, 223, 0, 0, 0, 224, 161, 0, 0, 0, ! 0, 0, 162, 225, 4, 226, 0, 227, 228, 163, ! 229, 0, 0, 164, 230, 0, 0, 0, 0, 0, ! 66, 0, 0, 67, 19, 0, 0, 0, 0, 0, ! 0, 231, 0, 128, 232, 0, 0, 6, 0, 0, ! 169, 170, 171, 172, 0, 0, 173, 174, 219, 0, ! 159, 160, 0, 220, 221, 64, 222, 0, 0, 223, ! 0, 0, 0, 224, 161, 0, 0, 0, 0, 0, ! 162, 225, 4, 226, 0, 227, 228, 163, 229, 0, ! 0, 164, 230, 0, 0, 0, 0, 0, 66, 0, ! 0, 67, 19, 0, 0, 0, 0, 0, 0, 231, ! 0, 128, 363, 0, 0, 6, 0, 0, 169, 170, ! 171, 172, 0, 0, 173, 174, 219, 0, 159, 160, ! 0, 220, 221, 64, 222, 0, 0, 223, 0, 0, ! 0, 224, 161, 0, 0, 0, 0, 0, 465, 225, ! 4, 226, 0, 227, 228, 163, 229, 0, 0, 466, ! 230, 0, 0, 0, 0, 0, 66, 0, 0, 67, ! 19, 0, 0, 0, 0, 0, 0, 231, 0, 128, ! 467, 0, 0, 6, 0, 0, 169, 170, 171, 172, ! 0, 0, 173, 174, 219, 0, 159, 160, 0, 220, ! 221, 64, 222, 0, 0, 223, 0, 0, 0, 224, ! 161, 0, 0, 0, 0, 0, 162, 225, 4, 226, ! 0, 227, 228, 163, 229, 0, 0, 164, 230, 0, ! 0, 0, 0, 0, 66, 0, 0, 67, 19, 0, ! 0, 0, 0, 0, 0, 231, 0, 128, 512, 0, ! 0, 6, 0, 0, 169, 170, 171, 172, 0, 0, ! 173, 174, 219, 0, 159, 160, 0, 220, 221, 64, ! 222, 0, 0, 223, 0, 0, 0, 224, 161, 0, ! 0, 0, 0, 0, 162, 225, 4, 226, 0, 227, ! 228, 163, 229, 0, 0, 164, 230, 0, 0, 0, ! 0, 0, 66, 0, 0, 67, 19, 0, 0, 0, ! 0, 0, 0, 231, 0, 128, 515, 0, 0, 6, ! 0, 0, 169, 170, 171, 172, 0, 0, 173, 174, ! 219, 0, 159, 160, 0, 220, 221, 64, 222, 0, ! 0, 223, 0, 0, 0, 224, 161, 0, 0, 0, ! 0, 0, 162, 225, 4, 226, 0, 227, 228, 163, ! 229, 0, 0, 164, 230, 0, 0, 0, 0, 0, ! 66, 0, 0, 67, 19, 0, 0, 0, 0, 0, ! 0, 231, 0, 128, 551, 0, 0, 6, 0, 0, ! 169, 170, 171, 172, 0, 0, 173, 174, 219, 0, ! 159, 160, 0, 220, 221, 64, 222, 0, 0, 223, ! 0, 0, 0, 224, 161, 0, 0, 0, 0, 0, ! 162, 225, 4, 226, 0, 227, 228, 163, 229, 0, ! 0, 164, 230, 0, 0, 0, 0, 0, 66, 0, ! 0, 67, 19, 0, 0, 0, 0, 0, 0, 231, ! 0, 128, 0, 0, 0, 6, 0, 0, 169, 170, ! 171, 172, 0, 0, 173, 174, 366, 0, 159, 160, ! 0, 220, 221, 64, 222, 0, 0, 223, 0, 0, ! 0, 224, 161, 0, 0, 0, 0, 0, 162, 225, ! 0, 226, 0, 227, 228, 163, 229, 0, 0, 164, ! 230, 0, 0, 0, 0, 0, 66, 0, 0, 67, ! 19, 0, 0, 0, 0, 0, 0, 231, 0, 128, ! 0, 0, 0, 6, 0, 0, 169, 170, 171, 172, ! 0, 0, 173, 174, 366, 0, 159, 160, 0, 530, ! 221, 64, 222, 0, 0, 223, 0, 0, 0, 224, ! 161, 0, 0, 0, 0, 0, 162, 225, 0, 226, ! 0, 227, 228, 163, 229, 0, 0, 164, 230, 0, ! 0, 0, 0, 0, 66, 0, 0, 67, 19, 0, ! 0, 0, 0, 0, 0, 231, 1, 128, 159, 160, ! 0, 6, 0, 64, 169, 170, 171, 172, 0, 0, ! 173, 174, 161, 0, 0, 0, 0, 0, 162, 0, ! 0, 0, 0, 159, 160, 163, 0, 0, 64, 164, ! 0, 0, 0, 0, 0, 0, 66, 161, 0, 67, ! 19, 0, 0, 162, 0, 0, 0, 231, 0, 0, ! 163, 0, 0, 0, 164, 0, 169, 170, 171, 172, ! 0, 66, 173, 174, 67, 19, 0, 0, 0, 0, ! 64, 0, 231, 0, 0, 0, 0, 0, 0, 161, ! 0, 169, 170, 171, 172, 162, 0, 173, 174, 0, ! 0, 0, 163, 0, 0, 0, 164, 0, 0, 0, ! 0, 0, 0, 66, 0, 0, 67, 19, 0, 0, ! 165, 166, 0, 0, 167, 0, 0, 0, 0, 0, ! 0, 0, 0, 169, 170, 171, 172, 0, 0, 173, ! 174 }; static const short yycheck[] = { ! 3, 4, 111, 103, 241, 288, 113, 108, 148, 1, ! 128, 168, 5, 401, 496, 15, 52, 88, 508, 1, ! 54, 8, 108, 10, 64, 52, 48, 0, 9, 8, ! 33, 34, 133, 36, 98, 8, 9, 10, 64, 140, ! 43, 63, 2, 30, 80, 5, 27, 133, 75, 496, ! 31, 30, 534, 80, 27, 537, 163, 30, 31, 123, ! 97, 125, 65, 44, 54, 99, 69, 37, 58, 88, ! 40, 44, 108, 70, 102, 260, 98, 37, 142, 52, ! 40, 108, 101, 96, 54, 112, 99, 534, 58, 89, ! 537, 581, 52, 397, 54, 88, 484, 133, 58, 102, ! 103, 128, 248, 108, 131, 97, 133, 80, 90, 255, ! 600, 257, 96, 417, 117, 75, 598, 107, 102, 101, ! 80, 53, 149, 73, 606, 128, 227, 609, 133, 611, ! 102, 44, 69, 233, 44, 108, 163, 107, 88, 112, ! 167, 51, 48, 113, 96, 148, 286, 107, 108, 62, ! 102, 598, 112, 113, 88, 68, 569, 63, 68, 606, ! 133, 101, 609, 52, 611, 102, 103, 101, 128, 473, ! 96, 131, 44, 133, 84, 588, 102, 87, 88, 176, ! 94, 282, 289, 186, 56, 99, 75, 491, 101, 149, ! 62, 80, 98, 163, 44, 96, 68, 157, 158, 159, ! 160, 102, 96, 163, 76, 165, 166, 167, 102, 99, ! 514, 238, 62, 128, 241, 279, 499, 103, 68, 108, ! 223, 534, 55, 112, 537, 108, 229, 60, 95, 101, ! 233, 44, 99, 260, 471, 99, 103, 234, 241, 103, ! 101, 52, 131, 56, 133, 248, 44, 404, 131, 62, ! 133, 278, 255, 51, 257, 68, 96, 90, 97, 99, ! 149, 288, 362, 103, 75, 96, 384, 96, 99, 80, ! 95, 575, 101, 102, 459, 460, 513, 100, 238, 392, ! 99, 241, 395, 286, 103, 598, 84, 260, 101, 87, ! 88, 100, 44, 606, 51, 298, 609, 108, 611, 51, ! 260, 112, 299, 300, 96, 278, 333, 304, 305, 101, ! 102, 99, 315, 316, 101, 288, 103, 128, 278, 289, ! 131, 97, 133, 508, 97, 101, 241, 84, 288, 289, ! 87, 88, 84, 248, 68, 87, 88, 98, 149, 73, ! 255, 102, 257, 77, 371, 260, 96, 448, 95, 238, ! 496, 469, 102, 590, 88, 100, 61, 384, 128, 362, ! 65, 321, 322, 323, 324, 325, 326, 327, 328, 329, ! 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, ! 340, 384, 100, 66, 493, 68, 96, 96, 534, 278, ! 73, 537, 102, 102, 77, 392, 581, 96, 395, 288, ! 546, 128, 496, 102, 101, 88, 103, 97, 509, 99, ! 519, 371, 97, 44, 560, 600, 93, 94, 95, 528, ! 51, 54, 99, 394, 384, 396, 103, 238, 574, 60, ! 241, 62, 102, 430, 5, 6, 7, 68, 398, 103, ! 534, 401, 469, 537, 471, 101, 102, 556, 103, 260, ! 103, 44, 598, 84, 101, 102, 87, 88, 51, 99, ! 606, 93, 94, 609, 103, 611, 469, 278, 471, 384, ! 571, 241, 499, 18, 19, 20, 21, 288, 248, 8, ! 9, 10, 371, 11, 128, 255, 513, 257, 93, 94, ! 260, 84, 12, 496, 87, 88, 46, 47, 157, 158, ! 159, 160, 13, 96, 598, 14, 165, 166, 511, 469, ! 513, 471, 606, 58, 241, 609, 95, 611, 326, 327, ! 328, 248, 333, 483, 484, 95, 499, 496, 255, 95, ! 257, 534, 95, 260, 537, 495, 3, 4, 95, 499, ! 44, 90, 569, 546, 459, 460, 101, 51, 329, 330, ! 331, 332, 95, 513, 469, 101, 471, 560, 16, 17, ! 371, 588, 101, 590, 97, 534, 569, 99, 537, 93, ! 94, 574, 68, 384, 46, 47, 46, 47, 324, 325, ! 84, 496, 99, 87, 88, 588, 96, 590, 95, 68, ! 128, 68, 96, 508, 95, 598, 98, 241, 513, 334, ! 335, 101, 101, 606, 248, 96, 609, 101, 611, 569, ! 499, 255, 101, 257, 384, 102, 260, 0, 67, 534, ! 102, 101, 537, 96, 95, 8, 9, 10, 588, 598, ! 590, 546, 100, 95, 100, 90, 96, 606, 101, 95, ! 609, 95, 611, 96, 27, 560, 96, 30, 31, 101, ! 95, 95, 100, 96, 569, 97, 97, 384, 469, 574, ! 471, 44, 321, 322, 323, 101, 581, 97, 95, 52, ! 57, 128, 57, 588, 96, 590, 101, 96, 96, 95, ! 101, 90, 96, 598, 101, 600, 101, 90, 499, 459, ! 460, 606, 96, 101, 609, 101, 611, 80, 57, 469, ! 88, 471, 513, 241, 0, 93, 94, 95, 101, 0, ! 248, 99, 8, 9, 10, 103, 96, 255, 0, 257, ! 333, 10, 260, 46, 62, 108, 496, 117, 133, 131, ! 278, 27, 459, 460, 30, 31, 45, 380, 508, 398, ! 384, 80, 469, 513, 471, 260, 88, 567, 44, 567, ! 133, 93, 94, 95, 128, 260, 449, 99, 569, 300, ! 449, 103, 336, 338, 534, 337, 339, 537, 344, 496, ! 495, 340, -1, -1, -1, -1, 546, 588, -1, 590, ! -1, 508, -1, -1, 241, -1, 513, -1, -1, -1, ! 560, 248, -1, -1, -1, -1, -1, 128, 255, 569, ! 257, -1, -1, 260, 574, -1, -1, 534, -1, -1, ! 537, 581, 108, -1, -1, 459, 460, -1, 588, 546, ! 590, -1, -1, -1, 483, 469, -1, 471, 598, -1, ! 600, -1, -1, 560, -1, -1, 606, 133, -1, 609, ! -1, 611, 569, -1, -1, -1, 384, 574, -1, -1, ! -1, -1, 496, -1, 581, -1, -1, -1, -1, -1, ! -1, 588, -1, 590, 508, -1, -1, 241, -1, 513, ! -1, 598, -1, 600, 248, -1, -1, -1, -1, 606, ! -1, 255, 609, 257, 611, -1, 260, -1, -1, -1, ! 534, -1, -1, 537, -1, -1, -1, -1, -1, -1, ! -1, -1, 546, 118, -1, -1, -1, -1, -1, -1, ! 241, -1, -1, -1, -1, -1, 560, 248, -1, -1, ! -1, 459, 460, -1, 255, 569, 257, 384, -1, 260, ! 574, 469, -1, 471, -1, -1, -1, 581, -1, -1, ! -1, -1, -1, -1, 588, -1, 590, -1, -1, -1, ! 44, -1, 167, 168, 598, -1, 600, 51, 496, -1, ! -1, -1, 606, -1, -1, 609, 60, 611, 62, -1, ! 508, -1, -1, -1, 68, 513, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, 534, -1, -1, 537, ! -1, -1, 459, 460, 98, -1, 221, -1, 546, 224, ! 384, -1, 469, -1, 471, 230, 231, -1, -1, -1, ! -1, -1, 560, -1, -1, -1, -1, -1, -1, -1, ! -1, 569, -1, -1, -1, -1, 574, -1, -1, 496, ! -1, -1, -1, 581, -1, -1, -1, -1, -1, -1, ! 588, 508, 590, 384, -1, -1, 513, -1, -1, -1, ! 598, -1, 600, -1, -1, -1, -1, -1, 606, -1, ! -1, 609, -1, 611, -1, -1, -1, 534, -1, -1, ! 537, -1, -1, -1, -1, 459, 460, -1, -1, 546, ! -1, -1, -1, -1, -1, 469, -1, 471, -1, 314, ! -1, -1, 317, 560, -1, -1, -1, -1, -1, -1, ! -1, -1, 569, -1, -1, -1, -1, 574, -1, -1, ! -1, -1, 496, -1, 581, -1, 341, -1, 459, 460, ! 345, 588, -1, 590, 508, -1, 351, 352, 469, 513, ! 471, 598, -1, 600, -1, -1, -1, -1, -1, 606, ! -1, -1, 609, -1, 611, -1, -1, -1, -1, -1, ! 534, 376, 377, 537, -1, 496, -1, -1, -1, -1, ! -1, -1, 546, -1, -1, -1, 391, 508, -1, -1, ! -1, -1, 513, -1, -1, -1, 560, -1, -1, 404, ! 157, 158, 159, 160, -1, 569, -1, -1, 165, 166, ! 574, -1, -1, 534, -1, -1, 537, 581, -1, -1, ! 157, 158, 159, 160, 588, 546, 590, -1, 165, 166, ! 1, -1, 3, 4, 598, -1, 600, -1, -1, 560, ! -1, -1, 606, -1, -1, 609, -1, 611, 569, 454, ! -1, -1, -1, 574, 44, -1, -1, -1, -1, -1, ! 581, 51, -1, -1, -1, -1, -1, 588, -1, 590, ! 60, -1, 62, -1, -1, 46, 47, 598, 68, 600, ! 51, -1, -1, -1, 489, 606, -1, -1, 609, 60, ! 611, -1, -1, -1, 84, 66, -1, 87, 88, 504, ! -1, -1, 73, -1, -1, -1, 77, 97, 98, -1, ! -1, 101, -1, 84, -1, -1, 87, 88, -1, -1, ! 91, 92, -1, -1, 95, -1, -1, -1, -1, -1, ! -1, -1, -1, 104, 105, 106, 107, -1, -1, 110, ! 111, -1, -1, -1, -1, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, 559, -1, -1, -1, 563, -1, ! 565, -1, -1, -1, 321, 322, 323, 324, 325, 326, ! 327, 328, 329, 330, 331, 332, -1, 334, 335, 336, ! 337, 338, 339, 340, 321, 322, 323, 324, 325, 326, ! 327, 328, 329, 330, 331, 332, -1, 334, 335, 336, ! 337, 338, 339, 340, 1, -1, 3, 4, 44, -1, ! -1, -1, -1, 44, -1, 51, -1, -1, -1, -1, ! 51, -1, -1, -1, 60, -1, 62, -1, -1, 60, ! -1, 62, 68, -1, -1, -1, -1, 68, -1, -1, ! -1, 398, -1, -1, 401, -1, -1, -1, 84, 46, ! 47, 87, 88, 84, 51, -1, 87, 88, -1, -1, ! -1, 398, 98, 60, 401, -1, 97, 98, -1, 66, ! 101, -1, -1, -1, -1, -1, 73, -1, -1, -1, ! 77, -1, -1, -1, -1, 3, 4, 84, -1, -1, ! 87, 88, -1, -1, 91, 92, -1, -1, 95, -1, ! -1, -1, -1, -1, -1, -1, -1, 104, 105, 106, ! 107, -1, -1, 110, 111, -1, -1, -1, -1, -1, ! -1, -1, -1, -1, -1, -1, 483, 484, 46, 47, ! -1, -1, -1, 51, -1, -1, -1, -1, 495, -1, ! -1, -1, 60, -1, -1, -1, 483, 484, 66, -1, ! -1, 3, 4, -1, -1, 73, -1, -1, 495, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, 97, ! 98, -1, -1, -1, 102, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 46, 47, -1, -1, -1, 51, ! -1, -1, -1, -1, -1, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, -1, 97, 98, -1, -1, -1, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! 46, 47, -1, -1, -1, 51, -1, -1, -1, 3, ! 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, 97, 46, 47, -1, -1, -1, 51, 104, 105, ! 106, 107, -1, -1, 110, 111, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, 3, 4, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, -1, -1, -1, -1, -1, 101, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 46, 47, ! -1, -1, -1, 51, -1, -1, -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, 96, -1, ! 46, 47, -1, -1, -1, 51, 104, 105, 106, 107, ! -1, -1, 110, 111, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, 3, 4, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, -1, -1, 100, -1, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 46, 47, -1, -1, ! -1, 51, -1, -1, -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, -1, -1, 46, 47, ! -1, 101, -1, 51, 104, 105, 106, 107, -1, -1, ! 110, 111, 60, -1, -1, -1, -1, -1, 66, -1, ! -1, 3, 4, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, 96, -1, ! -1, -1, -1, -1, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 46, 47, -1, -1, -1, 51, ! -1, -1, -1, 3, 4, -1, -1, -1, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, -1, -1, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, 96, -1, 46, 47, -1, -1, ! -1, 51, 104, 105, 106, 107, -1, -1, 110, 111, ! 60, -1, -1, -1, -1, -1, 66, -1, -1, 3, ! 4, -1, -1, 73, -1, -1, -1, 77, -1, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, 91, 92, -1, -1, 95, 96, -1, -1, -1, ! -1, -1, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, 46, 47, -1, -1, -1, 51, -1, -1, ! -1, 3, 4, -1, -1, -1, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, -1, -1, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, 96, -1, 46, 47, -1, -1, -1, 51, ! 104, 105, 106, 107, -1, -1, 110, 111, 60, -1, ! -1, -1, -1, -1, 66, -1, -1, 3, 4, -1, ! -1, 73, -1, -1, -1, 77, -1, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, 91, ! 92, -1, -1, 95, 96, -1, -1, -1, -1, -1, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! 46, 47, -1, -1, -1, 51, -1, -1, -1, 3, ! 4, -1, -1, -1, 60, -1, -1, -1, -1, -1, ! 66, -1, -1, -1, -1, -1, -1, 73, -1, -1, ! -1, 77, -1, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, 91, 92, -1, -1, 95, ! -1, -1, 46, 47, -1, 101, -1, 51, 104, 105, ! 106, 107, -1, -1, 110, 111, 60, -1, -1, -1, ! -1, -1, 66, -1, -1, 3, 4, -1, -1, 73, ! -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, 91, 92, -1, ! -1, 95, 96, -1, -1, -1, -1, -1, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 46, 47, ! -1, -1, -1, 51, -1, -1, -1, -1, -1, -1, ! -1, -1, 60, -1, -1, -1, -1, -1, 66, -1, ! -1, -1, -1, -1, -1, 73, -1, -1, -1, 77, ! -1, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, 91, 92, -1, -1, 95, -1, -1, ! -1, -1, -1, -1, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 44, -1, 46, 47, 48, 49, ! 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, ! 60, -1, -1, 63, -1, -1, 66, 67, 68, 69, ! -1, 71, 72, 73, 74, -1, -1, 77, 78, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, -1, -1, -1, -1, 95, -1, 97, 98, -1, ! -1, 101, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, 44, -1, 46, 47, 48, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, ! -1, 63, -1, -1, 66, 67, 68, 69, -1, 71, ! 72, 73, 74, -1, -1, 77, 78, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, -1, ! -1, -1, -1, 95, -1, 97, 98, -1, -1, 101, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, ! 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, ! -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, ! -1, -1, 66, 67, 68, 69, -1, 71, 72, 73, ! 74, -1, -1, 77, 78, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, -1, -1, -1, ! -1, 95, -1, 97, 98, -1, -1, 101, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 44, -1, ! 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, ! -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, ! 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, ! -1, 77, 78, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, -1, -1, -1, -1, 95, ! -1, 97, 98, -1, -1, 101, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, ! 78, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, -1, -1, -1, -1, 95, -1, 97, ! 98, -1, -1, 101, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 44, -1, 46, 47, -1, 49, ! 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, ! 60, -1, -1, -1, -1, -1, 66, 67, 68, 69, ! -1, 71, 72, 73, 74, -1, -1, 77, 78, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, -1, -1, -1, -1, 95, -1, 97, 98, -1, ! -1, 101, -1, -1, 104, 105, 106, 107, -1, -1, ! 110, 111, 44, -1, 46, 47, -1, 49, 50, 51, ! 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, ! -1, -1, -1, -1, 66, 67, 68, 69, -1, 71, ! 72, 73, 74, -1, -1, 77, 78, -1, -1, -1, ! -1, -1, 84, -1, -1, 87, 88, -1, -1, -1, ! -1, -1, -1, 95, -1, 97, 98, -1, -1, 101, ! -1, -1, 104, 105, 106, 107, -1, -1, 110, 111, 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, 66, 67, 68, 69, -1, 71, 72, 73, ! 74, -1, -1, 77, 78, -1, -1, -1, -1, -1, ! 84, -1, -1, 87, 88, -1, -1, -1, -1, -1, ! -1, 95, -1, 97, 98, -1, -1, 101, -1, -1, ! 104, 105, 106, 107, -1, -1, 110, 111, 44, -1, ! 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, ! -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, ! 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, ! -1, 77, 78, -1, -1, -1, -1, -1, 84, -1, ! -1, 87, 88, -1, -1, -1, -1, -1, -1, 95, ! -1, 97, -1, -1, -1, 101, -1, -1, 104, 105, ! 106, 107, -1, -1, 110, 111, 44, -1, 46, 47, ! -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, ! -1, 59, 60, -1, -1, -1, -1, -1, 66, 67, ! -1, 69, -1, 71, 72, 73, 74, -1, -1, 77, ! 78, -1, -1, -1, -1, -1, 84, -1, -1, 87, ! 88, -1, -1, -1, -1, -1, -1, 95, -1, 97, ! -1, -1, -1, 101, -1, -1, 104, 105, 106, 107, ! -1, -1, 110, 111, 44, -1, 46, 47, -1, 49, 50, 51, 52, -1, -1, 55, -1, -1, -1, 59, 60, -1, -1, -1, -1, -1, 66, 67, -1, 69, ! -1, 71, 72, 73, 74, -1, -1, 77, 78, -1, ! -1, -1, -1, -1, 84, -1, -1, 87, 88, -1, ! -1, -1, -1, -1, -1, 95, 44, 97, 46, 47, ! -1, 101, -1, 51, 104, 105, 106, 107, -1, -1, ! 110, 111, 60, -1, -1, -1, -1, -1, 66, -1, ! -1, -1, -1, 46, 47, 73, -1, -1, 51, 77, ! -1, -1, -1, -1, -1, -1, 84, 60, -1, 87, ! 88, -1, -1, 66, -1, -1, -1, 95, -1, -1, ! 73, -1, -1, -1, 77, -1, 104, 105, 106, 107, ! -1, 84, 110, 111, 87, 88, -1, -1, -1, -1, ! 51, -1, 95, -1, -1, -1, -1, -1, -1, 60, ! -1, 104, 105, 106, 107, 66, -1, 110, 111, -1, ! -1, -1, 73, -1, -1, -1, 77, -1, -1, -1, ! -1, -1, -1, 84, -1, -1, 87, 88, -1, -1, ! 91, 92, -1, -1, 95, -1, -1, -1, -1, -1, ! -1, -1, -1, 104, 105, 106, 107, -1, -1, 110, ! 111 }; + #define YYPURE 1 ! /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ ! #line 3 "/usr/share/bison/bison.simple" ! ! /* Skeleton output parser for bison, ! ! Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software ! Foundation, Inc. ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, ! Boston, MA 02111-1307, USA. */ ! ! /* As a special exception, when this file is copied by Bison into a ! Bison output file, you may use that output file without restriction. ! This special exception was added by the Free Software Foundation ! in version 1.24 of Bison. */ ! ! /* This is the parser code that is written into each bison parser when ! the %semantic_parser declaration is not specified in the grammar. ! It was written by Richard Stallman by simplifying the hairy parser ! used when %semantic_parser is specified. */ ! ! /* All symbols defined below should begin with yy or YY, to avoid ! infringing on user name space. This should be done even for local ! variables, as they might otherwise be expanded by user macros. ! There are some unavoidable exceptions within include files to ! define necessary library symbols; they are noted "INFRINGES ON ! USER NAME SPACE" below. */ ! ! #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) ! ! /* The parser invokes alloca or malloc; define the necessary symbols. */ ! ! # if YYSTACK_USE_ALLOCA ! # define YYSTACK_ALLOC alloca ! # else ! # ifndef YYSTACK_USE_ALLOCA ! # if defined (alloca) || defined (_ALLOCA_H) ! # define YYSTACK_ALLOC alloca ! # else ! # ifdef __GNUC__ ! # define YYSTACK_ALLOC __builtin_alloca ! # endif ! # endif ! # endif ! # endif ! ! # ifdef YYSTACK_ALLOC ! /* Pacify GCC's `empty if-body' warning. */ ! # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) ! # else ! # if defined (__STDC__) || defined (__cplusplus) ! # include /* INFRINGES ON USER NAME SPACE */ ! # define YYSIZE_T size_t ! # endif ! # define YYSTACK_ALLOC malloc ! # define YYSTACK_FREE free ! # endif ! #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ ! ! ! #if (! defined (yyoverflow) \ ! && (! defined (__cplusplus) \ ! || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) ! ! /* A type that is properly aligned for any stack member. */ ! union yyalloc { ! short yyss; ! YYSTYPE yyvs; ! # if YYLSP_NEEDED ! YYLTYPE yyls; ! # endif }; + /* The size of the maximum gap between one aligned stack and the next. */ + # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) + + /* The size of an array large to enough to hold all stacks, each with + N elements. */ + # if YYLSP_NEEDED + # define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAX) + # else + # define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) + # endif + + /* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ + # ifndef YYCOPY + # if 1 < __GNUC__ + # define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) + # else + # define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) + # endif + # endif + + /* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ + # define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + + #endif + + #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif *************** static const unsigned short yystos[] = *** 1857,1890 **** #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) ! #define YYEMPTY (-2) #define YYEOF 0 - #define YYACCEPT goto yyacceptlab ! #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 - /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ ! yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ ! yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) --- 1648,1676 ---- #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) ! #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab ! #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ ! yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ ! yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) *************** while (0) *** 1892,1915 **** #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions ! are run). */ #ifndef YYLLOC_DEFAULT ! # define YYLLOC_DEFAULT(Current, Rhs, N) \ ! Current.first_line = Rhs[1].first_line; \ ! Current.first_column = Rhs[1].first_column; \ ! Current.last_line = Rhs[N].last_line; \ ! Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ ! #ifdef YYLEX_PARAM ! # define YYLEX yylex (&yylval, YYLEX_PARAM) ! #else ! # define YYLEX yylex (&yylval) ! #endif /* Enable debugging if requested. */ #if YYDEBUG --- 1678,1718 ---- #define YYTERROR 1 #define YYERRCODE 256 + /* YYLLOC_DEFAULT -- Compute the default location (before the actions ! are run). ! ! When YYLLOC_DEFAULT is run, CURRENT is set the location of the ! first token. By default, to implement support for ranges, extend ! its range to the last symbol. */ #ifndef YYLLOC_DEFAULT ! # define YYLLOC_DEFAULT(Current, Rhs, N) \ ! Current.last_line = Rhs[N].last_line; \ ! Current.last_column = Rhs[N].last_column; #endif + /* YYLEX -- calling `yylex' with the right arguments. */ ! #if YYPURE ! # if YYLSP_NEEDED ! # ifdef YYLEX_PARAM ! # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) ! # else ! # define YYLEX yylex (&yylval, &yylloc) ! # endif ! # else /* !YYLSP_NEEDED */ ! # ifdef YYLEX_PARAM ! # define YYLEX yylex (&yylval, YYLEX_PARAM) ! # else ! # define YYLEX yylex (&yylval) ! # endif ! # endif /* !YYLSP_NEEDED */ ! #else /* !YYPURE */ ! # define YYLEX yylex () ! #endif /* !YYPURE */ ! /* Enable debugging if requested. */ #if YYDEBUG *************** do { \ *** 1924,2016 **** if (yydebug) \ YYFPRINTF Args; \ } while (0) - - # define YYDSYMPRINT(Args) \ - do { \ - if (yydebug) \ - yysymprint Args; \ - } while (0) - - # define YYDSYMPRINTF(Title, Token, Value, Location) \ - do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ - } while (0) - - /*------------------------------------------------------------------. - | yy_stack_print -- Print the state stack from its BOTTOM up to its | - | TOP (cinluded). | - `------------------------------------------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yy_stack_print (short *bottom, short *top) - #else - static void - yy_stack_print (bottom, top) - short *bottom; - short *top; - #endif - { - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); - } - - # define YY_STACK_PRINT(Bottom, Top) \ - do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ - } while (0) - - - /*------------------------------------------------. - | Report that the YYRULE is going to be reduced. | - `------------------------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yy_reduce_print (int yyrule) - #else - static void - yy_reduce_print (yyrule) - int yyrule; - #endif - { - int yyi; - unsigned int yylineno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylineno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); - } - - # define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ - } while (0) - /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) - # define YYDSYMPRINT(Args) - # define YYDSYMPRINTF(Title, Token, Value, Location) - # define YY_STACK_PRINT(Bottom, Top) - # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ - /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 --- 1727,1739 ---- *************** int yydebug; *** 2030,2039 **** #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif - ! ! #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) --- 1753,1760 ---- #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif ! #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) *************** yystpcpy (yydest, yysrc) *** 2083,2208 **** } # endif # endif - - #endif /* !YYERROR_VERBOSE */ - - - - #if YYDEBUG - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) - #else - static void - yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; #endif - { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - # ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); - # endif - } - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); - } - - #endif /* ! YYDEBUG */ - /*-----------------------------------------------. - | Release the memory associated to this symbol. | - `-----------------------------------------------*/ - - #if defined (__STDC__) || defined (__cplusplus) - static void - yydestruct (int yytype, YYSTYPE *yyvaluep) - #else - static void - yydestruct (yytype, yyvaluep) - int yytype; - YYSTYPE *yyvaluep; - #endif - { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - switch (yytype) - { - - default: - break; - } - } ! /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) ! int yyparse (void *YYPARSE_PARAM); # else ! int yyparse (); # endif ! #else /* ! YYPARSE_PARAM */ ! #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); ! #else ! int yyparse (); #endif - #endif /* ! YYPARSE_PARAM */ ! /*----------. ! | yyparse. | ! `----------*/ - #ifdef YYPARSE_PARAM - # if defined (__STDC__) || defined (__cplusplus) - int yyparse (void *YYPARSE_PARAM) - # else - int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; - # endif - #else /* ! YYPARSE_PARAM */ - #if defined (__STDC__) || defined (__cplusplus) - int - yyparse (void) - #else int ! yyparse () ! ! #endif ! #endif { ! /* The lookahead symbol. */ ! int yychar; ! ! /* The semantic value of the lookahead symbol. */ ! YYSTYPE yylval; ! ! /* Number of syntax errors so far. */ ! int yynerrs; register int yystate; register int yyn; --- 1804,1881 ---- } # endif # endif #endif + #line 315 "/usr/share/bison/bison.simple" ! ! /* The user can define YYPARSE_PARAM as the name of an argument to be passed ! into yyparse. The argument should have type void *. ! It should actually point to an object. ! Grammar actions can access the variable by casting it ! to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) ! # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM ! # define YYPARSE_PARAM_DECL # else ! # define YYPARSE_PARAM_ARG YYPARSE_PARAM ! # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif ! #else /* !YYPARSE_PARAM */ ! # define YYPARSE_PARAM_ARG ! # define YYPARSE_PARAM_DECL ! #endif /* !YYPARSE_PARAM */ ! ! /* Prevent warning if -Wstrict-prototypes. */ ! #ifdef __GNUC__ ! # ifdef YYPARSE_PARAM ! int yyparse (void *); ! # else int yyparse (void); ! # endif #endif + /* YY_DECL_VARIABLES -- depending whether we use a pure parser, + variables are global, or local to YYPARSE. */ + #define YY_DECL_NON_LSP_VARIABLES \ + /* The lookahead symbol. */ \ + int yychar; \ + \ + /* The semantic value of the lookahead symbol. */ \ + YYSTYPE yylval; \ + \ + /* Number of parse errors so far. */ \ + int yynerrs; + #if YYLSP_NEEDED + # define YY_DECL_VARIABLES \ + YY_DECL_NON_LSP_VARIABLES \ + \ + /* Location data for the lookahead symbol. */ \ + YYLTYPE yylloc; + #else + # define YY_DECL_VARIABLES \ + YY_DECL_NON_LSP_VARIABLES + #endif + /* If nonreentrant, generate the variables here. */ ! #if !YYPURE ! YY_DECL_VARIABLES ! #endif /* !YYPURE */ int ! yyparse (YYPARSE_PARAM_ARG) ! YYPARSE_PARAM_DECL { ! /* If reentrant, generate the variables here. */ ! #if YYPURE ! YY_DECL_VARIABLES ! #endif /* !YYPURE */ register int yystate; register int yyn; *************** int yynerrs; *** 2210,2216 **** /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ ! int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, --- 1883,1889 ---- /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ ! int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, *************** int yynerrs; *** 2220,2226 **** Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ ! /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; --- 1893,1899 ---- Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ ! /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; *************** int yynerrs; *** 2230,2248 **** YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; ! ! #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; ! /* When reducing, the number of symbols on the RHS of the reduced ! rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); --- 1903,1933 ---- YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; + #if YYLSP_NEEDED + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + #endif ! #if YYLSP_NEEDED ! # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) ! #else ! # define YYPOPSTACK (yyvsp--, yyssp--) ! #endif YYSIZE_T yystacksize = YYINITDEPTH; + /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; ! #if YYLSP_NEEDED ! YYLTYPE yyloc; ! #endif /* When reducing, the number of symbols on the RHS of the reduced ! rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); *************** int yynerrs; *** 2259,2265 **** yyssp = yyss; yyvsp = yyvs; ! goto yysetstate; /*------------------------------------------------------------. --- 1944,1952 ---- yyssp = yyss; yyvsp = yyvs; ! #if YYLSP_NEEDED ! yylsp = yyls; ! #endif goto yysetstate; /*------------------------------------------------------------. *************** int yynerrs; *** 2274,2280 **** yysetstate: *yyssp = yystate; ! if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; --- 1961,1967 ---- yysetstate: *yyssp = yystate; ! if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; *************** int yynerrs; *** 2287,2303 **** YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the ! data in use in that stack, in bytes. This used to be a ! conditional around just the two extra args, but that might ! be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), ! &yystacksize); ! yyss = yyss1; yyvs = yyvs1; } --- 1974,1997 ---- YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the ! data in use in that stack, in bytes. */ ! # if YYLSP_NEEDED ! YYLTYPE *yyls1 = yyls; ! /* This used to be a conditional around just the two extra args, ! but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), ! &yyls1, yysize * sizeof (*yylsp), &yystacksize); ! yyls = yyls1; ! # else ! yyoverflow ("parser stack overflow", ! &yyss1, yysize * sizeof (*yyssp), ! &yyvs1, yysize * sizeof (*yyvsp), ! &yystacksize); ! # endif yyss = yyss1; yyvs = yyvs1; } *************** int yynerrs; *** 2306,2315 **** goto yyoverflowlab; # else /* Extend the stack our own way. */ ! if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; ! if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { --- 2000,2009 ---- goto yyoverflowlab; # else /* Extend the stack our own way. */ ! if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; ! if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { *************** int yynerrs; *** 2320,2327 **** goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); ! ! # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } --- 2014,2023 ---- goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); ! # if YYLSP_NEEDED ! YYSTACK_RELOCATE (yyls); ! # endif ! # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } *************** int yynerrs; *** 2330,2341 **** yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; ! YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); ! if (yyss + yystacksize - 1 <= yyssp) YYABORT; } --- 2026,2039 ---- yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; ! #if YYLSP_NEEDED ! yylsp = yyls + yysize - 1; ! #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); ! if (yyssp >= yyss + yystacksize - 1) YYABORT; } *************** int yynerrs; *** 2343,2348 **** --- 2041,2047 ---- goto yybackup; + /*-----------. | yybackup. | `-----------*/ *************** yybackup: *** 2355,2409 **** /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; ! if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ ! /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } ! if (yychar <= YYEOF) { ! yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { ! yytoken = YYTRANSLATE (yychar); ! YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } ! /* If the proper action on seeing token YYTOKEN is to reduce or to ! detect an error, take that action. */ ! yyn += yytoken; ! if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; ! if (yyn <= 0) { ! if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ ! YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; ! /* Count tokens shifted since error; after three, turn off error status. */ --- 2054,2141 ---- /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; ! if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ ! /* yychar is either YYEMPTY or YYEOF ! or a valid token in external form. */ ! if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } ! /* Convert token to internal form (in yychar1) for indexing tables with */ ! ! if (yychar <= 0) /* This means end of input. */ { ! yychar1 = 0; ! yychar = YYEOF; /* Don't call YYLEX any more */ ! YYDPRINTF ((stderr, "Now at end of input.\n")); } else { ! yychar1 = YYTRANSLATE (yychar); ! ! #if YYDEBUG ! /* We have to keep this `#if YYDEBUG', since we use variables ! which are defined only if `YYDEBUG' is set. */ ! if (yydebug) ! { ! YYFPRINTF (stderr, "Next token is %d (%s", ! yychar, yytname[yychar1]); ! /* Give the individual parser a way to print the precise ! meaning of a token, for further debugging info. */ ! # ifdef YYPRINT ! YYPRINT (stderr, yychar, yylval); ! # endif ! YYFPRINTF (stderr, ")\n"); ! } ! #endif } ! yyn += yychar1; ! if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; + yyn = yytable[yyn]; ! ! /* yyn is what to do for this token type in this state. ! Negative => reduce, -yyn is rule number. ! Positive => shift, yyn is new state. ! New state is final state => don't bother to shift, ! just return success. ! 0, or most negative number => error. */ ! ! if (yyn < 0) { ! if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ ! YYDPRINTF ((stderr, "Shifting token %d (%s), ", ! yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; ! #if YYLSP_NEEDED ! *++yylsp = yylloc; ! #endif /* Count tokens shifted since error; after three, turn off error status. */ *************** yyreduce: *** 2434,2623 **** /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. ! Otherwise, the following line sets YYVAL to garbage. ! This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; ! YY_REDUCE_PRINT (yyn); ! switch (yyn) ! { ! case 11: ! #line 211 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" { /* use preset global here. FIXME */ yyval.node = xstrdup ("int"); ! ;} ! break; ! ! case 12: ! #line 216 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { /* use preset global here. FIXME */ yyval.node = xstrdup ("double"); ! ;} ! break; ! ! case 13: ! #line 221 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { /* use preset global here. FIXME */ yyval.node = xstrdup ("boolean"); ! ;} ! break; ! ! case 19: ! #line 246 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { while (bracket_count-- > 0) yyval.node = concat ("[", yyvsp[-1].node, NULL); ! ;} ! break; ! ! case 20: ! #line 251 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { while (bracket_count-- > 0) yyval.node = concat ("[", yyvsp[-1].node, NULL); ! ;} ! break; ! ! case 24: ! #line 269 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { yyval.node = concat (yyvsp[-2].node, ".", yyvsp[0].node, NULL); ! ;} ! break; ! ! case 38: ! #line 301 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { package_name = yyvsp[-1].node; ;} ! break; ! ! case 46: ! #line 328 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { if (yyvsp[0].value == PUBLIC_TK) modifier_value++; if (yyvsp[0].value == STATIC_TK) modifier_value++; USE_ABSORBER; ! ;} ! break; ! ! case 47: ! #line 336 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { if (yyvsp[0].value == PUBLIC_TK) modifier_value++; if (yyvsp[0].value == STATIC_TK) modifier_value++; USE_ABSORBER; ! ;} ! break; ! ! case 48: ! #line 348 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration(yyvsp[-2].node); modifier_value = 0; ! ;} ! break; ! ! case 50: ! #line 354 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration(yyvsp[-2].node); ;} ! break; ! ! case 56: ! #line 368 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 57: ! #line 370 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 58: ! #line 375 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { pop_class_context (); ;} ! break; ! ! case 59: ! #line 377 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { pop_class_context (); ;} ! break; ! ! case 71: ! #line 403 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 72: ! #line 405 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ;} ! break; ! ! case 77: ! #line 421 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { bracket_count = 0; USE_ABSORBER; ;} ! break; ! ! case 78: ! #line 423 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++bracket_count; ;} ! break; ! ! case 82: ! #line 438 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 84: ! #line 441 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ;} ! break; ! ! case 85: ! #line 443 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_main_declaration (yyvsp[-1].declarator); modifier_value = 0; ! ;} ! break; ! ! case 86: ! #line 451 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { struct method_declarator *d; NEW_METHOD_DECLARATOR (d, yyvsp[-2].node, NULL); yyval.declarator = d; ! ;} ! break; ! ! case 87: ! #line 457 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { struct method_declarator *d; NEW_METHOD_DECLARATOR (d, yyvsp[-3].node, yyvsp[-1].node); yyval.declarator = d; ! ;} ! break; ! ! case 90: ! #line 468 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { yyval.node = concat (yyvsp[-2].node, ",", yyvsp[0].node, NULL); ! ;} ! break; ! ! case 91: ! #line 475 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; if (bracket_count) { --- 2166,2360 ---- /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. ! Otherwise, the following line sets YYVAL to the semantic value of ! the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; + #if YYLSP_NEEDED + /* Similarly for the default location. Let the user run additional + commands if for instance locations are ranges. */ + yyloc = yylsp[1-yylen]; + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + #endif ! #if YYDEBUG ! /* We have to keep this `#if YYDEBUG', since we use variables which ! are defined only if `YYDEBUG' is set. */ ! if (yydebug) { + int yyi; + + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } + #endif + + switch (yyn) { + + case 10: + #line 232 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" + { /* use preset global here. FIXME */ yyval.node = xstrdup ("int"); ! ; ! break;} ! case 11: ! #line 237 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { /* use preset global here. FIXME */ yyval.node = xstrdup ("double"); ! ; ! break;} ! case 12: ! #line 242 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { /* use preset global here. FIXME */ yyval.node = xstrdup ("boolean"); ! ; ! break;} ! case 18: ! #line 267 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { while (bracket_count-- > 0) yyval.node = concat ("[", yyvsp[-1].node, NULL); ! ; ! break;} ! case 19: ! #line 272 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { while (bracket_count-- > 0) yyval.node = concat ("[", yyvsp[-1].node, NULL); ! ; ! break;} ! case 23: ! #line 290 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { yyval.node = concat (yyvsp[-2].node, ".", yyvsp[0].node, NULL); ! ; ! break;} ! case 37: ! #line 322 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { package_name = yyvsp[-1].node; ; ! break;} ! case 45: ! #line 349 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { if (yyvsp[0].value == PUBLIC_TK) modifier_value++; if (yyvsp[0].value == STATIC_TK) modifier_value++; USE_ABSORBER; ! ; ! break;} ! case 46: ! #line 357 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { if (yyvsp[0].value == PUBLIC_TK) modifier_value++; if (yyvsp[0].value == STATIC_TK) modifier_value++; USE_ABSORBER; ! ; ! break;} ! case 47: ! #line 369 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration(yyvsp[-2].node); modifier_value = 0; ! ; ! break;} ! case 49: ! #line 375 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration(yyvsp[-2].node); ; ! break;} ! case 55: ! #line 389 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 56: ! #line 391 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 57: ! #line 396 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { pop_class_context (); ; ! break;} ! case 58: ! #line 398 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { pop_class_context (); ; ! break;} ! case 70: ! #line 424 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 71: ! #line 426 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ; ! break;} ! case 76: ! #line 442 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { bracket_count = 0; USE_ABSORBER; ; ! break;} ! case 77: ! #line 444 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++bracket_count; ; ! break;} ! case 80: ! #line 455 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++method_depth; ; ! break;} ! case 81: ! #line 457 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { --method_depth; ; ! break;} ! case 82: ! #line 462 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 84: ! #line 465 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ; ! break;} ! case 85: ! #line 467 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_main_declaration (yyvsp[-1].declarator); modifier_value = 0; ! ; ! break;} ! case 86: ! #line 475 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { struct method_declarator *d; NEW_METHOD_DECLARATOR (d, yyvsp[-2].node, NULL); yyval.declarator = d; ! ; ! break;} ! case 87: ! #line 481 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { struct method_declarator *d; NEW_METHOD_DECLARATOR (d, yyvsp[-3].node, yyvsp[-1].node); yyval.declarator = d; ! ; ! break;} ! case 90: ! #line 492 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { yyval.node = concat (yyvsp[-2].node, ",", yyvsp[0].node, NULL); ! ; ! break;} ! case 91: ! #line 499 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; if (bracket_count) { *************** yyreduce: *** 2630,2641 **** } else yyval.node = yyvsp[-1].node; ! ;} ! break; ! ! case 92: ! #line 490 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { if (bracket_count) { int i; --- 2367,2377 ---- } else yyval.node = yyvsp[-1].node; ! ; ! break;} ! case 92: ! #line 514 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { if (bracket_count) { int i; *************** yyreduce: *** 2647,2929 **** } else yyval.node = yyvsp[-1].node; ! ;} ! break; ! ! case 95: ! #line 511 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 96: ! #line 513 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 100: ! #line 528 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 102: ! #line 539 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ;} ! break; ! ! case 104: ! #line 544 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ;} ! break; ! ! case 105: ! #line 551 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 106: ! #line 553 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 113: ! #line 570 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 114: ! #line 572 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 117: ! #line 584 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[0].node); modifier_value = 0; ;} ! break; ! ! case 119: ! #line 587 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[0].node); modifier_value = 0; ;} ! break; ! ! case 121: ! #line 590 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[-1].node); modifier_value = 0; ;} ! break; ! ! case 123: ! #line 593 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[-1].node); modifier_value = 0; ;} ! break; ! ! case 127: ! #line 604 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { pop_class_context (); ;} ! break; ! ! case 128: ! #line 606 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { pop_class_context (); ;} ! break; ! ! case 151: ! #line 665 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 152: ! #line 667 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ;} ! break; ! ! case 176: ! #line 707 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 187: ! #line 735 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 188: ! #line 740 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 189: ! #line 745 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 197: ! #line 765 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 202: ! #line 780 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 206: ! #line 797 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 212: ! #line 815 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 223: ! #line 840 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 226: ! #line 849 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 229: ! #line 859 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 235: ! #line 874 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 236: ! #line 878 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 247: ! #line 900 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 248: ! #line 905 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 249: ! #line 907 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 250: ! #line 909 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 251: ! #line 911 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 259: ! #line 926 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration (NULL); ;} ! break; ! ! case 261: ! #line 929 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { report_class_declaration (NULL); ;} ! break; ! ! case 263: ! #line 935 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 277: ! #line 967 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { bracket_count = 1; ;} ! break; ! ! case 278: ! #line 969 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { bracket_count++; ;} ! break; ! ! case 281: ! #line 982 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ++complexity; ;} ! break; ! ! case 282: ! #line 984 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ++complexity; ;} ! break; ! ! case 283: ! #line 985 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 284: ! #line 986 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 285: ! #line 987 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 286: ! #line 988 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 287: ! #line 993 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 290: ! #line 1000 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! case 337: ! #line 1096 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 339: ! #line 1102 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 341: ! #line 1108 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { ++complexity; ;} ! break; ! ! case 345: ! #line 1122 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ;} ! break; ! ! } - /* Line 991 of yacc.c. */ - #line 2917 "ps2505.c" yyvsp -= yylen; yyssp -= yylen; ! ! YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; ! /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule --- 2383,2632 ---- } else yyval.node = yyvsp[-1].node; ! ; ! break;} ! case 95: ! #line 535 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 96: ! #line 537 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 100: ! #line 552 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 102: ! #line 563 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ; ! break;} ! case 104: ! #line 568 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ; ! break;} ! case 105: ! #line 575 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 106: ! #line 577 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 113: ! #line 594 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 114: ! #line 596 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 117: ! #line 608 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[0].node); modifier_value = 0; ; ! break;} ! case 119: ! #line 611 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[0].node); modifier_value = 0; ; ! break;} ! case 121: ! #line 614 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[-1].node); modifier_value = 0; ; ! break;} ! case 123: ! #line 617 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration (yyvsp[-1].node); modifier_value = 0; ; ! break;} ! case 127: ! #line 628 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { pop_class_context (); ; ! break;} ! case 128: ! #line 630 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { pop_class_context (); ; ! break;} ! case 151: ! #line 689 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 152: ! #line 691 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { modifier_value = 0; ; ! break;} ! case 177: ! #line 732 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 188: ! #line 760 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 189: ! #line 765 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 190: ! #line 770 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 198: ! #line 790 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 203: ! #line 805 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 207: ! #line 822 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 213: ! #line 840 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 224: ! #line 865 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 227: ! #line 874 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 230: ! #line 881 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! {yyerror ("Missing term"); RECOVER;; ! break;} ! case 231: ! #line 883 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! {yyerror ("';' expected"); RECOVER;; ! break;} ! case 234: ! #line 892 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 240: ! #line 907 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 241: ! #line 911 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 252: ! #line 933 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 253: ! #line 938 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 254: ! #line 940 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 255: ! #line 942 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 256: ! #line 944 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 264: ! #line 959 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration (anonymous_context); ; ! break;} ! case 266: ! #line 962 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { report_class_declaration (anonymous_context); ; ! break;} ! case 268: ! #line 968 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 282: ! #line 1000 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { bracket_count = 1; ; ! break;} ! case 283: ! #line 1002 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { bracket_count++; ; ! break;} ! case 286: ! #line 1015 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ++complexity; ; ! break;} ! case 287: ! #line 1017 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ++complexity; ; ! break;} ! case 288: ! #line 1018 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 289: ! #line 1019 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 290: ! #line 1020 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 291: ! #line 1021 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 292: ! #line 1026 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 295: ! #line 1033 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! case 342: ! #line 1129 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 344: ! #line 1135 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 346: ! #line 1141 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { ++complexity; ; ! break;} ! case 350: ! #line 1155 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" ! { USE_ABSORBER; ; ! break;} ! } ! #line 705 "/usr/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; + #if YYLSP_NEEDED + yylsp -= yylen; + #endif ! #if YYDEBUG ! if (yydebug) ! { ! short *yyssp1 = yyss - 1; ! YYFPRINTF (stderr, "state stack now"); ! while (yyssp1 != yyssp) ! YYFPRINTF (stderr, " %d", *++yyssp1); ! YYFPRINTF (stderr, "\n"); ! } ! #endif *++yyvsp = yyval; ! #if YYLSP_NEEDED ! *++yylsp = yyloc; ! #endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule *************** yyreduce: *** 2931,2941 **** yyn = yyr1[yyn]; ! yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; ! if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else ! yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; --- 2634,2644 ---- yyn = yyr1[yyn]; ! yystate = yypgoto[yyn - YYNTBASE] + *yyssp; ! if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else ! yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; *************** yyerrlab: *** 2948,2960 **** if (!yyerrstatus) { ++yynerrs; ! #if YYERROR_VERBOSE yyn = yypact[yystate]; ! if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; --- 2651,2663 ---- if (!yyerrstatus) { ++yynerrs; ! ! #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; ! if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; *************** yyerrlab: *** 2963,2977 **** YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; ! yysize += yystrlen ("syntax error, unexpected ") + 1; ! yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { ! char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); ! yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { --- 2666,2680 ---- YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; ! yysize += yystrlen ("parse error, unexpected ") + 1; ! yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { ! char *yyp = yystpcpy (yymsg, "parse error, unexpected "); ! yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { *************** yyerrlab: *** 2979,2985 **** for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); --- 2682,2688 ---- for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) ! if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); *************** yyerrlab: *** 2991,3082 **** YYSTACK_FREE (yymsg); } else ! yyerror ("syntax error; also virtual memory exhausted"); } else ! #endif /* YYERROR_VERBOSE */ ! yyerror ("syntax error"); } ! if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ ! /* Return failure if at end of input. */ if (yychar == YYEOF) ! { ! /* Pop the error token. */ ! YYPOPSTACK; ! /* Pop the rest of the stack. */ ! while (yyss < yyssp) ! { ! YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ! yydestruct (yystos[*yyssp], yyvsp); ! YYPOPSTACK; ! } ! YYABORT; ! } ! ! YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); ! yydestruct (yytoken, &yylval); yychar = YYEMPTY; - } /* Else will try to reuse lookahead token after shifting the error token. */ - goto yyerrlab2; ! /*----------------------------------------------------. ! | yyerrlab1 -- error raised explicitly by an action. | ! `----------------------------------------------------*/ ! yyerrlab1: - /* Suppress GCC warning that yyerrlab1 is unused when no action - invokes YYERROR. */ - #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) - __attribute__ ((__unused__)); - #endif ! goto yyerrlab2; /*---------------------------------------------------------------. ! | yyerrlab2 -- pop states until the error token can be shifted. | `---------------------------------------------------------------*/ ! yyerrlab2: ! yyerrstatus = 3; /* Each real token shifted decrements this. */ ! for (;;) { ! yyn = yypact[yystate]; ! if (yyn != YYPACT_NINF) ! { ! yyn += YYTERROR; ! if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) ! { ! yyn = yytable[yyn]; ! if (0 < yyn) ! break; ! } ! } ! /* Pop the current state because it cannot handle the error token. */ ! if (yyssp == yyss) ! YYABORT; ! YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); ! yydestruct (yystos[yystate], yyvsp); ! yyvsp--; ! yystate = *--yyssp; ! YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; --- 2694,2795 ---- YYSTACK_FREE (yymsg); } else ! yyerror ("parse error; also virtual memory exhausted"); } else ! #endif /* defined (YYERROR_VERBOSE) */ ! yyerror ("parse error"); } + goto yyerrlab1; ! /*--------------------------------------------------. ! | yyerrlab1 -- error raised explicitly by an action | ! `--------------------------------------------------*/ ! yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ ! /* return failure if at end of input */ if (yychar == YYEOF) ! YYABORT; ! YYDPRINTF ((stderr, "Discarding token %d (%s).\n", ! yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ + yyerrstatus = 3; /* Each real token shifted decrements this */ ! goto yyerrhandle; + /*-------------------------------------------------------------------. + | yyerrdefault -- current state does not do anything special for the | + | error token. | + `-------------------------------------------------------------------*/ + yyerrdefault: + #if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ ! /* If its default is to accept any token, ok. Otherwise pop it. */ ! yyn = yydefact[yystate]; ! if (yyn) ! goto yydefault; ! #endif /*---------------------------------------------------------------. ! | yyerrpop -- pop the current state because it cannot handle the | ! | error token | `---------------------------------------------------------------*/ ! yyerrpop: ! if (yyssp == yyss) ! YYABORT; ! yyvsp--; ! yystate = *--yyssp; ! #if YYLSP_NEEDED ! yylsp--; ! #endif ! #if YYDEBUG ! if (yydebug) { ! short *yyssp1 = yyss - 1; ! YYFPRINTF (stderr, "Error: state stack now"); ! while (yyssp1 != yyssp) ! YYFPRINTF (stderr, " %d", *++yyssp1); ! YYFPRINTF (stderr, "\n"); ! } ! #endif ! /*--------------. ! | yyerrhandle. | ! `--------------*/ ! yyerrhandle: ! yyn = yypact[yystate]; ! if (yyn == YYFLAG) ! goto yyerrdefault; ! yyn += YYTERROR; ! if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) ! goto yyerrdefault; ! yyn = yytable[yyn]; ! if (yyn < 0) ! { ! if (yyn == YYFLAG) ! goto yyerrpop; ! yyn = -yyn; ! goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; *************** yyerrlab2: *** 3084,3090 **** YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; ! yystate = yyn; goto yynewstate; --- 2797,2805 ---- YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; ! #if YYLSP_NEEDED ! *++yylsp = yylloc; ! #endif yystate = yyn; goto yynewstate; *************** yyabortlab: *** 3104,3118 **** yyresult = 1; goto yyreturn; ! #ifndef yyoverflow ! /*----------------------------------------------. ! | yyoverflowlab -- parser overflow comes here. | ! `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ - #endif yyreturn: #ifndef yyoverflow --- 2819,2831 ---- yyresult = 1; goto yyreturn; ! /*---------------------------------------------. ! | yyoverflowab -- parser overflow comes here. | ! `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow *************** yyreturn: *** 3121,3129 **** #endif return yyresult; } ! ! ! #line 1140 "/u/molotova/0/galaad/gdosreis/gcc-3.2.3/gcc-3.2.3/gcc/java/parse-scan.y" /* Create a new parser context */ --- 2834,2840 ---- #endif return yyresult; } ! #line 1173 "/home/mitchell/gcc-3.3/gcc-3.3/gcc/java/parse-scan.y" /* Create a new parser context */ *************** static void *** 3142,3199 **** push_class_context (name) const char *name; { ! /* If we already have CURRENT_CLASS set, we're in an inter ! class. Mangle its name. */ ! if (current_class) ! { ! const char *p; ! char anonymous [3]; ! int additional_length; ! ! /* NAME set to NULL indicates an anonymous class, which are named by ! numbering them. */ ! if (!name) ! { ! sprintf (anonymous, "%d", ++anonymous_count); ! p = anonymous; ! } ! else ! p = name; ! ! additional_length = strlen (p)+1; /* +1 for `$' */ ! current_class = xrealloc (current_class, ! current_class_length + additional_length + 1); ! current_class [current_class_length] = '$'; ! strcpy (¤t_class [current_class_length+1], p); ! current_class_length += additional_length; ! } ! else ! { ! if (!name) ! return; ! current_class_length = strlen (name); ! current_class = xmalloc (current_class_length+1); ! strcpy (current_class, name); ! } } static void pop_class_context () { ! /* Go back to the last `$' and cut. */ ! while (--current_class_length > 0 ! && current_class [current_class_length] != '$') ! ; ! if (current_class_length) { ! current_class = xrealloc (current_class, current_class_length+1); ! current_class [current_class_length] = '\0'; } ! else { ! current_class = NULL; ! anonymous_count = 0; } } /* Actions defined here */ --- 2853,2952 ---- push_class_context (name) const char *name; { ! struct class_context *ctx; ! ! ctx = (struct class_context *) xmalloc (sizeof (struct class_context)); ! ctx->name = (char *) name; ! ctx->next = current_class_context; ! current_class_context = ctx; } static void pop_class_context () { ! struct class_context *ctx; ! ! if (current_class_context == NULL) ! return; ! ! ctx = current_class_context->next; ! if (current_class_context->name != anonymous_context) ! free (current_class_context->name); ! free (current_class_context); ! ! current_class_context = ctx; ! if (current_class_context == NULL) ! anonymous_count = 0; ! } ! ! /* Recursively construct the class name. This is just a helper ! function for get_class_name(). */ ! static int ! make_class_name_recursive (stack, ctx) ! struct obstack *stack; ! struct class_context *ctx; ! { ! if (! ctx) ! return 0; ! ! make_class_name_recursive (stack, ctx->next); ! ! /* Replace an anonymous context with the appropriate counter value. */ ! if (ctx->name == anonymous_context) { ! char buf[50]; ! ++anonymous_count; ! sprintf (buf, "%d", anonymous_count); ! ctx->name = xstrdup (buf); } ! ! obstack_grow (stack, ctx->name, strlen (ctx->name)); ! obstack_1grow (stack, '$'); ! ! return ISDIGIT (ctx->name[0]); ! } ! ! /* Return a newly allocated string holding the name of the class. */ ! static char * ! get_class_name () ! { ! char *result; ! int last_was_digit; ! struct obstack name_stack; ! ! obstack_init (&name_stack); ! ! /* Duplicate the logic of parse.y:maybe_make_nested_class_name(). */ ! last_was_digit = make_class_name_recursive (&name_stack, ! current_class_context->next); ! ! if (! last_was_digit ! && method_depth ! && current_class_context->name != anonymous_context) { ! char buf[50]; ! ++anonymous_count; ! sprintf (buf, "%d", anonymous_count); ! obstack_grow (&name_stack, buf, strlen (buf)); ! obstack_1grow (&name_stack, '$'); ! } ! ! if (current_class_context->name == anonymous_context) ! { ! char buf[50]; ! ++anonymous_count; ! sprintf (buf, "%d", anonymous_count); ! current_class_context->name = xstrdup (buf); ! obstack_grow0 (&name_stack, buf, strlen (buf)); } + else + obstack_grow0 (&name_stack, current_class_context->name, + strlen (current_class_context->name)); + + result = xstrdup (obstack_finish (&name_stack)); + obstack_free (&name_stack, NULL); + + return result; } /* Actions defined here */ *************** report_class_declaration (name) *** 3207,3223 **** push_class_context (name); if (flag_dump_class) { if (!previous_output) { if (flag_list_filename) fprintf (out, "%s: ", input_filename); previous_output = 1; } ! if (package_name) ! fprintf (out, "%s.%s ", package_name, current_class); else ! fprintf (out, "%s ", current_class); } } --- 2960,2980 ---- push_class_context (name); if (flag_dump_class) { + char *name = get_class_name (); + if (!previous_output) { if (flag_list_filename) fprintf (out, "%s: ", input_filename); previous_output = 1; } ! if (package_name) ! fprintf (out, "%s.%s ", package_name, name); else ! fprintf (out, "%s ", name); ! ! free (name); } } *************** report_main_declaration (declarator) *** 3234,3247 **** && declarator->args [0] == '[' && (! strcmp (declarator->args+1, "String") || ! strcmp (declarator->args + 1, "java.lang.String")) ! && current_class) { if (!previous_output) { if (package_name) ! fprintf (out, "%s.%s ", package_name, current_class); else ! fprintf (out, "%s", current_class); previous_output = 1; } } --- 2991,3006 ---- && declarator->args [0] == '[' && (! strcmp (declarator->args+1, "String") || ! strcmp (declarator->args + 1, "java.lang.String")) ! && current_class_context) { if (!previous_output) { + char *name = get_class_name (); if (package_name) ! fprintf (out, "%s.%s ", package_name, name); else ! fprintf (out, "%s", name); ! free (name); previous_output = 1; } } *************** void reset_report () *** 3261,3267 **** { previous_output = 0; package_name = NULL; ! current_class = NULL; complexity = 0; } --- 3020,3026 ---- { previous_output = 0; package_name = NULL; ! current_class_context = NULL; complexity = 0; } *************** yyerror (msg) *** 3272,3276 **** fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg); exit (1); } - - --- 3031,3033 ---- diff -Nrc3pad gcc-3.2.3/gcc/java/parse-scan.y gcc-3.3/gcc/java/parse-scan.y *** gcc-3.2.3/gcc/java/parse-scan.y 2001-04-04 17:56:25.000000000 +0000 --- gcc-3.3/gcc/java/parse-scan.y 2002-09-30 14:57:43.000000000 +0000 *************** *** 1,5 **** /* Parser grammar for quick source code scan of Java(TM) language programs. ! Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GNU CC. --- 1,5 ---- /* Parser grammar for quick source code scan of Java(TM) language programs. ! Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GNU CC. *************** definitions and other extensions. */ *** 43,48 **** --- 43,51 ---- #include "obstack.h" #include "toplev.h" + #define obstack_chunk_alloc xmalloc + #define obstack_chunk_free free + extern char *input_filename; extern FILE *finput, *out; *************** int lineno; *** 62,74 **** static int absorber; #define USE_ABSORBER absorber = 0 ! /* Keep track of the current class name and package name. */ ! static char *current_class; static const char *package_name; - /* Keep track of the current inner class qualifier. */ - static int current_class_length; - /* Keep track of whether things have be listed before. */ static int previous_output; --- 65,73 ---- static int absorber; #define USE_ABSORBER absorber = 0 ! /* Keep track of the current package name. */ static const char *package_name; /* Keep track of whether things have be listed before. */ static int previous_output; *************** static int bracket_count; *** 85,90 **** --- 84,105 ---- /* Numbers anonymous classes */ static int anonymous_count; + /* This is used to record the current class context. */ + struct class_context + { + char *name; + struct class_context *next; + }; + + /* The global class context. */ + static struct class_context *current_class_context; + + /* A special constant used to represent an anonymous context. */ + static const char *anonymous_context = "ANONYMOUS"; + + /* Count of method depth. */ + static int method_depth; + /* Record a method declaration */ struct method_declarator { const char *method_name; *************** struct method_declarator { *** 99,104 **** --- 114,122 ---- } /* Two actions for this grammar */ + static int make_class_name_recursive PARAMS ((struct obstack *stack, + struct class_context *ctx)); + static char *get_class_name PARAMS ((void)); static void report_class_declaration PARAMS ((const char *)); static void report_main_declaration PARAMS ((struct method_declarator *)); static void push_class_context PARAMS ((const char *)); *************** void report PARAMS ((void)); *** 117,122 **** --- 135,142 ---- } %{ + extern int flag_assert; + #include "lex.c" %} *************** void report PARAMS ((void)); *** 162,167 **** --- 182,188 ---- %token SWITCH_TK CONST_TK TRY_TK %token FOR_TK NEW_TK CONTINUE_TK %token GOTO_TK PACKAGE_TK THIS_TK + %token ASSERT_TK %token BYTE_TK SHORT_TK INT_TK LONG_TK %token CHAR_TK INTEGRAL_TK *************** variable_initializer: *** 430,436 **** /* 19.8.3 Productions from 8.4: Method Declarations */ method_declaration: ! method_header method_body ; method_header: --- 451,460 ---- /* 19.8.3 Productions from 8.4: Method Declarations */ method_declaration: ! method_header ! { ++method_depth; } ! method_body ! { --method_depth; } ; method_header: *************** statement_without_trailing_substatement: *** 696,701 **** --- 720,726 ---- | synchronized_statement | throw_statement | try_statement + | assert_statement ; empty_statement: *************** throw_statement: *** 849,854 **** --- 874,887 ---- THROW_TK expression SC_TK { ++complexity; } ; + assert_statement: + ASSERT_TK expression REL_CL_TK expression SC_TK + | ASSERT_TK expression SC_TK + | ASSERT_TK error + {yyerror ("Missing term"); RECOVER;} + | ASSERT_TK expression error + {yyerror ("';' expected"); RECOVER;} + ; synchronized_statement: synchronized OP_TK expression CP_TK block | synchronized OP_TK expression CP_TK error *************** class_instance_creation_expression: *** 923,932 **** anonymous_class_creation: NEW_TK class_type OP_TK CP_TK ! { report_class_declaration (NULL); } class_body | NEW_TK class_type OP_TK argument_list CP_TK ! { report_class_declaration (NULL); } class_body ; --- 956,965 ---- anonymous_class_creation: NEW_TK class_type OP_TK CP_TK ! { report_class_declaration (anonymous_context); } class_body | NEW_TK class_type OP_TK argument_list CP_TK ! { report_class_declaration (anonymous_context); } class_body ; *************** static void *** 1155,1212 **** push_class_context (name) const char *name; { ! /* If we already have CURRENT_CLASS set, we're in an inter ! class. Mangle its name. */ ! if (current_class) ! { ! const char *p; ! char anonymous [3]; ! int additional_length; ! ! /* NAME set to NULL indicates an anonymous class, which are named by ! numbering them. */ ! if (!name) ! { ! sprintf (anonymous, "%d", ++anonymous_count); ! p = anonymous; ! } ! else ! p = name; ! ! additional_length = strlen (p)+1; /* +1 for `$' */ ! current_class = xrealloc (current_class, ! current_class_length + additional_length + 1); ! current_class [current_class_length] = '$'; ! strcpy (¤t_class [current_class_length+1], p); ! current_class_length += additional_length; ! } ! else ! { ! if (!name) ! return; ! current_class_length = strlen (name); ! current_class = xmalloc (current_class_length+1); ! strcpy (current_class, name); ! } } static void pop_class_context () { ! /* Go back to the last `$' and cut. */ ! while (--current_class_length > 0 ! && current_class [current_class_length] != '$') ! ; ! if (current_class_length) { ! current_class = xrealloc (current_class, current_class_length+1); ! current_class [current_class_length] = '\0'; } ! else { ! current_class = NULL; ! anonymous_count = 0; } } /* Actions defined here */ --- 1188,1287 ---- push_class_context (name) const char *name; { ! struct class_context *ctx; ! ! ctx = (struct class_context *) xmalloc (sizeof (struct class_context)); ! ctx->name = (char *) name; ! ctx->next = current_class_context; ! current_class_context = ctx; } static void pop_class_context () { ! struct class_context *ctx; ! ! if (current_class_context == NULL) ! return; ! ! ctx = current_class_context->next; ! if (current_class_context->name != anonymous_context) ! free (current_class_context->name); ! free (current_class_context); ! ! current_class_context = ctx; ! if (current_class_context == NULL) ! anonymous_count = 0; ! } ! ! /* Recursively construct the class name. This is just a helper ! function for get_class_name(). */ ! static int ! make_class_name_recursive (stack, ctx) ! struct obstack *stack; ! struct class_context *ctx; ! { ! if (! ctx) ! return 0; ! ! make_class_name_recursive (stack, ctx->next); ! ! /* Replace an anonymous context with the appropriate counter value. */ ! if (ctx->name == anonymous_context) { ! char buf[50]; ! ++anonymous_count; ! sprintf (buf, "%d", anonymous_count); ! ctx->name = xstrdup (buf); } ! ! obstack_grow (stack, ctx->name, strlen (ctx->name)); ! obstack_1grow (stack, '$'); ! ! return ISDIGIT (ctx->name[0]); ! } ! ! /* Return a newly allocated string holding the name of the class. */ ! static char * ! get_class_name () ! { ! char *result; ! int last_was_digit; ! struct obstack name_stack; ! ! obstack_init (&name_stack); ! ! /* Duplicate the logic of parse.y:maybe_make_nested_class_name(). */ ! last_was_digit = make_class_name_recursive (&name_stack, ! current_class_context->next); ! ! if (! last_was_digit ! && method_depth ! && current_class_context->name != anonymous_context) { ! char buf[50]; ! ++anonymous_count; ! sprintf (buf, "%d", anonymous_count); ! obstack_grow (&name_stack, buf, strlen (buf)); ! obstack_1grow (&name_stack, '$'); } + + if (current_class_context->name == anonymous_context) + { + char buf[50]; + ++anonymous_count; + sprintf (buf, "%d", anonymous_count); + current_class_context->name = xstrdup (buf); + obstack_grow0 (&name_stack, buf, strlen (buf)); + } + else + obstack_grow0 (&name_stack, current_class_context->name, + strlen (current_class_context->name)); + + result = xstrdup (obstack_finish (&name_stack)); + obstack_free (&name_stack, NULL); + + return result; } /* Actions defined here */ *************** report_class_declaration (name) *** 1220,1236 **** push_class_context (name); if (flag_dump_class) { if (!previous_output) { if (flag_list_filename) fprintf (out, "%s: ", input_filename); previous_output = 1; } ! if (package_name) ! fprintf (out, "%s.%s ", package_name, current_class); else ! fprintf (out, "%s ", current_class); } } --- 1295,1315 ---- push_class_context (name); if (flag_dump_class) { + char *name = get_class_name (); + if (!previous_output) { if (flag_list_filename) fprintf (out, "%s: ", input_filename); previous_output = 1; } ! if (package_name) ! fprintf (out, "%s.%s ", package_name, name); else ! fprintf (out, "%s ", name); ! ! free (name); } } *************** report_main_declaration (declarator) *** 1247,1260 **** && declarator->args [0] == '[' && (! strcmp (declarator->args+1, "String") || ! strcmp (declarator->args + 1, "java.lang.String")) ! && current_class) { if (!previous_output) { if (package_name) ! fprintf (out, "%s.%s ", package_name, current_class); else ! fprintf (out, "%s", current_class); previous_output = 1; } } --- 1326,1341 ---- && declarator->args [0] == '[' && (! strcmp (declarator->args+1, "String") || ! strcmp (declarator->args + 1, "java.lang.String")) ! && current_class_context) { if (!previous_output) { + char *name = get_class_name (); if (package_name) ! fprintf (out, "%s.%s ", package_name, name); else ! fprintf (out, "%s", name); ! free (name); previous_output = 1; } } *************** void reset_report () *** 1274,1280 **** { previous_output = 0; package_name = NULL; ! current_class = NULL; complexity = 0; } --- 1355,1361 ---- { previous_output = 0; package_name = NULL; ! current_class_context = NULL; complexity = 0; } diff -Nrc3pad gcc-3.2.3/gcc/java/parse.y gcc-3.3/gcc/java/parse.y *** gcc-3.2.3/gcc/java/parse.y 2003-03-18 00:05:29.000000000 +0000 --- gcc-3.3/gcc/java/parse.y 2003-05-03 00:36:56.000000000 +0000 *************** *** 1,6 **** /* Source code parsing and tree node generation for the GNU compiler for the Java(TM) language. ! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GNU CC. --- 1,6 ---- /* Source code parsing and tree node generation for the GNU compiler for the Java(TM) language. ! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GNU CC. *************** Language Specification. J. Gosling, B. J *** 35,41 **** The following modifications were brought to the original grammar: method_body: added the rule '| block SC_TK' ! static_initializer: added the rule 'static block SC_TK'. Note: All the extra rules described above should go away when the empty_statement rule will work. --- 35,41 ---- The following modifications were brought to the original grammar: method_body: added the rule '| block SC_TK' ! static_initializer: added the rule 'static block SC_TK'. Note: All the extra rules described above should go away when the empty_statement rule will work. *************** definitions and other extensions. */ *** 51,56 **** --- 51,57 ---- #include #include "tree.h" #include "rtl.h" + #include "real.h" #include "obstack.h" #include "toplev.h" #include "flags.h" *************** definitions and other extensions. */ *** 65,74 **** #include "function.h" #include "except.h" #include "ggc.h" ! ! #ifndef DIR_SEPARATOR ! #define DIR_SEPARATOR '/' ! #endif /* Local function prototypes */ static char *java_accstring_lookup PARAMS ((int)); --- 66,73 ---- #include "function.h" #include "except.h" #include "ggc.h" ! #include "debug.h" ! #include "tree-inline.h" /* Local function prototypes */ static char *java_accstring_lookup PARAMS ((int)); *************** static void check_abstract_method_header *** 115,121 **** static tree lookup_java_interface_method2 PARAMS ((tree, tree)); static tree resolve_expression_name PARAMS ((tree, tree *)); static tree maybe_create_class_interface_decl PARAMS ((tree, tree, tree, tree)); ! static int check_class_interface_creation PARAMS ((int, int, tree, tree, tree, tree)); static tree patch_method_invocation PARAMS ((tree, tree, tree, int, int *, tree *)); --- 114,120 ---- static tree lookup_java_interface_method2 PARAMS ((tree, tree)); static tree resolve_expression_name PARAMS ((tree, tree *)); static tree maybe_create_class_interface_decl PARAMS ((tree, tree, tree, tree)); ! static int check_class_interface_creation PARAMS ((int, int, tree, tree, tree, tree)); static tree patch_method_invocation PARAMS ((tree, tree, tree, int, int *, tree *)); *************** static tree resolve_and_layout PARAMS (( *** 125,133 **** static tree qualify_and_find PARAMS ((tree, tree, tree)); static tree resolve_no_layout PARAMS ((tree, tree)); static int invocation_mode PARAMS ((tree, int)); ! static tree find_applicable_accessible_methods_list PARAMS ((int, tree, tree, tree)); ! static void search_applicable_methods_list PARAMS ((int, tree, tree, tree, tree *, tree *)); static tree find_most_specific_methods_list PARAMS ((tree)); static int argument_types_convertible PARAMS ((tree, tree)); --- 124,132 ---- static tree qualify_and_find PARAMS ((tree, tree, tree)); static tree resolve_no_layout PARAMS ((tree, tree)); static int invocation_mode PARAMS ((tree, int)); ! static tree find_applicable_accessible_methods_list PARAMS ((int, tree, tree, tree)); ! static void search_applicable_methods_list PARAMS ((int, tree, tree, tree, tree *, tree *)); static tree find_most_specific_methods_list PARAMS ((tree)); static int argument_types_convertible PARAMS ((tree, tree)); *************** static tree patch_array_ref PARAMS ((tre *** 179,185 **** static tree make_qualified_name PARAMS ((tree, tree, int)); static tree merge_qualified_name PARAMS ((tree, tree)); static tree make_qualified_primary PARAMS ((tree, tree, int)); ! static int resolve_qualified_expression_name PARAMS ((tree, tree *, tree *, tree *)); static void qualify_ambiguous_name PARAMS ((tree)); static tree resolve_field_access PARAMS ((tree, tree *, tree *)); --- 178,184 ---- static tree make_qualified_name PARAMS ((tree, tree, int)); static tree merge_qualified_name PARAMS ((tree, tree)); static tree make_qualified_primary PARAMS ((tree, tree, int)); ! static int resolve_qualified_expression_name PARAMS ((tree, tree *, tree *, tree *)); static void qualify_ambiguous_name PARAMS ((tree)); static tree resolve_field_access PARAMS ((tree, tree *, tree *)); *************** static tree build_return PARAMS ((int, t *** 192,198 **** static tree patch_return PARAMS ((tree)); static tree maybe_access_field PARAMS ((tree, tree, tree)); static int complete_function_arguments PARAMS ((tree)); ! static int check_for_static_method_reference PARAMS ((tree, tree, tree, tree, tree)); static int not_accessible_p PARAMS ((tree, tree, tree, int)); static void check_deprecation PARAMS ((tree, tree)); --- 191,197 ---- static tree patch_return PARAMS ((tree)); static tree maybe_access_field PARAMS ((tree, tree, tree)); static int complete_function_arguments PARAMS ((tree)); ! static int check_for_static_method_reference PARAMS ((tree, tree, tree, tree, tree)); static int not_accessible_p PARAMS ((tree, tree, tree, int)); static void check_deprecation PARAMS ((tree, tree)); *************** static tree build_string_concatenation P *** 218,223 **** --- 217,223 ---- static tree patch_string_cst PARAMS ((tree)); static tree patch_string PARAMS ((tree)); static tree encapsulate_with_try_catch PARAMS ((int, tree, tree, tree)); + static tree build_assertion PARAMS ((int, tree, tree)); static tree build_try_statement PARAMS ((int, tree, tree)); static tree build_try_finally_statement PARAMS ((int, tree, tree)); static tree patch_try_statement PARAMS ((tree)); *************** static int pop_current_osb PARAMS ((stru *** 294,304 **** /* JDK 1.1 work. FIXME */ static tree maybe_make_nested_class_name PARAMS ((tree)); ! static void make_nested_class_name PARAMS ((tree)); static void set_nested_class_simple_name_value PARAMS ((tree, int)); static void link_nested_class_to_enclosing PARAMS ((void)); ! static tree resolve_inner_class PARAMS ((struct hash_table *, tree, tree *, ! tree *, tree)); static tree find_as_inner_class PARAMS ((tree, tree, tree)); static tree find_as_inner_class_do PARAMS ((tree, tree)); static int check_inner_class_redefinition PARAMS ((tree, tree)); --- 294,303 ---- /* JDK 1.1 work. FIXME */ static tree maybe_make_nested_class_name PARAMS ((tree)); ! static int make_nested_class_name PARAMS ((tree)); static void set_nested_class_simple_name_value PARAMS ((tree, int)); static void link_nested_class_to_enclosing PARAMS ((void)); ! static tree resolve_inner_class PARAMS ((htab_t, tree, tree *, tree *, tree)); static tree find_as_inner_class PARAMS ((tree, tree, tree)); static tree find_as_inner_class_do PARAMS ((tree, tree)); static int check_inner_class_redefinition PARAMS ((tree, tree)); *************** static tree maybe_build_thisn_access_met *** 310,316 **** static tree build_outer_field_access PARAMS ((tree, tree)); static tree build_outer_field_access_methods PARAMS ((tree)); ! static tree build_outer_field_access_expr PARAMS ((int, tree, tree, tree, tree)); static tree build_outer_method_access_method PARAMS ((tree)); static tree build_new_access_id PARAMS ((void)); --- 309,315 ---- static tree build_outer_field_access PARAMS ((tree, tree)); static tree build_outer_field_access_methods PARAMS ((tree)); ! static tree build_outer_field_access_expr PARAMS ((int, tree, tree, tree, tree)); static tree build_outer_method_access_method PARAMS ((tree)); static tree build_new_access_id PARAMS ((void)); *************** static tree build_outer_field_access_met *** 318,324 **** tree, tree)); static int outer_field_access_p PARAMS ((tree, tree)); ! static int outer_field_expanded_access_p PARAMS ((tree, tree *, tree *, tree *)); static tree outer_field_access_fix PARAMS ((tree, tree, tree)); static tree build_incomplete_class_ref PARAMS ((int, tree)); --- 317,323 ---- tree, tree)); static int outer_field_access_p PARAMS ((tree, tree)); ! static int outer_field_expanded_access_p PARAMS ((tree, tree *, tree *, tree *)); static tree outer_field_access_fix PARAMS ((tree, tree, tree)); static tree build_incomplete_class_ref PARAMS ((int, tree)); *************** static void create_new_parser_context PA *** 333,351 **** static void mark_parser_ctxt PARAMS ((void *)); static tree maybe_build_class_init_for_field PARAMS ((tree, tree)); ! static bool attach_init_test_initialization_flags PARAMS ((struct hash_entry *, ! PTR)); ! static bool emit_test_initialization PARAMS ((struct hash_entry *, PTR)); /* Number of error found so far. */ ! int java_error_count; /* Number of warning found so far. */ int java_warning_count; /* Tell when not to fold, when doing xrefs */ int do_not_fold; /* Cyclic inheritance report, as it can be set by layout_class */ const char *cyclic_inheritance_report; ! /* The current parser context */ struct parser_ctxt *ctxp; --- 332,351 ---- static void mark_parser_ctxt PARAMS ((void *)); static tree maybe_build_class_init_for_field PARAMS ((tree, tree)); ! static int attach_init_test_initialization_flags PARAMS ((PTR *, PTR)); ! static int emit_test_initialization PARAMS ((PTR *, PTR)); ! ! static char *string_convert_int_cst PARAMS ((tree)); /* Number of error found so far. */ ! int java_error_count; /* Number of warning found so far. */ int java_warning_count; /* Tell when not to fold, when doing xrefs */ int do_not_fold; /* Cyclic inheritance report, as it can be set by layout_class */ const char *cyclic_inheritance_report; ! /* The current parser context */ struct parser_ctxt *ctxp; *************** struct parser_ctxt *ctxp_for_generation *** 357,366 **** covers both integral/floating point division. The code is changed once the type of both operator is worked out. */ ! static const enum tree_code binop_lookup[19] = ! { PLUS_EXPR, MINUS_EXPR, MULT_EXPR, RDIV_EXPR, TRUNC_MOD_EXPR, ! LSHIFT_EXPR, RSHIFT_EXPR, URSHIFT_EXPR, BIT_AND_EXPR, BIT_XOR_EXPR, BIT_IOR_EXPR, TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, EQ_EXPR, NE_EXPR, GT_EXPR, GE_EXPR, LT_EXPR, LE_EXPR, --- 357,366 ---- covers both integral/floating point division. The code is changed once the type of both operator is worked out. */ ! static const enum tree_code binop_lookup[19] = ! { PLUS_EXPR, MINUS_EXPR, MULT_EXPR, RDIV_EXPR, TRUNC_MOD_EXPR, ! LSHIFT_EXPR, RSHIFT_EXPR, URSHIFT_EXPR, BIT_AND_EXPR, BIT_XOR_EXPR, BIT_IOR_EXPR, TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, EQ_EXPR, NE_EXPR, GT_EXPR, GE_EXPR, LT_EXPR, LE_EXPR, *************** static const enum tree_code binop_lookup *** 373,426 **** #define BINOP_COMPOUND_CANDIDATES 11 /* The "$L" identifier we use to create labels. */ ! static tree label_id = NULL_TREE; /* The "StringBuffer" identifier used for the String `+' operator. */ ! static tree wfl_string_buffer = NULL_TREE; /* The "append" identifier used for String `+' operator. */ ! static tree wfl_append = NULL_TREE; /* The "toString" identifier used for String `+' operator. */ ! static tree wfl_to_string = NULL_TREE; /* The "java.lang" import qualified name. */ ! static tree java_lang_id = NULL_TREE; /* The generated `inst$' identifier used for generated enclosing instance/field access functions. */ ! static tree inst_id = NULL_TREE; ! ! /* The "java.lang.Cloneable" qualified name. */ ! static tree java_lang_cloneable = NULL_TREE; ! ! /* The "java.io.Serializable" qualified name. */ ! static tree java_io_serializable = NULL_TREE; /* Context and flag for static blocks */ ! static tree current_static_block = NULL_TREE; /* The generated `write_parm_value$' identifier. */ ! static tree wpv_id; /* The list of all packages we've seen so far */ ! static tree package_list = NULL_TREE; ! /* Hold THIS for the scope of the current method decl. */ ! static tree current_this; /* Hold a list of catch clauses list. The first element of this list is the list of the catch clauses of the currently analysed try block. */ ! static tree currently_caught_type_list; /* This holds a linked list of all the case labels for the current switch statement. It is only used when checking to see if there are duplicate labels. FIXME: probably this should just be attached to the switch itself; then it could be referenced via `ctxp->current_loop'. */ ! static tree case_label_list; ! static tree src_parse_roots[1]; /* All classes seen from source code */ #define gclass_list src_parse_roots[0] --- 373,424 ---- #define BINOP_COMPOUND_CANDIDATES 11 /* The "$L" identifier we use to create labels. */ ! static GTY(()) tree label_id; /* The "StringBuffer" identifier used for the String `+' operator. */ ! static GTY(()) tree wfl_string_buffer; /* The "append" identifier used for String `+' operator. */ ! static GTY(()) tree wfl_append; /* The "toString" identifier used for String `+' operator. */ ! static GTY(()) tree wfl_to_string; /* The "java.lang" import qualified name. */ ! static GTY(()) tree java_lang_id; /* The generated `inst$' identifier used for generated enclosing instance/field access functions. */ ! static GTY(()) tree inst_id; /* Context and flag for static blocks */ ! static GTY(()) tree current_static_block; /* The generated `write_parm_value$' identifier. */ ! static GTY(()) tree wpv_id; /* The list of all packages we've seen so far */ ! static GTY(()) tree package_list; ! /* Hold THIS for the scope of the current method decl. */ ! static GTY(()) tree current_this; /* Hold a list of catch clauses list. The first element of this list is the list of the catch clauses of the currently analysed try block. */ ! static GTY(()) tree currently_caught_type_list; /* This holds a linked list of all the case labels for the current switch statement. It is only used when checking to see if there are duplicate labels. FIXME: probably this should just be attached to the switch itself; then it could be referenced via `ctxp->current_loop'. */ ! static GTY(()) tree case_label_list; ! /* Anonymous class counter. Will be reset to 1 every time a non ! anonymous class gets created. */ ! static int anonymous_class_counter = 1; ! ! static GTY(()) tree src_parse_roots[1]; /* All classes seen from source code */ #define gclass_list src_parse_roots[0] *************** static tree src_parse_roots[1]; *** 433,440 **** #define check_modifiers(__message, __value, __mask) do { \ if ((__value) & ~(__mask)) \ { \ ! int i, remainder = (__value) & ~(__mask); \ ! for (i = 0; i <= 10; i++) \ if ((1 << i) & remainder) \ parse_error_context (ctxp->modifier_ctx [i], (__message), \ java_accstring_lookup (1 << i)); \ --- 431,438 ---- #define check_modifiers(__message, __value, __mask) do { \ if ((__value) & ~(__mask)) \ { \ ! size_t i, remainder = (__value) & ~(__mask); \ ! for (i = 0; i < ARRAY_SIZE (ctxp->modifier_ctx); i++) \ if ((1 << i) & remainder) \ parse_error_context (ctxp->modifier_ctx [i], (__message), \ java_accstring_lookup (1 << i)); \ *************** static tree src_parse_roots[1]; *** 465,477 **** %token PLUS_TK MINUS_TK MULT_TK DIV_TK REM_TK %token LS_TK SRS_TK ZRS_TK %token AND_TK XOR_TK OR_TK ! %token BOOL_AND_TK BOOL_OR_TK %token EQ_TK NEQ_TK GT_TK GTE_TK LT_TK LTE_TK /* This maps to the same binop_lookup entry than the token above */ %token PLUS_ASSIGN_TK MINUS_ASSIGN_TK MULT_ASSIGN_TK DIV_ASSIGN_TK ! %token REM_ASSIGN_TK %token LS_ASSIGN_TK SRS_ASSIGN_TK ZRS_ASSIGN_TK %token AND_ASSIGN_TK XOR_ASSIGN_TK OR_ASSIGN_TK --- 463,475 ---- %token PLUS_TK MINUS_TK MULT_TK DIV_TK REM_TK %token LS_TK SRS_TK ZRS_TK %token AND_TK XOR_TK OR_TK ! %token BOOL_AND_TK BOOL_OR_TK %token EQ_TK NEQ_TK GT_TK GTE_TK LT_TK LTE_TK /* This maps to the same binop_lookup entry than the token above */ %token PLUS_ASSIGN_TK MINUS_ASSIGN_TK MULT_ASSIGN_TK DIV_ASSIGN_TK ! %token REM_ASSIGN_TK %token LS_ASSIGN_TK SRS_ASSIGN_TK ZRS_ASSIGN_TK %token AND_ASSIGN_TK XOR_ASSIGN_TK OR_ASSIGN_TK *************** static tree src_parse_roots[1]; *** 491,497 **** %token DEFAULT_TK IF_TK THROW_TK %token BOOLEAN_TK DO_TK IMPLEMENTS_TK ! %token THROWS_TK BREAK_TK IMPORT_TK %token ELSE_TK INSTANCEOF_TK RETURN_TK %token VOID_TK CATCH_TK INTERFACE_TK %token CASE_TK EXTENDS_TK FINALLY_TK --- 489,495 ---- %token DEFAULT_TK IF_TK THROW_TK %token BOOLEAN_TK DO_TK IMPLEMENTS_TK ! %token THROWS_TK BREAK_TK IMPORT_TK %token ELSE_TK INSTANCEOF_TK RETURN_TK %token VOID_TK CATCH_TK INTERFACE_TK %token CASE_TK EXTENDS_TK FINALLY_TK *************** static tree src_parse_roots[1]; *** 499,504 **** --- 497,503 ---- %token SWITCH_TK CONST_TK TRY_TK %token FOR_TK NEW_TK CONTINUE_TK %token GOTO_TK PACKAGE_TK THIS_TK + %token ASSERT_TK %token BYTE_TK SHORT_TK INT_TK LONG_TK %token CHAR_TK INTEGRAL_TK *************** static tree src_parse_roots[1]; *** 522,528 **** %type type_declaration compilation_unit field_declaration method_declaration extends_interfaces interfaces interface_type_list ! import_declarations package_declaration type_declarations interface_body interface_member_declaration constant_declaration interface_member_declarations interface_type --- 521,527 ---- %type type_declaration compilation_unit field_declaration method_declaration extends_interfaces interfaces interface_type_list ! import_declarations package_declaration type_declarations interface_body interface_member_declaration constant_declaration interface_member_declarations interface_type *************** static tree src_parse_roots[1]; *** 551,591 **** array_creation_expression array_type class_instance_creation_expression field_access method_invocation array_access something_dot_new ! argument_list postfix_expression while_expression post_increment_expression post_decrement_expression unary_expression_not_plus_minus unary_expression pre_increment_expression pre_decrement_expression cast_expression multiplicative_expression additive_expression ! shift_expression relational_expression ! equality_expression and_expression exclusive_or_expression inclusive_or_expression conditional_and_expression conditional_or_expression conditional_expression assignment_expression left_hand_side assignment for_header for_begin constant_expression do_statement_begin empty_statement switch_statement synchronized_statement throw_statement ! try_statement switch_expression switch_block catches catch_clause catch_clause_parameter finally anonymous_class_creation trap_overflow_corner_case %type return_statement break_statement continue_statement ! %type ASSIGN_TK MULT_ASSIGN_TK DIV_ASSIGN_TK %type REM_ASSIGN_TK PLUS_ASSIGN_TK MINUS_ASSIGN_TK %type LS_ASSIGN_TK SRS_ASSIGN_TK ZRS_ASSIGN_TK %type AND_ASSIGN_TK XOR_ASSIGN_TK OR_ASSIGN_TK %type ASSIGN_ANY_TK assignment_operator ! %token EQ_TK GTE_TK ZRS_TK SRS_TK GT_TK LTE_TK LS_TK %token BOOL_AND_TK AND_TK BOOL_OR_TK OR_TK INCR_TK PLUS_TK %token DECR_TK MINUS_TK MULT_TK DIV_TK XOR_TK REM_TK NEQ_TK %token NEG_TK REL_QM_TK REL_CL_TK NOT_TK LT_TK OCB_TK CCB_TK %token OP_TK OSB_TK DOT_TK THROW_TK INSTANCEOF_TK ! %type THIS_TK SUPER_TK RETURN_TK BREAK_TK CONTINUE_TK %type CASE_TK DEFAULT_TK TRY_TK CATCH_TK SYNCHRONIZED_TK ! %type NEW_TK - %type method_body - %type literal INT_LIT_TK FP_LIT_TK BOOL_LIT_TK CHAR_LIT_TK STRING_LIT_TK NULL_TK VOID_TK --- 550,591 ---- array_creation_expression array_type class_instance_creation_expression field_access method_invocation array_access something_dot_new ! argument_list postfix_expression while_expression post_increment_expression post_decrement_expression unary_expression_not_plus_minus unary_expression pre_increment_expression pre_decrement_expression cast_expression multiplicative_expression additive_expression ! shift_expression relational_expression ! equality_expression and_expression exclusive_or_expression inclusive_or_expression conditional_and_expression conditional_or_expression conditional_expression assignment_expression left_hand_side assignment for_header for_begin constant_expression do_statement_begin empty_statement switch_statement synchronized_statement throw_statement ! try_statement assert_statement ! switch_expression switch_block catches catch_clause catch_clause_parameter finally anonymous_class_creation trap_overflow_corner_case %type return_statement break_statement continue_statement ! %type ASSIGN_TK MULT_ASSIGN_TK DIV_ASSIGN_TK %type REM_ASSIGN_TK PLUS_ASSIGN_TK MINUS_ASSIGN_TK %type LS_ASSIGN_TK SRS_ASSIGN_TK ZRS_ASSIGN_TK %type AND_ASSIGN_TK XOR_ASSIGN_TK OR_ASSIGN_TK %type ASSIGN_ANY_TK assignment_operator ! %token EQ_TK GTE_TK ZRS_TK SRS_TK GT_TK LTE_TK LS_TK %token BOOL_AND_TK AND_TK BOOL_OR_TK OR_TK INCR_TK PLUS_TK %token DECR_TK MINUS_TK MULT_TK DIV_TK XOR_TK REM_TK NEQ_TK %token NEG_TK REL_QM_TK REL_CL_TK NOT_TK LT_TK OCB_TK CCB_TK %token OP_TK OSB_TK DOT_TK THROW_TK INSTANCEOF_TK ! %type THIS_TK SUPER_TK RETURN_TK BREAK_TK CONTINUE_TK %type CASE_TK DEFAULT_TK TRY_TK CATCH_TK SYNCHRONIZED_TK ! %type NEW_TK ASSERT_TK ! ! %type method_body %type literal INT_LIT_TK FP_LIT_TK BOOL_LIT_TK CHAR_LIT_TK STRING_LIT_TK NULL_TK VOID_TK *************** static tree src_parse_roots[1]; *** 594,600 **** %type formal_parameter_list formal_parameter method_declarator method_header ! %type primitive_type reference_type type BOOLEAN_TK INTEGRAL_TK FP_TK /* Added or modified JDK 1.1 rule types */ --- 594,600 ---- %type formal_parameter_list formal_parameter method_declarator method_header ! %type primitive_type reference_type type BOOLEAN_TK INTEGRAL_TK FP_TK /* Added or modified JDK 1.1 rule types */ *************** goal: *** 606,629 **** { /* Register static variables with the garbage collector. */ ! ggc_add_tree_root (&label_id, 1); ! ggc_add_tree_root (&wfl_string_buffer, 1); ! ggc_add_tree_root (&wfl_append, 1); ! ggc_add_tree_root (&wfl_to_string, 1); ! ggc_add_tree_root (&java_lang_id, 1); ! ggc_add_tree_root (&inst_id, 1); ! ggc_add_tree_root (&java_lang_cloneable, 1); ! ggc_add_tree_root (&java_io_serializable, 1); ! ggc_add_tree_root (¤t_static_block, 1); ! ggc_add_tree_root (&wpv_id, 1); ! ggc_add_tree_root (&package_list, 1); ! ggc_add_tree_root (¤t_this, 1); ! ggc_add_tree_root (¤tly_caught_type_list, 1); ! ggc_add_tree_root (&case_label_list, 1); ! ggc_add_root (&ctxp, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); ! ggc_add_root (&ctxp_for_generation, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); } --- 606,615 ---- { /* Register static variables with the garbage collector. */ ! ggc_add_root (&ctxp, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); ! ggc_add_root (&ctxp_for_generation, 1, sizeof (struct parser_ctxt *), mark_parser_ctxt); } *************** interface_type: *** 672,678 **** array_type: primitive_type dims ! { int osb = pop_current_osb (ctxp); tree t = build_java_array_type (($1), -1); while (--osb) --- 658,664 ---- array_type: primitive_type dims ! { int osb = pop_current_osb (ctxp); tree t = build_java_array_type (($1), -1); while (--osb) *************** array_type: *** 680,686 **** $$ = t; } | name dims ! { int osb = pop_current_osb (ctxp); tree t = $1; while (osb--) --- 666,672 ---- $$ = t; } | name dims ! { int osb = pop_current_osb (ctxp); tree t = $1; while (osb--) *************** type_declarations: *** 738,744 **** package_declaration: PACKAGE_TK name SC_TK ! { ctxp->package = EXPR_WFL_NODE ($2); register_package (ctxp->package); } --- 724,730 ---- package_declaration: PACKAGE_TK name SC_TK ! { ctxp->package = EXPR_WFL_NODE ($2); register_package (ctxp->package); } *************** single_type_import_declaration: *** 772,778 **** if (err && err != name) parse_error_context ($2, "Ambiguous class: `%s' and `%s'", ! IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (err)); else REGISTER_IMPORT ($2, last_name); --- 758,764 ---- if (err && err != name) parse_error_context ($2, "Ambiguous class: `%s' and `%s'", ! IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (err)); else REGISTER_IMPORT ($2, last_name); *************** type_import_on_demand_declaration: *** 800,806 **** if (! it) { read_import_dir ($2); ! ctxp->import_demand_list = chainon (ctxp->import_demand_list, build_tree_list ($2, NULL_TREE)); } --- 786,792 ---- if (! it) { read_import_dir ($2); ! ctxp->import_demand_list = chainon (ctxp->import_demand_list, build_tree_list ($2, NULL_TREE)); } *************** modifiers: *** 836,842 **** { int acc = (1 << $2); if ($$ & acc) ! parse_error_context (ctxp->modifier_ctx [$2], "Modifier `%s' declared twice", java_accstring_lookup (acc)); else --- 822,828 ---- { int acc = (1 << $2); if ($$ & acc) ! parse_error_context (ctxp->modifier_ctx [$2], "Modifier `%s' declared twice", java_accstring_lookup (acc)); else *************** class_declaration: *** 852,872 **** { create_class ($1, $3, $4, $5); } class_body {;} ! | CLASS_TK identifier super interfaces { create_class (0, $2, $3, $4); } class_body {;} | modifiers CLASS_TK error ! {yyerror ("Missing class name"); RECOVER;} | CLASS_TK error ! {yyerror ("Missing class name"); RECOVER;} | CLASS_TK identifier error { ! if (!ctxp->class_err) yyerror ("'{' expected"); DRECOVER(class1); } | modifiers CLASS_TK identifier error ! {if (!ctxp->class_err) yyerror ("'{' expected"); RECOVER;} ; super: --- 838,858 ---- { create_class ($1, $3, $4, $5); } class_body {;} ! | CLASS_TK identifier super interfaces { create_class (0, $2, $3, $4); } class_body {;} | modifiers CLASS_TK error ! { yyerror ("Missing class name"); RECOVER; } | CLASS_TK error ! { yyerror ("Missing class name"); RECOVER; } | CLASS_TK identifier error { ! if (!ctxp->class_err) yyerror ("'{' expected"); DRECOVER(class1); } | modifiers CLASS_TK identifier error ! { if (!ctxp->class_err) yyerror ("'{' expected"); RECOVER; } ; super: *************** interfaces: *** 886,903 **** | IMPLEMENTS_TK error { ctxp->class_err=1; ! yyerror ("Missing interface name"); } ; interface_type_list: interface_type ! { ctxp->interface_number = 1; $$ = build_tree_list ($1, NULL_TREE); } | interface_type_list C_TK interface_type ! { ctxp->interface_number++; $$ = chainon ($1, build_tree_list ($3, NULL_TREE)); } --- 872,889 ---- | IMPLEMENTS_TK error { ctxp->class_err=1; ! yyerror ("Missing interface name"); } ; interface_type_list: interface_type ! { ctxp->interface_number = 1; $$ = build_tree_list ($1, NULL_TREE); } | interface_type_list C_TK interface_type ! { ctxp->interface_number++; $$ = chainon ($1, build_tree_list ($3, NULL_TREE)); } *************** interface_type_list: *** 907,924 **** class_body: OCB_TK CCB_TK ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL ($2.location, 1); $$ = GET_CPC (); } | OCB_TK class_body_declarations CCB_TK ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL ($3.location, 1); $$ = GET_CPC (); } --- 893,910 ---- class_body: OCB_TK CCB_TK ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL ($2.location, 1); $$ = GET_CPC (); } | OCB_TK class_body_declarations CCB_TK ! { /* Store the location of the `}' when doing xrefs */ if (flag_emit_xref) ! DECL_END_SOURCE_LINE (GET_CPC ()) = EXPR_WFL_ADD_COL ($3.location, 1); $$ = GET_CPC (); } *************** field_declaration: *** 959,965 **** { register_fields (0, $1, $2); } | modifiers type variable_declarators SC_TK { ! check_modifiers ("Illegal modifier `%s' for field declaration", $1, FIELD_MODIFIERS); check_modifiers_consistency ($1); --- 945,951 ---- { register_fields (0, $1, $2); } | modifiers type variable_declarators SC_TK { ! check_modifiers ("Illegal modifier `%s' for field declaration", $1, FIELD_MODIFIERS); check_modifiers_consistency ($1); *************** variable_declarator: *** 980,989 **** variable_declarator_id { $$ = build_tree_list ($1, NULL_TREE); } | variable_declarator_id ASSIGN_TK variable_initializer ! { if (java_error_count) $3 = NULL_TREE; ! $$ = build_tree_list ($1, build_assignment ($2.token, $2.location, $1, $3)); } | variable_declarator_id ASSIGN_TK error --- 966,975 ---- variable_declarator_id { $$ = build_tree_list ($1, NULL_TREE); } | variable_declarator_id ASSIGN_TK variable_initializer ! { if (java_error_count) $3 = NULL_TREE; ! $$ = build_tree_list ($1, build_assignment ($2.token, $2.location, $1, $3)); } | variable_declarator_id ASSIGN_TK error *************** variable_declarator_id: *** 1007,1019 **** | identifier error {yyerror ("Invalid declaration"); DRECOVER(vdi);} | variable_declarator_id OSB_TK error ! { ! tree node = java_lval.node; ! if (node && (TREE_CODE (node) == INTEGER_CST ! || TREE_CODE (node) == EXPR_WITH_FILE_LOCATION)) ! yyerror ("Can't specify array dimension in a declaration"); ! else ! yyerror ("']' expected"); DRECOVER(vdi); } | variable_declarator_id CSB_TK error --- 993,1000 ---- | identifier error {yyerror ("Invalid declaration"); DRECOVER(vdi);} | variable_declarator_id OSB_TK error ! { ! yyerror ("']' expected"); DRECOVER(vdi); } | variable_declarator_id CSB_TK error *************** variable_initializer: *** 1027,1033 **** /* 19.8.3 Productions from 8.4: Method Declarations */ method_declaration: ! method_header { current_function_decl = $1; if (current_function_decl --- 1008,1014 ---- /* 19.8.3 Productions from 8.4: Method Declarations */ method_declaration: ! method_header { current_function_decl = $1; if (current_function_decl *************** method_declaration: *** 1042,1048 **** {YYNOT_TWICE yyerror ("'{' expected"); RECOVER;} ; ! method_header: type method_declarator throws { $$ = method_header (0, $1, $2, $3); } | VOID_TK method_declarator throws --- 1023,1029 ---- {YYNOT_TWICE yyerror ("'{' expected"); RECOVER;} ; ! method_header: type method_declarator throws { $$ = method_header (0, $1, $2, $3); } | VOID_TK method_declarator throws *************** method_header: *** 1057,1067 **** RECOVER; } | modifiers type error ! {RECOVER;} | VOID_TK error ! {yyerror ("Identifier expected"); RECOVER;} | modifiers VOID_TK error ! {yyerror ("Identifier expected"); RECOVER;} | modifiers error { yyerror ("Invalid method declaration, return type required"); --- 1038,1057 ---- RECOVER; } | modifiers type error ! { ! yyerror ("Identifier expected"); ! RECOVER; ! } | VOID_TK error ! { ! yyerror ("Identifier expected"); ! RECOVER; ! } | modifiers VOID_TK error ! { ! yyerror ("Identifier expected"); ! RECOVER; ! } | modifiers error { yyerror ("Invalid method declaration, return type required"); *************** method_header: *** 1071,1077 **** method_declarator: identifier OP_TK CP_TK ! { ctxp->formal_parameter_number = 0; $$ = method_declarator ($1, NULL_TREE); } --- 1061,1067 ---- method_declarator: identifier OP_TK CP_TK ! { ctxp->formal_parameter_number = 0; $$ = method_declarator ($1, NULL_TREE); } *************** method_declarator: *** 1080,1089 **** | method_declarator OSB_TK CSB_TK { EXPR_WFL_LINECOL (wfl_operator) = $2.location; ! TREE_PURPOSE ($1) = build_unresolved_array_type (TREE_PURPOSE ($1)); ! parse_warning_context ! (wfl_operator, "Discouraged form of returned type specification"); } | identifier OP_TK error --- 1070,1079 ---- | method_declarator OSB_TK CSB_TK { EXPR_WFL_LINECOL (wfl_operator) = $2.location; ! TREE_PURPOSE ($1) = build_unresolved_array_type (TREE_PURPOSE ($1)); ! parse_warning_context ! (wfl_operator, "Discouraged form of returned type specification"); } | identifier OP_TK error *************** formal_parameter: *** 1112,1118 **** $$ = build_tree_list ($2, $1); } | final type variable_declarator_id /* Added, JDK1.1 final parms */ ! { $$ = build_tree_list ($3, $2); ARG_FINAL_P ($$) = 1; } --- 1102,1108 ---- $$ = build_tree_list ($2, $1); } | final type variable_declarator_id /* Added, JDK1.1 final parms */ ! { $$ = build_tree_list ($3, $2); ARG_FINAL_P ($$) = 1; } *************** static: /* Test lval.sub_token here * *** 1177,1183 **** /* Can't have a static initializer in an innerclass */ if ($1 | ACC_STATIC && GET_CPC_LIST () && !TOPLEVEL_CLASS_DECL_P (GET_CPC ())) ! parse_error_context (MODIFIER_WFL (STATIC_TK), "Can't define static initializer in class `%s'. Static initializer can only be defined in top-level classes", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ()))); --- 1167,1173 ---- /* Can't have a static initializer in an innerclass */ if ($1 | ACC_STATIC && GET_CPC_LIST () && !TOPLEVEL_CLASS_DECL_P (GET_CPC ())) ! parse_error_context (MODIFIER_WFL (STATIC_TK), "Can't define static initializer in class `%s'. Static initializer can only be defined in top-level classes", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ()))); *************** constructor_header: *** 1205,1212 **** constructor_declarator: simple_name OP_TK CP_TK ! { ! ctxp->formal_parameter_number = 0; $$ = method_declarator ($1, NULL_TREE); } | simple_name OP_TK formal_parameter_list CP_TK --- 1195,1202 ---- constructor_declarator: simple_name OP_TK CP_TK ! { ! ctxp->formal_parameter_number = 0; $$ = method_declarator ($1, NULL_TREE); } | simple_name OP_TK formal_parameter_list CP_TK *************** constructor_body: *** 1218,1224 **** body so we can safely perform all the required code addition (super invocation and field initialization) */ block_begin constructor_block_end ! { BLOCK_EXPR_BODY ($2) = empty_stmt_node; $$ = $2; } --- 1208,1214 ---- body so we can safely perform all the required code addition (super invocation and field initialization) */ block_begin constructor_block_end ! { BLOCK_EXPR_BODY ($2) = empty_stmt_node; $$ = $2; } *************** constructor_block_end: *** 1237,1250 **** /* Error recovery for that rule moved down expression_statement: rule. */ explicit_constructor_invocation: this_or_super OP_TK CP_TK SC_TK ! { ! $$ = build_method_invocation ($1, NULL_TREE); $$ = build_debugable_stmt (EXPR_WFL_LINECOL ($1), $$); $$ = java_method_add_stmt (current_function_decl, $$); } | this_or_super OP_TK argument_list CP_TK SC_TK ! { ! $$ = build_method_invocation ($1, $3); $$ = build_debugable_stmt (EXPR_WFL_LINECOL ($1), $$); $$ = java_method_add_stmt (current_function_decl, $$); } --- 1227,1240 ---- /* Error recovery for that rule moved down expression_statement: rule. */ explicit_constructor_invocation: this_or_super OP_TK CP_TK SC_TK ! { ! $$ = build_method_invocation ($1, NULL_TREE); $$ = build_debugable_stmt (EXPR_WFL_LINECOL ($1), $$); $$ = java_method_add_stmt (current_function_decl, $$); } | this_or_super OP_TK argument_list CP_TK SC_TK ! { ! $$ = build_method_invocation ($1, $3); $$ = build_debugable_stmt (EXPR_WFL_LINECOL ($1), $$); $$ = java_method_add_stmt (current_function_decl, $$); } *************** interface_declaration: *** 1291,1309 **** interface_body { ; } | INTERFACE_TK identifier error ! {yyerror ("'{' expected"); RECOVER;} | modifiers INTERFACE_TK identifier error ! {yyerror ("'{' expected"); RECOVER;} ; extends_interfaces: EXTENDS_TK interface_type ! { ctxp->interface_number = 1; $$ = build_tree_list ($2, NULL_TREE); } | extends_interfaces C_TK interface_type ! { ctxp->interface_number++; $$ = chainon ($1, build_tree_list ($3, NULL_TREE)); } --- 1281,1299 ---- interface_body { ; } | INTERFACE_TK identifier error ! { yyerror ("'{' expected"); RECOVER; } | modifiers INTERFACE_TK identifier error ! { yyerror ("'{' expected"); RECOVER; } ; extends_interfaces: EXTENDS_TK interface_type ! { ctxp->interface_number = 1; $$ = build_tree_list ($2, NULL_TREE); } | extends_interfaces C_TK interface_type ! { ctxp->interface_number++; $$ = chainon ($1, build_tree_list ($3, NULL_TREE)); } *************** constant_declaration: *** 1340,1346 **** abstract_method_declaration: method_header SC_TK ! { check_abstract_method_header ($1); current_function_decl = NULL_TREE; /* FIXME ? */ } --- 1330,1336 ---- abstract_method_declaration: method_header SC_TK ! { check_abstract_method_header ($1); current_function_decl = NULL_TREE; /* FIXME ? */ } *************** array_initializer: *** 1362,1369 **** variable_initializers: variable_initializer ! { ! $$ = tree_cons (maybe_build_array_element_wfl ($1), $1, NULL_TREE); } | variable_initializers C_TK variable_initializer --- 1352,1359 ---- variable_initializers: variable_initializer ! { ! $$ = tree_cons (maybe_build_array_element_wfl ($1), $1, NULL_TREE); } | variable_initializers C_TK variable_initializer *************** variable_initializers: *** 1377,1388 **** /* 19.11 Production from 14: Blocks and Statements */ block: OCB_TK CCB_TK ! { /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = EXPR_WFL_ADD_COL ($2.location, 1); ! $$ = empty_stmt_node; } | block_begin block_statements block_end { $$ = $3; } --- 1367,1378 ---- /* 19.11 Production from 14: Blocks and Statements */ block: OCB_TK CCB_TK ! { /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = EXPR_WFL_ADD_COL ($2.location, 1); ! $$ = empty_stmt_node; } | block_begin block_statements block_end { $$ = $3; } *************** block_begin: *** 1395,1406 **** block_end: CCB_TK ! { maybe_absorb_scoping_blocks (); /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = ! EXPR_WFL_ADD_COL ($1.location, 1); $$ = exit_block (); if (!BLOCK_SUBBLOCKS ($$)) BLOCK_SUBBLOCKS ($$) = empty_stmt_node; --- 1385,1396 ---- block_end: CCB_TK ! { maybe_absorb_scoping_blocks (); /* Store the location of the `}' when doing xrefs */ if (current_function_decl && flag_emit_xref) ! DECL_END_SOURCE_LINE (current_function_decl) = ! EXPR_WFL_ADD_COL ($1.location, 1); $$ = exit_block (); if (!BLOCK_SUBBLOCKS ($$)) BLOCK_SUBBLOCKS ($$) = empty_stmt_node; *************** block_statement: *** 1417,1423 **** | statement { java_method_add_stmt (current_function_decl, $1); } | class_declaration /* Added, JDK1.1 local classes */ ! { LOCAL_CLASS_P (TREE_TYPE (GET_CPC ())) = 1; end_class_declaration (1); } --- 1407,1413 ---- | statement { java_method_add_stmt (current_function_decl, $1); } | class_declaration /* Added, JDK1.1 local classes */ ! { LOCAL_CLASS_P (TREE_TYPE (GET_CPC ())) = 1; end_class_declaration (1); } *************** statement_without_trailing_substatement: *** 1465,1482 **** | synchronized_statement | throw_statement | try_statement ; empty_statement: SC_TK ! { ! if (flag_extraneous_semicolon ! && ! current_static_block ! && (! current_function_decl || /* Verify we're not in a inner class declaration */ (GET_CPC () != TYPE_NAME (DECL_CONTEXT (current_function_decl))))) ! { EXPR_WFL_SET_LINECOL (wfl_operator, lineno, -1); parse_warning_context (wfl_operator, "An empty declaration is a deprecated feature that should not be used"); --- 1455,1473 ---- | synchronized_statement | throw_statement | try_statement + | assert_statement ; empty_statement: SC_TK ! { ! if (flag_extraneous_semicolon ! && ! current_static_block ! && (! current_function_decl || /* Verify we're not in a inner class declaration */ (GET_CPC () != TYPE_NAME (DECL_CONTEXT (current_function_decl))))) ! { EXPR_WFL_SET_LINECOL (wfl_operator, lineno, -1); parse_warning_context (wfl_operator, "An empty declaration is a deprecated feature that should not be used"); *************** empty_statement: *** 1488,1494 **** label_decl: identifier REL_CL_TK { ! $$ = build_labeled_block (EXPR_WFL_LINECOL ($1), EXPR_WFL_NODE ($1)); pushlevel (2); push_labeled_block ($$); --- 1479,1485 ---- label_decl: identifier REL_CL_TK { ! $$ = build_labeled_block (EXPR_WFL_LINECOL ($1), EXPR_WFL_NODE ($1)); pushlevel (2); push_labeled_block ($$); *************** expression_statement: *** 1520,1526 **** info to be eventually generate here. */ $$ = JAVA_MAYBE_GENERATE_DEBUG_INFO ($$); } ! | error SC_TK { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); --- 1511,1517 ---- info to be eventually generate here. */ $$ = JAVA_MAYBE_GENERATE_DEBUG_INFO ($$); } ! | error SC_TK { YYNOT_TWICE yyerror ("Invalid expression statement"); DRECOVER (expr_stmt); *************** expression_statement: *** 1561,1567 **** {yyerror ("';' expected"); RECOVER;} ; ! statement_expression: assignment | pre_increment_expression | pre_decrement_expression --- 1552,1558 ---- {yyerror ("';' expected"); RECOVER;} ; ! statement_expression: assignment | pre_increment_expression | pre_decrement_expression *************** statement_expression: *** 1573,1580 **** if_then_statement: IF_TK OP_TK expression CP_TK statement ! { ! $$ = build_if_else_statement ($2.location, $3, $5, NULL_TREE); } | IF_TK error --- 1564,1571 ---- if_then_statement: IF_TK OP_TK expression CP_TK statement ! { ! $$ = build_if_else_statement ($2.location, $3, $5, NULL_TREE); } | IF_TK error *************** switch_statement: *** 1601,1607 **** enter_block (); } switch_block ! { /* Make into "proper list" of COMPOUND_EXPRs. I.e. make the last statement also have its own COMPOUND_EXPR. */ --- 1592,1598 ---- enter_block (); } switch_block ! { /* Make into "proper list" of COMPOUND_EXPRs. I.e. make the last statement also have its own COMPOUND_EXPR. */ *************** switch_statement: *** 1613,1619 **** switch_expression: SWITCH_TK OP_TK expression CP_TK ! { $$ = build (SWITCH_EXPR, NULL_TREE, $3, NULL_TREE); EXPR_WFL_LINECOL ($$) = $2.location; } --- 1604,1610 ---- switch_expression: SWITCH_TK OP_TK expression CP_TK ! { $$ = build (SWITCH_EXPR, NULL_TREE, $3, NULL_TREE); EXPR_WFL_LINECOL ($$) = $2.location; } *************** switch_block: *** 1639,1645 **** { $$ = NULL_TREE; } ; ! switch_block_statement_groups: switch_block_statement_group | switch_block_statement_groups switch_block_statement_group ; --- 1630,1636 ---- { $$ = NULL_TREE; } ; ! switch_block_statement_groups: switch_block_statement_group | switch_block_statement_groups switch_block_statement_group ; *************** switch_labels: *** 1655,1667 **** switch_label: CASE_TK constant_expression REL_CL_TK ! { tree lab = build1 (CASE_EXPR, NULL_TREE, $2); EXPR_WFL_LINECOL (lab) = $1.location; java_method_add_stmt (current_function_decl, lab); } | DEFAULT_TK REL_CL_TK ! { tree lab = build (DEFAULT_EXPR, NULL_TREE, NULL_TREE); EXPR_WFL_LINECOL (lab) = $1.location; java_method_add_stmt (current_function_decl, lab); --- 1646,1658 ---- switch_label: CASE_TK constant_expression REL_CL_TK ! { tree lab = build1 (CASE_EXPR, NULL_TREE, $2); EXPR_WFL_LINECOL (lab) = $1.location; java_method_add_stmt (current_function_decl, lab); } | DEFAULT_TK REL_CL_TK ! { tree lab = build (DEFAULT_EXPR, NULL_TREE, NULL_TREE); EXPR_WFL_LINECOL (lab) = $1.location; java_method_add_stmt (current_function_decl, lab); *************** switch_label: *** 1676,1682 **** while_expression: WHILE_TK OP_TK expression CP_TK ! { tree body = build_loop_body ($2.location, $3, 0); $$ = build_new_loop (body); } --- 1667,1673 ---- while_expression: WHILE_TK OP_TK expression CP_TK ! { tree body = build_loop_body ($2.location, $3, 0); $$ = build_new_loop (body); } *************** while_statement_nsi: *** 1700,1713 **** do_statement_begin: DO_TK ! { tree body = build_loop_body (0, NULL_TREE, 1); $$ = build_new_loop (body); } /* Need error handing here. FIXME */ ; ! do_statement: do_statement_begin statement WHILE_TK OP_TK expression CP_TK SC_TK { $$ = finish_loop_body ($4.location, $5, $2, 1); } ; --- 1691,1704 ---- do_statement_begin: DO_TK ! { tree body = build_loop_body (0, NULL_TREE, 1); $$ = build_new_loop (body); } /* Need error handing here. FIXME */ ; ! do_statement: do_statement_begin statement WHILE_TK OP_TK expression CP_TK SC_TK { $$ = finish_loop_body ($4.location, $5, $2, 1); } ; *************** for_statement: *** 1720,1729 **** $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7); } | for_begin SC_TK SC_TK for_update CP_TK statement ! { $$ = finish_for_loop (0, NULL_TREE, $4, $6); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY ($$), 0) = empty_stmt_node; } | for_begin SC_TK error --- 1711,1720 ---- $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7); } | for_begin SC_TK SC_TK for_update CP_TK statement ! { $$ = finish_for_loop (0, NULL_TREE, $4, $6); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY ($$), 0) = empty_stmt_node; } | for_begin SC_TK error *************** for_statement_nsi: *** 1738,1757 **** for_begin SC_TK expression SC_TK for_update CP_TK statement_nsi { $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7);} | for_begin SC_TK SC_TK for_update CP_TK statement_nsi ! { $$ = finish_for_loop (0, NULL_TREE, $4, $6); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY ($$), 0) = empty_stmt_node; } ; for_header: FOR_TK OP_TK ! { /* This scope defined for local variable that may be defined within the scope of the for loop */ ! enter_block (); } | FOR_TK error {yyerror ("'(' expected"); DRECOVER(for_1);} --- 1729,1748 ---- for_begin SC_TK expression SC_TK for_update CP_TK statement_nsi { $$ = finish_for_loop (EXPR_WFL_LINECOL ($3), $3, $5, $7);} | for_begin SC_TK SC_TK for_update CP_TK statement_nsi ! { $$ = finish_for_loop (0, NULL_TREE, $4, $6); /* We have not condition, so we get rid of the EXIT_EXPR */ ! LOOP_EXPR_BODY_CONDITION_EXPR (LOOP_EXPR_BODY ($$), 0) = empty_stmt_node; } ; for_header: FOR_TK OP_TK ! { /* This scope defined for local variable that may be defined within the scope of the for loop */ ! enter_block (); } | FOR_TK error {yyerror ("'(' expected"); DRECOVER(for_1);} *************** for_header: *** 1761,1767 **** for_begin: for_header for_init ! { /* We now declare the loop body. The loop is declared as a for loop. */ tree body = build_loop_body (0, NULL_TREE, 0); --- 1752,1758 ---- for_begin: for_header for_init ! { /* We now declare the loop body. The loop is declared as a for loop. */ tree body = build_loop_body (0, NULL_TREE, 0); *************** for_begin: *** 1775,1787 **** for_init: /* Can be empty */ { $$ = empty_stmt_node; } | statement_expression_list ! { /* Init statement recorded within the previously defined block scope */ $$ = java_method_add_stmt (current_function_decl, $1); } | local_variable_declaration ! { /* Local variable are recorded within the previously defined block scope */ $$ = NULL_TREE; --- 1766,1778 ---- for_init: /* Can be empty */ { $$ = empty_stmt_node; } | statement_expression_list ! { /* Init statement recorded within the previously defined block scope */ $$ = java_method_add_stmt (current_function_decl, $1); } | local_variable_declaration ! { /* Local variable are recorded within the previously defined block scope */ $$ = NULL_TREE; *************** return_statement: *** 1840,1846 **** throw_statement: THROW_TK expression SC_TK ! { $$ = build1 (THROW_EXPR, NULL_TREE, $2); EXPR_WFL_LINECOL ($$) = $1.location; } --- 1831,1837 ---- throw_statement: THROW_TK expression SC_TK ! { $$ = build1 (THROW_EXPR, NULL_TREE, $2); EXPR_WFL_LINECOL ($$) = $1.location; } *************** throw_statement: *** 1850,1860 **** {yyerror ("';' expected"); RECOVER;} ; synchronized_statement: synchronized OP_TK expression CP_TK block ! { $$ = build (SYNCHRONIZED_EXPR, NULL_TREE, $3, $5); ! EXPR_WFL_LINECOL ($$) = EXPR_WFL_LINECOL (MODIFIER_WFL (SYNCHRONIZED_TK)); } | synchronized OP_TK expression CP_TK error --- 1841,1866 ---- {yyerror ("';' expected"); RECOVER;} ; + assert_statement: + ASSERT_TK expression REL_CL_TK expression SC_TK + { + $$ = build_assertion ($1.location, $2, $4); + } + | ASSERT_TK expression SC_TK + { + $$ = build_assertion ($1.location, $2, NULL_TREE); + } + | ASSERT_TK error + {yyerror ("Missing term"); RECOVER;} + | ASSERT_TK expression error + {yyerror ("';' expected"); RECOVER;} + ; + synchronized_statement: synchronized OP_TK expression CP_TK block ! { $$ = build (SYNCHRONIZED_EXPR, NULL_TREE, $3, $5); ! EXPR_WFL_LINECOL ($$) = EXPR_WFL_LINECOL (MODIFIER_WFL (SYNCHRONIZED_TK)); } | synchronized OP_TK expression CP_TK error *************** synchronized: *** 1874,1880 **** "Illegal modifier `%s'. Only `synchronized' was expected here", $1, ACC_SYNCHRONIZED); if ($1 != ACC_SYNCHRONIZED) ! MODIFIER_WFL (SYNCHRONIZED_TK) = build_wfl_node (NULL_TREE); } ; --- 1880,1886 ---- "Illegal modifier `%s'. Only `synchronized' was expected here", $1, ACC_SYNCHRONIZED); if ($1 != ACC_SYNCHRONIZED) ! MODIFIER_WFL (SYNCHRONIZED_TK) = build_wfl_node (NULL_TREE); } ; *************** try_statement: *** 1885,1891 **** | TRY_TK block finally { $$ = build_try_finally_statement ($1.location, $2, $3); } | TRY_TK block catches finally ! { $$ = build_try_finally_statement ($1.location, build_try_statement ($1.location, $2, $3), $4); } --- 1891,1897 ---- | TRY_TK block finally { $$ = build_try_finally_statement ($1.location, $2, $3); } | TRY_TK block catches finally ! { $$ = build_try_finally_statement ($1.location, build_try_statement ($1.location, $2, $3), $4); } *************** try_statement: *** 1896,1902 **** catches: catch_clause | catches catch_clause ! { TREE_CHAIN ($2) = $1; $$ = $2; } --- 1902,1908 ---- catches: catch_clause | catches catch_clause ! { TREE_CHAIN ($2) = $1; $$ = $2; } *************** catches: *** 1904,1910 **** catch_clause: catch_clause_parameter block ! { java_method_add_stmt (current_function_decl, $2); exit_block (); $$ = $1; --- 1910,1916 ---- catch_clause: catch_clause_parameter block ! { java_method_add_stmt (current_function_decl, $2); exit_block (); $$ = $1; *************** catch_clause: *** 1913,1926 **** catch_clause_parameter: CATCH_TK OP_TK formal_parameter CP_TK ! { /* We add a block to define a scope for formal_parameter (CCBP). The formal parameter is declared initialized by the appropriate function call */ tree ccpb = enter_block (); tree init = build_assignment ! (ASSIGN_TK, $2.location, TREE_PURPOSE ($3), build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); declare_local_variables (0, TREE_VALUE ($3), build_tree_list (TREE_PURPOSE ($3), --- 1919,1932 ---- catch_clause_parameter: CATCH_TK OP_TK formal_parameter CP_TK ! { /* We add a block to define a scope for formal_parameter (CCBP). The formal parameter is declared initialized by the appropriate function call */ tree ccpb = enter_block (); tree init = build_assignment ! (ASSIGN_TK, $2.location, TREE_PURPOSE ($3), build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); declare_local_variables (0, TREE_VALUE ($3), build_tree_list (TREE_PURPOSE ($3), *************** catch_clause_parameter: *** 1930,1938 **** } | CATCH_TK error {yyerror ("'(' expected"); RECOVER; $$ = NULL_TREE;} ! | CATCH_TK OP_TK error { ! yyerror ("Missing term or ')' expected"); RECOVER; $$ = NULL_TREE; } | CATCH_TK OP_TK error CP_TK /* That's for () */ --- 1936,1944 ---- } | CATCH_TK error {yyerror ("'(' expected"); RECOVER; $$ = NULL_TREE;} ! | CATCH_TK OP_TK error { ! yyerror ("Missing term or ')' expected"); RECOVER; $$ = NULL_TREE; } | CATCH_TK OP_TK error CP_TK /* That's for () */ *************** primary_no_new_array: *** 1967,1977 **** refering to a 'ClassName' (class_name) rule that doesn't exist. Used name: instead. */ | name DOT_TK THIS_TK ! { tree wfl = build_wfl_node (this_identifier_node); $$ = make_qualified_primary ($1, wfl, EXPR_WFL_LINECOL ($1)); } ! | OP_TK expression error {yyerror ("')' expected"); RECOVER;} | name DOT_TK error {yyerror ("'class' or 'this' expected" ); RECOVER;} --- 1973,1983 ---- refering to a 'ClassName' (class_name) rule that doesn't exist. Used name: instead. */ | name DOT_TK THIS_TK ! { tree wfl = build_wfl_node (this_identifier_node); $$ = make_qualified_primary ($1, wfl, EXPR_WFL_LINECOL ($1)); } ! | OP_TK expression error {yyerror ("')' expected"); RECOVER;} | name DOT_TK error {yyerror ("'class' or 'this' expected" ); RECOVER;} *************** type_literals: *** 1989,1995 **** | primitive_type DOT_TK CLASS_TK { $$ = build_incomplete_class_ref ($2.location, $1); } | VOID_TK DOT_TK CLASS_TK ! { $$ = build_incomplete_class_ref ($2.location, void_type_node); } --- 1995,2001 ---- | primitive_type DOT_TK CLASS_TK { $$ = build_incomplete_class_ref ($2.location, $1); } | VOID_TK DOT_TK CLASS_TK ! { $$ = build_incomplete_class_ref ($2.location, void_type_node); } *************** class_instance_creation_expression: *** 2005,2024 **** primary instead of primary solely which couldn't work in all situations. */ | something_dot_new identifier OP_TK CP_TK ! { tree ctor = build_new_invocation ($2, NULL_TREE); ! $$ = make_qualified_primary ($1, ctor, EXPR_WFL_LINECOL ($1)); } | something_dot_new identifier OP_TK CP_TK class_body | something_dot_new identifier OP_TK argument_list CP_TK ! { tree ctor = build_new_invocation ($2, $4); ! $$ = make_qualified_primary ($1, ctor, EXPR_WFL_LINECOL ($1)); } | something_dot_new identifier OP_TK argument_list CP_TK class_body ! | NEW_TK error SC_TK {yyerror ("'(' expected"); DRECOVER(new_1);} | NEW_TK class_type error {yyerror ("'(' expected"); RECOVER;} --- 2011,2030 ---- primary instead of primary solely which couldn't work in all situations. */ | something_dot_new identifier OP_TK CP_TK ! { tree ctor = build_new_invocation ($2, NULL_TREE); ! $$ = make_qualified_primary ($1, ctor, EXPR_WFL_LINECOL ($1)); } | something_dot_new identifier OP_TK CP_TK class_body | something_dot_new identifier OP_TK argument_list CP_TK ! { tree ctor = build_new_invocation ($2, $4); ! $$ = make_qualified_primary ($1, ctor, EXPR_WFL_LINECOL ($1)); } | something_dot_new identifier OP_TK argument_list CP_TK class_body ! | NEW_TK error SC_TK {yyerror ("'(' expected"); DRECOVER(new_1);} | NEW_TK class_type error {yyerror ("'(' expected"); RECOVER;} *************** class_instance_creation_expression: *** 2038,2047 **** in the documentation but doesn't exist. */ anonymous_class_creation: ! NEW_TK class_type OP_TK argument_list CP_TK { create_anonymous_class ($1.location, $2); } class_body ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL ($2); --- 2044,2053 ---- in the documentation but doesn't exist. */ anonymous_class_creation: ! NEW_TK class_type OP_TK argument_list CP_TK { create_anonymous_class ($1.location, $2); } class_body ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL ($2); *************** anonymous_class_creation: *** 2063,2069 **** must be generated following the hints provided by the `new' expression. Whether a super constructor of that nature exists or not is to be verified ! later on in verify_constructor_super. It's during the expansion of a `new' statement refering to an anonymous class that a ctor will --- 2069,2075 ---- must be generated following the hints provided by the `new' expression. Whether a super constructor of that nature exists or not is to be verified ! later on in verify_constructor_super. It's during the expansion of a `new' statement refering to an anonymous class that a ctor will *************** anonymous_class_creation: *** 2071,2080 **** right arguments. */ } ! | NEW_TK class_type OP_TK CP_TK { create_anonymous_class ($1.location, $2); } ! class_body ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL ($2); --- 2077,2086 ---- right arguments. */ } ! | NEW_TK class_type OP_TK CP_TK { create_anonymous_class ($1.location, $2); } ! class_body ! { tree id = build_wfl_node (DECL_NAME (GET_CPC ())); EXPR_WFL_LINECOL (id) = EXPR_WFL_LINECOL ($2); *************** something_dot_new: /* Added, not part o *** 2097,2105 **** argument_list: expression ! { $$ = tree_cons (NULL_TREE, $1, NULL_TREE); ! ctxp->formal_parameter_number = 1; } | argument_list C_TK expression { --- 2103,2111 ---- argument_list: expression ! { $$ = tree_cons (NULL_TREE, $1, NULL_TREE); ! ctxp->formal_parameter_number = 1; } | argument_list C_TK expression { *************** array_creation_expression: *** 2133,2144 **** $2, get_identifier (sig), $4); } | NEW_TK primitive_type dims array_initializer ! { int osb = pop_current_osb (ctxp); tree type = $2; while (osb--) type = build_java_array_type (type, -1); ! $$ = build (NEW_ANONYMOUS_ARRAY_EXPR, NULL_TREE, build_pointer_type (type), NULL_TREE, $4); } | NEW_TK error CSB_TK --- 2139,2150 ---- $2, get_identifier (sig), $4); } | NEW_TK primitive_type dims array_initializer ! { int osb = pop_current_osb (ctxp); tree type = $2; while (osb--) type = build_java_array_type (type, -1); ! $$ = build (NEW_ANONYMOUS_ARRAY_EXPR, NULL_TREE, build_pointer_type (type), NULL_TREE, $4); } | NEW_TK error CSB_TK *************** dim_exprs: *** 2156,2162 **** dim_expr: OSB_TK expression CSB_TK ! { if (JNUMERIC_TYPE_P (TREE_TYPE ($2))) { $2 = build_wfl_node ($2); --- 2162,2168 ---- dim_expr: OSB_TK expression CSB_TK ! { if (JNUMERIC_TYPE_P (TREE_TYPE ($2))) { $2 = build_wfl_node ($2); *************** dim_expr: *** 2175,2183 **** } ; ! dims: OSB_TK CSB_TK ! { int allocate = 0; /* If not initialized, allocate memory for the osb numbers stack */ --- 2181,2189 ---- } ; ! dims: OSB_TK CSB_TK ! { int allocate = 0; /* If not initialized, allocate memory for the osb numbers stack */ *************** dims: *** 2189,2195 **** /* If capacity overflown, reallocate a bigger chunk */ else if (ctxp->osb_depth+1 == ctxp->osb_limit) allocate = ctxp->osb_limit << 1; ! if (allocate) { allocate *= sizeof (int); --- 2195,2201 ---- /* If capacity overflown, reallocate a bigger chunk */ else if (ctxp->osb_depth+1 == ctxp->osb_limit) allocate = ctxp->osb_limit << 1; ! if (allocate) { allocate *= sizeof (int); *************** dims: *** 2211,2217 **** field_access: primary DOT_TK identifier { $$ = make_qualified_primary ($1, $3, $2.location); } ! /* FIXME - REWRITE TO: { $$ = build_binop (COMPONENT_REF, $2.location, $1, $3); } */ | SUPER_TK DOT_TK identifier { --- 2217,2223 ---- field_access: primary DOT_TK identifier { $$ = make_qualified_primary ($1, $3, $2.location); } ! /* FIXME - REWRITE TO: { $$ = build_binop (COMPONENT_REF, $2.location, $1, $3); } */ | SUPER_TK DOT_TK identifier { *************** method_invocation: *** 2229,2237 **** | name OP_TK argument_list CP_TK { $$ = build_method_invocation ($1, $3); } | primary DOT_TK identifier OP_TK CP_TK ! { if (TREE_CODE ($1) == THIS_EXPR) ! $$ = build_this_super_qualified_invocation (1, $3, NULL_TREE, 0, $2.location); else { --- 2235,2243 ---- | name OP_TK argument_list CP_TK { $$ = build_method_invocation ($1, $3); } | primary DOT_TK identifier OP_TK CP_TK ! { if (TREE_CODE ($1) == THIS_EXPR) ! $$ = build_this_super_qualified_invocation (1, $3, NULL_TREE, 0, $2.location); else { *************** method_invocation: *** 2240,2248 **** } } | primary DOT_TK identifier OP_TK argument_list CP_TK ! { if (TREE_CODE ($1) == THIS_EXPR) ! $$ = build_this_super_qualified_invocation (1, $3, $5, 0, $2.location); else { --- 2246,2254 ---- } } | primary DOT_TK identifier OP_TK argument_list CP_TK ! { if (TREE_CODE ($1) == THIS_EXPR) ! $$ = build_this_super_qualified_invocation (1, $3, $5, 0, $2.location); else { *************** method_invocation: *** 2251,2263 **** } } | SUPER_TK DOT_TK identifier OP_TK CP_TK ! { ! $$ = build_this_super_qualified_invocation (0, $3, NULL_TREE, $1.location, $2.location); } | SUPER_TK DOT_TK identifier OP_TK argument_list CP_TK { ! $$ = build_this_super_qualified_invocation (0, $3, $5, $1.location, $2.location); } /* Screws up thing. I let it here until I'm convinced it can --- 2257,2269 ---- } } | SUPER_TK DOT_TK identifier OP_TK CP_TK ! { ! $$ = build_this_super_qualified_invocation (0, $3, NULL_TREE, $1.location, $2.location); } | SUPER_TK DOT_TK identifier OP_TK argument_list CP_TK { ! $$ = build_this_super_qualified_invocation (0, $3, $5, $1.location, $2.location); } /* Screws up thing. I let it here until I'm convinced it can *************** unary_expression_not_plus_minus: *** 2365,2386 **** cast_expression: /* Error handling here is potentially weak */ OP_TK primitive_type dims CP_TK unary_expression ! { tree type = $2; int osb = pop_current_osb (ctxp); while (osb--) type = build_java_array_type (type, -1); ! $$ = build_cast ($1.location, type, $5); } | OP_TK primitive_type CP_TK unary_expression { $$ = build_cast ($1.location, $2, $4); } | OP_TK expression CP_TK unary_expression_not_plus_minus { $$ = build_cast ($1.location, $2, $4); } | OP_TK name dims CP_TK unary_expression_not_plus_minus ! { const char *ptr; ! int osb = pop_current_osb (ctxp); ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE ($2)), IDENTIFIER_LENGTH (EXPR_WFL_NODE ($2))); while (osb--) --- 2371,2392 ---- cast_expression: /* Error handling here is potentially weak */ OP_TK primitive_type dims CP_TK unary_expression ! { tree type = $2; int osb = pop_current_osb (ctxp); while (osb--) type = build_java_array_type (type, -1); ! $$ = build_cast ($1.location, type, $5); } | OP_TK primitive_type CP_TK unary_expression { $$ = build_cast ($1.location, $2, $4); } | OP_TK expression CP_TK unary_expression_not_plus_minus { $$ = build_cast ($1.location, $2, $4); } | OP_TK name dims CP_TK unary_expression_not_plus_minus ! { const char *ptr; ! int osb = pop_current_osb (ctxp); ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE ($2)), IDENTIFIER_LENGTH (EXPR_WFL_NODE ($2))); while (osb--) *************** cast_expression: /* Error handling here *** 2408,2426 **** multiplicative_expression: unary_expression | multiplicative_expression MULT_TK unary_expression ! { ! $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, $1, $3); } | multiplicative_expression DIV_TK unary_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | multiplicative_expression REM_TK unary_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | multiplicative_expression MULT_TK error {yyerror ("Missing term"); RECOVER;} --- 2414,2432 ---- multiplicative_expression: unary_expression | multiplicative_expression MULT_TK unary_expression ! { ! $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, $1, $3); } | multiplicative_expression DIV_TK unary_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | multiplicative_expression REM_TK unary_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | multiplicative_expression MULT_TK error {yyerror ("Missing term"); RECOVER;} *************** additive_expression: *** 2435,2446 **** | additive_expression PLUS_TK multiplicative_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | additive_expression MINUS_TK multiplicative_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | additive_expression PLUS_TK error {yyerror ("Missing term"); RECOVER;} --- 2441,2452 ---- | additive_expression PLUS_TK multiplicative_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | additive_expression MINUS_TK multiplicative_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | additive_expression PLUS_TK error {yyerror ("Missing term"); RECOVER;} *************** shift_expression: *** 2453,2469 **** | shift_expression LS_TK additive_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | shift_expression SRS_TK additive_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | shift_expression ZRS_TK additive_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | shift_expression LS_TK error {yyerror ("Missing term"); RECOVER;} --- 2459,2475 ---- | shift_expression LS_TK additive_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | shift_expression SRS_TK additive_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | shift_expression ZRS_TK additive_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | shift_expression LS_TK error {yyerror ("Missing term"); RECOVER;} *************** relational_expression: *** 2478,2499 **** | relational_expression LT_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression GT_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression LTE_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression GTE_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression INSTANCEOF_TK reference_type { $$ = build_binop (INSTANCEOF_EXPR, $2.location, $1, $3); } --- 2484,2505 ---- | relational_expression LT_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression GT_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression LTE_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression GTE_TK shift_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | relational_expression INSTANCEOF_TK reference_type { $$ = build_binop (INSTANCEOF_EXPR, $2.location, $1, $3); } *************** equality_expression: *** 2514,2525 **** | equality_expression EQ_TK relational_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | equality_expression NEQ_TK relational_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | equality_expression EQ_TK error {yyerror ("Missing term"); RECOVER;} --- 2520,2531 ---- | equality_expression EQ_TK relational_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | equality_expression NEQ_TK relational_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | equality_expression EQ_TK error {yyerror ("Missing term"); RECOVER;} *************** and_expression: *** 2532,2538 **** | and_expression AND_TK equality_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | and_expression AND_TK error {yyerror ("Missing term"); RECOVER;} --- 2538,2544 ---- | and_expression AND_TK equality_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | and_expression AND_TK error {yyerror ("Missing term"); RECOVER;} *************** exclusive_or_expression: *** 2543,2549 **** | exclusive_or_expression XOR_TK and_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | exclusive_or_expression XOR_TK error {yyerror ("Missing term"); RECOVER;} --- 2549,2555 ---- | exclusive_or_expression XOR_TK and_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | exclusive_or_expression XOR_TK error {yyerror ("Missing term"); RECOVER;} *************** inclusive_or_expression: *** 2554,2560 **** | inclusive_or_expression OR_TK exclusive_or_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | inclusive_or_expression OR_TK error {yyerror ("Missing term"); RECOVER;} --- 2560,2566 ---- | inclusive_or_expression OR_TK exclusive_or_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | inclusive_or_expression OR_TK error {yyerror ("Missing term"); RECOVER;} *************** conditional_and_expression: *** 2565,2571 **** | conditional_and_expression BOOL_AND_TK inclusive_or_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | conditional_and_expression BOOL_AND_TK error {yyerror ("Missing term"); RECOVER;} --- 2571,2577 ---- | conditional_and_expression BOOL_AND_TK inclusive_or_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | conditional_and_expression BOOL_AND_TK error {yyerror ("Missing term"); RECOVER;} *************** conditional_or_expression: *** 2576,2582 **** | conditional_or_expression BOOL_OR_TK conditional_and_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | conditional_or_expression BOOL_OR_TK error {yyerror ("Missing term"); RECOVER;} --- 2582,2588 ---- | conditional_or_expression BOOL_OR_TK conditional_and_expression { $$ = build_binop (BINOP_LOOKUP ($2.token), $2.location, ! $1, $3); } | conditional_or_expression BOOL_OR_TK error {yyerror ("Missing term"); RECOVER;} *************** pop_current_osb (ctxp) *** 2648,2657 **** if (ctxp->osb_depth < 0) abort (); ! to_return = CURRENT_OSB (ctxp); ctxp->osb_depth--; ! return to_return; } --- 2654,2663 ---- if (ctxp->osb_depth < 0) abort (); ! to_return = CURRENT_OSB (ctxp); ctxp->osb_depth--; ! return to_return; } *************** pop_current_osb (ctxp) *** 2661,2667 **** Add mode documentation here. FIXME */ /* Helper function. Create a new parser context. With ! COPY_FROM_PREVIOUS set to a non zero value, content of the previous context is copied, otherwise, the new context is zeroed. The newly created context becomes the current one. */ --- 2667,2673 ---- Add mode documentation here. FIXME */ /* Helper function. Create a new parser context. With ! COPY_FROM_PREVIOUS set to a nonzero value, content of the previous context is copied, otherwise, the new context is zeroed. The newly created context becomes the current one. */ *************** create_new_parser_context (copy_from_pre *** 2679,2685 **** } else memset ((PTR) new, 0, sizeof (struct parser_ctxt)); ! new->next = ctxp; ctxp = new; } --- 2685,2691 ---- } else memset ((PTR) new, 0, sizeof (struct parser_ctxt)); ! new->next = ctxp; ctxp = new; } *************** void *** 2690,2698 **** java_push_parser_context () { create_new_parser_context (0); ! } ! void java_pop_parser_context (generate) int generate; { --- 2696,2704 ---- java_push_parser_context () { create_new_parser_context (0); ! } ! void java_pop_parser_context (generate) int generate; { *************** java_pop_parser_context (generate) *** 2723,2729 **** if ((ctxp = next)) /* Assignment is really meant here */ for (current = ctxp->import_list; current; current = TREE_CHAIN (current)) IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 1; ! /* If we pushed a context to parse a class intended to be generated, we keep it so we can remember the class. What we could actually do is to just update a list of class names. */ --- 2729,2735 ---- if ((ctxp = next)) /* Assignment is really meant here */ for (current = ctxp->import_list; current; current = TREE_CHAIN (current)) IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 1; ! /* If we pushed a context to parse a class intended to be generated, we keep it so we can remember the class. What we could actually do is to just update a list of class names. */ *************** java_parser_context_resume () *** 2830,2836 **** ctxp = restored; /* Re-installed the data for the parsing to carry on */ ! memcpy (&ctxp->marker_begining, &old->marker_begining, (size_t)(&ctxp->marker_end - &ctxp->marker_begining)); /* Buffer context can now be discarded */ --- 2836,2842 ---- ctxp = restored; /* Re-installed the data for the parsing to carry on */ ! memcpy (&ctxp->marker_begining, &old->marker_begining, (size_t)(&ctxp->marker_end - &ctxp->marker_begining)); /* Buffer context can now be discarded */ *************** java_parser_context_pop_initialized_fiel *** 2881,2887 **** if (CPC_STATIC_INITIALIZER_LIST (ctxp)) { stmts = CPC_STATIC_INITIALIZER_STMT (ctxp); ! CPC_STATIC_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_STATIC_INITIALIZER_LIST (ctxp)); /* Keep initialization in order to enforce 8.5 */ if (stmts && !java_error_count) --- 2887,2893 ---- if (CPC_STATIC_INITIALIZER_LIST (ctxp)) { stmts = CPC_STATIC_INITIALIZER_STMT (ctxp); ! CPC_STATIC_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_STATIC_INITIALIZER_LIST (ctxp)); /* Keep initialization in order to enforce 8.5 */ if (stmts && !java_error_count) *************** java_parser_context_pop_initialized_fiel *** 2892,2898 **** if (CPC_INSTANCE_INITIALIZER_LIST (ctxp)) { stmts = CPC_INSTANCE_INITIALIZER_STMT (ctxp); ! CPC_INSTANCE_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_INSTANCE_INITIALIZER_LIST (ctxp)); if (stmts && !java_error_count) TYPE_II_STMT_LIST (class_type) = nreverse (stmts); --- 2898,2904 ---- if (CPC_INSTANCE_INITIALIZER_LIST (ctxp)) { stmts = CPC_INSTANCE_INITIALIZER_STMT (ctxp); ! CPC_INSTANCE_INITIALIZER_LIST (ctxp) = TREE_CHAIN (CPC_INSTANCE_INITIALIZER_LIST (ctxp)); if (stmts && !java_error_count) TYPE_II_STMT_LIST (class_type) = nreverse (stmts); *************** reorder_static_initialized (list) *** 2908,2917 **** keep them in lexical order. */ tree marker, previous = NULL_TREE; for (marker = list; marker; previous = marker, marker = TREE_CHAIN (marker)) ! if (TREE_CODE (marker) == TREE_LIST && !TREE_VALUE (marker) && !TREE_PURPOSE (marker)) break; ! /* No static initialized, the list is fine as is */ if (!previous) list = TREE_CHAIN (marker); --- 2914,2923 ---- keep them in lexical order. */ tree marker, previous = NULL_TREE; for (marker = list; marker; previous = marker, marker = TREE_CHAIN (marker)) ! if (TREE_CODE (marker) == TREE_LIST && !TREE_VALUE (marker) && !TREE_PURPOSE (marker)) break; ! /* No static initialized, the list is fine as is */ if (!previous) list = TREE_CHAIN (marker); *************** java_debug_context_do (tab) *** 2951,2957 **** fprintf (stderr, "lineno: %d\n", copy->lineno); TAB_CONTEXT (tab); fprintf (stderr, "package: %s\n", ! (copy->package ? IDENTIFIER_POINTER (copy->package) : "")); TAB_CONTEXT (tab); fprintf (stderr, "context for saving: %d\n", copy->saved_data_ctx); --- 2957,2963 ---- fprintf (stderr, "lineno: %d\n", copy->lineno); TAB_CONTEXT (tab); fprintf (stderr, "package: %s\n", ! (copy->package ? IDENTIFIER_POINTER (copy->package) : "")); TAB_CONTEXT (tab); fprintf (stderr, "context for saving: %d\n", copy->saved_data_ctx); *************** static void *** 2984,2990 **** parse_ctor_invocation_error () { if (DECL_CONSTRUCTOR_P (current_function_decl)) ! yyerror ("Constructor invocation must be first thing in a constructor"); else yyerror ("Only constructors can invoke constructors"); } --- 2990,2996 ---- parse_ctor_invocation_error () { if (DECL_CONSTRUCTOR_P (current_function_decl)) ! yyerror ("Constructor invocation must be first thing in a constructor"); else yyerror ("Only constructors can invoke constructors"); } *************** yyerror (msg) *** 3012,3018 **** int save_lineno; char *remainder, *code_from_source; ! if (!force_error && prev_lineno == lineno) return; --- 3018,3024 ---- int save_lineno; char *remainder, *code_from_source; ! if (!force_error && prev_lineno == lineno) return; *************** yyerror (msg) *** 3039,3045 **** java_warning_count++; else java_error_count++; ! if (elc.col == 0 && msg && msg[1] == ';') { elc.col = ctxp->p_line->char_col-1; --- 3045,3051 ---- java_warning_count++; else java_error_count++; ! if (elc.col == 0 && msg && msg[1] == ';') { elc.col = ctxp->p_line->char_col-1; *************** yyerror (msg) *** 3051,3057 **** prev_msg = msg; code_from_source = java_get_line_col (ctxp->filename, elc.line, elc.col); ! obstack_grow0 (&temporary_obstack, code_from_source, strlen (code_from_source)); remainder = obstack_finish (&temporary_obstack); if (do_warning) --- 3057,3063 ---- prev_msg = msg; code_from_source = java_get_line_col (ctxp->filename, elc.line, elc.col); ! obstack_grow0 (&temporary_obstack, code_from_source, strlen (code_from_source)); remainder = obstack_finish (&temporary_obstack); if (do_warning) *************** issue_warning_error_from_context (cl, ms *** 3079,3085 **** force_error = 1; ctxp->elc.line = EXPR_WFL_LINENO (cl); ! ctxp->elc.col = (EXPR_WFL_COLNO (cl) == 0xfff ? -1 : (EXPR_WFL_COLNO (cl) == 0xffe ? -2 : EXPR_WFL_COLNO (cl))); /* We have a CL, that's a good reason for using it if it contains data */ --- 3085,3091 ---- force_error = 1; ctxp->elc.line = EXPR_WFL_LINENO (cl); ! ctxp->elc.col = (EXPR_WFL_COLNO (cl) == 0xfff ? -1 : (EXPR_WFL_COLNO (cl) == 0xffe ? -2 : EXPR_WFL_COLNO (cl))); /* We have a CL, that's a good reason for using it if it contains data */ *************** find_expr_with_wfl (node) *** 3147,3153 **** case LOOP_EXPR: node = TREE_OPERAND (node, 0); continue; ! case LABELED_BLOCK_EXPR: node = TREE_OPERAND (node, 1); continue; --- 3153,3159 ---- case LOOP_EXPR: node = TREE_OPERAND (node, 0); continue; ! case LABELED_BLOCK_EXPR: node = TREE_OPERAND (node, 1); continue; *************** int *** 3200,3206 **** java_report_errors () { if (java_error_count) ! fprintf (stderr, "%d error%s", java_error_count, (java_error_count == 1 ? "" : "s")); if (java_warning_count) fprintf (stderr, "%s%d warning%s", (java_error_count ? ", " : ""), --- 3206,3212 ---- java_report_errors () { if (java_error_count) ! fprintf (stderr, "%d error%s", java_error_count, (java_error_count == 1 ? "" : "s")); if (java_warning_count) fprintf (stderr, "%s%d warning%s", (java_error_count ? ", " : ""), *************** classitf_redefinition_error (context, id *** 3244,3251 **** const char *context; tree id, decl, cl; { ! parse_error_context (cl, "%s `%s' already defined in %s:%d", ! context, IDENTIFIER_POINTER (id), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); /* Here we should point out where its redefined. It's a unicode. FIXME */ } --- 3250,3257 ---- const char *context; tree id, decl, cl; { ! parse_error_context (cl, "%s `%s' already defined in %s:%d", ! context, IDENTIFIER_POINTER (id), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); /* Here we should point out where its redefined. It's a unicode. FIXME */ } *************** variable_redefinition_error (context, na *** 3264,3270 **** type_name = lang_printable_name (type, 0); parse_error_context (context, ! "Variable `%s' is already defined in this method and was declared `%s %s' at line %d", IDENTIFIER_POINTER (name), type_name, IDENTIFIER_POINTER (name), line); } --- 3270,3276 ---- type_name = lang_printable_name (type, 0); parse_error_context (context, ! "Variable `%s' is already defined in this method and was declared `%s %s' at line %d", IDENTIFIER_POINTER (name), type_name, IDENTIFIER_POINTER (name), line); } *************** build_array_from_name (type, type_wfl, n *** 3299,3305 **** /* Eventually get more dims */ more_dims = build_type_name_from_array_name (name, &name); ! /* If we have, then craft a new type for this variable */ if (more_dims) { --- 3305,3311 ---- /* Eventually get more dims */ more_dims = build_type_name_from_array_name (name, &name); ! /* If we have, then craft a new type for this variable */ if (more_dims) { *************** check_class_interface_creation (is_inter *** 3394,3402 **** int uaaf = CLASS_MODIFIERS; /* Usually allowed access flags */ if (!quiet_flag) ! fprintf (stderr, " %s%s %s", (CPC_INNER_P () ? "inner" : ""), ! (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name)); /* Scope of an interface/class type name: --- 3400,3408 ---- int uaaf = CLASS_MODIFIERS; /* Usually allowed access flags */ if (!quiet_flag) ! fprintf (stderr, " %s%s %s", (CPC_INNER_P () ? "inner" : ""), ! (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name)); /* Scope of an interface/class type name: *************** check_class_interface_creation (is_inter *** 3406,3412 **** && (node = find_name_in_single_imports (raw_name)) && !CPC_INNER_P ()) { ! parse_error_context (cl, "%s name `%s' clashes with imported type `%s'", (is_interface ? "Interface" : "Class"), IDENTIFIER_POINTER (raw_name), IDENTIFIER_POINTER (node)); --- 3412,3418 ---- && (node = find_name_in_single_imports (raw_name)) && !CPC_INNER_P ()) { ! parse_error_context (cl, "%s name `%s' clashes with imported type `%s'", (is_interface ? "Interface" : "Class"), IDENTIFIER_POINTER (raw_name), IDENTIFIER_POINTER (node)); *************** check_class_interface_creation (is_inter *** 3414,3420 **** } if (decl && CLASS_COMPLETE_P (decl)) { ! classitf_redefinition_error ((is_interface ? "Interface" : "Class"), qualified_name, decl, cl); return 1; } --- 3420,3426 ---- } if (decl && CLASS_COMPLETE_P (decl)) { ! classitf_redefinition_error ((is_interface ? "Interface" : "Class"), qualified_name, decl, cl); return 1; } *************** check_class_interface_creation (is_inter *** 3428,3445 **** { const char *f; ! /* Contains OS dependent assumption on path separator. FIXME */ ! for (f = &input_filename [strlen (input_filename)]; ! f != input_filename && f[0] != '/' && f[0] != DIR_SEPARATOR; f--) ; ! if (f[0] == '/' || f[0] == DIR_SEPARATOR) f++; ! if (strncmp (IDENTIFIER_POINTER (raw_name), f , IDENTIFIER_LENGTH (raw_name)) || f [IDENTIFIER_LENGTH (raw_name)] != '.') parse_error_context ! (cl, "Public %s `%s' must be defined in a file called `%s.java'", (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name), IDENTIFIER_POINTER (raw_name)); --- 3434,3450 ---- { const char *f; ! for (f = &input_filename [strlen (input_filename)]; ! f != input_filename && ! IS_DIR_SEPARATOR (f[0]); f--) ; ! if (IS_DIR_SEPARATOR (f[0])) f++; ! if (strncmp (IDENTIFIER_POINTER (raw_name), f , IDENTIFIER_LENGTH (raw_name)) || f [IDENTIFIER_LENGTH (raw_name)] != '.') parse_error_context ! (cl, "Public %s `%s' must be defined in a file called `%s.java'", (is_interface ? "interface" : "class"), IDENTIFIER_POINTER (qualified_name), IDENTIFIER_POINTER (raw_name)); *************** check_class_interface_creation (is_inter *** 3454,3460 **** complaining a second time */ if (CPC_INNER_P () && !TOPLEVEL_CLASS_DECL_P (GET_CPC())) { ! parse_error_context (cl, "Inner class `%s' can't be static. Static classes can only occur in interfaces and top-level classes", IDENTIFIER_POINTER (qualified_name)); sca = ACC_STATIC; } --- 3459,3465 ---- complaining a second time */ if (CPC_INNER_P () && !TOPLEVEL_CLASS_DECL_P (GET_CPC())) { ! parse_error_context (cl, "Inner class `%s' can't be static. Static classes can only occur in interfaces and top-level classes", IDENTIFIER_POINTER (qualified_name)); sca = ACC_STATIC; } *************** check_class_interface_creation (is_inter *** 3482,3495 **** } } ! if (is_interface) { if (CPC_INNER_P ()) uaaf = INTERFACE_INNER_MODIFIERS; else uaaf = INTERFACE_MODIFIERS; ! ! check_modifiers ("Illegal modifier `%s' for interface declaration", flags, uaaf); } else --- 3487,3500 ---- } } ! if (is_interface) { if (CPC_INNER_P ()) uaaf = INTERFACE_INNER_MODIFIERS; else uaaf = INTERFACE_MODIFIERS; ! ! check_modifiers ("Illegal modifier `%s' for interface declaration", flags, uaaf); } else *************** check_class_interface_creation (is_inter *** 3500,3523 **** return 0; } ! static void make_nested_class_name (cpc_list) tree cpc_list; { tree name; if (!cpc_list) ! return; ! else ! make_nested_class_name (TREE_CHAIN (cpc_list)); /* Pick the qualified name when dealing with the first upmost enclosing class */ ! name = (TREE_CHAIN (cpc_list) ? ! TREE_PURPOSE (cpc_list) : DECL_NAME (TREE_VALUE (cpc_list))); obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); obstack_1grow (&temporary_obstack, '$'); } /* Can't redefine a class already defined in an earlier scope. */ --- 3505,3532 ---- return 0; } ! /* Construct a nested class name. If the final component starts with ! a digit, return true. Otherwise return false. */ ! static int make_nested_class_name (cpc_list) tree cpc_list; { tree name; if (!cpc_list) ! return 0; ! ! make_nested_class_name (TREE_CHAIN (cpc_list)); /* Pick the qualified name when dealing with the first upmost enclosing class */ ! name = (TREE_CHAIN (cpc_list) ! ? TREE_PURPOSE (cpc_list) : DECL_NAME (TREE_VALUE (cpc_list))); obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); obstack_1grow (&temporary_obstack, '$'); + + return ISDIGIT (IDENTIFIER_POINTER (name)[0]); } /* Can't redefine a class already defined in an earlier scope. */ *************** check_inner_class_redefinition (raw_name *** 3528,3538 **** { tree scope_list; ! for (scope_list = GET_CPC_LIST (); scope_list; scope_list = GET_NEXT_ENCLOSING_CPC (scope_list)) if (raw_name == GET_CPC_UN_NODE (scope_list)) { ! parse_error_context (cl, "The class name `%s' is already defined in this scope. An inner class may not have the same simple name as any of its enclosing classes", IDENTIFIER_POINTER (raw_name)); return 1; --- 3537,3547 ---- { tree scope_list; ! for (scope_list = GET_CPC_LIST (); scope_list; scope_list = GET_NEXT_ENCLOSING_CPC (scope_list)) if (raw_name == GET_CPC_UN_NODE (scope_list)) { ! parse_error_context (cl, "The class name `%s' is already defined in this scope. An inner class may not have the same simple name as any of its enclosing classes", IDENTIFIER_POINTER (raw_name)); return 1; *************** check_inner_class_redefinition (raw_name *** 3545,3551 **** static tree resolve_inner_class (circularity_hash, cl, enclosing, super, class_type) ! struct hash_table *circularity_hash; tree cl, *enclosing, *super, class_type; { tree local_enclosing = *enclosing; --- 3554,3560 ---- static tree resolve_inner_class (circularity_hash, cl, enclosing, super, class_type) ! htab_t circularity_hash; tree cl, *enclosing, *super, class_type; { tree local_enclosing = *enclosing; *************** resolve_inner_class (circularity_hash, c *** 3555,3562 **** { tree intermediate, decl; ! hash_lookup (circularity_hash, ! (const hash_table_key) local_enclosing, TRUE, NULL); if ((decl = find_as_inner_class (local_enclosing, class_type, cl))) return decl; --- 3564,3571 ---- { tree intermediate, decl; ! *htab_find_slot (circularity_hash, local_enclosing, INSERT) = ! local_enclosing; if ((decl = find_as_inner_class (local_enclosing, class_type, cl))) return decl; *************** resolve_inner_class (circularity_hash, c *** 3584,3595 **** /* We may not have checked for circular inheritance yet, so do so here to prevent an infinite loop. */ ! if (hash_lookup (circularity_hash, ! (const hash_table_key) local_super, FALSE, NULL)) { if (!cl) cl = lookup_cl (local_enclosing); ! parse_error_context (cl, "Cyclic inheritance involving %s", IDENTIFIER_POINTER (DECL_NAME (local_enclosing))); --- 3593,3603 ---- /* We may not have checked for circular inheritance yet, so do so here to prevent an infinite loop. */ ! if (htab_find (circularity_hash, local_super) != NULL) { if (!cl) cl = lookup_cl (local_enclosing); ! parse_error_context (cl, "Cyclic inheritance involving %s", IDENTIFIER_POINTER (DECL_NAME (local_enclosing))); *************** find_as_inner_class (enclosing, name, cl *** 3626,3632 **** qual = build_tree_list (cl, NULL_TREE); else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! if ((to_return = find_as_inner_class_do (qual, enclosing))) return to_return; --- 3634,3640 ---- qual = build_tree_list (cl, NULL_TREE); else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! if ((to_return = find_as_inner_class_do (qual, enclosing))) return to_return; *************** find_as_inner_class (enclosing, name, cl *** 3636,3645 **** { tree acc = NULL_TREE, decl = NULL_TREE, ptr; ! for (qual = EXPR_WFL_QUALIFICATION (cl); qual && !decl; qual = TREE_CHAIN (qual)) { ! acc = merge_qualified_name (acc, EXPR_WFL_NODE (TREE_PURPOSE (qual))); BUILD_PTR_FROM_NAME (ptr, acc); decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl); --- 3644,3653 ---- { tree acc = NULL_TREE, decl = NULL_TREE, ptr; ! for (qual = EXPR_WFL_QUALIFICATION (cl); qual && !decl; qual = TREE_CHAIN (qual)) { ! acc = merge_qualified_name (acc, EXPR_WFL_NODE (TREE_PURPOSE (qual))); BUILD_PTR_FROM_NAME (ptr, acc); decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl); *************** find_as_inner_class (enclosing, name, cl *** 3647,3653 **** /* A NULL qual and a decl means that the search ended successfully?!? We have to do something then. FIXME */ ! if (decl) enclosing = decl; else --- 3655,3661 ---- /* A NULL qual and a decl means that the search ended successfully?!? We have to do something then. FIXME */ ! if (decl) enclosing = decl; else *************** find_as_inner_class (enclosing, name, cl *** 3656,3662 **** /* Otherwise, create a qual for the other part of the resolution. */ else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! return find_as_inner_class_do (qual, enclosing); } --- 3664,3670 ---- /* Otherwise, create a qual for the other part of the resolution. */ else qual = build_tree_list (build_expr_wfl (name, NULL, 0, 0), NULL_TREE); ! return find_as_inner_class_do (qual, enclosing); } *************** set_nested_class_simple_name_value (oute *** 3702,3708 **** tree l; for (l = DECL_INNER_CLASS_LIST (outer); l; l = TREE_CHAIN (l)) ! IDENTIFIER_GLOBAL_VALUE (TREE_VALUE (l)) = (set ? TREE_PURPOSE (l) : NULL_TREE); } --- 3710,3716 ---- tree l; for (l = DECL_INNER_CLASS_LIST (outer); l; l = TREE_CHAIN (l)) ! IDENTIFIER_GLOBAL_VALUE (TREE_VALUE (l)) = (set ? TREE_PURPOSE (l) : NULL_TREE); } *************** link_nested_class_to_enclosing () *** 3712,3718 **** if (GET_ENCLOSING_CPC ()) { tree enclosing = GET_ENCLOSING_CPC_CONTEXT (); ! DECL_INNER_CLASS_LIST (enclosing) = tree_cons (GET_CPC (), GET_CPC_UN (), DECL_INNER_CLASS_LIST (enclosing)); } --- 3720,3726 ---- if (GET_ENCLOSING_CPC ()) { tree enclosing = GET_ENCLOSING_CPC_CONTEXT (); ! DECL_INNER_CLASS_LIST (enclosing) = tree_cons (GET_CPC (), GET_CPC_UN (), DECL_INNER_CLASS_LIST (enclosing)); } *************** maybe_make_nested_class_name (name) *** 3726,3734 **** if (CPC_INNER_P ()) { ! make_nested_class_name (GET_CPC_LIST ()); obstack_grow0 (&temporary_obstack, ! IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); id = get_identifier (obstack_finish (&temporary_obstack)); if (ctxp->package) --- 3734,3755 ---- if (CPC_INNER_P ()) { ! /* If we're in a function, we must append a number to create the ! nested class name. However, we don't do this if the class we ! are constructing is anonymous, because in that case we'll ! already have a number as the class name. */ ! if (! make_nested_class_name (GET_CPC_LIST ()) ! && current_function_decl != NULL_TREE ! && ! ISDIGIT (IDENTIFIER_POINTER (name)[0])) ! { ! char buf[10]; ! sprintf (buf, "%d", anonymous_class_counter); ! ++anonymous_class_counter; ! obstack_grow (&temporary_obstack, buf, strlen (buf)); ! obstack_1grow (&temporary_obstack, '$'); ! } obstack_grow0 (&temporary_obstack, ! IDENTIFIER_POINTER (name), IDENTIFIER_LENGTH (name)); id = get_identifier (obstack_finish (&temporary_obstack)); if (ctxp->package) *************** maybe_create_class_interface_decl (decl, *** 3773,3779 **** /* Install a new dependency list element */ create_jdep_list (ctxp); ! SOURCE_FRONTEND_DEBUG (("Defining class/interface %s", IDENTIFIER_POINTER (qualified_name))); return decl; } --- 3794,3800 ---- /* Install a new dependency list element */ create_jdep_list (ctxp); ! SOURCE_FRONTEND_DEBUG (("Defining class/interface %s", IDENTIFIER_POINTER (qualified_name))); return decl; } *************** create_interface (flags, id, super) *** 3824,3830 **** EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */ ! /* Basic checks: scope, redefinition, modifiers */ if (check_class_interface_creation (1, flags, raw_name, q_name, decl, id)) { PUSH_ERROR (); --- 3845,3851 ---- EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */ ! /* Basic checks: scope, redefinition, modifiers */ if (check_class_interface_creation (1, flags, raw_name, q_name, decl, id)) { PUSH_ERROR (); *************** create_interface (flags, id, super) *** 3849,3855 **** - abstract is obsolete (comes first, it's a warning, or should be) - Can't use twice the same (checked in the modifier rule) */ if ((flags & ACC_ABSTRACT) && flag_redundant) ! parse_warning_context (MODIFIER_WFL (ABSTRACT_TK), "Redundant use of `abstract' modifier. Interface `%s' is implicitly abstract", IDENTIFIER_POINTER (raw_name)); --- 3870,3876 ---- - abstract is obsolete (comes first, it's a warning, or should be) - Can't use twice the same (checked in the modifier rule) */ if ((flags & ACC_ABSTRACT) && flag_redundant) ! parse_warning_context (MODIFIER_WFL (ABSTRACT_TK), "Redundant use of `abstract' modifier. Interface `%s' is implicitly abstract", IDENTIFIER_POINTER (raw_name)); *************** create_interface (flags, id, super) *** 3857,3863 **** decl = maybe_create_class_interface_decl (decl, raw_name, q_name, id); /* Set super info and mark the class a complete */ ! set_super_info (ACC_INTERFACE | flags, TREE_TYPE (decl), object_type_node, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; --- 3878,3884 ---- decl = maybe_create_class_interface_decl (decl, raw_name, q_name, id); /* Set super info and mark the class a complete */ ! set_super_info (ACC_INTERFACE | flags, TREE_TYPE (decl), object_type_node, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; *************** create_interface (flags, id, super) *** 3866,3875 **** return decl; } - /* Anonymous class counter. Will be reset to 1 every time a non - anonymous class gets created. */ - static int anonymous_class_counter = 1; - /* Patch anonymous class CLASS, by either extending or implementing DEP. */ --- 3887,3892 ---- *************** create_class (flags, id, super, interfac *** 3974,3980 **** PUSH_ERROR (); return NULL_TREE; } ! /* Suspend the current parsing context if we're parsing an inner class or an anonymous class. */ if (CPC_INNER_P ()) --- 3991,3997 ---- PUSH_ERROR (); return NULL_TREE; } ! /* Suspend the current parsing context if we're parsing an inner class or an anonymous class. */ if (CPC_INNER_P ()) *************** create_class (flags, id, super, interfac *** 3984,3996 **** if (CLASS_INTERFACE (GET_CPC ())) flags |= ACC_PUBLIC; } ! /* Push a new context for (static) initialized upon declaration fields */ java_parser_context_push_initialized_field (); ! /* Class modifier check: - Allowed modifier (already done at that point) ! - abstract AND final forbidden - Public classes defined in the correct file */ if ((flags & ACC_ABSTRACT) && (flags & ACC_FINAL)) parse_error_context --- 4001,4013 ---- if (CLASS_INTERFACE (GET_CPC ())) flags |= ACC_PUBLIC; } ! /* Push a new context for (static) initialized upon declaration fields */ java_parser_context_push_initialized_field (); ! /* Class modifier check: - Allowed modifier (already done at that point) ! - abstract AND final forbidden - Public classes defined in the correct file */ if ((flags & ACC_ABSTRACT) && (flags & ACC_FINAL)) parse_error_context *************** create_class (flags, id, super, interfac *** 4010,4016 **** return NULL_TREE; } ! super_decl_type = register_incomplete_type (JDEP_SUPER, super, decl, NULL_TREE); } else if (TREE_TYPE (decl) != object_type_node) --- 4027,4033 ---- return NULL_TREE; } ! super_decl_type = register_incomplete_type (JDEP_SUPER, super, decl, NULL_TREE); } else if (TREE_TYPE (decl) != object_type_node) *************** create_class (flags, id, super, interfac *** 4027,4033 **** } /* Set super info and mark the class as complete. */ ! set_super_info (flags, TREE_TYPE (decl), super_decl_type, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; --- 4044,4050 ---- } /* Set super info and mark the class as complete. */ ! set_super_info (flags, TREE_TYPE (decl), super_decl_type, ctxp->interface_number); ctxp->interface_number = 0; CLASS_COMPLETE_P (decl) = 1; *************** add_inner_class_fields (class_decl, fct_ *** 4091,4104 **** f = add_field (TREE_TYPE (class_decl), build_current_thisn (TREE_TYPE (class_decl)), ! build_pointer_type (TREE_TYPE (DECL_CONTEXT (class_decl))), ACC_PRIVATE); FIELD_THISN (f) = 1; if (!fct_decl) return; ! ! for (block = GET_CURRENT_BLOCK (fct_decl); block && TREE_CODE (block) == BLOCK; block = BLOCK_SUPERCONTEXT (block)) { tree decl; --- 4108,4121 ---- f = add_field (TREE_TYPE (class_decl), build_current_thisn (TREE_TYPE (class_decl)), ! build_pointer_type (TREE_TYPE (DECL_CONTEXT (class_decl))), ACC_PRIVATE); FIELD_THISN (f) = 1; if (!fct_decl) return; ! ! for (block = GET_CURRENT_BLOCK (fct_decl); block && TREE_CODE (block) == BLOCK; block = BLOCK_SUPERCONTEXT (block)) { tree decl; *************** add_inner_class_fields (class_decl, fct_ *** 4106,4116 **** { tree name, pname; tree wfl, init, list; ! /* Avoid non final arguments. */ if (!LOCAL_FINAL_P (decl)) continue; ! MANGLE_OUTER_LOCAL_VARIABLE_NAME (name, DECL_NAME (decl)); MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID (pname, DECL_NAME (decl)); wfl = build_wfl_node (name); --- 4123,4133 ---- { tree name, pname; tree wfl, init, list; ! /* Avoid non final arguments. */ if (!LOCAL_FINAL_P (decl)) continue; ! MANGLE_OUTER_LOCAL_VARIABLE_NAME (name, DECL_NAME (decl)); MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID (pname, DECL_NAME (decl)); wfl = build_wfl_node (name); *************** add_inner_class_fields (class_decl, fct_ *** 4122,4128 **** invoking it (hence the constructor will also feature a hidden parameter, set to the value of the outer context local at the time the inner class is created.) ! Note: we take into account all possible locals that can be accessed by the inner class. It's actually not trivial to minimize these aliases down to the ones really --- 4139,4145 ---- invoking it (hence the constructor will also feature a hidden parameter, set to the value of the outer context local at the time the inner class is created.) ! Note: we take into account all possible locals that can be accessed by the inner class. It's actually not trivial to minimize these aliases down to the ones really *************** add_inner_class_fields (class_decl, fct_ *** 4137,4150 **** identify locals really used in the inner class. We leave the flag FIELD_LOCAL_ALIAS_USED around for that future use. ! On the other hand, it only affect local inner classes, whose constructors (and finit$ call) will be featuring unecessary arguments. It's easy for a developper to keep this number of parameter down by using the `final' keyword only when necessary. For the time being, we can issue a warning on unecessary finals. FIXME */ ! init = build_assignment (ASSIGN_TK, EXPR_WFL_LINECOL (wfl), wfl, init); /* Register the field. The TREE_LIST holding the part --- 4154,4167 ---- identify locals really used in the inner class. We leave the flag FIELD_LOCAL_ALIAS_USED around for that future use. ! On the other hand, it only affect local inner classes, whose constructors (and finit$ call) will be featuring unecessary arguments. It's easy for a developper to keep this number of parameter down by using the `final' keyword only when necessary. For the time being, we can issue a warning on unecessary finals. FIXME */ ! init = build_assignment (ASSIGN_TK, EXPR_WFL_LINECOL (wfl), wfl, init); /* Register the field. The TREE_LIST holding the part *************** duplicate_declaration_error_p (new_field *** 4238,4256 **** if (decl) { char *t1 = xstrdup (purify_type_name ! ((TREE_CODE (new_type) == POINTER_TYPE && TREE_TYPE (new_type) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (new_type)) : lang_printable_name (new_type, 1))); /* The type may not have been completed by the time we report the error */ char *t2 = xstrdup (purify_type_name ! ((TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE && TREE_TYPE (TREE_TYPE (decl)) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl))) : lang_printable_name (TREE_TYPE (decl), 1))); ! parse_error_context ! (cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)", t1, IDENTIFIER_POINTER (new_field_name), t2, IDENTIFIER_POINTER (DECL_NAME (decl)), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); --- 4255,4273 ---- if (decl) { char *t1 = xstrdup (purify_type_name ! ((TREE_CODE (new_type) == POINTER_TYPE && TREE_TYPE (new_type) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (new_type)) : lang_printable_name (new_type, 1))); /* The type may not have been completed by the time we report the error */ char *t2 = xstrdup (purify_type_name ! ((TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE && TREE_TYPE (TREE_TYPE (decl)) == NULL_TREE) ? IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl))) : lang_printable_name (TREE_TYPE (decl), 1))); ! parse_error_context ! (cl , "Duplicate variable declaration: `%s %s' was `%s %s' (%s:%d)", t1, IDENTIFIER_POINTER (new_field_name), t2, IDENTIFIER_POINTER (DECL_NAME (decl)), DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl)); *************** register_fields (flags, type, variable_l *** 4303,4309 **** /* If TYPE is fully resolved and we don't have a reference, make one */ PROMOTE_RECORD_IF_COMPLETE (type, must_chain); ! for (current = variable_list, saved_type = type; current; current = TREE_CHAIN (current), type = saved_type) { tree real_type; --- 4320,4326 ---- /* If TYPE is fully resolved and we don't have a reference, make one */ PROMOTE_RECORD_IF_COMPLETE (type, must_chain); ! for (current = variable_list, saved_type = type; current; current = TREE_CHAIN (current), type = saved_type) { tree real_type; *************** register_fields (flags, type, variable_l *** 4315,4321 **** /* Can't declare non-final static fields in inner classes */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (class_type) && !(flags & ACC_FINAL)) ! parse_error_context (cl, "Field `%s' can't be static in inner class `%s' unless it is final", IDENTIFIER_POINTER (EXPR_WFL_NODE (cl)), lang_printable_name (class_type, 0)); --- 4332,4338 ---- /* Can't declare non-final static fields in inner classes */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (class_type) && !(flags & ACC_FINAL)) ! parse_error_context (cl, "Field `%s' can't be static in inner class `%s' unless it is final", IDENTIFIER_POINTER (EXPR_WFL_NODE (cl)), lang_printable_name (class_type, 0)); *************** register_fields (flags, type, variable_l *** 4369,4379 **** FIELD_LOCAL_ALIAS (field_decl) = 1; FIELD_FINAL (field_decl) = 0; } ! /* Check if we must chain. */ if (must_chain) register_incomplete_type (JDEP_FIELD, wfl, field_decl, type); ! /* If we have an initialization value tied to the field */ if (init) { --- 4386,4396 ---- FIELD_LOCAL_ALIAS (field_decl) = 1; FIELD_FINAL (field_decl) = 0; } ! /* Check if we must chain. */ if (must_chain) register_incomplete_type (JDEP_FIELD, wfl, field_decl, type); ! /* If we have an initialization value tied to the field */ if (init) { *************** register_fields (flags, type, variable_l *** 4388,4394 **** appropriately. */ TREE_CHAIN (init) = CPC_STATIC_INITIALIZER_STMT (ctxp); SET_CPC_STATIC_INITIALIZER_STMT (ctxp, init); ! if (TREE_OPERAND (init, 1) && TREE_CODE (TREE_OPERAND (init, 1)) == NEW_ARRAY_INIT) TREE_STATIC (TREE_OPERAND (init, 1)) = 1; } --- 4405,4411 ---- appropriately. */ TREE_CHAIN (init) = CPC_STATIC_INITIALIZER_STMT (ctxp); SET_CPC_STATIC_INITIALIZER_STMT (ctxp, init); ! if (TREE_OPERAND (init, 1) && TREE_CODE (TREE_OPERAND (init, 1)) == NEW_ARRAY_INIT) TREE_STATIC (TREE_OPERAND (init, 1)) = 1; } *************** generate_finit (class_type) *** 4420,4427 **** tree list = TYPE_FINIT_STMT_LIST (class_type); tree mdecl, current, parms; ! parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, NULL_TREE, &count); CRAFTED_PARAM_LIST_FIXUP (parms); mdecl = create_artificial_method (class_type, ACC_PRIVATE, void_type_node, --- 4437,4444 ---- tree list = TYPE_FINIT_STMT_LIST (class_type); tree mdecl, current, parms; ! parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, NULL_TREE, &count); CRAFTED_PARAM_LIST_FIXUP (parms); mdecl = create_artificial_method (class_type, ACC_PRIVATE, void_type_node, *************** generate_finit (class_type) *** 4433,4440 **** start_artificial_method_body (mdecl); for (current = list; current; current = TREE_CHAIN (current)) ! java_method_add_stmt (mdecl, ! build_debugable_stmt (EXPR_WFL_LINECOL (current), current)); end_artificial_method_body (mdecl); return mdecl; --- 4450,4457 ---- start_artificial_method_body (mdecl); for (current = list; current; current = TREE_CHAIN (current)) ! java_method_add_stmt (mdecl, ! build_debugable_stmt (EXPR_WFL_LINECOL (current), current)); end_artificial_method_body (mdecl); return mdecl; *************** generate_instinit (class_type) *** 4463,4469 **** mdecl, NULL_TREE); /* Gather all the statements in a compound */ ! for (current = TYPE_II_STMT_LIST (class_type); current; current = TREE_CHAIN (current)) compound = add_stmt_to_compound (compound, NULL_TREE, current); --- 4480,4486 ---- mdecl, NULL_TREE); /* Gather all the statements in a compound */ ! for (current = TYPE_II_STMT_LIST (class_type); current; current = TREE_CHAIN (current)) compound = add_stmt_to_compound (compound, NULL_TREE, current); *************** generate_instinit (class_type) *** 4472,4481 **** We do that only if all ctors of CLASS_TYPE are set to catch a checked exception. This doesn't apply to anonymous classes (since they don't have declared ctors.) */ ! if (!ANONYMOUS_CLASS_P (class_type) && ctors_unchecked_throws_clause_p (class_type)) { ! compound = encapsulate_with_try_catch (0, exception_type_node, compound, build1 (THROW_EXPR, NULL_TREE, build_wfl_node (wpv_id))); DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, --- 4489,4498 ---- We do that only if all ctors of CLASS_TYPE are set to catch a checked exception. This doesn't apply to anonymous classes (since they don't have declared ctors.) */ ! if (!ANONYMOUS_CLASS_P (class_type) && ctors_unchecked_throws_clause_p (class_type)) { ! compound = encapsulate_with_try_catch (0, exception_type_node, compound, build1 (THROW_EXPR, NULL_TREE, build_wfl_node (wpv_id))); DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, *************** method_header (flags, type, mdecl, throw *** 4538,4544 **** return error_mark_node; meth = TREE_VALUE (mdecl); id = TREE_PURPOSE (mdecl); ! check_modifiers_consistency (flags); if (GET_CPC ()) --- 4555,4561 ---- return error_mark_node; meth = TREE_VALUE (mdecl); id = TREE_PURPOSE (mdecl); ! check_modifiers_consistency (flags); if (GET_CPC ()) *************** method_header (flags, type, mdecl, throw *** 4546,4552 **** if (!this_class || this_class == error_mark_node) return NULL_TREE; ! /* There are some forbidden modifiers for an abstract method and its class must be abstract as well. */ if (type && (flags & ACC_ABSTRACT)) --- 4563,4569 ---- if (!this_class || this_class == error_mark_node) return NULL_TREE; ! /* There are some forbidden modifiers for an abstract method and its class must be abstract as well. */ if (type && (flags & ACC_ABSTRACT)) *************** method_header (flags, type, mdecl, throw *** 4559,4570 **** ABSTRACT_CHECK (flags, ACC_STRICT, id, "Strictfp"); if (!CLASS_ABSTRACT (TYPE_NAME (this_class)) && !CLASS_INTERFACE (TYPE_NAME (this_class))) ! parse_error_context ! (id, "Class `%s' must be declared abstract to define abstract method `%s'", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ())), IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); } /* Things to be checked when declaring a constructor */ if (!type) { --- 4576,4599 ---- ABSTRACT_CHECK (flags, ACC_STRICT, id, "Strictfp"); if (!CLASS_ABSTRACT (TYPE_NAME (this_class)) && !CLASS_INTERFACE (TYPE_NAME (this_class))) ! parse_error_context ! (id, "Class `%s' must be declared abstract to define abstract method `%s'", IDENTIFIER_POINTER (DECL_NAME (GET_CPC ())), IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); } + /* A native method can't be strictfp. */ + if ((flags & ACC_NATIVE) && (flags & ACC_STRICT)) + parse_error_context (id, "native method `%s' can't be strictfp", + IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); + /* No such thing as a transient or volatile method. */ + if ((flags & ACC_TRANSIENT)) + parse_error_context (id, "method `%s' can't be transient", + IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); + if ((flags & ACC_VOLATILE)) + parse_error_context (id, "method `%s' can't be volatile", + IDENTIFIER_POINTER (EXPR_WFL_NODE (id))); + /* Things to be checked when declaring a constructor */ if (!type) { *************** method_header (flags, type, mdecl, throw *** 4572,4578 **** /* 8.6: Constructor declarations: we might be trying to define a method without specifying a return type. */ if (EXPR_WFL_NODE (id) != GET_CPC_UN ()) ! parse_error_context (id, "Invalid method declaration, return type required"); /* 8.6.3: Constructor modifiers */ else --- 4601,4607 ---- /* 8.6: Constructor declarations: we might be trying to define a method without specifying a return type. */ if (EXPR_WFL_NODE (id) != GET_CPC_UN ()) ! parse_error_context (id, "Invalid method declaration, return type required"); /* 8.6.3: Constructor modifiers */ else *************** method_header (flags, type, mdecl, throw *** 4611,4617 **** /* Inner class can't declare static methods */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (this_class)) { ! parse_error_context (id, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", IDENTIFIER_POINTER (EXPR_WFL_NODE (id)), lang_printable_name (this_class, 0)); --- 4640,4646 ---- /* Inner class can't declare static methods */ if ((flags & ACC_STATIC) && !TOPLEVEL_CLASS_TYPE_P (this_class)) { ! parse_error_context (id, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", IDENTIFIER_POINTER (EXPR_WFL_NODE (id)), lang_printable_name (this_class, 0)); *************** method_header (flags, type, mdecl, throw *** 4653,4659 **** /* When defining an abstract or interface method, the curly bracket at level 1 doesn't exist because there is no function body */ ! lineno = (ctxp->first_ccb_indent1 ? ctxp->first_ccb_indent1 : EXPR_WFL_LINENO (id)); /* Remember the original argument list */ --- 4682,4688 ---- /* When defining an abstract or interface method, the curly bracket at level 1 doesn't exist because there is no function body */ ! lineno = (ctxp->first_ccb_indent1 ? ctxp->first_ccb_indent1 : EXPR_WFL_LINENO (id)); /* Remember the original argument list */ *************** method_header (flags, type, mdecl, throw *** 4674,4680 **** register_incomplete_type (JDEP_METHOD_END, NULL_TREE, meth, NULL_TREE); } else ! meth = add_method (this_class, flags, meth_name, build_java_signature (meth)); /* Remember final parameters */ --- 4703,4709 ---- register_incomplete_type (JDEP_METHOD_END, NULL_TREE, meth, NULL_TREE); } else ! meth = add_method (this_class, flags, meth_name, build_java_signature (meth)); /* Remember final parameters */ *************** method_header (flags, type, mdecl, throw *** 4700,4706 **** { register_incomplete_type (JDEP_EXCEPTION, TREE_VALUE (current), NULL_TREE, NULL_TREE); ! JDEP_GET_PATCH (CLASSD_LAST (ctxp->classd_list)) = &TREE_VALUE (current); } DECL_FUNCTION_THROWS (meth) = throws; --- 4729,4735 ---- { register_incomplete_type (JDEP_EXCEPTION, TREE_VALUE (current), NULL_TREE, NULL_TREE); ! JDEP_GET_PATCH (CLASSD_LAST (ctxp->classd_list)) = &TREE_VALUE (current); } DECL_FUNCTION_THROWS (meth) = throws; *************** method_header (flags, type, mdecl, throw *** 4715,4721 **** DECL_CONSTRUCTOR_P (meth) = 1; /* Compute and store the number of artificial parameters declared for this constructor */ ! for (count = 0, current = TYPE_FIELDS (this_class); current; current = TREE_CHAIN (current)) if (FIELD_LOCAL_ALIAS (current)) count++; --- 4744,4750 ---- DECL_CONSTRUCTOR_P (meth) = 1; /* Compute and store the number of artificial parameters declared for this constructor */ ! for (count = 0, current = TYPE_FIELDS (this_class); current; current = TREE_CHAIN (current)) if (FIELD_LOCAL_ALIAS (current)) count++; *************** finish_method_declaration (method_body) *** 4768,4774 **** if ((flags & ACC_ABSTRACT || flags & ACC_NATIVE) && method_body) { tree name = DECL_NAME (current_function_decl); ! parse_error_context (DECL_FUNCTION_WFL (current_function_decl), "%s method `%s' can't have a body defined", (METHOD_NATIVE (current_function_decl) ? "Native" : "Abstract"), --- 4797,4803 ---- if ((flags & ACC_ABSTRACT || flags & ACC_NATIVE) && method_body) { tree name = DECL_NAME (current_function_decl); ! parse_error_context (DECL_FUNCTION_WFL (current_function_decl), "%s method `%s' can't have a body defined", (METHOD_NATIVE (current_function_decl) ? "Native" : "Abstract"), *************** finish_method_declaration (method_body) *** 4779,4793 **** { tree name = DECL_NAME (current_function_decl); parse_error_context ! (DECL_FUNCTION_WFL (current_function_decl), "Non native and non abstract method `%s' must have a body defined", IDENTIFIER_POINTER (name)); method_body = NULL_TREE; } ! if (flag_emit_class_files && method_body ! && TREE_CODE (method_body) == NOP_EXPR ! && TREE_TYPE (current_function_decl) && TREE_TYPE (TREE_TYPE (current_function_decl)) == void_type_node) method_body = build1 (RETURN_EXPR, void_type_node, NULL); --- 4808,4822 ---- { tree name = DECL_NAME (current_function_decl); parse_error_context ! (DECL_FUNCTION_WFL (current_function_decl), "Non native and non abstract method `%s' must have a body defined", IDENTIFIER_POINTER (name)); method_body = NULL_TREE; } ! if (flag_emit_class_files && method_body ! && TREE_CODE (method_body) == NOP_EXPR ! && TREE_TYPE (current_function_decl) && TREE_TYPE (TREE_TYPE (current_function_decl)) == void_type_node) method_body = build1 (RETURN_EXPR, void_type_node, NULL); *************** finish_method_declaration (method_body) *** 4804,4810 **** ARG_FINAL_P parameter that might have been set on some of this function parameters. */ UNMARK_FINAL_PARMS (current_function_decl); ! /* So we don't have an irrelevant function declaration context for the next static block we'll see. */ current_function_decl = NULL_TREE; --- 4833,4839 ---- ARG_FINAL_P parameter that might have been set on some of this function parameters. */ UNMARK_FINAL_PARMS (current_function_decl); ! /* So we don't have an irrelevant function declaration context for the next static block we'll see. */ current_function_decl = NULL_TREE; *************** constructor_circularity_msg (from, to) *** 4826,4880 **** /* Verify a circular call to METH. Return 1 if an error is found, 0 otherwise. */ static int verify_constructor_circularity (meth, current) tree meth, current; { - static tree list = NULL_TREE; - static int initialized_p; tree c; - /* If we haven't already registered LIST with the garbage collector, - do so now. */ - if (!initialized_p) - { - ggc_add_tree_root (&list, 1); - initialized_p = 1; - } - for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { if (TREE_VALUE (c) == meth) { char *t; ! if (list) { tree liste; ! list = nreverse (list); ! for (liste = list; liste; liste = TREE_CHAIN (liste)) { ! parse_error_context (TREE_PURPOSE (TREE_PURPOSE (liste)), "%s", constructor_circularity_msg ! (TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste)))); java_error_count--; } } t = xstrdup (lang_printable_name (meth, 0)); ! parse_error_context (TREE_PURPOSE (c), "%s: recursive invocation of constructor `%s'", constructor_circularity_msg (current, meth), t); free (t); ! list = NULL_TREE; return 1; } } for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { ! list = tree_cons (c, current, list); if (verify_constructor_circularity (meth, TREE_VALUE (c))) return 1; ! list = TREE_CHAIN (list); } return 0; } --- 4855,4900 ---- /* Verify a circular call to METH. Return 1 if an error is found, 0 otherwise. */ + static GTY(()) tree vcc_list; static int verify_constructor_circularity (meth, current) tree meth, current; { tree c; for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { if (TREE_VALUE (c) == meth) { char *t; ! if (vcc_list) { tree liste; ! vcc_list = nreverse (vcc_list); ! for (liste = vcc_list; liste; liste = TREE_CHAIN (liste)) { ! parse_error_context (TREE_PURPOSE (TREE_PURPOSE (liste)), "%s", constructor_circularity_msg ! (TREE_VALUE (liste), TREE_VALUE (TREE_PURPOSE (liste)))); java_error_count--; } } t = xstrdup (lang_printable_name (meth, 0)); ! parse_error_context (TREE_PURPOSE (c), "%s: recursive invocation of constructor `%s'", constructor_circularity_msg (current, meth), t); free (t); ! vcc_list = NULL_TREE; return 1; } } for (c = DECL_CONSTRUCTOR_CALLS (current); c; c = TREE_CHAIN (c)) { ! vcc_list = tree_cons (c, current, vcc_list); if (verify_constructor_circularity (meth, TREE_VALUE (c))) return 1; ! vcc_list = TREE_CHAIN (vcc_list); } return 0; } *************** check_abstract_method_header (meth) *** 4915,4921 **** OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (ABSTRACT_TK), flags, ACC_ABSTRACT, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); ! OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (PUBLIC_TK), flags, ACC_PUBLIC, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); --- 4935,4941 ---- OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (ABSTRACT_TK), flags, ACC_ABSTRACT, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); ! OBSOLETE_MODIFIER_WARNING2 (MODIFIER_WFL (PUBLIC_TK), flags, ACC_PUBLIC, "abstract method", IDENTIFIER_POINTER (DECL_NAME (meth))); *************** method_declarator (id, list) *** 4945,4957 **** this$ decl in the name field of its parameter declaration. We also might have to hide the outer context local alias initializers. Not done when the class is a toplevel class. */ ! if (PURE_INNER_CLASS_DECL_P (GET_CPC ()) && EXPR_WFL_NODE (id) == GET_CPC_UN ()) { tree aliases_list, type, thisn; /* First the aliases, linked to the regular parameters */ aliases_list = ! build_alias_initializer_parameter_list (AIPL_FUNCTION_DECLARATION, TREE_TYPE (GET_CPC ()), NULL_TREE, NULL); list = chainon (nreverse (aliases_list), list); --- 4965,4977 ---- this$ decl in the name field of its parameter declaration. We also might have to hide the outer context local alias initializers. Not done when the class is a toplevel class. */ ! if (PURE_INNER_CLASS_DECL_P (GET_CPC ()) && EXPR_WFL_NODE (id) == GET_CPC_UN ()) { tree aliases_list, type, thisn; /* First the aliases, linked to the regular parameters */ aliases_list = ! build_alias_initializer_parameter_list (AIPL_FUNCTION_DECLARATION, TREE_TYPE (GET_CPC ()), NULL_TREE, NULL); list = chainon (nreverse (aliases_list), list); *************** method_declarator (id, list) *** 4962,4968 **** list = tree_cons (build_wfl_node (thisn), build_pointer_type (type), list); } ! for (current = list; current; current = TREE_CHAIN (current)) { int must_chain = 0; --- 4982,4988 ---- list = tree_cons (build_wfl_node (thisn), build_pointer_type (type), list); } ! for (current = list; current; current = TREE_CHAIN (current)) { int must_chain = 0; *************** method_declarator (id, list) *** 5005,5011 **** if (must_chain) { patch_stage = JDEP_METHOD; ! type = register_incomplete_type (patch_stage, type_wfl, wfl_name, type); jdep = CLASSD_LAST (ctxp->classd_list); JDEP_MISC (jdep) = id; --- 5025,5031 ---- if (must_chain) { patch_stage = JDEP_METHOD; ! type = register_incomplete_type (patch_stage, type_wfl, wfl_name, type); jdep = CLASSD_LAST (ctxp->classd_list); JDEP_MISC (jdep) = id; *************** method_declarator (id, list) *** 5015,5021 **** arg_node = build_tree_list (name, real_type); /* Remeber arguments declared final. */ ARG_FINAL_P (arg_node) = ARG_FINAL_P (current); ! if (jdep) JDEP_GET_PATCH (jdep) = &TREE_VALUE (arg_node); TREE_CHAIN (arg_node) = arg_types; --- 5035,5041 ---- arg_node = build_tree_list (name, real_type); /* Remeber arguments declared final. */ ARG_FINAL_P (arg_node) = ARG_FINAL_P (current); ! if (jdep) JDEP_GET_PATCH (jdep) = &TREE_VALUE (arg_node); TREE_CHAIN (arg_node) = arg_types; *************** static int *** 5030,5036 **** unresolved_type_p (wfl, returned) tree wfl; tree *returned; ! { if (TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION) { --- 5050,5056 ---- unresolved_type_p (wfl, returned) tree wfl; tree *returned; ! { if (TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION) { *************** parser_qualified_classname (name) *** 5065,5071 **** if (ctxp->package) return merge_qualified_name (ctxp->package, name); ! else return name; } --- 5085,5091 ---- if (ctxp->package) return merge_qualified_name (ctxp->package, name); ! else return name; } *************** parser_check_super_interface (super_decl *** 5081,5089 **** /* Has to be an interface */ if (!CLASS_INTERFACE (super_decl)) { ! parse_error_context (this_wfl, "%s `%s' can't implement/extend %s `%s'", ! (CLASS_INTERFACE (TYPE_NAME (TREE_TYPE (this_decl))) ? "Interface" : "Class"), IDENTIFIER_POINTER (DECL_NAME (this_decl)), (TYPE_ARRAY_P (super_type) ? "array" : "class"), --- 5101,5109 ---- /* Has to be an interface */ if (!CLASS_INTERFACE (super_decl)) { ! parse_error_context (this_wfl, "%s `%s' can't implement/extend %s `%s'", ! (CLASS_INTERFACE (TYPE_NAME (TREE_TYPE (this_decl))) ? "Interface" : "Class"), IDENTIFIER_POINTER (DECL_NAME (this_decl)), (TYPE_ARRAY_P (super_type) ? "array" : "class"), *************** parser_check_super_interface (super_decl *** 5091,5097 **** return 1; } ! /* Check top-level interface access. Inner classes are subject to member access rules (6.6.1). */ if (! INNER_CLASS_P (super_type) && check_pkg_class_access (DECL_NAME (super_decl), --- 5111,5117 ---- return 1; } ! /* Check top-level interface access. Inner classes are subject to member access rules (6.6.1). */ if (! INNER_CLASS_P (super_type) && check_pkg_class_access (DECL_NAME (super_decl), *************** parser_check_super (super_decl, this_dec *** 5116,5122 **** /* SUPER should be a CLASS (neither an array nor an interface) */ if (TYPE_ARRAY_P (super_type) || CLASS_INTERFACE (TYPE_NAME (super_type))) { ! parse_error_context (wfl, "Class `%s' can't subclass %s `%s'", IDENTIFIER_POINTER (DECL_NAME (this_decl)), (CLASS_INTERFACE (TYPE_NAME (super_type)) ? "interface" : "array"), --- 5136,5142 ---- /* SUPER should be a CLASS (neither an array nor an interface) */ if (TYPE_ARRAY_P (super_type) || CLASS_INTERFACE (TYPE_NAME (super_type))) { ! parse_error_context (wfl, "Class `%s' can't subclass %s `%s'", IDENTIFIER_POINTER (DECL_NAME (this_decl)), (CLASS_INTERFACE (TYPE_NAME (super_type)) ? "interface" : "array"), *************** parser_check_super (super_decl, this_dec *** 5136,5142 **** if (! INNER_CLASS_P (super_type) && (check_pkg_class_access (DECL_NAME (super_decl), wfl, true))) return 1; ! SOURCE_FRONTEND_DEBUG (("Completing class %s with %s", IDENTIFIER_POINTER (DECL_NAME (this_decl)), IDENTIFIER_POINTER (DECL_NAME (super_decl)))); --- 5156,5162 ---- if (! INNER_CLASS_P (super_type) && (check_pkg_class_access (DECL_NAME (super_decl), wfl, true))) return 1; ! SOURCE_FRONTEND_DEBUG (("Completing class %s with %s", IDENTIFIER_POINTER (DECL_NAME (this_decl)), IDENTIFIER_POINTER (DECL_NAME (super_decl)))); *************** static void *** 5150,5156 **** create_jdep_list (ctxp) struct parser_ctxt *ctxp; { ! jdeplist *new = (jdeplist *)xmalloc (sizeof (jdeplist)); new->first = new->last = NULL; new->next = ctxp->classd_list; ctxp->classd_list = new; --- 5170,5176 ---- create_jdep_list (ctxp) struct parser_ctxt *ctxp; { ! jdeplist *new = (jdeplist *)xmalloc (sizeof (jdeplist)); new->first = new->last = NULL; new->next = ctxp->classd_list; ctxp->classd_list = new; *************** register_incomplete_type (kind, wfl, dec *** 5220,5226 **** && GET_ENCLOSING_CPC ()) JDEP_ENCLOSING (new) = TREE_VALUE (GET_ENCLOSING_CPC ()); else if (kind == JDEP_SUPER) ! JDEP_ENCLOSING (new) = (GET_ENCLOSING_CPC () ? TREE_VALUE (GET_ENCLOSING_CPC ()) : NULL_TREE); else JDEP_ENCLOSING (new) = GET_CPC (); --- 5240,5246 ---- && GET_ENCLOSING_CPC ()) JDEP_ENCLOSING (new) = TREE_VALUE (GET_ENCLOSING_CPC ()); else if (kind == JDEP_SUPER) ! JDEP_ENCLOSING (new) = (GET_ENCLOSING_CPC () ? TREE_VALUE (GET_ENCLOSING_CPC ()) : NULL_TREE); else JDEP_ENCLOSING (new) = GET_CPC (); *************** check_circular_reference (type) *** 5303,5309 **** return lookup_cl (TYPE_NAME (type)); return NULL_TREE; } ! for (i = 0; i < TREE_VEC_LENGTH (basetype_vec); i++) { tree vec_elt = TREE_VEC_ELT (basetype_vec, i); --- 5323,5329 ---- return lookup_cl (TYPE_NAME (type)); return NULL_TREE; } ! for (i = 0; i < TREE_VEC_LENGTH (basetype_vec); i++) { tree vec_elt = TREE_VEC_ELT (basetype_vec, i); *************** build_alias_initializer_parameter_list ( *** 5359,5365 **** switch (mode) { case AIPL_FUNCTION_DECLARATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); purpose = build_wfl_node (mangled_id); if (TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE) --- 5379,5385 ---- switch (mode) { case AIPL_FUNCTION_DECLARATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); purpose = build_wfl_node (mangled_id); if (TREE_CODE (TREE_TYPE (field)) == POINTER_TYPE) *************** build_alias_initializer_parameter_list ( *** 5375,5381 **** break; case AIPL_FUNCTION_FINIT_INVOCATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); /* Now, this is wrong. purpose should always be the NAME of something and value its matching value (decl, type, --- 5395,5401 ---- break; case AIPL_FUNCTION_FINIT_INVOCATION: ! MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (mangled_id, &buffer [4]); /* Now, this is wrong. purpose should always be the NAME of something and value its matching value (decl, type, *************** build_alias_initializer_parameter_list ( *** 5408,5414 **** } if (additional_parms) { ! if (ANONYMOUS_CLASS_P (class_type) && mode == AIPL_FUNCTION_CTOR_INVOCATION) additional_parms = nreverse (additional_parms); parm = chainon (additional_parms, parm); --- 5428,5434 ---- } if (additional_parms) { ! if (ANONYMOUS_CLASS_P (class_type) && mode == AIPL_FUNCTION_CTOR_INVOCATION) additional_parms = nreverse (additional_parms); parm = chainon (additional_parms, parm); *************** craft_constructor (class_decl, args) *** 5432,5438 **** int i = 0, artificial = 0; tree decl, ctor_name; char buffer [80]; ! /* The constructor name is unless we're dealing with an anonymous class, in which case the name will be fixed after having be expanded. */ --- 5452,5458 ---- int i = 0, artificial = 0; tree decl, ctor_name; char buffer [80]; ! /* The constructor name is unless we're dealing with an anonymous class, in which case the name will be fixed after having be expanded. */ *************** craft_constructor (class_decl, args) *** 5452,5458 **** /* Some more arguments to be hidden here. The values of the local variables of the outer context that the inner class needs to see. */ parm = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, parm, &artificial); } --- 5472,5478 ---- /* Some more arguments to be hidden here. The values of the local variables of the outer context that the inner class needs to see. */ parm = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, ! class_type, parm, &artificial); } *************** craft_constructor (class_decl, args) *** 5464,5470 **** } CRAFTED_PARAM_LIST_FIXUP (parm); ! decl = create_artificial_method (class_type, flags, void_type_node, ctor_name, parm); fix_method_argument_names (parm, decl); /* Now, mark the artificial parameters. */ --- 5484,5490 ---- } CRAFTED_PARAM_LIST_FIXUP (parm); ! decl = create_artificial_method (class_type, flags, void_type_node, ctor_name, parm); fix_method_argument_names (parm, decl); /* Now, mark the artificial parameters. */ *************** jdep_resolve_class (dep) *** 5543,5549 **** JDEP_DECL (dep), JDEP_WFL (dep)); JDEP_RESOLVED (dep, decl); } ! if (!decl) complete_class_report_errors (dep); else if (PURE_INNER_CLASS_DECL_P (decl)) --- 5563,5569 ---- JDEP_DECL (dep), JDEP_WFL (dep)); JDEP_RESOLVED (dep, decl); } ! if (!decl) complete_class_report_errors (dep); else if (PURE_INNER_CLASS_DECL_P (decl)) *************** java_complete_class () *** 5573,5584 **** /* Process imports */ process_imports (); ! /* Rever things so we have the right order */ ctxp->class_list = nreverse (ctxp->class_list); ctxp->classd_list = reverse_jdep_list (ctxp); ! for (cclassd = ctxp->classd_list, cclass = ctxp->class_list; ! cclass && cclassd; cclass = TREE_CHAIN (cclass), cclassd = CLASSD_CHAIN (cclassd)) { jdep *dep; --- 5593,5604 ---- /* Process imports */ process_imports (); ! /* Reverse things so we have the right order */ ctxp->class_list = nreverse (ctxp->class_list); ctxp->classd_list = reverse_jdep_list (ctxp); ! for (cclassd = ctxp->classd_list, cclass = ctxp->class_list; ! cclass && cclassd; cclass = TREE_CHAIN (cclass), cclassd = CLASSD_CHAIN (cclassd)) { jdep *dep; *************** java_complete_class () *** 5602,5608 **** /* Simply patch super */ if (parser_check_super (decl, JDEP_DECL (dep), JDEP_WFL (dep))) continue; ! BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (TREE_TYPE (JDEP_DECL (dep)))), 0)) = TREE_TYPE (decl); break; --- 5622,5628 ---- /* Simply patch super */ if (parser_check_super (decl, JDEP_DECL (dep), JDEP_WFL (dep))) continue; ! BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (TREE_TYPE (JDEP_DECL (dep)))), 0)) = TREE_TYPE (decl); break; *************** java_complete_class () *** 5617,5623 **** DECL_ALIGN (field_decl) = 0; DECL_USER_ALIGN (field_decl) = 0; layout_decl (field_decl, 0); ! SOURCE_FRONTEND_DEBUG (("Completed field/var decl `%s' with `%s'", IDENTIFIER_POINTER (DECL_NAME (field_decl)), IDENTIFIER_POINTER (DECL_NAME (decl)))); --- 5637,5643 ---- DECL_ALIGN (field_decl) = 0; DECL_USER_ALIGN (field_decl) = 0; layout_decl (field_decl, 0); ! SOURCE_FRONTEND_DEBUG (("Completed field/var decl `%s' with `%s'", IDENTIFIER_POINTER (DECL_NAME (field_decl)), IDENTIFIER_POINTER (DECL_NAME (decl)))); *************** java_complete_class () *** 5634,5644 **** if (TREE_CODE (type) == RECORD_TYPE) type = promote_type (type); JDEP_APPLY_PATCH (dep, type); ! SOURCE_FRONTEND_DEBUG (((JDEP_KIND (dep) == JDEP_METHOD_RETURN ? "Completing fct `%s' with ret type `%s'": "Completing arg `%s' with type `%s'"), ! IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep))), IDENTIFIER_POINTER (DECL_NAME (decl)))); } --- 5654,5664 ---- if (TREE_CODE (type) == RECORD_TYPE) type = promote_type (type); JDEP_APPLY_PATCH (dep, type); ! SOURCE_FRONTEND_DEBUG (((JDEP_KIND (dep) == JDEP_METHOD_RETURN ? "Completing fct `%s' with ret type `%s'": "Completing arg `%s' with type `%s'"), ! IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep))), IDENTIFIER_POINTER (DECL_NAME (decl)))); } *************** java_complete_class () *** 5683,5696 **** case JDEP_TYPE: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing a random type dependency on a '%s' node", tree_code_name [TREE_CODE (JDEP_DECL (dep))])); break; case JDEP_EXCEPTION: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing `%s' `throws' argument node", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep))))); break; --- 5703,5716 ---- case JDEP_TYPE: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing a random type dependency on a '%s' node", tree_code_name [TREE_CODE (JDEP_DECL (dep))])); break; case JDEP_EXCEPTION: JDEP_APPLY_PATCH (dep, TREE_TYPE (decl)); ! SOURCE_FRONTEND_DEBUG (("Completing `%s' `throws' argument node", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep))))); break; *************** resolve_class (enclosing, class_type, de *** 5718,5724 **** tree resolved_type = TREE_TYPE (class_type); int array_dims = 0; tree resolved_type_decl; ! if (resolved_type != NULL_TREE) { tree resolved_type_decl = TYPE_NAME (resolved_type); --- 5738,5744 ---- tree resolved_type = TREE_TYPE (class_type); int array_dims = 0; tree resolved_type_decl; ! if (resolved_type != NULL_TREE) { tree resolved_type_decl = TYPE_NAME (resolved_type); *************** resolve_class (enclosing, class_type, de *** 5739,5750 **** WFL_STRIP_BRACKET (cl, cl); /* 2- Resolve the bare type */ ! if (!(resolved_type_decl = do_resolve_class (enclosing, class_type, decl, cl))) return NULL_TREE; resolved_type = TREE_TYPE (resolved_type_decl); ! /* 3- If we have and array, reconstruct the array down to its nesting */ if (array_dims) { for (; array_dims; array_dims--) --- 5759,5770 ---- WFL_STRIP_BRACKET (cl, cl); /* 2- Resolve the bare type */ ! if (!(resolved_type_decl = do_resolve_class (enclosing, class_type, decl, cl))) return NULL_TREE; resolved_type = TREE_TYPE (resolved_type_decl); ! /* 3- If we have an array, reconstruct the array down to its nesting */ if (array_dims) { for (; array_dims; array_dims--) *************** resolve_class (enclosing, class_type, de *** 5755,5765 **** return resolved_type_decl; } ! /* Effectively perform the resolution of class CLASS_TYPE. DECL or CL ! are used to report error messages. Do not try to replace TYPE_NAME ! (class_type) by a variable, since it is changed by ! find_in_imports{_on_demand} and (but it doesn't really matter) ! qualify_and_find. */ tree do_resolve_class (enclosing, class_type, decl, cl) --- 5775,5785 ---- return resolved_type_decl; } ! /* Effectively perform the resolution of class CLASS_TYPE. DECL or CL ! are used to report error messages; CL must either be NULL_TREE or a ! WFL wrapping a class. Do not try to replace TYPE_NAME (class_type) ! by a variable, since it is changed by find_in_imports{_on_demand} ! and (but it doesn't really matter) qualify_and_find. */ tree do_resolve_class (enclosing, class_type, decl, cl) *************** do_resolve_class (enclosing, class_type, *** 5768,5806 **** tree new_class_decl = NULL_TREE, super = NULL_TREE; tree saved_enclosing_type = enclosing ? TREE_TYPE (enclosing) : NULL_TREE; tree decl_result; ! struct hash_table _ht, *circularity_hash = &_ht; ! /* This hash table is used to register the classes we're going ! through when searching the current class as an inner class, in ! order to detect circular references. Remember to free it before ! returning the section 0- of this function. */ ! hash_table_init (circularity_hash, hash_newfunc, ! java_hash_hash_tree_node, java_hash_compare_tree_node); ! /* 0- Search in the current class as an inner class. ! Maybe some code here should be added to load the class or ! something, at least if the class isn't an inner class and ended ! being loaded from class file. FIXME. */ ! while (enclosing) { ! new_class_decl = resolve_inner_class (circularity_hash, cl, &enclosing, ! &super, class_type); ! if (new_class_decl) ! break; ! /* If we haven't found anything because SUPER reached Object and ! ENCLOSING happens to be an innerclass, try the enclosing context. */ ! if ((!super || super == object_type_node) && ! enclosing && INNER_CLASS_DECL_P (enclosing)) ! enclosing = DECL_CONTEXT (enclosing); ! else ! enclosing = NULL_TREE; ! } ! hash_table_free (circularity_hash); ! if (new_class_decl) ! return new_class_decl; /* 1- Check for the type in single imports. This will change TYPE_NAME() if something relevant is found */ --- 5788,5847 ---- tree new_class_decl = NULL_TREE, super = NULL_TREE; tree saved_enclosing_type = enclosing ? TREE_TYPE (enclosing) : NULL_TREE; tree decl_result; ! htab_t circularity_hash; ! if (QUALIFIED_P (TYPE_NAME (class_type))) ! { ! /* If the type name is of the form `Q . Id', then Q is either a ! package name or a class name. First we try to find Q as a ! class and then treat Id as a member type. If we can't find Q ! as a class then we fall through. */ ! tree q, left, left_type, right; ! breakdown_qualified (&left, &right, TYPE_NAME (class_type)); ! BUILD_PTR_FROM_NAME (left_type, left); ! q = do_resolve_class (enclosing, left_type, decl, cl); ! if (q) ! { ! enclosing = q; ! saved_enclosing_type = TREE_TYPE (q); ! BUILD_PTR_FROM_NAME (class_type, right); ! } ! } ! if (enclosing) { ! /* This hash table is used to register the classes we're going ! through when searching the current class as an inner class, in ! order to detect circular references. Remember to free it before ! returning the section 0- of this function. */ ! circularity_hash = htab_create (20, htab_hash_pointer, htab_eq_pointer, ! NULL); ! /* 0- Search in the current class as an inner class. ! Maybe some code here should be added to load the class or ! something, at least if the class isn't an inner class and ended ! being loaded from class file. FIXME. */ ! while (enclosing) ! { ! new_class_decl = resolve_inner_class (circularity_hash, cl, &enclosing, ! &super, class_type); ! if (new_class_decl) ! break; ! /* If we haven't found anything because SUPER reached Object and ! ENCLOSING happens to be an innerclass, try the enclosing context. */ ! if ((!super || super == object_type_node) && ! enclosing && INNER_CLASS_DECL_P (enclosing)) ! enclosing = DECL_CONTEXT (enclosing); ! else ! enclosing = NULL_TREE; ! } ! htab_delete (circularity_hash); ! ! if (new_class_decl) ! return new_class_decl; ! } /* 1- Check for the type in single imports. This will change TYPE_NAME() if something relevant is found */ *************** do_resolve_class (enclosing, class_type, *** 5829,5835 **** if (find_in_imports_on_demand (saved_enclosing_type, class_type)) return NULL_TREE; ! /* If found in find_in_imports_on_demant, the type has already been loaded. */ if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)))) return new_class_decl; --- 5870,5876 ---- if (find_in_imports_on_demand (saved_enclosing_type, class_type)) return NULL_TREE; ! /* If found in find_in_imports_on_demand, the type has already been loaded. */ if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)))) return new_class_decl; *************** do_resolve_class (enclosing, class_type, *** 5841,5862 **** /* If there is a current package (ctxp->package), it's the first element of package_list and we can skip it. */ ! for (package = (ctxp->package ? TREE_CHAIN (package_list) : package_list); package; package = TREE_CHAIN (package)) if ((new_class_decl = qualify_and_find (class_type, ! TREE_PURPOSE (package), TYPE_NAME (class_type)))) return new_class_decl; } ! /* 5- Check an other compilation unit that bears the name of type */ load_class (TYPE_NAME (class_type), 0); ! if (!cl) cl = lookup_cl (decl); ! ! /* If we don't have a value for CL, then we're being called recursively. We can't check package access just yet, but it will be taken care of by the caller. */ if (cl) --- 5882,5903 ---- /* If there is a current package (ctxp->package), it's the first element of package_list and we can skip it. */ ! for (package = (ctxp->package ? TREE_CHAIN (package_list) : package_list); package; package = TREE_CHAIN (package)) if ((new_class_decl = qualify_and_find (class_type, ! TREE_PURPOSE (package), TYPE_NAME (class_type)))) return new_class_decl; } ! /* 5- Check another compilation unit that bears the name of type */ load_class (TYPE_NAME (class_type), 0); ! if (!cl) cl = lookup_cl (decl); ! ! /* If we don't have a value for CL, then we're being called recursively. We can't check package access just yet, but it will be taken care of by the caller. */ if (cl) *************** resolve_and_layout (something, cl) *** 5971,5977 **** /* Check methods */ if (CLASS_FROM_SOURCE_P (decl_type)) java_check_methods (decl); ! /* Layout the type if necessary */ if (decl_type != current_class && !CLASS_LOADED_P (decl_type)) safe_layout_class (decl_type); --- 6012,6018 ---- /* Check methods */ if (CLASS_FROM_SOURCE_P (decl_type)) java_check_methods (decl); ! /* Layout the type if necessary */ if (decl_type != current_class && !CLASS_LOADED_P (decl_type)) safe_layout_class (decl_type); *************** resolve_no_layout (name, cl) *** 5990,5996 **** java_parser_context_save_global (); decl = resolve_class (TYPE_NAME (current_class), ptr, NULL_TREE, cl); java_parser_context_restore_global (); ! return decl; } --- 6031,6037 ---- java_parser_context_save_global (); decl = resolve_class (TYPE_NAME (current_class), ptr, NULL_TREE, cl); java_parser_context_restore_global (); ! return decl; } *************** complete_class_report_errors (dep) *** 6030,6036 **** switch (JDEP_KIND (dep)) { case JDEP_SUPER: ! parse_error_context (JDEP_WFL (dep), "Superclass `%s' of class `%s' not found", purify_type_name (name), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); --- 6071,6077 ---- switch (JDEP_KIND (dep)) { case JDEP_SUPER: ! parse_error_context (JDEP_WFL (dep), "Superclass `%s' of class `%s' not found", purify_type_name (name), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); *************** complete_class_report_errors (dep) *** 6050,6056 **** break; case JDEP_METHOD_RETURN: /* Covers return type */ parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the return type of method `%s'", purify_type_name (name), IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep)))); break; --- 6091,6097 ---- break; case JDEP_METHOD_RETURN: /* Covers return type */ parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the return type of method `%s'", purify_type_name (name), IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_DECL_WFL (dep)))); break; *************** complete_class_report_errors (dep) *** 6063,6075 **** break; case JDEP_VARIABLE: parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the local variable `%s'", ! purify_type_name (IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); break; case JDEP_EXCEPTION: /* As specified by `throws' */ ! parse_error_context (JDEP_WFL (dep), "Class `%s' not found in `throws'", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))); break; --- 6104,6116 ---- break; case JDEP_VARIABLE: parse_error_context ! (JDEP_WFL (dep), "Type `%s' not found in the declaration of the local variable `%s'", ! purify_type_name (IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))), IDENTIFIER_POINTER (DECL_NAME (JDEP_DECL (dep)))); break; case JDEP_EXCEPTION: /* As specified by `throws' */ ! parse_error_context (JDEP_WFL (dep), "Class `%s' not found in `throws'", IDENTIFIER_POINTER (EXPR_WFL_NODE (JDEP_WFL (dep)))); break; *************** get_printable_method_name (decl) *** 6096,6106 **** name = DECL_NAME (decl); DECL_NAME (decl) = DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))); } ! to_return = lang_printable_name (decl, 0); if (DECL_CONSTRUCTOR_P (decl)) DECL_NAME (decl) = name; ! return to_return; } --- 6137,6147 ---- name = DECL_NAME (decl); DECL_NAME (decl) = DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))); } ! to_return = lang_printable_name (decl, 0); if (DECL_CONSTRUCTOR_P (decl)) DECL_NAME (decl) = name; ! return to_return; } *************** check_method_redefinition (class, method *** 6128,6134 **** && sig == TYPE_ARGUMENT_SIGNATURE (TREE_TYPE (redef)) && !DECL_ARTIFICIAL (method)) { ! parse_error_context (DECL_FUNCTION_WFL (method), "Duplicate %s declaration `%s'", (DECL_CONSTRUCTOR_P (redef) ? "constructor" : "method"), get_printable_method_name (redef)); --- 6169,6175 ---- && sig == TYPE_ARGUMENT_SIGNATURE (TREE_TYPE (redef)) && !DECL_ARTIFICIAL (method)) { ! parse_error_context (DECL_FUNCTION_WFL (method), "Duplicate %s declaration `%s'", (DECL_CONSTRUCTOR_P (redef) ? "constructor" : "method"), get_printable_method_name (redef)); *************** check_abstract_method_definitions (do_in *** 6154,6167 **** tree other_super, other_method, method_sig, method_name; int found = 0; int end_type_reached = 0; ! if (!METHOD_ABSTRACT (method) || METHOD_FINAL (method)) continue; ! /* Now verify that somewhere in between TYPE and CLASS, abstract method METHOD gets a non abstract definition that is inherited by CLASS. */ ! method_sig = build_java_signature (TREE_TYPE (method)); method_name = DECL_NAME (method); if (TREE_CODE (method_name) == EXPR_WITH_FILE_LOCATION) --- 6195,6208 ---- tree other_super, other_method, method_sig, method_name; int found = 0; int end_type_reached = 0; ! if (!METHOD_ABSTRACT (method) || METHOD_FINAL (method)) continue; ! /* Now verify that somewhere in between TYPE and CLASS, abstract method METHOD gets a non abstract definition that is inherited by CLASS. */ ! method_sig = build_java_signature (TREE_TYPE (method)); method_name = DECL_NAME (method); if (TREE_CODE (method_name) == EXPR_WITH_FILE_LOCATION) *************** check_abstract_method_definitions (do_in *** 6171,6184 **** do { if (other_super == end_type) end_type_reached = 1; ! /* Method search */ for (other_method = TYPE_METHODS (other_super); other_method; other_method = TREE_CHAIN (other_method)) { tree s = build_java_signature (TREE_TYPE (other_method)); tree other_name = DECL_NAME (other_method); ! if (TREE_CODE (other_name) == EXPR_WITH_FILE_LOCATION) other_name = EXPR_WFL_NODE (other_name); if (!DECL_CLINIT_P (other_method) --- 6212,6225 ---- do { if (other_super == end_type) end_type_reached = 1; ! /* Method search */ for (other_method = TYPE_METHODS (other_super); other_method; other_method = TREE_CHAIN (other_method)) { tree s = build_java_signature (TREE_TYPE (other_method)); tree other_name = DECL_NAME (other_method); ! if (TREE_CODE (other_name) == EXPR_WITH_FILE_LOCATION) other_name = EXPR_WFL_NODE (other_name); if (!DECL_CLINIT_P (other_method) *************** check_abstract_method_definitions (do_in *** 6193,6213 **** } other_super = CLASSTYPE_SUPER (other_super); } while (!end_type_reached); ! /* Report that abstract METHOD didn't find an implementation that CLASS can use. */ if (!found) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0)); tree ccn = DECL_NAME (TYPE_NAME (DECL_CONTEXT (method))); ! ! parse_error_context (lookup_cl (class_decl), "Class `%s' doesn't define the abstract method `%s %s' from %s `%s'. This method must be defined or %s `%s' must be declared abstract", IDENTIFIER_POINTER (DECL_NAME (class_decl)), ! t, lang_printable_name (method, 0), ! (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))) ? "interface" : "class"), IDENTIFIER_POINTER (ccn), (CLASS_INTERFACE (class_decl) ? "interface" : "class"), --- 6234,6254 ---- } other_super = CLASSTYPE_SUPER (other_super); } while (!end_type_reached); ! /* Report that abstract METHOD didn't find an implementation that CLASS can use. */ if (!found) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0)); tree ccn = DECL_NAME (TYPE_NAME (DECL_CONTEXT (method))); ! ! parse_error_context (lookup_cl (class_decl), "Class `%s' doesn't define the abstract method `%s %s' from %s `%s'. This method must be defined or %s `%s' must be declared abstract", IDENTIFIER_POINTER (DECL_NAME (class_decl)), ! t, lang_printable_name (method, 0), ! (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))) ? "interface" : "class"), IDENTIFIER_POINTER (ccn), (CLASS_INTERFACE (class_decl) ? "interface" : "class"), *************** check_method_types_complete (decl) *** 6275,6281 **** if (!INCOMPLETE_TYPE_P (TREE_TYPE (type))) return 0; ! args = TYPE_ARG_TYPES (type); if (TREE_CODE (type) == METHOD_TYPE) args = TREE_CHAIN (args); --- 6316,6322 ---- if (!INCOMPLETE_TYPE_P (TREE_TYPE (type))) return 0; ! args = TYPE_ARG_TYPES (type); if (TREE_CODE (type) == METHOD_TYPE) args = TREE_CHAIN (args); *************** java_check_methods (class_decl) *** 6299,6305 **** java_check_abstract_methods (class_decl); else java_check_regular_methods (class_decl); ! CLASS_METHOD_CHECKED_P (TREE_TYPE (class_decl)) = 1; } --- 6340,6346 ---- java_check_abstract_methods (class_decl); else java_check_regular_methods (class_decl); ! CLASS_METHOD_CHECKED_P (TREE_TYPE (class_decl)) = 1; } *************** java_check_regular_methods (class_decl) *** 6314,6320 **** { int saw_constructor = ANONYMOUS_CLASS_P (TREE_TYPE (class_decl)); tree method; ! tree class = CLASS_TO_HANDLE_TYPE (TREE_TYPE (class_decl)); tree found = NULL_TREE; tree mthrows; --- 6355,6361 ---- { int saw_constructor = ANONYMOUS_CLASS_P (TREE_TYPE (class_decl)); tree method; ! tree class = TREE_TYPE (class_decl); tree found = NULL_TREE; tree mthrows; *************** java_check_regular_methods (class_decl) *** 6336,6362 **** if (check_method_redefinition (class, method)) continue; ! /* If we see one constructor a mark so we don't generate the ! default one. Also skip other verifications: constructors ! can't be inherited hence hiden or overriden */ ! if (DECL_CONSTRUCTOR_P (method)) ! { ! saw_constructor = 1; ! continue; ! } ! ! /* We verify things thrown by the method. They must inherits from ! java.lang.Throwable */ for (mthrows = DECL_FUNCTION_THROWS (method); mthrows; mthrows = TREE_CHAIN (mthrows)) { if (!inherits_from_p (TREE_VALUE (mthrows), throwable_type_node)) ! parse_error_context (TREE_PURPOSE (mthrows), "Class `%s' in `throws' clause must be a subclass of class `java.lang.Throwable'", ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows))))); } sig = build_java_argument_signature (TREE_TYPE (method)); found = lookup_argument_method2 (class, DECL_NAME (method), sig); --- 6377,6403 ---- if (check_method_redefinition (class, method)) continue; ! /* We verify things thrown by the method. They must inherit from ! java.lang.Throwable. */ for (mthrows = DECL_FUNCTION_THROWS (method); mthrows; mthrows = TREE_CHAIN (mthrows)) { if (!inherits_from_p (TREE_VALUE (mthrows), throwable_type_node)) ! parse_error_context (TREE_PURPOSE (mthrows), "Class `%s' in `throws' clause must be a subclass of class `java.lang.Throwable'", ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows))))); } + /* If we see one constructor a mark so we don't generate the + default one. Also skip other verifications: constructors + can't be inherited hence hidden or overridden. */ + if (DECL_CONSTRUCTOR_P (method)) + { + saw_constructor = 1; + continue; + } + sig = build_java_argument_signature (TREE_TYPE (method)); found = lookup_argument_method2 (class, DECL_NAME (method), sig); *************** java_check_regular_methods (class_decl) *** 6364,6370 **** if (METHOD_STATIC (method) && !TOPLEVEL_CLASS_DECL_P (class_decl)) { char *t = xstrdup (lang_printable_name (class, 0)); ! parse_error_context (method_wfl, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", lang_printable_name (method, 0), t); free (t); --- 6405,6411 ---- if (METHOD_STATIC (method) && !TOPLEVEL_CLASS_DECL_P (class_decl)) { char *t = xstrdup (lang_printable_name (class, 0)); ! parse_error_context (method_wfl, "Method `%s' can't be static in inner class `%s'. Only members of interfaces and top-level classes can be static", lang_printable_name (method, 0), t); free (t); *************** java_check_regular_methods (class_decl) *** 6381,6387 **** /* If `found' is declared in an interface, make sure the modifier matches. */ ! if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && clinit_identifier_node != DECL_NAME (found) && !METHOD_PUBLIC (method)) { --- 6422,6428 ---- /* If `found' is declared in an interface, make sure the modifier matches. */ ! if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && clinit_identifier_node != DECL_NAME (found) && !METHOD_PUBLIC (method)) { *************** java_check_regular_methods (class_decl) *** 6396,6408 **** types. */ if (TREE_TYPE (TREE_TYPE (found)) != TREE_TYPE (TREE_TYPE (method))) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (method_wfl, ! "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); } --- 6437,6449 ---- types. */ if (TREE_TYPE (TREE_TYPE (found)) != TREE_TYPE (TREE_TYPE (method))) { ! char *t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (method_wfl, ! "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); } *************** java_check_regular_methods (class_decl) *** 6415,6421 **** /* Static *can* override static */ if (METHOD_STATIC (found) && METHOD_STATIC (method)) continue; ! parse_error_context (method_wfl, "%s methods can't be overriden. Method `%s' is %s in class `%s'", (METHOD_FINAL (found) ? "Final" : "Static"), --- 6456,6462 ---- /* Static *can* override static */ if (METHOD_STATIC (found) && METHOD_STATIC (method)) continue; ! parse_error_context (method_wfl, "%s methods can't be overriden. Method `%s' is %s in class `%s'", (METHOD_FINAL (found) ? "Final" : "Static"), *************** java_check_regular_methods (class_decl) *** 6429,6435 **** /* Static method can't override instance method. */ if (METHOD_STATIC (method)) { ! parse_error_context (method_wfl, "Instance methods can't be overriden by a static method. Method `%s' is an instance method in class `%s'", lang_printable_name (found, 0), --- 6470,6476 ---- /* Static method can't override instance method. */ if (METHOD_STATIC (method)) { ! parse_error_context (method_wfl, "Instance methods can't be overriden by a static method. Method `%s' is an instance method in class `%s'", lang_printable_name (found, 0), *************** java_check_regular_methods (class_decl) *** 6447,6463 **** taken care of. */ if (!CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && ((METHOD_PUBLIC (found) && !METHOD_PUBLIC (method)) ! || (METHOD_PROTECTED (found) && !(METHOD_PUBLIC (method) || METHOD_PROTECTED (method))) || (!(aflags & (ACC_PUBLIC | ACC_PRIVATE | ACC_STATIC)) && METHOD_PRIVATE (method)))) { ! parse_error_context (method_wfl, "Methods can't be overridden to be more private. Method `%s' is not %s in class `%s'", lang_printable_name (method, 0), ! (METHOD_PUBLIC (method) ? "public" : (METHOD_PRIVATE (method) ? "private" : "protected")), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); continue; } --- 6488,6504 ---- taken care of. */ if (!CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (found))) && ((METHOD_PUBLIC (found) && !METHOD_PUBLIC (method)) ! || (METHOD_PROTECTED (found) && !(METHOD_PUBLIC (method) || METHOD_PROTECTED (method))) || (!(aflags & (ACC_PUBLIC | ACC_PRIVATE | ACC_STATIC)) && METHOD_PRIVATE (method)))) { ! parse_error_context (method_wfl, "Methods can't be overridden to be more private. Method `%s' is not %s in class `%s'", lang_printable_name (method, 0), ! (METHOD_PUBLIC (method) ? "public" : (METHOD_PRIVATE (method) ? "private" : "protected")), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); continue; } *************** java_check_regular_methods (class_decl) *** 6468,6474 **** /* Inheriting multiple methods with the same signature. FIXME */ } ! if (!TYPE_NVIRTUALS (class)) TYPE_METHODS (class) = nreverse (TYPE_METHODS (class)); --- 6509,6515 ---- /* Inheriting multiple methods with the same signature. FIXME */ } ! if (!TYPE_NVIRTUALS (class)) TYPE_METHODS (class) = nreverse (TYPE_METHODS (class)); *************** java_check_regular_methods (class_decl) *** 6480,6486 **** abort (); } ! /* Return a non zero value if the `throws' clause of METHOD (if any) is incompatible with the `throws' clause of FOUND (if any). */ static void --- 6521,6527 ---- abort (); } ! /* Return a nonzero value if the `throws' clause of METHOD (if any) is incompatible with the `throws' clause of FOUND (if any). */ static void *************** check_throws_clauses (method, method_wfl *** 6500,6516 **** if (IS_UNCHECKED_EXCEPTION_P (TREE_VALUE (mthrows))) continue; /* Checked expression must be compatible */ ! for (fthrows = DECL_FUNCTION_THROWS (found); fthrows; fthrows = TREE_CHAIN (fthrows)) if (inherits_from_p (TREE_VALUE (mthrows), TREE_VALUE (fthrows))) break; if (!fthrows) { ! parse_error_context (method_wfl, "Invalid checked exception class `%s' in `throws' clause. The exception must be a subclass of an exception thrown by `%s' from class `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows)))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } --- 6541,6557 ---- if (IS_UNCHECKED_EXCEPTION_P (TREE_VALUE (mthrows))) continue; /* Checked expression must be compatible */ ! for (fthrows = DECL_FUNCTION_THROWS (found); fthrows; fthrows = TREE_CHAIN (fthrows)) if (inherits_from_p (TREE_VALUE (mthrows), TREE_VALUE (fthrows))) break; if (!fthrows) { ! parse_error_context (method_wfl, "Invalid checked exception class `%s' in `throws' clause. The exception must be a subclass of an exception thrown by `%s' from class `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (TREE_VALUE (mthrows)))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } *************** java_check_abstract_methods (interface_d *** 6539,6549 **** { char *t; t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (DECL_FUNCTION_WFL (found), "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); continue; --- 6580,6590 ---- { char *t; t = xstrdup (lang_printable_name (TREE_TYPE (TREE_TYPE (found)), 0)); ! parse_error_context (DECL_FUNCTION_WFL (found), "Method `%s' was defined with return type `%s' in class `%s'", lang_printable_name (found, 0), t, ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); free (t); continue; *************** java_check_abstract_methods (interface_d *** 6561,6583 **** if (!vec_elt) continue; sub_interface = BINFO_TYPE (vec_elt); ! for (sub_interface_method = TYPE_METHODS (sub_interface); sub_interface_method; sub_interface_method = TREE_CHAIN (sub_interface_method)) { ! found = lookup_java_interface_method2 (interface, sub_interface_method); if (found && (found != sub_interface_method)) { ! parse_error_context (lookup_cl (sub_interface_method), "Interface `%s' inherits method `%s' from interface `%s'. This method is redefined with a different return type in interface `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (interface))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER ! (DECL_NAME (TYPE_NAME (DECL_CONTEXT (sub_interface_method)))), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } --- 6602,6624 ---- if (!vec_elt) continue; sub_interface = BINFO_TYPE (vec_elt); ! for (sub_interface_method = TYPE_METHODS (sub_interface); sub_interface_method; sub_interface_method = TREE_CHAIN (sub_interface_method)) { ! found = lookup_java_interface_method2 (interface, sub_interface_method); if (found && (found != sub_interface_method)) { ! parse_error_context (lookup_cl (sub_interface_method), "Interface `%s' inherits method `%s' from interface `%s'. This method is redefined with a different return type in interface `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (interface))), lang_printable_name (found, 0), ! IDENTIFIER_POINTER ! (DECL_NAME (TYPE_NAME (DECL_CONTEXT (sub_interface_method)))), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (found))))); } } *************** lookup_java_interface_method2 (class, me *** 6602,6614 **** { tree vec_elt = TREE_VEC_ELT (basetype_vec, i), to_return; if ((BINFO_TYPE (vec_elt) != object_type_node) ! && (to_return = lookup_java_method2 (BINFO_TYPE (vec_elt), method_decl, 1))) return to_return; } for (i = 0; i < n; i++) { ! to_return = lookup_java_interface_method2 (BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)), method_decl); if (to_return) return to_return; --- 6643,6655 ---- { tree vec_elt = TREE_VEC_ELT (basetype_vec, i), to_return; if ((BINFO_TYPE (vec_elt) != object_type_node) ! && (to_return = lookup_java_method2 (BINFO_TYPE (vec_elt), method_decl, 1))) return to_return; } for (i = 0; i < n; i++) { ! to_return = lookup_java_interface_method2 (BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)), method_decl); if (to_return) return to_return; *************** lookup_java_method2 (clas, method_decl, *** 6629,6635 **** method_signature = build_java_argument_signature (TREE_TYPE (method_decl)); name = DECL_NAME (method_decl); ! method_name = (TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name); method_type = TREE_TYPE (TREE_TYPE (method_decl)); --- 6670,6676 ---- method_signature = build_java_argument_signature (TREE_TYPE (method_decl)); name = DECL_NAME (method_decl); ! method_name = (TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name); method_type = TREE_TYPE (TREE_TYPE (method_decl)); *************** lookup_java_method2 (clas, method_decl, *** 6642,6648 **** tree name = DECL_NAME (method); if ((TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name) == method_name ! && method_sig == method_signature && TREE_TYPE (TREE_TYPE (method)) != method_type) return method; } --- 6683,6689 ---- tree name = DECL_NAME (method); if ((TREE_CODE (name) == EXPR_WITH_FILE_LOCATION ? EXPR_WFL_NODE (name) : name) == method_name ! && method_sig == method_signature && TREE_TYPE (TREE_TYPE (method)) != method_type) return method; } *************** lookup_java_method2 (clas, method_decl, *** 6654,6687 **** /* Return the line that matches DECL line number, and try its best to position the column number. Used during error reports. */ static tree lookup_cl (decl) tree decl; { - static tree cl = NULL_TREE; char *line, *found; ! if (!decl) return NULL_TREE; ! if (cl == NULL_TREE) { ! cl = build_expr_wfl (NULL_TREE, NULL, 0, 0); ! ggc_add_tree_root (&cl, 1); } ! EXPR_WFL_FILENAME_NODE (cl) = get_identifier (DECL_SOURCE_FILE (decl)); ! EXPR_WFL_SET_LINECOL (cl, DECL_SOURCE_LINE_FIRST (decl), -1); ! line = java_get_line_col (EXPR_WFL_FILENAME (cl), ! EXPR_WFL_LINENO (cl), EXPR_WFL_COLNO (cl)); ! found = strstr ((const char *)line, (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); if (found) ! EXPR_WFL_SET_LINECOL (cl, EXPR_WFL_LINENO (cl), found - line); ! return cl; } /* Look for a simple name in the single-type import list */ --- 6695,6727 ---- /* Return the line that matches DECL line number, and try its best to position the column number. Used during error reports. */ + static GTY(()) tree cl_v; static tree lookup_cl (decl) tree decl; { char *line, *found; ! if (!decl) return NULL_TREE; ! if (cl_v == NULL_TREE) { ! cl_v = build_expr_wfl (NULL_TREE, NULL, 0, 0); } ! EXPR_WFL_FILENAME_NODE (cl_v) = get_identifier (DECL_SOURCE_FILE (decl)); ! EXPR_WFL_SET_LINECOL (cl_v, DECL_SOURCE_LINE_FIRST (decl), -1); ! line = java_get_line_col (EXPR_WFL_FILENAME (cl_v), ! EXPR_WFL_LINENO (cl_v), EXPR_WFL_COLNO (cl_v)); ! found = strstr ((const char *)line, (const char *)IDENTIFIER_POINTER (DECL_NAME (decl))); if (found) ! EXPR_WFL_SET_LINECOL (cl_v, EXPR_WFL_LINENO (cl_v), found - line); ! return cl_v; } /* Look for a simple name in the single-type import list */ *************** process_imports () *** 6720,6726 **** /* Don't load twice something already defined. */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) continue; ! while (1) { tree left; --- 6760,6766 ---- /* Don't load twice something already defined. */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) continue; ! while (1) { tree left; *************** process_imports () *** 6729,6735 **** load_class (to_be_found, 0); error_found = check_pkg_class_access (to_be_found, TREE_PURPOSE (import), true); ! /* We found it, we can bail out */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) break; --- 6769,6775 ---- load_class (to_be_found, 0); error_found = check_pkg_class_access (to_be_found, TREE_PURPOSE (import), true); ! /* We found it, we can bail out */ if (IDENTIFIER_CLASS_VALUE (to_be_found)) break; *************** find_in_imports (enclosing_type, class_t *** 6766,6772 **** tree enclosing_type; tree class_type; { ! tree import = (enclosing_type ? TYPE_IMPORT_LIST (enclosing_type) : ctxp->import_list); while (import) { --- 6806,6812 ---- tree enclosing_type; tree class_type; { ! tree import = (enclosing_type ? TYPE_IMPORT_LIST (enclosing_type) : ctxp->import_list); while (import) { *************** read_import_dir (wfl) *** 6854,6860 **** int current_entry_len = zipd->filename_length; if (current_entry_len >= BUFFER_LENGTH (filename) ! && strncmp (filename->data, current_entry, BUFFER_LENGTH (filename)) != 0) continue; found |= note_possible_classname (current_entry, --- 6894,6900 ---- int current_entry_len = zipd->filename_length; if (current_entry_len >= BUFFER_LENGTH (filename) ! && strncmp (filename->data, current_entry, BUFFER_LENGTH (filename)) != 0) continue; found |= note_possible_classname (current_entry, *************** read_import_dir (wfl) *** 6881,6887 **** *filename->ptr++ = '/'; for (;;) { ! int len; const char *d_name; struct dirent *direntp = readdir (dirp); if (!direntp) --- 6921,6927 ---- *filename->ptr++ = '/'; for (;;) { ! int len; const char *d_name; struct dirent *direntp = readdir (dirp); if (!direntp) *************** read_import_dir (wfl) *** 6923,6929 **** /* Possibly find a type in the import on demands specified types. Returns 1 if an error occurred, 0 otherwise. Run through the entire list, to detected potential double definitions. */ ! static int find_in_imports_on_demand (enclosing_type, class_type) tree enclosing_type; --- 6963,6969 ---- /* Possibly find a type in the import on demands specified types. Returns 1 if an error occurred, 0 otherwise. Run through the entire list, to detected potential double definitions. */ ! static int find_in_imports_on_demand (enclosing_type, class_type) tree enclosing_type; *************** find_in_imports_on_demand (enclosing_typ *** 6944,6958 **** const char *id_name; tree decl, type_name_copy; ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE (TREE_PURPOSE (import))), IDENTIFIER_LENGTH (EXPR_WFL_NODE (TREE_PURPOSE (import)))); obstack_1grow (&temporary_obstack, '.'); ! obstack_grow0 (&temporary_obstack, IDENTIFIER_POINTER (class_type_name), IDENTIFIER_LENGTH (class_type_name)); id_name = obstack_finish (&temporary_obstack); ! if (! (node = maybe_get_identifier (id_name))) continue; --- 6984,6998 ---- const char *id_name; tree decl, type_name_copy; ! obstack_grow (&temporary_obstack, IDENTIFIER_POINTER (EXPR_WFL_NODE (TREE_PURPOSE (import))), IDENTIFIER_LENGTH (EXPR_WFL_NODE (TREE_PURPOSE (import)))); obstack_1grow (&temporary_obstack, '.'); ! obstack_grow0 (&temporary_obstack, IDENTIFIER_POINTER (class_type_name), IDENTIFIER_LENGTH (class_type_name)); id_name = obstack_finish (&temporary_obstack); ! if (! (node = maybe_get_identifier (id_name))) continue; *************** find_in_imports_on_demand (enclosing_typ *** 6990,6996 **** TYPE_NAME (class_type) = type_name_copy; continue; } ! /* If the loaded class is accessible, we keep a tab on it to detect and report multiple inclusions. */ if (IS_A_CLASSFILE_NAME (node)) --- 7030,7036 ---- TYPE_NAME (class_type) = type_name_copy; continue; } ! /* If the loaded class is accessible, we keep a tab on it to detect and report multiple inclusions. */ if (IS_A_CLASSFILE_NAME (node)) *************** find_in_imports_on_demand (enclosing_typ *** 7003,7015 **** else if (seen_once >= 0) { tree location = (cl ? cl : TREE_PURPOSE (import)); ! tree package = (cl ? EXPR_WFL_NODE (cl) : EXPR_WFL_NODE (TREE_PURPOSE (import))); seen_once++; ! parse_error_context (location, "Type `%s' also potentially defined in package `%s'", ! IDENTIFIER_POINTER (TYPE_NAME (class_type)), IDENTIFIER_POINTER (package)); } } --- 7043,7055 ---- else if (seen_once >= 0) { tree location = (cl ? cl : TREE_PURPOSE (import)); ! tree package = (cl ? EXPR_WFL_NODE (cl) : EXPR_WFL_NODE (TREE_PURPOSE (import))); seen_once++; ! parse_error_context (location, "Type `%s' also potentially defined in package `%s'", ! IDENTIFIER_POINTER (TYPE_NAME (class_type)), IDENTIFIER_POINTER (package)); } } *************** find_in_imports_on_demand (enclosing_typ *** 7022,7028 **** return (seen_once < 0 ? 0 : seen_once); /* It's ok not to have found */ } ! /* Add package NAME to the list of package encountered so far. To speed up class lookup in do_resolve_class, we make sure a particular package is added only once. */ --- 7062,7068 ---- return (seen_once < 0 ? 0 : seen_once); /* It's ok not to have found */ } ! /* Add package NAME to the list of packages encountered so far. To speed up class lookup in do_resolve_class, we make sure a particular package is added only once. */ *************** static void *** 7030,7048 **** register_package (name) tree name; { ! static struct hash_table _pht, *pht = NULL; ! if (!pht) ! { ! hash_table_init (&_pht, hash_newfunc, ! java_hash_hash_tree_node, java_hash_compare_tree_node); ! pht = &_pht; ! } ! ! if (!hash_lookup (pht, (const hash_table_key) name, FALSE, NULL)) { package_list = chainon (package_list, build_tree_list (name, NULL)); ! hash_lookup (pht, (const hash_table_key) name, TRUE, NULL); } } --- 7070,7086 ---- register_package (name) tree name; { ! static htab_t pht; ! PTR *e; ! if (pht == NULL) ! pht = htab_create (50, htab_hash_pointer, htab_eq_pointer, NULL); ! ! e = htab_find_slot (pht, name, INSERT); ! if (*e == NULL) { package_list = chainon (package_list, build_tree_list (name, NULL)); ! *e = name; } } *************** resolve_package (pkg, next, type_name) *** 7062,7075 **** /* Try to progressively construct a type name */ if (TREE_CODE (pkg) == EXPR_WITH_FILE_LOCATION) ! for (current = EXPR_WFL_QUALIFICATION (pkg); current; current = TREE_CHAIN (current)) { /* If we don't have what we're expecting, exit now. TYPE_NAME will be null and the error caught later. */ if (TREE_CODE (QUAL_WFL (current)) != EXPR_WITH_FILE_LOCATION) break; ! *type_name = merge_qualified_name (*type_name, EXPR_WFL_NODE (QUAL_WFL (current))); if ((decl = resolve_no_layout (*type_name, NULL_TREE))) { --- 7100,7113 ---- /* Try to progressively construct a type name */ if (TREE_CODE (pkg) == EXPR_WITH_FILE_LOCATION) ! for (current = EXPR_WFL_QUALIFICATION (pkg); current; current = TREE_CHAIN (current)) { /* If we don't have what we're expecting, exit now. TYPE_NAME will be null and the error caught later. */ if (TREE_CODE (QUAL_WFL (current)) != EXPR_WITH_FILE_LOCATION) break; ! *type_name = merge_qualified_name (*type_name, EXPR_WFL_NODE (QUAL_WFL (current))); if ((decl = resolve_no_layout (*type_name, NULL_TREE))) { *************** resolve_package (pkg, next, type_name) *** 7084,7090 **** } ! /* Check accessibility of inner classes according to member access rules. DECL is the inner class, ENCLOSING_DECL is the class from which the access is being attempted. */ --- 7122,7128 ---- } ! /* Check accessibility of inner classes according to member access rules. DECL is the inner class, ENCLOSING_DECL is the class from which the access is being attempted. */ *************** check_inner_class_access (decl, enclosin *** 7111,7121 **** class in which DECL is declared. */ tree top_level = decl; while (DECL_CONTEXT (top_level)) ! top_level = DECL_CONTEXT (top_level); while (DECL_CONTEXT (enclosing_decl)) enclosing_decl = DECL_CONTEXT (enclosing_decl); if (top_level == enclosing_decl) ! return; access = "private"; } else if (CLASS_PROTECTED (decl)) --- 7149,7159 ---- class in which DECL is declared. */ tree top_level = decl; while (DECL_CONTEXT (top_level)) ! top_level = DECL_CONTEXT (top_level); while (DECL_CONTEXT (enclosing_decl)) enclosing_decl = DECL_CONTEXT (enclosing_decl); if (top_level == enclosing_decl) ! return; access = "private"; } else if (CLASS_PROTECTED (decl)) *************** check_inner_class_access (decl, enclosin *** 7124,7130 **** /* Access is permitted from within the same package... */ if (in_same_package (decl, enclosing_decl)) return; ! /* ... or from within the body of a subtype of the context in which DECL is declared. */ decl_context = DECL_CONTEXT (decl); --- 7162,7168 ---- /* Access is permitted from within the same package... */ if (in_same_package (decl, enclosing_decl)) return; ! /* ... or from within the body of a subtype of the context in which DECL is declared. */ decl_context = DECL_CONTEXT (decl); *************** check_inner_class_access (decl, enclosin *** 7132,7150 **** { if (CLASS_INTERFACE (decl)) { ! if (interface_of_p (TREE_TYPE (decl_context), enclosing_decl_type)) return; } else { /* Eww. The order of the arguments is different!! */ ! if (inherits_from_p (enclosing_decl_type, TREE_TYPE (decl_context))) return; } enclosing_decl = DECL_CONTEXT (enclosing_decl); ! } access = "protected"; } else if (! CLASS_PUBLIC (decl)) --- 7170,7188 ---- { if (CLASS_INTERFACE (decl)) { ! if (interface_of_p (TREE_TYPE (decl_context), enclosing_decl_type)) return; } else { /* Eww. The order of the arguments is different!! */ ! if (inherits_from_p (enclosing_decl_type, TREE_TYPE (decl_context))) return; } enclosing_decl = DECL_CONTEXT (enclosing_decl); ! } access = "protected"; } else if (! CLASS_PUBLIC (decl)) *************** check_pkg_class_access (class_name, cl, *** 7196,7202 **** return 0; if (verbose) ! parse_error_context (cl, "Can't access %s `%s'. Only public classes and interfaces in other packages can be accessed", (CLASS_INTERFACE (TYPE_NAME (type)) ? "interface" : "class"), IDENTIFIER_POINTER (class_name)); --- 7234,7240 ---- return 0; if (verbose) ! parse_error_context (cl, "Can't access %s `%s'. Only public classes and interfaces in other packages can be accessed", (CLASS_INTERFACE (TYPE_NAME (type)) ? "interface" : "class"), IDENTIFIER_POINTER (class_name)); *************** declare_local_variables (modifier, type, *** 7228,7241 **** if (modifier) { ! int i; ! for (i = 0; i <= 10; i++) if (1 << i & modifier) break; if (modifier == ACC_FINAL) final_p = 1; ! else { ! parse_error_context ! (ctxp->modifier_ctx [i], "Only `final' is allowed as a local variables modifier"); return; } --- 7266,7281 ---- if (modifier) { ! size_t i; ! for (i = 0; i < ARRAY_SIZE (ctxp->modifier_ctx); i++) ! if (1 << i & modifier) ! break; if (modifier == ACC_FINAL) final_p = 1; ! else { ! parse_error_context ! (ctxp->modifier_ctx [i], "Only `final' is allowed as a local variables modifier"); return; } *************** declare_local_variables (modifier, type, *** 7281,7296 **** MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); DECL_FINAL (decl) = final_p; BLOCK_CHAIN_DECL (decl); ! /* If doing xreferencing, replace the line number with the WFL compound value */ if (flag_emit_xref) DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl); ! /* Don't try to use an INIT statement when an error was found */ if (init && java_error_count) init = NULL_TREE; ! /* Add the initialization function to the current function's code */ if (init) { --- 7321,7336 ---- MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); DECL_FINAL (decl) = final_p; BLOCK_CHAIN_DECL (decl); ! /* If doing xreferencing, replace the line number with the WFL compound value */ if (flag_emit_xref) DECL_SOURCE_LINE (decl) = EXPR_WFL_LINECOL (wfl); ! /* Don't try to use an INIT statement when an error was found */ if (init && java_error_count) init = NULL_TREE; ! /* Add the initialization function to the current function's code */ if (init) { *************** declare_local_variables (modifier, type, *** 7301,7307 **** build_debugable_stmt (EXPR_WFL_LINECOL (init), init)); } ! /* Setup dependency the type of the decl */ if (must_chain) { --- 7341,7347 ---- build_debugable_stmt (EXPR_WFL_LINECOL (init), init)); } ! /* Setup dependency the type of the decl */ if (must_chain) { *************** source_start_java_method (fndecl) *** 7336,7342 **** { tree type = TREE_VALUE (tem); tree name = TREE_PURPOSE (tem); ! /* If type is incomplete. Create an incomplete decl and ask for the decl to be patched later */ if (INCOMPLETE_TYPE_P (type)) --- 7376,7382 ---- { tree type = TREE_VALUE (tem); tree name = TREE_PURPOSE (tem); ! /* If type is incomplete. Create an incomplete decl and ask for the decl to be patched later */ if (INCOMPLETE_TYPE_P (type)) *************** create_artificial_method (class, flags, *** 7381,7393 **** tree mdecl; java_parser_context_save_global (); ! lineno = 0; ! mdecl = make_node (FUNCTION_TYPE); TREE_TYPE (mdecl) = type; TYPE_ARG_TYPES (mdecl) = args; ! mdecl = add_method (class, flags, name, build_java_signature (mdecl)); java_parser_context_restore_global (); ! DECL_ARTIFICIAL (mdecl) = 1; return mdecl; } --- 7421,7433 ---- tree mdecl; java_parser_context_save_global (); ! lineno = 0; ! mdecl = make_node (FUNCTION_TYPE); TREE_TYPE (mdecl) = type; TYPE_ARG_TYPES (mdecl) = args; ! mdecl = add_method (class, flags, name, build_java_signature (mdecl)); java_parser_context_restore_global (); ! DECL_ARTIFICIAL (mdecl) = 1; return mdecl; } *************** dump_java_tree (phase, t) *** 7426,7431 **** --- 7466,7472 ---- int flags; stream = dump_begin (phase, &flags); + flags |= TDF_SLIM; if (stream) { dump_node (t, flags, stream); *************** source_end_java_method () *** 7456,7461 **** --- 7497,7504 ---- patched. Dump it to a file if the user requested it. */ dump_java_tree (TDI_original, fndecl); + java_optimize_inline (fndecl); + /* Generate function's code */ if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) && ! flag_emit_class_files *************** add_stmt_to_block (b, type, stmt) *** 7500,7509 **** tree b, type, stmt; { tree body = BLOCK_EXPR_BODY (b), c; ! if (java_error_count) return body; ! if ((c = add_stmt_to_compound (body, type, stmt)) == body) return body; --- 7543,7552 ---- tree b, type, stmt; { tree body = BLOCK_EXPR_BODY (b), c; ! if (java_error_count) return body; ! if ((c = add_stmt_to_compound (body, type, stmt)) == body) return body; *************** static tree *** 7519,7524 **** --- 7562,7571 ---- add_stmt_to_compound (existing, type, stmt) tree existing, type, stmt; { + /* Keep track of this for inlining. */ + if (current_function_decl) + ++DECL_NUM_STMTS (current_function_decl); + if (existing) return build (COMPOUND_EXPR, type, existing, stmt); else *************** void java_layout_seen_class_methods () *** 7533,7542 **** while (1) { ! for (current = previous_list; current != end; current = TREE_CHAIN (current)) layout_class_methods (TREE_TYPE (TREE_VALUE (current))); ! if (previous_list != all_class_list) { end = previous_list; --- 7580,7589 ---- while (1) { ! for (current = previous_list; current != end; current = TREE_CHAIN (current)) layout_class_methods (TREE_TYPE (TREE_VALUE (current))); ! if (previous_list != all_class_list) { end = previous_list; *************** void java_layout_seen_class_methods () *** 7547,7566 **** } } void java_reorder_fields () { - static tree stop_reordering = NULL_TREE; - static int initialized_p; tree current; - /* Register STOP_REORDERING with the garbage collector. */ - if (!initialized_p) - { - ggc_add_tree_root (&stop_reordering, 1); - initialized_p = 1; - } - for (current = gclass_list; current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); --- 7594,7605 ---- } } + static GTY(()) tree stop_reordering; void java_reorder_fields () { tree current; for (current = gclass_list; current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); *************** java_reorder_fields () *** 7585,7591 **** after having reversed the fields */ else { ! TYPE_FIELDS (current_class) = nreverse (TYPE_FIELDS (current_class)); TYPE_SIZE (current_class) = NULL_TREE; } --- 7624,7630 ---- after having reversed the fields */ else { ! TYPE_FIELDS (current_class) = nreverse (TYPE_FIELDS (current_class)); TYPE_SIZE (current_class) = NULL_TREE; } *************** java_complete_expand_methods (class_decl *** 7715,7721 **** if (!DECL_CONSTRUCTOR_P (decl)) continue; ! no_body = !DECL_FUNCTION_BODY (decl); /* Don't generate debug info on line zero when expanding a generated constructor. */ --- 7754,7760 ---- if (!DECL_CONSTRUCTOR_P (decl)) continue; ! no_body = !DECL_FUNCTION_BODY (decl); /* Don't generate debug info on line zero when expanding a generated constructor. */ *************** java_complete_expand_methods (class_decl *** 7734,7740 **** /* Ctors aren't part of this batch. */ if (DECL_CONSTRUCTOR_P (decl) || DECL_CLINIT_P (decl)) continue; ! /* Skip abstract or native methods -- but do handle native methods when generating JNI stubs. */ if (METHOD_ABSTRACT (decl) || (! flag_jni && METHOD_NATIVE (decl))) --- 7773,7779 ---- /* Ctors aren't part of this batch. */ if (DECL_CONSTRUCTOR_P (decl) || DECL_CLINIT_P (decl)) continue; ! /* Skip abstract or native methods -- but do handle native methods when generating JNI stubs. */ if (METHOD_ABSTRACT (decl) || (! flag_jni && METHOD_NATIVE (decl))) *************** java_complete_expand_methods (class_decl *** 7762,7768 **** java_complete_expand_method (clinit); ctxp->explicit_constructor_p = 0; } ! /* We might have generated a class$ that we now want to expand */ if (TYPE_DOT_CLASS (current_class)) java_complete_expand_method (TYPE_DOT_CLASS (current_class)); --- 7801,7807 ---- java_complete_expand_method (clinit); ctxp->explicit_constructor_p = 0; } ! /* We might have generated a class$ that we now want to expand */ if (TYPE_DOT_CLASS (current_class)) java_complete_expand_method (TYPE_DOT_CLASS (current_class)); *************** java_complete_expand_methods (class_decl *** 7771,7777 **** prove wrong.) */ if (!CLASS_INTERFACE (class_decl)) for (decl = TYPE_METHODS (current_class); decl; decl = TREE_CHAIN (decl)) ! if (DECL_CONSTRUCTOR_P (decl) && verify_constructor_circularity (decl, decl)) break; --- 7810,7816 ---- prove wrong.) */ if (!CLASS_INTERFACE (class_decl)) for (decl = TYPE_METHODS (current_class); decl; decl = TREE_CHAIN (decl)) ! if (DECL_CONSTRUCTOR_P (decl) && verify_constructor_circularity (decl, decl)) break; *************** maybe_generate_pre_expand_clinit (class_ *** 7792,7798 **** return NULL_TREE; /* Go through all static fields and pre expand them */ ! for (current = TYPE_FIELDS (class_type); current; current = TREE_CHAIN (current)) if (FIELD_STATIC (current)) build_field_ref (NULL_TREE, class_type, DECL_NAME (current)); --- 7831,7837 ---- return NULL_TREE; /* Go through all static fields and pre expand them */ ! for (current = TYPE_FIELDS (class_type); current; current = TREE_CHAIN (current)) if (FIELD_STATIC (current)) build_field_ref (NULL_TREE, class_type, DECL_NAME (current)); *************** analyze_clinit_body (this_class, bbody) *** 7852,7868 **** case BLOCK: bbody = BLOCK_EXPR_BODY (bbody); break; ! case EXPR_WITH_FILE_LOCATION: bbody = EXPR_WFL_NODE (bbody); break; ! case COMPOUND_EXPR: if (analyze_clinit_body (this_class, TREE_OPERAND (bbody, 0))) return 1; bbody = TREE_OPERAND (bbody, 1); break; ! case MODIFY_EXPR: /* If we're generating to class file and we're dealing with an array initialization, we return 1 to keep */ --- 7891,7907 ---- case BLOCK: bbody = BLOCK_EXPR_BODY (bbody); break; ! case EXPR_WITH_FILE_LOCATION: bbody = EXPR_WFL_NODE (bbody); break; ! case COMPOUND_EXPR: if (analyze_clinit_body (this_class, TREE_OPERAND (bbody, 0))) return 1; bbody = TREE_OPERAND (bbody, 1); break; ! case MODIFY_EXPR: /* If we're generating to class file and we're dealing with an array initialization, we return 1 to keep */ *************** maybe_yank_clinit (mdecl) *** 7897,7903 **** { tree type, current; tree fbody, bbody; ! if (!DECL_CLINIT_P (mdecl)) return 0; --- 7936,7942 ---- { tree type, current; tree fbody, bbody; ! if (!DECL_CLINIT_P (mdecl)) return 0; *************** maybe_yank_clinit (mdecl) *** 7916,7922 **** type = DECL_CONTEXT (mdecl); current = TYPE_FIELDS (type); ! for (current = (current ? TREE_CHAIN (current) : current); current; current = TREE_CHAIN (current)) { tree f_init; --- 7955,7961 ---- type = DECL_CONTEXT (mdecl); current = TYPE_FIELDS (type); ! for (current = (current ? TREE_CHAIN (current) : current); current; current = TREE_CHAIN (current)) { tree f_init; *************** maybe_yank_clinit (mdecl) *** 7951,7957 **** if (TYPE_METHODS (type) == mdecl) TYPE_METHODS (type) = TREE_CHAIN (mdecl); else ! for (current = TYPE_METHODS (type); current; current = TREE_CHAIN (current)) if (TREE_CHAIN (current) == mdecl) { --- 7990,7996 ---- if (TYPE_METHODS (type) == mdecl) TYPE_METHODS (type) = TREE_CHAIN (mdecl); else ! for (current = TYPE_METHODS (type); current; current = TREE_CHAIN (current)) if (TREE_CHAIN (current) == mdecl) { *************** start_complete_expand_method (mdecl) *** 7977,7983 **** for (; tem; tem = TREE_CHAIN (tem)) { ! /* TREE_CHAIN (tem) will change after pushdecl. */ tree next = TREE_CHAIN (tem); tree type = TREE_TYPE (tem); if (PROMOTE_PROTOTYPES --- 8016,8022 ---- for (; tem; tem = TREE_CHAIN (tem)) { ! /* TREE_CHAIN (tem) will change after pushdecl. */ tree next = TREE_CHAIN (tem); tree type = TREE_TYPE (tem); if (PROMOTE_PROTOTYPES *************** java_complete_expand_method (mdecl) *** 8009,8015 **** /* Fix constructors before expanding them */ if (DECL_CONSTRUCTOR_P (mdecl)) fix_constructors (mdecl); ! /* Expand functions that have a body */ if (!DECL_FUNCTION_BODY (mdecl)) return; --- 8048,8054 ---- /* Fix constructors before expanding them */ if (DECL_CONSTRUCTOR_P (mdecl)) fix_constructors (mdecl); ! /* Expand functions that have a body */ if (!DECL_FUNCTION_BODY (mdecl)) return; *************** java_complete_expand_method (mdecl) *** 8026,8060 **** announce_function (mdecl); if (! quiet_flag) fprintf (stderr, "]"); ! /* Prepare the function for tree completion */ start_complete_expand_method (mdecl); /* Install the current this */ ! current_this = (!METHOD_STATIC (mdecl) ? BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (mdecl)) : NULL_TREE); /* Purge the `throws' list of unchecked exceptions (we save a copy of the list and re-install it later.) */ exception_copy = copy_list (DECL_FUNCTION_THROWS (mdecl)); purge_unchecked_exceptions (mdecl); ! /* Install exceptions thrown with `throws' */ PUSH_EXCEPTIONS (DECL_FUNCTION_THROWS (mdecl)); ! if (block_body != NULL_TREE) { block_body = java_complete_tree (block_body); ! /* Before we check initialization, attached all class initialization variable to the block_body */ ! hash_traverse (&DECL_FUNCTION_INIT_TEST_TABLE (mdecl), attach_init_test_initialization_flags, block_body); ! if (! flag_emit_xref && ! METHOD_NATIVE (mdecl)) { check_for_initialization (block_body, mdecl); ! /* Go through all the flags marking the initialization of static variables and see whether they're definitively assigned, in which case the type is remembered as --- 8065,8099 ---- announce_function (mdecl); if (! quiet_flag) fprintf (stderr, "]"); ! /* Prepare the function for tree completion */ start_complete_expand_method (mdecl); /* Install the current this */ ! current_this = (!METHOD_STATIC (mdecl) ? BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (mdecl)) : NULL_TREE); /* Purge the `throws' list of unchecked exceptions (we save a copy of the list and re-install it later.) */ exception_copy = copy_list (DECL_FUNCTION_THROWS (mdecl)); purge_unchecked_exceptions (mdecl); ! /* Install exceptions thrown with `throws' */ PUSH_EXCEPTIONS (DECL_FUNCTION_THROWS (mdecl)); ! if (block_body != NULL_TREE) { block_body = java_complete_tree (block_body); ! /* Before we check initialization, attached all class initialization variable to the block_body */ ! htab_traverse (DECL_FUNCTION_INIT_TEST_TABLE (mdecl), attach_init_test_initialization_flags, block_body); ! if (! flag_emit_xref && ! METHOD_NATIVE (mdecl)) { check_for_initialization (block_body, mdecl); ! /* Go through all the flags marking the initialization of static variables and see whether they're definitively assigned, in which case the type is remembered as *************** java_complete_expand_method (mdecl) *** 8065,8080 **** MDECL. This used with caution helps removing extra initialization of self. */ if (METHOD_STATIC (mdecl)) ! hash_lookup (&DECL_FUNCTION_INITIALIZED_CLASS_TABLE (mdecl), ! (hash_table_key) DECL_CONTEXT (mdecl), ! TRUE, NULL); } } ctxp->explicit_constructor_p = 0; } ! BLOCK_EXPR_BODY (fbody) = block_body; ! /* If we saw a return but couldn't evaluate it properly, we'll have an error_mark_node here. */ if (block_body != error_mark_node --- 8104,8121 ---- MDECL. This used with caution helps removing extra initialization of self. */ if (METHOD_STATIC (mdecl)) ! { ! *(htab_find_slot ! (DECL_FUNCTION_INITIALIZED_CLASS_TABLE (mdecl), ! DECL_CONTEXT (mdecl), INSERT)) = DECL_CONTEXT (mdecl); ! } } } ctxp->explicit_constructor_p = 0; } ! BLOCK_EXPR_BODY (fbody) = block_body; ! /* If we saw a return but couldn't evaluate it properly, we'll have an error_mark_node here. */ if (block_body != error_mark_node *************** java_expand_method_bodies (class) *** 8114,8119 **** --- 8155,8165 ---- current_function_decl = decl; + /* Save the function for inlining. */ + if (flag_inline_trees) + DECL_SAVED_TREE (decl) = + BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (decl)); + /* It's time to assign the variable flagging static class initialization based on which classes invoked static methods are definitely initializing. This should be flagged. */ *************** java_expand_method_bodies (class) *** 8135,8141 **** /* For each class definitely initialized in CALLED_METHOD, fill ASSIGNMENT_COMPOUND with assignment to the class initialization flag. */ ! hash_traverse (&DECL_FUNCTION_INITIALIZED_CLASS_TABLE (called_method), emit_test_initialization, assignment_compound_list); --- 8181,8187 ---- /* For each class definitely initialized in CALLED_METHOD, fill ASSIGNMENT_COMPOUND with assignment to the class initialization flag. */ ! htab_traverse (DECL_FUNCTION_INITIALIZED_CLASS_TABLE (called_method), emit_test_initialization, assignment_compound_list); *************** java_expand_method_bodies (class) *** 8145,8151 **** } } ! /* Prepare the function for RTL expansion */ start_complete_expand_method (decl); /* Expand function start, generate initialization flag --- 8191,8197 ---- } } ! /* Prepare the function for RTL expansion */ start_complete_expand_method (decl); /* Expand function start, generate initialization flag *************** build_outer_field_access (id, decl) *** 8186,8192 **** && (!FIELD_PRIVATE (decl) || !flag_emit_class_files )) { tree thisn = build_current_thisn (current_class); ! access = make_qualified_primary (build_wfl_node (thisn), id, EXPR_WFL_LINECOL (id)); } /* Otherwise, generate access methods to outer this and access the --- 8232,8238 ---- && (!FIELD_PRIVATE (decl) || !flag_emit_class_files )) { tree thisn = build_current_thisn (current_class); ! access = make_qualified_primary (build_wfl_node (thisn), id, EXPR_WFL_LINECOL (id)); } /* Otherwise, generate access methods to outer this and access the *************** build_outer_field_access (id, decl) *** 8217,8234 **** return resolve_expression_name (access, NULL); } ! /* Return a non zero value if NODE describes an outer field inner access. */ static int outer_field_access_p (type, decl) tree type, decl; { ! if (!INNER_CLASS_TYPE_P (type) || TREE_CODE (decl) != FIELD_DECL || DECL_CONTEXT (decl) == type) return 0; ! /* If the inner class extends the declaration context of the field we're try to acces, then this isn't an outer field access */ if (inherits_from_p (type, DECL_CONTEXT (decl))) --- 8263,8280 ---- return resolve_expression_name (access, NULL); } ! /* Return a nonzero value if NODE describes an outer field inner access. */ static int outer_field_access_p (type, decl) tree type, decl; { ! if (!INNER_CLASS_TYPE_P (type) || TREE_CODE (decl) != FIELD_DECL || DECL_CONTEXT (decl) == type) return 0; ! /* If the inner class extends the declaration context of the field we're try to acces, then this isn't an outer field access */ if (inherits_from_p (type, DECL_CONTEXT (decl))) *************** outer_field_access_p (type, decl) *** 8253,8259 **** return 0; } ! /* Return a non zero value if NODE represents an outer field inner access that was been already expanded. As a side effect, it returns the name of the field being accessed and the argument passed to the access function, suitable for a regeneration of the access method --- 8299,8305 ---- return 0; } ! /* Return a nonzero value if NODE represents an outer field inner access that was been already expanded. As a side effect, it returns the name of the field being accessed and the argument passed to the access function, suitable for a regeneration of the access method *************** outer_field_expanded_access_p (node, nam *** 8271,8291 **** /* Well, gcj generates slightly different tree nodes when compiling to native or bytecodes. It's the case for function calls. */ ! if (flag_emit_class_files && TREE_CODE (node) == CALL_EXPR && OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0)))) identified = 1; else if (!flag_emit_class_files) { node = TREE_OPERAND (node, 0); ! if (node && TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR) { node = TREE_OPERAND (node, 0); if (TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == FUNCTION_DECL ! && (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0))))) identified = 1; } --- 8317,8337 ---- /* Well, gcj generates slightly different tree nodes when compiling to native or bytecodes. It's the case for function calls. */ ! if (flag_emit_class_files && TREE_CODE (node) == CALL_EXPR && OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0)))) identified = 1; else if (!flag_emit_class_files) { node = TREE_OPERAND (node, 0); ! if (node && TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR) { node = TREE_OPERAND (node, 0); if (TREE_OPERAND (node, 0) && TREE_CODE (TREE_OPERAND (node, 0)) == FUNCTION_DECL ! && (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (TREE_OPERAND (node, 0))))) identified = 1; } *************** outer_field_access_fix (wfl, node, rhs) *** 8311,8320 **** tree wfl, node, rhs; { tree name, arg_type, arg; ! if (outer_field_expanded_access_p (node, &name, &arg_type, &arg)) { ! node = build_outer_field_access_expr (EXPR_WFL_LINECOL (wfl), arg_type, name, arg, rhs); return java_complete_tree (node); } --- 8357,8366 ---- tree wfl, node, rhs; { tree name, arg_type, arg; ! if (outer_field_expanded_access_p (node, &name, &arg_type, &arg)) { ! node = build_outer_field_access_expr (EXPR_WFL_LINECOL (wfl), arg_type, name, arg, rhs); return java_complete_tree (node); } *************** outer_field_access_fix (wfl, node, rhs) *** 8322,8328 **** } /* Construct the expression that calls an access method: ! .access$( [, ]); ARG2 can be NULL and will be omitted in that case. It will denote a read access. */ --- 8368,8374 ---- } /* Construct the expression that calls an access method: ! .access$( [, ]); ARG2 can be NULL and will be omitted in that case. It will denote a read access. */ *************** build_outer_field_access_expr (lc, type, *** 8334,8340 **** { tree args, cn, access; ! args = arg1 ? arg1 : build_wfl_node (build_current_thisn (current_class)); args = build_tree_list (NULL_TREE, args); --- 8380,8386 ---- { tree args, cn, access; ! args = arg1 ? arg1 : build_wfl_node (build_current_thisn (current_class)); args = build_tree_list (NULL_TREE, args); *************** build_outer_field_access_methods (decl) *** 8375,8386 **** tree decl; { tree id, args, stmt, mdecl; ! if (FIELD_INNER_ACCESS_P (decl)) return FIELD_INNER_ACCESS (decl); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); ! /* Create the identifier and a function named after it. */ id = build_new_access_id (); --- 8421,8432 ---- tree decl; { tree id, args, stmt, mdecl; ! if (FIELD_INNER_ACCESS_P (decl)) return FIELD_INNER_ACCESS (decl); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); ! /* Create the identifier and a function named after it. */ id = build_new_access_id (); *************** build_outer_field_access_methods (decl) *** 8394,8407 **** stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, stmt); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), TREE_TYPE (decl), id, args, stmt); DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; /* Create the write access method. No write access for final variable */ if (!FIELD_FINAL (decl)) { ! args = build_tree_list (inst_id, build_pointer_type (DECL_CONTEXT (decl))); TREE_CHAIN (args) = build_tree_list (wpv_id, TREE_TYPE (decl)); TREE_CHAIN (TREE_CHAIN (args)) = end_params_node; --- 8440,8453 ---- stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, stmt); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), TREE_TYPE (decl), id, args, stmt); DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; /* Create the write access method. No write access for final variable */ if (!FIELD_FINAL (decl)) { ! args = build_tree_list (inst_id, build_pointer_type (DECL_CONTEXT (decl))); TREE_CHAIN (args) = build_tree_list (wpv_id, TREE_TYPE (decl)); TREE_CHAIN (TREE_CHAIN (args)) = end_params_node; *************** build_outer_field_access_methods (decl) *** 8409,8416 **** build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, build_assignment (ASSIGN_TK, 0, stmt, build_wfl_node (wpv_id))); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), ! TREE_TYPE (decl), id, args, stmt); } DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; --- 8455,8462 ---- build_wfl_node (DECL_NAME (decl)), 0); stmt = build_return (0, build_assignment (ASSIGN_TK, 0, stmt, build_wfl_node (wpv_id))); ! mdecl = build_outer_field_access_method (DECL_CONTEXT (decl), ! TREE_TYPE (decl), id, args, stmt); } DECL_FUNCTION_ACCESS_DECL (mdecl) = decl; *************** build_outer_field_access_methods (decl) *** 8421,8427 **** /* Build an field access method NAME. */ ! static tree build_outer_field_access_method (class, type, name, args, body) tree class, type, name, args, body; { --- 8467,8473 ---- /* Build an field access method NAME. */ ! static tree build_outer_field_access_method (class, type, name, args, body) tree class, type, name, args, body; { *************** build_outer_method_access_method (decl) *** 8472,8488 **** carg = TYPE_ARG_TYPES (TREE_TYPE (decl)); /* Create the arguments, as much as the original */ ! for (; carg && carg != end_params_node; carg = TREE_CHAIN (carg)) { sprintf (buffer, "write_parm_value$%d", parm_id_count++); ! args = chainon (args, build_tree_list (get_identifier (buffer), TREE_VALUE (carg))); } args = chainon (args, end_params_node); /* Create the method */ ! mdecl = create_artificial_method (class, ACC_STATIC, TREE_TYPE (TREE_TYPE (decl)), id, args); layout_class_method (class, NULL_TREE, mdecl, NULL_TREE); /* There is a potential bug here. We should be able to use --- 8518,8534 ---- carg = TYPE_ARG_TYPES (TREE_TYPE (decl)); /* Create the arguments, as much as the original */ ! for (; carg && carg != end_params_node; carg = TREE_CHAIN (carg)) { sprintf (buffer, "write_parm_value$%d", parm_id_count++); ! args = chainon (args, build_tree_list (get_identifier (buffer), TREE_VALUE (carg))); } args = chainon (args, end_params_node); /* Create the method */ ! mdecl = create_artificial_method (class, ACC_STATIC, TREE_TYPE (TREE_TYPE (decl)), id, args); layout_class_method (class, NULL_TREE, mdecl, NULL_TREE); /* There is a potential bug here. We should be able to use *************** build_outer_method_access_method (decl) *** 8506,8515 **** call_args = tree_cons (NULL_TREE, build_wfl_node (TREE_PURPOSE (carg)), call_args); ! body = build_method_invocation (build_wfl_node (DECL_NAME (decl)), call_args); if (!METHOD_STATIC (decl)) ! body = make_qualified_primary (build_wfl_node (TREE_PURPOSE (args)), body, 0); if (TREE_TYPE (TREE_TYPE (decl)) != void_type_node) body = build_return (0, body); --- 8552,8561 ---- call_args = tree_cons (NULL_TREE, build_wfl_node (TREE_PURPOSE (carg)), call_args); ! body = build_method_invocation (build_wfl_node (DECL_NAME (decl)), call_args); if (!METHOD_STATIC (decl)) ! body = make_qualified_primary (build_wfl_node (TREE_PURPOSE (args)), body, 0); if (TREE_TYPE (TREE_TYPE (decl)) != void_type_node) body = build_return (0, body); *************** build_outer_method_access_method (decl) *** 8529,8535 **** the enclosing instance of an inner class. The enclosing instance is kept in a generated field called this$, with being the inner class nesting level (starting from 0.) */ ! /* Build an access to a given this$, always chaining access call to others. Access methods to this$ are build on the fly if necessary. This CAN'T be used to solely access this$ from --- 8575,8581 ---- the enclosing instance of an inner class. The enclosing instance is kept in a generated field called this$, with being the inner class nesting level (starting from 0.) */ ! /* Build an access to a given this$, always chaining access call to others. Access methods to this$ are build on the fly if necessary. This CAN'T be used to solely access this$ from *************** build_access_to_thisn (from, to, lc) *** 8575,8581 **** /* Build an access function to the this$ local to TYPE. NULL_TREE is returned if nothing needs to be generated. Otherwise, the method ! generated and a method decl is returned. NOTE: These generated methods should be declared in a class file attribute so that they can't be referred to directly. */ --- 8621,8627 ---- /* Build an access function to the this$ local to TYPE. NULL_TREE is returned if nothing needs to be generated. Otherwise, the method ! generated and a method decl is returned. NOTE: These generated methods should be declared in a class file attribute so that they can't be referred to directly. */ *************** maybe_build_thisn_access_method (type) *** 8603,8609 **** fix_method_argument_names (args, mdecl); layout_class_method (type, NULL_TREE, mdecl, NULL_TREE); stmt = build_current_thisn (type); ! stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (stmt), 0); stmt = build_return (0, stmt); --- 8649,8655 ---- fix_method_argument_names (args, mdecl); layout_class_method (type, NULL_TREE, mdecl, NULL_TREE); stmt = build_current_thisn (type); ! stmt = make_qualified_primary (build_wfl_node (inst_id), build_wfl_node (stmt), 0); stmt = build_return (0, stmt); *************** maybe_build_thisn_access_method (type) *** 8623,8659 **** This function can be invoked with TYPE to NULL, available and then has to count the parser context. */ static tree build_current_thisn (type) tree type; { static int saved_i = -1; - static tree saved_thisn = NULL_TREE; - static tree saved_type = NULL_TREE; static int saved_type_i = 0; - static int initialized_p; tree decl; char buffer [24]; int i = 0; - /* Register SAVED_THISN and SAVED_TYPE with the garbage collector. */ - if (!initialized_p) - { - ggc_add_tree_root (&saved_thisn, 1); - ggc_add_tree_root (&saved_type, 1); - initialized_p = 1; - } - if (type) { if (type == saved_type) i = saved_type_i; else { ! for (i = -1, decl = DECL_CONTEXT (TYPE_NAME (type)); decl; decl = DECL_CONTEXT (decl), i++) ; ! saved_type = type; saved_type_i = i; } --- 8669,8697 ---- This function can be invoked with TYPE to NULL, available and then has to count the parser context. */ + static GTY(()) tree saved_thisn; + static GTY(()) tree saved_type; + static tree build_current_thisn (type) tree type; { static int saved_i = -1; static int saved_type_i = 0; tree decl; char buffer [24]; int i = 0; if (type) { if (type == saved_type) i = saved_type_i; else { ! for (i = -1, decl = DECL_CONTEXT (TYPE_NAME (type)); decl; decl = DECL_CONTEXT (decl), i++) ; ! saved_type = type; saved_type_i = i; } *************** build_current_thisn (type) *** 8663,8669 **** if (i == saved_i) return saved_thisn; ! sprintf (buffer, "this$%d", i); saved_i = i; saved_thisn = get_identifier (buffer); --- 8701,8707 ---- if (i == saved_i) return saved_thisn; ! sprintf (buffer, "this$%d", i); saved_i = i; saved_thisn = get_identifier (buffer); *************** build_thisn_assign () *** 8700,8705 **** --- 8738,8746 ---- throw new NoClassDefFoundError(e.getMessage());} } */ + static GTY(()) tree get_message_wfl; + static GTY(()) tree type_parm_wfl; + static tree build_dot_class_method (class) tree class; *************** build_dot_class_method (class) *** 8709,8722 **** tree args, tmp, saved_current_function_decl, mdecl; tree stmt, throw_stmt; - static tree get_message_wfl, type_parm_wfl; - if (!get_message_wfl) { get_message_wfl = build_wfl_node (get_identifier ("getMessage")); type_parm_wfl = build_wfl_node (get_identifier ("type$")); - ggc_add_tree_root (&get_message_wfl, 1); - ggc_add_tree_root (&type_parm_wfl, 1); } /* Build the arguments */ --- 8750,8759 ---- *************** build_dot_class_method (class) *** 8725,8756 **** TREE_CHAIN (args) = end_params_node; /* Build the qualified name java.lang.Class.forName */ ! tmp = MQN (MQN (MQN (BWF ("java"), BWF ("lang")), BWF ("Class")), BWF ("forName")); load_class (class_not_found_type_node, 1); load_class (no_class_def_found_type_node, 1); ! /* Create the "class$" function */ ! mdecl = create_artificial_method (class, ACC_STATIC, build_pointer_type (class_type_node), classdollar_identifier_node, args); ! DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, no_class_def_found_type_node); /* We start by building the try block. We need to build: return (java.lang.Class.forName (type)); */ ! stmt = build_method_invocation (tmp, build_tree_list (NULL_TREE, type_parm_wfl)); stmt = build_return (0, stmt); /* Now onto the catch block. We start by building the expression throwing a new exception: throw new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = make_qualified_name (build_wfl_node (wpv_id), get_message_wfl, 0); throw_stmt = build_method_invocation (throw_stmt, NULL_TREE); ! /* Build new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = build_new_invocation (build_wfl_node (get_identifier ("NoClassDefFoundError")), build_tree_list (build_pointer_type (string_type_node), throw_stmt)); --- 8762,8793 ---- TREE_CHAIN (args) = end_params_node; /* Build the qualified name java.lang.Class.forName */ ! tmp = MQN (MQN (MQN (BWF ("java"), BWF ("lang")), BWF ("Class")), BWF ("forName")); load_class (class_not_found_type_node, 1); load_class (no_class_def_found_type_node, 1); ! /* Create the "class$" function */ ! mdecl = create_artificial_method (class, ACC_STATIC, build_pointer_type (class_type_node), classdollar_identifier_node, args); ! DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, no_class_def_found_type_node); /* We start by building the try block. We need to build: return (java.lang.Class.forName (type)); */ ! stmt = build_method_invocation (tmp, build_tree_list (NULL_TREE, type_parm_wfl)); stmt = build_return (0, stmt); /* Now onto the catch block. We start by building the expression throwing a new exception: throw new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = make_qualified_name (build_wfl_node (wpv_id), get_message_wfl, 0); throw_stmt = build_method_invocation (throw_stmt, NULL_TREE); ! /* Build new NoClassDefFoundError (_.getMessage) */ ! throw_stmt = build_new_invocation (build_wfl_node (get_identifier ("NoClassDefFoundError")), build_tree_list (build_pointer_type (string_type_node), throw_stmt)); *************** build_dot_class_method_invocation (type) *** 8788,8794 **** sig_id = unmangle_classname (IDENTIFIER_POINTER (sig_id), IDENTIFIER_LENGTH (sig_id)); ! s = build_string (IDENTIFIER_LENGTH (sig_id), IDENTIFIER_POINTER (sig_id)); return build_method_invocation (build_wfl_node (classdollar_identifier_node), build_tree_list (NULL_TREE, s)); --- 8825,8831 ---- sig_id = unmangle_classname (IDENTIFIER_POINTER (sig_id), IDENTIFIER_LENGTH (sig_id)); ! s = build_string (IDENTIFIER_LENGTH (sig_id), IDENTIFIER_POINTER (sig_id)); return build_method_invocation (build_wfl_node (classdollar_identifier_node), build_tree_list (NULL_TREE, s)); *************** fix_constructors (mdecl) *** 8825,8841 **** const char *n = IDENTIFIER_POINTER (DECL_NAME (sclass_decl)); DECL_NAME (mdecl) = DECL_NAME (sclass_decl); parse_error_context ! (lookup_cl (TYPE_NAME (class_type)), "No constructor matching `%s' found in class `%s'", lang_printable_name (mdecl, 0), n); DECL_NAME (mdecl) = save; } ! /* The constructor body must be crafted by hand. It's the constructor we defined when we realize we didn't have the CLASSNAME() constructor */ start_artificial_method_body (mdecl); ! /* Insert an assignment to the this$ hidden field, if necessary */ if ((thisn_assign = build_thisn_assign ())) --- 8862,8878 ---- const char *n = IDENTIFIER_POINTER (DECL_NAME (sclass_decl)); DECL_NAME (mdecl) = DECL_NAME (sclass_decl); parse_error_context ! (lookup_cl (TYPE_NAME (class_type)), "No constructor matching `%s' found in class `%s'", lang_printable_name (mdecl, 0), n); DECL_NAME (mdecl) = save; } ! /* The constructor body must be crafted by hand. It's the constructor we defined when we realize we didn't have the CLASSNAME() constructor */ start_artificial_method_body (mdecl); ! /* Insert an assignment to the this$ hidden field, if necessary */ if ((thisn_assign = build_thisn_assign ())) *************** fix_constructors (mdecl) *** 8853,8865 **** end_artificial_method_body (mdecl); } /* Search for an explicit constructor invocation */ ! else { int found = 0; int invokes_this = 0; tree found_call = NULL_TREE; tree main_block = BLOCK_EXPR_BODY (body); ! while (body) switch (TREE_CODE (body)) { --- 8890,8902 ---- end_artificial_method_body (mdecl); } /* Search for an explicit constructor invocation */ ! else { int found = 0; int invokes_this = 0; tree found_call = NULL_TREE; tree main_block = BLOCK_EXPR_BODY (body); ! while (body) switch (TREE_CODE (body)) { *************** fix_constructors (mdecl) *** 8899,8905 **** TREE_OPERAND (found_call, 0)); TREE_OPERAND (found_call, 0) = empty_stmt_node; } ! DECL_INIT_CALLS_THIS (mdecl) = invokes_this; /* Insert the instance initializer block right after. */ --- 8936,8942 ---- TREE_OPERAND (found_call, 0)); TREE_OPERAND (found_call, 0) = empty_stmt_node; } ! DECL_INIT_CALLS_THIS (mdecl) = invokes_this; /* Insert the instance initializer block right after. */ *************** verify_constructor_super (mdecl) *** 8943,8954 **** tree arg_type = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (sdecl))); if (super_inner) arg_type = TREE_CHAIN (arg_type); ! for (m_arg_type = mdecl_arg_type; ! (arg_type != end_params_node && m_arg_type != end_params_node); ! arg_type = TREE_CHAIN (arg_type), m_arg_type = TREE_CHAIN (m_arg_type)) ! if (!valid_method_invocation_conversion_p (TREE_VALUE (arg_type), TREE_VALUE (m_arg_type))) break; --- 8980,8991 ---- tree arg_type = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (sdecl))); if (super_inner) arg_type = TREE_CHAIN (arg_type); ! for (m_arg_type = mdecl_arg_type; ! (arg_type != end_params_node && m_arg_type != end_params_node); ! arg_type = TREE_CHAIN (arg_type), m_arg_type = TREE_CHAIN (m_arg_type)) ! if (!valid_method_invocation_conversion_p (TREE_VALUE (arg_type), TREE_VALUE (m_arg_type))) break; *************** verify_constructor_super (mdecl) *** 8973,8978 **** --- 9010,9016 ---- /* Generate code for all context remembered for code generation. */ + static GTY(()) tree reversed_class_list; void java_expand_classes () { *************** java_expand_classes () *** 9023,9033 **** } } /* If we've found error at that stage, don't try to generate anything, unless we're emitting xrefs or checking the syntax only (but not using -fsyntax-only for the purpose of generating bytecode. */ ! if (java_error_count && !flag_emit_xref && (!flag_syntax_only && !flag_emit_class_files)) return; --- 9061,9130 ---- } } + /* Expanding the constructors of anonymous classes generates access + methods. Scan all the methods looking for null DECL_RESULTs -- + this will be the case if a method hasn't been expanded. */ + for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) + { + tree current; + ctxp = cur_ctxp; + for (current = ctxp->class_list; current; current = TREE_CHAIN (current)) + { + tree d; + current_class = TREE_TYPE (current); + for (d = TYPE_METHODS (current_class); d; d = TREE_CHAIN (d)) + { + if (DECL_RESULT (d) == NULL_TREE) + { + restore_line_number_status (1); + java_complete_expand_method (d); + restore_line_number_status (0); + } + } + } + } + + /* ??? Instead of all this we could iterate around the list of + classes until there were no more un-expanded methods. It would + take a little longer -- one pass over the whole list of methods + -- but it would be simpler. Like this: */ + #if 0 + { + int something_changed; + + do + { + something_changed = 0; + for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) + { + tree current; + ctxp = cur_ctxp; + for (current = ctxp->class_list; current; current = TREE_CHAIN (current)) + { + tree d; + current_class = TREE_TYPE (current); + for (d = TYPE_METHODS (current_class); d; d = TREE_CHAIN (d)) + { + if (DECL_RESULT (d) == NULL_TREE) + { + something_changed = 1; + restore_line_number_status (1); + java_complete_expand_method (d); + restore_line_number_status (0); + } + } + } + } + } + while (something_changed); + } + #endif + /* If we've found error at that stage, don't try to generate anything, unless we're emitting xrefs or checking the syntax only (but not using -fsyntax-only for the purpose of generating bytecode. */ ! if (java_error_count && !flag_emit_xref && (!flag_syntax_only && !flag_emit_class_files)) return; *************** java_expand_classes () *** 9054,9060 **** for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) { tree current; ! tree reversed_class_list = NULL; ctxp = cur_ctxp; --- 9151,9157 ---- for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next) { tree current; ! reversed_class_list = NULL; ctxp = cur_ctxp; *************** java_expand_classes () *** 9066,9080 **** situation, the compiler cannot fall back to the original source, having already read the outer class, so we must prevent that situation. */ ! for (current = ctxp->class_list; ! current; current = TREE_CHAIN (current)) reversed_class_list = tree_cons (NULL_TREE, current, reversed_class_list); - ggc_add_tree_root (&reversed_class_list, 1); ! for (current = reversed_class_list; ! current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); --- 9163,9176 ---- situation, the compiler cannot fall back to the original source, having already read the outer class, so we must prevent that situation. */ ! for (current = ctxp->class_list; ! current; current = TREE_CHAIN (current)) reversed_class_list = tree_cons (NULL_TREE, current, reversed_class_list); ! for (current = reversed_class_list; ! current; current = TREE_CHAIN (current)) { current_class = TREE_TYPE (TREE_VALUE (current)); *************** java_expand_classes () *** 9089,9096 **** finish_class (); } } - - ggc_del_root (&reversed_class_list); } } --- 9185,9190 ---- *************** make_qualified_name (left, right, locati *** 9177,9183 **** EXPR_WFL_LINECOL (wfl) = EXPR_WFL_LINECOL (left); EXPR_WFL_QUALIFICATION (left) = build_tree_list (wfl, NULL_TREE); } ! wfl = build_expr_wfl (right_id, ctxp->filename, 0, 0); EXPR_WFL_LINECOL (wfl) = location; chainon (EXPR_WFL_QUALIFICATION (left), build_tree_list (wfl, NULL_TREE)); --- 9271,9277 ---- EXPR_WFL_LINECOL (wfl) = EXPR_WFL_LINECOL (left); EXPR_WFL_QUALIFICATION (left) = build_tree_list (wfl, NULL_TREE); } ! wfl = build_expr_wfl (right_id, ctxp->filename, 0, 0); EXPR_WFL_LINECOL (wfl) = location; chainon (EXPR_WFL_QUALIFICATION (left), build_tree_list (wfl, NULL_TREE)); *************** resolve_expression_name (id, orig) *** 9227,9233 **** return decl; /* 15.13.1: NAME can appear within a class declaration */ ! else { decl = lookup_field_wrapper (current_class, name); if (decl) --- 9321,9327 ---- return decl; /* 15.13.1: NAME can appear within a class declaration */ ! else { decl = lookup_field_wrapper (current_class, name); if (decl) *************** resolve_expression_name (id, orig) *** 9302,9314 **** /* We've got an error here */ if (INNER_CLASS_TYPE_P (current_class)) ! parse_error_context (id, "Local variable `%s' can't be accessed from within the inner class `%s' unless it is declared final", IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); else ! parse_error_context (id, "Undefined variable `%s'", IDENTIFIER_POINTER (name)); return error_mark_node; --- 9396,9408 ---- /* We've got an error here */ if (INNER_CLASS_TYPE_P (current_class)) ! parse_error_context (id, "Local variable `%s' can't be accessed from within the inner class `%s' unless it is declared final", IDENTIFIER_POINTER (name), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); else ! parse_error_context (id, "Undefined variable `%s'", IDENTIFIER_POINTER (name)); return error_mark_node; *************** static void *** 9318,9327 **** static_ref_err (wfl, field_id, class_type) tree wfl, field_id, class_type; { ! parse_error_context ! (wfl, "Can't make a static reference to nonstatic variable `%s' in class `%s'", ! IDENTIFIER_POINTER (field_id), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class_type)))); } --- 9412,9421 ---- static_ref_err (wfl, field_id, class_type) tree wfl, field_id, class_type; { ! parse_error_context ! (wfl, "Can't make a static reference to nonstatic variable `%s' in class `%s'", ! IDENTIFIER_POINTER (field_id), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (class_type)))); } *************** resolve_field_access (qual_wfl, field_de *** 9344,9351 **** return error_mark_node; /* Resolve the LENGTH field of an array here */ ! if (DECL_P (decl) && DECL_NAME (decl) == length_identifier_node ! && type_found && TYPE_ARRAY_P (type_found) && ! flag_emit_class_files && ! flag_emit_xref) { tree length = build_java_array_length_access (where_found); --- 9438,9445 ---- return error_mark_node; /* Resolve the LENGTH field of an array here */ ! if (DECL_P (decl) && DECL_NAME (decl) == length_identifier_node ! && type_found && TYPE_ARRAY_P (type_found) && ! flag_emit_class_files && ! flag_emit_xref) { tree length = build_java_array_length_access (where_found); *************** resolve_field_access (qual_wfl, field_de *** 9372,9384 **** if (!type_found) type_found = DECL_CONTEXT (decl); is_static = FIELD_STATIC (decl); ! field_ref = build_field_ref ((is_static && !flag_emit_xref? ! NULL_TREE : where_found), type_found, DECL_NAME (decl)); if (field_ref == error_mark_node) return error_mark_node; if (is_static) field_ref = maybe_build_class_init_for_field (decl, field_ref); } else field_ref = decl; --- 9466,9491 ---- if (!type_found) type_found = DECL_CONTEXT (decl); is_static = FIELD_STATIC (decl); ! field_ref = build_field_ref ((is_static && !flag_emit_xref? ! NULL_TREE : where_found), type_found, DECL_NAME (decl)); if (field_ref == error_mark_node) return error_mark_node; if (is_static) field_ref = maybe_build_class_init_for_field (decl, field_ref); + + /* If we're looking at a static field, we may need to generate a + class initialization for it. This can happen when the access + looks like `field.ref', where `field' is a static field in an + interface we implement. */ + if (!flag_emit_class_files + && !flag_emit_xref + && TREE_CODE (where_found) == VAR_DECL + && FIELD_STATIC (where_found)) + { + build_static_field_ref (where_found); + field_ref = build_class_init (DECL_CONTEXT (where_found), field_ref); + } } else field_ref = decl; *************** resolve_field_access (qual_wfl, field_de *** 9386,9392 **** if (field_decl) *field_decl = decl; if (field_type) ! *field_type = (QUAL_DECL_TYPE (decl) ? QUAL_DECL_TYPE (decl) : TREE_TYPE (decl)); return field_ref; } --- 9493,9499 ---- if (field_decl) *field_decl = decl; if (field_type) ! *field_type = (QUAL_DECL_TYPE (decl) ? QUAL_DECL_TYPE (decl) : TREE_TYPE (decl)); return field_ref; } *************** resolve_qualified_expression_name (wfl, *** 9430,9436 **** int is_static; tree decl = NULL_TREE, type = NULL_TREE, q; /* For certain for of inner class instantiation */ ! tree saved_current, saved_this; #define RESTORE_THIS_AND_CURRENT_CLASS \ { current_class = saved_current; current_this = saved_this;} --- 9537,9543 ---- int is_static; tree decl = NULL_TREE, type = NULL_TREE, q; /* For certain for of inner class instantiation */ ! tree saved_current, saved_this; #define RESTORE_THIS_AND_CURRENT_CLASS \ { current_class = saved_current; current_this = saved_this;} *************** resolve_qualified_expression_name (wfl, *** 9451,9457 **** build the code to access it. */ if (JDECL_P (decl) && !FIELD_STATIC (decl)) { ! decl = maybe_access_field (decl, *where_found, DECL_CONTEXT (decl)); if (decl == error_mark_node) return 1; --- 9558,9564 ---- build the code to access it. */ if (JDECL_P (decl) && !FIELD_STATIC (decl)) { ! decl = maybe_access_field (decl, *where_found, DECL_CONTEXT (decl)); if (decl == error_mark_node) return 1; *************** resolve_qualified_expression_name (wfl, *** 9467,9473 **** saved and restored shortly after */ saved_current = current_class; saved_this = current_this; ! if (decl && (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR || from_qualified_this)) { --- 9574,9580 ---- saved and restored shortly after */ saved_current = current_class; saved_this = current_this; ! if (decl && (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR || from_qualified_this)) { *************** resolve_qualified_expression_name (wfl, *** 9499,9510 **** } *type_found = type = QUAL_DECL_TYPE (*where_found); /* If we're creating an inner class instance, check for that an enclosing instance is in scope */ if (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR && INNER_ENCLOSING_SCOPE_CHECK (type)) { ! parse_error_context (qual_wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (type, 0), (!current_this ? "" : --- 9606,9619 ---- } *type_found = type = QUAL_DECL_TYPE (*where_found); + *where_found = force_evaluation_order (*where_found); + /* If we're creating an inner class instance, check for that an enclosing instance is in scope */ if (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR && INNER_ENCLOSING_SCOPE_CHECK (type)) { ! parse_error_context (qual_wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (type, 0), (!current_this ? "" : *************** resolve_qualified_expression_name (wfl, *** 9518,9525 **** RESTORE_THIS_AND_CURRENT_CLASS; /* EH check. No check on access$ functions */ ! if (location ! && !OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl))) check_thrown_exceptions (location, ret_decl); --- 9627,9634 ---- RESTORE_THIS_AND_CURRENT_CLASS; /* EH check. No check on access$ functions */ ! if (location ! && !OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl))) check_thrown_exceptions (location, ret_decl); *************** resolve_qualified_expression_name (wfl, *** 9613,9619 **** { if (!current_this) { ! parse_error_context (wfl, "Keyword `this' used outside allowed context"); return 1; } --- 9722,9728 ---- { if (!current_this) { ! parse_error_context (wfl, "Keyword `this' used outside allowed context"); return 1; } *************** resolve_qualified_expression_name (wfl, *** 9636,9643 **** if (!enclosing_context_p (type, current_class)) { char *p = xstrdup (lang_printable_name (type, 0)); ! parse_error_context (qual_wfl, "Can't use variable `%s.this': type `%s' isn't an outer type of type `%s'", ! p, p, lang_printable_name (current_class, 0)); free (p); return 1; --- 9745,9752 ---- if (!enclosing_context_p (type, current_class)) { char *p = xstrdup (lang_printable_name (type, 0)); ! parse_error_context (qual_wfl, "Can't use variable `%s.this': type `%s' isn't an outer type of type `%s'", ! p, p, lang_printable_name (current_class, 0)); free (p); return 1; *************** resolve_qualified_expression_name (wfl, *** 9668,9679 **** if (METHOD_STATIC (current_function_decl) || current_class == object_type_node) { ! parse_error_context (wfl, "Keyword `super' used outside allowed context"); return 1; } /* Otherwise, treat SUPER as (SUPER_CLASS)THIS */ ! node = build_cast (EXPR_WFL_LINECOL (qual_wfl), CLASSTYPE_SUPER (current_class), build_this (EXPR_WFL_LINECOL (qual_wfl))); *where_found = decl = java_complete_tree (node); --- 9777,9788 ---- if (METHOD_STATIC (current_function_decl) || current_class == object_type_node) { ! parse_error_context (wfl, "Keyword `super' used outside allowed context"); return 1; } /* Otherwise, treat SUPER as (SUPER_CLASS)THIS */ ! node = build_cast (EXPR_WFL_LINECOL (qual_wfl), CLASSTYPE_SUPER (current_class), build_this (EXPR_WFL_LINECOL (qual_wfl))); *where_found = decl = java_complete_tree (node); *************** resolve_qualified_expression_name (wfl, *** 9715,9721 **** else { if (from_super || from_cast) ! parse_error_context ((from_cast ? qual_wfl : wfl), "No variable `%s' defined in class `%s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), --- 9824,9830 ---- else { if (from_super || from_cast) ! parse_error_context ((from_cast ? qual_wfl : wfl), "No variable `%s' defined in class `%s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), *************** resolve_qualified_expression_name (wfl, *** 9737,9743 **** /* Sneak preview. If next we see a `new', we're facing a qualification with resulted in a type being selected instead of a field. Report the error */ ! if(TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR) { parse_error_context (qual_wfl, "Undefined variable `%s'", --- 9846,9852 ---- /* Sneak preview. If next we see a `new', we're facing a qualification with resulted in a type being selected instead of a field. Report the error */ ! if(TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR) { parse_error_context (qual_wfl, "Undefined variable `%s'", *************** resolve_qualified_expression_name (wfl, *** 9747,9753 **** if (not_accessible_p (TREE_TYPE (decl), decl, type, 0)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", java_accstring_lookup (get_access_flags_from_decl (decl)), GET_TYPE_NAME (type), --- 9856,9862 ---- if (not_accessible_p (TREE_TYPE (decl), decl, type, 0)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", java_accstring_lookup (get_access_flags_from_decl (decl)), GET_TYPE_NAME (type), *************** resolve_qualified_expression_name (wfl, *** 9761,9767 **** from_type = 1; } /* We resolve an expression name */ ! else { tree field_decl = NULL_TREE; --- 9870,9876 ---- from_type = 1; } /* We resolve an expression name */ ! else { tree field_decl = NULL_TREE; *************** resolve_qualified_expression_name (wfl, *** 9819,9832 **** if (!from_type && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `%s' in `%s %s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), lang_printable_name (type, 0), IDENTIFIER_POINTER (DECL_NAME (decl))); return 1; } ! field_decl = lookup_field_wrapper (type, EXPR_WFL_NODE (qual_wfl)); --- 9928,9941 ---- if (!from_type && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `%s' in `%s %s'", IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), lang_printable_name (type, 0), IDENTIFIER_POINTER (DECL_NAME (decl))); return 1; } ! field_decl = lookup_field_wrapper (type, EXPR_WFL_NODE (qual_wfl)); *************** resolve_qualified_expression_name (wfl, *** 9840,9846 **** inner_decl = resolve_class (decl, ptr, NULL_TREE, qual_wfl); if (inner_decl) { ! check_inner_class_access (inner_decl, decl, qual_wfl); type = TREE_TYPE (inner_decl); decl = inner_decl; from_type = 1; --- 9949,9955 ---- inner_decl = resolve_class (decl, ptr, NULL_TREE, qual_wfl); if (inner_decl) { ! check_inner_class_access (inner_decl, decl, qual_wfl); type = TREE_TYPE (inner_decl); decl = inner_decl; from_type = 1; *************** resolve_qualified_expression_name (wfl, *** 9850,9858 **** if (field_decl == NULL_TREE) { ! parse_error_context (qual_wfl, "No variable `%s' defined in type `%s'", ! IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), GET_TYPE_NAME (type)); return 1; } --- 9959,9967 ---- if (field_decl == NULL_TREE) { ! parse_error_context (qual_wfl, "No variable `%s' defined in type `%s'", ! IDENTIFIER_POINTER (EXPR_WFL_NODE (qual_wfl)), GET_TYPE_NAME (type)); return 1; } *************** resolve_qualified_expression_name (wfl, *** 9867,9903 **** field_decl_type = TREE_TYPE (TREE_TYPE (field_decl)); else field_decl_type = TREE_TYPE (field_decl); ! if (!JPRIMITIVE_TYPE_P (field_decl_type) && !CLASS_LOADED_P (field_decl_type) && !TYPE_ARRAY_P (field_decl_type)) resolve_and_layout (field_decl_type, NULL_TREE); ! /* Check on accessibility here */ if (not_accessible_p (current_class, field_decl, DECL_CONTEXT (field_decl), from_super)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", ! java_accstring_lookup (get_access_flags_from_decl (field_decl)), GET_TYPE_NAME (type), IDENTIFIER_POINTER (DECL_NAME (field_decl)), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); return 1; } check_deprecation (qual_wfl, field_decl); ! /* There are things to check when fields are accessed from type. There are no restrictions on a static declaration of the field when it is accessed from an interface */ is_static = FIELD_STATIC (field_decl); ! if (!from_super && from_type ! && !TYPE_INTERFACE_P (type) ! && !is_static ! && (current_function_decl && METHOD_STATIC (current_function_decl))) { static_ref_err (qual_wfl, EXPR_WFL_NODE (qual_wfl), type); --- 9976,10012 ---- field_decl_type = TREE_TYPE (TREE_TYPE (field_decl)); else field_decl_type = TREE_TYPE (field_decl); ! if (!JPRIMITIVE_TYPE_P (field_decl_type) && !CLASS_LOADED_P (field_decl_type) && !TYPE_ARRAY_P (field_decl_type)) resolve_and_layout (field_decl_type, NULL_TREE); ! /* Check on accessibility here */ if (not_accessible_p (current_class, field_decl, DECL_CONTEXT (field_decl), from_super)) { ! parse_error_context (qual_wfl, "Can't access %s field `%s.%s' from `%s'", ! java_accstring_lookup (get_access_flags_from_decl (field_decl)), GET_TYPE_NAME (type), IDENTIFIER_POINTER (DECL_NAME (field_decl)), ! IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); return 1; } check_deprecation (qual_wfl, field_decl); ! /* There are things to check when fields are accessed from type. There are no restrictions on a static declaration of the field when it is accessed from an interface */ is_static = FIELD_STATIC (field_decl); ! if (!from_super && from_type ! && !TYPE_INTERFACE_P (type) ! && !is_static ! && (current_function_decl && METHOD_STATIC (current_function_decl))) { static_ref_err (qual_wfl, EXPR_WFL_NODE (qual_wfl), type); *************** resolve_qualified_expression_name (wfl, *** 9942,9952 **** /* Sneak preview. If decl is qualified by a `new', report the error here to be accurate on the peculiar construct */ ! if (TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `new' in a `%s'", lang_printable_name (type, 0)); return 1; } --- 10051,10061 ---- /* Sneak preview. If decl is qualified by a `new', report the error here to be accurate on the peculiar construct */ ! if (TREE_CHAIN (q) && TREE_CODE (TREE_PURPOSE (TREE_CHAIN (q))) == NEW_CLASS_EXPR && !JREFERENCE_TYPE_P (type)) { ! parse_error_context (qual_wfl, "Attempt to reference field `new' in a `%s'", lang_printable_name (type, 0)); return 1; } *************** not_accessible_p (reference, member, whe *** 9982,9988 **** /* Access always granted for members declared public */ if (access_flag & ACC_PUBLIC) return 0; ! /* Check access on protected members */ if (access_flag & ACC_PROTECTED) { --- 10091,10097 ---- /* Access always granted for members declared public */ if (access_flag & ACC_PUBLIC) return 0; ! /* Check access on protected members */ if (access_flag & ACC_PROTECTED) { *************** check_deprecation (wfl, decl) *** 10050,10056 **** /* Complain if the field is deprecated and the file it was defined in isn't compiled at the same time the file which contains its use is */ ! if (DECL_DEPRECATED (decl) && !IS_A_COMMAND_LINE_FILENAME_P (get_identifier (file))) { char the [20]; --- 10159,10165 ---- /* Complain if the field is deprecated and the file it was defined in isn't compiled at the same time the file which contains its use is */ ! if (DECL_DEPRECATED (decl) && !IS_A_COMMAND_LINE_FILENAME_P (get_identifier (file))) { char the [20]; *************** check_deprecation (wfl, decl) *** 10073,10080 **** /* Don't issue a message if the context as been deprecated as a whole. */ if (! CLASS_DEPRECATED (TYPE_NAME (DECL_CONTEXT (decl)))) ! parse_warning_context ! (wfl, "The %s `%s' in class `%s' has been deprecated", the, lang_printable_name (decl, 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))))); } --- 10182,10189 ---- /* Don't issue a message if the context as been deprecated as a whole. */ if (! CLASS_DEPRECATED (TYPE_NAME (DECL_CONTEXT (decl)))) ! parse_warning_context ! (wfl, "The %s `%s' in class `%s' has been deprecated", the, lang_printable_name (decl, 0), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))))); } *************** check_deprecation (wfl, decl) *** 10082,10096 **** /* Returns 1 if class was declared in the current package, 0 otherwise */ static int class_in_current_package (class) tree class; { - static tree cache = NULL_TREE; int qualified_flag; tree left; ! if (cache == class) return 1; qualified_flag = QUALIFIED_P (DECL_NAME (TYPE_NAME (class))); --- 10191,10205 ---- /* Returns 1 if class was declared in the current package, 0 otherwise */ + static GTY(()) tree cicp_cache; static int class_in_current_package (class) tree class; { int qualified_flag; tree left; ! if (cicp_cache == class) return 1; qualified_flag = QUALIFIED_P (DECL_NAME (TYPE_NAME (class))); *************** class_in_current_package (class) *** 10111,10125 **** breakdown_qualified (&left, NULL, DECL_NAME (TYPE_NAME (class))); if (ctxp->package == left) { ! static int initialized_p; ! /* Register CACHE with the garbage collector. */ ! if (!initialized_p) ! { ! ggc_add_tree_root (&cache, 1); ! initialized_p = 1; ! } ! ! cache = class; return 1; } return 0; --- 10220,10226 ---- breakdown_qualified (&left, NULL, DECL_NAME (TYPE_NAME (class))); if (ctxp->package == left) { ! cicp_cache = class; return 1; } return 0; *************** maybe_access_field (decl, where, type) *** 10134,10140 **** { if (TREE_CODE (decl) == FIELD_DECL && decl != current_this && !FIELD_STATIC (decl)) ! decl = build_field_ref (where ? where : current_this, (type ? type : DECL_CONTEXT (decl)), DECL_NAME (decl)); return decl; --- 10235,10241 ---- { if (TREE_CODE (decl) == FIELD_DECL && decl != current_this && !FIELD_STATIC (decl)) ! decl = build_field_ref (where ? where : current_this, (type ? type : DECL_CONTEXT (decl)), DECL_NAME (decl)); return decl; *************** patch_method_invocation (patch, primary, *** 10160,10166 **** int is_super_init = 0; tree this_arg = NULL_TREE; int is_array_clone_call = 0; ! /* Should be overriden if everything goes well. Otherwise, if something fails, it should keep this value. It stop the evaluation of a bogus assignment. See java_complete_tree, --- 10261,10267 ---- int is_super_init = 0; tree this_arg = NULL_TREE; int is_array_clone_call = 0; ! /* Should be overriden if everything goes well. Otherwise, if something fails, it should keep this value. It stop the evaluation of a bogus assignment. See java_complete_tree, *************** patch_method_invocation (patch, primary, *** 10183,10196 **** data during error report. */ identifier_wfl = cut_identifier_in_qualified (wfl); identifier = EXPR_WFL_NODE (identifier_wfl); ! /* Given the context, IDENTIFIER is syntactically qualified as a MethodName. We need to qualify what's before */ qualify_ambiguous_name (wfl); resolved = resolve_field_access (wfl, NULL, NULL); if (TREE_CODE (resolved) == VAR_DECL && FIELD_STATIC (resolved) ! && FIELD_FINAL (resolved) && !inherits_from_p (DECL_CONTEXT (resolved), current_class) && !flag_emit_class_files && !flag_emit_xref) resolved = build_class_init (DECL_CONTEXT (resolved), resolved); --- 10284,10297 ---- data during error report. */ identifier_wfl = cut_identifier_in_qualified (wfl); identifier = EXPR_WFL_NODE (identifier_wfl); ! /* Given the context, IDENTIFIER is syntactically qualified as a MethodName. We need to qualify what's before */ qualify_ambiguous_name (wfl); resolved = resolve_field_access (wfl, NULL, NULL); if (TREE_CODE (resolved) == VAR_DECL && FIELD_STATIC (resolved) ! && FIELD_FINAL (resolved) && !inherits_from_p (DECL_CONTEXT (resolved), current_class) && !flag_emit_class_files && !flag_emit_xref) resolved = build_class_init (DECL_CONTEXT (resolved), resolved); *************** patch_method_invocation (patch, primary, *** 10200,10213 **** type = GET_SKIP_TYPE (resolved); resolve_and_layout (type, NULL_TREE); ! if (JPRIMITIVE_TYPE_P (type)) { parse_error_context (identifier_wfl, "Can't invoke a method on primitive type `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); ! PATCH_METHOD_RETURN_ERROR (); } list = lookup_method_invoke (0, identifier_wfl, type, identifier, args); --- 10301,10314 ---- type = GET_SKIP_TYPE (resolved); resolve_and_layout (type, NULL_TREE); ! if (JPRIMITIVE_TYPE_P (type)) { parse_error_context (identifier_wfl, "Can't invoke a method on primitive type `%s'", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); ! PATCH_METHOD_RETURN_ERROR (); } list = lookup_method_invoke (0, identifier_wfl, type, identifier, args); *************** patch_method_invocation (patch, primary, *** 10221,10237 **** parse_error_context (identifier_wfl, "Can't make static reference to method `%s' in interface `%s'", ! IDENTIFIER_POINTER (identifier), IDENTIFIER_POINTER (name)); PATCH_METHOD_RETURN_ERROR (); } if (list && !METHOD_STATIC (list)) { char *fct_name = xstrdup (lang_printable_name (list, 0)); ! parse_error_context (identifier_wfl, "Can't make static reference to method `%s %s' in class `%s'", ! lang_printable_name (TREE_TYPE (TREE_TYPE (list)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); free (fct_name); PATCH_METHOD_RETURN_ERROR (); --- 10322,10338 ---- parse_error_context (identifier_wfl, "Can't make static reference to method `%s' in interface `%s'", ! IDENTIFIER_POINTER (identifier), IDENTIFIER_POINTER (name)); PATCH_METHOD_RETURN_ERROR (); } if (list && !METHOD_STATIC (list)) { char *fct_name = xstrdup (lang_printable_name (list, 0)); ! parse_error_context (identifier_wfl, "Can't make static reference to method `%s %s' in class `%s'", ! lang_printable_name (TREE_TYPE (TREE_TYPE (list)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); free (fct_name); PATCH_METHOD_RETURN_ERROR (); *************** patch_method_invocation (patch, primary, *** 10239,10248 **** } else this_arg = primary = resolved; ! if (TYPE_ARRAY_P (type) && identifier == get_identifier ("clone")) is_array_clone_call = 1; ! /* IDENTIFIER_WFL will be used to report any problem further */ wfl = identifier_wfl; } --- 10340,10349 ---- } else this_arg = primary = resolved; ! if (TYPE_ARRAY_P (type) && identifier == get_identifier ("clone")) is_array_clone_call = 1; ! /* IDENTIFIER_WFL will be used to report any problem further */ wfl = identifier_wfl; } *************** patch_method_invocation (patch, primary, *** 10252,10264 **** { tree class_to_search = NULL_TREE; int lc; /* Looking for Constructor */ ! /* We search constructor in their target class */ if (CALL_CONSTRUCTOR_P (patch)) { if (TREE_CODE (patch) == NEW_CLASS_EXPR) class_to_search = EXPR_WFL_NODE (wfl); ! else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == this_identifier_node) class_to_search = NULL_TREE; else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == --- 10353,10365 ---- { tree class_to_search = NULL_TREE; int lc; /* Looking for Constructor */ ! /* We search constructor in their target class */ if (CALL_CONSTRUCTOR_P (patch)) { if (TREE_CODE (patch) == NEW_CLASS_EXPR) class_to_search = EXPR_WFL_NODE (wfl); ! else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == this_identifier_node) class_to_search = NULL_TREE; else if (EXPR_WFL_NODE (TREE_OPERAND (patch, 0)) == *************** patch_method_invocation (patch, primary, *** 10266,10272 **** { is_super_init = 1; if (CLASSTYPE_SUPER (current_class)) ! class_to_search = DECL_NAME (TYPE_NAME (CLASSTYPE_SUPER (current_class))); else { --- 10367,10373 ---- { is_super_init = 1; if (CLASSTYPE_SUPER (current_class)) ! class_to_search = DECL_NAME (TYPE_NAME (CLASSTYPE_SUPER (current_class))); else { *************** patch_method_invocation (patch, primary, *** 10282,10300 **** if (!class_to_search) { ! parse_error_context (wfl, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); } ! /* Can't instantiate an abstract class, but we can invoke it's constructor. It's use within the `new' context is denied here. */ ! if (CLASS_ABSTRACT (class_to_search) && TREE_CODE (patch) == NEW_CLASS_EXPR) { ! parse_error_context (wfl, "Class `%s' is an abstract class. It can't be instantiated", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); --- 10383,10401 ---- if (!class_to_search) { ! parse_error_context (wfl, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); } ! /* Can't instantiate an abstract class, but we can invoke it's constructor. It's use within the `new' context is denied here. */ ! if (CLASS_ABSTRACT (class_to_search) && TREE_CODE (patch) == NEW_CLASS_EXPR) { ! parse_error_context (wfl, "Class `%s' is an abstract class. It can't be instantiated", IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl))); PATCH_METHOD_RETURN_ERROR (); *************** patch_method_invocation (patch, primary, *** 10346,10358 **** can't be executed then. */ if (!list) PATCH_METHOD_RETURN_ERROR (); ! if (TYPE_ARRAY_P (class_to_search) && DECL_NAME (list) == get_identifier ("clone")) is_array_clone_call = 1; /* Check for static reference if non static methods */ ! if (check_for_static_method_reference (wfl, patch, list, class_to_search, primary)) PATCH_METHOD_RETURN_ERROR (); --- 10447,10459 ---- can't be executed then. */ if (!list) PATCH_METHOD_RETURN_ERROR (); ! if (TYPE_ARRAY_P (class_to_search) && DECL_NAME (list) == get_identifier ("clone")) is_array_clone_call = 1; /* Check for static reference if non static methods */ ! if (check_for_static_method_reference (wfl, patch, list, class_to_search, primary)) PATCH_METHOD_RETURN_ERROR (); *************** patch_method_invocation (patch, primary, *** 10362,10368 **** && INNER_ENCLOSING_SCOPE_CHECK (class_to_search) && !DECL_INIT_P (current_function_decl)) { ! parse_error_context (wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (class_to_search, 0), (!current_this ? "" : --- 10463,10469 ---- && INNER_ENCLOSING_SCOPE_CHECK (class_to_search) && !DECL_INIT_P (current_function_decl)) { ! parse_error_context (wfl, "No enclosing instance for inner class `%s' is in scope%s", lang_printable_name (class_to_search, 0), (!current_this ? "" : *************** patch_method_invocation (patch, primary, *** 10390,10406 **** x(a1,...,an) into TYPE_OF(this$).x(a1,....an) 2) We're generating bytecodes: ! - LIST is non static. It's invocation is transformed from x(a1,....,an) into access$(this$,a1,...,an). - LIST is static. It's invocation is transformed from x(a1,....,an) into TYPE_OF(this$).x(a1,....an). Of course, this$ can be abitrary complex, ranging from ! this$0 (the immediate outer context) to ! access$0(access$0(...(this$0))). ! ! maybe_use_access_method returns a non zero value if the this_arg has to be moved into the (then generated) stub argument list. In the meantime, the selected function might have be replaced by a generated stub. */ --- 10491,10507 ---- x(a1,...,an) into TYPE_OF(this$).x(a1,....an) 2) We're generating bytecodes: ! - LIST is non static. It's invocation is transformed from x(a1,....,an) into access$(this$,a1,...,an). - LIST is static. It's invocation is transformed from x(a1,....,an) into TYPE_OF(this$).x(a1,....an). Of course, this$ can be abitrary complex, ranging from ! this$0 (the immediate outer context) to ! access$0(access$0(...(this$0))). ! ! maybe_use_access_method returns a nonzero value if the this_arg has to be moved into the (then generated) stub argument list. In the meantime, the selected function might have be replaced by a generated stub. */ *************** patch_method_invocation (patch, primary, *** 10415,10427 **** /* Merge point of all resolution schemes. If we have nothing, this is an error, already signaled */ ! if (!list) PATCH_METHOD_RETURN_ERROR (); /* Check accessibility, position the is_static flag, build and return the call */ if (not_accessible_p (DECL_CONTEXT (current_function_decl), list, ! (primary ? TREE_TYPE (TREE_TYPE (primary)) : NULL_TREE), from_super) /* Calls to clone() on array types are permitted as a special-case. */ && !is_array_clone_call) --- 10516,10528 ---- /* Merge point of all resolution schemes. If we have nothing, this is an error, already signaled */ ! if (!list) PATCH_METHOD_RETURN_ERROR (); /* Check accessibility, position the is_static flag, build and return the call */ if (not_accessible_p (DECL_CONTEXT (current_function_decl), list, ! (primary ? TREE_TYPE (TREE_TYPE (primary)) : NULL_TREE), from_super) /* Calls to clone() on array types are permitted as a special-case. */ && !is_array_clone_call) *************** patch_method_invocation (patch, primary, *** 10452,10458 **** /* If invoking a innerclass constructor, there are hidden parameters to pass */ ! if (TREE_CODE (patch) == NEW_CLASS_EXPR && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { /* And make sure we add the accessed local variables to be saved --- 10553,10559 ---- /* If invoking a innerclass constructor, there are hidden parameters to pass */ ! if (TREE_CODE (patch) == NEW_CLASS_EXPR && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { /* And make sure we add the accessed local variables to be saved *************** patch_method_invocation (patch, primary, *** 10496,10507 **** /* This handles the situation where a constructor invocation needs to have an enclosing context passed as a second parameter (the constructor is one of an inner class). */ ! if ((is_super_init || (TREE_CODE (patch) == CALL_EXPR && name == this_identifier_node)) && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { tree dest = TYPE_NAME (DECL_CONTEXT (list)); ! tree extra_arg = build_access_to_thisn (current_class, DECL_CONTEXT (dest), 0); extra_arg = java_complete_tree (extra_arg); args = tree_cons (NULL_TREE, extra_arg, args); --- 10597,10608 ---- /* This handles the situation where a constructor invocation needs to have an enclosing context passed as a second parameter (the constructor is one of an inner class). */ ! if ((is_super_init || (TREE_CODE (patch) == CALL_EXPR && name == this_identifier_node)) && PURE_INNER_CLASS_TYPE_P (DECL_CONTEXT (list))) { tree dest = TYPE_NAME (DECL_CONTEXT (list)); ! tree extra_arg = build_access_to_thisn (current_class, DECL_CONTEXT (dest), 0); extra_arg = java_complete_tree (extra_arg); args = tree_cons (NULL_TREE, extra_arg, args); *************** patch_method_invocation (patch, primary, *** 10515,10522 **** invoke any method relying on `this'. Exceptions are: we're invoking a static function, primary exists and is not the current this, we're creating a new object. */ ! if (ctxp->explicit_constructor_p ! && !is_static_flag && (!primary || primary == current_this) && (TREE_CODE (patch) != NEW_CLASS_EXPR)) { --- 10616,10623 ---- invoke any method relying on `this'. Exceptions are: we're invoking a static function, primary exists and is not the current this, we're creating a new object. */ ! if (ctxp->explicit_constructor_p ! && !is_static_flag && (!primary || primary == current_this) && (TREE_CODE (patch) != NEW_CLASS_EXPR)) { *************** patch_method_invocation (patch, primary, *** 10524,10530 **** PATCH_METHOD_RETURN_ERROR (); } java_parser_context_restore_global (); ! if (is_static) *is_static = is_static_flag; /* Sometimes, we want the decl of the selected method. Such as for EH checking */ --- 10625,10631 ---- PATCH_METHOD_RETURN_ERROR (); } java_parser_context_restore_global (); ! if (is_static) *is_static = is_static_flag; /* Sometimes, we want the decl of the selected method. Such as for EH checking */ *************** patch_method_invocation (patch, primary, *** 10536,10547 **** if (is_super_init && CLASS_HAS_FINIT_P (current_class)) { tree finit_parms, finit_call; ! /* Prepare to pass hidden parameters to finit$, if any. */ ! finit_parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_FINIT_INVOCATION, current_class, NULL_TREE, NULL); ! ! finit_call = build_method_invocation (build_wfl_node (finit_identifier_node), finit_parms); --- 10637,10648 ---- if (is_super_init && CLASS_HAS_FINIT_P (current_class)) { tree finit_parms, finit_call; ! /* Prepare to pass hidden parameters to finit$, if any. */ ! finit_parms = build_alias_initializer_parameter_list (AIPL_FUNCTION_FINIT_INVOCATION, current_class, NULL_TREE, NULL); ! ! finit_call = build_method_invocation (build_wfl_node (finit_identifier_node), finit_parms); *************** static int *** 10562,10573 **** check_for_static_method_reference (wfl, node, method, where, primary) tree wfl, node, method, where, primary; { ! if (METHOD_STATIC (current_function_decl) && !METHOD_STATIC (method) && !primary && !CALL_CONSTRUCTOR_P (node)) { char *fct_name = xstrdup (lang_printable_name (method, 0)); ! parse_error_context ! (wfl, "Can't make static reference to method `%s %s' in class `%s'", lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (where)))); free (fct_name); --- 10663,10674 ---- check_for_static_method_reference (wfl, node, method, where, primary) tree wfl, node, method, where, primary; { ! if (METHOD_STATIC (current_function_decl) && !METHOD_STATIC (method) && !primary && !CALL_CONSTRUCTOR_P (node)) { char *fct_name = xstrdup (lang_printable_name (method, 0)); ! parse_error_context ! (wfl, "Can't make static reference to method `%s %s' in class `%s'", lang_printable_name (TREE_TYPE (TREE_TYPE (method)), 0), fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (where)))); free (fct_name); *************** maybe_use_access_method (is_super_init, *** 10591,10603 **** int to_return = 0; int non_static_context = !METHOD_STATIC (md); ! if (is_super_init || DECL_CONTEXT (md) == current_class ! || !PURE_INNER_CLASS_TYPE_P (current_class) || DECL_FINIT_P (md) || DECL_INSTINIT_P (md)) return 0; ! /* If we're calling a method found in an enclosing class, generate what it takes to retrieve the right this. Don't do that if we're invoking a static method. Note that if MD's type is unrelated to --- 10692,10704 ---- int to_return = 0; int non_static_context = !METHOD_STATIC (md); ! if (is_super_init || DECL_CONTEXT (md) == current_class ! || !PURE_INNER_CLASS_TYPE_P (current_class) || DECL_FINIT_P (md) || DECL_INSTINIT_P (md)) return 0; ! /* If we're calling a method found in an enclosing class, generate what it takes to retrieve the right this. Don't do that if we're invoking a static method. Note that if MD's type is unrelated to *************** maybe_use_access_method (is_super_init, *** 10622,10628 **** ta = build_access_to_thisn (ctx, type, 0); break; } ! type = (DECL_CONTEXT (TYPE_NAME (type)) ? TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type))) : NULL_TREE); } } --- 10723,10729 ---- ta = build_access_to_thisn (ctx, type, 0); break; } ! type = (DECL_CONTEXT (TYPE_NAME (type)) ? TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type))) : NULL_TREE); } } *************** maybe_use_access_method (is_super_init, *** 10641,10647 **** *mdecl = md; *this_arg = ta; ! /* Returnin a non zero value indicates we were doing a non static method invokation that is now a static invocation. It will have callee displace `this' to insert it in the regular argument list. */ --- 10742,10748 ---- *mdecl = md; *this_arg = ta; ! /* Returnin a nonzero value indicates we were doing a non static method invokation that is now a static invocation. It will have callee displace `this' to insert it in the regular argument list. */ *************** patch_invoke (patch, method, args) *** 10666,10672 **** t = TYPE_ARG_TYPES (TREE_TYPE (method)); if (TREE_CODE (patch) == NEW_CLASS_EXPR) t = TREE_CHAIN (t); ! for (ta = args; t != end_params_node && ta; t = TREE_CHAIN (t), ta = TREE_CHAIN (ta)) if (JPRIMITIVE_TYPE_P (TREE_TYPE (TREE_VALUE (ta))) && TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t)) --- 10767,10773 ---- t = TYPE_ARG_TYPES (TREE_TYPE (method)); if (TREE_CODE (patch) == NEW_CLASS_EXPR) t = TREE_CHAIN (t); ! for (ta = args; t != end_params_node && ta; t = TREE_CHAIN (t), ta = TREE_CHAIN (ta)) if (JPRIMITIVE_TYPE_P (TREE_TYPE (TREE_VALUE (ta))) && TREE_TYPE (TREE_VALUE (ta)) != TREE_VALUE (t)) *************** patch_invoke (patch, method, args) *** 10757,10763 **** new = build (CALL_EXPR, promote_type (class), build_address_of (alloc_node), tree_cons (NULL_TREE, build_class_ref (class), ! build_tree_list (NULL_TREE, size_in_bytes (class))), NULL_TREE); saved_new = save_expr (new); --- 10858,10864 ---- new = build (CALL_EXPR, promote_type (class), build_address_of (alloc_node), tree_cons (NULL_TREE, build_class_ref (class), ! build_tree_list (NULL_TREE, size_in_bytes (class))), NULL_TREE); saved_new = save_expr (new); *************** patch_invoke (patch, method, args) *** 10772,10778 **** is NULL. */ if (check != NULL_TREE) { ! patch = build (COMPOUND_EXPR, TREE_TYPE (patch), check, patch); TREE_SIDE_EFFECTS (patch) = 1; } --- 10873,10883 ---- is NULL. */ if (check != NULL_TREE) { ! /* We have to call force_evaluation_order now because creating a ! COMPOUND_EXPR wraps the arg list in a way that makes it ! unrecognizable by force_evaluation_order later. Yuk. */ ! patch = build (COMPOUND_EXPR, TREE_TYPE (patch), check, ! force_evaluation_order (patch)); TREE_SIDE_EFFECTS (patch) = 1; } *************** patch_invoke (patch, method, args) *** 10788,10794 **** { tree list; tree fndecl = current_function_decl; ! tree save = save_expr (patch); tree type = TREE_TYPE (patch); patch = build (COMPOUND_EXPR, type, save, empty_stmt_node); --- 10893,10902 ---- { tree list; tree fndecl = current_function_decl; ! /* We have to call force_evaluation_order now because creating a ! COMPOUND_EXPR wraps the arg list in a way that makes it ! unrecognizable by force_evaluation_order later. Yuk. */ ! tree save = save_expr (force_evaluation_order (patch)); tree type = TREE_TYPE (patch); patch = build (COMPOUND_EXPR, type, save, empty_stmt_node); *************** lookup_method_invoke (lc, cl, class, nam *** 10895,10901 **** char string [4096]; if (!cm || not_accessible_p (class, cm, NULL_TREE, 0)) continue; ! sprintf (string, " `%s' in `%s'%s", get_printable_method_name (cm), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (cm)))), --- 11003,11009 ---- char string [4096]; if (!cm || not_accessible_p (class, cm, NULL_TREE, 0)) continue; ! sprintf (string, " `%s' in `%s'%s", get_printable_method_name (cm), IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (cm)))), *************** find_applicable_accessible_methods_list *** 10927,10954 **** int lc; tree class, name, arglist; { ! static struct hash_table t, *searched_classes = NULL; static int search_not_done = 0; tree list = NULL_TREE, all_list = NULL_TREE; ! /* Check the hash table to determine if this class has been searched already. */ if (searched_classes) { ! if (hash_lookup (searched_classes, ! (const hash_table_key) class, FALSE, NULL)) ! return NULL; } else { ! hash_table_init (&t, hash_newfunc, java_hash_hash_tree_node, ! java_hash_compare_tree_node); ! searched_classes = &t; } ! search_not_done++; ! hash_lookup (searched_classes, ! (const hash_table_key) class, TRUE, NULL); if (!CLASS_LOADED_P (class) && !CLASS_FROM_SOURCE_P (class)) { --- 11035,11059 ---- int lc; tree class, name, arglist; { ! static htab_t searched_classes; static int search_not_done = 0; tree list = NULL_TREE, all_list = NULL_TREE; ! /* Check the hash table to determine if this class has been searched already. */ if (searched_classes) { ! if (htab_find (searched_classes, class) != NULL) ! return NULL; } else { ! searched_classes = htab_create (10, htab_hash_pointer, ! htab_eq_pointer, NULL); } ! search_not_done++; ! *htab_find_slot (searched_classes, class, INSERT) = class; if (!CLASS_LOADED_P (class) && !CLASS_FROM_SOURCE_P (class)) { *************** find_applicable_accessible_methods_list *** 10957,10968 **** } /* Search interfaces */ ! if (TREE_CODE (TYPE_NAME (class)) == TYPE_DECL && CLASS_INTERFACE (TYPE_NAME (class))) { int i, n; tree basetype_vec = TYPE_BINFO_BASETYPES (class); ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); n = TREE_VEC_LENGTH (basetype_vec); for (i = 1; i < n; i++) --- 11062,11073 ---- } /* Search interfaces */ ! if (TREE_CODE (TYPE_NAME (class)) == TYPE_DECL && CLASS_INTERFACE (TYPE_NAME (class))) { int i, n; tree basetype_vec = TYPE_BINFO_BASETYPES (class); ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); n = TREE_VEC_LENGTH (basetype_vec); for (i = 1; i < n; i++) *************** find_applicable_accessible_methods_list *** 10970,10976 **** tree t = BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)); tree rlist; ! rlist = find_applicable_accessible_methods_list (lc, t, name, arglist); list = chainon (rlist, list); } --- 11075,11081 ---- tree t = BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i)); tree rlist; ! rlist = find_applicable_accessible_methods_list (lc, t, name, arglist); list = chainon (rlist, list); } *************** find_applicable_accessible_methods_list *** 10978,10984 **** /* Search classes */ else { ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); /* When looking finit$, class$ or instinit$, we turn LC to 1 so --- 11083,11089 ---- /* Search classes */ else { ! search_applicable_methods_list (lc, TYPE_METHODS (class), name, arglist, &list, &all_list); /* When looking finit$, class$ or instinit$, we turn LC to 1 so *************** find_applicable_accessible_methods_list *** 11014,11020 **** { tree rlist; class = CLASSTYPE_SUPER (class); ! rlist = find_applicable_accessible_methods_list (lc, class, name, arglist); list = chainon (rlist, list); } --- 11119,11125 ---- { tree rlist; class = CLASSTYPE_SUPER (class); ! rlist = find_applicable_accessible_methods_list (lc, class, name, arglist); list = chainon (rlist, list); } *************** find_applicable_accessible_methods_list *** 11028,11042 **** { if (!lc && TYPE_METHODS (object_type_node) ! && !hash_lookup (searched_classes, ! (const hash_table_key) object_type_node, ! FALSE, NULL)) { ! search_applicable_methods_list (lc, TYPE_METHODS (object_type_node), name, arglist, &list, &all_list); } ! hash_table_free (searched_classes); searched_classes = NULL; } --- 11133,11145 ---- { if (!lc && TYPE_METHODS (object_type_node) ! && htab_find (searched_classes, object_type_node) == NULL) { ! search_applicable_methods_list (lc, TYPE_METHODS (object_type_node), name, arglist, &list, &all_list); } ! htab_delete (searched_classes); searched_classes = NULL; } *************** find_applicable_accessible_methods_list *** 11047,11053 **** /* Effectively search for the appropriate method in method */ ! static void search_applicable_methods_list (lc, method, name, arglist, list, all_list) int lc; tree method, name, arglist; --- 11150,11156 ---- /* Effectively search for the appropriate method in method */ ! static void search_applicable_methods_list (lc, method, name, arglist, list, all_list) int lc; tree method, name, arglist; *************** search_applicable_methods_list (lc, meth *** 11059,11072 **** other classes */ if (lc && !DECL_CONSTRUCTOR_P (method)) continue; ! else if (!lc && (DECL_CONSTRUCTOR_P (method) || (DECL_NAME (method) != name))) continue; if (argument_types_convertible (method, arglist)) { /* Retain accessible methods only */ ! if (!not_accessible_p (DECL_CONTEXT (current_function_decl), method, NULL_TREE, 0)) *list = tree_cons (NULL_TREE, method, *list); else --- 11162,11175 ---- other classes */ if (lc && !DECL_CONSTRUCTOR_P (method)) continue; ! else if (!lc && (DECL_CONSTRUCTOR_P (method) || (DECL_NAME (method) != name))) continue; if (argument_types_convertible (method, arglist)) { /* Retain accessible methods only */ ! if (!not_accessible_p (DECL_CONTEXT (current_function_decl), method, NULL_TREE, 0)) *list = tree_cons (NULL_TREE, method, *list); else *************** find_most_specific_methods_list (list) *** 11103,11115 **** /* Compare arguments and location where methods where declared */ if (argument_types_convertible (method_v, current_v)) { ! if (valid_method_invocation_conversion_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)) || (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) && enclosing_context_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)))) { ! int v = (DECL_SPECIFIC_COUNT (current_v) += (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) ? 2 : 1)); max = (v > max ? v : max); } --- 11206,11218 ---- /* Compare arguments and location where methods where declared */ if (argument_types_convertible (method_v, current_v)) { ! if (valid_method_invocation_conversion_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)) || (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) && enclosing_context_p (DECL_CONTEXT (method_v), DECL_CONTEXT (current_v)))) { ! int v = (DECL_SPECIFIC_COUNT (current_v) += (INNER_CLASS_TYPE_P (DECL_CONTEXT (current_v)) ? 2 : 1)); max = (v > max ? v : max); } *************** find_most_specific_methods_list (list) *** 11166,11190 **** corresponding parameter of M1. Implementation expects M2_OR_ARGLIST to change less often than M1. */ static int argument_types_convertible (m1, m2_or_arglist) tree m1, m2_or_arglist; { - static tree m2_arg_value = NULL_TREE; - static tree m2_arg_cache = NULL_TREE; - static int initialized_p; - register tree m1_arg, m2_arg; - /* Register M2_ARG_VALUE and M2_ARG_CACHE with the garbage - collector. */ - if (!initialized_p) - { - ggc_add_tree_root (&m2_arg_value, 1); - ggc_add_tree_root (&m2_arg_cache, 1); - initialized_p = 1; - } - SKIP_THIS_AND_ARTIFICIAL_PARMS (m1_arg, m1) if (m2_arg_value == m2_or_arglist) --- 11269,11283 ---- corresponding parameter of M1. Implementation expects M2_OR_ARGLIST to change less often than M1. */ + static GTY(()) tree m2_arg_value; + static GTY(()) tree m2_arg_cache; + static int argument_types_convertible (m1, m2_or_arglist) tree m1, m2_or_arglist; { register tree m1_arg, m2_arg; SKIP_THIS_AND_ARTIFICIAL_PARMS (m1_arg, m1) if (m2_arg_value == m2_or_arglist) *************** qualify_ambiguous_name (id) *** 11313,11319 **** else if (code == TREE_LIST) name = EXPR_WFL_NODE (TREE_PURPOSE (qual_wfl)); ! else if (code == STRING_CST || code == CONDITIONAL_EXPR || code == PLUS_EXPR) { qual = TREE_CHAIN (qual); --- 11406,11412 ---- else if (code == TREE_LIST) name = EXPR_WFL_NODE (TREE_PURPOSE (qual_wfl)); ! else if (code == STRING_CST || code == CONDITIONAL_EXPR || code == PLUS_EXPR) { qual = TREE_CHAIN (qual); *************** qualify_ambiguous_name (id) *** 11338,11344 **** if (TREE_CODE (TREE_PURPOSE (qual)) == ARRAY_REF && TREE_CODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == EXPR_WITH_FILE_LOCATION ! && EXPR_WFL_NODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == this_identifier_node) { qual = TREE_OPERAND (TREE_PURPOSE (qual), 0); --- 11431,11437 ---- if (TREE_CODE (TREE_PURPOSE (qual)) == ARRAY_REF && TREE_CODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == EXPR_WITH_FILE_LOCATION ! && EXPR_WFL_NODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) == this_identifier_node) { qual = TREE_OPERAND (TREE_PURPOSE (qual), 0); *************** qualify_ambiguous_name (id) *** 11371,11382 **** super_found = again = 1; } } while (again); ! /* If name appears within the scope of a local variable declaration or parameter declaration, then it is an expression name. We don't carry this test out if we're in the context of the use of SUPER or THIS */ ! if (!this_found && !super_found && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST && (decl = IDENTIFIER_LOCAL_VALUE (name))) { --- 11464,11475 ---- super_found = again = 1; } } while (again); ! /* If name appears within the scope of a local variable declaration or parameter declaration, then it is an expression name. We don't carry this test out if we're in the context of the use of SUPER or THIS */ ! if (!this_found && !super_found && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST && (decl = IDENTIFIER_LOCAL_VALUE (name))) { *************** qualify_ambiguous_name (id) *** 11402,11408 **** - NAME is declared in an another compilation unit of the package of the compilation unit containing NAME, - NAME is declared by exactly on type-import-on-demand declaration ! of the compilation unit containing NAME. - NAME is actually a STRING_CST. This can't happen if the expression was qualified by `this.' */ else if (! this_found && --- 11495,11501 ---- - NAME is declared in an another compilation unit of the package of the compilation unit containing NAME, - NAME is declared by exactly on type-import-on-demand declaration ! of the compilation unit containing NAME. - NAME is actually a STRING_CST. This can't happen if the expression was qualified by `this.' */ else if (! this_found && *************** qualify_ambiguous_name (id) *** 11426,11432 **** containing NAME. FIXME */ /* Otherwise, NAME is reclassified as a package name */ ! else RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1; /* Propagate the qualification accross other components of the --- 11519,11525 ---- containing NAME. FIXME */ /* Otherwise, NAME is reclassified as a package name */ ! else RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1; /* Propagate the qualification accross other components of the *************** qualify_ambiguous_name (id) *** 11436,11442 **** { if (RESOLVE_PACKAGE_NAME_P (qual_wfl)) RESOLVE_PACKAGE_NAME_P (QUAL_WFL (qual)) = 1; ! else RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (qual)) = 1; } --- 11529,11535 ---- { if (RESOLVE_PACKAGE_NAME_P (qual_wfl)) RESOLVE_PACKAGE_NAME_P (QUAL_WFL (qual)) = 1; ! else RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (qual)) = 1; } *************** breakdown_qualified (left, right, source *** 11458,11474 **** tree *left, *right, source; { char *p, *base; ! int l = IDENTIFIER_LENGTH (source); base = alloca (l + 1); memcpy (base, IDENTIFIER_POINTER (source), l + 1); ! /* Breakdown NAME into REMAINDER . IDENTIFIER */ p = base + l - 1; while (*p != '.' && p != base) p--; ! /* We didn't find a '.'. Return an error */ if (p == base) return 1; --- 11551,11567 ---- tree *left, *right, source; { char *p, *base; ! int l = IDENTIFIER_LENGTH (source); base = alloca (l + 1); memcpy (base, IDENTIFIER_POINTER (source), l + 1); ! /* Breakdown NAME into REMAINDER . IDENTIFIER. */ p = base + l - 1; while (*p != '.' && p != base) p--; ! /* We didn't find a '.'. Return an error. */ if (p == base) return 1; *************** breakdown_qualified (left, right, source *** 11476,11482 **** if (right) *right = get_identifier (p+1); *left = get_identifier (base); ! return 0; } --- 11569,11575 ---- if (right) *right = get_identifier (p+1); *left = get_identifier (base); ! return 0; } *************** in_same_package (name1, name2) *** 11489,11495 **** tree tmp; tree pkg1; tree pkg2; ! if (TREE_CODE (name1) == TYPE_DECL) name1 = DECL_NAME (name1); if (TREE_CODE (name2) == TYPE_DECL) --- 11582,11588 ---- tree tmp; tree pkg1; tree pkg2; ! if (TREE_CODE (name1) == TYPE_DECL) name1 = DECL_NAME (name1); if (TREE_CODE (name2) == TYPE_DECL) *************** in_same_package (name1, name2) *** 11505,11511 **** breakdown_qualified (&pkg1, &tmp, name1); breakdown_qualified (&pkg2, &tmp, name2); ! return (pkg1 == pkg2); } --- 11598,11604 ---- breakdown_qualified (&pkg1, &tmp, name1); breakdown_qualified (&pkg2, &tmp, name2); ! return (pkg1 == pkg2); } *************** java_complete_tree (node) *** 11522,11543 **** && DECL_INITIAL (node) != NULL_TREE && !flag_emit_xref) { ! tree value = DECL_INITIAL (node); ! DECL_INITIAL (node) = NULL_TREE; ! value = fold_constant_for_init (value, node); ! DECL_INITIAL (node) = value; if (value != NULL_TREE) ! { ! /* fold_constant_for_init sometimes widens the original type ! of the constant (i.e. byte to int). It's not desirable, ! especially if NODE is a function argument. */ ! if ((TREE_CODE (value) == INTEGER_CST ! || TREE_CODE (value) == REAL_CST) ! && TREE_TYPE (node) != TREE_TYPE (value)) ! return convert (TREE_TYPE (node), value); ! else ! return value; ! } } return node; } --- 11615,11623 ---- && DECL_INITIAL (node) != NULL_TREE && !flag_emit_xref) { ! tree value = fold_constant_for_init (node, node); if (value != NULL_TREE) ! return value; } return node; } *************** java_complete_lhs (node) *** 11598,11604 **** int error_seen = 0; if (TREE_CODE (stmt) == COMPOUND_EXPR) { ! /* Re-order from (((A; B); C); ...; Z) to (A; (B; (C ; (...; Z)))). This makes it easier to scan the statements left-to-right without using recursion (which might overflow the stack --- 11678,11684 ---- int error_seen = 0; if (TREE_CODE (stmt) == COMPOUND_EXPR) { ! /* Re-order from (((A; B); C); ...; Z) to (A; (B; (C ; (...; Z)))). This makes it easier to scan the statements left-to-right without using recursion (which might overflow the stack *************** java_complete_lhs (node) *** 11744,11754 **** nn = ctxp->current_loop; /* It must be assignable to the type of the switch expression. */ ! if (!try_builtin_assignconv (NULL_TREE, TREE_TYPE (TREE_OPERAND (nn, 0)), cn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Incompatible type for case. Can't convert `%s' to `int'", lang_printable_name (TREE_TYPE (cn), 0)); --- 11824,11834 ---- nn = ctxp->current_loop; /* It must be assignable to the type of the switch expression. */ ! if (!try_builtin_assignconv (NULL_TREE, TREE_TYPE (TREE_OPERAND (nn, 0)), cn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Incompatible type for case. Can't convert `%s' to `int'", lang_printable_name (TREE_TYPE (cn), 0)); *************** java_complete_lhs (node) *** 11779,11785 **** if (SWITCH_HAS_DEFAULT (nn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Duplicate case label: `default'"); return error_mark_node; } --- 11859,11865 ---- if (SWITCH_HAS_DEFAULT (nn)) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Duplicate case label: `default'"); return error_mark_node; } *************** java_complete_lhs (node) *** 11854,11860 **** /* 3- Expression section */ case COMPOUND_EXPR: wfl_op2 = TREE_OPERAND (node, 1); ! TREE_OPERAND (node, 0) = nn = java_complete_tree (TREE_OPERAND (node, 0)); if (wfl_op2 == empty_stmt_node) CAN_COMPLETE_NORMALLY (node) = CAN_COMPLETE_NORMALLY (nn); --- 11934,11940 ---- /* 3- Expression section */ case COMPOUND_EXPR: wfl_op2 = TREE_OPERAND (node, 1); ! TREE_OPERAND (node, 0) = nn = java_complete_tree (TREE_OPERAND (node, 0)); if (wfl_op2 == empty_stmt_node) CAN_COMPLETE_NORMALLY (node) = CAN_COMPLETE_NORMALLY (nn); *************** java_complete_lhs (node) *** 11867,11876 **** nn = wfl_op2; if (TREE_CODE (nn) == EXPR_WITH_FILE_LOCATION) nn = EXPR_WFL_NODE (nn); ! if (TREE_CODE (nn) != EXIT_EXPR) { SET_WFL_OPERATOR (wfl_operator, node, wfl_op2); ! parse_error_context (wfl_operator, "Unreachable statement"); } } TREE_OPERAND (node, 1) = java_complete_tree (TREE_OPERAND (node, 1)); --- 11947,11968 ---- nn = wfl_op2; if (TREE_CODE (nn) == EXPR_WITH_FILE_LOCATION) nn = EXPR_WFL_NODE (nn); ! /* NN can be NULL_TREE exactly when UPDATE is, in ! finish_for_loop. */ ! if (nn != NULL_TREE && TREE_CODE (nn) != EXIT_EXPR) { SET_WFL_OPERATOR (wfl_operator, node, wfl_op2); ! if (SUPPRESS_UNREACHABLE_ERROR (nn)) ! { ! /* Perhaps this warning should have an ! associated flag. The code being compiled is ! pedantically correct, but useless. */ ! parse_warning_context (wfl_operator, ! "Unreachable statement"); ! } ! else ! parse_error_context (wfl_operator, ! "Unreachable statement"); } } TREE_OPERAND (node, 1) = java_complete_tree (TREE_OPERAND (node, 1)); *************** java_complete_lhs (node) *** 11931,11937 **** } else TREE_TYPE (node) = TREE_TYPE (EXPR_WFL_NODE (node)); ! } break; --- 12023,12029 ---- } else TREE_TYPE (node) = TREE_TYPE (EXPR_WFL_NODE (node)); ! } break; *************** java_complete_lhs (node) *** 11941,11947 **** for (cn = TREE_OPERAND (node, 1); cn; cn = TREE_CHAIN (cn)) { int location = EXPR_WFL_LINECOL (TREE_VALUE (cn)); ! tree dim = convert (int_type_node, java_complete_tree (TREE_VALUE (cn))); if (dim == error_mark_node) { --- 12033,12039 ---- for (cn = TREE_OPERAND (node, 1); cn; cn = TREE_CHAIN (cn)) { int location = EXPR_WFL_LINECOL (TREE_VALUE (cn)); ! tree dim = convert (int_type_node, java_complete_tree (TREE_VALUE (cn))); if (dim == error_mark_node) { *************** java_complete_lhs (node) *** 11953,11959 **** TREE_VALUE (cn) = dim; /* Setup the location of the current dimension, for later error report. */ ! TREE_PURPOSE (cn) = build_expr_wfl (NULL_TREE, input_filename, 0, 0); EXPR_WFL_LINECOL (TREE_PURPOSE (cn)) = location; } --- 12045,12051 ---- TREE_VALUE (cn) = dim; /* Setup the location of the current dimension, for later error report. */ ! TREE_PURPOSE (cn) = build_expr_wfl (NULL_TREE, input_filename, 0, 0); EXPR_WFL_LINECOL (TREE_PURPOSE (cn)) = location; } *************** java_complete_lhs (node) *** 12002,12009 **** check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl); /* If we call this(...), register signature and positions */ if (in_this) ! DECL_CONSTRUCTOR_CALLS (current_function_decl) = ! tree_cons (wfl, decl, DECL_CONSTRUCTOR_CALLS (current_function_decl)); CAN_COMPLETE_NORMALLY (node) = 1; return force_evaluation_order (node); --- 12094,12101 ---- check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl); /* If we call this(...), register signature and positions */ if (in_this) ! DECL_CONSTRUCTOR_CALLS (current_function_decl) = ! tree_cons (wfl, decl, DECL_CONSTRUCTOR_CALLS (current_function_decl)); CAN_COMPLETE_NORMALLY (node) = 1; return force_evaluation_order (node); *************** java_complete_lhs (node) *** 12013,12032 **** /* Save potential wfls */ wfl_op1 = TREE_OPERAND (node, 0); TREE_OPERAND (node, 0) = nn = java_complete_lhs (wfl_op1); ! if (MODIFY_EXPR_FROM_INITIALIZATION_P (node) && TREE_CODE (nn) == VAR_DECL && TREE_STATIC (nn) && DECL_INITIAL (nn) != NULL_TREE) { tree value; ! value = fold_constant_for_init (nn, nn); /* When we have a primitype type, or a string and we're not emitting a class file, we actually don't want to generate anything for the assignment. */ if (value != NULL_TREE && ! (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) || (TREE_TYPE (value) == string_ptr_type_node && ! flag_emit_class_files))) { --- 12105,12124 ---- /* Save potential wfls */ wfl_op1 = TREE_OPERAND (node, 0); TREE_OPERAND (node, 0) = nn = java_complete_lhs (wfl_op1); ! if (MODIFY_EXPR_FROM_INITIALIZATION_P (node) && TREE_CODE (nn) == VAR_DECL && TREE_STATIC (nn) && DECL_INITIAL (nn) != NULL_TREE) { tree value; ! value = fold_constant_for_init (nn, nn); /* When we have a primitype type, or a string and we're not emitting a class file, we actually don't want to generate anything for the assignment. */ if (value != NULL_TREE && ! (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) || (TREE_TYPE (value) == string_ptr_type_node && ! flag_emit_class_files))) { *************** java_complete_lhs (node) *** 12062,12072 **** { /* This might break when accessing outer field from inner class. TESTME, FIXME */ ! tree lvalue = java_stabilize_reference (TREE_OPERAND (node, 0)); /* Hand stabilize the lhs on both places */ TREE_OPERAND (node, 0) = lvalue; ! TREE_OPERAND (TREE_OPERAND (node, 1), 0) = (flag_emit_class_files ? lvalue : save_expr (lvalue)); /* 15.25.2.a: Left hand is not an array access. FIXME */ --- 12154,12164 ---- { /* This might break when accessing outer field from inner class. TESTME, FIXME */ ! tree lvalue = java_stabilize_reference (TREE_OPERAND (node, 0)); /* Hand stabilize the lhs on both places */ TREE_OPERAND (node, 0) = lvalue; ! TREE_OPERAND (TREE_OPERAND (node, 1), 0) = (flag_emit_class_files ? lvalue : save_expr (lvalue)); /* 15.25.2.a: Left hand is not an array access. FIXME */ *************** java_complete_lhs (node) *** 12076,12084 **** if ((cn = patch_string (nn))) nn = cn; ! /* The last part of the rewrite for E1 op= E2 is to have E1 = (T)(E1 op E2), with T being the type of E1. */ ! nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn)); /* If the assignment is compound and has reference type, --- 12168,12176 ---- if ((cn = patch_string (nn))) nn = cn; ! /* The last part of the rewrite for E1 op= E2 is to have E1 = (T)(E1 op E2), with T being the type of E1. */ ! nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn)); /* If the assignment is compound and has reference type, *************** java_complete_lhs (node) *** 12132,12138 **** if (node == error_mark_node) return error_mark_node; /* Reorganize the tree if necessary. */ ! if (flag && (!JREFERENCE_TYPE_P (TREE_TYPE (node)) || JSTRING_P (TREE_TYPE (node)))) node = java_refold (node); } --- 12224,12230 ---- if (node == error_mark_node) return error_mark_node; /* Reorganize the tree if necessary. */ ! if (flag && (!JREFERENCE_TYPE_P (TREE_TYPE (node)) || JSTRING_P (TREE_TYPE (node)))) node = java_refold (node); } *************** java_complete_lhs (node) *** 12141,12149 **** undergone a conversion in patch_assignment. We do that only when it's necessary to have DECL_INITIAL properly set. */ nn = TREE_OPERAND (node, 0); ! if (TREE_CODE (nn) == VAR_DECL && DECL_INITIAL (nn) && CONSTANT_VALUE_P (DECL_INITIAL (nn)) ! && FIELD_STATIC (nn) && FIELD_FINAL (nn) && (JPRIMITIVE_TYPE_P (TREE_TYPE (nn)) || TREE_TYPE (nn) == string_ptr_type_node)) DECL_INITIAL (nn) = TREE_OPERAND (node, 1); --- 12233,12241 ---- undergone a conversion in patch_assignment. We do that only when it's necessary to have DECL_INITIAL properly set. */ nn = TREE_OPERAND (node, 0); ! if (TREE_CODE (nn) == VAR_DECL && DECL_INITIAL (nn) && CONSTANT_VALUE_P (DECL_INITIAL (nn)) ! && FIELD_STATIC (nn) && FIELD_FINAL (nn) && (JPRIMITIVE_TYPE_P (TREE_TYPE (nn)) || TREE_TYPE (nn) == string_ptr_type_node)) DECL_INITIAL (nn) = TREE_OPERAND (node, 1); *************** java_complete_lhs (node) *** 12165,12171 **** case RDIV_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: --- 12257,12263 ---- case RDIV_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: *************** java_complete_lhs (node) *** 12284,12296 **** if (ctxp->explicit_constructor_p) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Can't reference `this' or `super' before the superclass constructor has been called"); TREE_TYPE (node) = error_mark_node; return error_mark_node; } return current_this; ! case CLASS_LITERAL: CAN_COMPLETE_NORMALLY (node) = 1; node = patch_incomplete_class_ref (node); --- 12376,12388 ---- if (ctxp->explicit_constructor_p) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! parse_error_context (wfl_operator, "Can't reference `this' or `super' before the superclass constructor has been called"); TREE_TYPE (node) = error_mark_node; return error_mark_node; } return current_this; ! case CLASS_LITERAL: CAN_COMPLETE_NORMALLY (node) = 1; node = patch_incomplete_class_ref (node); *************** java_complete_lhs (node) *** 12310,12316 **** return node; } ! /* Complete function call's argument. Return a non zero value is an error was found. */ static int --- 12402,12408 ---- return node; } ! /* Complete function call's argument. Return a nonzero value is an error was found. */ static int *************** enter_block () *** 12387,12393 **** for the first time for a given function. The current function body (DECL_FUNCTION_BODY) is set to be block B. */ ! tree fndecl = current_function_decl; if (!fndecl) { BLOCK_SUPERCONTEXT (b) = current_static_block; --- 12479,12485 ---- for the first time for a given function. The current function body (DECL_FUNCTION_BODY) is set to be block B. */ ! tree fndecl = current_function_decl; if (!fndecl) { BLOCK_SUPERCONTEXT (b) = current_static_block; *************** lookup_name_in_blocks (name) *** 12449,12455 **** if (TREE_CODE (b) != BLOCK) abort (); ! for (current = BLOCK_EXPR_DECLS (b); current; current = TREE_CHAIN (current)) if (DECL_NAME (current) == name) return current; --- 12541,12547 ---- if (TREE_CODE (b) != BLOCK) abort (); ! for (current = BLOCK_EXPR_DECLS (b); current; current = TREE_CHAIN (current)) if (DECL_NAME (current) == name) return current; *************** build_wfl_wrap (node, location) *** 12482,12488 **** int location; { tree wfl, node_to_insert = node; ! /* We want to process THIS . xxx symbolicaly, to keep it consistent with the way we're processing SUPER. A THIS from a primary as a different form than a SUPER. Turn THIS into something symbolic */ --- 12574,12580 ---- int location; { tree wfl, node_to_insert = node; ! /* We want to process THIS . xxx symbolicaly, to keep it consistent with the way we're processing SUPER. A THIS from a primary as a different form than a SUPER. Turn THIS into something symbolic */ *************** build_this_super_qualified_invocation (u *** 12530,12536 **** int lloc, rloc; { tree invok; ! tree wfl = build_wfl_node (use_this ? this_identifier_node : super_identifier_node); EXPR_WFL_LINECOL (wfl) = lloc; invok = build_method_invocation (name, args); --- 12622,12628 ---- int lloc, rloc; { tree invok; ! tree wfl = build_wfl_node (use_this ? this_identifier_node : super_identifier_node); EXPR_WFL_LINECOL (wfl) = lloc; invok = build_method_invocation (name, args); *************** build_assignment (op, op_location, lhs, *** 12584,12591 **** return assignment; } ! /* Print an INTEGER_CST node in a static buffer, and return the buffer. */ char * print_int_node (node) tree node; --- 12676,12759 ---- return assignment; } ! /* Print an INTEGER_CST node as decimal in a static buffer, and return ! the buffer. This is used only for string conversion. */ ! static char * ! string_convert_int_cst (node) ! tree node; ! { ! /* Long.MIN_VALUE is -9223372036854775808, 20 characters. */ ! static char buffer[21]; ! ! unsigned HOST_WIDE_INT lo = TREE_INT_CST_LOW (node); ! unsigned HOST_WIDE_INT hi = TREE_INT_CST_HIGH (node); ! char *p = buffer + sizeof (buffer); ! int neg = 0; ! ! unsigned HOST_WIDE_INT hibit = (((unsigned HOST_WIDE_INT) 1) ! << (HOST_BITS_PER_WIDE_INT - 1)); ! ! *--p = '\0'; ! ! /* If negative, note the fact and negate the value. */ ! if ((hi & hibit)) ! { ! lo = ~lo; ! hi = ~hi; ! if (++lo == 0) ! ++hi; ! neg = 1; ! } ! ! /* Divide by 10 until there are no bits left. */ ! do ! { ! unsigned HOST_WIDE_INT acc = 0; ! unsigned HOST_WIDE_INT outhi = 0, outlo = 0; ! unsigned int i; ! ! /* Use long division to compute the result and the remainder. */ ! for (i = 0; i < 2 * HOST_BITS_PER_WIDE_INT; ++i) ! { ! /* Shift a bit into accumulator. */ ! acc <<= 1; ! if ((hi & hibit)) ! acc |= 1; ! ! /* Shift the value. */ ! hi <<= 1; ! if ((lo & hibit)) ! hi |= 1; ! lo <<= 1; ! ! /* Shift the correct bit into the result. */ ! outhi <<= 1; ! if ((outlo & hibit)) ! outhi |= 1; ! outlo <<= 1; ! if (acc >= 10) ! { ! acc -= 10; ! outlo |= 1; ! } ! } ! ! /* '0' == 060 in Java, but might not be here (think EBCDIC). */ ! *--p = '\060' + acc; ! ! hi = outhi; ! lo = outlo; ! } ! while (hi || lo); ! ! if (neg) ! *--p = '\055'; /* '-' == 055 in Java, but might not be here. */ + return p; + } + + /* Print an INTEGER_CST node in a static buffer, and return the + buffer. This is used only for error handling. */ char * print_int_node (node) tree node; *************** print_int_node (node) *** 12593,12599 **** static char buffer [80]; if (TREE_CONSTANT_OVERFLOW (node)) sprintf (buffer, ""); ! if (TREE_INT_CST_HIGH (node) == 0) sprintf (buffer, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node)); --- 12761,12767 ---- static char buffer [80]; if (TREE_CONSTANT_OVERFLOW (node)) sprintf (buffer, ""); ! if (TREE_INT_CST_HIGH (node) == 0) sprintf (buffer, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node)); *************** patch_assignment (node, wfl_op1) *** 12663,12669 **** { lhs_type = TREE_TYPE (lvalue); } ! else { parse_error_context (wfl_op1, "Invalid left hand side of assignment"); error_found = 1; --- 12831,12837 ---- { lhs_type = TREE_TYPE (lvalue); } ! else { parse_error_context (wfl_op1, "Invalid left hand side of assignment"); error_found = 1; *************** patch_assignment (node, wfl_op1) *** 12736,12747 **** /* 10.10: Array Store Exception runtime check */ if (!flag_emit_class_files && !flag_emit_xref ! && lvalue_from_array && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type))) { tree array, store_check, base, index_expr; ! ! /* Save RHS so that it doesn't get re-evaluated by the store check. */ new_rhs = save_expr (new_rhs); /* Get the INDIRECT_REF. */ --- 12904,12915 ---- /* 10.10: Array Store Exception runtime check */ if (!flag_emit_class_files && !flag_emit_xref ! && lvalue_from_array && JREFERENCE_TYPE_P (TYPE_ARRAY_ELEMENT (lhs_type))) { tree array, store_check, base, index_expr; ! ! /* Save RHS so that it doesn't get re-evaluated by the store check. */ new_rhs = save_expr (new_rhs); /* Get the INDIRECT_REF. */ *************** patch_assignment (node, wfl_op1) *** 12749,12775 **** /* Get the array pointer expr. */ array = TREE_OPERAND (array, 0); store_check = build_java_arraystore_check (array, new_rhs); ! index_expr = TREE_OPERAND (lvalue, 1); ! if (TREE_CODE (index_expr) == COMPOUND_EXPR) { ! /* A COMPOUND_EXPR here is a bounds check. The bounds check must happen before the store check, so prepare to insert the store check within the second operand of the existing COMPOUND_EXPR. */ base = index_expr; } else base = lvalue; ! index_expr = TREE_OPERAND (base, 1); ! TREE_OPERAND (base, 1) = build (COMPOUND_EXPR, TREE_TYPE (index_expr), store_check, index_expr); } /* Final locals can be used as case values in switch statement. Prepare them for this eventuality. */ ! if (TREE_CODE (lvalue) == VAR_DECL && DECL_FINAL (lvalue) && TREE_CONSTANT (new_rhs) && IDENTIFIER_LOCAL_VALUE (DECL_NAME (lvalue)) --- 12917,12943 ---- /* Get the array pointer expr. */ array = TREE_OPERAND (array, 0); store_check = build_java_arraystore_check (array, new_rhs); ! index_expr = TREE_OPERAND (lvalue, 1); ! if (TREE_CODE (index_expr) == COMPOUND_EXPR) { ! /* A COMPOUND_EXPR here is a bounds check. The bounds check must happen before the store check, so prepare to insert the store check within the second operand of the existing COMPOUND_EXPR. */ base = index_expr; } else base = lvalue; ! index_expr = TREE_OPERAND (base, 1); ! TREE_OPERAND (base, 1) = build (COMPOUND_EXPR, TREE_TYPE (index_expr), store_check, index_expr); } /* Final locals can be used as case values in switch statement. Prepare them for this eventuality. */ ! if (TREE_CODE (lvalue) == VAR_DECL && DECL_FINAL (lvalue) && TREE_CONSTANT (new_rhs) && IDENTIFIER_LOCAL_VALUE (DECL_NAME (lvalue)) *************** patch_assignment (node, wfl_op1) *** 12780,12785 **** --- 12948,12990 ---- DECL_INITIAL (lvalue) = new_rhs; } + /* Copy the rhs if it's a reference. */ + if (! flag_check_references && ! flag_emit_class_files && optimize > 0) + { + switch (TREE_CODE (new_rhs)) + { + case ARRAY_REF: + case INDIRECT_REF: + case COMPONENT_REF: + /* Transform a = foo.bar + into a = { int tmp; tmp = foo.bar; tmp; ). + We need to ensure that if a read from memory fails + because of a NullPointerException, a destination variable + will remain unchanged. An explicit temporary does what + we need. + + If flag_check_references is set, this is unnecessary + because we'll check each reference before doing any + reads. If optimize is not set the result will never be + written to a stack slot that contains the LHS. */ + { + tree tmp = build_decl (VAR_DECL, get_identifier (""), + TREE_TYPE (new_rhs)); + tree block = build (BLOCK, TREE_TYPE (new_rhs), NULL); + tree assignment + = build (MODIFY_EXPR, TREE_TYPE (new_rhs), tmp, fold (new_rhs)); + BLOCK_VARS (block) = tmp; + BLOCK_EXPR_BODY (block) + = build (COMPOUND_EXPR, TREE_TYPE (new_rhs), assignment, tmp); + TREE_SIDE_EFFECTS (block) = 1; + new_rhs = block; + } + break; + default: + break; + } + } + TREE_OPERAND (node, 0) = lvalue; TREE_OPERAND (node, 1) = new_rhs; TREE_TYPE (node) = lhs_type; *************** try_builtin_assignconv (wfl_op1, lhs_typ *** 12838,12857 **** else if (valid_builtin_assignconv_identity_widening_p (lhs_type, rhs_type)) new_rhs = convert (lhs_type, rhs); ! /* Try a narrowing primitive conversion (5.1.3): ! - expression is a constant expression of type int AND - variable is byte, short or char AND ! - The value of the expression is representable in the type of the variable */ ! else if (rhs_type == int_type_node && TREE_CONSTANT (rhs) && (lhs_type == byte_type_node || lhs_type == char_type_node || lhs_type == short_type_node)) { if (int_fits_type_p (rhs, lhs_type)) new_rhs = convert (lhs_type, rhs); else if (wfl_op1) /* Might be called with a NULL */ ! parse_warning_context ! (wfl_op1, "Constant expression `%s' too wide for narrowing primitive conversion to `%s'", print_int_node (rhs), lang_printable_name (lhs_type, 0)); /* Reported a warning that will turn into an error further down, so we don't return */ --- 13043,13065 ---- else if (valid_builtin_assignconv_identity_widening_p (lhs_type, rhs_type)) new_rhs = convert (lhs_type, rhs); ! /* Try a narrowing primitive conversion (5.1.3): ! - expression is a constant expression of type byte, short, char, ! or int, AND - variable is byte, short or char AND ! - The value of the expression is representable in the type of the variable */ ! else if ((rhs_type == byte_type_node || rhs_type == short_type_node ! || rhs_type == char_type_node || rhs_type == int_type_node) ! && TREE_CONSTANT (rhs) && (lhs_type == byte_type_node || lhs_type == char_type_node || lhs_type == short_type_node)) { if (int_fits_type_p (rhs, lhs_type)) new_rhs = convert (lhs_type, rhs); else if (wfl_op1) /* Might be called with a NULL */ ! parse_warning_context ! (wfl_op1, "Constant expression `%s' too wide for narrowing primitive conversion to `%s'", print_int_node (rhs), lang_printable_name (lhs_type, 0)); /* Reported a warning that will turn into an error further down, so we don't return */ *************** valid_builtin_assignconv_identity_wideni *** 12896,12902 **** /* From here, an integral is widened if its precision is smaller than the precision of the LHS or if the LHS is a floating point type, or the RHS is a float and the RHS a double. */ ! if ((JINTEGRAL_TYPE_P (rhs_type) && JINTEGRAL_TYPE_P (lhs_type) && (TYPE_PRECISION (rhs_type) < TYPE_PRECISION (lhs_type))) || (JINTEGRAL_TYPE_P (rhs_type) && JFLOAT_TYPE_P (lhs_type)) || (rhs_type == float_type_node && lhs_type == double_type_node)) --- 13104,13110 ---- /* From here, an integral is widened if its precision is smaller than the precision of the LHS or if the LHS is a floating point type, or the RHS is a float and the RHS a double. */ ! if ((JINTEGRAL_TYPE_P (rhs_type) && JINTEGRAL_TYPE_P (lhs_type) && (TYPE_PRECISION (rhs_type) < TYPE_PRECISION (lhs_type))) || (JINTEGRAL_TYPE_P (rhs_type) && JFLOAT_TYPE_P (lhs_type)) || (rhs_type == float_type_node && lhs_type == double_type_node)) *************** valid_ref_assignconv_cast_p (source, des *** 12944,12950 **** if (TYPE_CLASS_P (source)) { if (TYPE_CLASS_P (dest)) ! return (source == dest || inherits_from_p (source, dest) || (cast && inherits_from_p (dest, source))); if (TYPE_INTERFACE_P (dest)) --- 13152,13158 ---- if (TYPE_CLASS_P (source)) { if (TYPE_CLASS_P (dest)) ! return (source == dest || inherits_from_p (source, dest) || (cast && inherits_from_p (dest, source))); if (TYPE_INTERFACE_P (dest)) *************** valid_ref_assignconv_cast_p (source, des *** 12985,13000 **** tree source_type; tree source_sig; tree source_name; ! for (method_source = TYPE_METHODS (source); method_source; method_source = TREE_CHAIN (method_source)) { ! source_sig = build_java_argument_signature (TREE_TYPE (method_source)); source_type = TREE_TYPE (TREE_TYPE (method_source)); source_name = DECL_NAME (method_source); for (method_dest = TYPE_METHODS (dest); method_dest; method_dest = TREE_CHAIN (method_dest)) ! if (source_sig == build_java_argument_signature (TREE_TYPE (method_dest)) && source_name == DECL_NAME (method_dest) && source_type != TREE_TYPE (TREE_TYPE (method_dest))) --- 13193,13208 ---- tree source_type; tree source_sig; tree source_name; ! for (method_source = TYPE_METHODS (source); method_source; method_source = TREE_CHAIN (method_source)) { ! source_sig = build_java_argument_signature (TREE_TYPE (method_source)); source_type = TREE_TYPE (TREE_TYPE (method_source)); source_name = DECL_NAME (method_source); for (method_dest = TYPE_METHODS (dest); method_dest; method_dest = TREE_CHAIN (method_dest)) ! if (source_sig == build_java_argument_signature (TREE_TYPE (method_dest)) && source_name == DECL_NAME (method_dest) && source_type != TREE_TYPE (TREE_TYPE (method_dest))) *************** valid_ref_assignconv_cast_p (source, des *** 13009,13017 **** { /* Array */ return (cast ! && (DECL_NAME (TYPE_NAME (source)) == java_lang_cloneable || (DECL_NAME (TYPE_NAME (source)) ! == java_io_serializable))); } } if (TYPE_ARRAY_P (source)) --- 13217,13226 ---- { /* Array */ return (cast ! && (DECL_NAME (TYPE_NAME (source)) ! == java_lang_cloneable_identifier_node || (DECL_NAME (TYPE_NAME (source)) ! == java_io_serializable_identifier_node))); } } if (TYPE_ARRAY_P (source)) *************** valid_ref_assignconv_cast_p (source, des *** 13021,13033 **** /* Can't cast an array to an interface unless the interface is java.lang.Cloneable or java.io.Serializable. */ if (TYPE_INTERFACE_P (dest)) ! return (DECL_NAME (TYPE_NAME (dest)) == java_lang_cloneable ! || DECL_NAME (TYPE_NAME (dest)) == java_io_serializable); else /* Arrays */ { tree source_element_type = TYPE_ARRAY_ELEMENT (source); tree dest_element_type = TYPE_ARRAY_ELEMENT (dest); ! /* In case of severe errors, they turn out null */ if (!dest_element_type || !source_element_type) return 0; --- 13230,13244 ---- /* Can't cast an array to an interface unless the interface is java.lang.Cloneable or java.io.Serializable. */ if (TYPE_INTERFACE_P (dest)) ! return (DECL_NAME (TYPE_NAME (dest)) ! == java_lang_cloneable_identifier_node ! || (DECL_NAME (TYPE_NAME (dest)) ! == java_io_serializable_identifier_node)); else /* Arrays */ { tree source_element_type = TYPE_ARRAY_ELEMENT (source); tree dest_element_type = TYPE_ARRAY_ELEMENT (dest); ! /* In case of severe errors, they turn out null */ if (!dest_element_type || !source_element_type) return 0; *************** do_unary_numeric_promotion (arg) *** 13075,13081 **** return arg; } ! /* Return a non zero value if SOURCE can be converted into DEST using the method invocation conversion rule (5.3). */ static int valid_method_invocation_conversion_p (dest, source) --- 13286,13292 ---- return arg; } ! /* Return a nonzero value if SOURCE can be converted into DEST using the method invocation conversion rule (5.3). */ static int valid_method_invocation_conversion_p (dest, source) *************** operator_string (node) *** 13119,13125 **** sprintf (buffer, "%s%s", S, (COMPOUND_ASSIGN_P (node) ? "=" : "")); \ return buffer; \ } ! static char buffer [10]; switch (TREE_CODE (node)) { --- 13330,13336 ---- sprintf (buffer, "%s%s", S, (COMPOUND_ASSIGN_P (node) ? "=" : "")); \ return buffer; \ } ! static char buffer [10]; switch (TREE_CODE (node)) { *************** java_decl_equiv (var_acc1, var_acc2) *** 13166,13172 **** { if (JDECL_P (var_acc1)) return (var_acc1 == var_acc2); ! return (TREE_CODE (var_acc1) == COMPONENT_REF && TREE_CODE (var_acc2) == COMPONENT_REF && TREE_OPERAND (TREE_OPERAND (var_acc1, 0), 0) --- 13377,13383 ---- { if (JDECL_P (var_acc1)) return (var_acc1 == var_acc2); ! return (TREE_CODE (var_acc1) == COMPONENT_REF && TREE_CODE (var_acc2) == COMPONENT_REF && TREE_OPERAND (TREE_OPERAND (var_acc1, 0), 0) *************** java_decl_equiv (var_acc1, var_acc2) *** 13174,13180 **** && TREE_OPERAND (var_acc1, 1) == TREE_OPERAND (var_acc2, 1)); } ! /* Return a non zero value if CODE is one of the operators that can be used in conjunction with the `=' operator in a compound assignment. */ static int --- 13385,13391 ---- && TREE_OPERAND (var_acc1, 1) == TREE_OPERAND (var_acc2, 1)); } ! /* Return a nonzero value if CODE is one of the operators that can be used in conjunction with the `=' operator in a compound assignment. */ static int *************** java_refold (t) *** 13208,13214 **** /* Now the left branch of the binary operator. */ b = TREE_OPERAND (TREE_OPERAND (c, 1), 0); ! if (! (b && TREE_CODE (b) == NOP_EXPR && TREE_CODE (TREE_OPERAND (b, 0)) == SAVE_EXPR)) return t; --- 13419,13425 ---- /* Now the left branch of the binary operator. */ b = TREE_OPERAND (TREE_OPERAND (c, 1), 0); ! if (! (b && TREE_CODE (b) == NOP_EXPR && TREE_CODE (TREE_OPERAND (b, 0)) == SAVE_EXPR)) return t; *************** patch_binop (node, wfl_op1, wfl_op2) *** 13262,13268 **** error situation, unless it's too early to tell (in case we're handling a `+', `==', `!=' or `instanceof'.) We want to set op_type correctly so the error can be later on reported accurately. */ ! if (! (code == PLUS_EXPR || code == NE_EXPR || code == EQ_EXPR || code == INSTANCEOF_EXPR)) { tree n; --- 13473,13479 ---- error situation, unless it's too early to tell (in case we're handling a `+', `==', `!=' or `instanceof'.) We want to set op_type correctly so the error can be later on reported accurately. */ ! if (! (code == PLUS_EXPR || code == NE_EXPR || code == EQ_EXPR || code == INSTANCEOF_EXPR)) { tree n; *************** patch_binop (node, wfl_op1, wfl_op2) *** 13307,13313 **** parse_warning_context (wfl_operator, "Evaluating this expression will result in an arithmetic exception being thrown"); TREE_CONSTANT (node) = 0; } ! /* Change the division operator if necessary */ if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE) TREE_SET_CODE (node, TRUNC_DIV_EXPR); --- 13518,13524 ---- parse_warning_context (wfl_operator, "Evaluating this expression will result in an arithmetic exception being thrown"); TREE_CONSTANT (node) = 0; } ! /* Change the division operator if necessary */ if (code == RDIV_EXPR && TREE_CODE (prom_type) == INTEGER_TYPE) TREE_SET_CODE (node, TRUNC_DIV_EXPR); *************** patch_binop (node, wfl_op1, wfl_op2) *** 13330,13336 **** && ! flag_emit_class_files && (code == RDIV_EXPR || code == TRUNC_MOD_EXPR)) return build_java_soft_divmod (TREE_CODE (node), prom_type, op1, op2); ! /* This one is more complicated. FLOATs are processed by a function call to soft_fmod. Duplicate the value of the COMPOUND_ASSIGN_P flag. */ --- 13541,13547 ---- && ! flag_emit_class_files && (code == RDIV_EXPR || code == TRUNC_MOD_EXPR)) return build_java_soft_divmod (TREE_CODE (node), prom_type, op1, op2); ! /* This one is more complicated. FLOATs are processed by a function call to soft_fmod. Duplicate the value of the COMPOUND_ASSIGN_P flag. */ *************** patch_binop (node, wfl_op1, wfl_op2) *** 13352,13358 **** purpose of the a previous usage of the String concatenation operator */ ! if (TREE_CODE (op1) == STRING_CST || TREE_CODE (op2) == STRING_CST || JSTRING_TYPE_P (op1_type) || JSTRING_TYPE_P (op2_type) --- 13563,13569 ---- purpose of the a previous usage of the String concatenation operator */ ! if (TREE_CODE (op1) == STRING_CST || TREE_CODE (op2) == STRING_CST || JSTRING_TYPE_P (op1_type) || JSTRING_TYPE_P (op2_type) *************** patch_binop (node, wfl_op1, wfl_op2) *** 13392,13398 **** lang_printable_name (op2_type, 0)); else parse_error_context (wfl_operator, ! "Incompatible type for `%s'. Can't convert shift distance from `%s' to integral", operator_string (node), lang_printable_name (op2_type, 0)); } --- 13603,13609 ---- lang_printable_name (op2_type, 0)); else parse_error_context (wfl_operator, ! "Incompatible type for `%s'. Can't convert shift distance from `%s' to integral", operator_string (node), lang_printable_name (op2_type, 0)); } *************** patch_binop (node, wfl_op1, wfl_op2) *** 13406,13428 **** op1 = do_unary_numeric_promotion (op1); op2 = do_unary_numeric_promotion (op2); /* The type of the shift expression is the type of the promoted type of the left-hand operand */ prom_type = TREE_TYPE (op1); /* Shift int only up to 0x1f and long up to 0x3f */ if (prom_type == int_type_node) ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x1f, 0))); else ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x3f, 0))); /* The >>> operator is a >> operating on unsigned quantities */ if (code == URSHIFT_EXPR && ! flag_emit_class_files) { tree to_return; ! tree utype = unsigned_type (prom_type); op1 = convert (utype, op1); TREE_SET_CODE (node, RSHIFT_EXPR); TREE_OPERAND (node, 0) = op1; --- 13617,13644 ---- op1 = do_unary_numeric_promotion (op1); op2 = do_unary_numeric_promotion (op2); + /* If the right hand side is of type `long', first cast it to + `int'. */ + if (TREE_TYPE (op2) == long_type_node) + op2 = build1 (CONVERT_EXPR, int_type_node, op2); + /* The type of the shift expression is the type of the promoted type of the left-hand operand */ prom_type = TREE_TYPE (op1); /* Shift int only up to 0x1f and long up to 0x3f */ if (prom_type == int_type_node) ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x1f, 0))); else ! op2 = fold (build (BIT_AND_EXPR, int_type_node, op2, build_int_2 (0x3f, 0))); /* The >>> operator is a >> operating on unsigned quantities */ if (code == URSHIFT_EXPR && ! flag_emit_class_files) { tree to_return; ! tree utype = java_unsigned_type (prom_type); op1 = convert (utype, op1); TREE_SET_CODE (node, RSHIFT_EXPR); TREE_OPERAND (node, 0) = op1; *************** patch_binop (node, wfl_op1, wfl_op2) *** 13442,13447 **** --- 13658,13672 ---- TREE_TYPE (node) = boolean_type_node; + /* OP1_TYPE might be NULL when OP1 is a string constant. */ + if ((cn = patch_string (op1))) + { + op1 = cn; + op1_type = TREE_TYPE (op1); + } + if (op1_type == NULL_TREE) + abort (); + if (!(op2_type = resolve_type_during_patch (op2))) return error_mark_node; *************** patch_binop (node, wfl_op1, wfl_op2) *** 13480,13492 **** { char *t1 = xstrdup (lang_printable_name (op1_type, 0)); SET_WFL_OPERATOR (wfl_operator, node, wfl_op1); ! parse_error_context (wfl_operator, "Impossible for `%s' to be instance of `%s'", t1, lang_printable_name (op2_type, 0)); free (t1); error_found = 1; } ! break; /* 15.21 Bitwise and Logical Operators */ --- 13705,13717 ---- { char *t1 = xstrdup (lang_printable_name (op1_type, 0)); SET_WFL_OPERATOR (wfl_operator, node, wfl_op1); ! parse_error_context (wfl_operator, "Impossible for `%s' to be instance of `%s'", t1, lang_printable_name (op2_type, 0)); free (t1); error_found = 1; } ! break; /* 15.21 Bitwise and Logical Operators */ *************** patch_binop (node, wfl_op1, wfl_op2) *** 13498,13504 **** expression retain that type */ prom_type = binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op1_type) == BOOLEAN_TYPE) /* The type of the bitwise operator expression is BOOLEAN */ prom_type = boolean_type_node; --- 13723,13729 ---- expression retain that type */ prom_type = binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op1_type) == BOOLEAN_TYPE) /* The type of the bitwise operator expression is BOOLEAN */ prom_type = boolean_type_node; *************** patch_binop (node, wfl_op1, wfl_op2) *** 13520,13526 **** /* 15.23 Conditional-Or Operator */ case TRUTH_ORIF_EXPR: /* Operands must be of BOOLEAN type */ ! if (TREE_CODE (op1_type) != BOOLEAN_TYPE || TREE_CODE (op2_type) != BOOLEAN_TYPE) { if (TREE_CODE (op1_type) != BOOLEAN_TYPE) --- 13745,13751 ---- /* 15.23 Conditional-Or Operator */ case TRUTH_ORIF_EXPR: /* Operands must be of BOOLEAN type */ ! if (TREE_CODE (op1_type) != BOOLEAN_TYPE || TREE_CODE (op2_type) != BOOLEAN_TYPE) { if (TREE_CODE (op1_type) != BOOLEAN_TYPE) *************** patch_binop (node, wfl_op1, wfl_op2) *** 13570,13617 **** case EQ_EXPR: case NE_EXPR: /* It's time for us to patch the strings. */ ! if ((cn = patch_string (op1))) { op1 = cn; op1_type = TREE_TYPE (op1); } ! if ((cn = patch_string (op2))) { op2 = cn; op2_type = TREE_TYPE (op2); } ! /* 15.20.1 Numerical Equality Operators == and != */ /* Binary numeric promotion is performed on the operands */ if (JNUMERIC_TYPE_P (op1_type) && JNUMERIC_TYPE_P (op2_type)) binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! /* 15.20.2 Boolean Equality Operators == and != */ else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op2_type) == BOOLEAN_TYPE) ; /* Nothing to do here */ ! /* 15.20.3 Reference Equality Operators == and != */ /* Types have to be either references or the null type. If they're references, it must be possible to convert either type to the other by casting conversion. */ ! else if (op1 == null_pointer_node || op2 == null_pointer_node || (JREFERENCE_TYPE_P (op1_type) && JREFERENCE_TYPE_P (op2_type) && (valid_ref_assignconv_cast_p (op1_type, op2_type, 1) ! || valid_ref_assignconv_cast_p (op2_type, op1_type, 1)))) ; /* Nothing to do here */ ! /* Else we have an error figure what can't be converted into what and report the error */ else { char *t1; t1 = xstrdup (lang_printable_name (op1_type, 0)); ! parse_error_context (wfl_operator, "Incompatible type for `%s'. Can't convert `%s' to `%s'", ! operator_string (node), t1, lang_printable_name (op2_type, 0)); free (t1); TREE_TYPE (node) = boolean_type_node; --- 13795,13842 ---- case EQ_EXPR: case NE_EXPR: /* It's time for us to patch the strings. */ ! if ((cn = patch_string (op1))) { op1 = cn; op1_type = TREE_TYPE (op1); } ! if ((cn = patch_string (op2))) { op2 = cn; op2_type = TREE_TYPE (op2); } ! /* 15.20.1 Numerical Equality Operators == and != */ /* Binary numeric promotion is performed on the operands */ if (JNUMERIC_TYPE_P (op1_type) && JNUMERIC_TYPE_P (op2_type)) binary_numeric_promotion (op1_type, op2_type, &op1, &op2); ! /* 15.20.2 Boolean Equality Operators == and != */ else if (TREE_CODE (op1_type) == BOOLEAN_TYPE && TREE_CODE (op2_type) == BOOLEAN_TYPE) ; /* Nothing to do here */ ! /* 15.20.3 Reference Equality Operators == and != */ /* Types have to be either references or the null type. If they're references, it must be possible to convert either type to the other by casting conversion. */ ! else if (op1 == null_pointer_node || op2 == null_pointer_node || (JREFERENCE_TYPE_P (op1_type) && JREFERENCE_TYPE_P (op2_type) && (valid_ref_assignconv_cast_p (op1_type, op2_type, 1) ! || valid_ref_assignconv_cast_p (op2_type, op1_type, 1)))) ; /* Nothing to do here */ ! /* Else we have an error figure what can't be converted into what and report the error */ else { char *t1; t1 = xstrdup (lang_printable_name (op1_type, 0)); ! parse_error_context (wfl_operator, "Incompatible type for `%s'. Can't convert `%s' to `%s'", ! operator_string (node), t1, lang_printable_name (op2_type, 0)); free (t1); TREE_TYPE (node) = boolean_type_node; *************** patch_binop (node, wfl_op1, wfl_op2) *** 13631,13637 **** TREE_OPERAND (node, 1) = op2; TREE_TYPE (node) = prom_type; TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2); ! if (flag_emit_xref) return node; --- 13856,13862 ---- TREE_OPERAND (node, 1) = op2; TREE_TYPE (node) = prom_type; TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2); ! if (flag_emit_xref) return node; *************** do_merge_string_cste (cste, string, stri *** 13674,13715 **** } /* Tries to merge OP1 (a STRING_CST) and OP2 (if suitable). Return a ! new STRING_CST on success, NULL_TREE on failure */ static tree merge_string_cste (op1, op2, after) tree op1, op2; int after; { ! /* Handle two string constants right away */ if (TREE_CODE (op2) == STRING_CST) ! return do_merge_string_cste (op1, TREE_STRING_POINTER (op2), TREE_STRING_LENGTH (op2), after); ! ! /* Reasonable integer constant can be treated right away */ if (TREE_CODE (op2) == INTEGER_CST && !TREE_CONSTANT_OVERFLOW (op2)) { static const char *const boolean_true = "true"; static const char *const boolean_false = "false"; static const char *const null_pointer = "null"; ! char ch[3]; const char *string; ! if (op2 == boolean_true_node) string = boolean_true; else if (op2 == boolean_false_node) string = boolean_false; else if (op2 == null_pointer_node) string = null_pointer; else if (TREE_TYPE (op2) == char_type_node) { ! ch[0] = (char )TREE_INT_CST_LOW (op2); ! ch[1] = '\0'; string = ch; } else ! string = print_int_node (op2); ! return do_merge_string_cste (op1, string, strlen (string), after); } return NULL_TREE; --- 13899,13959 ---- } /* Tries to merge OP1 (a STRING_CST) and OP2 (if suitable). Return a ! new STRING_CST on success, NULL_TREE on failure. */ static tree merge_string_cste (op1, op2, after) tree op1, op2; int after; { ! /* Handle two string constants right away. */ if (TREE_CODE (op2) == STRING_CST) ! return do_merge_string_cste (op1, TREE_STRING_POINTER (op2), TREE_STRING_LENGTH (op2), after); ! ! /* Reasonable integer constant can be treated right away. */ if (TREE_CODE (op2) == INTEGER_CST && !TREE_CONSTANT_OVERFLOW (op2)) { static const char *const boolean_true = "true"; static const char *const boolean_false = "false"; static const char *const null_pointer = "null"; ! char ch[4]; const char *string; ! if (op2 == boolean_true_node) string = boolean_true; else if (op2 == boolean_false_node) string = boolean_false; else if (op2 == null_pointer_node) + /* FIXME: null is not a compile-time constant, so it is only safe to + merge if the overall expression is non-constant. However, this + code always merges without checking the overall expression. */ string = null_pointer; else if (TREE_TYPE (op2) == char_type_node) { ! /* Convert the character into UTF-8. */ ! unsigned int c = (unsigned int) TREE_INT_CST_LOW (op2); ! unsigned char *p = (unsigned char *) ch; ! if (0x01 <= c && c <= 0x7f) ! *p++ = (unsigned char) c; ! else if (c < 0x7ff) ! { ! *p++ = (unsigned char) (c >> 6 | 0xc0); ! *p++ = (unsigned char) ((c & 0x3f) | 0x80); ! } ! else ! { ! *p++ = (unsigned char) (c >> 12 | 0xe0); ! *p++ = (unsigned char) (((c >> 6) & 0x3f) | 0x80); ! *p++ = (unsigned char) ((c & 0x3f) | 0x80); ! } ! *p = '\0'; ! string = ch; } else ! string = string_convert_int_cst (op2); ! return do_merge_string_cste (op1, string, strlen (string), after); } return NULL_TREE; *************** string_constant_concatenation (op1, op2) *** 13731,13741 **** { tree string, rest; int invert; ! string = (TREE_CODE (op1) == STRING_CST ? op1 : op2); rest = (string == op1 ? op2 : op1); invert = (string == op1 ? 0 : 1 ); ! /* Walk REST, only if it looks reasonable */ if (TREE_CODE (rest) != STRING_CST && !IS_CRAFTED_STRING_BUFFER_P (rest) --- 13975,13985 ---- { tree string, rest; int invert; ! string = (TREE_CODE (op1) == STRING_CST ? op1 : op2); rest = (string == op1 ? op2 : op1); invert = (string == op1 ? 0 : 1 ); ! /* Walk REST, only if it looks reasonable */ if (TREE_CODE (rest) != STRING_CST && !IS_CRAFTED_STRING_BUFFER_P (rest) *************** build_string_concatenation (op1, op2) *** 13767,13773 **** if (flag_emit_xref) return build (PLUS_EXPR, string_type_node, op1, op2); ! /* Try to do some static optimization */ if ((result = string_constant_concatenation (op1, op2))) return result; --- 14011,14017 ---- if (flag_emit_xref) return build (PLUS_EXPR, string_type_node, op1, op2); ! /* Try to do some static optimization */ if ((result = string_constant_concatenation (op1, op2))) return result; *************** build_string_concatenation (op1, op2) *** 13788,13802 **** op2 = patch_string_cst (op2); /* If either one of the constant is null and the other non null ! operand is a String object, return it. */ ! if (JSTRING_TYPE_P (TREE_TYPE (op1)) && !op2) return op1; /* If OP1 isn't already a StringBuffer, create and initialize a new one */ if (!IS_CRAFTED_STRING_BUFFER_P (op1)) { ! /* Two solutions here: 1) OP1 is a constant string reference, we call new StringBuffer(OP1) 2) OP1 is something else, we call new StringBuffer().append(OP1). */ if (TREE_CONSTANT (op1) && JSTRING_TYPE_P (TREE_TYPE (op1))) --- 14032,14046 ---- op2 = patch_string_cst (op2); /* If either one of the constant is null and the other non null ! operand is a String constant, return it. */ ! if ((TREE_CODE (op1) == STRING_CST) && !op2) return op1; /* If OP1 isn't already a StringBuffer, create and initialize a new one */ if (!IS_CRAFTED_STRING_BUFFER_P (op1)) { ! /* Two solutions here: 1) OP1 is a constant string reference, we call new StringBuffer(OP1) 2) OP1 is something else, we call new StringBuffer().append(OP1). */ if (TREE_CONSTANT (op1) && JSTRING_TYPE_P (TREE_TYPE (op1))) *************** build_incdec (op_token, op_location, op1 *** 13907,13925 **** tree op1; int is_post_p; { ! static const enum tree_code lookup [2][2] = { { PREDECREMENT_EXPR, PREINCREMENT_EXPR, }, { POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, }, }; ! tree node = build (lookup [is_post_p][(op_token - DECR_TK)], NULL_TREE, op1, NULL_TREE); TREE_SIDE_EFFECTS (node) = 1; /* Store the location of the operator, for better error report. The string of the operator will be rebuild based on the OP value. */ EXPR_WFL_LINECOL (node) = op_location; return node; ! } /* Build an incomplete cast operator, based on the use of the CONVERT_EXPR. Note that TREE_TYPE of the constructed node is --- 14151,14169 ---- tree op1; int is_post_p; { ! static const enum tree_code lookup [2][2] = { { PREDECREMENT_EXPR, PREINCREMENT_EXPR, }, { POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, }, }; ! tree node = build (lookup [is_post_p][(op_token - DECR_TK)], NULL_TREE, op1, NULL_TREE); TREE_SIDE_EFFECTS (node) = 1; /* Store the location of the operator, for better error report. The string of the operator will be rebuild based on the OP value. */ EXPR_WFL_LINECOL (node) = op_location; return node; ! } /* Build an incomplete cast operator, based on the use of the CONVERT_EXPR. Note that TREE_TYPE of the constructed node is *************** patch_incomplete_class_ref (node) *** 13958,13964 **** if (!(ref_type = resolve_type_during_patch (type))) return error_mark_node; ! if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type)) { tree dot = build_class_ref (ref_type); /* A class referenced by `foo.class' is initialized. */ --- 14202,14209 ---- if (!(ref_type = resolve_type_during_patch (type))) return error_mark_node; ! if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type) ! || TREE_CODE (ref_type) == VOID_TYPE) { tree dot = build_class_ref (ref_type); /* A class referenced by `foo.class' is initialized. */ *************** patch_unaryop (node, wfl_op) *** 14020,14026 **** decl = DECL_FUNCTION_ACCESS_DECL (decl); } /* We really should have a JAVA_ARRAY_EXPR to avoid this */ ! else if (!JDECL_P (decl) && TREE_CODE (decl) != COMPONENT_REF && !(flag_emit_class_files && TREE_CODE (decl) == ARRAY_REF) && TREE_CODE (decl) != INDIRECT_REF --- 14265,14271 ---- decl = DECL_FUNCTION_ACCESS_DECL (decl); } /* We really should have a JAVA_ARRAY_EXPR to avoid this */ ! else if (!JDECL_P (decl) && TREE_CODE (decl) != COMPONENT_REF && !(flag_emit_class_files && TREE_CODE (decl) == ARRAY_REF) && TREE_CODE (decl) != INDIRECT_REF *************** patch_unaryop (node, wfl_op) *** 14031,14037 **** TREE_TYPE (node) = error_mark_node; error_found = 1; } ! /* From now on, we know that op if a variable and that it has a valid wfl. We use wfl_op to locate errors related to the ++/-- operand. */ --- 14276,14282 ---- TREE_TYPE (node) = error_mark_node; error_found = 1; } ! /* From now on, we know that op if a variable and that it has a valid wfl. We use wfl_op to locate errors related to the ++/-- operand. */ *************** patch_unaryop (node, wfl_op) *** 14055,14062 **** else { value = build_int_2 (1, 0); ! TREE_TYPE (node) = ! binary_numeric_promotion (op_type, TREE_TYPE (value), &op, &value); } --- 14300,14307 ---- else { value = build_int_2 (1, 0); ! TREE_TYPE (node) = ! binary_numeric_promotion (op_type, TREE_TYPE (value), &op, &value); } *************** patch_unaryop (node, wfl_op) *** 14064,14073 **** if (outer_field_flag) { /* We re-generate an access to the field */ ! value = build (PLUS_EXPR, TREE_TYPE (op), build_outer_field_access (wfl_op, decl), value); ! ! /* And we patch the original access$() into a write with plus_op as a rhs */ return outer_field_access_fix (node, op, value); } --- 14309,14318 ---- if (outer_field_flag) { /* We re-generate an access to the field */ ! value = build (PLUS_EXPR, TREE_TYPE (op), build_outer_field_access (wfl_op, decl), value); ! ! /* And we patch the original access$() into a write with plus_op as a rhs */ return outer_field_access_fix (node, op, value); } *************** patch_unaryop (node, wfl_op) *** 14152,14158 **** } break; } ! if (error_found) return error_mark_node; --- 14397,14403 ---- } break; } ! if (error_found) return error_mark_node; *************** resolve_type_during_patch (type) *** 14178,14184 **** tree type_decl = resolve_and_layout (EXPR_WFL_NODE (type), type); if (!type_decl) { ! parse_error_context (type, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (type))); return NULL_TREE; --- 14423,14429 ---- tree type_decl = resolve_and_layout (EXPR_WFL_NODE (type), type); if (!type_decl) { ! parse_error_context (type, "Class `%s' not found in type declaration", IDENTIFIER_POINTER (EXPR_WFL_NODE (type))); return NULL_TREE; *************** patch_cast (node, wfl_op) *** 14237,14243 **** /* The remaining legal casts involve conversion between reference types. Check for their compile time correctness. */ ! if (JREFERENCE_TYPE_P (op_type) && JREFERENCE_TYPE_P (cast_type) && valid_ref_assignconv_cast_p (op_type, cast_type, 1)) { TREE_TYPE (node) = promote_type (cast_type); --- 14482,14488 ---- /* The remaining legal casts involve conversion between reference types. Check for their compile time correctness. */ ! if (JREFERENCE_TYPE_P (op_type) && JREFERENCE_TYPE_P (cast_type) && valid_ref_assignconv_cast_p (op_type, cast_type, 1)) { TREE_TYPE (node) = promote_type (cast_type); *************** patch_array_ref (node) *** 14316,14322 **** /* The array reference must be an array */ if (!TYPE_ARRAY_P (array_type)) { ! parse_error_context (wfl_operator, "`[]' can only be applied to arrays. It can't be applied to `%s'", lang_printable_name (array_type, 0)); --- 14561,14567 ---- /* The array reference must be an array */ if (!TYPE_ARRAY_P (array_type)) { ! parse_error_context (wfl_operator, "`[]' can only be applied to arrays. It can't be applied to `%s'", lang_printable_name (array_type, 0)); *************** build_newarray_node (type, dims, extra_d *** 14366,14372 **** int extra_dims; { tree node = ! build (NEW_ARRAY_EXPR, NULL_TREE, type, nreverse (dims), build_int_2 (extra_dims, 0)); return node; } --- 14611,14617 ---- int extra_dims; { tree node = ! build (NEW_ARRAY_EXPR, NULL_TREE, type, nreverse (dims), build_int_2 (extra_dims, 0)); return node; } *************** patch_newarray (node) *** 14408,14416 **** /* Report errors on types here */ if (dim_error) { ! parse_error_context ! (TREE_PURPOSE (cdim), ! "Incompatible type for dimension in array creation expression. %s convert `%s' to `int'", (valid_cast_to_p (TREE_TYPE (dim), int_type_node) ? "Explicit cast needed to" : "Can't"), lang_printable_name (TREE_TYPE (dim), 0)); --- 14653,14661 ---- /* Report errors on types here */ if (dim_error) { ! parse_error_context ! (TREE_PURPOSE (cdim), ! "Incompatible type for dimension in array creation expression. %s convert `%s' to `int'", (valid_cast_to_p (TREE_TYPE (dim), int_type_node) ? "Explicit cast needed to" : "Can't"), lang_printable_name (TREE_TYPE (dim), 0)); *************** patch_newarray (node) *** 14459,14471 **** (primitive or not) matters. */ if (ndims == 1) return build_new_array (type, TREE_VALUE (dims)); ! /* Can't reuse what's already written in expr.c because it uses the JVM stack representation. Provide a build_multianewarray. FIXME */ return build (CALL_EXPR, array_type, build_address_of (soft_multianewarray_node), tree_cons (NULL_TREE, build_class_ref (TREE_TYPE (array_type)), ! tree_cons (NULL_TREE, build_int_2 (ndims, 0), dims )), NULL_TREE); } --- 14704,14716 ---- (primitive or not) matters. */ if (ndims == 1) return build_new_array (type, TREE_VALUE (dims)); ! /* Can't reuse what's already written in expr.c because it uses the JVM stack representation. Provide a build_multianewarray. FIXME */ return build (CALL_EXPR, array_type, build_address_of (soft_multianewarray_node), tree_cons (NULL_TREE, build_class_ref (TREE_TYPE (array_type)), ! tree_cons (NULL_TREE, build_int_2 (ndims, 0), dims )), NULL_TREE); } *************** patch_new_array_init (type, node) *** 14546,14552 **** TREE_PURPOSE (current) = NULL_TREE; all_constant = 0; } ! if (elt && TREE_CODE (elt) == TREE_LIST && TREE_VALUE (elt) == error_mark_node) error_seen = 1; } --- 14791,14797 ---- TREE_PURPOSE (current) = NULL_TREE; all_constant = 0; } ! if (elt && TREE_CODE (elt) == TREE_LIST && TREE_VALUE (elt) == error_mark_node) error_seen = 1; } *************** array_constructor_check_entry (type, ent *** 14586,14594 **** value = patched; if (value == error_mark_node) return 1; ! type_value = TREE_TYPE (value); ! /* At anytime, try_builtin_assignconv can report a warning on constant overflow during narrowing. */ SET_WFL_OPERATOR (wfl_operator, TREE_PURPOSE (entry), wfl_value); --- 14831,14839 ---- value = patched; if (value == error_mark_node) return 1; ! type_value = TREE_TYPE (value); ! /* At anytime, try_builtin_assignconv can report a warning on constant overflow during narrowing. */ SET_WFL_OPERATOR (wfl_operator, TREE_PURPOSE (entry), wfl_value); *************** array_constructor_check_entry (type, ent *** 14603,14614 **** "Can't" : "Explicit cast needed to"); if (!array_type_string) array_type_string = xstrdup (lang_printable_name (type, 1)); ! parse_error_context (wfl_operator, "Incompatible type for array. %s convert `%s' to `%s'", msg, lang_printable_name (type_value, 1), array_type_string); error_seen = 1; } ! if (new_value) TREE_VALUE (entry) = new_value; --- 14848,14859 ---- "Can't" : "Explicit cast needed to"); if (!array_type_string) array_type_string = xstrdup (lang_printable_name (type, 1)); ! parse_error_context (wfl_operator, "Incompatible type for array. %s convert `%s' to `%s'", msg, lang_printable_name (type_value, 1), array_type_string); error_seen = 1; } ! if (new_value) TREE_VALUE (entry) = new_value; *************** patch_return (node) *** 14669,14675 **** isn't declared with the keyword `void' */ if (!return_exp && (mtype != void_type_node && !DECL_CONSTRUCTOR_P (meth))) error_found = 2; ! if (DECL_INSTINIT_P (current_function_decl)) error_found = 1; --- 14914,14920 ---- isn't declared with the keyword `void' */ if (!return_exp && (mtype != void_type_node && !DECL_CONSTRUCTOR_P (meth))) error_found = 2; ! if (DECL_INSTINIT_P (current_function_decl)) error_found = 1; *************** patch_return (node) *** 14678,14684 **** if (DECL_INSTINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside instance initializer"); ! else if (DECL_CLINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside static initializer"); --- 14923,14929 ---- if (DECL_INSTINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside instance initializer"); ! else if (DECL_CLINIT_P (current_function_decl)) parse_error_context (wfl_operator, "`return' inside static initializer"); *************** patch_return (node) *** 14686,14699 **** else if (!DECL_CONSTRUCTOR_P (meth)) { char *t = xstrdup (lang_printable_name (mtype, 0)); ! parse_error_context (wfl_operator, "`return' with%s value from `%s %s'", ! (error_found == 1 ? "" : "out"), t, lang_printable_name (meth, 0)); free (t); } else ! parse_error_context (wfl_operator, "`return' with value from constructor `%s'", lang_printable_name (meth, 0)); return error_mark_node; --- 14931,14944 ---- else if (!DECL_CONSTRUCTOR_P (meth)) { char *t = xstrdup (lang_printable_name (mtype, 0)); ! parse_error_context (wfl_operator, "`return' with%s value from `%s %s'", ! (error_found == 1 ? "" : "out"), t, lang_printable_name (meth, 0)); free (t); } else ! parse_error_context (wfl_operator, "`return' with value from constructor `%s'", lang_printable_name (meth, 0)); return error_mark_node; *************** patch_return (node) *** 14709,14715 **** if ((patched = patch_string (exp))) exp = patched; ! modify = build (MODIFY_EXPR, NULL_TREE, DECL_RESULT (meth), exp); EXPR_WFL_LINECOL (modify) = EXPR_WFL_LINECOL (node); modify = java_complete_tree (modify); --- 14954,14960 ---- if ((patched = patch_string (exp))) exp = patched; ! modify = build (MODIFY_EXPR, NULL_TREE, DECL_RESULT (meth), exp); EXPR_WFL_LINECOL (modify) = EXPR_WFL_LINECOL (node); modify = java_complete_tree (modify); *************** patch_if_else_statement (node) *** 14759,14771 **** if (TREE_TYPE (expression) != boolean_type_node && TREE_TYPE (expression) != promoted_boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for `if'. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } ! if (TREE_CODE (expression) == INTEGER_CST) { if (integer_zerop (expression)) --- 15004,15016 ---- if (TREE_TYPE (expression) != boolean_type_node && TREE_TYPE (expression) != promoted_boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for `if'. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } ! if (TREE_CODE (expression) == INTEGER_CST) { if (integer_zerop (expression)) *************** build_labeled_block (location, label) *** 14811,14817 **** parse_error_context (wfl_operator, "Declaration of `%s' shadows a previous label declaration", IDENTIFIER_POINTER (label)); ! EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (IDENTIFIER_LOCAL_VALUE (label_name)); parse_error_context (wfl_operator, "This is the location of the previous declaration of label `%s'", --- 15056,15062 ---- parse_error_context (wfl_operator, "Declaration of `%s' shadows a previous label declaration", IDENTIFIER_POINTER (label)); ! EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (IDENTIFIER_LOCAL_VALUE (label_name)); parse_error_context (wfl_operator, "This is the location of the previous declaration of label `%s'", *************** build_new_loop (loop_body) *** 14861,14871 **** COMPOUND_EXPR (loop main body) EXIT_EXPR (this order is for while/for loops. LABELED_BLOCK_EXPR the order is reversed for do loops) ! LABEL_DECL (a continue occurring here branches at the BODY end of this labeled block) INCREMENT (if any) ! REVERSED, if non zero, tells that the loop condition expr comes after the body, like in the do-while loop. To obtain a loop, the loop body structure described above is --- 15106,15116 ---- COMPOUND_EXPR (loop main body) EXIT_EXPR (this order is for while/for loops. LABELED_BLOCK_EXPR the order is reversed for do loops) ! LABEL_DECL (a continue occurring here branches at the BODY end of this labeled block) INCREMENT (if any) ! REVERSED, if nonzero, tells that the loop condition expr comes after the body, like in the do-while loop. To obtain a loop, the loop body structure described above is *************** build_loop_body (location, condition, re *** 14892,14899 **** body = build_labeled_block (0, continue_identifier_node); first = (reversed ? body : condition); second = (reversed ? condition : body); ! return ! build (COMPOUND_EXPR, NULL_TREE, build (COMPOUND_EXPR, NULL_TREE, first, second), empty_stmt_node); } --- 15137,15144 ---- body = build_labeled_block (0, continue_identifier_node); first = (reversed ? body : condition); second = (reversed ? condition : body); ! return ! build (COMPOUND_EXPR, NULL_TREE, build (COMPOUND_EXPR, NULL_TREE, first, second), empty_stmt_node); } *************** finish_for_loop (location, condition, up *** 14935,14941 **** /* Put the condition and the loop body in place */ tree loop = finish_loop_body (location, condition, body, 0); /* LOOP is the current loop which has been now popped of the loop ! stack. Install the update block */ LOOP_EXPR_BODY_UPDATE_BLOCK (LOOP_EXPR_BODY (loop)) = update; return loop; } --- 15180,15206 ---- /* Put the condition and the loop body in place */ tree loop = finish_loop_body (location, condition, body, 0); /* LOOP is the current loop which has been now popped of the loop ! stack. Mark the update block as reachable and install it. We do ! this because the (current interpretation of the) JLS requires ! that the update expression be considered reachable even if the ! for loop's body doesn't complete normally. */ ! if (update != NULL_TREE && update != empty_stmt_node) ! { ! tree up2 = update; ! if (TREE_CODE (up2) == EXPR_WITH_FILE_LOCATION) ! up2 = EXPR_WFL_NODE (up2); ! /* It is possible for the update expression to be an ! EXPR_WFL_NODE wrapping nothing. */ ! if (up2 != NULL_TREE && up2 != empty_stmt_node) ! { ! /* Try to detect constraint violations. These would be ! programming errors somewhere. */ ! if (! IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (up2))) ! || TREE_CODE (up2) == LOOP_EXPR) ! abort (); ! SUPPRESS_UNREACHABLE_ERROR (up2) = 1; ! } ! } LOOP_EXPR_BODY_UPDATE_BLOCK (LOOP_EXPR_BODY (loop)) = update; return loop; } *************** build_bc_statement (location, is_break, *** 15022,15028 **** if (name) { ! if (!(label_block_expr = IDENTIFIER_LOCAL_VALUE (merge_qualified_name (label_id, EXPR_WFL_NODE (name))))) /* Null means that we don't have a target for this named break/continue. In this case, we make the target to be the --- 15287,15293 ---- if (name) { ! if (!(label_block_expr = IDENTIFIER_LOCAL_VALUE (merge_qualified_name (label_id, EXPR_WFL_NODE (name))))) /* Null means that we don't have a target for this named break/continue. In this case, we make the target to be the *************** build_bc_statement (location, is_break, *** 15032,15038 **** } /* Unlabeled break/continue will be handled during the break/continue patch operation */ ! break_continue = build (EXIT_BLOCK_EXPR, NULL_TREE, label_block_expr, NULL_TREE); IS_BREAK_STMT_P (break_continue) = is_break; --- 15297,15303 ---- } /* Unlabeled break/continue will be handled during the break/continue patch operation */ ! break_continue = build (EXIT_BLOCK_EXPR, NULL_TREE, label_block_expr, NULL_TREE); IS_BREAK_STMT_P (break_continue) = is_break; *************** patch_bc_statement (node) *** 15051,15057 **** tree bc_label = EXIT_BLOCK_LABELED_BLOCK (node), target_stmt; tree labeled_block = ctxp->current_labeled_block; EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! /* Having an identifier here means that the target is unknown. */ if (bc_label != NULL_TREE && TREE_CODE (bc_label) == IDENTIFIER_NODE) { --- 15316,15322 ---- tree bc_label = EXIT_BLOCK_LABELED_BLOCK (node), target_stmt; tree labeled_block = ctxp->current_labeled_block; EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node); ! /* Having an identifier here means that the target is unknown. */ if (bc_label != NULL_TREE && TREE_CODE (bc_label) == IDENTIFIER_NODE) { *************** patch_bc_statement (node) *** 15070,15076 **** parse_error_context (wfl_operator, "`continue' must be in loop"); else ! parse_error_context (wfl_operator, "continue label `%s' does not name a loop", IDENTIFIER_POINTER (bc_label)); return error_mark_node; --- 15335,15341 ---- parse_error_context (wfl_operator, "`continue' must be in loop"); else ! parse_error_context (wfl_operator, "continue label `%s' does not name a loop", IDENTIFIER_POINTER (bc_label)); return error_mark_node; *************** patch_bc_statement (node) *** 15086,15092 **** } } else if (!bc_label) ! { for (;; labeled_block = TREE_CHAIN (labeled_block)) { if (labeled_block == NULL_TREE) --- 15351,15357 ---- } } else if (!bc_label) ! { for (;; labeled_block = TREE_CHAIN (labeled_block)) { if (labeled_block == NULL_TREE) *************** patch_exit_expr (node) *** 15132,15146 **** /* The type of expression must be boolean */ if (TREE_TYPE (expression) != boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for loop conditional. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } /* Now we know things are allright, invert the condition, fold and return */ ! TREE_OPERAND (node, 0) = fold (build1 (TRUTH_NOT_EXPR, boolean_type_node, expression)); if (! integer_zerop (TREE_OPERAND (node, 0)) --- 15397,15411 ---- /* The type of expression must be boolean */ if (TREE_TYPE (expression) != boolean_type_node) { ! parse_error_context ! (wfl_operator, ! "Incompatible type for loop conditional. Can't convert `%s' to `boolean'", lang_printable_name (TREE_TYPE (expression), 0)); return error_mark_node; } /* Now we know things are allright, invert the condition, fold and return */ ! TREE_OPERAND (node, 0) = fold (build1 (TRUTH_NOT_EXPR, boolean_type_node, expression)); if (! integer_zerop (TREE_OPERAND (node, 0)) *************** patch_switch_statement (node) *** 15226,15236 **** TREE_TYPE (node) = void_type_node; TREE_SIDE_EFFECTS (node) = 1; CAN_COMPLETE_NORMALLY (node) ! = CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 1)) || ! SWITCH_HAS_DEFAULT (node); return node; } /* 14.18 The try/catch statements */ /* Encapsulate TRY_STMTS' in a try catch sequence. The catch clause --- 15491,15579 ---- TREE_TYPE (node) = void_type_node; TREE_SIDE_EFFECTS (node) = 1; CAN_COMPLETE_NORMALLY (node) ! = CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 1)) || ! SWITCH_HAS_DEFAULT (node); return node; } + /* Assertions. */ + + /* Build an assertion expression for `assert CONDITION : VALUE'; VALUE + might be NULL_TREE. */ + static tree + build_assertion (location, condition, value) + int location; + tree condition, value; + { + tree node; + tree klass = GET_CPC (); + + if (! CLASS_USES_ASSERTIONS (klass)) + { + tree field, classdollar, id, call; + tree class_type = TREE_TYPE (klass); + + field = add_field (class_type, + get_identifier ("$assertionsDisabled"), + boolean_type_node, + ACC_PRIVATE | ACC_STATIC | ACC_FINAL); + MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (field); + FIELD_SYNTHETIC (field) = 1; + + if (!TYPE_DOT_CLASS (class_type)) + build_dot_class_method (class_type); + classdollar = build_dot_class_method_invocation (class_type); + + /* Call CLASS.desiredAssertionStatus(). */ + id = build_wfl_node (get_identifier ("desiredAssertionStatus")); + call = build (CALL_EXPR, NULL_TREE, id, NULL_TREE, NULL_TREE); + call = make_qualified_primary (classdollar, call, location); + TREE_SIDE_EFFECTS (call) = 1; + + /* Invert to obtain !CLASS.desiredAssertionStatus(). This may + seem odd, but we do it to generate code identical to that of + the JDK. */ + call = build1 (TRUTH_NOT_EXPR, NULL_TREE, call); + TREE_SIDE_EFFECTS (call) = 1; + DECL_INITIAL (field) = call; + + /* Record the initializer in the initializer statement list. */ + call = build (MODIFY_EXPR, NULL_TREE, field, call); + TREE_CHAIN (call) = CPC_STATIC_INITIALIZER_STMT (ctxp); + SET_CPC_STATIC_INITIALIZER_STMT (ctxp, call); + MODIFY_EXPR_FROM_INITIALIZATION_P (call) = 1; + + CLASS_USES_ASSERTIONS (klass) = 1; + } + + if (value != NULL_TREE) + value = tree_cons (NULL_TREE, value, NULL_TREE); + + node = build_wfl_node (get_identifier ("java")); + node = make_qualified_name (node, build_wfl_node (get_identifier ("lang")), + location); + node = make_qualified_name (node, build_wfl_node (get_identifier ("AssertionError")), + location); + + node = build (NEW_CLASS_EXPR, NULL_TREE, node, value, NULL_TREE); + TREE_SIDE_EFFECTS (node) = 1; + /* It is too early to use BUILD_THROW. */ + node = build1 (THROW_EXPR, NULL_TREE, node); + TREE_SIDE_EFFECTS (node) = 1; + + /* We invert the condition; if we just put NODE as the `else' part + then we generate weird-looking bytecode. */ + condition = build1 (TRUTH_NOT_EXPR, NULL_TREE, condition); + /* Check $assertionsDisabled. */ + condition + = build (TRUTH_ANDIF_EXPR, NULL_TREE, + build1 (TRUTH_NOT_EXPR, NULL_TREE, + build_wfl_node (get_identifier ("$assertionsDisabled"))), + condition); + node = build_if_else_statement (location, condition, node, NULL_TREE); + return node; + } + /* 14.18 The try/catch statements */ /* Encapsulate TRY_STMTS' in a try catch sequence. The catch clause *************** encapsulate_with_try_catch (location, ty *** 15247,15257 **** try_block = build_expr_block (try_stmts, NULL_TREE); /* Build a catch block: we need a catch clause parameter */ ! catch_clause_param = build_decl (VAR_DECL, wpv_id, build_pointer_type (type)); /* And a block */ catch_block = build_expr_block (NULL_TREE, catch_clause_param); ! /* Initialize the variable and store in the block */ catch = build (MODIFY_EXPR, NULL_TREE, catch_clause_param, build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); --- 15590,15600 ---- try_block = build_expr_block (try_stmts, NULL_TREE); /* Build a catch block: we need a catch clause parameter */ ! catch_clause_param = build_decl (VAR_DECL, wpv_id, build_pointer_type (type)); /* And a block */ catch_block = build_expr_block (NULL_TREE, catch_clause_param); ! /* Initialize the variable and store in the block */ catch = build (MODIFY_EXPR, NULL_TREE, catch_clause_param, build (JAVA_EXC_OBJ_EXPR, ptr_type_node)); *************** patch_try_statement (node) *** 15322,15328 **** only parameter of the clause statement in of class Throwable or a subclass of Throwable, but that was done earlier. The catch clause parameter type has also been resolved. */ ! /* Just make sure that the catch clause parameter type inherits from java.lang.Throwable */ if (!inherits_from_p (carg_type, throwable_type_node)) --- 15665,15671 ---- only parameter of the clause statement in of class Throwable or a subclass of Throwable, but that was done earlier. The catch clause parameter type has also been resolved. */ ! /* Just make sure that the catch clause parameter type inherits from java.lang.Throwable */ if (!inherits_from_p (carg_type, throwable_type_node)) *************** patch_try_statement (node) *** 15334,15340 **** error_found = 1; continue; } ! /* Partial check for unreachable catch statement: The catch clause is reachable iff is no earlier catch block A in the try statement such that the type of the catch --- 15677,15683 ---- error_found = 1; continue; } ! /* Partial check for unreachable catch statement: The catch clause is reachable iff is no earlier catch block A in the try statement such that the type of the catch *************** patch_try_statement (node) *** 15351,15357 **** if (inherits_from_p (carg_type, TREE_TYPE (TREE_TYPE (decl)))) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (current); ! parse_error_context (wfl_operator, "`catch' not reached because of the catch clause at line %d", EXPR_WFL_LINENO (sub_current)); --- 15694,15700 ---- if (inherits_from_p (carg_type, TREE_TYPE (TREE_TYPE (decl)))) { EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (current); ! parse_error_context (wfl_operator, "`catch' not reached because of the catch clause at line %d", EXPR_WFL_LINENO (sub_current)); *************** patch_try_statement (node) *** 15387,15393 **** POP_EXCEPTIONS (); /* Verification ends here */ ! if (error_found) return error_mark_node; TREE_OPERAND (node, 0) = try; --- 15730,15736 ---- POP_EXCEPTIONS (); /* Verification ends here */ ! if (error_found) return error_mark_node; TREE_OPERAND (node, 0) = try; *************** patch_synchronized_statement (node, wfl_ *** 15438,15444 **** that the handler that catches all throw exception calls _Jv_MonitorExit and then rethrow the exception. The synchronized statement is then implemented as: ! TRY { _Jv_MonitorEnter (expression) synchronized_block --- 15781,15787 ---- that the handler that catches all throw exception calls _Jv_MonitorExit and then rethrow the exception. The synchronized statement is then implemented as: ! TRY { _Jv_MonitorEnter (expression) synchronized_block *************** patch_throw_statement (node, wfl_op1) *** 15500,15516 **** is explicitly declared in the `throws' clause of each constructor. This doesn't apply to anonymous classes, since they don't have declared constructors. */ ! if (!unchecked_ok && DECL_INSTINIT_P (current_function_decl) && !ANONYMOUS_CLASS_P (current_class)) { tree current; ! for (current = TYPE_METHODS (current_class); current; current = TREE_CHAIN (current)) ! if (DECL_CONSTRUCTOR_P (current) && !check_thrown_exceptions_do (TREE_TYPE (expr))) { ! parse_error_context (wfl_operator, "Checked exception `%s' can't be thrown in instance initializer (not all declared constructor are declaring it in their `throws' clause)", lang_printable_name (TREE_TYPE (expr), 0)); return error_mark_node; } --- 15843,15859 ---- is explicitly declared in the `throws' clause of each constructor. This doesn't apply to anonymous classes, since they don't have declared constructors. */ ! if (!unchecked_ok && DECL_INSTINIT_P (current_function_decl) && !ANONYMOUS_CLASS_P (current_class)) { tree current; ! for (current = TYPE_METHODS (current_class); current; current = TREE_CHAIN (current)) ! if (DECL_CONSTRUCTOR_P (current) && !check_thrown_exceptions_do (TREE_TYPE (expr))) { ! parse_error_context (wfl_operator, "Checked exception `%s' can't be thrown in instance initializer (not all declared constructor are declaring it in their `throws' clause)", lang_printable_name (TREE_TYPE (expr), 0)); return error_mark_node; } *************** patch_throw_statement (node, wfl_op1) *** 15539,15545 **** /* We report that the exception can't be throw from a try block in all circumstances but when the `throw' is inside a static block. */ ! else if (!EXCEPTIONS_P (currently_caught_type_list) && !tryblock_throws_ok) { if (DECL_CLINIT_P (current_function_decl)) --- 15882,15888 ---- /* We report that the exception can't be throw from a try block in all circumstances but when the `throw' is inside a static block. */ ! else if (!EXCEPTIONS_P (currently_caught_type_list) && !tryblock_throws_ok) { if (DECL_CLINIT_P (current_function_decl)) *************** patch_throw_statement (node, wfl_op1) *** 15548,15560 **** lang_printable_name (type, 0)); else parse_error_context (wfl_operator, ! "Checked exception `%s' isn't thrown from a `try' block", lang_printable_name (type, 0)); } /* Otherwise, the current method doesn't have the appropriate throws declaration */ else ! parse_error_context (wfl_operator, "Checked exception `%s' doesn't match any of current method's `throws' declaration(s)", lang_printable_name (type, 0)); return error_mark_node; } --- 15891,15903 ---- lang_printable_name (type, 0)); else parse_error_context (wfl_operator, ! "Checked exception `%s' isn't thrown from a `try' block", lang_printable_name (type, 0)); } /* Otherwise, the current method doesn't have the appropriate throws declaration */ else ! parse_error_context (wfl_operator, "Checked exception `%s' doesn't match any of current method's `throws' declaration(s)", lang_printable_name (type, 0)); return error_mark_node; } *************** check_thrown_exceptions (location, decl) *** 15578,15585 **** { tree throws; /* For all the unchecked exceptions thrown by DECL */ ! for (throws = DECL_FUNCTION_THROWS (decl); throws; ! throws = TREE_CHAIN (throws)) if (!check_thrown_exceptions_do (TREE_VALUE (throws))) { #if 1 --- 15921,15928 ---- { tree throws; /* For all the unchecked exceptions thrown by DECL */ ! for (throws = DECL_FUNCTION_THROWS (decl); throws; ! throws = TREE_CHAIN (throws)) if (!check_thrown_exceptions_do (TREE_VALUE (throws))) { #if 1 *************** check_thrown_exceptions (location, decl) *** 15592,15601 **** parse_error_context (wfl_operator, "Exception `%s' can't be thrown in initializer", lang_printable_name (TREE_VALUE (throws), 0)); ! else { ! parse_error_context ! (wfl_operator, "Exception `%s' must be caught, or it must be declared in the `throws' clause of `%s'", lang_printable_name (TREE_VALUE (throws), 0), (DECL_INIT_P (current_function_decl) ? IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))) : --- 15935,15944 ---- parse_error_context (wfl_operator, "Exception `%s' can't be thrown in initializer", lang_printable_name (TREE_VALUE (throws), 0)); ! else { ! parse_error_context ! (wfl_operator, "Exception `%s' must be caught, or it must be declared in the `throws' clause of `%s'", lang_printable_name (TREE_VALUE (throws), 0), (DECL_INIT_P (current_function_decl) ? IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))) : *************** patch_conditional_expr (node, wfl_cond, *** 15718,15724 **** /* Second and third can be numeric, boolean (i.e. primitive), references or null. Anything else results in an error */ if (!((JNUMERIC_TYPE_P (t1) && JNUMERIC_TYPE_P (t2)) ! || ((JREFERENCE_TYPE_P (t1) || op1 == null_pointer_node) && (JREFERENCE_TYPE_P (t2) || op2 == null_pointer_node)) || (t1 == boolean_type_node && t2 == boolean_type_node))) error_found = 1; --- 16061,16067 ---- /* Second and third can be numeric, boolean (i.e. primitive), references or null. Anything else results in an error */ if (!((JNUMERIC_TYPE_P (t1) && JNUMERIC_TYPE_P (t2)) ! || ((JREFERENCE_TYPE_P (t1) || op1 == null_pointer_node) && (JREFERENCE_TYPE_P (t2) || op2 == null_pointer_node)) || (t1 == boolean_type_node && t2 == boolean_type_node))) error_found = 1; *************** patch_conditional_expr (node, wfl_cond, *** 15750,15758 **** /* Otherwise, binary numeric promotion is applied and the resulting type is the promoted type of operand 1 and 2 */ ! else ! resulting_type = binary_numeric_promotion (t1, t2, ! &TREE_OPERAND (node, 1), &TREE_OPERAND (node, 2)); } --- 16093,16101 ---- /* Otherwise, binary numeric promotion is applied and the resulting type is the promoted type of operand 1 and 2 */ ! else ! resulting_type = binary_numeric_promotion (t1, t2, ! &TREE_OPERAND (node, 1), &TREE_OPERAND (node, 2)); } *************** fold_constant_for_init (node, context) *** 15833,15840 **** switch (code) { - case STRING_CST: case INTEGER_CST: case REAL_CST: return node; --- 16176,16185 ---- switch (code) { case INTEGER_CST: + if (node == null_pointer_node) + return NULL_TREE; + case STRING_CST: case REAL_CST: return node; *************** fold_constant_for_init (node, context) *** 15851,15857 **** case BIT_IOR_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: --- 16196,16202 ---- case BIT_IOR_EXPR: case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: ! case EQ_EXPR: case NE_EXPR: case GT_EXPR: case GE_EXPR: *************** fold_constant_for_init (node, context) *** 15907,15912 **** --- 16252,16259 ---- /* Guard against infinite recursion. */ DECL_INITIAL (node) = NULL_TREE; val = fold_constant_for_init (val, node); + if (val != NULL_TREE && TREE_CODE (val) != STRING_CST) + val = try_builtin_assignconv (NULL_TREE, TREE_TYPE (node), val); DECL_INITIAL (node) = val; return val; *************** fold_constant_for_init (node, context) *** 15922,15928 **** else if (! QUALIFIED_P (name)) { decl = lookup_field_wrapper (DECL_CONTEXT (context), name); ! if (decl == NULL_TREE || (! FIELD_STATIC (decl) && ! FIELD_FINAL (decl))) return NULL_TREE; return fold_constant_for_init (decl, decl); --- 16269,16275 ---- else if (! QUALIFIED_P (name)) { decl = lookup_field_wrapper (DECL_CONTEXT (context), name); ! if (decl == NULL_TREE || (! FIELD_STATIC (decl) && ! FIELD_FINAL (decl))) return NULL_TREE; return fold_constant_for_init (decl, decl); *************** mark_parser_ctxt (p) *** 15990,16002 **** void *p; { struct parser_ctxt *pc = *((struct parser_ctxt **) p); ! int i; if (!pc) return; #ifndef JC1_LITE ! for (i = 0; i < 11; ++i) ggc_mark_tree (pc->modifier_ctx[i]); ggc_mark_tree (pc->class_type); ggc_mark_tree (pc->function_decl); --- 16337,16351 ---- void *p; { struct parser_ctxt *pc = *((struct parser_ctxt **) p); ! #ifndef JC1_LITE ! size_t i; ! #endif if (!pc) return; #ifndef JC1_LITE ! for (i = 0; i < ARRAY_SIZE (pc->modifier_ctx); ++i) ggc_mark_tree (pc->modifier_ctx[i]); ggc_mark_tree (pc->class_type); ggc_mark_tree (pc->function_decl); *************** mark_parser_ctxt (p) *** 16020,16031 **** void init_src_parse () { - /* Register roots with the garbage collector. */ - ggc_add_tree_root (src_parse_roots, sizeof (src_parse_roots) / sizeof(tree)); - /* Sanity check; we've been bit by this before. */ ! if (sizeof (ctxp->modifier_ctx) / sizeof (tree) != ! MODIFIER_TK - PUBLIC_TK) abort (); } --- 16369,16376 ---- void init_src_parse () { /* Sanity check; we've been bit by this before. */ ! if (ARRAY_SIZE (ctxp->modifier_ctx) != MODIFIER_TK - PUBLIC_TK) abort (); } *************** init_src_parse () *** 16036,16051 **** /* Attach to PTR (a block) the declaration found in ENTRY. */ ! static bool attach_init_test_initialization_flags (entry, ptr) ! struct hash_entry *entry; PTR ptr; { tree block = (tree)ptr; ! struct init_test_hash_entry *ite = (struct init_test_hash_entry *) entry; ! ! TREE_CHAIN (ite->init_test_decl) = BLOCK_EXPR_DECLS (block); ! BLOCK_EXPR_DECLS (block) = ite->init_test_decl; return true; } --- 16381,16399 ---- /* Attach to PTR (a block) the declaration found in ENTRY. */ ! static int attach_init_test_initialization_flags (entry, ptr) ! PTR *entry; PTR ptr; { tree block = (tree)ptr; ! struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry; ! ! if (block != error_mark_node) ! { ! TREE_CHAIN (ite->value) = BLOCK_EXPR_DECLS (block); ! BLOCK_EXPR_DECLS (block) = ite->value; ! } return true; } *************** attach_init_test_initialization_flags (e *** 16055,16085 **** initialized static class flags if a flag already existed, otherwise a new one is created. */ ! static bool ! emit_test_initialization (entry, info) ! struct hash_entry *entry; PTR info; { tree l = (tree) info; tree decl, init; ! ! struct init_test_hash_entry *ite = (struct init_test_hash_entry *) ! hash_lookup (&DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl), ! entry->key, ! current_function_decl != TREE_PURPOSE (l), NULL); /* If we haven't found a flag and we're dealing with self registered with current_function_decl, then don't do anything. Self is always added as definitely initialized but this information is valid only if used outside the current function. */ ! if (! ite) return true; /* If we don't have a variable, create one and install it. */ ! if (! ite->init_test_decl) { tree block; ! decl = build_decl (VAR_DECL, NULL_TREE, boolean_type_node); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); LOCAL_CLASS_INITIALIZATION_FLAG (decl) = 1; --- 16403,16434 ---- initialized static class flags if a flag already existed, otherwise a new one is created. */ ! static int ! emit_test_initialization (entry_p, info) ! PTR *entry_p; PTR info; { tree l = (tree) info; tree decl, init; ! tree key = (tree) *entry_p; ! tree *ite; ! htab_t cf_ht = DECL_FUNCTION_INIT_TEST_TABLE (current_function_decl); /* If we haven't found a flag and we're dealing with self registered with current_function_decl, then don't do anything. Self is always added as definitely initialized but this information is valid only if used outside the current function. */ ! if (current_function_decl == TREE_PURPOSE (l) ! && java_treetreehash_find (cf_ht, key) == NULL) return true; + ite = java_treetreehash_new (cf_ht, key); + /* If we don't have a variable, create one and install it. */ ! if (*ite == NULL) { tree block; ! decl = build_decl (VAR_DECL, NULL_TREE, boolean_type_node); MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl); LOCAL_CLASS_INITIALIZATION_FLAG (decl) = 1; *************** emit_test_initialization (entry, info) *** 16090,16099 **** block = BLOCK_SUBBLOCKS (GET_CURRENT_BLOCK (current_function_decl)); TREE_CHAIN (decl) = BLOCK_EXPR_DECLS (block); BLOCK_EXPR_DECLS (block) = decl; ! ite->init_test_decl = decl; } else ! decl = ite->init_test_decl; /* Now simply augment the compound that holds all the assignments pertaining to this method invocation. */ --- 16439,16448 ---- block = BLOCK_SUBBLOCKS (GET_CURRENT_BLOCK (current_function_decl)); TREE_CHAIN (decl) = BLOCK_EXPR_DECLS (block); BLOCK_EXPR_DECLS (block) = decl; ! *ite = decl; } else ! decl = *ite; /* Now simply augment the compound that holds all the assignments pertaining to this method invocation. */ *************** emit_test_initialization (entry, info) *** 16104,16106 **** --- 16453,16458 ---- return true; } + + #include "gt-java-parse.h" + #include "gtype-java.h" diff -Nrc3pad gcc-3.2.3/gcc/java/rmic.1 gcc-3.3/gcc/java/rmic.1 *** gcc-3.2.3/gcc/java/rmic.1 2003-04-22 07:07:38.000000000 +0000 --- gcc-3.3/gcc/java/rmic.1 2003-05-14 00:32:12.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:38 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,145 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "RMIC 1" ! .TH RMIC 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" rmic \- Generate stubs for Remote Method Invocation .SH "SYNOPSIS" --- 126,135 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "RMIC 1" ! .TH RMIC 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" rmic \- Generate stubs for Remote Method Invocation .SH "SYNOPSIS" *************** Note that this program isn't yet fully c *** 155,210 **** recognized but currently ignored. We have left these options undocumented for now. .PP ! Long options can also be given with a GNU-style leading \fB\--\fR. For ! instance, \fB\*(--help\fR is accepted. .SH "OPTIONS" .IX Header "OPTIONS" ! .Ip "\fB\-keep\fR" 4 .IX Item "-keep" .PD 0 ! .Ip "\fB\-keepgenerated\fR" 4 .IX Item "-keepgenerated" .PD By default, \fBrmic\fR deletes intermediate files. Either of these options causes it not to delete such files. ! .Ip "\fB\-v1.1\fR" 4 .IX Item "-v1.1" Cause \fBrmic\fR to create stubs and skeletons for the 1.1 protocol version. ! .Ip "\fB\-vcompat\fR" 4 .IX Item "-vcompat" Cause \fBrmic\fR to create stubs and skeletons compatible with both the 1.1 and 1.2 protocol versions. This is the default. ! .Ip "\fB\-v1.2\fR" 4 .IX Item "-v1.2" Cause \fBrmic\fR to create stubs and skeletons for the 1.2 protocol version. ! .Ip "\fB\-nocompile\fR" 4 .IX Item "-nocompile" Don't compile the generated files. ! .Ip "\fB\-verbose\fR" 4 .IX Item "-verbose" Print information about what \fBrmic\fR is doing. ! .Ip "\fB\-d\fR \fIdirectory\fR" 4 .IX Item "-d directory" Put output files in \fIdirectory\fR. By default the files are put in the current working directory. ! .Ip "\fB\-help\fR" 4 .IX Item "-help" Print a help message, then exit. ! .Ip "\fB\-version\fR" 4 .IX Item "-version" Print version information, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 145,214 ---- recognized but currently ignored. We have left these options undocumented for now. .PP ! Long options can also be given with a GNU-style leading \fB\-\-\fR. For ! instance, \fB\-\-help\fR is accepted. .SH "OPTIONS" .IX Header "OPTIONS" ! .IP "\fB\-keep\fR" 4 .IX Item "-keep" .PD 0 ! .IP "\fB\-keepgenerated\fR" 4 .IX Item "-keepgenerated" .PD By default, \fBrmic\fR deletes intermediate files. Either of these options causes it not to delete such files. ! .IP "\fB\-v1.1\fR" 4 .IX Item "-v1.1" Cause \fBrmic\fR to create stubs and skeletons for the 1.1 protocol version. ! .IP "\fB\-vcompat\fR" 4 .IX Item "-vcompat" Cause \fBrmic\fR to create stubs and skeletons compatible with both the 1.1 and 1.2 protocol versions. This is the default. ! .IP "\fB\-v1.2\fR" 4 .IX Item "-v1.2" Cause \fBrmic\fR to create stubs and skeletons for the 1.2 protocol version. ! .IP "\fB\-nocompile\fR" 4 .IX Item "-nocompile" Don't compile the generated files. ! .IP "\fB\-verbose\fR" 4 .IX Item "-verbose" Print information about what \fBrmic\fR is doing. ! .IP "\fB\-d\fR \fIdirectory\fR" 4 .IX Item "-d directory" Put output files in \fIdirectory\fR. By default the files are put in the current working directory. ! .IP "\fB\-help\fR" 4 .IX Item "-help" Print a help message, then exit. ! .IP "\fB\-version\fR" 4 .IX Item "-version" Print version information, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/rmiregistry.1 gcc-3.3/gcc/java/rmiregistry.1 *** gcc-3.2.3/gcc/java/rmiregistry.1 2003-04-22 07:07:39.000000000 +0000 --- gcc-3.3/gcc/java/rmiregistry.1 2003-05-14 00:32:13.000000000 +0000 *************** *** 1,8 **** ! .\" Automatically generated by Pod::Man version 1.15 ! .\" Tue Apr 22 07:07:39 2003 .\" .\" Standard preamble: ! .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp --- 1,7 ---- ! .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" .\" Standard preamble: ! .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp *************** *** 15,26 **** .if t .sp .5v .if n .sp .. - .de Ip \" List item - .br - .ie \\n(.$>=3 .ne \\$3 - .el .ne 3 - .IP "\\$1" \\$2 - .. .de Vb \" Begin verbatim text .ft CW .nf --- 14,19 ---- *************** *** 28,42 **** .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used ! .\" to do unbreakable dashes and therefore won't be available. \*(C` and ! .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ --- 21,34 ---- .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a ! .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to ! .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' ! .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ *************** *** 56,65 **** . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr ! .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and ! .\" index entries marked with X<> in POD. Of course, you'll have to process ! .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" --- 48,57 ---- . ds R" '' 'br\} .\" ! .\" If the F register is turned on, we'll generate index entries on stderr for ! .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index ! .\" entries marked with X<> in POD. Of course, you'll have to process the ! .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" *************** *** 68,81 **** . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it ! .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. - .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 --- 60,72 ---- . rr F .\} .\" ! .\" For nroff, turn off justification. Always turn off hyphenation; it makes ! .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 *************** *** 135,172 **** . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ====================================================================== .\" .IX Title "RMIREGISTRY 1" ! .TH RMIREGISTRY 1 "gcc-3.2.3" "2003-04-22" "GNU" ! .UC .SH "NAME" rmiregistry \- Remote object registry .SH "SYNOPSIS" .IX Header "SYNOPSIS" ! \&\fBrmiregistry\fR [\fB\s-1OPTION\s0\fR] ... [\fIport\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBrmiregistry\fR starts a remote object registry on the current host. If no port number is specified, then port 1099 is used. .SH "OPTIONS" .IX Header "OPTIONS" ! .Ip "\fB\*(--help\fR" 4 ! .IX Item "help" Print a help message, then exit. ! .Ip "\fB\*(--version\fR" 4 ! .IX Item "version" Print version information, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). --- 126,176 ---- . ds Ae AE .\} .rm #[ #] #H #V #F C ! .\" ======================================================================== .\" .IX Title "RMIREGISTRY 1" ! .TH RMIREGISTRY 1 "2003-05-14" "gcc-3.3" "GNU" .SH "NAME" rmiregistry \- Remote object registry .SH "SYNOPSIS" .IX Header "SYNOPSIS" ! \&\fBrmic\fR [\fB\s-1OPTION\s0\fR] ... [\fIport\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBrmiregistry\fR starts a remote object registry on the current host. If no port number is specified, then port 1099 is used. .SH "OPTIONS" .IX Header "OPTIONS" ! .IP "\fB\-\-help\fR" 4 ! .IX Item "--help" Print a help message, then exit. ! .IP "\fB\-\-version\fR" 4 ! .IX Item "--version" Print version information, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" .SH "COPYRIGHT" .IX Header "COPYRIGHT" ! Copyright (c) 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document ! under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being ``\s-1GNU\s0 General Public License'', the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). + .PP + (a) The \s-1FSF\s0's Front-Cover Text is: + .PP + .Vb 1 + \& A GNU Manual + .Ve + .PP + (b) The \s-1FSF\s0's Back-Cover Text is: + .PP + .Vb 3 + \& You have freedom to copy and modify this GNU Manual, like GNU + \& software. Copies published by the Free Software Foundation raise + \& funds for GNU development. + .Ve diff -Nrc3pad gcc-3.2.3/gcc/java/typeck.c gcc-3.3/gcc/java/typeck.c *** gcc-3.2.3/gcc/java/typeck.c 2001-12-03 23:09:42.000000000 +0000 --- gcc-3.3/gcc/java/typeck.c 2002-08-04 22:45:31.000000000 +0000 *************** The Free Software Foundation is independ *** 28,33 **** --- 28,34 ---- #include "config.h" #include "system.h" #include "tree.h" + #include "real.h" #include "obstack.h" #include "flags.h" #include "java-tree.h" *************** static tree lookup_do PARAMS ((tree, tre *** 43,49 **** static tree build_null_signature PARAMS ((tree)); tree * type_map; - extern struct obstack permanent_obstack; /* Set the type of the local variable with index SLOT to TYPE. */ --- 44,49 ---- *************** convert_to_boolean (type, expr) *** 166,189 **** return build1 (NOP_EXPR, type, expr); } - /* Print an error message for invalid use of an incomplete type. - VALUE is the expression that was used (or 0 if that isn't known) - and TYPE is the type that was invalid. */ - - void - incomplete_type_error (value, type) - tree value ATTRIBUTE_UNUSED; - tree type ATTRIBUTE_UNUSED; - { - error ("internal error - use of undefined type"); - } - /* Return a data type that has machine mode MODE. If the mode is an integer, then UNSIGNEDP selects between signed and unsigned types. */ tree ! type_for_mode (mode, unsignedp) enum machine_mode mode; int unsignedp; { --- 166,177 ---- return build1 (NOP_EXPR, type, expr); } /* Return a data type that has machine mode MODE. If the mode is an integer, then UNSIGNEDP selects between signed and unsigned types. */ tree ! java_type_for_mode (mode, unsignedp) enum machine_mode mode; int unsignedp; { *************** type_for_mode (mode, unsignedp) *** 207,213 **** that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */ tree ! type_for_size (bits, unsignedp) unsigned bits; int unsignedp; { --- 195,201 ---- that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */ tree ! java_type_for_size (bits, unsignedp) unsigned bits; int unsignedp; { *************** type_for_size (bits, unsignedp) *** 226,232 **** signed according to UNSIGNEDP. */ tree ! signed_or_unsigned_type (unsignedp, type) int unsignedp; tree type; { --- 214,220 ---- signed according to UNSIGNEDP. */ tree ! java_signed_or_unsigned_type (unsignedp, type) int unsignedp; tree type; { *************** signed_or_unsigned_type (unsignedp, type *** 246,273 **** /* Return a signed type the same as TYPE in other respects. */ tree ! signed_type (type) tree type; { ! return signed_or_unsigned_type (0, type); } /* Return an unsigned type the same as TYPE in other respects. */ tree ! unsigned_type (type) tree type; { ! return signed_or_unsigned_type (1, type); ! } /* Mark EXP saying that we need to be able to take the address of it; it should not be allocated in a register. ! Value is 1 if successful. */ ! int ! mark_addressable (exp) tree exp; { register tree x = exp; --- 234,260 ---- /* Return a signed type the same as TYPE in other respects. */ tree ! java_signed_type (type) tree type; { ! return java_signed_or_unsigned_type (0, type); } /* Return an unsigned type the same as TYPE in other respects. */ tree ! java_unsigned_type (type) tree type; { ! return java_signed_or_unsigned_type (1, type); } /* Mark EXP saying that we need to be able to take the address of it; it should not be allocated in a register. ! Value is true if successful. */ ! bool ! java_mark_addressable (exp) tree exp; { register tree x = exp; *************** mark_addressable (exp) *** 289,300 **** break; case COND_EXPR: ! return mark_addressable (TREE_OPERAND (x, 1)) ! & mark_addressable (TREE_OPERAND (x, 2)); case CONSTRUCTOR: TREE_ADDRESSABLE (x) = 1; ! return 1; case INDIRECT_REF: /* We sometimes add a cast *(TYPE*)&FOO to handle type and mode --- 276,287 ---- break; case COND_EXPR: ! return java_mark_addressable (TREE_OPERAND (x, 1)) ! && java_mark_addressable (TREE_OPERAND (x, 2)); case CONSTRUCTOR: TREE_ADDRESSABLE (x) = 1; ! return true; case INDIRECT_REF: /* We sometimes add a cast *(TYPE*)&FOO to handle type and mode *************** mark_addressable (exp) *** 310,316 **** x = TREE_OPERAND (x, 0); break; } ! return 1; case VAR_DECL: case CONST_DECL: --- 297,303 ---- x = TREE_OPERAND (x, 0); break; } ! return true; case VAR_DECL: case CONST_DECL: *************** mark_addressable (exp) *** 324,330 **** #endif /* drops through */ default: ! return 1; } } --- 311,317 ---- #endif /* drops through */ default: ! return true; } } *************** promote_type (type) *** 458,464 **** switch (TREE_CODE (type)) { case RECORD_TYPE: ! return build_pointer_type (CLASS_TO_HANDLE_TYPE (type)); case BOOLEAN_TYPE: if (type == boolean_type_node) return promoted_boolean_type_node; --- 445,451 ---- switch (TREE_CODE (type)) { case RECORD_TYPE: ! return build_pointer_type (type); case BOOLEAN_TYPE: if (type == boolean_type_node) return promoted_boolean_type_node; diff -Nrc3pad gcc-3.2.3/gcc/java/verify.c gcc-3.3/gcc/java/verify.c *** gcc-3.2.3/gcc/java/verify.c 2001-12-16 16:23:50.000000000 +0000 --- gcc-3.3/gcc/java/verify.c 2002-11-18 15:46:34.000000000 +0000 *************** *** 1,6 **** /* Handle verification of bytecoded methods for the GNU compiler for the Java(TM) language. ! Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU CC. --- 1,6 ---- /* Handle verification of bytecoded methods for the GNU compiler for the Java(TM) language. ! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU CC. *************** merge_types (type1, type2) *** 145,152 **** if (type2 == ptr_type_node || type1 == object_ptr_type_node) return type1; ! tt1 = HANDLE_TO_CLASS_TYPE (TREE_TYPE (type1)); ! tt2 = HANDLE_TO_CLASS_TYPE (TREE_TYPE (type2)); /* If tt{1,2} haven't been properly loaded, now is a good time to do it. */ --- 145,152 ---- if (type2 == ptr_type_node || type1 == object_ptr_type_node) return type1; ! tt1 = TREE_TYPE (type1); ! tt2 = TREE_TYPE (type2); /* If tt{1,2} haven't been properly loaded, now is a good time to do it. */ *************** verify_jvm_instructions (jcf, byte_ops, *** 449,455 **** /* We read the exception handlers in order of increasing start PC. To do this we first read and sort the start PCs. */ ! starts = (struct pc_index *) xmalloc (eh_count * sizeof (struct pc_index)); for (i = 0; i < eh_count; ++i) { starts[i].start_pc = GET_u2 (jcf->read_ptr + 8 * i); --- 449,455 ---- /* We read the exception handlers in order of increasing start PC. To do this we first read and sort the start PCs. */ ! starts = xmalloc (eh_count * sizeof (struct pc_index)); for (i = 0; i < eh_count; ++i) { starts[i].start_pc = GET_u2 (jcf->read_ptr + 8 * i); *************** verify_jvm_instructions (jcf, byte_ops, *** 471,477 **** if (start_pc < 0 || start_pc >= length || end_pc < 0 || end_pc > length || start_pc >= end_pc || handler_pc < 0 || handler_pc >= length - || (handler_pc >= start_pc && handler_pc < end_pc) || ! (instruction_bits [start_pc] & BCODE_INSTRUCTION_START) || (end_pc < length && ! (instruction_bits [end_pc] & BCODE_INSTRUCTION_START)) --- 471,476 ---- *************** verify_jvm_instructions (jcf, byte_ops, *** 482,487 **** --- 481,489 ---- return 0; } + if (handler_pc >= start_pc && handler_pc < end_pc) + warning ("exception handler inside code that is being protected"); + add_handler (start_pc, end_pc, lookup_label (handler_pc), catch_type == 0 ? NULL_TREE *************** verify_jvm_instructions (jcf, byte_ops, *** 1324,1330 **** type_map[len] = TREE_VEC_ELT (return_map, len); } current_subr = LABEL_SUBR_CONTEXT (target); ! PUSH_PENDING (return_label); } INVALIDATE_PC; --- 1326,1333 ---- type_map[len] = TREE_VEC_ELT (return_map, len); } current_subr = LABEL_SUBR_CONTEXT (target); ! if (RETURN_MAP_ADJUSTED (return_map)) ! PUSH_PENDING (return_label); } INVALIDATE_PC; diff -Nrc3pad gcc-3.2.3/gcc/java/win32-host.c gcc-3.3/gcc/java/win32-host.c *** gcc-3.2.3/gcc/java/win32-host.c 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/gcc/java/win32-host.c 2003-04-10 14:54:08.000000000 +0000 *************** *** 0 **** --- 1,85 ---- + /* Platform-Specific Win32 Functions + Copyright (C) 2003 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + Java and all Java-based marks are trademarks or registered trademarks + of Sun Microsystems, Inc. in the United States and other countries. + The Free Software Foundation is independent of Sun Microsystems, Inc. */ + + /* Written by Mohan Embar , March 2003. */ + + #ifdef WIN32 + + #include "config.h" + #include "system.h" + + #include "jcf.h" + + #define WIN32_LEAN_AND_MEAN + #include + #undef WIN32_LEAN_AND_MEAN + + /* Simulate an open() failure with ENOENT */ + static int + file_not_found (void); + + static int + file_not_found (void) + { + errno = ENOENT; + return -1; + } + + int + jcf_open_exact_case (const char *filename, int oflag) + { + int filename_len = strlen (filename); + int found_file_len; + HANDLE found_file_handle; + WIN32_FIND_DATA fd; + + /* See if we can find this file. */ + found_file_handle = FindFirstFile (filename, &fd); + if (found_file_handle == INVALID_HANDLE_VALUE) + return file_not_found (); + FindClose (found_file_handle); + + found_file_len = strlen (fd.cFileName); + + /* This should never happen. */ + if (found_file_len > filename_len) + return file_not_found (); + + /* Here, we're only actually comparing the filename and not + checking the case of any containing directory components. + Although we're not fully obeying our contract, checking + all directory components would be tedious and time-consuming + and it's a pretty safe assumption that mixed-case package + names are a fringe case.... */ + if (strcmp (filename + filename_len - found_file_len, fd.cFileName)) + { + /* Reject this because it is not a perfect-case match. */ + /* printf("************\nRejected:\n%s\n%s\n************\n\n", filename, fd.cFileName); */ + return file_not_found (); + } + else + { + return open (filename, oflag); + } + } + + #endif /* WIN32 */ diff -Nrc3pad gcc-3.2.3/gcc/java/xref.c gcc-3.3/gcc/java/xref.c *** gcc-3.2.3/gcc/java/xref.c 2000-01-21 20:57:00.000000000 +0000 --- gcc-3.3/gcc/java/xref.c 2002-08-05 18:46:37.000000000 +0000 *************** The Free Software Foundation is independ *** 31,38 **** #include "xref.h" #include "jcf.h" #include "parse.h" - #include "obstack.h" - static xref_flag_table xref_table [] = { {NULL, NULL, NULL, NULL}, --- 31,36 ---- diff -Nrc3pad gcc-3.2.3/libffi/ChangeLog gcc-3.3/libffi/ChangeLog *** gcc-3.2.3/libffi/ChangeLog 2003-04-22 06:15:28.000000000 +0000 --- gcc-3.3/libffi/ChangeLog 2003-05-14 00:10:48.000000000 +0000 *************** *** 1,62 **** ! 2003-04-22 Release Manager ! * GCC 3.2.3 Released. - 2003-02-08 Andreas Tobler - * libffi/src/powerpc/darwin_closure.S: ! Fix alignement bug, allocate 8 bytes for the result. ! * libffi/src/powerpc/aix_closure.S: ! Likewise. ! * libffi/src/powerpc/ffi_darwin.c: ! Update stackframe description for aix/darwin_closure.S. ! 2003-02-07 Andreas Tobler * libffi/src/ffitest.c add closure testcases ! 2003-02-07 Kevin B. Hendricks * libffi/src/powerpc/ffi.c fix alignment bug for float (4 byte aligned iso 8 byte) ! 2003-02-05 Release Manager ! * GCC 3.2.2 Released. ! 2003-01-29 Franz Sirl ! * src/powerpc/ppc_closure.S: Recode to fit shared libs. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-18 Release Manager ! * GCC 3.2.1 Released. ! 2002-10-07 Kaveh R. Ghazi * Makefile.am (all-multi): Fix multilib parallel build. ! 2002-08-14 Release Manager ! * GCC 3.2 Released. ! 2002-07-25 Release Manager ! * GCC 3.1.1 Released. ! 2002-05-28 Bo Thorsen ! * src/x86/ffi.c (ffi_prep_incoming_args_SYSV): Remove avn ! here too. 2002-05-27 Roger Sayle --- 1,262 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! ! 2003-05-13 Release Manager ! ! * GCC 3.3 Released. ! ! 2003-05-13 Release Manager ! ! * GCC 3.3 Released. ! ! 2003-05-07 Jeff Sturm ! ! Fixes PR bootstrap/10656 ! * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler ! support for .register pseudo-op. ! * src/sparc/v8.S: Use it. ! * fficonfig.h.in: Rebuilt. ! * configure: Rebuilt. ! ! 2003-04-04 Loren J. Rittle ! ! * include/Makefile.in: Regenerate. ! ! 2003-03-22 Zdenek Dvorak ! ! * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32 ! bit mode. ! * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): ! Receive closure pointer through parameter, read args using ! __builtin_dwarf_cfa. ! (FFI_INIT_TRAMPOLINE): Send closure reference through eax. ! ! 2003-02-06 Andreas Tobler * libffi/src/powerpc/darwin_closure.S: ! Fix alignement bug, allocate 8 bytes for the result. ! * libffi/src/powerpc/aix_closure.S: ! Likewise. ! * libffi/src/powerpc/ffi_darwin.c: ! Update stackframe description for aix/darwin_closure.S. ! 2003-01-31 Christian Cornelssen , ! Andreas Schwab ! ! * configure.in: Adjust command to source config-ml.in to account ! for changes to the libffi_basedir definition. ! (libffi_basedir): Remove ${srcdir} from value and include trailing ! slash if nonempty. ! ! * configure: Regenerate. ! ! 2003-01-29 Franz Sirl ! ! * src/powerpc/ppc_closure.S: Recode to fit shared libs. ! ! 2003-01-28 Andrew Haley ! ! * include/ffi.h.in: Enable FFI_CLOSURES for x86_64. ! * src/x86/ffi64.c (ffi_prep_closure): New. ! (ffi_closure_UNIX64_inner): New. ! * src/x86/unix64.S (ffi_closure_UNIX64): New. ! ! 2003-01-22 Andrew Haley ! ! * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to ! unwind info. ! ! 2003-01-21 Andreas Tobler ! ! * src/powerpc/darwin.S: Add unwind info. ! * src/powerpc/darwin_closure.S: Likewise. ! ! 2003-01-14 Andrew Haley ! ! * src/x86/ffi64.c (ffi_prep_args): Check for void retval. ! (ffi_prep_cif_machdep): Likewise. ! * src/x86/unix64.S: Add unwind info. ! ! 2003-01-14 Andreas Jaeger ! ! * src/ffitest.c (main): Only use ffi_closures if those are ! supported. ! ! 2003-01-13 Andreas Tobler * libffi/src/ffitest.c add closure testcases ! 2003-01-13 Kevin B. Hendricks * libffi/src/powerpc/ffi.c fix alignment bug for float (4 byte aligned iso 8 byte) ! 2003-01-03 Jeff Sturm ! * include/ffi.h.in: Add closure defines for SPARC, SPARC64. ! * src/ffitest.c (main): Use static storage for closure. ! * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New. ! * src/sparc/v8.S (ffi_closure_v8): New. ! * src/sparc/v9.S (ffi_closure_v9): New. ! 2002-11-10 Ranjit Mathew ! * include/ffi.h.in: Added FFI_STDCALL ffi_type ! enumeration for X86_WIN32. ! * src/x86/win32.S: Added ffi_call_STDCALL function ! definition. ! * src/x86/ffi.c (ffi_call/ffi_raw_call): Added ! switch cases for recognising FFI_STDCALL and ! calling ffi_call_STDCALL if target is X86_WIN32. ! * src/ffitest.c (my_stdcall_strlen/stdcall_many): ! stdcall versions of the "my_strlen" and "many" ! test functions (for X86_WIN32). ! Added test cases to test stdcall invocation using ! these functions. ! 2002-11-27 Ulrich Weigand ! * src/s390/sysv.S (.eh_frame section): Make section read-only. ! 2002-11-26 Jim Wilson ! * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64. ! 2002-11-15 Ulrich Weigand ! * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding. ! 2002-11-11 DJ Delorie ! ! * configure.in: Look for common files in the right place. ! ! 2002-10-08 Ulrich Weigand ! ! * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret ! raw data as _Jv_word values, not ffi_raw. ! (ffi_java_ptrarray_to_raw): Likewise. ! (ffi_java_rvalue_to_raw): New function. ! (ffi_java_raw_call): Call it. ! (ffi_java_raw_to_rvalue): New function. ! (ffi_java_translate_args): Call it. ! * src/ffitest.c (closure_test_fn): Interpret return value ! as ffi_arg, not int. ! * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing ! FFI_TYPE_POINTER case. ! (ffi_closure_helper_SYSV): Likewise. Also, assume return ! values extended to word size. ! ! 2002-10-02 Andreas Jaeger ! ! * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output. ! ! 2002-10-01 Bo Thorsen ! ! * include/ffi.h.in: Fix i386 win32 compilation. ! ! 2002-09-30 Ulrich Weigand ! ! * configure.in: Add s390x-*-linux-* target. ! * configure: Regenerate. ! * include/ffi.h.in: Define S390X for s390x targets. ! (FFI_CLOSURES): Define for s390/s390x. ! (FFI_TRAMPOLINE_SIZE): Likewise. ! (FFI_NATIVE_RAW_API): Likewise. ! * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390. ! * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x. ! * src/s390/ffi.c: Major rework of existing code. Add support for ! s390x targets. Add closure support. ! * src/s390/sysv.S: Likewise. ! ! 2002-09-29 Richard Earnshaw ! ! * src/arm/sysv.S: Fix typo. ! ! 2002-09-28 Richard Earnshaw ! ! * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor ! has defined __USER_LABEL_PREFIX__, then use it in CNAME. ! (ffi_call_SYSV): Handle soft-float. ! ! 2002-09-27 Bo Thorsen ! ! * include/ffi.h.in: Fix multilib x86-64 support. ! ! 2002-09-22 Kaveh R. Ghazi * Makefile.am (all-multi): Fix multilib parallel build. ! 2002-07-19 Kaz Kojima ! * configure.in (sh[34]*-*-linux*): Add brackets. ! * configure: Regenerate. ! 2002-07-18 Kaz Kojima ! * Makefile.am: Add SH support. ! * Makefile.in: Regenerate. ! * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target. ! * configure: Regenerate. ! * include/ffi.h.in: Add SH support. ! * src/sh/ffi.c: New file. ! * src/sh/sysv.S: New file. ! * src/types.c: Add SH support. ! 2002-07-16 Bo Thorsen ! * src/x86/ffi64.c: New file that adds x86-64 support. ! * src/x86/unix64.S: New file that handles argument setup for ! x86-64. ! * src/x86/sysv.S: Don't use this on x86-64. ! * src/x86/ffi.c: Don't use this on x86-64. ! Remove unused vars. ! * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation ! for x86-64. ! * src/ffitest.c (struct6): New test that tests a special case in ! the x86-64 ABI. ! (struct7): Likewise. ! (struct8): Likewise. ! (struct9): Likewise. ! (closure_test_fn): Silence warning about this when it's not used. ! (main): Add the new tests. ! (main): Fix a couple of wrong casts and silence some compiler warnings. ! * include/ffi.h.in: Add x86-64 ABI definition. ! * fficonfig.h.in: Regenerate. ! * Makefile.am: Add x86-64 support. ! * configure.in: Likewise. ! * Makefile.in: Regenerate. ! * configure: Likewise. ! ! 2002-06-24 Bo Thorsen ! ! * src/types.c: Merge settings for similar architectures. ! Add x86-64 sizes and alignments. ! ! 2002-06-23 Bo Thorsen ! ! * src/arm/ffi.c (ffi_prep_args): Remove unused vars. ! * src/sparc/ffi.c (ffi_prep_args_v8): Likewise. ! * src/mips/ffi.c (ffi_prep_args): Likewise. ! * src/m68k/ffi.c (ffi_prep_args): Likewise. ! ! 2002-07-18 H.J. Lu (hjl@gnu.org) ! ! * Makefile.am (TARGET_SRC_MIPS_LINUX): New. ! (libffi_la_SOURCES): Support MIPS_LINUX. ! (libffi_convenience_la_SOURCES): Likewise. ! * Makefile.in: Regenerated. ! ! * configure.in (mips64*-*): Skip. ! (mips*-*-linux*): New. ! * configure: Regenerated. ! ! * src/mips/ffi.c: Include . ! ! 2002-06-06 Ulrich Weigand ! ! * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info. 2002-05-27 Roger Sayle *************** *** 67,79 **** * src/x86/ffi.c (ffi_prep_args): Remove unused variable and fix formatting. ! 2002-05-14 Release Manager ! ! * GCC 3.1 Released. ! ! 2002-05-14 Release Manager ! * GCC 3.1 Released. 2002-05-08 Alexandre Oliva --- 267,276 ---- * src/x86/ffi.c (ffi_prep_args): Remove unused variable and fix formatting. ! 2002-05-13 Andreas Tobler ! * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at ! beginning of function (for older apple cc). 2002-05-08 Alexandre Oliva *************** *** 81,90 **** --- 278,303 ---- script entry, and set LD to it when configuring multilibs. * configure: Rebuilt. + 2002-05-05 Jason Thorpe + + * configure.in (sparc64-*-netbsd*): Add target. + (sparc-*-netbsdelf*): Likewise. + * configure: Regenerate. + 2002-04-28 David S. Miller * configure.in, configure: Fix SPARC test in previous change. + 2002-04-29 Gerhard Tonn + + * Makefile.am: Add Linux for S/390 support. + * Makefile.in: Regenerate. + * configure.in: Add Linux for S/390 support. + * configure: Regenerate. + * include/ffi.h.in: Add Linux for S/390 support. + * src/s390/ffi.c: New file from libffi CVS tree. + * src/s390/sysv.S: New file from libffi CVS tree. + 2002-04-28 Jakub Jelinek * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working *************** *** 107,122 **** * src/sparc/v8.S: Make .eh_frame dependent on target word size. 2002-04-04 Jeff Sturm * src/sparc/v8.S: Add unwind info. * src/sparc/v9.S: Likewise. - 2002-04-01 Loren J. Rittle - - * configure.in: Enable alpha*-*-freebsd*. - * configure: Rebuilt. - 2002-03-30 Krister Walfridsson * configure.in: Enable i*86-*-netbsdelf*. --- 320,335 ---- * src/sparc/v8.S: Make .eh_frame dependent on target word size. + 2002-04-06 Jason Thorpe + + * configure.in (alpha*-*-netbsd*): Add target. + * configure: Regenerate. + 2002-04-04 Jeff Sturm * src/sparc/v8.S: Add unwind info. * src/sparc/v9.S: Likewise. 2002-03-30 Krister Walfridsson * configure.in: Enable i*86-*-netbsdelf*. *************** *** 128,133 **** --- 341,351 ---- * src/mips/n32.s: Delete * src/mips/o32.s: Delete + 2002-03-21 Loren J. Rittle + + * configure.in: Enable alpha*-*-freebsd*. + * configure: Rebuilt. + 2002-03-17 Bryce McKinlay * Makefile.am: libfficonvenience -> libffi_convenience. *************** *** 224,236 **** 2001-06-06 Andrew Haley ! * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF. 2001-06-03 Andrew Haley ! * src/alpha/osf.S: Add unwind info. ! * src/powerpc/sysv.S: Add unwind info. ! * src/powerpc/ppc_closure.S: Likewise. 2000-05-31 Jeff Sturm --- 442,454 ---- 2001-06-06 Andrew Haley ! * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF. 2001-06-03 Andrew Haley ! * src/alpha/osf.S: Add unwind info. ! * src/powerpc/sysv.S: Add unwind info. ! * src/powerpc/ppc_closure.S: Likewise. 2000-05-31 Jeff Sturm *************** *** 389,402 **** (Multilib support.): Add section. * Makefile.in: Rebuilt. * ltconfig (extra_compiler_flags, extra_compiler_flags_value): ! New variables. Set for gcc using -print-multi-lib. Export them ! to libtool. ! (sparc64-*-linux-gnu*): Use libsuff 64 for search paths. ! * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options ! for -shared links. ! (extra_compiler_flags_value, extra_compiler_flags): Check these ! for extra compiler options which need to be passed down in ! compiler_flags. 2000-04-16 Anthony Green --- 607,620 ---- (Multilib support.): Add section. * Makefile.in: Rebuilt. * ltconfig (extra_compiler_flags, extra_compiler_flags_value): ! New variables. Set for gcc using -print-multi-lib. Export them ! to libtool. ! (sparc64-*-linux-gnu*): Use libsuff 64 for search paths. ! * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options ! for -shared links. ! (extra_compiler_flags_value, extra_compiler_flags): Check these ! for extra compiler options which need to be passed down in ! compiler_flags. 2000-04-16 Anthony Green *************** *** 405,411 **** 2000-04-14 Jakub Jelinek ! * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds. Set SPARC FFI_DEFAULT_ABI based on SPARC64 define. * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args. Replace all void * sizeofs with sizeof(int). --- 623,629 ---- 2000-04-14 Jakub Jelinek ! * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds. Set SPARC FFI_DEFAULT_ABI based on SPARC64 define. * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args. Replace all void * sizeofs with sizeof(int). *************** *** 515,521 **** * configure: Rebuilt. * configure.in: Change version to 2.00-beta. ! * fficonfig.h.in: Rebuilt. * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. * src/x86/ffi.c (ffi_raw_call): Rename. --- 733,739 ---- * configure: Rebuilt. * configure.in: Change version to 2.00-beta. ! * fficonfig.h.in: Rebuilt. * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. * src/x86/ffi.c (ffi_raw_call): Rename. diff -Nrc3pad gcc-3.2.3/libffi/ChangeLog.libgcj gcc-3.3/libffi/ChangeLog.libgcj *** gcc-3.2.3/libffi/ChangeLog.libgcj 2003-01-28 01:43:56.000000000 +0000 --- gcc-3.3/libffi/ChangeLog.libgcj 2003-02-20 09:12:03.000000000 +0000 *************** *** 1,3 **** --- 1,9 ---- + 2003-02-20 Alexandre Oliva + + * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to + config.status. + * configure: Rebuilt. + 2002-01-27 Alexandre Oliva * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. diff -Nrc3pad gcc-3.2.3/libffi/configure gcc-3.3/libffi/configure *** gcc-3.2.3/libffi/configure 2003-01-28 22:59:05.000000000 +0000 --- gcc-3.3/libffi/configure 2003-05-08 20:37:56.000000000 +0000 *************** fi *** 633,649 **** if test "${srcdir}" = "."; then if test "${with_target_subdir}" != "."; then ! libffi_basedir="${srcdir}/${with_multisrctop}.." else ! libffi_basedir="${srcdir}/${with_multisrctop}" fi else ! libffi_basedir="${srcdir}" fi - ac_aux_dir= ! for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" --- 633,648 ---- if test "${srcdir}" = "."; then if test "${with_target_subdir}" != "."; then ! libffi_basedir="${with_multisrctop}../" else ! libffi_basedir="${with_multisrctop}" fi else ! libffi_basedir= fi ac_aux_dir= ! for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" *************** for ac_dir in $srcdir $srcdir/.. $srcdir *** 655,667 **** fi done if test -z "$ac_aux_dir"; then ! { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } --- 654,667 ---- fi done if test -z "$ac_aux_dir"; then ! { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } *************** gnu*) *** 1238,1246 **** ;; hpux10.20*|hpux11*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) --- 1238,1255 ---- ;; hpux10.20*|hpux11*) ! case $host_cpu in ! hppa*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ! ;; ! ia64*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ! ;; ! esac ;; irix5* | irix6*) *************** file_magic_cmd=$lt_cv_file_magic_cmd *** 1330,1342 **** deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:1334: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; --- 1339,1351 ---- deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:1343: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *************** ac_objext=$ac_cv_objext *** 1356,1362 **** echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1360: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1365,1371 ---- echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1369: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1366,1372 **** rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; --- 1375,1381 ---- rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; *************** case $deplibs_check_method in *** 1399,1405 **** file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:1403: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1408,1414 ---- file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:1412: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1461,1467 **** if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:1465: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1470,1476 ---- if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:1474: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** esac *** 1532,1538 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1536: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1541,1547 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1545: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 1564,1570 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1568: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1573,1579 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1577: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1599,1605 **** # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1603: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1608,1614 ---- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1612: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 1631,1637 **** # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1635: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1640,1646 ---- # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1644: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** test x"$pic_mode" = xno && libtool_flags *** 1698,1705 **** case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 1702 "configure"' > conftest.$ac_ext ! if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" --- 1707,1727 ---- case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 1711 "configure"' > conftest.$ac_ext ! if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! if test "$lt_cv_prog_gnu_ld" = yes; then ! case `/usr/bin/file conftest.$ac_objext` in ! *32-bit*) ! LD="${LD-ld} -melf32bsmip" ! ;; ! *N32*) ! LD="${LD-ld} -melf32bmipn32" ! ;; ! *64-bit*) ! LD="${LD-ld} -melf64bmip" ! ;; ! esac ! else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" *************** case $host in *** 1711,1716 **** --- 1733,1797 ---- LD="${LD-ld} -64" ;; esac + fi + fi + rm -rf conftest* + ;; + + ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; + + x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:1761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac fi rm -rf conftest* ;; *************** case $host in *** 1720,1726 **** SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:1724: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1801,1807 ---- SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:1805: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** ac_link='${CC-cc} -o conftest${ac_exeext *** 1733,1746 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else --- 1814,1827 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else *************** exec 5>>./config.log *** 1868,1874 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1872: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1949,1955 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1953: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** test -z "$INSTALL_SCRIPT" && INSTALL_SCR *** 1921,1927 **** test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:1925: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile --- 2002,2008 ---- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:2006: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile *************** test "$program_suffix" != NONE && *** 1978,1984 **** test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2059,2065 ---- test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:2063: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** fi *** 2017,2023 **** missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:2021: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 2098,2104 ---- missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:2102: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 2030,2036 **** fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:2034: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 2111,2117 ---- fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:2115: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 2043,2049 **** fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:2047: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 2124,2130 ---- fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:2128: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 2056,2062 **** fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:2060: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 2137,2143 ---- fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:2141: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 2069,2075 **** fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:2073: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 2150,2156 ---- fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:2154: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** fi *** 2086,2092 **** echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:2090: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2167,2173 ---- echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:2171: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 2096,2102 **** rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; --- 2177,2183 ---- rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; *************** echo "$ac_t""${ac_cv_exeext}" 1>&6 *** 2117,2123 **** ac_exeext=$EXEEXT echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" --- 2198,2204 ---- ac_exeext=$EXEEXT echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:2202: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" *************** fi *** 2143,2149 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2147: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2224,2230 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2228: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -z "$CC"; then *** 2173,2179 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2177: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2254,2260 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2258: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2224,2230 **** # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2228: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2305,2311 ---- # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2309: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2256,2262 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 2337,2343 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:2341: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** cross_compiling=$ac_cv_prog_cc_cross *** 2267,2278 **** cat > conftest.$ac_ext << EOF ! #line 2271 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 2348,2359 ---- cat > conftest.$ac_ext << EOF ! #line 2352 "configure" #include "confdefs.h" main(){return(0);} EOF ! if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** if test $ac_cv_prog_cc_works = no; then *** 2298,2309 **** { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:2307: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2379,2390 ---- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:2383: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:2388: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 2312,2318 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 2393,2399 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** ac_test_CFLAGS="${CFLAGS+set}" *** 2331,2337 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2412,2418 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:2416: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** i*86-*-cygwin*) TARGET=X86_WIN32; TARGET *** 2381,2397 **** i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; ! alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; esac if test $TARGETDIR = unknown; then --- 2462,2484 ---- i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; ! alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; + mips64*-*);; + mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; + s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; + s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; + x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; + sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; esac if test $TARGETDIR = unknown; then *************** else *** 2418,2423 **** --- 2505,2519 ---- fi + if test x$TARGET = xMIPS_LINUX; then + MIPS_LINUX_TRUE= + MIPS_LINUX_FALSE='#' + else + MIPS_LINUX_TRUE='#' + MIPS_LINUX_FALSE= + fi + + if test x$TARGET = xSPARC; then SPARC_TRUE= SPARC_FALSE='#' *************** else *** 2507,2514 **** ARM_FALSE= fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:2512: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 2603,2641 ---- ARM_FALSE= fi + + if test x$TARGET = xS390; then + S390_TRUE= + S390_FALSE='#' + else + S390_TRUE='#' + S390_FALSE= + fi + + + if test x$TARGET = xX86_64; then + X86_64_TRUE= + X86_64_FALSE='#' + else + X86_64_TRUE='#' + X86_64_FALSE= + fi + + + if test x$TARGET = xSH; then + SH_TRUE= + SH_FALSE='#' + else + SH_TRUE='#' + SH_FALSE= + fi + + if test x$TARGET = xMIPS_LINUX; then + TARGET=MIPS + fi + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:2639: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** else *** 2523,2535 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2650,2662 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** else *** 2540,2552 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2667,2679 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** else *** 2557,2569 **** rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2684,2696 ---- rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** fi *** 2588,2599 **** echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:2592: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 2715,2726 ---- echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:2719: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** else *** 2601,2607 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 2728,2734 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** rm -f conftest* *** 2618,2624 **** if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 2745,2751 ---- if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** fi *** 2636,2642 **** if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 2763,2769 ---- if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** if test "$cross_compiling" = yes; then *** 2657,2663 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 2784,2790 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** if (XOR (islower (i), ISLOWER (i)) || to *** 2668,2674 **** exit (0); } EOF ! if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else --- 2795,2801 ---- exit (0); } EOF ! if { (eval echo configure:2799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else *************** fi *** 2694,2705 **** for ac_func in memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2698: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2825: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2849,2855 ---- ; return 0; } EOF ! if { (eval echo configure:2853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 2749,2767 **** # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:2753: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else --- 2876,2894 ---- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:2880: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:2892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else *************** EOF *** 2782,2793 **** fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:2786: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2913: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else --- 2942,2948 ---- char *p = (char *) alloca(1); ; return 0; } EOF ! if { (eval echo configure:2946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else *************** EOF *** 2847,2858 **** echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:2851: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2978: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 *** 2877,2888 **** if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2881: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3008: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3032,3038 ---- ; return 0; } EOF ! if { (eval echo configure:3036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 2932,2938 **** fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:2936: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 3059,3065 ---- fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:3063: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 2940,2946 **** ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else --- 3086,3092 ---- exit (find_stack_direction() < 0); } EOF ! if { (eval echo configure:3090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else *************** fi *** 2982,2994 **** echo $ac_n "checking size of short""... $ac_c" 1>&6 ! echo "configure:2986: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3109,3121 ---- echo $ac_n "checking size of short""... $ac_c" 1>&6 ! echo "configure:3113: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 2998,3004 **** switch (0) case 0: case (sizeof (short) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_short=$ac_size else --- 3125,3131 ---- switch (0) case 0: case (sizeof (short) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_short=$ac_size else *************** EOF *** 3021,3033 **** echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:3025: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3148,3160 ---- echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:3152: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 3037,3043 **** switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_int=$ac_size else --- 3164,3170 ---- switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_int=$ac_size else *************** EOF *** 3060,3072 **** echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:3064: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3187,3199 ---- echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:3191: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 3076,3082 **** switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long=$ac_size else --- 3203,3209 ---- switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long=$ac_size else *************** EOF *** 3099,3111 **** echo $ac_n "checking size of long long""... $ac_c" 1>&6 ! echo "configure:3103: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3226,3238 ---- echo $ac_n "checking size of long long""... $ac_c" 1>&6 ! echo "configure:3230: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 3115,3121 **** switch (0) case 0: case (sizeof (long long) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_long=$ac_size else --- 3242,3248 ---- switch (0) case 0: case (sizeof (long long) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_long=$ac_size else *************** EOF *** 3138,3150 **** echo $ac_n "checking size of float""... $ac_c" 1>&6 ! echo "configure:3142: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3265,3277 ---- echo $ac_n "checking size of float""... $ac_c" 1>&6 ! echo "configure:3269: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 3154,3160 **** switch (0) case 0: case (sizeof (float) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_float=$ac_size else --- 3281,3287 ---- switch (0) case 0: case (sizeof (float) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_float=$ac_size else *************** EOF *** 3177,3189 **** echo $ac_n "checking size of double""... $ac_c" 1>&6 ! echo "configure:3181: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3304,3316 ---- echo $ac_n "checking size of double""... $ac_c" 1>&6 ! echo "configure:3308: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 3193,3199 **** switch (0) case 0: case (sizeof (double) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_double=$ac_size else --- 3320,3326 ---- switch (0) case 0: case (sizeof (double) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_double=$ac_size else *************** EOF *** 3216,3228 **** echo $ac_n "checking size of long double""... $ac_c" 1>&6 ! echo "configure:3220: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3343,3355 ---- echo $ac_n "checking size of long double""... $ac_c" 1>&6 ! echo "configure:3347: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 3232,3238 **** switch (0) case 0: case (sizeof (long double) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_double=$ac_size else --- 3359,3365 ---- switch (0) case 0: case (sizeof (long double) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_long_double=$ac_size else *************** EOF *** 3256,3268 **** echo $ac_n "checking size of void *""... $ac_c" 1>&6 ! echo "configure:3260: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 3383,3395 ---- echo $ac_n "checking size of void *""... $ac_c" 1>&6 ! echo "configure:3387: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 3272,3278 **** switch (0) case 0: case (sizeof (void *) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_void_p=$ac_size else --- 3399,3405 ---- switch (0) case 0: case (sizeof (void *) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:3403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_void_p=$ac_size else *************** EOF *** 3295,3308 **** echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:3299: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include --- 3422,3435 ---- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 ! echo "configure:3426: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include *************** int main() { *** 3313,3323 **** #endif ; return 0; } EOF ! if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include --- 3440,3450 ---- #endif ; return 0; } EOF ! if { (eval echo configure:3444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include *************** int main() { *** 3328,3334 **** #endif ; return 0; } EOF ! if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else --- 3455,3461 ---- #endif ; return 0; } EOF ! if { (eval echo configure:3459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else *************** if test "$cross_compiling" = yes; then *** 3348,3354 **** echo $ac_n "cross-compiling... " 2>&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else --- 3488,3494 ---- exit (u.c[sizeof (long) - 1] == 1); } EOF ! if { (eval echo configure:3492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else *************** fi *** 3379,3385 **** echo "$ac_t""$ac_cv_c_bigendian" 1>&6 if test $ac_cv_c_bigendian = unknown; then echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 ! echo "configure:3383: checking to probe for byte ordering" >&5 cat >conftest.c <&6 if test $ac_cv_c_bigendian = unknown; then echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 ! echo "configure:3510: checking to probe for byte ordering" >&5 cat >conftest.c <&6 ! echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5 if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 3556,3562 ---- if test x$TARGET = xSPARC; then echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6 ! echo "configure:3560: checking assembler and linker support unaligned pc related relocs" >&5 if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 3439,3452 **** CFLAGS="$CFLAGS -fpic" LDFLAGS="$LDFLAGS -shared" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* libffi_cv_as_sparc_ua_pcrel=yes else --- 3566,3579 ---- CFLAGS="$CFLAGS -fpic" LDFLAGS="$LDFLAGS -shared" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* libffi_cv_as_sparc_ua_pcrel=yes else *************** echo "$ac_t""$libffi_cv_as_sparc_ua_pcre *** 3467,3472 **** --- 3594,3636 ---- EOF fi + + echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 + echo "configure:3600: checking assembler .register pseudo-op support" >&5 + if eval "test \"`echo '$''{'libffi_cv_as_register_pseudo_op'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + + libffi_cv_as_register_pseudo_op=unknown + # Check if we have .register + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + libffi_cv_as_register_pseudo_op=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + libffi_cv_as_register_pseudo_op=no + fi + rm -f conftest* + + fi + + echo "$ac_t""$libffi_cv_as_register_pseudo_op" 1>&6 + if test "x$libffi_cv_as_register_pseudo_op" = xyes; then + cat >> confdefs.h <<\EOF + #define HAVE_AS_REGISTER_PSEUDO_OP 1 + EOF + + fi fi *************** s%@MIPS_GCC_TRUE@%$MIPS_GCC_TRUE%g *** 3709,3714 **** --- 3873,3880 ---- s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g + s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g + s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g s%@SPARC_TRUE@%$SPARC_TRUE%g s%@SPARC_FALSE@%$SPARC_FALSE%g s%@X86_TRUE@%$X86_TRUE%g *************** s%@POWERPC_DARWIN_TRUE@%$POWERPC_DARWIN_ *** 3729,3734 **** --- 3895,3906 ---- s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g s%@ARM_TRUE@%$ARM_TRUE%g s%@ARM_FALSE@%$ARM_FALSE%g + s%@S390_TRUE@%$S390_TRUE%g + s%@S390_FALSE@%$S390_FALSE%g + s%@X86_64_TRUE@%$X86_64_TRUE%g + s%@X86_64_FALSE@%$X86_64_FALSE%g + s%@SH_TRUE@%$SH_TRUE%g + s%@SH_FALSE@%$SH_FALSE%g s%@CPP@%$CPP%g s%@ALLOCA@%$ALLOCA%g s%@TARGET@%$TARGET%g *************** CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} *** 3954,3959 **** --- 4126,4132 ---- libffi_basedir=${libffi_basedir} CC="${CC}" DEFS="$DEFS" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" test ! -d include && mkdir include test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then *************** test -z "$CONFIG_HEADERS" || echo timest *** 3969,3975 **** if test -n "$CONFIG_FILES"; then LD="${ORIGINAL_LD_FOR_MULTILIBS}" ! ac_file=Makefile . ${libffi_basedir}/../config-ml.in fi exit 0 --- 4142,4148 ---- if test -n "$CONFIG_FILES"; then LD="${ORIGINAL_LD_FOR_MULTILIBS}" ! ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in fi exit 0 diff -Nrc3pad gcc-3.2.3/libffi/configure.in gcc-3.3/libffi/configure.in *** gcc-3.2.3/libffi/configure.in 2003-01-28 01:43:56.000000000 +0000 --- gcc-3.3/libffi/configure.in 2003-05-08 20:37:56.000000000 +0000 *************** dnl --with-target-subdir, --with-multisr *** 22,35 **** if test "${srcdir}" = "."; then if test "${with_target_subdir}" != "."; then ! libffi_basedir="${srcdir}/${with_multisrctop}.." else ! libffi_basedir="${srcdir}/${with_multisrctop}" fi else ! libffi_basedir="${srcdir}" fi AC_SUBST(libffi_basedir) AC_CANONICAL_HOST --- 22,36 ---- if test "${srcdir}" = "."; then if test "${with_target_subdir}" != "."; then ! libffi_basedir="${with_multisrctop}../" else ! libffi_basedir="${with_multisrctop}" fi else ! libffi_basedir= fi AC_SUBST(libffi_basedir) + AC_CONFIG_AUX_DIR(${libffi_basedir}..) AC_CANONICAL_HOST *************** i*86-*-cygwin*) TARGET=X86_WIN32; TARGET *** 56,72 **** i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; ! alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; esac if test $TARGETDIR = unknown; then --- 57,79 ---- i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; ! sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; ! alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; + mips64*-*);; + mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; + s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; + s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; + x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; + sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;; esac if test $TARGETDIR = unknown; then *************** fi *** 75,80 **** --- 82,88 ---- AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno) + AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) AM_CONDITIONAL(X86, test x$TARGET = xX86) AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) *************** AM_CONDITIONAL(POWERPC, test x$TARGET = *** 85,90 **** --- 93,105 ---- AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) AM_CONDITIONAL(ARM, test x$TARGET = xARM) + AM_CONDITIONAL(S390, test x$TARGET = xS390) + AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64) + AM_CONDITIONAL(SH, test x$TARGET = xSH) + + if test x$TARGET = xMIPS_LINUX; then + TARGET=MIPS + fi AC_HEADER_STDC AC_CHECK_FUNCS(memcpy) *************** if test x$TARGET = xSPARC; then *** 118,123 **** --- 133,151 ---- AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1, [Define if your assembler and linker support unaligned PC relative relocs.]) fi + + AC_CACHE_CHECK([assembler .register pseudo-op support], + libffi_cv_as_register_pseudo_op, [ + libffi_cv_as_register_pseudo_op=unknown + # Check if we have .register + AC_TRY_COMPILE([asm (".register %g2, #scratch");],, + [libffi_cv_as_register_pseudo_op=yes], + [libffi_cv_as_register_pseudo_op=no]) + ]) + if test "x$libffi_cv_as_register_pseudo_op" = xyes; then + AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1, + [Define if your assembler supports .register.]) + fi fi AC_SUBST(TARGET) *************** AC_OUTPUT(include/Makefile include/ffi.h *** 171,177 **** [ if test -n "$CONFIG_FILES"; then LD="${ORIGINAL_LD_FOR_MULTILIBS}" ! ac_file=Makefile . ${libffi_basedir}/../config-ml.in fi ], srcdir=${srcdir} --- 199,205 ---- [ if test -n "$CONFIG_FILES"; then LD="${ORIGINAL_LD_FOR_MULTILIBS}" ! ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in fi ], srcdir=${srcdir} *************** CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} *** 183,188 **** --- 211,217 ---- libffi_basedir=${libffi_basedir} CC="${CC}" DEFS="$DEFS" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" test ! -d include && mkdir include test ! -f include/fficonfig.h && cp fficonfig.h include/fficonfig.h if cmp -s fficonfig.h include/fficonfig.h 2>/dev/null; then diff -Nrc3pad gcc-3.2.3/libffi/fficonfig.h.in gcc-3.3/libffi/fficonfig.h.in *** gcc-3.2.3/libffi/fficonfig.h.in 2002-04-28 20:12:04.000000000 +0000 --- gcc-3.3/libffi/fficonfig.h.in 2003-05-08 20:37:57.000000000 +0000 *************** *** 25,34 **** /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS - /* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ - #undef WORDS_BIGENDIAN - /* Define this if you want extra debugging */ #undef FFI_DEBUG --- 25,30 ---- *************** *** 42,73 **** /* Define this is you do not want support for the raw API. */ #undef FFI_NO_RAW_API ! /* The number of bytes in a double. */ ! #undef SIZEOF_DOUBLE ! /* The number of bytes in a float. */ ! #undef SIZEOF_FLOAT ! /* The number of bytes in a int. */ #undef SIZEOF_INT ! /* The number of bytes in a long. */ #undef SIZEOF_LONG ! /* The number of bytes in a long double. */ ! #undef SIZEOF_LONG_DOUBLE ! ! /* The number of bytes in a long long. */ #undef SIZEOF_LONG_LONG ! /* The number of bytes in a short. */ ! #undef SIZEOF_SHORT ! /* The number of bytes in a void *. */ #undef SIZEOF_VOID_P ! /* Define if you have the memcpy function. */ ! #undef HAVE_MEMCPY ! /* Define if your assembler and linker support unaligned PC relative relocs. */ #undef HAVE_AS_SPARC_UA_PCREL --- 38,79 ---- /* Define this is you do not want support for the raw API. */ #undef FFI_NO_RAW_API ! /* Define if you have the memcpy function. */ ! #undef HAVE_MEMCPY ! /* The number of bytes in type short */ ! #undef SIZEOF_SHORT ! /* The number of bytes in type int */ #undef SIZEOF_INT ! /* The number of bytes in type long */ #undef SIZEOF_LONG ! /* The number of bytes in type long long */ #undef SIZEOF_LONG_LONG ! /* The number of bytes in type float */ ! #undef SIZEOF_FLOAT ! /* The number of bytes in type double */ ! #undef SIZEOF_DOUBLE ! ! /* The number of bytes in type long double */ ! #undef SIZEOF_LONG_DOUBLE ! ! /* The number of bytes in type void * */ #undef SIZEOF_VOID_P ! /* whether byteorder is bigendian */ ! #undef WORDS_BIGENDIAN ! /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ ! #undef BYTEORDER ! ! /* Define if your assembler and linker support unaligned PC relative relocs. */ #undef HAVE_AS_SPARC_UA_PCREL + + /* Define if your assembler supports .register. */ + #undef HAVE_AS_REGISTER_PSEUDO_OP + diff -Nrc3pad gcc-3.2.3/libffi/include/ffi.h.in gcc-3.3/libffi/include/ffi.h.in *** gcc-3.2.3/libffi/include/ffi.h.in 2002-03-12 22:35:56.000000000 +0000 --- gcc-3.3/libffi/include/ffi.h.in 2003-03-22 11:57:33.000000000 +0000 *************** *** 1,5 **** /* -----------------------------------------------------------------*-C-*- ! libffi @VERSION@ - Copyright (c) 1996-2002 Cygnus Solutions Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the --- 1,5 ---- /* -----------------------------------------------------------------*-C-*- ! libffi @VERSION@ - Copyright (c) 1996-2003 Cygnus Solutions Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the *************** extern "C" { *** 164,169 **** --- 164,182 ---- #endif #endif + #ifdef S390 + #if defined (__s390x__) + #define S390X + #endif + #endif + + #ifdef X86_64 + #if defined (__i386__) + #undef X86_64 + #define X86 + #endif + #endif + #ifndef LIBFFI_ASM /* ---- Generic type definitions ----------------------------------------- */ *************** typedef enum ffi_abi { *** 189,204 **** #endif #endif ! /* ---- Intel x86 ---------------- */ ! #ifdef X86 FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, #endif ! /* ---- Intel x86 Win32 ---------- */ ! #ifdef X86_WIN32 FFI_SYSV, FFI_DEFAULT_ABI = FFI_SYSV, #endif /* ---- Intel ia64 ---------------- */ --- 202,224 ---- #endif #endif ! /* ---- Intel x86 Win32 ---------- */ ! #ifdef X86_WIN32 FFI_SYSV, + FFI_STDCALL, + /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV, #endif ! /* ---- Intel x86 and AMD x86-64 - */ ! #if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) FFI_SYSV, + FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ + #ifdef __i386__ FFI_DEFAULT_ABI = FFI_SYSV, + #else + FFI_DEFAULT_ABI = FFI_UNIX64, + #endif #endif /* ---- Intel ia64 ---------------- */ *************** typedef enum ffi_abi { *** 251,256 **** --- 271,288 ---- FFI_DEFAULT_ABI = FFI_SYSV, #endif + /* ---- S390 --------------------- */ + #ifdef S390 + FFI_SYSV, + FFI_DEFAULT_ABI = FFI_SYSV, + #endif + + /* ---- SuperH ------------------- */ + #ifdef SH + FFI_SYSV, + FFI_DEFAULT_ABI = FFI_SYSV, + #endif + /* Leave this for debugging purposes */ FFI_LAST_ABI *************** typedef struct _ffi_type *** 264,270 **** /*@null@*/ struct _ffi_type **elements; } ffi_type; ! /* These are defined in ffi.c */ extern ffi_type ffi_type_void; extern ffi_type ffi_type_uint8; extern ffi_type ffi_type_sint8; --- 296,302 ---- /*@null@*/ struct _ffi_type **elements; } ffi_type; ! /* These are defined in types.c */ extern ffi_type ffi_type_void; extern ffi_type ffi_type_uint8; extern ffi_type ffi_type_sint8; *************** size_t ffi_java_raw_size (ffi_cif *cif); *** 373,385 **** /* ---- Definitions for closures ----------------------------------------- */ ! #ifdef X86 ! ! #define FFI_CLOSURES 1 /* x86 supports closures */ ! #define FFI_TRAMPOLINE_SIZE 10 ! #define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ ! ! #elif defined(X86_WIN32) #define FFI_CLOSURES 1 /* x86 supports closures */ #define FFI_TRAMPOLINE_SIZE 10 --- 405,411 ---- /* ---- Definitions for closures ----------------------------------------- */ ! #ifdef __i386__ #define FFI_CLOSURES 1 /* x86 supports closures */ #define FFI_TRAMPOLINE_SIZE 10 *************** struct ffi_ia64_trampoline_struct { *** 424,429 **** --- 450,489 ---- #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ #define FFI_NATIVE_RAW_API 0 + #elif defined(SPARC64) + + #define FFI_CLOSURES 1 + #define FFI_TRAMPOLINE_SIZE 24 + #define FFI_NATIVE_RAW_API 0 + + #elif defined(SPARC) + + #define FFI_CLOSURES 1 + #define FFI_TRAMPOLINE_SIZE 16 + #define FFI_NATIVE_RAW_API 0 + + #elif defined(S390) + + #define FFI_CLOSURES 1 + #ifdef S390X + #define FFI_TRAMPOLINE_SIZE 32 + #else + #define FFI_TRAMPOLINE_SIZE 16 + #endif + #define FFI_NATIVE_RAW_API 0 + + #elif defined(SH) + + #define FFI_CLOSURES 1 + #define FFI_TRAMPOLINE_SIZE 16 + #define FFI_NATIVE_RAW_API 0 + + #elif defined(__x86_64__) + + #define FFI_CLOSURES 1 + #define FFI_TRAMPOLINE_SIZE 24 + #define FFI_NATIVE_RAW_API 0 + #else #define FFI_CLOSURES 0 diff -Nrc3pad gcc-3.2.3/libffi/include/Makefile.in gcc-3.3/libffi/include/Makefile.in *** gcc-3.2.3/libffi/include/Makefile.in 2001-10-09 05:32:16.000000000 +0000 --- gcc-3.3/libffi/include/Makefile.in 2003-04-05 01:46:50.000000000 +0000 *************** *** 1,6 **** ! # Makefile.in generated automatically by automake 1.4 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. --- 1,6 ---- ! # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. *************** TARGET = @TARGET@ *** 81,86 **** --- 81,88 ---- TARGETDIR = @TARGETDIR@ VERSION = @VERSION@ libffi_basedir = @libffi_basedir@ + toolexecdir = @toolexecdir@ + toolexeclibdir = @toolexeclibdir@ AUTOMAKE_OPTIONS = foreign *************** EXTRA_DIST = ffi.h.in ffi_common.h ffi_m *** 89,95 **** hackdir = $(includedir) hack_DATA = fficonfig.h ffi.h ffi_mips.h ! mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = ../fficonfig.h CONFIG_CLEAN_FILES = ffi.h DATA = $(hack_DATA) --- 91,97 ---- hackdir = $(includedir) hack_DATA = fficonfig.h ffi.h ffi_mips.h ! mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs CONFIG_HEADER = ../fficonfig.h CONFIG_CLEAN_FILES = ffi.h DATA = $(hack_DATA) *************** DIST_COMMON = Makefile.am Makefile.in f *** 99,105 **** DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ! TAR = gnutar GZIP_ENV = --best all: all-redirect .SUFFIXES: --- 101,107 ---- DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) ! TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: diff -Nrc3pad gcc-3.2.3/libffi/Makefile.am gcc-3.3/libffi/Makefile.am *** gcc-3.2.3/libffi/Makefile.am 2003-01-28 01:43:56.000000000 +0000 --- gcc-3.3/libffi/Makefile.am 2003-01-28 01:44:57.000000000 +0000 *************** EXTRA_DIST = LICENSE ChangeLog.v1 src/mi *** 8,13 **** --- 8,14 ---- src/mips/n32.s src/mips/o32.S src/mips/o32.s \ src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ + src/x86/ffi64.c src/x86/unix64.S \ src/alpha/ffi.c src/alpha/osf.S \ src/m68k/ffi.c src/m68k/sysv.S \ src/powerpc/ffi.c src/powerpc/sysv.S \ *************** EXTRA_DIST = LICENSE ChangeLog.v1 src/mi *** 15,21 **** src/powerpc/ffi_darwin.c \ src/powerpc/darwin.S src/powerpc/aix.S \ src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ ! src/arm/ffi.c src/arm/sysv.S VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ --- 16,24 ---- src/powerpc/ffi_darwin.c \ src/powerpc/darwin.S src/powerpc/aix.S \ src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ ! src/arm/ffi.c src/arm/sysv.S \ ! src/s390/ffi.c src/s390/sysv.S \ ! src/sh/ffi.c src/sh/sysv.S VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ *************** ffitest_LDADD = libffi.la *** 83,88 **** --- 86,92 ---- ffitest_LDFLAGS = -shared-libgcc TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S + TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S *************** TARGET_SRC_POWERPC = src/powerpc/ffi.c s *** 94,99 **** --- 98,106 ---- TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c + TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c + TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S + TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@) ## Work around automake deficiency *************** if MIPS_GCC *** 103,108 **** --- 110,119 ---- libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) endif + if MIPS_LINUX + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) + endif if MIPS_SGI libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) *************** if ARM *** 147,152 **** --- 158,175 ---- libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) endif + if S390 + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) + endif + if X86_64 + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) + endif + if SH + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) + libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) + endif AM_CFLAGS = -fexceptions diff -Nrc3pad gcc-3.2.3/libffi/Makefile.in gcc-3.3/libffi/Makefile.in *** gcc-3.2.3/libffi/Makefile.in 2003-01-28 22:59:05.000000000 +0000 --- gcc-3.3/libffi/Makefile.in 2003-01-28 01:44:57.000000000 +0000 *************** EXTRA_DIST = LICENSE ChangeLog.v1 src/mi *** 91,96 **** --- 91,97 ---- src/mips/n32.s src/mips/o32.S src/mips/o32.s \ src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ + src/x86/ffi64.c src/x86/unix64.S \ src/alpha/ffi.c src/alpha/osf.S \ src/m68k/ffi.c src/m68k/sysv.S \ src/powerpc/ffi.c src/powerpc/sysv.S \ *************** EXTRA_DIST = LICENSE ChangeLog.v1 src/mi *** 98,104 **** src/powerpc/ffi_darwin.c \ src/powerpc/darwin.S src/powerpc/aix.S \ src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ ! src/arm/ffi.c src/arm/sysv.S VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ --- 99,107 ---- src/powerpc/ffi_darwin.c \ src/powerpc/darwin.S src/powerpc/aix.S \ src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ ! src/arm/ffi.c src/arm/sysv.S \ ! src/s390/ffi.c src/s390/sysv.S \ ! src/sh/ffi.c src/sh/sysv.S VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ *************** ffitest_LDADD = libffi.la *** 162,167 **** --- 165,171 ---- ffitest_LDFLAGS = -shared-libgcc TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S + TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S *************** TARGET_SRC_POWERPC = src/powerpc/ffi.c s *** 173,183 **** --- 177,191 ---- TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c + TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c + TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S + TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ src/raw_api.c src/java_raw_api.c @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) + @MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) *************** libffi_la_common_SOURCES = src/debug.c s *** 189,195 **** --- 197,207 ---- @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) + @S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) + @X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) + @SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) + @MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) *************** libffi_la_common_SOURCES = src/debug.c s *** 201,206 **** --- 213,221 ---- @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) + @S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) + @X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) + @SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) AM_CFLAGS = -fexceptions *************** libffi_la_LDFLAGS = -release $(VERSION) *** 208,214 **** INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ! mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = fficonfig.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) --- 223,229 ---- INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ! mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs CONFIG_HEADER = fficonfig.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) *************** LDFLAGS = @LDFLAGS@ *** 220,229 **** LIBS = @LIBS@ libffi_convenience_la_LDFLAGS = libffi_convenience_la_LIBADD = - @POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ - @POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo @ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo --- 235,240 ---- *************** libffi_convenience_la_LIBADD = *** 234,245 **** @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ @MIPS_GCC_TRUE@src/mips/n32.lo ! @X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ! @X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ! @X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ --- 245,273 ---- @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ @MIPS_GCC_TRUE@src/mips/n32.lo ! @S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo + @X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo + @POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ + @POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo + @MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo + @X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo + @X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \ + @X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ *************** libffi_convenience_la_LIBADD = *** 248,288 **** @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ @POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo ! @X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo ! @ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo ! @MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ! @MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ! @MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ ! @MIPS_SGI_TRUE@src/mips/n32.lo libffi_la_LIBADD = @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ @POWERPC_TRUE@src/powerpc/ppc_closure.lo ! @ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo ! @IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo ! @MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo ! @X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo ! @M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo --- 276,310 ---- @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ @POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo ! @MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ! @MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ! @MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ ! @MIPS_SGI_TRUE@src/mips/n32.lo @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo ! @ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo libffi_la_LIBADD = + @SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ + @SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \ + @SH_TRUE@src/sh/ffi.lo + @IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo + @X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ + @X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ + @X86_TRUE@src/x86/sysv.lo @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ @POWERPC_TRUE@src/powerpc/ppc_closure.lo ! @MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo *************** libffi_la_LIBADD = *** 290,308 **** @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \ @POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo ! @X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ ! @X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ ! @X86_TRUE@src/x86/sysv.lo @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ @ARM_TRUE@src/arm/ffi.lo @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo - @MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo noinst_PROGRAMS = ffitest$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) --- 312,346 ---- @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \ @POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo ! @MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ! @MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ! @MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ @ARM_TRUE@src/arm/ffi.lo + @ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo + @MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo + @S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo + @M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo + @X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo + @X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \ + @X86_64_TRUE@src/x86/sysv.lo @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo noinst_PROGRAMS = ffitest$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) *************** distdir: $(DISTFILES) *** 578,585 **** -chmod 777 $(distdir) $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \ $(distdir)/src/m68k $(distdir)/src/mips \ ! $(distdir)/src/powerpc $(distdir)/src/sparc \ ! $(distdir)/src/x86 @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ --- 616,623 ---- -chmod 777 $(distdir) $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \ $(distdir)/src/m68k $(distdir)/src/mips \ ! $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \ ! $(distdir)/src/sparc $(distdir)/src/x86 @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ diff -Nrc3pad gcc-3.2.3/libffi/src/arm/ffi.c gcc-3.3/libffi/src/arm/ffi.c *** gcc-3.2.3/libffi/src/arm/ffi.c 2001-03-02 22:21:23.000000000 +0000 --- gcc-3.3/libffi/src/arm/ffi.c 2002-07-18 23:08:30.000000000 +0000 *************** void ffi_prep_args(char *stack, extended *** 36,48 **** /*@=exportheader@*/ { register unsigned int i; - register int tmp; - register unsigned int avn; register void **p_argv; register char *argp; register ffi_type **p_arg; - tmp = 0; argp = stack; if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) { --- 36,45 ---- *************** void ffi_prep_args(char *stack, extended *** 50,60 **** argp += 4; } - avn = ecif->cif->nargs; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ! (i != 0) && (avn != 0); i--, p_arg++) { size_t z; --- 47,56 ---- argp += 4; } p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ! (i != 0); i--, p_arg++) { size_t z; *************** void ffi_prep_args(char *stack, extended *** 64,72 **** argp = (char *) ALIGN(argp, (*p_arg)->alignment); } - if (avn != 0) - { - avn--; z = (*p_arg)->size; if (z < sizeof(int)) { --- 60,65 ---- *************** void ffi_prep_args(char *stack, extended *** 107,113 **** } p_argv++; argp += z; - } } return; --- 100,105 ---- diff -Nrc3pad gcc-3.2.3/libffi/src/arm/sysv.S gcc-3.3/libffi/src/arm/sysv.S *** gcc-3.2.3/libffi/src/arm/sysv.S 2001-03-02 22:21:23.000000000 +0000 --- gcc-3.3/libffi/src/arm/sysv.S 2002-09-29 18:08:58.000000000 +0000 *************** *** 28,35 **** #ifdef HAVE_MACHINE_ASM_H #include #else ! /* XXX these lose for some platforms, I'm sure. */ #define CNAME(x) x #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): #endif --- 28,42 ---- #ifdef HAVE_MACHINE_ASM_H #include #else ! #ifdef __USER_LABEL_PREFIX__ ! #define CONCAT1(a, b) CONCAT2(a, b) ! #define CONCAT2(a, b) a ## b ! ! /* Use the right prefix for global labels. */ ! #define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) ! #else #define CNAME(x) x + #endif #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): #endif *************** ENTRY(ffi_call_SYSV) *** 96,107 **** --- 103,122 ---- # return FLOAT cmp a4, #FFI_TYPE_FLOAT + #ifdef __SOFTFP__ + streq a1, [a3] + #else stfeqs f0, [a3] + #endif beq epilogue # return DOUBLE or LONGDOUBLE cmp a4, #FFI_TYPE_DOUBLE + #ifdef __SOFTFP__ + stmeqia a3, {a1, a2} + #else stfeqd f0, [a3] + #endif epilogue: ldmfd sp!, {a1-a4, fp, pc} diff -Nrc3pad gcc-3.2.3/libffi/src/ffitest.c gcc-3.3/libffi/src/ffitest.c *** gcc-3.2.3/libffi/src/ffitest.c 2003-02-08 07:54:39.000000000 +0000 --- gcc-3.3/libffi/src/ffitest.c 2003-01-14 11:11:35.000000000 +0000 *************** static size_t my_strlen(char *s) *** 49,54 **** --- 49,61 ---- return (strlen(s)); } + #ifdef X86_WIN32 + static size_t __attribute__((stdcall)) my_stdcall_strlen(char *s) + { + return (strlen(s)); + } + #endif /* X86_WIN32 */ + static int promotion(signed char sc, signed short ss, unsigned char uc, unsigned short us) { *************** static float many(float f1, *** 112,117 **** --- 119,143 ---- return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); } + #ifdef X86_WIN32 + static float __attribute__((stdcall)) stdcall_many(float f1, + float f2, + float f3, + float f4, + float f5, + float f6, + float f7, + float f8, + float f9, + float f10, + float f11, + float f12, + float f13) + { + return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); + } + #endif /* X86_WIN32 */ + static double dblit(float f) { return f/3.0; *************** typedef struct *** 153,158 **** --- 179,211 ---- char c2; } test_structure_5; + typedef struct + { + float f; + double d; + } test_structure_6; + + typedef struct + { + float f1; + float f2; + double d; + } test_structure_7; + + typedef struct + { + float f1; + float f2; + float f3; + float f4; + } test_structure_8; + + typedef struct + { + float f; + int i; + } test_structure_9; + static test_structure_1 struct1(test_structure_1 ts) { /*@-type@*/ *************** static test_structure_5 struct5(test_str *** 194,199 **** --- 247,287 ---- return ts1; } + static test_structure_6 struct6 (test_structure_6 ts) + { + ts.f += 1; + ts.d += 1; + + return ts; + } + + static test_structure_7 struct7 (test_structure_7 ts) + { + ts.f1 += 1; + ts.f2 += 1; + ts.d += 1; + + return ts; + } + + static test_structure_8 struct8 (test_structure_8 ts) + { + ts.f1 += 1; + ts.f2 += 1; + ts.f3 += 1; + ts.f4 += 1; + + return ts; + } + + static test_structure_9 struct9 (test_structure_9 ts) + { + ts.f += 1; + ts.i += 1; + + return ts; + } + /* Take an int and a float argument, together with int userdata, and */ /* return the sum. */ #if FFI_CLOSURES *************** typedef int (*closure_test_type3)(float, *** 316,321 **** --- 404,410 ---- float, float, double, int, float, float, int, float, float, int); #endif + int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[]) { ffi_cif cif; *************** int main(/*@unused@*/ int argc, /*@unuse *** 350,360 **** --- 439,457 ---- ffi_type ts3_type; ffi_type ts4_type; ffi_type ts5_type; + ffi_type ts6_type; + ffi_type ts7_type; + ffi_type ts8_type; + ffi_type ts9_type; ffi_type *ts1_type_elements[4]; ffi_type *ts2_type_elements[3]; ffi_type *ts3_type_elements[2]; ffi_type *ts4_type_elements[4]; ffi_type *ts5_type_elements[3]; + ffi_type *ts6_type_elements[3]; + ffi_type *ts7_type_elements[4]; + ffi_type *ts8_type_elements[5]; + ffi_type *ts9_type_elements[3]; ts1_type.size = 0; ts1_type.alignment = 0; *************** int main(/*@unused@*/ int argc, /*@unuse *** 376,387 **** --- 473,504 ---- ts5_type.alignment = 0; ts5_type.type = FFI_TYPE_STRUCT; + ts6_type.size = 0; + ts6_type.alignment = 0; + ts6_type.type = FFI_TYPE_STRUCT; + + ts7_type.size = 0; + ts7_type.alignment = 0; + ts7_type.type = FFI_TYPE_STRUCT; + + ts8_type.size = 0; + ts8_type.alignment = 0; + ts8_type.type = FFI_TYPE_STRUCT; + + ts9_type.size = 0; + ts9_type.alignment = 0; + ts9_type.type = FFI_TYPE_STRUCT; + /*@-immediatetrans@*/ ts1_type.elements = ts1_type_elements; ts2_type.elements = ts2_type_elements; ts3_type.elements = ts3_type_elements; ts4_type.elements = ts4_type_elements; ts5_type.elements = ts5_type_elements; + ts6_type.elements = ts6_type_elements; + ts7_type.elements = ts7_type_elements; + ts8_type.elements = ts8_type_elements; + ts9_type.elements = ts9_type_elements; /*@=immediatetrans@*/ ts1_type_elements[0] = &ffi_type_uchar; *************** int main(/*@unused@*/ int argc, /*@unuse *** 405,410 **** --- 522,546 ---- ts5_type_elements[1] = &ffi_type_schar; ts5_type_elements[2] = NULL; + ts6_type_elements[0] = &ffi_type_float; + ts6_type_elements[1] = &ffi_type_double; + ts6_type_elements[2] = NULL; + + ts7_type_elements[0] = &ffi_type_float; + ts7_type_elements[1] = &ffi_type_float; + ts7_type_elements[2] = &ffi_type_double; + ts7_type_elements[3] = NULL; + + ts8_type_elements[0] = &ffi_type_float; + ts8_type_elements[1] = &ffi_type_float; + ts8_type_elements[2] = &ffi_type_float; + ts8_type_elements[3] = &ffi_type_float; + ts8_type_elements[4] = NULL; + + ts9_type_elements[0] = &ffi_type_float; + ts9_type_elements[1] = &ffi_type_sint; + ts9_type_elements[2] = NULL; + ul = 0; /* return value tests */ *************** int main(/*@unused@*/ int argc, /*@unuse *** 446,452 **** { ul++; ffi_call(&cif, FFI_FN(return_sc), &rint, values); ! CHECK(rint == (int) sc); } args[0] = &ffi_type_uchar; --- 582,588 ---- { ul++; ffi_call(&cif, FFI_FN(return_sc), &rint, values); ! CHECK(rint == (ffi_arg) sc); } args[0] = &ffi_type_uchar; *************** int main(/*@unused@*/ int argc, /*@unuse *** 533,539 **** ffi_call(&cif, FFI_FN(floating), &rint, values); ! printf ("%d vs %d\n", rint, floating (si1, f, d, ld, si2)); CHECK(rint == floating(si1, f, d, ld, si2)); --- 669,675 ---- ffi_call(&cif, FFI_FN(floating), &rint, values); ! printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld, si2)); CHECK(rint == floating(si1, f, d, ld, si2)); *************** int main(/*@unused@*/ int argc, /*@unuse *** 603,609 **** &ffi_type_float, args) == FFI_OK); /*@-usedef@*/ ! ff = many(fa[0], fa[1], fa[2], fa[3], fa[4], fa[5], fa[6], fa[7], --- 739,745 ---- &ffi_type_float, args) == FFI_OK); /*@-usedef@*/ ! ff = many (fa[0], fa[1], fa[2], fa[3], fa[4], fa[5], fa[6], fa[7], *************** int main(/*@unused@*/ int argc, /*@unuse *** 652,658 **** { ul++; ffi_call(&cif, FFI_FN(promotion), &rint, values); ! CHECK(rint == (int) sc + (int) ss + (int) uc + (int) us); } printf("%lu promotion tests run\n", ul); } --- 788,795 ---- { ul++; ffi_call(&cif, FFI_FN(promotion), &rint, values); ! CHECK((int)rint == (signed char) sc + (signed short) ss + ! (unsigned char) uc + (unsigned short) us); } printf("%lu promotion tests run\n", ul); } *************** int main(/*@unused@*/ int argc, /*@unuse *** 699,706 **** values[0] = &ts2_arg; /* Initialize the cif */ ! CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, ! &ts2_type, args) == FFI_OK); ts2_arg.d1 = 5.55; ts2_arg.d2 = 6.66; --- 836,842 ---- values[0] = &ts2_arg; /* Initialize the cif */ ! CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK); ts2_arg.d1 = 5.55; ts2_arg.d2 = 6.66; *************** int main(/*@unused@*/ int argc, /*@unuse *** 767,774 **** values[0] = &ts4_arg; /* Initialize the cif */ ! CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, ! &ts4_type, args) == FFI_OK); ts4_arg.ui1 = 2; ts4_arg.ui2 = 3; --- 903,909 ---- values[0] = &ts4_arg; /* Initialize the cif */ ! CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK); ts4_arg.ui1 = 2; ts4_arg.ui2 = 3; *************** int main(/*@unused@*/ int argc, /*@unuse *** 798,805 **** values[1] = &ts5_arg2; /* Initialize the cif */ ! CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, ! &ts5_type, args) == FFI_OK); ts5_arg1.c1 = 2; ts5_arg1.c2 = 6; --- 933,939 ---- values[1] = &ts5_arg2; /* Initialize the cif */ ! CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK); ts5_arg1.c1 = 2; ts5_arg1.c2 = 6; *************** int main(/*@unused@*/ int argc, /*@unuse *** 817,826 **** --- 951,1165 ---- free (ts5_result); } + /* struct tests */ + { + test_structure_6 ts6_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_6 *ts6_result = + (test_structure_6 *) malloc (sizeof(test_structure_6)); + + args[0] = &ts6_type; + values[0] = &ts6_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts6_type, args) == FFI_OK); + + ts6_arg.f = 5.55f; + ts6_arg.d = 6.66; + + printf ("%g\n", ts6_arg.f); + printf ("%g\n", ts6_arg.d); + + ffi_call(&cif, FFI_FN(struct6), ts6_result, values); + + printf ("%g\n", ts6_result->f); + printf ("%g\n", ts6_result->d); + + CHECK(ts6_result->f == 5.55f + 1); + CHECK(ts6_result->d == 6.66 + 1); + + printf("structure test 6 ok!\n"); + + free (ts6_result); + } + + /* struct tests */ + { + test_structure_7 ts7_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_7 *ts7_result = + (test_structure_7 *) malloc (sizeof(test_structure_7)); + + args[0] = &ts7_type; + values[0] = &ts7_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK); + + ts7_arg.f1 = 5.55f; + ts7_arg.f2 = 55.5f; + ts7_arg.d = 6.66; + + printf ("%g\n", ts7_arg.f1); + printf ("%g\n", ts7_arg.f2); + printf ("%g\n", ts7_arg.d); + + ffi_call(&cif, FFI_FN(struct7), ts7_result, values); + + printf ("%g\n", ts7_result->f1); + printf ("%g\n", ts7_result->f2); + printf ("%g\n", ts7_result->d); + + CHECK(ts7_result->f1 == 5.55f + 1); + CHECK(ts7_result->f2 == 55.5f + 1); + CHECK(ts7_result->d == 6.66 + 1); + + printf("structure test 7 ok!\n"); + + free (ts7_result); + } + + /* struct tests */ + { + test_structure_8 ts8_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_8 *ts8_result = + (test_structure_8 *) malloc (sizeof(test_structure_8)); + + args[0] = &ts8_type; + values[0] = &ts8_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK); + + ts8_arg.f1 = 5.55f; + ts8_arg.f2 = 55.5f; + ts8_arg.f3 = -5.55f; + ts8_arg.f4 = -55.5f; + + printf ("%g\n", ts8_arg.f1); + printf ("%g\n", ts8_arg.f2); + printf ("%g\n", ts8_arg.f3); + printf ("%g\n", ts8_arg.f4); + + ffi_call(&cif, FFI_FN(struct8), ts8_result, values); + + printf ("%g\n", ts8_result->f1); + printf ("%g\n", ts8_result->f2); + printf ("%g\n", ts8_result->f3); + printf ("%g\n", ts8_result->f4); + + CHECK(ts8_result->f1 == 5.55f + 1); + CHECK(ts8_result->f2 == 55.5f + 1); + CHECK(ts8_result->f3 == -5.55f + 1); + CHECK(ts8_result->f4 == -55.5f + 1); + + printf("structure test 8 ok!\n"); + + free (ts8_result); + } + + /* struct tests */ + { + test_structure_9 ts9_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_9 *ts9_result = + (test_structure_9 *) malloc (sizeof(test_structure_9)); + + args[0] = &ts9_type; + values[0] = &ts9_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts9_type, args) == FFI_OK); + + ts9_arg.f = 5.55f; + ts9_arg.i = 5; + + printf ("%g\n", ts9_arg.f); + printf ("%d\n", ts9_arg.i); + + ffi_call(&cif, FFI_FN(struct9), ts9_result, values); + + printf ("%g\n", ts9_result->f); + printf ("%d\n", ts9_result->i); + + CHECK(ts9_result->f == 5.55f + 1); + CHECK(ts9_result->i == 5 + 1); + + printf("structure test 9 ok!\n"); + + free (ts9_result); + } + #else printf("Structure passing doesn't work on Win32.\n"); #endif /* X86_WIN32 */ + #ifdef X86_WIN32 + /* stdcall strlen tests */ + { + args[0] = &ffi_type_pointer; + values[0] = (void*) &s; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 1, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; + ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); + CHECK(rint == 1); + + s = "1234567"; + ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); + CHECK(rint == 7); + + s = "1234567890123456789012345"; + ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); + CHECK(rint == 25); + + printf("stdcall strlen tests passed\n"); + } + + /* stdcall many arg tests */ + { + float ff; + float fa[13]; + + for (ul = 0; ul < 13; ul++) + { + args[ul] = &ffi_type_float; + values[ul] = &fa[ul]; + fa[ul] = (float) ul; + } + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13, + &ffi_type_float, args) == FFI_OK); + + /*@-usedef@*/ + ff = stdcall_many(fa[0], fa[1], + fa[2], fa[3], + fa[4], fa[5], + fa[6], fa[7], + fa[8], fa[9], + fa[10],fa[11],fa[12]); + /*@=usedef@*/ + + ffi_call(&cif, FFI_FN(stdcall_many), &f, values); + + /*@-realcompare@*/ + if (f - ff < FLT_EPSILON) + /*@=realcompare@*/ + printf("stdcall many arg tests ok!\n"); + else + CHECK(0); + } + #endif /* X86_WIN32 */ + # if FFI_CLOSURES /* A simple closure test */ { *************** int main(/*@unused@*/ int argc, /*@unuse *** 956,961 **** --- 1295,1301 ---- (void) puts("\nFinished FFI_CLOSURES\n"); # endif + /* If we arrived here, all is good */ (void) puts("\nLooks good. No surprises.\n"); diff -Nrc3pad gcc-3.2.3/libffi/src/java_raw_api.c gcc-3.3/libffi/src/java_raw_api.c *** gcc-3.2.3/libffi/src/java_raw_api.c 2002-04-08 22:31:14.000000000 +0000 --- gcc-3.3/libffi/src/java_raw_api.c 2002-10-08 14:55:02.000000000 +0000 *************** ffi_java_raw_to_ptrarray (ffi_cif *cif, *** 81,101 **** { case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: ! *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1); break; case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: ! *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2); break; - #if SIZEOF_ARG >= 4 - case FFI_TYPE_UINT32: - case FFI_TYPE_SINT32: - *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4); - break; - #endif - #if SIZEOF_ARG == 8 case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: --- 81,94 ---- { case FFI_TYPE_UINT8: case FFI_TYPE_SINT8: ! *args = (void*) ((char*)(raw++) + 3); break; case FFI_TYPE_UINT16: case FFI_TYPE_SINT16: ! *args = (void*) ((char*)(raw++) + 2); break; #if SIZEOF_ARG == 8 case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: *************** ffi_java_ptrarray_to_raw (ffi_cif *cif, *** 157,187 **** switch ((*tp)->type) { case FFI_TYPE_UINT8: (raw++)->uint = *(UINT8*) (*args); break; case FFI_TYPE_SINT8: (raw++)->sint = *(SINT8*) (*args); break; case FFI_TYPE_UINT16: (raw++)->uint = *(UINT16*) (*args); break; case FFI_TYPE_SINT16: (raw++)->sint = *(SINT16*) (*args); break; - #if SIZEOF_ARG >= 4 case FFI_TYPE_UINT32: (raw++)->uint = *(UINT32*) (*args); break; case FFI_TYPE_SINT32: (raw++)->sint = *(SINT32*) (*args); - break; #endif ! case FFI_TYPE_FLOAT: (raw++)->flt = *(FLOAT32*) (*args); break; --- 150,203 ---- switch ((*tp)->type) { case FFI_TYPE_UINT8: + #if WORDS_BIGENDIAN + *(UINT32*)(raw++) = *(UINT8*) (*args); + #else (raw++)->uint = *(UINT8*) (*args); + #endif break; case FFI_TYPE_SINT8: + #if WORDS_BIGENDIAN + *(SINT32*)(raw++) = *(SINT8*) (*args); + #else (raw++)->sint = *(SINT8*) (*args); + #endif break; case FFI_TYPE_UINT16: + #if WORDS_BIGENDIAN + *(UINT32*)(raw++) = *(UINT16*) (*args); + #else (raw++)->uint = *(UINT16*) (*args); + #endif break; case FFI_TYPE_SINT16: + #if WORDS_BIGENDIAN + *(SINT32*)(raw++) = *(SINT16*) (*args); + #else (raw++)->sint = *(SINT16*) (*args); + #endif break; case FFI_TYPE_UINT32: + #if WORDS_BIGENDIAN + *(UINT32*)(raw++) = *(UINT32*) (*args); + #else (raw++)->uint = *(UINT32*) (*args); + #endif break; case FFI_TYPE_SINT32: + #if WORDS_BIGENDIAN + *(SINT32*)(raw++) = *(SINT32*) (*args); + #else (raw++)->sint = *(SINT32*) (*args); #endif ! break; ! ! case FFI_TYPE_FLOAT: (raw++)->flt = *(FLOAT32*) (*args); break; *************** ffi_java_ptrarray_to_raw (ffi_cif *cif, *** 211,216 **** --- 227,281 ---- #if !FFI_NATIVE_RAW_API + static void + ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) + { + #if WORDS_BIGENDIAN && SIZEOF_ARG == 8 + switch (cif->rtype->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT32: + *(UINT64 *)rvalue <<= 32; + break; + + case FFI_TYPE_SINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_INT: + *(SINT64 *)rvalue <<= 32; + break; + + default: + break; + } + #endif + } + + static void + ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) + { + #if WORDS_BIGENDIAN && SIZEOF_ARG == 8 + switch (cif->rtype->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT32: + *(UINT64 *)rvalue >>= 32; + break; + + case FFI_TYPE_SINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_INT: + *(SINT64 *)rvalue >>= 32; + break; + + default: + break; + } + #endif + } /* This is a generic definition of ffi_raw_call, to be used if the * native system does not provide a machine-specific implementation. *************** void ffi_java_raw_call (/*@dependent@*/ *** 227,232 **** --- 292,298 ---- void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); ffi_java_raw_to_ptrarray (cif, raw, avalue); ffi_call (cif, fn, rvalue, avalue); + ffi_java_rvalue_to_raw (cif, rvalue); } #if FFI_CLOSURES /* base system provides closures */ *************** ffi_java_translate_args (ffi_cif *cif, v *** 240,245 **** --- 306,312 ---- ffi_java_ptrarray_to_raw (cif, avalue, raw); (*cl->fun) (cif, rvalue, raw, cl->user_data); + ffi_java_raw_to_rvalue (cif, rvalue); } /* Again, here is the generic version of ffi_prep_raw_closure, which diff -Nrc3pad gcc-3.2.3/libffi/src/m68k/ffi.c gcc-3.3/libffi/src/m68k/ffi.c *** gcc-3.2.3/libffi/src/m68k/ffi.c 1999-08-08 13:27:19.000000000 +0000 --- gcc-3.3/libffi/src/m68k/ffi.c 2002-07-18 23:08:30.000000000 +0000 *************** static void * *** 16,29 **** ffi_prep_args (void *stack, extended_cif *ecif) { unsigned int i; - int tmp; - unsigned int avn; void **p_argv; char *argp; ffi_type **p_arg; void *struct_value_ptr; - tmp = 0; argp = stack; if (ecif->cif->rtype->type == FFI_TYPE_STRUCT --- 16,26 ---- *************** ffi_prep_args (void *stack, extended_cif *** 32,42 **** else struct_value_ptr = NULL; - avn = ecif->cif->nargs; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ! i != 0 && avn != 0; i--, p_arg++) { size_t z; --- 29,38 ---- else struct_value_ptr = NULL; p_argv = ecif->avalue; for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ! i != 0; i--, p_arg++) { size_t z; *************** ffi_prep_args (void *stack, extended_cif *** 45,53 **** if (((*p_arg)->alignment - 1) & (unsigned) argp) argp = (char *) ALIGN (argp, (*p_arg)->alignment); - if (avn != 0) - { - avn--; z = (*p_arg)->size; if (z < sizeof (int)) { --- 41,46 ---- *************** ffi_prep_args (void *stack, extended_cif *** 82,88 **** memcpy (argp, *p_argv, z); p_argv++; argp += z; - } } return struct_value_ptr; --- 75,80 ---- diff -Nrc3pad gcc-3.2.3/libffi/src/mips/ffi.c gcc-3.3/libffi/src/mips/ffi.c *** gcc-3.2.3/libffi/src/mips/ffi.c 2001-03-02 22:21:23.000000000 +0000 --- gcc-3.3/libffi/src/mips/ffi.c 2002-07-18 23:08:31.000000000 +0000 *************** *** 23,28 **** --- 23,29 ---- OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ + #include #include #include *************** static void ffi_prep_args(char *stack, *** 50,56 **** int flags) { register int i; - register int avn; register void **p_argv; register char *argp; register ffi_type **p_arg; --- 51,56 ---- *************** static void ffi_prep_args(char *stack, *** 80,91 **** FIX_ARGP; } - avn = ecif->cif->nargs; p_argv = ecif->avalue; ! for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ! i && avn; ! i--, p_arg++) { size_t z; --- 80,88 ---- FIX_ARGP; } p_argv = ecif->avalue; ! for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) { size_t z; *************** static void ffi_prep_args(char *stack, *** 101,109 **** #define OFFSET sizeof(int) #endif - if (avn) - { - avn--; z = (*p_arg)->size; if (z < sizeof(SLOT_TYPE_UNSIGNED)) { --- 98,103 ---- *************** static void ffi_prep_args(char *stack, *** 179,185 **** p_argv++; argp += z; FIX_ARGP; - } } return; --- 173,178 ---- diff -Nrc3pad gcc-3.2.3/libffi/src/powerpc/darwin_closure.S gcc-3.3/libffi/src/powerpc/darwin_closure.S *** gcc-3.2.3/libffi/src/powerpc/darwin_closure.S 2003-02-08 08:04:17.000000000 +0000 --- gcc-3.3/libffi/src/powerpc/darwin_closure.S 2003-02-07 04:33:43.000000000 +0000 *************** LFE1: *** 189,191 **** --- 189,236 ---- blr /* END(ffi_closure_ASM) */ + + .data + .section __TEXT,__eh_frame + Lframe1: + .set L$set$0,LECIE1-LSCIE1 + .long L$set$0 ; Length of Common Information Entry + LSCIE1: + .long 0x0 ; CIE Identifier Tag + .byte 0x1 ; CIE Version + .ascii "zR\0" ; CIE Augmentation + .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor + .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor + .byte 0x41 ; CIE RA Column + .byte 0x1 ; uleb128 0x1; Augmentation size + .byte 0x10 ; FDE Encoding (pcrel) + .byte 0xc ; DW_CFA_def_cfa + .byte 0x1 ; uleb128 0x1 + .byte 0x0 ; uleb128 0x0 + .align 2 + LECIE1: + LSFDE1: + .set L$set$1,LEFDE1-LASFDE1 + .long L$set$1 ; FDE Length + + LASFDE1: + .set L$set$2,LASFDE1-Lframe1 + .long L$set$2 ; FDE CIE offset + .long LFB1-. ; FDE initial location + .set L$set$3,LFE1-LFB1 + .long L$set$3 ; FDE address range + .byte 0x0 ; uleb128 0x0; Augmentation size + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$3,LCFI1-LCFI0 + .long L$set$3 + .byte 0xe ; DW_CFA_def_cfa_offset + .byte 176,1 ; uleb128 176 + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$4,LCFI0-LFB1 + .long L$set$4 + .byte 0x11 ; DW_CFA_offset_extended_sf + .byte 0x41 ; uleb128 0x41 + .byte 0x7e ; sleb128 -2 + .align 2 + LEFDE1: + diff -Nrc3pad gcc-3.2.3/libffi/src/powerpc/darwin.S gcc-3.3/libffi/src/powerpc/darwin.S *** gcc-3.2.3/libffi/src/powerpc/darwin.S 2002-01-18 16:22:34.000000000 +0000 --- gcc-3.3/libffi/src/powerpc/darwin.S 2003-01-22 20:17:49.000000000 +0000 *************** *** 3,10 **** PowerPC Assembly glue. - $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $ - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including --- 3,8 ---- *************** *** 39,68 **** .text .align 2 _ffi_call_DARWIN: ! mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved... /* Save the old stack pointer as AP. */ mr r8,r1 ! /* Allocate the stack space we need. */ stwux r1,r1,r4 /* Save registers we use. */ mflr r9 ! stw r28,-16(r8) stw r29,-12(r8) stw r30, -8(r8) stw r31, -4(r8) ! ! stw r9, 8(r8) stw r2, 20(r1) /* Save arguments over call... */ ! mr r31,r5 /* flags, */ ! mr r30,r6 /* rvalue, */ ! mr r29,r7 /* function address, */ ! mr r28,r8 /* our AP. */ ! /* Call ffi_prep_args. */ mr r4,r1 li r9,0 --- 37,70 ---- .text .align 2 _ffi_call_DARWIN: ! LFB0: ! mr r12,r8 /* We only need r12 until the call, ! so it doesn't have to be saved... */ ! LFB1: /* Save the old stack pointer as AP. */ mr r8,r1 ! LCFI0: /* Allocate the stack space we need. */ stwux r1,r1,r4 /* Save registers we use. */ mflr r9 ! stw r28,-16(r8) stw r29,-12(r8) stw r30, -8(r8) stw r31, -4(r8) ! ! stw r9, 8(r8) stw r2, 20(r1) + LCFI1: /* Save arguments over call... */ ! mr r31,r5 /* flags, */ ! mr r30,r6 /* rvalue, */ ! mr r29,r7 /* function address, */ ! mr r28,r8 /* our AP. */ ! LCFI2: /* Call ffi_prep_args. */ mr r4,r1 li r9,0 *************** L(fp_return_value): *** 145,151 **** L(float_return_value): stfs f1,0(r30) b L(done_return_value) ! //END(_ffi_call_DARWIN) /* Provide a null definition of _ffi_call_AIX. */ .text --- 147,154 ---- L(float_return_value): stfs f1,0(r30) b L(done_return_value) ! LFE1: ! /* END(_ffi_call_DARWIN) */ /* Provide a null definition of _ffi_call_AIX. */ .text *************** L(float_return_value): *** 155,159 **** .align 2 _ffi_call_AIX: blr ! //END(_ffi_call_AIX) --- 158,218 ---- .align 2 _ffi_call_AIX: blr ! /* END(_ffi_call_AIX) */ + .data + .section __TEXT,__eh_frame + Lframe1: + .set L$set$0,LECIE1-LSCIE1 + .long L$set$0 ; Length of Common Information Entry + LSCIE1: + .long 0x0 ; CIE Identifier Tag + .byte 0x1 ; CIE Version + .ascii "zR\0" ; CIE Augmentation + .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor + .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor + .byte 0x41 ; CIE RA Column + .byte 0x1 ; uleb128 0x1; Augmentation size + .byte 0x10 ; FDE Encoding (pcrel) + .byte 0xc ; DW_CFA_def_cfa + .byte 0x1 ; uleb128 0x1 + .byte 0x0 ; uleb128 0x0 + .align 2 + LECIE1: + LSFDE1: + .set L$set$1,LEFDE1-LASFDE1 + .long L$set$1 ; FDE Length + LASFDE1: + .set L$set$2,LASFDE1-Lframe1 + .long L$set$2 ; FDE CIE offset + .long LFB0-. ; FDE initial location + .set L$set$3,LFE1-LFB0 + .long L$set$3 ; FDE address range + .byte 0x0 ; uleb128 0x0; Augmentation size + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$4,LCFI0-LFB1 + .long L$set$4 + .byte 0xd ; DW_CFA_def_cfa_register + .byte 0x08 ; uleb128 0x08 + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$5,LCFI1-LCFI0 + .long L$set$5 + .byte 0x11 ; DW_CFA_offset_extended_sf + .byte 0x41 ; uleb128 0x41 + .byte 0x7e ; sleb128 -2 + .byte 0x9f ; DW_CFA_offset, column 0x1f + .byte 0x1 ; uleb128 0x1 + .byte 0x9e ; DW_CFA_offset, column 0x1e + .byte 0x2 ; uleb128 0x2 + .byte 0x9d ; DW_CFA_offset, column 0x1d + .byte 0x3 ; uleb128 0x3 + .byte 0x9c ; DW_CFA_offset, column 0x1c + .byte 0x4 ; uleb128 0x4 + .byte 0x4 ; DW_CFA_advance_loc4 + .set L$set$6,LCFI2-LCFI1 + .long L$set$6 + .byte 0xd ; DW_CFA_def_cfa_register + .byte 0x1c ; uleb128 0x1c + .align 2 + LEFDE1: + diff -Nrc3pad gcc-3.2.3/libffi/src/prep_cif.c gcc-3.3/libffi/src/prep_cif.c *** gcc-3.2.3/libffi/src/prep_cif.c 2001-03-02 22:21:22.000000000 +0000 --- gcc-3.3/libffi/src/prep_cif.c 2002-09-30 11:59:42.000000000 +0000 *************** ffi_status ffi_prep_cif(/*@out@*/ /*@par *** 103,109 **** /* Perform a sanity check on the return type */ FFI_ASSERT(ffi_type_test(cif->rtype)); ! #ifndef M68K /* Make space for the return structure pointer */ if (cif->rtype->type == FFI_TYPE_STRUCT #ifdef SPARC --- 103,110 ---- /* Perform a sanity check on the return type */ FFI_ASSERT(ffi_type_test(cif->rtype)); ! /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ ! #if !defined M68K && !defined __x86_64__ && !defined S390 /* Make space for the return structure pointer */ if (cif->rtype->type == FFI_TYPE_STRUCT #ifdef SPARC *************** ffi_status ffi_prep_cif(/*@out@*/ /*@par *** 122,127 **** --- 123,129 ---- if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) return FFI_BAD_TYPEDEF; + #if !defined __x86_64__ && !defined S390 #ifdef SPARC if (((*ptr)->type == FFI_TYPE_STRUCT && ((*ptr)->size > 16 || cif->abi != FFI_V9)) *************** ffi_status ffi_prep_cif(/*@out@*/ /*@par *** 137,142 **** --- 139,145 ---- bytes += STACK_ARG_SIZE((*ptr)->size); } + #endif } cif->bytes = bytes; diff -Nrc3pad gcc-3.2.3/libffi/src/s390/ffi.c gcc-3.3/libffi/src/s390/ffi.c *** gcc-3.2.3/libffi/src/s390/ffi.c 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libffi/src/s390/ffi.c 2002-10-08 14:55:03.000000000 +0000 *************** *** 0 **** --- 1,749 ---- + /* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2000 Software AG + + S390 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + /*====================================================================*/ + /* Includes */ + /* -------- */ + /*====================================================================*/ + + #include + #include + + #include + #include + + /*====================== End of Includes =============================*/ + + /*====================================================================*/ + /* Defines */ + /* ------- */ + /*====================================================================*/ + + /* Maximum number of GPRs available for argument passing. */ + #define MAX_GPRARGS 5 + + /* Maximum number of FPRs available for argument passing. */ + #ifdef __s390x__ + #define MAX_FPRARGS 4 + #else + #define MAX_FPRARGS 2 + #endif + + /* Round to multiple of 16. */ + #define ROUND_SIZE(size) (((size) + 15) & ~15) + + /* If these values change, sysv.S must be adapted! */ + #define FFI390_RET_VOID 0 + #define FFI390_RET_STRUCT 1 + #define FFI390_RET_FLOAT 2 + #define FFI390_RET_DOUBLE 3 + #define FFI390_RET_INT32 4 + #define FFI390_RET_INT64 5 + + /*===================== End of Defines ===============================*/ + + /*====================================================================*/ + /* Prototypes */ + /* ---------- */ + /*====================================================================*/ + + static void ffi_prep_args (unsigned char *, extended_cif *); + static int ffi_check_float_struct (ffi_type *); + void ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, + unsigned long long *, unsigned long *); + + /*====================== End of Prototypes ===========================*/ + + /*====================================================================*/ + /* Externals */ + /* --------- */ + /*====================================================================*/ + + extern void ffi_call_SYSV(unsigned, + extended_cif *, + void (*)(unsigned char *, extended_cif *), + unsigned, + void *, + void (*fn)()); + + extern void ffi_closure_SYSV(void); + + /*====================== End of Externals ============================*/ + + /*====================================================================*/ + /* */ + /* Name - ffi_check_struct_type. */ + /* */ + /* Function - Determine if a structure can be passed within a */ + /* general purpose or floating point register. */ + /* */ + /*====================================================================*/ + + static int + ffi_check_struct_type (ffi_type *arg) + { + size_t size = arg->size; + + /* If the struct has just one element, look at that element + to find out whether to consider the struct as floating point. */ + while (arg->type == FFI_TYPE_STRUCT + && arg->elements[0] && !arg->elements[1]) + arg = arg->elements[0]; + + /* Structs of size 1, 2, 4, and 8 are passed in registers, + just like the corresponding int/float types. */ + switch (size) + { + case 1: + return FFI_TYPE_UINT8; + + case 2: + return FFI_TYPE_UINT16; + + case 4: + if (arg->type == FFI_TYPE_FLOAT) + return FFI_TYPE_FLOAT; + else + return FFI_TYPE_UINT32; + + case 8: + if (arg->type == FFI_TYPE_DOUBLE) + return FFI_TYPE_DOUBLE; + else + return FFI_TYPE_UINT64; + + default: + break; + } + + /* Other structs are passed via a pointer to the data. */ + return FFI_TYPE_POINTER; + } + + /*======================== End of Routine ============================*/ + + /*====================================================================*/ + /* */ + /* Name - ffi_prep_args. */ + /* */ + /* Function - Prepare parameters for call to function. */ + /* */ + /* ffi_prep_args is called by the assembly routine once stack space */ + /* has been allocated for the function's arguments. */ + /* */ + /*====================================================================*/ + + static void + ffi_prep_args (unsigned char *stack, extended_cif *ecif) + { + /* The stack space will be filled with those areas: + + FPR argument register save area (highest addresses) + GPR argument register save area + temporary struct copies + overflow argument area (lowest addresses) + + We set up the following pointers: + + p_fpr: bottom of the FPR area (growing upwards) + p_gpr: bottom of the GPR area (growing upwards) + p_ov: bottom of the overflow area (growing upwards) + p_struct: top of the struct copy area (growing downwards) + + All areas are kept aligned to twice the word size. */ + + int gpr_off = ecif->cif->bytes; + int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long)); + + unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off); + unsigned long *p_gpr = (unsigned long *)(stack + gpr_off); + unsigned char *p_struct = (unsigned char *)p_gpr; + unsigned long *p_ov = (unsigned long *)stack; + + int n_fpr = 0; + int n_gpr = 0; + int n_ov = 0; + + ffi_type **ptr; + void **p_argv = ecif->avalue; + int i; + + /* If we returning a structure then we set the first parameter register + to the address of where we are returning this structure. */ + + if (ecif->cif->flags == FFI390_RET_STRUCT) + p_gpr[n_gpr++] = (unsigned long) ecif->rvalue; + + /* Now for the arguments. */ + + for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; + i > 0; + i--, ptr++, p_argv++) + { + void *arg = *p_argv; + int type = (*ptr)->type; + + /* Check how a structure type is passed. */ + if (type == FFI_TYPE_STRUCT) + { + type = ffi_check_struct_type (*ptr); + + /* If we pass the struct via pointer, copy the data. */ + if (type == FFI_TYPE_POINTER) + { + p_struct -= ROUND_SIZE ((*ptr)->size); + memcpy (p_struct, (char *)arg, (*ptr)->size); + arg = &p_struct; + } + } + + /* Pointers are passed like UINTs of the same size. */ + if (type == FFI_TYPE_POINTER) + #ifdef __s390x__ + type = FFI_TYPE_UINT64; + #else + type = FFI_TYPE_UINT32; + #endif + + /* Now handle all primitive int/float data types. */ + switch (type) + { + case FFI_TYPE_DOUBLE: + if (n_fpr < MAX_FPRARGS) + p_fpr[n_fpr++] = *(unsigned long long *) arg; + else + #ifdef __s390x__ + p_ov[n_ov++] = *(unsigned long *) arg; + #else + p_ov[n_ov++] = ((unsigned long *) arg)[0], + p_ov[n_ov++] = ((unsigned long *) arg)[1]; + #endif + break; + + case FFI_TYPE_FLOAT: + if (n_fpr < MAX_FPRARGS) + p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32; + else + p_ov[n_ov++] = *(unsigned int *) arg; + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + #ifdef __s390x__ + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = *(unsigned long *) arg; + else + p_ov[n_ov++] = *(unsigned long *) arg; + #else + if (n_gpr == MAX_GPRARGS-1) + n_gpr = MAX_GPRARGS; + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = ((unsigned long *) arg)[0], + p_gpr[n_gpr++] = ((unsigned long *) arg)[1]; + else + p_ov[n_ov++] = ((unsigned long *) arg)[0], + p_ov[n_ov++] = ((unsigned long *) arg)[1]; + #endif + break; + + case FFI_TYPE_UINT32: + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = *(unsigned int *) arg; + else + p_ov[n_ov++] = *(unsigned int *) arg; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = *(signed int *) arg; + else + p_ov[n_ov++] = *(signed int *) arg; + break; + + case FFI_TYPE_UINT16: + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = *(unsigned short *) arg; + else + p_ov[n_ov++] = *(unsigned short *) arg; + break; + + case FFI_TYPE_SINT16: + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = *(signed short *) arg; + else + p_ov[n_ov++] = *(signed short *) arg; + break; + + case FFI_TYPE_UINT8: + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = *(unsigned char *) arg; + else + p_ov[n_ov++] = *(unsigned char *) arg; + break; + + case FFI_TYPE_SINT8: + if (n_gpr < MAX_GPRARGS) + p_gpr[n_gpr++] = *(signed char *) arg; + else + p_ov[n_ov++] = *(signed char *) arg; + break; + + default: + FFI_ASSERT (0); + break; + } + } + } + + /*======================== End of Routine ============================*/ + + /*====================================================================*/ + /* */ + /* Name - ffi_prep_cif_machdep. */ + /* */ + /* Function - Perform machine dependent CIF processing. */ + /* */ + /*====================================================================*/ + + ffi_status + ffi_prep_cif_machdep(ffi_cif *cif) + { + size_t struct_size = 0; + int n_gpr = 0; + int n_fpr = 0; + int n_ov = 0; + + ffi_type **ptr; + int i; + + /* Determine return value handling. */ + + switch (cif->rtype->type) + { + /* Void is easy. */ + case FFI_TYPE_VOID: + cif->flags = FFI390_RET_VOID; + break; + + /* Structures are returned via a hidden pointer. */ + case FFI_TYPE_STRUCT: + cif->flags = FFI390_RET_STRUCT; + n_gpr++; /* We need one GPR to pass the pointer. */ + break; + + /* Floating point values are returned in fpr 0. */ + case FFI_TYPE_FLOAT: + cif->flags = FFI390_RET_FLOAT; + break; + + case FFI_TYPE_DOUBLE: + cif->flags = FFI390_RET_DOUBLE; + break; + + /* Integer values are returned in gpr 2 (and gpr 3 + for 64-bit values on 31-bit machines). */ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + cif->flags = FFI390_RET_INT64; + break; + + case FFI_TYPE_POINTER: + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + /* These are to be extended to word size. */ + #ifdef __s390x__ + cif->flags = FFI390_RET_INT64; + #else + cif->flags = FFI390_RET_INT32; + #endif + break; + + default: + FFI_ASSERT (0); + break; + } + + /* Now for the arguments. */ + + for (ptr = cif->arg_types, i = cif->nargs; + i > 0; + i--, ptr++) + { + int type = (*ptr)->type; + + /* Check how a structure type is passed. */ + if (type == FFI_TYPE_STRUCT) + { + type = ffi_check_struct_type (*ptr); + + /* If we pass the struct via pointer, we must reserve space + to copy its data for proper call-by-value semantics. */ + if (type == FFI_TYPE_POINTER) + struct_size += ROUND_SIZE ((*ptr)->size); + } + + /* Now handle all primitive int/float data types. */ + switch (type) + { + /* The first MAX_FPRARGS floating point arguments + go in FPRs, the rest overflow to the stack. */ + + case FFI_TYPE_DOUBLE: + if (n_fpr < MAX_FPRARGS) + n_fpr++; + else + n_ov += sizeof (double) / sizeof (long); + break; + + case FFI_TYPE_FLOAT: + if (n_fpr < MAX_FPRARGS) + n_fpr++; + else + n_ov++; + break; + + /* On 31-bit machines, 64-bit integers are passed in GPR pairs, + if one is still available, or else on the stack. If only one + register is free, skip the register (it won't be used for any + subsequent argument either). */ + + #ifndef __s390x__ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + if (n_gpr == MAX_GPRARGS-1) + n_gpr = MAX_GPRARGS; + if (n_gpr < MAX_GPRARGS) + n_gpr += 2; + else + n_ov += 2; + break; + #endif + + /* Everything else is passed in GPRs (until MAX_GPRARGS + have been used) or overflows to the stack. */ + + default: + if (n_gpr < MAX_GPRARGS) + n_gpr++; + else + n_ov++; + break; + } + } + + /* Total stack space as required for overflow arguments + and temporary structure copies. */ + + cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; + + return FFI_OK; + } + + /*======================== End of Routine ============================*/ + + /*====================================================================*/ + /* */ + /* Name - ffi_call. */ + /* */ + /* Function - Call the FFI routine. */ + /* */ + /*====================================================================*/ + + void + ffi_call(ffi_cif *cif, + void (*fn)(), + void *rvalue, + void **avalue) + { + int ret_type = cif->flags; + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + ecif.rvalue = rvalue; + + /* If we don't have a return value, we need to fake one. */ + if (rvalue == NULL) + { + if (ret_type == FFI390_RET_STRUCT) + ecif.rvalue = alloca (cif->rtype->size); + else + ret_type = FFI390_RET_VOID; + } + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args, + ret_type, ecif.rvalue, fn); + break; + + default: + FFI_ASSERT (0); + break; + } + } + + /*======================== End of Routine ============================*/ + + /*====================================================================*/ + /* */ + /* Name - ffi_closure_helper_SYSV. */ + /* */ + /* Function - Call a FFI closure target function. */ + /* */ + /*====================================================================*/ + + void + ffi_closure_helper_SYSV (ffi_closure *closure, + unsigned long *p_gpr, + unsigned long long *p_fpr, + unsigned long *p_ov) + { + unsigned long long ret_buffer; + + void *rvalue = &ret_buffer; + void **avalue; + void **p_arg; + + int n_gpr = 0; + int n_fpr = 0; + int n_ov = 0; + + ffi_type **ptr; + int i; + + /* Allocate buffer for argument list pointers. */ + + p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *)); + + /* If we returning a structure, pass the structure address + directly to the target function. Otherwise, have the target + function store the return value to the GPR save area. */ + + if (closure->cif->flags == FFI390_RET_STRUCT) + rvalue = (void *) p_gpr[n_gpr++]; + + /* Now for the arguments. */ + + for (ptr = closure->cif->arg_types, i = closure->cif->nargs; + i > 0; + i--, p_arg++, ptr++) + { + int deref_struct_pointer = 0; + int type = (*ptr)->type; + + /* Check how a structure type is passed. */ + if (type == FFI_TYPE_STRUCT) + { + type = ffi_check_struct_type (*ptr); + + /* If we pass the struct via pointer, remember to + retrieve the pointer later. */ + if (type == FFI_TYPE_POINTER) + deref_struct_pointer = 1; + } + + /* Pointers are passed like UINTs of the same size. */ + if (type == FFI_TYPE_POINTER) + #ifdef __s390x__ + type = FFI_TYPE_UINT64; + #else + type = FFI_TYPE_UINT32; + #endif + + /* Now handle all primitive int/float data types. */ + switch (type) + { + case FFI_TYPE_DOUBLE: + if (n_fpr < MAX_FPRARGS) + *p_arg = &p_fpr[n_fpr++]; + else + *p_arg = &p_ov[n_ov], + n_ov += sizeof (double) / sizeof (long); + break; + + case FFI_TYPE_FLOAT: + if (n_fpr < MAX_FPRARGS) + *p_arg = &p_fpr[n_fpr++]; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; + break; + + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + #ifdef __s390x__ + if (n_gpr < MAX_GPRARGS) + *p_arg = &p_gpr[n_gpr++]; + else + *p_arg = &p_ov[n_ov++]; + #else + if (n_gpr == MAX_GPRARGS-1) + n_gpr = MAX_GPRARGS; + if (n_gpr < MAX_GPRARGS) + *p_arg = &p_gpr[n_gpr], n_gpr += 2; + else + *p_arg = &p_ov[n_ov], n_ov += 2; + #endif + break; + + case FFI_TYPE_INT: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + if (n_gpr < MAX_GPRARGS) + *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; + break; + + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + if (n_gpr < MAX_GPRARGS) + *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; + break; + + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + if (n_gpr < MAX_GPRARGS) + *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; + else + *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; + break; + + default: + FFI_ASSERT (0); + break; + } + + /* If this is a struct passed via pointer, we need to + actually retrieve that pointer. */ + if (deref_struct_pointer) + *p_arg = *(void **)*p_arg; + } + + + /* Call the target function. */ + (closure->fun) (closure->cif, rvalue, avalue, closure->user_data); + + /* Convert the return value. */ + switch (closure->cif->rtype->type) + { + /* Void is easy, and so is struct. */ + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + break; + + /* Floating point values are returned in fpr 0. */ + case FFI_TYPE_FLOAT: + p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; + break; + + case FFI_TYPE_DOUBLE: + p_fpr[0] = *(unsigned long long *) rvalue; + break; + + /* Integer values are returned in gpr 2 (and gpr 3 + for 64-bit values on 31-bit machines). */ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + #ifdef __s390x__ + p_gpr[0] = *(unsigned long *) rvalue; + #else + p_gpr[0] = ((unsigned long *) rvalue)[0], + p_gpr[1] = ((unsigned long *) rvalue)[1]; + #endif + break; + + case FFI_TYPE_POINTER: + case FFI_TYPE_UINT32: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT8: + p_gpr[0] = *(unsigned long *) rvalue; + break; + + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT8: + p_gpr[0] = *(signed long *) rvalue; + break; + + default: + FFI_ASSERT (0); + break; + } + } + + /*======================== End of Routine ============================*/ + + /*====================================================================*/ + /* */ + /* Name - ffi_prep_closure. */ + /* */ + /* Function - Prepare a FFI closure. */ + /* */ + /*====================================================================*/ + + ffi_status + ffi_prep_closure (ffi_closure *closure, + ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data) + { + FFI_ASSERT (cif->abi == FFI_SYSV); + + #ifndef __s390x__ + *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ + *(short *)&closure->tramp [2] = 0x9801; /* lm %r0,%r1,6(%r1) */ + *(short *)&closure->tramp [4] = 0x1006; + *(short *)&closure->tramp [6] = 0x07f1; /* br %r1 */ + *(long *)&closure->tramp [8] = (long)closure; + *(long *)&closure->tramp[12] = (long)&ffi_closure_SYSV; + #else + *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ + *(short *)&closure->tramp [2] = 0xeb01; /* lmg %r0,%r1,14(%r1) */ + *(short *)&closure->tramp [4] = 0x100e; + *(short *)&closure->tramp [6] = 0x0004; + *(short *)&closure->tramp [8] = 0x07f1; /* br %r1 */ + *(long *)&closure->tramp[16] = (long)closure; + *(long *)&closure->tramp[24] = (long)&ffi_closure_SYSV; + #endif + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; + } + + /*======================== End of Routine ============================*/ + diff -Nrc3pad gcc-3.2.3/libffi/src/s390/sysv.S gcc-3.3/libffi/src/s390/sysv.S *** gcc-3.2.3/libffi/src/s390/sysv.S 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libffi/src/s390/sysv.S 2002-11-27 16:44:35.000000000 +0000 *************** *** 0 **** --- 1,425 ---- + /* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2000 Software AG + + S390 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + + #ifndef __s390x__ + + .text + + # r2: cif->bytes + # r3: &ecif + # r4: ffi_prep_args + # r5: ret_type + # r6: ecif.rvalue + # ov: fn + + # This assumes we are using gas. + .globl ffi_call_SYSV + .type ffi_call_SYSV,%function + ffi_call_SYSV: + .LFB1: + stm %r6,%r15,24(%r15) # Save registers + .LCFI0: + basr %r13,0 # Set up base register + .Lbase: + lr %r11,%r15 # Set up frame pointer + .LCFI1: + sr %r15,%r2 + ahi %r15,-96-48 # Allocate stack + lr %r8,%r6 # Save ecif.rvalue + sr %r9,%r9 + ic %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address + l %r7,96(%r11) # Load function address + st %r11,0(%r15) # Set up back chain + ahi %r11,-48 # Register save area + .LCFI2: + + la %r2,96(%r15) # Save area + # r3 already holds &ecif + basr %r14,%r4 # Call ffi_prep_args + + lm %r2,%r6,0(%r11) # Load arguments + ld %f0,32(%r11) + ld %f2,40(%r11) + la %r14,0(%r13,%r9) # Set return address + br %r7 # ... and call function + + .LretNone: # Return void + l %r4,48+56(%r11) + lm %r6,%r15,48+24(%r11) + br %r4 + + .LretFloat: + l %r4,48+56(%r11) + ste %f0,0(%r8) # Return float + lm %r6,%r15,48+24(%r11) + br %r4 + + .LretDouble: + l %r4,48+56(%r11) + std %f0,0(%r8) # Return double + lm %r6,%r15,48+24(%r11) + br %r4 + + .LretInt32: + l %r4,48+56(%r11) + st %r2,0(%r8) # Return int + lm %r6,%r15,48+24(%r11) + br %r4 + + .LretInt64: + l %r4,48+56(%r11) + stm %r2,%r3,0(%r8) # Return long long + lm %r6,%r15,48+24(%r11) + br %r4 + + .Ltable: + .byte .LretNone-.Lbase # FFI390_RET_VOID + .byte .LretNone-.Lbase # FFI390_RET_STRUCT + .byte .LretFloat-.Lbase # FFI390_RET_FLOAT + .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE + .byte .LretInt32-.Lbase # FFI390_RET_INT32 + .byte .LretInt64-.Lbase # FFI390_RET_INT64 + + .LFE1: + .ffi_call_SYSV_end: + .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV + + + .globl ffi_closure_SYSV + .type ffi_closure_SYSV,%function + ffi_closure_SYSV: + .LFB2: + stm %r12,%r15,48(%r15) # Save registers + .LCFI10: + basr %r13,0 # Set up base register + .Lcbase: + stm %r2,%r6,8(%r15) # Save arguments + std %f0,64(%r15) + std %f2,72(%r15) + lr %r1,%r15 # Set up stack frame + ahi %r15,-96 + .LCFI11: + l %r12,.Lchelper-.Lcbase(%r13) # Get helper function + lr %r2,%r0 # Closure + la %r3,8(%r1) # GPRs + la %r4,64(%r1) # FPRs + la %r5,96(%r1) # Overflow + st %r1,0(%r15) # Set up back chain + + bas %r14,0(%r12,%r13) # Call helper + + l %r4,96+56(%r15) + ld %f0,96+64(%r15) # Load return registers + lm %r2,%r3,96+8(%r15) + lm %r12,%r15,96+48(%r15) + br %r4 + + .align 4 + .Lchelper: + .long ffi_closure_helper_SYSV-.Lcbase + + .LFE2: + + .ffi_closure_SYSV_end: + .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV + + + .section .eh_frame,"a",@progbits + .Lframe1: + .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry + .LSCIE1: + .4byte 0x0 # CIE Identifier Tag + .byte 0x1 # CIE Version + .ascii "zR\0" # CIE Augmentation + .uleb128 0x1 # CIE Code Alignment Factor + .sleb128 -4 # CIE Data Alignment Factor + .byte 0xe # CIE RA Column + .uleb128 0x1 # Augmentation size + .byte 0x1b # FDE Encoding (pcrel sdata4) + .byte 0xc # DW_CFA_def_cfa + .uleb128 0xf + .uleb128 0x60 + .align 4 + .LECIE1: + .LSFDE1: + .4byte .LEFDE1-.LASFDE1 # FDE Length + .LASFDE1: + .4byte .LASFDE1-.Lframe1 # FDE CIE offset + .4byte .LFB1-. # FDE initial location + .4byte .LFE1-.LFB1 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI0-.LFB1 + .byte 0x8f # DW_CFA_offset, column 0xf + .uleb128 0x9 + .byte 0x8e # DW_CFA_offset, column 0xe + .uleb128 0xa + .byte 0x8d # DW_CFA_offset, column 0xd + .uleb128 0xb + .byte 0x8c # DW_CFA_offset, column 0xc + .uleb128 0xc + .byte 0x8b # DW_CFA_offset, column 0xb + .uleb128 0xd + .byte 0x8a # DW_CFA_offset, column 0xa + .uleb128 0xe + .byte 0x89 # DW_CFA_offset, column 0x9 + .uleb128 0xf + .byte 0x88 # DW_CFA_offset, column 0x8 + .uleb128 0x10 + .byte 0x87 # DW_CFA_offset, column 0x7 + .uleb128 0x11 + .byte 0x86 # DW_CFA_offset, column 0x6 + .uleb128 0x12 + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI1-.LCFI0 + .byte 0xd # DW_CFA_def_cfa_register + .uleb128 0xb + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI2-.LCFI1 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 0x90 + .align 4 + .LEFDE1: + .LSFDE2: + .4byte .LEFDE2-.LASFDE2 # FDE Length + .LASFDE2: + .4byte .LASFDE2-.Lframe1 # FDE CIE offset + .4byte .LFB2-. # FDE initial location + .4byte .LFE2-.LFB2 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI10-.LFB2 + .byte 0x8f # DW_CFA_offset, column 0xf + .uleb128 0x9 + .byte 0x8e # DW_CFA_offset, column 0xe + .uleb128 0xa + .byte 0x8d # DW_CFA_offset, column 0xd + .uleb128 0xb + .byte 0x8c # DW_CFA_offset, column 0xc + .uleb128 0xc + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI11-.LCFI10 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 0xc0 + .align 4 + .LEFDE2: + + #else + + .text + + # r2: cif->bytes + # r3: &ecif + # r4: ffi_prep_args + # r5: ret_type + # r6: ecif.rvalue + # ov: fn + + # This assumes we are using gas. + .globl ffi_call_SYSV + .type ffi_call_SYSV,%function + ffi_call_SYSV: + .LFB1: + stmg %r6,%r15,48(%r15) # Save registers + .LCFI0: + larl %r13,.Lbase # Set up base register + lgr %r11,%r15 # Set up frame pointer + .LCFI1: + sgr %r15,%r2 + aghi %r15,-160-80 # Allocate stack + lgr %r8,%r6 # Save ecif.rvalue + llgc %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address + lg %r7,160(%r11) # Load function address + stg %r11,0(%r15) # Set up back chain + aghi %r11,-80 # Register save area + .LCFI2: + + la %r2,160(%r15) # Save area + # r3 already holds &ecif + basr %r14,%r4 # Call ffi_prep_args + + lmg %r2,%r6,0(%r11) # Load arguments + ld %f0,48(%r11) + ld %f2,56(%r11) + ld %f4,64(%r11) + ld %f6,72(%r11) + la %r14,0(%r13,%r9) # Set return address + br %r7 # ... and call function + + .Lbase: + .LretNone: # Return void + lg %r4,80+112(%r11) + lmg %r6,%r15,80+48(%r11) + br %r4 + + .LretFloat: + lg %r4,80+112(%r11) + ste %f0,0(%r8) # Return float + lmg %r6,%r15,80+48(%r11) + br %r4 + + .LretDouble: + lg %r4,80+112(%r11) + std %f0,0(%r8) # Return double + lmg %r6,%r15,80+48(%r11) + br %r4 + + .LretInt32: + lg %r4,80+112(%r11) + st %r2,0(%r8) # Return int + lmg %r6,%r15,80+48(%r11) + br %r4 + + .LretInt64: + lg %r4,80+112(%r11) + stg %r2,0(%r8) # Return long + lmg %r6,%r15,80+48(%r11) + br %r4 + + .Ltable: + .byte .LretNone-.Lbase # FFI390_RET_VOID + .byte .LretNone-.Lbase # FFI390_RET_STRUCT + .byte .LretFloat-.Lbase # FFI390_RET_FLOAT + .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE + .byte .LretInt32-.Lbase # FFI390_RET_INT32 + .byte .LretInt64-.Lbase # FFI390_RET_INT64 + + .LFE1: + .ffi_call_SYSV_end: + .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV + + + .globl ffi_closure_SYSV + .type ffi_closure_SYSV,%function + ffi_closure_SYSV: + .LFB2: + stmg %r14,%r15,112(%r15) # Save registers + .LCFI10: + stmg %r2,%r6,16(%r15) # Save arguments + std %f0,128(%r15) + std %f2,136(%r15) + std %f4,144(%r15) + std %f6,152(%r15) + lgr %r1,%r15 # Set up stack frame + aghi %r15,-160 + .LCFI11: + lgr %r2,%r0 # Closure + la %r3,16(%r1) # GPRs + la %r4,128(%r1) # FPRs + la %r5,160(%r1) # Overflow + stg %r1,0(%r15) # Set up back chain + + brasl %r14,ffi_closure_helper_SYSV # Call helper + + lg %r14,160+112(%r15) + ld %f0,160+128(%r15) # Load return registers + lg %r2,160+16(%r15) + la %r15,160(%r15) + br %r14 + .LFE2: + + .ffi_closure_SYSV_end: + .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV + + + + .section .eh_frame,"a",@progbits + .Lframe1: + .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry + .LSCIE1: + .4byte 0x0 # CIE Identifier Tag + .byte 0x1 # CIE Version + .ascii "zR\0" # CIE Augmentation + .uleb128 0x1 # CIE Code Alignment Factor + .sleb128 -8 # CIE Data Alignment Factor + .byte 0xe # CIE RA Column + .uleb128 0x1 # Augmentation size + .byte 0x1b # FDE Encoding (pcrel sdata4) + .byte 0xc # DW_CFA_def_cfa + .uleb128 0xf + .uleb128 0xa0 + .align 8 + .LECIE1: + .LSFDE1: + .4byte .LEFDE1-.LASFDE1 # FDE Length + .LASFDE1: + .4byte .LASFDE1-.Lframe1 # FDE CIE offset + .4byte .LFB1-. # FDE initial location + .4byte .LFE1-.LFB1 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI0-.LFB1 + .byte 0x8f # DW_CFA_offset, column 0xf + .uleb128 0x5 + .byte 0x8e # DW_CFA_offset, column 0xe + .uleb128 0x6 + .byte 0x8d # DW_CFA_offset, column 0xd + .uleb128 0x7 + .byte 0x8c # DW_CFA_offset, column 0xc + .uleb128 0x8 + .byte 0x8b # DW_CFA_offset, column 0xb + .uleb128 0x9 + .byte 0x8a # DW_CFA_offset, column 0xa + .uleb128 0xa + .byte 0x89 # DW_CFA_offset, column 0x9 + .uleb128 0xb + .byte 0x88 # DW_CFA_offset, column 0x8 + .uleb128 0xc + .byte 0x87 # DW_CFA_offset, column 0x7 + .uleb128 0xd + .byte 0x86 # DW_CFA_offset, column 0x6 + .uleb128 0xe + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI1-.LCFI0 + .byte 0xd # DW_CFA_def_cfa_register + .uleb128 0xb + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI2-.LCFI1 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 0xf0 + .align 8 + .LEFDE1: + .LSFDE2: + .4byte .LEFDE2-.LASFDE2 # FDE Length + .LASFDE2: + .4byte .LASFDE2-.Lframe1 # FDE CIE offset + .4byte .LFB2-. # FDE initial location + .4byte .LFE2-.LFB2 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI10-.LFB2 + .byte 0x8f # DW_CFA_offset, column 0xf + .uleb128 0x5 + .byte 0x8e # DW_CFA_offset, column 0xe + .uleb128 0x6 + .byte 0x4 # DW_CFA_advance_loc4 + .4byte .LCFI11-.LCFI10 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 0x140 + .align 8 + .LEFDE2: + + #endif + diff -Nrc3pad gcc-3.2.3/libffi/src/sh/ffi.c gcc-3.3/libffi/src/sh/ffi.c *** gcc-3.2.3/libffi/src/sh/ffi.c 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libffi/src/sh/ffi.c 2002-07-19 01:08:43.000000000 +0000 *************** *** 0 **** --- 1,722 ---- + /* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2002 Kaz Kojima + + SuperH Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + + #include + #include + + #include + + #define NGREGARG 4 + #if defined(__SH4__) + #define NFREGARG 8 + #endif + + #if defined(__HITACHI__) + #define STRUCT_VALUE_ADDRESS_WITH_ARG 1 + #else + #define STRUCT_VALUE_ADDRESS_WITH_ARG 0 + #endif + + /* If the structure has essentialy an unique element, return its type. */ + static int + simple_type (ffi_type *arg) + { + if (arg->type != FFI_TYPE_STRUCT) + return arg->type; + else if (arg->elements[1]) + return FFI_TYPE_STRUCT; + + return simple_type (arg->elements[0]); + } + + static int + return_type (ffi_type *arg) + { + unsigned short type; + + if (arg->type != FFI_TYPE_STRUCT) + return arg->type; + + type = simple_type (arg->elements[0]); + if (! arg->elements[1]) + { + switch (type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + return FFI_TYPE_INT; + + default: + return type; + } + } + + /* gcc uses r0/r1 pair for some kind of structures. */ + if (arg->size <= 2 * sizeof (int)) + { + int i = 0; + ffi_type *e; + + while ((e = arg->elements[i++])) + { + type = simple_type (e); + switch (type) + { + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_INT: + case FFI_TYPE_FLOAT: + return FFI_TYPE_UINT64; + + default: + break; + } + } + } + + return FFI_TYPE_STRUCT; + } + + /* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + + /*@-exportheader@*/ + void ffi_prep_args(char *stack, extended_cif *ecif) + /*@=exportheader@*/ + { + register unsigned int i; + register int tmp; + register unsigned int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + int greg, ireg; + #if defined(__SH4__) + int freg = 0; + #endif + + tmp = 0; + argp = stack; + + if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) + { + *(void **) argp = ecif->rvalue; + argp += 4; + ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; + } + else + ireg = 0; + + /* Set arguments for registers. */ + greg = ireg; + avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ >= NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + argp += z; + } + else if (z == sizeof(int)) + { + #if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ >= NFREGARG) + continue; + } + else + #endif + { + if (greg++ >= NGREGARG) + continue; + } + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + argp += z; + } + #if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 >= NFREGARG) + continue; + freg = (freg + 1) & ~1; + freg += 2; + memcpy (argp, *p_argv, z); + argp += z; + } + #endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); + #if defined(__SH4__) + if (greg + n - 1 >= NGREGARG) + continue; + greg += n; + #else + if (greg >= NGREGARG) + continue; + else if (greg + n - 1 >= NGREGARG) + greg = NGREGARG; + else + greg += n; + #endif + memcpy (argp, *p_argv, z); + argp += z; + } + } + + /* Set arguments on stack. */ + greg = ireg; + #if defined(__SH4__) + freg = 0; + #endif + p_argv = ecif->avalue; + + for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ < NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + break; + + default: + FFI_ASSERT(0); + } + argp += z; + } + else if (z == sizeof(int)) + { + #if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ < NFREGARG) + continue; + } + else + #endif + { + if (greg++ < NGREGARG) + continue; + } + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + argp += z; + } + #if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 < NFREGARG) + { + freg = (freg + 1) & ~1; + freg += 2; + continue; + } + memcpy (argp, *p_argv, z); + argp += z; + } + #endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); + if (greg + n - 1 < NGREGARG) + { + greg += n; + continue; + } + #if (! defined(__SH4__)) + else if (greg < NGREGARG) + { + greg = NGREGARG; + continue; + } + #endif + memcpy (argp, *p_argv, z); + argp += z; + } + } + + return; + } + + /* Perform machine dependent cif processing */ + ffi_status ffi_prep_cif_machdep(ffi_cif *cif) + { + int i, j; + int size, type; + int n, m; + int greg; + #if defined(__SH4__) + int freg = 0; + #endif + + cif->flags = 0; + + greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && + STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; + + #if defined(__SH4__) + for (i = j = 0; i < cif->nargs && j < 12; i++) + { + type = (cif->arg_types)[i]->type; + switch (type) + { + case FFI_TYPE_FLOAT: + if (freg >= NFREGARG) + continue; + freg++; + cif->flags += ((cif->arg_types)[i]->type) << (2 * j); + j++; + break; + + case FFI_TYPE_DOUBLE: + if ((freg + 1) >= NFREGARG) + continue; + freg = (freg + 1) & ~1; + freg += 2; + cif->flags += ((cif->arg_types)[i]->type) << (2 * j); + j++; + break; + + default: + size = (cif->arg_types)[i]->size; + n = (size + sizeof (int) - 1) / sizeof (int); + if (greg + n - 1 >= NGREGARG) + continue; + greg += n; + for (m = 0; m < n; m++) + cif->flags += FFI_TYPE_INT << (2 * j++); + break; + } + } + #else + for (i = j = 0; i < cif->nargs && j < 4; i++) + { + size = (cif->arg_types)[i]->size; + n = (size + sizeof (int) - 1) / sizeof (int); + if (greg >= NGREGARG) + continue; + else if (greg + n - 1 >= NGREGARG) + greg = NGREGARG; + else + greg += n; + for (m = 0; m < n; m++) + cif->flags += FFI_TYPE_INT << (2 * j++); + } + #endif + + /* Set the return type flag */ + switch (cif->rtype->type) + { + case FFI_TYPE_STRUCT: + cif->flags += (unsigned) (return_type (cif->rtype)) << 24; + break; + + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags += (unsigned) cif->rtype->type << 24; + break; + + default: + cif->flags += FFI_TYPE_INT << 24; + break; + } + + return FFI_OK; + } + + /*@-declundef@*/ + /*@-exportheader@*/ + extern void ffi_call_SYSV(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); + /*@=declundef@*/ + /*@=exportheader@*/ + + void ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, + /*@dependent@*/ void **avalue) + { + extended_cif ecif; + + ecif.cif = cif; + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->rtype->type == FFI_TYPE_STRUCT)) + { + /*@-sysunrecog@*/ + ecif.rvalue = alloca(cif->rtype->size); + /*@=sysunrecog@*/ + } + else + ecif.rvalue = rvalue; + + + switch (cif->abi) + { + case FFI_SYSV: + /*@-usedef@*/ + ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; + default: + FFI_ASSERT(0); + break; + } + } + + extern void ffi_closure_SYSV (void); + #if defined(__SH4__) + extern void __ic_invalidate (void *line); + #endif + + ffi_status + ffi_prep_closure (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data) + { + unsigned int *tramp; + + FFI_ASSERT (cif->abi == FFI_GCC_SYSV); + + tramp = (unsigned int *) &closure->tramp[0]; + #ifdef __LITTLE_ENDIAN__ + tramp[0] = 0xd301d202; + tramp[1] = 0x0009422b; + #else + tramp[0] = 0xd202d301; + tramp[1] = 0x422b0009; + #endif + *(void **) &tramp[2] = (void *)closure; /* ctx */ + *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + #if defined(__SH4__) + /* Flush the icache. */ + __ic_invalidate(&closure->tramp[0]); + #endif + + return FFI_OK; + } + + /* Basically the trampoline invokes ffi_closure_SYSV, and on + * entry, r3 holds the address of the closure. + * After storing the registers that could possibly contain + * parameters to be passed into the stack frame and setting + * up space for a return value, ffi_closure_SYSV invokes the + * following helper function to do most of the work. + */ + + #ifdef __LITTLE_ENDIAN__ + #define OFS_INT8 0 + #define OFS_INT16 2 + #else + #define OFS_INT8 3 + #define OFS_INT16 2 + #endif + + int + ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, + unsigned long *pgr, unsigned long *pfr, + unsigned long *pst) + { + void **avalue; + ffi_type **p_arg; + int i, avn; + int ireg, greg = 0; + #if defined(__SH4__) + int freg = 0; + #endif + ffi_cif *cif; + double temp; + + cif = closure->cif; + avalue = alloca(cif->nargs * sizeof(void *)); + + /* Copy the caller's structure return value address so that the closure + returns the data directly to the caller. */ + if (cif->rtype->type == FFI_TYPE_STRUCT) + { + rvalue = *pgr++; + ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; + } + else + ireg = 0; + + cif = closure->cif; + greg = ireg; + avn = cif->nargs; + + /* Grab the addresses of the arguments from the stack frame. */ + for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ >= NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = (((char *)pgr) + OFS_INT8); + break; + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = (((char *)pgr) + OFS_INT16); + break; + + case FFI_TYPE_STRUCT: + avalue[i] = pgr; + break; + + default: + FFI_ASSERT(0); + } + pgr++; + } + else if (z == sizeof(int)) + { + #if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ >= NFREGARG) + continue; + avalue[i] = pfr; + pfr++; + } + else + #endif + { + if (greg++ >= NGREGARG) + continue; + avalue[i] = pgr; + pgr++; + } + } + #if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 >= NFREGARG) + continue; + freg = (freg + 1) & ~1; + freg += 2; + avalue[i] = pfr; + pfr += 2; + } + #endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); + #if defined(__SH4__) + if (greg + n - 1 >= NGREGARG) + continue; + greg += n; + #else + if (greg >= NGREGARG) + continue; + else if (greg + n - 1 >= NGREGARG) + greg = NGREGARG; + else + greg += n; + #endif + avalue[i] = pgr; + pgr += n; + } + } + + greg = ireg; + #if defined(__SH4__) + freg = 0; + #endif + + for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) + { + size_t z; + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + if (greg++ < NGREGARG) + continue; + + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + avalue[i] = (((char *)pst) + OFS_INT8); + break; + + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + avalue[i] = (((char *)pst) + OFS_INT16); + break; + + case FFI_TYPE_STRUCT: + avalue[i] = pst; + break; + + default: + FFI_ASSERT(0); + } + pst++; + } + else if (z == sizeof(int)) + { + #if defined(__SH4__) + if ((*p_arg)->type == FFI_TYPE_FLOAT) + { + if (freg++ < NFREGARG) + continue; + } + else + #endif + { + if (greg++ < NGREGARG) + continue; + } + avalue[i] = pst; + pst++; + } + #if defined(__SH4__) + else if ((*p_arg)->type == FFI_TYPE_DOUBLE) + { + if (freg + 1 < NFREGARG) + { + freg = (freg + 1) & ~1; + freg += 2; + continue; + } + avalue[i] = pst; + pst += 2; + } + #endif + else + { + int n = (z + sizeof (int) - 1) / sizeof (int); + if (greg + n - 1 < NGREGARG) + { + greg += n; + continue; + } + #if (! defined(__SH4__)) + else if (greg < NGREGARG) + { + greg = NGREGARG; + continue; + } + #endif + avalue[i] = pst; + pst += n; + } + } + + (closure->fun) (cif, rvalue, avalue, closure->user_data); + + /* Tell ffi_closure_osf how to perform return type promotions. */ + return cif->rtype->type; + } diff -Nrc3pad gcc-3.2.3/libffi/src/sh/sysv.S gcc-3.3/libffi/src/sh/sysv.S *** gcc-3.2.3/libffi/src/sh/sysv.S 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libffi/src/sh/sysv.S 2002-07-19 01:08:43.000000000 +0000 *************** *** 0 **** --- 1,674 ---- + /* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2002 Kaz Kojima + + SuperH Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + + #define LIBFFI_ASM + #include + #ifdef HAVE_MACHINE_ASM_H + #include + #else + /* XXX these lose for some platforms, I'm sure. */ + #define CNAME(x) x + #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): + #endif + + #if defined(__HITACHI__) + #define STRUCT_VALUE_ADDRESS_WITH_ARG 1 + #else + #define STRUCT_VALUE_ADDRESS_WITH_ARG 0 + #endif + + .text + + # r4: ffi_prep_args + # r5: &ecif + # r6: bytes + # r7: flags + # sp+0: rvalue + # sp+4: fn + + # This assumes we are using gas. + ENTRY(ffi_call_SYSV) + #if defined(__SH4__) + # Save registers + mov.l r8,@-r15 + mov.l r9,@-r15 + mov.l r10,@-r15 + mov.l r12,@-r15 + mov.l r14,@-r15 + sts.l pr,@-r15 + mov r15,r14 + + mov r6,r8 + mov r7,r9 + + sub r6,r15 + add #-16,r15 + mov #~7,r0 + and r0,r15 + + mov r4,r0 + jsr @r0 + mov r15,r4 + + mov r9,r1 + shlr8 r9 + shlr8 r9 + shlr8 r9 + + mov #FFI_TYPE_STRUCT,r2 + cmp/eq r2,r9 + bf 1f + #if STRUCT_VALUE_ADDRESS_WITH_ARG + mov.l @r15+,r4 + bra 2f + mov #5,r2 + #else + mov.l @r15+,r10 + #endif + 1: + mov #4,r2 + 2: + mov #4,r3 + + L_pass: + cmp/pl r8 + bf L_call_it + + mov r1,r0 + and #3,r0 + + L_pass_d: + cmp/eq #FFI_TYPE_DOUBLE,r0 + bf L_pass_f + + mov r3,r0 + and #1,r0 + tst r0,r0 + bt 1f + add #1,r3 + 1: + mov r15,r0 + and #7,r0 + tst r0,r0 + bt 2f + add #4,r15 + 2: + mov #12,r0 + cmp/hs r0,r3 + bt/s 3f + shlr2 r1 + bsr L_pop_d + nop + 3: + add #2,r3 + bra L_pass + add #-8,r8 + + L_pop_d: + mov r3,r0 + add r0,r0 + add r3,r0 + add #-12,r0 + braf r0 + nop + #ifdef __LITTLE_ENDIAN__ + fmov.s @r15+,fr5 + rts + fmov.s @r15+,fr4 + fmov.s @r15+,fr7 + rts + fmov.s @r15+,fr6 + fmov.s @r15+,fr9 + rts + fmov.s @r15+,fr8 + fmov.s @r15+,fr11 + rts + fmov.s @r15+,fr10 + #else + fmov.s @r15+,fr4 + rts + fmov.s @r15+,fr5 + fmov.s @r15+,fr6 + rts + fmov.s @r15+,fr7 + fmov.s @r15+,fr8 + rts + fmov.s @r15+,fr9 + fmov.s @r15+,fr10 + rts + fmov.s @r15+,fr11 + #endif + + L_pass_f: + cmp/eq #FFI_TYPE_FLOAT,r0 + bf L_pass_i + + mov #12,r0 + cmp/hs r0,r3 + bt/s 2f + shlr2 r1 + bsr L_pop_f + nop + 2: + add #1,r3 + bra L_pass + add #-4,r8 + + L_pop_f: + mov r3,r0 + shll2 r0 + add #-16,r0 + braf r0 + nop + #ifdef __LITTLE_ENDIAN__ + rts + fmov.s @r15+,fr5 + rts + fmov.s @r15+,fr4 + rts + fmov.s @r15+,fr7 + rts + fmov.s @r15+,fr6 + rts + fmov.s @r15+,fr9 + rts + fmov.s @r15+,fr8 + rts + fmov.s @r15+,fr11 + rts + fmov.s @r15+,fr10 + #else + rts + fmov.s @r15+,fr4 + rts + fmov.s @r15+,fr5 + rts + fmov.s @r15+,fr6 + rts + fmov.s @r15+,fr7 + rts + fmov.s @r15+,fr8 + rts + fmov.s @r15+,fr9 + rts + fmov.s @r15+,fr10 + rts + fmov.s @r15+,fr11 + #endif + + L_pass_i: + cmp/eq #FFI_TYPE_INT,r0 + bf L_call_it + + mov #8,r0 + cmp/hs r0,r2 + bt/s 2f + shlr2 r1 + bsr L_pop_i + nop + 2: + add #1,r2 + bra L_pass + add #-4,r8 + + L_pop_i: + mov r2,r0 + shll2 r0 + add #-16,r0 + braf r0 + nop + rts + mov.l @r15+,r4 + rts + mov.l @r15+,r5 + rts + mov.l @r15+,r6 + rts + mov.l @r15+,r7 + + L_call_it: + # call function + #if (! STRUCT_VALUE_ADDRESS_WITH_ARG) + mov r10, r2 + #endif + mov.l @(28,r14),r1 + jsr @r1 + nop + + L_ret_d: + mov #FFI_TYPE_DOUBLE,r2 + cmp/eq r2,r9 + bf L_ret_ll + + mov.l @(24,r14),r1 + #ifdef __LITTLE_ENDIAN__ + fmov.s fr1,@r1 + add #4,r1 + bra L_epilogue + fmov.s fr0,@r1 + #else + fmov.s fr0,@r1 + add #4,r1 + bra L_epilogue + fmov.s fr1,@r1 + #endif + + L_ret_ll: + mov #FFI_TYPE_SINT64,r2 + cmp/eq r2,r9 + bt/s 1f + mov #FFI_TYPE_UINT64,r2 + cmp/eq r2,r9 + bf L_ret_f + + 1: + mov.l @(24,r14),r2 + mov.l r0,@r2 + bra L_epilogue + mov.l r1,@(4,r2) + + L_ret_f: + mov #FFI_TYPE_FLOAT,r2 + cmp/eq r2,r9 + bf L_ret_i + + mov.l @(24,r14),r1 + bra L_epilogue + fmov.s fr0,@r1 + + L_ret_i: + mov #FFI_TYPE_INT,r2 + cmp/eq r2,r9 + bf L_epilogue + + mov.l @(24,r14),r1 + bra L_epilogue + mov.l r0,@r1 + + L_epilogue: + # Remove the space we pushed for the args + mov r14,r15 + + lds.l @r15+,pr + mov.l @r15+,r14 + mov.l @r15+,r12 + mov.l @r15+,r10 + mov.l @r15+,r9 + rts + mov.l @r15+,r8 + #else + # Save registers + mov.l r8,@-r15 + mov.l r9,@-r15 + mov.l r10,@-r15 + mov.l r12,@-r15 + mov.l r14,@-r15 + sts.l pr,@-r15 + mov r15,r14 + + mov r6,r8 + mov r7,r9 + + sub r6,r15 + add #-16,r15 + mov #~7,r0 + and r0,r15 + + mov r4,r0 + jsr @r0 + mov r15,r4 + + mov r9,r3 + shlr8 r9 + shlr8 r9 + shlr8 r9 + + mov #FFI_TYPE_STRUCT,r2 + cmp/eq r2,r9 + bf 1f + #if STRUCT_VALUE_ADDRESS_WITH_ARG + mov.l @r15+,r4 + bra 2f + mov #5,r2 + #else + mov.l @r15+,r10 + #endif + 1: + mov #4,r2 + 2: + + L_pass: + cmp/pl r8 + bf L_call_it + + mov r3,r0 + and #3,r0 + + L_pass_d: + cmp/eq #FFI_TYPE_DOUBLE,r0 + bf L_pass_i + + mov r15,r0 + and #7,r0 + tst r0,r0 + bt 1f + add #4,r15 + 1: + mov #8,r0 + cmp/hs r0,r2 + bt/s 2f + shlr2 r3 + bsr L_pop_d + nop + 2: + add #2,r2 + bra L_pass + add #-8,r8 + + L_pop_d: + mov r2,r0 + add r0,r0 + add r2,r0 + add #-12,r0 + add r0,r0 + braf r0 + nop + mov.l @r15+,r4 + rts + mov.l @r15+,r5 + mov.l @r15+,r5 + rts + mov.l @r15+,r6 + mov.l @r15+,r6 + rts + mov.l @r15+,r7 + rts + mov.l @r15+,r7 + + L_pass_i: + mov #8,r0 + cmp/hs r0,r2 + bt/s 2f + shlr2 r3 + bsr L_pop_i + nop + 2: + add #1,r2 + bra L_pass + add #-4,r8 + + L_pop_i: + mov r2,r0 + shll2 r0 + add #-16,r0 + braf r0 + nop + rts + mov.l @r15+,r4 + rts + mov.l @r15+,r5 + rts + mov.l @r15+,r6 + rts + mov.l @r15+,r7 + + L_call_it: + # call function + #if (! STRUCT_VALUE_ADDRESS_WITH_ARG) + mov r10, r2 + #endif + mov.l @(28,r14),r1 + jsr @r1 + nop + + L_ret_d: + mov #FFI_TYPE_DOUBLE,r2 + cmp/eq r2,r9 + bf L_ret_ll + + mov.l @(24,r14),r2 + mov.l r0,@r2 + bra L_epilogue + mov.l r1,@(4,r2) + + L_ret_ll: + mov #FFI_TYPE_SINT64,r2 + cmp/eq r2,r9 + bt/s 1f + mov #FFI_TYPE_UINT64,r2 + cmp/eq r2,r9 + bf L_ret_i + + 1: + mov.l @(24,r14),r2 + mov.l r0,@r2 + bra L_epilogue + mov.l r1,@(4,r2) + + L_ret_i: + mov #FFI_TYPE_FLOAT,r2 + cmp/eq r2,r9 + bt 1f + mov #FFI_TYPE_INT,r2 + cmp/eq r2,r9 + bf L_epilogue + 1: + mov.l @(24,r14),r1 + bra L_epilogue + mov.l r0,@r1 + + L_epilogue: + # Remove the space we pushed for the args + mov r14,r15 + + lds.l @r15+,pr + mov.l @r15+,r14 + mov.l @r15+,r12 + mov.l @r15+,r10 + mov.l @r15+,r9 + rts + mov.l @r15+,r8 + #endif + + .ffi_call_SYSV_end: + .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) + + .globl ffi_closure_helper_SYSV + + ENTRY(ffi_closure_SYSV) + mov.l r14,@-r15 + sts.l pr,@-r15 + + /* Stack layout: + ... + 32 bytes (floating register parameters, SH-4 only) + 16 bytes (register parameters) + 4 bytes (result) + 4 bytes (5th arg) + <- new stack pointer + */ + #if defined(__SH4__) + add #-56,r15 + #else + add #-24,r15 + #endif + mov r15,r14 + + mov r14,r1 + add #24,r1 + mov.l r7,@-r1 + mov.l r6,@-r1 + mov.l r5,@-r1 + mov.l r4,@-r1 + mov r1,r6 + + #if defined(__SH4__) + mov r14,r1 + add #56,r1 + #ifdef __LITTLE_ENDIAN__ + fmov.s fr10,@-r1 + fmov.s fr11,@-r1 + fmov.s fr8,@-r1 + fmov.s fr9,@-r1 + fmov.s fr6,@-r1 + fmov.s fr7,@-r1 + fmov.s fr4,@-r1 + fmov.s fr5,@-r1 + #else + fmov.s fr11,@-r1 + fmov.s fr10,@-r1 + fmov.s fr9,@-r1 + fmov.s fr8,@-r1 + fmov.s fr7,@-r1 + fmov.s fr6,@-r1 + fmov.s fr5,@-r1 + fmov.s fr4,@-r1 + #endif + mov r1,r7 + #endif + + mov r14,r1 + add #4,r1 + mov r1,r5 + + mov r14,r1 + #if defined(__SH4__) + add #64,r1 + #else + add #32,r1 + #endif + mov.l r1,@r14 + + mov.l L_helper,r0 + jsr @r0 + mov r3,r4 + + shll r0 + mov r0,r1 + mova L_table,r0 + add r1,r0 + mov.w @r0,r0 + mov r14,r2 + braf r0 + add #4,r2 + 0: + .align 2 + L_helper: + .long ffi_closure_helper_SYSV + L_table: + .short L_case_v - 0b /* FFI_TYPE_VOID */ + .short L_case_i - 0b /* FFI_TYPE_INT */ + #if defined(__SH4__) + .short L_case_f - 0b /* FFI_TYPE_FLOAT */ + .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ + .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ + #else + .short L_case_i - 0b /* FFI_TYPE_FLOAT */ + .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ + .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ + #endif + .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ + .short L_case_q - 0b /* FFI_TYPE_SINT8 */ + .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ + .short L_case_h - 0b /* FFI_TYPE_SINT16 */ + .short L_case_i - 0b /* FFI_TYPE_UINT32 */ + .short L_case_i - 0b /* FFI_TYPE_SINT32 */ + .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ + .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ + .short L_case_v - 0b /* FFI_TYPE_STRUCT */ + .short L_case_i - 0b /* FFI_TYPE_POINTER */ + + #if defined(__SH4__) + L_case_d: + #ifdef __LITTLE_ENDIAN__ + fmov.s @r2+,fr1 + bra L_case_v + fmov.s @r2,fr0 + #else + fmov.s @r2+,fr0 + bra L_case_v + fmov.s @r2,fr1 + #endif + + L_case_f: + bra L_case_v + fmov.s @r2,fr0 + #endif + + L_case_ll: + mov.l @r2+,r0 + bra L_case_v + mov.l @r2,r1 + + L_case_i: + bra L_case_v + mov.l @r2,r0 + + L_case_q: + #ifdef __LITTLE_ENDIAN__ + #else + add #3,r2 + #endif + bra L_case_v + mov.b @r2,r0 + + L_case_uq: + #ifdef __LITTLE_ENDIAN__ + #else + add #3,r2 + #endif + mov.b @r2,r0 + bra L_case_v + extu.b r0,r0 + + L_case_h: + #ifdef __LITTLE_ENDIAN__ + #else + add #2,r2 + #endif + bra L_case_v + mov.w @r2,r0 + + L_case_uh: + #ifdef __LITTLE_ENDIAN__ + #else + add #2,r2 + #endif + mov.w @r2,r0 + extu.w r0,r0 + /* fall through */ + + L_case_v: + #if defined(__SH4__) + add #56,r15 + #else + add #24,r15 + #endif + lds.l @r15+,pr + rts + mov.l @r15+,r14 + + .ffi_closure_SYSV_end: + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) diff -Nrc3pad gcc-3.2.3/libffi/src/sparc/ffi.c gcc-3.3/libffi/src/sparc/ffi.c *** gcc-3.2.3/libffi/src/sparc/ffi.c 2001-03-02 22:21:23.000000000 +0000 --- gcc-3.3/libffi/src/sparc/ffi.c 2003-01-04 03:13:28.000000000 +0000 *************** *** 1,5 **** /* ----------------------------------------------------------------------- ! ffi.c - Copyright (c) 1996 Cygnus Solutions Sparc Foreign Function Interface --- 1,5 ---- /* ----------------------------------------------------------------------- ! ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions Sparc Foreign Function Interface *************** *** 28,47 **** #include /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ void ffi_prep_args_v8(char *stack, extended_cif *ecif) { int i; - int tmp; - int avn; void **p_argv; char *argp; ffi_type **p_arg; - tmp = 0; - /* Skip 16 words for the window save area */ argp = stack + 16*sizeof(int); --- 28,49 ---- #include + #ifdef SPARC64 + extern void ffi_closure_v9(void); + #else + extern void ffi_closure_v8(void); + #endif + /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ void ffi_prep_args_v8(char *stack, extended_cif *ecif) { int i; void **p_argv; char *argp; ffi_type **p_arg; /* Skip 16 words for the window save area */ argp = stack + 16*sizeof(int); *************** void ffi_prep_args_v8(char *stack, exten *** 66,83 **** ((int*)argp)[5] = 0; #endif - avn = ecif->cif->nargs; p_argv = ecif->avalue; ! for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ! i && avn; ! i--, p_arg++) { size_t z; - if (avn) - { - avn--; if ((*p_arg)->type == FFI_TYPE_STRUCT #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE || (*p_arg)->type == FFI_TYPE_LONGDOUBLE --- 68,79 ---- ((int*)argp)[5] = 0; #endif p_argv = ecif->avalue; ! for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) { size_t z; if ((*p_arg)->type == FFI_TYPE_STRUCT #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE || (*p_arg)->type == FFI_TYPE_LONGDOUBLE *************** void ffi_prep_args_v8(char *stack, exten *** 122,128 **** } p_argv++; argp += z; - } } return; --- 118,123 ---- *************** void ffi_call(ffi_cif *cif, void (*fn)() *** 420,422 **** --- 415,515 ---- } } + + ffi_status + ffi_prep_closure (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data) + { + unsigned int *tramp = (unsigned int *) &closure->tramp[0]; + unsigned long fn; + unsigned long ctx = (unsigned long) closure; + + #ifdef SPARC64 + /* Trampoline address is equal to the closure address. We take advantage + of that to reduce the trampoline size by 8 bytes. */ + FFI_ASSERT (cif->abi == FFI_V9); + fn = (unsigned long) ffi_closure_v9; + tramp[0] = 0x83414000; /* rd %pc, %g1 */ + tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ + tramp[2] = 0x81c14000; /* jmp %g5 */ + tramp[3] = 0x01000000; /* nop */ + *((unsigned long *) &tramp[4]) = fn; + #else + FFI_ASSERT (cif->abi == FFI_V8); + fn = (unsigned long) ffi_closure_v8; + tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ + tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ + tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ + tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ + #endif + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + /* Flush the Icache. FIXME: alignment isn't certain, assume 8 bytes */ + #ifdef SPARC64 + asm volatile ("flush %0" : : "r" (closure) : "memory"); + asm volatile ("flush %0" : : "r" (((char *) closure) + 8) : "memory"); + #else + asm volatile ("iflush %0" : : "r" (closure) : "memory"); + asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory"); + #endif + + return FFI_OK; + } + + int + ffi_closure_sparc_inner(ffi_closure *closure, + void *rvalue, unsigned long *gpr, double *fpr) + { + ffi_cif *cif; + void **avalue; + ffi_type **arg_types; + int i, avn, argn; + + cif = closure->cif; + avalue = alloca(cif->nargs * sizeof(void *)); + + argn = 0; + + /* Copy the caller's structure return address to that the closure + returns the data directly to the caller. */ + if (cif->flags == FFI_TYPE_STRUCT) + { + rvalue = (void *) gpr[0]; + argn = 1; + } + + i = 0; + avn = cif->nargs; + arg_types = cif->arg_types; + + /* Grab the addresses of the arguments from the stack frame. */ + while (i < avn) + { + /* Assume big-endian. FIXME */ + argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; + + #ifdef SPARC64 + if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT + || arg_types[i]->type == FFI_TYPE_DOUBLE + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + || arg_types[i]->type == FFI_TYPE_LONGDOUBLE + #endif + )) + avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size; + else + #endif + avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size; + i++; + } + + /* Invoke the closure. */ + (closure->fun) (cif, rvalue, avalue, closure->user_data); + + /* Tell ffi_closure_sparc how to perform return type promotions. */ + return cif->rtype->type; + } diff -Nrc3pad gcc-3.2.3/libffi/src/sparc/v8.S gcc-3.3/libffi/src/sparc/v8.S *** gcc-3.2.3/libffi/src/sparc/v8.S 2002-04-28 20:12:04.000000000 +0000 --- gcc-3.3/libffi/src/sparc/v8.S 2003-05-08 20:37:57.000000000 +0000 *************** *** 1,5 **** /* ----------------------------------------------------------------------- ! v8.S - Copyright (c) 1996, 1997 Cygnus Solutions Sparc Foreign Function Interface --- 1,5 ---- /* ----------------------------------------------------------------------- ! v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions Sparc Foreign Function Interface *************** longlong: *** 94,99 **** --- 94,167 ---- .ffi_call_V8_end: .size ffi_call_V8,.ffi_call_V8_end-ffi_call_V8 + + #define STACKFRAME 104 /* 16*4 register window + + 1*4 struct return + + 6*4 args backing store + + 3*4 locals */ + + /* ffi_closure_v8(...) + + Receives the closure argument in %g2. */ + + .text + .align 8 + .globl ffi_closure_v8 + + ffi_closure_v8: + #ifdef HAVE_AS_REGISTER_PSEUDO_OP + .register %g2, #scratch + #endif + .LLFB2: + save %sp, -STACKFRAME, %sp + .LLCFI1: + + ! Store all of the potential argument registers in va_list format. + st %i0, [%fp+68+0] + st %i1, [%fp+68+4] + st %i2, [%fp+68+8] + st %i3, [%fp+68+12] + st %i4, [%fp+68+16] + st %i5, [%fp+68+20] + + ! Call ffi_closure_sparc_inner to do the bulk of the work. + mov %g2, %o0 + add %fp, -8, %o1 + add %fp, 68, %o2 + call ffi_closure_sparc_inner + mov 0, %o3 + + ! Load up the return value in the proper type. + cmp %o0, FFI_TYPE_VOID + be done1 + + cmp %o0, FFI_TYPE_FLOAT + be,a done1 + ld [%fp-8], %f0 + + cmp %o0, FFI_TYPE_DOUBLE + be,a done1 + ldd [%fp-8], %f0 + + cmp %o0, FFI_TYPE_SINT64 + be,a integer + ld [%fp-4], %i1 + + cmp %o0, FFI_TYPE_UINT64 + be,a integer + ld [%fp-4], %i1 + + integer: + ld [%fp-8], %i0 + + done1: + ret + restore + .LLFE2: + + .ffi_closure_v8_end: + .size ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8 + #ifdef SPARC64 #define WS 8 #define nword xword *************** longlong: *** 148,150 **** --- 216,241 ---- .byte 0x1f ! uleb128 0x1f .align WS .LLEFDE1: + .LLSFDE2: + .uaword .LLEFDE2-.LLASFDE2 ! FDE Length + .LLASFDE2: + .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset + #ifdef HAVE_AS_SPARC_UA_PCREL + .uaword %r_disp32(.LLFB2) + .uaword .LLFE2-.LLFB2 ! FDE address range + #else + .align WS + .nword .LLFB2 + .uanword .LLFE2-.LLFB2 ! FDE address range + #endif + .byte 0x0 ! uleb128 0x0; Augmentation size + .byte 0x4 ! DW_CFA_advance_loc4 + .uaword .LLCFI1-.LLFB2 + .byte 0xd ! DW_CFA_def_cfa_register + .byte 0x1e ! uleb128 0x1e + .byte 0x2d ! DW_CFA_GNU_window_save + .byte 0x9 ! DW_CFA_register + .byte 0xf ! uleb128 0xf + .byte 0x1f ! uleb128 0x1f + .align WS + .LLEFDE2: diff -Nrc3pad gcc-3.2.3/libffi/src/sparc/v9.S gcc-3.3/libffi/src/sparc/v9.S *** gcc-3.2.3/libffi/src/sparc/v9.S 2002-04-28 20:12:04.000000000 +0000 --- gcc-3.3/libffi/src/sparc/v9.S 2003-01-04 03:13:28.000000000 +0000 *************** *** 1,5 **** /* ----------------------------------------------------------------------- ! v9.S - Copyright (c) 2000 Cygnus Solutions Sparc 64bit Foreign Function Interface --- 1,5 ---- /* ----------------------------------------------------------------------- ! v9.S - Copyright (c) 2000, 2003 Cygnus Solutions Sparc 64bit Foreign Function Interface *************** _ffi_call_V9: *** 99,105 **** cmp %i3, FFI_TYPE_STRUCT be,pn %icc, dostruct ! cmp %i3, FFI_TYPE_LONGDOUBLE bne,pt %icc, done nop std %f0, [%i4+0] --- 99,105 ---- cmp %i3, FFI_TYPE_STRUCT be,pn %icc, dostruct ! cmp %i3, FFI_TYPE_LONGDOUBLE bne,pt %icc, done nop std %f0, [%i4+0] *************** dostruct: *** 125,130 **** --- 125,212 ---- .ffi_call_V9_end: .size ffi_call_V9,.ffi_call_V9_end-ffi_call_V9 + + #define STACKFRAME 240 /* 16*8 register window + + 6*8 args backing store + + 8*8 locals */ + #define FP %fp+STACK_BIAS + + /* ffi_closure_v9(...) + + Receives the closure argument in %g1. */ + + .text + .align 8 + .globl ffi_closure_v9 + + ffi_closure_v9: + .LLFB2: + save %sp, -STACKFRAME, %sp + .LLCFI1: + + ! Store all of the potential argument registers in va_list format. + stx %i0, [FP+128+0] + stx %i1, [FP+128+8] + stx %i2, [FP+128+16] + stx %i3, [FP+128+24] + stx %i4, [FP+128+32] + stx %i5, [FP+128+40] + + ! Store possible floating point argument registers too. + std %f0, [FP-48] + std %f2, [FP-40] + std %f4, [FP-32] + std %f6, [FP-24] + std %f8, [FP-16] + std %f10, [FP-8] + + ! Call ffi_closure_sparc_inner to do the bulk of the work. + mov %g1, %o0 + add %fp, STACK_BIAS-64, %o1 + add %fp, STACK_BIAS+128, %o2 + call ffi_closure_sparc_inner + add %fp, STACK_BIAS-48, %o3 + + ! Load up the return value in the proper type. + cmp %o0, FFI_TYPE_VOID + be,pn %icc, done1 + + cmp %o0, FFI_TYPE_FLOAT + be,a,pn %icc, done1 + ld [FP-64], %f0 + + cmp %o0, FFI_TYPE_DOUBLE + be,a,pn %icc, done1 + ldd [FP-64], %f0 + + cmp %o0, FFI_TYPE_LONGDOUBLE + be,a,pn %icc, longdouble1 + ldd [FP-64], %f0 + + cmp %o0, FFI_TYPE_STRUCT + be,pn %icc, struct1 + + ! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER + ldx [FP-64], %i0 + + done1: + ret + restore + + struct1: + ldx [FP-56], %i2 + ret + restore + + longdouble1: + ldd [FP-56], %f2 + ret + restore + .LLFE2: + + .ffi_closure_v9_end: + .size ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9 + .section ".eh_frame",#alloc,#write .LLframe1: .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry *************** dostruct: *** 169,173 **** .byte 0x1f ! uleb128 0x1f .align 8 .LLEFDE1: ! #endif --- 251,277 ---- .byte 0x1f ! uleb128 0x1f .align 8 .LLEFDE1: ! .LLSFDE2: ! .uaword .LLEFDE2-.LLASFDE2 ! FDE Length ! .LLASFDE2: ! .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset ! #ifdef HAVE_AS_SPARC_UA_PCREL ! .uaword %r_disp32(.LLFB2) ! .uaword .LLFE2-.LLFB2 ! FDE address range ! #else ! .align 8 ! .xword .LLFB2 ! .uaxword .LLFE2-.LLFB2 ! FDE address range ! #endif ! .byte 0x0 ! uleb128 0x0; Augmentation size ! .byte 0x4 ! DW_CFA_advance_loc4 ! .uaword .LLCFI1-.LLFB2 ! .byte 0xd ! DW_CFA_def_cfa_register ! .byte 0x1e ! uleb128 0x1e ! .byte 0x2d ! DW_CFA_GNU_window_save ! .byte 0x9 ! DW_CFA_register ! .byte 0xf ! uleb128 0xf ! .byte 0x1f ! uleb128 0x1f ! .align 8 ! .LLEFDE2: #endif diff -Nrc3pad gcc-3.2.3/libffi/src/types.c gcc-3.3/libffi/src/types.c *** gcc-3.2.3/libffi/src/types.c 2001-03-27 02:39:16.000000000 +0000 --- gcc-3.3/libffi/src/types.c 2002-11-26 22:24:05.000000000 +0000 *************** FFI_INTEGRAL_TYPEDEF(uint32, 4, 4, FFI_T *** 42,48 **** FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); ! #if defined ALPHA || defined SPARC64 FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); --- 42,49 ---- FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); ! #if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \ ! || defined IA64 FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); *************** FFI_INTEGRAL_TYPEDEF(pointer, 4, 4, FFI_ *** 52,73 **** #endif ! #ifdef X86 ! ! FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); ! FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); ! ! #elif defined X86_WIN32 ! ! FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); ! FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); ! ! #elif defined ARM FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); ! #elif defined M68K FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); --- 53,64 ---- #endif ! #if defined X86 || defined X86_WIN32 || defined ARM || defined M68K FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); ! #elif defined SH FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); *************** FFI_INTEGRAL_TYPEDEF(sint64, 8, 8, FFI_T *** 80,91 **** #endif ! #ifdef X86 ! ! FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); ! FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); ! ! #elif defined X86_WIN32 FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); --- 71,77 ---- #endif ! #if defined X86 || defined X86_WIN32 || defined M68K FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); *************** FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, *** 95,119 **** FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); ! #elif defined M68K FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); ! FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); #elif defined SPARC FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); - #ifdef SPARC64 - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); - #else - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); - #endif #else FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); --- 81,105 ---- FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); ! #elif defined SH FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); ! FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); #elif defined SPARC FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); #ifdef SPARC64 FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); #else FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); #endif + #elif defined X86_64 + + FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); + #else FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); diff -Nrc3pad gcc-3.2.3/libffi/src/x86/ffi64.c gcc-3.3/libffi/src/x86/ffi64.c *** gcc-3.2.3/libffi/src/x86/ffi64.c 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libffi/src/x86/ffi64.c 2003-01-28 16:39:05.000000000 +0000 *************** *** 0 **** --- 1,706 ---- + /* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2002 Bo Thorsen + + x86-64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + + #include + #include + + #include + #include + + /* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + + #ifdef __x86_64__ + + #define MAX_GPR_REGS 6 + #define MAX_SSE_REGS 8 + typedef struct + { + /* Registers for argument passing. */ + long gpr[MAX_GPR_REGS]; + __int128_t sse[MAX_SSE_REGS]; + + /* Stack space for arguments. */ + char argspace[0]; + } stackLayout; + + /* All reference to register classes here is identical to the code in + gcc/config/i386/i386.c. Do *not* change one without the other. */ + + /* Register class used for passing given 64bit part of the argument. + These represent classes as documented by the PS ABI, with the exception + of SSESF, SSEDF classes, that are basically SSE class, just gcc will + use SF or DFmode move instead of DImode to avoid reformating penalties. + + Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves + whenever possible (upper half does contain padding). + */ + enum x86_64_reg_class + { + X86_64_NO_CLASS, + X86_64_INTEGER_CLASS, + X86_64_INTEGERSI_CLASS, + X86_64_SSE_CLASS, + X86_64_SSESF_CLASS, + X86_64_SSEDF_CLASS, + X86_64_SSEUP_CLASS, + X86_64_X87_CLASS, + X86_64_X87UP_CLASS, + X86_64_MEMORY_CLASS + }; + + #define MAX_CLASSES 4 + + /* x86-64 register passing implementation. See x86-64 ABI for details. Goal + of this code is to classify each 8bytes of incoming argument by the register + class and assign registers accordingly. */ + + /* Return the union class of CLASS1 and CLASS2. + See the x86-64 PS ABI for details. */ + + static enum x86_64_reg_class + merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) + { + /* Rule #1: If both classes are equal, this is the resulting class. */ + if (class1 == class2) + return class1; + + /* Rule #2: If one of the classes is NO_CLASS, the resulting class is + the other class. */ + if (class1 == X86_64_NO_CLASS) + return class2; + if (class2 == X86_64_NO_CLASS) + return class1; + + /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ + if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) + return X86_64_MEMORY_CLASS; + + /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ + if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) + || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) + return X86_64_INTEGERSI_CLASS; + if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS + || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) + return X86_64_INTEGER_CLASS; + + /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */ + if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS + || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS) + return X86_64_MEMORY_CLASS; + + /* Rule #6: Otherwise class SSE is used. */ + return X86_64_SSE_CLASS; + } + + /* Classify the argument of type TYPE and mode MODE. + CLASSES will be filled by the register class used to pass each word + of the operand. The number of words is returned. In case the parameter + should be passed in memory, 0 is returned. As a special case for zero + sized containers, classes[0] will be NO_CLASS and 1 is returned. + + See the x86-64 PS ABI for details. + */ + static int + classify_argument (ffi_type *type, enum x86_64_reg_class classes[], + int *byte_offset) + { + /* First, align to the right place. */ + *byte_offset = ALIGN(*byte_offset, type->alignment); + + switch (type->type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + if (((*byte_offset) % 8 + type->size) <= 4) + classes[0] = X86_64_INTEGERSI_CLASS; + else + classes[0] = X86_64_INTEGER_CLASS; + return 1; + case FFI_TYPE_FLOAT: + if (((*byte_offset) % 8) == 0) + classes[0] = X86_64_SSESF_CLASS; + else + classes[0] = X86_64_SSE_CLASS; + return 1; + case FFI_TYPE_DOUBLE: + classes[0] = X86_64_SSEDF_CLASS; + return 1; + case FFI_TYPE_LONGDOUBLE: + classes[0] = X86_64_X87_CLASS; + classes[1] = X86_64_X87UP_CLASS; + return 2; + case FFI_TYPE_STRUCT: + { + const int UNITS_PER_WORD = 8; + int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + ffi_type **ptr; + int i; + enum x86_64_reg_class subclasses[MAX_CLASSES]; + + /* If the struct is larger than 16 bytes, pass it on the stack. */ + if (type->size > 16) + return 0; + + for (i = 0; i < words; i++) + classes[i] = X86_64_NO_CLASS; + + /* Merge the fields of structure. */ + for (ptr=type->elements; (*ptr)!=NULL; ptr++) + { + int num; + + num = classify_argument (*ptr, subclasses, byte_offset); + if (num == 0) + return 0; + for (i = 0; i < num; i++) + { + int pos = *byte_offset / 8; + classes[i + pos] = + merge_classes (subclasses[i], classes[i + pos]); + } + + if ((*ptr)->type != FFI_TYPE_STRUCT) + *byte_offset += (*ptr)->size; + } + + /* Final merger cleanup. */ + for (i = 0; i < words; i++) + { + /* If one class is MEMORY, everything should be passed in + memory. */ + if (classes[i] == X86_64_MEMORY_CLASS) + return 0; + + /* The X86_64_SSEUP_CLASS should be always preceded by + X86_64_SSE_CLASS. */ + if (classes[i] == X86_64_SSEUP_CLASS + && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS)) + classes[i] = X86_64_SSE_CLASS; + + /* X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS. */ + if (classes[i] == X86_64_X87UP_CLASS + && (i == 0 || classes[i - 1] != X86_64_X87_CLASS)) + classes[i] = X86_64_SSE_CLASS; + } + return words; + } + + default: + FFI_ASSERT(0); + } + return 0; /* Never reached. */ + } + + /* Examine the argument and return set number of register required in each + class. Return 0 iff parameter should be passed in memory. */ + static int + examine_argument (ffi_type *type, int in_return, int *int_nregs,int *sse_nregs) + { + enum x86_64_reg_class class[MAX_CLASSES]; + int offset = 0; + int n; + + n = classify_argument (type, class, &offset); + + if (n == 0) + return 0; + + *int_nregs = 0; + *sse_nregs = 0; + for (n--; n>=0; n--) + switch (class[n]) + { + case X86_64_INTEGER_CLASS: + case X86_64_INTEGERSI_CLASS: + (*int_nregs)++; + break; + case X86_64_SSE_CLASS: + case X86_64_SSESF_CLASS: + case X86_64_SSEDF_CLASS: + (*sse_nregs)++; + break; + case X86_64_NO_CLASS: + case X86_64_SSEUP_CLASS: + break; + case X86_64_X87_CLASS: + case X86_64_X87UP_CLASS: + if (!in_return) + return 0; + break; + default: + abort (); + } + return 1; + } + + /* Functions to load floats and double to an SSE register placeholder. */ + extern void float2sse (float, __int128_t *); + extern void double2sse (double, __int128_t *); + extern void floatfloat2sse (void *, __int128_t *); + + /* Functions to put the floats and doubles back. */ + extern float sse2float (__int128_t *); + extern double sse2double (__int128_t *); + extern void sse2floatfloat(__int128_t *, void *); + + /*@-exportheader@*/ + void + ffi_prep_args (stackLayout *stack, extended_cif *ecif) + /*@=exportheader@*/ + { + int gprcount, ssecount, i, g, s; + void **p_argv; + void *argp = &stack->argspace; + ffi_type **p_arg; + + /* First check if the return value should be passed in memory. If so, + pass the pointer as the first argument. */ + gprcount = ssecount = 0; + if (ecif->cif->rtype->type != FFI_TYPE_VOID + && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0) + (void *)stack->gpr[gprcount++] = ecif->rvalue; + + for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue; + i!=0; i--, p_arg++, p_argv++) + { + int in_register = 0; + + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + if (gprcount < MAX_GPR_REGS) + { + stack->gpr[gprcount] = 0; + stack->gpr[gprcount++] = *(long long *)(*p_argv); + in_register = 1; + } + break; + + case FFI_TYPE_FLOAT: + if (ssecount < MAX_SSE_REGS) + { + float2sse (*(float *)(*p_argv), &stack->sse[ssecount++]); + in_register = 1; + } + break; + + case FFI_TYPE_DOUBLE: + if (ssecount < MAX_SSE_REGS) + { + double2sse (*(double *)(*p_argv), &stack->sse[ssecount++]); + in_register = 1; + } + break; + } + + if (in_register) + continue; + + /* Either all places in registers where filled, or this is a + type that potentially goes into a memory slot. */ + if (examine_argument (*p_arg, 0, &g, &s) == 0 + || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) + { + /* Pass this argument in memory. */ + argp = (void *)ALIGN(argp, (*p_arg)->alignment); + memcpy (argp, *p_argv, (*p_arg)->size); + argp += (*p_arg)->size; + } + else + { + /* All easy cases are eliminated. Now fire the big guns. */ + + enum x86_64_reg_class classes[MAX_CLASSES]; + int offset = 0, j, num; + void *a; + + num = classify_argument (*p_arg, classes, &offset); + for (j=0, a=*p_argv; jgpr[gprcount++] = *(long long *)a; + break; + case X86_64_SSE_CLASS: + floatfloat2sse (a, &stack->sse[ssecount++]); + break; + case X86_64_SSESF_CLASS: + float2sse (*(float *)a, &stack->sse[ssecount++]); + break; + case X86_64_SSEDF_CLASS: + double2sse (*(double *)a, &stack->sse[ssecount++]); + break; + default: + abort(); + } + } + } + } + } + + /* Perform machine dependent cif processing. */ + ffi_status + ffi_prep_cif_machdep (ffi_cif *cif) + { + int gprcount, ssecount, i, g, s; + + gprcount = ssecount = 0; + + /* Reset the byte count. We handle this size estimation here. */ + cif->bytes = 0; + + /* If the return value should be passed in memory, pass the pointer + as the first argument. The actual memory isn't allocated here. */ + if (cif->rtype->type != FFI_TYPE_VOID + && examine_argument (cif->rtype, 1, &g, &s) == 0) + gprcount = 1; + + /* Go over all arguments and determine the way they should be passed. + If it's in a register and there is space for it, let that be so. If + not, add it's size to the stack byte count. */ + for (i=0; inargs; i++) + { + if (examine_argument (cif->arg_types[i], 0, &g, &s) == 0 + || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) + { + /* This is passed in memory. First align to the basic type. */ + cif->bytes = ALIGN(cif->bytes, cif->arg_types[i]->alignment); + + /* Stack arguments are *always* at least 8 byte aligned. */ + cif->bytes = ALIGN(cif->bytes, 8); + + /* Now add the size of this argument. */ + cif->bytes += cif->arg_types[i]->size; + } + else + { + gprcount += g; + ssecount += s; + } + } + + /* Set the flag for the closures return. */ + switch (cif->rtype->type) + { + case FFI_TYPE_VOID: + case FFI_TYPE_STRUCT: + case FFI_TYPE_SINT64: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_LONGDOUBLE: + cif->flags = (unsigned) cif->rtype->type; + break; + + case FFI_TYPE_UINT64: + cif->flags = FFI_TYPE_SINT64; + break; + + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; + } + + typedef struct + { + long gpr[2]; + __int128_t sse[2]; + long double st0; + } return_value; + + void + ffi_fill_return_value (return_value *rv, extended_cif *ecif) + { + enum x86_64_reg_class classes[MAX_CLASSES]; + int i = 0, num; + long *gpr = rv->gpr; + __int128_t *sse = rv->sse; + signed char sc; + signed short ss; + + /* This is needed because of the way x86-64 handles signed short + integers. */ + switch (ecif->cif->rtype->type) + { + case FFI_TYPE_SINT8: + sc = *(signed char *)gpr; + *(long long *)ecif->rvalue = (long long)sc; + return; + case FFI_TYPE_SINT16: + ss = *(signed short *)gpr; + *(long long *)ecif->rvalue = (long long)ss; + return; + default: + /* Just continue. */ + ; + } + + num = classify_argument (ecif->cif->rtype, classes, &i); + + if (num == 0) + /* Return in memory. */ + ecif->rvalue = (void *) rv->gpr[0]; + else if (num == 2 && classes[0] == X86_64_X87_CLASS && + classes[1] == X86_64_X87UP_CLASS) + /* This is a long double (this is easiest to handle this way instead + of an eightbyte at a time as in the loop below. */ + *((long double *)ecif->rvalue) = rv->st0; + else + { + void *a; + + for (i=0, a=ecif->rvalue; irtype, 1, &dummy, &dummy) == 0)) + { + /*@-sysunrecog@*/ + ecif.rvalue = alloca(cif->rtype->size); + /*@=sysunrecog@*/ + } + else + ecif.rvalue = rvalue; + + /* Stack must always be 16byte aligned. Make it so. */ + cif->bytes = ALIGN(cif->bytes, 16); + + switch (cif->abi) + { + case FFI_SYSV: + /* Calling 32bit code from 64bit is not possible */ + FFI_ASSERT(0); + break; + + case FFI_UNIX64: + /*@-usedef@*/ + ffi_call_UNIX64 (ffi_prep_args, ffi_fill_return_value, &ecif, + cif->bytes, ecif.rvalue, fn); + /*@=usedef@*/ + break; + + default: + FFI_ASSERT(0); + break; + } + } + + extern void ffi_closure_UNIX64(void); + + ffi_status + ffi_prep_closure (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*), + void *user_data) + { + volatile unsigned short *tramp; + + /* FFI_ASSERT (cif->abi == FFI_OSF); */ + + tramp = (volatile unsigned short *) &closure->tramp[0]; + tramp[0] = 0xbb49; /* mov , %r11 */ + tramp[5] = 0xba49; /* mov , %r10 */ + tramp[10] = 0xff49; /* jmp *%r11 */ + tramp[11] = 0x00e3; + *(void * volatile *) &tramp[1] = ffi_closure_UNIX64; + *(void * volatile *) &tramp[6] = closure; + + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; + } + + int + ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp) + { + ffi_cif *cif; + void **avalue; + ffi_type **arg_types; + long i, avn, argn; + + cif = closure->cif; + avalue = alloca(cif->nargs * sizeof(void *)); + + argn = 0; + + i = 0; + avn = cif->nargs; + arg_types = cif->arg_types; + + /* Grab the addresses of the arguments from the stack frame. */ + while (i < avn) + { + switch (arg_types[i]->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_POINTER: + { + if (l->gp_offset > 48-8) + { + avalue[i] = l->overflow_arg_area; + l->overflow_arg_area = (char *)l->overflow_arg_area + 8; + } + else + { + avalue[i] = (char *)l->reg_save_area + l->gp_offset; + l->gp_offset += 8; + } + } + break; + + case FFI_TYPE_STRUCT: + /* FIXME */ + FFI_ASSERT(0); + break; + + case FFI_TYPE_DOUBLE: + { + if (l->fp_offset > 176-16) + { + avalue[i] = l->overflow_arg_area; + l->overflow_arg_area = (char *)l->overflow_arg_area + 8; + } + else + { + avalue[i] = (char *)l->reg_save_area + l->fp_offset; + l->fp_offset += 16; + } + } + #if DEBUG_FFI + fprintf (stderr, "double arg %d = %g\n", i, *(double *)avalue[i]); + #endif + break; + + case FFI_TYPE_FLOAT: + { + if (l->fp_offset > 176-16) + { + avalue[i] = l->overflow_arg_area; + l->overflow_arg_area = (char *)l->overflow_arg_area + 8; + } + else + { + avalue[i] = (char *)l->reg_save_area + l->fp_offset; + l->fp_offset += 16; + } + } + #if DEBUG_FFI + fprintf (stderr, "float arg %d = %g\n", i, *(float *)avalue[i]); + #endif + break; + + default: + FFI_ASSERT(0); + } + + argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; + i++; + } + + /* Invoke the closure. */ + (closure->fun) (cif, rp, avalue, closure->user_data); + + /* FIXME: Structs not supported. */ + FFI_ASSERT(cif->rtype->type != FFI_TYPE_STRUCT); + + /* Tell ffi_closure_UNIX64 how to perform return type promotions. */ + + return cif->rtype->type; + } + #endif /* ifndef __x86_64__ */ diff -Nrc3pad gcc-3.2.3/libffi/src/x86/ffi.c gcc-3.3/libffi/src/x86/ffi.c *** gcc-3.2.3/libffi/src/x86/ffi.c 2002-05-28 09:22:08.000000000 +0000 --- gcc-3.3/libffi/src/x86/ffi.c 2003-03-22 11:57:33.000000000 +0000 *************** *** 1,5 **** /* ----------------------------------------------------------------------- ! ffi.c - Copyright (c) 1996, 1998, 1999 Cygnus Solutions x86 Foreign Function Interface --- 1,8 ---- /* ----------------------------------------------------------------------- ! ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. ! Copyright (c) 2002 Ranjit Mathew ! Copyright (c) 2002 Bo Thorsen ! Copyright (c) 2002 Roger Sayle x86 Foreign Function Interface *************** *** 23,28 **** --- 26,33 ---- OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ + #ifndef __x86_64__ + #include #include *************** void ffi_prep_args(char *stack, extended *** 36,47 **** /*@=exportheader@*/ { register unsigned int i; - register int tmp; register void **p_argv; register char *argp; register ffi_type **p_arg; - tmp = 0; argp = stack; if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) --- 41,50 ---- *************** extern void ffi_call_SYSV(void (*)(char *** 148,153 **** --- 151,168 ---- /*@=declundef@*/ /*@=exportheader@*/ + #ifdef X86_WIN32 + /*@-declundef@*/ + /*@-exportheader@*/ + extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); + /*@=declundef@*/ + /*@=exportheader@*/ + #endif /* X86_WIN32 */ + void ffi_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), /*@out@*/ void *rvalue, *************** void ffi_call(/*@dependent@*/ ffi_cif *c *** 180,185 **** --- 195,208 ---- cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; + #ifdef X86_WIN32 + case FFI_STDCALL: + /*@-usedef@*/ + ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; + #endif /* X86_WIN32 */ default: FFI_ASSERT(0); break; *************** void ffi_call(/*@dependent@*/ ffi_cif *c *** 191,225 **** static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, void** args, ffi_cif* cif); ! static void ffi_closure_SYSV (); ! static void ffi_closure_raw_SYSV (); ! /* This function is jumped to by the trampoline, on entry, %ecx (a ! * caller-save register) holds the address of the closure. ! * Clearly, this requires __GNUC__, so perhaps we should translate this ! * into an assembly file if this is to be distributed with ffi. ! */ static void ! ffi_closure_SYSV () { // this is our return value storage long double res; // our various things... - void *args; ffi_cif *cif; void **arg_area; - ffi_closure *closure; unsigned short rtype; void *resp = (void*)&res; - /* grab the trampoline context pointer */ - asm ("movl %%ecx,%0" : "=r" (closure)); - cif = closure->cif; arg_area = (void**) alloca (cif->nargs * sizeof (void*)); - asm ("leal 8(%%ebp),%0" : "=q" (args)); /* this call will initialize ARG_AREA, such that each * element in that array points to the corresponding --- 214,242 ---- static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, void** args, ffi_cif* cif); ! static void ffi_closure_SYSV (ffi_closure *) ! __attribute__ ((regparm(1))); ! static void ffi_closure_raw_SYSV (ffi_raw_closure *) ! __attribute__ ((regparm(1))); ! /* This function is jumped to by the trampoline */ static void ! ffi_closure_SYSV (closure) ! ffi_closure *closure; { // this is our return value storage long double res; // our various things... ffi_cif *cif; void **arg_area; unsigned short rtype; void *resp = (void*)&res; + void *args = __builtin_dwarf_cfa (); cif = closure->cif; arg_area = (void**) alloca (cif->nargs * sizeof (void*)); /* this call will initialize ARG_AREA, such that each * element in that array points to the corresponding *************** ffi_prep_incoming_args_SYSV(char *stack, *** 266,277 **** /*@=exportheader@*/ { register unsigned int i; - register int tmp; register void **p_argv; register char *argp; register ffi_type **p_arg; - tmp = 0; argp = stack; if ( cif->rtype->type == FFI_TYPE_STRUCT ) { --- 283,292 ---- *************** ffi_prep_incoming_args_SYSV(char *stack, *** 281,293 **** p_argv = avalue; ! for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) { size_t z; /* Align if necessary */ ! if (((*p_arg)->alignment - 1) & (unsigned) argp) argp = (char *) ALIGN(argp, (*p_arg)->alignment); z = (*p_arg)->size; --- 296,309 ---- p_argv = avalue; ! for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) { size_t z; /* Align if necessary */ ! if (((*p_arg)->alignment - 1) & (unsigned) argp) { argp = (char *) ALIGN(argp, (*p_arg)->alignment); + } z = (*p_arg)->size; *************** ffi_prep_incoming_args_SYSV(char *stack, *** 298,304 **** p_argv++; argp += z; } ! return; } --- 314,320 ---- p_argv++; argp += z; } ! return; } *************** ffi_prep_incoming_args_SYSV(char *stack, *** 308,318 **** ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ unsigned int __fun = (unsigned int)(FUN); \ unsigned int __ctx = (unsigned int)(CTX); \ ! unsigned int __dis = __fun - ((unsigned int) __tramp + 10); \ ! *(unsigned char*) &__tramp[0] = 0xb9; \ ! *(unsigned int*) &__tramp[1] = __ctx; \ ! *(unsigned char*) &__tramp[5] = 0xe9; \ ! *(unsigned int*) &__tramp[6] = __dis; \ }) --- 324,334 ---- ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ unsigned int __fun = (unsigned int)(FUN); \ unsigned int __ctx = (unsigned int)(CTX); \ ! unsigned int __dis = __fun - ((unsigned int) __tramp + FFI_TRAMPOLINE_SIZE); \ ! *(unsigned char*) &__tramp[0] = 0xb8; \ ! *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \ ! *(unsigned char *) &__tramp[5] = 0xe9; \ ! *(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \ }) *************** ffi_prep_closure (ffi_closure* closure, *** 342,371 **** #if !FFI_NO_RAW_API static void ! ffi_closure_raw_SYSV () { // this is our return value storage long double res; // our various things... - void *args; ffi_raw *raw_args; ffi_cif *cif; - ffi_raw_closure *closure; unsigned short rtype; void *resp = (void*)&res; - /* grab the trampoline context pointer */ - asm ("movl %%ecx,%0" : "=r" (closure)); - - /* take the argument pointer */ - asm ("leal 8(%%ebp),%0" : "=q" (args)); - /* get the cif */ cif = closure->cif; /* the SYSV/X86 abi matches the RAW API exactly, well.. almost */ ! raw_args = (ffi_raw*) args; (closure->fun) (cif, resp, raw_args, closure->user_data); --- 358,380 ---- #if !FFI_NO_RAW_API static void ! ffi_closure_raw_SYSV (closure) ! ffi_raw_closure *closure; { // this is our return value storage long double res; // our various things... ffi_raw *raw_args; ffi_cif *cif; unsigned short rtype; void *resp = (void*)&res; /* get the cif */ cif = closure->cif; /* the SYSV/X86 abi matches the RAW API exactly, well.. almost */ ! raw_args = (ffi_raw*) __builtin_dwarf_cfa (); (closure->fun) (cif, resp, raw_args, closure->user_data); *************** ffi_call_SYSV(void (*)(char *, extended_ *** 449,454 **** --- 458,472 ---- /*@out@*/ unsigned *, void (*fn)()); + #ifdef X86_WIN32 + extern void + ffi_call_STDCALL(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); + #endif /* X86_WIN32 */ + void ffi_raw_call(/*@dependent@*/ ffi_cif *cif, void (*fn)(), *************** ffi_raw_call(/*@dependent@*/ ffi_cif *ci *** 483,488 **** --- 501,514 ---- cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; + #ifdef X86_WIN32 + case FFI_STDCALL: + /*@-usedef@*/ + ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; + #endif /* X86_WIN32 */ default: FFI_ASSERT(0); break; *************** ffi_raw_call(/*@dependent@*/ ffi_cif *ci *** 490,492 **** --- 516,520 ---- } #endif + + #endif /* __x86_64__ */ diff -Nrc3pad gcc-3.2.3/libffi/src/x86/sysv.S gcc-3.3/libffi/src/x86/sysv.S *** gcc-3.2.3/libffi/src/x86/sysv.S 2001-07-16 17:10:53.000000000 +0000 --- gcc-3.3/libffi/src/x86/sysv.S 2002-07-18 23:08:31.000000000 +0000 *************** *** 1,5 **** /* ----------------------------------------------------------------------- ! sysv.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions X86 Foreign Function Interface --- 1,5 ---- /* ----------------------------------------------------------------------- ! sysv.S - Copyright (c) 1996, 1998, 2001, 2002 Cygnus Solutions X86 Foreign Function Interface *************** *** 23,28 **** --- 23,30 ---- OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ + #ifndef __x86_64__ + #define LIBFFI_ASM #include *************** __FRAME_BEGIN__: *** 163,165 **** --- 165,169 ---- .align 4 .LEFDE1: .set .LLFDE1,.LEFDE1-.LSFDE1 + + #endif /* ifndef __x86_64__ */ diff -Nrc3pad gcc-3.2.3/libffi/src/x86/unix64.S gcc-3.3/libffi/src/x86/unix64.S *** gcc-3.2.3/libffi/src/x86/unix64.S 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libffi/src/x86/unix64.S 2003-01-28 16:39:05.000000000 +0000 *************** *** 0 **** --- 1,302 ---- + /* ----------------------------------------------------------------------- + unix64.S - Copyright (c) 2002 Bo Thorsen + + x86-64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + + #ifdef __x86_64__ + #define LIBFFI_ASM + #include + + .section .rodata + .LC0: + .string "asm in progress %lld\n" + .LC1: + .string "asm in progress\n" + .text + .align 2 + .globl ffi_call_UNIX64 + .type ffi_call_UNIX64,@function + + ffi_call_UNIX64: + .LFB1: + pushq %rbp + .LCFI0: + movq %rsp, %rbp + .LCFI1: + /* Save all arguments */ + subq $48, %rsp + .LCFI2: + movq %rdi, -8(%rbp) /* ffi_prep_args */ + movq %rsi, -16(%rbp) /* ffi_fill_return_value */ + movq %rdx, -24(%rbp) /* ecif */ + movq %rcx, -32(%rbp) /* cif->bytes */ + movq %r8, -40(%rbp) /* ecif.rvalue */ + movq %r9, -48(%rbp) /* fn */ + + /* Make room for all of the new args and the register args */ + addl $176, %ecx + .LCFI3: + subq %rcx, %rsp + .LCFI4: + /* Setup the call to ffi_prep_args. */ + movq %rdi, %rax /* &ffi_prep_args */ + movq %rsp, %rdi /* stackLayout */ + movq %rdx, %rsi /* ecif */ + call *%rax /* ffi_prep_args(stackLayout, ecif);*/ + + /* ffi_prep_args have put all the register contents into the */ + /* stackLayout struct. Now put the register values in place. */ + movq (%rsp), %rdi + movq 8(%rsp), %rsi + movq 16(%rsp), %rdx + movq 24(%rsp), %rcx + movq 32(%rsp), %r8 + movq 40(%rsp), %r9 + movaps 48(%rsp), %xmm0 + movaps 64(%rsp), %xmm1 + movaps 80(%rsp), %xmm2 + movaps 96(%rsp), %xmm3 + movaps 112(%rsp), %xmm4 + movaps 128(%rsp), %xmm5 + movaps 144(%rsp), %xmm6 + movaps 160(%rsp), %xmm7 + + /* Remove space for stackLayout so stack arguments are placed + correctly for the call. */ + .LCFI5: + addq $176, %rsp + .LCFI6: + /* Call the user function. */ + call *-48(%rbp) + + /* Make stack space for the return_value struct. */ + subq $64, %rsp + + /* Fill in all potential return values to this struct. */ + movq %rax, (%rsp) + movq %rdx, 8(%rsp) + movaps %xmm0, 16(%rsp) + movaps %xmm1, 32(%rsp) + fstpt 48(%rsp) + + /* Now call ffi_fill_return_value. */ + movq %rsp, %rdi /* struct return_value */ + movq -24(%rbp), %rsi /* ecif */ + movq -16(%rbp), %rax /* &ffi_fill_return_value */ + call *%rax /* call it */ + + /* And the work is done. */ + leave + ret + .LFE1: + .ffi_call_UNIX64_end: + .size ffi_call_UNIX64,.ffi_call_UNIX64_end-ffi_call_UNIX64 + + .text + .align 2 + .globl float2sse + .type float2sse,@function + float2sse: + /* Save the contents of this sse-float in a pointer. */ + movaps %xmm0, (%rdi) + ret + + .align 2 + .globl floatfloat2sse + .type floatfloat2sse,@function + floatfloat2sse: + /* Save the contents of these two sse-floats in a pointer. */ + movq (%rdi), %xmm0 + movaps %xmm0, (%rsi) + ret + + .align 2 + .globl double2sse + .type double2sse,@function + double2sse: + /* Save the contents of this sse-double in a pointer. */ + movaps %xmm0, (%rdi) + ret + + .align 2 + .globl sse2float + .type sse2float,@function + sse2float: + /* Save the contents of this sse-float in a pointer. */ + movaps (%rdi), %xmm0 + ret + + .align 2 + .globl sse2double + .type sse2double,@function + sse2double: + /* Save the contents of this pointer in a sse-double. */ + movaps (%rdi), %xmm0 + ret + + .align 2 + .globl sse2floatfloat + .type sse2floatfloat,@function + sse2floatfloat: + /* Save the contents of this pointer in two sse-floats. */ + movaps (%rdi), %xmm0 + movq %xmm0, (%rsi) + ret + + .align 2 + .globl ffi_closure_UNIX64 + .type ffi_closure_UNIX64,@function + + ffi_closure_UNIX64: + .LFB2: + pushq %rbp + .LCFI10: + movq %rsp, %rbp + .LCFI11: + subq $240, %rsp + .LCFI12: + movq %rdi, -176(%rbp) + movq %rsi, -168(%rbp) + movq %rdx, -160(%rbp) + movq %rcx, -152(%rbp) + movq %r8, -144(%rbp) + movq %r9, -136(%rbp) + /* FIXME: We can avoid all this stashing of XMM registers by + (in ffi_prep_closure) computing the number of + floating-point args and moving it into %rax before calling + this function. Once this is done, uncomment the next few + lines and only the essential XMM registers will be written + to memory. This is a significant saving. */ + /* movzbl %al, %eax */ + /* movq %rax, %rdx */ + /* leaq 0(,%rdx,4), %rax */ + /* leaq 2f(%rip), %rdx */ + /* subq %rax, %rdx */ + leaq -1(%rbp), %rax + /* jmp *%rdx */ + movaps %xmm7, -15(%rax) + movaps %xmm6, -31(%rax) + movaps %xmm5, -47(%rax) + movaps %xmm4, -63(%rax) + movaps %xmm3, -79(%rax) + movaps %xmm2, -95(%rax) + movaps %xmm1, -111(%rax) + movaps %xmm0, -127(%rax) + 2: + movl %edi, -180(%rbp) + movl $0, -224(%rbp) + movl $48, -220(%rbp) + leaq 16(%rbp), %rax + movq %rax, -216(%rbp) + leaq -176(%rbp), %rdx + movq %rdx, -208(%rbp) + leaq -224(%rbp), %rsi + movq %r10, %rdi + movq %rsp, %rdx + call ffi_closure_UNIX64_inner@PLT + + cmpl $FFI_TYPE_FLOAT, %eax + je 1f + cmpl $FFI_TYPE_DOUBLE, %eax + je 2f + cmpl $FFI_TYPE_LONGDOUBLE, %eax + je 3f + cmpl $FFI_TYPE_STRUCT, %eax + je 4f + popq %rax + leave + ret + 1: + 2: + 3: + movaps -240(%rbp), %xmm0 + leave + ret + 4: + leave + ret + .LFE2: + + .section .eh_frame,"a",@progbits + .Lframe0: + .long .LECIE1-.LSCIE1 + .LSCIE1: + .long 0x0 + .byte 0x1 + .string "zR" + .uleb128 0x1 + .sleb128 -8 + .byte 0x10 + .uleb128 0x1 + .byte 0x1b + .byte 0xc + .uleb128 0x7 + .uleb128 0x8 + .byte 0x90 + .uleb128 0x1 + .align 8 + .LECIE1: + .LSFDE1: + .long .LEFDE1-.LASFDE1 + .LASFDE1: + .long .LASFDE1-.Lframe0 + + .long .LFB1-. + .long .LFE1-.LFB1 + .uleb128 0x0 + .byte 0x4 # DW_CFA_advance_loc4 + .long .LCFI0-.LFB1 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 0x10 + .byte 0x86 # DW_CFA_offset: r6 at cfa-16 + .uleb128 0x2 + .byte 0x4 # DW_CFA_advance_loc4 + .long .LCFI1-.LCFI0 + .byte 0x86 # DW_CFA_offset: r6 at cfa-16 + .uleb128 0x2 + .byte 0xd # DW_CFA_def_cfa_reg: r6 + .uleb128 0x6 + .align 8 + .LEFDE1: + .LSFDE3: + .long .LEFDE3-.LASFDE3 # FDE Length + .LASFDE3: + .long .LASFDE3-.Lframe0 # FDE CIE offset + + .long .LFB2-. # FDE initial location + .long .LFE2-.LFB2 # FDE address range + .uleb128 0x0 # Augmentation size + .byte 0x4 # DW_CFA_advance_loc4 + .long .LCFI10-.LFB2 + .byte 0xe # DW_CFA_def_cfa_offset + .uleb128 0x10 + .byte 0x86 # DW_CFA_offset, column 0x6 + .uleb128 0x2 + .byte 0x4 # DW_CFA_advance_loc4 + .long .LCFI11-.LCFI10 + .byte 0xd # DW_CFA_def_cfa_register + .uleb128 0x6 + .align 8 + .LEFDE3: + + #endif /* __x86_64__ */ diff -Nrc3pad gcc-3.2.3/libffi/src/x86/win32.S gcc-3.3/libffi/src/x86/win32.S *** gcc-3.2.3/libffi/src/x86/win32.S 2001-03-27 02:39:16.000000000 +0000 --- gcc-3.3/libffi/src/x86/win32.S 2002-12-06 01:16:45.000000000 +0000 *************** *** 1,5 **** /* ----------------------------------------------------------------------- ! win32.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions X86 Foreign Function Interface --- 1,8 ---- /* ----------------------------------------------------------------------- ! win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. ! Copyright (c) 2001 John Beniton ! Copyright (c) 2002 Ranjit Mathew ! X86 Foreign Function Interface *************** _ffi_call_SYSV: *** 52,58 **** # Return stack to previous state and call the function addl $8,%esp ! call *28(%ebp) # Remove the space we pushed for the args movl 16(%ebp),%ecx --- 55,64 ---- # Return stack to previous state and call the function addl $8,%esp ! # FIXME: Align the stack to a 128-bit boundary to avoid ! # potential performance hits. ! ! call *28(%ebp) # Remove the space we pushed for the args movl 16(%ebp),%ecx *************** epilogue: *** 123,125 **** --- 129,226 ---- ret .ffi_call_SYSV_end: + + # This assumes we are using gas. + .balign 16 + .globl _ffi_call_STDCALL + + _ffi_call_STDCALL: + pushl %ebp + movl %esp,%ebp + + # Make room for all of the new args. + movl 16(%ebp),%ecx + subl %ecx,%esp + + movl %esp,%eax + + # Place all of the ffi_prep_args in position + pushl 12(%ebp) + pushl %eax + call *8(%ebp) + + # Return stack to previous state and call the function + addl $8,%esp + + # FIXME: Align the stack to a 128-bit boundary to avoid + # potential performance hits. + + call *28(%ebp) + + # stdcall functions pop arguments off the stack themselves + + # Load %ecx with the return type code + movl 20(%ebp),%ecx + + # If the return value pointer is NULL, assume no return value. + cmpl $0,24(%ebp) + jne sc_retint + + # Even if there is no space for the return value, we are + # obliged to handle floating-point values. + cmpl $FFI_TYPE_FLOAT,%ecx + jne sc_noretval + fstp %st(0) + + jmp sc_epilogue + + sc_retint: + cmpl $FFI_TYPE_INT,%ecx + jne sc_retfloat + # Load %ecx with the pointer to storage for the return value + movl 24(%ebp),%ecx + movl %eax,0(%ecx) + jmp sc_epilogue + + sc_retfloat: + cmpl $FFI_TYPE_FLOAT,%ecx + jne sc_retdouble + # Load %ecx with the pointer to storage for the return value + movl 24(%ebp),%ecx + fstps (%ecx) + jmp sc_epilogue + + sc_retdouble: + cmpl $FFI_TYPE_DOUBLE,%ecx + jne sc_retlongdouble + # Load %ecx with the pointer to storage for the return value + movl 24(%ebp),%ecx + fstpl (%ecx) + jmp sc_epilogue + + sc_retlongdouble: + cmpl $FFI_TYPE_LONGDOUBLE,%ecx + jne sc_retint64 + # Load %ecx with the pointer to storage for the return value + movl 24(%ebp),%ecx + fstpt (%ecx) + jmp sc_epilogue + + sc_retint64: + cmpl $FFI_TYPE_SINT64,%ecx + jne sc_retstruct + # Load %ecx with the pointer to storage for the return value + movl 24(%ebp),%ecx + movl %eax,0(%ecx) + movl %edx,4(%ecx) + + sc_retstruct: + # Nothing to do! + + sc_noretval: + sc_epilogue: + movl %ebp,%esp + popl %ebp + ret + + .ffi_call_STDCALL_end: diff -Nrc3pad gcc-3.2.3/libjava/acconfig.h gcc-3.3/libjava/acconfig.h *** gcc-3.2.3/libjava/acconfig.h 2002-03-18 06:30:23.000000000 +0000 --- gcc-3.3/libjava/acconfig.h 2002-08-29 18:05:14.000000000 +0000 *************** *** 107,112 **** --- 107,113 ---- #undef HAVE_READDIR_R #undef HAVE_GETHOSTBYNAME_R #undef HAVE_GETHOSTBYADDR_R + #undef HAVE_FTRUNCATE /* Define if you want a bytecode interpreter. */ #undef INTERPRETER *************** *** 156,158 **** --- 157,165 ---- /* Define if you are using JVMPI. */ #undef ENABLE_JVMPI + + /* Define if your platform has a working backtrace() function. */ + #undef HAVE_BACKTRACE + + /* Define if your platform has the global _timezone variable. */ + #undef HAVE_UNDERSCORE_TIMEZONE diff -Nrc3pad gcc-3.2.3/libjava/acinclude.m4 gcc-3.3/libjava/acinclude.m4 *** gcc-3.2.3/libjava/acinclude.m4 2002-02-27 02:22:33.000000000 +0000 --- gcc-3.3/libjava/acinclude.m4 2003-01-31 18:01:17.000000000 +0000 *************** if :; then :; else *** 68,74 **** fi # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) AC_CANONICAL_SYSTEM --- 68,74 ---- fi # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" AC_SUBST(mkinstalldirs) AC_CANONICAL_SYSTEM *************** AC_PROG_INSTALL *** 144,163 **** AM_MAINTAINER_MODE ! # We need AC_EXEEXT to keep automake happy in cygnus mode. However, ! # at least currently, we never actually build a program, so we never ! # need to use $(EXEEXT). Moreover, the test for EXEEXT normally ! # fails, because we are probably configuring with a cross compiler ! # which cant create executables. So we include AC_EXEEXT to keep ! # automake happy, but we don't execute it, since we don't care about ! # the result. ! if false; then ! # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands ! # to nothing, so nothing would remain between `then' and `fi' if it ! # were not for the `:' below. ! : ! AC_EXEEXT ! fi # configure.host sets the following important variables # libgcj_cflags - host specific C compiler flags --- 144,150 ---- AM_MAINTAINER_MODE ! AC_EXEEXT # configure.host sets the following important variables # libgcj_cflags - host specific C compiler flags *************** AC_DEFUN([AM_LC_MESSAGES], *** 286,288 **** --- 273,299 ---- [Define if your file defines LC_MESSAGES.]) fi fi]) + + AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD], + [ + AC_MSG_CHECKING(whether 'ld' is at least 2.13) + LD_PROG=`$CC --print-prog-name=ld` + LD_VERSION=`$LD_PROG --version` + LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4` + LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2` + if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then + LD_OK="ok" + else + if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then + LD_OK="ok" + fi + fi + if test "x$LD_OK" != x; then + AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR]) + else + AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR]) + AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...]) + AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1, + [Indicate that linker is not able to 8-byte align static data]) + fi[]dnl + ])# CHECK_FOR_BROKEN_MINGW_LD diff -Nrc3pad gcc-3.2.3/libjava/aclocal.m4 gcc-3.3/libjava/aclocal.m4 *** gcc-3.2.3/libjava/aclocal.m4 2003-04-22 06:56:18.000000000 +0000 --- gcc-3.3/libjava/aclocal.m4 2003-05-14 00:18:14.000000000 +0000 *************** if :; then :; else *** 80,86 **** fi # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) AC_CANONICAL_SYSTEM --- 80,86 ---- fi # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" AC_SUBST(mkinstalldirs) AC_CANONICAL_SYSTEM *************** AC_PROG_INSTALL *** 156,175 **** AM_MAINTAINER_MODE ! # We need AC_EXEEXT to keep automake happy in cygnus mode. However, ! # at least currently, we never actually build a program, so we never ! # need to use $(EXEEXT). Moreover, the test for EXEEXT normally ! # fails, because we are probably configuring with a cross compiler ! # which cant create executables. So we include AC_EXEEXT to keep ! # automake happy, but we don't execute it, since we don't care about ! # the result. ! if false; then ! # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands ! # to nothing, so nothing would remain between `then' and `fi' if it ! # were not for the `:' below. ! : ! AC_EXEEXT ! fi # configure.host sets the following important variables # libgcj_cflags - host specific C compiler flags --- 156,162 ---- AM_MAINTAINER_MODE ! AC_EXEEXT # configure.host sets the following important variables # libgcj_cflags - host specific C compiler flags *************** AC_DEFUN([AM_LC_MESSAGES], *** 299,304 **** --- 286,315 ---- fi fi]) + AC_DEFUN([CHECK_FOR_BROKEN_MINGW_LD], + [ + AC_MSG_CHECKING(whether 'ld' is at least 2.13) + LD_PROG=`$CC --print-prog-name=ld` + LD_VERSION=`$LD_PROG --version` + LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4` + LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2` + if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then + LD_OK="ok" + else + if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then + LD_OK="ok" + fi + fi + if test "x$LD_OK" != x; then + AC_MSG_RESULT([yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR]) + else + AC_MSG_RESULT([no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR]) + AC_MSG_WARN([ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack...]) + AC_DEFINE(JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS, 1, + [Indicate that linker is not able to 8-byte align static data]) + fi[]dnl + ])# CHECK_FOR_BROKEN_MINGW_LD + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. diff -Nrc3pad gcc-3.2.3/libjava/boehm.cc gcc-3.3/libjava/boehm.cc *** gcc-3.2.3/libjava/boehm.cc 2002-02-12 04:14:52.000000000 +0000 --- gcc-3.3/libjava/boehm.cc 2003-01-03 05:19:53.000000000 +0000 *************** *** 1,6 **** // boehm.cc - interface between libjava and Boehm GC. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // boehm.cc - interface between libjava and Boehm GC. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** extern "C" *** 39,45 **** ptr_t GC_debug_generic_malloc (size_t size, int k, GC_EXTRA_PARAMS); }; - // We must check for plausibility ourselves. #define MAYBE_MARK(Obj, Top, Limit, Source, Exit) \ Top=GC_MARK_AND_PUSH((GC_PTR)Obj, Top, Limit, (GC_PTR *)Source) --- 39,44 ---- *************** _Jv_MarkObj (void *addr, void *msp, void *** 134,139 **** --- 133,144 ---- p = (ptr_t) c->methods; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c6label); + // The vtable might have been set, but the rest of the class + // could still be uninitialized. If this is the case, then + // c.isArray will SEGV. We check for this, and if it is the + // case we just return. + if (__builtin_expect (c->name == NULL, false)) + return mark_stack_ptr; if (! c->isArray() && ! c->isPrimitive()) { *************** _Jv_MarkObj (void *addr, void *msp, void *** 147,165 **** p = (ptr_t) c->methods[i].signature; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cm2label); - - // FIXME: `ncode' entry? - - #ifdef INTERPRETER - // The interpreter installs a heap-allocated - // trampoline here, so we'll mark it. - if (_Jv_IsInterpretedClass (c)) - { - p = (ptr_t) c->methods[i].ncode; - MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, - cm3label); - } - #endif } } --- 152,157 ---- *************** _Jv_MarkObj (void *addr, void *msp, void *** 211,221 **** MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cBlabel); p = (ptr_t) c->arrayclass; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cDlabel); #ifdef INTERPRETER if (_Jv_IsInterpretedClass (c)) { ! _Jv_InterpClass* ic = (_Jv_InterpClass*)c; p = (ptr_t) ic->interpreted_methods; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cElabel); --- 203,215 ---- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cBlabel); p = (ptr_t) c->arrayclass; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cDlabel); + p = (ptr_t) c->protectionDomain; + MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cPlabel); #ifdef INTERPRETER if (_Jv_IsInterpretedClass (c)) { ! _Jv_InterpClass* ic = (_Jv_InterpClass*) c; p = (ptr_t) ic->interpreted_methods; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cElabel); *************** _Jv_MarkObj (void *addr, void *msp, void *** 225,230 **** --- 219,244 ---- p = (ptr_t) ic->interpreted_methods[i]; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, \ cFlabel); + + // Mark the direct-threaded code. + if ((c->methods[i].accflags + & java::lang::reflect::Modifier::NATIVE) == 0) + { + _Jv_InterpMethod *im + = (_Jv_InterpMethod *) ic->interpreted_methods[i]; + if (im) + { + p = (ptr_t) im->prepared; + MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, \ + cFlabel); + } + } + + // The interpreter installs a heap-allocated trampoline + // here, so we'll mark it. + p = (ptr_t) c->methods[i].ncode; + MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, + cm3label); } p = (ptr_t) ic->field_initializers; diff -Nrc3pad gcc-3.2.3/libjava/ChangeLog gcc-3.3/libjava/ChangeLog *** gcc-3.2.3/libjava/ChangeLog 2003-04-22 06:15:35.000000000 +0000 --- gcc-3.3/libjava/ChangeLog 2003-05-14 00:11:02.000000000 +0000 *************** *** 1,10 **** ! 2003-04-22 Release Manager ! * GCC 3.2.3 Released. ! 2003-02-05 Release Manager ! * GCC 3.2.2 Released. 2003-01-27 Alexandre Oliva --- 1,1186 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! ! 2003-05-13 Release Manager ! ! * GCC 3.3 Released. ! ! 2003-05-06 Tom Tromey ! ! * verify.cc: Reverted previous patch. ! ! 2003-05-01 Tom Tromey ! ! PR libgcj/10582: ! * verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow): ! Removed. ! (type::compatible): Use _Jv_IsAssignableFrom. ! * java/lang/natClass.cc (iindex_mutex_initialized): Now static. ! (_Jv_IsAssignableFrom): Work even when source or target class is ! not prepared. ! ! 2003-04-15 Mohan Embar ! ! * include/win32.h: added dummy ECONNREFUSED define and ! _Jv_select() declaration ! * win32.cc (_Jv_select): placeholder implementation ! (_Jv_platform_initProperties): Fix by Ranjit ! Mathew (rmathew@hotmail.com): use generic names ! like "x86" for the "os.arch" property to be consistent with ! what Sun's JDK produces. Use the wProcessorArchitecture ! member of the Win32 SYSTEM_INFO structure, filled in a call ! to GetSystemInfo( ), instead of dwProcessorType ! * gnu/java/nio/natSocketChannelImpl.cc (SocketRead): use ! elements(data) and explicitly cast to char* on platforms ! where jbyte is not signed char ! (SocketWrite): idem ! ! 2003-03-29 Mohan Embar ! ! * include/jvm.h: (_Jv_GetNbArgs) added ! (_Jv_GetSafeArg) added ! (_Jv_SetArgs) added ! * prims.cc: (_Jv_GetNbArgs) implemented ! (_Jv_GetSafeArg) implemented ! (_Jv_SetArgs) implemented ! (_Jv_RunMain) use _Jv_SetArgs() instead of explicitly ! setting _Jv_argc and _Jv_argv ! * posix.cc: (_Jv_ThisExecutable) use _Jv_GetSafeArg() ! instead of _Jv_argv ! * java/lang/natRuntime.cc: (insertSystemProperties) use ! _Jv_GetSafeArg() instead of _Jv_argv ! ! 2003-04-19 Jerry Quinn ! ! * java/math/BigInteger.java (probablePrime): New. ! * java/math/BigDecimal.java (unscaledValue): New. ! ! 2003-04-19 Ranjit Mathew ! ! * java/io/File.java (getAbsolutePath): On Windows, take care ! of paths like "C:", "G:foo\bar", etc. ! (getName): Make it work correctly on Windows. ! (getParent): Make it work correctly on Windows. For UNIX, ! fix bug that causes "/" to be returned as the parent of "/", ! instead of null as returned by Sun's JRE. ! ! * java/io/natFileWin32.cc: Change copyright owner to FSF. ! ! 2003-04-16 Tom Tromey ! ! * mauve-libgcj: Disable some tests we can't compile. ! ! 2003-04-10 Tom Tromey ! ! * verify.cc (pop64): Removed. ! (verify_instructions_0) : Inline code. Don't throw ! exception if top-of-stack is narrow. ! (initialize_stack): Check to ensure that is not static and ! is. ! ! 2003-03-29 Ulrich Weigand ! ! * configure.in (HAVE_BACKTRACE) [s390*-*-linux*]: Define. ! * configure: Regenerate. ! ! 2003-03-14 Jeroen Frijters ! ! * java/io/ObjectInputStream.java (readObject): Cleaned up the class ! hierarchy loop. ! (readFields(Object,ObjectStreamField[],boolean)): Changed argument ! list to Object,ObjectStreamClass, moved callReadMethod code up into ! readObject and added Class argument to all setXxxField calls. ! (callReadMethod): Changed Class argument to ObjectStreamClass to be ! consistent with ObjectOutputStream and to facilitate caching the ! Method in the future. ! (setBooleanField): Added Class argument. ! (setByteField): Likewise. ! (setCharField): Likewise. ! (setDoubleField): Likewise. ! (setFloatField): Likewise. ! (setIntField): Likewise. ! (setLongField): Likewise. ! (setShortField): Likewise. ! (setObjectField): Likewise. ! * java/io/ObjectOutputStream.java (writeObject): Cleaned up the ! class hierarchy loop. ! (defaultWriteObject): Call writeFields with new argument list. ! (writeFields(Object,ObjectStreamField[],boolean): Changed argument ! list to Object,ObjectStreamClass, moved callWriteMethod up into ! writeObject and added Class argument to all getXxxField calls. ! (callWriteMethod): Added ObjectStreamClass argument to be able to ! get the proper class to call getMethod on (each class can have (or ! not have) its own writeObject method). ! (getBooleanField): Added Class argument. ! (getByteField): Likewise. ! (getCharField): Likewise. ! (getDoubleField): Likewise. ! (getFloatField): Likewise. ! (getIntField): Likewise. ! (getLongField): Likewise. ! (getShortField): Likewise. ! (getObjectField): Likewise. ! * java/io/ObjectStreamClass.java (hasReadMethod): Added method to ! facilitate caching the Method object in the future. ! ! 2003-03-10 2003-02-27 Mohan Embar ! ! * include/jvm.h: removed declaration of _Jv_ThisExecutable() ! setter; made return value of getter const char* instead of char* ! * prims.cc: removed all references to _Jv_ThisExecutable(). ! These are in the platform-specific sections now. ! * posix.cc: define platform-specific _Jv_ThisExecutable(). ! Handle DISABLE_MAIN_ARGS and HAVE_PROC_SELF_EXE cases ! * win32.cc: define platform-specific _Jv_ThisExecutable() ! using GetModuleFilename() ! * java/lang/natRuntime.cc: set gnu.gcj.progname property ! to argv[0] instead of _Jv_ThisExecutable() ! ! 2003-03-10 Ranjit Mathew ! ! * gnu/gcj/runtime/NameFinder.java (usingAddr2name): New flag ! that is set if we are using addr2name.awk instead of addr2line. ! (NameFinder): Set usingAddr2name if using addr2name.awk. ! (getExternalLabel): New native method to convert a method ! name to an external label. ! (lookup): Convert name given by addr2line to an external label ! before demangling. ! ! * gnu/gcj/runtime/natNameFinder.cc (LABEL_PREFIX): New string ! constant representing the prefix attached to method names to ! convert them to an external label. ! (gnu::gcj::runtime::NameFinder::getExternalLabel): Define ! using LABEL_PREFIX. ! ! 2003-03-09 Tom Tromey ! ! PR libgcj/9934: ! * java/io/natFileDescriptorPosix.cc (available): Fixed arguments ! to lseek. Return 0 if we can't compute the value. ! ! 2003-03-03 Tom Tromey ! ! * verify.cc (handle_jsr_insn): Don't fail if `jsr' appears at end ! of bytecode. ! (handle_ret_insn): Fail if returning to jsr that appears at end of ! bytecode. ! ! 2003-03-02 Mark Wielaard ! ! * java/util/Properties.java (load): Only skip line if the first ! character is a comment, whitespaces don't count. ! ! 2003-03-01 Jason Thorpe ! ! * posix-threads.cc: Include if HAVE_UNISTD_H is defined. ! (_Jv_ThreadSetPriority): Test for _POSIX_THREAD_PRIORITY_SCHEDULING. ! ! 2003-03-01 Ranjit Mathew ! ! * java/io/File.java (normalizePath): Remove trailing separator ! on Windows only if path is not of the form "x:\". ! ! * java/io/natFileWin32.cc (WIN32_EPOCH_MILLIS): New constant. ! (java::io::File::attr): Change formatting a bit and use ! WIN32_EPOCH_MILLIS instead of magic numbers. ! (java::io::File::isAbsolute): Path must have at least 3 ! characters for a UNC network path. ! (java::io::File::init_native): Define. ! (java::io::File::performCreate): Likewise. ! (java::io::File::performSetReadOnly): Likewise. ! (java::io::File::performSetLastModified): Likewise. ! (java::io::File::performListRoots): Likewise. ! ! 2003-03-01 Michael Koch ! ! * java/net/DatagramSocket.java ! (closed): New member variable. ! (close): Use closed variable. ! (getInetAddress): No need to call isConnected(). ! (getPort): No need to call isConnected(). ! (disconnect): Reset remoteAddress and remotePort, fixed typo. ! (isClosed): Reimplemented. ! ! 2003-03-01 Ranjit Mathew ! ! * java/io/File (getAbsolutePath): Prefix drive specifier on ! Windows for paths starting with a '\'. ! (toURL): Make URL more consistent with what Sun's JDK returns. ! ! * java/io/natFileWin32.cc (java::io::File::isAbsolute): Return ! true only if the path is a UNC network path or it starts with a ! drive specifier. ! ! * java/net/URLStreamHandler.java (parseURL): Correct minor typo. ! Be prepared to handle either '/' or '\\' in the file path for ! Windows if using the "file" protocol. ! Canonicalise the file path if using a relative path in the given ! context and the "file" protocol. ! ! 2003-03-01 Mohan Embar ! ! * java/lang/natWin32Process.cc (startProcess): Double-quote each ! program array element passed to CreateProcess. ! ! 2003-03-01 Michael Koch ! ! * gnu/java/nio/natSocketChannelImpl.cc: ! Reverse logic for DISABLE_JAVA_NET. Thanks to Krister Walfridsson ! for pointing to it. ! ! * gnu/java/nio/natSocketChannelImpl.cc: ! Added support for platforms without network support. ! ! * java/nio/channels/FileChannel.java ! (toString): New implementation, added documentation. ! (map): Added exception documentation. ! (size): Added exception documentation. ! (write): New methods, documentation work. ! (read): New methods, documentation work. ! (implCloseChannel): Rewrote exception documentation. ! (force): Throws IOException, added documentation. ! (lock): New methods. ! (tryLock): New methods. ! (position): New methods. ! (transferTo): New method. ! (transferFrom): New method. ! (truncate): New method. ! * java/nio/channels/spi/SelectorProvider.java ! (provider): Implemented. ! * Makefile.am ! (ordinary_java_source_files): Added the following files: ! gnu/java/nio/DatagramChannelImpl.java ! gnu/java/nio/FileChannelImpl.java ! gnu/java/nio/PipeImpl.java ! gnu/java/nio/SelectionKeyImpl.java ! gnu/java/nio/SelectorImpl.java ! gnu/java/nio/SelectorProviderImpl.java ! gnu/java/nio/ServerSocketChannelImpl.java ! gnu/java/nio/SocketChannelImpl.java ! java/nio/channels/FileLock.java ! (nat_java_source_files): Added the following files: ! gnu/java/nio/natFileChannelImpl.cc ! gnu/java/nio/natSelectorImpl.cc ! gnu/java/nio/natSocketChannelImpl.cc ! * Makefile.in: Regenerated. ! ! 2003-03-01 Michael Koch ! ! * gnu/java/nio/ByteBufferImpl.java ! (ByteBufferImpl): Renamed two variables. ! * gnu/java/nio/CharBufferImpl.java ! (CharBufferImpl): Renamed two variables. ! * gnu/java/nio/DoubleBufferImpl.java ! (DoubleBufferImpl): Renamed two variables. ! * gnu/java/nio/FloatBufferImpl.java ! (FloatBufferImpl): Renamed two variables. ! * gnu/java/nio/IntBufferImpl.java ! (IntBufferImpl): Renamed two variables. ! * gnu/java/nio/LongBufferImpl.java ! (LongBufferImpl): Renamed two variables. ! * gnu/java/nio/ShortBufferImpl.java ! (ShortBufferImpl): Renamed two variables. ! * java/nio/CharBuffer.java ! (wrap): Fixed arguments to CharBufferImpl constructor. ! (hasArray): Only not read-only buffers have backing arrays. ! (length): Documentation added. ! (subSequence): Documentation added. ! * java/nio/DoubleBuffer.java ! (hasArray): Only not read-only buffers have backing arrays. ! * java/nio/FloatBuffer.java ! (hasArray): Only not read-only buffers have backing arrays. ! * java/nio/IntBuffer.java ! (hasArray): Only not read-only buffers have backing arrays. ! * java/nio/LongBuffer.java ! (hasArray): Only not read-only buffers have backing arrays. ! * java/nio/ShortBuffer.java ! (hasArray): Only not read-only buffers have backing arrays. ! ! 2003-03-01 Mark Wielaard ! ! * java/io/ObjectInputStream.java: Reindent. ! * java/io/ObjectOutputStream.java: Likewise. ! ! 2003-02-28 Hans Boehm ! ! * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Allocate a full ! jvalue for each argument. Simplify. ! * testsuite/libjava.jni/calls.c (docall), ! testsuite/libjava.jni/calls.java (longpb_f): check for argument ! misalignment. ! ! 2003-02-28 Mark Wielaard ! ! * Makefile.am (nat_source_files): Remove ! java/io/natObjectOutputStream.cc. ! * Makefile.in: Regenerated. ! * mauve-libgcj: Don't exclude java.io.ObjectInputOutput tests. ! * java/io/ObjectStreamField.java (typename): New field. ! (ObjectStreamField(String, Class)): Initialize new field. ! (ObjectStreamField(String, String)): New Constructor. ! (getTypeCode): Use new field. ! (getTypeString): Use new field. ! * java/io/ObjectOutputStream.java (writeObject): Rethrow fatal ! ObjectStreamExceptions. Remember and reset old BlockDataMode. ! Handle reading of Proxy classes. Never drain(), just write ! TC_ENDBLOCKDATA. Rethrow ObjectStreamExceptions. ! (drain): Check writeDataAsBlocks before calling writeBlockDataHeader. ! (flush): Call flush(), not just drain(). ! (writeBoolean): Always use blockDataOutput. ! (writeByte): Likewise. ! (writeShort): Likewise. ! (writeChar): Likewise. ! (writeInt): Likewise. ! (writeLong): Likewise. ! (writeFloat): Likewise. ! (writeDouble): Likewise. ! (writeBytes): Likewise. ! (putfield (put(String,Object))): Throw IllegalArgumentException if ! field cannot be found. ! (putfield (write(ObjectOutput))): Remember old BlockDataMode. ! (writeArraySizeAndElements): Write byte[] in one go. ! (writeFields): Write TC_ENDBLOCKDATA when call_write_method, otherwise ! set BlockDataMode to false. ! (annotateProxyClass): New method. ! (defaultProtocolVersion): Now defaults to PROTOCOL_VERSION_2 ! (getField): No longer native. ! (getMethod): Likewise. ! (setBlockDataMode): Always drain() on switch, return old mode. ! (static): New static code block. ! * java/io/natObjectOutputStream.cc: Removed. ! * java/io/ObjectInputStream.java (getField): No longer native. ! (getMethod): Likewise. ! (readObject): Remember and reset old BlockDataMode. Track whether ! object is consumed. Handle TC_ENDBLOCKDATA, TC_PROXYCLASSDESC and ! TC_LONGSTRING. ! (defaultReadObject): Set BlockDataMode to false during readFields. ! (resolveClass): Create new SecurityManager if necessary. ! Use Class.forName() if null ClassLoader found. ! (read(byte[],int,int): Copy remaining bytes to data before calling ! readNextBlock(). ! (readFields): Set and reset BlockDataMode on call_read_method. ! Catch NoSuchFieldErrors. ! (setBlockDataMode): Return old mode. ! (static): New static code block. ! * java/io/natObjectInputStream.cc (getField): Removed. ! (getMethod): Likewise. ! ! 2003-02-21 Mark Wielaard ! ! * java/util/zip/ZipEntry.java (setComment): Don't check length when ! argument is null. ! ! 2003-02-21 Mark Wielaard ! ! * java/util/zip/ZipEntry.java (ZipEntry(String)): When name is bigger ! then 65535 chars throw IllegalArgumentException. ! ! 2003-02-21 Mark Wielaard ! ! * java/util/zip/ZipFile.java (finalize): New method. ! ! 2003-02-20 Alexandre Oliva ! ! * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to ! config.status. ! * configure: Rebuilt. ! ! 2003-02-19 Rainer Orth ! ! * gnu/gcj/runtime/natStackTrace.cc: Include platform.h immediately ! after config.h. Use <> for consistency. ! * java/lang/natObject.cc: Likewise. ! * java/lang/natRuntime.cc: Likewise. ! * java/lang/natSystem.cc: Likewise. ! * java/util/natTimeZone.cc: Likewise. ! * win32.cc: Likewise. ! * include/posix.h (fcntl, socket, connect, close, bind, accept, ! listen, write, read): Undef to avoid interference from OS macros. ! ! 2003-02-18 Raif S. Naffah ! ! * java/math/BigInteger.java (euclidInv): Take result array as an ! argument. Updated all callers. ! (modInverse): Removed unused variables. ! ! 2003-02-17 Michael Koch ! ! * java/net/DatagramSocket.java ! (connect): Merged with classpath. ! (disconnect): Merged documentation with classpath. ! (receice): Merged documentation with classpath. ! (send): Merged documentation with classpath. ! ! 2003-02-17 Jesse Rosenstock ! ! * java/nio/charset/Charset.java ! (isRegistered): Fixed method args and implementation. ! * java/nio/charset/CharsetEncoder.java ! (unmappableCharacterAction): New method. ! ! 2003-02-17 Raif S. Naffah ! ! * java/math/BigInteger.java (euclidInv): Return array of ! `BigInteger's. Changed all callers. ! ! 2003-02-16 Ranjit Mathew ! ! * java/util/Properties.java (store): Move the code formerly in ! list(), into this method. ! (list (PrintStream)): Just call list (PrintWriter) with a ! PrintWriter object constructed from the given PrintStream object. ! (list (PrintWriter)): Emulate the output of Properties.list() ! as found in JDK 1.3/1.4. ! ! 2003-02-16 Tom Tromey ! ! * verify.cc (_Jv_BytecodeVerifier::pop_jump): Removed unused ! variable. ! ! 2003-02-14 Michael Koch ! ! * gnu/java/nio/natServerSocketChannelImpl.cc: Removed. ! * gnu/java/nio/ServerSocketChannelImpl.java ! (SocketAccept): Removed. ! (accept): Commented out use of SocketAccept. ! ! 2003-02-14 Mark Wielaard ! ! * java/math/BigDecimal.java (BigDecimal(String)): Always set scale to ! zero when there is an exponent and the significant is zero. ! (divide): Always set scale to newScale even in special ZERO case. ! ! 2003-02-14 Tom Tromey ! ! * java/lang/System.java (properties): Use Properties.clone. ! (setProperties): Likewise. ! ! 2003-02-13 Tom Tromey ! ! * verify.cc (state::seen_subrs): New field. ! (state::state): Initialize it. ! (state::clean_subrs): New method. ! (state::~state): Call it. ! (state::copy): Copy subroutine list. ! (state::add_subr): New method. ! (state::merge): Only register a change if the current subroutine ! hasn't yet been noted. ! ! 2003-02-13 Mark Wielaard ! ! * java/io/InputStreamReader.java (getEncoding): Return null when ! closed. ! * java/io/OutputStreamWriter.java (getEncoding): Likewise. ! ! 2003-02-13 Mark Wielaard ! ! * java/util/zip/InflaterInputStream.java (read): Return zero when len ! is zero. ! ! 2003-02-13 Mark Wielaard ! ! * java/io/BufferedOutputStream.java (write(int)): Only flush when ! next byte cannot be buffered. ! ! 2003-02-13 Casey Marshall ! ! PR libgcj/9271: ! * java/security/SecureRandom.java (next): Avoid bias in results. ! ! 2003-02-13 Michael ! ! * gnu/java/nio/FileChannelImpl.java ! (lengthInternal): Must be native. ! (size): Check if channel is already closed. ! (implCloseChannel): Reformated. ! (read): w was unused, removed it. ! (read): Removed. ! (read): New method. ! (write): New method. ! (map): Check arguments. ! (force): Throws IOException, check if channel is closed. ! (transferTo): New method. ! (transferFrom): New method. ! (lock): New method. ! (tryLock): New method. ! (position): New method. ! (truncate): New method. ! (nio_mmap_file): Uncommented. ! (nio_munmap_file): Uncommented. ! (nio_msync): Uncommented. ! * gnu/java/nio/natFileChannelImpl.cc: New file. ! ! 2003-02-13 Michael Koch ! ! * java/nio/ByteBuffer.java ! (endian): New member variable. ! (get): New methods. ! (equals): New method. ! (compareTo): New method. ! (order): New methods. ! (compact): New method. ! (isDirect): New method. ! (slice): New method. ! (duplicate): New method. ! (asReadOnlyBuffer): New method. ! (asCharBuffer): New method. ! (asDoubleBuffer): New method. ! (asFloatBuffer): New method. ! (asIntBuffer): New method. ! (asLongBuffer): New method. ! (asShortBuffer): New method. ! (get*): New methods. ! (put*): New methods. ! (toString): New method. ! * java/nio/CharBuffer.java ! (CharBuffer): Implement Comparable instead of Cloneable. ! (get): May not be final. ! (put): May not be final. ! ! 2003-02-13 Michael Koch ! ! * gnu/java/nio/natSocketChannelImpl.cc ! (SocketConnect): This is not implemented yet. ! (SocketBind): This is not implemented yet. ! ! 2003-02-13 Michael Koch ! ! * gnu/java/nio/natByteBufferImpl.cc, ! gnu/java/nio/natCharBufferImpl.cc, ! gnu/java/nio/natDoubleBufferImpl.cc, ! gnu/java/nio/natFloatBufferImpl.cc, ! gnu/java/nio/natIntBufferImpl.cc, ! gnu/java/nio/natLongBufferImpl.cc, ! gnu/java/nio/natShortBufferImpl.cc: ! Added copyright and license. ! * java/nio/DoubleBuffer.java, ! java/nio/FloatBuffer.java, ! java/nio/IntBuffer.java, ! java/nio/LongBuffer.java, ! java/nio/ShortBuffer.java ! (array): Throw exceptions. ! (arrayOffset): Throw exceptions. ! ! 2002-02-13 Ranjit Mathew ! ! * gnu/gcj/runtime/NameFinder.java (createStackTraceElement): Use ! lastIndexOf( ) instead of indexOf( ) to find the colon before ! the line number, because Win32 file names might contain a ! drive letter and a colon at the start of an absolute path. ! ! 2003-02-12 Jeff Sturm ! ! * configure.host (alpha*-*): Default to -mieee. ! * configure.in (IEEESPEC): New. ! * libgcj.spec.in (jc1): Add IEEESPEC. ! * configure: Rebuild. ! ! 2003-02-12 Ranjit Mathew ! ! * include/win32.h: Include ws2tcpip.h instead of ! winsock.h to obtain definition of the socklen_t type. ! Remove IP_TOS definition - not needed with ws2tcpip.h ! (_Jv_connect): Correct slight formatting error. ! ! 2003-02-12 Ranjit Mathew ! ! * jni.cc (_Jv_LookupJNIMethod): Modify to accept the ! size of the arguments for a JNI function. For Win32, ! modify to search for all forms of possible exported ! names of an stdcall JNI function. ! (_Jv_JNIMethod::call): Modify to calculate the size ! of the arguments passed to a JNI function and pass ! it to _Jv_LookupJNIMethod. ! ! 2003-02-12 Michael Koch ! ! * java/net/NetPermission.java ! (NetPermission): Make doucmentation match the method declaration. ! * java/net/NetworkInterface.java ! (equals): Reformated for GNU coding style. ! * java/net/ServerSocket.java: Merged with classpath. ! * java/net/Socket.java: Partly merged with classpath (Added some ! @since). ! * java/net/SocketImpl.java ! (localPort): Merged with classpath (initialize with -1). ! * java/net/SocketPermission.java: Merged with classpath (reindented). ! * java/net/URLDecoder.java: Merged with classpath (reindented). ! ! 2003-02-12 Michael Koch ! ! * java/nio/channels/Channels.java: New file. ! * Makefile.am ! (ordinary_java_source_files): Added java/nio/channels/Channels.java. ! * Makefile.in: Regenerated. ! ! 2003-02-12 Michael Koch ! ! * java/nio/ByteBuffer.java ! (allocate): Implemented. ! (wrap): Implemented. ! * java/nio/CharBuffer.java: ! Some documentation added and reworked. ! (endian): Removed. ! (allocate): Implemented. ! (wrap): Implemented. ! (array): Throw exceptions. ! (arrayOffset): Throw exceptions. ! (toString): Implemented. ! (length): Implemented. ! (put): Implemented. ! (charAt): Implemented. ! ! 2003-02-11 John Leuner ! ! * java/util/zip/ZipInputStream.java: Fix problem with 0-length ! reads from end of file. ! ! 2003-02-11 Michael Koch ! ! * gnu/java/nio/ByteBufferImpl.java: ! Reformated and removed some code. ! (backing_buffer): Removed. ! (array_offset): Removed. ! (ro): Renamed to readOnly. ! (ByteBufferImpl): Use parent constructor, initialize readOnly. ! * gnu/java/nio/CharBufferImpl.java: ! Reformated and removed some code. ! (array_offset): Removed. ! (ro): Renamed to readOnly. ! (CharBufferImpl): Use parent constructor, initialize readOnly. ! (inc_pos): Removed. ! (order): New method. ! * gnu/java/nio/DoubleBufferImpl.java: ! Reformated and removed some code. ! (array_offset): Removed. ! (ro): Renamed to readOnly. ! (DoubleBufferImpl): Use parent constructor, initialize readOnly. ! (inc_pos): Removed. ! (order): New method. ! * gnu/java/nio/FloatBufferImpl.java: ! Reformated and removed some code. ! (array_offset): Removed. ! (ro): Renamed to readOnly. ! (FloatBufferImpl): Use parent constructor, initialize readOnly. ! (inc_pos): Removed. ! (order): New method. ! * gnu/java/nio/IntBufferImpl.java: ! Reformated and removed some code. ! (array_offset): Removed. ! (ro): Renamed to readOnly. ! (IntBufferImpl): Use parent constructor, initialize readOnly. ! (inc_pos): Removed. ! (order): New method. ! * gnu/java/nio/LongBufferImpl.java: ! Reformated and removed some code. ! (array_offset): Removed. ! (ro): Renamed to readOnly. ! (LongBufferImpl): Use parent constructor, initialize readOnly. ! (inc_pos): Removed. ! (order): New method. ! * gnu/java/nio/ShortBufferImpl.java: ! Reformated and removed some code. ! (array_offset): Removed. ! (ro): Renamed to readOnly. ! (ShortBufferImpl): Use parent constructor, initialize readOnly. ! (inc_pos): Removed. ! (order): New method. ! * Makefile.am ! (ordinary_java_source_files): Added the following files: ! gnu/java/nio/ByteBufferImpl.java ! gnu/java/nio/CharBufferImpl.java ! gnu/java/nio/DoubleBufferImpl.java ! gnu/java/nio/FloatBufferImpl.java ! gnu/java/nio/IntBufferImpl.java ! gnu/java/nio/LongBufferImpl.java ! gnu/java/nio/ShortBufferImpl.java ! java/nio/DoubleBuffer.java ! java/nio/FloatBuffer.java ! java/nio/IntBuffer.java ! java/nio/LongBuffer.java ! java/nio/ShortBuffer.java ! (nat_source_files): Added the following files: ! gnu/java/nio/natByteBufferImpl.cc ! gnu/java/nio/natCharBufferImpl.cc ! gnu/java/nio/natDoubleBufferImpl.cc ! gnu/java/nio/natFloatBufferImpl.cc ! gnu/java/nio/natIntBufferImpl.cc ! gnu/java/nio/natLongBufferImpl.cc ! gnu/java/nio/natShortBufferImpl.cc ! * Makefile.in: Regenerated. ! ! 2003-02-11 Michael Koch ! ! * gnu/java/nio/natCharBufferImpl.cc ! (nio_cast): Removed. ! (nio_put_*): Removed. ! (nio_get_*): Removed. ! * gnu/java/nio/natDoubleBufferImpl.cc ! (nio_cast): Removed. ! (nio_put_*): Removed. ! (nio_get_*): Removed. ! * gnu/java/nio/natFloatBufferImpl.cc ! (nio_cast): Removed. ! (nio_put_*): Removed. ! (nio_get_*): Removed. ! * gnu/java/nio/natIntBufferImpl.cc ! (nio_cast): Removed. ! (nio_put_*): Removed. ! (nio_get_*): Removed. ! * gnu/java/nio/natLongBufferImpl.cc ! (nio_cast): Removed. ! (nio_put_*): Removed. ! (nio_get_*): Removed. ! * gnu/java/nio/natShortBufferImpl.cc ! (nio_cast): Removed. ! (nio_put_*): Removed. ! (nio_get_*): Removed. ! * gnu/java/nio/SelectorProviderImpl.java ! (openDatagramChannel): Throws IOException. ! (openPipe): Throws IOException. ! (openSelector): Throws IOException. ! (openServerSocketChannel): Throws IOException. ! (openSocketChannel): Throws IOException. ! * gnu/java/nio/ServerSocketChannelImpl.java ! (ServerSocketChannelImpl): Throws IOException. ! (implCloseSelectableChannel): Throws IOException. ! (implConfigureBlocking): Throws IOException. ! * java/nio/ByteBuffer.java ! (readOnly): Removed. ! (hasArray): Use isReadOnly() instead of readOnly. ! (array): Use isReadOnly() instead of readOnly. ! (arrayOffset): Use isReadOnly() instead of readOnly. ! * java/nio/CharBuffer.java ! (CharBuffer): Implements Cloneable and CharSequence. ! ! 2003-02-11 Michael Koch ! ! * java/nio/Buffer.java ! (cap, lim, pos, mark): Made private ! (Buffer): Added package private constructor. ! * java/nio/ByteBuffer.java ! (ByteBuffer): Implements Cloneable. ! (offset): New member variable. ! (readOnly): New member variable. ! (backing_buffer): New member variable. ! (allocateDirect): Throw exception and tell that direct buffers are ! not supported yet, documentation added. ! (allocate): Documentation added. ! (wrap): Documentation added. ! (ByteBuffer): New constructor. ! (hasArray): New method. ! (array): New method. ! (arrayOffset): New method. ! (get): Documentation added. ! (put): Documentation added. ! * java/nio/CharBuffer.java ! (CharBuffer): New constructor. ! (compareTo): Don't access member variables of Buffer directly. ! * java/nio/DoubleBuffer.java ! (allocateDirect): Throw exception and tell that direct buffers are ! not supported yet. ! * java/nio/FloatBuffer.java ! (allocateDirect): Throw exception and tell that direct buffers are ! not supported yet. ! * java/nio/IntBuffer.java ! (allocateDirect): Throw exception and tell that direct buffers are ! not supported yet. ! * java/nio/LongBuffer.java ! (allocateDirect): Throw exception and tell that direct buffers are ! not supported yet. ! * java/nio/MappedByteBuffer.java ! (MappedByteBuffer): New method. ! (force): New method. ! (isLoaded): New method. ! (load): New method. ! * java/nio/ShortBuffer.java ! (allocateDirect): Throw exception and tell that direct buffers are ! not supported yet. ! ! 2003-02-11 Ranjit Mathew ! ! * java/io/natFileDescriptorWin32.cc ! (java::io::FileDescriptor::read): Return -1 (EOF) if ReadFile( ) ! returns with Win32 error code ERROR_BROKEN_PIPE. ! ! 2003-02-10 Tom Tromey ! ! * javax/sql/ConnectionEvent.java (serialVersionUID): New field. ! (ex): Renamed from sqlException. ! ! 2003-02-10 Michael Koch ! ! * java/nio/DoubleBuffer.java ! (DoubleBuffer): Implements Comparable. ! (endian): Removed. ! (array_offset): New member variable. ! (DoubleBuffer): New constuctor. ! (get): May not be final. ! (put): May not be final. ! (arrayOffset): Implemented. ! (order): Made abstract. ! (order): Removed. ! (as*Buffer): Removed. ! (get*): Removed. ! (put*): Removed. ! * java/nio/FloatBuffer.java ! (FloatBuffer): Implements Comparable. ! (endian): Removed. ! (array_offset): New member variable. ! (FloatBuffer): New constuctor. ! (get): May not be final. ! (put): May not be final. ! (arrayOffset): Implemented. ! (order): Made abstract. ! (order): Removed. ! (as*Buffer): Removed. ! (get*): Removed. ! (put*): Removed. ! * java/nio/IntBuffer.java ! (IntBuffer): Implements Comparable. ! (endian): Removed. ! (array_offset): New member variable. ! (IntBuffer): New constuctor. ! (get): May not be final. ! (put): May not be final. ! (arrayOffset): Implemented. ! (order): Made abstract. ! (order): Removed. ! (as*Buffer): Removed. ! (get*): Removed. ! (put*): Removed. ! * java/nio/LongBuffer.java ! (LongBuffer): Implements Comparable. ! (endian): Removed. ! (array_offset): New member variable. ! (LongBuffer): New constuctor. ! (get): May not be final. ! (put): May not be final. ! (arrayOffset): Implemented. ! (order): Made abstract. ! (order): Removed. ! (as*Buffer): Removed. ! (get*): Removed. ! (put*): Removed. ! * java/nio/ShortBuffer.java ! (ShortBuffer): Implements Comparable. ! (endian): Removed. ! (array_offset): New member variable. ! (ShortBuffer): New constuctor. ! (get): May not be final. ! (put): May not be final. ! (arrayOffset): Implemented. ! (order): Made abstract. ! (order): Removed. ! (as*Buffer): Removed. ! (get*): Removed. ! (put*): Removed. ! ! 2003-02-10 Michael Koch ! ! * gnu/java/nio/FileLockImpl.java, ! java/nio/channels/FileLock.java: New files. ! ! 2003-02-10 Michael Koch ! ! * java/nio/charset/IllegalCharsetNameException.java ! (serialVersionUID): New member variable. ! (charsetName): New member variable. ! (IllegalCharsetException): New implementation. ! (getCharsetName): New implementation. ! * java/nio/charset/UnsupportedCharsetException.java ! (serialVersionUID): New member variable. ! (charsetName): New member variable. ! (UnsupportedCharsetException): New implementation. ! (getCharsetName): New implementation. ! ! 2003-02-10 Michael Koch ! ! * java/nio/channels/DatagramChannel.java ! (write): Throws IOException. ! (connect): Throws IOException. ! (disconnect): Throws IOException. ! (read): Throws IOException. ! (receive): Throws IOException. ! (send): Throws IOException. ! * java/nio/channels/Pipe.java ! (open): Throws IOException. ! * java/nio/channels/SelectableChannel.java ! (configureBlocking): Throws IOException. ! * java/nio/channels/ServerSocketChannel.java ! (accept): Throws IOException. ! * java/nio/channels/SocketChannel.java ! (SocketChannel): Implements ByteChannel, ScatteringByteChannel, ! GatheringByteChannel. ! (read): Throws IOException. ! (write): Throws IOException. ! (finishConnect): Throws IOException. ! * java/nio/channels/spi/AbstractInterruptibleChannel.java ! (end): Throws AsynchronousCloseException. ! * java/nio/channels/spi/AbstractSelectableChannel.java ! (configureBlocking): Throws IOException. ! (implCloseChannel): Throws IOException. ! (implCloseSelectableChannel): Throws IOException. ! (implConfigureBlocking): Throws IOException. ! * java/nio/channels/spi/SelectorProvider.java ! (openDatagramChannel): Throws IOException. ! (openPipe): Throws IOException. ! (openSelector): Throws IOException. ! (openServerSocketChannel): Throws IOException. ! (openSocketChannel): Throws IOException. ! ! 2003-02-10 Raif S. Naffah ! ! * gnu/java/security/provider/SHA1PRNG.java (ensureIsSeeded): new ! method used to ensure seeding has occurred and that a specific ! seed can be set and used. ! ! 2003-02-10 Michael Koch ! ! * java/nio/channels/SelectionKey.java ! (OP_ACCEPT, OP_CONNECT, OP_READ, OP_WRITE): Initialize with correct ! values. ! ! 2003-02-10 Ranjit Mathew ! ! * java/lang/Win32Process.java (destroy): Declare as native. ! (hasExited): New native method. ! (exitValue): Define. ! (getErrorStream): Likewise. ! (getInputStream): Likewise. ! (getOutputStream): Likewise. ! (waitFor): Declare as native. ! (startProcess): New native method. ! (cleanup): Likewise. ! (ConcreteProcess): Define. ! (outputStream, inputStream, errorStream): New members. ! (procHandle, exitCode): Likewise. ! ! * java/lang/natWin32Process.cc ! (java::lang::ConcreteProcess::cleanup): Define. ! (java::lang::ConcreteProcess::destroy): Likewise. ! (java::lang::ConcreteProcess::hasExited): Likewise. ! (java::lang::ConcreteProcess::waitFor): Likewise. ! (new_string): Likewise. ! (java::lang::ConcreteProcess::startProcess): Likewise. ! ! 2003-02-10 Raif S. Naffah ! ! * java/math/BigInteger.java: ! Updated notice to include years 2002 and 3. ! Added 2 private (int) arrays with values from the HAC (Handbook of ! Applied Cryptography -A. Menezes & al): k[] that contains bit lengths ! and t[] that contains nbr. of tests --used in isProbablePrime(). ! ! * java/math/BigInteger.java (make(long)): Merged into valueOf(long). ! ! * java/math/BigInteger.java (make(int[],int), add(int,int), ! add(BI,BI,int), times(BI,int), divide(long,long,BI,BI,int), gcd(BI), ! isProbablePrime(int), shift(BI,int), valueOf(String,int), neg(BI), ! bitOp(int,BI,BI), and(BI,int)): Use valueOf(long) instead of ! make(long). ! ! * java/math/BigInteger.java (euclidInv): Reduce number of work vars ! (euclidInv(int,int,int)): Now returns an array of 2 ints instead of 3. ! (euclidInv(BI,BI,BI)): Used to return an array of 2 BIs; now accepts 6 ! BIs and returns void. ! (modInverse(BI)): Use new signatures of euclidInv(). ! ! * java/math/BigInteger.java (isProbablePrime(int)): Use divide() with ! static small primes instead of remainder(). ! Use pre-computed max nbr of trials based on bitlength of BI to test. ! Use pre-computed small primes for the trial tests instead of random ! numbers. ! ! * java/math/BigInteger.java (isOdd, isMinusOne, pow): Removed. ! not used. ! ! * java/math/BigInteger.java (format(int,StringBuffer)): Removed ! invoacation of MPN.chars_per_word(). not used. ! ! * java/math/BigInteger.java (gcd(int,int)): Declared 'tmp' once as ! local var and used where needed. ! ! * java/math/BigInteger.java (modPow(BI,BI)): Fixed spelling. ! Combined declaration with initialisation of locals. ! Removed unused var. ! ! * java/math/BigInteger.java: Style changes ! (pow(int)): Removed 'else' keyword. ! (toString(int)): idem. ! (doubleValue()): idem. ! (bitLength()): idem. ! (equals(Object)): Use static methods name in same class w/o prepending ! class name. ! (doubleValue()): idem. ! (setNegative(BI)): idem. ! (negate()): idem. ! (and(BI,int)): idem. ! (and(BI)): idem. ! (gcd(BI)): idem. ! (byteArrayToIntArray()): Removed casting to (int). this is ! std. behaviour. ! (canonicalize()): idem. ! (alloc(int)): Always instantiate a new BI. ! ! 2003-02-10 Tom Tromey ! ! * java/sql/Timestamp.java (compareTo(Object)): New method. ! (compareTo(Timestamp)): Likewise. ! (serialVersionUID): Updated. ! ! 2003-02-07 Mark Wielaard ! ! * java/util/jar/JarFile.java (JarFile(String, boolean)): Read manifest ! when verify is true. ! (JarFile(File, boolean)): Likewise. ! (manifestRead): Set manifestRead field correctly. ! ! 2003-02-07 Stephen Crawley ! ! * java/math/BigDecimal(valueOf): fix DiagBigDecimal val008, val013 ! tests; see patch #1016 on Savannah. ! ! 2003-02-07 Stephen Crawley ! ! * java/math/BigDecimal.java (BigDecimal): enhance parsing of exponents ! (toString): do not return Strings starting with . and - erroneously. ! Improves Mauve results to 12 of 600 instead of 16 of 338 on ! DiagBigDecimal. ! ! 2003-02-07 Stephen Crawley ! ! * java/beans/PropertyDescriptor.java ! (PropertyDescriptor(String, Class)): Sanity check getter and setter ! methods. ! (PropertyDescriptor(String, Class, String, String)): Likewise. ! (PropertyDescriptor(String, Method, Method): Factor out getter and ! setter method sanity checks into new method. ! (findMethods): Don't do parameter sanity checking of get method here. ! (checkMethods): New method. ! ! 2003-02-07 Stephen Crawley ! ! * java/beans/PropertyDescriptor.java: Reformat. ! ! 2003-02-04 Tom Tromey ! ! * java/io/PipedOutputStream.java (flush): Declare as throwing ! IOException. ! (close): Likewise. ! * java/io/PipedWriter.java (close): Declare as throwing ! IOException. ! * java/io/StringWriter.java (close): Declare as throwing ! IOException. ! ! 2003-02-03 Ranjit Mathew ! ! * java/lang/natRuntime.cc (java::lang::Runtime::_load)): Take care ! of the fact that on Win32, JNI_OnLoad is an "stdcall" function and ! could also have been exported as "JNI_OnLoad@8" (MinGW) or ! "_JNI_OnLoad@8" (MSVC). ! ! 2003-02-03 Ranjit Mathew ! ! * resolve.cc (_Jv_JNIMethod::ncode): Use stdcall calling ! convention on Win32 to invoke native JNI methods. ! ! 2003-02-03 Andrew Haley ! ! * configure.host (x86_64): Enable interpreter. ! ! 2003-01-28 Andrew Haley ! ! * libgcj.spec.in (jc1): Add BACKTRACESPEC. ! * configure.host (x86_64): Default to -fno-omit-frame-pointer. ! * configure.in (BACKTRACESPEC): New. ! * configure: Regenerate. ! ! 2003-02-02 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (lib_gnu_awt_xlib_la_LDFLAGS): Link against ! libstdc++. ! ! 2003-01-31 Tom Tromey ! ! * jni.cc (_Jv_JNI_NewObjectArray): Check that initializer can be ! cast to element type. ! (_Jv_JNI_SetObjectArrayElement): Check array bounds. ! (_Jv_JNI_GetObjectArrayElement): Likewise. ! ! 2003-01-31 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (cond_x_ltlibrary): Renamed library to ! lib-gnu-awt-xlib.la. ! (lib_gnu_awt_xlib_la_SOURCES): Renamed. ! (EXTRA_lib_gnu_awt_xlib_la_SOURCES): Likewise. ! (lib_gnu_awt_xlib_la_DEPENDENCIES): Likewise. ! (lib_gnu_awt_xlib_la_LIBADD): Likewise. ! (lib_gnu_awt_xlib_la_LDFLAGS): Likewise. ! (lib_gnu_awt_xlib_la_LINK): Likewise. ! (install-exec-hook): Removed. ! (lib-gnu-awt-xlib.la): Renamed. ! ! * aclocal.m4, configure, include/config.h.in: Rebuilt. ! * acinclude.m4 (CHECK_FOR_BROKEN_MINGW_LD): Moved from ! aclocal.m4. ! ! 2003-01-31 Julian Dolby ! ! * java/util/Properties.java (load): Ignore backslash before EOF. ! ! 2003-01-28 Oscar Pearce ! ! * java/awt/Component.java (processPaintEvent): Dispose of Graphics ! object when finished. ! ! 2003-01-28 Andreas Tobler ! ! * libjava/configure.host: Disable can_unwind_signal on darwin. ! ! 2003-01-28 Ranjit Mathew ! ! Fixes PR java/9254: ! * include/win32-threads.h (_Jv_Mutex_t): Convert to a struct ! additionally containing id of the owner thread as well as ! the number of nested times the thread has acquired the mutex. ! (_Jv_MutexInit): Initialise owner thread id and refcount to 0. ! (_Jv_MutexDestroy): Reset owner thread id and refcount to 0. ! (_Jv_MutexUnlock): Check if really the owner thread, reset ! owner thread id to 0 before leaving, if leaving for the last ! time. ! (_Jv_MutexLock): Set owner thread id in the mutex and increment ! refcount. ! (_Jv_ThreadYield): Yield using a call to Sleep(0). ! * win32-threads.cc (_Jv_CondWait): Check if really owner of ! the passed mutex. ! Pass handle of the broadcast event, instead of a pointer to it ! in Win32 ResetEvent( ) call. ! Remove incorrect return values. ! (_Jv_CondDestroy): Close both event handles and delete ! critical section. ! (_Jv_CondNotify): Check if really the owner thread. ! (_Jv_CondNotifyAll): Check if really the owner thread. ! (_Jv_InitThreads): Change daemon_cond to a manual-reset event. ! (really_start): Use SetEvent( ) to signal daemon_cond. ! (_Jv_ThreadWait): Remove SignalObjectAndWait( ) and use ! WaitForSingleObject( ) instead to wait for daemon_cond to be ! signalled. ! ! 2003-01-28 Ranjit Mathew ! ! * configure.in: Specifically define HAVE_BACKTRACE if building ! for MinGW. ! * include/win32.h: Remove HAVE_BACKTRACE definition. ! * gnu/gcj/runtime/natStackTrace.cc: Include platform.h. ! * configure: Rebuilt. 2003-01-27 Alexandre Oliva *************** *** 14,54 **** (toolexecmainlib_DATA): Renamed from toolexeclib_DATA. * Makefile.in, configure: Rebuilt. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-18 Release Manager ! * GCC 3.2.1 Released. ! 2002-10-07 Kaveh R. Ghazi * Makefile.am (all-multi): Fix multilib parallel build. ! 2002-08-14 Release Manager ! * GCC 3.2 Released. ! 2002-07-25 Release Manager ! * GCC 3.1.1 Released. 2002-07-12 Jesse Rosenstock For PR libgcj/7292: * java/lang/Character.java (toString(char)): Now static. 2002-06-23 Tom Tromey * Makefile.in: Rebuilt. * Makefile.am ($(srcdir)/java/lang/Object.h, $(srcdir)/java/lang/Class.h): Added dummy targets. 2002-06-10 Bryce McKinlay * configure.host: Disable hash synchronization and slow_pthread_self --- 1190,5194 ---- (toolexecmainlib_DATA): Renamed from toolexeclib_DATA. * Makefile.in, configure: Rebuilt. ! 2003-01-24 Ranjit Mathew ! Fixes PR java/9253: ! * java/io/natFileWin32.cc (performList): Append only "*.*" ! if the canonical file path already has a "\" at the end. ! 2003-01-24 Tom Tromey ! * java/lang/ClassLoader.java (findLoadedClass): Removed erroneous ! comment. ! 2003-01-22 Andrew Haley ! * x86_64-signal.h: Add simple handler for x86_64 32-bit mode. ! * configure.host (CHECKREFSPEC): Define for x86_64. ! 2003-01-21 Tom Tromey ! ! * java/util/natResourceBundle.cc (getCallingClassLoader): Start ! search at 2, not 3. ! ! 2003-01-21 Vladimir Puskas ! ! * java/io/natFileWin32.cc (isAbsolute): Check path length before ! looking at any characters. ! * java/io/natFilePosix.cc (_stat): Only compute `buf' if it will ! be used. ! (isAbsolute): Check path's length as well. ! ! 2003-01-17 Mark Wielaard ! ! * Makefile.am (core_java_source_files): Add VMObjectStreamClass.java. ! (nat_source_files): Add natVMObjectStreamClass.cc. ! * Makefile.in: Regenerated. ! * gcj/javaprims.h (namespace java): Regenerated. ! * java/io/ObjectStreamClass.java (getClassUID): Call ! VMObjectStreamClass.hasClassInitializer(). ! (hasClassInitializer): Removed. ! * java/io/VMObjectStreamClass.java: New class. ! * java/io/natVMObjectStreamClass.cc: New file. ! * java/lang/Class.h: Make java::io::VMObjectStreamClass friend class. ! ! 2003-01-19 Michael Koch ! ! * java/net/MulticastSocket.java ! (setInterface): Reindented. ! ! 2003-01-16 Mark Wielaard ! ! * java/net/SocketImpl.java (toString): Don't explicitly call ! toString() on possible null address. ! ! 2003-01-15 Scott Gilbertson ! ! * gnu/gcj/xlib/natGC.cc (fillPolygon): New method. ! * gnu/gcj/xlib/GC.java (fillPolygon): Declare. ! * gnu/awt/xlib/XGraphics.java (fillPolygon): Added translateX and ! translateY arguments. Implement. ! * gnu/awt/j2d/IntegerGraphicsState.java (fillPolygon): Pass ! down translation arguments. ! (drawPolyline, drawPolygon): Fix incorrect tests. ! * gnu/awt/j2d/DirectRasterGraphics.java (fillPolygon): Added ! translateX and translateY arguments. ! ! 2003-01-15 Scott Gilbertson ! ! * Makefile.in: Rebuilt. ! * Makefile.am (xlib_includes): New macro. ! (INCLUDES): Use it. ! ! 2003-01-15 Scott Gilbertson ! ! * gnu/awt/xlib/XToolkit.java (getColorModel): Implemented. ! * gnu/awt/xlib/XGraphicsConfiguration.java (getPixel): Work with ! 16-bit display mode. ! ! 2003-01-15 Scott Gilbertson ! ! * java/awt/CardLayout.java (show): Rewrote. ! (gotoComponent): Removed `target' argument. Simplified code. ! Don't pre-compute `choice' unless `what' is FIRST or LAST. ! Changed all callers. ! (NONE): Removed. ! ! 2003-01-14 Michael Koch ! ! * java/net/InetSocketAddress.java ! (serialVersionUID): New member variable. ! * java/net/NetPermission.java ! (NetPermission): Dont implement java.io.Serialization directly. ! * java/net/SocketAddress.java: ! (serialVersionUID): Documentation added. ! ! 2003-01-14 Michael Koch ! ! * java/awt/Label.java ! (Label): Implements javax.accessibility.Accessible; ! * java/awt/List.java ! (List): Implements javax.accessibility.Accessible; ! * java/awt/ScrollPane.java ! (ScrollPane): Implements javax.accessibility.Accessible; ! * java/awt/Scrollbar.java ! (Scrollbar): Implements javax.accessibility.Accessible; ! * java/awt/TextComponent.java ! (setCaretPosition): Throw exception, documentation added. ! * java/awt/Toolkit.java: ! Added some newlines in method documentations. ! (createButton): Exception documentation added. ! (createTextField): Exception documentation added. ! (createLabel): Exception documentation added. ! (createList): Exception documentation added. ! (createCheckbox): Exception documentation added. ! (createScrollbar): Exception documentation added. ! (createScrollPane): Exception documentation added. ! (createTextArea): Exception documentation added. ! (createChoice): Exception documentation added. ! (createFrame): Exception documentation added. ! (createWindow): Exception documentation added. ! (createDialog): Exception documentation added. ! (createMenuBar): Exception documentation added. ! (createMenu): Exception documentation added. ! (createMenuItem): Exception documentation added. ! (createFileDialog): Exception documentation added. ! (createCheckboxMenuItem): Exception documentation added. ! (loadSystemColors): Exception documentation added. ! (setDynamicLayout): Exception documentation added. ! (isDynamicLayoutSet): Exception documentation added. ! (isDynamicLayoutActive): Exception documentation added. ! (getScreenSize): Exception documentation added. ! (getScreenResolution): Exception documentation added. ! (getScreenInsets): Exception documentation added. ! (getColorModel): Exception documentation added. ! (getSystemClipboard): Exception documentation added. ! (getSystemSelection): Exception documentation added. ! (getMenuShortcutKeyMask): Exception documentation added. ! (getSystemEventQueue): Exception documentation added. ! * java/awt/Window.java: ! Reindented some code. ! (Window): Centralized implementation, documentation added. ! (finalize): Documentation added. ! (hide): Fixed typo in comment. ! (getWindowListeners): Documentation added. ! * java/awt/color/ColorSpace.java ! (toRGB): Documentation added. ! * java/awt/color/ICC_ColorSpace.java ! (ICC_ColorSpace): Documentation added. ! (toRGB): Throw exception, documentation added. ! (fromRGB): Throw exception, documentation added. ! (toCIEXYZ): Documentation added. ! (fromCIEXYZ): Documentation added. ! (getMinValue): Documentation added. ! (getMaxValue): Documentation added. ! * java/awt/geom/Dimension2D.java ! (clone): Documentation added. ! * java/awt/geom/GeneralPath.java ! (clone): Documentation added. ! * java/awt/geom/Line2D.java ! (clone): Documentation added. ! * java/awt/geom/QuadCurve2D.java ! (clone): Documentation added. ! * java/awt/image/ColorModel.java ! (ColorModel): Throw exception, documentation added. ! * java/awt/image/ImageFilter.java ! (clone): Doesnt throw CloneNotSupportedException. ! ! 2003-01-14 Andrew Haley ! ! * java/lang/natRuntime.cc (_load): StackTrace access needs to be ! in a try block. ! ! 2003-01-10 Andrew Haley ! ! * include/dwarf2-signal.h: Remove x86_64. ! * configure.host (x86_64 DIVIDESPEC): Remove. ! * include/x86_64-signal.h: New file. ! * configure.in: Regenerate. ! ! 2003-01-10 Michael Koch ! ! * java/net/DatagramSocket.java ! (ch): Description added. ! (remotePort): Initialize with -1. ! (connect): Doesnt throws SocketException. ! * java/net/MulticastSocket.java ! (setInterface): Merge with Classpath. ! * java/net/ServerSocket.java ! (closed): New member variable. ! (bind): Check if socket is closed. ! (close): Close an associated channel too, set new value to closed. ! (isBound): Reindented. ! (isClosed): Implemented. ! * java/net/Socket.java ! (closed): New member variable. ! (bind): Check if socket is closed. ! (connect): Check if socket is closed. ! (close): Close an associated channel too, set new value to closed. ! (isClosed): Implemented. ! ! 2003-01-10 Michael Koch ! ! * java/awt/DisplayMode.java ! (equals): Fixed argument type and implementation. ! ! 2003-01-07 Michael Koch ! ! * java/net/DatagramSocket.java: ! Added classpath license info. ! (DatagramSocket): Merged description with classpath. ! (close): Merged description with classpath. ! (getChannel): Merged description with classpath. ! (getInetAddress): Merged description with classpath. ! (getPort): Merged description with classpath. ! (getLocalAddress): Merged description with classpath. ! (getLocalPort): Merged description with classpath. ! (getSoTimeout): Merged description with classpath. ! (setSoTimeout): Merged description with classpath. ! (getSendBufferSize): Merged description with classpath. ! (setSendBufferSize): Merged description with classpath. ! (getReceiveBufferSize): Merged description with classpath. ! (setReceiveBufferSize): Merged description with classpath. ! ! 2003-01-07 Tom Tromey ! ! * include/posix.h (_Jv_platform_usleep): Wrap in ifdef ! JV_HASH_SYNCHRONIZATION. ! * include/win32.h (_Jv_platform_usleep): Wrap in ifdef ! JV_HASH_SYNCHRONIZATION. ! ! 2003-01-04 Tom Tromey ! ! * java/awt/List.java: Merged with Classpath. ! ! 2003-01-03 Mark Wielaard ! ! * java/io/FileDescriptor.java (position): New private field. ! * java/io/natFileDescriptorPosix.cc (write): Up position. ! (setLength): Use and set position. ! (seek): Set position. ! (getFilePointer): Return position. ! (read): Up position. ! ! 2003-01-03 Mark Wielaard ! ! Merge with Classpath: ! * java/io/ObjectStreamClass.java (lookup): Split method and call ! lookupForClassObject(). ! (lookupForClassObject): New method. ! (isProxyClass): New field. ! (setClass): Set isProxyClass, add object to classLookupTable, set ! superClass and calculateOffsets. ! (ObjectStreamClass): Set isProxyClass. Only set uid when Serializable ! and not a proxy class. ! (setFields): Set accessible true for serialPersistentFields. ! (getClassUID): Same for suid. And check if suid is of type long. ! (hasClassInitializer): Don't throw NoSuchMethodError. ! ! 2003-01-03 Jeff Sturm ! ! * configure.host (sparc*-*): Enable bytecode interpreter. ! ! 2003-01-03 Mark Wielaard ! ! * java/io/FileInputStream.java (finalize): Don't explicitly ! finalize FileDescriptor. ! ! 2003-01-03 Dhek Bhun Kho ! ! * gnu/java/rmi/server/UnicastServerRef.java (unexportObject): ! Don't throw RemoteException. ! * java/rmi/server/UnicastRemoteObject.java (unexportObject): Don't ! throw RemoteException. ! ! 2003-01-03 Joerg Brunsmann ! ! * gnu/gcj/protocol/http/Connection.java (proxyPort, proxyInUse, ! proxyHost): New static fields. ! (): Initialize new fields. ! (connect): Use proxy if necessary. ! (usingProxy): Implement. ! ! 2003-01-03 Eric Blake ! ! * java/util/TreeMap.java (fabricateTree): Fix off-by-one error. ! (TreeIterator.remove): Prefer IllegalStateException over ! ConcurrentModificationException, to match Sun. ! ! 2002-01-02 Anthony Green ! ! * boehm.cc (_Jv_MarkObj): Mark the protectionDomain of a class. ! ! 2003-01-02 Mark Wielaard ! ! * java/net/HttpURLConnection.java (HTTP_NOT_IMPLEMENTED): Must be ! public. ! (HTTP_USE_PROXY): Add field. ! (getResponseVals): Only set responseCode when not yet explicitly ! set by subclass. ! ! 2003-01-02 Artur Biesiadowski ! Mark Wielaard ! ! * java/util/zip/ZipFile.java (entries): Now HashMap. ! (readLeShort(DataInput, byte[])): Read from given byte array. ! (readLeInt(DataInput, byte[]): Likewise. ! (readLeShort(byte[] b, int off)): New method. ! (readLeInt(byte[] b, int off)): Likewise. ! (readEntries): Use byte arrays to read info in bigger chunks. ! (getEntries): Return HashMap. ! (getEntry): Use HashMap. ! (locBuf): New private field. ! (checkLocalHeader): Use locBuf to read info in one chunk. ! (getInputStream): Use entries HashMap, wrap PartialInputStream ! in BufferedInputStream. ! (ZipEntryEnumeration): Use HashMap and Interator. ! ! 2003-01-02 Mark Wielaard ! Jeroen Frijters ! ! * java/net/URLClassLoader.java (Resource.getCodeSource): ! Fix check certs == null. ! (getCanonicalFileURL): Removed method. ! (JarURLLoader): Don't call removed method. ! (FileURLLoader): Likewise. ! (FileURLLoader.getResource): Don't canonicalize file name. ! ! 2003-01-01 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (rmi_java_source_files): Added RMIClassLoaderSpi. ! * java/awt/AlphaComposite.java, java/awt/BasicStroke.java, ! java/awt/BufferCapabilities.java, java/awt/Button.java, ! java/awt/CheckboxMenuItem.java, java/awt/Choice.java, ! java/awt/Container.java, java/awt/Cursor.java, ! java/awt/EventQueue.java, java/awt/FileDialog.java, ! java/awt/Graphics2D.java, java/awt/Label.java, java/awt/Menu.java, ! java/awt/MenuBar.java, java/awt/MenuComponent.java, ! java/awt/PopupMenu.java, java/awt/ScrollPane.java, ! java/awt/Scrollbar.java, java/awt/TextArea.java, ! java/awt/TextField.java, java/awt/color/CMMException.java, ! java/awt/color/ColorSpace.java, java/awt/color/ICC_Profile.java, ! java/awt/color/ProfileDataException.java, ! java/awt/datatransfer/Clipboard.java, ! java/awt/datatransfer/DataFlavor.java, ! java/awt/datatransfer/FlavorMap.java, ! java/awt/datatransfer/SystemFlavorMap.java, ! java/awt/dnd/DragGestureEvent.java, ! java/awt/dnd/DragGestureRecognizer.java, ! java/awt/dnd/DragSource.java, java/awt/dnd/DropTarget.java, ! java/awt/event/WindowEvent.java, java/awt/geom/PathIterator.java, ! java/awt/im/InputMethodHighlight.java, ! java/io/PipedOutputStream.java, java/io/PipedWriter.java, ! java/rmi/server/RMIClassLoader.java: Merged from Classpath. ! ! * gnu/awt/j2d/Graphics2DImpl.java (drawImage): Changed type of ! `op' to BufferedImageOp. ! ! 2002-12-31 Tom Tromey ! ! Fix for PR libgcj/7416: ! * javax/naming/InitialContext.java (init): Use ! gnu.classpath.home.url. ! * java/security/Security.java: Use new properties. ! (loadProviders): Accept base url; use it. ! * java/lang/System.java: Document gnu.classpath.vm.shortname, and ! gnu.classpath.home.url. ! (gnu.classpath.home.url): Define. ! (gnu.classpath.vm.shortname): Likewise. ! ! 2002-12-31 Tom Tromey ! Ranjit Mathew ! ! Fix for PR libgcj/8997: ! * java/lang/natObject.cc (spin): Use _Jv_platform_usleep. ! Include platform.h. ! * include/posix.h (_Jv_platform_usleep): New function. ! * include/win32.h (_Jv_platform_usleep): New function. ! ! 2002-12-30 Tom Tromey ! ! * gcj/javaprims.h: Updated class list. ! ! 2002-12-30 Mark Wielaard ! ! * java/net/URLStreamHandler.java (toExternalForm): Ignore port ! if zero or smaller. ! ! 2002-12-30 Mark Wielaard ! ! * java/util/Properties (formatForOutput): Don't fall through to ! default case after escaping character. ! ! 2002-11-30 Mark Wielaard ! ! * java/lang/StringBuffer.java (getChars): Remove wrong dstOffset check ! against count. ! ! 2002-11-21 Anthony Green ! ! * Makefile.am: Move org.xml.sax and org.w3c.dom into their own ! libraries. ! * Makefile.in: Rebuilt. ! ! 2002-12-19 Anthony Green ! ! * Makefile.am (ordinary_java_source_files): Add ! org/xml/sax/helpers/NewInstance.java. ! * Makefile.in: Rebuilt. ! * org/xml/sax/package.html, org/xml/sax/ext/package.html, ! org/xml/sax/helpers/package.html: New files. ! * org/xml/sax/*: Upgrade to SAX 2.0.1 release from ! http://www.saxproject.org. ! ! 2002-12-19 Andrew Haley ! ! * java/util/natResourceBundle.cc: Include ! ArrayIndexOutOfBoundsException.h. ! (getCallingClassLoader): Don't put upper bound on stack search. ! Catch ArrayIndexOutOfBoundsException. ! ! 2002-12-19 Tom Tromey ! ! * libtool-version: Increased `current'. ! ! 2002-12-19 Tom Tromey ! ! * java/lang/natClassLoader.cc (defineClass0): Removed erroneous ! comment. ! * java/lang/ClassLoader.java (defineClass): Use chained ! exception when rethrowing. ! * defineclass.cc (handleClassBegin): Mark class as interpreted. ! * java/lang/reflect/Modifier.java (INVISIBLE, INTERPRETED): New ! constants. ! * resolve.cc (_Jv_PrepareMissingMethods): New function. ! (_Jv_PrepareClass): Use it. ! * include/java-interp.h (_Jv_IsInterpretedClass): Rewrote. ! (_Jv_InterpClass): _Jv_PrepareMissingMethods now friend. ! * java/lang/Class.h (Class::getModifiers): Mask with ALL_FLAGS. ! (Class): _Jv_PrepareMissingMethods now friend. ! * java/lang/natClassLoader.cc (defineClass0): Use JvSynchronize. ! Record `NULL' for system class loader. ! (_Jv_RegisterInitiatingLoader): Use JvSynchronize. Special case ! system class loader. ! (_Jv_FindClassInCache): Likewise. ! (_Jv_UnregisterClass): Use JvSynchronize. Free old loader info. ! (_Jv_FindClass): Special case system class loader. ! * java/lang/natClass.cc (_Jv_abstractMethodError): New function. ! (_Jv_SetVTableEntries): Put _Jv_abstractMethodError into empty ! vtable slots. ! (_Jv_LayoutVTableMethods): Don't generate vtable slot for a method ! in a final class. ! (_getDeclaredMethod): Don't return synthetic methods. ! (getDeclaredMethods): Likewise. ! (_getMethod): Likewise. ! (_getMethods): Likewise. ! ! 2002-12-18 Raif Naffah ! ! * java/math/BigInteger.java (euclidInv): Make sure quot and rem are in ! canonical form after divide(). ! (modInverse): Likewise. ! ! 2002-12-13 Casey Marshall ! Mark Wielaard ! ! * java/security/SecurityRandom (digest): Removed field. ! (SecureRandom): Check all providers for case-insensitive SecureRandom ! implementation. Don't ignore classname == null. Fallback to SHA1PRNG ! if necessary. ! (getInstance(String,Provider,boolean): New method. ! (getInstance(String)): Use new method. ! (getInstance(String,String)): Likewise. ! (getInstance(String,Provider)): Likewise. ! ! 2002-12-13 Casey Marshall ! ! * java/security/Security.java (loadProviders): Increment i only once. ! ! 2002-12-12 Mark Wielaard ! ! * java/lang/ClassLoader.java (resolveClass0): Transform ! ClassNotFoundException to NoClassDefFoundError. Transform all other ! throwables to LinkageError. ! ! 2002-12-11 Tom Tromey ! ! * java/lang/ClassLoader.java (findLoadedClass): Now synchronized. ! ! * java/lang/ClassLoader.java (loadedClasses): New field. ! (defineClass): Fixed indentation. Put new class in ! loadedClasses. ! (findLoadedClass): Implement here. ! * java/lang/natClassLoader.cc (findLoadedClass): Removed. ! ! 2002-12-10 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (nat_source_files): Added natVMClassLoader.cc. ! * gnu/gcj/runtime/natVMClassLoader.cc: New file. ! (gnu::gcj::runtime::VMClassLoader::findClass): Moved here. ! * java/lang/natClassLoader.cc ! (gnu::gcj::runtime::VMClassLoader::findClass): Removed. ! ! 2002-12-10 Mark Wielaard ! Tom Tromey ! ! * java/net/URLClassLoader.java (getCanonicalFileURL): New method. ! (JarURLLoader): Use it. ! (FileURLLoader): Likewise. ! (JarURLResource.getURL): Use chained exception. ! (FileResource.getURL): Likewise. ! (FileURLLoader.getResource): Use canonical file name. ! (addURL): Indentation fix. ! ! 2002-12-10 Tom Tromey ! ! * include/win32.h: Fixed typo in "DISABLE_JAVA_NET". ! From Laurent Bardet . ! ! 2002-12-09 Tom Tromey ! ! * include/win32.h (_Jv_platform_solib_prefix): New define. ! (_Jv_platform_solib_suffix): Likewise. ! * include/posix.h (_Jv_platform_solib_prefix): New define. ! (_Jv_platform_solib_suffix): Likewise. ! * java/lang/natRuntime.cc: Include StackTrace.h. ! (_load): Use findLibrary and new platform defines. ! (nativeGetLibname): Use new platform defines. ! ! * java/util/natResourceBundle.cc (getCallingClassLoader): Assume ! `t' won't be null. ! ! 2002-12-08 Mark Wielaard ! ! * gnu/gcj/protocol/jar/Connection.java (getJarFile): download and ! cache remote jar files. ! * gnu/gcj/runtime/VMClassLoader.java: Don't construct jar URL, only ! add File.separator to URL when it is a directory. ! * java/lang/ClassLoader.java: Add Classpath javadoc. ! (parent): final. ! (getParent): Add (disabled) security check. ! (findLibrary): New default method. ! * java/net/JarURLConnection.java (getManifest): Implement. ! (getInputStream): Only create InputStream when entry exists. ! (getHeaders): Only use jarFileURLConnection or JarEntry to set length ! when they exist. ! * java/net/URLClassLoader.java: New/Rewritten version from Classpath. ! ! 2002-12-08 Mark Wielaard ! ! * java/util/ResourceBundle.java (resourceBundleCache): Not final. ! (lastDefaultLocale): New field. ! (getBundle): When Locale.getDefault != lastDefaultLocale reset ! resourceBundleCache. ! ! 2002-12-06 Mark Wielaard ! ! * java/net/InetAddress.java (toString): Use hostname when not null, ! don't do an explicit reverse getHostName() lookup. ! * java/net/Socket.java (setSocketImplFactory): When fac == null throw ! NullPointerException. ! ! 2002-12-06 Tom Tromey ! ! * include/java-interp.h (class _Jv_InterpMethod): Added ! JV_MARKOBJ_DECL. ! * boehm.cc (_Jv_MarkObj): Consolidated interpreter code. Also ! mark `prepared' field of interpreted method. ! * interpret.cc (compile): Use _Jv_AllocBytes. ! ! 2002-12-05 Andrew Haley ! ! * gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Throw ! #ifdef (HAVE_BACKTRACE) around the whole function body. ! ! 2002-12-05 Tom Tromey ! ! * java/lang/Class.h (_Jv_SetVTableEntries): Updated declaration. ! * resolve.cc: Don't include AbstractMethodError.h. ! (_Jv_abstractMethodError): Removed. ! * defineclass.cc (handleMethodsBegin): Initialize method index to ! -1. ! * java/lang/natClass.cc (_Jv_LayoutVTableMethods): Don't set ! method index for "new" final method. ! (_Jv_SetVTableEntries): Compare index against -1 instead of using ! isVirtualMethod. Added `flags' argument. ! (_Jv_MakeVTable): Throw exception for abstract method in concrete ! class. ! ! 2002-12-04 Tom Tromey ! ! * java/net/SocketPermission.java (hashCode): Rewrote. ! ! 2002-12-04 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (nat_source_files): Added natVMSecurityManager, ! natResourceBundle. ! * java/util/ResourceBundle.java (Security): Removed. ! (getCallingClassLoader): Now native. ! * java/util/natResourceBundle.cc: New file. ! * java/lang/natVMSecurityManager.cc: New file. ! * java/lang/VMSecurityManager.java (getClassContext): Now native. ! ! 2002-12-03 Mark Wielaard ! ! * java/util/jar/JarFile.java (manifest): Not final. ! (manifestRead): New field. ! (JarFile): Don't read Manifest in constructor. ! (getManifest): New method. ! (JarEnumeration.nextElement): Use new method. ! (getEntry): Likewise. ! * java/util/zip/ZipFile.java (name): Final. ! (raf): Likewsie. ! (entries): Change type to Hashtable. ! (closed): New field. ! (ZipFile): Don't read enties in constructor. ! (readEntries): Use Hashtable. ! (close): Set new close flag and set entries to null inside ! synchronized block. ! (entries): Contruct enumeration using new getEntries() method and ! entries Hashtable. ! (getEntryIndex): Removed. ! (getEntries): New method. ! (getEntry): Use new getEntries() method and entries Hastable. ! (getInputStream): Likewise. ! (size): Return getEntries().size(). ! (ZipEntryEnumeration): Wrap entries Hashtable elements. ! * java/util/zip/ZipEntry.java (cal): Don't initialize. ! (time): Removed ! (dostime): New field. ! (zipFileIndex): Removed. ! (ZipEntry(ZipEntry)): Copy dostime. ! (setDOSTime): Now final and doesn't convert dos time. ! (getDOSTime): Likewise. ! (setTime): Convert dos time. ! (getTime): Likewise. ! (getCalendar): New method. ! (setExtra): Use setTime(). ! * java/util/zip/ZipInputStream.java (getNextEntry): Format error msg. ! ! 2002-12-03 Tom Tromey ! ! * java/lang/Character.java (forDigit): Formatting fix. ! ! 2002-12-03 Raif Naffah ! ! * java/security/spec/DSAParameterSpec.java (getP): Return p, not q. ! * java/security/spec/DSAPrivateKeySpec.java (getP): Likewise. ! * java/security/spec/DSAPublicKeySpec.java (getP): Likewise. ! ! 2002-12-03 Andrew Haley ! ! * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call ! _Jv_PushClass. ! (_Jv_InitNewClassFields): Set protectionDomain and chain = NULL. ! (_Jv_PopClass): New. ! (_Jv_PushClass): New. ! * java/lang/natClass.cc (forName (jstring)): Use a StackTrace to ! discover the ClassLoader of our caller. ! (_Jv_CheckArrayStore): Don't check that a class is assignment ! compatible with Object. ! * java/lang/natVMTHrowable.cc: Delete. ! * gnu/gcj/runtime/StackTrace.java: New, partly copied from ! java.lang.VMThrowable. ! (StackTrace(), StackTrace(int)): New constructors. ! (classAt, methodAt, update, methodAtAddress): New methods. ! (map): New field. ! * java/lang/VMThrowable.java: Use StackTrace instead of ! natVMTHrowable. ! * java/lang/Class.h (getClassLoaderInternal): New. ! (class Class): Be friendly with _Jv_PopClass and _Jv_PushClass. ! Be friendly with gnu::gcj::runtime::StackTrace. ! (Object.chain): New field. ! * include/java-interp.h (class _Jv_InterpMethod): Be friendly with ! gnu::gcj::runtime::StackTrace. ! * gnu/gcj/runtime/natStackTrace.cc: New file. ! * gnu/gcj/runtime/MethodRef.java: New file. ! * prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal() ! instead of getClassLoader(). ! * verify.cc (class _Jv_BytecodeVerifier): Likewise. ! java::lang::VMThrowable. ! * Makefile.am (core_java_source_files): Add MethodRef.java, ! StackTrace.java. ! (nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc. ! * Makefile.in: Rebuild. ! ! 2002-12-02 Tom Tromey ! ! * jni.cc: Added `name' argument. ! * include/jni.h (struct JNINativeInterface) [DefineClass]: Added ! `const char *' argument. ! (class _Jv_JNIEnv) [DefineClass]: Likewise. ! ! 2002-12-01 Tom Tromey ! ! Bug compatibility, for PR libgcj/8738: ! * java/io/CharArrayWriter.java (close): Do nothing. ! (flush): Likewise. ! (reset): Don't touch `closed'. ! (write(int)): Don't throw IOException. ! (write(char[],int,int)): Likewise. ! (write(String,int,int)): Likewise. ! (closed): Removed. ! ! 2002-12-01 Mark Wielaard ! ! * java/lang/SecurityManager.java: Remerge comments, indenting and ! checkXXX methods with Classpath. ! ! 2002-11-29 Scott Gilbertson ! ! * java/awt/image/ColorModel.java (getUnnormalizedComponents, ! getNormalizedComponents): Fix calculation which was using one too ! many bits in the unnormalized format. ! ! 2002-11-29 Gary Benson ! ! For PR libgcj/8759: ! * java/beans/Introspector.java (flushCaches): New method. ! (flushFromCaches): Likewise. ! ! 2002-11-29 Michael Koch ! ! * java/nio/channels/DatagramChannel.java ! (open): Added exception documentation. ! (write): Added exception documentation. ! (connect): Added exception documentation. ! (disconnect): Added exception documentation. ! (isConnected): Added exception documentation. ! (read): Added exception documentation. ! (receive): Added exception documentation. ! (send): Added exception documentation. ! (validOps): Added exception documentation. ! * java/nio/channels/SocketChannel.java ! (open): Added exception documentation. ! (read): Added exception documentation. ! (write): Added exception documentation. ! (connect): Added exception documentation. ! (finishConnect): Added exception documentation. ! ! 2002-11-29 Michael Koch ! ! * gnu/java/nio/DatagramChannelImpl: ! (fd): New member variable to store file descriptor of socket. ! * gnu/java/nio/SelectionKeyImpl.java: ! (ops): Removed. ! (readyOps): New member variable. ! (interestOps): New member variable. ! (readyOps): Implemented. ! (readyOps): New method to set member variable readyOps. ! (interestOps): Replaced ops by interestOps. ! * gnu/java/nio/SelectorImpl.java: ! (SelectorImpl): Initialize key sets. ! (select): Call select with -1 instead of Long.MAX_VALUE). ! (java_do_select): Make it a native method. ! (getFDsAsArray): New helper method. ! (select): Remove canceled keys, give only interested file discriptors ! to java_do_select, set ready ops. ! (add): No need to initialize keys set here. ! (add_selected): No need to initialize selected set here. ! (deregisterCanceledKeys): New helper method. ! (register): Set interest ops, set attachments, added handling of datagram ! channels. ! * gnu/java/nio/ServerSocketChannelImpl: ! (SocketAccept): Renamed from NioSocketAccept. ! (implConfigureBlocking): Implemented. ! (accept): Use SocketAccept instead of NioSocketAccept. ! * gnu/java/nio/SocketChannelImpl: ! Reactivate native methods. ! ! 2002-11-29 Michael Koch ! ! * gnu/java/nio/natByteBufferImpl.cc, ! gnu/java/nio/natCharBufferImpl.cc, ! gnu/java/nio/natDoubleBufferImpl.cc, ! gnu/java/nio/natFloatBufferImpl.cc, ! gnu/java/nio/natIntBufferImpl.cc, ! gnu/java/nio/natLongBufferImpl.cc, ! gnu/java/nio/natSelectorImpl.cc, ! gnu/java/nio/natServerSocketChannelImpl.cc, ! gnu/java/nio/natShortBufferImpl.cc, ! gnu/java/nio/natSocketChannelImpl.cc: ! New files that implement native functionalities. ! ! 2002-11-29 Michael Koch ! ! * gnu/java/nio/ByteBufferImpl.java ! (ByteBufferImpl): Moved position() after limit. ! (nio_*): Use native implementation. ! * gnu/java/nio/CharBufferImpl.java: ! Reformated. ! (endian): New member variable string endianess of buffer. ! (CharBufferImpl): Moved position() after limit. ! (nio_*): Use native implementation. ! (subSequence): Implemented. ! * gnu/java/nio/DoubleBufferImpl.java ! (DoubleBufferImpl): Moved position() after limit. ! (nio_*): Use native implementation. ! * gnu/java/nio/FloatBufferImpl.java ! Reformated. ! (FloatBufferImpl): Moved position() after limit. ! (nio_*): Use native implementation. ! * gnu/java/nio/IntBufferImpl.java ! Added needed imports, Reformated. ! (IntBufferImpl): Moved position() after limit. ! (nio_*): Use native implementation. ! * gnu/java/nio/LongBufferImpl.java ! Reformated. ! (LongBufferImpl): Moved position() after limit. ! (nio_*): Use native implementation. ! * gnu/java/nio/ShortBufferImpl.java ! Reformated. ! (ShortBufferImpl): Moved position() after limit. ! (nio_*): Use native implementation. ! ! 2002-11-27 Julian Dolby ! ! * java/util/Locale.java (toString): Improve efficiency if country ! and variant are both empty. ! ! 2002-11-26 Tom Tromey ! ! * verify.cc (pop_init_ref): New method. ! (verify_instructions_0) [op_iaload, op_laload, op_faload, ! op_daload, op_aaload, op_baload, op_caload, op_saload, op_iastore, ! op_lastore, op_fastore, op_dastore, op_aastore, op_bastore, ! op_castore, op_sastore, op_areturn, op_arraylength, op_checkcast, ! op_instanceof, op_monitorenter, op_monitorexit]: Use it. ! (verify_instructions_0) [op_invokevirtual, op_invokespecial, ! op_invokestatic, op_invokeinterface]: Use pop_init_ref. Don't ! let `this' argument be uninitialized. Don't let `null' be passed ! as `this' to construtor. ! ! 2002-11-26 Mark Wielaard ! ! * javax/transaction/HeuristicCommitException.java: Classpath merge. ! * javax/transaction/HeuristicMixedException.java: Likewise. ! * javax/transaction/HeuristicRollbackException.java: Likewise. ! * javax/transaction/InvalidTransactionException.java: Likewise. ! * javax/transaction/NotSupportedException.java: Likewise. ! * javax/transaction/RollbackException.java: Likewise. ! * javax/transaction/Status.java: Likewise. ! * javax/transaction/Synchronization.java: Likewise. ! * javax/transaction/SystemException.java: Likewise. ! * javax/transaction/Transaction.java: Likewise. ! * javax/transaction/TransactionManager.java: Likewise. ! * javax/transaction/TransactionRequiredException.java: Likewise. ! * javax/transaction/TransactionRolledbackException.java: Likewise. ! * javax/transaction/UserTransaction.java: Likewise. ! * javax/transaction/xa/XAException.java: Likewise. ! * javax/transaction/xa/XAResource.java: Likewise. ! * javax/transaction/xa/Xid.java: Likewise. ! ! 2002-11-26 Andreas Tobler ! ! * java/net/natPlainDatagramSocketImpl.cc (socklen_t): Don't ! define. ! * java/net/natPlainSocketImpl.cc (socklen_t): Don't define. ! * include/posix.h (socklen_t): Define if not already defined. ! ! 2002-11-25 Tom Tromey ! ! * verify.cc (type::compatible): Backed out broken change. ! ! * verify.cc (type::compatible): Check initialization status ! first. ! * interpret.cc (run) [insn_invokespecial, invokespecial_resolved]: ! Don't use NULLCHECK. ! ! 2002-11-23 Mark Wielaard ! ! * javax/naming/AuthenticationException.java: Update copyright header. ! * javax/naming/AuthenticationNotSupportedException.java: Likewise. ! * javax/naming/Binding.java: Likewise. ! * javax/naming/CannotProceedException.java: Likewise. ! * javax/naming/CommunicationException.java: Likewise. ! * javax/naming/CompositeName.java: Likewise. ! * javax/naming/CompoundName.java: Likewise. ! * javax/naming/ConfigurationException.java: Likewise. ! * javax/naming/Context.java: Likewise. ! * javax/naming/ContextNotEmptyException.java: Likewise. ! * javax/naming/InitialContext.java: Likewise. ! * javax/naming/InsufficientResourcesException.java: Likewise. ! * javax/naming/InterruptedNamingException.java: Likewise. ! * javax/naming/LimitExceededException.java: Likewise. ! * javax/naming/LinkException.java: Likewise. ! * javax/naming/LinkLoopException.java: Likewise. ! * javax/naming/LinkRef.java: Likewise. ! * javax/naming/MalformedLinkException.java: Likewise. ! * javax/naming/NameAlreadyBoundException.java: Likewise. ! * javax/naming/NameClassPair.java: Likewise. ! * javax/naming/NameNotFoundException.java: Likewise. ! * javax/naming/NameParser.java: Likewise. ! * javax/naming/NamingEnumeration.java: Likewise. ! * javax/naming/NamingSecurityException.java: Likewise. ! * javax/naming/NoInitialContextException.java: Likewise. ! * javax/naming/NoPermissionException.java: Likewise. ! * javax/naming/NotContextException.java: Likewise. ! * javax/naming/OperationNotSupportedException.java: Likewise. ! * javax/naming/PartialResultException.java: Likewise. ! * javax/naming/Reference.java: Likewise. ! * javax/naming/Referenceable.java: Likewise. ! * javax/naming/ReferralException.java: Likewise. ! * javax/naming/ServiceUnavailableException.java: Likewise. ! * javax/naming/SizeLimitExceededException.java: Likewise. ! * javax/naming/TimeLimitExceededException.java: Likewise. ! * javax/naming/directory/Attribute.java: Likewise. ! * javax/naming/directory/AttributeInUseException.java: Likewise. ! * javax/naming/directory/AttributeModificationException.java: Likewise. ! * javax/naming/directory/Attributes.java: Likewise. ! * javax/naming/directory/BasicAttribute.java: Likewise. ! * javax/naming/directory/BasicAttributes.java: Likewise. ! * javax/naming/directory/DirContext.java: Likewise. ! * javax/naming/directory/InitialDirContext.java: Likewise. ! * javax/naming/directory/InvalidAttributeIdentifierException.java: ! Likewise. ! * javax/naming/directory/InvalidAttributeValueException.java: Likewise. ! * javax/naming/directory/InvalidAttributesException.java: Likewise. ! * javax/naming/directory/InvalidSearchControlsException.java: Likewise. ! * javax/naming/directory/InvalidSearchFilterException.java: Likewise. ! * javax/naming/directory/ModificationItem.java: Likewise. ! * javax/naming/directory/NoSuchAttributeException.java: Likewise. ! * javax/naming/directory/SchemaViolationException.java: Likewise. ! * javax/naming/directory/SearchControls.java: Likewise. ! * javax/naming/directory/SearchResult.java: Likewise. ! * javax/naming/event/EventContext.java: Likewise. ! * javax/naming/event/EventDirContext.java: Likewise. ! * javax/naming/event/NamespaceChangeListener.java: Likewise. ! * javax/naming/event/NamingEvent.java: Likewise. ! * javax/naming/event/NamingExceptionEvent.java: Likewise. ! * javax/naming/event/NamingListener.java: Likewise. ! * javax/naming/event/ObjectChangeListener.java: Likewise. ! * javax/naming/ldap/Control.java: Likewise. ! * javax/naming/ldap/ControlFactory.java: Likewise. ! * javax/naming/ldap/ExtendedRequest.java: Likewise. ! * javax/naming/ldap/ExtendedResponse.java: Likewise. ! * javax/naming/ldap/HasControls.java: Likewise. ! * javax/naming/ldap/InitialLdapContext.java: Likewise. ! * javax/naming/ldap/LdapContext.java: Likewise. ! * javax/naming/ldap/LdapReferralException.java: Likewise. ! * javax/naming/ldap/UnsolicitedNotification.java: Likewise. ! * javax/naming/ldap/UnsolicitedNotificationEvent.java: Likewise. ! * javax/naming/ldap/UnsolicitedNotificationListener.java: Likewise. ! * javax/naming/spi/DirObjectFactory.java: Likewise. ! * javax/naming/spi/DirStateFactory.java: Likewise. ! * javax/naming/spi/DirectoryManager.java: Likewise. ! * javax/naming/spi/InitialContextFactory.java: Likewise. ! * javax/naming/spi/InitialContextFactoryBuilder.java: Likewise. ! * javax/naming/spi/NamingManager.java: Likewise. ! * javax/naming/spi/ObjectFactory.java: Likewise. ! * javax/naming/spi/ObjectFactoryBuilder.java: Likewise. ! * javax/naming/spi/ResolveResult.java: Likewise. ! * javax/naming/spi/Resolver.java: Likewise. ! * javax/naming/spi/StateFactory.java: Likewise. ! ! * javax/naming/spi/NamingManager.java (ofb): Package private. ! ! 2002-11-21 Mark Wielaard ! ! * java/net/URL.java: Merge with Classpath (partly). ! * java/net/URLStreamHandler: Merge with Classpath. ! ! 2002-11-22 Michael Koch ! ! * include/posix.h: ! (_Jv_platform_on_close): Moved out of #ifndef DISBALE_JAVA_NET. ! * include/win32.h: ! (_Jv_platform_on_close): Moved out of #ifndef DISBALE_JAVA_NET. ! (backtrace): Moved out of #ifndef DISBALE_JAVA_NET. ! ! 2002-11-21 Michael Koch ! ! * include/posix.h: I put too much into the #ifndef DISABLE_JAVA_NET. ! Only the new network functions should be in it. ! ! 2002-11-21 Michael Koch ! ! * include/posix.h: Moved new functions into a #ifndef DISABLE_JAVA_NET ! * include/win32.h: Moved new functions into a #ifndef DISABLE_JAVA_NET ! ! 2002-11-21 Michael Koch ! ! * java/nio/channels/AsynchronousCloseException.java, ! java/nio/channels/CancelledKeyException.java, ! java/nio/channels/ClosedByInterruptException.java, ! java/nio/channels/ConnectionPendingException.java, ! java/nio/channels/FileLockInterruptionException.java, ! java/nio/channels/IllegalSelectorException.java, ! java/nio/channels/NoConnectionPendingException.java, ! java/nio/channels/NonReadableChannelException.java, ! java/nio/channels/NonWritableChannelException.java, ! java/nio/channels/NotYetBoundException.java, ! java/nio/channels/NotYetConnectedException.java, ! java/nio/channels/OverlappingFileLockException.java, ! java/nio/channels/UnresolvedAddressException.java, ! java/nio/channels/UnsupportedAddressTypeException.java: ! New files. ! * Makefile.am (ordinary_java_source_files): Added new files. ! * Makefile.in: Regenerated. ! ! 2002-11-21 Michael Koch ! ! * include/posix.h ! (_Jv_socket): New method. ! (_Jv_connect): New method. ! (_Jv_close): New method. ! (_Jv_platform_close_on_exec): Prefixed system function with "::". ! (_Jv_bind): New method. ! (_Jv_listen): New method. ! (_Jv_write): New method. ! (_Jv_read): New method. ! * include/win32.h ! (_Jv_socket): New method. ! (_Jv_connect): New method. ! (_Jv_close): New method. ! (_Jv_bind): New method. ! (_Jv_listen): New method. ! (_Jv_write): New method. ! (_Jv_read): New method. ! * java/net/natNetworkInterface.cc: ! Include platform.h, removed inclusion of socket.h ! (getRealNetworkInterfaces): Replaced ::socket() by _Jv_socket() and ! ::close() by _Jv_close(). ! * java/net/natPlainDatagramSocketImpl.cc: ! Removed include of socket.h, definition of NATIVE_CLOSE and _Jv_bind, ! added some new lines to make code more readable. ! (create): Replaced ::socket() by _Jv_socket(). ! (close): Replaced NATIVE_CLOSE() by _Jv_close(). ! * java/net/natPlainSocketImpl.cc: ! Removed definition of NATIVE_CLOSE, _Jv_bind, Jv_connect and _Jv_accept, ! removed include of socket.h, removed some windows defines ! (now in include/win32.h). ! (create): Replaced ::socket() by _Jv_socket(). ! (close): Replaced NATIVE_CLOSE() by _Jv_close(). ! (write): Replaced ::read by _Jv_write(). ! (read): Replaced ::read by _Jv_read(). ! ! 2002-11-20 Michael Koch ! ! * Makefile.am (ordinary_java_source_files): ! Added java/nio/channels/FileChannel.java. ! * Makefile.in: Regenerated. ! ! 2002-11-20 Michael Koch ! ! * java/io/FileInputStream.java ! (getChannel): New method. ! * java/io/FileOutputStream.java ! (getChannel): New method. ! * java/net/ServerSocket.java ! (bind): Removed duplicate code and called another bind method instead. ! * java/nio/channels/SelectionKey.java ! (isValid): Removed wrong exception documentation. ! * java/nio/channels/ServerSocketChannel.java ! (accept): Added exception documentation. ! (open): Fixed typo, added exception documentation. ! * java/nio/channels/spi/AbstractSelectableChannel.java ! (implCloseChannel): Added exception documentation. ! (add): Reformated. ! (register): Added exception documentation. ! ! 2002-11-20 Andreas Jaeger ! ! * configure: Regenerated with new libtool.m4. ! ! 2002-11-19 Tom Tromey ! ! * java/lang/ref/natReference.cc (add_to_hash): Look at `copy', not ! `referent'. ! (finalize_referred_to_object): Don't modify `referent' or `copy' ! fields. ! (add_to_hash): Correctly set `n->next' when updating list. ! * java/lang/ref/Reference.java (enqueue): Return false if already ! enqueued. ! ! 2002-11-19 Ranjit Mathew ! ! * include/jni.h: Add missing JNICALL and JNIEXPORT attributes ! to function and function pointer declarations in accordance with ! Sun's JDKs. Define JNIIMPEXP to either JNIEXPORT or JNIIMPORT ! based on whether __GCJ_JNI_IMPL__ has been defined or not. ! * jni.cc: Add missing JNICALL and JNIEXPORT attributes to ! JNI function definitions. ! ! 2002-11-18 Jesse Rosenstock ! ! * java/nio/charset/CoderResult.java (Cache.get): Fix a bug ! that was causing CoderResults to be cached, not WeakReferences ! to CoderResults. ! ! 2002-11-18 Joerg Brunsmann ! ! * java/security/KeyStore.java (getInstance): Fix ! comment and throw IllegalArgumentException if ! given provider is null. ! (getInstance): New method for jdk1.4 compatibility. ! ! 2002-11-18 Michael Koch ! ! * java/net/PlainSocketImpl.java: Fix imports. ! ! 2002-11-18 Michael Koch ! ! * java/nio/channels/SelectionKey.java ! (isValid): Added exception documentation. ! * java/nio/channels/Selector.java ! (open): Declare "throws IOException". ! ! 2002-11-18 Jesse Rosenstock ! ! * java/nio/charset/Charset.java ! (): New method. ! (encode): Synchronize use of cached encoder object. ! (decode): Synchronize use of cached encoder object. ! ! 2002-11-18 Michael Koch ! ! * gnu/java/nio/ByteBufferImpl.java, ! gnu/java/nio/CharBufferImpl.java, ! gnu/java/nio/DatagramChannelImpl.java, ! gnu/java/nio/DoubleBufferImpl.java, ! gnu/java/nio/FileChannelImpl.java, ! gnu/java/nio/FloatBufferImpl.java, ! gnu/java/nio/IntBufferImpl.java, ! gnu/java/nio/LongBufferImpl.java, ! gnu/java/nio/PipeImpl.java, ! gnu/java/nio/SelectionKeyImpl.java, ! gnu/java/nio/SelectorImpl.java, ! gnu/java/nio/SelectorProviderImpl.java, ! gnu/java/nio/ServerSocketChannelImpl.java, ! gnu/java/nio/ShortBufferImpl.java, ! gnu/java/nio/SocketChannelImpl.java, ! java/nio/DoubleBuffer.java, ! java/nio/FloatBuffer.java, ! java/nio/IntBuffer.java, ! java/nio/LongBuffer.java, ! java/nio/ShortBuffer.java, ! java/nio/channels/FileChannel.java: New files. ! ! 2002-11-18 Michael Koch ! ! * Makefile.am (ordinary_java_source_files): ! Added java/nio/ReadOnlyBufferException.java and ! java/nio/channels/ClosedSelectorException.java. ! * Makefile.in: Regenerated. ! ! 2002-11-18 Michael Koch ! ! * java/net/PlainSocketImpl.java: Reworked imports. ! * java/net/ServerSocket.java ! (ServerSocket): Create socket. ! * java/net/SocketAddress.java: Documentation added. ! * java/net/natPlainSocketImpl.cc: Reindented. ! * java/nio/ReadOnlyBufferException.java: New file ! * java/nio/channels/ClosedChannelException.java: Documentation added. ! * java/nio/channels/ClosedSelectorException.java: New file. ! ! 2002-11-17 Mark Wielaard ! ! * java/net/HttpURLConnection.java ((getPermission): Take port ! into consideration. ! (getErrorStream): Implement. ! ! 2002-11-17 Mark Wielaard ! ! * java/net/HttpURLConnection.java: Merge with GNU Classpath. ! ! 2002-11-16 Mark Wielaard ! ! Integrate work by Raif S. Naffah (raif@fl.net.au) ! * java/security/DummyKeyPairGenerator.java (clone): New method. ! * java/security/DummyMessageDigest.java (clone): New method. ! (engineUpdate): Now public. ! (engineReset): Likewise. ! (engineDigest): Likewise. ! (engineGetDigestLength): New method. ! * java/security/DummySignature.java (clone): New method. ! * java/security/KeyPairGenerator.java (provider): Now package private. ! (getInstance(String)): Use getInstance(String,Provider). ! (getInstance(String,String): Use getInstance(String,Provider) ! (getInstance(String,Provider): New method. ! (getInstance(String,String,Provider): Don't cast DummyKeyPairGenerator. ! * java/security/KeyPairGeneratorSpi.java (clone): New method. ! * java/security/MessageDigest.java (provider): Now package private. ! (getInstance(String): Use getInstance(String,Provider). ! (getInstance(String,String): Use getInstance(String,Provider) ! (getInstance(String,Provider): New method. ! * java/security/Provider.java (toCanonicalKey): New method. ! (get): New method that uses toCanonicalKey(). ! (put): Use toCanonicalKey(). ! (remove): Likewise. ! * java/security/Security.java (insertProviderAt): Provider index is one ! based, not zero based. ! (addProvider): Likewise. ! (removeProvider): Likewise. ! * java/security/Signature.java (provider): Now package private. ! (getInstance(String)): Use getInstance(String,Provider). ! (getInstance(String,String): Use getInstance(String,Provider) ! (getInstance(String,Provider): New method. ! (getInstance(String,String,Provider): Don't cast DummySignature. ! ! 2002-11-15 Tom Tromey ! ! For PR libgcj/8593: ! * java/util/zip/GZIPInputStream.java (read): Check file size. ! Look in inflater for remaining input bytes. ! (read4): Added buf and offset arguments. ! ! 2002-11-12 Eric Blake ! ! * java/applet/AppletContext.java: Fix typo and remove redundant ! modifiers. ! ! 2002-11-14 Tom Tromey ! ! * java/lang/natRuntime.cc (insertSystemProperties): Set ! gnu.classpath.home. ! ! 2002-11-13 Michael Koch ! ! * java/nio/ByteBuffer.java ! (allocate): New method. ! (wrap): New method. ! (put): New method. ! (get): New method. ! ! 2002-11-13 Michael Koch ! ! * java/nio/channels/AlreadyConnectedException.java: ! Removed unneeded import. ! (AlreadyConnectedException): Documentation added. ! * java/nio/channels/Pipe.java ! (SinkChannel.SinkChannel): Documentation added. ! (SinkChannel.validOps): New method. ! (SourceChannel.SourceChannel): Documentation added. ! (SourceChannel.validOps): New method. ! (Pipe): Documentation added. ! (open): Documentation added. ! (SinkChannel.channel): Documentation added. ! (SourceChannel.channel): Documentation added. ! * java/nio/channel/SelectableChannel.java ! (SelectableChannel): Documentation added. ! (blockingLock): Documentation added. ! (configureBlocking):Documentation added. ! (isBlocking):Documentation added. ! (isRegistered):Documentation added. ! (keyFor):Documentation added. ! (provider):Documentation added. ! (register): Documentation added. ! (validOps): Documentation added. ! * jaba/nio/channels/SelectionKey.java ! (SelectionKey): Documentation added. ! (attach): Documentation added. ! (attachment): Documentation added. ! (isAcceptable): Documentation added. ! (isConnetable): Documentation added. ! (isReadable): Documentation added. ! (isWritable): Documentation added. ! (cancel): Documentation added. ! (channel): Documentation added. ! (interestOps): Documentation added. ! (isValid): Documentation added. ! (readyOps): Documentation added. ! (selector): Documentation added. ! * jaba/nio/channels/Selector.java ! (Selector): Documentation added. ! (open): Documentation added. ! (close): Documentation added. ! (isOpen): Documentation added. ! (keys): Documentation added. ! (provider): Documentation added. ! (select): Documentation added. ! (selectedKeys): Documentation added. ! (selectNow): Documentation added. ! (wakeup): Documentation added. ! * java/nio/channels/spi/AbstractInterruptibleChannel.java ! (AbstractInterruptibleChannel): Documentation added. ! (opened): Default to true; ! (begin): Documentation added. ! (close): Set opened to false, documentation added. ! (isOpen): Documentation added. ! * java/nio/channels/spi/AbstractSelectionKey.java ! (AbstractSelectionKey): Documentation added. ! (cancel): Documentation added. ! (isValid): Documentation added. ! * java/nio/channels/spi/AbstractSelector.java ! (AbstractSelector): Documentation added. ! (begin): Documentation added. ! (close): Documentation added. ! (isOpen): Documentation added. ! (deregister): Documentation added. ! (end): Documentation added. ! (provider): Documentation added. ! (implCloseSelector): Documentation added. ! (register): Documentation added. ! * java/nio/channels/spi/SelectorProvider.java ! (SelectorProvider): Documentation added. ! (openDatagramChannel): Documentation added. ! (openPipe): Documentation added. ! (openSelector): Documentation added. ! (openServerSocketChannel): Documentation added. ! (openSocketChannel): Documentation added. ! (provider): Documentation added. ! ! 2002-11-12 Michael Koch ! ! * java/nio/Buffer.java: Implemented. ! * java/nio/CharBuffer.java: New file. ! * java/nio/InvalidMarkException.java: New file. ! * java/nio/channels/DatagramChannel.java: Implemented. ! * java/nio/channels/ServerSocketChannel.java: Implemented. ! * java/nio/channels/SocketChannel.java: Implemented. ! * java/nio/channels/spi/AbstractChannel.java: Removed. ! * java/nio/channels/spi/AbstractSelectableChannel.java: ! Implemented. ! * java/nio/charset/Charset.java: ! Merge from Classpath. ! * java/nio/charset/CharsetDecoder.java: New file. ! * java/nio/charset/CharsetEncoder.java: New file. ! * java/nio/charset/CoderResult.java: New file. ! * Makefile.am (ordinary_java_source_files): Added new files. ! * Makefile.in: Regenerated. ! ! 2002-11-11 Jesse Rosenstock ! ! * gnu/java/nio/charset/ISO_8859_1.java, ! gnu/java/nio/charset/Provider.java, ! gnu/java/nio/charset/US_ASCII.java, ! gnu/java/nio/charset/UTF_16.java, ! gnu/java/nio/charset/UTF_16BE.java, ! gnu/java/nio/charset/UTF_16Decoder.java, ! gnu/java/nio/charset/UTF_16Encoder.java, ! gnu/java/nio/charset/UTF_16LE.java, ! gnu/java/nio/charset/UTF_8.java: New files. ! ! 2002-11-11 Michael Koch ! ! * java/nio/charset/CharacterCodingException.java: ! This class must be public. ! * java/nio/charset/CoderMalfunctionError.java: ! This class must be public. ! * java/nio/charset/CodingErrorAction.java: ! This class must be public. ! * java/nio/charset/IllegalCharsetNameException.java: ! This class must be public, better implementation. ! * java/nio/charset/MalformedInputException.java: ! This class must be public, better implementation. ! * java/nio/charset/UnmappableCharacterException.java: ! This class must be public, better implementation. ! * java/nio/charset/UnsupportedCharsetException.java: ! This class must be public, better implementation. ! ! 2002-11-11 Michael Koch ! ! * java/nio/BufferOverflowException.java, ! java/nio/BufferUnderflowException.java: New file. ! * Makefile.am (ordinary_java_source_files): ! Added new files. ! * Makefile.in: Regenerated. ! ! 2002-11-10 Tom Tromey ! ! * java/awt/Container.java (validate): Use tree lock. ! (getComponent): Likewise. ! (getComponents): Likewise. ! (addImpl): Likewise. ! (remove): Likewise. ! (removeAll): Likewise. ! (processEvent): Fixed indentation. ! (getComponentAt): Use tree lock. ! (findComponentAt): Likewise. ! (removeNotify): Likewise. ! (isAncestorOf): Likewise. ! (list): Likewise. ! (visitChildren): Likewise. ! (findNextFocusComponent): Likewise. ! (addNotifyContainerChildren): Likewise. ! (getAccessibleChildrenCount): Likewise. ! (getAccessibleChild): Likewise. ! ! * java/awt/GridLayout.java (layoutContainer): Use tree lock. ! (getSize): Likewise. ! * java/awt/FlowLayout.java (layoutContainer): Use tree lock. ! (getSize): Likewise. ! * java/awt/BorderLayout.java (layoutContainer): Use tree lock. ! (calcSize): Likewise. ! * java/awt/CardLayout.java (getSize): Use tree lock. ! (gotoComponent): Likewise. ! (layoutContainer): Likewise. ! ! * java/io/natFileDescriptorWin32.cc (read): Handle case where ! count is 0. ! * java/io/natFileDescriptorPosix.cc (read): Handle case where ! count is 0. ! ! * java/io/Externalizable.java, java/io/FilePermission.java, ! java/io/ObjectStreamConstants.java, java/io/Serializable.java, ! java/io/SerializablePermission.java, java/text/Format.java, ! java/util/AbstractMap.java, java/util/HashMap.java, ! java/util/LinkedHashMap.java, javax/naming/BinaryRefAddr.java: New ! versions from Classpath. ! ! 2002-11-10 Anthony Green ! ! * java/util/jar/Attributes.java (Name): Fix name check. ! ! 2002-11-10 Mark Wielaard ! ! * java/lang/natClass.cc (initializeClass): Throw NoClassDefFoundError ! with getName() as message. ! (_Jv_CheckArrayStore): Throw ArrayStoreException with object and array ! type as message. ! ! * java/lang/natVMThrowable.cc: Don't declare parameter t, it is ! unused. ! ! 2002-11-08 Ranjit Mathew ! ! * include/jni.h (JNIIMPORT, JNIEXPORT, JNICALL): Linker defines ! for Win32. JNICALL has been defined to __stdcall to be compatible ! with Sun's JDKs. ! ! 2002-11-10 Tom Tromey ! ! * java/awt/GridLayout.java (setColumns): Check newCols, not cols. ! (setRows): Check newRows, not rows. ! ! * jni.cc (_Jv_GetJNIEnvNewFrame): Set env->ex in all cases. ! ! 2002-11-09 Tom Tromey ! ! * java/applet/Applet.java, java/applet/AppletContext.java, ! java/applet/AppletStub.java, java/applet/AudioClip.java, ! java/awt/CardLayout.java, ! java/awt/ContainerOrderFocusTraversalPolicy.java, ! java/awt/Cursor.java, java/awt/Event.java, java/awt/Frame.java, ! java/awt/GridBagConstraints.java, java/awt/GridBagLayout.java, ! java/awt/GridLayout.java, java/awt/color/ColorSpace.java, ! java/awt/color/ICC_ColorSpace.java, ! java/awt/color/ICC_Profile.java, ! java/awt/color/ICC_ProfileGray.java, ! java/awt/color/ICC_ProfileRGB.java, ! java/awt/datatransfer/DataFlavor.java, ! java/awt/dnd/DragSourceContext.java, java/awt/dnd/DropTarget.java, ! java/awt/dnd/DropTargetContext.java, java/awt/event/KeyEvent.java: ! New versions from Classpath. ! * Makefile.in: Rebuilt. ! * Makefile.am (awt_java_source_files): Added ICC_ProfileGray and ! ICC_ProfileRGB. ! ! * java/awt/ScrollPane.java (ScrollPane): Fixed test for valid ! display policy. ! ! * java/awt/List.java (processEvent): Added missing `else's. ! ! * java/awt/Window.java (show): validate() before showing. Make ! parent displayable. ! (isDisplayable): New method. ! ! 2002-11-07 Mark Wielaard ! ! Merge Orp RMI patches from Wu Gansha ! * java/rmi/MarshalledObject.java (equals): Check hashcode first. ! ! * java/rmi/server/RMIClassLoader.java (MyClassLoader): Create/Use ! annotation. ! (loadClass): Take String as codebases. ! (getClassAnnotation): Use MyClassLoader annotations. ! * java/rmi/server/UnicastRemoteObject.java (UnicastRemoteObject): ! call exportObject(this). ! ! * gnu/java/rmi/RMIMarshalledObjectOutputStream.java ! (RMIMarshalledObjectOutputStream): set locBytesStream and locStream. ! (setAnnotation): Don't set locBytesStream and locStream. ! (replaceObject): Removed. ! (flush): Don't test locStream. ! (getLocBytes): LikeWise. ! * gnu/java/rmi/dgc/DGCImpl.java: extends UnicastServerRef. ! (leaseCache): New field. ! (dirty): Use leaseCache. ! (LeaseRecord): New inner class. ! * gnu/java/rmi/registry/RegistryImpl.java (RegistryImpl): Don't ! explicitly call exportObject(). ! * gnu/java/rmi/registry/RegistryImpl_Stub.java: set useNewInvoke to ! false to communicate with Sun JDK130. ! * gnu/java/rmi/server/ConnectionRunnerPool.java: Add CPU comment. ! * gnu/java/rmi/server/RMIObjectInputStream.java ! (UnicastConnectionManager): Removed field. ! * gnu/java/rmi/server/RMIObjectOutputStream.java (replaceObject): ! Use UnicastServer.getExportedRef(). ! * gnu/java/rmi/server/UnicastConnection.java (reviveTime): New field. ! (expireTime): Likewise. ! (CONNECTION_TIMEOUT): Likewise. ! (disconnect): Call sock.close(). ! (isExpired): New method. ! (resetTime): Likewise. ! (run): Use do while loop and catch Exception for discardConnection(). ! * gnu/java/rmi/server/UnicastConnectionManager.java: Pool connections. ! * gnu/java/rmi/server/UnicastRef.java: Lots of changes. ! * gnu/java/rmi/server/UnicastRemoteCall.java: Lots of changes. ! * gnu/java/rmi/server/UnicastServer.java (refcache): New field. ! (exportObject): Use refcache. ! (unexportObject): Likewise. ! (getExportedRef): New method. ! * gnu/java/rmi/server/UnicastServerRef.java (UnicastServerRef): New ! constructor. ! (exportObject): Save manager.serverobj. ! (getStub): New method. ! ! 2002-11-07 Mark Wielaard ! ! * java/lang/reflect/natField.cc (getBoolean): Use getType(). ! (getByte): Likewise. ! (getShort): Likewise. ! (getInt): Likewise. ! (getLong): Likewise. ! (getFloat): Likewise. ! (getDouble): Likewise. ! (get): Likewise. ! (setChar): Likewise. ! (setByte): Likewise. ! (setShort): Likewise. ! (setInt): Likewise. ! (setLong): Likewise. ! (setFloat): Likewise. ! (setDouble): Likewise. ! ! 2002-11-07 Michael Koch ! ! * java/awt/Choice.java, ! java/awt/Container.java, ! java/awt/GridBagLayout.java: ! Fixed documentation. ! * java/awt/peer/ContainerPeer.java: ! Reindented. ! ! 2002-11-07 Michael Koch ! ! * java/awt/color/ICC_Profile.java: ! Added missing constants. ! * java/awt/color/ICC_ColorSpace.java ! (getMinValue): Added dummy implementation. ! (getMaxValue): Added dummy implementation. ! * java/awt/datatransfer/DataFlavor.java ! (imageFlavor): Added. ! (isMimeTypeEqual): Must be final. ! (getDefaultRepresentationClass): Must be non-static. ! (getDefaultRepresentationClassAsString): Must be non-static. ! * java/awt/dnd/DragSourceContext.java ! (dragExit): Corrected argument. ! (dragDropEnd): Corrected argument. ! * java/awt/dnd/DragSourceListener.java.java ! (dragExit): Corrected argument. ! (dragDropEnd): Corrected argument. ! * java/awt/font/TextHitInfo.java ! (toString): Added stubbed implementation. ! * java/awt/geom/PathIterator.java: ! The constants must be static. ! * java/awt/image/VolatileImage.java ! (IMAGE_INCOMPATIBLE): Fixed typo. ! * java/awt/image/renderable/RenderableImage.java ! (HINTS_OBSERVED): Must be static. ! * java/beans/BeanInfo.java: ! Constants must be final. ! ! 2002-11-06 Tom Tromey ! ! From svens@it.uu.se. For PR libgcj/8481. ! * java/util/Random.java (nextInt(int)): Only use 31 bits. ! ! 2002-11-06 Tom Tromey ! ! * jni.cc (array_from_valist): Assume that jlong won't be ! promoted. ! ! 2002-11-04 R. A. Rivas Diaz ! ! * gnu/java/security/provider/SHA.java (engineGetDigestLength): ! Return 20. ! * gnu/java/security/provider/MD5.java (engineGetDigestLength): ! Return 16. ! ! 2002-11-03 Tom Tromey ! ! * java/lang/ClassLoader.java (loadClass): Call loadClass on ! VMClassLoader, not findClass. ! ! 2002-11-03 Jeff Sturm ! ! * resolve.cc (METHOD_NOT_THERE, METHOD_INACCESSIBLE): Remove. ! (_Jv_ResolvePoolEntry): Use _Jv_Method.index, not ! _Jv_DetermineVTableIndex, to determine vtable offset. ! (_Jv_DetermineVTableIndex): Remove. ! (_Jv_PrepareClass): Don't layout vtable. Use _Jv_MakeVTable instead. ! ! * java/lang/Class.h (friend int _Jv_DetermineVTableIndex): Remove. ! ! 2002-11-03 Tom Tromey ! ! * java/nio/channels/AlreadyConnectedException.java: Extend ! IllegalStateException, per spec. ! ! 2002-10-31 Stephen Crawley ! ! * java/lang/Double.java (valueOf): Return new Double(parseDouble(s)). ! ! 2002-10-31 Wu Gansha : ! ! * java/util/ArrayList.java (readObject, writeObject): Only read/write ! size items. ! ! 2002-10-31 Wu Gansha : ! ! * java/io/DataInputStream.java (convertFromUTF): Give StringBuffer an ! initial estimated size to avoid enlarge buffer frequently. ! ! 2002-10-31 Wu Gansha : ! ! * java/lang/reflect/Proxy.java (ProxyType): Set loader to System ! ClassLoader when null. ! (ProxyType.hashCode): Loader null check no longer needed. ! (ProxyType.sameTypes): New method. ! (ProxyType.equals): Use new method. ! ! 2002-10-31 Mark Wielaard ! ! * java/net/URLDecoder.java (decode): Initialize Stringbuffer size to ! length of String. ! * java/net/URLEncoder.java (encode): Likewise. ! ! 2002-10-31 Mark Wielaard ! ! * java/util/zip/ZipInputStream.java (getNextEntry): Throw IOException ! when stream is closed. ! (closeEntry): Likewise. ! (read): Likewise. ! * java/util/zip/ZipOutputStream.java (putNextEntry): Throw ! ZipException when no entry active. ! (closeEntry): Likewise. ! (write): Likewise. ! ! 2002-11-02 Tom Tromey ! ! * java/lang/Class.h: Move JV_STATE_ERROR before JV_STATE_DONE. ! * java/lang/natClass.cc (initializeClass): Don't return just ! because self==thread. ! ! For PR java/8415: ! * java/lang/reflect/natMethod.cc (getType): Use _Jv_FindClass. ! * prims.cc (_Jv_FindClassFromSignature): Indentation fix. ! ! 2002-11-02 Andreas Schwab ! ! * Makefile.am (AM_MAKEFLAGS): Don't pass JC1FLAGS, CC and CXX, do ! pass GCJFLAGS. ! (FLAGS_TO_PASS): Define. ! * Makefile.in: Regenerated. ! ! 2002-11-01 Michael Koch ! ! * java/nio/ByteOrder.java: New file. ! * java/nio/channels/DatagramChannel.java: ! (DatagramChannel): New constructor. ! * java/nio/channels/Pipe.java: New file. ! * java/nio/channels/SelectableChannel.java: New file. ! * java/nio/channels/SelectionKey.java: New file. ! * java/nio/channels/Selector.java: New file. ! * java/nio/channels/ServerSocketChannel.java ! (ServerSocketChannel): New constructor. ! * java/nio/channels/SocketChannel.java ! (SocketChannel): New constructor. ! * java/nio/channels/Pipe.java: New file. ! * java/nio/channels/spi/AbstractChannel.java: New file. ! * java/nio/channels/spi/AbstractInterruptibleChannel.java: New file. ! * java/nio/channels/spi/AbstractSelectableChannel.java: ! License added ! (AbstractSelectableChannel): New stubbed method. ! * java/nio/channels/spi/AbstractSelectionKey.java: New file. ! * java/nio/channels/spi/AbstractSelector.java: New file. ! * java/nio/channels/spi/SelectorProvider.java: New file. ! * java/nio/charset/Charset.java: New file. ! * java/nio/charset/CoderMalfunctionError.java: New file. ! * java/nio/charset/CodingErrorAction.java: New file. ! * java/nio/charset/spi/CharsetProvider.java ! (charsetForName): Uncommented. ! * Makefile.am (java_native_source_files): Added new files. ! * Makefile.in: Regenerated. ! ! 2002-11-01 Michael Koch ! ! * java/net/InetAddress.java: ! (isAnyLocalAddress): Implemented. ! (isLoopbackAddress): Implemented, comment added. ! (isLinkLocalAddress): Implemented, documentation added. ! (isSiteLocalAddress): Implemented, documentation added. ! (isMCGlobal): Implemented, documentation added. ! (isMCNodeLocal): Implemented, documentation added. ! (isMCLinkLocal): Implemented, documentation added. ! (isMCSiteLocal): Implemented, documentation added. ! (isMCOrgLocal): Implemented, documentation added. ! (getHostName): Documentation added. ! (getCanonicalHostName): Implemented, documentation added. ! (getAddress): Documentation added. ! (hashCode): Documentation added. ! (equals): Documentation added. ! (toString): Fixed implementation. ! (getByAddress): Use Inet4Address and Inet6Address. ! (lookup): New linewrap. ! (getByName): SecurityManager check added, support Inet4Address and ! Inet6address, comments added. ! (getAllByName): SecurityManager check added, comments added. ! * java/net/Inet6Address.java: ! (Inet6Address): Initialize parent class with addr instead of null. ! * java/net/URL.java ! (equals): Documentation added. ! (getFile): Documentation added. ! (hashCode): Documentation added. ! * java/net/natInetAddress.cc: ! (aton): Fix IPv6 support. ! * java/net/natPlainDatagramSocketImpl.cc: ! (peek): Throw PortUnreachableException when suitable. ! (peekData): Throw PortUnreachableException when suitable. ! (send): Throw PortUnreachableException when suitable. ! (receive): Throw PortUnreachableException when suitable. ! ! 2002-10-27 Mark Wielaard ! ! * java/util/zip/ZipFile.java (readLeShort): Take and use DataInput as ! argument. ! (readLeShort): Likewise and use byte[]. ! (readLeInt): Likewise. ! (readEntries): Use new versions of methods and use byte[] for reading ! a complete zip entry. Add ZipFile name to exceptions. ! (entries): Add ZipFile name to exceptions. ! (getEntry): Likewise. ! (checkLocalHeader): Use new versions of methods and add ZipFile name ! to exceptions. ! ! 2002-10-31 Mark Anderson ! ! * java/awt/GridBagLayout.java (setConstraints): New stubbed method ! added ! ! 2002-10-25 Krister Walfridsson ! ! * configure.in: Disable hash sync when not using threads. ! * configure: Regenerated. ! ! 2002-10-24 Tom Tromey ! ! * java/lang/natRuntime.cc (_Jv_SetDLLSearchPath): New function. ! (_Jv_FindSymbolInExecutable): Removed argument name. ! (insertSystemProperties): Call _Jv_SetDLLSearchPath if ! java.library.path is set. ! ! * gij.cc (help): Document --showversion. ! (version): Don't exit. ! (main): Handle --showversion. Exit if --version given. ! ! 2002-10-23 Tom Tromey ! ! * jni.cc (_Jv_JNI_AllocObject): Removed old FIXME comment. ! (array_from_valist): Correctly handle promotion for jint, jlong, ! jfloat, and jdouble. ! ! 2002-10-23 Ranjit Mathew ! ! * java/io/natFileWin32.cc (attr): Use FindFirstFile( ) instead of ! GetFileAttributesEx( ) to find file length and modification times, ! as the latter is not present on Windows 95. ! ! 2002-10-21 Michael Koch ! ! * java/net/URL.java ! (URL): Activate SecurityManager checks. ! (equals): Use URLStreamHandler implementation instead of doing it ! alone. This allows special protocol stream handlers to change default ! behaviour. ! (hashCode): Use URLStreamHandler implementation instead of doing it ! alone. This allows special protocol stream handlers to change default ! behaviour. ! * java/net/URLStreamHandler.java ! (equals): Implemented default URL equality check. ! (hostsEqual): Implemented default URL equality check. ! (hashCode): Implemented default URL hashCode algorithm. ! * java/net/natPlainDatagramSocketImpl.cc: ! No lines longer then 80 characters. ! ! 2002-10-20 Adam Megacz ! ! * aclocal.m4 (CHECK_FOR_BROKEN_MINGW_LD): added ! * configure.in: enabled hash sync on Win32 ! * include/win32-threads.h (_Jv_ThreadId_t): added. ! * java/lang/natObject.cc (_Jv_MonitorEnter, _Jv_MonitorExit, ! heavy_lock_obj_finalization_proc, wait, notify, notifyAll): ! removed some posix-isms, use Thread::sleep() instead of usleep, ! added code to clear bottom three bits if platform has a broken ! linker. ! * include/win32-threads.h (_Jv_ThreadId_t): added. ! ! 2002-10-19 Ranjit Mathew ! ! * java/lang/natRuntime.cc (insertSystemProperties): Added GCJ ! runtime property "gnu.gcj.progname" containing the name used to ! invoke the current Java program (similar to argv[0] for C ! programs). ! ! 2002-10-15 Tom Tromey ! ! Fix for PR libgcj/8234: ! * java/util/zip/natInflater.cc (reset): Reset avail_in. ! * java/util/zip/natDeflater.cc (reset): Reset avail_in. ! ! 2002-10-13 Mark Wielaard ! ! * mauve-libgcj: Enable Mauve tests that compile now. ! ! 2002-10-11 Mark Wielaard ! ! Fix for PR libgcj/8142 ! * java/lang/natClassLoader.cc (findClass): Skip inner classes when ! loading native modules. ! ! 2002-10-10 Michael Koch ! ! * javax/swing/AbstractListModel.java ! (getListDataListeners): New stubbed method. ! javax/swing/DefaultBoundedRangeModel.java ! (getChangeListeners): New stubbed method. ! javax/swing/DefaultSingleSelectionModel.java ! (getChangeListeners): New stubbed method. ! ! 2002-10-10 Michael Koch ! ! * gcj/.cvsignore: New file to ignore files generated during build. ! * include/.cvsignore: New file to ignore files generated during build. ! ! 2002-10-10 Michael Koch ! ! * java/net/HttpURLConnection.java ! (getPermission): New method. ! (getErrorStream): New stub method. ! (getHeaderFieldDate): New stub method. ! * java/net/Inet4Address.java: ! (isLinkLocalAddress): Typo fixed. ! * java/net/InetAddress.java: ! (readResolve): New stubbed method (for serialization). ! (isAnyLocalAddress): New stubbed method. ! (isLoopbackAddress): New stubbed method. ! (isLinkLocalAddress): New stubbed method. ! (isSiteLocalAddress): New stubbed method. ! (isMCGlobal): New stubbed method. ! (isMCNodeGlobal): New stubbed method. ! (isMCLinkLocal): New stubbed method. ! (isMCSiteLocal): New stubbed method. ! (isMCOrgLocal): New stubbed method. ! (getCanonicalHostName): New stubbed method. ! (getByAddress): Create instances of Inet4Address/Inet6Address, ! instead of InetAddress, documentation added. ! * java/net/MulticastSocket.java ! (getInterface): Removed FIXME. ! (getNetworkInterface): New method. ! (setNetworkInterface): New method. ! * java/net/NetworkInterface.java: ! (toString): Use property "line.separator" instead of "\n". ! * java/net/URLConnection.java ! (getContent): New stubbed method. ! * java/net/URLStreamHandler.java: ! (equals): New stubbed method. ! (hostsEqual): New stubbed method. ! (hashCode): New stubbed method. ! * java/net/natNetworkInterface.cc: ! (getRealNetworkInterfaces): Create Inet4Address object ! instead of InetAddress. ! ! 2002-10-08 Ulrich Weigand ! ! * interpret.cc (_Jv_InterpMethod::run): Use UINT32 instead of ! unsigned long temporary to implement insn_iushr shifts. ! ! 2002-10-08 Ulrich Weigand ! ! * configure.host [s390*-*]: Enable Java interpreter. ! Enable hash synchronization. Add sysdeps dir. ! * sysdep/s390/locks.h: New file. ! ! 2002-10-06 Mark Wielaard ! ! * java/lang/Thread.java (setDaemon): Check startable_flag, ! not isAlive(). ! ! 2002-10-07 Michael Koch ! ! * java/nio/Buffer.java: New stub file. ! * java/nio/charset/spi/CharsetProvider.java: Commented out all usages ! of class Charset. ! * Makefile.am (java_native_source_files): Added java/nio/Buffer.java. ! * Makefile.in: Regenerated. ! ! 2002-10-07 Michael Koch ! ! * java/nio/ByteBuffer.java: ! removed import of not commited class. ! ! 2002-10-07 Michael Koch ! ! * java/nio/ByteBuffer.java, ! java/nio/MappedByteBuffer.java: ! New files, forgot to add these dummies. ! * Makefile.am (java_native_source_files): Added new files. ! * Makefile.in: Regenerated. ! ! 2002-10-07 Michael Koch ! ! * java/nio/channels/AlreadyConnectedException.java, ! java/nio/channels/ClosedChannelException.java, ! java/nio/channels/ReadableByteChannel.java, ! java/nio/channels/InterruptibleChannel.java, ! java/nio/channels/Channel.java, ! java/nio/channels/ByteChannel.java, ! java/nio/channels/GatheringByteChannel.java, ! java/nio/channels/ScatteringByteChannel.java, ! java/nio/channels/WritableByteChannel.java, ! java/nio/charset/CharacterCodingException.java, ! java/nio/charset/IllegalCharsetNameException.java, ! java/nio/charset/MalformedInputException.java, ! java/nio/charset/UnmappableCharacterException.java, ! java/nio/charset/UnsupportedCharsetException.java, ! java/nio/charset/spi/CharsetProvider.java: New file. ! These files are exceptions or interfaces, ! no real or abstract classes. ! * Makefile.am (java_native_source_files): Added new files. ! * Makefile.in: Regenerated. ! ! 2002-10-05 Michael Koch ! ! * java/net/InetAddress.java ! (getByAddress): Fixed documentation. ! (getByAddress): New method. ! * java/net/Inet4Address.java: New file. ! * java/net/URL.java ! (URL): Documentation added. ! (getContent): Documentation added. ! (getContent): New stubbed method. ! (getQuery): New method. ! (openConnection): Documentation added. ! (openStream): Documentation added. ! (setURLStreamHandlerFactory): Documentation added. ! * java/net/URI.java: New stub file. ! * Makefile.am ! (java_native_source_files): Added java/net/Inet4Address.java, ! java/net/Inet6Address.java and java/net/URI.java. ! * Makefile.in: Regenerated. ! ! 2002-10-04 C. Scott Ananian ! ! * java/lang/ProtectionDomain.java (linesep): Remove field. ! (toString): Use System.getProperty("line.separator"). ! ! 2002-10-04 Michael Koch ! ! * java/security/Identity.java: Added serialVersionUID. ! * java/security/KeyPair.java: Added serialVersionUID. ! * java/security/Provider.java: Added serialVersionUID. ! * java/security/SecureRandom.java: Added serialVersionUID. ! * java/security/SecureRandomSpi.java: Added serialVersionUID. ! * java/security/SignedObject.java: Added serialVersionUID. ! * java/security/cert/Certificate.java: Added serialVersionUID. ! ! 2002-10-04 Mark Wielaard ! ! * java/security/Security.java: Use java.home or gnu.classpath.home ! to load providers. ! (loadProviders): Extra dir argument. ! (getProvider): Return null when not found. ! ! 2002-10-04 Mark Wielaard ! ! * java/lang/Throwable.java: Remerge with Classpath. ! ! 2002-10-04 Michael Koch ! ! * java/net/InetAddress.java: ! (isMulticastAddress): Added documentation. ! (getHostAddress): Added documentation. ! (toString): Added documentation. ! (getByAddress): Fixed documentation. ! (getByName): Added documentation. ! (getAllByName): Added documentation. ! (getLocalHost): Added documentation. ! ! 2002-10-04 Michael Koch ! ! * java/beans/beancontext/BeanContextChildSupport.java: ! Added serialVersionUID. ! * java/text/Collator.java: (compare): Made documentation HTML-aware. ! * javax/naming/BinaryRefAddr.java: Added serialVersionUID. ! * javax/naming/Name.java: Added serialVersionUID. ! ! 2002-10-03 Adam Megacz ! ! * natNetworkInterface.cc (getRealNetworkInterfaces): ifdef out ! some functionality that isn't supported yet on WIN32. ! ! 2002-10-03 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (awt_java_source_files): Added new files. ! ! 2002-10-03 Michael Koch ! ! * java/net/InetAddress.java ! (class InetAddress): Removed final keyword. ! (equals): Fixed typo. ! (getByAddress): New method. ! ! 2002-10-03 Michael Koch ! ! * java/awt/dnd/Autoscroll.java: ! New file, merge from Classpath. ! * java/awt/dnd/DragSourceAdapter.java: ! (dragExit): Fixed typos in argument type. ! (dragDropEnd): Fixed typos in argument type. ! * java/awt/dnd/DragSourceDropEvent.java: ! New file, merge from Classpath. ! * java/awt/dnd/DropTarget.java: ! Added stubs, merge from Classpath. ! * java/awt/dnd/DropTargetAdapter.java: ! New file, merge from Classpath. ! * java/awt/dnd/DropTargetContext.java: ! New file, merge from Classpath. ! * java/awt/dnd/DropTargetDragEvent.java: ! New file, merge from Classpath. ! * java/awt/dnd/DropTargetDropEvent.java: ! New file, merge from Classpath. ! * java/awt/dnd/DropTargetEvent.java: ! New file, merge from Classpath. ! * java/awt/dnd/DropTargetListener.java: ! New file, merge from Classpath. ! * java/awt/dnd/MouseDragGestureRecognizer.java: ! New file, merge from Classpath. ! * java/awt/dnd/peer/DropTargetContextPeer.java: ! New file, merge from Classpath. ! ! 2002-10-03 Michael Koch ! ! * java/net/DatagramPacket.java ! (setLength): Fixed typo and be HTML-aware. ! * java/net/InetSocketAddress.java ! (InetSocketAddress): Correct initialization of hostname, fixed typo. ! (equals): Added comment about equality of InetSocketAddress objects. ! * java/net/ServerSocket.java ! (accept): Added checks. ! (isClosed): New stubbed method. ! * java/net/SocketOptions.java: Reindention. ! * java/net/SocketPermission ! (SocketPermission): Documentation fixed. ! ! 2002-10-03 Michael Koch ! ! * java/net/DatagramSocket.java ! (receive): Check with SecurityManager AFTER the packet is received, ! check if connected to multicast address, documentation added. ! (send): Only check SecurityManager if connected, check address of ! packet to send. ! (connect): Implemented, documentation added. ! * java/net/Inet6Address.java: New file (not added yet to Makefile.am). ! * java/net/InetSocketAddress.java ! (whole file): Reindented. ! (hostname): New attribute. ! (InetSocketAddress): Initialize new attribute. ! (getAddress): Documentation added. ! (getHostName): Documentation added. ! (getPort): Documentation added. ! (hashCode): Documentation added. ! (isUnresolved): Documentation added. ! (toString): Conform to output of JDK 1.4.1, documentation added. ! * java/net/MulticastSocket.java ! (joinGroup): Removed FIXME, documentation added. ! (leaveGroup): Removed FIXME, documentation added. ! (send): Documentation added. ! * java/net/Socket.java ! (inputShutdown): New variable. ! (outputShutdown): New variable. ! (Socket): Initialize new variables. ! (getRemoteSocketAddress): Check if connected. ! (shutdownInput): Set new variable. ! (shutdownOutput): Set new variable. ! (isConnected): New method. ! (isClosed): New method. ! (isInputShutdown): New method. ! (isOutputShutdown): New method. ! * java/net/URLStreamHandler.java ! (URLStreamHandler): New method. ! (openConnection): Added documentation. ! (parseURL): Added documentation. ! (getHostAddress): New method. ! (getDefaultPort): New method. ! ! 2002-10-02 Tom Tromey ! ! * java/rmi/activation/ActivationDesc.java, ! java/rmi/activation/ActivationGroupDesc.java, ! java/rmi/activation/ActivationGroupID.java, ! java/rmi/activation/ActivationID.java: New versions from ! Classpath. ! ! 2002-09-30 Bo Thorsen ! ! * sysdep/x86-64/locks.h (compare_and_swap): Fix multilib support. ! ! 2002-09-30 Tom Tromey ! ! * java/io/ObjectInputStream.java (resolveProxyClass): New method ! from Classpath. ! * Makefile.in: Rebuilt. ! * Makefile.am (rmi_java_source_files): Added new files. ! * gnu/java/rmi/RMIMarshalledObjectInputStream.java, ! gnu/java/rmi/RMIMarshalledObjectOutputStream.java, ! gnu/java/rmi/server/ConnectionRunnerPool.java: New files from ! Classpath. ! * gnu/java/rmi/dgc/DGCImpl.java, ! gnu/java/rmi/dgc/DGCImpl_Skel.java, ! gnu/java/rmi/dgc/DGCImpl_Stub.java, ! gnu/java/rmi/registry/RegistryImpl_Skel.java, ! gnu/java/rmi/registry/RegistryImpl_Stub.java, ! gnu/java/rmi/server/RMIHashes.java, ! gnu/java/rmi/server/RMIObjectInputStream.java, ! gnu/java/rmi/server/RMIObjectOutputStream.java, ! gnu/java/rmi/server/UnicastConnection.java, ! gnu/java/rmi/server/UnicastConnectionManager.java, ! gnu/java/rmi/server/UnicastRef.java, ! gnu/java/rmi/server/UnicastServer.java, ! gnu/java/rmi/server/UnicastServerRef.java, ! java/rmi/MarshalledObject.java, ! java/rmi/server/RMIClassLoader.java, ! java/rmi/server/RemoteObject.java, ! java/rmi/server/UnicastRemoteObject.java, ! java/security/SecureClassLoader.java: Merged from Classpath. ! ! 2002-09-29 Anthony Green ! ! * java/lang/reflect/UndeclaredThrowableException.java: New file. ! Imported from GNU Classpath. ! * java/lang/reflect/natProxy.cc: New file. ! * java/lang/reflect/InvocationHandler.java: New file. Imported ! from GNU Classpath. ! * java/lang/reflect/Proxy.java: New file. Imported from GNU ! Classpath. ! * gnu/java/lang/reflect/TypeSignature.java: Refresh from GNU ! Classpath. ! * gnu/classpath/Configuration.java.in (HAVE_NATIVE_GET_PROXY_DATA, ! HAVE_NATIVE_GET_PROXY_CLASS, HAVE_NATIVE_GENERATE_PROXY_CLASS): ! New statics. ! * gcj/javaprims.h ("Java"): Add new classes. ! * java/lang/reflect/Proxy.java: Fix check for duplicate interfaces. ! * Makefile.am (java/lang/reflect/Proxy$$ProxyData.h): Create this. ! java/lang/reflect/Proxy$$ProxyType.h): And this. ! (inner_nat_headers): Add these new headers. ! (ordinary_java_source_files): Add new files. ! (nat_source_files): Add new file. ! * Makefile.in: Rebuilt. ! ! 2002-09-28 Richard Earnshaw ! ! * configure.host: Handle arm*-elf, strongarm*-elf and xscale*-elf with ! a single configuration. ! ! 2002-09-25 Jesse Rosenstock ! ! * java/util/TimeZone.java (getDSTSavings): New method. ! Fixes PR libgcj/7786. ! ! 2002-09-25 Jesse Rosenstock ! ! * resolve.cc (_Jv_ResolvePoolEntry) [end_of_method_search]: Check ! to see if `the_method == 0' before looking up vtable index. ! Fixes PR libgcj/7709. ! ! 2002-09-25 Tom Tromey ! ! * java/lang/natClassLoader.cc: ! (_Jv_PrepareCompiledClass): Throw NoClassDefFoundError, per spec. ! * resolve.cc: Include NoClassDefFoundError.h, not ! ClassNotFoundException.h. ! (_Jv_ResolvePoolEntry): Throw NoClassDefFoundError, per spec. ! ! * defineclass.cc: Don't include ClassNotFoundException.h. ! ! * resolve.cc: Include StringBuffer. ! (_Jv_ResolvePoolEntry): Use StringBuffer to create error string. ! ! * boehm.cc (_Jv_MarkObj): Don't fail if class object has been ! allocated but not initialized. ! ! 2002-09-25 Jesse Rosenstock ! ! Fix for PR libgcj/7766: ! * java/util/zip/ZipInputStream.java (entryAtEOF): New field. ! (getNextEntry): Set it. ! (closeEntry): Likewise. ! (read): Likewise. ! (close): Likewise. ! (available): Use it. ! ! 2002-09-25 Michael Koch ! ! * java/net/DatagramSocket.java ! (DatagramSocket): Initialize new instance variables. ! (close): Reset new instance variables. ! (getLocalAddress): Remove unneeded SecurityManager usage. ! (getLocalPort): Check if socket is already bound. ! (isConnected): New method. ! (getInetAddress): Implemented. ! (getPort): Better Implementation, documentation fixed. ! (getRemoteSocketAddress): New method. ! * java/net/JarURLConnection.java ! (element): Typo fixed. ! (getMainAttributes): New method. ! (getAttributes): New method (stub only). ! (getManifest): New method (stub only). ! * java/net/NetPermission.java: Added serialVersionsUID. ! * java/net/Socket.java ! (connect): Check blocking mode of associated channel, ! documentation added. ! (getLocalSocketAddress): Better implementation. ! (getRemoteSocketAddress): Implemented. ! (isBound): New method. ! (setSendBufferSize): Documentation added. ! * java/net/SocketAddress.java: Added serialVersionsUID. ! * java/net/SocketPermission.java: Added serialVersionsUID. ! * java/net/URL.java ! (URL): Wrap for shorter lines, initialize new instance variables, ! documentation added. ! (equals): Check new instance variables too. ! (getContent): Documentation added. ! (getPath): Documentation added. ! (getAuthority): New method. ! (getHost): Documentation added. ! (getPort): Documentation added. ! (getDefaultPort): New method. ! (getProtocol): Documentation added. ! (getUserInfo): Documentation added. ! (set): Initialize new instance variables, documentation added. ! * java/net/URLStreamHandler.java ! (setURL): New method. ! * java/net/natPlainDatagramSocketImpl.cc ! (connect): Fix exception name. ! (disconnect): Fix exception name. ! ! 2002-09-25 Michael Koch ! ! * java/nio/channels/spi/AbstractSelectableChannel.java: New file. ! * java/nio/channels/DatagramChannel.java: ! extends AbstractSelectableChannel ! * java/nio/channels/ServerSocketChannel.java: ! extends AbstractSelectableChannel ! * java/nio/channels/SocketChannel.java: ! extends AbstractSelectableChannel ! * Makefile.am (ordinary_java_source_files): ! java/nio/channels/spi/AbstractSelectableChannel.java added. ! * Makefile.in: Regenerated. ! ! 2002-09-25 Michael Koch ! ! * java/net/DatagramSocket.java ! (DatagramSocket): Exception documentation added. ! (bind): Exception documentation added, addded SecurityManager check, ! added SocketAddress type check. ! (getSoTimeout): Check impl. ! (receive): Fix SecurityManager check, check impl, documentation added. ! (send): Check channel mode, documentation added. ! (connect): New method. ! (disconnect): Implemented. ! (getLocalSocketAddress): New method. ! (getReceiveBufferSize): Check impl. ! (setReuseAddress): Check impl. ! (getReuseAddress): Check impl. ! (setBroadcast): Check impl. ! (getBroadcast): Check impl. ! (setTrafficClass): Check impl, Documentation cleared. ! (getTrafficClass): Check impl. ! (getSendBufferSize): Check impl. ! (setReceiveBufferSize): Check impl, documentation added. ! (setSendBufferSize): Documentation added. ! (setDatagramSocketImplFactory): New method. ! * java/net/HttpURLConnection.java ! (HTTP_INTERNAL_ERROR): The correct code is 500. ! (HTTP_NOT_IMPLEMENTED): Added new constant. ! (setFollowRedirects): Documentation added. ! (getInstanceFollowRedirects): New method. ! (setInstanceFollowRedirects): New method. ! (setRequestMethod): Documentation added. ! (getResponseCode): Documentation added. ! (getResponseMessage): Documentation added. ! * java/net/JarURLConnection.java ! (JarURLConnection): protected since JDK 1.4. ! (getJarEntry): java.io.IOException to IOException, documentation added. ! (getJarFile): Documentation added. ! * java/net/ServerSocket.java ! (ServerSocket): Private to public, exception added. ! (ServerSocket): java.io.IOException to IOException, documentation added. ! (bind): Check socket address type, documentation added. ! (bind): java.io.IOException to IOException, documentation added. ! (accept): Documentation added. ! (implAccept): Check ch is not non-blocking, documentation added. ! (setSoTimeout): Documentation fixed. ! (setReceiveBufferSize): Documentation added. ! * java/net/Socket.java ! (Socket): Documentation added. ! (bind): Documentation added. ! (connect): Check socket address type, documentation added. ! (getRemoteSocketAddress): New method. ! (getLocalSocketAddress): New method. ! (setSoLinger): Documentation added. ! (getReuseAddress): New method. ! (setReuseAddress): New method. ! (getTrafficClass): New method. ! (setTrafficClass): New method. ! * java/net/URLStreamHandler.java ! (openConnection): java.io.IOException to IOException. ! (parseURL): Documentation added. ! (sameFile): public to protected, documentation added. ! (setURL): Documentation added. ! * java/nio/IllegalBlockingModeException.java: New file. ! * Makefile.am (ordinary_java_source_files): ! added java/nio/IllegalBlockingModeException.java ! * Makefile.in: Regenerated. ! ! 2002-09-25 Michael Koch ! ! * java/net/DatagramPacket ! (DatagramPacket): Exception documentation added. ! (setData): Likewise. ! (setSocketAddress): Likewise. ! * java/net/DatagramSocketImpl.java ! (peek): Documentation addded. ! (peekData): Documentation addded. ! (send): Documentation addded. ! (receive): Documentation addded. ! (connect): New method. ! (disconnect): New method. ! (joinGroup): New abstract method. ! (leaveGroup): New abstract method. ! * java/net/InetSocketAddress.java ! (InetSocketAddress): Documentation added. ! (equals): final keyword added. ! (getAddress): final keyword added. ! (getHostName): final keyword added. ! (getPort): final keyword added. ! (hashCode): final keyword added. ! (isUnresolved): final keyword added. ! * java/net/MulticastSocket.java ! (MulticastSocket): Documentation added. ! (MulticastSocket): New method. ! (joinGroup): Documentation added. ! (joinGroup): New method. ! (leaveGroup): Documentation added. ! (leaveGroup): New method. ! (send): Documentation added. ! * java/net/NetworkInterface.java ! (getByName): Documentation added. ! (getByInetAddress): Documentation added. ! (getNetworkInterfaces): Documentation added. ! * java/net/PlainDatagramSocketImpl.java ! (connect): New method. ! (disconnect): New method. ! * java/net/SocketImpl.java ! (create): Documentation added. ! (shutdownInput): Convert public to protected, as it always was. ! (shutdownOutput): Convert public to protected, as it always was. ! * java/net/SocketOptions.java ! (whole file): Reintented. ! * java/net/URLClassLoader.java ! (URLClassLoader): SecurityManager check added, documentation added. ! (findResources): Documentation added. ! (findClass): Documentation added. ! (newInstance): More correct method arguments. ! * java/net/URLConnection.java ! (connect): Documentation added. ! (getContent): Documentation added. ! (getPermission): Documentation added. ! (getInputStream): Documentation added. ! (getOutputStream): Documentation added. ! (setDoInput): Throw correct exception, documentation added. ! (setDoOutput): Throw correct exception, documentation added. ! (setAllowUserInteraction): Throw correct exception, documentation added. ! (setUseCaches): Throw correct exception, documentation added. ! (setIfModifiedSince): Throw correct exception, documentation added. ! (setRequestProperty): Throw exception, documentation added. ! (addRequestProperty): Throw exception, documentation added. ! (getRequestProperty): Throw exception, documentation added. ! (getRequestProperties): Documentation added. ! (setContentHandlerFactory): Documentation added. ! (guessContentTypeFromName): protected to public. ! (setFileNameMap): Documentation added. ! * java/net/URLDecoder.java ! (URLDecoder): New method. ! (decode): Documentation added. ! (whole file): Reindented. ! * java/net/URLEncoder.java ! (encode): Documentation added. ! * java/net/natPlainDatagramSocketImpl.cc ! (connect): New method. ! (disconnect): New method. ! * javax/naming/RefAddr: ! (addrType): addrType was never final. ! (equals): Fix typo in method name. ! * javax/naming/BinaryRefAddr: ! (equals): Fix typo in method name. ! ! 2002-09-22 Tom Tromey ! ! Fix for PR libgcj/6576: ! * java/util/ResourceBundle.java (tryBundle): Cache `null' if we ! didn't find a given bundle. ! (getBundle): Don't require base bundle. ! (setParent): Removed old comment. ! (tryLocalBundle): Try components even if preceding components were ! empty. ! ! 2002-09-22 Kaveh R. Ghazi * Makefile.am (all-multi): Fix multilib parallel build. ! 2002-09-21 Michael Koch ! * java/net/Socket.java ! (sendUrgentData): New method. ! (getChannel): New method. ! * java/net/ServerSocket.java ! (getChannel): New method. ! (isBound): New method. ! * java/net/DatagramSocket.java ! (DatagramSocket): Two new methods. ! (bind): New method. ! (getChannel): New method. ! (isBound): New method. ! (send): Added newline to to make shorter lines. ! * java/net/PlainDatagramSocketImpl.java ! (mcastGrp): Added argument. ! (join): Use new mcastGrp. ! (leave): Use new mcastGrp. ! (joinGroup): New method. ! (leaveGroup): New method. ! * java/net/natPlainDatagramSocketImpl.cc ! (mcastGrp): Added argument, no yet really implemented. ! (getOption): Added newline for shorter lines. ! * java/net/natPlainSocketImpl.cc ! (read, setOption, getOption): Added newline for shorter lines. ! 2002-09-19 Tom Tromey ! * java/lang/ClassLoader.java (resolveClass0): Set cause for ! newly-created exception. ! ! 2002-09-18 Michael Koch ! ! * java/util/regex/Matcher.java, java/util/regex/Pattern.java, ! java/util/regex/PatternSyntaxException.java: ! Merge with classpath, new files. ! * Makefile.am (core_java_source_files): ! Added java/util/regex/Matcher.java, ! java/util/regex/Pattern.java, ! java/util/regex/PatternSyntaxException.java ! * Makefile.in: Regenerated. ! * include/config.h.in: Added HAVE_NET_IF_H. ! * java/net/natNetworkInterface.cc (getRealNetworkInterfaces): ! Removed #if 0 ... #endif. ! ! 2002-09-17 Michael Koch ! ! * java/net/natNetworkInterface.cc: ! Removed unneed and yet wrong includes. ! ! 2002-09-17 Michael Koch ! ! * java/net/NetworkInterface.java: New file. ! * java/net/natNetworkInterface.java: New file. ! * configure.in: Added check for net/if.h. ! * configure: Regenerated. ! * Makefile.am ! (ordinary_java_source_files): Added NetworkInterface.java. ! (nat_source_files): Added natNetworkInterface.cc. ! * Makefile.in: Regenerated. ! ! 2002-09-16 Tom Tromey ! ! * java/net/URLClassLoader.java (findClass): Code source for a ! class from a jar is not necessarily a jar: URL. ! ! 2002-09-16 Michael Koch ! ! * java/lang/AssertionError.java: ! Merge with classpath, fixes HTML. ! * java/rmi/server/LogStream.java: ! Merge with classpath, fixes some constants. ! * java/net/server/RemoteServer.java: ! Merge with classpath, adds serialVersionUID. ! * javax/naming/BinaryRefAddr.java: ! Merge with classpath, s/equal/equals/. ! * javax/naming/NamingException.java: ! Merge with classpath, fixed typo. ! * javax/naming/RefAddr.java: ! Merge with classpath, s/equal/equals/. ! * java/awt/Toolkit.java: ! s/gnu.java.awt.peer.gtk.GtkToolkit/gnu.awt.gtk.GtkToolkit/ ! and typo fixed. ! ! 2002-09-15 Adam Megacz ! ! * java/net/natPlainSocketImpl.cc: fixed typo. ! ! 2002-09-15 Adam Megacz ! ! * java/net/natPlainSocketImpl.cc: #ifdef-shielded socket timeouts, ! which don't work on Win32 (yet). ! ! 2002-09-14 Adam Megacz ! ! * java/net/natPlainDatagramSocket.cc: removed #include ! ; the mingw header is broken (conflicts with itself). ! * include/win32.h: included definition for IP_TOS to satisfy ! natPlainDatagramSocket.cc ! ! 2002-09-13 Michael Koch ! ! * java/net/DatagramPacket.java (DatagramPacket): ! Added linebreak for 80 chars per line. ! * java/net/JarURLConection.java ! (getInputStreami, getJarEntry): Likewise. ! * java/net/SocketPErmission.java ! (SocketPermission class docu, implies): Likewise. ! * java/net/URLClassLoader.java (findResources): Likewise. ! * java/net/URLConnection.java: Reindendet remark for 80 chars per line ! ! 2002-09-13 Michael Koch ! ! * java/nio/channels/DatagramChannel.java, ! java/nio/channels/ServerSocketChannel.java ! java/nio/channels/SocketChannel.java: ! New dummy files to make java.net fully JDK 1.4 compatible ! * Makefile.am (ordinary_java_source_files): Added ! java/net/DatagramSocketImplFactory.java (long forgotten), ! java/nio/SocketChannel.java, ! java/nio/ServerSocketChannel.java, ! java/nio/DatagramChannel.java ! * Makefile.in: Regenrated. ! ! 2002-09-12 Michael Koch ! ! * java/net/DatagramSocketImpl.java ! (peekData): New method. ! * java/net/PlainDatagramSocketImpl.java ! (peekData): New method. ! * java/net/natPlainDatagramSocketImpl.cc ! (peekData): New method. ! * java/net/URLConnection ! (getPermission): New method. ! (addRequestProperty): New method. ! (getRequestProperties): New method. ! (guessContentTypeFromStream): New method, not really implemented. ! (URLConnection): Added/updated documentation. ! (connect): Added/updated documentation. ! (getURL): Added/updated documentation. ! (getContentLength): Added/updated documentation. ! (getContentType: Added/updated documentation. ! (getContentEncoding): Added/updated documentation. ! (getExpiration): Added/updated documentation. ! (getDate): Added/updated documentation. ! (getLastModified): Added/updated documentation. ! (getHeaderField): Added/updated documentation. ! (getHeaderFields): Added/updated documentation. ! (getHeaderFieldInt): Added/updated documentation. ! (getHeaderFieldDate): Added/updated documentation. ! (getHeaderFieldKey): Added/updated documentation. ! (getContent): Added/updated documentation. ! (getInputStream): Added/updated documentation. ! (getOutputStream): Added/updated documentation. ! (toString): Added/updated documentation. ! (setDoInput): Added/updated documentation. ! (getDoInput): Added/updated documentation. ! (setDoOutput): Added/updated documentation. ! (getDoOutput): Added/updated documentation. ! (setAllowUserInteraction): Added/updated documentation. ! (getAllowUserInteraction): Added/updated documentation. ! (setDefaultAllowUserInteraction): Added/updated documentation. ! (getDefaultAllowUserInteraction): Added/updated documentation. ! (setUseCaches): Added/updated documentation. ! (getUseCaches): Added/updated documentation. ! (setIfModifiedSince): Added/updated documentation. ! (getIfModifiedSince): Added/updated documentation. ! (getDefaultUseCaches): Added/updated documentation. ! (setDefaultUseCaches): Added/updated documentation. ! (setRequestProperty): Added/updated documentation. ! (getRequestProperty): Added/updated documentation. ! (setDefaultRequestProperty): Added/updated documentation. ! (getDefaultRequestProperty): Added/updated documentation. ! (setContentHandlerFactory): Added/updated documentation. ! (guessContentTypeFromName): Added/updated documentation. ! (getFileNameMap): Added/updated documentation. ! (setFileNameMap): Added/updated documentation. ! ! 2002-09-11 Michael Koch ! ! * java/net/Socket.java ! (Socket): protected to public (since JDK 1.4). Added @specnote. ! (bind): New method. ! (connect): Two new methods. ! (getKeepalive): Get correct socket option. ! (setKeepalive): Set correct socket option. ! (getOOBInline): New method. ! (setOOBInline): New method. ! * java/net/ServerSocket.java ! (bind): Two new methods. ! (getInetAddress): Reimplemented, catch exception. ! (getLocalSocketAddress): New method. ! (setReuseAddress): New method. ! (getReuseAdress): New method. ! (setReceiveBufferSize): New method. ! (getReceiveBufferSize): New method. ! (toString): Made string JDK 1.4 compliant. ! ! 2002-09-10 Michael Koch ! ! * java/net/SocketImpl.java ! (connect): New method. ! (supportsUrgentData): New method. ! (sendUrgentData): New method. ! * java/net/PlainSocketImpl.java ! (connect): One new method and two new implementation. ! (sendUrgentData): New method. ! * java/natPlainSocketImpl.cc ! (connect): Arguments changed, added support for timeouts. ! (getOption): Another __java_boolean to jboolean. ! ! 2002-09-07 Adam Megacz ! ! * java/net/natPlainDatagramSocket.cc: include ws2tcpip.h for ! definition of IP_TOS. ! ! 2002-09-04 Michael Koch ! ! * java/net/DatagramSocket.java ! (DatagramSocket): Added documentation. ! (close): Likewise. ! (getLocalAddress): Likewise. ! (getLocalPort): Likewise. ! (receive): Likewise. ! (send): Likewise. ! (setSoTimeout): Likewise. ! (connect): New method. ! (disconnect): New method. ! (getInetAddress): New method (FIXME) ! (getPort): New method. ! (setReuseAddress): New method. ! (getReuseAddress): New method. ! (setBroadcast): New method. ! (getBroadcast): New method. ! (setTrafficClass): New method. ! (getTrafficClass): New method. ! * java/net/MulticastSocket.java): ! (getTTL): Added @see in documentation. ! (setTTL): Added @see in documentation. ! (setLoopbackMode): New method. ! (getLoopbackMode): New method. ! * java/net/PlainSocketImpl.java: ! Added new constants for the options SO_BROADCAST, SO_OOBINLINE, ! IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS ! * java/net/PlainDatagramSocketImpl.java ! Added new constants for the options SO_BROADCAST, SO_OOBINLINE, ! IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS ! * java/net/natPlainSocketImpl.cc ! (getOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, ! IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS ! (setOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, ! IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS ! This should also fix SO_KEEPALIVE ! * java/net/natPlainDatagramSocketImpl.cc ! (getOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, ! IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS ! (setOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, ! IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS ! ! 2002-09-04 Michael Koch ! ! * java/net/SocketOptions.java: added static variables to be JDK 1.4 ! compatible (SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, ! IP_MULTICAST_LOOP, IP_TOS ! ! 2002-09-03 Tom Tromey ! ! * java/lang/Class.h (_getDeclaredMethod): Declare. ! (_getMethod): Now private. ! * java/lang/natClass.cc (_getDeclaredMethod): Renamed from ! getDeclaredMethod. Now returns NULL on failure. ! * java/lang/Class.java (_getDeclaredMethod): Declare. ! (getDeclaredMethod): No longer native; implements access checks. ! ! 2002-09-01 Mark Wielaard ! ! * gnu/gcj/runtime/NameFinder.java (remove_interpreter): New field. ! (sanitizeStack): Correctly reset unknown and interpreter counters, ! detect interpreter runtime frames. ! (demangleInterpreterMethod): New method. ! * gnu/gcj/runtime/natNameFinder.cc (lookupInterp): Use new method. ! * java/lang/natVMThrowable.cc (fillInStackTrace): Change order of ! filling in addrs[]. ! ! 2002-09-02 Michael Koch ! ! * java/net/DatagramPacket.java, java/net/MulticsstSocket.java: ! re-indented documentation. ! ! 2002-08-30 Jesse Rosenstock ! ! * java/util/Calendar.java (getTimeInMillis, getTimeInMillis): Now ! public, per 1.4 spec. Fixes PR libgcj/7785. ! ! 2002-08-30 Jeff Sturm ! ! * Makefile.in: Rebuilt. ! * Makefile.am (ZIP, GCJH): Remove $(EXEEXT). ! ! 2002-08-29 Tom Tromey ! ! * java/net/JarURLConnection.java (getCertificates): New method ! from Classpath. ! * java/net/URLClassLoader.java (URLClassLoader): Extends ! SecureClassLoader. ! (definePackage): New method from Classpath. ! (getPermissions): Likewise. ! (newInstance): Likewise. ! (findClass): Construct CodeSource for new class (from Classpath). ! * java/net/SocketImpl.java (shutdownInput, shutdownOutput): New ! methods. ! * java/net/URL.java (getUserInfo): New method. ! (set(String,String,int,String,String,String,String,String)): New ! method. ! * java/net/PlainSocketImpl.java (_Jv_SO_KEEPALIVE_): Define. ! (shutdownInput, shutdownOutput): Declare. ! * java/net/PlainDatagramSocketImpl.java (_Jv_SO_KEEPALIVE_): ! Define. ! * java/net/natPlainSocketImpl.cc (setOption): Handle keepalive. ! (getOption): Likewise. ! (shutdownInput): New method. ! (shutdownOutput): Likewise. ! * java/net/natPlainDatagramSocketImpl.cc (setOption): Handle ! keepalive. ! (getOption): Likewise. ! * java/net/SocketOptions.java (SO_KEEPALIVE): New constant. ! * java/net/Socket.java (setKeepAlive): New method. ! (getKeepAlive): Likewise. ! (shutdownInput, shutdownOutput): New methods. ! ! 2002-08-29 Michael Koch ! ! * java/net/DatagramPacket.java: updated to JDK 1.4 API ! new methods are: ! DatagramPacket(byte[] buf, int offset, int length, SocketAddress ! address), ! DatagramPacket(byte[] buf, int length, SocketAddress address), ! void setSocketAddress(SocketAddress address) ! public SocketAddress getSocketAddress() ! ! 2002-08-29 Tom Tromey ! ! * java/io/natFileDescriptorPosix.cc (setLength): Handle case where ! ftruncate is missing. ! * configure, include/config.h.in: Rebuilt. ! * acconfig.h (HAVE_FTRUNCATE): Mention. ! * configure.in: Check for ftruncate. ! ! 2002-08-29 Tom Tromey ! ! * include/jvm.h (struct _Jv_frame_info): New structure. ! * gnu/gcj/runtime/natNameFinder.cc: Include StringBuffer.h, ! java-interp.h. ! (lookupInterp): New method. ! (getAddrAsString): Use _Jv_frame_info. ! (dladdrLookup): Likewise. ! * gnu/gcj/runtime/NameFinder.java (lookup): Try to look up ! interpreted frame. ! (lookupInterp): Declare. ! * java/lang/natVMThrowable.cc: Include Thread.h, java-interp.h. ! (fillInStackTrace): Collect information on interpreted frames. ! Use _Jv_frame_info. ! * interpret.cc: Include Thread.h. ! (run): Create and push _Jv_MethodChain object. ! (_Jv_EndOfInterpreter): New global. ! * java/lang/Thread.java (interp_frame): New field. ! * include/java-interp.h (struct _Jv_MethodChain): New structure. ! Include NameFinder.h. ! ! 2002-08-28 Tom Tromey ! ! * java/lang/Class.h: Include Package.h. ! (Class::getProtectionDomain): Declare. ! (Class::getPackage): Declare. ! ! 2002-08-28 Michael Koch ! ! * java/net/InetSocketAddress.java: Added some documentation and argument ! checks for the port numbers. ! * java/net/DatagramSocketImplFactory.java: New file. ! ! 2002-08-28 Michael Koch ! ! * java/net/Authenticator.java: added some documentation. ! ! 2002-08-27 Tom Tromey ! ! * java/lang/reflect/natConstructor.cc (newInstance): Initialize ! class. ! * java/lang/reflect/natMethod.cc (invoke): Initialize class. ! ! 2002-08-27 Michael Koch ! ! * java/net/BindException.java, ! java/net/JarURLConnection.java, ! java/net/FileNameMap.java, ! java/net/HttpURLConnection.java, ! java/net/InetSocketAddress.java, ! java/net/DatagramPacket.java, ! java/net/DatagramSocket.java, ! java/net/DatagramSocketImpl.java, ! java/net/MulticastSocket.java, ! java/net/PasswordAuthentication.java, ! java/net/ServerSocket.java, ! java/net/Socket.java, ! java/net/URLClassLoader.java, ! java/net/URLConnection.java: add/update of some @since/@deprecated ! ! 2002-08-27 Tony Kimball ! Tom Tromey ! ! * java/net/natPlainDatagramSocketImpl.cc (NATIVE_CLOSE): New ! define. ! (::close): Removed. ! (PlainDatagramSocketImpl::close): Use NATIVE_CLOSE. ! * java/net/natPlainSocketImpl.cc (NATIVE_CLOSE): New define. ! (::close): Removed. ! (PlainSocketImpl::close): Use NATIVE_CLOSE. ! * include/win32.h (getcwd): Removed declaration. Include io.h. ! ! 2002-08-25 Adam Megacz ! ! * include/win32.h (getcwd): copied function declaration as ! temporary fix for header confusion. ! ! 2002-08-24 Mark Wielaard ! ! * Makefile.am (libgcj_la_SOURCES): Remove name-finder.cc. ! (core_java_source_files): Add VMThrowable.java and NameFinder.java ! (nat_source_files): Remove natThrowable.cc, add natVMThrowable.cc ! and natNameFinder.cc. ! * Makefile.in: Regenerate. ! * prims.cc: Use trace_enabled from VMThrowable. ! * name-finder.cc: Removed. ! * gcj/javaprims.h: Add class VMThrowable. ! * gnu/gcj/runtime/NameFinder.java: New file. ! * gnu/gcj/runtime/natNameFinder.cc: Likewise. ! * include/name-finder.h: Removed. ! * java/lang/Throwable.java (printStackTrace (PrintStream)): Use new ! method stackTraceString(). ! (printStackTrace (PrintWriter)): Likewise. ! (stackTraceString): Complete rewrite of old printStackTrace using ! StringBuffer. ! (stackTraceStringBuffer): New helper method for stackTraceString(). ! (fillInStackTrace): Delegate to VMTrowable. ! (getStackTrace): Likewise. ! (getStackTrace0): Removed. ! (trace_enabled, stackTraceBytes): Moved to new VMThrowable.java. ! (setStackTrace): Copy given array. ! * java/lang/natThrowable.cc: Removed (replaced by natVMThrowable). ! * java/lang/VMThrowable.java: New class. ! * java/lang/natVMThrowable.cc: New file. ! ! 2003-08-23 Michael Koch ! ! * java/net/URLConnection.java, ! java/netJarURLConnection.java, ! gnu/gcj/protocol/core/Connection.java, ! gnu/gcj/protocol/file/Connection.java, ! gnu/gcj/protocol/http/Connection.java: Added implementation of ! getHeaderFields(). ! ! 2002-08-22 Tom Tromey ! ! * gij.cc (help): Document -cp and -classpath. ! (main): Handle -classpath. ! ! 2002-08-21 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (ordinary_java_source_files): Added ! SocketAddress.java, InetSocketAddress.java. ! * java/net/PortUnreachableException.java: Merged with Classpath. ! * java/net/SocketTimeoutException.java: Likewise. ! * java/net/URISyntaxException.java: Likewise. ! * java/net/SocketAddress.java: New class from Classpath. ! * java/net/InetSocketAddress.java: Likewise. ! ! 2003-08-21 Michael Koch ! ! * java/net/Authenticator.java: updated JDK 1.4 ! * java/net/ContentHandler.java: updated JDK 1.4 ! ! 2002-08-20 Michael Koch ! ! * java/net/URISyntaxException.java: New file. ! * java/net/SocketTimeoutException.java: New file. ! * java/net/PortUnreachableException.java: New file. ! * Makefile.am: Updated. ! * Makefile.in: Rebuilt. ! ! 2002-08-18 Mark Wielaard ! ! Thanks to Vladimir Puskas ! * gnu/java/security/provider/MD5.java: Extends MessageDigest, not ! MessageDigestSpi (fixes Classpath bug #783). ! ! 2002-08-14 Jesse Rosenstock ! ! * java/lang/natPosixProcess.cc (cleanup): Added `path' argument. ! (startProcess): Allocate path for chdir in async-signal-safe way. ! ! 2002-08-13 Jesse Rosenstock ! ! Fix for PR libgcj/7570 and PR libgcj/7578: ! * java/lang/natPosixProcess.cc: Include java/io/File.h. ! (startProcess): Handle new `dir' argument. ! * java/lang/Win32Process.java (ConcreteProcess): Added `dir' ! argument. ! * java/lang/PosixProcess.java (ConcreteProcess): Added `dir' ! argument. ! (startProcess): Likewise. ! * java/lang/EcosProcess.java (ConcreteProcess): Added `dir' ! argument. ! * java/lang/Runtime.java (execInternal): Added `dir' argument. ! (exec): Don't create new environment if ENV==null. Pass DIR to ! execInternal. ! * java/lang/natRuntime.cc: Include java/io/File.h. ! (execInternal): Added `dir' argument. ! ! 2002-08-13 Jesse Rosenstock ! ! * java/io/RandomAccessFile.java (skipBytes): Return number of ! bytes skipped. ! ! 2002-08-01 Mark Wielaard ! ! Reenable patch since shared library troubles on powerpc are solved: ! * gnu/java/security/provider/Gnu.java: Reference all implementation ! classes by using Class.getName(). ! * gnu/java/security/der/DEREncodingException.java, ! gnu/java/security/provider/DERReader.java, ! gnu/java/security/provider/DERWriter.java, ! gnu/java/security/provider/DSAKeyPairGenerator.java, ! gnu/java/security/provider/DSAParameterGenerator.java, ! gnu/java/security/provider/DSAParameters.java, ! gnu/java/security/provider/DSASignature.java, ! gnu/java/security/provider/GnuDSAPrivateKey.java, ! gnu/java/security/provider/GnuDSAPublicKey.java, ! gnu/java/security/provider/MD5.java, ! gnu/java/security/util/Prime.java: New classes ! * Makefile.am (ordinary_java_source_files): Add above files. ! * Makefile.in: Regenerate. ! * gnu/java/security/provider/DefaultPolicy.java ! (getPermissions): Don't maintain static class variable of Permissions. ! * gnu/java/security/provider/SHA.java ! (engineUpdate): algorithm change. ! (engineDigest): algorithm change. ! ! 2002-08-09 Mark Wielaard ! ! * java/awt/image/MemoryImageSource.java: Change constructor to take ! int[] not byte[]. ! * java/awt/Graphics2D.java: Uncomment methods that can now be ! compiled. ! * java/awt/GridBagLayout.java: New stub implementation. ! * javax/swing/text/html/HTML.java: Stub implementation. ! * javax/swing/text/html/parser/ParserDelegator.java: New stub ! implementation. ! ! * Makefile.am: Add new files. ! * Makefile.in: Rebuilt. ! ! 2002-08-09 Bryce McKinlay ! ! * gnu/awt/j2d/Graphics2DImpl.java: Implement stubs for new abstract ! methods in Graphics2D. ! ! 2002-08-09 Bryce McKinlay ! ! AWT/Swing merge from GNU Classpath. ! ! * java/awt/AlphaComposite.java, java/awt/AttributeValue.java, ! java/awt/BasicStroke.java, java/awt/BufferCapabilities.java, ! java/awt/color/CMMException.java, java/awt/ColorPaintContext.java, ! java/awt/color/ProfileDataException.java, ! java/awt/CompositeContext.java, java/awt/Composite.java, ! java/awt/ContainerOrderFocusTraversalPolicy.java, ! java/awt/datatransfer/FlavorTable.java, ! java/awt/DefaultFocusTraversalPolicy.java, ! java/awt/DefaultKeyboardFocusManager.java, java/awt/DisplayMode.java, ! java/awt/dnd/DnDConstants.java, java/awt/dnd/DragGestureEvent.java, ! java/awt/dnd/DragGestureListener.java, ! java/awt/dnd/DragGestureRecognizer.java, ! java/awt/dnd/DragSourceAdapter.java, ! java/awt/dnd/DragSourceContext.java, ! java/awt/dnd/DragSourceDragEvent.java, ! java/awt/dnd/DragSourceEvent.java, java/awt/dnd/DragSource.java, ! java/awt/dnd/DragSourceListener.java, ! java/awt/dnd/DragSourceMotionListener.java, ! java/awt/dnd/DropTarget.java, ! java/awt/dnd/InvalidDnDOperationException.java, ! java/awt/dnd/peer/DragSourceContextPeer.java, ! java/awt/event/AWTEventListenerProxy.java, ! java/awt/event/MouseWheelEvent.java, ! java/awt/event/MouseWheelListener.java, ! java/awt/event/WindowFocusListener.java, ! java/awt/event/WindowStateListener.java, ! java/awt/FocusTraversalPolicy.java, java/awt/FontFormatException.java, ! java/awt/font/TextHitInfo.java, java/awt/geom/Arc2D.java, ! java/awt/geom/Area.java, java/awt/geom/CubicCurve2D.java, ! java/awt/geom/FlatteningPathIterator.java, ! java/awt/geom/GeneralPath.java, java/awt/geom/QuadCurve2D.java, ! java/awt/GradientPaint.java, java/awt/GraphicsConfigTemplate.java, ! java/awt/GraphicsDevice.java, java/awt/GraphicsEnvironment.java, ! java/awt/HeadlessException.java, java/awt/image/BufferedImageOp.java, ! java/awt/image/BufferStrategy.java, java/awt/ImageCapabilities.java, ! java/awt/image/ImagingOpException.java, ! java/awt/image/RasterFormatException.java, ! java/awt/image/RenderedImage.java, java/awt/image/TileObserver.java, ! java/awt/image/VolatileImage.java, ! java/awt/image/WritableRenderedImage.java, ! java/awt/im/InputContext.java, java/awt/im/InputMethodHighlight.java ! java/awt/im/InputMethodRequests.java, java/awt/im/InputSubset.java, ! java/awt/JobAttributes.java, java/awt/KeyboardFocusManager.java, ! java/awt/KeyEventDispatcher.java, java/awt/KeyEventPostProcessor.java ! java/awt/PageAttributes.java, java/awt/print/Book.java, ! java/awt/print/Pageable.java, java/awt/print/PageFormat.java, ! java/awt/print/Paper.java, java/awt/print/Printable.java, ! java/awt/print/PrinterAbortException.java, ! java/awt/print/PrinterException.java, ! java/awt/print/PrinterGraphics.java, ! java/awt/print/PrinterIOException.java, java/awt/print/PrinterJob.java, ! java/awt/Robot.java, java/awt/ScrollPaneAdjustable.java, ! java/awt/Stroke.java, java/awt/TexturePaint.java, ! javax/accessibility/AccessibleAction.java, ! javax/accessibility/AccessibleBundle.java, ! javax/accessibility/AccessibleComponent.java, ! javax/accessibility/AccessibleContext.java, ! javax/accessibility/AccessibleEditableText.java, ! javax/accessibility/AccessibleExtendedComponent.java, ! javax/accessibility/AccessibleExtendedTable.java, ! javax/accessibility/AccessibleHyperlink.java, ! javax/accessibility/AccessibleHypertext.java, ! javax/accessibility/AccessibleIcon.java, ! javax/accessibility/Accessible.java, ! javax/accessibility/AccessibleKeyBinding.java, ! javax/accessibility/AccessibleRelation.java, ! javax/accessibility/AccessibleRelationSet.java, ! javax/accessibility/AccessibleResourceBundle.java, ! javax/accessibility/AccessibleRole.java, ! javax/accessibility/AccessibleSelection.java, ! javax/accessibility/AccessibleState.java, ! javax/accessibility/AccessibleStateSet.java, ! javax/accessibility/AccessibleTable.java, ! javax/accessibility/AccessibleTableModelChange.java, ! javax/accessibility/AccessibleText.java, ! javax/accessibility/AccessibleValue.java, ! javax/swing/AbstractAction.java, ! javax/swing/AbstractButton.java, ! javax/swing/AbstractCellEditor.java, ! javax/swing/AbstractListModel.java, ! javax/swing/AbstractSet.java, javax/swing/Action.java, ! javax/swing/ActionMap.java, javax/swing/border/AbstractBorder.java, ! javax/swing/border/BevelBorder.java, javax/swing/border/Border.java, ! javax/swing/border/CompoundBorder.java, ! javax/swing/border/EmptyBorder.java, ! javax/swing/border/EtchedBorder.java, javax/swing/BorderFactory.java, ! javax/swing/border/LineBorder.java, ! javax/swing/border/MatteBorder.java, ! javax/swing/border/TitledBorder.java, ! javax/swing/BoundedRangeModel.java, javax/swing/Box.java, ! javax/swing/BoxLayout.java, javax/swing/ButtonGroup.java, ! javax/swing/ButtonModel.java, javax/swing/CellEditor.java, ! javax/swing/CellRendererPane.java, ! javax/swing/colorchooser/AbstractColorChooserPanel.java, ! javax/swing/colorchooser/ColorChooserComponentFactory.java, ! javax/swing/colorchooser/ColorSelectionModel.java, ! javax/swing/colorchooser/DefaultColorSelectionModel.java, ! javax/swing/ComboBoxEditor.java, javax/swing/ComboBoxModel.java, ! javax/swing/ComponentInputMap.java, javax/swing/DebugGraphics.java, ! javax/swing/DefaultBoundedRangeModel.java, ! javax/swing/DefaultButtonModel.java, ! javax/swing/DefaultCellEditor.java, ! javax/swing/DefaultCellRenderer.java, ! javax/swing/DefaultComboBoxModel.java, ! javax/swing/DefaultDesktopManager.java, ! javax/swing/DefaultFocusManager.java, ! javax/swing/DefaultListCellRenderer.java, ! javax/swing/DefaultListModel.java, ! javax/swing/DefaultListSelectionModel.java, ! javax/swing/DefaultSingleSelectionModel.java, ! javax/swing/DesktopManager.java, ! javax/swing/event/AncestorEvent.java, ! javax/swing/event/AncestorListener.java, ! javax/swing/event/CaretEvent.java, ! javax/swing/event/CaretListener.java, ! javax/swing/event/CellEditorListener.java, ! javax/swing/event/ChangeEvent.java, ! javax/swing/event/ChangeListener.java, ! javax/swing/event/DocumentEvent.java, ! javax/swing/event/DocumentListener.java, ! javax/swing/event/EventListenerList.java, ! javax/swing/event/HyperlinkEvent.java, ! javax/swing/event/HyperlinkListener.java, ! javax/swing/event/InternalFrameAdapter.java, ! javax/swing/event/InternalFrameEvent.java, ! javax/swing/event/InternalFrameListener.java, ! javax/swing/event/ListDataEvent.java, ! javax/swing/event/ListDataListener.java, ! javax/swing/event/ListSelectionEvent.java, ! javax/swing/event/ListSelectionListener.java, ! javax/swing/event/MenuDragMouseEvent.java, ! javax/swing/event/MenuDragMouseListener.java, ! javax/swing/event/MenuEvent.java, ! javax/swing/event/MenuKeyEvent.java, ! javax/swing/event/MenuKeyListener.java, ! javax/swing/event/MenuListener.java, ! javax/swing/event/MouseInputAdapter.java, ! javax/swing/event/MouseInputListener.java, ! javax/swing/event/PopupMenuEvent.java, ! javax/swing/event/PopupMenuListener.java, ! javax/swing/event/SwingPropertyChangeSupport.java, ! javax/swing/event/TableColumnModelEvent.java, ! javax/swing/event/TableColumnModelListener.java, ! javax/swing/event/TableModelEvent.java, ! javax/swing/event/TableModelListener.java, ! javax/swing/event/TreeExpansionEvent.java, ! javax/swing/event/TreeExpansionListener.java, ! javax/swing/event/TreeModelEvent.java, ! javax/swing/event/TreeModelListener.java, ! javax/swing/event/TreeSelectionEvent.java, ! javax/swing/event/TreeSelectionListener.java, ! javax/swing/event/TreeWillExpandListener.java, ! javax/swing/event/UndoableEditEvent.java, ! javax/swing/event/UndoableEditListener.java, ! javax/swing/filechooser/FileFilter.java, ! javax/swing/filechooser/FileSystemView.java, ! javax/swing/filechooser/FileView.java, ! javax/swing/FocusManager.java, javax/swing/GrayFilter.java, ! javax/swing/Icon.java, javax/swing/ImageIcon.java, ! javax/swing/InputMap.java, javax/swing/InputVerifier.java, ! javax/swing/JApplet.java, javax/swing/JButton.java, ! javax/swing/JCheckBox.java, javax/swing/JCheckBoxMenuItem.java, ! javax/swing/JColorChooser.java, javax/swing/JComboBox.java, ! javax/swing/JComponent.java, javax/swing/JDesktopPane.java, ! javax/swing/JDialog.java, javax/swing/JEditorPane.java, ! javax/swing/JFileChooser.java, javax/swing/JFrame.java, ! javax/swing/JInternalFrame.java, javax/swing/JLabel.java, ! javax/swing/JLayeredPane.java, javax/swing/JList.java, ! javax/swing/JMenuBar.java, javax/swing/JMenuItem.java, ! javax/swing/JMenu.java, javax/swing/JOptionPane.java, ! javax/swing/JPanel.java, javax/swing/JPasswordField.java, ! javax/swing/JPopupMenu.java, javax/swing/JProgressBar.java, ! javax/swing/JRadioButton.java, javax/swing/JRadioButtonMenuItem.java, ! javax/swing/JRootPane.java, javax/swing/JScrollBar.java, ! javax/swing/JScrollPane.java, javax/swing/JSeparator.java, ! javax/swing/JSlider.java, javax/swing/JSplitPane.java, ! javax/swing/JTabbedPane.java, javax/swing/JTable.java, ! javax/swing/JTextField.java, javax/swing/JTextPane.java, ! javax/swing/JToggleButton.java, javax/swing/JToolBar.java, ! javax/swing/JToolTip.java, javax/swing/JTree.java, ! javax/swing/JViewport.java, javax/swing/JWindow.java, ! javax/swing/KeyStroke.java, javax/swing/ListCellRenderer.java, ! javax/swing/ListModel.java, javax/swing/ListSelectionModel.java, ! javax/swing/LookAndFeel.java, javax/swing/MenuElement.java, ! javax/swing/MenuSelectionManager.java, ! javax/swing/MutableComboBoxModel.java, ! javax/swing/OverlayLayout.java, ! javax/swing/plaf/ActionMapUIResource.java, ! javax/swing/plaf/basic/BasicBorders.java, ! javax/swing/plaf/basic/BasicButtonUI.java, ! javax/swing/plaf/basic/BasicCheckBoxUI.java, ! javax/swing/plaf/basic/BasicDefaults.java, ! javax/swing/plaf/basic/BasicGraphicsUtils.java, ! javax/swing/plaf/basic/BasicIconFactory.java, ! javax/swing/plaf/basic/BasicLabelUI.java, ! javax/swing/plaf/basic/BasicListUI.java, ! javax/swing/plaf/basic/BasicLookAndFeel.java, ! javax/swing/plaf/basic/BasicOptionPaneUI.java, ! javax/swing/plaf/basic/BasicPanelUI.java, ! javax/swing/plaf/basic/BasicRadioButtonUI.java, ! javax/swing/plaf/basic/BasicScrollPaneUI.java, ! javax/swing/plaf/basic/BasicTabbedPaneUI.java, ! javax/swing/plaf/basic/BasicTextUI.java, ! javax/swing/plaf/basic/BasicToggleButtonUI.java, ! javax/swing/plaf/basic/BasicTreeUI.java, ! javax/swing/plaf/basic/BasicViewportUI.java, ! javax/swing/plaf/BorderUIResource.java, ! javax/swing/plaf/ButtonUI.java, ! javax/swing/plaf/ColorChooserUI.java, ! javax/swing/plaf/ColorUIResource.java, ! javax/swing/plaf/ComboBoxUI.java, ! javax/swing/plaf/ComponentInputMapUIResource.java, ! javax/swing/plaf/ComponentUI.java, ! javax/swing/plaf/DesktopIconUI.java, ! javax/swing/plaf/DesktopPaneUI.java, ! javax/swing/plaf/DimensionUIResource.java, ! javax/swing/plaf/FileChooserUI.java, ! javax/swing/plaf/FontUIResource.java, ! javax/swing/plaf/IconUIResource.java, ! javax/swing/plaf/InputMapUIResource.java, ! javax/swing/plaf/InsetsUIResource.java, ! javax/swing/plaf/InternalFrameUI.java, ! javax/swing/plaf/LabelUI.java, ! javax/swing/plaf/ListUI.java, ! javax/swing/plaf/MenuBarUI.java, ! javax/swing/plaf/MenuItemUI.java, ! javax/swing/plaf/OptionPaneUI.java, ! javax/swing/plaf/PanelUI.java, ! javax/swing/plaf/PopupMenuUI.java, ! javax/swing/plaf/ProgressBarUI.java, ! javax/swing/plaf/RootPaneUI.java, ! javax/swing/plaf/ScrollBarUI.java, ! javax/swing/plaf/ScrollPaneUI.java, ! javax/swing/plaf/SeparatorUI.java, ! javax/swing/plaf/SliderUI.java, ! javax/swing/plaf/SplitPaneUI.java, ! javax/swing/plaf/TabbedPaneUI.java, ! javax/swing/plaf/TableHeaderUI.java, ! javax/swing/plaf/TableUI.java, ! javax/swing/plaf/TextUI.java, ! javax/swing/plaf/ToolBarUI.java, ! javax/swing/plaf/ToolTipUI.java, ! javax/swing/plaf/TreeUI.java, ! javax/swing/plaf/UIResource.java, ! javax/swing/plaf/ViewportUI.java, ! javax/swing/ProgressMonitorInputStream.java, ! javax/swing/ProgressMonitor.java, ! javax/swing/Renderer.java, ! javax/swing/RepaintManager.java, ! javax/swing/RootPaneContainer.java, ! javax/swing/Scrollable.java, ! javax/swing/ScrollPaneConstants.java, ! javax/swing/ScrollPaneLayout.java, ! javax/swing/SingleSelectionModel.java, ! javax/swing/SizeRequirements.java, ! javax/swing/SizeSequence.java, ! javax/swing/SwingConstants.java, ! javax/swing/SwingUtilities.java, ! javax/swing/table/AbstractTableModel.java, ! javax/swing/table/DefaultTableCellRenderer.java, ! javax/swing/table/DefaultTableColumnModel.java, ! javax/swing/table/DefaultTableModel.java, ! javax/swing/table/TableCellEditor.java, ! javax/swing/table/TableCellRenderer.java, ! javax/swing/table/TableColumn.java, ! javax/swing/table/TableColumnModel.java, ! javax/swing/table/TableModel.java, ! javax/swing/text/AbstractDocument.java, ! javax/swing/text/AttributeSet.java, ! javax/swing/text/BadLocationException.java, ! javax/swing/text/Caret.java, ! javax/swing/text/CharacterIterator.java, ! javax/swing/text/ComponentView.java, ! javax/swing/text/DefaultCaret.java, ! javax/swing/text/DefaultEditorKit.java, ! javax/swing/text/Document.java, ! javax/swing/text/EditorKit.java, ! javax/swing/text/Element.java, ! javax/swing/text/GapContent.java, ! javax/swing/text/JTextComponent.java, ! javax/swing/text/Keymap.java, ! javax/swing/text/MutableAttributeSet.java, ! javax/swing/text/PlainDocument.java, ! javax/swing/text/PlainEditorKit.java, ! javax/swing/text/Position.java, ! javax/swing/text/Segment.java, ! javax/swing/text/StyledDocument.java, ! javax/swing/text/StyledEditorKit.java, ! javax/swing/text/Style.java, ! javax/swing/text/TextAction.java, ! javax/swing/text/ViewFactory.java, ! javax/swing/text/View.java, ! javax/swing/Timer.java, ! javax/swing/ToggleButtonModel.java, ! javax/swing/ToolTipManager.java, ! javax/swing/tree/AbstractLayoutCache.java, ! javax/swing/tree/DefaultMutableTreeNode.java, ! javax/swing/tree/DefaultTreeCellEditor.java, ! javax/swing/tree/DefaultTreeCellRenderer.java, ! javax/swing/tree/DefaultTreeModel.java, ! javax/swing/tree/DefaultTreeSelectionModel.java, ! javax/swing/tree/ExpandVetoException.java, ! javax/swing/tree/FixedHeightLayoutCache.java, ! javax/swing/tree/MutableTreeNode.java, ! javax/swing/tree/RowMapper.java, ! javax/swing/tree/TreeCellEditor.java, ! javax/swing/tree/TreeCellRenderer.java, ! javax/swing/tree/TreeModel.java, ! javax/swing/tree/TreeNode.java, ! javax/swing/tree/TreePath.java, ! javax/swing/tree/TreeSelectionModel.java, ! javax/swing/tree/VariableHeightLayoutCache.java, ! javax/swing/UIDefaults.java, ! javax/swing/UIManager.java, ! javax/swing/undo/AbstractUndoableEdit.java, ! javax/swing/undo/CannotRedoException.java, ! javax/swing/undo/CannotUndoException.java, ! javax/swing/undo/CompoundEdit.java, ! javax/swing/undo/StateEditable.java, ! javax/swing/undo/StateEdit.java, ! javax/swing/undo/UndoableEdit.java, ! javax/swing/undo/UndoableEditSupport.java, ! javax/swing/undo/UndoManager.java, ! javax/swing/UnsupportedLookAndFeelException.java, ! javax/swing/ViewportLayout.java, ! javax/swing/WindowConstants.java: New files, from GNU Classpath. ! ! * java/awt/ActiveEvent.java, ! java/awt/Adjustable.java, java/awt/AWTError.java, ! java/awt/AWTEvent.java, java/awt/AWTEventMulticaster.java, ! java/awt/AWTException.java, java/awt/AWTPermission.java, ! java/awt/BorderLayout.java, java/awt/Button.java, java/awt/Choice.java, ! java/awt/Color.java, java/awt/Component.java, ! java/awt/ComponentOrientation.java, java/awt/Container.java, ! java/awt/datatransfer/MimeTypeParseException.java, ! java/awt/datatransfer/Transferable.java, ! java/awt/datatransfer/UnsupportedFlavorException.java, ! java/awt/Dimension.java, java/awt/event/ActionEvent.java, ! java/awt/event/ActionListener.java, ! java/awt/event/AdjustmentEvent.java, ! java/awt/event/AdjustmentListener.java, ! java/awt/event/AWTEventListener.java, ! java/awt/event/ComponentAdapter.java, ! java/awt/event/ComponentEvent.java, ! java/awt/event/ComponentListener.java, ! java/awt/event/ContainerAdapter.java, ! java/awt/event/ContainerEvent.java, ! java/awt/event/ContainerListener.java, ! java/awt/event/FocusAdapter.java, ! java/awt/event/FocusEvent.java, java/awt/event/FocusListener.java, ! java/awt/event/HierarchyBoundsAdapter.java, ! java/awt/event/HierarchyBoundsListener.java, ! java/awt/event/HierarchyEvent.java, ! java/awt/event/HierarchyListener.java, ! java/awt/event/InputEvent.java, java/awt/event/InputMethodEvent.java, ! java/awt/event/InputMethodListener.java, ! java/awt/event/InvocationEvent.java, java/awt/event/ItemEvent.java, ! java/awt/event/ItemListener.java, java/awt/event/KeyAdapter.java, ! java/awt/event/KeyEvent.java, java/awt/event/KeyListener.java, ! java/awt/event/MouseAdapter.java, java/awt/event/MouseEvent.java, ! java/awt/event/MouseListener.java, ! java/awt/event/MouseMotionAdapter.java, ! java/awt/event/MouseMotionListener.java, ! java/awt/event/PaintEvent.java, java/awt/EventQueue.java, ! java/awt/event/TextEvent.java, java/awt/event/TextListener.java, ! java/awt/event/WindowAdapter.java, java/awt/event/WindowEvent.java, ! java/awt/event/WindowListener.java, java/awt/Font.java, ! java/awt/geom/AffineTransform.java, java/awt/geom/Dimension2D.java, ! java/awt/geom/Ellipse2D.java, ! java/awt/geom/IllegalPathStateException.java, ! java/awt/geom/Line2D.java, ! java/awt/geom/NoninvertibleTransformException.java, ! java/awt/geom/PathIterator.java, java/awt/geom/Point2D.java, ! java/awt/geom/Rectangle2D.java, java/awt/geom/RectangularShape.java, ! java/awt/geom/RoundRectangle2D.java, ! java/awt/GraphicsConfiguration.java, ! java/awt/IllegalComponentStateException.java, ! java/awt/image/IndexColorModel.java, ! java/awt/Image.java, java/awt/image/MemoryImageSource.java, ! java/awt/image/PixelGrabber.java, java/awt/Insets.java, ! java/awt/ItemSelectable.java, java/awt/LayoutManager2.java, ! java/awt/LayoutManager.java, java/awt/MenuContainer.java, ! java/awt/MenuItem.java, java/awt/PaintContext.java, ! java/awt/Paint.java, java/awt/Panel.java, java/awt/Point.java, ! java/awt/Polygon.java, java/awt/PrintGraphics.java, ! java/awt/PrintJob.java, java/awt/Rectangle.java, ! java/awt/RenderingHints.java, java/awt/ScrollPane.java, ! java/awt/Shape.java, java/awt/SystemColor.java, java/awt/Toolkit.java, ! java/awt/Transparency.java, java/awt/Window.java: Merge from classpath. ! ! * java/awt/im/spi/InputMethod.java, ! java/awt/im/spi/InputMethodContext.java, ! java/awt/im/spi/InputMethodDescriptor.java, ! java/awt/image/renderable/ContextualRenderedImageFactory.java, ! java/awt/image/renderable/ParameterBlock.java, ! java/awt/image/renderable/RenderContext.java, ! java/awt/image/renderable/RenderableImage.java, ! java/awt/image/renderable/RenderableImageOp.java, ! java/awt/image/renderable/RenderableImageProducer.java, ! java/awt/image/renderable/RenderedImageFactory.java: New files from ! classpath. ! ! * gnu/java/awt/EventModifier.java, ! gnu/java/awt/image/ImageDecoder.java, ! gnu/java/awt/image/XBMDecoder.java: New files from GNU Classpath. ! ! * gnu/awt/xlib/XGraphicsConfiguration.java, ! gnu/awt/xlib/XToolkit.java: Updated to compile against 1.4 abstract ! API. ! ! * javax/swing/plaf/metal/MetalLookAndFeel.java: New file from ! GNU Classpath. ! ! * Makefile.am: Add new files. ! * Makefile.in: Rebuilt. ! ! 2002-08-07 Bryce McKinlay ! ! * java/lang/ClassLoader.java (getSystemClassLoader, findClass, ! defineClass, setSigners, getSystemResource, getSystemResourceAsStream, ! findResource, getResources, findResources): Add javadoc from classpath. ! (getSystemResources): Implemented. ! ! 2002-08-01 Mark Wielaard ! ! Revert patch that breaks libgcj shared library on powerpc: ! * gnu/java/security/provider/Gnu.java: Reverse referencing all ! implementation classes by using Class.getName(). Uses Strings again. ! * gnu/java/security/der/DEREncodingException.java, ! gnu/java/security/provider/DERReader.java, ! gnu/java/security/provider/DERWriter.java, ! gnu/java/security/provider/DSAKeyPairGenerator.java, ! gnu/java/security/provider/DSAParameterGenerator.java, ! gnu/java/security/provider/DSAParameters.java, ! gnu/java/security/provider/DSASignature.java, ! gnu/java/security/provider/GnuDSAPrivateKey.java, ! gnu/java/security/provider/GnuDSAPublicKey.java, ! gnu/java/security/provider/MD5.java, ! gnu/java/security/util/Prime.java: Removed. ! * Makefile.am (ordinary_java_source_files): Remove above files. ! * Makefile.in: Regenerate. ! * gnu/java/security/provider/DefaultPolicy.java ! (getPermissions): Revert to maintaining static class variable of ! Permissions. ! * gnu/java/security/provider/SHA.java ! (engineUpdate): Revert algorithm change. ! (engineDigest): Revert algorithm change. ! ! 2002-08-01 Kaz Kojima ! ! * configure.host: Add SH support. ! * sysdep/sh/locks.h: New file. ! ! 2002-07-31 Bryce McKinlay ! ! * java/awt/Frame.java (Frame): Remove println calls. ! ! 2002-07-30 Jeff Sturm ! ! * configure.in (LIBFFIINCS): Don't prepend MULTIBUILDTOP. ! * configure: Rebuilt. ! ! 2002-07-27 Alan Modra ! ! * sysdep/powerpc/locks.h: Formatting. ! (_LARX): Define. ! (_STCX): Define. ! (compare_and_swap): Use _LARX and _STCX. ! (compare_and_swap_release): Likewise. ! ! 2002-07-26 Tom Tromey ! ! * java/net/Authenticator.java: New version from Classpath. ! * java/net/DatagramSocketImpl.java: New version from Classpath. ! ! 2002-07-27 Alan Modra ! ! * configure.host: Add powerpc64*-* entry. ! ! 2002-07-26 Tom Tromey ! ! * java/io/natFileDescriptorPosix.cc: Don't include sys/socket.h or ! fcntl.h. ! ! 2002-07-24 Tom Tromey ! ! * java/lang/Runtime.java (loadLibrary): Pass `true' as search ! argument to _load. ! ! 2002-07-24 Tom Tromey ! Tony Kimball ! ! * java/io/natFileDescriptorWin32.cc (setLength): New method. ! * java/io/natFileDescriptorPosix.cc (setLength): New method. ! * java/io/RandomAccessFile.java (setLength): New method. ! * java/io/natFileDescriptorEcos.cc (setLength): New method. ! * java/io/FileDescriptor.java (setLength): New method. ! ! 2002-07-24 Mark Wielaard ! ! * java/lang/reflect/natField.cc (setAddr): Check isAccessible(). ! * java/io/ObjectInputStream.java (setBooleanField): Before setting ! field call setAccessible(true). ! (setByteField): Likewise. ! (setCharField): Likewise. ! (setDoubleField): Likewise. ! (setFloatField): Likewise. ! (setIntField): Likewise. ! (setLongField): Likewise. ! (setShortField): Likewise. ! (setObjectField): Likewise. ! ! 2002-07-24 Tom Tromey ! ! * java/io/ObjectInputStream.java (readObject) [TC_ARRAY]: Don't ! use toString() to format array element. ! ! 2002-07-23 Mark Wielaard ! ! * gnu/java/security/provider/MD5.java: Extends MessageDigest, not ! MessageDigestSpi (fixes Classpath bug #783). ! ! 2002-07-21 Mark Wielaard ! ! * gnu/java/security/provider/Gnu.java: Reference all implementation ! classes by using Class.getName(). ! ! 2002-07-19 Bo Thorsen ! ! * java/lang/ieeefp.h: Add x86-64 support. ! * configure.in: Likewise. ! * configure.host: Likewise. ! * configure: Regenerated. ! * sysdep/x86-64/locks.h: New file with x86-64 locks. ! ! 2002-07-16 Mark Wielaard ! ! * java/io/StreamTokenizer.java (pushBack): Update documentation. ! (whitespaceChars): call resetChar(). ! ! 2002-07-15 Tom Tromey ! ! * Makefile.in: Rebuilt. ! * Makefile.am (awt_java_source_files): Added new files. ! * java/beans/ExceptionListener.java: Merged with Classpath. ! * java/beans/PropertyChangeEvent.java: Merged with Classpath. ! * java/beans/PropertyChangeListener.java: Merged with Classpath. ! * java/beans/PropertyChangeListenerProxy.java: Merged with Classpath. ! * java/beans/PropertyChangeSupport.java: Merged with Classpath. ! * java/beans/VetoableChangeListener.java: Merged with Classpath. ! * java/beans/VetoableChangeListenerProxy.java: Merged with Classpath. ! * java/beans/VetoableChangeSupport.java: Merged with Classpath. ! ! 2002-07-14 Mark Wielaard ! ! * gnu/java/security/der/DEREncodingException.java, ! gnu/java/security/provider/DERReader.java, ! gnu/java/security/provider/DERWriter.java, ! gnu/java/security/provider/DSAKeyPairGenerator.java, ! gnu/java/security/provider/DSAParameterGenerator.java, ! gnu/java/security/provider/DSAParameters.java, ! gnu/java/security/provider/DSASignature.java, ! gnu/java/security/provider/GnuDSAPrivateKey.java, ! gnu/java/security/provider/GnuDSAPublicKey.java, ! gnu/java/security/provider/MD5.java, ! gnu/java/security/util/Prime.java: New files from Classpath. ! * Makefile.am (ordinary_java_source_files): Add new files. ! * Makefile.in: Regenerate. ! ! 2002-07-14 C. Brian Jones ! ! * gnu/java/security/provider/DefaultPolicy.java ! (getPermissions): do not maintain static class variable of ! Permissions ! * gnu/java/security/provider/SHA.java ! (engineUpdate): algorithm change ! (engineDigest): algorithm change 2002-07-12 Jesse Rosenstock For PR libgcj/7292: * java/lang/Character.java (toString(char)): Now static. + 2002-07-12 Mark Wielaard + + * java/lang/natThrowable.cc (printRawStackTrace): removed. + (getStackTrace0): new method. + * java/lang/Throwable.java (CPlusPlusDemangler): removed. + (printStackTrace(PrintWriter)): replace with pure java implementation. + (printRawStackTrace): removed. + (getStackTrace0): new method. + * java/lang/StackTraceElement.java (toString): add extra whitespace. + * gcj/javaprims.h: regenerate class list. + * include/name-finder.h (lookup): new returns StackTraceElement*. + (method_name, file_name): fields removed. + (pid2, f2_pipe, b2_pipe, b2_pipe_fd): new fields. + (~_Jv_name_finder): close new descriptors. + * name-finder.cc(_Jv_name_finder): setup c++filt helper process. + (createStackTraceElement): new method. + (lookup): returns StackTraceElement*, uses createStackTraceElement(). + + 2002-07-10 Tom Tromey + + * configure: Rebuilt. + * configure.in: Use `test' after `&&'. From Chris Faylor. + + 2002-07-08 Mark Wielaard + + * mauve-libgcj: Don't compile java.sql.Blob.BlobTest, + java.sql.Clob.ClobTest, java.sql.Connection.TestJdbc20, + java.sql.DatabaseMetaData.TestJdbc20 + + 2002-07-05 Tony Kimball + + * java/lang/natRuntime.cc (nativeGetLibname): Added missing `#'. + + 2002-07-04 Tom Tromey + Jeff Sturm + + Fix for PR libgcj/7060: + * java/lang/Class.h (_getMethod): Renamed from getMethod. + * java/lang/natClass.cc (_getMethod): Renamed from getMethod. + Recurse into superinterfaces. Don't throw NoSuchMethodException. + * java/lang/Class.java (getMethod): New Java implementation; + complies with spec. + (_getMethod): New native method. + + 2002-07-02 Tom Tromey + David Hovemeyer + + * java/text/ChoiceFormat.java + (format(double,StringBuffer,FieldPosition)): Fix fencepost error + in check loop. + * java/text/MessageFormat.java + (format(Object[],StringBuffer,FieldPosition): Pass all arguments + to MessageFormat. + + 2002-07-01 Tom Tromey + + * javax/naming/spi/NamingManager.java (getPlusPath): Don't create + StringTokenizer on null string. For PR libgcj/7180. + From daveho@cs.umd.edu. + + 2002-06-24 Tom Tromey + + * java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Removed. + (IntegerClass): Likewise. + * java/lang/natClass.cc (CloneableClass): Removed. + (ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass, + ConstructorClass): Likewise. + * java/lang/natClassLoader.cc (CloneableClass): Removed. + (ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass, + SerializableClass): Likewise. + * java/lang/reflect/natMethod.cc (BooleanClass): Removed. + (VoidClass, ByteClass, ShortClass, CharacterClass, IntegerClass, + LongClass, FloatClass, DoubleClass): Likewise. + + * verify.cc (branch_prepass): Updated for change to exception + handler type. + (verify_instructions_0): Likewise. + * defineclass.cc (handleCodeAttribute): Initialize `prepared'. + (handleExceptionTableEntry): Updated for change to exception + handler type. + * java/lang/Class.h (Class): Removed _Jv_InterpMethodInvocation. + * include/java-interp.h (_Jv_InterpMethodInvocation): Removed. + (union _Jv_InterpPC): New. + (class _Jv_InterpException): Changed types to _Jv_InterpPC. + (class _Jv_InterpMethod): Added new `prepared' field. + (class _Jv_InterpMethod): Added `compile' method. Removed + `continue1' and `find_exception'. Changed arguments to `run'. + * interpret.cc (union insn_slot): New. + (find_exception): Removed. + (run_normal): Removed most logic. + (run_synch_object): Likewise; also, use JvSynchronize. + (run_synch_class): Likewise. + (run): Removed. + (continue1): Renamed as `run'. Compile bytecode if required. + Add new code to allow refinement of direct-threaded code at + runtime. Handle exceptions. + (SAVE_PC): Removed. + (compile): New method. + (SET_ONE, SET_INSN, SET_INT, SET_DATUM): New defines. + (NULLARRAYCHECK): Don't use SAVE_PC. + (pc_t): New typedef. + (TAKE_GOTO, GET1S, GET1U, GET2U, AVAL1U, AVAL2U, AVAL2UP, + SKIP_GOTO, GOTO_VAL, PCVAL, AMPAMP): New macros. + 2002-06-23 Tom Tromey + * configure: Rebuilt. + * configure.in (INTERPRETER): New subst. + (AM_RUNTESTFLAGS): Don't subst. + * Makefile.in: Rebuilt. * Makefile.am ($(srcdir)/java/lang/Object.h, $(srcdir)/java/lang/Class.h): Added dummy targets. + 2002-06-21 Bryce McKinlay + + Reformat JDBC classes and add new JDK 1.4 classes and methods. + + * java/sql/ParameterMetaData.java, java/sql/SQLPermission.java, + java/sql/Savepoint.java: New files. + * java/sql/Array.java, java/sql/BatchUpdateException.java, + java/sql/Blob.java, java/sql/CallableStatement.java, + java/sql/Clob.java, java/sql/Connection.java, + java/sql/DataTruncation.java, java/sql/DatabaseMetaData.java, + java/sql/Date.java, java/sql/Driver.java, java/sql/DriverManager.java, + java/sql/DriverPropertyInfo.java, java/sql/PreparedStatement.java, + java/sql/Ref.java, java/sql/ResultSet.java, + java/sql/ResultSetMetaData.java, java/sql/SQLData.java + java/sql/SQLException.java, java/sql/SQLInput.java, + java/sql/SQLOutput.java, java/sql/SQLWarning.java + java/sql/Statement.java, java/sql/Struct.java, java/sql/Time.java, + java/sql/Timestamp.java, java/sql/Types.java: Updated to JDBC 3.0 + (JDK 1.4) specification. + * javax/sql/ConnectionEvent.java, + javax/sql/ConnectionEventListener.java, + javax/sql/ConnectionPoolDataSource.java, + javax/sql/DataSource.java, javax/sql/PooledConnection.java, + javax/sql/RowSetEvent.java, javax/sql/RowSetInternal.java, + javax/sql/RowSet.java, javax/sql/RowSetListener.java, + javax/sql/RowSetMetaData.java, javax/sql/RowSetReader.java, + javax/sql/RowSetWriter.java, javax/sql/XAConnection.java, + javax/sql/XADataSource.java: New files. + * Makefile.am: Add new files. + * Makefile.in: Rebuilt. + + 2002-06-20 Tom Tromey + + For PR libgcj/7073: + * resolve.cc (_Jv_PrepareClass): Only resolve superclass if it + exists. + * defineclass.cc (handleClassBegin): Superclass for interface is + `null'. + + 2002-06-18 Tom Tromey + + * gcj/javaprims.h: Updated class declaration list. + * Makefile.in: Rebuilt. + * Makefile.am (core_java_source_files): Removed + BasicMapEntry.java. + * java/util/BasicMapEntry.java: Removed. + + 2002-06-18 Jeff Sturm + + * java/net/natPlainDatagramSocketImpl.cc (receive): + Check bounds of argument to FD_SET. + (setOption): Throw exception if socket is closed. + + * java/net/natPlainSocketImpl.cc (accept, read): + Check bounds of argument to FD_SET. + (setOption): Throw exception if socket is closed. + + 2002-06-18 Tom Tromey + + * gcj/javaprims.h: Updated class declaration list. + * Makefile.in: Rebuilt. + * Makefile.am (core_java_source_files): Added + PropertyPermissionCollection.java. + * java/lang/Thread.java (group, name): Now package-private. + * java/lang/ThreadGroup.java: Re-merge with Classpath. + * java/util/AbstractList.java: Likewise. + * java/util/AbstractMap.java: Likewise. + * java/util/Calendar.java: Likewise. + * java/util/Collections.java: Likewise. + * java/util/HashMap.java: Likewise. + * java/util/Hashtable.java: Likewise. + * java/util/LinkedHashMap.java: Likewise. + * java/util/LinkedList.java: Likewise. + * java/util/List.java: Likewise. + * java/util/ListResourceBundle.java: Likewise. + * java/util/Map.java: Likewise. + * java/util/Observable.java: Likewise. + * java/util/Properties.java: Likewise. + * java/util/PropertyPermission.java: Likewise. + * java/util/PropertyPermissionCollection.java: Likewise. + * java/util/PropertyResourceBundle.java: Likewise. + * java/util/Random.java: Likewise. + * java/util/SimpleTimeZone.java: Likewise. + * java/util/StringTokenizer.java: Likewise. + * java/util/TimerTask.java: Likewise. + * java/util/TreeMap.java: Likewise. + * java/util/WeakHashMap.java: Likewise. + * java/util/jar/Attributes.java: Likewise. + * java/util/jar/JarException.java: Likewise. + * java/util/jar/Manifest.java: Likewise. + + 2002-06-17 Tom Tromey + + * gcj/javaprims.h: Updated class declaration list. + * Makefile.in: Rebuilt. + * Makefile.am (core_java_source_files): Added new file. + * java/util/EventListenerProxy.java: New file. + * java/util/EventListener.java: Re-merge with Classpath. + * java/util/EventObject.java: Re-merge with Classpath. + + 2002-06-17 Nathanael Nerode + + * java/lang/ClassNotFoundException.java: New Classpath version. + + 2002-06-17 Nathanael Nerode + + * java/rmi/activation/ActivateFailedException.java: Remerge from + Classpath version. + * java/rmi/activation/ActivationException.java: Ditto. + * java/rmi/activation/UnknownGroupException.java: Ditto. + * java/rmi/activation/UnknownObjectException.java: Ditto. + * java/rmi/server/ExportException: Ditto. + * java/rmi/server/ServerCloneException: Ditto. + * java/rmi/server/ServerNotActiveException: Ditto. + * java/rmi/server/SkeletonMismatchException: Ditto. + * java/rmi/server/SkeletonNotFoundException: Ditto. + * java/rmi/server/SocketSecurityException: Ditto. + + 2002-06-16 Tom Tromey + + * gcj/javaprims.h: Updated class declaration list. + + * java/io/LineNumberInputStream.java: Merged with Classpath. + + * java/lang/RuntimeException.java: Re-merge with Classpath. + * java/util/ArrayList.java: Likewise. + * java/util/Arrays.java: Likewise. + * java/util/BitSet.java: Likewise. + * java/util/Dictionary.java: Likewise. + * java/util/IdentityHashMap.java: Likewise. + * java/util/MissingResourceException.java: Likewise. + * java/util/Observer.java: Likewise. + * java/util/TooManyListenersException.java: Likewise. + * java/util/zip/DataFormatException.java: Likewise. + * java/util/zip/ZipException.java: Likewise. + + 2002-06-16 Nathanael Nerode + + * java/rmi/AccessException.java: Remerge from Classpath. + * java/rmi/AlreadyBoundException.java: Ditto. + * java/rmi/ConnectException.java: Ditto. + * java/rmi/ConnectIOException.java: Ditto. + * java/rmi/MarshalException.java: Ditto. + * java/rmi/NoSuchObjectException.java: Ditto. + * java/rmi/NotBoundException.java: Ditto. + * java/rmi/RemoteException.java: Ditto. + * java/rmi/RMISecurityException.java: Ditto. + * java/rmi/ServerError.java: Ditto. + * java/rmi/ServerException.java: Ditto. + * java/rmi/ServerRuntimeException.java: Ditto. + * java/rmi/StubNotFoundException.java: Ditto. + * java/rmi/UnexpectedExcpetion.java: Ditto. + * java/rmi/UnknownHostException.java: Ditto. + * java/rmi/UnmarshalException.java: Ditto. + + 2002-06-15 Tom Tromey + + * java/lang/AbstractMethodError.java: Re-merged with Classpath. + * java/lang/ArithmeticException.java: Likewise. + * java/lang/ArrayIndexOutOfBoundsException.java: Likewise. + * java/lang/ArrayStoreException.java: Likewise. + * java/lang/Byte.java: Likewise. + * java/lang/CharSequence.java: Likewise. + * java/lang/ClassCastException.java: Likewise. + * java/lang/ClassCircularityError.java: Likewise. + * java/lang/ClassFormatError.java: Likewise. + * java/lang/CloneNotSupportedException.java: Likewise. + * java/lang/Cloneable.java: Likewise. + * java/lang/Comparable.java: Likewise. + * java/lang/Compiler.java: Likewise. + * java/lang/Error.java: Likewise. + * java/lang/ExceptionInInitializerError.java: Likewise. + * java/lang/IllegalAccessError.java: Likewise. + * java/lang/IllegalAccessException.java: Likewise. + * java/lang/IllegalArgumentException.java: Likewise. + * java/lang/IllegalMonitorStateException.java: Likewise. + * java/lang/IllegalStateException.java: Likewise. + * java/lang/IllegalThreadStateException.java: Likewise. + * java/lang/IncompatibleClassChangeError.java: Likewise. + * java/lang/IndexOutOfBoundsException.java: Likewise. + * java/lang/InheritableThreadLocal.java: Likewise. + * java/lang/InstantiationError.java: Likewise. + * java/lang/InstantiationException.java: Likewise. + * java/lang/InternalError.java: Likewise. + * java/lang/InterruptedException.java: Likewise. + * java/lang/LinkageError.java: Likewise. + * java/lang/NegativeArraySizeException.java: Likewise. + * java/lang/NoClassDefFoundError.java: Likewise. + * java/lang/NoSuchFieldError.java: Likewise. + * java/lang/NoSuchFieldException.java: Likewise. + * java/lang/NoSuchMethodError.java: Likewise. + * java/lang/NoSuchMethodException.java: Likewise. + * java/lang/NullPointerException.java: Likewise. + * java/lang/NumberFormatException.java: Likewise. + * java/lang/OutOfMemoryError.java: Likewise. + * java/lang/Process.java: Likewise. + * java/lang/Runnable.java: Likewise. + * java/lang/RuntimePermission.java: Likewise. + * java/lang/SecurityException.java: Likewise. + * java/lang/Short.java: Likewise. + * java/lang/StackOverflowError.java: Likewise. + * java/lang/StringIndexOutOfBoundsException.java: Likewise. + * java/lang/ThreadDeath.java: Likewise. + * java/lang/ThreadLocal.java: Likewise. + * java/lang/UnknownError.java: Likewise. + * java/lang/UnsatisfiedLinkError.java: Likewise. + * java/lang/UnsupportedClassVersionError.java: Likewise. + * java/lang/UnsupportedOperationException.java: Likewise. + * java/lang/VerifyError.java: Likewise. + * java/lang/VirtualMachineError.java: Likewise. + * java/lang/reflect/InvocationTargetException.java: Likewise. + * java/net/BindException.java: Likewise. + * java/net/ConnectException.java: Likewise. + * java/net/MalformedURLException.java: Likewise. + * java/net/NoRouteToHostException.java: Likewise. + * java/net/ProtocolException.java: Likewise. + * java/net/SocketException.java: Likewise. + * java/net/UnknownHostException.java: Likewise. + * java/net/UnknownServiceException.java: Likewise. + + * java/io/BufferedOutputStream.java: Re-merged with Classpath. + * java/io/CharConversionException.java: Likewise. + * java/io/EOFException.java: Likewise. + * java/io/FileNotFoundException.java: Likewise. + * java/io/IOException.java: Likewise. + * java/io/InterruptedIOException.java: Likewise. + * java/io/InvalidClassException.java: Likewise. + * java/io/InvalidObjectException.java: Likewise. + * java/io/NotActiveException.java: Likewise. + * java/io/NotSerializableException.java: Likewise. + * java/io/ObjectStreamException.java: Likewise. + * java/io/ObjectStreamConstants.java: Likewise. + * java/io/OptionalDataException.java: Likewise. + * java/io/PipedInputStream.java: Likewise. + * java/io/PushbackInputStream.java: Likewise. + * java/io/StreamCorruptedException.java: Likewise. + * java/io/SyncFailedException.java: Likewise. + * java/io/UTFDataFormatException.java: Likewise. + * java/io/UnsupportedEncodingException.java: Likewise. + * java/io/WriteAbortedException.java: Likewise. + + 2002-06-15 Nathanael Nerode + + * java/text/ChoiceFormat.java: Update comments from Classpath. + * java/text/ParseException.java (serialVersionUID): New + field from Classpath. + * java/text/ParseException.java: Update formatting & comments + from Classpath. + + 2002-06-15 Tom Tromey + + * java/util/zip/InflaterInputStream.java (read): Loop if data has + been read but none output by inflater. + * java/util/zip/natDeflater.cc (reset): Set is_finished. + * java/util/zip/natInflater.cc (reset): Set dist_needed and + is_finished. + * java/util/zip/ZipOutputStream.java: Replaced with Classpath + version. + * java/util/zip/ZipFile.java: Replaced with Classpath version. + * java/util/zip/ZipEntry.java: Replaced with Classpath version. + * java/util/zip/ZipInputStream.java: Replaced with Classpath + version. + * java/util/zip/ZipConstants.java: Replaced with Classpath version. + + 2002-06-13 Tom Tromey + + * java/lang/natString.cc (init): Handle case where DONT_COPY is + true and OFFSET!=0. + * java/lang/String.java (String(char[],int,int,boolean): New + constructor. + * java/lang/Long.java: Imported new version from Classpath. + * java/lang/Number.java: Likewise. + * java/lang/Integer.java: Likewise. + * java/lang/Long.java: Likewise. + * java/lang/Float.java: Likewise. + * java/lang/Boolean.java: Likewise. + * java/lang/Double.java: Likewise. + * java/lang/Void.java: Likewise. + + 2002-06-12 Tom Tromey + + * java/io/natFilePosix.cc (getCanonicalPath): Treat "" like ".". + Fixes PR libgcj/6652. + + 2002-06-10 Tom Tromey + + * java/lang/Class.h (Class::desiredAssertionStatus): Declare. + (Class::getPackagePortion): Likewise. + * java/lang/Class.java (desiredAssertionStatus): New method from + Classpath. + (getPackagePortion): Likewise. + * java/lang/VMClassLoader.java (defaultAssertionStatus, + packageAssertionStatus, classAssertionStatus): New methods from + Classpath. + * java/lang/ClassLoader.java (defaultAssertionStatus, + systemPackageAssertionStatus, packageAssertionStatus, + systemClassAssertionStatus, classAssertionStatus): New fields from + Classpath. + (setDefaultAssertionStatus, setPackageAssertionStatus, + setClassAssertionStatus, clearAssertionStatus): New methods from + Classpath. + * Makefile.in: Rebuilt. + * Makefile.am (core_java_source_files): Added AssertionError.java. + * java/lang/AssertionError.java: New from Classpath. + 2002-06-10 Bryce McKinlay * configure.host: Disable hash synchronization and slow_pthread_self *************** *** 58,85 **** * java/io/natFileDescriptorWin32.cc (open): Disable Win32 file locking, just like the Sun JVM does. ! ! 2002-06-03 Mark Mitchell ! ! 2002-05-23 Bryce McKinlay * Makefile.am (all-recursive): Depend on $all_java_class_files so that they build first. * Makefile.in: Rebuilt. ! 2002-05-08 Mark Mitchell ! * Makefile.am (all_java_source_files): New variable. ! (all_java_class_files): Likewise. ! .java.class: New rule. ! (CLEANFILES): Remove tmp-list. ! * Makefile.in: Regenerated. ! ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. 2002-05-09 Jakub Jelinek --- 5198,5381 ---- * java/io/natFileDescriptorWin32.cc (open): Disable Win32 file locking, just like the Sun JVM does. ! ! 2002-06-05 H.J. Lu (hjl@gnu.org) ! ! * Makefile.am (libgcj_convenience.la): Revert the last change. ! (libgcj.la): Likewise. ! * Makefile.in: Regenerated. ! ! 2002-06-04 H.J. Lu (hjl@gnu.org) ! ! * Makefile.am (libgcj_convenience.la): New target. ! (libgcj.la): Depend on libgcj_convenience.la. ! * Makefile.in: Regenerated. ! ! 2002-06-04 H.J. Lu (hjl@gnu.org) ! ! * configure.in (--with-newlib): New option: ! Check ${with_newlib} instead of ${with_cross_host} for newlib. ! (HAVE_PROC_SELF_EXE): Defined to 1 only for cross compiling to ! Linux. ! * configure: Regenerated. ! ! 2002-06-04 Tom Tromey ! ! * java/util/natTimeZone.cc: Include . ! ! 2002-05-29 Ulrich Weigand ! ! * configure.host [s390*-linux*]: Set can_unwind_signal=yes. ! * configure.in [s390*-*-linux*]: Do not define HAVE_BACKTRACE. ! Set SIGNAL_HANDLER=include/s390-linux.h. ! * configure: Regenerate. ! * include/s390-linux.h: New file. ! ! 2002-05-24 Bryce McKinlay ! ! * java/lang/natThrowable.cc (fillInStackTrace): Use "stackTraceBytes", ! not "stackTrace". ! ! 2002-05-24 Bryce McKinlay ! ! Merge JDK 1.4 java.security changes from classpath. ! ! * java/security/AccessControlException.java: Merge from Classpath. ! * java/security/AccessController.java: Likewise. ! * java/security/AllPermission.java: Likewise. ! * java/security/BasicPermission.java: Likewise. ! * java/security/Certificate.java: Likewise. ! * java/security/CodeSource.java: Likewise. ! * java/security/DigestException.java: Likewise. ! * java/security/DigestOutputStream.java: Likewise. ! * java/security/DomainCombiner.java: Likewise. ! * java/security/GeneralSecurityException.java: Likewise. ! * java/security/Guard.java: Likewise. ! * java/security/GuardedObject.java: Likewise. ! * java/security/InvalidAlgorithmParameterException.java: Likewise. ! * java/security/InvalidKeyException.java: Likewise. ! * java/security/InvalidParameterException.java: Likewise. ! * java/security/Key.java: Likewise. ! * java/security/KeyException.java: Likewise. ! * java/security/KeyManagementException.java: Likewise. ! * java/security/KeyStoreException.java: Likewise. ! * java/security/MessageDigest.java: Likewise. ! * java/security/NoSuchAlgorithmException.java: Likewise. ! * java/security/NoSuchProviderException.java: Likewise. ! * java/security/Permission.java: Likewise. ! * java/security/PermissionCollection.java: Likewise. ! * java/security/Permissions.java: Likewise. ! * java/security/Policy.java: Likewise. ! * java/security/Principal.java: Likewise. ! * java/security/PrivateKey.java: Likewise. ! * java/security/PrivilegedAction.java: Likewise. ! * java/security/PrivilegedActionException.java: Likewise. ! * java/security/PrivilegedExceptionAction.java: Likewise. ! * java/security/ProtectionDomain.java: Likewise. ! * java/security/ProviderException.java: Likewise. ! * java/security/PublicKey.java: Likewise. ! * java/security/SecureClassLoader.java: Likewise. ! * java/security/SecurityPermission.java: Likewise. ! * java/security/SignatureException.java: Likewise. ! * java/security/UnrecoverableKeyException.java: Likewise. ! * java/security/UnresolvedPermission.java: Likewise. ! * java/security/acl/AclNotFoundException.java: Likewise. ! * java/security/acl/LastOwnerException.java: Likewise. ! * java/security/acl/NotOwnerException.java: Likewise. ! * java/security/cert/CRLException.java: Likewise. ! * java/security/cert/CertificateEncodingException.java: Likewise. ! * java/security/cert/CertificateException.java: Likewise. ! * java/security/cert/CertificateExpiredException.java: Likewise. ! * java/security/cert/CertificateFactory.java: Likewise. ! * java/security/cert/CertificateNotYetValidException.java: Likewise. ! * java/security/cert/CertificateParsingException.java: Likewise. ! * java/security/spec/InvalidKeySpecException.java: Likewise. ! * java/security/spec/InvalidParameterSpecException.java: Likewise. ! ! * java/security/cert/CertPath.java: New file. ! * java/security/cert/CertPathBuilderException.java: New file. ! * java/security/cert/CertPathValidatorException.java: New file. ! * java/security/cert/CertStoreException.java: New file. ! ! * Makefile.am: Add new CertPath classes. ! * Makefile.in: Rebuilt. ! ! * gnu/java/util/EmptyEnumeration.java: New file from classpath. ! ! 2002-05-24 Bryce McKinlay ! ! Merge JDK 1.4 exception chaining support from classpath. ! ! * java/lang/Throwable.java: Merge 1.4 support from classpath. ! (stackTraceBytes): Rename from stackTrace. ! * java/lang/Exception.java: Merge from classpath. ! * java/lang/StackTraceElement: New file from classpath. ! * gcj/javaprims.h: Rebuild CNI namespace declarations. ! * Makefile.am: Add StackTraceElement. ! * Makefile.in: Rebuilt. ! ! 2002-05-23 Bryce McKinlay ! * Makefile.am (all-recursive): Depend on $all_java_class_files so that they build first. * Makefile.in: Rebuilt. ! 2002-05-16 Rainer Orth ! * acinclude.m4: Allow for PWDCMD to override hardcoded pwd. ! * configure.in: Likewise. ! * aclocal.m4: Regenerate. ! * configure: Regenerate. ! 2002-05-13 Tom Tromey ! * java/lang/natRuntime.cc: Don't include sys/time.h and time.h. ! * java/util/natTimeZone.cc: Include sys/time.h and time.h here. ! Include platform.h. ! ! Fixes PR libgcj/6389: ! * Makefile.in: Rebuilt. ! * Makefile.am (nat_source_files): Added natTimeZone.cc. ! * java/util/natTimeZone.cc: New file. ! * java/util/TimeZone.java (getDefaultTimeZoneId): New method. ! * java/lang/System.java: Merged with Classpath. ! * java/lang/Runtime.java: Merged with Classpath. ! * java/lang/natSystem.cc (setErr0): Renamed from setErr; don't run ! security check. ! (setIn0): Renamed from setIn; don't run security check. ! (setOut0): Renamed from setOut; don't run security check. ! (file_encoding, getpwuid_adaptor, getSystemTimeZone, ! init_properties): Moved to natRuntime.cc. ! Moved many includes to natRuntime.cc. ! (isWordsBigEndian): New method. ! * java/lang/natRuntime.cc: Include Long.h, also other includes ! previously in natSystem.cc. ! (maxMemory): New function. ! (exitInternal): Renamed from `_exit'. ! (exit): Removed. ! (init): Don't set finalize_on_exit. ! (exitInternal): Use `finalizeOnExit'. ! (file_encoding, getpwuid_adaptor): New functions from ! natSystem.cc. ! (insertSystemProperties): New method, renamed from ! System::init_properties. Don't set user.timezone. ! (_load): Don't call checkLink. ! (execInternal): New method. ! (availableProcessors): Likewise. ! (nativeGetLibname): Likewise. ! ! 2002-05-11 Mark Wielaard ! ! * gnu/java/text/SentenceBreakIterator.java (next): Skip all java white ! space characters. ! (previous_internal): Likewise. ! ! 2002-05-09 Tom Tromey ! ! * jni.cc (_Jv_JNIFunctions): Fixed typo. ! ! * java/util/ResourceBundle.java: New version from Classpath. ! * java/util/Locale.java: Likewise. 2002-05-09 Jakub Jelinek *************** *** 87,98 **** --- 5383,5440 ---- multilib dirs containing libgcc_s*.so.1 below gcc object dir to LD_LIBRARY_PATH. + 2002-05-08 Mark Mitchell + + * libjava/Makefile.am (all_java_source_files): New variable. + (all_java_class_files): Likewise. + .java.class: New rule. + (CLEANFILES): Remove tmp-list. + * libjava/Makefile.in: Regenerated. + + 2002-05-09 David.Billinghurst + + * testsuite/lib/libjava.exp (test_libjava_from_javac): + Append .exe to executable names. Fix for cygwin. + 2002-05-08 Alexandre Oliva * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at script entry, and set LD to it when configuring multilibs. * configure: Rebuilt. + 2002-05-07 Tom Tromey + + * java/lang/natString.cc (unintern): Fixed typo. + + 2002-05-06 David.Billinghurst + + * testsuite/lib/libjava.exp (libjava_arguments): Don't link + with -no-install on *-*-cygwin*. + + 2002-05-06 David.Billinghurst + + * testsuite/lib/libjava.exp (test_libjava_from_source): + Add comment explaining last patch + + 2002-05-04 David Billinghurst + + * testsuite/lib/libjava.exp (test_libjava_from_source): + Append .exe to executable names. If no suffix is present, + then ".exe" is added by default on win32. Harmless + elsewhere so always do it. + + 2002-05-03 David Billinghurst + Tom Tromey + + * java/lang/natSystem.cc (getSystemTimeZone): Use + HAVE_UNDERSCORE_TIMEZONE. + * include/config.h.in: Rebuilt. + * acconfig.h (HAVE_UNDERSCORE_TIMEZONE, HAVE_BACKTRACE): Undef. + * aclocal.m4, configure: Rebuilt. + * acinclude.m4: Run AC_EXEEXT. + * configure.in: Adjust test for `timezone' so it fails on Cygwin. + Add test for `_timezone'. + 2002-05-03 Alexandre Oliva Suggested by Rainer Orth *************** *** 100,106 **** (gij_LDADD, rmic_LDADD, rmiregistry_LDADD): Likewise. * Makefile.in: Rebuilt. ! 2002-05-02 Hans Boehm * include/dwarf2-signal.h (INIT_SEGV, INIT_FPE for ia64): use sigaction instead of __libc_sigaction. --- 5442,5448 ---- (gij_LDADD, rmic_LDADD, rmiregistry_LDADD): Likewise. * Makefile.in: Rebuilt. ! 2002-05-02 Hans Boehm * include/dwarf2-signal.h (INIT_SEGV, INIT_FPE for ia64): use sigaction instead of __libc_sigaction. *************** *** 117,122 **** --- 5459,5483 ---- * include/dwarf2-signal.h (INIT_SEGV, INIT_FPE): Don't use __libc_sigaction on Sparc. + 2002-05-02 Jerome Marc + + * java/net/natPlainSocketImpl.cc: Include sys/ioctl.h and + sys/filio.h, if present. + + 2002-04-30 Tom Tromey + + * java/io/BufferedReader.java (fill): Handle case where markPos + point to ignored \n. Fixes PR libgcj/6301. + + 2002-04-29 Gerhard Tonn + + * java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN for S/390. + + 2002-04-29 Adam King + + * java/io/natFileDescriptorWin32.cc (open): Move file pointer to end + of file in APPEND mode. + 2002-04-25 David S. Miller PR target/6422 *************** *** 124,130 **** program counter to next program counter minus 8. Update comments in this macro to explain why. ! 2002-04-22 Tom Tromey * gnu/gcj/natCore.cc (create): Use __builtin_alloca, and compute correct length of UTF-8 encoded name. Strip leading `/'. --- 5485,5503 ---- program counter to next program counter minus 8. Update comments in this macro to explain why. ! 2002-04-26 Tom Tromey ! ! * verify.cc (construct_primitive_array_type) [void_type]: New ! case. ! (branch_prepass): Added dummy entries for unused instruction ! values. ! (verify_instructions_0): Likewise. ! * interpret.cc (continue1): Comment fix. ! * include/java-insns.h (op_xxxunusedxxx1): Removed. ! * Makefile.in: Rebuilt. ! * Makefile.am: Added -Wswitch-enum. ! ! 2002-04-24 Tom Tromey * gnu/gcj/natCore.cc (create): Use __builtin_alloca, and compute correct length of UTF-8 encoded name. Strip leading `/'. *************** *** 168,181 **** 2002-04-17 Adam King ! * java/io/File.java (normalizePath): Add Win32 support for auto conversion of a '/' path separator to Win32's '\' separator. - 2002-04-16 DJ Delorie - - * configure.in: Allow building in $srcdir. - * configure: Regenerated. - 2002-04-16 Tom Tromey Fix for PR libgcj/6081: --- 5541,5549 ---- 2002-04-17 Adam King ! * java/io/File.java (normalizePath): Add Win32 support for auto conversion of a '/' path separator to Win32's '\' separator. 2002-04-16 Tom Tromey Fix for PR libgcj/6081: *************** *** 193,203 **** (_access, _stat, attr, getCanonicalPath, performMkdir, performRenameTo): Don't use fixed-size array. (getCanonicalPath): Use throw, not _Jv_Throw. - - 2002-04-15 Mark Wielaard ! * java/lang/Integer.java (getInteger(String,Integer): Return def when ! nm is null or the empty String. 2002-04-14 Mark Wielaard --- 5561,5571 ---- (_access, _stat, attr, getCanonicalPath, performMkdir, performRenameTo): Don't use fixed-size array. (getCanonicalPath): Use throw, not _Jv_Throw. ! 2002-04-15 DJ Delorie ! ! * configure.in: Allow building in $srcdir. ! * configure: Regenerated. 2002-04-14 Mark Wielaard *************** *** 210,221 **** 2002-04-13 Adam King ! * java/lang/natDouble.cc (parseDouble): Allow a number to end with the f/F/d/D modifiers. ! 2002-04-11 Tom Tromey ! * win32.cc (_Jv_platform_initProperties): Fix spelling of _Jv_Free. 2002-04-11 Bryce McKinlay --- 5578,5593 ---- 2002-04-13 Adam King ! * java/lang/natDouble.cc (parseDouble): Allow a number to end with the f/F/d/D modifiers. ! 2002-04-12 Anthony Green ! * Makefile.am (jardir, jar_DATA): Define (for libgcj.jar). ! Create libgcj-@gcc_version@.jar instead of libgcj.jar. ! * Makefile.in: Rebuilt. ! * configure.in: Substitute gcc_version. ! * configure: Rebuilt. 2002-04-11 Bryce McKinlay *************** *** 224,230 **** * configure.in: Set CHECKREFSPEC and DIVIDESPEC if not using SJLJ exceptions and can_unwind_signal isn't set. * configure: Rebuilt. ! 2002-04-11 Adam King Tom Tromey --- 5596,5606 ---- * configure.in: Set CHECKREFSPEC and DIVIDESPEC if not using SJLJ exceptions and can_unwind_signal isn't set. * configure: Rebuilt. ! ! 2002-04-11 Tom Tromey ! ! * win32.cc (_Jv_platform_initProperties): Fix spelling of _Jv_Free. ! 2002-04-11 Adam King Tom Tromey *************** *** 234,255 **** and _Jv_free. Correctly invoke GetTempPath(). Indentation fixes. ! 2002-04-09 Anthony Green - * Makefile.am (jardir, jar_DATA): Define (for libgcj.jar). - Create libgcj-@gcc_version@.jar instead of libgcj.jar. * Makefile.in: Rebuilt. ! * configure.in: Substitute gcc_version. ! * configure: Rebuilt. 2002-04-09 Tom Tromey * win32.cc (_Jv_platform_initProperties): Use GetTempPath. - 2002-04-05 Adam Megacz - - * exception.cc (abort): added static modifier - 2002-04-08 Alberto Biancardi Fix for PR libgcj/6187: --- 5610,5652 ---- and _Jv_free. Correctly invoke GetTempPath(). Indentation fixes. ! 2002-04-10 Tom Tromey * Makefile.in: Rebuilt. ! * Makefile.am (java/lang/Thread.h): Mark ! _Jv_AttachCurrentThreadAsDaemon as friend. ! * gcj/javaprims.h (_Jv_AttachCurrentThreadAsDaemon): Declare. ! * gcj/cni.h (JvAttachCurrentThreadAsDaemon): New function. ! * java/lang/natThread.cc (_Jv_AttachCurrentThreadAsDaemon): New ! function. ! * java/lang/natRuntime.cc (_load): Recognize JNI_VERSION_1_4. ! * jni.cc (_Jv_JNI_GetVersion): Return JNI_VERSION_1_4. ! (_Jv_JNI_InvokeFunctions): Added ! _Jv_JNI_AttachCurrentThreadAsDaemon. ! (_Jv_JNI_GetEnv): Handle JNI_VERSION_1_4. ! (JNI_GetDefaultJavaVMInitArgs): Likewise. ! (JNI_CreateJavaVM): Likewise. ! (_Jv_JNI_AttachCurrentThread): Likewise. ! (_Jv_JNI_AttachCurrentThread): Added `is_daemon' argument. ! (_Jv_JNI_AttachCurrentThreadAsDaemon): New method. ! (_Jv_JNIFunctions): Initialize new fields. ! (_Jv_JNI_NewDirectByteBuffer): New function. ! (_Jv_JNI_GetDirectBufferAddress): Likewise. ! (_Jv_JNI_GetDirectBufferCapacity): Likewise. ! * include/jni.h (JNI_VERSION_1_4): New macro. ! (JNIInvokeInterface::AttachCurrentThreadAsDaemon): New field. ! (_Jv_JavaVM::AttachCurrentThreadAsDaemon): New method. ! (JNINativeInterface::NewDirectByteBuffer): New field. ! (JNINativeInterface::GetDirectBufferAddress): New field. ! (JNINativeInterface::GetDirectBufferCapacity): New field. ! (_Jv_JNIEnv::NewDirectByteBuffer): New method. ! (_Jv_JNIEnv::GetDirectBufferAddress): New method. ! (_Jv_JNIEnv::GetDirectBufferCapacity): New method. 2002-04-09 Tom Tromey * win32.cc (_Jv_platform_initProperties): Use GetTempPath. 2002-04-08 Alberto Biancardi Fix for PR libgcj/6187: *************** *** 258,278 **** 2002-04-07 Mark Wielaard ! * java/util/AbstractMap.java (putAll): Use entrySet size. ! (toString): Explicitly use getKey() and getValue(). 2002-04-07 Mark Wielaard * java/util/Hashtable.java (contains): Remove NullPointer check. (containsValue): Add NullPointer check. ! (remove): Always throw NullPointerException when key is null. 2002-04-07 Adam King * java/lang/natSystem.cc (init_properties): Call new function _Jv_platform_initProperties. ! * win32.cc (_Jv_platform_initProperties): New function that adds Win32 ! support for the System properties os.name, os.arch, os.version, user.name, user.home, and user.dir. * include/posix.h, include/win32.h, posix.cc: New function _Jv_platform_initProperties. --- 5655,5676 ---- 2002-04-07 Mark Wielaard ! * java/util/AbstractMap.java (putAll): Use entrySet size. ! (toString): Explicitly use getKey() and getValue(). 2002-04-07 Mark Wielaard * java/util/Hashtable.java (contains): Remove NullPointer check. (containsValue): Add NullPointer check. ! (remove): Always throw NullPointerException when key ! is null. 2002-04-07 Adam King * java/lang/natSystem.cc (init_properties): Call new function _Jv_platform_initProperties. ! * win32.cc (_Jv_platform_initProperties): New function that adds Win32 ! support for the System properties os.name, os.arch, os.version, user.name, user.home, and user.dir. * include/posix.h, include/win32.h, posix.cc: New function _Jv_platform_initProperties. *************** *** 297,302 **** --- 5695,5704 ---- * java/util/ArrayList.java (removeRange): If toIndex == fromIndex do nothing, if toIndex < fromIndex throw IndexOutIfBoundsException. + 2002-04-05 Adam Megacz + + * exception.cc (abort): added static modifier + 2002-04-04 Adam Megacz * include/win32.h (_Jv_platform_close_on_exec): added inline *************** *** 304,311 **** 2002-04-04 Loren J. Rittle ! * configure.host: Add case statement to support generic port ! properties. Add *-*-freebsd* section. 2002-04-04 Mark Wielaard --- 5706,5713 ---- 2002-04-04 Loren J. Rittle ! * configure.host: Add case statement to support generic port ! properties. Add *-*-freebsd* section. 2002-04-04 Mark Wielaard *************** *** 325,335 **** * java/lang/reflect/Modifier.java (toString(int,StringBuffer)): Fix ordering. - 2002-04-02 Mark Wielaard - - * java/lang/Long.java (getLong(String,Long)): Actually decode property - value, not key. - 2002-04-02 Tom Tromey * java/lang/natClassLoader.cc (findClass): Compare against `3', --- 5727,5732 ---- *************** *** 337,343 **** 2002-04-02 Mark Wielaard ! * mauve-libgcj: add java.net.DatagramSocket.DatagramSocketTest2 to list of testsuite crashers. 2002-04-02 Bryce McKinlay --- 5734,5740 ---- 2002-04-02 Mark Wielaard ! * mauve-libgcj: add java.net.DatagramSocket.DatagramSocketTest2 to list of testsuite crashers. 2002-04-02 Bryce McKinlay *************** *** 345,354 **** * java/util/IdentityHashMap.java (put): Set new threshold correctly when resizing table. - 2002-04-01 Loren J. Rittle - - * include/posix-threads.h: Support <.../pal.h> on FreeBSD/alpha. - 2002-04-01 Mark Wielaard * java/util/BitSet.java (BitSet(int)): if nbits < 0 throw --- 5742,5747 ---- *************** *** 362,372 **** 2002-04-01 Mark Wielaard - * java/lang/Integer.java (decode): Throw NullPointerException when - argument is null. A minus sign can precede other leading characters. - - 2002-04-01 Mark Wielaard - * mauve-libgcj: Add JDK1.3, JDK1.4, JLS1.2 tests, remove ignored tests that can be compiled now and add testsuite crashers to ignore list. --- 5755,5760 ---- *************** *** 401,413 **** (accept): Likewise. (close): Synchronize. 2002-03-25 Andrew Haley , Hans Boehm ! * include/dwarf2-signal.h (MAKE_THROW_FRAME): Add for IA-64. ! (INIT_SEGV, INIT_FPE): Add versions that use __libc_sigaction ! instead of syscall on IA-64. ! Add FIXME comment. ! 2002-03-27 Anthony Green * libgcj.spec.in: Add CHECKREFSPEC. --- 5789,5805 ---- (accept): Likewise. (close): Synchronize. + 2002-03-27 Richard Henderson + + * include/posix-threads.h [alpha] (_Jv_ThreadSelf): Avoid a copy. + 2002-03-25 Andrew Haley , Hans Boehm ! * include/dwarf2-signal.h (MAKE_THROW_FRAME): Add for IA-64. ! (INIT_SEGV, INIT_FPE): Add versions that use __libc_sigaction ! instead of syscall on IA-64. ! Add FIXME comment. ! 2002-03-27 Anthony Green * libgcj.spec.in: Add CHECKREFSPEC. *************** *** 415,424 **** * configure.host: Ditto. Check references for xscale-elf. * configure: Rebuilt. ! 2002-03-25 Hans Boehm * include/dwarf2-signal.h: Temporarily back out last change. 2002-03-25 Andrew Haley , Hans Boehm * configure.in, configure: enable dwarf2-exception-style --- 5807,5820 ---- * configure.host: Ditto. Check references for xscale-elf. * configure: Rebuilt. ! 2002-03-26 Hans Boehm * include/dwarf2-signal.h: Temporarily back out last change. + 2002-03-26 Loren J. Rittle + + * include/posix-threads.h: Support <.../pal.h> on FreeBSD/alpha. + 2002-03-25 Andrew Haley , Hans Boehm * configure.in, configure: enable dwarf2-exception-style *************** *** 426,432 **** * include/dwarf2-signal.h (MAKE_THROW_FRAME): Add for IA-64. (INIT_SEGV, INIT_FPE): Use __libc_sigaction instead of syscall. Add FIXME comment. ! 2002-03-25 Tom Tromey * Makefile.am (libgcj_la_LDFLAGS): Use THREADLDFLAGS. --- 5822,5828 ---- * include/dwarf2-signal.h (MAKE_THROW_FRAME): Add for IA-64. (INIT_SEGV, INIT_FPE): Use __libc_sigaction instead of syscall. Add FIXME comment. ! 2002-03-25 Tom Tromey * Makefile.am (libgcj_la_LDFLAGS): Use THREADLDFLAGS. *************** *** 449,454 **** --- 5845,5855 ---- * gnu/java/rmi/rmic/RMIC.java (parseOptions): Removed extraneous "GNU". + 2002-03-25 Tom Tromey + + * java/awt/Component.java (processEvent): Check ComponentEvent + after KeyEvent. + 2002-03-24 Bryce McKinlay * java/io/PushbackReader.java: Reformat. *************** *** 457,467 **** calculate correct number of bytes skipped. Based on patch from Intel's ORP team: ! * java/io/PushbackInputStream.java (available): Calculate correct number of bytes in buffer. (read): Remove redundant bound check. Return bytes from both the buffer and the stream. 2002-03-24 Eric Blake * java/beans/IntrospectionException.java: Update to 1.4. --- 5858,5884 ---- calculate correct number of bytes skipped. Based on patch from Intel's ORP team: ! * java/io/PushbackInputStream.java (available): Calculate correct number of bytes in buffer. (read): Remove redundant bound check. Return bytes from both the buffer and the stream. + 2002-03-24 Tom Tromey + + * java/awt/TextComponent.java (TextComponent): Editable by + default. + + * java/awt/MenuItem.java (eventMask): No longer private. + * java/awt/Button.java (dispatchEventImpl): Only dispatch to + superclass if we didn't handle event. + * java/awt/Checkbox.java (dispatchEventImpl): New method. + * java/awt/CheckboxMenuItem.java (dispatchEventImpl): New method. + * java/awt/Choice.java (dispatchEventImpl): New method. + * java/awt/List.java (dispatchEventImpl): New method. + * java/awt/Scrollbar.java (dispatchEventImpl): New method. + * java/awt/TextComponent.java (dispatchEventImpl): New method. + * java/awt/TextField.java (dispatchEventImpl): New method. + 2002-03-24 Eric Blake * java/beans/IntrospectionException.java: Update to 1.4. *************** *** 517,523 **** 2002-03-19 Martin Kahlert ! * include/jni.h Use correct C comments 2002-03-18 Tom Tromey --- 5934,5940 ---- 2002-03-19 Martin Kahlert ! * include/jni.h Use correct C comments. 2002-03-18 Tom Tromey *************** *** 525,530 **** --- 5942,5952 ---- (JNIEXPORT): Likewise. (JNICALL): Likewise. + 2002-03-18 Rainer Orth + + * configure.host (i?86-*): Use -fuse-divide-subroutine on Solaris + systems. + 2002-03-18 Andrew Haley * include/i386-signal.h (old_i386_kernel_sigaction): New. *************** *** 554,559 **** --- 5976,5984 ---- * Makefile.in: Rebuilt. * libtool-version: Increment .so version number. + * Makefile.am: Escape quotes in echo. + * Makefile.in: Rebuilt. + 2002-03-16 Bryce McKinlay * Makefile.am: Use empty -classpath flag in addition to -bootclasspath. *************** *** 592,600 **** * gcj/Makefile: Rebuilt. * gcj/libgcj-config.h: Add warning comment. - * Makefile.am: Escape quotes in echo. - * Makefile.in: Rebuilt. - 2002-03-12 Andreas Tobler * configure.host (powerpc*-darwin*): Enable interpreter. --- 6017,6022 ---- *************** *** 602,618 **** 2002-03-10 Bryce McKinlay * include/posix.h: Add multiple include header protection. 2002-03-10 Adam Megacz ! * java/net/natPlainSocketImpl.cc: Removed #include "posix.h". ! ! 2002-03-10 Adam Megacz ! ! * java/net/natPlainSocketImpl.cc: Added #include . 2002-03-10 Tom Tromey * java/lang/Win32Process.java: Added comment. * include/posix.h (_Jv_platform_close_on_exec): New function. Include fcntl.h. --- 6024,6040 ---- 2002-03-10 Bryce McKinlay * include/posix.h: Add multiple include header protection. + * java/net/natPlainSocketImpl.cc: Don't #include . 2002-03-10 Adam Megacz ! * java/net/natPlainSocketImpl.cc: Added #include . 2002-03-10 Tom Tromey + * java/awt/GridLayout.java (layoutContainer): Handle case where + there are no items in container. + * java/lang/Win32Process.java: Added comment. * include/posix.h (_Jv_platform_close_on_exec): New function. Include fcntl.h. *************** *** 641,651 **** * java/awt/ImageMediaEntry: Removed. * java/awt/MediaEntry: Removed. - 2002-03-09 Adam Megacz - - * java/io/natFileDescriptorWin32.cc (read): Return -1 if zero - bytes read and no failure code returned. - 2002-03-09 Bryce McKinlay Hashtable synchronization for PowerPC. --- 6063,6068 ---- *************** *** 653,660 **** slow_pthread_self. Set up symlink for sysdeps directory. * configure: Rebuild. * configure.host: Document more shell variables. Set sysdeps_dir ! for most platforms. Set slow_pthread_self for i686. Set ! enable_hash_synchronization_default and slow_pthread_self for PowerPC. * posix-threads.cc (_Jv_ThreadSelf_out_of_line): Use release_set so that memory barrier is emitted where required. * prims.cc: 64-bit align static primitive class instances. --- 6070,6077 ---- slow_pthread_self. Set up symlink for sysdeps directory. * configure: Rebuild. * configure.host: Document more shell variables. Set sysdeps_dir ! for most platforms. Set slow_pthread_self for i686. Set ! enable_hash_synchronization_default and slow_pthread_self for PowerPC. * posix-threads.cc (_Jv_ThreadSelf_out_of_line): Use release_set so that memory barrier is emitted where required. * prims.cc: 64-bit align static primitive class instances. *************** *** 662,668 **** read_barrier() to enforce ordering of reads. * sysdep/powerpc/locks.h: New file. Implementation of synchronization primitives for PowerPC. ! * sysdep/i386/locks.h: New file. Synchronization primitives for i386 moved from natObject.cc. * sysdep/alpha/locks.h: Likewise. * sysdep/ia64/locks.h: Likewise. --- 6079,6085 ---- read_barrier() to enforce ordering of reads. * sysdep/powerpc/locks.h: New file. Implementation of synchronization primitives for PowerPC. ! * sysdep/i386/locks.h: New file. Synchronization primitives for i386 moved from natObject.cc. * sysdep/alpha/locks.h: Likewise. * sysdep/ia64/locks.h: Likewise. *************** *** 672,684 **** 2002-03-09 Adam Megacz * win32.cc (_CRT_MT, __mingwthr_key_dtor) Added fake definitions to simulate -mthreads. 2002-03-09 Adam Megacz * win32.cc (_Jv_platform_gettimeofday) Cast 1000 to long long to ! avoid precision loss. 2002-03-09 Per Bothner --- 6089,6106 ---- 2002-03-09 Adam Megacz + * java/io/natFileDescriptorWin32.cc (read): Return -1 if zero + bytes read and no failure code returned. + + 2002-03-09 Adam Megacz + * win32.cc (_CRT_MT, __mingwthr_key_dtor) Added fake definitions to simulate -mthreads. 2002-03-09 Adam Megacz * win32.cc (_Jv_platform_gettimeofday) Cast 1000 to long long to ! avoid precision loss. 2002-03-09 Per Bothner *************** *** 688,701 **** 2002-03-09 Adam Megacz ! * java/lang/Win32Process.java (ConcreteProcess): Now throws an ! IOException so that Throwable.printStackTrace fails correctly. 2002-03-08 Adam Megacz ! * java/net/natPlainSocketImpl.cc (read, write, close): Formatting ! fixed. ! 2002-03-09 Bryce McKinlay * posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get --- 6110,6123 ---- 2002-03-09 Adam Megacz ! * java/lang/Win32Process.java (ConcreteProcess): Now throws an ! IOException so that Throwable.printStackTrace fails correctly. 2002-03-08 Adam Megacz ! * java/net/natPlainSocketImpl.cc (read, write, close): Formatting ! fixed. ! 2002-03-09 Bryce McKinlay * posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get *************** *** 712,735 **** 2002-03-07 Adam Megacz - * java/lang/natSystem.cc (currentTimeMillis): Now uses updated - _Jv_platform_gettimeofday signature. - - 2002-03-07 Adam Megacz - - * win32.cc (_Jv_platform_gettimeofday): Now takes no args, - returns jlong. Added implementation - * posix.cc (_Jv_platform_gettimeofday): Now takes no args, - returns jlong. - * win32.h (_Jv_platform_gettimeofday): Now takes no args, - returns jlong. - * posix.h (_Jv_platform_gettimeofday): Now takes no args, - returns jlong. - * java/lang/natSystem.cc (currentTimeMillis): Now uses updated - _Jv_platform_gettimeofday signature. - - 2002-03-07 Adam Megacz - * java/net/natPlainSocketImpl.cc: Changed USE_WINSOCK to WIN32, and added thunks for read(), write(), and close(). * java/net/natPlainSocketImpl.cc (accept, read, read): --- 6134,6139 ---- *************** *** 737,746 **** 2002-03-07 Adam Megacz ! * java/io/FileDescriptor.java: Initialize in/out/err in init(). ! * java/io/natFileDescriptorWin32.cc (init()): Added function. ! * java/io/natFileDescriptorPosix.cc (init()): Added function. ! * java/io/natFileDescriptorEcos.cc (init()): Added function. 2002-03-07 Bryce McKinlay --- 6141,6156 ---- 2002-03-07 Adam Megacz ! * win32.cc (_Jv_platform_gettimeofday): Now takes no args, ! returns jlong. Added implementation ! * posix.cc (_Jv_platform_gettimeofday): Now takes no args, ! returns jlong. ! * win32.h (_Jv_platform_gettimeofday): Now takes no args, ! returns jlong. ! * posix.h (_Jv_platform_gettimeofday): Now takes no args, ! returns jlong. ! * java/lang/natSystem.cc (currentTimeMillis): Now uses updated ! _Jv_platform_gettimeofday signature. 2002-03-07 Bryce McKinlay *************** *** 749,758 **** --- 6159,6181 ---- 2002-03-06 Tom Tromey + * java/io/natFileDescriptorEcos.cc (init): Don't use + GetStdHandle. + * java/io/natFileDescriptorPosix.cc (valid): Don't call stat if FD + is negative. + (init): Don't use GetStdHandle. + * include/config.h.in: Rebuilt. * configure: Rebuilt. * Makefile.in: Rebuilt. + 2002-03-06 Adam Megacz + + * java/io/FileDescriptor.java: Initialize in/out/err in init(). + * java/io/natFileDescriptorWin32.cc (init()): Added function. + * java/io/natFileDescriptorPosix.cc (init()): Added function. + * java/io/natFileDescriptorEcos.cc (init()): Added function. + 2002-03-06 Eric Blake * scripts/unicode-decomp.pl: Move from chartables.pl, and remove *************** *** 787,802 **** (startProcess): Simplified error-handling. Preserve LD_LIBRARY_PATH across exec. - 2002-03-05 Tom Tromey - * jni.cc (_Jv_LookupJNIMethod): Throw UnsatisfiedLinkError, not AbstractMethodError. - 2002-03-04 Adam Megacz - - * java/net/natInetAddress.cc: Changed USE_WINSOCK to WIN32, added - '#undef STRICT'. - 2002-03-03 Bryce McKinlay * Makefile.am: Use -bootclasspath, not -CLASSPATH. --- 6210,6218 ---- *************** *** 812,817 **** --- 6228,6238 ---- (_Jv_CallAnyMethodA): Handle FFI_TYPE_POINTER arguments. Move constructor test. + 2002-02-27 Adam Megacz + + * java/net/natInetAddress.cc: Changed USE_WINSOCK to WIN32, added + '#undef STRICT'. + 2002-02-26 Tom Tromey * java/lang/natSystem.cc (init_properties): Use __VERSION__. *************** *** 866,872 **** * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Define ffi_result union for ffi_call result. Cast ffi_result members to jvalue. ! 2002-02-23 Alexandre Oliva * Makefile.in, gcj/Makefile.in, include/Makefile.in: Rebuilt. --- 6287,6293 ---- * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Define ffi_result union for ffi_call result. Cast ffi_result members to jvalue. ! 2002-02-23 Alexandre Oliva * Makefile.in, gcj/Makefile.in, include/Makefile.in: Rebuilt. *************** *** 1044,1050 **** * boehm.cc (initialized, obj_kind_x, obj_free_list): Removed unused declarations. ! (_Jv_InitGC): Don't bother locking, as this is always called from a single-thread. Turn off GC_all_interior_pointers. Remove dead code. 2002-02-11 Adam Megacz --- 6465,6471 ---- * boehm.cc (initialized, obj_kind_x, obj_free_list): Removed unused declarations. ! (_Jv_InitGC): Don't bother locking, as this is always called from a single-thread. Turn off GC_all_interior_pointers. Remove dead code. 2002-02-11 Adam Megacz *************** *** 1168,1178 **** * gnu/gcj/io/shs.h, gnu/gcj/io/shs.cc, gnu/gcj/io/natSimpleSHSStream.cc: use uint_t instead of LONG and BYTE ! 2002-02-06 Adam Megacz * name-finder.h: don't #include sys/wait.h unless HAVE_SYS_WAIT_H ! 2002-02-06 Anthony Green * java/net/natPlainSocketImpl.cc: Fix DISABLE_JAVA_NET targets. --- 6589,6599 ---- * gnu/gcj/io/shs.h, gnu/gcj/io/shs.cc, gnu/gcj/io/natSimpleSHSStream.cc: use uint_t instead of LONG and BYTE ! 2002-02-06 Adam Megacz * name-finder.h: don't #include sys/wait.h unless HAVE_SYS_WAIT_H ! 2002-02-06 Anthony Green * java/net/natPlainSocketImpl.cc: Fix DISABLE_JAVA_NET targets. *************** *** 1230,1236 **** * configure.in: Added PLATFORM_SPECIFIC_SOURCES, which is set to posix.cc or win32.cc. * Makefile.am: Updated it to use $(PLATFORM_SPECIFIC_SOURCES). ! 2002-02-04 Adam Megacz * configure.in: Corrected mingw case branches; added * before --- 6651,6657 ---- * configure.in: Added PLATFORM_SPECIFIC_SOURCES, which is set to posix.cc or win32.cc. * Makefile.am: Updated it to use $(PLATFORM_SPECIFIC_SOURCES). ! 2002-02-04 Adam Megacz * configure.in: Corrected mingw case branches; added * before *************** *** 1266,1272 **** 2002-02-01 Adam Megacz * prims.cc: Added #undef STRICT after #include. ! 2002-02-01 Adam Megacz * prims.cc --- 6687,6693 ---- 2002-02-01 Adam Megacz * prims.cc: Added #undef STRICT after #include. ! 2002-02-01 Adam Megacz * prims.cc *************** *** 1274,1280 **** USE_WIN32_SIGNALLING and USE_WINSOCK. (win32_exception_handler): Now throws an exception out of the signal handler; assumes SJLJ. ! 2002-02-01 Adam Megacz * win32-threads.cc: --- 6695,6701 ---- USE_WIN32_SIGNALLING and USE_WINSOCK. (win32_exception_handler): Now throws an exception out of the signal handler; assumes SJLJ. ! 2002-02-01 Adam Megacz * win32-threads.cc: *************** *** 1305,1311 **** 2002-02-01 Craig Rodrigues PR java/4972 ! * aclocal.m4, acinclude.m4 (AM_ICONV): Put linking flags for libiconv in LIBICONV variable. * configure: Regenerated. --- 6726,6732 ---- 2002-02-01 Craig Rodrigues PR java/4972 ! * aclocal.m4, acinclude.m4 (AM_ICONV): Put linking flags for libiconv in LIBICONV variable. * configure: Regenerated. *************** *** 1411,1419 **** 2002-01-25 Bryce McKinlay * java/lang/natObject.cc (X86 compare_and_swap): Use +m constraint. ! * java/awt/image/PixelGrabber.java (grabPixels()): Call grabPixels(0). ! (grabPixels(long)): Wait to be notified that the ImageProducer has completed. 2002-01-24 Per Bothner --- 6832,6840 ---- 2002-01-25 Bryce McKinlay * java/lang/natObject.cc (X86 compare_and_swap): Use +m constraint. ! * java/awt/image/PixelGrabber.java (grabPixels()): Call grabPixels(0). ! (grabPixels(long)): Wait to be notified that the ImageProducer has completed. 2002-01-24 Per Bothner *************** *** 1492,2030 **** 2002-01-22 Mark Wielaard ! * java/awt/Adjustable.java java/awt/CheckboxMenuItem.java ! java/awt/Choice.java java/awt/Color.java java/awt/Cursor.java ! java/awt/Dialog.java java/awt/FileDialog.java ! java/awt/Font.java java/awt/FontMetrics.java ! java/awt/Image.java java/awt/ImageMediaEntry.java ! java/awt/Insets.java java/awt/List.java ! java/awt/MediaEntry.java java/awt/MediaTracker.java ! java/awt/Menu.java java/awt/MenuBar.java ! java/awt/MenuContainer.java java/awt/MenuShortcut.java ! java/awt/PaintContext.java java/awt/Panel.java ! java/awt/PopupMenu.java java/awt/SystemColor.java ! java/awt/peer/ButtonPeer.java java/awt/peer/CanvasPeer.java ! java/awt/peer/CheckboxMenuItemPeer.java ! java/awt/peer/CheckboxPeer.java java/awt/peer/ChoicePeer.java ! java/awt/peer/ComponentPeer.java ! java/awt/peer/ContainerPeer.java java/awt/peer/DialogPeer.java ! java/awt/peer/FileDialogPeer.java java/awt/peer/FontPeer.java ! java/awt/peer/FramePeer.java java/awt/peer/LabelPeer.java ! java/awt/peer/LightweightPeer.java java/awt/peer/ListPeer.java ! java/awt/peer/MenuBarPeer.java ! java/awt/peer/MenuComponentPeer.java ! java/awt/peer/MenuItemPeer.java java/awt/peer/MenuPeer.java ! java/awt/peer/PanelPeer.java java/awt/peer/PopupMenuPeer.java ! java/awt/peer/ScrollPanePeer.java ! java/awt/peer/ScrollbarPeer.java ! java/awt/peer/TextAreaPeer.java ! java/awt/peer/TextComponentPeer.java java/awt/peer/TextFieldPeer.java java/awt/peer/WindowPeer.java: Add license clarification. 2002-01-22 Mark Wielaard ! * LIBGCJ_LICENSE gnu/classpath/Configuration.java.in ! gnu/gcj/runtime/StringBuffer.java ! gnu/java/awt/BitMaskExtent.java gnu/java/awt/Buffers.java ! gnu/java/awt/ComponentDataBlitOp.java ! gnu/java/awt/GLightweightPeer.java ! gnu/java/beans/BeanInfoEmbryo.java ! gnu/java/beans/EmptyBeanInfo.java ! gnu/java/beans/ExplicitBeanInfo.java ! gnu/java/beans/IntrospectionIncubator.java ! gnu/java/beans/editors/ColorEditor.java ! gnu/java/beans/editors/FontEditor.java ! gnu/java/beans/editors/NativeBooleanEditor.java ! gnu/java/beans/editors/NativeByteEditor.java ! gnu/java/beans/editors/NativeDoubleEditor.java ! gnu/java/beans/editors/NativeFloatEditor.java ! gnu/java/beans/editors/NativeIntEditor.java ! gnu/java/beans/editors/NativeLongEditor.java ! gnu/java/beans/editors/NativeShortEditor.java ! gnu/java/beans/editors/StringEditor.java ! gnu/java/beans/info/ComponentBeanInfo.java ! gnu/java/io/ClassLoaderObjectInputStream.java ! gnu/java/io/NullOutputStream.java ! gnu/java/io/ObjectIdentityWrapper.java ! gnu/java/lang/ArrayHelper.java gnu/java/lang/ClassHelper.java ! gnu/java/lang/reflect/TypeSignature.java ! gnu/java/locale/Calendar.java gnu/java/locale/Calendar_de.java ! gnu/java/locale/Calendar_en.java ! gnu/java/locale/Calendar_nl.java ! gnu/java/locale/LocaleInformation.java ! gnu/java/locale/LocaleInformation_de.java ! gnu/java/locale/LocaleInformation_en.java ! gnu/java/locale/LocaleInformation_nl.java ! gnu/java/math/MPN.java gnu/java/rmi/dgc/DGCImpl.java ! gnu/java/rmi/registry/RegistryImpl.java ! gnu/java/rmi/rmic/Compile_gcj.java ! gnu/java/rmi/rmic/Compiler.java ! gnu/java/rmi/rmic/CompilerProcess.java ! gnu/java/rmi/rmic/RMIC.java ! gnu/java/rmi/rmic/TabbedWriter.java ! gnu/java/rmi/server/ProtocolConstants.java ! gnu/java/rmi/server/RMIDefaultSocketFactory.java ! gnu/java/rmi/server/RMIHashes.java ! gnu/java/rmi/server/RMIObjectInputStream.java ! gnu/java/rmi/server/RMIObjectOutputStream.java ! gnu/java/rmi/server/UnicastConnection.java ! gnu/java/rmi/server/UnicastConnectionManager.java ! gnu/java/rmi/server/UnicastRef.java ! gnu/java/rmi/server/UnicastRemoteCall.java ! gnu/java/rmi/server/UnicastRemoteStub.java ! gnu/java/rmi/server/UnicastServer.java ! gnu/java/rmi/server/UnicastServerRef.java ! gnu/java/security/provider/DefaultPolicy.java ! gnu/java/security/provider/Gnu.java ! gnu/java/security/provider/SHA.java ! gnu/java/security/provider/SHA1PRNG.java ! gnu/java/text/BaseBreakIterator.java ! gnu/java/text/CharacterBreakIterator.java ! gnu/java/text/LineBreakIterator.java ! gnu/java/text/SentenceBreakIterator.java ! gnu/java/text/WordBreakIterator.java ! gnu/java/util/DoubleEnumeration.java java/applet/Applet.java ! java/applet/AppletContext.java java/applet/AppletStub.java ! java/applet/AudioClip.java java/awt/AWTError.java ! java/awt/AWTEvent.java java/awt/AWTEventMulticaster.java ! java/awt/AWTException.java java/awt/AWTPermission.java ! java/awt/ActiveEvent.java java/awt/BorderLayout.java ! java/awt/Button.java java/awt/Canvas.java ! java/awt/CardLayout.java java/awt/Checkbox.java ! java/awt/CheckboxGroup.java java/awt/Component.java ! java/awt/ComponentOrientation.java java/awt/Container.java ! java/awt/Dimension.java java/awt/Event.java ! java/awt/EventDispatchThread.java java/awt/EventQueue.java ! java/awt/FlowLayout.java java/awt/Frame.java ! java/awt/Graphics.java java/awt/Graphics2D.java ! java/awt/GraphicsConfiguration.java java/awt/GridLayout.java ! java/awt/IllegalComponentStateException.java ! java/awt/ItemSelectable.java java/awt/Label.java ! java/awt/LayoutManager.java java/awt/LayoutManager2.java ! java/awt/MenuComponent.java java/awt/MenuItem.java ! java/awt/Paint.java java/awt/Point.java ! java/awt/Rectangle.java java/awt/RenderingHints.java ! java/awt/Transparency.java java/awt/Window.java ! java/awt/color/ColorSpace.java ! java/awt/color/ICC_ColorSpace.java ! java/awt/color/ICC_Profile.java ! java/awt/event/HierarchyBoundsAdapter.java ! java/awt/event/HierarchyBoundsListener.java ! java/awt/event/HierarchyEvent.java ! java/awt/event/HierarchyListener.java ! java/awt/geom/AffineTransform.java ! java/awt/geom/Dimension2D.java java/awt/geom/Ellipse2D.java ! java/awt/geom/IllegalPathStateException.java ! java/awt/geom/Line2D.java ! java/awt/geom/NoninvertibleTransformException.java ! java/awt/geom/PathIterator.java java/awt/geom/Point2D.java ! java/awt/geom/Rectangle2D.java ! java/awt/geom/RectangularShape.java ! java/awt/geom/RoundRectangle2D.java ! java/awt/image/BufferedImage.java ! java/awt/image/ColorModel.java ! java/awt/image/ComponentColorModel.java ! java/awt/image/ComponentSampleModel.java ! java/awt/image/DataBuffer.java ! java/awt/image/DataBufferByte.java ! java/awt/image/DataBufferInt.java ! java/awt/image/DataBufferUShort.java ! java/awt/image/DirectColorModel.java ! java/awt/image/PackedColorModel.java ! java/awt/image/Raster.java java/awt/image/RasterOp.java ! java/awt/image/SampleModel.java ! java/awt/image/SinglePixelPackedSampleModel.java ! java/awt/image/WritableRaster.java ! java/beans/AppletInitializer.java ! java/beans/BeanDescriptor.java java/beans/BeanInfo.java ! java/beans/Beans.java java/beans/Customizer.java ! java/beans/DesignMode.java java/beans/EventSetDescriptor.java ! java/beans/FeatureDescriptor.java ! java/beans/IndexedPropertyDescriptor.java ! java/beans/IntrospectionException.java ! java/beans/Introspector.java java/beans/MethodDescriptor.java ! java/beans/ParameterDescriptor.java ! java/beans/PropertyChangeEvent.java ! java/beans/PropertyChangeListener.java ! java/beans/PropertyChangeSupport.java ! java/beans/PropertyDescriptor.java ! java/beans/PropertyEditor.java ! java/beans/PropertyEditorManager.java ! java/beans/PropertyEditorSupport.java ! java/beans/PropertyVetoException.java ! java/beans/SimpleBeanInfo.java ! java/beans/VetoableChangeListener.java ! java/beans/VetoableChangeSupport.java ! java/beans/Visibility.java ! java/beans/beancontext/BeanContext.java ! java/beans/beancontext/BeanContextChild.java ! java/beans/beancontext/BeanContextChildComponentProxy.java ! java/beans/beancontext/BeanContextChildSupport.java ! java/beans/beancontext/BeanContextContainerProxy.java ! java/beans/beancontext/BeanContextEvent.java ! java/beans/beancontext/BeanContextMembershipEvent.java ! java/beans/beancontext/BeanContextMembershipListener.java ! java/beans/beancontext/BeanContextProxy.java ! java/beans/beancontext/BeanContextServiceAvailableEvent.java ! java/beans/beancontext/BeanContextServiceProvider.java ! java/beans/beancontext/BeanContextServiceProviderBeanInfo.java ! java/beans/beancontext/BeanContextServiceRevokedEvent.java ! java/beans/beancontext/BeanContextServiceRevokedListener.java ! java/beans/beancontext/BeanContextServices.java ! java/beans/beancontext/BeanContextServicesListener.java ! java/io/BufferedInputStream.java ! java/io/BufferedOutputStream.java java/io/BufferedReader.java ! java/io/BufferedWriter.java java/io/ByteArrayInputStream.java ! java/io/ByteArrayOutputStream.java ! java/io/CharArrayReader.java java/io/CharArrayWriter.java ! java/io/CharConversionException.java java/io/DataInput.java ! java/io/DataInputStream.java java/io/DataOutput.java ! java/io/EOFException.java java/io/Externalizable.java ! java/io/FileFilter.java java/io/FileNotFoundException.java ! java/io/FilePermission.java java/io/FileReader.java ! java/io/FileWriter.java java/io/FilenameFilter.java ! java/io/FilterInputStream.java java/io/FilterOutputStream.java ! java/io/FilterReader.java java/io/FilterWriter.java ! java/io/IOException.java java/io/InputStream.java ! java/io/InterruptedIOException.java ! java/io/InvalidClassException.java ! java/io/InvalidObjectException.java ! java/io/NotActiveException.java ! java/io/NotSerializableException.java java/io/ObjectInput.java ! java/io/ObjectInputStream.java ! java/io/ObjectInputValidation.java java/io/ObjectOutput.java ! java/io/ObjectOutputStream.java java/io/ObjectStreamClass.java ! java/io/ObjectStreamConstants.java ! java/io/ObjectStreamException.java ! java/io/ObjectStreamField.java ! java/io/OptionalDataException.java java/io/OutputStream.java ! java/io/PipedInputStream.java java/io/PipedOutputStream.java ! java/io/PipedReader.java java/io/PipedWriter.java ! java/io/PrintWriter.java java/io/PushbackInputStream.java ! java/io/PushbackReader.java java/io/Reader.java ! java/io/SequenceInputStream.java java/io/Serializable.java ! java/io/SerializablePermission.java ! java/io/StreamCorruptedException.java ! java/io/StreamTokenizer.java ! java/io/StringBufferInputStream.java java/io/StringReader.java ! java/io/StringWriter.java java/io/SyncFailedException.java ! java/io/UTFDataFormatException.java ! java/io/UnsupportedEncodingException.java ! java/io/WriteAbortedException.java java/io/Writer.java ! java/lang/AbstractMethodError.java ! java/lang/ArithmeticException.java ! java/lang/ArrayIndexOutOfBoundsException.java ! java/lang/ArrayStoreException.java java/lang/Boolean.java ! java/lang/Byte.java java/lang/CharSequence.java ! java/lang/ClassCastException.java ! java/lang/ClassCircularityError.java ! java/lang/ClassFormatError.java ! java/lang/ClassNotFoundException.java ! java/lang/CloneNotSupportedException.java ! java/lang/Cloneable.java java/lang/Comparable.java ! java/lang/Compiler.java java/lang/Double.java ! java/lang/Error.java java/lang/Exception.java ! java/lang/ExceptionInInitializerError.java ! java/lang/Float.java java/lang/IllegalAccessError.java ! java/lang/IllegalAccessException.java ! java/lang/IllegalArgumentException.java ! java/lang/IllegalMonitorStateException.java ! java/lang/IllegalStateException.java ! java/lang/IllegalThreadStateException.java ! java/lang/IncompatibleClassChangeError.java ! java/lang/IndexOutOfBoundsException.java ! java/lang/InheritableThreadLocal.java ! java/lang/InstantiationError.java ! java/lang/InstantiationException.java java/lang/Integer.java ! java/lang/InternalError.java ! java/lang/InterruptedException.java ! java/lang/LinkageError.java java/lang/Long.java ! java/lang/NegativeArraySizeException.java ! java/lang/NoClassDefFoundError.java ! java/lang/NoSuchFieldError.java ! java/lang/NoSuchFieldException.java ! java/lang/NoSuchMethodError.java ! java/lang/NoSuchMethodException.java ! java/lang/NullPointerException.java java/lang/Number.java ! java/lang/NumberFormatException.java ! java/lang/OutOfMemoryError.java java/lang/Package.java ! java/lang/Process.java java/lang/Runnable.java ! java/lang/RuntimeException.java ! java/lang/RuntimePermission.java ! java/lang/SecurityException.java ! java/lang/SecurityManager.java java/lang/Short.java ! java/lang/StackOverflowError.java java/lang/StringBuffer.java ! java/lang/StringIndexOutOfBoundsException.java ! java/lang/ThreadDeath.java java/lang/ThreadGroup.java ! java/lang/ThreadLocal.java java/lang/UnknownError.java ! java/lang/UnsatisfiedLinkError.java ! java/lang/UnsupportedClassVersionError.java ! java/lang/UnsupportedOperationException.java ! java/lang/VerifyError.java java/lang/VirtualMachineError.java ! java/lang/Void.java java/lang/ref/PhantomReference.java ! java/lang/ref/Reference.java java/lang/ref/ReferenceQueue.java ! java/lang/ref/SoftReference.java ! java/lang/ref/WeakReference.java ! java/lang/reflect/AccessibleObject.java ! java/lang/reflect/InvocationTargetException.java ! java/lang/reflect/Member.java java/lang/reflect/Modifier.java ! java/lang/reflect/ReflectPermission.java ! java/math/BigDecimal.java java/math/BigInteger.java ! java/net/Authenticator.java java/net/BindException.java ! java/net/ConnectException.java java/net/ContentHandler.java ! java/net/ContentHandlerFactory.java ! java/net/DatagramPacket.java java/net/DatagramSocketImpl.java ! java/net/FileNameMap.java java/net/MalformedURLException.java ! java/net/MulticastSocket.java java/net/NetPermission.java ! java/net/NoRouteToHostException.java ! java/net/PasswordAuthentication.java ! java/net/ProtocolException.java java/net/ServerSocket.java ! java/net/Socket.java java/net/SocketException.java ! java/net/SocketImpl.java java/net/SocketImplFactory.java ! java/net/SocketOptions.java java/net/SocketPermission.java ! java/net/URLDecoder.java java/net/URLEncoder.java ! java/net/URLStreamHandlerFactory.java ! java/net/UnknownHostException.java ! java/net/UnknownServiceException.java ! java/rmi/AccessException.java ! java/rmi/AlreadyBoundException.java ! java/rmi/ConnectException.java ! java/rmi/ConnectIOException.java ! java/rmi/MarshalException.java java/rmi/MarshalledObject.java ! java/rmi/Naming.java java/rmi/NoSuchObjectException.java ! java/rmi/NotBoundException.java ! java/rmi/RMISecurityException.java ! java/rmi/RMISecurityManager.java java/rmi/Remote.java ! java/rmi/RemoteException.java java/rmi/ServerError.java ! java/rmi/ServerException.java ! java/rmi/ServerRuntimeException.java ! java/rmi/StubNotFoundException.java ! java/rmi/UnexpectedException.java ! java/rmi/UnknownHostException.java ! java/rmi/UnmarshalException.java ! java/rmi/activation/Activatable.java ! java/rmi/activation/ActivateFailedException.java ! java/rmi/activation/ActivationDesc.java ! java/rmi/activation/ActivationException.java ! java/rmi/activation/ActivationGroup.java ! java/rmi/activation/ActivationGroupDesc.java ! java/rmi/activation/ActivationGroupID.java ! java/rmi/activation/ActivationID.java ! java/rmi/activation/ActivationInstantiator.java ! java/rmi/activation/ActivationMonitor.java ! java/rmi/activation/ActivationSystem.java ! java/rmi/activation/Activator.java ! java/rmi/activation/UnknownGroupException.java ! java/rmi/activation/UnknownObjectException.java ! java/rmi/dgc/DGC.java java/rmi/dgc/Lease.java ! java/rmi/dgc/VMID.java java/rmi/registry/LocateRegistry.java ! java/rmi/registry/Registry.java ! java/rmi/registry/RegistryHandler.java ! java/rmi/server/ExportException.java ! java/rmi/server/LoaderHandler.java ! java/rmi/server/LogStream.java java/rmi/server/ObjID.java ! java/rmi/server/Operation.java ! java/rmi/server/RMIClassLoader.java ! java/rmi/server/RMIClientSocketFactory.java ! java/rmi/server/RMIFailureHandler.java ! java/rmi/server/RMIServerSocketFactory.java ! java/rmi/server/RMISocketFactory.java ! java/rmi/server/RemoteCall.java ! java/rmi/server/RemoteObject.java ! java/rmi/server/RemoteRef.java ! java/rmi/server/RemoteServer.java ! java/rmi/server/RemoteStub.java ! java/rmi/server/ServerCloneException.java ! java/rmi/server/ServerNotActiveException.java ! java/rmi/server/ServerRef.java java/rmi/server/Skeleton.java ! java/rmi/server/SkeletonMismatchException.java ! java/rmi/server/SkeletonNotFoundException.java ! java/rmi/server/SocketSecurityException.java ! java/rmi/server/UID.java ! java/rmi/server/UnicastRemoteObject.java ! java/rmi/server/Unreferenced.java ! java/security/AccessControlContext.java ! java/security/AccessControlException.java ! java/security/AccessController.java ! java/security/AlgorithmParameterGenerator.java ! java/security/AlgorithmParameterGeneratorSpi.java ! java/security/AlgorithmParameters.java ! java/security/AlgorithmParametersSpi.java ! java/security/AllPermission.java ! java/security/BasicPermission.java ! java/security/Certificate.java java/security/CodeSource.java ! java/security/DigestException.java ! java/security/DigestInputStream.java ! java/security/DigestOutputStream.java ! java/security/DomainCombiner.java ! java/security/DummyKeyPairGenerator.java ! java/security/DummyMessageDigest.java ! java/security/DummySignature.java ! java/security/GeneralSecurityException.java ! java/security/Guard.java java/security/GuardedObject.java ! java/security/Identity.java java/security/IdentityScope.java ! java/security/InvalidAlgorithmParameterException.java ! java/security/InvalidKeyException.java ! java/security/InvalidParameterException.java ! java/security/Key.java java/security/KeyException.java ! java/security/KeyFactory.java java/security/KeyFactorySpi.java ! java/security/KeyManagementException.java ! java/security/KeyPair.java java/security/KeyPairGenerator.java ! java/security/KeyPairGeneratorSpi.java ! java/security/KeyStore.java ! java/security/KeyStoreException.java ! java/security/KeyStoreSpi.java ! java/security/MessageDigest.java ! java/security/MessageDigestSpi.java ! java/security/NoSuchAlgorithmException.java ! java/security/NoSuchProviderException.java ! java/security/Permission.java ! java/security/PermissionCollection.java ! java/security/Permissions.java java/security/Policy.java ! java/security/Principal.java java/security/PrivateKey.java ! java/security/PrivilegedAction.java ! java/security/PrivilegedActionException.java ! java/security/PrivilegedExceptionAction.java ! java/security/ProtectionDomain.java ! java/security/Provider.java ! java/security/ProviderException.java ! java/security/PublicKey.java ! java/security/SecureClassLoader.java ! java/security/SecureRandom.java ! java/security/SecureRandomSpi.java java/security/Security.java ! java/security/SecurityPermission.java ! java/security/Signature.java ! java/security/SignatureException.java ! java/security/SignatureSpi.java ! java/security/SignedObject.java java/security/Signer.java ! java/security/UnrecoverableKeyException.java ! java/security/UnresolvedPermission.java ! java/security/acl/Acl.java java/security/acl/AclEntry.java ! java/security/acl/AclNotFoundException.java ! java/security/acl/Group.java ! java/security/acl/LastOwnerException.java ! java/security/acl/NotOwnerException.java ! java/security/acl/Owner.java java/security/acl/Permission.java ! java/security/cert/CRL.java ! java/security/cert/CRLException.java ! java/security/cert/Certificate.java ! java/security/cert/CertificateEncodingException.java ! java/security/cert/CertificateException.java ! java/security/cert/CertificateExpiredException.java ! java/security/cert/CertificateFactory.java ! java/security/cert/CertificateFactorySpi.java ! java/security/cert/CertificateNotYetValidException.java ! java/security/cert/CertificateParsingException.java ! java/security/cert/X509CRL.java ! java/security/cert/X509CRLEntry.java ! java/security/cert/X509Certificate.java ! java/security/cert/X509Extension.java ! java/security/interfaces/DSAKey.java ! java/security/interfaces/DSAKeyPairGenerator.java ! java/security/interfaces/DSAParams.java ! java/security/interfaces/DSAPrivateKey.java ! java/security/interfaces/DSAPublicKey.java ! java/security/interfaces/RSAKey.java ! java/security/interfaces/RSAPrivateCrtKey.java ! java/security/interfaces/RSAPrivateKey.java ! java/security/interfaces/RSAPublicKey.java ! java/security/spec/AlgorithmParameterSpec.java ! java/security/spec/DSAParameterSpec.java ! java/security/spec/DSAPrivateKeySpec.java ! java/security/spec/DSAPublicKeySpec.java ! java/security/spec/EncodedKeySpec.java ! java/security/spec/InvalidKeySpecException.java ! java/security/spec/InvalidParameterSpecException.java ! java/security/spec/KeySpec.java ! java/security/spec/PKCS8EncodedKeySpec.java ! java/security/spec/RSAKeyGenParameterSpec.java ! java/security/spec/RSAPrivateCrtKeySpec.java ! java/security/spec/RSAPrivateKeySpec.java ! java/security/spec/RSAPublicKeySpec.java ! java/security/spec/X509EncodedKeySpec.java java/sql/Array.java ! java/sql/BatchUpdateException.java java/sql/Blob.java ! java/sql/CallableStatement.java java/sql/Clob.java ! java/sql/Connection.java java/sql/DataTruncation.java ! java/sql/DatabaseMetaData.java java/sql/Date.java ! java/sql/Driver.java java/sql/DriverManager.java ! java/sql/DriverPropertyInfo.java ! java/sql/PreparedStatement.java java/sql/Ref.java ! java/sql/ResultSet.java java/sql/ResultSetMetaData.java ! java/sql/SQLData.java java/sql/SQLException.java ! java/sql/SQLInput.java java/sql/SQLOutput.java ! java/sql/SQLWarning.java java/sql/Statement.java ! java/sql/Struct.java java/sql/Time.java ! java/sql/Timestamp.java java/sql/Types.java ! java/text/Annotation.java ! java/text/AttributedCharacterIterator.java ! java/text/AttributedString.java ! java/text/AttributedStringIterator.java ! java/text/BreakIterator.java java/text/CharacterIterator.java ! java/text/ChoiceFormat.java java/text/Collator.java ! java/text/DateFormat.java java/text/DateFormatSymbols.java ! java/text/DecimalFormat.java ! java/text/DecimalFormatSymbols.java ! java/text/FieldPosition.java java/text/Format.java ! java/text/MessageFormat.java java/text/NumberFormat.java ! java/text/ParseException.java java/text/ParsePosition.java ! java/text/SimpleDateFormat.java ! java/text/StringCharacterIterator.java ! java/util/AbstractCollection.java java/util/AbstractList.java ! java/util/AbstractMap.java ! java/util/AbstractSequentialList.java ! java/util/AbstractSet.java java/util/ArrayList.java ! java/util/Arrays.java java/util/BasicMapEntry.java ! java/util/BitSet.java java/util/Calendar.java ! java/util/Collection.java java/util/Collections.java ! java/util/Comparator.java ! java/util/ConcurrentModificationException.java ! java/util/Date.java java/util/Dictionary.java ! java/util/EmptyStackException.java java/util/Enumeration.java ! java/util/EventListener.java java/util/EventObject.java ! java/util/GregorianCalendar.java java/util/HashMap.java ! java/util/HashSet.java java/util/Hashtable.java ! java/util/IdentityHashMap.java java/util/Iterator.java ! java/util/LinkedHashMap.java java/util/LinkedHashSet.java ! java/util/LinkedList.java java/util/List.java ! java/util/ListIterator.java java/util/ListResourceBundle.java ! java/util/Locale.java java/util/Map.java ! java/util/MissingResourceException.java ! java/util/NoSuchElementException.java ! java/util/Observable.java java/util/Observer.java ! java/util/Properties.java java/util/PropertyPermission.java ! java/util/PropertyResourceBundle.java java/util/Random.java ! java/util/RandomAccess.java java/util/ResourceBundle.java ! java/util/Set.java java/util/SimpleTimeZone.java ! java/util/SortedMap.java java/util/SortedSet.java ! java/util/Stack.java java/util/StringTokenizer.java ! java/util/TimeZone.java java/util/Timer.java ! java/util/TimerTask.java ! java/util/TooManyListenersException.java ! java/util/TreeMap.java java/util/TreeSet.java ! java/util/Vector.java java/util/WeakHashMap.java ! java/util/jar/Attributes.java java/util/jar/JarEntry.java ! java/util/jar/JarException.java java/util/jar/JarFile.java ! java/util/jar/JarInputStream.java ! java/util/jar/JarOutputStream.java java/util/jar/Manifest.java ! java/util/zip/Adler32.java java/util/zip/CRC32.java ! java/util/zip/CheckedInputStream.java ! java/util/zip/CheckedOutputStream.java ! java/util/zip/Checksum.java ! java/util/zip/DataFormatException.java ! java/util/zip/Deflater.java ! java/util/zip/DeflaterOutputStream.java ! java/util/zip/GZIPInputStream.java ! java/util/zip/GZIPOutputStream.java ! java/util/zip/Inflater.java ! java/util/zip/InflaterInputStream.java ! java/util/zip/ZipConstants.java java/util/zip/ZipEntry.java ! java/util/zip/ZipException.java java/util/zip/ZipFile.java ! java/util/zip/ZipInputStream.java ! java/util/zip/ZipOutputStream.java ! javax/naming/BinaryRefAddr.java ! javax/naming/InvalidNameException.java javax/naming/Name.java ! javax/naming/NamingException.java javax/naming/RefAddr.java javax/naming/StringRefAddr.java: Add license clarification. 2002-01-22 Tom Tromey --- 6913,7451 ---- 2002-01-22 Mark Wielaard ! * java/awt/Adjustable.java java/awt/CheckboxMenuItem.java ! java/awt/Choice.java java/awt/Color.java java/awt/Cursor.java ! java/awt/Dialog.java java/awt/FileDialog.java ! java/awt/Font.java java/awt/FontMetrics.java ! java/awt/Image.java java/awt/ImageMediaEntry.java ! java/awt/Insets.java java/awt/List.java ! java/awt/MediaEntry.java java/awt/MediaTracker.java ! java/awt/Menu.java java/awt/MenuBar.java ! java/awt/MenuContainer.java java/awt/MenuShortcut.java ! java/awt/PaintContext.java java/awt/Panel.java ! java/awt/PopupMenu.java java/awt/SystemColor.java ! java/awt/peer/ButtonPeer.java java/awt/peer/CanvasPeer.java ! java/awt/peer/CheckboxMenuItemPeer.java ! java/awt/peer/CheckboxPeer.java java/awt/peer/ChoicePeer.java ! java/awt/peer/ComponentPeer.java ! java/awt/peer/ContainerPeer.java java/awt/peer/DialogPeer.java ! java/awt/peer/FileDialogPeer.java java/awt/peer/FontPeer.java ! java/awt/peer/FramePeer.java java/awt/peer/LabelPeer.java ! java/awt/peer/LightweightPeer.java java/awt/peer/ListPeer.java ! java/awt/peer/MenuBarPeer.java ! java/awt/peer/MenuComponentPeer.java ! java/awt/peer/MenuItemPeer.java java/awt/peer/MenuPeer.java ! java/awt/peer/PanelPeer.java java/awt/peer/PopupMenuPeer.java ! java/awt/peer/ScrollPanePeer.java ! java/awt/peer/ScrollbarPeer.java ! java/awt/peer/TextAreaPeer.java ! java/awt/peer/TextComponentPeer.java java/awt/peer/TextFieldPeer.java java/awt/peer/WindowPeer.java: Add license clarification. 2002-01-22 Mark Wielaard ! * LIBGCJ_LICENSE gnu/classpath/Configuration.java.in ! gnu/gcj/runtime/StringBuffer.java ! gnu/java/awt/BitMaskExtent.java gnu/java/awt/Buffers.java ! gnu/java/awt/ComponentDataBlitOp.java ! gnu/java/awt/GLightweightPeer.java ! gnu/java/beans/BeanInfoEmbryo.java ! gnu/java/beans/EmptyBeanInfo.java ! gnu/java/beans/ExplicitBeanInfo.java ! gnu/java/beans/IntrospectionIncubator.java ! gnu/java/beans/editors/ColorEditor.java ! gnu/java/beans/editors/FontEditor.java ! gnu/java/beans/editors/NativeBooleanEditor.java ! gnu/java/beans/editors/NativeByteEditor.java ! gnu/java/beans/editors/NativeDoubleEditor.java ! gnu/java/beans/editors/NativeFloatEditor.java ! gnu/java/beans/editors/NativeIntEditor.java ! gnu/java/beans/editors/NativeLongEditor.java ! gnu/java/beans/editors/NativeShortEditor.java ! gnu/java/beans/editors/StringEditor.java ! gnu/java/beans/info/ComponentBeanInfo.java ! gnu/java/io/ClassLoaderObjectInputStream.java ! gnu/java/io/NullOutputStream.java ! gnu/java/io/ObjectIdentityWrapper.java ! gnu/java/lang/ArrayHelper.java gnu/java/lang/ClassHelper.java ! gnu/java/lang/reflect/TypeSignature.java ! gnu/java/locale/Calendar.java gnu/java/locale/Calendar_de.java ! gnu/java/locale/Calendar_en.java ! gnu/java/locale/Calendar_nl.java ! gnu/java/locale/LocaleInformation.java ! gnu/java/locale/LocaleInformation_de.java ! gnu/java/locale/LocaleInformation_en.java ! gnu/java/locale/LocaleInformation_nl.java ! gnu/java/math/MPN.java gnu/java/rmi/dgc/DGCImpl.java ! gnu/java/rmi/registry/RegistryImpl.java ! gnu/java/rmi/rmic/Compile_gcj.java ! gnu/java/rmi/rmic/Compiler.java ! gnu/java/rmi/rmic/CompilerProcess.java ! gnu/java/rmi/rmic/RMIC.java ! gnu/java/rmi/rmic/TabbedWriter.java ! gnu/java/rmi/server/ProtocolConstants.java ! gnu/java/rmi/server/RMIDefaultSocketFactory.java ! gnu/java/rmi/server/RMIHashes.java ! gnu/java/rmi/server/RMIObjectInputStream.java ! gnu/java/rmi/server/RMIObjectOutputStream.java ! gnu/java/rmi/server/UnicastConnection.java ! gnu/java/rmi/server/UnicastConnectionManager.java ! gnu/java/rmi/server/UnicastRef.java ! gnu/java/rmi/server/UnicastRemoteCall.java ! gnu/java/rmi/server/UnicastRemoteStub.java ! gnu/java/rmi/server/UnicastServer.java ! gnu/java/rmi/server/UnicastServerRef.java ! gnu/java/security/provider/DefaultPolicy.java ! gnu/java/security/provider/Gnu.java ! gnu/java/security/provider/SHA.java ! gnu/java/security/provider/SHA1PRNG.java ! gnu/java/text/BaseBreakIterator.java ! gnu/java/text/CharacterBreakIterator.java ! gnu/java/text/LineBreakIterator.java ! gnu/java/text/SentenceBreakIterator.java ! gnu/java/text/WordBreakIterator.java ! gnu/java/util/DoubleEnumeration.java java/applet/Applet.java ! java/applet/AppletContext.java java/applet/AppletStub.java ! java/applet/AudioClip.java java/awt/AWTError.java ! java/awt/AWTEvent.java java/awt/AWTEventMulticaster.java ! java/awt/AWTException.java java/awt/AWTPermission.java ! java/awt/ActiveEvent.java java/awt/BorderLayout.java ! java/awt/Button.java java/awt/Canvas.java ! java/awt/CardLayout.java java/awt/Checkbox.java ! java/awt/CheckboxGroup.java java/awt/Component.java ! java/awt/ComponentOrientation.java java/awt/Container.java ! java/awt/Dimension.java java/awt/Event.java ! java/awt/EventDispatchThread.java java/awt/EventQueue.java ! java/awt/FlowLayout.java java/awt/Frame.java ! java/awt/Graphics.java java/awt/Graphics2D.java ! java/awt/GraphicsConfiguration.java java/awt/GridLayout.java ! java/awt/IllegalComponentStateException.java ! java/awt/ItemSelectable.java java/awt/Label.java ! java/awt/LayoutManager.java java/awt/LayoutManager2.java ! java/awt/MenuComponent.java java/awt/MenuItem.java ! java/awt/Paint.java java/awt/Point.java ! java/awt/Rectangle.java java/awt/RenderingHints.java ! java/awt/Transparency.java java/awt/Window.java ! java/awt/color/ColorSpace.java ! java/awt/color/ICC_ColorSpace.java ! java/awt/color/ICC_Profile.java ! java/awt/event/HierarchyBoundsAdapter.java ! java/awt/event/HierarchyBoundsListener.java ! java/awt/event/HierarchyEvent.java ! java/awt/event/HierarchyListener.java ! java/awt/geom/AffineTransform.java ! java/awt/geom/Dimension2D.java java/awt/geom/Ellipse2D.java ! java/awt/geom/IllegalPathStateException.java ! java/awt/geom/Line2D.java ! java/awt/geom/NoninvertibleTransformException.java ! java/awt/geom/PathIterator.java java/awt/geom/Point2D.java ! java/awt/geom/Rectangle2D.java ! java/awt/geom/RectangularShape.java ! java/awt/geom/RoundRectangle2D.java ! java/awt/image/BufferedImage.java ! java/awt/image/ColorModel.java ! java/awt/image/ComponentColorModel.java ! java/awt/image/ComponentSampleModel.java ! java/awt/image/DataBuffer.java ! java/awt/image/DataBufferByte.java ! java/awt/image/DataBufferInt.java ! java/awt/image/DataBufferUShort.java ! java/awt/image/DirectColorModel.java ! java/awt/image/PackedColorModel.java ! java/awt/image/Raster.java java/awt/image/RasterOp.java ! java/awt/image/SampleModel.java ! java/awt/image/SinglePixelPackedSampleModel.java ! java/awt/image/WritableRaster.java ! java/beans/AppletInitializer.java ! java/beans/BeanDescriptor.java java/beans/BeanInfo.java ! java/beans/Beans.java java/beans/Customizer.java ! java/beans/DesignMode.java java/beans/EventSetDescriptor.java ! java/beans/FeatureDescriptor.java ! java/beans/IndexedPropertyDescriptor.java ! java/beans/IntrospectionException.java ! java/beans/Introspector.java java/beans/MethodDescriptor.java ! java/beans/ParameterDescriptor.java ! java/beans/PropertyChangeEvent.java ! java/beans/PropertyChangeListener.java ! java/beans/PropertyChangeSupport.java ! java/beans/PropertyDescriptor.java ! java/beans/PropertyEditor.java ! java/beans/PropertyEditorManager.java ! java/beans/PropertyEditorSupport.java ! java/beans/PropertyVetoException.java ! java/beans/SimpleBeanInfo.java ! java/beans/VetoableChangeListener.java ! java/beans/VetoableChangeSupport.java ! java/beans/Visibility.java ! java/beans/beancontext/BeanContext.java ! java/beans/beancontext/BeanContextChild.java ! java/beans/beancontext/BeanContextChildComponentProxy.java ! java/beans/beancontext/BeanContextChildSupport.java ! java/beans/beancontext/BeanContextContainerProxy.java ! java/beans/beancontext/BeanContextEvent.java ! java/beans/beancontext/BeanContextMembershipEvent.java ! java/beans/beancontext/BeanContextMembershipListener.java ! java/beans/beancontext/BeanContextProxy.java ! java/beans/beancontext/BeanContextServiceAvailableEvent.java ! java/beans/beancontext/BeanContextServiceProvider.java ! java/beans/beancontext/BeanContextServiceProviderBeanInfo.java ! java/beans/beancontext/BeanContextServiceRevokedEvent.java ! java/beans/beancontext/BeanContextServiceRevokedListener.java ! java/beans/beancontext/BeanContextServices.java ! java/beans/beancontext/BeanContextServicesListener.java ! java/io/BufferedInputStream.java ! java/io/BufferedOutputStream.java java/io/BufferedReader.java ! java/io/BufferedWriter.java java/io/ByteArrayInputStream.java ! java/io/ByteArrayOutputStream.java ! java/io/CharArrayReader.java java/io/CharArrayWriter.java ! java/io/CharConversionException.java java/io/DataInput.java ! java/io/DataInputStream.java java/io/DataOutput.java ! java/io/EOFException.java java/io/Externalizable.java ! java/io/FileFilter.java java/io/FileNotFoundException.java ! java/io/FilePermission.java java/io/FileReader.java ! java/io/FileWriter.java java/io/FilenameFilter.java ! java/io/FilterInputStream.java java/io/FilterOutputStream.java ! java/io/FilterReader.java java/io/FilterWriter.java ! java/io/IOException.java java/io/InputStream.java ! java/io/InterruptedIOException.java ! java/io/InvalidClassException.java ! java/io/InvalidObjectException.java ! java/io/NotActiveException.java ! java/io/NotSerializableException.java java/io/ObjectInput.java ! java/io/ObjectInputStream.java ! java/io/ObjectInputValidation.java java/io/ObjectOutput.java ! java/io/ObjectOutputStream.java java/io/ObjectStreamClass.java ! java/io/ObjectStreamConstants.java ! java/io/ObjectStreamException.java ! java/io/ObjectStreamField.java ! java/io/OptionalDataException.java java/io/OutputStream.java ! java/io/PipedInputStream.java java/io/PipedOutputStream.java ! java/io/PipedReader.java java/io/PipedWriter.java ! java/io/PrintWriter.java java/io/PushbackInputStream.java ! java/io/PushbackReader.java java/io/Reader.java ! java/io/SequenceInputStream.java java/io/Serializable.java ! java/io/SerializablePermission.java ! java/io/StreamCorruptedException.java ! java/io/StreamTokenizer.java ! java/io/StringBufferInputStream.java java/io/StringReader.java ! java/io/StringWriter.java java/io/SyncFailedException.java ! java/io/UTFDataFormatException.java ! java/io/UnsupportedEncodingException.java ! java/io/WriteAbortedException.java java/io/Writer.java ! java/lang/AbstractMethodError.java ! java/lang/ArithmeticException.java ! java/lang/ArrayIndexOutOfBoundsException.java ! java/lang/ArrayStoreException.java java/lang/Boolean.java ! java/lang/Byte.java java/lang/CharSequence.java ! java/lang/ClassCastException.java ! java/lang/ClassCircularityError.java ! java/lang/ClassFormatError.java ! java/lang/ClassNotFoundException.java ! java/lang/CloneNotSupportedException.java ! java/lang/Cloneable.java java/lang/Comparable.java ! java/lang/Compiler.java java/lang/Double.java ! java/lang/Error.java java/lang/Exception.java ! java/lang/ExceptionInInitializerError.java ! java/lang/Float.java java/lang/IllegalAccessError.java ! java/lang/IllegalAccessException.java ! java/lang/IllegalArgumentException.java ! java/lang/IllegalMonitorStateException.java ! java/lang/IllegalStateException.java ! java/lang/IllegalThreadStateException.java ! java/lang/IncompatibleClassChangeError.java ! java/lang/IndexOutOfBoundsException.java ! java/lang/InheritableThreadLocal.java ! java/lang/InstantiationError.java ! java/lang/InstantiationException.java java/lang/Integer.java ! java/lang/InternalError.java ! java/lang/InterruptedException.java ! java/lang/LinkageError.java java/lang/Long.java ! java/lang/NegativeArraySizeException.java ! java/lang/NoClassDefFoundError.java ! java/lang/NoSuchFieldError.java ! java/lang/NoSuchFieldException.java ! java/lang/NoSuchMethodError.java ! java/lang/NoSuchMethodException.java ! java/lang/NullPointerException.java java/lang/Number.java ! java/lang/NumberFormatException.java ! java/lang/OutOfMemoryError.java java/lang/Package.java ! java/lang/Process.java java/lang/Runnable.java ! java/lang/RuntimeException.java ! java/lang/RuntimePermission.java ! java/lang/SecurityException.java ! java/lang/SecurityManager.java java/lang/Short.java ! java/lang/StackOverflowError.java java/lang/StringBuffer.java ! java/lang/StringIndexOutOfBoundsException.java ! java/lang/ThreadDeath.java java/lang/ThreadGroup.java ! java/lang/ThreadLocal.java java/lang/UnknownError.java ! java/lang/UnsatisfiedLinkError.java ! java/lang/UnsupportedClassVersionError.java ! java/lang/UnsupportedOperationException.java ! java/lang/VerifyError.java java/lang/VirtualMachineError.java ! java/lang/Void.java java/lang/ref/PhantomReference.java ! java/lang/ref/Reference.java java/lang/ref/ReferenceQueue.java ! java/lang/ref/SoftReference.java ! java/lang/ref/WeakReference.java ! java/lang/reflect/AccessibleObject.java ! java/lang/reflect/InvocationTargetException.java ! java/lang/reflect/Member.java java/lang/reflect/Modifier.java ! java/lang/reflect/ReflectPermission.java ! java/math/BigDecimal.java java/math/BigInteger.java ! java/net/Authenticator.java java/net/BindException.java ! java/net/ConnectException.java java/net/ContentHandler.java ! java/net/ContentHandlerFactory.java ! java/net/DatagramPacket.java java/net/DatagramSocketImpl.java ! java/net/FileNameMap.java java/net/MalformedURLException.java ! java/net/MulticastSocket.java java/net/NetPermission.java ! java/net/NoRouteToHostException.java ! java/net/PasswordAuthentication.java ! java/net/ProtocolException.java java/net/ServerSocket.java ! java/net/Socket.java java/net/SocketException.java ! java/net/SocketImpl.java java/net/SocketImplFactory.java ! java/net/SocketOptions.java java/net/SocketPermission.java ! java/net/URLDecoder.java java/net/URLEncoder.java ! java/net/URLStreamHandlerFactory.java ! java/net/UnknownHostException.java ! java/net/UnknownServiceException.java ! java/rmi/AccessException.java ! java/rmi/AlreadyBoundException.java ! java/rmi/ConnectException.java ! java/rmi/ConnectIOException.java ! java/rmi/MarshalException.java java/rmi/MarshalledObject.java ! java/rmi/Naming.java java/rmi/NoSuchObjectException.java ! java/rmi/NotBoundException.java ! java/rmi/RMISecurityException.java ! java/rmi/RMISecurityManager.java java/rmi/Remote.java ! java/rmi/RemoteException.java java/rmi/ServerError.java ! java/rmi/ServerException.java ! java/rmi/ServerRuntimeException.java ! java/rmi/StubNotFoundException.java ! java/rmi/UnexpectedException.java ! java/rmi/UnknownHostException.java ! java/rmi/UnmarshalException.java ! java/rmi/activation/Activatable.java ! java/rmi/activation/ActivateFailedException.java ! java/rmi/activation/ActivationDesc.java ! java/rmi/activation/ActivationException.java ! java/rmi/activation/ActivationGroup.java ! java/rmi/activation/ActivationGroupDesc.java ! java/rmi/activation/ActivationGroupID.java ! java/rmi/activation/ActivationID.java ! java/rmi/activation/ActivationInstantiator.java ! java/rmi/activation/ActivationMonitor.java ! java/rmi/activation/ActivationSystem.java ! java/rmi/activation/Activator.java ! java/rmi/activation/UnknownGroupException.java ! java/rmi/activation/UnknownObjectException.java ! java/rmi/dgc/DGC.java java/rmi/dgc/Lease.java ! java/rmi/dgc/VMID.java java/rmi/registry/LocateRegistry.java ! java/rmi/registry/Registry.java ! java/rmi/registry/RegistryHandler.java ! java/rmi/server/ExportException.java ! java/rmi/server/LoaderHandler.java ! java/rmi/server/LogStream.java java/rmi/server/ObjID.java ! java/rmi/server/Operation.java ! java/rmi/server/RMIClassLoader.java ! java/rmi/server/RMIClientSocketFactory.java ! java/rmi/server/RMIFailureHandler.java ! java/rmi/server/RMIServerSocketFactory.java ! java/rmi/server/RMISocketFactory.java ! java/rmi/server/RemoteCall.java ! java/rmi/server/RemoteObject.java ! java/rmi/server/RemoteRef.java ! java/rmi/server/RemoteServer.java ! java/rmi/server/RemoteStub.java ! java/rmi/server/ServerCloneException.java ! java/rmi/server/ServerNotActiveException.java ! java/rmi/server/ServerRef.java java/rmi/server/Skeleton.java ! java/rmi/server/SkeletonMismatchException.java ! java/rmi/server/SkeletonNotFoundException.java ! java/rmi/server/SocketSecurityException.java ! java/rmi/server/UID.java ! java/rmi/server/UnicastRemoteObject.java ! java/rmi/server/Unreferenced.java ! java/security/AccessControlContext.java ! java/security/AccessControlException.java ! java/security/AccessController.java ! java/security/AlgorithmParameterGenerator.java ! java/security/AlgorithmParameterGeneratorSpi.java ! java/security/AlgorithmParameters.java ! java/security/AlgorithmParametersSpi.java ! java/security/AllPermission.java ! java/security/BasicPermission.java ! java/security/Certificate.java java/security/CodeSource.java ! java/security/DigestException.java ! java/security/DigestInputStream.java ! java/security/DigestOutputStream.java ! java/security/DomainCombiner.java ! java/security/DummyKeyPairGenerator.java ! java/security/DummyMessageDigest.java ! java/security/DummySignature.java ! java/security/GeneralSecurityException.java ! java/security/Guard.java java/security/GuardedObject.java ! java/security/Identity.java java/security/IdentityScope.java ! java/security/InvalidAlgorithmParameterException.java ! java/security/InvalidKeyException.java ! java/security/InvalidParameterException.java ! java/security/Key.java java/security/KeyException.java ! java/security/KeyFactory.java java/security/KeyFactorySpi.java ! java/security/KeyManagementException.java ! java/security/KeyPair.java java/security/KeyPairGenerator.java ! java/security/KeyPairGeneratorSpi.java ! java/security/KeyStore.java ! java/security/KeyStoreException.java ! java/security/KeyStoreSpi.java ! java/security/MessageDigest.java ! java/security/MessageDigestSpi.java ! java/security/NoSuchAlgorithmException.java ! java/security/NoSuchProviderException.java ! java/security/Permission.java ! java/security/PermissionCollection.java ! java/security/Permissions.java java/security/Policy.java ! java/security/Principal.java java/security/PrivateKey.java ! java/security/PrivilegedAction.java ! java/security/PrivilegedActionException.java ! java/security/PrivilegedExceptionAction.java ! java/security/ProtectionDomain.java ! java/security/Provider.java ! java/security/ProviderException.java ! java/security/PublicKey.java ! java/security/SecureClassLoader.java ! java/security/SecureRandom.java ! java/security/SecureRandomSpi.java java/security/Security.java ! java/security/SecurityPermission.java ! java/security/Signature.java ! java/security/SignatureException.java ! java/security/SignatureSpi.java ! java/security/SignedObject.java java/security/Signer.java ! java/security/UnrecoverableKeyException.java ! java/security/UnresolvedPermission.java ! java/security/acl/Acl.java java/security/acl/AclEntry.java ! java/security/acl/AclNotFoundException.java ! java/security/acl/Group.java ! java/security/acl/LastOwnerException.java ! java/security/acl/NotOwnerException.java ! java/security/acl/Owner.java java/security/acl/Permission.java ! java/security/cert/CRL.java ! java/security/cert/CRLException.java ! java/security/cert/Certificate.java ! java/security/cert/CertificateEncodingException.java ! java/security/cert/CertificateException.java ! java/security/cert/CertificateExpiredException.java ! java/security/cert/CertificateFactory.java ! java/security/cert/CertificateFactorySpi.java ! java/security/cert/CertificateNotYetValidException.java ! java/security/cert/CertificateParsingException.java ! java/security/cert/X509CRL.java ! java/security/cert/X509CRLEntry.java ! java/security/cert/X509Certificate.java ! java/security/cert/X509Extension.java ! java/security/interfaces/DSAKey.java ! java/security/interfaces/DSAKeyPairGenerator.java ! java/security/interfaces/DSAParams.java ! java/security/interfaces/DSAPrivateKey.java ! java/security/interfaces/DSAPublicKey.java ! java/security/interfaces/RSAKey.java ! java/security/interfaces/RSAPrivateCrtKey.java ! java/security/interfaces/RSAPrivateKey.java ! java/security/interfaces/RSAPublicKey.java ! java/security/spec/AlgorithmParameterSpec.java ! java/security/spec/DSAParameterSpec.java ! java/security/spec/DSAPrivateKeySpec.java ! java/security/spec/DSAPublicKeySpec.java ! java/security/spec/EncodedKeySpec.java ! java/security/spec/InvalidKeySpecException.java ! java/security/spec/InvalidParameterSpecException.java ! java/security/spec/KeySpec.java ! java/security/spec/PKCS8EncodedKeySpec.java ! java/security/spec/RSAKeyGenParameterSpec.java ! java/security/spec/RSAPrivateCrtKeySpec.java ! java/security/spec/RSAPrivateKeySpec.java ! java/security/spec/RSAPublicKeySpec.java ! java/security/spec/X509EncodedKeySpec.java java/sql/Array.java ! java/sql/BatchUpdateException.java java/sql/Blob.java ! java/sql/CallableStatement.java java/sql/Clob.java ! java/sql/Connection.java java/sql/DataTruncation.java ! java/sql/DatabaseMetaData.java java/sql/Date.java ! java/sql/Driver.java java/sql/DriverManager.java ! java/sql/DriverPropertyInfo.java ! java/sql/PreparedStatement.java java/sql/Ref.java ! java/sql/ResultSet.java java/sql/ResultSetMetaData.java ! java/sql/SQLData.java java/sql/SQLException.java ! java/sql/SQLInput.java java/sql/SQLOutput.java ! java/sql/SQLWarning.java java/sql/Statement.java ! java/sql/Struct.java java/sql/Time.java ! java/sql/Timestamp.java java/sql/Types.java ! java/text/Annotation.java ! java/text/AttributedCharacterIterator.java ! java/text/AttributedString.java ! java/text/AttributedStringIterator.java ! java/text/BreakIterator.java java/text/CharacterIterator.java ! java/text/ChoiceFormat.java java/text/Collator.java ! java/text/DateFormat.java java/text/DateFormatSymbols.java ! java/text/DecimalFormat.java ! java/text/DecimalFormatSymbols.java ! java/text/FieldPosition.java java/text/Format.java ! java/text/MessageFormat.java java/text/NumberFormat.java ! java/text/ParseException.java java/text/ParsePosition.java ! java/text/SimpleDateFormat.java ! java/text/StringCharacterIterator.java ! java/util/AbstractCollection.java java/util/AbstractList.java ! java/util/AbstractMap.java ! java/util/AbstractSequentialList.java ! java/util/AbstractSet.java java/util/ArrayList.java ! java/util/Arrays.java java/util/BasicMapEntry.java ! java/util/BitSet.java java/util/Calendar.java ! java/util/Collection.java java/util/Collections.java ! java/util/Comparator.java ! java/util/ConcurrentModificationException.java ! java/util/Date.java java/util/Dictionary.java ! java/util/EmptyStackException.java java/util/Enumeration.java ! java/util/EventListener.java java/util/EventObject.java ! java/util/GregorianCalendar.java java/util/HashMap.java ! java/util/HashSet.java java/util/Hashtable.java ! java/util/IdentityHashMap.java java/util/Iterator.java ! java/util/LinkedHashMap.java java/util/LinkedHashSet.java ! java/util/LinkedList.java java/util/List.java ! java/util/ListIterator.java java/util/ListResourceBundle.java ! java/util/Locale.java java/util/Map.java ! java/util/MissingResourceException.java ! java/util/NoSuchElementException.java ! java/util/Observable.java java/util/Observer.java ! java/util/Properties.java java/util/PropertyPermission.java ! java/util/PropertyResourceBundle.java java/util/Random.java ! java/util/RandomAccess.java java/util/ResourceBundle.java ! java/util/Set.java java/util/SimpleTimeZone.java ! java/util/SortedMap.java java/util/SortedSet.java ! java/util/Stack.java java/util/StringTokenizer.java ! java/util/TimeZone.java java/util/Timer.java ! java/util/TimerTask.java ! java/util/TooManyListenersException.java ! java/util/TreeMap.java java/util/TreeSet.java ! java/util/Vector.java java/util/WeakHashMap.java ! java/util/jar/Attributes.java java/util/jar/JarEntry.java ! java/util/jar/JarException.java java/util/jar/JarFile.java ! java/util/jar/JarInputStream.java ! java/util/jar/JarOutputStream.java java/util/jar/Manifest.java ! java/util/zip/Adler32.java java/util/zip/CRC32.java ! java/util/zip/CheckedInputStream.java ! java/util/zip/CheckedOutputStream.java ! java/util/zip/Checksum.java ! java/util/zip/DataFormatException.java ! java/util/zip/Deflater.java ! java/util/zip/DeflaterOutputStream.java ! java/util/zip/GZIPInputStream.java ! java/util/zip/GZIPOutputStream.java ! java/util/zip/Inflater.java ! java/util/zip/InflaterInputStream.java ! java/util/zip/ZipConstants.java java/util/zip/ZipEntry.java ! java/util/zip/ZipException.java java/util/zip/ZipFile.java ! java/util/zip/ZipInputStream.java ! java/util/zip/ZipOutputStream.java ! javax/naming/BinaryRefAddr.java ! javax/naming/InvalidNameException.java javax/naming/Name.java ! javax/naming/NamingException.java javax/naming/RefAddr.java javax/naming/StringRefAddr.java: Add license clarification. 2002-01-22 Tom Tromey *************** *** 2511,2517 **** * Makefile.in: Rebuilt. * Makefile.am (jv_convert_LDADD): Removed convert_source_files. ! 2002-01-08 Nic Ferrier * java/net/natPlainSocketImpl.cc: Added timeout handling for sockets. --- 7932,7938 ---- * Makefile.in: Rebuilt. * Makefile.am (jv_convert_LDADD): Removed convert_source_files. ! 2002-01-08 Nic Ferrier * java/net/natPlainSocketImpl.cc: Added timeout handling for sockets. *************** *** 2567,2570 **** * libjava/java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN for PPC Darwin, not for all of Darwin. - --- 7988,7990 ---- diff -Nrc3pad gcc-3.2.3/libjava/configure gcc-3.3/libjava/configure *** gcc-3.2.3/libjava/configure 2003-04-22 06:56:18.000000000 +0000 --- gcc-3.3/libjava/configure 2003-05-14 00:18:14.000000000 +0000 *************** ac_help="$ac_help *** 17,22 **** --- 17,24 ---- ac_help="$ac_help --with-cross-host=HOST configuring with a cross compiler" ac_help="$ac_help + --with-newlib Configuring with newlib" + ac_help="$ac_help --enable-multilib build many library versions (default)" ac_help="$ac_help --enable-maintainer-mode enable make rules and dependencies not useful *************** fi *** 581,587 **** ORIGINAL_LD_FOR_MULTILIBS=$LD echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:585: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 583,589 ---- ORIGINAL_LD_FOR_MULTILIBS=$LD echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:587: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test "${with_cross_host+set}" = set; *** 615,620 **** --- 617,629 ---- fi + # Check whether --with-newlib or --without-newlib was given. + if test "${with_newlib+set}" = set; then + withval="$with_newlib" + : + fi + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: *************** fi *** 627,633 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:631: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 636,642 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:640: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** test -z "$INSTALL_SCRIPT" && INSTALL_SCR *** 680,686 **** test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:684: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile --- 689,695 ---- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ! echo "configure:693: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile *************** test "$program_suffix" != NONE && *** 737,743 **** test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:741: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 746,752 ---- test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 770,781 **** fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 ! echo "configure:774: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:783: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else --- 795,801 ---- return __CYGWIN__; ; return 0; } EOF ! if { (eval echo configure:799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else *************** echo "$ac_t""$ac_cv_cygwin" 1>&6 *** 803,821 **** CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ! echo "configure:807: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else --- 812,830 ---- CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 ! echo "configure:816: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else *************** ac_configure=$ac_aux_dir/configure # Thi *** 911,917 **** fi # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" --- 920,926 ---- fi # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" *************** else { echo "configure: error: can not r *** 942,948 **** fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:946: checking host system type" >&5 host_alias=$host case "$host_alias" in --- 951,957 ---- fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:955: checking host system type" >&5 host_alias=$host case "$host_alias" in *************** host_os=`echo $host | sed 's/^\([^-]*\)- *** 963,969 **** echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 ! echo "configure:967: checking target system type" >&5 target_alias=$target case "$target_alias" in --- 972,978 ---- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 ! echo "configure:976: checking target system type" >&5 target_alias=$target case "$target_alias" in *************** target_os=`echo $target | sed 's/^\([^-] *** 981,987 **** echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:985: checking build system type" >&5 build_alias=$build case "$build_alias" in --- 990,996 ---- echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:994: checking build system type" >&5 build_alias=$build case "$build_alias" in *************** test "$host_alias" != "$target_alias" && *** 1010,1016 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1014: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1019,1025 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1023: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -z "$CC"; then *** 1040,1046 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1044: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1049,1055 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1053: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1091,1097 **** # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1095: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1100,1106 ---- # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1104: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1124,1130 **** echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1128: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1133,1139 ---- echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1137: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1133,1139 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 1142,1148 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** ac_test_CFLAGS="${CFLAGS+set}" *** 1152,1158 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1156: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1161,1167 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1165: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** do *** 1201,1207 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1205: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_glibjava_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1210,1216 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1214: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_glibjava_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** CXX=$glibjava_CXX *** 1236,1242 **** test -z "$glibjava_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1240: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1245,1251 ---- test -z "$glibjava_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:1249: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1245,1251 **** yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no --- 1254,1260 ---- yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no *************** if test $ac_cv_prog_gxx = yes; then *** 1260,1266 **** ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1264: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1269,1275 ---- ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:1273: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** EOF *** 1309,1315 **** missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:1313: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1318,1324 ---- missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ! echo "configure:1322: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 1322,1328 **** fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:1326: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1331,1337 ---- fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ! echo "configure:1335: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 1335,1341 **** fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:1339: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1344,1350 ---- fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 ! echo "configure:1348: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 1348,1354 **** fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:1352: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1357,1363 ---- fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ! echo "configure:1361: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** else *** 1361,1367 **** fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:1365: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. --- 1370,1376 ---- fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ! echo "configure:1374: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. *************** fi *** 1380,1386 **** # LIBGCJ_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:1384: checking build system type" >&5 build_alias=$build case "$build_alias" in --- 1389,1395 ---- # LIBGCJ_CONFIGURE, which doesn't work because that means that it will # be run before AC_CANONICAL_HOST. echo $ac_n "checking build system type""... $ac_c" 1>&6 ! echo "configure:1393: checking build system type" >&5 build_alias=$build case "$build_alias" in *************** echo "$ac_t""$build" 1>&6 *** 1401,1407 **** # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1405: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1410,1416 ---- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1414: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1433,1439 **** # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1437: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1442,1448 ---- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1446: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1465,1471 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1469: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1474,1480 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1478: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 1497,1503 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1501: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1506,1512 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1510: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1542,1548 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1546: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1551,1557 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:1555: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** test -z "$INSTALL_DATA" && INSTALL_DATA= *** 1596,1602 **** echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:1600: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" --- 1605,1611 ---- echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ! echo "configure:1609: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" *************** fi *** 1619,1640 **** ! # We need AC_EXEEXT to keep automake happy in cygnus mode. However, ! # at least currently, we never actually build a program, so we never ! # need to use $(EXEEXT). Moreover, the test for EXEEXT normally ! # fails, because we are probably configuring with a cross compiler ! # which cant create executables. So we include AC_EXEEXT to keep ! # automake happy, but we don't execute it, since we don't care about ! # the result. ! if false; then ! # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands ! # to nothing, so nothing would remain between `then' and `fi' if it ! # were not for the `:' below. ! : ! echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1638: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1628,1637 ---- ! echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 ! echo "configure:1635: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 1644,1650 **** rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; --- 1641,1647 ---- rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= ! if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; *************** test x"${ac_cv_exeext}" != xno && EXEEXT *** 1664,1670 **** echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT - fi # configure.host sets the following important variables # libgcj_cflags - host specific C compiler flags --- 1661,1666 ---- *************** EOF *** 1708,1714 **** # Sigh. Libtool's macro doesn't do the right thing. INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL" # FIXME: this is a hack. ! sub_auxdir="`cd $ac_aux_dir && pwd`" ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir" fi --- 1704,1710 ---- # Sigh. Libtool's macro doesn't do the right thing. INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL" # FIXME: this is a hack. ! sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`" ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir" fi *************** ac_prog=ld *** 1795,1801 **** if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 ! echo "configure:1799: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw --- 1791,1797 ---- if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 ! echo "configure:1795: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw *************** echo "configure:1799: checking for ld us *** 1825,1834 **** esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 ! echo "configure:1829: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 ! echo "configure:1832: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1821,1830 ---- esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 ! echo "configure:1825: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 ! echo "configure:1828: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 1863,1869 **** fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 ! echo "configure:1867: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1859,1865 ---- fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 ! echo "configure:1863: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** with_gnu_ld=$lt_cv_prog_gnu_ld *** 1880,1886 **** echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 ! echo "configure:1884: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1876,1882 ---- echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 ! echo "configure:1880: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** reload_flag=$lt_cv_ld_reload_flag *** 1892,1898 **** test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 ! echo "configure:1896: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1888,1894 ---- test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 ! echo "configure:1892: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** NM="$lt_cv_path_NM" *** 1930,1936 **** echo "$ac_t""$NM" 1>&6 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 ! echo "configure:1934: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1926,1932 ---- echo "$ac_t""$NM" 1>&6 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 ! echo "configure:1930: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** gnu*) *** 2002,2010 **** ;; hpux10.20*|hpux11*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) --- 1998,2015 ---- ;; hpux10.20*|hpux11*) ! case $host_cpu in ! hppa*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ! ;; ! ia64*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ! ;; ! esac ;; irix5* | irix6*) *************** file_magic_cmd=$lt_cv_file_magic_cmd *** 2094,2106 **** deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:2098: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:2104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; --- 2099,2111 ---- deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:2103: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:2109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *************** case $deplibs_check_method in *** 2124,2130 **** file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:2128: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2129,2135 ---- file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:2133: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2186,2192 **** if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:2190: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2191,2197 ---- if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:2195: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** esac *** 2257,2263 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2261: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2262,2268 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2266: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 2289,2295 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2293: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2294,2300 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2298: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 2324,2330 **** # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2328: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2329,2335 ---- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2333: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 2356,2362 **** # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2360: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2361,2367 ---- # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2365: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** test x"$pic_mode" = xno && libtool_flags *** 2423,2430 **** case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 2427 "configure"' > conftest.$ac_ext ! if { (eval echo configure:2428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" --- 2428,2448 ---- case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 2432 "configure"' > conftest.$ac_ext ! if { (eval echo configure:2433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! if test "$lt_cv_prog_gnu_ld" = yes; then ! case `/usr/bin/file conftest.$ac_objext` in ! *32-bit*) ! LD="${LD-ld} -melf32bsmip" ! ;; ! *N32*) ! LD="${LD-ld} -melf32bmipn32" ! ;; ! *64-bit*) ! LD="${LD-ld} -melf64bmip" ! ;; ! esac ! else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" *************** case $host in *** 2436,2441 **** --- 2454,2518 ---- LD="${LD-ld} -64" ;; esac + fi + fi + rm -rf conftest* + ;; + + ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:2466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; + + x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:2482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac fi rm -rf conftest* ;; *************** case $host in *** 2445,2451 **** SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:2449: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2522,2528 ---- SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:2526: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** ac_link='${CC-cc} -o conftest${ac_exeext *** 2458,2471 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else --- 2535,2548 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else *************** echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 *** 2495,2501 **** esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:2499: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2572,2578 ---- esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:2576: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** ac_link='${CXX-g++} -o conftest${ac_exee *** 2508,2519 **** cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2585,2596 ---- cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** if test "$libgcj_interpreter" = yes; the *** 2745,2753 **** EOF fi echo $ac_n "checking for exception model to use""... $ac_c" 1>&6 ! echo "configure:2751: checking for exception model to use" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 2822,2832 ---- EOF fi + INTERPRETER="$libgcj_interpreter" + echo $ac_n "checking for exception model to use""... $ac_c" 1>&6 ! echo "configure:2830: checking for exception model to use" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** if test "${enable_sjlj_exceptions+set}" *** 2762,2768 **** : else cat > conftest.$ac_ext << EOF ! #line 2766 "configure" struct S { ~S(); }; void bar(); void foo() --- 2841,2847 ---- : else cat > conftest.$ac_ext << EOF ! #line 2845 "configure" struct S { ~S(); }; void bar(); void foo() *************** void foo() *** 2773,2779 **** EOF old_CXXFLAGS="$CXXFLAGS" CXXFLAGS=-S ! if { (eval echo configure:2777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then enable_sjlj_exceptions=yes elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then --- 2852,2858 ---- EOF old_CXXFLAGS="$CXXFLAGS" CXXFLAGS=-S ! if { (eval echo configure:2856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then enable_sjlj_exceptions=yes elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then *************** if test "$with_libffi" != no; then *** 2846,2852 **** EOF LIBFFI=../libffi/libffi_convenience.la ! LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I$(MULTIBUILDTOP)../libffi/include' fi --- 2925,2931 ---- EOF LIBFFI=../libffi/libffi_convenience.la ! LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include' fi *************** case "$TARGET_ECOS" in *** 2881,2886 **** --- 2960,2989 ---- PLATFORM=Win32 PLATFORMOBJS=win32.lo PLATFORMH=win32.h + + echo $ac_n "checking whether 'ld' is at least 2.13""... $ac_c" 1>&6 + echo "configure:2966: checking whether 'ld' is at least 2.13" >&5 + LD_PROG=`$CC --print-prog-name=ld` + LD_VERSION=`$LD_PROG --version` + LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4` + LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2` + if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then + LD_OK="ok" + else + if expr "$LD_VERSION_MAJOR" = 2 && expr "$LD_VERSION_MINOR" \>= 13 > /dev/null; then + LD_OK="ok" + fi + fi + if test "x$LD_OK" != x; then + echo "$ac_t""yes; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR" 1>&6 + else + echo "$ac_t""no; major=$LD_VERSION_MAJOR, minor=$LD_VERSION_MINOR" 1>&6 + echo "configure: warning: ld <2.13 detected; enabling JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS hack..." 1>&2 + cat >> confdefs.h <<\EOF + #define JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS 1 + EOF + + fi ;; *) PLATFORM=Posix *************** esac *** 2903,2909 **** echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:2907: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 3006,3012 ---- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:3010: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** else *** 2918,2930 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 3021,3033 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** else *** 2935,2947 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 3038,3050 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** else *** 2952,2964 **** rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 3055,3067 ---- rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** fi *** 2983,2989 **** echo "$ac_t""$CPP" 1>&6 cat > conftest.$ac_ext < EOF --- 3086,3092 ---- echo "$ac_t""$CPP" 1>&6 cat > conftest.$ac_ext < EOF *************** fi *** 2998,3004 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 3101,3107 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** fi *** 3013,3019 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 3116,3122 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** fi *** 3028,3034 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 3131,3137 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** rm -f conftest* *** 3045,3051 **** cat > conftest.$ac_ext < EOF --- 3148,3154 ---- cat > conftest.$ac_ext < EOF *************** fi *** 3060,3066 **** rm -f conftest* cat > conftest.$ac_ext < EOF --- 3163,3169 ---- rm -f conftest* cat > conftest.$ac_ext < EOF *************** case "${host}" in *** 3095,3101 **** esac ! LIBGCJTESTSPEC="-L`pwd`/.libs -rpath `pwd`/.libs" # Check whether --with-system-zlib or --without-system-zlib was given. --- 3198,3204 ---- esac ! LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -rpath `${PWDCMD-pwd}`/.libs" # Check whether --with-system-zlib or --without-system-zlib was given. *************** ZLIBTESTSPEC= *** 3112,3118 **** libsubdir=.libs echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6 ! echo "configure:3116: checking for garbage collector to use" >&5 # Check whether --enable-java-gc or --disable-java-gc was given. if test "${enable_java_gc+set}" = set; then enableval="$enable_java_gc" --- 3215,3221 ---- libsubdir=.libs echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6 ! echo "configure:3219: checking for garbage collector to use" >&5 # Check whether --enable-java-gc or --disable-java-gc was given. if test "${enable_java_gc+set}" = set; then enableval="$enable_java_gc" *************** case "$GC" in *** 3135,3141 **** GCLIBS=../boehm-gc/libgcjgc_convenience.la GCINCS='-I$(top_srcdir)/../boehm-gc/include' JC1GCSPEC='-fuse-boehm-gc' ! GCTESTSPEC="-L`pwd`/../boehm-gc/.libs -rpath `pwd`/../boehm-gc/.libs" GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`" GCOBJS=boehm.lo --- 3238,3244 ---- GCLIBS=../boehm-gc/libgcjgc_convenience.la GCINCS='-I$(top_srcdir)/../boehm-gc/include' JC1GCSPEC='-fuse-boehm-gc' ! GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs" GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`" GCOBJS=boehm.lo *************** esac *** 3165,3171 **** echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 ! echo "configure:3169: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` echo "$ac_t""$THREADS" 1>&6 --- 3268,3274 ---- echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 ! echo "configure:3272: checking for thread model used by GCC" >&5 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` echo "$ac_t""$THREADS" 1>&6 *************** if test -d sysdep; then true; else mkdir *** 3280,3286 **** HASH_SYNC_SPEC= # Hash synchronization is only useful with posix threads right now. ! if test "$enable_hash_synchronization" = yes && test "$THREADS" = "posix"; then HASH_SYNC_SPEC=-fhash-synchronization cat >> confdefs.h <<\EOF #define JV_HASH_SYNCHRONIZATION 1 --- 3383,3389 ---- HASH_SYNC_SPEC= # Hash synchronization is only useful with posix threads right now. ! if test "$enable_hash_synchronization" = yes && test "$THREADS" != "none"; then HASH_SYNC_SPEC=-fhash-synchronization cat >> confdefs.h <<\EOF #define JV_HASH_SYNCHRONIZATION 1 *************** tool_include_dir='$(libdir)/gcc-lib/$(ta *** 3315,3321 **** ! if test -n "${with_cross_host}"; then # We are being configured with a cross compiler. AC_REPLACE_FUNCS # may not work correctly, because the compiler may not be able to # link executables. --- 3418,3424 ---- ! if test "x${with_newlib}" = "xyes"; then # We are being configured with a cross compiler. AC_REPLACE_FUNCS # may not work correctly, because the compiler may not be able to # link executables. *************** EOF *** 3362,3368 **** # If Canadian cross, then don't pick up tools from the build # directory. ! if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then CANADIAN=yes GCC_UNWIND_INCLUDE= GCJ="${target_alias}-gcj" --- 3465,3472 ---- # If Canadian cross, then don't pick up tools from the build # directory. ! if test x"$build" != x"$with_cross_host" \ ! && test x"$build" != x"$target"; then CANADIAN=yes GCC_UNWIND_INCLUDE= GCJ="${target_alias}-gcj" *************** else *** 3372,3383 **** for ac_func in strerror ioctl select fstat open fsync sleep opendir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3376: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3480: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3504,3510 ---- ; return 0; } EOF ! if { (eval echo configure:3508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 3427,3438 **** for ac_func in gmtime_r localtime_r readdir_r getpwuid_r getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3431: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3535: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3559,3565 ---- ; return 0; } EOF ! if { (eval echo configure:3563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 3482,3493 **** for ac_func in access stat mkdir rename rmdir unlink realpath utime chmod do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3486: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3590: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3614,3620 ---- ; return 0; } EOF ! if { (eval echo configure:3618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 3537,3548 **** for ac_func in nl_langinfo setlocale do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3541: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3645: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3669,3675 ---- ; return 0; } EOF ! if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 3592,3603 **** for ac_func in inet_aton inet_addr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3596: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3700: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3724,3730 ---- ; return 0; } EOF ! if { (eval echo configure:3728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 3647,3658 **** for ac_func in inet_pton uname inet_ntoa do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3651: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3755: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3779,3785 ---- ; return 0; } EOF ! if { (eval echo configure:3783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** else *** 3699,3713 **** fi done ! for ac_func in fork execvp pipe sigaction do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3706: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3810: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3834,3840 ---- ; return 0; } EOF ! if { (eval echo configure:3838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 3758,3774 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3762: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 3862,3878 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3866: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** fi *** 3795,3806 **** done echo $ac_n "checking for backtrace""... $ac_c" 1>&6 ! echo "configure:3799: checking for backtrace" >&5 if eval "test \"`echo '$''{'ac_cv_func_backtrace'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3903: checking for backtrace" >&5 if eval "test \"`echo '$''{'ac_cv_func_backtrace'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_backtrace=yes" else --- 3927,3933 ---- ; return 0; } EOF ! if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_backtrace=yes" else *************** EOF *** 3852,3862 **** else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6 ! echo "configure:3860: checking for dladdr in -ldl" >&5 ac_lib_var=`echo dl'_'dladdr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3956,3977 ---- else echo "$ac_t""no" 1>&6 + + case "$host" in + *mingw*) + # Has backtrace() defined in libgcj itself + cat >> confdefs.h <<\EOF + #define HAVE_BACKTRACE 1 + EOF + + ;; + esac + fi echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6 ! echo "configure:3975: checking for dladdr in -ldl" >&5 ac_lib_var=`echo dl'_'dladdr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 3864,3870 **** ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 3990,3996 ---- dladdr() ; return 0; } EOF ! if { (eval echo configure:3994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** else *** 3899,3910 **** echo "$ac_t""no" 1>&6 fi ! for ac_file in /proc/self/exe do ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_file""... $ac_c" 1>&6 ! echo "configure:3908: checking for $ac_file" >&5 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 4014,4026 ---- echo "$ac_t""no" 1>&6 fi ! if test x"$build" = x"$host"; then ! for ac_file in /proc/self/exe do ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_file""... $ac_c" 1>&6 ! echo "configure:4024: checking for $ac_file" >&5 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if eval "test \"`echo '$ac_cv_file_'$ac_ *** 3925,3931 **** #define $ac_tr_file 1 EOF ! cat >> confdefs.h <<\EOF #define HAVE_PROC_SELF_EXE 1 EOF --- 4041,4047 ---- #define $ac_tr_file 1 EOF ! cat >> confdefs.h <<\EOF #define HAVE_PROC_SELF_EXE 1 EOF *************** else *** 3935,3940 **** --- 4051,4066 ---- fi done + else + case $host in + *-linux*) + cat >> confdefs.h <<\EOF + #define HAVE_PROC_SELF_EXE 1 + EOF + + ;; + esac + fi *************** fi *** 3952,3958 **** echo $ac_n "checking for iconv""... $ac_c" 1>&6 ! echo "configure:3956: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 4078,4084 ---- echo $ac_n "checking for iconv""... $ac_c" 1>&6 ! echo "configure:4082: checking for iconv" >&5 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 3960,3966 **** am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext < #include --- 4086,4092 ---- am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat > conftest.$ac_ext < #include *************** iconv_t cd = iconv_open("",""); *** 3970,3976 **** iconv_close(cd); ; return 0; } EOF ! if { (eval echo configure:3974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else --- 4096,4102 ---- iconv_close(cd); ; return 0; } EOF ! if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_func_iconv=yes else *************** rm -f conftest* *** 3982,3988 **** am_save_LIBS="$LIBS" LIBS="$LIBS $am_cv_libiconv_ldpath -liconv" cat > conftest.$ac_ext < #include --- 4108,4114 ---- am_save_LIBS="$LIBS" LIBS="$LIBS $am_cv_libiconv_ldpath -liconv" cat > conftest.$ac_ext < #include *************** iconv_t cd = iconv_open("",""); *** 3992,3998 **** iconv_close(cd); ; return 0; } EOF ! if { (eval echo configure:3996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes --- 4118,4124 ---- iconv_close(cd); ; return 0; } EOF ! if { (eval echo configure:4122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_lib_iconv=yes am_cv_func_iconv=yes *************** echo "$ac_t""$am_cv_func_iconv" 1>&6 *** 4013,4025 **** EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 ! echo "configure:4017: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < --- 4139,4151 ---- EOF echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 ! echo "configure:4143: checking for iconv declaration" >&5 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** int main() { *** 4038,4044 **** ; return 0; } EOF ! if { (eval echo configure:4042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else --- 4164,4170 ---- ; return 0; } EOF ! if { (eval echo configure:4168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_proto_iconv_arg1="" else *************** EOF *** 4067,4085 **** if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 ! echo "configure:4071: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF ! if { (eval echo configure:4083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else --- 4193,4211 ---- if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 ! echo "configure:4197: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF ! if { (eval echo configure:4209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else *************** EOF *** 4100,4111 **** fi fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 ! echo "configure:4104: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4226,4237 ---- fi fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 ! echo "configure:4230: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** int main() { *** 4113,4119 **** struct tm *tp; tp->tm_sec; ; return 0; } EOF ! if { (eval echo configure:4117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else --- 4239,4245 ---- struct tm *tp; tp->tm_sec; ; return 0; } EOF ! if { (eval echo configure:4243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else *************** EOF *** 4134,4145 **** fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 ! echo "configure:4138: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> --- 4260,4271 ---- fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 ! echo "configure:4264: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> *************** int main() { *** 4147,4153 **** struct tm tm; tm.tm_zone; ; return 0; } EOF ! if { (eval echo configure:4151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else --- 4273,4279 ---- struct tm tm; tm.tm_zone; ; return 0; } EOF ! if { (eval echo configure:4277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else *************** EOF *** 4167,4178 **** else echo $ac_n "checking for tzname""... $ac_c" 1>&6 ! echo "configure:4171: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ --- 4293,4304 ---- else echo $ac_n "checking for tzname""... $ac_c" 1>&6 ! echo "configure:4297: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ *************** int main() { *** 4182,4188 **** atoi(*tzname); ; return 0; } EOF ! if { (eval echo configure:4186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else --- 4308,4314 ---- atoi(*tzname); ; return 0; } EOF ! if { (eval echo configure:4312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else *************** fi *** 4207,4218 **** for ac_func in gethostbyname_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4211: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4337: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4361,4367 ---- ; return 0; } EOF ! if { (eval echo configure:4365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** EOF *** 4262,4268 **** # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF --- 4388,4394 ---- # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF *************** rm -f conftest* *** 4282,4288 **** *" -D_REENTRANT "*) ;; *) echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6 ! echo "configure:4286: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5 if eval "test \"`echo '$''{'libjava_cv_gethostbyname_r_needs_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 4408,4414 ---- *" -D_REENTRANT "*) ;; *) echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6 ! echo "configure:4412: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5 if eval "test \"`echo '$''{'libjava_cv_gethostbyname_r_needs_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** ac_link='${CXX-g++} -o conftest${ac_exee *** 4295,4308 **** cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { gethostbyname_r("", 0, 0); ; return 0; } EOF ! if { (eval echo configure:4306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=no else --- 4421,4434 ---- cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { gethostbyname_r("", 0, 0); ; return 0; } EOF ! if { (eval echo configure:4432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=no else *************** else *** 4312,4325 **** CPPFLAGS_SAVE="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_REENTRANT" cat > conftest.$ac_ext < int main() { gethostbyname_r("", 0, 0); ; return 0; } EOF ! if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=yes else --- 4438,4451 ---- CPPFLAGS_SAVE="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_REENTRANT" cat > conftest.$ac_ext < int main() { gethostbyname_r("", 0, 0); ; return 0; } EOF ! if { (eval echo configure:4449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_gethostbyname_r_needs_reentrant=yes else *************** EOF *** 4354,4365 **** esac echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6 ! echo "configure:4358: checking for struct hostent_data" >&5 if eval "test \"`echo '$''{'libjava_cv_struct_hostent_data'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4484: checking for struct hostent_data" >&5 if eval "test \"`echo '$''{'libjava_cv_struct_hostent_data'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_struct_hostent_data=yes else --- 4496,4502 ---- struct hostent_data data; ; return 0; } EOF ! if { (eval echo configure:4500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libjava_cv_struct_hostent_data=yes else *************** done *** 4402,4408 **** # to exist where expected. (The root issue: AC_CHECK_FUNCS assumes C # linkage check is enough, yet C++ code requires proper prototypes.) cat > conftest.$ac_ext < EOF --- 4528,4534 ---- # to exist where expected. (The root issue: AC_CHECK_FUNCS assumes C # linkage check is enough, yet C++ code requires proper prototypes.) cat > conftest.$ac_ext < EOF *************** if (eval "$ac_cpp conftest.$ac_ext") 2>& *** 4413,4424 **** for ac_func in gethostbyaddr_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4417: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4543: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4567,4573 ---- ; return 0; } EOF ! if { (eval echo configure:4571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** EOF *** 4468,4474 **** # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF --- 4594,4600 ---- # We look for the one that returns `int'. # Hopefully this check is robust enough. cat > conftest.$ac_ext < EOF *************** rm -f conftest* *** 4495,4506 **** for ac_func in gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4499: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4625: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4649,4655 ---- ; return 0; } EOF ! if { (eval echo configure:4653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** EOF *** 4547,4553 **** EOF cat > conftest.$ac_ext < EOF --- 4673,4679 ---- EOF cat > conftest.$ac_ext < EOF *************** done *** 4578,4589 **** for ac_func in pthread_mutexattr_settype pthread_mutexattr_setkind_np do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4582: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4708: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4732,4738 ---- ; return 0; } EOF ! if { (eval echo configure:4736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 4636,4647 **** for ac_func in sched_yield do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4640: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4766: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4790,4796 ---- ; return 0; } EOF ! if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** EOF *** 4686,4692 **** else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6 ! echo "configure:4690: checking for sched_yield in -lrt" >&5 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4812,4818 ---- else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6 ! echo "configure:4816: checking for sched_yield in -lrt" >&5 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 4694,4700 **** ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 4831,4837 ---- sched_yield() ; return 0; } EOF ! if { (eval echo configure:4835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** else *** 4731,4737 **** echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6 ! echo "configure:4735: checking for sched_yield in -lposix4" >&5 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4857,4863 ---- echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6 ! echo "configure:4861: checking for sched_yield in -lposix4" >&5 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 4739,4745 **** ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 4876,4882 ---- sched_yield() ; return 0; } EOF ! if { (eval echo configure:4880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** done *** 4786,4792 **** # We can save a little space at runtime if the mutex has m_count # or __m_count. This is a nice hack for Linux. cat > conftest.$ac_ext < int main() { --- 4912,4918 ---- # We can save a little space at runtime if the mutex has m_count # or __m_count. This is a nice hack for Linux. cat > conftest.$ac_ext < int main() { *************** int main() { *** 4795,4801 **** ; return 0; } EOF ! if { (eval echo configure:4799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE_M_COUNT 1 --- 4921,4927 ---- ; return 0; } EOF ! if { (eval echo configure:4925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE_M_COUNT 1 *************** else *** 4807,4813 **** rm -rf conftest* cat > conftest.$ac_ext < int main() { --- 4933,4939 ---- rm -rf conftest* cat > conftest.$ac_ext < int main() { *************** int main() { *** 4816,4822 **** ; return 0; } EOF ! if { (eval echo configure:4820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE___M_COUNT 1 --- 4942,4948 ---- ; return 0; } EOF ! if { (eval echo configure:4946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define PTHREAD_MUTEX_HAVE___M_COUNT 1 *************** rm -f conftest* *** 4836,4847 **** for ac_func in gettimeofday time ftime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4840: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4966: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4990,4996 ---- ; return 0; } EOF ! if { (eval echo configure:4994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 4895,4906 **** for ac_func in memmove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4899: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5025: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 5049,5055 ---- ; return 0; } EOF ! if { (eval echo configure:5053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 4953,4964 **** for ac_func in memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4957: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5083: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 5107,5113 ---- ; return 0; } EOF ! if { (eval echo configure:5111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 5010,5016 **** fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:5014: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 5136,5142 ---- fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:5140: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 5018,5024 **** ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 5155,5161 ---- dlopen() ; return 0; } EOF ! if { (eval echo configure:5159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 5074,5080 **** #-------------------------------------------------------------------- echo $ac_n "checking for socket libraries""... $ac_c" 1>&6 ! echo "configure:5078: checking for socket libraries" >&5 if eval "test \"`echo '$''{'gcj_cv_lib_sockets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5200,5206 ---- #-------------------------------------------------------------------- echo $ac_n "checking for socket libraries""... $ac_c" 1>&6 ! echo "configure:5204: checking for socket libraries" >&5 if eval "test \"`echo '$''{'gcj_cv_lib_sockets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 5082,5093 **** gcj_checkBoth=0 unset ac_cv_func_connect echo $ac_n "checking for connect""... $ac_c" 1>&6 ! echo "configure:5086: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5212: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else --- 5236,5242 ---- ; return 0; } EOF ! if { (eval echo configure:5240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else *************** fi *** 5133,5139 **** if test "$gcj_checkSocket" = 1; then unset ac_cv_func_connect echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 ! echo "configure:5137: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 5259,5265 ---- if test "$gcj_checkSocket" = 1; then unset ac_cv_func_connect echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 ! echo "configure:5263: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 5141,5154 **** ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 5267,5280 ---- ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 5175,5186 **** LIBS="$LIBS -lsocket -lnsl" unset ac_cv_func_accept echo $ac_n "checking for accept""... $ac_c" 1>&6 ! echo "configure:5179: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5305: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else --- 5329,5335 ---- ; return 0; } EOF ! if { (eval echo configure:5333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else *************** fi *** 5230,5241 **** gcj_oldLibs=$LIBS LIBS="$LIBS $gcj_cv_lib_sockets" echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 ! echo "configure:5234: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5360: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else --- 5384,5390 ---- ; return 0; } EOF ! if { (eval echo configure:5388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else *************** if eval "test \"`echo '$ac_cv_func_'geth *** 5276,5282 **** else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 ! echo "configure:5280: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 5402,5408 ---- else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 ! echo "configure:5406: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 5284,5297 **** ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 5410,5423 ---- ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** echo "$ac_t""$gcj_cv_lib_sockets" 1>&6 *** 5323,5329 **** if test "$with_system_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 ! echo "configure:5327: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 5449,5455 ---- if test "$with_system_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 ! echo "configure:5453: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 5331,5337 **** ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 5468,5474 ---- deflate() ; return 0; } EOF ! if { (eval echo configure:5472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 5369,5375 **** # requires -ldl. if test "$GC" = boehm; then echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6 ! echo "configure:5373: checking for main in -ldl" >&5 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 5495,5501 ---- # requires -ldl. if test "$GC" = boehm; then echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6 ! echo "configure:5499: checking for main in -ldl" >&5 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 5377,5390 **** ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 5503,5516 ---- ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 5414,5425 **** fi if test -x "${builddotdot}/../../gcc/gcj"; then ! dir="`cd ${builddotdot}/../../gcc && pwd`" ! GCJ="$dir/gcj -B`pwd`/ -B$dir/" else CANADIAN=yes NULL_TARGET=yes ! GCJ="gcj -B`pwd`/" fi fi --- 5540,5551 ---- fi if test -x "${builddotdot}/../../gcc/gcj"; then ! dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`" ! GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/" else CANADIAN=yes NULL_TARGET=yes ! GCJ="gcj -B`${PWDCMD-pwd}`/" fi fi *************** test -f libgcj.spec || touch libgcj.spec *** 5429,5435 **** # We must search the source tree for java.lang, since we still don't # have libgcj.jar nor java/lang/*.class GCJ_SAVE_CPPFLAGS=$CPPFLAGS ! CPPFLAGS="$CPPFLAGS -I`pwd` -I`cd $srcdir && pwd`" # Since some classes depend on this one, we need its source available # before we can do any GCJ compilation test :-( --- 5555,5561 ---- # We must search the source tree for java.lang, since we still don't # have libgcj.jar nor java/lang/*.class GCJ_SAVE_CPPFLAGS=$CPPFLAGS ! CPPFLAGS="$CPPFLAGS -I`${PWDCMD-pwd}` -I`cd $srcdir && ${PWDCMD-pwd}`" # Since some classes depend on this one, we need its source available # before we can do any GCJ compilation test :-( *************** fi *** 5450,5456 **** # Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args. set dummy ${ac_tool_prefix}gcj; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5454: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5576,5582 ---- # Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args. set dummy ${ac_tool_prefix}gcj; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5580: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 5482,5488 **** # Extract the first word of "gcj", so it can be a program name with args. set dummy gcj; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5486: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5608,5614 ---- # Extract the first word of "gcj", so it can be a program name with args. set dummy gcj; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5612: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** exec 5>>./config.log *** 5544,5556 **** CPPFLAGS=$GCJ_SAVE_CPPFLAGS echo $ac_n "checking size of void *""... $ac_c" 1>&6 ! echo "configure:5548: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < --- 5670,5682 ---- CPPFLAGS=$GCJ_SAVE_CPPFLAGS echo $ac_n "checking size of void *""... $ac_c" 1>&6 ! echo "configure:5674: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat > conftest.$ac_ext < *************** int main() { *** 5560,5566 **** switch (0) case 0: case (sizeof (void *) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:5564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_void_p=$ac_size else --- 5686,5692 ---- switch (0) case 0: case (sizeof (void *) == $ac_size):; ; return 0; } EOF ! if { (eval echo configure:5690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_sizeof_void_p=$ac_size else *************** fi *** 5604,5609 **** --- 5730,5736 ---- + if test "$CANADIAN" = yes; then CANADIAN_TRUE= CANADIAN_FALSE='#' *************** toolexeclibdir=$toolexecmainlibdir/`$CC *** 5653,5660 **** - - # Determine gcj version number. gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'` --- 5780,5785 ---- *************** EOF *** 5667,5684 **** echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6 ! echo "configure:5671: checking for g++ -ffloat-store bug" >&5 save_CFLAGS="$CFLAGS" CFLAGS="-x c++ -O2 -ffloat-store" cat > conftest.$ac_ext < int main() { ; return 0; } EOF ! if { (eval echo configure:5682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 else --- 5792,5809 ---- echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6 ! echo "configure:5796: checking for g++ -ffloat-store bug" >&5 save_CFLAGS="$CFLAGS" CFLAGS="-x c++ -O2 -ffloat-store" cat > conftest.$ac_ext < int main() { ; return 0; } EOF ! if { (eval echo configure:5807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 else *************** fi *** 5694,5714 **** rm -f conftest* CFLAGS="$save_CFLAGS" ! for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h pwd.h sys/config.h stdint.h langinfo.h locale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:5702: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:5712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 5819,5839 ---- rm -f conftest* CFLAGS="$save_CFLAGS" ! for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h pwd.h sys/config.h stdint.h langinfo.h locale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:5827: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:5837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** for ac_hdr in dirent.h *** 5738,5754 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:5742: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:5752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 5863,5879 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:5867: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:5877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** for ac_hdr in inttypes.h *** 5778,5794 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:5782: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:5792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 5903,5919 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:5907: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:5917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** fi *** 5824,5835 **** done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 ! echo "configure:5828: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 5949,5960 ---- done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 ! echo "configure:5953: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** wait (&s); *** 5845,5851 **** s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF ! if { (eval echo configure:5849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else --- 5970,5976 ---- s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF ! if { (eval echo configure:5974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else *************** fi *** 5867,5878 **** echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:5871: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 5992,6003 ---- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:5996: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** else *** 5880,5886 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:5884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 6005,6011 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:6009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** rm -f conftest* *** 5897,5903 **** if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 6022,6028 ---- if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** fi *** 5915,5921 **** if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 6040,6046 ---- if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** if test "$cross_compiling" = yes; then *** 5936,5942 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 6061,6067 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** if (XOR (islower (i), ISLOWER (i)) || to *** 5947,5953 **** exit (0); } EOF ! if { (eval echo configure:5951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else --- 6072,6078 ---- exit (0); } EOF ! if { (eval echo configure:6076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else *************** EOF *** 5971,5982 **** fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 ! echo "configure:5975: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 6096,6107 ---- fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 ! echo "configure:6100: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** fi *** 6005,6013 **** echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6 ! echo "configure:6009: checking for in_addr_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS --- 6130,6138 ---- echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6 ! echo "configure:6134: checking for in_addr_t" >&5 cat > conftest.$ac_ext < #if STDC_HEADERS *************** int main() { *** 6021,6027 **** in_addr_t foo; ; return 0; } EOF ! if { (eval echo configure:6025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_IN_ADDR_T 1 --- 6146,6152 ---- in_addr_t foo; ; return 0; } EOF ! if { (eval echo configure:6150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_IN_ADDR_T 1 *************** fi *** 6037,6052 **** rm -f conftest* echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6 ! echo "configure:6041: checking whether struct ip_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct ip_mreq mreq; ; return 0; } EOF ! if { (eval echo configure:6050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IP_MREQ 1 --- 6162,6177 ---- rm -f conftest* echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6 ! echo "configure:6166: checking whether struct ip_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct ip_mreq mreq; ; return 0; } EOF ! if { (eval echo configure:6175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IP_MREQ 1 *************** fi *** 6062,6077 **** rm -f conftest* echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6 ! echo "configure:6066: checking whether struct ipv6_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct ipv6_mreq mreq6; ; return 0; } EOF ! if { (eval echo configure:6075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IPV6_MREQ 1 --- 6187,6202 ---- rm -f conftest* echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6 ! echo "configure:6191: checking whether struct ipv6_mreq is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct ipv6_mreq mreq6; ; return 0; } EOF ! if { (eval echo configure:6200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_STRUCT_IPV6_MREQ 1 *************** fi *** 6087,6102 **** rm -f conftest* echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6 ! echo "configure:6091: checking whether struct sockaddr_in6 is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct sockaddr_in6 addr6; ; return 0; } EOF ! if { (eval echo configure:6100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_INET6 1 --- 6212,6227 ---- rm -f conftest* echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6 ! echo "configure:6216: checking whether struct sockaddr_in6 is in netinet/in.h" >&5 cat > conftest.$ac_ext < int main() { struct sockaddr_in6 addr6; ; return 0; } EOF ! if { (eval echo configure:6225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_INET6 1 *************** fi *** 6112,6120 **** rm -f conftest* echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6 ! echo "configure:6116: checking for socklen_t in sys/socket.h" >&5 cat > conftest.$ac_ext < --- 6237,6245 ---- rm -f conftest* echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6 ! echo "configure:6241: checking for socklen_t in sys/socket.h" >&5 cat > conftest.$ac_ext < *************** int main() { *** 6123,6129 **** socklen_t x = 5; ; return 0; } EOF ! if { (eval echo configure:6127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SOCKLEN_T 1 --- 6248,6254 ---- socklen_t x = 5; ; return 0; } EOF ! if { (eval echo configure:6252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SOCKLEN_T 1 *************** fi *** 6139,6154 **** rm -f conftest* echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 ! echo "configure:6143: checking for tm_gmtoff in struct tm" >&5 cat > conftest.$ac_ext < int main() { struct tm tim; tim.tm_gmtoff = 0; ; return 0; } EOF ! if { (eval echo configure:6152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define STRUCT_TM_HAS_GMTOFF 1 --- 6264,6279 ---- rm -f conftest* echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 ! echo "configure:6268: checking for tm_gmtoff in struct tm" >&5 cat > conftest.$ac_ext < int main() { struct tm tim; tim.tm_gmtoff = 0; ; return 0; } EOF ! if { (eval echo configure:6277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define STRUCT_TM_HAS_GMTOFF 1 *************** else *** 6161,6176 **** rm -rf conftest* echo "$ac_t""no" 1>&6 echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6 ! echo "configure:6165: checking for global timezone variable" >&5 ! cat > conftest.$ac_ext < int main() { ! long z2 = timezone; ; return 0; } EOF ! if { (eval echo configure:6174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TIMEZONE 1 --- 6286,6301 ---- rm -rf conftest* echo "$ac_t""no" 1>&6 echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6 ! echo "configure:6290: checking for global timezone variable" >&5 ! cat > conftest.$ac_ext < int main() { ! void i(){long z2 = 2*timezone;} ; return 0; } EOF ! if { (eval echo configure:6299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TIMEZONE 1 *************** else *** 6182,6187 **** --- 6307,6336 ---- cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 + echo $ac_n "checking for global _timezone variable""... $ac_c" 1>&6 + echo "configure:6312: checking for global _timezone variable" >&5 + cat > conftest.$ac_ext < + int main() { + long z2 = _timezone; + ; return 0; } + EOF + if { (eval echo configure:6321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cat >> confdefs.h <<\EOF + #define HAVE_UNDERSCORE_TIMEZONE 1 + EOF + + echo "$ac_t""yes" 1>&6 + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 + fi + rm -f conftest* fi rm -f conftest* fi *************** rm -f conftest* *** 6190,6208 **** # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:6194: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:6206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else --- 6339,6357 ---- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:6343: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:6355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else *************** EOF *** 6223,6234 **** fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:6227: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:6376: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else --- 6405,6411 ---- char *p = (char *) alloca(1); ; return 0; } EOF ! if { (eval echo configure:6409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else *************** EOF *** 6288,6299 **** echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:6292: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:6441: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 *** 6318,6329 **** if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:6322: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:6471: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 6495,6501 ---- ; return 0; } EOF ! if { (eval echo configure:6499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 6373,6379 **** fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:6377: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 6522,6528 ---- fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:6526: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 6381,6387 **** ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else --- 6549,6555 ---- exit (find_stack_direction() < 0); } EOF ! if { (eval echo configure:6553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else *************** do *** 6427,6433 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:6431: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 6576,6582 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:6580: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** case "${host}" in *** 6480,6485 **** --- 6629,6640 ---- alpha*-*-linux*) SIGNAL_HANDLER=include/dwarf2-signal.h ;; + s390*-*-linux*) + SIGNAL_HANDLER=include/s390-signal.h + ;; + x86_64*-*-linux*) + SIGNAL_HANDLER=include/x86_64-signal.h + ;; sparc*-*-linux*) SIGNAL_HANDLER=include/dwarf2-signal.h ;; *************** if test "$enable_sjlj_exceptions" = yes; *** 6496,6501 **** --- 6651,6665 ---- SIGNAL_HANDLER=include/default-signal.h fi + # Define here any compiler flags that you need in order to make backtrace() work. + BACKTRACESPEC= + case "${host}" in + x86_64*-*-linux*) + BACKTRACESPEC=-fno-omit-frame-pointer + ;; + esac + + *************** fi *** 6511,6517 **** # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 ! echo "configure:6515: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then --- 6675,6681 ---- # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 ! echo "configure:6679: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then *************** if test "$ac_x_includes" = NO; then *** 6573,6584 **** # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:6582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 6737,6748 ---- # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:6746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** if test "$ac_x_libraries" = NO; then *** 6647,6660 **** ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. --- 6811,6824 ---- ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. *************** else *** 6760,6776 **** case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 ! echo "configure:6764: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else --- 6924,6940 ---- case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 ! echo "configure:6928: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else *************** rm -f conftest* *** 6786,6799 **** else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else --- 6950,6963 ---- else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else *************** rm -f conftest* *** 6825,6831 **** # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 ! echo "configure:6829: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 6989,6995 ---- # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 ! echo "configure:6993: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 6833,6839 **** ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 7008,7014 ---- dnet_ntoa() ; return 0; } EOF ! if { (eval echo configure:7012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 6866,6872 **** if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 ! echo "configure:6870: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7030,7036 ---- if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 ! echo "configure:7034: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 6874,6880 **** ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 7049,7055 ---- dnet_ntoa() ; return 0; } EOF ! if { (eval echo configure:7053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 6914,6925 **** # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 ! echo "configure:6918: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:7082: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else --- 7106,7112 ---- ; return 0; } EOF ! if { (eval echo configure:7110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else *************** fi *** 6963,6969 **** if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 ! echo "configure:6967: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7127,7133 ---- if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 ! echo "configure:7131: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 6971,6977 **** ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 7146,7152 ---- gethostbyname() ; return 0; } EOF ! if { (eval echo configure:7150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 7012,7023 **** # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 ! echo "configure:7016: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:7180: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else --- 7204,7210 ---- ; return 0; } EOF ! if { (eval echo configure:7208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else *************** fi *** 7061,7067 **** if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 ! echo "configure:7065: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7225,7231 ---- if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 ! echo "configure:7229: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 7069,7075 **** ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 7244,7250 ---- connect() ; return 0; } EOF ! if { (eval echo configure:7248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 7104,7115 **** # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 ! echo "configure:7108: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:7272: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else --- 7296,7302 ---- ; return 0; } EOF ! if { (eval echo configure:7300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else *************** fi *** 7153,7159 **** if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 ! echo "configure:7157: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7317,7323 ---- if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 ! echo "configure:7321: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 7161,7167 **** ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 7336,7342 ---- remove() ; return 0; } EOF ! if { (eval echo configure:7340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 7196,7207 **** # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 ! echo "configure:7200: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:7364: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else --- 7388,7394 ---- ; return 0; } EOF ! if { (eval echo configure:7392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else *************** fi *** 7245,7251 **** if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 ! echo "configure:7249: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7409,7415 ---- if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 ! echo "configure:7413: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 7253,7259 **** ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 7428,7434 ---- shmat() ; return 0; } EOF ! if { (eval echo configure:7432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** fi *** 7297,7303 **** # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 ! echo "configure:7301: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 7461,7467 ---- # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 ! echo "configure:7465: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 7305,7311 **** ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 7480,7486 ---- IceConnectionNumber() ; return 0; } EOF ! if { (eval echo configure:7484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** else *** 7396,7402 **** fi ! here=`pwd` # We get this from the environment. --- 7560,7566 ---- fi ! here=`${PWDCMD-pwd}` # We get this from the environment. *************** s%@COMPPATH@%$COMPPATH%g *** 7589,7594 **** --- 7753,7759 ---- s%@TESTSUBDIR_TRUE@%$TESTSUBDIR_TRUE%g s%@TESTSUBDIR_FALSE@%$TESTSUBDIR_FALSE%g s%@LIBGCJDEBUG@%$LIBGCJDEBUG%g + s%@INTERPRETER@%$INTERPRETER%g s%@LIBFFI@%$LIBFFI%g s%@LIBFFIINCS@%$LIBFFIINCS%g s%@PLATFORMOBJS@%$PLATFORMOBJS%g *************** s%@ZINCS@%$ZINCS%g *** 7624,7629 **** --- 7789,7795 ---- s%@DIVIDESPEC@%$DIVIDESPEC%g s%@CHECKREFSPEC@%$CHECKREFSPEC%g s%@EXCEPTIONSPEC@%$EXCEPTIONSPEC%g + s%@IEEESPEC@%$IEEESPEC%g s%@CANADIAN_TRUE@%$CANADIAN_TRUE%g s%@CANADIAN_FALSE@%$CANADIAN_FALSE%g s%@NULL_TARGET_TRUE@%$NULL_TARGET_TRUE%g *************** s%@GCC_UNWIND_INCLUDE@%$GCC_UNWIND_INCLU *** 7636,7645 **** s%@toolexecdir@%$toolexecdir%g s%@toolexecmainlibdir@%$toolexecmainlibdir%g s%@toolexeclibdir@%$toolexeclibdir%g - s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g s%@GCJVERSION@%$GCJVERSION%g s%@ALLOCA@%$ALLOCA%g s%@PERL@%$PERL%g s%@SYSDEP_SOURCES@%$SYSDEP_SOURCES%g s%@X_CFLAGS@%$X_CFLAGS%g s%@X_PRE_LIBS@%$X_PRE_LIBS%g --- 7802,7811 ---- s%@toolexecdir@%$toolexecdir%g s%@toolexecmainlibdir@%$toolexecmainlibdir%g s%@toolexeclibdir@%$toolexeclibdir%g s%@GCJVERSION@%$GCJVERSION%g s%@ALLOCA@%$ALLOCA%g s%@PERL@%$PERL%g + s%@BACKTRACESPEC@%$BACKTRACESPEC%g s%@SYSDEP_SOURCES@%$SYSDEP_SOURCES%g s%@X_CFLAGS@%$X_CFLAGS%g s%@X_PRE_LIBS@%$X_PRE_LIBS%g *************** CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} *** 7914,7919 **** --- 8080,8086 ---- libgcj_basedir=${libgcj_basedir} CC="${CC}" CXX="${CXX}" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" EOF cat >> $CONFIG_STATUS <<\EOF *************** esac *** 7936,7942 **** # Make subdirectories and `.d' files. Look in both srcdir and # builddir for the .java files. ! h=`pwd` : > deps.mk ( (cd $srcdir && find . \( -name '*.java' -o -name '*.cc' \) -print) ; find . \( -name '*.java' -o -name '*.cc' \) -print) | \ --- 8103,8109 ---- # Make subdirectories and `.d' files. Look in both srcdir and # builddir for the .java files. ! h=`${PWDCMD-pwd}` : > deps.mk ( (cd $srcdir && find . \( -name '*.java' -o -name '*.cc' \) -print) ; find . \( -name '*.java' -o -name '*.cc' \) -print) | \ diff -Nrc3pad gcc-3.2.3/libjava/configure.host gcc-3.3/libjava/configure.host *** gcc-3.2.3/libjava/configure.host 2002-06-10 04:15:26.000000000 +0000 --- gcc-3.3/libjava/configure.host 2003-02-13 02:09:26.000000000 +0000 *************** CHECKREFSPEC= *** 65,70 **** --- 65,80 ---- # This case statement supports per-CPU defaults. case "${host}" in + arm*-elf | strongarm*-elf | xscale*-elf) + with_libffi_default=no + PROCESS=Ecos + FILE=Posix + CHECKREFSPEC=-fcheck-references + EXCEPTIONSPEC= + enable_java_net_default=no + enable_getenv_properties_default=no + enable_main_args_default=no + ;; mips-tx39-*|mipstx39-unknown-*) libgcj_flags="${libgcj_flags} -G 0" LDFLAGS="$LDFLAGS -Tjmr3904dram.ld" *************** case "${host}" in *** 85,95 **** --- 95,126 ---- enable_hash_synchronization_default=yes slow_pthread_self=yes ;; + x86_64-*) + CHECKREFSPEC="%{m32:-fcheck-references}" + sysdeps_dir=x86-64 + libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer" + libgcj_cxxflags="-D__NO_MATH_INLINES" + libgcj_cflags="-D__NO_MATH_INLINES" + enable_hash_synchronization_default=yes + slow_pthread_self=yes + libgcj_interpreter=yes + ;; alpha*-*) sysdeps_dir=alpha libgcj_flags="${libgcj_flags} -mieee" libgcj_interpreter=yes enable_hash_synchronization_default=yes + IEEESPEC=-mieee + ;; + powerpc64*-*) + # libffi not ported. + with_libffi_default=no + libgcj_interpreter=no + libgcj_flags="${libgcj_flags} -mminimal-toc" + # this may not be correct + sysdeps_dir=powerpc + enable_hash_synchronization_default=yes + slow_pthread_self=yes ;; powerpc*-*) sysdeps_dir=powerpc *************** case "${host}" in *** 97,103 **** enable_hash_synchronization_default=yes slow_pthread_self=yes ;; ! sparc-*) ;; ia64-*) sysdeps_dir=ia64 --- 128,140 ---- enable_hash_synchronization_default=yes slow_pthread_self=yes ;; ! s390*-*) ! sysdeps_dir=s390 ! libgcj_interpreter=yes ! enable_hash_synchronization_default=yes ! ;; ! sparc*-*) ! libgcj_interpreter=yes ;; ia64-*) sysdeps_dir=ia64 *************** case "${host}" in *** 105,119 **** libgcj_interpreter=yes enable_hash_synchronization_default=yes ;; ! xscale*-elf) ! with_libffi_default=no ! PROCESS=Ecos ! FILE=Posix CHECKREFSPEC=-fcheck-references EXCEPTIONSPEC= ! enable_java_net_default=no ! enable_getenv_properties_default=no ! enable_main_args_default=no ;; esac --- 142,154 ---- libgcj_interpreter=yes enable_hash_synchronization_default=yes ;; ! sh-* | sh[34]*-*) ! sysdeps_dir=sh ! libgcj_flags="${libgcj_flags} -mieee" ! libgcj_interpreter=yes CHECKREFSPEC=-fcheck-references EXCEPTIONSPEC= ! enable_hash_synchronization_default=yes ;; esac *************** case "${host}" in *** 125,137 **** i[34567]86*-linux* | \ powerpc*-linux* | \ alpha*-linux* | \ sparc*-linux* | \ ! ia64-*) can_unwind_signal=yes ;; *-*-darwin*) enable_hash_synchronization_default=no slow_pthread_self= ;; *-*-freebsd*) slow_pthread_self= --- 160,175 ---- i[34567]86*-linux* | \ powerpc*-linux* | \ alpha*-linux* | \ + s390*-linux* | \ sparc*-linux* | \ ! ia64-* | \ ! x86_64*-linux*) can_unwind_signal=yes ;; *-*-darwin*) enable_hash_synchronization_default=no slow_pthread_self= + can_unwind_signal=no ;; *-*-freebsd*) slow_pthread_self= diff -Nrc3pad gcc-3.2.3/libjava/configure.in gcc-3.3/libjava/configure.in *** gcc-3.2.3/libjava/configure.in 2003-01-28 01:44:39.000000000 +0000 --- gcc-3.3/libjava/configure.in 2003-03-28 23:42:56.000000000 +0000 *************** AC_ARG_WITH(target-subdir, *** 16,21 **** --- 16,24 ---- AC_ARG_WITH(cross-host, [ --with-cross-host=HOST configuring with a cross compiler]) + AC_ARG_WITH(newlib, + [ --with-newlib Configuring with newlib]) + LIBGCJ_CONFIGURE(.) AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h) *************** if test -z "${with_cross_host}"; then *** 29,35 **** # Sigh. Libtool's macro doesn't do the right thing. INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL" # FIXME: this is a hack. ! sub_auxdir="`cd $ac_aux_dir && pwd`" ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir" fi AC_SUBST(INCLTDL) --- 32,38 ---- # Sigh. Libtool's macro doesn't do the right thing. INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL" # FIXME: this is a hack. ! sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`" ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir" fi AC_SUBST(INCLTDL) *************** AC_ARG_ENABLE(interpreter, *** 112,117 **** --- 115,122 ---- if test "$libgcj_interpreter" = yes; then AC_DEFINE(INTERPRETER) fi + INTERPRETER="$libgcj_interpreter" + AC_SUBST(INTERPRETER) AC_MSG_CHECKING([for exception model to use]) AC_LANG_SAVE *************** LIBFFIINCS= *** 191,197 **** if test "$with_libffi" != no; then AC_DEFINE(USE_LIBFFI) LIBFFI=../libffi/libffi_convenience.la ! LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I$(MULTIBUILDTOP)../libffi/include' fi AC_SUBST(LIBFFI) AC_SUBST(LIBFFIINCS) --- 196,202 ---- if test "$with_libffi" != no; then AC_DEFINE(USE_LIBFFI) LIBFFI=../libffi/libffi_convenience.la ! LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include' fi AC_SUBST(LIBFFI) AC_SUBST(LIBFFIINCS) *************** case "$TARGET_ECOS" in *** 221,226 **** --- 226,232 ---- PLATFORM=Win32 PLATFORMOBJS=win32.lo PLATFORMH=win32.h + CHECK_FOR_BROKEN_MINGW_LD ;; *) PLATFORM=Posix *************** case "${host}" in *** 273,279 **** esac AC_SUBST(SYSTEMSPEC) ! LIBGCJTESTSPEC="-L`pwd`/.libs -rpath `pwd`/.libs" AC_SUBST(LIBGCJTESTSPEC) AC_ARG_WITH(system-zlib, --- 279,285 ---- esac AC_SUBST(SYSTEMSPEC) ! LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -rpath `${PWDCMD-pwd}`/.libs" AC_SUBST(LIBGCJTESTSPEC) AC_ARG_WITH(system-zlib, *************** case "$GC" in *** 307,313 **** GCLIBS=../boehm-gc/libgcjgc_convenience.la GCINCS='-I$(top_srcdir)/../boehm-gc/include' JC1GCSPEC='-fuse-boehm-gc' ! GCTESTSPEC="-L`pwd`/../boehm-gc/.libs -rpath `pwd`/../boehm-gc/.libs" dnl We also want to pick up some cpp flags required when including dnl boehm-config.h. Yuck. --- 313,319 ---- GCLIBS=../boehm-gc/libgcjgc_convenience.la GCINCS='-I$(top_srcdir)/../boehm-gc/include' JC1GCSPEC='-fuse-boehm-gc' ! GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs" dnl We also want to pick up some cpp flags required when including dnl boehm-config.h. Yuck. *************** AC_LINK_FILES(sysdep/$sysdeps_dir/locks. *** 439,445 **** HASH_SYNC_SPEC= # Hash synchronization is only useful with posix threads right now. ! if test "$enable_hash_synchronization" = yes && test "$THREADS" = "posix"; then HASH_SYNC_SPEC=-fhash-synchronization AC_DEFINE(JV_HASH_SYNCHRONIZATION, 1, [Define if hash synchronization is in use]) fi --- 445,451 ---- HASH_SYNC_SPEC= # Hash synchronization is only useful with posix threads right now. ! if test "$enable_hash_synchronization" = yes && test "$THREADS" != "none"; then HASH_SYNC_SPEC=-fhash-synchronization AC_DEFINE(JV_HASH_SYNCHRONIZATION, 1, [Define if hash synchronization is in use]) fi *************** changequote([,])dnl *** 465,471 **** AC_SUBST(tool_include_dir) AC_SUBST(gcc_version) ! if test -n "${with_cross_host}"; then # We are being configured with a cross compiler. AC_REPLACE_FUNCS # may not work correctly, because the compiler may not be able to # link executables. --- 471,477 ---- AC_SUBST(tool_include_dir) AC_SUBST(gcc_version) ! if test "x${with_newlib}" = "xyes"; then # We are being configured with a cross compiler. AC_REPLACE_FUNCS # may not work correctly, because the compiler may not be able to # link executables. *************** if test -n "${with_cross_host}"; then *** 488,494 **** # If Canadian cross, then don't pick up tools from the build # directory. ! if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then CANADIAN=yes GCC_UNWIND_INCLUDE= GCJ="${target_alias}-gcj" --- 494,501 ---- # If Canadian cross, then don't pick up tools from the build # directory. ! if test x"$build" != x"$with_cross_host" \ ! && test x"$build" != x"$target"; then CANADIAN=yes GCC_UNWIND_INCLUDE= GCJ="${target_alias}-gcj" *************** else *** 501,507 **** AC_CHECK_FUNCS(nl_langinfo setlocale) AC_CHECK_FUNCS(inet_aton inet_addr, break) AC_CHECK_FUNCS(inet_pton uname inet_ntoa) ! AC_CHECK_FUNCS(fork execvp pipe sigaction) AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h) AC_CHECK_FUNC(backtrace, [ case "$host" in --- 508,514 ---- AC_CHECK_FUNCS(nl_langinfo setlocale) AC_CHECK_FUNCS(inet_aton inet_addr, break) AC_CHECK_FUNCS(inet_pton uname inet_ntoa) ! AC_CHECK_FUNCS(fork execvp pipe sigaction ftruncate) AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h) AC_CHECK_FUNC(backtrace, [ case "$host" in *************** else *** 512,523 **** AC_DEFINE(HAVE_BACKTRACE) ;; esac ]) AC_CHECK_LIB(dl, dladdr, [ AC_DEFINE(HAVE_DLADDR)]) ! AC_CHECK_FILES(/proc/self/exe, [ ! AC_DEFINE(HAVE_PROC_SELF_EXE)]) AM_ICONV AM_LC_MESSAGES --- 519,545 ---- AC_DEFINE(HAVE_BACKTRACE) ;; esac + ], [ + case "$host" in + *mingw*) + # Has backtrace() defined in libgcj itself + AC_DEFINE(HAVE_BACKTRACE) + ;; + esac ]) AC_CHECK_LIB(dl, dladdr, [ AC_DEFINE(HAVE_DLADDR)]) ! if test x"$build" = x"$host"; then ! AC_CHECK_FILES(/proc/self/exe, [ ! AC_DEFINE(HAVE_PROC_SELF_EXE)]) ! else ! case $host in ! *-linux*) ! AC_DEFINE(HAVE_PROC_SELF_EXE) ! ;; ! esac ! fi AM_ICONV AM_LC_MESSAGES *************** changequote(<<,>>) *** 710,721 **** changequote([,]) fi if test -x "${builddotdot}/../../gcc/gcj"; then ! dir="`cd ${builddotdot}/../../gcc && pwd`" ! GCJ="$dir/gcj -B`pwd`/ -B$dir/" else CANADIAN=yes NULL_TARGET=yes ! GCJ="gcj -B`pwd`/" fi fi --- 732,743 ---- changequote([,]) fi if test -x "${builddotdot}/../../gcc/gcj"; then ! dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`" ! GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/" else CANADIAN=yes NULL_TARGET=yes ! GCJ="gcj -B`${PWDCMD-pwd}`/" fi fi *************** test -f libgcj.spec || touch libgcj.spec *** 725,731 **** # We must search the source tree for java.lang, since we still don't # have libgcj.jar nor java/lang/*.class GCJ_SAVE_CPPFLAGS=$CPPFLAGS ! CPPFLAGS="$CPPFLAGS -I`pwd` -I`cd $srcdir && pwd`" # Since some classes depend on this one, we need its source available # before we can do any GCJ compilation test :-( --- 747,753 ---- # We must search the source tree for java.lang, since we still don't # have libgcj.jar nor java/lang/*.class GCJ_SAVE_CPPFLAGS=$CPPFLAGS ! CPPFLAGS="$CPPFLAGS -I`${PWDCMD-pwd}` -I`cd $srcdir && ${PWDCMD-pwd}`" # Since some classes depend on this one, we need its source available # before we can do any GCJ compilation test :-( *************** AC_SUBST(ZINCS) *** 767,772 **** --- 789,795 ---- AC_SUBST(DIVIDESPEC) AC_SUBST(CHECKREFSPEC) AC_SUBST(EXCEPTIONSPEC) + AC_SUBST(IEEESPEC) AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes) AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes) *************** AC_SUBST(toolexecdir) *** 787,801 **** AC_SUBST(toolexecmainlibdir) AC_SUBST(toolexeclibdir) - AC_SUBST(AM_RUNTESTFLAGS) - # Determine gcj version number. changequote(<<,>>) gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'` changequote([,]) GCJVERSION=$gcjversion AC_SUBST(GCJVERSION) ! AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version]) dnl Work around a g++ bug. Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000. AC_MSG_CHECKING([for g++ -ffloat-store bug]) --- 810,822 ---- AC_SUBST(toolexecmainlibdir) AC_SUBST(toolexeclibdir) # Determine gcj version number. changequote(<<,>>) gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'` changequote([,]) GCJVERSION=$gcjversion AC_SUBST(GCJVERSION) ! AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version ID]) dnl Work around a g++ bug. Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000. AC_MSG_CHECKING([for g++ -ffloat-store bug]) *************** CFLAGS="$save_CFLAGS" *** 810,816 **** dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there. dnl On that system, sys/ioctl.h will not include sys/filio.h unless dnl BSD_COMP is defined; just including sys/filio.h is simpler. ! AC_CHECK_HEADERS(unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h pwd.h sys/config.h stdint.h langinfo.h locale.h) dnl We avoid AC_HEADER_DIRENT since we really only care about dirent.h dnl for now. If you change this, you also must update natFile.cc. AC_CHECK_HEADERS(dirent.h) --- 831,837 ---- dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there. dnl On that system, sys/ioctl.h will not include sys/filio.h unless dnl BSD_COMP is defined; just including sys/filio.h is simpler. ! AC_CHECK_HEADERS(unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h pwd.h sys/config.h stdint.h langinfo.h locale.h) dnl We avoid AC_HEADER_DIRENT since we really only care about dirent.h dnl for now. If you change this, you also must update natFile.cc. AC_CHECK_HEADERS(dirent.h) *************** AC_TRY_COMPILE([#include ], [str *** 870,879 **** dnl FIXME: we don't want a link check here because that won't work dnl when cross-compiling. So instead we make an assumption that dnl the header file will mention timezone if it exists. ! AC_TRY_COMPILE([#include ], [long z2 = timezone;], [AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes)], ! [AC_MSG_RESULT(no)])]) AC_FUNC_ALLOCA --- 891,907 ---- dnl FIXME: we don't want a link check here because that won't work dnl when cross-compiling. So instead we make an assumption that dnl the header file will mention timezone if it exists. ! dnl Don't find the win32 function timezone ! AC_TRY_COMPILE([#include ], [void i(){long z2 = 2*timezone;}], [AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes)], ! [AC_MSG_RESULT(no) ! AC_MSG_CHECKING([for global _timezone variable]) ! dnl FIXME: As above, don't want link check ! AC_TRY_COMPILE([#include ], [long z2 = _timezone;], ! [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE) ! AC_MSG_RESULT(yes)], ! [AC_MSG_RESULT(no)])])]) AC_FUNC_ALLOCA *************** case "${host}" in *** 901,906 **** --- 929,940 ---- alpha*-*-linux*) SIGNAL_HANDLER=include/dwarf2-signal.h ;; + s390*-*-linux*) + SIGNAL_HANDLER=include/s390-signal.h + ;; + x86_64*-*-linux*) + SIGNAL_HANDLER=include/x86_64-signal.h + ;; sparc*-*-linux*) SIGNAL_HANDLER=include/dwarf2-signal.h ;; *************** if test "$enable_sjlj_exceptions" = yes; *** 917,922 **** --- 951,965 ---- SIGNAL_HANDLER=include/default-signal.h fi + # Define here any compiler flags that you need in order to make backtrace() work. + BACKTRACESPEC= + case "${host}" in + x86_64*-*-linux*) + BACKTRACESPEC=-fno-omit-frame-pointer + ;; + esac + AC_SUBST(BACKTRACESPEC) + AC_SUBST(SYSDEP_SOURCES) AC_LINK_FILES($SIGNAL_HANDLER, include/java-signal.h) *************** AM_CONDITIONAL(XLIB_AWT, test "$use_xlib *** 965,971 **** AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes) ! here=`pwd` AC_SUBST(here) # We get this from the environment. --- 1008,1014 ---- AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes) ! here=`${PWDCMD-pwd}` AC_SUBST(here) # We get this from the environment. *************** esac *** 982,988 **** # Make subdirectories and `.d' files. Look in both srcdir and # builddir for the .java files. ! h=`pwd` : > deps.mk ( (cd $srcdir && find . \( -name '*.java' -o -name '*.cc' \) -print) ; find . \( -name '*.java' -o -name '*.cc' \) -print) | \ --- 1025,1031 ---- # Make subdirectories and `.d' files. Look in both srcdir and # builddir for the .java files. ! h=`${PWDCMD-pwd}` : > deps.mk ( (cd $srcdir && find . \( -name '*.java' -o -name '*.cc' \) -print) ; find . \( -name '*.java' -o -name '*.cc' \) -print) | \ *************** CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} *** 1010,1013 **** --- 1053,1057 ---- libgcj_basedir=${libgcj_basedir} CC="${CC}" CXX="${CXX}" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" ) diff -Nrc3pad gcc-3.2.3/libjava/defineclass.cc gcc-3.3/libjava/defineclass.cc *** gcc-3.2.3/libjava/defineclass.cc 2001-12-10 01:18:30.000000000 +0000 --- gcc-3.3/libjava/defineclass.cc 2002-12-19 19:32:16.000000000 +0000 *************** *** 1,6 **** // defineclass.cc - defining a class from .class format. ! /* Copyright (C) 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // defineclass.cc - defining a class from .class format. ! /* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** details. */ *** 35,41 **** #include #include #include - #include #include #include --- 35,40 ---- *************** _Jv_ClassReader::handleClassBegin *** 891,914 **** throw_no_class_def_found_error (msg); } ! def->accflags = access_flags; pool_data[this_class].clazz = def; pool_tags[this_class] = JV_CONSTANT_ResolvedClass; ! if (super_class == 0) { - // interfaces have java.lang.Object as super. - if (access_flags & Modifier::INTERFACE) - { - def->superclass = (jclass)&java::lang::Object::class$; - } - // FIXME: Consider this carefully! ! else if (!_Jv_equalUtf8Consts (def->name, ! java::lang::Object::class$.name)) ! { ! throw_no_class_def_found_error ("loading java.lang.Object"); ! } } // In the pre-loading state, it can be looked up in the --- 890,904 ---- throw_no_class_def_found_error (msg); } ! def->accflags = access_flags | java::lang::reflect::Modifier::INTERPRETED; pool_data[this_class].clazz = def; pool_tags[this_class] = JV_CONSTANT_ResolvedClass; ! if (super_class == 0 && ! (access_flags & Modifier::INTERFACE)) { // FIXME: Consider this carefully! ! if (! _Jv_equalUtf8Consts (def->name, java::lang::Object::class$.name)) ! throw_no_class_def_found_error ("loading java.lang.Object"); } // In the pre-loading state, it can be looked up in the *************** _Jv_ClassReader::handleClassBegin *** 924,948 **** if (super_class != 0) { ! // load the super class check_tag (super_class, JV_CONSTANT_Class); _Jv_Utf8Const* super_name = pool_data[super_class].utf8; ! // load the super class using our defining loader jclass the_super = _Jv_FindClass (super_name, def->loader); // This will establish that we are allowed to be a subclass, ! // and check for class circularity error checkExtends (def, the_super); ! def->superclass = the_super; pool_data[super_class].clazz = the_super; pool_tags[super_class] = JV_CONSTANT_ResolvedClass; } ! // now we've come past the circularity problem, we can ! // now say that we're loading... def->state = JV_STATE_LOADING; def->notifyAll (); --- 914,943 ---- if (super_class != 0) { ! // Load the superclass. check_tag (super_class, JV_CONSTANT_Class); _Jv_Utf8Const* super_name = pool_data[super_class].utf8; ! // Load the superclass using our defining loader. jclass the_super = _Jv_FindClass (super_name, def->loader); // This will establish that we are allowed to be a subclass, ! // and check for class circularity error. checkExtends (def, the_super); ! // Note: for an interface we will find Object as the ! // superclass. We still check it above to ensure class file ! // validity, but we simply assign `null' to the actual field in ! // this case. ! def->superclass = (((access_flags & Modifier::INTERFACE)) ! ? NULL : the_super); pool_data[super_class].clazz = the_super; pool_tags[super_class] = JV_CONSTANT_ResolvedClass; } ! // Now we've come past the circularity problem, we can ! // now say that we're loading. def->state = JV_STATE_LOADING; def->notifyAll (); *************** void _Jv_ClassReader::handleFieldsEnd () *** 1189,1203 **** void _Jv_ClassReader::handleMethodsBegin (int count) { ! def->methods = (_Jv_Method*) ! _Jv_AllocBytes (sizeof (_Jv_Method)*count); def->interpreted_methods = (_Jv_MethodBase **) _Jv_AllocBytes (sizeof (_Jv_MethodBase *) * count); for (int i = 0; i < count; i++) ! def->interpreted_methods[i] = 0; def->method_count = count; } --- 1184,1200 ---- void _Jv_ClassReader::handleMethodsBegin (int count) { ! def->methods = (_Jv_Method *) _Jv_AllocBytes (sizeof (_Jv_Method) * count); def->interpreted_methods = (_Jv_MethodBase **) _Jv_AllocBytes (sizeof (_Jv_MethodBase *) * count); for (int i = 0; i < count; i++) ! { ! def->interpreted_methods[i] = 0; ! def->methods[i].index = (_Jv_ushort) -1; ! } def->method_count = count; } *************** void _Jv_ClassReader::handleCodeAttribut *** 1262,1267 **** --- 1259,1265 ---- method->exc_count = exc_table_length; method->defining_class = def; method->self = &def->methods[method_index]; + method->prepared = NULL; // grab the byte code! memcpy ((void*) method->bytecode (), *************** void _Jv_ClassReader::handleCodeAttribut *** 1271,1277 **** def->interpreted_methods[method_index] = method; } ! void _Jv_ClassReader::handleExceptionTableEntry (int method_index, int exc_index, int start_pc, int end_pc, int handler_pc, int catch_type) { --- 1269,1275 ---- def->interpreted_methods[method_index] = method; } ! void _Jv_ClassReader::handleExceptionTableEntry (int method_index, int exc_index, int start_pc, int end_pc, int handler_pc, int catch_type) { *************** void _Jv_ClassReader::handleExceptionTab *** 1279,1288 **** (def->interpreted_methods[method_index]); _Jv_InterpException *exc = method->exceptions (); ! exc[exc_index].start_pc = start_pc; ! exc[exc_index].end_pc = end_pc; ! exc[exc_index].handler_pc = handler_pc; ! exc[exc_index].handler_type = catch_type; } void _Jv_ClassReader::handleMethodsEnd () --- 1277,1286 ---- (def->interpreted_methods[method_index]); _Jv_InterpException *exc = method->exceptions (); ! exc[exc_index].start_pc.i = start_pc; ! exc[exc_index].end_pc.i = end_pc; ! exc[exc_index].handler_pc.i = handler_pc; ! exc[exc_index].handler_type.i = catch_type; } void _Jv_ClassReader::handleMethodsEnd () *************** throw_internal_error (char *msg) *** 1380,1391 **** throw new java::lang::InternalError (JvNewStringLatin1 (msg)); } ! static void throw_incompatible_class_change_error (jstring msg) { throw new java::lang::IncompatibleClassChangeError (msg); } ! static void throw_class_circularity_error (jstring msg) { throw new java::lang::ClassCircularityError (msg); } --- 1378,1391 ---- throw new java::lang::InternalError (JvNewStringLatin1 (msg)); } ! static void ! throw_incompatible_class_change_error (jstring msg) { throw new java::lang::IncompatibleClassChangeError (msg); } ! static void ! throw_class_circularity_error (jstring msg) { throw new java::lang::ClassCircularityError (msg); } diff -Nrc3pad gcc-3.2.3/libjava/gcj/cni.h gcc-3.3/libjava/gcj/cni.h *** gcc-3.2.3/libjava/gcj/cni.h 2001-05-22 06:47:48.000000000 +0000 --- gcc-3.3/libjava/gcj/cni.h 2002-04-10 20:36:02.000000000 +0000 *************** *** 2,8 **** // This file describes the Cygnus Native Interface, CNI. // It provides a nicer interface to many of the things in gcj/javaprims.h. ! /* Copyright (C) 1998, 1999 Free Software Foundation This file is part of libgcj. --- 2,8 ---- // This file describes the Cygnus Native Interface, CNI. // It provides a nicer interface to many of the things in gcj/javaprims.h. ! /* Copyright (C) 1998, 1999, 2002 Free Software Foundation This file is part of libgcj. *************** JvAttachCurrentThread (jstring name, jav *** 131,136 **** --- 131,142 ---- return _Jv_AttachCurrentThread (name, group); } + extern inline java::lang::Thread* + JvAttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group) + { + return _Jv_AttachCurrentThreadAsDaemon (name, group); + } + extern inline jint JvDetachCurrentThread (void) { diff -Nrc3pad gcc-3.2.3/libjava/gcj/.cvsignore gcc-3.3/libjava/gcj/.cvsignore *** gcc-3.2.3/libjava/gcj/.cvsignore 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gcj/.cvsignore 2002-10-10 05:21:53.000000000 +0000 *************** *** 0 **** --- 1 ---- + stamp-h2.in diff -Nrc3pad gcc-3.2.3/libjava/gcj/javaprims.h gcc-3.3/libjava/gcj/javaprims.h *** gcc-3.2.3/libjava/gcj/javaprims.h 2002-02-15 03:21:47.000000000 +0000 --- gcc-3.3/libjava/gcj/javaprims.h 2003-01-20 06:49:28.000000000 +0000 *************** extern "Java" *** 120,125 **** --- 120,126 ---- class SyncFailedException; class UTFDataFormatException; class UnsupportedEncodingException; + class VMObjectStreamClass; class ValidatorAndPriority; class WriteAbortedException; class Writer; *************** extern "Java" *** 131,139 **** class ArithmeticException; class ArrayIndexOutOfBoundsException; class ArrayStoreException; class Boolean; class Byte; - class CPlusPlusDemangler; class CharSequence; class Character; class Character$Subset; --- 132,140 ---- class ArithmeticException; class ArrayIndexOutOfBoundsException; class ArrayStoreException; + class AssertionError; class Boolean; class Byte; class CharSequence; class Character; class Character$Subset; *************** extern "Java" *** 193,198 **** --- 194,200 ---- class SecurityManager; class Short; class StackOverflowError; + class StackTraceElement; class StrictMath; class String; class String$CaseInsensitiveComparator; *************** extern "Java" *** 203,209 **** class ThreadDeath; class ThreadGroup; class ThreadLocal; - class ThreadLocal$Value; class Throwable; class UnknownError; class UnsatisfiedLinkError; --- 205,210 ---- *************** extern "Java" *** 211,216 **** --- 212,218 ---- class UnsupportedOperationException; class VMClassLoader; class VMSecurityManager; + class VMThrowable; class VerifyError; class VirtualMachineError; class Void; *************** extern "Java" *** 229,239 **** --- 231,248 ---- class Array; class Constructor; class Field; + class InvocationHandler; class InvocationTargetException; class Member; class Method; class Modifier; + class Proxy; + class Proxy$ClassFactory; + class Proxy$ProxyData; + class Proxy$ProxySignature; + class Proxy$ProxyType; class ReflectPermission; + class UndeclaredThrowableException; }; }; *************** extern "Java" *** 241,272 **** { class AbstractCollection; class AbstractList; - class AbstractList$AbstractListItr; class AbstractMap; class AbstractSequentialList; class AbstractSet; class ArrayList; class Arrays; ! class Arrays$ListImpl; ! class BasicMapEntry; class BitSet; class Calendar; class Collection; class Collections; class Collections$ReverseComparator; class Collections$SynchronizedCollection; class Collections$SynchronizedIterator; class Collections$SynchronizedList; class Collections$SynchronizedListIterator; class Collections$SynchronizedMap; class Collections$SynchronizedSet; class Collections$SynchronizedSortedMap; class Collections$SynchronizedSortedSet; class Collections$UnmodifiableCollection; class Collections$UnmodifiableIterator; class Collections$UnmodifiableList; class Collections$UnmodifiableListIterator; class Collections$UnmodifiableMap; class Collections$UnmodifiableSet; class Collections$UnmodifiableSortedMap; class Collections$UnmodifiableSortedSet; --- 250,291 ---- { class AbstractCollection; class AbstractList; class AbstractMap; + class AbstractMap$BasicMapEntry; class AbstractSequentialList; class AbstractSet; class ArrayList; class Arrays; ! class Arrays$ArrayList; class BitSet; class Calendar; class Collection; class Collections; + class Collections$CopiesList; + class Collections$EmptyList; + class Collections$EmptyMap; + class Collections$EmptySet; class Collections$ReverseComparator; + class Collections$SingletonList; + class Collections$SingletonMap; + class Collections$SingletonSet; class Collections$SynchronizedCollection; class Collections$SynchronizedIterator; class Collections$SynchronizedList; class Collections$SynchronizedListIterator; class Collections$SynchronizedMap; + class Collections$SynchronizedMapEntry; + class Collections$SynchronizedRandomAccessList; class Collections$SynchronizedSet; class Collections$SynchronizedSortedMap; class Collections$SynchronizedSortedSet; class Collections$UnmodifiableCollection; + class Collections$UnmodifiableEntrySet; class Collections$UnmodifiableIterator; class Collections$UnmodifiableList; class Collections$UnmodifiableListIterator; class Collections$UnmodifiableMap; + class Collections$UnmodifiableRandomAccessList; class Collections$UnmodifiableSet; class Collections$UnmodifiableSortedMap; class Collections$UnmodifiableSortedSet; *************** extern "Java" *** 277,282 **** --- 296,302 ---- class EmptyStackException; class Enumeration; class EventListener; + class EventListenerProxy; class EventObject; class GregorianCalendar; class HashMap; *************** extern "Java" *** 288,297 **** --- 308,319 ---- class Hashtable$HashEntry; class Hashtable$HashIterator; class IdentityHashMap; + class IdentityHashMap$IdentityEntry; class IdentityHashMap$IdentityIterator; class Iterator; class LinkedHashMap; class LinkedHashMap$LinkedHashEntry; + class LinkedHashSet; class LinkedList; class LinkedList$Entry; class LinkedList$LinkedListItr; *************** extern "Java" *** 303,316 **** --- 325,341 ---- class Map$Entry; class Map$Map; class MissingResourceException; + class MyResources; class NoSuchElementException; class Observable; class Observer; class Properties; class PropertyPermission; + class PropertyPermissionCollection; class PropertyResourceBundle; class Random; class RandomAccess; + class RandomAccessSubList; class ResourceBundle; class Set; class SimpleTimeZone; *************** extern "Java" *** 329,340 **** class TreeMap$Node; class TreeMap$SubMap; class TreeMap$TreeIterator; - class TreeMap$VerifyResult; class TreeSet; class Vector; class WeakHashMap; - class WeakHashMap$Entry; class WeakHashMap$WeakBucket; class WeakHashMap$WeakEntrySet; namespace jar { --- 354,364 ---- class TreeMap$Node; class TreeMap$SubMap; class TreeMap$TreeIterator; class TreeSet; class Vector; class WeakHashMap; class WeakHashMap$WeakBucket; + class WeakHashMap$WeakEntry; class WeakHashMap$WeakEntrySet; namespace jar { *************** extern "Java" *** 349,354 **** --- 373,385 ---- class Manifest; }; + namespace regex + { + class Matcher; + class Pattern; + class PatternSyntaxException; + }; + namespace zip { class Adler32; *************** extern "Java" *** 365,373 **** class InflaterInputStream; class ZipConstants; class ZipEntry; - class ZipEnumeration; class ZipException; class ZipFile; class ZipInputStream; class ZipOutputStream; }; --- 396,405 ---- class InflaterInputStream; class ZipConstants; class ZipEntry; class ZipException; class ZipFile; + class ZipFile$PartialInputStream; + class ZipFile$ZipEntryEnumeration; class ZipInputStream; class ZipOutputStream; }; *************** jint *** 418,423 **** --- 450,457 ---- _Jv_AttachCurrentThread(java::lang::Thread* thread); extern "C" java::lang::Thread* _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group); + extern "C" java::lang::Thread* + _Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group); extern "C" jint _Jv_DetachCurrentThread (void); extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__)); diff -Nrc3pad gcc-3.2.3/libjava/gcj/Makefile.in gcc-3.3/libjava/gcj/Makefile.in *** gcc-3.2.3/libjava/gcj/Makefile.in 2002-04-10 13:10:14.000000000 +0000 --- gcc-3.3/libjava/gcj/Makefile.in 2003-03-01 22:57:52.000000000 +0000 *************** *** 1,6 **** ! # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. --- 1,6 ---- ! # Makefile.in generated automatically by automake 1.4 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. *************** host_alias = @host_alias@ *** 63,71 **** host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ - AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ AR = @AR@ AS = @AS@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ --- 63,71 ---- host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ AR = @AR@ AS = @AS@ + BACKTRACESPEC = @BACKTRACESPEC@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ *************** GCOBJS = @GCOBJS@ *** 87,93 **** --- 87,95 ---- GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ + IEEESPEC = @IEEESPEC@ INCLTDL = @INCLTDL@ + INTERPRETER = @INTERPRETER@ JC1GCSPEC = @JC1GCSPEC@ LIBFFI = @LIBFFI@ LIBFFIINCS = @LIBFFIINCS@ *************** here = @here@ *** 129,134 **** --- 131,139 ---- libgcj_basedir = @libgcj_basedir@ mkinstalldirs = @mkinstalldirs@ tool_include_dir = @tool_include_dir@ + toolexecdir = @toolexecdir@ + toolexeclibdir = @toolexeclibdir@ + toolexecmainlibdir = @toolexecmainlibdir@ AUTOMAKE_OPTIONS = foreign diff -Nrc3pad gcc-3.2.3/libjava/gij.cc gcc-3.3/libjava/gij.cc *** gcc-3.2.3/libjava/gij.cc 2002-02-27 05:37:40.000000000 +0000 --- gcc-3.3/libjava/gij.cc 2002-10-25 03:28:00.000000000 +0000 *************** help () *** 28,38 **** --- 28,42 ---- printf (" to interpret Java bytecodes, or\n"); printf (" gij -jar [OPTION] ... JARFILE [ARGS] ...\n"); printf (" to execute a jar file\n\n"); + printf (" --cp LIST set class path\n"); + printf (" --classpath LIST set class path\n"); printf (" -DVAR=VAL define property VAR with value VAL\n"); printf (" --help print this help, then exit\n"); printf (" --ms=NUMBER set initial heap size\n"); printf (" --mx=NUMBER set maximum heap size\n"); + printf (" --showversion print version number, then keep going\n"); printf (" --version print version number, then exit\n"); + printf ("\nOptions can be specified with `-' or `--'.\n"); printf ("\nSee http://gcc.gnu.org/java/ for information on reporting bugs\n"); exit (0); } *************** version () *** 44,50 **** printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n"); printf ("This is free software; see the source for copying conditions. There is NO\n"); printf ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); - exit (0); } int --- 48,53 ---- *************** main (int argc, const char **argv) *** 90,95 **** --- 93,103 ---- if (! strcmp (arg, "-help")) help (); else if (! strcmp (arg, "-version")) + { + version (); + exit (0); + } + else if (! strcmp (arg, "-showversion")) version (); /* FIXME: use getopt and avoid the ugliness here. We at least need to handle the argument in a better way. */ *************** main (int argc, const char **argv) *** 115,120 **** --- 123,137 ---- goto no_arg; _Jv_SetMaximumHeapSize (argv[++i]); } + else if (! strcmp (arg, "-cp") || ! strcmp (arg, "-classpath")) + { + if (i >= argc - 1) + goto no_arg; + // We set _Jv_Jar_Class_Path. If the user specified `-jar' + // then the jar code will override this. This is the + // correct behavior. + _Jv_Jar_Class_Path = argv[++i]; + } else { fprintf (stderr, "gij: unrecognized option -- `%s'\n", argv[i]); diff -Nrc3pad gcc-3.2.3/libjava/gnu/awt/j2d/DirectRasterGraphics.java gcc-3.3/libjava/gnu/awt/j2d/DirectRasterGraphics.java *** gcc-3.2.3/libjava/gnu/awt/j2d/DirectRasterGraphics.java 2001-02-15 04:36:34.000000000 +0000 --- gcc-3.3/libjava/gnu/awt/j2d/DirectRasterGraphics.java 2003-01-15 23:53:17.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2003 Free Software Foundation This file is part of libgcj. *************** public interface DirectRasterGraphics ex *** 61,67 **** public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints); ! public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints); public void drawString(String str, int x, int y); --- 61,68 ---- public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints); ! public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints, ! int translateX, int translateY); public void drawString(String str, int x, int y); diff -Nrc3pad gcc-3.2.3/libjava/gnu/awt/j2d/Graphics2DImpl.java gcc-3.3/libjava/gnu/awt/j2d/Graphics2DImpl.java *** gcc-3.2.3/libjava/gnu/awt/j2d/Graphics2DImpl.java 2000-10-22 17:46:09.000000000 +0000 --- gcc-3.3/libjava/gnu/awt/j2d/Graphics2DImpl.java 2003-01-02 00:14:02.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 9,14 **** --- 9,15 ---- package gnu.awt.j2d; import java.awt.Color; + import java.awt.Composite; import java.awt.Image; import java.awt.Shape; import java.awt.Rectangle; *************** import java.awt.Font; *** 19,26 **** --- 20,34 ---- import java.awt.FontMetrics; import java.awt.Paint; import java.awt.RenderingHints; + import java.awt.Stroke; import java.awt.geom.AffineTransform; import java.awt.image.ImageObserver; + import java.awt.image.BufferedImage; + import java.awt.image.BufferedImageOp; + import java.awt.image.RenderedImage; + import java.awt.image.renderable.RenderableImage; + import java.text.AttributedCharacterIterator; + import java.util.Map; /** * Delegates almost all work to a state object, that allows us to *************** public class Graphics2DImpl extends Grap *** 451,454 **** --- 459,519 ---- "has not been implemented yet"; throw new UnsupportedOperationException(msg); } + + public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void drawRenderedImage(RenderedImage image, AffineTransform xform) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void drawRenderableImage(RenderableImage image, AffineTransform xform) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void drawString(AttributedCharacterIterator iterator, + int x, int y) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void drawString(AttributedCharacterIterator iterator, float x, + float y) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void setComposite(Composite comp) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void setStroke(Stroke stroke) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void setRenderingHints(Map hints) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public void addRenderingHints(Map hints) + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public Composite getComposite() + { + throw new UnsupportedOperationException("not implemented yet"); + } + + public Stroke getStroke() + { + throw new UnsupportedOperationException("not implemented yet"); + } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/awt/j2d/IntegerGraphicsState.java gcc-3.3/libjava/gnu/awt/j2d/IntegerGraphicsState.java *** gcc-3.2.3/libjava/gnu/awt/j2d/IntegerGraphicsState.java 2001-02-15 04:36:34.000000000 +0000 --- gcc-3.3/libjava/gnu/awt/j2d/IntegerGraphicsState.java 2003-01-15 23:53:17.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2003 Free Software Foundation This file is part of libgcj. *************** public class IntegerGraphicsState extend *** 212,218 **** public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { ! if ((tx == 0) || (ty == 0)) { directGfx.drawPolyline(xPoints, yPoints, nPoints); return; --- 212,218 ---- public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) { ! if ((tx == 0) && (ty == 0)) { directGfx.drawPolyline(xPoints, yPoints, nPoints); return; *************** public class IntegerGraphicsState extend *** 223,229 **** public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { ! if ((tx == 0) || (ty == 0)) { directGfx.drawPolygon(xPoints, yPoints, nPoints); return; --- 223,229 ---- public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) { ! if ((tx == 0) && (ty == 0)) { directGfx.drawPolygon(xPoints, yPoints, nPoints); return; *************** public class IntegerGraphicsState extend *** 232,246 **** throw new UnsupportedOperationException("translate not implemented"); } ! public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) { ! if ((tx == 0) || (ty == 0)) ! { ! directGfx.fillPolygon(xPoints, yPoints, nPoints); ! return; ! } ! ! throw new UnsupportedOperationException("translate not implemented"); } public boolean drawImage(Image image, int x, int y, --- 232,242 ---- throw new UnsupportedOperationException("translate not implemented"); } ! public void fillPolygon (int[] xPoints, int[] yPoints, int nPoints) { ! // FIXME: remove tx & ty args once translation via AffineTransform ! // is implemented. ! directGfx.fillPolygon (xPoints, yPoints, nPoints, tx, ty); } public boolean drawImage(Image image, int x, int y, diff -Nrc3pad gcc-3.2.3/libjava/gnu/awt/xlib/XGraphicsConfiguration.java gcc-3.3/libjava/gnu/awt/xlib/XGraphicsConfiguration.java *** gcc-3.2.3/libjava/gnu/awt/xlib/XGraphicsConfiguration.java 2002-01-16 04:21:31.000000000 +0000 --- gcc-3.3/libjava/gnu/awt/xlib/XGraphicsConfiguration.java 2003-01-15 23:18:19.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2003 Free Software Foundation This file is part of libgcj. *************** import java.awt.GraphicsConfiguration; *** 12,17 **** --- 12,18 ---- import java.awt.Rectangle; import java.awt.Graphics2D; import java.awt.Graphics; + import java.awt.GraphicsDevice; import java.awt.Point; import java.awt.Color; import java.awt.color.ColorSpace; *************** public class XGraphicsConfiguration exte *** 128,134 **** * maybe be moved to a different location.] * * @param offset Offset to data. The given offset does not include ! * data buffer offset, which will also be added. */ static void attachData(XImage ximage, DataBuffer dataB, int offset) { offset += dataB.getOffset(); --- 129,136 ---- * maybe be moved to a different location.] * * @param offset Offset to data. The given offset does not include ! * data buffer offset, which will also be added. ! */ static void attachData(XImage ximage, DataBuffer dataB, int offset) { offset += dataB.getOffset(); *************** public class XGraphicsConfiguration exte *** 236,248 **** rmap, gmap, bmap, amap); } public BufferedImage createCompatibleImage(int width, int height, int transparency) { throw new UnsupportedOperationException("not implemented"); } ! /** * FIXME: I'm not sure which color model that should be returned here. */ --- 238,284 ---- rmap, gmap, bmap, amap); } + /** + * Gets the associated device that this configuration describes. + * + * @return the device + */ + public GraphicsDevice getDevice() + { + throw new UnsupportedOperationException("not implemented"); + } + + /** + * Returns a buffered image optimized to this device, so that blitting can + * be supported in the buffered image. + * + * @param w the width of the buffer + * @param h the height of the buffer + * @return the buffered image, or null if none is supported + */ public BufferedImage createCompatibleImage(int width, int height, int transparency) { throw new UnsupportedOperationException("not implemented"); } ! ! /** ! * Returns a buffered volatile image optimized to this device, so that ! * blitting can be supported in the buffered image. Because the buffer is ! * volatile, it can be optimized by native graphics accelerators. ! * ! * @param w the width of the buffer ! * @param h the height of the buffer ! * @return the buffered image, or null if none is supported ! * @see Component#createVolatileImage(int, int) ! * @since 1.4 ! */ ! public VolatileImage createCompatibleVolatileImage(int w, int h) ! { ! throw new UnsupportedOperationException("not implemented"); ! } ! /** * FIXME: I'm not sure which color model that should be returned here. */ *************** public class XGraphicsConfiguration exte *** 353,367 **** int getPixel(Color color) { int[] components = ! { ! color.getRed(), ! color.getGreen(), ! color.getBlue(), ! 0xff ! }; ! ! ColorModel cm = getColorModel(); ! return cm.getDataElement(components, 0); } } --- 389,420 ---- int getPixel(Color color) { + /* FIXME: consider an integer technique whenever + * the ColorModel is 8 bits per color. + * The problem with using integers is that it doesn't work unless + * the colors are 8 bits each (as in the array), since ColorModel.getDataElement(int[],int) + * expects non-normalized values. For example, in a 16-bit display mode, you + * would typically have 5 bits each for red and blue, and 6 bits for green. int[] components = ! { ! color.getRed (), ! color.getGreen (), ! color.getBlue (), ! 0xff ! }; ! */ ! ! float[] normalizedComponents = ! { ! ((float)color.getRed ()) / 255F, ! ((float)color.getGreen ()) / 255F, ! ((float)color.getBlue ()) / 255F, ! 1 ! }; ! int[] unnormalizedComponents = { 0, 0, 0, 0xff }; ! ColorModel cm = getColorModel (); ! cm.getUnnormalizedComponents(normalizedComponents, 0, ! unnormalizedComponents, 0); ! return cm.getDataElement (unnormalizedComponents, 0); } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/awt/xlib/XGraphics.java gcc-3.3/libjava/gnu/awt/xlib/XGraphics.java *** gcc-3.2.3/libjava/gnu/awt/xlib/XGraphics.java 2000-10-22 17:46:09.000000000 +0000 --- gcc-3.3/libjava/gnu/awt/xlib/XGraphics.java 2003-01-15 23:53:18.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2003 Free Software Foundation This file is part of libgcj. *************** public class XGraphics implements Clonea *** 176,185 **** throw new UnsupportedOperationException("not implemented"); } ! public void fillPolygon(int[] xPoints, int[] yPoints, int ! nPoints) { ! throw new UnsupportedOperationException("not implemented"); } public void drawString(String str, int x, int y) --- 176,185 ---- throw new UnsupportedOperationException("not implemented"); } ! public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints, ! int translateX, int translateY) { ! context.fillPolygon(xPoints, yPoints, nPoints, translateX, translateY); } public void drawString(String str, int x, int y) diff -Nrc3pad gcc-3.2.3/libjava/gnu/awt/xlib/XToolkit.java gcc-3.3/libjava/gnu/awt/xlib/XToolkit.java *** gcc-3.2.3/libjava/gnu/awt/xlib/XToolkit.java 2002-01-24 16:44:37.000000000 +0000 --- gcc-3.3/libjava/gnu/awt/xlib/XToolkit.java 2003-01-15 23:18:20.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 9,20 **** --- 9,24 ---- package gnu.awt.xlib; import java.awt.*; + import java.awt.dnd.*; + import java.awt.dnd.peer.*; + import java.awt.im.*; import java.awt.peer.*; import java.awt.image.ImageProducer; import java.awt.image.ImageObserver; import java.net.*; import java.awt.datatransfer.Clipboard; import java.util.Properties; + import java.util.Map; import gnu.gcj.xlib.Display; import gnu.gcj.xlib.Screen; *************** public class XToolkit extends Toolkit *** 169,175 **** public java.awt.image.ColorModel getColorModel() { ! throw new UnsupportedOperationException("not implemented yet"); } public String[] getFontList() --- 173,179 ---- public java.awt.image.ColorModel getColorModel() { ! return getDefaultXGraphicsConfiguration().getColorModel(); } public String[] getFontList() *************** public class XToolkit extends Toolkit *** 318,339 **** return defaultConfig; } ! /* ! public DragSourceContextPeer ! createDragSourceContextPeer(DragGestureEvent dge) ! throws InvalidDnDOperationException; ! ! public DragGestureRecognizer ! createDragGestureRecognizer(Class abstractRecognizerClass, ! DragSource ds, Component c, ! int srcActions, DragGestureListener dgl) { ! throw new UnsupportedOperationException("not implemented"); ! } ! */ ! /* ! public Map mapInputMethodHighlight(InputMethodHighlight highlight); ! */ } --- 322,345 ---- return defaultConfig; } + public DragSourceContextPeer + createDragSourceContextPeer(DragGestureEvent dge) + throws InvalidDnDOperationException + { + throw new UnsupportedOperationException("not implemented"); + } ! public DragGestureRecognizer ! createDragGestureRecognizer(Class abstractRecognizerClass, ! DragSource ds, Component c, ! int srcActions, DragGestureListener dgl) ! { ! throw new UnsupportedOperationException("not implemented"); ! } ! public Map mapInputMethodHighlight(InputMethodHighlight highlight) ! { ! throw new UnsupportedOperationException("not implemented"); ! } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/classpath/Configuration.java.in gcc-3.3/libjava/gnu/classpath/Configuration.java.in *** gcc-3.2.3/libjava/gnu/classpath/Configuration.java.in 2002-01-22 22:39:47.000000000 +0000 --- gcc-3.3/libjava/gnu/classpath/Configuration.java.in 2002-09-30 05:19:08.000000000 +0000 *************** public interface Configuration *** 51,54 **** --- 51,59 ---- // For libgcj we never load the JNI libraries. boolean INIT_LOAD_LIBRARY = false; + + // For libgcj we have native methods for proxy support.... + boolean HAVE_NATIVE_GET_PROXY_DATA = false; + boolean HAVE_NATIVE_GET_PROXY_CLASS = false; + boolean HAVE_NATIVE_GENERATE_PROXY_CLASS = false; } diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/protocol/core/Connection.java gcc-3.3/libjava/gnu/gcj/protocol/core/Connection.java *** gcc-3.2.3/libjava/gnu/gcj/protocol/core/Connection.java 2001-09-06 22:32:54.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/protocol/core/Connection.java 2002-08-23 04:54:02.000000000 +0000 *************** package gnu.gcj.protocol.core; *** 13,18 **** --- 13,19 ---- import gnu.gcj.Core; import java.net.*; import java.io.*; + import java.util.Map; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; *************** class Connection extends URLConnection *** 72,77 **** --- 73,92 ---- } // Override default method in URLConnection. + public Map getHeaderFields() + { + try + { + getHeaders(); + } + catch (IOException x) + { + return null; + } + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { try diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/protocol/file/Connection.java gcc-3.3/libjava/gnu/gcj/protocol/file/Connection.java *** gcc-3.2.3/libjava/gnu/gcj/protocol/file/Connection.java 2002-02-22 13:53:22.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/protocol/file/Connection.java 2002-08-23 04:54:02.000000000 +0000 *************** package gnu.gcj.protocol.file; *** 12,17 **** --- 12,18 ---- import java.net.*; import java.io.*; + import java.util.Map; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; *************** class Connection extends URLConnection *** 96,101 **** --- 97,116 ---- } // Override default method in URLConnection. + public Map getHeaderFields() + { + try + { + getHeaders(); + } + catch (IOException x) + { + return null; + } + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { try diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/protocol/http/Connection.java gcc-3.3/libjava/gnu/gcj/protocol/http/Connection.java *** gcc-3.2.3/libjava/gnu/gcj/protocol/http/Connection.java 2002-04-15 03:16:02.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/protocol/http/Connection.java 2003-01-03 18:05:28.000000000 +0000 *************** *** 1,6 **** // Connection.java - Implementation of HttpURLConnection for http protocol. ! /* Copyright (C) 1999, 2000 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // Connection.java - Implementation of HttpURLConnection for http protocol. ! /* Copyright (C) 1999, 2000, 2003 Free Software Foundation This file is part of libgcj. *************** package gnu.gcj.protocol.http; *** 12,17 **** --- 12,18 ---- import java.net.*; import java.io.*; + import java.util.Map; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; *************** import java.util.Enumeration; *** 24,33 **** /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Minimal subset of functionality. Proxies and Redirects ! * not yet handled. FileNameMap handling needs to be considered. ! * useCaches, ifModifiedSince, and allowUserInteraction need ! * consideration as well as doInput and doOutput. */ class Connection extends HttpURLConnection --- 25,35 ---- /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Minimal subset of functionality. Proxies only partially ! * handled; Redirects not yet handled. FileNameMap handling needs to ! * be considered. useCaches, ifModifiedSince, and ! * allowUserInteraction need consideration as well as doInput and ! * doOutput. */ class Connection extends HttpURLConnection *************** class Connection extends HttpURLConnecti *** 39,44 **** --- 41,73 ---- private Vector hdrVec = new Vector(); private BufferedInputStream bufferedIn; + private static int proxyPort = 80; + private static boolean proxyInUse = false; + private static String proxyHost = null; + + static + { + // Recognize some networking properties listed at + // http://java.sun.com/j2se/1.4/docs/guide/net/properties.html. + String port = null; + proxyHost = System.getProperty("http.proxyHost"); + if (proxyHost != null) + { + proxyInUse = true; + if ((port = System.getProperty("http.proxyPort")) != null) + { + try + { + proxyPort = Integer.parseInt(port); + } + catch (Throwable t) + { + // Nothing. + } + } + } + } + public Connection(URL url) { super(url); *************** class Connection extends HttpURLConnecti *** 84,95 **** // Get address and port number. int port; ! InetAddress destAddr = InetAddress.getByName(url.getHost()); ! if ((port = url.getPort()) == -1) ! port = 80; - // Open socket and output stream. - sock = new Socket(destAddr, port); PrintWriter out = new PrintWriter(sock.getOutputStream()); // Send request including any request properties that were set. --- 113,132 ---- // Get address and port number. int port; ! if (proxyInUse) ! { ! port = proxyPort; ! sock = new Socket(proxyHost, port); ! } ! else ! { ! InetAddress destAddr = InetAddress.getByName(url.getHost()); ! if ((port = url.getPort()) == -1) ! port = 80; ! // Open socket and output stream. ! sock = new Socket(destAddr, port); ! } PrintWriter out = new PrintWriter(sock.getOutputStream()); // Send request including any request properties that were set. *************** class Connection extends HttpURLConnecti *** 122,131 **** } } - // TODO: public boolean usingProxy() public boolean usingProxy() { ! return false; } // Override default method in URLConnection. --- 159,167 ---- } } public boolean usingProxy() { ! return proxyInUse; } // Override default method in URLConnection. *************** class Connection extends HttpURLConnecti *** 168,173 **** --- 204,225 ---- } // Override default method in URLConnection. + public Map getHeaderFields() + { + if (!connected) + try + { + connect(); + } + catch (IOException x) + { + return null; + } + + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { if (!connected) diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/protocol/jar/Connection.java gcc-3.3/libjava/gnu/gcj/protocol/jar/Connection.java *** gcc-3.2.3/libjava/gnu/gcj/protocol/jar/Connection.java 2000-05-19 02:46:09.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/protocol/jar/Connection.java 2002-12-09 00:03:59.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 1999, 2002 Free Software Foundation This file is part of libgcj. *************** details. */ *** 9,27 **** package gnu.gcj.protocol.jar; import java.net.URL; import java.net.JarURLConnection; import java.net.URLStreamHandler; import java.net.MalformedURLException; import java.net.ProtocolException; import java.io.IOException; import java.util.jar.JarFile; import java.util.Hashtable; /** * Written using on-line Java Platform 1.2 API Specification. - * Status: Needs a way to download jar files and store them in the local file - * system. I don't know how to do that in a portable way. For now, it can only handle - * connections to a jar:file: url's. * * @author Kresten Krab Thorup * @date Aug 10, 1999. --- 9,29 ---- package gnu.gcj.protocol.jar; import java.net.URL; + import java.net.URLConnection; import java.net.JarURLConnection; import java.net.URLStreamHandler; import java.net.MalformedURLException; import java.net.ProtocolException; import java.io.IOException; + import java.io.InputStream; + import java.io.File; + import java.io.FileOutputStream; import java.util.jar.JarFile; + import java.util.zip.ZipFile; import java.util.Hashtable; /** * Written using on-line Java Platform 1.2 API Specification. * * @author Kresten Krab Thorup * @date Aug 10, 1999. *************** public class Connection extends JarURLCo *** 70,83 **** } else { ! /* ! FIXME: Here we need to download and cache the jar ! file in the local file system! Stupid design. Why ! can't we just create a JarFile from a bag of bytes? ! */ ! ! throw new java.io.IOException("cannot create jar file from " + ! jarFileURL); } return jarfile; --- 72,90 ---- } else { ! URLConnection urlconn = jarFileURL.openConnection(); ! InputStream is = urlconn.getInputStream(); ! byte[] buf = new byte[4*1024]; ! File f = File.createTempFile("cache", "jar"); ! FileOutputStream fos = new FileOutputStream(f); ! int len = 0; ! while((len = is.read(buf)) != -1) ! fos.write(buf, 0, len); ! fos.close(); ! // Always verify the Manifest, open read only and delete when done. ! // XXX ZipFile.OPEN_DELETE not yet implemented. ! // jf = new JarFile(f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); ! jarfile = new JarFile(f, true, ZipFile.OPEN_READ); } return jarfile; diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/runtime/MethodRef.java gcc-3.3/libjava/gnu/gcj/runtime/MethodRef.java *** gcc-3.2.3/libjava/gnu/gcj/runtime/MethodRef.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/runtime/MethodRef.java 2002-12-03 13:53:27.000000000 +0000 *************** *** 0 **** --- 1,25 ---- + // gnu.gcj.runtime.MethodRef -- used by StackTrace. + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + package gnu.gcj.runtime; + + import gnu.gcj.RawData; + + class MethodRef + { + MethodRef(RawData /* Actually _Jv_Method */ m, Class k) + { + klass = k; + method = m; + } + + public RawData method; // Actually a raw pointer to _Jv_Method + public Class klass; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/runtime/NameFinder.java gcc-3.3/libjava/gnu/gcj/runtime/NameFinder.java *** gcc-3.2.3/libjava/gnu/gcj/runtime/NameFinder.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/runtime/NameFinder.java 2003-03-10 19:34:30.000000000 +0000 *************** *** 0 **** --- 1,568 ---- + /* NameFinder.java -- Translates addresses to StackTraceElements. + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + package gnu.gcj.runtime; + + import gnu.gcj.RawData; + + import java.lang.StringBuffer; + + import java.io.BufferedReader; + import java.io.BufferedWriter; + import java.io.InputStreamReader; + import java.io.OutputStreamWriter; + import java.io.IOException; + import java.io.File; + + /** + * Helper class that translates addresses (represented as longs) to a + * StackTraceElement array. + * + * There are a couple of system properties that can be set to manipulate the + * result (all default to true): + *
  • + *
      gnu.gcj.runtime.NameFinder.demangle + * Whether names should be demangled.
    + *
      gnu.gcj.runtime.NameFinder.sanitize
    + * Whether calls to initialize exceptions and starting the runtime system + * should be removed from the stack trace. Only done when names are + * demangled. + *
      gnu.gcj.runtime.NameFinder.remove_unknown + * Whether calls to unknown functions (class and method names are unknown) + * should be removed from the stack trace. Only done when the stack is + * sanitized.
    + *
      gnu.gcj.runtime.NameFinder.remove_interpreter + * Whether runtime interpreter calls (methods in the _Jv_InterpMethod class + * and functions starting with 'ffi_') should be removed from the stack + * trace. Only done when the stack is sanitized.
    + *
      gnu.gcj.runtime.NameFinder.use_addr2line + * Whether an external process (addr2line or addr2name.awk) should be used + * as fallback to convert the addresses to function names when the runtime + * is unable to do it through dladdr.
    + *
  • + * + * close() should be called to get rid of all resources. + * + * This class is used from java.lang.VMThrowable. + * + * Currently the lookup(long[]) method is not thread safe. + * It can easily be made thread safe by synchronizing access to all external + * processes when used. + * + * @author Mark Wielaard (mark@klomp.org) + */ + public class NameFinder + { + // Set these to false when not needed. + private static final boolean demangle + = Boolean.valueOf(System.getProperty + ("gnu.gcj.runtime.NameFinder.demangle", "true") + ).booleanValue(); + private static final boolean sanitize + = Boolean.valueOf(System.getProperty + ("gnu.gcj.runtime.NameFinder.sanitize", "true") + ).booleanValue(); + private static final boolean remove_unknown + = Boolean.valueOf(System.getProperty + ("gnu.gcj.runtime.NameFinder.remove_unknown", "true") + ).booleanValue(); + private static final boolean remove_interpreter + = Boolean.valueOf(System.getProperty + ("gnu.gcj.runtime.NameFinder.remove_interpreter", "true") + ).booleanValue(); + private static final boolean use_addr2line + = Boolean.valueOf(System.getProperty + ("gnu.gcj.runtime.NameFinder.use_addr2line", "true") + ).booleanValue(); + + /** + * The name of the currently running executable. + */ + private final String executable; + + /** + * Process used for demangling names. + */ + private Process cppfilt; + + private BufferedWriter cppfiltOut; + private BufferedReader cppfiltIn; + + /** + * Process used for translating addresses to function/file names. + */ + private Process addr2line; + + private BufferedWriter addr2lineOut; + private BufferedReader addr2lineIn; + + /** + * Flag set if using addr2name.awk instead of addr2line from binutils. + */ + private boolean usingAddr2name = false; + + /** + * Creates a new NameFinder. Call close to get rid of any resources + * created while using the lookup methods. + */ + public NameFinder() + { + executable = getExecutable(); + Runtime runtime = Runtime.getRuntime(); + if (demangle) + { + try + { + String[] exec = new String[] {"c++filt", "-s", "java"}; + cppfilt = runtime.exec(exec); + cppfiltIn = new BufferedReader + (new InputStreamReader(cppfilt.getInputStream())); + cppfiltOut = new BufferedWriter + (new OutputStreamWriter(cppfilt.getOutputStream())); + } + catch (IOException ioe) + { + if (cppfilt != null) + cppfilt.destroy(); + cppfilt = null; + } + } + + if (use_addr2line) + { + try + { + String[] exec = new String[] {"addr2line", "-f", "-e", executable}; + addr2line = runtime.exec(exec); + } + catch (IOException ioe) + { + try + { + String[] exec = new String[] {"addr2name.awk", executable}; + addr2line = runtime.exec(exec); + usingAddr2name = true; + } + catch (IOException ioe2) { addr2line = null; } + } + + if (addr2line != null) + { + try + { + addr2lineIn = new BufferedReader + (new InputStreamReader(addr2line.getInputStream())); + addr2lineOut = new BufferedWriter + (new OutputStreamWriter(addr2line.getOutputStream())); + } + catch (IOException ioe) + { + addr2line.destroy(); + addr2line = null; + } + } + } + } + + /** + * Returns the name of the currently running process. + */ + native private static String getExecutable(); + + /** + * Tries to use dladdr to create the nth StackTraceElement from the given + * addresses. Returns null on failure. + */ + native private StackTraceElement dladdrLookup(RawData addrs, int n); + + /** + * Returns the nth element from the stack as a hex encoded String. + */ + native private String getAddrAsString(RawData addrs, int n); + + /** + * Returns the label that is exported for the given method name. + */ + native private String getExternalLabel(String name); + + /** + * If nth element of stack is an interpreted frame, return the + * element representing the method being interpreted. + */ + native private StackTraceElement lookupInterp(RawData addrs, int n); + + /** + * Creates the nth StackTraceElement from the given native stacktrace. + */ + private StackTraceElement lookup(RawData addrs, int n) + { + StackTraceElement result; + + result = lookupInterp(addrs, n); + if (result == null) + result = dladdrLookup(addrs, n); + if (result == null) + { + String name = null; + String file = null; + + String hex = getAddrAsString(addrs, n); + + if (addr2line != null) + { + try + { + addr2lineOut.write(hex); + addr2lineOut.newLine(); + addr2lineOut.flush(); + name = addr2lineIn.readLine(); + file = addr2lineIn.readLine(); + + // addr2line uses symbolic debugging information instead + // of the actually exported labels as addr2name.awk does. + // This name might need some modification, depending on + // the system, to make it a label like that returned + // by addr2name.awk or dladdr. + if (! usingAddr2name) + if (name != null && ! "??".equals (name)) + name = getExternalLabel (name); + } + catch (IOException ioe) { addr2line = null; } + } + + if (name == null || "??".equals(name)) + name = hex; + + result = createStackTraceElement(name, file); + } + + return result; + } + + /** + * Given an Throwable and a native stacktrace returns an array of + * StackTraceElement containing class, method, file and linenumbers. + */ + public StackTraceElement[] lookup(Throwable t, RawData addrs, int length) + { + StackTraceElement[] elements = new StackTraceElement[length]; + for (int i=0; i < length; i++) + elements[i] = lookup(addrs, i); + + if (demangle && sanitize) + return sanitizeStack(elements, t); + else + return elements; + } + + + /** + * Removes calls to initialize exceptions and the runtime system from + * the stack trace including stack frames of which nothing usefull is known. + * Throw away the top of the stack till we find the constructor(s) + * of this Throwable or at least the contructors of java.lang.Throwable + * or the actual fillInStackTrace call. + * Also throw away from the top everything before and including a runtime + * _Jv_Throw call. + */ + private static StackTraceElement[] sanitizeStack(StackTraceElement[] elements, + Throwable t) + { + StackTraceElement[] stack; + + String className = t.getClass().getName(); + String consName; + int lastDot = className.lastIndexOf('.'); + if (lastDot == -1) + consName = className + '('; + else + consName = className.substring(lastDot + 1) + '('; + + int unknown = 0; + int interpreter = 0; + int last_throw = -1; + int length = elements.length; + int end = length-1; + for (int i = 0; i < length; i++) + { + String CName = elements[i].getClassName(); + String MName = elements[i].getMethodName(); + if ((CName == null && MName != null && MName.startsWith("_Jv_Throw")) + || + (CName != null + && (CName.equals(className) + || CName.equals("java.lang.Throwable") + || CName.equals("java.lang.VMThrowable")) + && MName != null + && (MName.startsWith(consName) + || MName.startsWith("Throwable(") + || MName.startsWith("fillInStackTrace(")))) + { + last_throw = i; + // Reset counting of unknown and interpreter frames. + unknown = 0; + interpreter = 0; + } + else if (remove_unknown && CName == null + && (MName == null || MName.startsWith("0x"))) + unknown++; + else if (remove_interpreter + && ((CName == null + && MName != null && MName.startsWith("ffi_")) + || (CName != null && CName.equals("_Jv_InterpMethod")))) + interpreter++; + else if ("main(java.lang.String[])".equals(MName)) + { + end = i; + break; + } + } + int begin = last_throw+1; + + // Now filter out everything at the start and the end that is not part + // of the "normal" user program including any elements that are interpreter + // calls or have no usefull information whatsoever. + // Unless that means we filter out all info. + int nr_elements = end-begin-unknown-interpreter+1; + if ((begin > 0 || end < length-1 || unknown > 0 || interpreter > 0) + && nr_elements > 0) + { + stack = new StackTraceElement[nr_elements]; + int pos =0; + for (int i=begin; i<=end; i++) + { + String MName = elements[i].getMethodName(); + String CName = elements[i].getClassName(); + if (remove_unknown && CName == null + && (MName == null || MName.startsWith("0x"))) + ; // Skip unknown frame + else if (remove_interpreter + && ((CName == null + && MName != null && MName.startsWith("ffi_")) + || (CName != null && CName.equals("_Jv_InterpMethod")))) + ; // Skip interpreter runtime frame + else + { + stack[pos] = elements[i]; + pos++; + } + } + } + else + stack = elements; + + return stack; + } + + /** + * Creates a StackTraceElement given a string and a filename. + * Splits the given string into the class and method part. + * The string name will be a demangled to a fully qualified java method + * string. The string file will be decomposed into a file name and possibly + * a line number. The name should never be null, but the file may be if it + * is unknown. + */ + private StackTraceElement createStackTraceElement(String name, String file) + { + if (!demangle) + return new StackTraceElement(file, -1, null, name, false); + + String s = demangleName(name); + String methodName = s; + String className = null; + int bracket = s.indexOf('('); + if (bracket > 0) + { + int dot = s.lastIndexOf('.', bracket); + if (dot > 0) + { + className = s.substring(0, dot); + methodName = s.substring(dot+1, s.length()); + } + } + + String fileName = file; + int line = -1; + if (fileName != null) + { + int colon = file.lastIndexOf(':'); + if (colon > 0) + { + fileName = file.substring(0, colon); + try + { + line = Integer.parseInt(file.substring(colon+1, file.length())); + } + catch (NumberFormatException nfe) { /* ignore */ } + } + + if (line == 0) + line =-1; + + if ("".equals(fileName) || "??".equals(fileName)) + fileName = null; + else if (fileName != null) + { + try + { + fileName = new File(fileName).getCanonicalPath(); + } + catch (IOException ioe) { /* ignore */ } + } + } + + return new StackTraceElement(fileName, line, className, methodName, false); + } + + /** + * Demangles the given String if possible. Returns the demangled String or + * the original string if demangling is impossible. + */ + private String demangleName(String s) + { + if (cppfilt != null) + { + try + { + cppfiltOut.write(s); + cppfiltOut.newLine(); + cppfiltOut.flush(); + return cppfiltIn.readLine(); + } + catch (IOException ioe) { cppfilt.destroy(); cppfilt = null; } + } + + return s; + } + + /** + * Returns human readable method name and aguments given a method type + * signature as known to the interpreter and a classname. + */ + public static String demangleInterpreterMethod(String m, String cn) + { + int index = 0; + int length = m.length(); + StringBuffer sb = new StringBuffer(length); + + // Figure out the real method name + if (m.startsWith("")) + { + String className; + int i = cn.lastIndexOf('.'); + if (i < 0) + className = cn; + else + className = cn.substring(i + 1); + sb.append(className); + index += 7; + } + else + { + int i = m.indexOf('('); + if (i > 0) + { + sb.append(m.substring(0,i)); + index += i + 1; + } + } + + sb.append('('); + + // Demangle the type arguments + int arrayDepth = 0; + char c = (index < length) ? m.charAt(index) : ')'; + while (c != ')') + { + String type; + switch(c) + { + case 'B': + type = "byte"; + break; + case 'C': + type = "char"; + break; + case 'D': + type = "double"; + break; + case 'F': + type = "float"; + break; + case 'I': + type = "int"; + break; + case 'J': + type = "long"; + break; + case 'S': + type = "short"; + break; + case 'Z': + type = "boolean"; + break; + case 'L': + int i = m.indexOf(';', index); + if (i > 0) + { + type = m.substring(index+1, i); + index = i; + } + else + type = ""; + break; + case '[': + type = ""; + arrayDepth++; + break; + default: + type = "'; + } + sb.append(type); + + // Handle arrays + if (c != '[' && arrayDepth > 0) + while (arrayDepth > 0) + { + sb.append("[]"); + arrayDepth--; + } + + index++; + char nc = (index < length) ? m.charAt(index) : ')'; + if (c != '[' && nc != ')') + sb.append(", "); + c = nc; + } + + // Stop. We are not interested in the return type. + sb.append(')'); + return sb.toString(); + } + + /** + * Releases all resources used by this NameFinder. + */ + public void close() + { + if (cppfilt != null) + cppfilt.destroy(); + + if (addr2line != null) + addr2line.destroy(); + } + + /** + * Calls close to get rid of all resources. + */ + protected void finalize() + { + close(); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/runtime/natNameFinder.cc gcc-3.3/libjava/gnu/gcj/runtime/natNameFinder.cc *** gcc-3.2.3/libjava/gnu/gcj/runtime/natNameFinder.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/runtime/natNameFinder.cc 2003-03-10 19:34:30.000000000 +0000 *************** *** 0 **** --- 1,146 ---- + // natNameFinder.cc - native helper methods for NameFinder.java + + /* Copyright (C) 2002 Free Software Foundation, Inc + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + /** + * @author Mark Wielaard (mark@klomp.org) + * Based on the old name-finder.cc by Andrew Haley . + */ + + #include + + #include + + #include + #include + #include + #include + #include + #include + + #include + + #ifdef HAVE_DLFCN_H + #include + #endif + + // On some systems, a prefix is attached to a method name before + // it is exported as a label. The GCC preprocessor predefines + // this prefix as the macro __USER_LABEL_PREFIX__ which expands to + // a string (not string constant) representing the prefix, if any. + #undef LABEL_PREFIX + #ifdef __USER_LABEL_PREFIX__ + + #define USER_LABEL_PREFIX_STRING_0(s) #s + #define USER_LABEL_PREFIX_STRING(s) USER_LABEL_PREFIX_STRING_0(s) + + #define LABEL_PREFIX USER_LABEL_PREFIX_STRING(__USER_LABEL_PREFIX__) + + #else /* __USER_LABEL_PREFIX__ */ + + #define LABEL_PREFIX "" + + #endif /* ! __USER_LABEL_PREFIX__ */ + + java::lang::String* + gnu::gcj::runtime::NameFinder::getExternalLabel (java::lang::String* name) + { + jsize nameLen = JvGetStringUTFLength (name); + jsize pfxLen = strlen (LABEL_PREFIX); + char *newName = (char *) JvMalloc (pfxLen + nameLen + 1); + *(newName + 0) = '\0'; + strcpy (newName, LABEL_PREFIX); + JvGetStringUTFRegion (name, 0, nameLen, newName + pfxLen); + *(newName + pfxLen + nameLen) = '\0'; + return JvNewStringLatin1 (newName); + } + + java::lang::String* + gnu::gcj::runtime::NameFinder::getExecutable (void) + { + return JvNewStringLatin1 (_Jv_ThisExecutable ()); + } + + java::lang::String* + gnu::gcj::runtime::NameFinder::getAddrAsString(RawData* addrs, jint n) + { + _Jv_frame_info *p = (_Jv_frame_info *) addrs; + typedef unsigned word_t __attribute ((mode (word))); + word_t w = (word_t) p[n].addr; + int digits = sizeof (void *) * 2; + char hex[digits+5]; + + strcpy (hex, "0x"); + for (int i = digits - 1; i >= 0; i--) + { + int digit = w % 16; + + w /= 16; + hex[i+2] = digit > 9 ? 'a' + digit - 10 : '0' + digit; + } + hex [digits+2] = 0; + + return JvNewStringLatin1(hex); + } + + java::lang::StackTraceElement* + gnu::gcj::runtime::NameFinder::dladdrLookup(RawData* addrs, jint n) + { + #if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR) + extern char **_Jv_argv; + char name[1024]; + char file_name[1024]; + _Jv_frame_info *stack = (_Jv_frame_info *) addrs; + void* p = stack[n].addr; + Dl_info dl_info; + + if (dladdr (p, &dl_info)) + { + if (dl_info.dli_fname) + strncpy (file_name, dl_info.dli_fname, sizeof file_name); + if (dl_info.dli_sname) + strncpy (name, dl_info.dli_sname, sizeof name); + + /* Don't trust dladdr() if the address is from the main program. */ + if (dl_info.dli_fname != NULL + && dl_info.dli_sname != NULL + && (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0)) + return createStackTraceElement (JvNewStringLatin1 (name), + JvNewStringLatin1 (file_name)); + } + #endif + return NULL; + } + + java::lang::StackTraceElement * + gnu::gcj::runtime::NameFinder::lookupInterp(RawData* addrs, jint n) + { + #ifdef INTERPRETER + _Jv_frame_info *stack = (_Jv_frame_info *) addrs; + if (stack[n].interp == NULL) + return NULL; + + _Jv_InterpMethod *meth + = reinterpret_cast<_Jv_InterpMethod *> (stack[n].interp); + java::lang::StringBuffer *sb = new java::lang::StringBuffer(); + sb->append(_Jv_NewStringUtf8Const(meth->self->name)); + sb->append(_Jv_NewStringUtf8Const(meth->self->signature)); + // FIXME: source file name and line number can be found from + // bytecode debug information. But currently we don't keep that + // around. + // FIXME: is using the defining class correct here? + java::lang::String *className = meth->defining_class->getName(); + java::lang::String *methodName + = demangleInterpreterMethod(sb->toString(), className); + return new java::lang::StackTraceElement(NULL, -1, + className, methodName, false); + #else // INTERPRETER + return NULL; + #endif // INTERPRETER + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/runtime/natStackTrace.cc gcc-3.3/libjava/gnu/gcj/runtime/natStackTrace.cc *** gcc-3.2.3/libjava/gnu/gcj/runtime/natStackTrace.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/runtime/natStackTrace.cc 2003-02-19 16:27:22.000000000 +0000 *************** *** 0 **** --- 1,198 ---- + // natStackTrace.cc - native helper methods for Throwable + + /* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + /** + * @author Andrew Haley + * @author Mark Wielaard + * + * Native helper methods for VM specific Throwable support. + */ + + #include + #include + + #include + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + + #include + + #include + + #ifdef HAVE_EXECINFO_H + #include + #endif + + #include + + + // Fill in this stack trace with MAXLEN elements starting at offset. + void + gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset) + { + #ifdef HAVE_BACKTRACE + offset += 1; + void *_p[maxlen + offset]; + len = backtrace (_p, maxlen + offset) - offset; + void **p = _p + offset; + _Jv_frame_info *frame; + if (len > 0) + { + #ifdef INTERPRETER + extern void _Jv_StartOfInterpreter (void); + extern void _Jv_EndOfInterpreter (void); + + java::lang::Thread *thread = java::lang::Thread::currentThread(); + _Jv_MethodChain *interp_frame + = (thread ? reinterpret_cast<_Jv_MethodChain *> (thread->interp_frame) + : NULL); + #endif // INTERPRETER + + frame = (_Jv_frame_info *) _Jv_Malloc (len * sizeof (_Jv_frame_info)); + for (int n = 0; n < len; n++) + { + frame[n].addr = p[n]; + #ifdef INTERPRETER + if (p[n] >= &_Jv_StartOfInterpreter && p[n] <= &_Jv_EndOfInterpreter) + { + frame[n].interp = (void *) interp_frame->self; + interp_frame = interp_frame->next; + } + else + frame[n].interp = 0; + #endif // INTERPRETER + } + } + else + frame = NULL; + + addrs = reinterpret_cast (frame); + #else // HAVE_BACKTRACE + (void)maxlen; + (void)offset; + #endif // HAVE_BACKTRACE + } + + /* Obtain the next power-of-2 of some integer. */ + static inline jint + nextpowerof2 (jint n) + { + n |= (n >> 1); + n |= (n >> 2); + n |= (n >> 4); + n |= (n >> 8); + n |= (n >> 16); + return n+1; + } + + #define GET_FRAME(N) \ + ({ \ + if ((N) >= len) \ + fillInStackTrace (nextpowerof2 (N), 1); \ + if ((N) < 0 || (N) >= len) \ + throw new ::java::lang::ArrayIndexOutOfBoundsException (); \ + \ + _Jv_frame_info *frame = (_Jv_frame_info *)addrs; \ + &frame[N]; \ + }) + + gnu::gcj::runtime::MethodRef * + gnu::gcj::runtime::StackTrace::getCompiledMethodRef (gnu::gcj::RawData *addr) + { + void *p = _Unwind_FindEnclosingFunction (addr); + return gnu::gcj::runtime::StackTrace + ::methodAtAddress ((gnu::gcj::RawData *)p); + } + + java::lang::Class * + gnu::gcj::runtime::StackTrace::classAt (jint n) + { + _Jv_frame_info *frame = GET_FRAME (n); + + #ifdef INTERPRETER + if (frame->interp) + { + _Jv_InterpMethod *meth + = reinterpret_cast<_Jv_InterpMethod *> (frame->interp); + return meth->defining_class; + } + #endif // INTERPRETER + + gnu::gcj::runtime::MethodRef *ref + = getCompiledMethodRef ((gnu::gcj::RawData *)frame->addr); + if (ref) + return ref->klass; + else + return NULL; + } + + java::lang::String* + gnu::gcj::runtime::StackTrace::methodAt (jint n) + { + _Jv_frame_info *frame = GET_FRAME (n); + _Jv_Method *meth = NULL; + + #ifdef INTERPRETER + if (frame->interp) + { + meth + = reinterpret_cast<_Jv_InterpMethod *> (frame->interp) + ->get_method(); + } + #endif // INTERPRETER + + if (! meth) + { + gnu::gcj::runtime::MethodRef *ref + = getCompiledMethodRef ((gnu::gcj::RawData *)frame->addr); + if (ref) + meth = (_Jv_Method *)ref->method; + } + + return meth + ? _Jv_NewStringUtf8Const (meth->name) + : NULL ; + } + + void + gnu::gcj::runtime::StackTrace::update(void) + { + jclass klass; + + while ((klass = _Jv_PopClass ())) + { + for (int i=0; imethod_count; i++) + { + JvSynchronize sync (map); + _Jv_Method *meth = &(klass->methods[i]); + if (meth->ncode) // i.e. if p is not abstract + { + gnu::gcj::runtime::MethodRef *ref + = new gnu::gcj::runtime::MethodRef + ((gnu::gcj::RawData *)meth, klass); + map->put ((java::lang::Object*)(meth->ncode), ref); + } + } + } + } + + diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/runtime/natVMClassLoader.cc gcc-3.3/libjava/gnu/gcj/runtime/natVMClassLoader.cc *** gcc-3.2.3/libjava/gnu/gcj/runtime/natVMClassLoader.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/runtime/natVMClassLoader.cc 2002-12-11 03:15:14.000000000 +0000 *************** *** 0 **** --- 1,67 ---- + // Native code for VMClassLoader + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + #include + #include + #include + #include + + jclass + gnu::gcj::runtime::VMClassLoader::findClass (jstring name) + { + _Jv_Utf8Const *name_u = _Jv_makeUtf8Const (name); + jclass klass = _Jv_FindClassInCache (name_u, 0); + + if (! klass) + { + // Turn `gnu.pkg.quux' into `lib-gnu-pkg-quux'. Then search for + // a module named (eg, on Linux) `lib-gnu-pkg-quux.so', followed + // by `lib-gnu-pkg.so' and `lib-gnu.so'. If loading one of + // these causes the class to appear in the cache, then use it. + java::lang::StringBuffer *sb = new java::lang::StringBuffer (JvNewStringLatin1("lib-")); + // Skip inner classes + jstring cn; + jint ci = name->indexOf('$'); + if (ci == -1) + cn = name; + else + cn = name->substring (0, ci); + jstring so_base_name = (sb->append (cn)->toString ())->replace ('.', '-'); + + // Compare against `3' because that is the length of "lib". + while (! klass && so_base_name && so_base_name->length() > 3) + { + using namespace ::java::lang; + Runtime *rt = Runtime::getRuntime(); + jboolean loaded = rt->loadLibraryInternal (so_base_name); + + jint nd = so_base_name->lastIndexOf ('-'); + if (nd == -1) + so_base_name = NULL; + else + so_base_name = so_base_name->substring (0, nd); + + if (loaded) + klass = _Jv_FindClassInCache (name_u, 0); + } + } + + // Now try loading using the interpreter. + if (! klass) + klass = java::net::URLClassLoader::findClass (name); + + return klass; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/runtime/StackTrace.java gcc-3.3/libjava/gnu/gcj/runtime/StackTrace.java *** gcc-3.2.3/libjava/gnu/gcj/runtime/StackTrace.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/runtime/StackTrace.java 2002-12-03 13:53:27.000000000 +0000 *************** *** 0 **** --- 1,164 ---- + /* gnu.gcj.runtime.StackTrace -- VM support methods for walking the + stack. + Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.gcj.runtime; + + import gnu.gcj.RawData; + import java.util.TreeMap; + import java.util.IdentityHashMap; + import java.util.SortedMap; + import gnu.gcj.runtime.NameFinder; + import java.util.NoSuchElementException; + + /** + * VM dependent state and support methods for walking the stack. + *

    + * This is the version used by libgcj (http://gcc.gnu.org/java/). + * + * @author Mark Wielaard (mark@klomp.org) + * @author Andrew Haley (aph@redhat.com) + */ + public final class StackTrace + { + /** + * Fill in the stack trace with the top n frames on current + * execution stack. Can return null if the VM does not support + * capturing the VM execution state. + * + * @see Throwable#fillInStackTrace() + */ + public StackTrace(int n) + { + fillInStackTrace(n, 1); + } + + /** + * Fill in the stack trace with state of the entire execution stack, + * starting from frame offset. Can return null if the + * VM does not support capturing the VM execution state. + * + * This can be very expensive. If you only want part of the stack, + * see Throwable.fillInStackTrace(int) + * + * @see Throwable#fillInStackTrace() + */ + public StackTrace() + { + int n = 64; + + do + { + n *= 4; + fillInStackTrace(n, 1); + } + while (len >= n); + } + + /** + * Return the class containing the execution point represented by + * the Nth frame down the stack. The zeroth frame represents the + * top of the stack, which is the method that called classAt(). + * + * If the Nth frame down the stack was not create by a method + * invocation, return null. + * + * It is not necessary to call fillInStackTrace() with + * a size greater than N before calling this method; if the current + * stack trace is insufficiently large, it will be expanded as + * required. This requires some caution if + * fillInStackTrace() is called from a different + * invocation to the one that calls classAt(). + * classAt() will not call fillInStackTrace() unless N + * is greater than the current length. + * + */ + public native Class classAt(int n); + + /** + * Return the name of the method containing the execution point + * represented by the Nth frame down the stack. The zeroth frame + * represents the top of the stack, which is the method that called + * classAt(). + * + * If the Nth frame down the stack was not create by a method + * invocation, return null. + * + * It is not necessary to call fillInStackTrace() with + * a size greater than N before calling this method; if the current + * stack trace is insufficiently large, it will be expanded as + * required. This requires some caution if + * fillInStackTrace() is called from a different + * invocation to the one that calls classAt(). + * classAt() will not call fillInStackTrace() unless N + * is greater than the current length. + * + */ + public native String methodAt(int n); + + /** + * Return the length of this stack trace. + * + */ + public int length () + { + return len; + } + + private static native void update(); + private static MethodRef methodAtAddress(RawData addr) + { + update(); + synchronized (map) + { + return (MethodRef) map.get (addr); + } + } + + gnu.gcj.RawData stackTraceAddrs() + { + return addrs; + } + + private native void fillInStackTrace(int n, int offset); + + private static native MethodRef getCompiledMethodRef(RawData addr); + private static IdentityHashMap map = new IdentityHashMap(); + + private gnu.gcj.RawData addrs; + private int len; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/runtime/VMClassLoader.java gcc-3.3/libjava/gnu/gcj/runtime/VMClassLoader.java *** gcc-3.2.3/libjava/gnu/gcj/runtime/VMClassLoader.java 2001-09-06 22:32:54.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/runtime/VMClassLoader.java 2002-12-09 00:03:59.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2001 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 1999, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** public final class VMClassLoader extends *** 33,55 **** String e = st.nextToken (); try { ! if (e.endsWith(".jar") || e.endsWith (".zip")) ! { ! File archive = new File (e); ! try { ! p.addElement(new URL("jar", "", -1, "file://" ! + archive.getCanonicalPath () ! + "!/")); ! } catch (IOException ex) { ! // empty ! } ! } ! else if (e.endsWith ("/")) ! p.addElement (new URL("file", "", -1, e)); ! else if (new File (e).isDirectory ()) ! p.addElement (new URL("file", "", -1, e + "/")); else ! /* Ignore path element. */; } catch (java.net.MalformedURLException x) { --- 33,42 ---- String e = st.nextToken (); try { ! if (!e.endsWith (File.separator) && new File (e).isDirectory ()) ! p.addElement (new URL("file", "", -1, e + File.separator)); else ! p.addElement (new URL("file", "", -1, e)); } catch (java.net.MalformedURLException x) { diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/xlib/GC.java gcc-3.3/libjava/gnu/gcj/xlib/GC.java *** gcc-3.2.3/libjava/gnu/gcj/xlib/GC.java 2000-10-22 17:46:09.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/xlib/GC.java 2003-01-15 23:53:18.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2003 Free Software Foundation This file is part of libgcj. *************** public class GC implements Cloneable *** 84,89 **** --- 84,91 ---- public native void drawRectangle(int x, int y, int w, int h); public native void fillRectangle(int x, int y, int w, int h); + public native void fillPolygon(int[] xPoints, int[] yPoints, int nPoints, + int translateX, int translateY); /** * diff -Nrc3pad gcc-3.2.3/libjava/gnu/gcj/xlib/natGC.cc gcc-3.3/libjava/gnu/gcj/xlib/natGC.cc *** gcc-3.2.3/libjava/gnu/gcj/xlib/natGC.cc 2000-10-22 17:46:09.000000000 +0000 --- gcc-3.3/libjava/gnu/gcj/xlib/natGC.cc 2003-01-15 23:53:18.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 2000, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 11,16 **** --- 11,17 ---- #include #include + #include #include #include #include *************** void gnu::gcj::xlib::GC::fillRectangle(j *** 154,159 **** --- 155,181 ---- // no fast fail } + void gnu::gcj::xlib::GC::fillPolygon(jintArray xPoints, jintArray yPoints, + jint nPoints, + jint translateX, jint translateY) + { + Display* display = target->getDisplay(); + ::Display* dpy = (::Display*) (display->display); + ::Drawable drawableXID = target->getXID(); + ::GC gc = (::GC) structure; + typedef ::XPoint xpoint; + std::vector points(nPoints+1); + for (int i=0; iClasss or Members. ! More specific methods are also provided for computing the ! type-signature of Constructors and ! Methods. Methods are also provided to go in the ! reverse direction. ! */ public class TypeSignature { - /** ! Returns a String representing the type-encoding of ! CLAZZ. Type-encodings are computed as follows: !

    !      boolean -> "Z"
    !      byte    -> "B"
    !      char    -> "C"
    !      double  -> "D"
    !      float   -> "F"
    !      int     -> "I"
    !      long    -> "J"
    !      short   -> "S"
    !      void    -> "V"
    !      arrays  -> "[" + type-encoding of component type
    !      object  -> "L"
    !                  + fully qualified class name with "."'s replaced by "/"'s
    !                  + ";"
    ! */ ! public static String getEncodingOfClass( Class clazz ) { ! if( clazz.isPrimitive() ) ! { ! if( clazz == Boolean.TYPE ) ! return "Z"; ! if( clazz == Byte.TYPE ) ! return "B"; ! if( clazz == Character.TYPE ) ! return "C"; ! if( clazz == Double.TYPE ) ! return "D"; ! if( clazz == Float.TYPE ) ! return "F"; ! if( clazz == Integer.TYPE ) ! return "I"; ! if( clazz == Long.TYPE ) ! return "J"; ! if( clazz == Short.TYPE ) ! return "S"; ! if( clazz == Void.TYPE ) ! return "V"; ! else ! throw new RuntimeException( "Unknown primitive class " + clazz ); ! } ! else if( clazz.isArray() ) ! { ! return '[' + getEncodingOfClass( clazz.getComponentType() ); ! } ! else ! { ! String classname = clazz.getName(); ! int name_len = classname.length(); ! char[] buf = new char[ name_len + 2 ]; ! buf[0] = 'L'; ! classname.getChars( 0, name_len, buf, 1 ); ! ! int i; ! for( i=1; i <= name_len; i++ ) ! { ! if( buf[i] == '.' ) ! buf[i] = '/'; ! } ! ! buf[i] = ';'; ! return new String( buf ); ! } } - /** ! This function is the inverse of getEncodingOfClass. - @see getEncodingOfClass ! @exception ClassNotFoundException If class encoded as type_code ! cannot be located. ! */ ! public static Class getClassForEncoding( String type_code ) throws ClassNotFoundException { ! if( type_code.equals( "B" ) ) ! return Byte.TYPE; ! if( type_code.equals( "C" ) ) ! return Character.TYPE; ! if( type_code.equals( "D" ) ) ! return Double.TYPE; ! if( type_code.equals( "F" ) ) ! return Float.TYPE; ! if( type_code.equals( "I" ) ) ! return Integer.TYPE; ! if( type_code.equals( "J" ) ) ! return Long.TYPE; ! if( type_code.equals( "S" ) ) ! return Short.TYPE; ! if( type_code.equals( "Z" ) ) ! return Boolean.TYPE; ! if( type_code.charAt( 0 ) == 'L' ) ! { ! return Class.forName( ! type_code.substring( 1, type_code.length() - 1 ).replace( '/', '.' )); ! } ! if( type_code.charAt( 0 ) == '[' ) ! { ! int last_bracket = type_code.lastIndexOf( '[' ); ! String brackets = type_code.substring( 0, last_bracket + 1 ); ! String component = type_code.substring( last_bracket + 1 ); ! ! // ??? This is what the Classpath implementation did, but I don't ! // think that it's correct. The JLS says that Class.forName takes the ! // classname of an array element in fully qualified form, whereas this ! // code is tring to strip off the punctuation. ! ! // if( component.charAt( 0 ) == 'L' ) ! // component = ! // component.substring( 1, component.length() - 1 ).replace('/', '.'); ! ! if( component.charAt( 0 ) == 'L' ) ! component = component.replace('/', '.'); ! ! return Class.forName( brackets + component ); ! } ! else ! throw new ClassNotFoundException( "Type code cannot be parsed as a valid class name" ); } - /** ! Returns a String representing the type-encoding of ! M. The type-encoding of a method is: ! "(" + type-encodings of parameter types + ")" ! + type-encoding of return type ! */ ! public static String getEncodingOfMethod( Method m ) { - String returnEncoding = getEncodingOfClass( m.getReturnType() ); Class[] paramTypes = m.getParameterTypes(); ! String[] paramEncodings = new String[ paramTypes.length ]; ! ! String paramEncoding; ! int size = 2; // make room for parens ! for( int i=0; i < paramTypes.length; i++ ) ! { ! paramEncoding = getEncodingOfClass( paramTypes[i] ); ! size += paramEncoding.length(); ! paramEncodings[i] = paramEncoding; ! } ! ! size += returnEncoding.length(); ! ! StringBuffer buf = new StringBuffer( size ); ! buf.append( '(' ); ! ! for( int i=0; i < paramTypes.length; i++ ) ! { ! buf.append( paramEncodings[i] ); ! } ! ! buf.append( ')' ); ! buf.append( returnEncoding ); ! return buf.toString(); } - /** ! Returns a String representing the type-encoding of ! C. The type-encoding of a method is: ! ! "(" + type-encodings of parameter types + ")V" ! */ ! public static String getEncodingOfConstructor( Constructor c ) { Class[] paramTypes = c.getParameterTypes(); ! String[] paramEncodings = new String[ paramTypes.length ]; ! ! String paramEncoding; ! int size = 3; // make room for parens and V for return type ! for( int i=0; i < paramTypes.length; i++ ) ! { ! paramEncoding = getEncodingOfClass( paramTypes[i] ); ! size += paramEncoding.length(); ! paramEncodings[i] = paramEncoding; ! } ! ! StringBuffer buf = new StringBuffer( size ); ! buf.append( '(' ); ! ! for( int i=0; i < paramTypes.length; i++ ) ! { ! buf.append( paramEncodings[i] ); ! } ! ! buf.append( ")V" ); ! return buf.toString(); } - /** ! Returns a String representing the type-encoding of ! MEM. Constructors are handled by ! getEncodingOfConstructor. Methods are ! handled by getEncodingOfMethod. Fields ! are handled by returning the encoding of the type of the ! Field. ! */ ! public static String getEncodingOfMember( Member mem ) { ! if( mem instanceof Constructor ) ! return getEncodingOfConstructor( (Constructor)mem ); ! if( mem instanceof Method ) ! return getEncodingOfMethod( (Method)mem ); else // Field ! return getEncodingOfClass( ((Field)mem).getType() ); } ! } --- 44,261 ---- import java.lang.reflect.Method; /** ! * This class provides static methods that can be used to compute ! * type-signatures of Classs or Members. ! * More specific methods are also provided for computing the ! * type-signature of Constructors and ! * Methods. Methods are also provided to go in the ! * reverse direction. ! * ! * @author Eric Blake ! */ public class TypeSignature { /** ! * Returns a String representing the type-encoding of a class. ! * The .class file format has different encodings for classes, depending ! * on whether it must be disambiguated from primitive types or not; hence ! * the descriptor parameter to choose between them. If you are planning ! * on decoding primitive types along with classes, then descriptor should ! * be true for correct results. Type-encodings are computed as follows: ! * ! *
    !    * boolean -> "Z"
    !    * byte    -> "B"
    !    * char    -> "C"
    !    * double  -> "D"
    !    * float   -> "F"
    !    * int     -> "I"
    !    * long    -> "J"
    !    * short   -> "S"
    !    * void    -> "V"
    !    * arrays  -> "[" + descriptor format of component type
    !    * object  -> class format: fully qualified name with '.' replaced by '/'
    !    *            descriptor format: "L" + class format + ";"
    !    * 
    ! * ! * @param type the class name to encode ! * @param descriptor true to return objects in descriptor format ! * @return the class name, as it appears in bytecode constant pools ! * @see #getClassForEncoding(String) ! */ ! public static String getEncodingOfClass(String type, boolean descriptor) ! { ! if (! descriptor || type.charAt(0) == '[') ! return type.replace('.', '/'); ! if (type.equals("boolean")) ! return "Z"; ! if (type.equals("byte")) ! return "B"; ! if (type.equals("short")) ! return "S"; ! if (type.equals("char")) ! return "C"; ! if (type.equals("int")) ! return "I"; ! if (type.equals("long")) ! return "J"; ! if (type.equals("float")) ! return "F"; ! if (type.equals("double")) ! return "D"; ! if (type.equals("void")) ! return "V"; ! return 'L' + type.replace('.', '/') + ';'; ! } ! /** ! * Gets the descriptor encoding for a class. ! * ! * @param clazz the class to encode ! * @param descriptor true to return objects in descriptor format ! * @return the class name, as it appears in bytecode constant pools ! * @see #getEncodingOfClass(String, boolean) ! */ ! public static String getEncodingOfClass(Class clazz, boolean descriptor) { ! return getEncodingOfClass(clazz.getName(), descriptor); } /** ! * Gets the descriptor encoding for a class. ! * ! * @param clazz the class to encode ! * @return the class name, as it appears in bytecode constant pools ! * @see #getEncodingOfClass(String, boolean) ! */ ! public static String getEncodingOfClass(Class clazz) ! { ! return getEncodingOfClass(clazz.getName(), true); ! } ! /** ! * This function is the inverse of getEncodingOfClass. This ! * accepts both object and descriptor formats, but must know which style ! * of string is being passed in (usually, descriptor should be true). In ! * descriptor format, "I" is treated as int.class, in object format, it ! * is treated as a class named I in the unnamed package. ! * ! * @param type_code the class name to decode ! * @param descriptor if the string is in descriptor format ! * @return the corresponding Class object ! * @throws ClassNotFoundException if the class cannot be located ! * @see #getEncodingOfClass(Class, boolean) ! */ ! public static Class getClassForEncoding(String type_code, boolean descriptor) throws ClassNotFoundException { ! if (descriptor) ! { ! switch (type_code.charAt(0)) ! { ! case 'B': ! return byte.class; ! case 'C': ! return char.class; ! case 'D': ! return double.class; ! case 'F': ! return float.class; ! case 'I': ! return int.class; ! case 'J': ! return long.class; ! case 'S': ! return short.class; ! case 'V': ! return void.class; ! case 'Z': ! return boolean.class; ! default: ! throw new ClassNotFoundException("Invalid class name: " ! + type_code); ! case 'L': ! type_code = type_code.substring(1, type_code.length() - 1); ! // Fallthrough. ! case '[': ! } ! } ! return Class.forName(type_code.replace('/', '.')); } /** ! * Gets the Class object for a type name. ! * ! * @param type_code the class name to decode ! * @return the corresponding Class object ! * @throws ClassNotFoundException if the class cannot be located ! * @see #getClassForEncoding(String, boolean) ! */ ! public static Class getClassForEncoding(String type_code) ! throws ClassNotFoundException ! { ! return getClassForEncoding(type_code, true); ! } ! /** ! * Returns a String representing the type-encoding of a ! * method. The type-encoding of a method is: ! * ! * "(" + parameter type descriptors + ")" + return type descriptor ! * ! * XXX This could be faster if it were implemented natively. ! * ! * @param m the method to encode ! * @return the encoding ! */ ! public static String getEncodingOfMethod(Method m) { Class[] paramTypes = m.getParameterTypes(); ! StringBuffer buf = new StringBuffer().append('('); ! for (int i = 0; i < paramTypes.length; i++) ! buf.append(getEncodingOfClass(paramTypes[i].getName(), true)); ! buf.append(')').append(getEncodingOfClass(m.getReturnType().getName(), ! true)); return buf.toString(); } /** ! * Returns a String representing the type-encoding of a ! * constructor. The type-encoding of a method is: ! * ! * "(" + parameter type descriptors + ")V" ! * ! * XXX This could be faster if it were implemented natively. ! * ! * @param c the constructor to encode ! * @return the encoding ! */ ! public static String getEncodingOfConstructor(Constructor c) { Class[] paramTypes = c.getParameterTypes(); ! StringBuffer buf = new StringBuffer().append('('); ! for (int i = 0; i < paramTypes.length; i++) ! buf.append(getEncodingOfClass(paramTypes[i].getName(), true)); ! buf.append(")V"); return buf.toString(); } /** ! * Returns a String representing the type-encoding of a ! * class member. This appropriately handles Constructors, Methods, and ! * Fields. ! * ! * @param mem the member to encode ! * @return the encoding ! */ ! public static String getEncodingOfMember(Member mem) { ! if (mem instanceof Constructor) ! return getEncodingOfConstructor((Constructor) mem); ! if (mem instanceof Method) ! return getEncodingOfMethod((Method) mem); else // Field ! return getEncodingOfClass(((Field) mem).getType().getName(), true); } ! } // class TypeSignature diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/ByteBufferImpl.java gcc-3.3/libjava/gnu/java/nio/ByteBufferImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/ByteBufferImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/ByteBufferImpl.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,469 ---- + /* ByteBufferImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.DoubleBuffer; + import java.nio.FloatBuffer; + import java.nio.IntBuffer; + import java.nio.LongBuffer; + import java.nio.ReadOnlyBufferException; + import java.nio.ShortBuffer; + + /** + * This is a Heap memory implementation + */ + public final class ByteBufferImpl extends ByteBuffer + { + private boolean readOnly; + + public ByteBufferImpl (int cap, int off, int lim) + { + super (cap, lim, off, 0); + this.backing_buffer = new byte [cap]; + readOnly = false; + } + + public ByteBufferImpl (byte[] array, int offset, int length) + { + super (array.length, length, offset, 0); + this.backing_buffer = array; + readOnly = false; + } + + public ByteBufferImpl (ByteBufferImpl copy) + { + super (copy.capacity (), copy.limit (), copy.position (), 0); + backing_buffer = copy.backing_buffer; + readOnly = copy.isReadOnly (); + } + + void inc_pos (int toAdd) + { + position (position () + toAdd); + } + + private static native byte[] nio_cast(byte[]copy); + private static native byte[] nio_cast(char[]copy); + private static native byte[] nio_cast(short[]copy); + private static native byte[] nio_cast(long[]copy); + private static native byte[] nio_cast(int[]copy); + private static native byte[] nio_cast(float[]copy); + private static native byte[] nio_cast(double[]copy); + + ByteBufferImpl (byte[] copy) + { + super (copy.length, copy.length, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native byte nio_get_Byte (ByteBufferImpl b, int index, int limit); + + private static native void nio_put_Byte (ByteBufferImpl b, int index, int limit, byte value); + + public ByteBuffer asByteBuffer () + { + ByteBufferImpl res = new ByteBufferImpl (backing_buffer); + res.limit ((limit () * 1) / 1); + return res; + } + + ByteBufferImpl (char[] copy) + { + super (copy.length * 2, copy.length * 2, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native char nio_get_Char (ByteBufferImpl b, int index, int limit); + + private static native void nio_put_Char (ByteBufferImpl b, int index, int limit, char value); + + public CharBuffer asCharBuffer () + { + CharBufferImpl res = new CharBufferImpl (backing_buffer); + res.limit ((limit () * 2) / 1); + return res; + } + + ByteBufferImpl (short[] copy) + { + super (copy.length, copy.length, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native short nio_get_Short (ByteBufferImpl b, int index, int limit); + + private static native void nio_put_Short (ByteBufferImpl b, int index, int limit, short value); + + public ShortBuffer asShortBuffer () + { + ShortBufferImpl res = new ShortBufferImpl (backing_buffer); + res.limit ((limit () * 2) / 1); + return res; + } + + ByteBufferImpl (int[] copy) + { + super (copy.length * 4, copy.length * 4, 0, 0); + this.backing_buffer = copy != null ? nio_cast(copy) : null; + readOnly = false; + } + + private static native int nio_get_Int (ByteBufferImpl b, int index, int limit); + + private static native void nio_put_Int (ByteBufferImpl b, int index, int limit, int value); + + public IntBuffer asIntBuffer () + { + IntBufferImpl res = new IntBufferImpl (backing_buffer); + res.limit ((limit() * 4) / 1); + return res; + } + + ByteBufferImpl (long[] copy) + { + super (copy.length * 8, copy.length * 8, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native long nio_get_Long (ByteBufferImpl b, int index, int limit); + + private static native void nio_put_Long (ByteBufferImpl b, int index, int limit, long value); + + public LongBuffer asLongBuffer () + { + LongBufferImpl res = new LongBufferImpl (backing_buffer); + res.limit ((limit() * 8) / 1); + return res; + } + + ByteBufferImpl (float[] copy) + { + super (copy.length * 4, copy.length * 4, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native float nio_get_Float (ByteBufferImpl b, int index, int limit); + + private static native void nio_put_Float (ByteBufferImpl b, int index, int limit, float value); + + public FloatBuffer asFloatBuffer () + { + FloatBufferImpl res = new FloatBufferImpl (backing_buffer); + res.limit ((limit() * 4) / 1); + return res; + } + + ByteBufferImpl (double[] copy) + { + super (copy.length * 8, copy.length * 8, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native double nio_get_Double (ByteBufferImpl b, int index, int limit); + + private static native void nio_put_Double (ByteBufferImpl b, int index, int limit, double value); + + public DoubleBuffer asDoubleBuffer () + { + DoubleBufferImpl res = new DoubleBufferImpl (backing_buffer); + res.limit ((limit () * 8) / 1); + return res; + } + + public boolean isReadOnly() + { + return readOnly; + } + + public ByteBuffer slice() + { + return new ByteBufferImpl(this); + } + + public ByteBuffer duplicate() + { + return new ByteBufferImpl(this); + } + + public ByteBuffer asReadOnlyBuffer() + { + ByteBufferImpl a = new ByteBufferImpl(this); + a.readOnly = true; + return a; + } + + public ByteBuffer compact() + { + return this; + } + + public boolean isDirect() + { + return false; + } + + final public byte get() + { + byte e = backing_buffer[position()]; + position(position()+1); + return e; + } + + final public ByteBuffer put(byte b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[position()] = b; + position(position()+1); + return this; + } + + final public byte get(int index) + { + return backing_buffer[index]; + } + + final public ByteBuffer put(int index, byte b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[index] = b; + return this; + } + + final public char getChar () + { + char a = nio_get_Char (this, position (), limit ()); + inc_pos (2); + return a; + } + + final public ByteBuffer putChar (char value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Char (this, position (), limit (), value); + inc_pos (2); + return this; + } + + final public char getChar (int index) + { + char a = nio_get_Char (this, index, limit ()); + return a; + } + + final public ByteBuffer putChar (int index, char value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Char (this, index, limit (), value); + return this; + } + + final public short getShort () + { + short a = nio_get_Short (this, position (), limit ()); + inc_pos (2); + return a; + } + + final public ByteBuffer putShort (short value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Short (this, position (), limit(), value); + inc_pos (2); + return this; + } + + final public short getShort (int index) + { + short a = nio_get_Short (this, index, limit ()); + return a; + } + + final public ByteBuffer putShort (int index, short value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Short (this, index, limit (), value); + return this; + } + + final public int getInt () + { + int a = nio_get_Int (this, position (), limit ()); + inc_pos (4); + return a; + } + + final public ByteBuffer putInt (int value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Int (this, position (), limit , value); + inc_pos (4); + return this; + } + + final public int getInt (int index) + { + int a = nio_get_Int (this, index, limit ()); + return a; + } + + final public ByteBuffer putInt (int index, int value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Int(this, index, limit (), value); + return this; + } + + final public long getLong () + { + long a = nio_get_Long (this, position (), limit ()); + inc_pos (8); + return a; + } + + final public ByteBuffer putLong (long value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Long (this, position (), limit (), value); + inc_pos (8); + return this; + } + + final public long getLong (int index) + { + long a = nio_get_Long (this, index, limit ()); + return a; + } + + final public ByteBuffer putLong (int index, long value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Long (this, index, limit (), value); + return this; + } + + final public float getFloat () + { + float a = nio_get_Float (this, position (), limit ()); + inc_pos (4); + return a; + } + + final public ByteBuffer putFloat (float value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Float (this, position (), limit (), value); + inc_pos (4); + return this; + } + + final public float getFloat (int index) + { + float a = nio_get_Float (this, index, limit ()); + return a; + } + + final public ByteBuffer putFloat (int index, float value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Float (this, index, limit(), value); + return this; + } + + final public double getDouble () + { + double a = nio_get_Double (this, position (), limit ()); + inc_pos (8); + return a; + } + + final public ByteBuffer putDouble (double value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Double (this, position(), limit (), value); + inc_pos (8); + return this; + } + + final public double getDouble (int index) + { + return nio_get_Double (this, index, limit ()); + } + + final public ByteBuffer putDouble (int index, double value) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + nio_put_Double (this, index, limit (), value); + return this; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/CharBufferImpl.java gcc-3.3/libjava/gnu/java/nio/CharBufferImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/CharBufferImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/CharBufferImpl.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,206 ---- + /* CharBufferImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.CharBuffer; + import java.nio.ReadOnlyBufferException; + + /** + * This is a Heap memory implementation + */ + public final class CharBufferImpl extends CharBuffer + { + private boolean readOnly; + + public CharBufferImpl(int cap, int off, int lim) + { + super (cap, lim, off, 0); + this.backing_buffer = new char [cap]; + readOnly = false; + } + + public CharBufferImpl(char[] array, int offset, int length) + { + super (array.length, length, offset, 0); + this.backing_buffer = array; + readOnly = false; + } + + public CharBufferImpl (CharBufferImpl copy) + { + super (copy.capacity (), copy.limit (), copy.position (), 0); + backing_buffer = copy.backing_buffer; + readOnly = copy.isReadOnly (); + } + + private static native char[] nio_cast (byte[] copy); + + CharBufferImpl (byte[] copy) + { + super (copy.length / 2, copy.length / 2, 0, 0); + this.backing_buffer = (copy != null ? nio_cast (copy) : null); + readOnly = false; + } + + private static native byte nio_get_Byte (CharBufferImpl b, int index, int limit); + + private static native void nio_put_Byte (CharBufferImpl b, int index, int limit, byte value); + + public ByteBuffer asByteBuffer () + { + ByteBufferImpl res = new ByteBufferImpl (backing_buffer); + res.limit ((limit () * 1) / 2); + return res; + } + + + public boolean isReadOnly() + { + return readOnly; + } + + public CharBuffer slice() + { + return new CharBufferImpl (this); + } + + public CharBuffer duplicate() + { + return new CharBufferImpl(this); + } + + public CharBuffer asReadOnlyBuffer() + { + CharBufferImpl result = new CharBufferImpl (this); + result.readOnly = true; + return result; + } + + public CharBuffer compact() + { + return this; + } + + public boolean isDirect() + { + return false; + } + + final public CharSequence subSequence (int start, int end) + { + if (start < 0 || + end > length () || + start > end) + throw new IndexOutOfBoundsException (); + + // No support for direct buffers yet. + // assert array () != null; + return new CharBufferImpl (array (), position () + start, + position () + end); + } + + /** + * Relative get method. Reads the next character from the buffer. + */ + final public char get() + { + char e = backing_buffer[position()]; + position(position()+1); + return e; + } + + /** + * Relative put method. Writes value to the next position + * in the buffer. + * + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + final public CharBuffer put(char b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[position()] = b; + position(position()+1); + return this; + } + + /** + * Absolute get method. Reads the character at position index. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit. + */ + final public char get(int index) + { + if (index < 0 + || index >= limit ()) + throw new IndexOutOfBoundsException (); + + return backing_buffer[index]; + } + + /** + * Absolute put method. Writes value to position + * index in the buffer. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + final public CharBuffer put(int index, char b) + { + if (index < 0 + || index >= limit ()) + throw new IndexOutOfBoundsException (); + + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[index] = b; + return this; + } + + + public final ByteOrder order() + { + return ByteOrder.BIG_ENDIAN; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/ISO_8859_1.java gcc-3.3/libjava/gnu/java/nio/charset/ISO_8859_1.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/ISO_8859_1.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/ISO_8859_1.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,132 ---- + /* ISO_8859_1.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CharsetEncoder; + import java.nio.charset.CoderResult; + + /** + * ISO-8859-1 charset. + * + * @author Jesse Rosenstock + */ + final class ISO_8859_1 extends Charset + { + ISO_8859_1 () + { + super ("ISO-8859-1", new String[]{"ISO-LATIN-1"}); + } + + public boolean contains (Charset cs) + { + return cs instanceof US_ASCII || cs instanceof ISO_8859_1; + } + + public CharsetDecoder newDecoder () + { + return new Decoder (this); + } + + public CharsetEncoder newEncoder () + { + return new Encoder (this); + } + + private static final class Decoder extends CharsetDecoder + { + private Decoder (Charset cs) + { + super (cs, 1.0f, 1.0f); + } + + protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out) + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + while (in.hasRemaining ()) + { + byte b = in.get (); + + if (!out.hasRemaining ()) + { + in.position (in.position () - 1); + return CoderResult.OVERFLOW; + } + + out.put ((char) (b & 0xFF)); + } + + return CoderResult.UNDERFLOW; + } + } + + private static final class Encoder extends CharsetEncoder + { + private Encoder (Charset cs) + { + super (cs, 1.0f, 1.0f); + } + + protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + while (in.hasRemaining ()) + { + char c = in.get (); + + if (c > 0xFF) + { + in.position (in.position () - 1); + return CoderResult.unmappableForLength (1); + } + if (!out.hasRemaining ()) + { + in.position (in.position () - 1); + return CoderResult.OVERFLOW; + } + + out.put ((byte) c); + } + + return CoderResult.UNDERFLOW; + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/Provider.java gcc-3.3/libjava/gnu/java/nio/charset/Provider.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/Provider.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/Provider.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,135 ---- + /* Provider.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.charset.Charset; + import java.nio.charset.spi.CharsetProvider; + import java.util.Collections; + import java.util.HashMap; + import java.util.Iterator; + + /** + * Charset provider for the required charsets. Used by + * {@link Charset#charsetForName} and * {@link Charset#availableCharsets}. + * + * @author Jesse Rosenstock + * @see Charset + */ + public final class Provider extends CharsetProvider + { + private static Provider singleton; + + static + { + synchronized (Provider.class) + { + singleton = null; + } + } + + /** + * Map from charset name to charset canonical name. + */ + private final HashMap canonicalNames; + + /** + * Map from canonical name to Charset. + * TODO: We may want to use soft references. We would then need to keep + * track of the class name to regenerate the object. + */ + private final HashMap charsets; + + private Provider () + { + // FIXME: We might need to make the name comparison case insensitive. + // Verify this with the Sun JDK. + canonicalNames = new HashMap (); + charsets = new HashMap (); + + // US-ASCII aka ISO646-US + addCharset (new US_ASCII ()); + + // ISO-8859-1 aka ISO-LATIN-1 + addCharset (new ISO_8859_1 ()); + + // UTF-8 + addCharset (new UTF_8 ()); + + // UTF-16BE + addCharset (new UTF_16BE ()); + + // UTF-16LE + addCharset (new UTF_16LE ()); + + // UTF-16 + addCharset (new UTF_16 ()); + } + + public Iterator charsets () + { + return Collections.unmodifiableCollection (charsets.values ()) + .iterator (); + } + + public Charset charsetForName (String charsetName) + { + return (Charset) charsets.get (canonicalize (charsetName)); + } + + private Object canonicalize (String charsetName) + { + Object o = canonicalNames.get (charsetName); + return o == null ? charsetName : o; + } + + private void addCharset (Charset cs) + { + String canonicalName = cs.name (); + charsets.put (canonicalName, cs); + + for (Iterator i = cs.aliases ().iterator (); i.hasNext (); ) + canonicalNames.put (i.next (), canonicalName); + } + + public static synchronized Provider provider () + { + if (singleton == null) + singleton = new Provider (); + return singleton; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/US_ASCII.java gcc-3.3/libjava/gnu/java/nio/charset/US_ASCII.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/US_ASCII.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/US_ASCII.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,137 ---- + /* US_ASCII.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CharsetEncoder; + import java.nio.charset.CoderResult; + + /** + * US-ASCII charset. + * + * @author Jesse Rosenstock + */ + final class US_ASCII extends Charset + { + US_ASCII () + { + super ("US-ASCII", new String[]{"ISO646-US"}); + } + + public boolean contains (Charset cs) + { + return cs instanceof US_ASCII; + } + + public CharsetDecoder newDecoder () + { + return new Decoder (this); + } + + public CharsetEncoder newEncoder () + { + return new Encoder (this); + } + + private static final class Decoder extends CharsetDecoder + { + private Decoder (Charset cs) + { + super (cs, 1.0f, 1.0f); + } + + protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out) + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + while (in.hasRemaining ()) + { + byte b = in.get (); + + if (b < 0) + { + in.position (in.position () - 1); + return CoderResult.malformedForLength (1); + } + if (!out.hasRemaining ()) + { + in.position (in.position () - 1); + return CoderResult.OVERFLOW; + } + + out.put ((char) b); + } + + return CoderResult.UNDERFLOW; + } + } + + private static final class Encoder extends CharsetEncoder + { + private Encoder (Charset cs) + { + super (cs, 1.0f, 1.0f); + } + + protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + while (in.hasRemaining ()) + { + char c = in.get (); + + if (c > Byte.MAX_VALUE) + { + in.position (in.position () - 1); + return CoderResult.unmappableForLength (1); + } + if (!out.hasRemaining ()) + { + in.position (in.position () - 1); + return CoderResult.OVERFLOW; + } + + out.put ((byte) c); + } + + return CoderResult.UNDERFLOW; + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16BE.java gcc-3.3/libjava/gnu/java/nio/charset/UTF_16BE.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16BE.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/UTF_16BE.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,75 ---- + /* UTF_16BE.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CharsetEncoder; + import java.nio.charset.CoderResult; + + /** + * UTF-16BE charset. + * + * @author Jesse Rosenstock + */ + final class UTF_16BE extends Charset + { + UTF_16BE () + { + super ("UTF-16BE", null); + } + + public boolean contains (Charset cs) + { + return cs instanceof US_ASCII || cs instanceof ISO_8859_1 + || cs instanceof UTF_8 || cs instanceof UTF_16BE + || cs instanceof UTF_16LE || cs instanceof UTF_16; + } + + public CharsetDecoder newDecoder () + { + return new UTF_16Decoder (this, UTF_16Decoder.BIG_ENDIAN); + } + + public CharsetEncoder newEncoder () + { + return new UTF_16Encoder (this, UTF_16Encoder.BIG_ENDIAN, true); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16Decoder.java gcc-3.3/libjava/gnu/java/nio/charset/UTF_16Decoder.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16Decoder.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/UTF_16Decoder.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,169 ---- + /* UTF_16Decoder.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CoderResult; + + /** + * Decoder for UTF-16, UTF-15LE, and UTF-16BE. + * + * @author Jesse Rosenstock + */ + final class UTF_16Decoder extends CharsetDecoder + { + // byte orders + static final int BIG_ENDIAN = 0; + static final int LITTLE_ENDIAN = 1; + static final int UNKNOWN_ENDIAN = 2; + + private static final char BYTE_ORDER_MARK = '\uFEFF'; + private static final char REVERSED_BYTE_ORDER_MARK = '\uFFFE'; + + private final int originalByteOrder; + private int byteOrder; + + UTF_16Decoder (Charset cs, int byteOrder) + { + super (cs, 0.5f, 1.0f); + this.originalByteOrder = byteOrder; + this.byteOrder = byteOrder; + } + + protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out) + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + + int inPos = in.position (); + try + { + while (in.remaining () >= 2) + { + byte b1 = in.get (); + byte b2 = in.get (); + + // handle byte order mark + if (byteOrder == UNKNOWN_ENDIAN) + { + char c = (char) ((b1 << 8) | b2); + if (c == BYTE_ORDER_MARK) + { + byteOrder = BIG_ENDIAN; + inPos += 2; + continue; + } + else if (c == REVERSED_BYTE_ORDER_MARK) + { + byteOrder = LITTLE_ENDIAN; + inPos += 2; + continue; + } + else + { + // assume big endian, do not consume bytes, + // continue with normal processing + byteOrder = BIG_ENDIAN; + } + } + + char c = byteOrder == BIG_ENDIAN ? (char) ((b1 << 8) | b2) + : (char) ((b2 << 8) | b1); + + if (0xD800 <= c && c <= 0xDFFF) + { + // c is a surrogate + + // make sure c is a high surrogate + if (c > 0xDBFF) + return CoderResult.malformedForLength (2); + if (in.remaining () < 2) + return CoderResult.UNDERFLOW; + byte b3 = in.get (); + byte b4 = in.get (); + char d = byteOrder == BIG_ENDIAN ? (char) ((b3 << 8) | b4) + : (char) ((b4 << 8) | b3); + // make sure d is a low surrogate + if (d < 0xDC00 || d > 0xDFFF) + return CoderResult.malformedForLength (2); + out.put (c); + out.put (d); + inPos += 4; + } + else + { + if (!out.hasRemaining ()) + return CoderResult.UNDERFLOW; + out.put (c); + inPos += 2; + } + } + + return CoderResult.UNDERFLOW; + } + finally + { + in.position (inPos); + } + } + + /** + * Writes c to out in the byte order + * specified by byteOrder. + **/ + private void put (ByteBuffer out, char c) + { + if (byteOrder == BIG_ENDIAN) + { + out.put ((byte) (c >> 8)); + out.put ((byte) (c & 0xFF)); + } + else + { + out.put ((byte) (c & 0xFF)); + out.put ((byte) (c >> 8)); + } + } + + protected void implReset () + { + byteOrder = originalByteOrder; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16Encoder.java gcc-3.3/libjava/gnu/java/nio/charset/UTF_16Encoder.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16Encoder.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/UTF_16Encoder.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,153 ---- + /* UTF_16Encoder.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetEncoder; + import java.nio.charset.CoderResult; + + /** + * Encoder for UTF-16, UTF-15LE, and UTF-16BE. + * + * @author Jesse Rosenstock + */ + final class UTF_16Encoder extends CharsetEncoder + { + // byte orders + static final int BIG_ENDIAN = 0; + static final int LITTLE_ENDIAN = 1; + + private static final char BYTE_ORDER_MARK = '\uFEFF'; + + private final int byteOrder; + private final boolean useByteOrderMark; + private boolean needsByteOrderMark; + + UTF_16Encoder (Charset cs, int byteOrder, boolean useByteOrderMark) + { + super (cs, 2.0f, + useByteOrderMark ? 4.0f : 2.0f, + byteOrder == BIG_ENDIAN + ? new byte[] { (byte) 0xFF, (byte) 0xFD } + : new byte[] { (byte) 0xFD, (byte) 0xFF }); + this.byteOrder = byteOrder; + this.useByteOrderMark = useByteOrderMark; + this.needsByteOrderMark = useByteOrderMark; + } + + protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + + if (needsByteOrderMark) + { + if (out.remaining () < 2) + return CoderResult.OVERFLOW; + put (out, BYTE_ORDER_MARK); + needsByteOrderMark = false; + } + + int inPos = in.position (); + try + { + while (in.hasRemaining ()) + { + char c = in.get (); + + if (0xD800 <= c && c <= 0xDFFF) + { + // c is a surrogate + + // make sure c is a high surrogate + if (c > 0xDBFF) + return CoderResult.malformedForLength (1); + if (in.remaining () < 1) + return CoderResult.UNDERFLOW; + char d = in.get (); + // make sure d is a low surrogate + if (d < 0xDC00 || d > 0xDFFF) + return CoderResult.malformedForLength (1); + put (out, c); + put (out, d); + inPos += 2; + } + else + { + if (out.remaining () < 2) + return CoderResult.OVERFLOW; + put (out, c); + inPos++; + } + } + + return CoderResult.UNDERFLOW; + } + finally + { + in.position (inPos); + } + } + + /** + * Writes c to out in the byte order + * specified by byteOrder. + **/ + private void put (ByteBuffer out, char c) + { + if (byteOrder == BIG_ENDIAN) + { + out.put ((byte) (c >> 8)); + out.put ((byte) (c & 0xFF)); + } + else + { + out.put ((byte) (c & 0xFF)); + out.put ((byte) (c >> 8)); + } + } + + protected void implReset () + { + needsByteOrderMark = useByteOrderMark; + } + + // TODO: override canEncode(char) and canEncode(CharSequence) + // for performance + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16.java gcc-3.3/libjava/gnu/java/nio/charset/UTF_16.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/UTF_16.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,75 ---- + /* UTF_16.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CharsetEncoder; + import java.nio.charset.CoderResult; + + /** + * UTF-16 charset. + * + * @author Jesse Rosenstock + */ + final class UTF_16 extends Charset + { + UTF_16 () + { + super ("UTF-16", null); + } + + public boolean contains (Charset cs) + { + return cs instanceof US_ASCII || cs instanceof ISO_8859_1 + || cs instanceof UTF_8 || cs instanceof UTF_16BE + || cs instanceof UTF_16LE || cs instanceof UTF_16; + } + + public CharsetDecoder newDecoder () + { + return new UTF_16Decoder (this, UTF_16Decoder.UNKNOWN_ENDIAN); + } + + public CharsetEncoder newEncoder () + { + return new UTF_16Encoder (this, UTF_16Encoder.BIG_ENDIAN, false); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16LE.java gcc-3.3/libjava/gnu/java/nio/charset/UTF_16LE.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_16LE.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/UTF_16LE.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,75 ---- + /* UTF_16LE.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CharsetEncoder; + import java.nio.charset.CoderResult; + + /** + * UTF-16LE charset. + * + * @author Jesse Rosenstock + */ + final class UTF_16LE extends Charset + { + UTF_16LE () + { + super ("UTF-16LE", null); + } + + public boolean contains (Charset cs) + { + return cs instanceof US_ASCII || cs instanceof ISO_8859_1 + || cs instanceof UTF_8 || cs instanceof UTF_16BE + || cs instanceof UTF_16LE || cs instanceof UTF_16; + } + + public CharsetDecoder newDecoder () + { + return new UTF_16Decoder (this, UTF_16Decoder.LITTLE_ENDIAN); + } + + public CharsetEncoder newEncoder () + { + return new UTF_16Encoder (this, UTF_16Encoder.LITTLE_ENDIAN, true); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_8.java gcc-3.3/libjava/gnu/java/nio/charset/UTF_8.java *** gcc-3.2.3/libjava/gnu/java/nio/charset/UTF_8.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/charset/UTF_8.java 2002-11-11 07:36:41.000000000 +0000 *************** *** 0 **** --- 1,279 ---- + /* UTF_8.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CharsetEncoder; + import java.nio.charset.CoderResult; + + /** + * UTF-8 charset. + * + *

    UTF-8 references: + *

    + * + * @author Jesse Rosenstock + */ + final class UTF_8 extends Charset + { + UTF_8 () + { + super ("UTF-8", null); + } + + public boolean contains (Charset cs) + { + return cs instanceof US_ASCII || cs instanceof ISO_8859_1 + || cs instanceof UTF_8 || cs instanceof UTF_16BE + || cs instanceof UTF_16LE || cs instanceof UTF_16; + } + + public CharsetDecoder newDecoder () + { + return new Decoder (this); + } + + public CharsetEncoder newEncoder () + { + return new Encoder (this); + } + + private static final class Decoder extends CharsetDecoder + { + private Decoder (Charset cs) + { + super (cs, 1.0f, 1.0f); + } + + protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out) + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + int inPos = 0; + try + { + while (in.hasRemaining ()) + { + char c; + byte b1 = in.get (); + int highNibble = (b1 >> 4) & 0xF; + + switch (highNibble) + { + case 0: case 1: case 2: case 3: + case 4: case 5: case 6: case 7: + if (out.remaining () < 1) + return CoderResult.OVERFLOW; + out.put ((char) b1); + inPos++; + break; + + case 0xC: case 0xD: + byte b2; + if (in.remaining () < 1) + return CoderResult.UNDERFLOW; + if (out.remaining () < 1) + return CoderResult.OVERFLOW; + if (!isContinuation (b2 = in.get ())) + return CoderResult.malformedForLength (1); + c = (char) (((b1 & 0x1F) << 6) | (b2 & 0x3F)); + // check that we had the shortest encoding + if (c <= 0x7F) + return CoderResult.malformedForLength (2); + out.put (c); + inPos += 2; + break; + + case 0xE: + byte b3; + if (in.remaining () < 2) + return CoderResult.UNDERFLOW; + if (out.remaining () < 1) + return CoderResult.OVERFLOW; + if (!isContinuation (b2 = in.get ())) + return CoderResult.malformedForLength (1); + if (!isContinuation (b3 = in.get ())) + return CoderResult.malformedForLength (1); + c = (char) (((b1 & 0x0F) << 12) + | ((b2 & 0x3F) << 6) + | (b3 & 0x3F)); + // check that we had the shortest encoding + if (c <= 0x7FF) + return CoderResult.malformedForLength (3); + out.put (c); + inPos += 3; + break; + + default: + return CoderResult.malformedForLength (1); + } + } + + return CoderResult.UNDERFLOW; + } + finally + { + // In case we did a get(), then encountered an error, reset the + // position to before the error. If there was no error, this + // will benignly reset the position to the value it already has. + in.position (inPos); + } + } + + private static boolean isContinuation (byte b) + { + return (b & 0xC0) == 0x80; + } + } + + private static final class Encoder extends CharsetEncoder + { + private Encoder (Charset cs) + { + // According to + // http://www-106.ibm.com/developerworks/unicode/library/utfencodingforms/index.html + // On average, English takes slightly over one unit per code point. + // Most Latin-script languages take about 1.1 bytes. Greek, Russian, + // Arabic and Hebrew take about 1.7 bytes, and most others (including + // Japanese, Chinese, Korean and Hindi) take about 3 bytes. + // We assume we will be dealing with latin scripts, and use 1.1 + // for averageBytesPerChar. + super (cs, 1.1f, 4.0f); + } + + protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) + { + int inPos = 0; + try + { + // TODO: Optimize this in the case in.hasArray() / out.hasArray() + while (in.hasRemaining ()) + { + int remaining = out.remaining (); + char c = in.get (); + + // UCS-4 range (hex.) UTF-8 octet sequence (binary) + // 0000 0000-0000 007F 0xxxxxxx + // 0000 0080-0000 07FF 110xxxxx 10xxxxxx + // 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx + + // Scalar Value UTF-16 byte 1 byte 2 byte 3 byte 4 + // 0000 0000 0xxx xxxx 0000 0000 0xxx xxxx 0xxx xxxx + // 0000 0yyy yyxx xxxx 0000 0yyy yyxx xxxx 110y yyyy 10xx xxxx + // zzzz yyyy yyxx xxxx zzzz yyyy yyxx xxxx 1110 zzzz 10yy yyyy 10xx xxxx + // u uuuu zzzz yyyy yyxx xxxx 1101 10ww wwzz zzyy 1111 0uuu 10uu zzzz 10yy yyyy 10xx xxxx + // + 1101 11yy yyxx xxxx + // Note: uuuuu = wwww + 1 + + if (c <= 0x7F) + { + if (remaining < 1) + return CoderResult.OVERFLOW; + out.put ((byte) c); + inPos++; + } + else if (c <= 0x7FF) + { + if (remaining < 2) + return CoderResult.OVERFLOW; + out.put ((byte) (0xC0 | (c >> 6))); + out.put ((byte) (0x80 | (c & 0x3F))); + inPos++; + } + else if (0xD800 <= c && c <= 0xDFFF) + { + if (remaining < 4) + return CoderResult.OVERFLOW; + + // we got a low surrogate without a preciding high one + if (c > 0xDBFF) + return CoderResult.malformedForLength (1); + + // high surrogates + if (!in.hasRemaining ()) + return CoderResult.UNDERFLOW; + + char d = in.get (); + + // make sure d is a low surrogate + if (d < 0xDC00 || d > 0xDFFF) + return CoderResult.malformedForLength (1); + + // make the 32 bit value + // int value2 = (c - 0xD800) * 0x400 + (d - 0xDC00) + 0x10000; + int value = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000; + // assert value == value2; + out.put ((byte) (0xF0 | (value >> 18))); + out.put ((byte) (0x80 | ((value >> 12) & 0x3F))); + out.put ((byte) (0x80 | ((value >> 6) & 0x3F))); + out.put ((byte) (0x80 | ((value ) & 0x3F))); + + inPos += 2; + } + else + { + if (remaining < 3) + return CoderResult.OVERFLOW; + + out.put ((byte) (0xE0 | (c >> 12))); + out.put ((byte) (0x80 | ((c >> 6) & 0x3F))); + out.put ((byte) (0x80 | (c & 0x3F))); + inPos++; + } + } + + return CoderResult.UNDERFLOW; + } + finally + { + // In case we did a get(), then encountered an error, reset the + // position to before the error. If there was no error, this + // will benignly reset the position to the value it already has. + in.position (inPos); + } + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/DatagramChannelImpl.java gcc-3.3/libjava/gnu/java/nio/DatagramChannelImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/DatagramChannelImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/DatagramChannelImpl.java 2002-11-29 09:57:05.000000000 +0000 *************** *** 0 **** --- 1,112 ---- + /* DatagramChannelImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.net.DatagramSocket; + import java.net.SocketAddress; + import java.nio.ByteBuffer; + import java.nio.channels.DatagramChannel; + import java.nio.channels.spi.SelectorProvider; + + public class DatagramChannelImpl extends DatagramChannel + { + int fd; + + protected DatagramChannelImpl (SelectorProvider provider) + { + super (provider); + } + + protected void implCloseSelectableChannel () + { + } + + protected void implConfigureBlocking (boolean block) + { + } + + public int write (ByteBuffer src) + { + return 0; + } + + public long write (ByteBuffer[] srcs, int offset, int length) + { + return 0; + } + + public int read (ByteBuffer dst) + { + return 0; + } + + public DatagramChannel connect (SocketAddress remote) + { + return null; + } + + public DatagramChannel disconnect () + { + return null; + } + + public boolean isConnected () + { + return false; + } + + public long read (ByteBuffer[] dsts, int offset, int length) + { + return 0; + } + + public SocketAddress receive (ByteBuffer dst) + { + return null; + } + + public int send (ByteBuffer src, SocketAddress target) + { + return 0; + } + + public DatagramSocket socket () + { + return null; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/DoubleBufferImpl.java gcc-3.3/libjava/gnu/java/nio/DoubleBufferImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/DoubleBufferImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/DoubleBufferImpl.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,160 ---- + /* DoubleBufferImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.DoubleBuffer; + import java.nio.ReadOnlyBufferException; + + /** + * This is a Heap memory implementation + */ + public final class DoubleBufferImpl extends DoubleBuffer + { + private boolean readOnly; + + public DoubleBufferImpl(int cap, int off, int lim) + { + super (cap, lim, off, 0); + this.backing_buffer = new double[cap]; + readOnly = false; + } + + public DoubleBufferImpl(double[] array, int offset, int length) + { + super (array.length, length, offset, 0); + this.backing_buffer = array; + readOnly = false; + } + + public DoubleBufferImpl(DoubleBufferImpl copy) + { + super (copy.capacity (), copy.limit (), copy.position (), 0); + backing_buffer = copy.backing_buffer; + readOnly = copy.isReadOnly (); + } + + DoubleBufferImpl (byte[] copy) + { + super (copy.length, copy.length, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native byte nio_get_Byte (DoubleBufferImpl b, int index, int limit); + + private static native void nio_put_Byte (DoubleBufferImpl b, int index, int limit, byte value); + + public ByteBuffer asByteBuffer () + { + ByteBufferImpl res = new ByteBufferImpl (backing_buffer); + res.limit ((limit () * 1) / 8); + return res; + } + + private static native double[] nio_cast (byte[] copy); + + public boolean isReadOnly () + { + return readOnly; + } + + public DoubleBuffer slice () + { + return new DoubleBufferImpl (this); + } + + public DoubleBuffer duplicate() + { + return new DoubleBufferImpl(this); + } + + public DoubleBuffer asReadOnlyBuffer() + { + DoubleBufferImpl result = new DoubleBufferImpl (this); + result.readOnly = true; + return result; + } + + public DoubleBuffer compact() + { + return this; + } + + public boolean isDirect() + { + return false; + } + + final public double get() + { + double e = backing_buffer[position()]; + position(position()+1); + return e; + } + + final public DoubleBuffer put(double b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[position()] = b; + position(position()+1); + return this; + } + + final public double get(int index) + { + return backing_buffer[index]; + } + + final public DoubleBuffer put(int index, double b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[index] = b; + return this; + } + + final public ByteOrder order () + { + return ByteOrder.BIG_ENDIAN; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/FileChannelImpl.java gcc-3.3/libjava/gnu/java/nio/FileChannelImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/FileChannelImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/FileChannelImpl.java 2003-02-13 16:50:39.000000000 +0000 *************** *** 0 **** --- 1,357 ---- + /* FileChannelImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.io.EOFException; + import java.io.FileInputStream; + import java.io.FileOutputStream; + import java.io.IOException; + import java.io.RandomAccessFile; + import java.nio.ByteBuffer; + import java.nio.MappedByteBuffer; + import java.nio.channels.ClosedChannelException; + import java.nio.channels.FileChannel; + import java.nio.channels.FileLock; + import java.nio.channels.NonReadableChannelException; + import java.nio.channels.NonWritableChannelException; + import java.nio.channels.ReadableByteChannel; + import java.nio.channels.WritableByteChannel; + + /** + * This file is not user visible ! + * But alas, Java does not have a concept of friendly packages + * so this class is public. + * Instances of this class are created by invoking getChannel + * Upon a Input/Output/RandomAccessFile object. + */ + + public class FileChannelImpl extends FileChannel + { + public long address; + public int length; + public int fd; + public MappedByteBuffer buf; + public Object file_obj; // just to keep it live... + + /** + * This method came from java.io.RandomAccessFile + * It is private there so we will repeat it here. + */ + private native long lengthInternal (int native_fd) throws IOException; + + public FileChannelImpl (int fd, Object obj) + { + this.fd = fd; + this.file_obj = obj; + } + + public long size () throws IOException + { + if (!isOpen ()) + throw new ClosedChannelException (); + + return lengthInternal (fd); + } + + protected void implCloseChannel() throws IOException + { + if (address != 0) + { + nio_unmmap_file (fd, address, (int) length); + address = 0; + } + + // FIXME + fd = 0; + + if (file_obj instanceof RandomAccessFile) + { + RandomAccessFile o = (RandomAccessFile) file_obj; + o.close(); + } + else if (file_obj instanceof FileInputStream) + { + FileInputStream o = (FileInputStream) file_obj; + o.close(); + } + else if (file_obj instanceof FileOutputStream) + { + FileOutputStream o = (FileOutputStream) file_obj; + o.close(); + } + } + + public int read (ByteBuffer dst) throws IOException + { + int s = (int)size(); + + if (buf == null) + { + throw new EOFException("file not mapped"); + } + + for (int i=0; i Integer.MAX_VALUE) + throw new IllegalArgumentException (); + + // int cmode = mode.m; + // address = nio_mmap_file (fd, position, size, cmode); + // length = size; + // buf = new MappedByteFileBuffer (this); + // return buf; + return null; + } + + static MappedByteBuffer create_direct_mapped_buffer (long address, + long length) + { + // FileChannelImpl ch = new FileChannelImpl (-1, null); + // ch.address = address; + // ch.length = (int) length; + // ch.buf = new MappedByteFileBuffer (ch); + // return ch.buf; + return null; + } + + public long write (ByteBuffer[] srcs) + throws IOException + { + return write (srcs, 0, srcs.length); + } + + /** + * msync with the disk + */ + public void force (boolean metaData) throws IOException + { + if (!isOpen ()) + throw new ClosedChannelException (); + + // FIXME: What to do with metaData ? + + nio_msync (fd, address, length); + } + + public long transferTo (long position, long count, WritableByteChannel target) + throws IOException + { + if (position < 0 + || count < 0) + throw new IllegalArgumentException (); + + if (!isOpen ()) + throw new ClosedChannelException (); + + // FIXME: check for NonReadableChannelException + // FIXME: check for NonWritableChannelException + + throw new Error ("Not implemented"); + } + + public long transferFrom (ReadableByteChannel src, long position, long count) + throws IOException + { + if (position < 0 + || count < 0) + throw new IllegalArgumentException (); + + if (!isOpen ()) + throw new ClosedChannelException (); + + // FIXME: check for NonReadableChannelException + // FIXME: check for NonWritableChannelException + + throw new Error ("Not implemented"); + } + + public FileLock lock (long position, long size, boolean shared) + throws IOException + { + if (position < 0 + || size < 0) + throw new IllegalArgumentException (); + + if (!isOpen ()) + throw new ClosedChannelException (); + + // FIXME: check for NonReadableChannelException + // FIXME: check for NonWritableChannelException + + throw new Error ("Not implemented"); + } + + public FileLock tryLock (long position, long size, boolean shared) + throws IOException + { + if (position < 0 + || size < 0) + throw new IllegalArgumentException (); + + if (!isOpen ()) + throw new ClosedChannelException (); + + throw new Error ("Not implemented"); + } + + public long position () + throws IOException + { + if (!isOpen ()) + throw new ClosedChannelException (); + + throw new Error ("not implemented"); + } + + public FileChannel position (long newPosition) + throws IOException + { + if (newPosition < 0) + throw new IllegalArgumentException (); + + if (!isOpen ()) + throw new ClosedChannelException (); + + throw new Error ("not implemented"); + } + + public FileChannel truncate (long size) + throws IOException + { + if (size < 0) + throw new IllegalArgumentException (); + + if (!isOpen ()) + throw new ClosedChannelException (); + + // FIXME: check for NonWritableChannelException + + throw new Error ("not implemented"); + } + + private static native long nio_mmap_file (int fd, long pos, int size, int mode); + private static native void nio_unmmap_file (int fd, long address, int size); + private static native void nio_msync (int fd, long address, int length); + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/FileLockImpl.java gcc-3.3/libjava/gnu/java/nio/FileLockImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/FileLockImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/FileLockImpl.java 2003-02-11 04:13:47.000000000 +0000 *************** *** 0 **** --- 1,63 ---- + /* FileChannelImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.channels.FileChannel; + import java.nio.channels.FileLock; + + /** + * @author Michael Koch + */ + public class FileLockImpl extends FileLock + { + public FileLockImpl (FileChannel channel, long position, long size, + boolean shared) + { + super (channel, position, size, shared); + } + + public boolean isValid () + { + throw new Error ("Not implemented"); + } + + public void release () + { + throw new Error ("Not implemented"); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/FloatBufferImpl.java gcc-3.3/libjava/gnu/java/nio/FloatBufferImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/FloatBufferImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/FloatBufferImpl.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,160 ---- + /* FloatBufferImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.FloatBuffer; + import java.nio.ReadOnlyBufferException; + + /** + * This is a Heap memory implementation + */ + public final class FloatBufferImpl extends FloatBuffer + { + private boolean readOnly; + + public FloatBufferImpl(int cap, int off, int lim) + { + super (cap, lim, off, 0); + this.backing_buffer = new float [cap]; + readOnly = false; + } + + public FloatBufferImpl(float[] array, int offset, int length) + { + super (array.length, length, offset, 0); + this.backing_buffer = array; + readOnly = false; + } + + public FloatBufferImpl(FloatBufferImpl copy) + { + super (copy.capacity (), copy.limit (), copy.position (), 0); + backing_buffer = copy.backing_buffer; + readOnly = copy.isReadOnly (); + } + + private static native float[] nio_cast (byte[] copy); + + FloatBufferImpl (byte[] copy) + { + super (copy.length, copy.length, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native byte nio_get_Byte (FloatBufferImpl b, int index, int limit); + + private static native void nio_put_Byte (FloatBufferImpl b, int index, int limit, byte value); + + public ByteBuffer asByteBuffer() + { + ByteBufferImpl res = new ByteBufferImpl (backing_buffer); + res.limit ((limit () * 1) / 4); + return res; + } + + public boolean isReadOnly () + { + return readOnly; + } + + public FloatBuffer slice() + { + return new FloatBufferImpl (this); + } + + public FloatBuffer duplicate() + { + return new FloatBufferImpl(this); + } + + public FloatBuffer asReadOnlyBuffer() + { + FloatBufferImpl result = new FloatBufferImpl (this); + result.readOnly = true; + return result; + } + + public FloatBuffer compact() + { + return this; + } + + public boolean isDirect() + { + return false; + } + + final public float get() + { + float e = backing_buffer[position()]; + position(position()+1); + return e; + } + + final public FloatBuffer put(float b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[position()] = b; + position(position()+1); + return this; + } + + final public float get(int index) + { + return backing_buffer[index]; + } + + final public FloatBuffer put(int index, float b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[index] = b; + return this; + } + + final public ByteOrder order () + { + return ByteOrder.BIG_ENDIAN; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/IntBufferImpl.java gcc-3.3/libjava/gnu/java/nio/IntBufferImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/IntBufferImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/IntBufferImpl.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,160 ---- + /* IntBufferImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.IntBuffer; + import java.nio.ReadOnlyBufferException; + + /** + * This is a Heap memory implementation + */ + public final class IntBufferImpl extends IntBuffer + { + private boolean readOnly; + + public IntBufferImpl(int cap, int off, int lim) + { + super (cap, lim, off, 0); + this.backing_buffer = new int[cap]; + readOnly = false; + } + + public IntBufferImpl(int[] array, int offset, int length) + { + super (array.length, length, offset, 0); + this.backing_buffer = array; + readOnly = false; + } + + public IntBufferImpl(IntBufferImpl copy) + { + super (copy.capacity (), copy.limit (), copy.position (), 0); + backing_buffer = copy.backing_buffer; + readOnly = copy.isReadOnly (); + } + + private static native int[] nio_cast (byte[] copy); + + IntBufferImpl (byte[] copy) + { + super (copy.length, copy.length, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native byte nio_get_Byte (IntBufferImpl b, int index, int limit); + + private static native void nio_put_Byte (IntBufferImpl b, int index, int limit, byte value); + + public ByteBuffer asByteBuffer () + { + ByteBufferImpl res = new ByteBufferImpl (backing_buffer); + res.limit ((limit () * 1) / 4); + return res; + } + + public boolean isReadOnly() + { + return readOnly; + } + + public IntBuffer slice() + { + return new IntBufferImpl (this); + } + + public IntBuffer duplicate() + { + return new IntBufferImpl(this); + } + + public IntBuffer asReadOnlyBuffer() + { + IntBufferImpl result = new IntBufferImpl (this); + result.readOnly = true; + return result; + } + + public IntBuffer compact() + { + return this; + } + + public boolean isDirect() + { + return false; + } + + final public int get() + { + int e = backing_buffer[position()]; + position(position()+1); + return e; + } + + final public IntBuffer put(int b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[position()] = b; + position(position()+1); + return this; + } + + final public int get(int index) + { + return backing_buffer[index]; + } + + final public IntBuffer put(int index, int b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[index] = b; + return this; + } + + final public ByteOrder order () + { + return ByteOrder.BIG_ENDIAN; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/LongBufferImpl.java gcc-3.3/libjava/gnu/java/nio/LongBufferImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/LongBufferImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/LongBufferImpl.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,160 ---- + /* LongBufferImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.LongBuffer; + import java.nio.ReadOnlyBufferException; + + /** + * This is a Heap memory implementation + */ + public final class LongBufferImpl extends LongBuffer + { + private boolean readOnly; + + public LongBufferImpl(int cap, int off, int lim) + { + super (cap, lim, off, 0); + this.backing_buffer = new long[cap]; + readOnly = false; + } + + public LongBufferImpl(long[] array, int offset, int length) + { + super (array.length, length, offset, 0); + this.backing_buffer = array; + readOnly = false; + } + + public LongBufferImpl(LongBufferImpl copy) + { + super (copy.capacity (), copy.limit (), copy.position (), 0); + backing_buffer = copy.backing_buffer; + readOnly = copy.isReadOnly (); + } + + private static native long[] nio_cast (byte[] copy); + + LongBufferImpl (byte[] copy) + { + super (copy.length, copy.length, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native byte nio_get_Byte (LongBufferImpl b, int index, int limit); + + private static native void nio_put_Byte (LongBufferImpl b, int index, int limit, byte value); + + public ByteBuffer asByteBuffer () + { + ByteBufferImpl res = new ByteBufferImpl (backing_buffer); + res.limit ((limit () * 1) / 8); + return res; + } + + public boolean isReadOnly() + { + return readOnly; + } + + public LongBuffer slice() + { + return new LongBufferImpl (this); + } + + public LongBuffer duplicate() + { + return new LongBufferImpl(this); + } + + public LongBuffer asReadOnlyBuffer() + { + LongBufferImpl result = new LongBufferImpl (this); + result.readOnly = true; + return result; + } + + public LongBuffer compact() + { + return this; + } + + public boolean isDirect() + { + return false; + } + + final public long get() + { + long e = backing_buffer[position()]; + position(position()+1); + return e; + } + + final public LongBuffer put(long b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[position()] = b; + position(position()+1); + return this; + } + + final public long get(int index) + { + return backing_buffer[index]; + } + + final public LongBuffer put(int index, long b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[index] = b; + return this; + } + + final public ByteOrder order () + { + return ByteOrder.BIG_ENDIAN; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natByteBufferImpl.cc gcc-3.3/libjava/gnu/java/nio/natByteBufferImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natByteBufferImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natByteBufferImpl.cc 2003-02-13 16:38:19.000000000 +0000 *************** *** 0 **** --- 1,135 ---- + // natByteBufferImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + + JArray* + gnu::java::nio::ByteBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + JArray* + gnu::java::nio::ByteBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + JArray* + gnu::java::nio::ByteBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + JArray* + gnu::java::nio::ByteBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + JArray* + gnu::java::nio::ByteBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + JArray* + gnu::java::nio::ByteBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + JArray* + gnu::java::nio::ByteBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + void + gnu::java::nio::ByteBufferImpl::nio_put_Byte(gnu::java::nio::ByteBufferImpl*, jint, jint, jbyte) + { + } + + void + gnu::java::nio::ByteBufferImpl::nio_put_Char(gnu::java::nio::ByteBufferImpl*, jint, jint, jchar) + { + } + + void + gnu::java::nio::ByteBufferImpl::nio_put_Short(gnu::java::nio::ByteBufferImpl*, jint, jint, jshort) + { + } + + void + gnu::java::nio::ByteBufferImpl::nio_put_Int(gnu::java::nio::ByteBufferImpl*, jint, jint, jint) + { + } + + void + gnu::java::nio::ByteBufferImpl::nio_put_Long(gnu::java::nio::ByteBufferImpl*, jint, jint, jlong) + { + } + + void + gnu::java::nio::ByteBufferImpl::nio_put_Float(gnu::java::nio::ByteBufferImpl*, jint, jint, jfloat) + { + } + + void + gnu::java::nio::ByteBufferImpl::nio_put_Double(gnu::java::nio::ByteBufferImpl*, jint, jint, jdouble) + { + } + + jbyte + gnu::java::nio::ByteBufferImpl::nio_get_Byte(gnu::java::nio::ByteBufferImpl*, jint, jint) + { + return 0; + } + + jchar + gnu::java::nio::ByteBufferImpl::nio_get_Char(gnu::java::nio::ByteBufferImpl*, jint, jint) + { + return ' '; + } + + jshort + gnu::java::nio::ByteBufferImpl::nio_get_Short(gnu::java::nio::ByteBufferImpl*, jint, jint) + { + return 0; + } + + jint + gnu::java::nio::ByteBufferImpl::nio_get_Int(gnu::java::nio::ByteBufferImpl*, jint, jint) + { + return 0; + } + + jlong + gnu::java::nio::ByteBufferImpl::nio_get_Long(gnu::java::nio::ByteBufferImpl*, jint, jint) + { + return 0; + } + + jfloat + gnu::java::nio::ByteBufferImpl::nio_get_Float(gnu::java::nio::ByteBufferImpl*, jint, jint) + { + return 0.0; + } + + jdouble + gnu::java::nio::ByteBufferImpl::nio_get_Double(gnu::java::nio::ByteBufferImpl*, jint, jint) + { + return 0.0; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natCharBufferImpl.cc gcc-3.3/libjava/gnu/java/nio/natCharBufferImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natCharBufferImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natCharBufferImpl.cc 2003-02-13 16:38:19.000000000 +0000 *************** *** 0 **** --- 1,33 ---- + // natCharBufferImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + + JArray* + gnu::java::nio::CharBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + void + gnu::java::nio::CharBufferImpl::nio_put_Byte(gnu::java::nio::CharBufferImpl*, jint, jint, jbyte) + { + } + + jbyte + gnu::java::nio::CharBufferImpl::nio_get_Byte(gnu::java::nio::CharBufferImpl*, jint, jint) + { + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natDoubleBufferImpl.cc gcc-3.3/libjava/gnu/java/nio/natDoubleBufferImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natDoubleBufferImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natDoubleBufferImpl.cc 2003-02-13 16:38:19.000000000 +0000 *************** *** 0 **** --- 1,33 ---- + // natDoubleBufferImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + + JArray* + gnu::java::nio::DoubleBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + void + gnu::java::nio::DoubleBufferImpl::nio_put_Byte(gnu::java::nio::DoubleBufferImpl*, jint, jint, jbyte) + { + } + + jbyte + gnu::java::nio::DoubleBufferImpl::nio_get_Byte(gnu::java::nio::DoubleBufferImpl*, jint, jint) + { + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natFileChannelImpl.cc gcc-3.3/libjava/gnu/java/nio/natFileChannelImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natFileChannelImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natFileChannelImpl.cc 2003-02-13 16:50:39.000000000 +0000 *************** *** 0 **** --- 1,53 ---- + // natFileChannelImpl.cc + + /* Copyright (C) 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + + #include + #include + #include + + #ifdef HAVE_UNISTD_H + #include + #endif + + #ifdef HAVE_FCNTL_H + #include + #endif + + #include + #include + #include + + jlong + gnu::java::nio::FileChannelImpl::lengthInternal (jint fd) + { + throw new ::java::io::IOException (JvNewStringUTF ("lengthInternal not implemented")); + } + + jlong + gnu::java::nio::FileChannelImpl::nio_mmap_file (jint, jlong, jint, jint) + { + throw new ::java::io::IOException (JvNewStringUTF ("mmap not implemented")); + } + + void + gnu::java::nio::FileChannelImpl::nio_unmmap_file (jint, jlong, jint) + { + throw new ::java::io::IOException (JvNewStringUTF ("munmap not implemented")); + } + + void + gnu::java::nio::FileChannelImpl::nio_msync (jint, jlong, jint) + { + throw new ::java::io::IOException (JvNewStringUTF ("msync not implemented")); + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natFloatBufferImpl.cc gcc-3.3/libjava/gnu/java/nio/natFloatBufferImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natFloatBufferImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natFloatBufferImpl.cc 2003-02-13 16:38:19.000000000 +0000 *************** *** 0 **** --- 1,33 ---- + // natFloatBufferImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + + JArray* + gnu::java::nio::FloatBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + void + gnu::java::nio::FloatBufferImpl::nio_put_Byte(gnu::java::nio::FloatBufferImpl*, jint, jint, jbyte) + { + } + + jbyte + gnu::java::nio::FloatBufferImpl::nio_get_Byte(gnu::java::nio::FloatBufferImpl*, jint, jint) + { + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natIntBufferImpl.cc gcc-3.3/libjava/gnu/java/nio/natIntBufferImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natIntBufferImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natIntBufferImpl.cc 2003-02-13 16:38:19.000000000 +0000 *************** *** 0 **** --- 1,33 ---- + // natIntBufferImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + + JArray* + gnu::java::nio::IntBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + void + gnu::java::nio::IntBufferImpl::nio_put_Byte(gnu::java::nio::IntBufferImpl*, jint, jint, jbyte) + { + } + + jbyte + gnu::java::nio::IntBufferImpl::nio_get_Byte(gnu::java::nio::IntBufferImpl*, jint, jint) + { + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natLongBufferImpl.cc gcc-3.3/libjava/gnu/java/nio/natLongBufferImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natLongBufferImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natLongBufferImpl.cc 2003-02-13 16:38:19.000000000 +0000 *************** *** 0 **** --- 1,33 ---- + // natLongBufferImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + + JArray* + gnu::java::nio::LongBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + void + gnu::java::nio::LongBufferImpl::nio_put_Byte(gnu::java::nio::LongBufferImpl*, jint, jint, jbyte) + { + } + + jbyte + gnu::java::nio::LongBufferImpl::nio_get_Byte(gnu::java::nio::LongBufferImpl*, jint, jint) + { + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natSelectorImpl.cc gcc-3.3/libjava/gnu/java/nio/natSelectorImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natSelectorImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natSelectorImpl.cc 2002-11-29 07:56:58.000000000 +0000 *************** *** 0 **** --- 1,126 ---- + // natSelectorImpl.cc + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + #include + + #include + #include + + #if HAVE_BSTRING_H + // Needed for bzero, implicitly used by FD_ZERO on IRIX 5.2 + #include + #endif + + //#include + #include + #include + + void + helper_put_filedescriptors (jintArray java_fd_array, fd_set& fds, int& max_fd) + { + int counter; + jint* java_fds; + + java_fds = elements (java_fd_array); + + for (counter = 0; counter < JvGetArrayLength (java_fd_array); counter++) + { + FD_SET (java_fds [counter], &fds); + + if (java_fds [counter] > max_fd) + { + max_fd = java_fds [counter]; + } + } + } + + void + helper_get_filedescriptors (jintArray& java_fd_array, fd_set fds) + { + int counter; + int counter_fds; + jint* java_fds; + jintArray new_array_fds; + jint* new_data_fds; + + counter_fds = 0; + java_fds = elements (java_fd_array); + + for (counter = 0; counter < JvGetArrayLength (java_fd_array); counter++) + { + if (FD_ISSET (java_fds[counter], &fds)) + { + counter_fds++; + } + } + + new_array_fds = JvNewIntArray (counter_fds); + new_data_fds = elements (new_array_fds); + + for (counter = 0; counter < JvGetArrayLength (java_fd_array); counter++) + { + if (FD_ISSET (java_fds[counter], &fds)) + { + new_data_fds[counter] = java_fds[counter]; + } + } + + java_fd_array = new_array_fds; + } + + jint + gnu::java::nio::SelectorImpl::java_do_select (jintArray read, jintArray write, + jintArray except, jlong timeout) + { + jint result; + int max_fd = 0; + fd_set read_fds; + fd_set write_fds; + fd_set except_fds; + struct timeval real_time_data; + struct timeval *time_data = NULL; + + real_time_data.tv_sec = 0; + real_time_data.tv_usec = timeout; + + // If not legal timeout value is given, use NULL. + // This means an infinite timeout. + if (timeout >= 0) + { + time_data = &real_time_data; + } + + // Reset all fd_set structures + FD_ZERO (&read_fds); + FD_ZERO (&write_fds); + FD_ZERO (&except_fds); + + // Fill the fd_set data structures for the _Jv_select() call. + helper_put_filedescriptors (read, read_fds, max_fd); + helper_put_filedescriptors (write, write_fds, max_fd); + helper_put_filedescriptors (except, except_fds, max_fd); + + // Actually do the select + result = _Jv_select (max_fd + 1, &read_fds, &write_fds, &except_fds, time_data); + + if (result < 0) + { + char* strerr = strerror (errno); + throw new ::java::io::IOException (JvNewStringUTF (strerr)); + } + + // Set the file descriptors according to the values returned from select(). + helper_get_filedescriptors (read, read_fds); + helper_get_filedescriptors (write, write_fds); + helper_get_filedescriptors (except, except_fds); + + return result; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natShortBufferImpl.cc gcc-3.3/libjava/gnu/java/nio/natShortBufferImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natShortBufferImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natShortBufferImpl.cc 2003-02-13 16:38:19.000000000 +0000 *************** *** 0 **** --- 1,33 ---- + // natShortBufferImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + + JArray* + gnu::java::nio::ShortBufferImpl::nio_cast(JArray*) + { + return NULL; + } + + void + gnu::java::nio::ShortBufferImpl::nio_put_Byte(gnu::java::nio::ShortBufferImpl*, jint, jint, jbyte) + { + } + + jbyte + gnu::java::nio::ShortBufferImpl::nio_get_Byte(gnu::java::nio::ShortBufferImpl*, jint, jint) + { + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/natSocketChannelImpl.cc gcc-3.3/libjava/gnu/java/nio/natSocketChannelImpl.cc *** gcc-3.2.3/libjava/gnu/java/nio/natSocketChannelImpl.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/natSocketChannelImpl.cc 2003-04-29 13:58:52.000000000 +0000 *************** *** 0 **** --- 1,178 ---- + // natSocketChannelImpl.cc + + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + #include + + #include + + #include + #include + #include + #include + #include + + + #ifdef DISABLE_JAVA_NET + + jint + gnu::java::nio::SocketChannelImpl::SocketCreate () + { + throw new ::java::io::IOException (JvNewStringUTF ("SocketCreate not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketConnect (jint, + ::java::net::InetAddress *, + jint) + { + throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketBind (jint, ::java::net::InetAddress *, + jint) + { + throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketListen (jint, jint) + { + throw new ::java::io::IOException (JvNewStringUTF ("SocketList not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketAvailable (jint) + { + throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketAvailable: not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketClose (jint) + { + throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketClose: not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketRead (jint, jbyteArray, jint, jint) + { + throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketRead: not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketWrite (jint, jbyteArray, jint, jint) + { + throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketWrite: not implemented")); + } + + #else // DISABLE_JAVA_NET + + jint + gnu::java::nio::SocketChannelImpl::SocketCreate () + { + int sock = _Jv_socket (AF_INET, SOCK_STREAM, 0); + + if (sock < 0) + { + char* strerr = strerror (errno); + throw new ::java::io::IOException (JvNewStringUTF (strerr)); + } + + return sock; + } + + jint + gnu::java::nio::SocketChannelImpl::SocketConnect (jint fd, + ::java::net::InetAddress *addr, + jint port) + { + throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketBind (jint fd, + ::java::net::InetAddress *addr, + jint port) + { + throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketListen (jint fd, jint backlog) + { + int result = _Jv_listen (fd, backlog); + + if (result < 0) + { + char* strerr = strerror (errno); + throw new ::java::io::IOException (JvNewStringUTF (strerr)); + } + + return result; + } + + jint + gnu::java::nio::SocketChannelImpl::SocketAvailable (jint /*fd*/) + { + throw new ::java::net::SocketException (JvNewStringLatin1 ("SocketAvailable: not implemented")); + } + + jint + gnu::java::nio::SocketChannelImpl::SocketClose (jint fd) + { + int result = _Jv_close (fd); + + if (result < 0) + { + char* strerr = strerror (errno); + throw new ::java::io::IOException (JvNewStringUTF (strerr)); + } + + return result; + } + + jint + gnu::java::nio::SocketChannelImpl::SocketRead (jint fd, jbyteArray data, + jint offset, jint length) + { + /* The cast to char* is needed to placate the Win32 API. */ + int result = + ::recv (fd, reinterpret_cast(elements(data)), offset, length); + + if (result < 0) + { + char* strerr = strerror (errno); + throw new ::java::io::IOException (JvNewStringUTF (strerr)); + } + + return result; + } + + jint + gnu::java::nio::SocketChannelImpl::SocketWrite (jint fd, jbyteArray data, + jint offset, jint length) + { + /* The cast to char* is needed to placate the Win32 API. I used char* + instead of const char* because I wasn't sure about the API on all + UNICES. */ + int result = + ::send (fd, reinterpret_cast(elements(data)), offset, length); + + if (result < 0) + { + char* strerr = strerror (errno); + throw new ::java::io::IOException (JvNewStringUTF (strerr)); + } + + return result; + } + + #endif // DISABLE_JAVA_NET diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/PipeImpl.java gcc-3.3/libjava/gnu/java/nio/PipeImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/PipeImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/PipeImpl.java 2002-11-18 13:56:58.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* PipeImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.channels.Pipe; + + class PipeImpl extends Pipe + { + public PipeImpl() + { + } + + public Pipe.SinkChannel sink() + { + return null; + } + + public Pipe.SourceChannel source() + { + return null; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/SelectionKeyImpl.java gcc-3.3/libjava/gnu/java/nio/SelectionKeyImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/SelectionKeyImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/SelectionKeyImpl.java 2002-11-29 09:57:05.000000000 +0000 *************** *** 0 **** --- 1,91 ---- + /* SelectionKeyImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.channels.SelectableChannel; + import java.nio.channels.SelectionKey; + import java.nio.channels.Selector; + import java.nio.channels.spi.AbstractSelectionKey; + + public class SelectionKeyImpl extends AbstractSelectionKey + { + int fd; + int readyOps; + int interestOps; + SelectorImpl impl; + SelectableChannel ch; + + public SelectionKeyImpl(SelectableChannel ch, SelectorImpl impl, int fd) + { + this.ch = ch; + this.impl = impl; + this.fd = fd; + } + + public SelectableChannel channel () + { + return ch; + } + + public int readyOps () + { + return readyOps; + } + + public SelectionKey readyOps (int ops) + { + readyOps = ops; + return this; + } + + public int interestOps () + { + return interestOps; + } + + public SelectionKey interestOps (int ops) + { + interestOps = ops; + return this; + } + + public Selector selector () + { + return impl; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/SelectorImpl.java gcc-3.3/libjava/gnu/java/nio/SelectorImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/SelectorImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/SelectorImpl.java 2002-11-29 09:57:05.000000000 +0000 *************** *** 0 **** --- 1,299 ---- + /* SelectorImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.channels.ClosedSelectorException; + import java.nio.channels.SelectableChannel; + import java.nio.channels.SelectionKey; + import java.nio.channels.Selector; + import java.nio.channels.spi.AbstractSelectableChannel; + import java.nio.channels.spi.AbstractSelector; + import java.nio.channels.spi.SelectorProvider; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Set; + + public class SelectorImpl extends AbstractSelector + { + boolean closed = false; + Set keys, selected, canceled; + + public SelectorImpl (SelectorProvider provider) + { + super (provider); + + keys = new HashSet (); + selected = new HashSet (); + canceled = new HashSet (); + } + + public Set keys () + { + return keys; + } + + public int selectNow () + { + return select (1); + } + + public int select () + { + return select (-1); + } + + // A timeout value of -1 means block forever. + private static native int java_do_select (int[] read, int[] write, + int[] except, long timeout); + + private int[] getFDsAsArray (int ops) + { + int[] result; + int counter = 0; + Iterator it = keys.iterator (); + + // Count the number of file descriptors needed + while (it.hasNext ()) + { + SelectionKeyImpl key = (SelectionKeyImpl) it.next (); + + if ((key.interestOps () & ops) != 0) + { + counter++; + } + } + + result = new int[counter]; + + counter = 0; + it = keys.iterator (); + + // Fill the array with the file descriptors + while (it.hasNext ()) + { + SelectionKeyImpl key = (SelectionKeyImpl) it.next (); + + if ((key.interestOps () & ops) != 0) + { + result[counter] = key.fd; + counter++; + } + } + + return result; + } + + public int select (long timeout) + { + if (closed) + { + throw new ClosedSelectorException (); + } + + if (keys == null) + { + return 0; + } + + int ret = 0; + + deregisterCanceledKeys (); + + // Set only keys with the needed interest ops into the arrays. + int[] read = getFDsAsArray (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT); + int[] write = getFDsAsArray (SelectionKey.OP_WRITE | SelectionKey.OP_CONNECT); + int[] except = new int [0]; // FIXME: We dont need to check this yet + + // Call the native select () on all file descriptors. + int anzahl = read.length + write.length + except.length; + ret = java_do_select (read, write, except, timeout); + + Iterator it = keys.iterator (); + + while (it.hasNext ()) + { + int ops = 0; + SelectionKeyImpl key = (SelectionKeyImpl) it.next (); + + // If key is already selected retrieve old ready ops. + if (selected.contains (key)) + { + ops = key.readyOps (); + } + + // Set new ready read/accept ops + for (int i = 0; i < read.length; i++) + { + if (key.fd == read[i]) + { + if (key.channel () instanceof ServerSocketChannelImpl) + { + ops = ops | SelectionKey.OP_ACCEPT; + } + else + { + ops = ops | SelectionKey.OP_READ; + } + } + } + + // Set new ready write ops + for (int i = 0; i < write.length; i++) + { + if (key.fd == write[i]) + { + ops = ops | SelectionKey.OP_WRITE; + + // if (key.channel ().isConnected ()) + // { + // ops = ops | SelectionKey.OP_WRITE; + // } + // else + // { + // ops = ops | SelectionKey.OP_CONNECT; + // } + } + } + + // FIXME: We dont handle exceptional file descriptors yet. + + // If key is not yet selected add it. + if (!selected.contains (key)) + { + add_selected (key); + } + + // Set new ready ops + key.readyOps (key.interestOps () & ops); + } + + deregisterCanceledKeys (); + return ret; + } + + public Set selectedKeys () + { + return selected; + } + + public Selector wakeup () + { + return null; + } + + public void add (SelectionKeyImpl k) + { + keys.add (k); + } + + void add_selected (SelectionKeyImpl k) + { + selected.add (k); + } + + protected void implCloseSelector () + { + closed = true; + } + + private void deregisterCanceledKeys () + { + Iterator it = canceled.iterator (); + + while (it.hasNext ()) + { + keys.remove ((SelectionKeyImpl) it.next ()); + it.remove (); + } + } + + protected SelectionKey register (SelectableChannel ch, int ops, Object att) + { + return register ((AbstractSelectableChannel) ch, ops, att); + } + + protected SelectionKey register (AbstractSelectableChannel ch, int ops, + Object att) + { + // // filechannel is not selectable ? + // if (ch instanceof FileChannelImpl) + // { + // FileChannelImpl fc = (FileChannelImpl) ch; + // SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, fc.fd); + // keys.add (impl); + // impl.interestOps (ops); + // impl.attach (att); + // return impl; + // } + // else + + if (ch instanceof SocketChannelImpl) + { + SocketChannelImpl sc = (SocketChannelImpl) ch; + SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, sc.fd); + add (impl); + impl.interestOps (ops); + impl.attach (att); + return impl; + } + else if (ch instanceof DatagramChannelImpl) + { + DatagramChannelImpl dc = (DatagramChannelImpl) ch; + SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, dc.fd); + add (impl); + impl.interestOps (ops); + impl.attach (att); + return impl; + } + else if (ch instanceof ServerSocketChannelImpl) + { + ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch; + SelectionKeyImpl impl = new SelectionKeyImpl (ch, this, ssc.fd); + add (impl); + impl.interestOps (ops); + impl.attach (att); + return impl; + } + else + { + System.err.println ("INTERNAL ERROR, no known channel type"); + } + + return null; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/SelectorProviderImpl.java gcc-3.3/libjava/gnu/java/nio/SelectorProviderImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/SelectorProviderImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/SelectorProviderImpl.java 2003-02-11 22:00:57.000000000 +0000 *************** *** 0 **** --- 1,83 ---- + /* SelectorProviderImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.io.IOException; + import java.nio.channels.DatagramChannel; + import java.nio.channels.Pipe; + import java.nio.channels.ServerSocketChannel; + import java.nio.channels.SocketChannel; + import java.nio.channels.spi.SelectorProvider; + import java.nio.channels.spi.AbstractSelector; + + public class SelectorProviderImpl extends SelectorProvider + { + public SelectorProviderImpl () + { + } + + public DatagramChannel openDatagramChannel () + throws IOException + { + return new DatagramChannelImpl (this); + } + + public Pipe openPipe () + throws IOException + { + return new PipeImpl (); + } + + public AbstractSelector openSelector () + throws IOException + { + return new SelectorImpl (this); + } + + public ServerSocketChannel openServerSocketChannel () + throws IOException + { + return new ServerSocketChannelImpl (this); + } + + public SocketChannel openSocketChannel () + throws IOException + { + return new SocketChannelImpl (this); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/ServerSocketChannelImpl.java gcc-3.3/libjava/gnu/java/nio/ServerSocketChannelImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/ServerSocketChannelImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/ServerSocketChannelImpl.java 2003-02-14 19:40:36.000000000 +0000 *************** *** 0 **** --- 1,111 ---- + /* ServerSocketChannelImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.io.IOException; + import java.net.InetSocketAddress; + import java.net.ServerSocket; + import java.net.SocketAddress; + import java.nio.channels.ServerSocketChannel; + import java.nio.channels.SocketChannel; + import java.nio.channels.spi.SelectorProvider; + + class ServerSocketChannelImpl extends ServerSocketChannel + { + ServerSocket sock_object; + int fd; + // int local_port; + boolean blocking = true; + boolean connected = false; + // InetSocketAddress sa; + + protected ServerSocketChannelImpl (SelectorProvider provider) + throws IOException + { + super (provider); + fd = SocketChannelImpl.SocketCreate (); + + try + { + sock_object = new ServerSocket (); + } + catch (IOException e) + { + System.err.println ("ServerSocket could not be created."); + } + } + + public void finalizer() + { + if (connected) + { + try + { + close(); + } + catch (Exception e) + { + } + } + } + + protected void implCloseSelectableChannel () throws IOException + { + connected = false; + SocketChannelImpl.SocketClose (fd); + fd = SocketChannelImpl.SocketCreate (); + } + + protected void implConfigureBlocking (boolean block) throws IOException + { + blocking = block; + } + + public SocketChannel accept () + { + SocketChannelImpl result = new SocketChannelImpl (provider ()); + result.sa = new InetSocketAddress (0); + //int res = SocketAccept (this,result); + return result; + } + + public ServerSocket socket () + { + return sock_object; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/ShortBufferImpl.java gcc-3.3/libjava/gnu/java/nio/ShortBufferImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/ShortBufferImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/ShortBufferImpl.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,160 ---- + /* ShortBufferImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.nio.ShortBuffer; + import java.nio.ReadOnlyBufferException; + + /** + * This is a Heap memory implementation + */ + public final class ShortBufferImpl extends ShortBuffer + { + private boolean readOnly; + + public ShortBufferImpl(int cap, int off, int lim) + { + super (cap, lim, off, 0); + this.backing_buffer = new short [cap]; + readOnly = false; + } + + public ShortBufferImpl(short[] array, int offset, int length) + { + super (array.length, length, offset, 0); + this.backing_buffer = array; + readOnly = false; + } + + public ShortBufferImpl(ShortBufferImpl copy) + { + super (copy.capacity (), copy.limit (), copy.position (), 0); + backing_buffer = copy.backing_buffer; + readOnly = copy.isReadOnly (); + } + + private static native short[] nio_cast (byte[] copy); + + ShortBufferImpl (byte[] copy) + { + super (copy.length, copy.length, 0, 0); + this.backing_buffer = copy != null ? nio_cast (copy) : null; + readOnly = false; + } + + private static native byte nio_get_Byte (ShortBufferImpl b, int index, int limit); + + private static native void nio_put_Byte (ShortBufferImpl b, int index, int limit, byte value); + + public ByteBuffer asByteBuffer () + { + ByteBufferImpl res = new ByteBufferImpl (backing_buffer); + res.limit ((limit () * 1) / 2); + return res; + } + + public boolean isReadOnly() + { + return readOnly; + } + + public ShortBuffer slice() + { + return new ShortBufferImpl (this); + } + + public ShortBuffer duplicate() + { + return new ShortBufferImpl(this); + } + + public ShortBuffer asReadOnlyBuffer() + { + ShortBufferImpl result = new ShortBufferImpl (this); + result.readOnly = true; + return result; + } + + public ShortBuffer compact() + { + return this; + } + + public boolean isDirect() + { + return false; + } + + final public short get() + { + short e = backing_buffer[position()]; + position(position()+1); + return e; + } + + final public ShortBuffer put(short b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[position()] = b; + position(position()+1); + return this; + } + + final public short get(int index) + { + return backing_buffer[index]; + } + + final public ShortBuffer put(int index, short b) + { + if (readOnly) + throw new ReadOnlyBufferException (); + + backing_buffer[index] = b; + return this; + } + + final public ByteOrder order () + { + return ByteOrder.BIG_ENDIAN; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/nio/SocketChannelImpl.java gcc-3.3/libjava/gnu/java/nio/SocketChannelImpl.java *** gcc-3.2.3/libjava/gnu/java/nio/SocketChannelImpl.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/nio/SocketChannelImpl.java 2002-11-29 09:57:05.000000000 +0000 *************** *** 0 **** --- 1,223 ---- + /* SocketChannelImpl.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.nio; + + import java.io.IOException; + import java.net.InetAddress; + import java.net.InetSocketAddress; + import java.net.Socket; + import java.net.SocketAddress; + import java.nio.ByteBuffer; + import java.nio.channels.AlreadyConnectedException; + import java.nio.channels.SocketChannel; + import java.nio.channels.spi.SelectorProvider; + import gnu.classpath.Configuration; + + public class SocketChannelImpl extends SocketChannel + { + Socket sock_object; + int fd; + int local_port; + boolean blocking = true; + boolean connected = false; + InetSocketAddress sa; + + static native int SocketCreate(); + static native int SocketConnect(int fd, InetAddress addr, int port); + static native int SocketBind(int fd, InetAddress addr, int port); + static native int SocketListen(int fd, int backlog); + static native int SocketAvailable(int fd); + static native int SocketClose(int fd); + static native int SocketRead(int fd, byte b[], int off, int len); + static native int SocketWrite(int fd, byte b[], int off, int len); + + public SocketChannelImpl(SelectorProvider provider) + { + super(provider); + fd = SocketCreate(); + + if (fd == -1) + { + System.err.println("failed to create socket:"+fd); + } + } + + public void finalizer() + { + if (connected) + { + try + { + close(); + } + catch (Exception e) + { + } + } + } + + protected void implCloseSelectableChannel() + { + connected = false; + SocketClose(fd); + fd = SocketCreate(); + } + + protected void implConfigureBlocking(boolean block) + { + if (blocking == block) + return; + } + + public boolean connect(SocketAddress remote) + throws IOException + { + if (connected) + { + throw new AlreadyConnectedException(); + } + + // ok, lets connect ! + + sa = (InetSocketAddress) remote; + + InetAddress addr = sa.getAddress(); + int port = sa.getPort(); + int err = SocketConnect(fd, addr, port); + + if (err < 0) + { + throw new IOException("Connection refused:"+err + ", connect="+err); + } + + local_port = err; + connected = true; + return blocking; + } + + public boolean finishConnect() + { + return false; + } + + public boolean isConnected() + { + return connected; + } + + public boolean isConnectionPending() + { + if (blocking) + return true; + + return false; + } + + public Socket socket() + { + if (sock_object != null) + { + //sock_object.ch = this; + } + + return sock_object; + } + + public int read(ByteBuffer dst) + { + int bytes = 0; + int len = 1024; + byte[]b = new byte[len]; + + bytes = SocketRead(fd, b, 0, len); + dst.put(b, 0, bytes); + + if (bytes == 0) + { + // we've hit eof ? + return -1; + } + + return bytes; + } + + public long read(ByteBuffer[] dsts, int offset, int length) + { + long bytes = 0; + + for (int i=offset; i expireTime) ! return true; ! return false; ! } ! ! } //End of LeaseRecord ! ! } //End of DGCImpl diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java gcc-3.3/libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java *** gcc-3.2.3/libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java 2001-08-28 00:03:20.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/dgc/DGCImpl_Skel.java 2002-10-01 03:46:41.000000000 +0000 *************** *** 1,3 **** --- 1,41 ---- + /* DGCImpl_Skel.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + // Skel class generated by rmic - DO NOT EDIT! package gnu.java.rmi.dgc; diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java gcc-3.3/libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java *** gcc-3.2.3/libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java 2001-08-28 00:03:20.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/dgc/DGCImpl_Stub.java 2002-10-01 03:46:41.000000000 +0000 *************** *** 1,3 **** --- 1,41 ---- + /* DGCImpl_Stub.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + // Stub class generated by rmic - DO NOT EDIT! package gnu.java.rmi.dgc; diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/registry/RegistryImpl.java gcc-3.3/libjava/gnu/java/rmi/registry/RegistryImpl.java *** gcc-3.2.3/libjava/gnu/java/rmi/registry/RegistryImpl.java 2002-03-25 22:15:18.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/registry/RegistryImpl.java 2002-11-07 18:01:05.000000000 +0000 *************** public RegistryImpl(int port) throws Rem *** 64,70 **** public RegistryImpl(int port, RMIClientSocketFactory cf, RMIServerSocketFactory sf) throws RemoteException { super(new UnicastServerRef(new ObjID(ObjID.REGISTRY_ID), port, sf)); ! ((UnicastServerRef)getRef()).exportObject(this); } public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException { --- 64,71 ---- public RegistryImpl(int port, RMIClientSocketFactory cf, RMIServerSocketFactory sf) throws RemoteException { super(new UnicastServerRef(new ObjID(ObjID.REGISTRY_ID), port, sf)); ! // The following is unnecessary, because UnicastRemoteObject export itself automatically. ! //((UnicastServerRef)getRef()).exportObject(this); } public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException { diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java gcc-3.3/libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java *** gcc-3.2.3/libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java 2001-08-28 00:03:22.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/registry/RegistryImpl_Skel.java 2002-10-01 03:46:41.000000000 +0000 *************** *** 1,3 **** --- 1,41 ---- + /* RegistryImpl_Skel.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + // Skel class generated by rmic - DO NOT EDIT! package gnu.java.rmi.registry; diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java gcc-3.3/libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java *** gcc-3.2.3/libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java 2001-08-28 00:03:22.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/registry/RegistryImpl_Stub.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 1,3 **** --- 1,41 ---- + /* RegistryImpl_Stub.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + // Stub class generated by rmic - DO NOT EDIT! package gnu.java.rmi.registry; *************** public final class RegistryImpl_Stub *** 29,35 **** static { try { java.rmi.server.RemoteRef.class.getMethod("invoke", new java.lang.Class[] { java.rmi.Remote.class, java.lang.reflect.Method.class, java.lang.Object[].class, long.class }); ! useNewInvoke = true; $method_bind_0 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("bind", new java.lang.Class[] {java.lang.String.class, java.rmi.Remote.class}); $method_list_1 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("list", new java.lang.Class[] {}); $method_lookup_2 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("lookup", new java.lang.Class[] {java.lang.String.class}); --- 67,73 ---- static { try { java.rmi.server.RemoteRef.class.getMethod("invoke", new java.lang.Class[] { java.rmi.Remote.class, java.lang.reflect.Method.class, java.lang.Object[].class, long.class }); ! useNewInvoke = false; $method_bind_0 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("bind", new java.lang.Class[] {java.lang.String.class, java.rmi.Remote.class}); $method_list_1 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("list", new java.lang.Class[] {}); $method_lookup_2 = gnu.java.rmi.registry.RegistryImpl.class.getMethod("lookup", new java.lang.Class[] {java.lang.String.class}); diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java gcc-3.3/libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java *** gcc-3.2.3/libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/RMIMarshalledObjectInputStream.java 2002-10-01 03:46:41.000000000 +0000 *************** *** 0 **** --- 1,70 ---- + /* gnu.java.rmi.RMIMarshalledObjectInputStream + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.rmi; + + import gnu.java.rmi.server.RMIObjectInputStream; + import java.io.ObjectInputStream; + import java.io.IOException; + import java.io.ByteArrayInputStream; + + /** + * This class is only for java.rmi.MarshalledObject to deserialize object from + * objBytes and locBytes + */ + + public class RMIMarshalledObjectInputStream extends RMIObjectInputStream + { + private ObjectInputStream locStream; + + public RMIMarshalledObjectInputStream(byte[] objBytes, byte[] locBytes) throws IOException + { + super(new ByteArrayInputStream(objBytes)); + if(locBytes != null) + locStream = new ObjectInputStream(new ByteArrayInputStream(locBytes)); + } + + //This method overrides RMIObjectInputStream's + protected Object getAnnotation() throws IOException, ClassNotFoundException + { + if(locStream == null) + return null; + return locStream.readObject(); + } + + } // End of RMIMarshalledObjectInputStream diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java gcc-3.3/libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java *** gcc-3.2.3/libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/RMIMarshalledObjectOutputStream.java 2002-11-07 18:01:04.000000000 +0000 *************** *** 0 **** --- 1,83 ---- + /* gnu.java.rmi.RMIMarshalledObjectOutputStream + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.rmi; + + import java.io.OutputStream; + import java.io.ObjectOutputStream; + import java.io.ByteArrayOutputStream; + import java.io.IOException; + import java.rmi.Remote; + import java.rmi.server.ObjID; + import java.rmi.server.RemoteStub; + + import gnu.java.rmi.server.RMIObjectOutputStream; + import gnu.java.rmi.server.UnicastServerRef; + + /** + * This class is only for java.rmi.MarshalledObject to serialize object and + * got objBytes and locBytes + */ + public class RMIMarshalledObjectOutputStream extends RMIObjectOutputStream + { + private ObjectOutputStream locStream; + private ByteArrayOutputStream locBytesStream; + + public RMIMarshalledObjectOutputStream(OutputStream objStream) throws IOException + { + super(objStream); + locBytesStream = new ByteArrayOutputStream(256); + locStream = new ObjectOutputStream(locBytesStream); + } + + //This method overrides RMIObjectOutputStream's. + protected void setAnnotation(String annotation) throws IOException{ + locStream.writeObject(annotation); + } + + public void flush() throws IOException { + super.flush(); + locStream.flush(); + } + + public byte[] getLocBytes(){ + return locBytesStream.toByteArray(); + } + + } // End of RMIMarshalledObjectOutputStream + diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java gcc-3.3/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 0 **** --- 1,155 ---- + /* gnu.java.rmi.server.ConnectionRunnerPool + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.rmi.server; + + import java.util.ArrayList; + import java.util.Arrays; + + //Should I generalize this class? + + class ConnectionRunnerPool + { + + public static + class ConnectionRunner extends Thread{ + private UnicastConnection conn; + private volatile boolean exiting = false; + + public ConnectionRunner(ThreadGroup group, String id){ + super(group, id); + } + + public synchronized void run(){ + while(!exiting){ + if(conn == null) + try{ + wait(); + }catch(InterruptedException e){ + continue; + } + else{ + conn.run(); + conn = null; + synchronized(ConnectionRunnerPool.class){ + freelist.add(this); + if(freelist.size() == 1) + ConnectionRunnerPool.class.notifyAll(); + } + } + } + } + + public synchronized void dispatch(UnicastConnection conn){ + this.conn = conn; + notify(); + } + + void exit(){ + exiting = true; + if(conn != null) + try{ + join(500); + }catch(InterruptedException e){} + interrupt(); + } + + } + + // Should this value equal to number of CPU? + private static int size = 5; + private static int max_size = 10; + + private static ArrayList freelist; + + private static ThreadGroup group = new ThreadGroup("pool"); + + static { + ConnectionRunner[] pools = new ConnectionRunner[size]; + for(int i = 0; i < pools.length; i++){ + pools[i] = new ConnectionRunner(group, new Integer(i).toString()); + pools[i].setContextClassLoader(Thread.currentThread().getContextClassLoader()); + pools[i].start(); + } + freelist = new ArrayList(Arrays.asList(pools)); + } + + public static void setSize(int size_){ + size = size_; + } + + public static void setMaxSize(int size){ + max_size = size; + } + + private synchronized static ConnectionRunner getConnectionRunner() + { + if(freelist.size() == 0){ + if(size < max_size){ + ++size; + ConnectionRunner a = new ConnectionRunner(group, new Integer(size).toString()); + a.start(); + freelist.add(a); + }else + while(freelist.size() == 0) + try{ + ConnectionRunnerPool.class.wait(); + }catch(InterruptedException e){} + } + + // always let the first in pool most busy or other scheduling plan?? + ConnectionRunner a = (ConnectionRunner)freelist.get(0); + freelist.remove(a); + return a; + } + + public static void dispatchConnection(UnicastConnection conn) + { + ConnectionRunner r = getConnectionRunner(); + r.dispatch(conn); + } + + public static void exit() + { + Thread[] list = new Thread[group.activeCount()]; + group.enumerate(list); + for(int i = 0; i < list.length; i++) + ((ConnectionRunner)list[i]).exit(); + } + + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/RMIHashes.java gcc-3.3/libjava/gnu/java/rmi/server/RMIHashes.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/RMIHashes.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/RMIHashes.java 2002-10-01 03:46:42.000000000 +0000 *************** package gnu.java.rmi.server; *** 39,51 **** import java.lang.reflect.Method; import java.lang.Class; ! import gnu.java.security.provider.SHA; public class RMIHashes { public static long getMethodHash(Method meth) { ! return meth.hashCode (); } public static long getInterfaceHash(Class clazz) --- 39,94 ---- import java.lang.reflect.Method; import java.lang.Class; ! import gnu.java.io.NullOutputStream; ! import gnu.java.lang.reflect.TypeSignature; ! import java.security.MessageDigest; ! import java.security.DigestOutputStream; ! import java.io.DataOutputStream; ! import java.io.ByteArrayOutputStream; public class RMIHashes { + //There're other places using DigestOutputStream to generate hash in classpath, but I think the way I used + //here is more efficient, anyway, you can switch to DigestOutputStream by doing like "//or:" comments say. + + //or:add this statement: private static final NullOutputStream nullOutputStream = new NullOutputStream (); public static long getMethodHash(Method meth) { ! //Object Serialization Spec 8.3 ! try ! { ! MessageDigest md = MessageDigest.getInstance ("SHA"); ! //or:remove this statement: DigestOutputStream digest_out = new DigestOutputStream (nullOutputStream, md); ! ByteArrayOutputStream digest_out = new ByteArrayOutputStream(); ! DataOutputStream data_out = new DataOutputStream (digest_out); ! ! StringBuffer sbuf = new StringBuffer(); ! sbuf.append(meth.getName()); ! sbuf.append('('); ! Class params[] = meth.getParameterTypes(); ! for(int i = 0; i < params.length; i++) ! sbuf.append(TypeSignature.getEncodingOfClass(params[i])); ! sbuf.append(')'); ! Class rcls = meth.getReturnType(); ! if(rcls != Void.TYPE) ! sbuf.append(TypeSignature.getEncodingOfClass(rcls)); ! else ! sbuf.append('V'); ! ! data_out.writeUTF (sbuf.toString()); ! data_out.flush(); ! data_out.close (); ! ! md.update(digest_out.toByteArray()); //or:remove this statement ! byte[] sha = md.digest (); ! long result = 0; ! int len = sha.length < 8 ? sha.length : 8; ! for (int i=0; i < len; i++) ! result += (long)(sha[i] & 0xFF) << (8 * i); ! return result; ! }catch(Exception _){ ! return -1L; ! } } public static long getInterfaceHash(Class clazz) *************** public class RMIHashes *** 53,55 **** --- 96,99 ---- return clazz.hashCode (); } } + diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/RMIObjectInputStream.java gcc-3.3/libjava/gnu/java/rmi/server/RMIObjectInputStream.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/RMIObjectInputStream.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/RMIObjectInputStream.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.IOException; *** 44,75 **** import java.net.URL; import java.net.MalformedURLException; import java.rmi.server.RMIClassLoader; public class RMIObjectInputStream extends ObjectInputStream { ! UnicastConnectionManager manager; ! ! public RMIObjectInputStream(InputStream strm, UnicastConnectionManager man) throws IOException { super(strm); - manager = man; enableResolveObject(true); } protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { ! //System.out.println("Resolving class: " + desc.getName()); ! String annotation = (String)readObject(); ! if (annotation == null) { ! return (super.resolveClass(desc)); } ! else { ! try { ! return (RMIClassLoader.loadClass(new URL(annotation), desc.getName())); ! } ! catch (MalformedURLException _) { ! throw new ClassNotFoundException(desc.getName()); ! } } } } --- 44,126 ---- import java.net.URL; import java.net.MalformedURLException; import java.rmi.server.RMIClassLoader; + import java.lang.ClassNotFoundException; + import java.lang.reflect.Proxy; public class RMIObjectInputStream extends ObjectInputStream { ! public RMIObjectInputStream(InputStream strm) throws IOException { super(strm); enableResolveObject(true); } protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { ! String annotation = (String)getAnnotation(); ! ! try { ! if(annotation == null) ! return (RMIClassLoader.loadClass(desc.getName())); ! else ! return (RMIClassLoader.loadClass(annotation, desc.getName())); } ! catch (MalformedURLException _) { ! throw new ClassNotFoundException(desc.getName()); } } + //Separate it for override by MarshalledObject + protected Object getAnnotation() + throws IOException, ClassNotFoundException + { + return readObject(); + } + + protected Class resolveProxyClass(String intfs[]) + throws IOException, ClassNotFoundException + { + String annotation = (String)getAnnotation(); + + Class clss[] = new Class[intfs.length]; + if(annotation == null) + clss[0] = RMIClassLoader.loadClass(intfs[0]); + else + clss[0] = RMIClassLoader.loadClass(annotation, intfs[0]); + + //assume all interfaces can be loaded by the same classloader + ClassLoader loader = clss[0].getClassLoader(); + for (int i = 0; i < intfs.length; i++) + clss[i] = Class.forName(intfs[i], false, loader); + + try { + return Proxy.getProxyClass(loader, clss); + } catch (IllegalArgumentException e) { + throw new ClassNotFoundException(null, e); + } + } + + protected Object readValue(Class valueClass) throws IOException, ClassNotFoundException { + if(valueClass.isPrimitive()){ + if(valueClass == Boolean.TYPE) + return new Boolean(readBoolean()); + if(valueClass == Byte.TYPE) + return new Byte(readByte()); + if(valueClass == Character.TYPE) + return new Character(readChar()); + if(valueClass == Short.TYPE) + return new Short(readShort()); + if(valueClass == Integer.TYPE) + return new Integer(readInt()); + if(valueClass == Long.TYPE) + return new Long(readLong()); + if(valueClass == Float.TYPE) + return new Float(readFloat()); + if(valueClass == Double.TYPE) + return new Double(readDouble()); + else + throw new Error("Unsupported primitive class: " + valueClass); + } else + return readObject(); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/RMIObjectOutputStream.java gcc-3.3/libjava/gnu/java/rmi/server/RMIObjectOutputStream.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/RMIObjectOutputStream.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/RMIObjectOutputStream.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.ObjectOutputStream; *** 41,57 **** import java.io.OutputStream; import java.io.IOException; import java.rmi.server.RMIClassLoader; public class RMIObjectOutputStream extends ObjectOutputStream { public RMIObjectOutputStream(OutputStream strm) throws IOException { super(strm); } protected void annotateClass(Class cls) throws IOException { ! //System.out.println("Annotating class: " + cls); ! writeObject(RMIClassLoader.getClassAnnotation(cls)); } } --- 41,113 ---- import java.io.OutputStream; import java.io.IOException; import java.rmi.server.RMIClassLoader; + import java.rmi.Remote; + import java.rmi.server.RemoteStub; + import java.rmi.server.ObjID; public class RMIObjectOutputStream extends ObjectOutputStream { public RMIObjectOutputStream(OutputStream strm) throws IOException { super(strm); + enableReplaceObject(true); + } + + //Separate it for override by MarshalledObject + protected void setAnnotation(String annotation) throws IOException{ + writeObject(annotation); } protected void annotateClass(Class cls) throws IOException { ! setAnnotation(RMIClassLoader.getClassAnnotation(cls)); ! } ! ! protected void annotateProxyClass(Class cls) ! throws IOException ! { ! annotateClass(cls); ! } ! ! protected Object replaceObject(Object obj) ! throws IOException ! { ! if((obj instanceof Remote) && !(obj instanceof RemoteStub)){ ! UnicastServerRef ref = UnicastServer.getExportedRef((Remote)obj); ! if (ref != null) ! return ref.getStub(); ! } ! return obj; ! } ! ! protected void writeValue(Object value, Class valueClass) throws IOException{ ! if(valueClass.isPrimitive()){ ! if(valueClass == Boolean.TYPE) ! writeBoolean(((Boolean)value).booleanValue()); ! else ! if(valueClass == Byte.TYPE) ! writeByte(((Byte)value).byteValue()); ! else ! if(valueClass == Character.TYPE) ! writeChar(((Character)value).charValue()); ! else ! if(valueClass == Short.TYPE) ! writeShort(((Short)value).shortValue()); ! else ! if(valueClass == Integer.TYPE) ! writeInt(((Integer)value).intValue()); ! else ! if(valueClass == Long.TYPE) ! writeLong(((Long)value).longValue()); ! else ! if(valueClass == Float.TYPE) ! writeFloat(((Float)value).floatValue()); ! else ! if(valueClass == Double.TYPE) ! writeDouble(((Double)value).doubleValue()); ! else ! throw new Error("Unsupported primitive class: " + valueClass); ! } else ! writeObject(value); } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastConnection.java gcc-3.3/libjava/gnu/java/rmi/server/UnicastConnection.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastConnection.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/UnicastConnection.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.DataInputStream; *** 44,49 **** --- 44,51 ---- import java.io.DataOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; + import java.io.BufferedInputStream; + import java.io.BufferedOutputStream; import java.io.ObjectOutput; import java.io.ObjectInput; import java.io.IOException; *************** DataOutputStream dout; *** 59,73 **** ObjectInputStream oin; ObjectOutputStream oout; UnicastConnection(UnicastConnectionManager man, Socket sock) { this.manager = man; this.sock = sock; } void acceptConnection() throws IOException { ! //System.out.println("Accepting connection on " + lport); ! din = new DataInputStream(sock.getInputStream()); ! dout = new DataOutputStream(sock.getOutputStream()); int sig = din.readInt(); if (sig != PROTOCOL_HEADER) { --- 61,80 ---- ObjectInputStream oin; ObjectOutputStream oout; + // reviveTime and expireTime make UnicastConnection pool-able + long reviveTime = 0; + long expireTime = Long.MAX_VALUE; + UnicastConnection(UnicastConnectionManager man, Socket sock) { this.manager = man; this.sock = sock; } void acceptConnection() throws IOException { ! //System.out.println("Accepting connection on " + sock); ! //Use BufferedXXXStream would be more efficient ! din = new DataInputStream(new BufferedInputStream(sock.getInputStream())); ! dout = new DataOutputStream(new BufferedOutputStream(sock.getOutputStream())); int sig = din.readInt(); if (sig != PROTOCOL_HEADER) { *************** void acceptConnection() throws IOExcepti *** 85,90 **** --- 92,98 ---- // Send my hostname and port dout.writeUTF(manager.serverName); dout.writeInt(manager.serverPort); + dout.flush(); // Read their hostname and port String rhost = din.readUTF(); *************** void acceptConnection() throws IOExcepti *** 94,108 **** } void makeConnection(int protocol) throws IOException { ! dout = new DataOutputStream(sock.getOutputStream()); ! din = new DataInputStream(sock.getInputStream()); // Send header dout.writeInt(PROTOCOL_HEADER); dout.writeShort(PROTOCOL_VERSION); dout.writeByte(protocol); ! dout.flush(); ! if (protocol != SINGLE_OP_PROTOCOL) { // Get back ack. int ack = din.readUnsignedByte(); --- 102,117 ---- } void makeConnection(int protocol) throws IOException { ! //Use BufferedXXXStream would be more efficient ! din = new DataInputStream(new BufferedInputStream(sock.getInputStream())); ! dout = new DataOutputStream(new BufferedOutputStream(sock.getOutputStream())); // Send header dout.writeInt(PROTOCOL_HEADER); dout.writeShort(PROTOCOL_VERSION); dout.writeByte(protocol); ! dout.flush(); ! if (protocol != SINGLE_OP_PROTOCOL) { // Get back ack. int ack = din.readUnsignedByte(); *************** void makeConnection(int protocol) throws *** 117,122 **** --- 126,132 ---- // Send them my endpoint dout.writeUTF(manager.serverName); dout.writeInt(manager.serverPort); + dout.flush(); } // Okay, ready to roll ... } *************** DataOutputStream getDataOutputStream() t *** 131,137 **** ObjectInputStream getObjectInputStream() throws IOException { if (oin == null) { ! oin = new RMIObjectInputStream(din, manager); } return (oin); } --- 141,147 ---- ObjectInputStream getObjectInputStream() throws IOException { if (oin == null) { ! oin = new RMIObjectInputStream(din); } return (oin); } *************** ObjectOutputStream getObjectOutputStream *** 144,172 **** } void disconnect() { - oin = null; - oout = null; try { ! sock.close(); } catch (IOException _) { ! } din = null; dout = null; sock = null; } /** * We run connects on the server. Dispatch it then discard it. */ public void run() { try { UnicastServer.dispatch(this); manager.discardConnection(this); } ! catch (Exception e) { ! e.printStackTrace(); ! } } } --- 154,203 ---- } void disconnect() { try { ! if(oout != null) ! oout.close(); ! sock.close(); } catch (IOException _) { ! } ! ! oin = null; ! oout = null; din = null; dout = null; sock = null; } + public static final long CONNECTION_TIMEOUT = 10000L; + + static boolean isExpired(UnicastConnection conn, long l){ + if (l <= conn.expireTime ) + return false; + return true; + } + + static void resetTime(UnicastConnection conn){ + long l = System.currentTimeMillis(); + conn.reviveTime = l; + conn.expireTime = l + CONNECTION_TIMEOUT; + } + /** * We run connects on the server. Dispatch it then discard it. */ public void run() { + do{ try { UnicastServer.dispatch(this); + //don't discardConnection explicitly, only when + // exception happens or the connection's expireTime + // comes + } catch (Exception e ){ manager.discardConnection(this); + break; } ! }while(true); } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastConnectionManager.java gcc-3.3/libjava/gnu/java/rmi/server/UnicastConnectionManager.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastConnectionManager.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/UnicastConnectionManager.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.rmi.server.RMISocketFactory; *** 41,88 **** import java.rmi.server.RMIServerSocketFactory; import java.rmi.server.RMIClientSocketFactory; import java.rmi.RemoteException; - import gnu.java.rmi.server.UnicastConnection; - import java.util.Hashtable; - import java.net.Socket; - import java.net.ServerSocket; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectInput; import java.lang.Thread; import java.lang.Runnable; import java.net.InetAddress; import java.net.UnknownHostException; public class UnicastConnectionManager implements Runnable, ProtocolConstants { private static String localhost; private static Hashtable servers = new Hashtable(); ! private Thread serverThread; private ServerSocket ssock; String serverName; int serverPort; private RMIServerSocketFactory serverFactory; private RMIClientSocketFactory clientFactory; static { try { ! localhost = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException _) { localhost = "localhost"; } } private UnicastConnectionManager(String host, int port, RMIClientSocketFactory csf) { ssock = null; serverName = host; serverPort = port; serverFactory = null; clientFactory = csf; } private UnicastConnectionManager(int port, RMIServerSocketFactory ssf) { try { ssock = ssf.createServerSocket(port); --- 41,175 ---- import java.rmi.server.RMIServerSocketFactory; import java.rmi.server.RMIClientSocketFactory; import java.rmi.RemoteException; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectInput; + import java.io.DataInputStream; import java.lang.Thread; import java.lang.Runnable; import java.net.InetAddress; + import java.net.Socket; + import java.net.ServerSocket; import java.net.UnknownHostException; + import java.util.ArrayList; + import java.util.ConcurrentModificationException; + import java.util.Enumeration; + import java.util.Hashtable; + import java.util.Iterator; + + import gnu.java.rmi.server.UnicastConnection; + public class UnicastConnectionManager implements Runnable, ProtocolConstants { private static String localhost; + // use different maps for server/client type UnicastConnectionManager private static Hashtable servers = new Hashtable(); + private static Hashtable clients = new Hashtable(); + private ArrayList connections; //client connection pool ! // make serverThread volatile for poll ! private volatile Thread serverThread; private ServerSocket ssock; String serverName; int serverPort; + + static private Thread scavenger; + + // If client and server are in the same VM, serverobj represents server + Object serverobj; + + private static RMISocketFactory defaultSocketFactory = RMISocketFactory.getSocketFactory(); private RMIServerSocketFactory serverFactory; private RMIClientSocketFactory clientFactory; + // The following is for debug + private static int ncsock = 0; //count of client socket + private static int nssock = 0; //count of server socket + private static int ncmanager = 0; //count of client manager + private static int nsmanager = 0; //count of server manager + + private static final boolean debug = false; + + private static final Object GLOBAL_LOCK = new Object(); + static { try { ! //Use host address instead of host name to avoid name resolving issues ! //localhost = InetAddress.getLocalHost().getHostName(); ! localhost = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException _) { localhost = "localhost"; } + + } + //Only one scavenger thread running globally + private static void startScavenger(){ + scavenger = new Thread(new Runnable(){ + public void run(){ + if (debug) System.out.println("************* start scavenger."); + boolean liveon = true; + while (liveon){ + // Sleep for the expire timeout + try{ + Thread.sleep(UnicastConnection.CONNECTION_TIMEOUT); + }catch(InterruptedException _ie){ + break; + } + liveon = false; + // Scavenge all clients' connections that're expired + Iterator iter = clients.values().iterator(); + long l = System.currentTimeMillis(); + try{ + while(iter.hasNext()){ + UnicastConnectionManager man = (UnicastConnectionManager)iter.next(); + ArrayList conns = man.connections; + synchronized(conns) { // is the lock a little coarser? + for (int last = conns.size() - 1; + last >= 0; + --last) + { + UnicastConnection conn = (UnicastConnection)conns.get(last); + if (UnicastConnection.isExpired(conn, l)){ + conns.remove(last); + conn.disconnect(); + conn = null; + }else + liveon = true; //there're still live connections + } + } + } + }catch(ConcurrentModificationException cme) { + // handle it lazily + liveon = true; + } + } + scavenger = null; + if (debug) System.out.println("************* exit scavenger."); + } + }); + scavenger.start(); + } + + /** + * Client UnicastConnectionManager constructor + */ private UnicastConnectionManager(String host, int port, RMIClientSocketFactory csf) { ssock = null; serverName = host; serverPort = port; serverFactory = null; clientFactory = csf; + connections = new ArrayList(); } + /** + * Server UnicastConnectionManager constructor + */ private UnicastConnectionManager(int port, RMIServerSocketFactory ssf) { try { ssock = ssf.createServerSocket(port); *************** private UnicastConnectionManager(int por *** 110,122 **** public static synchronized UnicastConnectionManager getInstance(String host, int port, RMIClientSocketFactory csf) { //System.out.println("getInstance: " + host + "," + port + "," + csf); if (csf == null) { ! csf = RMISocketFactory.getSocketFactory(); } TripleKey key = new TripleKey(host, port, csf); ! UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(host, port, csf); ! servers.put(key, man); } return (man); } --- 197,224 ---- public static synchronized UnicastConnectionManager getInstance(String host, int port, RMIClientSocketFactory csf) { //System.out.println("getInstance: " + host + "," + port + "," + csf); if (csf == null) { ! csf = defaultSocketFactory; } + // change host name to host address to avoid name resolving issues + try{ + host = InetAddress.getByName(host).getHostAddress(); + }catch(Exception _){} + TripleKey key = new TripleKey(host, port, csf); ! UnicastConnectionManager man = (UnicastConnectionManager)clients.get(key); if (man == null) { man = new UnicastConnectionManager(host, port, csf); ! if (debug) { ! ncmanager++; ! System.out.println("\n\n ====== " + ncmanager + " client managers.\n\n"); ! } ! clients.put(key, man); ! ! // Detect if client and server are in the same VM, i.e., their keys are equal ! UnicastConnectionManager svrman = (UnicastConnectionManager)servers.get(key); ! if(svrman != null){ // server and client are in the same VM ! man.serverobj = svrman.serverobj; ! } } return (man); } *************** public static synchronized UnicastConnec *** 128,139 **** public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) { //System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ! ssf = RMISocketFactory.getSocketFactory(); } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); --- 230,245 ---- public static synchronized UnicastConnectionManager getInstance(int port, RMIServerSocketFactory ssf) { //System.out.println("getInstance: " + port + "," + ssf); if (ssf == null) { ! ssf = defaultSocketFactory; } TripleKey key = new TripleKey(localhost, port, ssf); UnicastConnectionManager man = (UnicastConnectionManager)servers.get(key); if (man == null) { man = new UnicastConnectionManager(port, ssf); + if (debug) { + nsmanager++; + System.out.println("\n\n ****** " + nsmanager + " server managers.\n\n"); + } // The provided port might not be the set port. key.port = man.serverPort; servers.put(key, man); *************** public UnicastConnection getConnection() *** 158,166 **** */ private UnicastConnection getServerConnection() throws IOException { Socket sock = ssock.accept(); UnicastConnection conn = new UnicastConnection(this, sock); conn.acceptConnection(); ! //System.out.println("Server connection " + conn); return (conn); } --- 264,277 ---- */ private UnicastConnection getServerConnection() throws IOException { Socket sock = ssock.accept(); + sock.setTcpNoDelay(true); //?? UnicastConnection conn = new UnicastConnection(this, sock); conn.acceptConnection(); ! if (debug){ ! nssock++; ! System.out.println("\n\n ****** " + nssock + " server socks.\n\n"); ! } ! //System.out.println("Server connection " + sock); return (conn); } *************** private UnicastConnection getServerConne *** 168,177 **** * Make a conection from this client to the server. */ private UnicastConnection getClientConnection() throws IOException { Socket sock = clientFactory.createSocket(serverName, serverPort); ! UnicastConnection conn = new UnicastConnection(this, sock); conn.makeConnection(DEFAULT_PROTOCOL); ! //System.out.println("Client connection " + conn); return (conn); } --- 279,316 ---- * Make a conection from this client to the server. */ private UnicastConnection getClientConnection() throws IOException { + ArrayList conns = connections; + UnicastConnection conn; + + synchronized(conns) { + int nconn = conns.size() - 1; + + // if there're free connections in connection pool + if(nconn >= 0) { + conn = (UnicastConnection)conns.get(nconn); + //Should we check if conn is alive using Ping?? + conns.remove(nconn); + + // Check if the connection is already expired + long l = System.currentTimeMillis(); + if (!UnicastConnection.isExpired(conn, l)){ + return conn; + }else { + conn.disconnect(); + conn = null; + } + } + } + Socket sock = clientFactory.createSocket(serverName, serverPort); ! conn = new UnicastConnection(this, sock); conn.makeConnection(DEFAULT_PROTOCOL); ! ! if (debug) { ! ncsock++; ! System.out.println("\n\n ====== " + ncsock + " client socks.\n\n"); ! } ! return (conn); } *************** private UnicastConnection getClientConne *** 181,187 **** --- 320,338 ---- */ public void discardConnection(UnicastConnection conn) { //System.out.println("Discarding connection " + conn); + //conn.disconnect(); + if (ssock != null) //server connection conn.disconnect(); + else { + // To client connection, we'd like to return back to pool + UnicastConnection.resetTime(conn); + //Ensure there're only one scavenger globally + synchronized(GLOBAL_LOCK) { + connections.add(conn); //borrow this lock to garantee thread safety + if (scavenger == null) + startScavenger(); + } + } } /** *************** public void startServer() { *** 194,215 **** return; } serverThread = new Thread(this); } serverThread.start(); } /** * Server thread for connection manager. */ public void run() { ! for (;;) { try { //System.out.println("Waiting for connection on " + serverPort); UnicastConnection conn = getServerConnection(); ! (new Thread(conn)).start(); } catch (Exception e) { ! e.printStackTrace(); } } } --- 345,384 ---- return; } serverThread = new Thread(this); + // The following is not necessary when java.lang.Thread's constructor do this. + // serverThread.setContextClassLoader(Thread.currentThread().getContextClassLoader()); } serverThread.start(); } /** + * Stop a server on this manager + */ + public void stopServer() { + synchronized(this) { + if(serverThread != null){ + serverThread = null; + try{ + ssock.close(); + }catch(Exception _){} + } + } + } + + /** * Server thread for connection manager. */ public void run() { ! for (;serverThread != null;) { // if serverThread==null, then exit thread try { //System.out.println("Waiting for connection on " + serverPort); UnicastConnection conn = getServerConnection(); ! // use a thread pool to improve performance ! //ConnectionRunnerPool.dispatchConnection(conn); ! (new Thread(conn)).start(); } catch (Exception e) { ! e.printStackTrace(); } } } *************** void write(ObjectOutput out) throws IOEx *** 228,235 **** static UnicastConnectionManager read(ObjectInput in) throws IOException { String host = in.readUTF(); int port = in.readInt(); ! RMIClientSocketFactory csf = ((RMIObjectInputStream)in).manager.clientFactory; ! return (getInstance(host, port, csf)); } } --- 397,405 ---- static UnicastConnectionManager read(ObjectInput in) throws IOException { String host = in.readUTF(); int port = in.readInt(); ! //RMIClientSocketFactory csf = ((RMIObjectInputStream)in).manager.clientFactory; ! //return (getInstance(host, port, csf)); ! return (getInstance(host, port, null)); } } *************** public boolean equals(Object obj) { *** 262,268 **** TripleKey other = (TripleKey)obj; if (this.host.equals(other.host) && this.other == other.other && ! (this.port == other.port || this.port == 0 || other.port == 0)) { return (true); } } --- 432,438 ---- TripleKey other = (TripleKey)obj; if (this.host.equals(other.host) && this.other == other.other && ! (this.port == other.port /* || this.port == 0 || other.port == 0*/)) { return (true); } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastRef.java gcc-3.3/libjava/gnu/java/rmi/server/UnicastRef.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastRef.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/UnicastRef.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.ObjectOutputStream; *** 62,67 **** --- 62,69 ---- import java.io.DataInputStream; import java.io.DataOutputStream; + import java.lang.reflect.InvocationTargetException; + public class UnicastRef implements RemoteRef, ProtocolConstants { *************** public ObjID objid; *** 69,77 **** UnicastConnectionManager manager; /** ! * Used by serialization. */ ! private UnicastRef() { } public UnicastRef(ObjID objid, String host, int port, RMIClientSocketFactory csf) { --- 71,80 ---- UnicastConnectionManager manager; /** ! * Used by serialization, and let subclass capable of having default constructor */ ! //private ! UnicastRef() { } public UnicastRef(ObjID objid, String host, int port, RMIClientSocketFactory csf) { *************** public UnicastRef(ObjID objid) { *** 84,89 **** --- 87,107 ---- } public Object invoke(Remote obj, Method method, Object[] params, long opnum) throws Exception { + // Check if client and server are in the same VM, then local call can be used to + // replace remote call, but it's somewhat violating remote semantic. + Object svrobj = manager.serverobj; + if(svrobj != null){ + //local call + Object ret = null; + try{ + ret = method.invoke(svrobj, params); + }catch(InvocationTargetException e){ + throw (Exception)e.getTargetException(); + } + //System.out.println("\n\n ***** local call: " + method + "\nreturn: " + ret + "\n\n"); + return ret; + } + //System.out.println("***************** remote call:" + manager.serverPort); return (invokeCommon(obj, method, params, -1, opnum)); } *************** private Object invokeCommon(Remote obj, *** 107,122 **** objid.write(out); out.writeInt(opnum); out.writeLong(hash); ! if (params != null) { ! for (int i = 0; i < params.length; i++) { ! if (params[i] instanceof UnicastRemoteObject) { ! out.writeObject(UnicastRemoteObject.exportObject((UnicastRemoteObject)params[i])); ! } ! else { ! out.writeObject(params[i]); ! } ! } ! } out.flush(); } --- 125,135 ---- objid.write(out); out.writeInt(opnum); out.writeLong(hash); ! ! // must handle primitive class and their wrapper classes ! Class clss[] = method.getParameterTypes(); ! for(int i = 0; i < clss.length; i++) ! ((RMIObjectOutputStream)out).writeValue(params[i], clss[i]); out.flush(); } *************** private Object invokeCommon(Remote obj, *** 131,153 **** UID ack; try { din = conn.getDataInputStream(); ! if (din.readUnsignedByte() != MESSAGE_CALL_ACK) { ! throw new RemoteException("Call not acked"); } in = conn.getObjectInputStream(); - returncode = in.readUnsignedByte(); ack = UID.read(in); ! returnval = in.readObject(); } catch (IOException e3) { throw new RemoteException("call return failed: ", e3); } manager.discardConnection(conn); ! if (returncode != RETURN_ACK) { throw (Exception)returnval; } --- 144,183 ---- UID ack; try { din = conn.getDataInputStream(); ! ! if ((returncode = din.readUnsignedByte()) != MESSAGE_CALL_ACK) { ! conn.disconnect(); ! throw new RemoteException("Call not acked:" + returncode); } in = conn.getObjectInputStream(); returncode = in.readUnsignedByte(); ack = UID.read(in); ! ! Class cls = method.getReturnType(); ! if(cls == Void.TYPE){ ! returnval = null; ! in.readObject(); ! }else ! returnval = ((RMIObjectInputStream)in).readValue(cls); ! } catch (IOException e3) { + //for debug: e3.printStackTrace(); throw new RemoteException("call return failed: ", e3); } + /* if DGCAck is necessary?? + //According to RMI wire protocol, send a DGCAck + // to indicate receiving return value + dout.writeByte(MESSAGE_DGCACK); + ack.write(dout); + out.flush(); + */ + manager.discardConnection(conn); ! if (returncode != RETURN_ACK && returnval != null) { throw (Exception)returnval; } *************** private Object invokeCommon(Remote obj, *** 158,164 **** * @deprecated */ public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) throws RemoteException { ! return (new UnicastRemoteCall(obj, opnum, hash)); } /** --- 188,205 ---- * @deprecated */ public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum, long hash) throws RemoteException { ! UnicastConnection conn; ! ! try { ! conn = manager.getConnection(); ! } ! catch (IOException e1) { ! throw new RemoteException("connection failed to host: " + manager.serverName, e1); ! } ! ! //obj: useless? ! ! return (new UnicastRemoteCall(conn, objid, opnum, hash)); } /** *************** public RemoteCall newCall(RemoteObject o *** 166,180 **** */ public void invoke(RemoteCall call) throws Exception { UnicastRemoteCall c = (UnicastRemoteCall)call; ! Object ret = invokeCommon((Remote)c.getObject(), (Method)null, c.getArguments(), c.getOpnum(), c.getHash()); ! c.setReturnValue(ret); } /** * @deprecated */ public void done(RemoteCall call) throws RemoteException { ! /* Does nothing */ } public void writeExternal(ObjectOutput out) throws IOException { --- 207,225 ---- */ public void invoke(RemoteCall call) throws Exception { UnicastRemoteCall c = (UnicastRemoteCall)call; ! call.executeCall(); } /** * @deprecated */ public void done(RemoteCall call) throws RemoteException { ! UnicastRemoteCall c = (UnicastRemoteCall)call; ! try{ ! c.done(); ! } catch(IOException e){} ! UnicastConnection conn = c.getConnection(); ! manager.discardConnection(conn); } public void writeExternal(ObjectOutput out) throws IOException { *************** public void writeExternal(ObjectOutput o *** 183,195 **** } manager.write(out); objid.write(out); ! out.writeByte(RETURN_ACK); } public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { manager = UnicastConnectionManager.read(in); objid = ObjID.read(in); ! if (in.readByte() != RETURN_ACK) { throw new IOException("no ack found"); } } --- 228,243 ---- } manager.write(out); objid.write(out); ! // This byte is somewhat confusing when interoperating with JDK ! out.writeByte(0); //RETURN_ACK); } public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { manager = UnicastConnectionManager.read(in); objid = ObjID.read(in); ! byte ack = in.readByte(); ! // This byte is somewhat confusing when interoperating with JDK ! if (ack != RETURN_ACK && ack != 0/*jdk ack value*/) { throw new IOException("no ack found"); } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastRemoteCall.java gcc-3.3/libjava/gnu/java/rmi/server/UnicastRemoteCall.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastRemoteCall.java 2002-02-14 23:16:02.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/UnicastRemoteCall.java 2002-11-07 18:01:05.000000000 +0000 *************** exception statement from your version. * *** 38,51 **** package gnu.java.rmi.server; import java.lang.Exception; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectInput; import java.io.StreamCorruptedException; import java.rmi.server.RemoteCall; import java.util.Vector; ! public class UnicastRemoteCall implements RemoteCall { private UnicastConnection conn; --- 38,61 ---- package gnu.java.rmi.server; import java.lang.Exception; + import java.io.DataInputStream; + import java.io.DataOutputStream; import java.io.IOException; import java.io.ObjectOutput; import java.io.ObjectInput; import java.io.StreamCorruptedException; import java.rmi.server.RemoteCall; + import java.rmi.RemoteException; + import java.rmi.MarshalException; + import java.rmi.UnmarshalException; + import java.rmi.server.UID; + import java.rmi.server.ObjID; + import java.rmi.server.RemoteObject; + import java.util.Vector; ! public class UnicastRemoteCall ! implements RemoteCall, ProtocolConstants { private UnicastConnection conn; *************** public class UnicastRemoteCall implement *** 56,61 **** --- 66,74 ---- private Vector vec; private int ptr; + private ObjectOutput oout; + private ObjectInput oin; + /** * Incoming call. */ *************** public class UnicastRemoteCall implement *** 67,96 **** /** * Outgoing call. */ ! UnicastRemoteCall(Object obj, int opnum, long hash) { ! this.object = obj; this.opnum = opnum; this.hash = hash; } ! public ObjectOutput getOutputStream() throws IOException { ! vec = new Vector(); ! return new DummyObjectOutputStream(); } public void releaseOutputStream() throws IOException { ! // Does nothing. } public ObjectInput getInputStream() throws IOException { if (conn != null) ! return conn.getObjectInputStream(); ! ptr = 0; ! return new DummyObjectInputStream(); } public void releaseInputStream() throws IOException --- 80,150 ---- /** * Outgoing call. */ ! UnicastRemoteCall(UnicastConnection conn, ObjID objid, int opnum, long hash) ! throws RemoteException { ! this.conn = conn; this.opnum = opnum; this.hash = hash; + + // signal the call when constructing + try + { + DataOutputStream dout = conn.getDataOutputStream(); + dout.write(MESSAGE_CALL); + + oout = conn.getObjectOutputStream(); + objid.write(oout); + oout.writeInt(opnum); + oout.writeLong(hash); + } + catch(IOException ex) + { + throw new MarshalException("Try to write header but failed.", ex); + } } ! ! UnicastConnection getConnection() ! { ! return conn; ! } ! public ObjectOutput getOutputStream() throws IOException { ! if (conn != null) ! { ! if(oout == null) ! return (oout = conn.getObjectOutputStream()); ! else ! return oout; ! } ! else ! { ! vec = new Vector(); ! return (new DummyObjectOutputStream()); ! } } public void releaseOutputStream() throws IOException { ! if(oout != null) ! oout.flush(); } public ObjectInput getInputStream() throws IOException { if (conn != null) ! { ! if(oin == null) ! return (oin = conn.getObjectInputStream()); ! else ! return oin; ! } ! else ! { ! ptr = 0; ! return (new DummyObjectInputStream()); ! } } public void releaseInputStream() throws IOException *************** public class UnicastRemoteCall implement *** 104,118 **** vec = new Vector(); return new DummyObjectOutputStream(); } ! public void executeCall() throws Exception { ! throw new Error("Not implemented"); } public void done() throws IOException { ! /* Does nothing */ } Object returnValue() --- 158,214 ---- vec = new Vector(); return new DummyObjectOutputStream(); } ! public void executeCall() throws Exception { ! byte returncode; ! ObjectInput oin; ! try ! { ! releaseOutputStream(); ! DataInputStream din = conn.getDataInputStream(); ! if (din.readByte() != MESSAGE_CALL_ACK) ! throw new RemoteException("Call not acked"); ! ! oin = getInputStream(); ! returncode = oin.readByte(); ! UID.read(oin); ! } ! catch(IOException ex) ! { ! throw new UnmarshalException("Try to read header but failed:", ex); ! } ! ! //check return code ! switch(returncode) ! { ! case RETURN_ACK: //it's ok ! return; ! case RETURN_NACK: ! Object returnobj; ! try ! { ! returnobj = oin.readObject(); ! } ! catch(Exception ex2) ! { ! throw new UnmarshalException ! ("Try to read exception object but failed", ex2); ! } ! ! if(!(returnobj instanceof Exception)) ! throw new UnmarshalException("Should be Exception type here: " ! + returnobj); ! throw (Exception)returnobj; ! ! default: ! throw new UnmarshalException("Invalid return code"); ! } } public void done() throws IOException { ! // conn.disconnect(); } Object returnValue() diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastServer.java gcc-3.3/libjava/gnu/java/rmi/server/UnicastServer.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastServer.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/UnicastServer.java 2002-11-07 18:01:05.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.IOException; *** 45,50 **** --- 45,51 ---- import java.net.InetAddress; import java.util.Hashtable; import java.net.UnknownHostException; + import java.rmi.Remote; import java.rmi.server.ObjID; import java.rmi.server.UnicastRemoteObject; import java.rmi.server.UID; *************** import gnu.java.rmi.dgc.DGCImpl; *** 56,75 **** public class UnicastServer implements ProtocolConstants { ! static private Hashtable objects = new Hashtable(); static private DGCImpl dgc; public static void exportObject(UnicastServerRef obj) { startDGC(); objects.put(obj.objid, obj); obj.manager.startServer(); } private static synchronized void startDGC() { if (dgc == null) { try { dgc = new DGCImpl(); ! ((UnicastServerRef)dgc.getRef()).exportObject(dgc); } catch (RemoteException e) { e.printStackTrace(); --- 57,92 ---- public class UnicastServer implements ProtocolConstants { ! static private Hashtable objects = new Hashtable(); //mapping OBJID to server ref ! static private Hashtable refcache = new Hashtable(); //mapping obj itself to server ref static private DGCImpl dgc; public static void exportObject(UnicastServerRef obj) { startDGC(); objects.put(obj.objid, obj); + refcache.put(obj.myself, obj); obj.manager.startServer(); } + // FIX ME: I haven't handle force parameter + public static boolean unexportObject(UnicastServerRef obj, boolean force) { + objects.remove(obj.objid); + refcache.remove(obj.myself); + obj.manager.stopServer(); + return true; + } + + public static UnicastServerRef getExportedRef(Remote remote){ + return (UnicastServerRef)refcache.get(remote); + } + private static synchronized void startDGC() { if (dgc == null) { try { dgc = new DGCImpl(); ! // Changed DGCImpl to inherit UnicastServerRef directly ! //((UnicastServerRef)dgc.getRef()).exportObject(dgc); ! dgc.exportObject(dgc); } catch (RemoteException e) { e.printStackTrace(); *************** private static void incomingMessageCall( *** 100,109 **** --- 117,130 ---- UnicastServerRef uref = (UnicastServerRef)objects.get(objid); Object returnval; int returncode = RETURN_ACK; + // returnval is from Method.invoke(), so we must check the return class to see + // if it's primitive type + Class returncls = null; if (uref != null) { try { // Dispatch the call to it. returnval = uref.incomingMessageCall(conn, method, hash); + returncls = uref.getMethodReturnType(method, hash); } catch (Exception e) { returnval = e; *************** private static void incomingMessageCall( *** 121,127 **** out.writeByte(returncode); (new UID()).write(out); ! out.writeObject(returnval); out.flush(); } --- 142,151 ---- out.writeByte(returncode); (new UID()).write(out); ! if(returnval != null && returncls != null) ! ((RMIObjectOutputStream)out).writeValue(returnval, returncls); ! else ! out.writeObject(returnval); out.flush(); } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastServerRef.java gcc-3.3/libjava/gnu/java/rmi/server/UnicastServerRef.java *** gcc-3.2.3/libjava/gnu/java/rmi/server/UnicastServerRef.java 2002-01-22 22:40:01.000000000 +0000 --- gcc-3.3/libjava/gnu/java/rmi/server/UnicastServerRef.java 2003-01-03 22:56:56.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.DataInputStream; *** 63,79 **** import java.io.DataOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Hashtable; public class UnicastServerRef ! extends UnicastRef { final static private Class[] stubprototype = new Class[] { RemoteRef.class }; ! Remote myself; private Skeleton skel; private RemoteStub stub; ! private Hashtable methods; public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) { super(id); --- 63,89 ---- import java.io.DataOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; + import java.io.ObjectInput; + import java.io.ObjectOutput; import java.util.Hashtable; public class UnicastServerRef ! extends UnicastRef ! implements ServerRef{ //SHOULD implement ServerRef final static private Class[] stubprototype = new Class[] { RemoteRef.class }; ! Remote myself; //save the remote object itself private Skeleton skel; private RemoteStub stub; ! private Hashtable methods = new Hashtable(); ! ! /** ! * Used by serialization. ! */ ! UnicastServerRef() ! { ! } public UnicastServerRef(ObjID id, int port, RMIServerSocketFactory ssf) { super(id); *************** public UnicastServerRef(ObjID id, int po *** 83,88 **** --- 93,101 ---- public RemoteStub exportObject(Remote obj) throws RemoteException { if (myself == null) { myself = obj; + // Save it to server manager, to let client calls in the same VM to issue + // local call + manager.serverobj = obj; // Find and install the stub Class cls = obj.getClass(); *************** public RemoteStub exportObject(Remote ob *** 95,101 **** skel = (Skeleton)getHelperClass(cls, "_Skel"); // Build hash of methods which may be called. ! buildMethodHash(obj.getClass()); // Export it. UnicastServer.exportObject(this); --- 108,114 ---- skel = (Skeleton)getHelperClass(cls, "_Skel"); // Build hash of methods which may be called. ! buildMethodHash(obj.getClass(), true); // Export it. UnicastServer.exportObject(this); *************** public RemoteStub exportObject(Remote ob *** 104,113 **** return (stub); } private Object getHelperClass(Class cls, String type) { try { ! String classname = cls.getName(); ! Class scls = Class.forName(classname + type); if (type.equals("_Stub")) { try { // JDK 1.2 stubs --- 117,145 ---- return (stub); } + public RemoteStub exportObject(Remote remote, Object obj) + throws RemoteException + { + //FIX ME + return exportObject(remote); + } + + public RemoteStub getStub(){ + return stub; + } + + + public boolean unexportObject(Remote obj, boolean force) { + // Remove all hashes of methods which may be called. + buildMethodHash(obj.getClass(), false); + return UnicastServer.unexportObject(this, force); + } + private Object getHelperClass(Class cls, String type) { try { ! String classname = cls.getName(); ! ClassLoader cl = cls.getClassLoader(); //DONT use "Class scls = Class.forName(classname + type);" ! Class scls = cl.loadClass(classname + type); if (type.equals("_Stub")) { try { // JDK 1.2 stubs *************** public String getClientHost() throws Ser *** 147,154 **** throw new Error("Not implemented"); } ! private void buildMethodHash(Class cls) { ! methods = new Hashtable(); Method[] meths = cls.getMethods(); for (int i = 0; i < meths.length; i++) { /* Don't need to include any java.xxx related stuff */ --- 179,185 ---- throw new Error("Not implemented"); } ! private void buildMethodHash(Class cls, boolean build) { Method[] meths = cls.getMethods(); for (int i = 0; i < meths.length; i++) { /* Don't need to include any java.xxx related stuff */ *************** private void buildMethodHash(Class cls) *** 156,166 **** continue; } long hash = RMIHashes.getMethodHash(meths[i]); ! methods.put(new Long (hash), meths[i]); //System.out.println("meth = " + meths[i] + ", hash = " + hash); } } public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception { //System.out.println("method = " + method + ", hash = " + hash); // If method is -1 then this is JDK 1.2 RMI - so use the hash --- 187,209 ---- continue; } long hash = RMIHashes.getMethodHash(meths[i]); ! if(build) ! methods.put(new Long (hash), meths[i]); ! else ! methods.remove(new Long (hash)); //System.out.println("meth = " + meths[i] + ", hash = " + hash); } } + Class getMethodReturnType(int method, long hash) throws Exception + { + if (method == -1) { + Method meth = (Method)methods.get(new Long (hash)); + return meth.getReturnType(); + }else + return null; + } + public Object incomingMessageCall(UnicastConnection conn, int method, long hash) throws Exception { //System.out.println("method = " + method + ", hash = " + hash); // If method is -1 then this is JDK 1.2 RMI - so use the hash *************** public Object incomingMessageCall(Unicas *** 189,195 **** throw t; } } ! return (meth.invoke(myself, args)); } // Otherwise this is JDK 1.1 style RMI - we find the skeleton // and invoke it using the method number. We wrap up our --- 232,246 ---- throw t; } } ! //We must reinterpret the exception thrown by meth.invoke() ! //return (meth.invoke(myself, args)); ! Object ret = null; ! try{ ! ret = meth.invoke(myself, args); ! }catch(InvocationTargetException e){ ! throw (Exception)(e.getTargetException()); ! } ! return ret; } // Otherwise this is JDK 1.1 style RMI - we find the skeleton // and invoke it using the method number. We wrap up our diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/der/DEREncodingException.java gcc-3.3/libjava/gnu/java/security/der/DEREncodingException.java *** gcc-3.2.3/libjava/gnu/java/security/der/DEREncodingException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/der/DEREncodingException.java 2002-08-11 16:34:44.000000000 +0000 *************** *** 0 **** --- 1,53 ---- + /* DEREncodingException.java --- DER Encoding Exception + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.der; + + public class DEREncodingException extends Exception + { + + public DEREncodingException() + { + super (); + } + + public DEREncodingException (String msg) + { + super (msg); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/DefaultPolicy.java gcc-3.3/libjava/gnu/java/security/provider/DefaultPolicy.java *** gcc-3.2.3/libjava/gnu/java/security/provider/DefaultPolicy.java 2002-01-22 22:40:02.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/DefaultPolicy.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 1,5 **** /* DefaultPolicy.java ! Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* DefaultPolicy.java ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.security.*; *** 47,62 **** */ public class DefaultPolicy extends Policy { ! static Permissions allPermissions = new Permissions(); ! ! static ! { ! allPermissions.add(new AllPermission()); ! } public PermissionCollection getPermissions(CodeSource codesource) { ! return allPermissions; } public void refresh() --- 47,59 ---- */ public class DefaultPolicy extends Policy { ! static Permission allPermission = new AllPermission(); public PermissionCollection getPermissions(CodeSource codesource) { ! Permissions perms = new Permissions(); ! perms.add(allPermission); ! return perms; } public void refresh() diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/DERReader.java gcc-3.3/libjava/gnu/java/security/provider/DERReader.java *** gcc-3.2.3/libjava/gnu/java/security/provider/DERReader.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/DERReader.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,152 ---- + /* DERReader.java + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + + import java.math.BigInteger; + import gnu.java.security.der.DEREncodingException; + + public class DERReader + { + byte source[]; + int pos; + + static final int UNIVERSAL = 1; + static final int APPLICATION = 2; + static final int CONTEXT_SPECIFIC = 3; + static final int PRIVATE = 4; + + + public DERReader() + { + source = null; + pos = 0; + } + + public DERReader( byte source[] ) + { + init( source ); + } + + public void init( String source ) + { + init( source.getBytes() ); + } + + public void init( byte source[] ) + { + this.source = source; + pos = 0; + } + + public BigInteger getBigInteger() throws DEREncodingException + { + return new BigInteger( getPrimitive() ); + } + + //Reads Primitive, definite-length method + private byte[] getPrimitive() throws DEREncodingException + { + int tmp = pos; + + //Read Identifier + byte identifier = source[tmp++]; + if( (0x20 & identifier) != 0) + throw new DEREncodingException(); + int type = translateLeadIdentifierByte(identifier); + //System.out.println("Type: " + type); + + //get tag + int tag = (0x1f & identifier); + //if( tag == 0x1f) + // tag = getIdentifier(tmp); + //System.out.println("Tag: " + tag); + + //get length + byte len = source[tmp]; //may be length of length parameter + long length = 0x7f & len; + int i; + if( (0x80 & len) != 0 ) { + //System.out.println("Extra Long Length"); + len &= 0x7f; + //System.out.println("Length of Length: " + len); + //get length here + length = 0; + for( i = 0; i < len; i++ ) { + tmp++; + length <<= 8; + length += (source[tmp] < 0 ) ? + (256 + source[tmp]) : + source[tmp]; + //System.out.println("Length of Length: " + length); + } + tmp++; + } else + tmp++; + + /*System.out.println("Position: " + tmp); + System.out.println("Length: " + length); + for( i = 0; i < 10; i++) + System.out.print(source[tmp + i] + " "); + System.out.println();*/ + + byte tmpb[] = new byte[ (int)length ]; + System.arraycopy( source, tmp, tmpb, 0, (int)length); + pos = (int)(tmp + length); + return tmpb; + } + + private int translateLeadIdentifierByte(byte b) + { + if( (0x3f & b ) == b) + return UNIVERSAL; + else if( (0x7f & b ) == b) + return APPLICATION; + else if( (0xbf & b ) == b) + return CONTEXT_SPECIFIC; + else + return PRIVATE; + } + + private int getIdentifier(int tpos) + { + while( (0x80 & source[tpos]) != 0) + tpos++; + return tpos; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/DERWriter.java gcc-3.3/libjava/gnu/java/security/provider/DERWriter.java *** gcc-3.2.3/libjava/gnu/java/security/provider/DERWriter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/DERWriter.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,142 ---- + /* DERWriter.java + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + + import java.math.BigInteger; + + public class DERWriter + { + static final int UNIVERSAL = 1; + static final int APPLICATION = 2; + static final int CONTEXT_SPECIFIC = 3; + static final int PRIVATE = 4; + + public DERWriter() + {} + + public byte[] writeBigInteger( BigInteger i) + { + return writePrimitive( 0x02, UNIVERSAL, (int)Math.ceil((double)i.bitLength() / 8), i.toByteArray() ); + } + + private byte[] writePrimitive( int identifier, int identifierencoding, + int length, byte contents[]) + { + return joinarrays( generateIdentifier( identifier, identifierencoding ), generateLength( length ), contents); + } + + public byte[] joinarrays( byte a[], byte b[]) + { + byte d[] = new byte[ a.length + b.length]; + System.arraycopy( a, 0, d, 0, a.length); + System.arraycopy( b, 0, d, a.length, b.length); + return d; + } + + public byte[] joinarrays( byte a[], byte b[], byte c[]) + { + byte d[] = new byte[ a.length + b.length + c.length]; + System.arraycopy( a, 0, d, 0, a.length); + System.arraycopy( b, 0, d, a.length, b.length); + System.arraycopy( c, 0, d, a.length + b.length, c.length); + return d; + } + + private byte[] generateIdentifier(int identifier, + int identifierencoding) + { + byte b[]; + if( identifier > 31 ) { + int count = (int)(Math.log( identifier ) / Math.log( 256 )); + b = new byte[ count + 1 ]; + b[0] = (byte)(translateLeadIdentifierByte(identifierencoding) + | 0x1f); + int i; + for( i = 1; i < (count + 1); i++) { + b[i] = (byte)(0x7f & ( identifier >> (7 * (count - i)) )); + b[i] |= 0x80; + } + b[i - 1] ^= 0x80; + //System.out.println("Identifier1: " + b[0]); + return b; + } else { + b = new byte[1]; + b[0] = (byte)((translateLeadIdentifierByte(identifierencoding) + | (byte)( identifier & 0x1f )) & 0xdf); + //System.out.println("Identifier2: " + b[0]); + return b; + } + } + + private byte translateLeadIdentifierByte(int b) + { + if( b == UNIVERSAL) + return (byte)0x3f; + else if( b == APPLICATION) + return (byte)0x7f; + else if( b == CONTEXT_SPECIFIC) + return (byte)0xbf; + else + return (byte)0xC0; + } + + private byte[] generateLength( int length ) + { + byte b[]; + if( length > 127 ) { + int count = (int)Math.ceil(Math.log( length ) / Math.log( 256 )); + //System.out.println("Length byte count: " + count); + b = new byte[ count + 1 ]; + b[0] = (byte)((count & 0x7f) | 0x80); + for( int i = 1; i < (count + 1); i++) { + b[i] = (byte)( length >>> (8 * ( count - i) )); + //System.out.println("Length1 byte1: " + (length >>> (8 * ( count - i) ))); + //System.out.println("Length1 byte2: " + b[i]); + } + + //System.out.println("Length1: " + length); + return b; + } else { + b = new byte[1]; + b[0] = (byte)( length & 0x7f ); + //System.out.println("Length2: " + length); + return b; + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/DSAKeyPairGenerator.java gcc-3.3/libjava/gnu/java/security/provider/DSAKeyPairGenerator.java *** gcc-3.2.3/libjava/gnu/java/security/provider/DSAKeyPairGenerator.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/DSAKeyPairGenerator.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,173 ---- + /* GnuDSAKeyPairGenerator.java --- Gnu DSA Key Pair Generator + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + + import java.math.BigInteger; + import java.security.AlgorithmParameters; + import java.security.AlgorithmParameterGenerator; + import java.security.KeyPairGeneratorSpi; + import java.security.KeyPair; + import java.security.SecureRandom; + import java.security.InvalidParameterException; + import java.security.InvalidAlgorithmParameterException; + import java.security.interfaces.DSAParams; + import java.security.spec.AlgorithmParameterSpec; + import java.security.spec.DSAParameterSpec; + import java.util.Random; + + import gnu.java.security.util.Prime; + + public class DSAKeyPairGenerator extends KeyPairGeneratorSpi + implements java.security.interfaces.DSAKeyPairGenerator + { + int keysize; + SecureRandom random; + private BigInteger q = null; // the small prime + private BigInteger p = null; // the big prime + private BigInteger g = null; + + DSAKeyPairGenerator() + { + keysize = 1024; + } + + public void initialize(int keysize, SecureRandom random) + { + //if( ((keysize % 64) != 0) || (keysize < 512) || (keysize > 1024) ) + // throw new InvalidAlgorithmParameterException("Invalid key size"); + + this.keysize = keysize; + this.random = random; + } + + public void initialize(AlgorithmParameterSpec params, + SecureRandom random) + throws InvalidAlgorithmParameterException + { + if( !( params instanceof DSAParameterSpec ) ) + throw new InvalidAlgorithmParameterException("Must be DSAParameterSpec"); + + DSAParameterSpec dsaparameterspec = (DSAParameterSpec)params; + p = dsaparameterspec.getP(); + q = dsaparameterspec.getQ(); + g = dsaparameterspec.getG(); + this.random = random; + } + + public void initialize(DSAParams params, SecureRandom random) + throws InvalidParameterException + { + if(params.getP() != null) + p = params.getP(); + else + throw new InvalidParameterException(); + + if(params.getQ() != null) + q = params.getQ(); + else + throw new InvalidParameterException(); + + if(params.getG() != null) + g = params.getG(); + else + throw new InvalidParameterException(); + + this.random = random; + } + + public void initialize(int modlen, boolean genParams, SecureRandom random) + throws InvalidParameterException + { + if( ((modlen % 64) != 0) || (modlen < 512) || (modlen > 1024) ) + throw new InvalidParameterException(); + + if( (genParams == false) && (modlen != 512) && (modlen != 768) && (modlen != 1024) ) + throw new InvalidParameterException(); + this.keysize = modlen; + this.random = random; + p = null; + q = null; + g = null; + } + + public KeyPair generateKeyPair() + { + if( getDefaults() == false) { + try { + AlgorithmParameterGenerator apgDSA = AlgorithmParameterGenerator.getInstance("DSA"); + AlgorithmParameters apDSA = apgDSA.generateParameters(); + DSAParameterSpec dsaparameterspec = (DSAParameterSpec)apDSA.getParameterSpec( DSAParameterSpec.class ); + p = dsaparameterspec.getP(); + q = dsaparameterspec.getQ(); + g = dsaparameterspec.getG(); + } catch ( Exception e ) { + return null; + } + } + + BigInteger x = new BigInteger( 159, new Random() ); + + BigInteger y = g.modPow( x, p ); + + return new KeyPair( new GnuDSAPublicKey(y,p,q,g), new GnuDSAPrivateKey(x,p,q,g)); + //return new KeyPair( public, private ); + } + + //These constants are Sun's Constants copied from the + //Cryptography Specification + private boolean getDefaults() + { + if( keysize == 512) { + p = new BigInteger("fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3ae1617ae01f35b91a47e6df63413c5e12ed0899bcd132acd50d99151bdc43ee737592e17", 16); + q = new BigInteger("962eddcc369cba8ebb260ee6b6a126d9346e38c5", 16); + g = new BigInteger("678471b27a9cf44ee91a49c5147db1a9aaf244f05a434d6486931d2d14271b9e35030b71fd73da179069b32e2935630e1c2062354d0da20a6c416e50be794ca4", 16); + return true; + } else if( keysize == 768) { + p = new BigInteger("e9e642599d355f37c97ffd3567120b8e25c9cd43e927b3a9670fbec5d890141922d2c3b3ad2480093799869d1e846aab49fab0ad26d2ce6a22219d470bce7d777d4a21fbe9c270b57f607002f3cef8393694cf45ee3688c11a8c56ab127a3daf", 16); + q = new BigInteger("9cdbd84c9f1ac2f38d0f80f42ab952e7338bf511", 16); + g = new BigInteger("30470ad5a005fb14ce2d9dcd87e38bc7d1b1c5facbaecbe95f190aa7a31d23c4dbbcbe06174544401a5b2c020965d8c2bd2171d3668445771f74ba084d2029d83c1c158547f3a9f1a2715be23d51ae4d3e5a1f6a7064f316933a346d3f529252", 16); + } else if( keysize == 512) { + p = new BigInteger("fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c7", 16); + q = new BigInteger("9760508f15230bccb292b982a2eb840bf0581cf5", 16); + g = new BigInteger("f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a", 16); + } + return false; + } + + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/DSAParameterGenerator.java gcc-3.3/libjava/gnu/java/security/provider/DSAParameterGenerator.java *** gcc-3.2.3/libjava/gnu/java/security/provider/DSAParameterGenerator.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/DSAParameterGenerator.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,128 ---- + /* DSAParameterGenerator.java --- DSA Parameter Generator Implementation + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + + import java.math.BigInteger; + import java.security.AlgorithmParameters; + import java.security.AlgorithmParameterGeneratorSpi; + import java.security.InvalidAlgorithmParameterException; + import java.security.NoSuchAlgorithmException; + import java.security.SecureRandom; + import java.security.spec.AlgorithmParameterSpec; + import java.security.spec.DSAParameterSpec; + import java.security.spec.InvalidParameterSpecException; + import java.util.Random; + + import gnu.java.security.util.Prime; + + public class DSAParameterGenerator extends AlgorithmParameterGeneratorSpi + { + private int size; + private SecureRandom random = null; + + public DSAParameterGenerator() + { + size = 1024; + } + + public void engineInit(int size, SecureRandom random) + { + if( (size < 512) || (size > 1024) || ( (size % 64) != 0) ) + //throw new InvalidAlgorithmParameterException("Invalid Size"); + return; + this.size = size; + this.random = random; + } + + public void engineInit(AlgorithmParameterSpec genParamSpec, SecureRandom random) + throws InvalidAlgorithmParameterException + { + if( !( genParamSpec instanceof DSAParameterSpec ) ) + throw new InvalidAlgorithmParameterException("Must be DSAParameterSpec"); + + DSAParameterSpec dsaparameterspec = (DSAParameterSpec)genParamSpec; + int tmp = dsaparameterspec.getP().bitLength(); + + if( (tmp < 512) || (tmp > 1024) || ( (tmp % 64) != 0) ) + throw new InvalidAlgorithmParameterException("Invalid Size"); + + this.random = random; + } + + //For more information see IEEE P1363 A.16.1 (10/05/98 Draft) + public AlgorithmParameters engineGenerateParameters() + { + DSAParameterSpec dsaparameterspec; + + int L = size; + BigInteger r, p, k, h, g; + + //q 2^159 < q < 2^160 + r = Prime.generateRandomPrime( 159, 160, BigInteger.valueOf(1)); + + // 2^(L-1) < p < 2^L + p = Prime.generateRandomPrime( r, BigInteger.valueOf(1), L - 1, L, BigInteger.valueOf(1)); + + k = p.subtract( BigInteger.valueOf(1) ); + k = k.divide( r ); + + Random rand = new Random(); + h = BigInteger.valueOf(1); + + for(;;) { + h = h.add(BigInteger.valueOf( 1 ) ); + + g = h.modPow(k, p); + + if( g.compareTo( BigInteger.valueOf(1) ) != 1 ) + break; + } + + try { + dsaparameterspec = new DSAParameterSpec(p, r, g); + AlgorithmParameters ap = AlgorithmParameters.getInstance("DSA"); + ap.init( dsaparameterspec ); + return ap; + } catch ( NoSuchAlgorithmException nsae ) { + return null; + } catch ( InvalidParameterSpecException ipse) { + return null; + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/DSAParameters.java gcc-3.3/libjava/gnu/java/security/provider/DSAParameters.java *** gcc-3.2.3/libjava/gnu/java/security/provider/DSAParameters.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/DSAParameters.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,141 ---- + /* DSAParameters.java --- DSA Parameters Implementation + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + + import java.io.IOException; + import java.math.BigInteger; + import java.security.AlgorithmParametersSpi; + import java.security.InvalidAlgorithmParameterException; + import java.security.spec.AlgorithmParameterSpec; + import java.security.spec.DSAParameterSpec; + import java.security.spec.InvalidParameterSpecException; + import java.util.Random; + import gnu.java.security.der.DEREncodingException; + + import gnu.java.security.util.Prime; + + /* + ASN.1 Encoding for DSA from rfc2459 + + id-dsa ID ::= { iso(1) member-body(2) us(840) x9-57(10040) + x9cm(4) 1 } + + Dss-Parms ::= SEQUENCE { + p INTEGER, + q INTEGER, + g INTEGER } + + */ + public class DSAParameters extends AlgorithmParametersSpi + { + private BigInteger q; // the small prime + private BigInteger p; // the big prime + private BigInteger g; + + + public void engineInit(AlgorithmParameterSpec paramSpec) + throws InvalidParameterSpecException + { + if( paramSpec instanceof DSAParameterSpec ) { + DSAParameterSpec dsaParamSpec = (DSAParameterSpec)paramSpec; + p = dsaParamSpec.getP(); + q = dsaParamSpec.getQ(); + q = dsaParamSpec.getG(); + } + else + throw new InvalidParameterSpecException("Only accepts DSAParameterSpec"); + } + + public void engineInit(byte[] params) + throws IOException + { + DERReader reader = new DERReader( params ); + try { + + p = reader.getBigInteger(); + q = reader.getBigInteger(); + g = reader.getBigInteger(); + + } catch ( DEREncodingException DERee) { + throw new IOException("Invalid Format: Only accepts ASN.1"); + } + } + + public void engineInit(byte[] params, String format) + throws IOException + { + if( !format.equals("ASN.1") ) + throw new IOException("Invalid Format: Only accepts ASN.1"); + engineInit( params ); + } + + public AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec) + throws InvalidParameterSpecException + { + if( paramSpec.isAssignableFrom(DSAParameterSpec.class) ) + return new DSAParameterSpec(p, q, g); + else + throw new InvalidParameterSpecException("Only accepts DSAParameterSpec"); + } + + public byte[] engineGetEncoded() + throws IOException + { + DERWriter writer = new DERWriter(); + return writer.joinarrays( writer.writeBigInteger(p), + writer.writeBigInteger(q), + writer.writeBigInteger(g) ); + } + + + public byte[] engineGetEncoded(String format) + throws IOException + { + if( !format.equals("ASN.1") ) + throw new IOException("Invalid Format: Only accepts ASN.1"); + return engineGetEncoded(); + } + + public String engineToString() + { + String lineSeparator = System.getProperty("line.seperator"); + return ("q: " + q + lineSeparator + "p: " + p + lineSeparator + "g:" + g); + } + + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/DSASignature.java gcc-3.3/libjava/gnu/java/security/provider/DSASignature.java *** gcc-3.2.3/libjava/gnu/java/security/provider/DSASignature.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/DSASignature.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,247 ---- + /* DSASignature.java + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.security.provider; + + import java.math.BigInteger; + import java.security.InvalidAlgorithmParameterException; + import java.security.InvalidKeyException; + import java.security.InvalidParameterException; + import java.security.MessageDigest; + import java.security.NoSuchAlgorithmException; + import java.security.NoSuchProviderException; + import java.security.PrivateKey; + import java.security.PublicKey; + import java.security.SecureRandom; + import java.security.SignatureException; + import java.security.SignatureSpi; + import java.security.interfaces.DSAPrivateKey; + import java.security.interfaces.DSAPublicKey; + import java.security.spec.AlgorithmParameterSpec; + import java.util.Random; + import gnu.java.security.der.DEREncodingException; + + public class DSASignature extends SignatureSpi + { + private DSAPublicKey publicKey; + private DSAPrivateKey privateKey; + private MessageDigest digest = null; + + public DSASignature() + {} + + private void init() + { + if( digest == null ) { + try { + digest = MessageDigest.getInstance( "SHA1", "GNU" ); + } catch ( NoSuchAlgorithmException nsae ) { + digest = null; + } catch ( NoSuchProviderException nspe ) { + digest = null; + } + } + digest.reset(); + } + + public void engineInitVerify(PublicKey publicKey) + throws InvalidKeyException + { + if( publicKey instanceof DSAPublicKey ) + this.publicKey = (DSAPublicKey)publicKey; + else + throw new InvalidKeyException(); + init(); + } + + public void engineInitSign(PrivateKey privateKey) + throws InvalidKeyException + { + if( privateKey instanceof DSAPrivateKey ) + this.privateKey = (DSAPrivateKey)privateKey; + else + throw new InvalidKeyException(); + + init(); + } + + public void engineInitSign(PrivateKey privateKey, + SecureRandom random) + throws InvalidKeyException + { + if( privateKey instanceof DSAPrivateKey ) + this.privateKey = (DSAPrivateKey)privateKey; + else + throw new InvalidKeyException(); + + appRandom = random; + init(); + } + + public void engineUpdate(byte b) + throws SignatureException + { + if( digest == null ) + throw new SignatureException(); + + digest.update( b ); + } + + public void engineUpdate(byte[] b, int off, int len) + throws SignatureException + { + if( digest == null ) + throw new SignatureException(); + + digest.update( b, off, len ); + } + + public byte[] engineSign() + throws SignatureException + { + if( digest == null ) + throw new SignatureException(); + if( privateKey == null) + throw new SignatureException(); + + try { + + BigInteger g = privateKey.getParams().getG(); + BigInteger p = privateKey.getParams().getP(); + BigInteger q = privateKey.getParams().getQ(); + + BigInteger x = privateKey.getX(); + + BigInteger k = new BigInteger( 159, (Random)appRandom ); + + BigInteger r = g.modPow(k, p); + r = r.mod(q); + + byte bytes[] = digest.digest(); + BigInteger sha = new BigInteger(1, bytes); + + BigInteger s = sha.add( x.multiply( r ) ); + s = s.multiply( k.modInverse(q) ).mod( q ); + + DERWriter writer = new DERWriter(); + return writer.joinarrays( writer.writeBigInteger( r ), writer.writeBigInteger( s ) ); + + } catch ( ArithmeticException ae ) { + throw new SignatureException(); + } + } + + public int engineSign(byte[] outbuf, int offset, int len) + throws SignatureException + { + byte tmp[] = engineSign(); + if( tmp.length > len ) + throw new SignatureException(); + System.arraycopy( tmp, 0, outbuf, offset, tmp.length ); + return tmp.length; + } + + public boolean engineVerify(byte[] sigBytes) + throws SignatureException + { + //Decode sigBytes from ASN.1 DER encoding + try { + DERReader reader = new DERReader( sigBytes ); + BigInteger r = reader.getBigInteger(); + BigInteger s = reader.getBigInteger(); + + BigInteger g = publicKey.getParams().getG(); + BigInteger p = publicKey.getParams().getP(); + BigInteger q = publicKey.getParams().getQ(); + + BigInteger y = publicKey.getY(); + + BigInteger w = s.modInverse( q ); + + byte bytes[] = digest.digest(); + BigInteger sha = new BigInteger(1, bytes); + + BigInteger u1 = w.multiply( sha ).mod( q ); + + BigInteger u2 = r.multiply( w ).mod( q ); + + //This should test the compiler :) + BigInteger v = g.modPow( u1, p ).multiply( y.modPow( u2, p ) ).mod( p ).mod( q ); + + if( v.equals( r ) ) + return true; + else + return false; + } catch ( DEREncodingException deree ) { + throw new SignatureException(); + } + } + + public void engineSetParameter(String param, + Object value) + throws InvalidParameterException + { + throw new InvalidParameterException(); + } + + public void engineSetParameter(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException + { + throw new InvalidParameterException(); + + } + + public Object engineGetParameter(String param) + throws InvalidParameterException + { + throw new InvalidParameterException(); + } + + public Object clone() + //throws CloneNotSupportedException + { + return new DSASignature( this ); + } + + private DSASignature( DSASignature copy ) + { + this(); + this.publicKey = copy.publicKey; + this.privateKey = copy.privateKey; + this.digest = copy.digest; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java gcc-3.3/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java *** gcc-3.2.3/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,85 ---- + /* GnuDSAPrivateKey.java --- Gnu DSA Private Key + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + + import java.math.BigInteger; + import java.security.interfaces.DSAPrivateKey; + import java.security.interfaces.DSAParams; + import java.security.spec.DSAParameterSpec; + + public class GnuDSAPrivateKey implements DSAPrivateKey + { + BigInteger x; + BigInteger p; + BigInteger q; + BigInteger g; + + public GnuDSAPrivateKey(BigInteger x, BigInteger p, BigInteger q, BigInteger g ) + { + this.x = x; + this.p = p; + this.q = q; + this.g = g; + } + + public String getAlgorithm() + { + return "DSA"; + } + + public String getFormat() + { + return null; + } + + public byte[] getEncoded() + { + return null; + } + + public DSAParams getParams() + { + return (DSAParams)(new DSAParameterSpec(p,q,g)); + } + + public BigInteger getX() + { + return x; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/GnuDSAPublicKey.java gcc-3.3/libjava/gnu/java/security/provider/GnuDSAPublicKey.java *** gcc-3.2.3/libjava/gnu/java/security/provider/GnuDSAPublicKey.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/GnuDSAPublicKey.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 0 **** --- 1,85 ---- + /* GnuDSAPublicKey.java --- Gnu DSA Public Key + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + + import java.math.BigInteger; + import java.security.interfaces.DSAPublicKey; + import java.security.interfaces.DSAParams; + import java.security.spec.DSAParameterSpec; + + public class GnuDSAPublicKey implements DSAPublicKey + { + BigInteger y; + BigInteger p; + BigInteger q; + BigInteger g; + + public GnuDSAPublicKey(BigInteger y, BigInteger p, BigInteger q, BigInteger g ) + { + this.y = y; + this.p = p; + this.q = q; + this.g = g; + } + + public String getAlgorithm() + { + return "DSA"; + } + + public String getFormat() + { + return null; + } + + public byte[] getEncoded() + { + return null; + } + + public DSAParams getParams() + { + return (DSAParams)(new DSAParameterSpec(p,q,g)); + } + + public BigInteger getY() + { + return y; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/Gnu.java gcc-3.3/libjava/gnu/java/security/provider/Gnu.java *** gcc-3.2.3/libjava/gnu/java/security/provider/Gnu.java 2002-01-22 22:40:02.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/Gnu.java 2002-08-11 12:08:03.000000000 +0000 *************** *** 1,5 **** /* Gnu.java --- Gnu provider main class ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Gnu.java --- Gnu provider main class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public final class Gnu extends Provider *** 45,52 **** { super( "GNU", 1.0, "GNU provider v1.0 implementing SHA-1, MD5, DSA"); // Signature ! put("Signature.SHA1withDSA", "gnu.java.security.provider.DSASignature"); put("Alg.Alias.Signature.DSS", "SHA1withDSA"); put("Alg.Alias.Signature.DSA", "SHA1withDSA"); --- 45,57 ---- { super( "GNU", 1.0, "GNU provider v1.0 implementing SHA-1, MD5, DSA"); + // Note that all implementation class names are referenced by using + // Class.getName(). That way when we staticly link the Gnu provider + // we automatically get all the implementation classes. + // Signature ! put("Signature.SHA1withDSA", ! gnu.java.security.provider.DSASignature.class.getName()); put("Alg.Alias.Signature.DSS", "SHA1withDSA"); put("Alg.Alias.Signature.DSA", "SHA1withDSA"); *************** public final class Gnu extends Provider *** 62,90 **** put("Alg.Alias.Signature.1.3.14.3.2.27", "SHA1withDSA"); // Key Pair Generator ! put("KeyPairGenerator.DSA", "gnu.java.security.provider.DSAKeyPairGenerator"); put("Alg.Alias.KeyPairGenerator.OID.1.2.840.10040.4.1", "DSA"); put("Alg.Alias.KeyPairGenerator.1.2.840.10040.4.1", "DSA"); put("Alg.Alias.KeyPairGenerator.1.3.14.3.2.12", "DSA"); // Message Digests ! put("MessageDigest.SHA", "gnu.java.security.provider.SHA"); ! put("MessageDigest.MD5", "gnu.java.security.provider.MD5"); // Format "Alias", "Actual Name" put("Alg.Alias.MessageDigest.SHA1", "SHA"); put("Alg.Alias.MessageDigest.SHA-1", "SHA"); // Algorithm Parameters ! put("AlgorithmParameters.DSA", "gnu.java.security.provider.DSAAlgorithmParameters"); // Algorithm Parameter Generator ! put("AlgorithmParameterGenerator.DSA", "gnu.java.security.provider.DSAAlgorithmParameterGenerator"); // SecureRandom ! put("SecureRandom.SHA1PRNG", "gnu.java.security.provider.SHA1PRNG"); ! } } --- 67,98 ---- put("Alg.Alias.Signature.1.3.14.3.2.27", "SHA1withDSA"); // Key Pair Generator ! put("KeyPairGenerator.DSA", ! gnu.java.security.provider.DSAKeyPairGenerator.class.getName()); put("Alg.Alias.KeyPairGenerator.OID.1.2.840.10040.4.1", "DSA"); put("Alg.Alias.KeyPairGenerator.1.2.840.10040.4.1", "DSA"); put("Alg.Alias.KeyPairGenerator.1.3.14.3.2.12", "DSA"); // Message Digests ! put("MessageDigest.SHA", gnu.java.security.provider.SHA.class.getName()); ! put("MessageDigest.MD5", gnu.java.security.provider.MD5.class.getName()); // Format "Alias", "Actual Name" put("Alg.Alias.MessageDigest.SHA1", "SHA"); put("Alg.Alias.MessageDigest.SHA-1", "SHA"); // Algorithm Parameters ! put("AlgorithmParameters.DSA", ! gnu.java.security.provider.DSAParameters.class.getName()); // Algorithm Parameter Generator ! put("AlgorithmParameterGenerator.DSA", ! gnu.java.security.provider.DSAParameterGenerator.class.getName()); // SecureRandom ! put("SecureRandom.SHA1PRNG", ! gnu.java.security.provider.SHA1PRNG.class.getName()); } } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/MD5.java gcc-3.3/libjava/gnu/java/security/provider/MD5.java *** gcc-3.2.3/libjava/gnu/java/security/provider/MD5.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/MD5.java 2002-11-05 04:12:04.000000000 +0000 *************** *** 0 **** --- 1,338 ---- + /* MD5.java -- Class implementing the MD5 algorithm as specified in RFC1321. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.provider; + import java.security.MessageDigest; + + /** + This class implements the MD5 algorithm as described in RFC1321. + + @see java.security.MessageDigest + */ + public class MD5 extends MessageDigest implements Cloneable + { + private final int W[] = new int[16]; + private long bytecount; + private int A; + private int B; + private int C; + private int D; + + public MD5() + { + super("MD5"); + engineReset (); + } + + public Object clone() + { + return new MD5 (this); + } + + private MD5 (MD5 copy) + { + this (); + bytecount = copy.bytecount; + A = copy.A; + B = copy.B; + C = copy.C; + D = copy.D; + System.arraycopy (copy.W, 0, W, 0, 16); + } + + public int engineGetDigestLength() + { + return 16; + } + + // Intialize the A,B,C,D needed for the hash + public void engineReset() + { + bytecount = 0; + A = 0x67452301; + B = 0xefcdab89; + C = 0x98badcfe; + D = 0x10325476; + for(int i = 0; i < 16; i++) + W[i] = 0; + } + + public void engineUpdate (byte b) + { + int i = (int)bytecount % 64; + int shift = (3 - i % 4) * 8; + int idx = i / 4; + + // if you could index ints, this would be: W[idx][shift/8] = b + W[idx] = (W[idx] & ~(0xff << shift)) | ((b & 0xff) << shift); + + // if we've filled up a block, then process it + if ((++ bytecount) % 64 == 0) + munch (); + } + + public void engineUpdate (byte bytes[], int off, int len) + { + if (len < 0) + throw new ArrayIndexOutOfBoundsException (); + + int end = off + len; + while (off < end) + engineUpdate (bytes[off++]); + } + + public byte[] engineDigest() + { + long bitcount = bytecount * 8; + engineUpdate ((byte)0x80); // 10000000 in binary; the start of the padding + + // add the rest of the padding to fill this block out, but leave 8 + // bytes to put in the original bytecount + while ((int)bytecount % 64 != 56) + engineUpdate ((byte)0); + + // add the length of the original, unpadded block to the end of + // the padding + W[14] = SWAP((int)(0xffffffff & bitcount)); + W[15] = SWAP((int)(0xffffffff & (bitcount >>> 32))); + bytecount += 8; + + // digest the fully padded block + munch (); + + A = SWAP(A); + B = SWAP(B); + C = SWAP(C); + D = SWAP(D); + byte[] result = new byte[] {(byte)(A >>> 24), (byte)(A >>> 16), + (byte)(A >>> 8), (byte)A, + (byte)(B >>> 24), (byte)(B >>> 16), + (byte)(B >>> 8), (byte)B, + (byte)(C >>> 24), (byte)(C >>> 16), + (byte)(C >>> 8), (byte)C, + (byte)(D >>> 24), (byte)(D >>> 16), + (byte)(D >>> 8), (byte)D}; + + engineReset (); + return result; + } + + private int F( int X, int Y, int Z) + { + return ((X & Y) | (~X & Z)); + } + + private int G( int X, int Y, int Z) + { + return ((X & Z) | (Y & ~Z)); + } + + private int H( int X, int Y, int Z) + { + return (X ^ Y ^ Z); + } + + private int I( int X, int Y, int Z) + { + return (Y ^ (X | ~Z)); + } + + private int rotateLeft( int i, int count) + { + //Taken from FIPS 180-1 + return ( (i << count) | (i >>> (32 - count)) ) ; + } + + /* Round 1. */ + private int FF( int a, int b, int c, int d, int k, int s, int i) + { + /* Let [abcd k s i] denote the operation */ + a += F(b,c,d) + k + i; + return b + rotateLeft(a, s); + } + /* Round 2. */ + private int GG( int a, int b, int c, int d, int k, int s, int i) + { + /* Let [abcd k s i] denote the operation */ + a += G(b,c,d) + k + i; + return b + rotateLeft(a, s); + } + /* Round 3. */ + private int HH( int a, int b, int c, int d, int k, int s, int i) + { + /* Let [abcd k s t] denote the operation */ + a += H(b,c,d) + k + i; + return b + rotateLeft(a, s); + } + + /* Round 4. */ + private int II( int a, int b, int c, int d, int k, int s, int i) + { + /* Let [abcd k s t] denote the operation */ + a += I(b,c,d) + k + i; + return b + rotateLeft(a, s); + } + + private int SWAP(int n) + { + //Copied from md5.c in FSF Gnu Privacy Guard 0.9.2 + return (( (0xff & n) << 24) | ((n & 0xff00) << 8) | ((n >>> 8) & 0xff00) | (n >>> 24)); + } + + private void munch() + { + int AA,BB,CC,DD, j; + int X[] = new int[16]; + + /* Copy block i into X. */ + for(j = 0; j < 16; j++) + X[j] = SWAP(W[j]); + + /* Save A as AA, B as BB, C as CC, and D as DD. */ + AA = A; + BB = B; + CC = C; + DD = D; + + /* The hex constants are from md5.c + in FSF Gnu Privacy Guard 0.9.2 */ + /* Round 1. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + A = FF(A,B,C,D, X[0], 7, 0xd76aa478); + D = FF(D,A,B,C, X[1], 12, 0xe8c7b756); + C = FF(C,D,A,B, X[2], 17, 0x242070db); + B = FF(B,C,D,A, X[3], 22, 0xc1bdceee); + + A = FF(A,B,C,D, X[4], 7, 0xf57c0faf); + D = FF(D,A,B,C, X[5], 12, 0x4787c62a); + C = FF(C,D,A,B, X[6], 17, 0xa8304613); + B = FF(B,C,D,A, X[7], 22, 0xfd469501); + + A = FF(A,B,C,D, X[8], 7, 0x698098d8); + D = FF(D,A,B,C, X[9], 12, 0x8b44f7af); + C = FF(C,D,A,B, X[10], 17, 0xffff5bb1); + B = FF(B,C,D,A, X[11], 22, 0x895cd7be); + + A = FF(A,B,C,D, X[12], 7, 0x6b901122); + D = FF(D,A,B,C, X[13], 12, 0xfd987193); + C = FF(C,D,A,B, X[14], 17, 0xa679438e); + B = FF(B,C,D,A, X[15], 22, 0x49b40821); + + /* Round 2. */ + /* Let [abcd k s i] denote the operation + a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + A = GG(A,B,C,D, X[1], 5, 0xf61e2562); + D = GG(D,A,B,C, X[6], 9, 0xc040b340); + C = GG(C,D,A,B, X[11], 14, 0x265e5a51); + B = GG(B,C,D,A, X[0], 20, 0xe9b6c7aa); + + A = GG(A,B,C,D, X[5], 5, 0xd62f105d); + D = GG(D,A,B,C, X[10], 9, 0x02441453); + C = GG(C,D,A,B, X[15], 14, 0xd8a1e681); + B = GG(B,C,D,A, X[4], 20, 0xe7d3fbc8); + + A = GG(A,B,C,D, X[9], 5, 0x21e1cde6); + D = GG(D,A,B,C, X[14], 9, 0xc33707d6); + C = GG(C,D,A,B, X[3], 14, 0xf4d50d87); + B = GG(B,C,D,A, X[8], 20, 0x455a14ed); + + A = GG(A,B,C,D, X[13], 5, 0xa9e3e905); + D = GG(D,A,B,C, X[2], 9, 0xfcefa3f8); + C = GG(C,D,A,B, X[7], 14, 0x676f02d9); + B = GG(B,C,D,A, X[12], 20, 0x8d2a4c8a); + + /* Round 3. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + A = HH(A,B,C,D, X[5], 4, 0xfffa3942); + D = HH(D,A,B,C, X[8], 11, 0x8771f681); + C = HH(C,D,A,B, X[11], 16, 0x6d9d6122); + B = HH(B,C,D,A, X[14], 23, 0xfde5380c); + + A = HH(A,B,C,D, X[1], 4, 0xa4beea44); + D = HH(D,A,B,C, X[4], 11, 0x4bdecfa9); + C = HH(C,D,A,B, X[7], 16, 0xf6bb4b60); + B = HH(B,C,D,A, X[10], 23, 0xbebfbc70); + + A = HH(A,B,C,D, X[13], 4, 0x289b7ec6); + D = HH(D,A,B,C, X[0], 11, 0xeaa127fa); + C = HH(C,D,A,B, X[3], 16, 0xd4ef3085); + B = HH(B,C,D,A, X[6], 23, 0x04881d05); + + A = HH(A,B,C,D, X[9], 4, 0xd9d4d039); + D = HH(D,A,B,C, X[12], 11, 0xe6db99e5); + C = HH(C,D,A,B, X[15], 16, 0x1fa27cf8); + B = HH(B,C,D,A, X[2], 23, 0xc4ac5665); + + /* Round 4. */ + /* Let [abcd k s t] denote the operation + a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ + /* Do the following 16 operations. */ + A = II(A,B,C,D, X[0], 6, 0xf4292244); + D = II(D,A,B,C, X[7], 10, 0x432aff97); + C = II(C,D,A,B, X[14], 15, 0xab9423a7); + B = II(B,C,D,A, X[5], 21, 0xfc93a039); + + A = II(A,B,C,D, X[12], 6, 0x655b59c3); + D = II(D,A,B,C, X[3], 10, 0x8f0ccc92); + C = II(C,D,A,B, X[10], 15, 0xffeff47d); + B = II(B,C,D,A, X[1], 21, 0x85845dd1); + + A = II(A,B,C,D, X[8], 6, 0x6fa87e4f); + D = II(D,A,B,C, X[15], 10, 0xfe2ce6e0); + C = II(C,D,A,B, X[6], 15, 0xa3014314); + B = II(B,C,D,A, X[13], 21, 0x4e0811a1); + + A = II(A,B,C,D, X[4], 6, 0xf7537e82); + D = II(D,A,B,C, X[11], 10, 0xbd3af235); + C = II(C,D,A,B, X[2], 15, 0x2ad7d2bb); + B = II(B,C,D,A, X[9], 21, 0xeb86d391); + + /* Then perform the following additions. (That is increment each + of the four registers by the value it had before this block + was started.) */ + A = A + AA; + B = B + BB; + C = C + CC; + D = D + DD; + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/SHA1PRNG.java gcc-3.3/libjava/gnu/java/security/provider/SHA1PRNG.java *** gcc-3.2.3/libjava/gnu/java/security/provider/SHA1PRNG.java 2002-01-22 22:40:02.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/SHA1PRNG.java 2003-02-11 00:08:53.000000000 +0000 *************** *** 1,5 **** /* SHA1PRNG.java --- Secure Random SPI SHA1PRNG ! Copyright (C) 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SHA1PRNG.java --- Secure Random SPI SHA1PRNG ! Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class SHA1PRNG extends SecureRand *** 51,77 **** byte data[]; int seedpos; int datapos; public SHA1PRNG() { try { digest = MessageDigest.getInstance("SHA"); } catch ( NoSuchAlgorithmException nsae) { ! System.out.println("Failed to find SHA Message Digest: " + nsae); ! nsae.printStackTrace(); } seed = new byte[20]; seedpos = 0; data = new byte[40]; ! datapos = 0; ! ! new Random().nextBytes(seed); ! ! byte digestdata[]; ! digestdata = digest.digest( data ); ! System.arraycopy( digestdata, 0, data, 0, 20); ! } public void engineSetSeed(byte[] seed) --- 51,72 ---- byte data[]; int seedpos; int datapos; + private boolean seeded = false; // set to true when we seed this public SHA1PRNG() { try { digest = MessageDigest.getInstance("SHA"); } catch ( NoSuchAlgorithmException nsae) { ! // System.out.println("Failed to find SHA Message Digest: " + nsae); ! // nsae.printStackTrace(); ! throw new InternalError ("no SHA implementation found"); } seed = new byte[20]; seedpos = 0; data = new byte[40]; ! datapos = 20; // try to force hashing a first block } public void engineSetSeed(byte[] seed) *************** public class SHA1PRNG extends SecureRand *** 84,89 **** --- 79,85 ---- public void engineNextBytes(byte[] bytes) { + ensureIsSeeded (); int loc = 0; while (loc < bytes.length) { *************** public class SHA1PRNG extends SecureRand *** 113,116 **** --- 109,126 ---- engineNextBytes( tmp ); return tmp; } + + private void ensureIsSeeded() + { + if (!seeded) + { + new Random(0L).nextBytes(seed); + + byte[] digestdata = digest.digest(data); + System.arraycopy(digestdata, 0, data, 0, 20); + + seeded = true; + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/provider/SHA.java gcc-3.3/libjava/gnu/java/security/provider/SHA.java *** gcc-3.2.3/libjava/gnu/java/security/provider/SHA.java 2002-01-22 22:40:02.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/provider/SHA.java 2002-11-05 04:12:04.000000000 +0000 *************** *** 1,5 **** /* SHA.java -- Class implementing the SHA-1 algorithm as specified in [1]. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SHA.java -- Class implementing the SHA-1 algorithm as specified in [1]. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class SHA extends MessageDigest i *** 58,77 **** public int engineGetDigestLength() { ! return 16; } public void engineUpdate (byte b) { ! int i = (int)bytecount % 64; ! int shift = (3 - i % 4) * 8; int idx = i / 4; ! // if you could index ints, this would be: W[idx][shift/8] = b ! W[idx] = (W[idx] & ~(0xff << shift)) | ((b & 0xff) << shift); // if we've filled up a block, then process it ! if ((++ bytecount) % 64 == 0) munch (); } --- 58,77 ---- public int engineGetDigestLength() { ! return 20; } public void engineUpdate (byte b) { ! int i = ((int)bytecount) & 0x3f; //wgs ! int shift = (3 - i % 4) << 3; int idx = i / 4; ! i = (int)b; ! W[idx] = (W[idx] & ~(0xff << shift)) | ((i & 0xff) << shift); // if we've filled up a block, then process it ! if (((++bytecount) & 0x3f) == 0) munch (); } *************** public class SHA extends MessageDigest i *** 99,110 **** public byte[] engineDigest () { ! long bitcount = bytecount * 8; engineUpdate ((byte)0x80); // 10000000 in binary; the start of the padding // add the rest of the padding to fill this block out, but leave 8 // bytes to put in the original bytecount ! while ((int)bytecount % 64 != 56) engineUpdate ((byte)0); // add the length of the original, unpadded block to the end of --- 99,110 ---- public byte[] engineDigest () { ! long bitcount = bytecount << 3; engineUpdate ((byte)0x80); // 10000000 in binary; the start of the padding // add the rest of the padding to fill this block out, but leave 8 // bytes to put in the original bytecount ! while ((bytecount & 0x3f) != 56) engineUpdate ((byte)0); // add the length of the original, unpadded block to the end of diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/security/util/Prime.java gcc-3.3/libjava/gnu/java/security/util/Prime.java *** gcc-3.2.3/libjava/gnu/java/security/util/Prime.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/security/util/Prime.java 2002-08-11 16:34:44.000000000 +0000 *************** *** 0 **** --- 1,164 ---- + /* Prime.java --- Prime number generation utilities + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package gnu.java.security.util; + import java.math.BigInteger; + import java.util.Random; + //import java.security.SecureRandom; + + public final class Prime + { + + /* + See IEEE P1363 A.15.4 (10/05/98 Draft) + */ + public static BigInteger generateRandomPrime( int pmin, int pmax, BigInteger f ) + { + BigInteger d; + + //Step 1 - generate prime + BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); + if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmin ) ) <= 0 ) + { + p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin ).subtract( p ) ); + } + + //Step 2 - test for even + if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) + p.add( BigInteger.valueOf( 1 ) ); + + for(;;) + { + //Step 3 + if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) + { + //Step 3.1 + p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); + p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); + p = p.subtract( BigInteger.valueOf( 1 ) ); + + //Step 3.2 + // put step 2 code here so looping code is cleaner + //Step 2 - test for even + if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) + p.add( BigInteger.valueOf( 1 ) ); + continue; + } + + //Step 4 - compute GCD + d = p.subtract( BigInteger.valueOf(1) ); + d = d.gcd( f ); + + //Step 5 - test d + if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) + { + //Step 5.1 - test primality + if( p.isProbablePrime( 1 ) == true ) + { + //Step 5.2; + return p; + } + } + //Step 6 + p = p.add( BigInteger.valueOf( 2 ) ); + + //Step 7 + } + } + + + /* + See IEEE P1363 A.15.5 (10/05/98 Draft) + */ + public static BigInteger generateRandomPrime( BigInteger r, BigInteger a, int pmin, int pmax, BigInteger f ) + { + BigInteger d, w; + + //Step 1 - generate prime + BigInteger p = new BigInteger( (pmax + pmin)/2, new Random() ); + + steptwo:{ //Step 2 + w = p.mod( r.multiply( BigInteger.valueOf(2) )); + + //Step 3 + p = p.add( r.multiply( BigInteger.valueOf(2) ) ); + p = p.subtract( w ); + p = p.add(a); + + //Step 4 - test for even + if( p.mod( BigInteger.valueOf(2) ).compareTo( BigInteger.valueOf( 0 )) == 0) + p.add( r ); + + for(;;) + { + //Step 5 + if( p.compareTo( BigInteger.valueOf( 1 ).shiftLeft( pmax)) > 0) + { + //Step 5.1 + p = p.subtract( BigInteger.valueOf( 1 ).shiftLeft( pmax) ); + p = p.add( BigInteger.valueOf( 1 ).shiftLeft( pmin) ); + p = p.subtract( BigInteger.valueOf( 1 ) ); + + //Step 5.2 - goto to Step 2 + break steptwo; + } + + //Step 6 + d = p.subtract( BigInteger.valueOf(1) ); + d = d.gcd( f ); + + //Step 7 - test d + if( d.compareTo( BigInteger.valueOf( 1 ) ) == 0) + { + //Step 7.1 - test primality + if( p.isProbablePrime( 1 ) == true ) + { + //Step 7.2; + return p; + } + } + //Step 8 + p = p.add( r.multiply( BigInteger.valueOf(2) ) ); + + //Step 9 + } + } + //Should never reach here but makes the compiler happy + return BigInteger.valueOf(0); + } + } diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/text/SentenceBreakIterator.java gcc-3.3/libjava/gnu/java/text/SentenceBreakIterator.java *** gcc-3.2.3/libjava/gnu/java/text/SentenceBreakIterator.java 2002-01-22 22:40:02.000000000 +0000 --- gcc-3.3/libjava/gnu/java/text/SentenceBreakIterator.java 2002-05-12 01:11:18.000000000 +0000 *************** *** 1,5 **** /* SentenceBreakIterator.java - Default sentence BreakIterator. ! Copyright (C) 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SentenceBreakIterator.java - Default sentence BreakIterator. ! Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class SentenceBreakIterator exten *** 91,103 **** while (n != CharacterIterator.DONE && Character.getType(n) == Character.END_PUNCTUATION) n = iter.next(); ! // Skip spaces. ! while (n != CharacterIterator.DONE ! && Character.getType(n) == Character.SPACE_SEPARATOR) ! n = iter.next(); ! // Skip optional paragraph separator. ! if (n != CharacterIterator.DONE ! && Character.getType(n) == Character.PARAGRAPH_SEPARATOR) n = iter.next(); // There's always a break somewhere after `!' or `?'. --- 91,98 ---- while (n != CharacterIterator.DONE && Character.getType(n) == Character.END_PUNCTUATION) n = iter.next(); ! // Skip (java) space, line and paragraph separators. ! while (n != CharacterIterator.DONE && Character.isWhitespace(n)) n = iter.next(); // There's always a break somewhere after `!' or `?'. *************** public class SentenceBreakIterator exten *** 111,121 **** while (n != CharacterIterator.DONE && Character.getType(n) == Character.END_PUNCTUATION) n = iter.next(); ! // Skip spaces. We keep count because we need at least ! // one for this period to represent a terminator. int spcount = 0; ! while (n != CharacterIterator.DONE ! && Character.getType(n) == Character.SPACE_SEPARATOR) { n = iter.next(); ++spcount; --- 106,116 ---- while (n != CharacterIterator.DONE && Character.getType(n) == Character.END_PUNCTUATION) n = iter.next(); ! // Skip (java) space, line and paragraph separators. ! // We keep count because we need at least one for this period to ! // represent a terminator. int spcount = 0; ! while (n != CharacterIterator.DONE && Character.isWhitespace(n)) { n = iter.next(); ++spcount; *************** public class SentenceBreakIterator exten *** 162,168 **** if (! Character.isLowerCase(c) && (nt == Character.START_PUNCTUATION ! || nt == Character.SPACE_SEPARATOR)) { int save = iter.getIndex(); int save_nt = nt; --- 157,163 ---- if (! Character.isLowerCase(c) && (nt == Character.START_PUNCTUATION ! || Character.isWhitespace(n))) { int save = iter.getIndex(); int save_nt = nt; *************** public class SentenceBreakIterator exten *** 173,184 **** n = iter.previous(); if (n == CharacterIterator.DONE) break; ! if (Character.getType(n) == Character.SPACE_SEPARATOR) { ! // Must have at least once space after the `.'. int save2 = iter.getIndex(); while (n != CharacterIterator.DONE ! && Character.getType(n) == Character.SPACE_SEPARATOR) n = iter.previous(); // Skip close punctuation. while (n != CharacterIterator.DONE --- 168,179 ---- n = iter.previous(); if (n == CharacterIterator.DONE) break; ! if (Character.isWhitespace(n)) { ! // Must have at least one (java) space after the `.'. int save2 = iter.getIndex(); while (n != CharacterIterator.DONE ! && Character.isWhitespace(n)) n = iter.previous(); // Skip close punctuation. while (n != CharacterIterator.DONE *************** public class SentenceBreakIterator exten *** 203,215 **** period = iter.getIndex(); break; } ! else if (nt == Character.SPACE_SEPARATOR || nt == Character.END_PUNCTUATION) { int save = iter.getIndex(); ! // Skip spaces. while (n != CharacterIterator.DONE ! && Character.getType(n) == Character.SPACE_SEPARATOR) n = iter.previous(); // Skip close punctuation. while (n != CharacterIterator.DONE --- 198,210 ---- period = iter.getIndex(); break; } ! else if (Character.isWhitespace(n) || nt == Character.END_PUNCTUATION) { int save = iter.getIndex(); ! // Skip (java) space, line and paragraph separators. while (n != CharacterIterator.DONE ! && Character.isWhitespace(n)) n = iter.previous(); // Skip close punctuation. while (n != CharacterIterator.DONE diff -Nrc3pad gcc-3.2.3/libjava/gnu/java/util/EmptyEnumeration.java gcc-3.3/libjava/gnu/java/util/EmptyEnumeration.java *** gcc-3.2.3/libjava/gnu/java/util/EmptyEnumeration.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/gnu/java/util/EmptyEnumeration.java 2002-05-24 11:57:06.000000000 +0000 *************** *** 0 **** --- 1,96 ---- + /* EmptyEnumeration.java -- a constant empty enumeration + Copyright (C) 2001, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package gnu.java.util; + + import java.io.Serializable; + import java.util.Enumeration; + import java.util.NoSuchElementException; + + /** + * This is a helper class that produces an empty Enumerations. There is only + * one instance of this class that can be used whenever one needs a + * non-null but empty enumeration. Using this class prevents multiple + * small objects and inner classes. getInstance() returns + * the only instance of this class. It can be shared by multiple objects and + * threads. + * + * @author Mark Wielaard (mark@klomp.org) + */ + public final class EmptyEnumeration implements Enumeration, Serializable + { + /** The only instance of this class */ + private static final EmptyEnumeration instance = new EmptyEnumeration(); + + /** + * Private constructor that creates a new empty Enumeration. + */ + private EmptyEnumeration() + { + } + + /** + * Returns the only instance of this class. + * It can be shared by multiple objects and threads. + * + * @return the common empty enumeration + */ + public static EmptyEnumeration getInstance() + { + return instance; + } + + /** + * Returns false, since there are no elements. + * + * @return false + */ + public boolean hasMoreElements() + { + return false; + } + + /** + * Always throws NoSuchElementException, since it is empty. + * + * @throws NoSuchElementException this is empty + */ + public Object nextElement() + { + throw new NoSuchElementException(); + } + } diff -Nrc3pad gcc-3.2.3/libjava/include/config.h.in gcc-3.3/libjava/include/config.h.in *** gcc-3.2.3/libjava/include/config.h.in 2002-03-18 06:30:26.000000000 +0000 --- gcc-3.3/libjava/include/config.h.in 2003-01-31 18:01:17.000000000 +0000 *************** *** 132,137 **** --- 132,138 ---- #undef HAVE_READDIR_R #undef HAVE_GETHOSTBYNAME_R #undef HAVE_GETHOSTBYADDR_R + #undef HAVE_FTRUNCATE /* Define if you want a bytecode interpreter. */ #undef INTERPRETER *************** *** 174,185 **** /* Define if you are using JVMPI. */ #undef ENABLE_JVMPI /* Define if you have the access function. */ #undef HAVE_ACCESS - /* Define if you have the backtrace function. */ - #undef HAVE_BACKTRACE - /* Define if you have the chmod function. */ #undef HAVE_CHMOD --- 175,189 ---- /* Define if you are using JVMPI. */ #undef ENABLE_JVMPI + /* Define if your platform has a working backtrace() function. */ + #undef HAVE_BACKTRACE + + /* Define if your platform has the global _timezone variable. */ + #undef HAVE_UNDERSCORE_TIMEZONE + /* Define if you have the access function. */ #undef HAVE_ACCESS /* Define if you have the chmod function. */ #undef HAVE_CHMOD *************** *** 198,203 **** --- 202,210 ---- /* Define if you have the ftime function. */ #undef HAVE_FTIME + /* Define if you have the ftruncate function. */ + #undef HAVE_FTRUNCATE + /* Define if you have the getcwd function. */ #undef HAVE_GETCWD *************** *** 336,341 **** --- 343,351 ---- /* Define if you have the header file. */ #undef HAVE_LOCALE_H + /* Define if you have the header file. */ + #undef HAVE_NET_IF_H + /* Define if you have the header file. */ #undef HAVE_NETDB_H *************** *** 384,389 **** --- 394,402 ---- /* Define if the compiler is configured for setjmp/longjmp exceptions. */ #undef SJLJ_EXCEPTIONS + /* Indicate that linker is not able to 8-byte align static data */ + #undef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS + /* Required define if using POSIX threads */ #undef _REENTRANT *************** *** 414,420 **** /* The number of bytes in type void * */ #undef SIZEOF_VOID_P ! /* Short GCJ version */ #undef GCJVERSION /* Define if is available */ --- 427,433 ---- /* The number of bytes in type void * */ #undef SIZEOF_VOID_P ! /* Short GCJ version ID */ #undef GCJVERSION /* Define if is available */ diff -Nrc3pad gcc-3.2.3/libjava/include/.cvsignore gcc-3.3/libjava/include/.cvsignore *** gcc-3.2.3/libjava/include/.cvsignore 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/include/.cvsignore 2002-10-10 05:21:53.000000000 +0000 *************** *** 0 **** --- 1 ---- + stamp-h1.in diff -Nrc3pad gcc-3.2.3/libjava/include/i386-signal.h gcc-3.3/libjava/include/i386-signal.h *** gcc-3.2.3/libjava/include/i386-signal.h 2002-03-18 17:26:11.000000000 +0000 --- gcc-3.3/libjava/include/i386-signal.h 2002-03-18 17:11:43.000000000 +0000 *************** struct old_i386_kernel_sigaction { *** 108,129 **** void (*sa_restorer) (void); }; ! #define INIT_SEGV \ ! do \ ! { \ ! nullp = new java::lang::NullPointerException (); \ struct old_i386_kernel_sigaction kact; \ kact.k_sa_handler = catch_segv; \ kact.k_sa_mask = 0; \ kact.k_sa_flags = 0; \ syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \ ! } \ while (0) #define INIT_FPE \ do \ ! { \ ! arithexception = new java::lang::ArithmeticException \ (JvNewStringLatin1 ("/ by zero")); \ struct old_i386_kernel_sigaction kact; \ kact.k_sa_handler = catch_fpe; \ --- 108,129 ---- void (*sa_restorer) (void); }; ! #define INIT_SEGV \ ! do \ ! { \ ! nullp = new java::lang::NullPointerException (); \ struct old_i386_kernel_sigaction kact; \ kact.k_sa_handler = catch_segv; \ kact.k_sa_mask = 0; \ kact.k_sa_flags = 0; \ syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \ ! } \ while (0) #define INIT_FPE \ do \ ! { \ ! arithexception = new java::lang::ArithmeticException \ (JvNewStringLatin1 ("/ by zero")); \ struct old_i386_kernel_sigaction kact; \ kact.k_sa_handler = catch_fpe; \ diff -Nrc3pad gcc-3.2.3/libjava/include/java-insns.h gcc-3.3/libjava/include/java-insns.h *** gcc-3.2.3/libjava/include/java-insns.h 2001-11-25 19:48:19.000000000 +0000 --- gcc-3.3/libjava/include/java-insns.h 2002-04-26 22:39:29.000000000 +0000 *************** *** 1,6 **** // java-insns.h - Instruction encodings. This is -*- c++ -*- ! /* Copyright (C) 1999, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // java-insns.h - Instruction encodings. This is -*- c++ -*- ! /* Copyright (C) 1999, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** enum java_opcode *** 199,205 **** op_invokespecial = 0xb7, op_invokestatic = 0xb8, op_invokeinterface = 0xb9, ! op_xxxunusedxxx1 = 0xba, op_new = 0xbb, op_newarray = 0xbc, op_anewarray = 0xbd, --- 199,207 ---- op_invokespecial = 0xb7, op_invokestatic = 0xb8, op_invokeinterface = 0xb9, ! ! // 0xba is unused. ! op_new = 0xbb, op_newarray = 0xbc, op_anewarray = 0xbd, diff -Nrc3pad gcc-3.2.3/libjava/include/java-interp.h gcc-3.3/libjava/include/java-interp.h *** gcc-3.2.3/libjava/include/java-interp.h 2001-11-26 06:40:05.000000000 +0000 --- gcc-3.3/libjava/include/java-interp.h 2002-12-19 19:32:17.000000000 +0000 *************** *** 1,6 **** // java-interp.h - Header file for the bytecode interpreter. -*- c++ -*- ! /* Copyright (C) 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // java-interp.h - Header file for the bytecode interpreter. -*- c++ -*- ! /* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** details. */ *** 13,18 **** --- 13,19 ---- #include #include + #include #ifdef INTERPRETER *************** details. */ *** 20,25 **** --- 21,28 ---- #include #include + #include + #include extern "C" { #include *************** extern "C" { *** 28,34 **** extern inline jboolean _Jv_IsInterpretedClass (jclass c) { ! return (c->loader != 0); } struct _Jv_ResolvedMethod; --- 31,37 ---- extern inline jboolean _Jv_IsInterpretedClass (jclass c) { ! return (c->accflags & java::lang::reflect::Modifier::INTERPRETED) != 0; } struct _Jv_ResolvedMethod; *************** void _Jv_VerifyMethod (_Jv_InterpMethod *** 49,62 **** class _Jv_InterpClass; class _Jv_InterpMethod; ! class _Jv_InterpMethodInvocation; class _Jv_InterpException { ! int start_pc; ! int end_pc; ! int handler_pc; ! int handler_type; friend class _Jv_ClassReader; friend class _Jv_InterpMethod; --- 52,73 ---- class _Jv_InterpClass; class _Jv_InterpMethod; ! ! // Before a method is "compiled" we store values as the bytecode PC, ! // an int. Afterwards we store them as pointers into the prepared ! // code itself. ! union _Jv_InterpPC ! { ! int i; ! void *p; ! }; class _Jv_InterpException { ! _Jv_InterpPC start_pc; ! _Jv_InterpPC end_pc; ! _Jv_InterpPC handler_pc; ! _Jv_InterpPC handler_type; friend class _Jv_ClassReader; friend class _Jv_InterpMethod; *************** class _Jv_InterpMethod : public _Jv_Meth *** 92,97 **** --- 103,110 ---- _Jv_ushort exc_count; + void *prepared; + unsigned char* bytecode () { return *************** class _Jv_InterpMethod : public _Jv_Meth *** 99,105 **** + ROUND((sizeof (_Jv_InterpMethod) + exc_count*sizeof (_Jv_InterpException)), 4); } ! _Jv_InterpException * exceptions () { return (_Jv_InterpException*) (this+1); --- 112,118 ---- + ROUND((sizeof (_Jv_InterpMethod) + exc_count*sizeof (_Jv_InterpException)), 4); } ! _Jv_InterpException * exceptions () { return (_Jv_InterpException*) (this+1); *************** class _Jv_InterpMethod : public _Jv_Meth *** 115,154 **** // return the method's invocation pointer (a stub). void *ncode (); ! void continue1 (_Jv_InterpMethodInvocation *inv); static void run_normal (ffi_cif*, void*, ffi_raw*, void*); static void run_synch_object (ffi_cif*, void*, ffi_raw*, void*); static void run_synch_class (ffi_cif*, void*, ffi_raw*, void*); ! inline jobject run (ffi_cif*, void*, ffi_raw*, ! _Jv_InterpMethodInvocation*); ! ! bool find_exception (jobject ex, ! _Jv_InterpMethodInvocation *inv); public: static void dump_object(jobject o); friend class _Jv_ClassReader; - friend class _Jv_InterpMethodInvocation; friend class _Jv_BytecodeVerifier; friend void _Jv_PrepareClass(jclass); - }; - - class _Jv_InterpMethodInvocation { - _Jv_InterpMethod *running; - _Jv_word *sp; - unsigned char *pc; - _Jv_word state[0]; - - _Jv_word* stack_base () { return &state[0]; } - _Jv_word* local_base () { return &state[running->max_stack]; } ! friend class _Jv_InterpMethod; }; ! class _Jv_InterpClass : public java::lang::Class { _Jv_MethodBase **interpreted_methods; --- 128,156 ---- // return the method's invocation pointer (a stub). void *ncode (); ! void compile (const void * const *); static void run_normal (ffi_cif*, void*, ffi_raw*, void*); static void run_synch_object (ffi_cif*, void*, ffi_raw*, void*); static void run_synch_class (ffi_cif*, void*, ffi_raw*, void*); ! void run (void*, ffi_raw *); public: static void dump_object(jobject o); friend class _Jv_ClassReader; friend class _Jv_BytecodeVerifier; + friend class gnu::gcj::runtime::NameFinder; + friend class gnu::gcj::runtime::StackTrace; friend void _Jv_PrepareClass(jclass); ! #ifdef JV_MARKOBJ_DECL ! friend JV_MARKOBJ_DECL; ! #endif }; ! class _Jv_InterpClass : public java::lang::Class { _Jv_MethodBase **interpreted_methods; *************** class _Jv_InterpClass : public java::lan *** 157,162 **** --- 159,165 ---- friend class _Jv_ClassReader; friend class _Jv_InterpMethod; friend void _Jv_PrepareClass(jclass); + friend void _Jv_PrepareMissingMethods (jclass base2, jclass iface_class); friend void _Jv_InitField (jobject, jclass, int); #ifdef JV_MARKOBJ_DECL friend JV_MARKOBJ_DECL; *************** public: *** 212,217 **** --- 215,242 ---- } }; + // A structure of this type is used to link together interpreter + // invocations on the stack. + struct _Jv_MethodChain + { + const _Jv_InterpMethod *self; + _Jv_MethodChain **ptr; + _Jv_MethodChain *next; + + _Jv_MethodChain (const _Jv_InterpMethod *s, _Jv_MethodChain **n) + { + self = s; + ptr = n; + next = *n; + *n = this; + } + + ~_Jv_MethodChain () + { + *ptr = next; + } + }; + #endif /* INTERPRETER */ #endif /* __JAVA_INTERP_H__ */ diff -Nrc3pad gcc-3.2.3/libjava/include/jni.h gcc-3.3/libjava/include/jni.h *** gcc-3.2.3/libjava/include/jni.h 2002-03-19 21:47:03.000000000 +0000 --- gcc-3.3/libjava/include/jni.h 2002-12-03 03:54:05.000000000 +0000 *************** typedef void *jmethodID; *** 161,166 **** --- 161,167 ---- /* Version numbers. */ #define JNI_VERSION_1_1 0x00010001 #define JNI_VERSION_1_2 0x00010002 + #define JNI_VERSION_1_4 0x00010004 /* Used when releasing array elements. */ #define JNI_COMMIT 1 *************** typedef void *jmethodID; *** 172,183 **** #define JNI_EDETACHED -2 #define JNI_EVERSION -3 ! /* Linkage and calling conventions. This will need updating when we ! support Windows DLLs. */ #define JNIIMPORT #define JNIEXPORT #define JNICALL #ifdef __cplusplus extern "C" { --- 173,199 ---- #define JNI_EDETACHED -2 #define JNI_EVERSION -3 ! /* Linkage and calling conventions. */ ! #if defined (_WIN32) || defined (__WIN32__) || defined (WIN32) ! ! #define JNIIMPORT __declspec(dllimport) ! #define JNIEXPORT __declspec(dllexport) ! #define JNICALL __stdcall ! ! #else ! #define JNIIMPORT #define JNIEXPORT #define JNICALL + #endif /* !( _WIN32 || __WIN32__ || WIN32) */ + + #ifdef __GCJ_JNI_IMPL__ + #define JNIIMPEXP JNIEXPORT + #else + #define JNIIMPEXP JNIIMPORT + #endif /* ! __GCJ_JNI_IMPL__ */ + #ifdef __cplusplus extern "C" { *************** extern "C" *** 185,198 **** /* These functions might be defined in libraries which we load; the JNI implementation calls them at the appropriate times. */ ! extern jint JNI_OnLoad (JavaVM *, void *); ! extern void JNI_OnUnload (JavaVM *, void *); /* These functions are called by user code to start using the invocation API. */ ! extern jint JNI_GetDefaultJavaVMInitArgs (void *); ! extern jint JNI_CreateJavaVM (JavaVM **, void **, void *); ! extern jint JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); #ifdef __cplusplus }; --- 201,214 ---- /* These functions might be defined in libraries which we load; the JNI implementation calls them at the appropriate times. */ ! extern JNIEXPORT jint JNICALL JNI_OnLoad (JavaVM *, void *); ! extern JNIEXPORT void JNICALL JNI_OnUnload (JavaVM *, void *); /* These functions are called by user code to start using the invocation API. */ ! extern JNIIMPEXP jint JNICALL JNI_GetDefaultJavaVMInitArgs (void *); ! extern JNIIMPEXP jint JNICALL JNI_CreateJavaVM (JavaVM **, void **, void *); ! extern JNIIMPEXP jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *); #ifdef __cplusplus }; *************** struct JNINativeInterface *** 232,646 **** _Jv_func reserved2; _Jv_func reserved3; ! jint (*GetVersion) (JNIEnv *); ! jclass (*DefineClass) (JNIEnv *, jobject, ! const jbyte *, jsize); ! jclass (*FindClass) (JNIEnv *, const char *); ! jmethodID (*FromReflectedMethod) (JNIEnv *, jobject); ! jfieldID (*FromReflectedField) (JNIEnv *, jobject); ! jobject (*ToReflectedMethod) (JNIEnv *, jclass, jmethodID, ! jboolean); ! jclass (*GetSuperclass) (JNIEnv *, jclass); ! jboolean (*IsAssignableFrom) (JNIEnv *, jclass, jclass); ! jobject (*ToReflectedField) (JNIEnv *, jclass, jfieldID, ! jboolean); ! jint (*Throw) (JNIEnv *, jthrowable); ! jint (*ThrowNew) (JNIEnv *, jclass, const char *); ! jthrowable (*ExceptionOccurred) (JNIEnv *); ! void (*ExceptionDescribe) (JNIEnv *); ! void (*ExceptionClear) (JNIEnv *); ! void (*FatalError) (JNIEnv *, const char *); ! jint (*PushLocalFrame) (JNIEnv *, jint); ! jobject (*PopLocalFrame) (JNIEnv *, jobject); ! jobject (*NewGlobalRef) (JNIEnv *, jobject); ! void (*DeleteGlobalRef) (JNIEnv *, jobject); ! void (*DeleteLocalRef) (JNIEnv *, jobject); ! jboolean (*IsSameObject) (JNIEnv *, jobject, jobject); ! jobject (*NewLocalRef) (JNIEnv *, jobject); ! jint (*EnsureLocalCapacity) (JNIEnv *, jint); ! jobject (*AllocObject) (JNIEnv *, jclass); ! jobject (*NewObject) (JNIEnv *, jclass, jmethodID, ...); ! jobject (*NewObjectV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jobject (*NewObjectA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jclass (*GetObjectClass) (JNIEnv *, jobject); ! jboolean (*IsInstanceOf) (JNIEnv *, jobject, jclass); ! jmethodID (*GetMethodID) (JNIEnv *, jclass, const char *, ! const char *); ! jobject (*CallObjectMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jobject (*CallObjectMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jobject (*CallObjectMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jboolean (*CallBooleanMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jboolean (*CallBooleanMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jboolean (*CallBooleanMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jbyte (*CallByteMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jbyte (*CallByteMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jbyte (*CallByteMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jchar (*CallCharMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jchar (*CallCharMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jchar (*CallCharMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jshort (*CallShortMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jshort (*CallShortMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jshort (*CallShortMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jint (*CallIntMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jint (*CallIntMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jint (*CallIntMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jlong (*CallLongMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jlong (*CallLongMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jlong (*CallLongMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jfloat (*CallFloatMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jfloat (*CallFloatMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jfloat (*CallFloatMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jdouble (*CallDoubleMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jdouble (*CallDoubleMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jdouble (*CallDoubleMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! void (*CallVoidMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! void (*CallVoidMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! void (*CallVoidMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jobject (*CallNonvirtualObjectMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jobject (*CallNonvirtualObjectMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jobject (*CallNonvirtualObjectMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jboolean (*CallNonvirtualBooleanMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jboolean (*CallNonvirtualBooleanMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jboolean (*CallNonvirtualBooleanMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jbyte (*CallNonvirtualByteMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jbyte (*CallNonvirtualByteMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jbyte (*CallNonvirtualByteMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jchar (*CallNonvirtualCharMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jchar (*CallNonvirtualCharMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jchar (*CallNonvirtualCharMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jshort (*CallNonvirtualShortMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jshort (*CallNonvirtualShortMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jshort (*CallNonvirtualShortMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jint (*CallNonvirtualIntMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jint (*CallNonvirtualIntMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jint (*CallNonvirtualIntMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jlong (*CallNonvirtualLongMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jlong (*CallNonvirtualLongMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jlong (*CallNonvirtualLongMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jfloat (*CallNonvirtualFloatMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jfloat (*CallNonvirtualFloatMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jfloat (*CallNonvirtualFloatMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jdouble (*CallNonvirtualDoubleMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jdouble (*CallNonvirtualDoubleMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jdouble (*CallNonvirtualDoubleMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! void (*CallNonvirtualVoidMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! void (*CallNonvirtualVoidMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! void (*CallNonvirtualVoidMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jfieldID (*GetFieldID) (JNIEnv *, jclass, const char *, const char *); ! jobject (*GetObjectField) (JNIEnv *, jobject, jfieldID); ! jboolean (*GetBooleanField) (JNIEnv *, jobject, jfieldID); ! jbyte (*GetByteField) (JNIEnv *, jobject, jfieldID); ! jchar (*GetCharField) (JNIEnv *, jobject, jfieldID); ! jshort (*GetShortField) (JNIEnv *, jobject, jfieldID); ! jint (*GetIntField) (JNIEnv *, jobject, jfieldID); ! jlong (*GetLongField) (JNIEnv *, jobject, jfieldID); ! jfloat (*GetFloatField) (JNIEnv *, jobject, jfieldID); ! jdouble (*GetDoubleField) (JNIEnv *, jobject, jfieldID); ! void (*SetObjectField) (JNIEnv *, jobject, jfieldID, jobject); ! void (*SetBooleanField) (JNIEnv *, jobject, jfieldID, jboolean); ! void (*SetByteField) (JNIEnv *, jobject, jfieldID, jbyte); ! void (*SetCharField) (JNIEnv *, jobject, jfieldID, jchar); ! void (*SetShortField) (JNIEnv *, jobject, jfieldID, jshort); ! void (*SetIntField) (JNIEnv *, jobject, jfieldID, jint); ! void (*SetLongField) (JNIEnv *, jobject, jfieldID, jlong); ! void (*SetFloatField) (JNIEnv *, jobject, jfieldID, jfloat); ! void (*SetDoubleField) (JNIEnv *, jobject, jfieldID, jdouble); ! jmethodID (*GetStaticMethodID) (JNIEnv *, jclass, const char *, const char *); ! jobject (*CallStaticObjectMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jobject (*CallStaticObjectMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jobject (*CallStaticObjectMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jboolean (*CallStaticBooleanMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jboolean (*CallStaticBooleanMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jboolean (*CallStaticBooleanMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jbyte (*CallStaticByteMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jbyte (*CallStaticByteMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jbyte (*CallStaticByteMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jchar (*CallStaticCharMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jchar (*CallStaticCharMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jchar (*CallStaticCharMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jshort (*CallStaticShortMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jshort (*CallStaticShortMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jshort (*CallStaticShortMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jint (*CallStaticIntMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jint (*CallStaticIntMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jint (*CallStaticIntMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jlong (*CallStaticLongMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jlong (*CallStaticLongMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jlong (*CallStaticLongMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jfloat (*CallStaticFloatMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jfloat (*CallStaticFloatMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jfloat (*CallStaticFloatMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jdouble (*CallStaticDoubleMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jdouble (*CallStaticDoubleMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jdouble (*CallStaticDoubleMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! void (*CallStaticVoidMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! void (*CallStaticVoidMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! void (*CallStaticVoidMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jfieldID (*GetStaticFieldID) (JNIEnv *, jclass, const char *, ! const char *); ! jobject (*GetStaticObjectField) (JNIEnv *, jclass, jfieldID); ! jboolean (*GetStaticBooleanField) (JNIEnv *, jclass, jfieldID); ! jbyte (*GetStaticByteField) (JNIEnv *, jclass, jfieldID); ! jchar (*GetStaticCharField) (JNIEnv *, jclass, jfieldID); ! jshort (*GetStaticShortField) (JNIEnv *, jclass, jfieldID); ! jint (*GetStaticIntField) (JNIEnv *, jclass, jfieldID); ! jlong (*GetStaticLongField) (JNIEnv *, jclass, jfieldID); ! jfloat (*GetStaticFloatField) (JNIEnv *, jclass, jfieldID); ! jdouble (*GetStaticDoubleField) (JNIEnv *, jclass, jfieldID); ! void (*SetStaticObjectField) (JNIEnv *, jclass, jfieldID, jobject); ! void (*SetStaticBooleanField) (JNIEnv *, jclass, jfieldID, jboolean); ! void (*SetStaticByteField) (JNIEnv *, jclass, jfieldID, jbyte); ! void (*SetStaticCharField) (JNIEnv *, jclass, jfieldID, jchar); ! void (*SetStaticShortField) (JNIEnv *, jclass, jfieldID, jshort); ! void (*SetStaticIntField) (JNIEnv *, jclass, jfieldID, jint); ! void (*SetStaticLongField) (JNIEnv *, jclass, jfieldID, jlong); ! void (*SetStaticFloatField) (JNIEnv *, jclass, jfieldID, jfloat); ! void (*SetStaticDoubleField) (JNIEnv *, jclass, jfieldID, jdouble); ! jstring (*NewString) (JNIEnv *, const jchar *, jsize); ! jsize (*GetStringLength) (JNIEnv *, jstring); ! const jchar * (*GetStringChars) (JNIEnv *, jstring, jboolean *); ! void (*ReleaseStringChars) (JNIEnv *, jstring, const jchar *); ! jstring (*NewStringUTF) (JNIEnv *, const char *); ! jsize (*GetStringUTFLength) (JNIEnv *, jstring); ! const char * (*GetStringUTFChars) (JNIEnv *, jstring, jboolean *); ! void (*ReleaseStringUTFChars) (JNIEnv *, jstring, const char *); ! jsize (*GetArrayLength) (JNIEnv *, jarray); ! jarray (*NewObjectArray) (JNIEnv *, jsize, jclass, jobject); ! jobject (*GetObjectArrayElement) (JNIEnv *, jobjectArray, jsize); ! void (*SetObjectArrayElement) (JNIEnv *, jobjectArray, jsize, ! jobject); ! jbooleanArray (*NewBooleanArray) (JNIEnv *, jsize); ! jbyteArray (*NewByteArray) (JNIEnv *, jsize); ! jcharArray (*NewCharArray) (JNIEnv *, jsize); ! jshortArray (*NewShortArray) (JNIEnv *, jsize); ! jintArray (*NewIntArray) (JNIEnv *, jsize); ! jlongArray (*NewLongArray) (JNIEnv *, jsize); ! jfloatArray (*NewFloatArray) (JNIEnv *, jsize); ! jdoubleArray (*NewDoubleArray) (JNIEnv *, jsize); ! jboolean * (*GetBooleanArrayElements) (JNIEnv *, jbooleanArray, ! jboolean *); ! jbyte * (*GetByteArrayElements) (JNIEnv *, jbyteArray, ! jboolean *); ! jchar * (*GetCharArrayElements) (JNIEnv *, jcharArray, ! jboolean *); ! jshort * (*GetShortArrayElements) (JNIEnv *, jshortArray, ! jboolean *); ! jint * (*GetIntArrayElements) (JNIEnv *, jintArray, ! jboolean *); ! jlong * (*GetLongArrayElements) (JNIEnv *, jlongArray, ! jboolean *); ! jfloat * (*GetFloatArrayElements) (JNIEnv *, jfloatArray, ! jboolean *); ! jdouble * (*GetDoubleArrayElements) (JNIEnv *, jdoubleArray, ! jboolean *); ! void (*ReleaseBooleanArrayElements) (JNIEnv *, jbooleanArray, ! jboolean *, jint); ! void (*ReleaseByteArrayElements) (JNIEnv *, jbyteArray, ! jbyte *, jint); ! void (*ReleaseCharArrayElements) (JNIEnv *, jcharArray, ! jchar *, jint); ! void (*ReleaseShortArrayElements) (JNIEnv *, jshortArray, ! jshort *, jint); ! void (*ReleaseIntArrayElements) (JNIEnv *, jintArray, ! jint *, jint); ! void (*ReleaseLongArrayElements) (JNIEnv *, jlongArray, ! jlong *, jint); ! void (*ReleaseFloatArrayElements) (JNIEnv *, jfloatArray, ! jfloat *, jint); ! void (*ReleaseDoubleArrayElements) (JNIEnv *, jdoubleArray, ! jdouble *, jint); ! void (*GetBooleanArrayRegion) (JNIEnv *, jbooleanArray, ! jsize, jsize, jboolean *); ! void (*GetByteArrayRegion) (JNIEnv *, jbyteArray, ! jsize, jsize, jbyte *); ! void (*GetCharArrayRegion) (JNIEnv *, jcharArray, ! jsize, jsize, jchar *); ! void (*GetShortArrayRegion) (JNIEnv *, jshortArray, ! jsize, jsize, jshort *); ! void (*GetIntArrayRegion) (JNIEnv *, jintArray, ! jsize, jsize, jint *); ! void (*GetLongArrayRegion) (JNIEnv *, jlongArray, ! jsize, jsize, jlong *); ! void (*GetFloatArrayRegion) (JNIEnv *, jfloatArray, ! jsize, jsize, jfloat *); ! void (*GetDoubleArrayRegion) (JNIEnv *, jdoubleArray, ! jsize, jsize, jdouble *); ! void (*SetBooleanArrayRegion) (JNIEnv *, jbooleanArray, ! jsize, jsize, jboolean *); ! void (*SetByteArrayRegion) (JNIEnv *, jbyteArray, ! jsize, jsize, jbyte *); ! void (*SetCharArrayRegion) (JNIEnv *, jcharArray, ! jsize, jsize, jchar *); ! void (*SetShortArrayRegion) (JNIEnv *, jshortArray, ! jsize, jsize, jshort *); ! void (*SetIntArrayRegion) (JNIEnv *, jintArray, ! jsize, jsize, jint *); ! void (*SetLongArrayRegion) (JNIEnv *, jlongArray, ! jsize, jsize, jlong *); ! void (*SetFloatArrayRegion) (JNIEnv *, jfloatArray, ! jsize, jsize, jfloat *); ! void (*SetDoubleArrayRegion) (JNIEnv *, jdoubleArray, ! jsize, jsize, jdouble *); ! jint (*RegisterNatives) (JNIEnv *, jclass, ! const JNINativeMethod *, jint); ! jint (*UnregisterNatives) (JNIEnv *, jclass); ! jint (*MonitorEnter) (JNIEnv *, jobject); ! jint (*MonitorExit) (JNIEnv *, jobject); ! jint (*GetJavaVM) (JNIEnv *, JavaVM **); ! void (*GetStringRegion) (JNIEnv *, jstring, jsize, ! jsize, jchar *); ! void (*GetStringUTFRegion) (JNIEnv *, jstring, jsize, ! jsize, char *); ! void * (*GetPrimitiveArrayCritical) (JNIEnv *, jarray, jboolean *); ! void (*ReleasePrimitiveArrayCritical) (JNIEnv *, jarray, void *, jint); ! const jchar * (*GetStringCritical) (JNIEnv *, jstring, jboolean *); ! void (*ReleaseStringCritical) (JNIEnv *, jstring, const jchar *); ! jweak (*NewWeakGlobalRef) (JNIEnv *, jobject); ! void (*DeleteWeakGlobalRef) (JNIEnv *, jweak); ! jboolean (*ExceptionCheck) (JNIEnv *); }; #ifdef __cplusplus --- 248,666 ---- _Jv_func reserved2; _Jv_func reserved3; ! jint (JNICALL *GetVersion) (JNIEnv *); ! jclass (JNICALL *DefineClass) (JNIEnv *, const char *, ! jobject, const jbyte *, ! jsize); ! jclass (JNICALL *FindClass) (JNIEnv *, const char *); ! jmethodID (JNICALL *FromReflectedMethod) (JNIEnv *, jobject); ! jfieldID (JNICALL *FromReflectedField) (JNIEnv *, jobject); ! jobject (JNICALL *ToReflectedMethod) (JNIEnv *, jclass, ! jmethodID, jboolean); ! jclass (JNICALL *GetSuperclass) (JNIEnv *, jclass); ! jboolean (JNICALL *IsAssignableFrom) (JNIEnv *, jclass, jclass); ! jobject (JNICALL *ToReflectedField) (JNIEnv *, jclass, jfieldID, ! jboolean); ! jint (JNICALL *Throw) (JNIEnv *, jthrowable); ! jint (JNICALL *ThrowNew) (JNIEnv *, jclass, ! const char *); ! jthrowable (JNICALL *ExceptionOccurred) (JNIEnv *); ! void (JNICALL *ExceptionDescribe) (JNIEnv *); ! void (JNICALL *ExceptionClear) (JNIEnv *); ! void (JNICALL *FatalError) (JNIEnv *, const char *); ! jint (JNICALL *PushLocalFrame) (JNIEnv *, jint); ! jobject (JNICALL *PopLocalFrame) (JNIEnv *, jobject); ! jobject (JNICALL *NewGlobalRef) (JNIEnv *, jobject); ! void (JNICALL *DeleteGlobalRef) (JNIEnv *, jobject); ! void (JNICALL *DeleteLocalRef) (JNIEnv *, jobject); ! jboolean (JNICALL *IsSameObject) (JNIEnv *, jobject, ! jobject); ! jobject (JNICALL *NewLocalRef) (JNIEnv *, jobject); ! jint (JNICALL *EnsureLocalCapacity) (JNIEnv *, jint); ! jobject (JNICALL *AllocObject) (JNIEnv *, jclass); ! jobject (JNICALL *NewObject) (JNIEnv *, jclass, ! jmethodID, ...); ! jobject (JNICALL *NewObjectV) (JNIEnv *, jclass, ! jmethodID, _Jv_va_list); ! jobject (JNICALL *NewObjectA) (JNIEnv *, jclass, ! jmethodID, jvalue *); ! jclass (JNICALL *GetObjectClass) (JNIEnv *, jobject); ! jboolean (JNICALL *IsInstanceOf) (JNIEnv *, jobject, jclass); ! jmethodID (JNICALL *GetMethodID) (JNIEnv *, jclass, ! const char *, const char *); ! jobject (JNICALL *CallObjectMethod) (JNIEnv *, jobject, jmethodID, ...); ! jobject (JNICALL *CallObjectMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jobject (JNICALL *CallObjectMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jboolean (JNICALL *CallBooleanMethod) (JNIEnv *, jobject, jmethodID, ! ...); ! jboolean (JNICALL *CallBooleanMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jboolean (JNICALL *CallBooleanMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jbyte (JNICALL *CallByteMethod) (JNIEnv *, jobject, jmethodID, ...); ! jbyte (JNICALL *CallByteMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jbyte (JNICALL *CallByteMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jchar (JNICALL *CallCharMethod) (JNIEnv *, jobject, jmethodID, ...); ! jchar (JNICALL *CallCharMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jchar (JNICALL *CallCharMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jshort (JNICALL *CallShortMethod) (JNIEnv *, jobject, jmethodID, ...); ! jshort (JNICALL *CallShortMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jshort (JNICALL *CallShortMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jint (JNICALL *CallIntMethod) (JNIEnv *, jobject, jmethodID, ...); ! jint (JNICALL *CallIntMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jint (JNICALL *CallIntMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jlong (JNICALL *CallLongMethod) (JNIEnv *, jobject, jmethodID, ...); ! jlong (JNICALL *CallLongMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jlong (JNICALL *CallLongMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jfloat (JNICALL *CallFloatMethod) (JNIEnv *, jobject, jmethodID, ...); ! jfloat (JNICALL *CallFloatMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jfloat (JNICALL *CallFloatMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jdouble (JNICALL *CallDoubleMethod) (JNIEnv *, jobject, jmethodID, ...); ! jdouble (JNICALL *CallDoubleMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! jdouble (JNICALL *CallDoubleMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! void (JNICALL *CallVoidMethod) (JNIEnv *, jobject, jmethodID, ...); ! void (JNICALL *CallVoidMethodV) (JNIEnv *, jobject, jmethodID, ! _Jv_va_list); ! void (JNICALL *CallVoidMethodA) (JNIEnv *, jobject, jmethodID, ! jvalue *); ! jobject (JNICALL *CallNonvirtualObjectMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jobject (JNICALL *CallNonvirtualObjectMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jobject (JNICALL *CallNonvirtualObjectMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jboolean (JNICALL *CallNonvirtualBooleanMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jboolean (JNICALL *CallNonvirtualBooleanMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jboolean (JNICALL *CallNonvirtualBooleanMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jbyte (JNICALL *CallNonvirtualByteMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jbyte (JNICALL *CallNonvirtualByteMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jbyte (JNICALL *CallNonvirtualByteMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jchar (JNICALL *CallNonvirtualCharMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jchar (JNICALL *CallNonvirtualCharMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jchar (JNICALL *CallNonvirtualCharMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jshort (JNICALL *CallNonvirtualShortMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jshort (JNICALL *CallNonvirtualShortMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jshort (JNICALL *CallNonvirtualShortMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jint (JNICALL *CallNonvirtualIntMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jint (JNICALL *CallNonvirtualIntMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jint (JNICALL *CallNonvirtualIntMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jlong (JNICALL *CallNonvirtualLongMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jlong (JNICALL *CallNonvirtualLongMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jlong (JNICALL *CallNonvirtualLongMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jfloat (JNICALL *CallNonvirtualFloatMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jfloat (JNICALL *CallNonvirtualFloatMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jfloat (JNICALL *CallNonvirtualFloatMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jdouble (JNICALL *CallNonvirtualDoubleMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! jdouble (JNICALL *CallNonvirtualDoubleMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! jdouble (JNICALL *CallNonvirtualDoubleMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! void (JNICALL *CallNonvirtualVoidMethod) (JNIEnv *, jobject, jclass, ! jmethodID, ...); ! void (JNICALL *CallNonvirtualVoidMethodV) (JNIEnv *, jobject, jclass, ! jmethodID, _Jv_va_list); ! void (JNICALL *CallNonvirtualVoidMethodA) (JNIEnv *, jobject, jclass, ! jmethodID, jvalue *); ! jfieldID (JNICALL *GetFieldID) (JNIEnv *, jclass, const char *, const char *); ! jobject (JNICALL *GetObjectField) (JNIEnv *, jobject, jfieldID); ! jboolean (JNICALL *GetBooleanField) (JNIEnv *, jobject, jfieldID); ! jbyte (JNICALL *GetByteField) (JNIEnv *, jobject, jfieldID); ! jchar (JNICALL *GetCharField) (JNIEnv *, jobject, jfieldID); ! jshort (JNICALL *GetShortField) (JNIEnv *, jobject, jfieldID); ! jint (JNICALL *GetIntField) (JNIEnv *, jobject, jfieldID); ! jlong (JNICALL *GetLongField) (JNIEnv *, jobject, jfieldID); ! jfloat (JNICALL *GetFloatField) (JNIEnv *, jobject, jfieldID); ! jdouble (JNICALL *GetDoubleField) (JNIEnv *, jobject, jfieldID); ! void (JNICALL *SetObjectField) (JNIEnv *, jobject, jfieldID, jobject); ! void (JNICALL *SetBooleanField) (JNIEnv *, jobject, jfieldID, jboolean); ! void (JNICALL *SetByteField) (JNIEnv *, jobject, jfieldID, jbyte); ! void (JNICALL *SetCharField) (JNIEnv *, jobject, jfieldID, jchar); ! void (JNICALL *SetShortField) (JNIEnv *, jobject, jfieldID, jshort); ! void (JNICALL *SetIntField) (JNIEnv *, jobject, jfieldID, jint); ! void (JNICALL *SetLongField) (JNIEnv *, jobject, jfieldID, jlong); ! void (JNICALL *SetFloatField) (JNIEnv *, jobject, jfieldID, jfloat); ! void (JNICALL *SetDoubleField) (JNIEnv *, jobject, jfieldID, jdouble); ! jmethodID (JNICALL *GetStaticMethodID) (JNIEnv *, jclass, const char *, const char *); ! jobject (JNICALL *CallStaticObjectMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jobject (JNICALL *CallStaticObjectMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jobject (JNICALL *CallStaticObjectMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jboolean (JNICALL *CallStaticBooleanMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jboolean (JNICALL *CallStaticBooleanMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jboolean (JNICALL *CallStaticBooleanMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jbyte (JNICALL *CallStaticByteMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jbyte (JNICALL *CallStaticByteMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jbyte (JNICALL *CallStaticByteMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jchar (JNICALL *CallStaticCharMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jchar (JNICALL *CallStaticCharMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jchar (JNICALL *CallStaticCharMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jshort (JNICALL *CallStaticShortMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jshort (JNICALL *CallStaticShortMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jshort (JNICALL *CallStaticShortMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jint (JNICALL *CallStaticIntMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jint (JNICALL *CallStaticIntMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jint (JNICALL *CallStaticIntMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jlong (JNICALL *CallStaticLongMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jlong (JNICALL *CallStaticLongMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jlong (JNICALL *CallStaticLongMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jfloat (JNICALL *CallStaticFloatMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jfloat (JNICALL *CallStaticFloatMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jfloat (JNICALL *CallStaticFloatMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jdouble (JNICALL *CallStaticDoubleMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! jdouble (JNICALL *CallStaticDoubleMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! jdouble (JNICALL *CallStaticDoubleMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! void (JNICALL *CallStaticVoidMethod) (JNIEnv *, jclass, jmethodID, ! ...); ! void (JNICALL *CallStaticVoidMethodV) (JNIEnv *, jclass, jmethodID, ! _Jv_va_list); ! void (JNICALL *CallStaticVoidMethodA) (JNIEnv *, jclass, jmethodID, ! jvalue *); ! jfieldID (JNICALL *GetStaticFieldID) (JNIEnv *, jclass, const char *, ! const char *); ! jobject (JNICALL *GetStaticObjectField) (JNIEnv *, jclass, jfieldID); ! jboolean (JNICALL *GetStaticBooleanField) (JNIEnv *, jclass, jfieldID); ! jbyte (JNICALL *GetStaticByteField) (JNIEnv *, jclass, jfieldID); ! jchar (JNICALL *GetStaticCharField) (JNIEnv *, jclass, jfieldID); ! jshort (JNICALL *GetStaticShortField) (JNIEnv *, jclass, jfieldID); ! jint (JNICALL *GetStaticIntField) (JNIEnv *, jclass, jfieldID); ! jlong (JNICALL *GetStaticLongField) (JNIEnv *, jclass, jfieldID); ! jfloat (JNICALL *GetStaticFloatField) (JNIEnv *, jclass, jfieldID); ! jdouble (JNICALL *GetStaticDoubleField) (JNIEnv *, jclass, jfieldID); ! void (JNICALL *SetStaticObjectField) (JNIEnv *, jclass, jfieldID, jobject); ! void (JNICALL *SetStaticBooleanField) (JNIEnv *, jclass, jfieldID, jboolean); ! void (JNICALL *SetStaticByteField) (JNIEnv *, jclass, jfieldID, jbyte); ! void (JNICALL *SetStaticCharField) (JNIEnv *, jclass, jfieldID, jchar); ! void (JNICALL *SetStaticShortField) (JNIEnv *, jclass, jfieldID, jshort); ! void (JNICALL *SetStaticIntField) (JNIEnv *, jclass, jfieldID, jint); ! void (JNICALL *SetStaticLongField) (JNIEnv *, jclass, jfieldID, jlong); ! void (JNICALL *SetStaticFloatField) (JNIEnv *, jclass, jfieldID, jfloat); ! void (JNICALL *SetStaticDoubleField) (JNIEnv *, jclass, jfieldID, jdouble); ! jstring (JNICALL *NewString) (JNIEnv *, const jchar *, jsize); ! jsize (JNICALL *GetStringLength) (JNIEnv *, jstring); ! const jchar * (JNICALL *GetStringChars) (JNIEnv *, jstring, jboolean *); ! void (JNICALL *ReleaseStringChars) (JNIEnv *, jstring, const jchar *); ! jstring (JNICALL *NewStringUTF) (JNIEnv *, const char *); ! jsize (JNICALL *GetStringUTFLength) (JNIEnv *, jstring); ! const char * (JNICALL *GetStringUTFChars) (JNIEnv *, jstring, jboolean *); ! void (JNICALL *ReleaseStringUTFChars) (JNIEnv *, jstring, const char *); ! jsize (JNICALL *GetArrayLength) (JNIEnv *, jarray); ! jarray (JNICALL *NewObjectArray) (JNIEnv *, jsize, jclass, jobject); ! jobject (JNICALL *GetObjectArrayElement) (JNIEnv *, jobjectArray, jsize); ! void (JNICALL *SetObjectArrayElement) (JNIEnv *, jobjectArray, jsize, ! jobject); ! jbooleanArray (JNICALL *NewBooleanArray) (JNIEnv *, jsize); ! jbyteArray (JNICALL *NewByteArray) (JNIEnv *, jsize); ! jcharArray (JNICALL *NewCharArray) (JNIEnv *, jsize); ! jshortArray (JNICALL *NewShortArray) (JNIEnv *, jsize); ! jintArray (JNICALL *NewIntArray) (JNIEnv *, jsize); ! jlongArray (JNICALL *NewLongArray) (JNIEnv *, jsize); ! jfloatArray (JNICALL *NewFloatArray) (JNIEnv *, jsize); ! jdoubleArray (JNICALL *NewDoubleArray) (JNIEnv *, jsize); ! jboolean * (JNICALL *GetBooleanArrayElements) (JNIEnv *, jbooleanArray, ! jboolean *); ! jbyte * (JNICALL *GetByteArrayElements) (JNIEnv *, jbyteArray, ! jboolean *); ! jchar * (JNICALL *GetCharArrayElements) (JNIEnv *, jcharArray, ! jboolean *); ! jshort * (JNICALL *GetShortArrayElements) (JNIEnv *, jshortArray, ! jboolean *); ! jint * (JNICALL *GetIntArrayElements) (JNIEnv *, jintArray, ! jboolean *); ! jlong * (JNICALL *GetLongArrayElements) (JNIEnv *, jlongArray, ! jboolean *); ! jfloat * (JNICALL *GetFloatArrayElements) (JNIEnv *, jfloatArray, ! jboolean *); ! jdouble * (JNICALL *GetDoubleArrayElements) (JNIEnv *, jdoubleArray, ! jboolean *); ! void (JNICALL *ReleaseBooleanArrayElements) (JNIEnv *, jbooleanArray, ! jboolean *, jint); ! void (JNICALL *ReleaseByteArrayElements) (JNIEnv *, jbyteArray, ! jbyte *, jint); ! void (JNICALL *ReleaseCharArrayElements) (JNIEnv *, jcharArray, ! jchar *, jint); ! void (JNICALL *ReleaseShortArrayElements) (JNIEnv *, jshortArray, ! jshort *, jint); ! void (JNICALL *ReleaseIntArrayElements) (JNIEnv *, jintArray, ! jint *, jint); ! void (JNICALL *ReleaseLongArrayElements) (JNIEnv *, jlongArray, ! jlong *, jint); ! void (JNICALL *ReleaseFloatArrayElements) (JNIEnv *, jfloatArray, ! jfloat *, jint); ! void (JNICALL *ReleaseDoubleArrayElements) (JNIEnv *, jdoubleArray, ! jdouble *, jint); ! void (JNICALL *GetBooleanArrayRegion) (JNIEnv *, jbooleanArray, ! jsize, jsize, jboolean *); ! void (JNICALL *GetByteArrayRegion) (JNIEnv *, jbyteArray, ! jsize, jsize, jbyte *); ! void (JNICALL *GetCharArrayRegion) (JNIEnv *, jcharArray, ! jsize, jsize, jchar *); ! void (JNICALL *GetShortArrayRegion) (JNIEnv *, jshortArray, ! jsize, jsize, jshort *); ! void (JNICALL *GetIntArrayRegion) (JNIEnv *, jintArray, ! jsize, jsize, jint *); ! void (JNICALL *GetLongArrayRegion) (JNIEnv *, jlongArray, ! jsize, jsize, jlong *); ! void (JNICALL *GetFloatArrayRegion) (JNIEnv *, jfloatArray, ! jsize, jsize, jfloat *); ! void (JNICALL *GetDoubleArrayRegion) (JNIEnv *, jdoubleArray, ! jsize, jsize, jdouble *); ! void (JNICALL *SetBooleanArrayRegion) (JNIEnv *, jbooleanArray, ! jsize, jsize, jboolean *); ! void (JNICALL *SetByteArrayRegion) (JNIEnv *, jbyteArray, ! jsize, jsize, jbyte *); ! void (JNICALL *SetCharArrayRegion) (JNIEnv *, jcharArray, ! jsize, jsize, jchar *); ! void (JNICALL *SetShortArrayRegion) (JNIEnv *, jshortArray, ! jsize, jsize, jshort *); ! void (JNICALL *SetIntArrayRegion) (JNIEnv *, jintArray, ! jsize, jsize, jint *); ! void (JNICALL *SetLongArrayRegion) (JNIEnv *, jlongArray, ! jsize, jsize, jlong *); ! void (JNICALL *SetFloatArrayRegion) (JNIEnv *, jfloatArray, ! jsize, jsize, jfloat *); ! void (JNICALL *SetDoubleArrayRegion) (JNIEnv *, jdoubleArray, ! jsize, jsize, jdouble *); ! jint (JNICALL *RegisterNatives) (JNIEnv *, jclass, ! const JNINativeMethod *, ! jint); ! jint (JNICALL *UnregisterNatives) (JNIEnv *, jclass); ! jint (JNICALL *MonitorEnter) (JNIEnv *, jobject); ! jint (JNICALL *MonitorExit) (JNIEnv *, jobject); ! jint (JNICALL *GetJavaVM) (JNIEnv *, JavaVM **); ! void (JNICALL *GetStringRegion) (JNIEnv *, jstring, jsize, ! jsize, jchar *); ! void (JNICALL *GetStringUTFRegion) (JNIEnv *, jstring, jsize, ! jsize, char *); ! void * (JNICALL *GetPrimitiveArrayCritical) (JNIEnv *, jarray, ! jboolean *); ! void (JNICALL *ReleasePrimitiveArrayCritical) (JNIEnv *, jarray, void *, ! jint); ! const jchar * (JNICALL *GetStringCritical) (JNIEnv *, jstring, ! jboolean *); ! void (JNICALL *ReleaseStringCritical) (JNIEnv *, jstring, ! const jchar *); ! jweak (JNICALL *NewWeakGlobalRef) (JNIEnv *, jobject); ! void (JNICALL *DeleteWeakGlobalRef) (JNIEnv *, jweak); ! jboolean (JNICALL *ExceptionCheck) (JNIEnv *); ! ! jobject (JNICALL *NewDirectByteBuffer) (JNIEnv *, void *, jlong); ! void * (JNICALL *GetDirectBufferAddress) (JNIEnv *, jobject); ! jlong (JNICALL *GetDirectBufferCapacity) (JNIEnv *, jobject); }; #ifdef __cplusplus *************** public: *** 668,675 **** jint GetVersion () { return p->GetVersion (this); } ! jclass DefineClass (jobject obj0, const jbyte * val1, jsize val2) ! { return p->DefineClass (this, obj0, val1, val2); } jclass FindClass (const char * val0) { return p->FindClass (this, val0); } --- 688,696 ---- jint GetVersion () { return p->GetVersion (this); } ! jclass DefineClass (const char *name, jobject obj0, const jbyte * val1, ! jsize val2) ! { return p->DefineClass (this, name, obj0, val1, val2); } jclass FindClass (const char * val0) { return p->FindClass (this, val0); } *************** public: *** 1522,1527 **** --- 1543,1557 ---- jboolean ExceptionCheck () { return p->ExceptionCheck (this); } + + jobject NewDirectByteBuffer (void *addr, jlong capacity) + { return p->NewDirectByteBuffer (this, addr, capacity); } + + void *GetDirectBufferAddress (jobject buf) + { return p->GetDirectBufferAddress (this, buf); } + + jlong GetDirectBufferCapacity (jobject buf) + { return p->GetDirectBufferCapacity (this, buf); } }; #endif /* __cplusplus */ *************** struct JNIInvokeInterface *** 1535,1544 **** _Jv_func reserved1; _Jv_func reserved2; ! jint (*DestroyJavaVM) (JavaVM *); ! jint (*AttachCurrentThread) (JavaVM *, void **, void *); ! jint (*DetachCurrentThread) (JavaVM *); ! jint (*GetEnv) (JavaVM *, void **, jint); }; #ifdef __cplusplus --- 1565,1575 ---- _Jv_func reserved1; _Jv_func reserved2; ! jint (JNICALL *DestroyJavaVM) (JavaVM *); ! jint (JNICALL *AttachCurrentThread) (JavaVM *, void **, void *); ! jint (JNICALL *DetachCurrentThread) (JavaVM *); ! jint (JNICALL *GetEnv) (JavaVM *, void **, jint); ! jint (JNICALL *AttachCurrentThreadAsDaemon) (JavaVM *, void **, void *); }; #ifdef __cplusplus *************** public: *** 1563,1568 **** --- 1594,1602 ---- jint GetEnv (void **penv, jint version) { return functions->GetEnv (this, penv, version); } + + jint AttachCurrentThreadAsDaemon (void **penv, void *args) + { return functions->AttachCurrentThreadAsDaemon (this, penv, args); } }; #endif /* __cplusplus */ diff -Nrc3pad gcc-3.2.3/libjava/include/jvm.h gcc-3.3/libjava/include/jvm.h *** gcc-3.2.3/libjava/include/jvm.h 2002-04-11 15:56:34.000000000 +0000 --- gcc-3.3/libjava/include/jvm.h 2003-04-25 16:02:22.000000000 +0000 *************** union _Jv_word2 *** 111,116 **** --- 111,130 ---- jdouble d; }; + // An instance of this type is used to represent a single frame in a + // backtrace. If the interpreter has been built, we also include + // information about the interpreted method. + struct _Jv_frame_info + { + // PC value. + void *addr; + #ifdef INTERPRETER + // Actually a _Jv_InterpMethod, but we don't want to include + // java-interp.h everywhere. + void *interp; + #endif // INTERPRETER + }; + /* Extract a character from a Java-style Utf8 string. * PTR points to the current character. * LIMIT points to the end of the Utf8 string. *************** extern "C" *** 338,346 **** jlong _Jv_remJ (jlong, jlong); } ! /* get/set the name of the running executable. */ ! extern char *_Jv_ThisExecutable (void); ! extern void _Jv_ThisExecutable (const char *); /* Return a pointer to a symbol in executable or loaded library. */ void *_Jv_FindSymbolInExecutable (const char *); --- 352,372 ---- jlong _Jv_remJ (jlong, jlong); } ! /* Get the number of arguments (cf. argc) or 0 if our argument ! list was never initialized. */ ! extern int _Jv_GetNbArgs (void); ! ! /* Get the specified argument (cf. argv[index]) or "" if either ! our argument list was never initialized or the specified index ! is out of bounds. */ ! extern const char * _Jv_GetSafeArg (int index); ! ! /* Sets our argument list. Can be used by programs with non-standard ! entry points. */ ! extern void _Jv_SetArgs (int argc, const char **argv); ! ! /* Get the name of the running executable. */ ! extern const char *_Jv_ThisExecutable (void); /* Return a pointer to a symbol in executable or loaded library. */ void *_Jv_FindSymbolInExecutable (const char *); diff -Nrc3pad gcc-3.2.3/libjava/include/Makefile.in gcc-3.3/libjava/include/Makefile.in *** gcc-3.2.3/libjava/include/Makefile.in 2002-04-10 13:10:15.000000000 +0000 --- gcc-3.3/libjava/include/Makefile.in 2003-03-01 22:57:53.000000000 +0000 *************** *** 1,6 **** ! # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. --- 1,6 ---- ! # Makefile.in generated automatically by automake 1.4 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. *************** host_alias = @host_alias@ *** 63,71 **** host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ - AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ AR = @AR@ AS = @AS@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ --- 63,71 ---- host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ AR = @AR@ AS = @AS@ + BACKTRACESPEC = @BACKTRACESPEC@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ *************** GCOBJS = @GCOBJS@ *** 87,93 **** --- 87,95 ---- GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ + IEEESPEC = @IEEESPEC@ INCLTDL = @INCLTDL@ + INTERPRETER = @INTERPRETER@ JC1GCSPEC = @JC1GCSPEC@ LIBFFI = @LIBFFI@ LIBFFIINCS = @LIBFFIINCS@ *************** here = @here@ *** 129,134 **** --- 131,139 ---- libgcj_basedir = @libgcj_basedir@ mkinstalldirs = @mkinstalldirs@ tool_include_dir = @tool_include_dir@ + toolexecdir = @toolexecdir@ + toolexeclibdir = @toolexeclibdir@ + toolexecmainlibdir = @toolexecmainlibdir@ AUTOMAKE_OPTIONS = foreign diff -Nrc3pad gcc-3.2.3/libjava/include/name-finder.h gcc-3.3/libjava/include/name-finder.h *** gcc-3.2.3/libjava/include/name-finder.h 2002-03-23 16:17:07.000000000 +0000 --- gcc-3.3/libjava/include/name-finder.h 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,91 **** - // name-finder.h - Convert addresses to names - - /* Copyright (C) 2000, 2002 Free Software Foundation, Inc - - This file is part of libgcj. - - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - - /** - * @author Andrew Haley - * @date Jan 6 2000 - */ - - #include - #include - - #include - - #ifdef HAVE_SYS_WAIT_H - #include - #endif - - #include - #include - - #ifdef HAVE_UNISTD_H - #include - #endif - - /* _Jv_name_finder is a class wrapper around a mechanism that can - convert addresses of methods to their names and the names of files - in which they appear. */ - - class _Jv_name_finder - { - public: - _Jv_name_finder (char *executable); - ~_Jv_name_finder () - { - #if defined (HAVE_PIPE) && defined (HAVE_FORK) - myclose (f_pipe[0]); - myclose (f_pipe[1]); - myclose (b_pipe[0]); - myclose (b_pipe[1]); - if (b_pipe_fd != NULL) - fclose (b_pipe_fd); - - if (pid >= 0) - { - int wstat; - // We don't care about errors here. - waitpid (pid, &wstat, 0); - } - #endif - } - - /* Given a pointer to a function or method, try to convert it into a - name and the appropriate line and source file. The caller passes - the code pointer in p. - - Returns false if the lookup fails. Even if this happens, the field - hex will have been correctly filled in with the pointer. - - The other fields are method_name and file_name, which lookup will - attempt to fill appropriately. If the lookup has failed, these - fields contain garbage.*/ - bool lookup (void *p); - - char method_name[1024]; - char file_name[1024]; - char hex[sizeof (void *) * 2 + 5]; - - private: - void toHex (void *p); - #if defined (HAVE_PIPE) && defined (HAVE_FORK) - pid_t pid; - int f_pipe[2], b_pipe[2]; - FILE *b_pipe_fd; - int error; - - // Close a descriptor only if it has not been closed. - void myclose (int fd) - { - if (fd != -1) - close (fd); - } - - #endif - }; --- 0 ---- diff -Nrc3pad gcc-3.2.3/libjava/include/posix.h gcc-3.3/libjava/include/posix.h *** gcc-3.2.3/libjava/include/posix.h 2002-04-07 11:30:09.000000000 +0000 --- gcc-3.3/libjava/include/posix.h 2003-02-19 16:18:03.000000000 +0000 *************** *** 1,6 **** // posix.h -- Helper functions for POSIX-flavored OSs. ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // posix.h -- Helper functions for POSIX-flavored OSs. ! /* Copyright (C) 2000, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** This software is copyrighted work licens *** 8,13 **** --- 8,16 ---- Libgcj License. Please consult the file "LIBGCJ_LICENSE" for details. */ + #ifndef __JV_POSIX_H__ + #define __JV_POSIX_H__ + /* Required on Tru64 UNIX V4/V5 so defines prototypes of socket functions with socklen_t instead of size_t. This must be defined early so defines the correct version of __PIIX. */ *************** details. */ *** 24,29 **** --- 27,36 ---- #include #endif + #ifdef HAVE_SYS_SOCKET_H + #include + #endif + #ifdef HAVE_UNISTD_H #include #endif *************** details. */ *** 33,38 **** --- 40,53 ---- #include #include + // Prefix and suffix for shared libraries. + #define _Jv_platform_solib_prefix "lib" + #define _Jv_platform_solib_suffix ".so" + + #ifndef DISABLE_JAVA_NET + #include + #endif + extern int _Jv_select (int n, fd_set *, fd_set *, fd_set *, struct timeval *); extern jlong _Jv_platform_gettimeofday (); extern void _Jv_platform_initialize (void); *************** inline void *** 42,46 **** _Jv_platform_close_on_exec (jint fd) { // Ignore errors. ! fcntl (fd, F_SETFD, FD_CLOEXEC); } --- 57,148 ---- _Jv_platform_close_on_exec (jint fd) { // Ignore errors. ! ::fcntl (fd, F_SETFD, FD_CLOEXEC); ! } ! ! #undef fcntl ! ! #ifdef JV_HASH_SYNCHRONIZATION ! inline void ! _Jv_platform_usleep (unsigned long usecs) ! { ! usleep (usecs); ! } ! #endif /* JV_HASH_SYNCHRONIZATION */ ! ! #ifndef DISABLE_JAVA_NET ! ! #ifndef HAVE_SOCKLEN_T ! #define socklen_t int ! #endif ! ! static inline int ! _Jv_socket (int domain, int type, int protocol) ! { ! return ::socket (domain, type, protocol); ! } ! ! #undef socket ! ! inline int ! _Jv_connect (jint fd, sockaddr *ptr, int len) ! { ! return ::connect (fd, ptr, len); ! } ! ! #undef connect ! ! inline int ! _Jv_close (jint fd) ! { ! return ::close (fd); ! } ! ! #undef close ! ! // Avoid macro definitions of bind from system headers, e.g. on ! // Solaris 7 with _XOPEN_SOURCE. FIXME ! inline int ! _Jv_bind (int fd, struct sockaddr *addr, int addrlen) ! { ! return ::bind (fd, addr, addrlen); } + + #undef bind + + // Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET + inline int + _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen) + { + return ::accept (fd, addr, addrlen); + } + + #undef accept + + inline int + _Jv_listen (int fd, int backlog) + { + return ::listen (fd, backlog); + } + + #undef listen + + inline int + _Jv_write(int s, void *buf, int len) + { + return ::write (s, buf, len); + } + + #undef write + + inline int + _Jv_read(int s, void *buf, int len) + { + return ::read (s, buf, len); + } + + #undef read + + #endif /* DISABLE_JAVA_NET */ + + #endif /* __JV_POSIX_H__ */ diff -Nrc3pad gcc-3.2.3/libjava/include/posix-threads.h gcc-3.3/libjava/include/posix-threads.h *** gcc-3.2.3/libjava/include/posix-threads.h 2002-04-01 23:08:40.000000000 +0000 --- gcc-3.3/libjava/include/posix-threads.h 2002-03-27 19:25:04.000000000 +0000 *************** typedef unsigned long _Jv_ThreadId_t; *** 256,263 **** inline _Jv_ThreadId_t _Jv_ThreadSelf (void) { ! unsigned long id; ! __asm__ ("call_pal %1\n\tmov $0, %0" : "=r"(id) : "i"(PAL_rduniq) : "$0"); return id; } --- 256,263 ---- inline _Jv_ThreadId_t _Jv_ThreadSelf (void) { ! register unsigned long id __asm__("$0"); ! __asm__ ("call_pal %1" : "=r"(id) : "i"(PAL_rduniq)); return id; } diff -Nrc3pad gcc-3.2.3/libjava/include/s390-signal.h gcc-3.3/libjava/include/s390-signal.h *** gcc-3.2.3/libjava/include/s390-signal.h 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/include/s390-signal.h 2002-05-29 18:36:50.000000000 +0000 *************** *** 0 **** --- 1,78 ---- + // s390-signal.h - Catch runtime signals and turn them into exceptions + // on an s390 based Linux system. + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + + #ifndef JAVA_SIGNAL_H + #define JAVA_SIGNAL_H 1 + + #include + #include + + #define HANDLE_SEGV 1 + #undef HANDLE_FPE + + #define SIGNAL_HANDLER(_name) \ + static void _name (int /* _signal */, struct sigcontext _sc) + + #define MAKE_THROW_FRAME(_exception) \ + do \ + { \ + /* Advance the program counter so that it is after the start of the \ + instruction: the s390 exception handler expects the PSW to point \ + to the instruction after a call. */ \ + _sc.sregs->regs.psw.addr += 2; \ + \ + } \ + while (0) + + + /* For an explanation why we cannot simply use sigaction to + install the handlers, see i386-signal.h. */ + + /* We use old_kernel_sigaction here because we're calling the kernel + directly rather than via glibc. The sigaction structure that the + syscall uses is a different shape from the one in userland and not + visible to us in a header file so we define it here. */ + + struct old_s390_kernel_sigaction { + void (*k_sa_handler) (int, struct sigcontext); + unsigned long k_sa_mask; + unsigned long k_sa_flags; + void (*sa_restorer) (void); + }; + + #define INIT_SEGV \ + do \ + { \ + nullp = new java::lang::NullPointerException (); \ + struct old_s390_kernel_sigaction kact; \ + kact.k_sa_handler = catch_segv; \ + kact.k_sa_mask = 0; \ + kact.k_sa_flags = 0; \ + syscall (SYS_sigaction, SIGSEGV, &kact, NULL); \ + } \ + while (0) + + #define INIT_FPE \ + do \ + { \ + arithexception = new java::lang::ArithmeticException \ + (JvNewStringLatin1 ("/ by zero")); \ + struct old_s390_kernel_sigaction kact; \ + kact.k_sa_handler = catch_fpe; \ + kact.k_sa_mask = 0; \ + kact.k_sa_flags = 0; \ + syscall (SYS_sigaction, SIGFPE, &kact, NULL); \ + } \ + while (0) + + #endif /* JAVA_SIGNAL_H */ + diff -Nrc3pad gcc-3.2.3/libjava/include/win32.h gcc-3.3/libjava/include/win32.h *** gcc-3.2.3/libjava/include/win32.h 2002-04-24 01:04:45.000000000 +0000 --- gcc-3.3/libjava/include/win32.h 2003-04-29 13:58:51.000000000 +0000 *************** *** 1,6 **** // win32.h -- Helper functions for Microsoft-flavored OSs. ! /* Copyright (C) 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // win32.h -- Helper functions for Microsoft-flavored OSs. ! /* Copyright (C) 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 14,27 **** #include #undef STRICT ! #undef __INSIDE_CYGWIN__ ! #include #include #include extern void _Jv_platform_initialize (void); extern void _Jv_platform_initProperties (java::util::Properties*); extern jlong _Jv_platform_gettimeofday (); inline void _Jv_platform_close_on_exec (jint) --- 14,50 ---- #include #undef STRICT ! #include #include #include + #include + + // Prefix and suffix for shared libraries. + #define _Jv_platform_solib_prefix "" + #define _Jv_platform_solib_suffix ".dll" + + #ifndef DISABLE_JAVA_NET + + // these errors cannot occur on Win32 + #define ENOTCONN 0 + #define ECONNRESET 0 + + /* This is incorrect, but allows java/net/natPlainDatagramSocketImpl.cc + to compile under MingW. This will be remedied in a subsequent gcj + release where the Win32 and Posix networking code have been forked. */ + #define ECONNREFUSED 0 + + #ifndef ENOPROTOOPT + #define ENOPROTOOPT 109 + #endif + + #endif // DISABLE_JAVA_NET + extern void _Jv_platform_initialize (void); extern void _Jv_platform_initProperties (java::util::Properties*); extern jlong _Jv_platform_gettimeofday (); + extern int _Jv_select (int n, fd_set *, fd_set *, fd_set *, struct timeval *); inline void _Jv_platform_close_on_exec (jint) *************** _Jv_platform_close_on_exec (jint) *** 29,35 **** // Ignore. } ! #define HAVE_BACKTRACE /* Store up to SIZE return address of the current program state in ARRAY and return the exact number of values stored. */ --- 52,123 ---- // Ignore. } ! #ifdef JV_HASH_SYNCHRONIZATION ! /* Suspends the execution of the current thread for the specified ! number of microseconds. Tries to emulate the behaviour of usleep() ! on UNIX and provides a granularity of 1 millisecond. */ ! inline void ! _Jv_platform_usleep (unsigned long usecs) ! { ! if (usecs > 0UL) ! { ! unsigned long millis = ((usecs + 999UL) / 1000UL); ! Sleep (millis); ! } ! } ! #endif /* JV_HASH_SYNCHRONIZATION */ ! ! #ifndef DISABLE_JAVA_NET ! ! static inline int ! _Jv_socket (int domain, int type, int protocol) ! { ! return ::socket (domain, type, protocol); ! } ! ! inline int ! _Jv_connect (jint fd, sockaddr *ptr, int len) ! { ! return ::connect (fd, ptr, len); ! } ! ! inline int ! _Jv_close (jint fd) ! { ! return ::closesocket (fd); ! } ! ! inline int ! _Jv_bind (int fd, struct sockaddr *addr, int addrlen) ! { ! return ::bind (fd, addr, addrlen); ! } ! ! inline int ! _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen) ! { ! return ::accept (fd, addr, addrlen); ! } ! ! inline int ! _Jv_listen (int fd, int backlog) ! { ! return ::listen (fd, backlog); ! } ! ! inline int ! _Jv_write(int s, void *buf, int len) ! { ! return ::send (s, (char*) buf, len, 0); ! } ! ! inline int ! _Jv_read(int s, void *buf, int len) ! { ! return ::recv (s, (char*) buf, len, 0); ! } ! ! #endif /* DISABLE_JAVA_NET */ /* Store up to SIZE return address of the current program state in ARRAY and return the exact number of values stored. */ diff -Nrc3pad gcc-3.2.3/libjava/include/win32-threads.h gcc-3.3/libjava/include/win32-threads.h *** gcc-3.2.3/libjava/include/win32-threads.h 2002-02-02 04:27:34.000000000 +0000 --- gcc-3.3/libjava/include/win32-threads.h 2003-01-28 22:23:08.000000000 +0000 *************** *** 1,7 **** // -*- c++ -*- // win32-threads.h - Defines for using Win32 threads. ! /* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. --- 1,8 ---- // -*- c++ -*- // win32-threads.h - Defines for using Win32 threads. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software ! Foundation This file is part of libgcj. *************** details. */ *** 18,30 **** // Typedefs. // ! typedef struct _Jv_ConditionVariable_t { HANDLE ev[2]; ! CRITICAL_SECTION count_mutex; int blocked_count; - }; ! typedef CRITICAL_SECTION _Jv_Mutex_t; typedef struct { --- 19,50 ---- // Typedefs. // ! typedef struct ! { ! // ev[0] (signal) is a Win32 auto-reset event for _Jv_CondNotify ! // ev[1] (broadcast) is a Win32 manual-reset event for _Jv_CondNotifyAll HANDLE ev[2]; ! ! // Number of threads waiting on this condition variable int blocked_count; ! // Protects access to the blocked_count variable ! CRITICAL_SECTION count_mutex; ! ! } _Jv_ConditionVariable_t; ! ! typedef struct ! { ! // The thread-id of the owner thread if any, 0 otherwise ! DWORD owner; ! ! // Track nested mutex acquisitions by the same thread ! int refcount; ! ! // The actual Windows construct used to implement this mutex ! CRITICAL_SECTION cs; ! ! } _Jv_Mutex_t; typedef struct { *************** typedef struct *** 33,38 **** --- 53,66 ---- java::lang::Thread *thread_obj; } _Jv_Thread_t; + typedef DWORD _Jv_ThreadId_t; + + inline _Jv_ThreadId_t + _Jv_ThreadSelf (void) + { + return GetCurrentThreadId(); + } + typedef void _Jv_ThreadStartFunc (java::lang::Thread *); // *************** int _Jv_CondNotifyAll (_Jv_ConditionVari *** 52,76 **** inline void _Jv_MutexInit (_Jv_Mutex_t *mu) { ! InitializeCriticalSection(mu); } #define _Jv_HaveMutexDestroy inline void _Jv_MutexDestroy (_Jv_Mutex_t *mu) { ! DeleteCriticalSection(mu); mu = NULL; } inline int _Jv_MutexUnlock (_Jv_Mutex_t *mu) { ! LeaveCriticalSection(mu); ! return 0; } inline int _Jv_MutexLock (_Jv_Mutex_t *mu) { ! EnterCriticalSection(mu); return 0; } --- 80,118 ---- inline void _Jv_MutexInit (_Jv_Mutex_t *mu) { ! mu->owner = 0UL; ! mu->refcount = 0; ! InitializeCriticalSection (&(mu->cs)); } #define _Jv_HaveMutexDestroy inline void _Jv_MutexDestroy (_Jv_Mutex_t *mu) { ! mu->owner = 0UL; ! mu->refcount = 0; ! DeleteCriticalSection (&(mu->cs)); mu = NULL; } inline int _Jv_MutexUnlock (_Jv_Mutex_t *mu) { ! if (mu->owner == GetCurrentThreadId ( )) ! { ! mu->refcount--; ! if (mu->refcount == 0) ! mu->owner = 0UL; ! LeaveCriticalSection (&(mu->cs)); ! return 0; ! } ! else ! return 1; } inline int _Jv_MutexLock (_Jv_Mutex_t *mu) { ! EnterCriticalSection (&(mu->cs)); ! mu->owner = GetCurrentThreadId ( ); ! mu->refcount++; return 0; } *************** inline _Jv_Thread_t *_Jv_ThreadCurrentDa *** 96,104 **** inline void _Jv_ThreadYield (void) { ! // FIXME: win98 freezes hard (OS hang) when we use this -- ! // for now, we simply don't yield ! // Sleep (0); } void _Jv_ThreadRegister (_Jv_Thread_t *data); --- 138,144 ---- inline void _Jv_ThreadYield (void) { ! Sleep (0); } void _Jv_ThreadRegister (_Jv_Thread_t *data); diff -Nrc3pad gcc-3.2.3/libjava/include/x86_64-signal.h gcc-3.3/libjava/include/x86_64-signal.h *** gcc-3.2.3/libjava/include/x86_64-signal.h 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/include/x86_64-signal.h 2003-01-22 18:13:36.000000000 +0000 *************** *** 0 **** --- 1,96 ---- + // x86_64-signal.h - Catch runtime signals and turn them into exceptions + // on an x86_64 based GNU/Linux system. + + /* Copyright (C) 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + + #ifndef JAVA_SIGNAL_H + #define JAVA_SIGNAL_H 1 + + #include + #include + + #ifdef __x86_64__ + + #define HANDLE_SEGV 1 + + #define SIGNAL_HANDLER(_name) \ + static void _Jv_##_name (int, siginfo_t *_sip, void *_p) + + extern "C" + { + struct kernel_sigaction + { + void (*k_sa_sigaction)(int,siginfo_t *,void *); + unsigned long k_sa_flags; + void (*k_sa_restorer) (void); + sigset_t k_sa_mask; + }; + } + + #define MAKE_THROW_FRAME(_exception) \ + do \ + { \ + /* Advance the program counter so that it is after the start of the \ + instruction: the x86_64 exception handler expects \ + the PC to point to the instruction after a call. */ \ + struct ucontext *_uc = (struct ucontext *)_p; \ + struct sigcontext *_sc = (struct sigcontext *) &_uc->uc_mcontext; \ + _sc->rip += 2; \ + } \ + while (0) + + #define RESTORE(name, syscall) RESTORE2 (name, syscall) + #define RESTORE2(name, syscall) \ + asm \ + ( \ + ".byte 0 # Yes, this really is necessary\n" \ + ".align 16\n" \ + "__" #name ":\n" \ + " movq $" #syscall ", %rax\n" \ + " syscall\n" \ + ); + + /* The return code for realtime-signals. */ + RESTORE (restore_rt, __NR_rt_sigreturn) + static void restore_rt (void) asm ("__restore_rt"); + + #define INIT_SEGV \ + do \ + { \ + nullp = new java::lang::NullPointerException (); \ + struct kernel_sigaction act; \ + act.k_sa_sigaction = _Jv_catch_segv; \ + sigemptyset (&act.k_sa_mask); \ + act.k_sa_flags = SA_SIGINFO|0x4000000; \ + act.k_sa_restorer = restore_rt; \ + syscall (SYS_rt_sigaction, SIGSEGV, &act, NULL, _NSIG / 8); \ + } \ + while (0) + + /* We use syscall(SYS_rt_sigaction) in INIT_SEGV instead of + * sigaction() because on some systems the pthreads wrappers for + * signal handlers are not compiled with unwind information, so it's + * not possible to unwind through them. This is a problem that will + * go away if all systems ever have pthreads libraries that are + * compiled with unwind info. */ + + #else /* __x86_64__ */ + + /* This is for the 32-bit subsystem on on x86-64. Catching signals + doesn't yet work on that target. */ + + #undef HANDLE_SEGV + #undef HANDLE_FPE + + #define INIT_SEGV do {} while (0) + #define INIT_FPE do {} while (0) + + #endif /* __x86_64__ */ + #endif /* JAVA_SIGNAL_H */ diff -Nrc3pad gcc-3.2.3/libjava/interpret.cc gcc-3.3/libjava/interpret.cc *** gcc-3.2.3/libjava/interpret.cc 2002-02-10 18:32:48.000000000 +0000 --- gcc-3.3/libjava/interpret.cc 2002-12-06 23:41:37.000000000 +0000 *************** *** 1,6 **** // interpret.cc - Code for the interpreter ! /* Copyright (C) 1999, 2000, 2001 , 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // interpret.cc - Code for the interpreter ! /* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** details. */ *** 12,23 **** #include #pragma implementation "java-interp.h" #include #include #include - // #include #include #include #include --- 12,27 ---- #include + // Define this to get the direct-threaded interpreter. If undefined, + // we revert to a basic bytecode interpreter. The former is faster + // but uses more memory. + #define DIRECT_THREADED + #pragma implementation "java-interp.h" #include #include #include #include #include #include *************** details. */ *** 31,36 **** --- 35,41 ---- #include #include #include + #include #include #include *************** static void throw_null_pointer_exception *** 51,56 **** --- 56,81 ---- extern "C" double __ieee754_fmod (double,double); + // This represents a single slot in the "compiled" form of the + // bytecode. + union insn_slot + { + // Address of code. + void *insn; + // An integer value used by an instruction. + jint int_val; + // A pointer value used by an instruction. + void *datum; + }; + + // The type of the PC depends on whether we're doing direct threading + // or a more ordinary bytecode interpreter. + #ifdef DIRECT_THREADED + typedef insn_slot *pc_t; + #else + typedef unsigned char *pc_t; + #endif + static inline void dupx (_Jv_word *sp, int n, int x) { // first "slide" n+x elements n to the right *************** static jint get4(unsigned char* loc) { *** 199,210 **** #ifdef HANDLE_SEGV #define NULLCHECK(X) ! #define NULLARRAYCHECK(X) do { SAVE_PC; } while (0) #else #define NULLCHECK(X) \ do { if ((X)==NULL) throw_null_pointer_exception (); } while (0) #define NULLARRAYCHECK(X) \ ! do { if ((X)==NULL) { SAVE_PC; throw_null_pointer_exception (); } } while (0) #endif #define ARRAYBOUNDSCHECK(array, index) \ --- 224,235 ---- #ifdef HANDLE_SEGV #define NULLCHECK(X) ! #define NULLARRAYCHECK(X) #else #define NULLCHECK(X) \ do { if ((X)==NULL) throw_null_pointer_exception (); } while (0) #define NULLARRAYCHECK(X) \ ! do { if ((X)==NULL) { throw_null_pointer_exception (); } } while (0) #endif #define ARRAYBOUNDSCHECK(array, index) \ *************** static jint get4(unsigned char* loc) { *** 215,444 **** } \ while (0) ! // this method starts the actual running of the method. It is inlined ! // in three different variants in the static methods run_normal, ! // run_sync_object and run_sync_class (see below). Those static methods ! // are installed directly in the stub for this method (by ! // _Jv_InterpMethod::ncode, in resolve.cc). ! inline jobject ! _Jv_InterpMethod::run (ffi_cif* cif, ! void *retp, ! ffi_raw *args, ! _Jv_InterpMethodInvocation *inv) { ! inv->running = this; ! inv->pc = bytecode (); ! inv->sp = inv->stack_base (); ! _Jv_word *locals = inv->local_base (); ! /* Go straight at it! the ffi raw format matches the internal ! stack representation exactly. At least, that's the idea. ! */ ! memcpy ((void*) locals, (void*) args, args_raw_size); ! next_segment: ! jobject ex = NULL; ! try ! { ! continue1 (inv); ! } ! catch (java::lang::Throwable *ex2) ! { ! ex = ex2; ! } ! if (ex == 0) // no exception... { ! /* define sp locally, so the POP? macros will pick it up */ ! _Jv_word *sp = inv->sp; ! int rtype = cif->rtype->type; ! if (rtype == FFI_TYPE_POINTER) ! { ! jobject r = POPA(); ! *(jobject*) retp = r; ! return 0; ! } ! else if (rtype == FFI_TYPE_SINT32) ! { ! jint r = POPI(); ! *(jint*)retp = r; ! return 0; ! } ! else if (rtype == FFI_TYPE_VOID) { ! return 0; } ! else switch (rtype) { ! case FFI_TYPE_FLOAT: ! { ! jfloat r = POPF(); ! *(jfloat*)retp = r; ! return 0; ! } ! ! case FFI_TYPE_DOUBLE: ! { ! jdouble r = POPD(); ! *(jdouble*)retp = r; ! return 0; ! } ! case FFI_TYPE_UINT8: ! case FFI_TYPE_UINT16: ! case FFI_TYPE_UINT32: ! case FFI_TYPE_SINT8: ! case FFI_TYPE_SINT16: ! { ! jint r = POPI(); ! *(jint*)retp = r; ! return 0; ! } ! ! case FFI_TYPE_SINT64: ! { ! jlong r = POPL(); ! *(jlong*)retp = r; ! return 0; ! } ! ! default: ! throw_internal_error ("unknown return type"); ! } ! } ! /** handle an exception */ ! if ( find_exception (ex, inv) ) ! goto next_segment; ! return ex; ! } ! #define SAVE_PC inv->pc = pc ! bool _Jv_InterpMethod::find_exception (jobject ex, ! _Jv_InterpMethodInvocation *inv) ! { ! // We subtract one because the PC was incremented before it was ! // saved. ! int logical_pc = inv->pc - 1 - bytecode (); ! _Jv_InterpException *exc = exceptions (); ! jclass exc_class = ex->getClass (); ! for (int i = 0; i < exc_count; i++) ! { ! if (exc[i].start_pc <= logical_pc && logical_pc < exc[i].end_pc) ! { ! jclass handler; ! if (exc[i].handler_type != 0) ! handler = (_Jv_ResolvePoolEntry (defining_class, ! exc[i].handler_type)).clazz; ! else ! handler = NULL; ! ! if (handler==NULL || handler->isAssignableFrom (exc_class)) ! { ! inv->pc = bytecode () + exc[i].handler_pc; ! inv->sp = inv->stack_base (); // reset stack ! (inv->sp++)->o = ex; // push exception ! return true; ! } ! } ! } ! return false; ! } ! void _Jv_InterpMethod::run_normal (ffi_cif* cif, ! void* ret, ! ffi_raw * args, ! void* __this) ! { ! _Jv_InterpMethod* _this = (_Jv_InterpMethod*)__this; ! // we do the alloca of the method invocation here, to allow the method ! // "run" ro be inlined. Otherwise gcc will ignore the inline directive. ! int storage_size = _this->max_stack+_this->max_locals; ! _Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*) ! __builtin_alloca (sizeof (_Jv_InterpMethodInvocation) ! + storage_size * sizeof (_Jv_word)); ! jobject ex = _this->run (cif, ret, args, inv); ! if (ex != 0) throw static_cast(ex); ! } ! void _Jv_InterpMethod::run_synch_object (ffi_cif* cif, ! void* ret, ! ffi_raw * args, ! void* __this) ! { ! _Jv_InterpMethod* _this = (_Jv_InterpMethod*)__this; ! jobject rcv = (jobject)args[0].ptr; ! int storage_size = _this->max_stack+_this->max_locals; ! _Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*) ! __builtin_alloca (sizeof (_Jv_InterpMethodInvocation) ! + storage_size * sizeof (_Jv_word)); ! _Jv_MonitorEnter (rcv); ! jobject ex = _this->run (cif, ret, args, inv); ! _Jv_MonitorExit (rcv); ! if (ex != 0) throw static_cast(ex); ! } ! void _Jv_InterpMethod::run_synch_class (ffi_cif* cif, ! void* ret, ! ffi_raw * args, ! void* __this) ! { ! _Jv_InterpMethod* _this = (_Jv_InterpMethod*)__this; ! jclass sync = _this->defining_class; ! int storage_size = _this->max_stack+_this->max_locals; ! _Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*) ! __builtin_alloca (sizeof (_Jv_InterpMethodInvocation) ! + storage_size * sizeof (_Jv_word)); ! _Jv_MonitorEnter (sync); ! jobject ex = _this->run (cif, ret, args, inv); ! _Jv_MonitorExit (sync); ! if (ex != 0) throw static_cast(ex); ! } ! /* ! This proceeds execution, as designated in "inv". If an exception ! happens, then it is simply thrown, and handled in Java. Thus, the pc ! needs to be stored in the inv->pc at all times, so we can figure ! out which handler (if any) to invoke. ! One design issue, which I have not completely considered, is if it ! should be possible to have interpreted classes linked in! Seldom used ! (or non-critical) classes could reasonably be interpreted. ! */ ! void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv) { using namespace java::lang::reflect; ! _Jv_word *sp = inv->sp; ! unsigned char *pc = inv->pc; ! _Jv_word *locals = inv->local_base (); ! _Jv_word *pool_data = defining_class->constants.data; ! ! /* these two are used in the invokeXXX instructions */ void (*fun)(); _Jv_ResolvedMethod* rmeth; #define INSN_LABEL(op) &&insn_##op - #define GOTO_INSN(op) goto *(insn_target[op]) static const void *const insn_target[] = { --- 240,790 ---- } \ while (0) ! void _Jv_InterpMethod::run_normal (ffi_cif *, ! void* ret, ! ffi_raw * args, ! void* __this) ! { ! _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; ! _this->run (ret, args); ! } ! void _Jv_InterpMethod::run_synch_object (ffi_cif *, ! void* ret, ! ffi_raw * args, ! void* __this) { ! _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; ! jobject rcv = (jobject) args[0].ptr; ! JvSynchronize mutex (rcv); ! _this->run (ret, args); ! } ! void _Jv_InterpMethod::run_synch_class (ffi_cif *, ! void* ret, ! ffi_raw * args, ! void* __this) ! { ! _Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this; ! jclass sync = _this->defining_class; ! JvSynchronize mutex (sync); ! _this->run (ret, args); ! } ! ! #ifdef DIRECT_THREADED ! // "Compile" a method by turning it from bytecode to direct-threaded ! // code. ! void ! _Jv_InterpMethod::compile (const void * const *insn_targets) ! { ! insn_slot *insns = NULL; ! int next = 0; ! unsigned char *codestart = bytecode (); ! unsigned char *end = codestart + code_length; ! _Jv_word *pool_data = defining_class->constants.data; ! ! #define SET_ONE(Field, Value) \ ! do \ ! { \ ! if (first_pass) \ ! ++next; \ ! else \ ! insns[next++].Field = Value; \ ! } \ ! while (0) ! ! #define SET_INSN(Value) SET_ONE (insn, (void *) Value) ! #define SET_INT(Value) SET_ONE (int_val, Value) ! #define SET_DATUM(Value) SET_ONE (datum, Value) ! ! // Map from bytecode PC to slot in INSNS. ! int *pc_mapping = (int *) __builtin_alloca (sizeof (int) * code_length); ! for (int i = 0; i < code_length; ++i) ! pc_mapping[i] = -1; ! ! for (int i = 0; i < 2; ++i) { ! jboolean first_pass = i == 0; ! if (! first_pass) { ! insns = (insn_slot *) _Jv_AllocBytes (sizeof (insn_slot) * next); ! next = 0; } ! ! unsigned char *pc = codestart; ! while (pc < end) { ! int base_pc_val = pc - codestart; ! if (first_pass) ! pc_mapping[base_pc_val] = next; ! java_opcode opcode = (java_opcode) *pc++; ! // Just elide NOPs. ! if (opcode == op_nop) ! continue; ! SET_INSN (insn_targets[opcode]); ! switch (opcode) ! { ! case op_nop: ! case op_aconst_null: ! case op_iconst_m1: ! case op_iconst_0: ! case op_iconst_1: ! case op_iconst_2: ! case op_iconst_3: ! case op_iconst_4: ! case op_iconst_5: ! case op_lconst_0: ! case op_lconst_1: ! case op_fconst_0: ! case op_fconst_1: ! case op_fconst_2: ! case op_dconst_0: ! case op_dconst_1: ! case op_iload_0: ! case op_iload_1: ! case op_iload_2: ! case op_iload_3: ! case op_lload_0: ! case op_lload_1: ! case op_lload_2: ! case op_lload_3: ! case op_fload_0: ! case op_fload_1: ! case op_fload_2: ! case op_fload_3: ! case op_dload_0: ! case op_dload_1: ! case op_dload_2: ! case op_dload_3: ! case op_aload_0: ! case op_aload_1: ! case op_aload_2: ! case op_aload_3: ! case op_iaload: ! case op_laload: ! case op_faload: ! case op_daload: ! case op_aaload: ! case op_baload: ! case op_caload: ! case op_saload: ! case op_istore_0: ! case op_istore_1: ! case op_istore_2: ! case op_istore_3: ! case op_lstore_0: ! case op_lstore_1: ! case op_lstore_2: ! case op_lstore_3: ! case op_fstore_0: ! case op_fstore_1: ! case op_fstore_2: ! case op_fstore_3: ! case op_dstore_0: ! case op_dstore_1: ! case op_dstore_2: ! case op_dstore_3: ! case op_astore_0: ! case op_astore_1: ! case op_astore_2: ! case op_astore_3: ! case op_iastore: ! case op_lastore: ! case op_fastore: ! case op_dastore: ! case op_aastore: ! case op_bastore: ! case op_castore: ! case op_sastore: ! case op_pop: ! case op_pop2: ! case op_dup: ! case op_dup_x1: ! case op_dup_x2: ! case op_dup2: ! case op_dup2_x1: ! case op_dup2_x2: ! case op_swap: ! case op_iadd: ! case op_isub: ! case op_imul: ! case op_idiv: ! case op_irem: ! case op_ishl: ! case op_ishr: ! case op_iushr: ! case op_iand: ! case op_ior: ! case op_ixor: ! case op_ladd: ! case op_lsub: ! case op_lmul: ! case op_ldiv: ! case op_lrem: ! case op_lshl: ! case op_lshr: ! case op_lushr: ! case op_land: ! case op_lor: ! case op_lxor: ! case op_fadd: ! case op_fsub: ! case op_fmul: ! case op_fdiv: ! case op_frem: ! case op_dadd: ! case op_dsub: ! case op_dmul: ! case op_ddiv: ! case op_drem: ! case op_ineg: ! case op_i2b: ! case op_i2c: ! case op_i2s: ! case op_lneg: ! case op_fneg: ! case op_dneg: ! case op_i2l: ! case op_i2f: ! case op_i2d: ! case op_l2i: ! case op_l2f: ! case op_l2d: ! case op_f2i: ! case op_f2l: ! case op_f2d: ! case op_d2i: ! case op_d2l: ! case op_d2f: ! case op_lcmp: ! case op_fcmpl: ! case op_fcmpg: ! case op_dcmpl: ! case op_dcmpg: ! case op_monitorenter: ! case op_monitorexit: ! case op_ireturn: ! case op_lreturn: ! case op_freturn: ! case op_dreturn: ! case op_areturn: ! case op_return: ! case op_athrow: ! case op_arraylength: ! // No argument, nothing else to do. ! break; ! case op_bipush: ! SET_INT (get1s (pc)); ! ++pc; ! break; ! case op_ldc: ! { ! int index = get1u (pc); ! ++pc; ! SET_DATUM (pool_data[index].o); ! } ! break; ! case op_ret: ! case op_iload: ! case op_lload: ! case op_fload: ! case op_dload: ! case op_aload: ! case op_istore: ! case op_lstore: ! case op_fstore: ! case op_dstore: ! case op_astore: ! case op_newarray: ! SET_INT (get1u (pc)); ! ++pc; ! break; ! case op_iinc: ! SET_INT (get1u (pc)); ! SET_INT (get1s (pc + 1)); ! pc += 2; ! break; ! case op_ldc_w: ! { ! int index = get2u (pc); ! pc += 2; ! SET_DATUM (pool_data[index].o); ! } ! break; ! case op_ldc2_w: ! { ! int index = get2u (pc); ! pc += 2; ! SET_DATUM (&pool_data[index]); ! } ! break; ! case op_sipush: ! SET_INT (get2s (pc)); ! pc += 2; ! break; ! case op_new: ! case op_getstatic: ! case op_getfield: ! case op_putfield: ! case op_putstatic: ! case op_anewarray: ! case op_instanceof: ! case op_checkcast: ! case op_invokespecial: ! case op_invokestatic: ! case op_invokevirtual: ! SET_INT (get2u (pc)); ! pc += 2; ! break; ! case op_multianewarray: ! SET_INT (get2u (pc)); ! SET_INT (get1u (pc + 2)); ! pc += 3; ! break; ! case op_jsr: ! case op_ifeq: ! case op_ifne: ! case op_iflt: ! case op_ifge: ! case op_ifgt: ! case op_ifle: ! case op_if_icmpeq: ! case op_if_icmpne: ! case op_if_icmplt: ! case op_if_icmpge: ! case op_if_icmpgt: ! case op_if_icmple: ! case op_if_acmpeq: ! case op_if_acmpne: ! case op_ifnull: ! case op_ifnonnull: ! case op_goto: ! { ! int offset = get2s (pc); ! pc += 2; ! int new_pc = base_pc_val + offset; ! bool orig_was_goto = opcode == op_goto; ! // Thread jumps. We limit the loop count; this lets ! // us avoid infinite loops if the bytecode contains ! // such. `10' is arbitrary. ! int count = 10; ! while (codestart[new_pc] == op_goto && count-- > 0) ! new_pc += get2s (&codestart[new_pc + 1]); ! // If the jump takes us to a `return' instruction and ! // the original branch was an unconditional goto, then ! // we hoist the return. ! opcode = (java_opcode) codestart[new_pc]; ! if (orig_was_goto ! && (opcode == op_ireturn || opcode == op_lreturn ! || opcode == op_freturn || opcode == op_dreturn ! || opcode == op_areturn || opcode == op_return)) ! { ! --next; ! SET_INSN (insn_targets[opcode]); ! } ! else ! SET_DATUM (&insns[pc_mapping[new_pc]]); ! } ! break; ! case op_tableswitch: ! { ! while ((pc - codestart) % 4 != 0) ! ++pc; ! jint def = get4 (pc); ! SET_DATUM (&insns[pc_mapping[base_pc_val + def]]); ! pc += 4; ! int low = get4 (pc); ! SET_INT (low); ! pc += 4; ! int high = get4 (pc); ! SET_INT (high); ! pc += 4; ! for (int i = low; i <= high; ++i) ! { ! SET_DATUM (&insns[pc_mapping[base_pc_val + get4 (pc)]]); ! pc += 4; ! } ! } ! break; ! ! case op_lookupswitch: ! { ! while ((pc - codestart) % 4 != 0) ! ++pc; + jint def = get4 (pc); + SET_DATUM (&insns[pc_mapping[base_pc_val + def]]); + pc += 4; ! jint npairs = get4 (pc); ! pc += 4; ! SET_INT (npairs); ! ! while (npairs-- > 0) ! { ! jint match = get4 (pc); ! jint offset = get4 (pc + 4); ! SET_INT (match); ! SET_DATUM (&insns[pc_mapping[base_pc_val + offset]]); ! pc += 8; ! } ! } ! break; ! ! case op_invokeinterface: ! { ! jint index = get2u (pc); ! pc += 2; ! // We ignore the next two bytes. ! pc += 2; ! SET_INT (index); ! } ! break; ! ! case op_wide: ! { ! opcode = (java_opcode) get1u (pc); ! pc += 1; ! jint val = get2u (pc); ! pc += 2; ! ! // We implement narrow and wide instructions using the ! // same code in the interpreter. So we rewrite the ! // instruction slot here. ! if (! first_pass) ! insns[next - 1].insn = (void *) insn_targets[opcode]; ! SET_INT (val); ! ! if (opcode == op_iinc) ! { ! SET_INT (get2s (pc)); ! pc += 2; ! } ! } ! break; ! ! case op_jsr_w: ! case op_goto_w: ! { ! jint offset = get4 (pc); ! pc += 4; ! SET_DATUM (&insns[pc_mapping[base_pc_val + offset]]); ! } ! break; ! ! // Some "can't happen" cases that we include for ! // error-checking purposes. ! case op_putfield_1: ! case op_putfield_2: ! case op_putfield_4: ! case op_putfield_8: ! case op_putfield_a: ! case op_putstatic_1: ! case op_putstatic_2: ! case op_putstatic_4: ! case op_putstatic_8: ! case op_putstatic_a: ! case op_getfield_1: ! case op_getfield_2s: ! case op_getfield_2u: ! case op_getfield_4: ! case op_getfield_8: ! case op_getfield_a: ! case op_getstatic_1: ! case op_getstatic_2s: ! case op_getstatic_2u: ! case op_getstatic_4: ! case op_getstatic_8: ! case op_getstatic_a: ! default: ! // Fail somehow. ! break; ! } ! } ! } ! ! // Now update exceptions. ! _Jv_InterpException *exc = exceptions (); ! for (int i = 0; i < exc_count; ++i) ! { ! exc[i].start_pc.p = &insns[pc_mapping[exc[i].start_pc.i]]; ! exc[i].end_pc.p = &insns[pc_mapping[exc[i].end_pc.i]]; ! exc[i].handler_pc.p = &insns[pc_mapping[exc[i].handler_pc.i]]; ! jclass handler = (_Jv_ResolvePoolEntry (defining_class, ! exc[i].handler_type.i)).clazz; ! exc[i].handler_type.p = handler; ! } ! ! prepared = insns; ! } ! #endif /* DIRECT_THREADED */ ! ! // This function exists so that the stack-tracing code can find the ! // boundaries of the interpreter. ! void ! _Jv_StartOfInterpreter (void) ! { ! } ! ! void ! _Jv_InterpMethod::run (void *retp, ffi_raw *args) { using namespace java::lang::reflect; ! // FRAME_DESC registers this particular invocation as the top-most ! // interpreter frame. This lets the stack tracing code (for ! // Throwable) print information about the method being interpreted ! // rather than about the interpreter itself. FRAME_DESC has a ! // destructor so it cleans up automatically when the interpreter ! // returns. ! java::lang::Thread *thread = java::lang::Thread::currentThread(); ! _Jv_MethodChain frame_desc (this, ! (_Jv_MethodChain **) &thread->interp_frame); ! _Jv_word stack[max_stack]; ! _Jv_word *sp = stack; ! ! _Jv_word locals[max_locals]; ! ! /* Go straight at it! the ffi raw format matches the internal ! stack representation exactly. At least, that's the idea. ! */ ! memcpy ((void*) locals, (void*) args, args_raw_size); ! ! _Jv_word *pool_data = defining_class->constants.data; ! ! /* These three are temporaries for common code used by several ! instructions. */ void (*fun)(); _Jv_ResolvedMethod* rmeth; + int tmpval; #define INSN_LABEL(op) &&insn_##op static const void *const insn_target[] = { *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 628,634 **** INSN_LABEL(invokespecial), INSN_LABEL(invokestatic), INSN_LABEL(invokeinterface), ! 0, /* op_xxxunusedxxx1, */ INSN_LABEL(new), INSN_LABEL(newarray), INSN_LABEL(anewarray), --- 974,980 ---- INSN_LABEL(invokespecial), INSN_LABEL(invokestatic), INSN_LABEL(invokeinterface), ! 0, /* Unused. */ INSN_LABEL(new), INSN_LABEL(newarray), INSN_LABEL(anewarray), *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 638,699 **** INSN_LABEL(instanceof), INSN_LABEL(monitorenter), INSN_LABEL(monitorexit), INSN_LABEL(wide), INSN_LABEL(multianewarray), INSN_LABEL(ifnull), INSN_LABEL(ifnonnull), INSN_LABEL(goto_w), INSN_LABEL(jsr_w), }; ! /* If the macro INLINE_SWITCH is not defined, then the main loop ! operates as one big (normal) switch statement. If it is defined, ! then the case selection is performed `inline' in the end of the ! code for each case. The latter saves a native branch instruction ! for each java-instruction, but expands the code size somewhat. ! ! NOTE: On i386 defining INLINE_SWITCH improves over all ! performance approximately seven percent, but it may be different ! for other machines. At some point, this may be made into a proper ! configuration parameter. */ ! #define INLINE_SWITCH ! #ifdef INLINE_SWITCH ! #define NEXT_INSN do { GOTO_INSN(*pc++); } while (0) - NEXT_INSN; #else ! #define NEXT_INSN goto next_insn ! next_insn: ! GOTO_INSN (*pc++); ! #endif ! /* The first few instructions here are ordered according to their ! frequency, in the hope that this will improve code locality a ! little. */ ! insn_aload_0: // 0x2a ! LOADA(0); NEXT_INSN; ! insn_iload: // 0x15 ! LOADI (get1u (pc++)); NEXT_INSN; ! insn_iload_1: // 0x1b LOADI (1); NEXT_INSN; ! insn_invokevirtual: // 0xb6 ! SAVE_PC; { ! int index = get2u (pc); pc += 2; /* _Jv_ResolvePoolEntry returns immediately if the value already * is resolved. If we want to clutter up the code here to gain --- 984,1075 ---- INSN_LABEL(instanceof), INSN_LABEL(monitorenter), INSN_LABEL(monitorexit), + #ifdef DIRECT_THREADED + 0, // wide + #else INSN_LABEL(wide), + #endif INSN_LABEL(multianewarray), INSN_LABEL(ifnull), INSN_LABEL(ifnonnull), INSN_LABEL(goto_w), INSN_LABEL(jsr_w), + 0 }; ! pc_t pc; ! #ifdef DIRECT_THREADED ! #define NEXT_INSN goto *((pc++)->insn) ! #define INTVAL() ((pc++)->int_val) ! #define AVAL() ((pc++)->datum) ! #define GET1S() INTVAL () ! #define GET2S() INTVAL () ! #define GET1U() INTVAL () ! #define GET2U() INTVAL () ! #define AVAL1U() AVAL () ! #define AVAL2U() AVAL () ! #define AVAL2UP() AVAL () ! #define SKIP_GOTO ++pc ! #define GOTO_VAL() (insn_slot *) pc->datum ! #define PCVAL(unionval) unionval.p ! #define AMPAMP(label) &&label + // Compile if we must. + if (prepared == NULL) + compile (insn_target); + pc = (insn_slot *) prepared; #else ! #define NEXT_INSN goto *(insn_target[*pc++]) ! #define GET1S() get1s (pc++) ! #define GET2S() (pc += 2, get2s (pc- 2)) ! #define GET1U() get1u (pc++) ! #define GET2U() (pc += 2, get2u (pc - 2)) ! #define AVAL1U() ({ int index = get1u (pc++); pool_data[index].o; }) ! #define AVAL2U() ({ int index = get2u (pc); pc += 2; pool_data[index].o; }) ! #define AVAL2UP() ({ int index = get2u (pc); pc += 2; &pool_data[index]; }) ! #define SKIP_GOTO pc += 2 ! #define GOTO_VAL() pc - 1 + get2s (pc) ! #define PCVAL(unionval) unionval.i ! #define AMPAMP(label) NULL ! pc = bytecode (); ! #endif /* DIRECT_THREADED */ ! #define TAKE_GOTO pc = GOTO_VAL () ! ! try ! { ! // We keep nop around. It is used if we're interpreting the ! // bytecodes and not doing direct threading. ! insn_nop: NEXT_INSN; ! /* The first few instructions here are ordered according to their ! frequency, in the hope that this will improve code locality a ! little. */ ! ! insn_aload_0: // 0x2a ! LOADA (0); NEXT_INSN; ! insn_iload: // 0x15 ! LOADI (GET1U ()); ! NEXT_INSN; ! ! insn_iload_1: // 0x1b LOADI (1); NEXT_INSN; ! insn_invokevirtual: // 0xb6 { ! int index = GET2U (); /* _Jv_ResolvePoolEntry returns immediately if the value already * is resolved. If we want to clutter up the code here to gain *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 719,731 **** else { jobject rcv = sp[0].o; ! _Jv_VTable *table = *(_Jv_VTable**)rcv; ! fun = (void (*)()) table->get_method(rmeth->vtable_index); } } goto perform_invoke; ! perform_invoke: { /* here goes the magic again... */ ffi_cif *cif = &rmeth->cif; --- 1095,1141 ---- else { jobject rcv = sp[0].o; ! _Jv_VTable *table = *(_Jv_VTable**) rcv; ! fun = (void (*)()) table->get_method (rmeth->vtable_index); } + + #ifdef DIRECT_THREADED + // Rewrite instruction so that we use a faster pre-resolved + // method. + pc[-2].insn = &&invokevirtual_resolved; + pc[-1].datum = rmeth; + #endif /* DIRECT_THREADED */ } goto perform_invoke; ! #ifdef DIRECT_THREADED ! invokevirtual_resolved: ! { ! rmeth = (_Jv_ResolvedMethod *) AVAL (); ! sp -= rmeth->stack_item_count; ! // We don't use NULLCHECK here because we can't rely on that ! // working if the method is final. So instead we do an ! // explicit test. ! if (! sp[0].o) ! throw new java::lang::NullPointerException; ! ! if (rmeth->vtable_index == -1) ! { ! // final methods do not appear in the vtable, ! // if it does not appear in the superclass. ! fun = (void (*)()) rmeth->method->ncode; ! } ! else ! { ! jobject rcv = sp[0].o; ! _Jv_VTable *table = *(_Jv_VTable**) rcv; ! fun = (void (*)()) table->get_method (rmeth->vtable_index); ! } ! } ! goto perform_invoke; ! #endif /* DIRECT_THREADED */ ! ! perform_invoke: { /* here goes the magic again... */ ffi_cif *cif = &rmeth->cif; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 757,987 **** { /* skip */ } ! else switch (rtype) { ! case FFI_TYPE_SINT8: ! { ! jbyte value = (*(jint*)&rvalue) & 0xff; ! PUSHI (value); ! } ! break; ! case FFI_TYPE_SINT16: ! { ! jshort value = (*(jint*)&rvalue) & 0xffff; ! PUSHI (value); ! } ! break; ! case FFI_TYPE_UINT16: ! { ! jint value = (*(jint*)&rvalue) & 0xffff; ! PUSHI (value); ! } ! break; ! case FFI_TYPE_FLOAT: ! PUSHF (*(jfloat*)&rvalue); ! break; ! case FFI_TYPE_DOUBLE: ! PUSHD (rvalue); ! break; ! case FFI_TYPE_SINT64: ! PUSHL (*(jlong*)&rvalue); ! break; ! default: ! throw_internal_error ("unknown return type in invokeXXX"); } - } NEXT_INSN; ! ! insn_nop: ! NEXT_INSN; ! ! insn_aconst_null: PUSHA (NULL); NEXT_INSN; ! insn_iconst_m1: PUSHI (-1); NEXT_INSN; ! insn_iconst_0: PUSHI (0); NEXT_INSN; ! insn_iconst_1: PUSHI (1); NEXT_INSN; ! insn_iconst_2: PUSHI (2); NEXT_INSN; ! insn_iconst_3: PUSHI (3); NEXT_INSN; ! insn_iconst_4: PUSHI (4); NEXT_INSN; ! insn_iconst_5: PUSHI (5); NEXT_INSN; ! insn_lconst_0: PUSHL (0); NEXT_INSN; ! insn_lconst_1: PUSHL (1); NEXT_INSN; ! insn_fconst_0: PUSHF (0); NEXT_INSN; ! insn_fconst_1: PUSHF (1); NEXT_INSN; ! insn_fconst_2: PUSHF (2); NEXT_INSN; ! insn_dconst_0: PUSHD (0); NEXT_INSN; ! insn_dconst_1: PUSHD (1); NEXT_INSN; ! insn_bipush: ! PUSHI (get1s(pc++)); NEXT_INSN; ! ! insn_sipush: ! PUSHI (get2s(pc)); pc += 2; NEXT_INSN; ! insn_ldc: ! { ! int index = get1u (pc++); ! PUSHA(pool_data[index].o); ! } NEXT_INSN; ! ! insn_ldc_w: ! { ! int index = get2u (pc); pc += 2; ! PUSHA(pool_data[index].o); ! } NEXT_INSN; ! insn_ldc2_w: { ! int index = get2u (pc); pc += 2; ! memcpy (sp, &pool_data[index], 2*sizeof (_Jv_word)); sp += 2; } NEXT_INSN; ! insn_lload: ! LOADL (get1u (pc++)); NEXT_INSN; ! insn_fload: ! LOADF (get1u (pc++)); NEXT_INSN; ! insn_dload: ! LOADD (get1u (pc++)); NEXT_INSN; ! insn_aload: ! LOADA (get1u (pc++)); NEXT_INSN; ! insn_iload_0: LOADI (0); NEXT_INSN; ! insn_iload_2: LOADI (2); NEXT_INSN; ! insn_iload_3: LOADI (3); NEXT_INSN; ! insn_lload_0: LOADL (0); NEXT_INSN; ! insn_lload_1: LOADL (1); NEXT_INSN; ! insn_lload_2: LOADL (2); NEXT_INSN; ! insn_lload_3: LOADL (3); NEXT_INSN; ! insn_fload_0: LOADF (0); NEXT_INSN; ! insn_fload_1: LOADF (1); NEXT_INSN; ! insn_fload_2: LOADF (2); NEXT_INSN; ! insn_fload_3: LOADF (3); NEXT_INSN; ! insn_dload_0: LOADD (0); NEXT_INSN; ! insn_dload_1: LOADD (1); NEXT_INSN; ! insn_dload_2: LOADD (2); NEXT_INSN; ! insn_dload_3: LOADD (3); NEXT_INSN; ! insn_aload_1: LOADA(1); NEXT_INSN; ! insn_aload_2: LOADA(2); NEXT_INSN; ! insn_aload_3: LOADA(3); NEXT_INSN; ! insn_iaload: { jint index = POPI(); jintArray arr = (jintArray) POPA(); --- 1167,1393 ---- { /* skip */ } ! else { ! switch (rtype) ! { ! case FFI_TYPE_SINT8: ! { ! jbyte value = (*(jint*)&rvalue) & 0xff; ! PUSHI (value); ! } ! break; ! case FFI_TYPE_SINT16: ! { ! jshort value = (*(jint*)&rvalue) & 0xffff; ! PUSHI (value); ! } ! break; ! case FFI_TYPE_UINT16: ! { ! jint value = (*(jint*)&rvalue) & 0xffff; ! PUSHI (value); ! } ! break; ! case FFI_TYPE_FLOAT: ! PUSHF (*(jfloat*)&rvalue); ! break; ! case FFI_TYPE_DOUBLE: ! PUSHD (rvalue); ! break; ! case FFI_TYPE_SINT64: ! PUSHL (*(jlong*)&rvalue); ! break; ! default: ! throw_internal_error ("unknown return type in invokeXXX"); ! } } } NEXT_INSN; ! insn_aconst_null: PUSHA (NULL); NEXT_INSN; ! insn_iconst_m1: PUSHI (-1); NEXT_INSN; ! insn_iconst_0: PUSHI (0); NEXT_INSN; ! insn_iconst_1: PUSHI (1); NEXT_INSN; ! insn_iconst_2: PUSHI (2); NEXT_INSN; ! insn_iconst_3: PUSHI (3); NEXT_INSN; ! insn_iconst_4: PUSHI (4); NEXT_INSN; ! insn_iconst_5: PUSHI (5); NEXT_INSN; ! insn_lconst_0: PUSHL (0); NEXT_INSN; ! insn_lconst_1: PUSHL (1); NEXT_INSN; ! insn_fconst_0: PUSHF (0); NEXT_INSN; ! insn_fconst_1: PUSHF (1); NEXT_INSN; ! insn_fconst_2: PUSHF (2); NEXT_INSN; ! insn_dconst_0: PUSHD (0); NEXT_INSN; ! insn_dconst_1: PUSHD (1); NEXT_INSN; ! insn_bipush: ! // For direct threaded, bipush and sipush are the same. ! #ifndef DIRECT_THREADED ! PUSHI (GET1S ()); NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! insn_sipush: ! PUSHI (GET2S ()); NEXT_INSN; ! insn_ldc: ! // For direct threaded, ldc and ldc_w are the same. ! #ifndef DIRECT_THREADED ! PUSHA ((jobject) AVAL1U ()); NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! insn_ldc_w: ! PUSHA ((jobject) AVAL2U ()); NEXT_INSN; ! insn_ldc2_w: { ! void *where = AVAL2UP (); ! memcpy (sp, where, 2*sizeof (_Jv_word)); sp += 2; } NEXT_INSN; ! insn_lload: ! LOADL (GET1U ()); NEXT_INSN; ! insn_fload: ! LOADF (GET1U ()); NEXT_INSN; ! insn_dload: ! LOADD (GET1U ()); NEXT_INSN; ! insn_aload: ! LOADA (GET1U ()); NEXT_INSN; ! insn_iload_0: LOADI (0); NEXT_INSN; ! insn_iload_2: LOADI (2); NEXT_INSN; ! insn_iload_3: LOADI (3); NEXT_INSN; ! insn_lload_0: LOADL (0); NEXT_INSN; ! insn_lload_1: LOADL (1); NEXT_INSN; ! insn_lload_2: LOADL (2); NEXT_INSN; ! insn_lload_3: LOADL (3); NEXT_INSN; ! insn_fload_0: LOADF (0); NEXT_INSN; ! insn_fload_1: LOADF (1); NEXT_INSN; ! insn_fload_2: LOADF (2); NEXT_INSN; ! insn_fload_3: LOADF (3); NEXT_INSN; ! insn_dload_0: LOADD (0); NEXT_INSN; ! insn_dload_1: LOADD (1); NEXT_INSN; ! insn_dload_2: LOADD (2); NEXT_INSN; ! insn_dload_3: LOADD (3); NEXT_INSN; ! insn_aload_1: LOADA(1); NEXT_INSN; ! insn_aload_2: LOADA(2); NEXT_INSN; ! insn_aload_3: LOADA(3); NEXT_INSN; ! insn_iaload: { jint index = POPI(); jintArray arr = (jintArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 991,997 **** } NEXT_INSN; ! insn_laload: { jint index = POPI(); jlongArray arr = (jlongArray) POPA(); --- 1397,1403 ---- } NEXT_INSN; ! insn_laload: { jint index = POPI(); jlongArray arr = (jlongArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1001,1007 **** } NEXT_INSN; ! insn_faload: { jint index = POPI(); jfloatArray arr = (jfloatArray) POPA(); --- 1407,1413 ---- } NEXT_INSN; ! insn_faload: { jint index = POPI(); jfloatArray arr = (jfloatArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1011,1017 **** } NEXT_INSN; ! insn_daload: { jint index = POPI(); jdoubleArray arr = (jdoubleArray) POPA(); --- 1417,1423 ---- } NEXT_INSN; ! insn_daload: { jint index = POPI(); jdoubleArray arr = (jdoubleArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1021,1027 **** } NEXT_INSN; ! insn_aaload: { jint index = POPI(); jobjectArray arr = (jobjectArray) POPA(); --- 1427,1433 ---- } NEXT_INSN; ! insn_aaload: { jint index = POPI(); jobjectArray arr = (jobjectArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1031,1037 **** } NEXT_INSN; ! insn_baload: { jint index = POPI(); jbyteArray arr = (jbyteArray) POPA(); --- 1437,1443 ---- } NEXT_INSN; ! insn_baload: { jint index = POPI(); jbyteArray arr = (jbyteArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1041,1047 **** } NEXT_INSN; ! insn_caload: { jint index = POPI(); jcharArray arr = (jcharArray) POPA(); --- 1447,1453 ---- } NEXT_INSN; ! insn_caload: { jint index = POPI(); jcharArray arr = (jcharArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1051,1057 **** } NEXT_INSN; ! insn_saload: { jint index = POPI(); jshortArray arr = (jshortArray) POPA(); --- 1457,1463 ---- } NEXT_INSN; ! insn_saload: { jint index = POPI(); jshortArray arr = (jshortArray) POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1061,1167 **** } NEXT_INSN; ! insn_istore: ! STOREI (get1u (pc++)); NEXT_INSN; ! insn_lstore: ! STOREL (get1u (pc++)); NEXT_INSN; ! insn_fstore: ! STOREF (get1u (pc++)); NEXT_INSN; ! insn_dstore: ! STORED (get1u (pc++)); NEXT_INSN; ! insn_astore: ! STOREA (get1u (pc++)); NEXT_INSN; ! insn_istore_0: STOREI (0); NEXT_INSN; ! insn_istore_1: STOREI (1); NEXT_INSN; ! insn_istore_2: STOREI (2); NEXT_INSN; ! insn_istore_3: STOREI (3); NEXT_INSN; ! insn_lstore_0: STOREL (0); NEXT_INSN; ! insn_lstore_1: STOREL (1); NEXT_INSN; ! insn_lstore_2: STOREL (2); NEXT_INSN; ! insn_lstore_3: STOREL (3); NEXT_INSN; ! insn_fstore_0: STOREF (0); NEXT_INSN; ! insn_fstore_1: STOREF (1); NEXT_INSN; ! insn_fstore_2: STOREF (2); NEXT_INSN; ! insn_fstore_3: STOREF (3); NEXT_INSN; ! insn_dstore_0: STORED (0); NEXT_INSN; ! insn_dstore_1: STORED (1); NEXT_INSN; ! insn_dstore_2: STORED (2); NEXT_INSN; ! insn_dstore_3: STORED (3); NEXT_INSN; ! insn_astore_0: STOREA(0); NEXT_INSN; ! insn_astore_1: STOREA(1); NEXT_INSN; ! insn_astore_2: STOREA(2); NEXT_INSN; ! insn_astore_3: STOREA(3); NEXT_INSN; ! insn_iastore: { jint value = POPI(); jint index = POPI(); --- 1467,1573 ---- } NEXT_INSN; ! insn_istore: ! STOREI (GET1U ()); NEXT_INSN; ! insn_lstore: ! STOREL (GET1U ()); NEXT_INSN; ! insn_fstore: ! STOREF (GET1U ()); NEXT_INSN; ! insn_dstore: ! STORED (GET1U ()); NEXT_INSN; ! insn_astore: ! STOREA (GET1U ()); NEXT_INSN; ! insn_istore_0: STOREI (0); NEXT_INSN; ! insn_istore_1: STOREI (1); NEXT_INSN; ! insn_istore_2: STOREI (2); NEXT_INSN; ! insn_istore_3: STOREI (3); NEXT_INSN; ! insn_lstore_0: STOREL (0); NEXT_INSN; ! insn_lstore_1: STOREL (1); NEXT_INSN; ! insn_lstore_2: STOREL (2); NEXT_INSN; ! insn_lstore_3: STOREL (3); NEXT_INSN; ! insn_fstore_0: STOREF (0); NEXT_INSN; ! insn_fstore_1: STOREF (1); NEXT_INSN; ! insn_fstore_2: STOREF (2); NEXT_INSN; ! insn_fstore_3: STOREF (3); NEXT_INSN; ! insn_dstore_0: STORED (0); NEXT_INSN; ! insn_dstore_1: STORED (1); NEXT_INSN; ! insn_dstore_2: STORED (2); NEXT_INSN; ! insn_dstore_3: STORED (3); NEXT_INSN; ! insn_astore_0: STOREA(0); NEXT_INSN; ! insn_astore_1: STOREA(1); NEXT_INSN; ! insn_astore_2: STOREA(2); NEXT_INSN; ! insn_astore_3: STOREA(3); NEXT_INSN; ! insn_iastore: { jint value = POPI(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1172,1178 **** } NEXT_INSN; ! insn_lastore: { jlong value = POPL(); jint index = POPI(); --- 1578,1584 ---- } NEXT_INSN; ! insn_lastore: { jlong value = POPL(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1183,1189 **** } NEXT_INSN; ! insn_fastore: { jfloat value = POPF(); jint index = POPI(); --- 1589,1595 ---- } NEXT_INSN; ! insn_fastore: { jfloat value = POPF(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1194,1200 **** } NEXT_INSN; ! insn_dastore: { jdouble value = POPD(); jint index = POPI(); --- 1600,1606 ---- } NEXT_INSN; ! insn_dastore: { jdouble value = POPD(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1205,1211 **** } NEXT_INSN; ! insn_aastore: { jobject value = POPA(); jint index = POPI(); --- 1611,1617 ---- } NEXT_INSN; ! insn_aastore: { jobject value = POPA(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1217,1223 **** } NEXT_INSN; ! insn_bastore: { jbyte value = (jbyte) POPI(); jint index = POPI(); --- 1623,1629 ---- } NEXT_INSN; ! insn_bastore: { jbyte value = (jbyte) POPI(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1228,1234 **** } NEXT_INSN; ! insn_castore: { jchar value = (jchar) POPI(); jint index = POPI(); --- 1634,1640 ---- } NEXT_INSN; ! insn_castore: { jchar value = (jchar) POPI(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1239,1245 **** } NEXT_INSN; ! insn_sastore: { jshort value = (jshort) POPI(); jint index = POPI(); --- 1645,1651 ---- } NEXT_INSN; ! insn_sastore: { jshort value = (jshort) POPI(); jint index = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1250,1291 **** } NEXT_INSN; ! insn_pop: sp -= 1; NEXT_INSN; ! insn_pop2: sp -= 2; NEXT_INSN; ! insn_dup: sp[0] = sp[-1]; sp += 1; NEXT_INSN; ! insn_dup_x1: dupx (sp, 1, 1); sp+=1; NEXT_INSN; ! insn_dup_x2: dupx (sp, 1, 2); sp+=1; NEXT_INSN; ! insn_dup2: sp[0] = sp[-2]; sp[1] = sp[-1]; sp += 2; NEXT_INSN; ! insn_dup2_x1: dupx (sp, 2, 1); sp+=2; NEXT_INSN; ! insn_dup2_x2: dupx (sp, 2, 2); sp+=2; NEXT_INSN; ! insn_swap: { jobject tmp1 = POPA(); jobject tmp2 = POPA(); --- 1656,1697 ---- } NEXT_INSN; ! insn_pop: sp -= 1; NEXT_INSN; ! insn_pop2: sp -= 2; NEXT_INSN; ! insn_dup: sp[0] = sp[-1]; sp += 1; NEXT_INSN; ! insn_dup_x1: dupx (sp, 1, 1); sp+=1; NEXT_INSN; ! insn_dup_x2: dupx (sp, 1, 2); sp+=1; NEXT_INSN; ! insn_dup2: sp[0] = sp[-2]; sp[1] = sp[-1]; sp += 2; NEXT_INSN; ! insn_dup2_x1: dupx (sp, 2, 1); sp+=2; NEXT_INSN; ! insn_dup2_x2: dupx (sp, 2, 2); sp+=2; NEXT_INSN; ! insn_swap: { jobject tmp1 = POPA(); jobject tmp2 = POPA(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1294,1349 **** } NEXT_INSN; ! insn_iadd: BINOPI(+); NEXT_INSN; ! insn_ladd: BINOPL(+); NEXT_INSN; ! insn_fadd: BINOPF(+); NEXT_INSN; ! insn_dadd: BINOPD(+); NEXT_INSN; ! insn_isub: BINOPI(-); NEXT_INSN; ! insn_lsub: BINOPL(-); NEXT_INSN; ! insn_fsub: BINOPF(-); NEXT_INSN; ! insn_dsub: BINOPD(-); NEXT_INSN; ! insn_imul: BINOPI(*); NEXT_INSN; ! insn_lmul: BINOPL(*); NEXT_INSN; ! insn_fmul: BINOPF(*); NEXT_INSN; ! insn_dmul: BINOPD(*); NEXT_INSN; ! insn_idiv: ! SAVE_PC; { jint value2 = POPI(); jint value1 = POPI(); --- 1700,1754 ---- } NEXT_INSN; ! insn_iadd: BINOPI(+); NEXT_INSN; ! insn_ladd: BINOPL(+); NEXT_INSN; ! insn_fadd: BINOPF(+); NEXT_INSN; ! insn_dadd: BINOPD(+); NEXT_INSN; ! insn_isub: BINOPI(-); NEXT_INSN; ! insn_lsub: BINOPL(-); NEXT_INSN; ! insn_fsub: BINOPF(-); NEXT_INSN; ! insn_dsub: BINOPD(-); NEXT_INSN; ! insn_imul: BINOPI(*); NEXT_INSN; ! insn_lmul: BINOPL(*); NEXT_INSN; ! insn_fmul: BINOPF(*); NEXT_INSN; ! insn_dmul: BINOPD(*); NEXT_INSN; ! insn_idiv: { jint value2 = POPI(); jint value1 = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1352,1359 **** } NEXT_INSN; ! insn_ldiv: ! SAVE_PC; { jlong value2 = POPL(); jlong value1 = POPL(); --- 1757,1763 ---- } NEXT_INSN; ! insn_ldiv: { jlong value2 = POPL(); jlong value1 = POPL(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1362,1368 **** } NEXT_INSN; ! insn_fdiv: { jfloat value2 = POPF(); jfloat value1 = POPF(); --- 1766,1772 ---- } NEXT_INSN; ! insn_fdiv: { jfloat value2 = POPF(); jfloat value1 = POPF(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1371,1377 **** } NEXT_INSN; ! insn_ddiv: { jdouble value2 = POPD(); jdouble value1 = POPD(); --- 1775,1781 ---- } NEXT_INSN; ! insn_ddiv: { jdouble value2 = POPD(); jdouble value1 = POPD(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1380,1387 **** } NEXT_INSN; ! insn_irem: ! SAVE_PC; { jint value2 = POPI(); jint value1 = POPI(); --- 1784,1790 ---- } NEXT_INSN; ! insn_irem: { jint value2 = POPI(); jint value1 = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1390,1397 **** } NEXT_INSN; ! insn_lrem: ! SAVE_PC; { jlong value2 = POPL(); jlong value1 = POPL(); --- 1793,1799 ---- } NEXT_INSN; ! insn_lrem: { jlong value2 = POPL(); jlong value1 = POPL(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1400,1406 **** } NEXT_INSN; ! insn_frem: { jfloat value2 = POPF(); jfloat value1 = POPF(); --- 1802,1808 ---- } NEXT_INSN; ! insn_frem: { jfloat value2 = POPF(); jfloat value1 = POPF(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1409,1415 **** } NEXT_INSN; ! insn_drem: { jdouble value2 = POPD(); jdouble value1 = POPD(); --- 1811,1817 ---- } NEXT_INSN; ! insn_drem: { jdouble value2 = POPD(); jdouble value1 = POPD(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1418,1452 **** } NEXT_INSN; ! insn_ineg: { jint value = POPI(); PUSHI (value * -1); } NEXT_INSN; ! insn_lneg: { jlong value = POPL(); PUSHL (value * -1); } NEXT_INSN; ! insn_fneg: { jfloat value = POPF(); PUSHF (value * -1); } NEXT_INSN; ! insn_dneg: { jdouble value = POPD(); PUSHD (value * -1); } NEXT_INSN; ! insn_ishl: { jint shift = (POPI() & 0x1f); jint value = POPI(); --- 1820,1854 ---- } NEXT_INSN; ! insn_ineg: { jint value = POPI(); PUSHI (value * -1); } NEXT_INSN; ! insn_lneg: { jlong value = POPL(); PUSHL (value * -1); } NEXT_INSN; ! insn_fneg: { jfloat value = POPF(); PUSHF (value * -1); } NEXT_INSN; ! insn_dneg: { jdouble value = POPD(); PUSHD (value * -1); } NEXT_INSN; ! insn_ishl: { jint shift = (POPI() & 0x1f); jint value = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1454,1460 **** } NEXT_INSN; ! insn_lshl: { jint shift = (POPI() & 0x3f); jlong value = POPL(); --- 1856,1862 ---- } NEXT_INSN; ! insn_lshl: { jint shift = (POPI() & 0x3f); jlong value = POPL(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1462,1468 **** } NEXT_INSN; ! insn_ishr: { jint shift = (POPI() & 0x1f); jint value = POPI(); --- 1864,1870 ---- } NEXT_INSN; ! insn_ishr: { jint shift = (POPI() & 0x1f); jint value = POPI(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1470,1476 **** } NEXT_INSN; ! insn_lshr: { jint shift = (POPI() & 0x3f); jlong value = POPL(); --- 1872,1878 ---- } NEXT_INSN; ! insn_lshr: { jint shift = (POPI() & 0x3f); jlong value = POPL(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1478,1492 **** } NEXT_INSN; ! insn_iushr: { jint shift = (POPI() & 0x1f); ! unsigned long value = POPI(); PUSHI ((jint) (value >> shift)); } NEXT_INSN; ! insn_lushr: { jint shift = (POPI() & 0x3f); UINT64 value = (UINT64) POPL(); --- 1880,1894 ---- } NEXT_INSN; ! insn_iushr: { jint shift = (POPI() & 0x1f); ! UINT32 value = (UINT32) POPI(); PUSHI ((jint) (value >> shift)); } NEXT_INSN; ! insn_lushr: { jint shift = (POPI() & 0x3f); UINT64 value = (UINT64) POPL(); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1494,1556 **** } NEXT_INSN; ! insn_iand: BINOPI (&); NEXT_INSN; ! insn_land: BINOPL (&); NEXT_INSN; ! insn_ior: BINOPI (|); NEXT_INSN; ! insn_lor: BINOPL (|); NEXT_INSN; ! insn_ixor: BINOPI (^); NEXT_INSN; ! insn_lxor: BINOPL (^); NEXT_INSN; ! insn_iinc: { ! jint index = get1u (pc++); ! jint amount = get1s (pc++); locals[index].i += amount; } NEXT_INSN; ! insn_i2l: {jlong value = POPI(); PUSHL (value);} NEXT_INSN; ! insn_i2f: {jfloat value = POPI(); PUSHF (value);} NEXT_INSN; ! insn_i2d: {jdouble value = POPI(); PUSHD (value);} NEXT_INSN; ! insn_l2i: {jint value = POPL(); PUSHI (value);} NEXT_INSN; ! insn_l2f: {jfloat value = POPL(); PUSHF (value);} NEXT_INSN; ! insn_l2d: {jdouble value = POPL(); PUSHD (value);} NEXT_INSN; ! insn_f2i: { using namespace java::lang; jint value = convert (POPF (), Integer::MIN_VALUE, Integer::MAX_VALUE); --- 1896,1958 ---- } NEXT_INSN; ! insn_iand: BINOPI (&); NEXT_INSN; ! insn_land: BINOPL (&); NEXT_INSN; ! insn_ior: BINOPI (|); NEXT_INSN; ! insn_lor: BINOPL (|); NEXT_INSN; ! insn_ixor: BINOPI (^); NEXT_INSN; ! insn_lxor: BINOPL (^); NEXT_INSN; ! insn_iinc: { ! jint index = GET1U (); ! jint amount = GET1S (); locals[index].i += amount; } NEXT_INSN; ! insn_i2l: {jlong value = POPI(); PUSHL (value);} NEXT_INSN; ! insn_i2f: {jfloat value = POPI(); PUSHF (value);} NEXT_INSN; ! insn_i2d: {jdouble value = POPI(); PUSHD (value);} NEXT_INSN; ! insn_l2i: {jint value = POPL(); PUSHI (value);} NEXT_INSN; ! insn_l2f: {jfloat value = POPL(); PUSHF (value);} NEXT_INSN; ! insn_l2d: {jdouble value = POPL(); PUSHD (value);} NEXT_INSN; ! insn_f2i: { using namespace java::lang; jint value = convert (POPF (), Integer::MIN_VALUE, Integer::MAX_VALUE); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1558,1564 **** } NEXT_INSN; ! insn_f2l: { using namespace java::lang; jlong value = convert (POPF (), Long::MIN_VALUE, Long::MAX_VALUE); --- 1960,1966 ---- } NEXT_INSN; ! insn_f2l: { using namespace java::lang; jlong value = convert (POPF (), Long::MIN_VALUE, Long::MAX_VALUE); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1566,1576 **** } NEXT_INSN; ! insn_f2d: { jdouble value = POPF (); PUSHD(value); } NEXT_INSN; ! insn_d2i: { using namespace java::lang; jint value = convert (POPD (), Integer::MIN_VALUE, Integer::MAX_VALUE); --- 1968,1978 ---- } NEXT_INSN; ! insn_f2d: { jdouble value = POPF (); PUSHD(value); } NEXT_INSN; ! insn_d2i: { using namespace java::lang; jint value = convert (POPD (), Integer::MIN_VALUE, Integer::MAX_VALUE); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1578,1584 **** } NEXT_INSN; ! insn_d2l: { using namespace java::lang; jlong value = convert (POPD (), Long::MIN_VALUE, Long::MAX_VALUE); --- 1980,1986 ---- } NEXT_INSN; ! insn_d2l: { using namespace java::lang; jlong value = convert (POPD (), Long::MIN_VALUE, Long::MAX_VALUE); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1586,1608 **** } NEXT_INSN; ! insn_d2f: { jfloat value = POPD (); PUSHF(value); } NEXT_INSN; ! insn_i2b: { jbyte value = POPI (); PUSHI(value); } NEXT_INSN; ! insn_i2c: { jchar value = POPI (); PUSHI(value); } NEXT_INSN; ! insn_i2s: { jshort value = POPI (); PUSHI(value); } NEXT_INSN; ! insn_lcmp: { jlong value2 = POPL (); jlong value1 = POPL (); --- 1988,2010 ---- } NEXT_INSN; ! insn_d2f: { jfloat value = POPD (); PUSHF(value); } NEXT_INSN; ! insn_i2b: { jbyte value = POPI (); PUSHI(value); } NEXT_INSN; ! insn_i2c: { jchar value = POPI (); PUSHI(value); } NEXT_INSN; ! insn_i2s: { jshort value = POPI (); PUSHI(value); } NEXT_INSN; ! insn_lcmp: { jlong value2 = POPL (); jlong value1 = POPL (); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1615,1622 **** } NEXT_INSN; ! insn_fcmpl: ! insn_fcmpg: { jfloat value2 = POPF (); jfloat value1 = POPF (); --- 2017,2030 ---- } NEXT_INSN; ! insn_fcmpl: ! tmpval = -1; ! goto fcmp; ! ! insn_fcmpg: ! tmpval = 1; ! ! fcmp: { jfloat value2 = POPF (); jfloat value1 = POPF (); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1626,1640 **** PUSHI (0); else if (value1 < value2) PUSHI (-1); - else if ((*(pc-1)) == op_fcmpg) - PUSHI (1); else ! PUSHI (-1); } NEXT_INSN; ! insn_dcmpl: ! insn_dcmpg: { jdouble value2 = POPD (); jdouble value1 = POPD (); --- 2034,2052 ---- PUSHI (0); else if (value1 < value2) PUSHI (-1); else ! PUSHI (tmpval); } NEXT_INSN; ! insn_dcmpl: ! tmpval = 1; ! goto dcmp; ! ! insn_dcmpg: ! tmpval = -1; ! ! dcmp: { jdouble value2 = POPD (); jdouble value1 = POPD (); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1644,1863 **** PUSHI (0); else if (value1 < value2) PUSHI (-1); - else if ((*(pc-1)) == op_dcmpg) - PUSHI (1); else ! PUSHI (-1); } NEXT_INSN; ! insn_ifeq: { - jint offset = get2s (pc); if (POPI() == 0) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_ifne: { - jint offset = get2s (pc); if (POPI() != 0) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_iflt: { - jint offset = get2s (pc); if (POPI() < 0) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_ifge: { - jint offset = get2s (pc); if (POPI() >= 0) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_ifgt: { - jint offset = get2s (pc); if (POPI() > 0) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_ifle: { - jint offset = get2s (pc); if (POPI() <= 0) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_icmpeq: { - jint offset = get2s (pc); jint value2 = POPI(); jint value1 = POPI(); if (value1 == value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_icmpne: { - jint offset = get2s (pc); jint value2 = POPI(); jint value1 = POPI(); if (value1 != value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_icmplt: { - jint offset = get2s (pc); jint value2 = POPI(); jint value1 = POPI(); if (value1 < value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_icmpge: { - jint offset = get2s (pc); jint value2 = POPI(); jint value1 = POPI(); if (value1 >= value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_icmpgt: { - jint offset = get2s (pc); jint value2 = POPI(); jint value1 = POPI(); if (value1 > value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_icmple: { - jint offset = get2s (pc); jint value2 = POPI(); jint value1 = POPI(); if (value1 <= value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_acmpeq: { - jint offset = get2s (pc); jobject value2 = POPA(); jobject value1 = POPA(); if (value1 == value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_if_acmpne: { - jint offset = get2s (pc); jobject value2 = POPA(); jobject value1 = POPA(); if (value1 != value2) ! pc = pc-1+offset; else ! pc = pc+2; } NEXT_INSN; ! insn_goto: { ! jint offset = get2s (pc); ! pc = pc-1+offset; } NEXT_INSN; ! ! insn_jsr: { ! unsigned char *base_pc = pc-1; ! jint offset = get2s (pc); pc += 2; ! PUSHA ((jobject)pc); ! pc = base_pc+offset; } NEXT_INSN; ! insn_ret: { ! jint index = get1u (pc); ! pc = (unsigned char*) PEEKA (index); } NEXT_INSN; ! insn_tableswitch: { ! unsigned char *base_pc = pc-1; int index = POPI(); ! unsigned char* base = bytecode (); ! while ((pc-base) % 4 != 0) ! pc++; ! jint def = get4 (pc); ! jint low = get4 (pc+4); ! jint high = get4 (pc+8); if (index < low || index > high) ! pc = base_pc + def; else ! pc = base_pc + get4 (pc+4*(index-low+3)); } NEXT_INSN; ! insn_lookupswitch: { unsigned char *base_pc = pc-1; int index = POPI(); unsigned char* base = bytecode (); while ((pc-base) % 4 != 0) ! pc++; jint def = get4 (pc); jint npairs = get4 (pc+4); --- 2056,2322 ---- PUSHI (0); else if (value1 < value2) PUSHI (-1); else ! PUSHI (tmpval); } NEXT_INSN; ! insn_ifeq: { if (POPI() == 0) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_ifne: { if (POPI() != 0) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_iflt: { if (POPI() < 0) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_ifge: { if (POPI() >= 0) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_ifgt: { if (POPI() > 0) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_ifle: { if (POPI() <= 0) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_icmpeq: { jint value2 = POPI(); jint value1 = POPI(); if (value1 == value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_icmpne: { jint value2 = POPI(); jint value1 = POPI(); if (value1 != value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_icmplt: { jint value2 = POPI(); jint value1 = POPI(); if (value1 < value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_icmpge: { jint value2 = POPI(); jint value1 = POPI(); if (value1 >= value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_icmpgt: { jint value2 = POPI(); jint value1 = POPI(); if (value1 > value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_icmple: { jint value2 = POPI(); jint value1 = POPI(); if (value1 <= value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_acmpeq: { jobject value2 = POPA(); jobject value1 = POPA(); if (value1 == value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_if_acmpne: { jobject value2 = POPA(); jobject value1 = POPA(); if (value1 != value2) ! TAKE_GOTO; else ! SKIP_GOTO; } NEXT_INSN; ! insn_goto_w: ! #ifndef DIRECT_THREADED ! // For direct threaded, goto and goto_w are the same. ! pc = pc - 1 + get4 (pc); ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! insn_goto: ! TAKE_GOTO; ! NEXT_INSN; ! ! insn_jsr_w: ! #ifndef DIRECT_THREADED ! // For direct threaded, jsr and jsr_w are the same. { ! pc_t next = pc - 1 + get4 (pc); ! pc += 4; ! PUSHA ((jobject) pc); ! pc = next; } NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! insn_jsr: { ! pc_t next = GOTO_VAL(); ! SKIP_GOTO; ! PUSHA ((jobject) pc); ! pc = next; } NEXT_INSN; ! insn_ret: { ! jint index = GET1U (); ! pc = (pc_t) PEEKA (index); } NEXT_INSN; ! insn_tableswitch: { ! #ifdef DIRECT_THREADED ! void *def = (pc++)->datum; ! int index = POPI(); ! jint low = INTVAL (); ! jint high = INTVAL (); ! if (index < low || index > high) ! pc = (insn_slot *) def; ! else ! pc = (insn_slot *) ((pc + index - low)->datum); ! #else ! pc_t base_pc = pc - 1; ! int index = POPI (); + pc_t base = (pc_t) bytecode (); + while ((pc - base) % 4 != 0) + ++pc; + + jint def = get4 (pc); + jint low = get4 (pc + 4); + jint high = get4 (pc + 8); if (index < low || index > high) ! pc = base_pc + def; else ! pc = base_pc + get4 (pc + 4 * (index - low + 3)); ! #endif /* DIRECT_THREADED */ } NEXT_INSN; ! insn_lookupswitch: { + #ifdef DIRECT_THREADED + void *def = (pc++)->insn; + + int index = POPI(); + + jint npairs = INTVAL (); + + int max = npairs - 1; + int min = 0; + + // Simple binary search... + while (min < max) + { + int half = (min + max) / 2; + int match = pc[2 * half].int_val; + + if (index == match) + { + // Found it. + pc = (insn_slot *) pc[2 * half + 1].datum; + NEXT_INSN; + } + else if (index < match) + // We can use HALF - 1 here because we check again on + // loop exit. + max = half - 1; + else + // We can use HALF + 1 here because we check again on + // loop exit. + min = half + 1; + } + if (index == pc[2 * min].int_val) + pc = (insn_slot *) pc[2 * min + 1].datum; + else + pc = (insn_slot *) def; + #else unsigned char *base_pc = pc-1; int index = POPI(); unsigned char* base = bytecode (); while ((pc-base) % 4 != 0) ! ++pc; jint def = get4 (pc); jint npairs = get4 (pc+4); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1865,1871 **** int max = npairs-1; int min = 0; ! // simple binary search... while (min < max) { int half = (min+max)/2; --- 2324,2330 ---- int max = npairs-1; int min = 0; ! // Simple binary search... while (min < max) { int half = (min+max)/2; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1873,1907 **** if (index == match) min = max = half; - else if (index < match) ! max = half-1; ! else ! min = half+1; } if (index == get4 (pc+ 4*(2 + 2*min))) pc = base_pc + get4 (pc+ 4*(2 + 2*min + 1)); else pc = base_pc + def; } NEXT_INSN; ! /* on return, just save the sp and return to caller */ ! insn_ireturn: ! insn_lreturn: ! insn_freturn: ! insn_dreturn: ! insn_areturn: ! insn_return: ! inv->sp = sp; return; ! insn_getstatic: ! SAVE_PC; { ! jint fieldref_index = get2u (pc); pc += 2; _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; --- 2332,2381 ---- if (index == match) min = max = half; else if (index < match) ! // We can use HALF - 1 here because we check again on ! // loop exit. ! max = half - 1; else ! // We can use HALF + 1 here because we check again on ! // loop exit. ! min = half + 1; } if (index == get4 (pc+ 4*(2 + 2*min))) pc = base_pc + get4 (pc+ 4*(2 + 2*min + 1)); else pc = base_pc + def; + #endif /* DIRECT_THREADED */ } NEXT_INSN; ! insn_areturn: ! *(jobject *) retp = POPA (); return; ! insn_lreturn: ! *(jlong *) retp = POPL (); ! return; ! ! insn_freturn: ! *(jfloat *) retp = POPF (); ! return; ! ! insn_dreturn: ! *(jdouble *) retp = POPD (); ! return; ! ! insn_ireturn: ! *(jint *) retp = POPI (); ! return; ! ! insn_return: ! return; ! ! insn_getstatic: { ! jint fieldref_index = GET2U (); _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1911,1951 **** jclass type = field->type; if (type->isPrimitive ()) { switch (type->size_in_bytes) { case 1: PUSHI (*(jbyte*) (field->u.addr)); break; case 2: if (type == JvPrimClass (char)) ! PUSHI(*(jchar*) (field->u.addr)); else ! PUSHI(*(jshort*) (field->u.addr)); break; case 4: PUSHI(*(jint*) (field->u.addr)); break; case 8: PUSHL(*(jlong*) (field->u.addr)); break; } } else { PUSHA(*(jobject*) (field->u.addr)); } } NEXT_INSN; ! insn_getfield: ! SAVE_PC; { ! jint fieldref_index = get2u (pc); pc += 2; _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; --- 2385,2468 ---- jclass type = field->type; + // We rewrite the instruction once we discover what it refers + // to. + void *newinsn = NULL; if (type->isPrimitive ()) { switch (type->size_in_bytes) { case 1: PUSHI (*(jbyte*) (field->u.addr)); + newinsn = AMPAMP (getstatic_resolved_1); break; case 2: if (type == JvPrimClass (char)) ! { ! PUSHI(*(jchar*) (field->u.addr)); ! newinsn = AMPAMP (getstatic_resolved_char); ! } else ! { ! PUSHI(*(jshort*) (field->u.addr)); ! newinsn = AMPAMP (getstatic_resolved_short); ! } break; case 4: PUSHI(*(jint*) (field->u.addr)); + newinsn = AMPAMP (getstatic_resolved_4); break; case 8: PUSHL(*(jlong*) (field->u.addr)); + newinsn = AMPAMP (getstatic_resolved_8); break; } } else { PUSHA(*(jobject*) (field->u.addr)); + newinsn = AMPAMP (getstatic_resolved_obj); } + + #ifdef DIRECT_THREADED + pc[-2].insn = newinsn; + pc[-1].datum = field->u.addr; + #endif /* DIRECT_THREADED */ } NEXT_INSN; ! #ifdef DIRECT_THREADED ! getstatic_resolved_1: ! PUSHI (*(jbyte *) AVAL ()); ! NEXT_INSN; ! ! getstatic_resolved_char: ! PUSHI (*(jchar *) AVAL ()); ! NEXT_INSN; ! ! getstatic_resolved_short: ! PUSHI (*(jshort *) AVAL ()); ! NEXT_INSN; ! ! getstatic_resolved_4: ! PUSHI (*(jint *) AVAL ()); ! NEXT_INSN; ! ! getstatic_resolved_8: ! PUSHL (*(jlong *) AVAL ()); ! NEXT_INSN; ! ! getstatic_resolved_obj: ! PUSHA (*(jobject *) AVAL ()); ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! ! insn_getfield: { ! jint fieldref_index = GET2U (); _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 1961,2001 **** jobject obj = POPA(); NULLCHECK(obj); if (type->isPrimitive ()) { switch (type->size_in_bytes) { case 1: PUSHI (*(jbyte*) ((char*)obj + field_offset)); break; case 2: if (type == JvPrimClass (char)) ! PUSHI (*(jchar*) ((char*)obj + field_offset)); else ! PUSHI (*(jshort*) ((char*)obj + field_offset)); break; case 4: PUSHI (*(jint*) ((char*)obj + field_offset)); break; case 8: PUSHL(*(jlong*) ((char*)obj + field_offset)); break; } } else { PUSHA(*(jobject*) ((char*)obj + field_offset)); } } NEXT_INSN; ! insn_putstatic: ! SAVE_PC; { ! jint fieldref_index = get2u (pc); pc += 2; _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; --- 2478,2583 ---- jobject obj = POPA(); NULLCHECK(obj); + void *newinsn = NULL; if (type->isPrimitive ()) { switch (type->size_in_bytes) { case 1: PUSHI (*(jbyte*) ((char*)obj + field_offset)); + newinsn = AMPAMP (getfield_resolved_1); break; case 2: if (type == JvPrimClass (char)) ! { ! PUSHI (*(jchar*) ((char*)obj + field_offset)); ! newinsn = AMPAMP (getfield_resolved_char); ! } else ! { ! PUSHI (*(jshort*) ((char*)obj + field_offset)); ! newinsn = AMPAMP (getfield_resolved_short); ! } break; case 4: PUSHI (*(jint*) ((char*)obj + field_offset)); + newinsn = AMPAMP (getfield_resolved_4); break; case 8: PUSHL(*(jlong*) ((char*)obj + field_offset)); + newinsn = AMPAMP (getfield_resolved_8); break; } } else { PUSHA(*(jobject*) ((char*)obj + field_offset)); + newinsn = AMPAMP (getfield_resolved_obj); } + + #ifdef DIRECT_THREADED + pc[-2].insn = newinsn; + pc[-1].int_val = field_offset; + #endif /* DIRECT_THREADED */ } NEXT_INSN; ! #ifdef DIRECT_THREADED ! getfield_resolved_1: { ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! PUSHI (*(jbyte *) (obj + INTVAL ())); ! } ! NEXT_INSN; ! ! getfield_resolved_char: ! { ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! PUSHI (*(jchar *) (obj + INTVAL ())); ! } ! NEXT_INSN; ! ! getfield_resolved_short: ! { ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! PUSHI (*(jshort *) (obj + INTVAL ())); ! } ! NEXT_INSN; ! ! getfield_resolved_4: ! { ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! PUSHI (*(jint *) (obj + INTVAL ())); ! } ! NEXT_INSN; ! ! getfield_resolved_8: ! { ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! PUSHL (*(jlong *) (obj + INTVAL ())); ! } ! NEXT_INSN; ! ! getfield_resolved_obj: ! { ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! PUSHA (*(jobject *) (obj + INTVAL ())); ! } ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! ! insn_putstatic: ! { ! jint fieldref_index = GET2U (); _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2006,2011 **** --- 2588,2594 ---- throw_incompatible_class_change_error (JvNewStringLatin1 ("field no longer static")); + void *newinsn = NULL; if (type->isPrimitive ()) { switch (type->size_in_bytes) *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2014,2019 **** --- 2597,2603 ---- { jint value = POPI(); *(jbyte*) (field->u.addr) = value; + newinsn = AMPAMP (putstatic_resolved_1); break; } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2021,2026 **** --- 2605,2611 ---- { jint value = POPI(); *(jchar*) (field->u.addr) = value; + newinsn = AMPAMP (putstatic_resolved_2); break; } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2028,2033 **** --- 2613,2619 ---- { jint value = POPI(); *(jint*) (field->u.addr) = value; + newinsn = AMPAMP (putstatic_resolved_4); break; } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2035,2040 **** --- 2621,2627 ---- { jlong value = POPL(); *(jlong*) (field->u.addr) = value; + newinsn = AMPAMP (putstatic_resolved_8); break; } } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2043,2057 **** { jobject value = POPA(); *(jobject*) (field->u.addr) = value; } } NEXT_INSN; ! insn_putfield: ! SAVE_PC; { ! jint fieldref_index = get2u (pc); pc += 2; _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; --- 2630,2670 ---- { jobject value = POPA(); *(jobject*) (field->u.addr) = value; + newinsn = AMPAMP (putstatic_resolved_obj); } + + #ifdef DIRECT_THREADED + pc[-2].insn = newinsn; + pc[-1].datum = field->u.addr; + #endif /* DIRECT_THREADED */ } NEXT_INSN; + #ifdef DIRECT_THREADED + putstatic_resolved_1: + *(jbyte *) AVAL () = POPI (); + NEXT_INSN; + + putstatic_resolved_2: + *(jchar *) AVAL () = POPI (); + NEXT_INSN; ! putstatic_resolved_4: ! *(jint *) AVAL () = POPI (); ! NEXT_INSN; ! ! putstatic_resolved_8: ! *(jlong *) AVAL () = POPL (); ! NEXT_INSN; ! ! putstatic_resolved_obj: ! *(jobject *) AVAL () = POPA (); ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! ! insn_putfield: { ! jint fieldref_index = GET2U (); _Jv_ResolvePoolEntry (defining_class, fieldref_index); _Jv_Field *field = pool_data[fieldref_index].field; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2065,2070 **** --- 2678,2684 ---- if (field_offset > 0xffff) throw new java::lang::VirtualMachineError; + void *newinsn = NULL; if (type->isPrimitive ()) { switch (type->size_in_bytes) *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2075,2080 **** --- 2689,2695 ---- jobject obj = POPA(); NULLCHECK(obj); *(jbyte*) ((char*)obj + field_offset) = value; + newinsn = AMPAMP (putfield_resolved_1); break; } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2084,2089 **** --- 2699,2705 ---- jobject obj = POPA(); NULLCHECK(obj); *(jchar*) ((char*)obj + field_offset) = value; + newinsn = AMPAMP (putfield_resolved_2); break; } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2093,2098 **** --- 2709,2715 ---- jobject obj = POPA(); NULLCHECK(obj); *(jint*) ((char*)obj + field_offset) = value; + newinsn = AMPAMP (putfield_resolved_4); break; } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2102,2107 **** --- 2719,2725 ---- jobject obj = POPA(); NULLCHECK(obj); *(jlong*) ((char*)obj + field_offset) = value; + newinsn = AMPAMP (putfield_resolved_8); break; } } *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2112,2140 **** jobject obj = POPA(); NULLCHECK(obj); *(jobject*) ((char*)obj + field_offset) = value; } } NEXT_INSN; ! insn_invokespecial: ! SAVE_PC; { ! int index = get2u (pc); pc += 2; rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod; sp -= rmeth->stack_item_count; ! NULLCHECK (sp[0].o); fun = (void (*)()) rmeth->method->ncode; } goto perform_invoke; ! insn_invokestatic: ! SAVE_PC; { ! int index = get2u (pc); pc += 2; rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod; --- 2730,2833 ---- jobject obj = POPA(); NULLCHECK(obj); *(jobject*) ((char*)obj + field_offset) = value; + newinsn = AMPAMP (putfield_resolved_obj); } + + #ifdef DIRECT_THREADED + pc[-2].insn = newinsn; + pc[-1].int_val = field_offset; + #endif /* DIRECT_THREADED */ } NEXT_INSN; ! #ifdef DIRECT_THREADED ! putfield_resolved_1: { ! jint val = POPI (); ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! *(jbyte *) (obj + INTVAL ()) = val; ! } ! NEXT_INSN; ! ! putfield_resolved_2: ! { ! jint val = POPI (); ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! *(jchar *) (obj + INTVAL ()) = val; ! } ! NEXT_INSN; ! ! putfield_resolved_4: ! { ! jint val = POPI (); ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! *(jint *) (obj + INTVAL ()) = val; ! } ! NEXT_INSN; ! ! putfield_resolved_8: ! { ! jlong val = POPL (); ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! *(jlong *) (obj + INTVAL ()) = val; ! } ! NEXT_INSN; ! ! putfield_resolved_obj: ! { ! jobject val = POPA (); ! char *obj = (char *) POPA (); ! NULLCHECK (obj); ! *(jobject *) (obj + INTVAL ()) = val; ! } ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! ! insn_invokespecial: ! { ! int index = GET2U (); rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod; sp -= rmeth->stack_item_count; ! // We don't use NULLCHECK here because we can't rely on that ! // working for . So instead we do an explicit test. ! if (! sp[0].o) ! throw new java::lang::NullPointerException; fun = (void (*)()) rmeth->method->ncode; + + #ifdef DIRECT_THREADED + // Rewrite instruction so that we use a faster pre-resolved + // method. + pc[-2].insn = &&invokespecial_resolved; + pc[-1].datum = rmeth; + #endif /* DIRECT_THREADED */ } goto perform_invoke; ! #ifdef DIRECT_THREADED ! invokespecial_resolved: { ! rmeth = (_Jv_ResolvedMethod *) AVAL (); ! sp -= rmeth->stack_item_count; ! // We don't use NULLCHECK here because we can't rely on that ! // working for . So instead we do an explicit test. ! if (! sp[0].o) ! throw new java::lang::NullPointerException; ! fun = (void (*)()) rmeth->method->ncode; ! } ! goto perform_invoke; ! #endif /* DIRECT_THREADED */ ! ! insn_invokestatic: ! { ! int index = GET2U (); rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2142,2157 **** _Jv_InitClass (rmeth->klass); fun = (void (*)()) rmeth->method->ncode; } goto perform_invoke; ! insn_invokeinterface: ! SAVE_PC; { ! int index = get2u (pc); pc += 2; ! // invokeinterface has two unused bytes... ! pc += 2; rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod; --- 2835,2863 ---- _Jv_InitClass (rmeth->klass); fun = (void (*)()) rmeth->method->ncode; + + #ifdef DIRECT_THREADED + // Rewrite instruction so that we use a faster pre-resolved + // method. + pc[-2].insn = &&invokestatic_resolved; + pc[-1].datum = rmeth; + #endif /* DIRECT_THREADED */ } goto perform_invoke; ! #ifdef DIRECT_THREADED ! invokestatic_resolved: { ! rmeth = (_Jv_ResolvedMethod *) AVAL (); ! sp -= rmeth->stack_item_count; ! fun = (void (*)()) rmeth->method->ncode; ! } ! goto perform_invoke; ! #endif /* DIRECT_THREADED */ ! insn_invokeinterface: ! { ! int index = GET2U (); rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2165,2208 **** _Jv_LookupInterfaceMethod (rcv->getClass (), rmeth->method->name, rmeth->method->signature); } goto perform_invoke; ! insn_new: ! SAVE_PC; { ! int index = get2u (pc); pc += 2; jclass klass = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; _Jv_InitClass (klass); jobject res = _Jv_AllocObject (klass, klass->size_in_bytes); PUSHA (res); } NEXT_INSN; ! insn_newarray: ! SAVE_PC; { ! int atype = get1u (pc++); int size = POPI(); jobject result = _Jv_NewArray (atype, size); PUSHA (result); } NEXT_INSN; ! insn_anewarray: ! SAVE_PC; { ! int index = get2u (pc); pc += 2; jclass klass = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; int size = POPI(); _Jv_InitClass (klass); jobject result = _Jv_NewObjectArray (size, klass, 0); PUSHA (result); } NEXT_INSN; ! insn_arraylength: { __JArray *arr = (__JArray*)POPA(); NULLARRAYCHECK (arr); --- 2871,2966 ---- _Jv_LookupInterfaceMethod (rcv->getClass (), rmeth->method->name, rmeth->method->signature); + + #ifdef DIRECT_THREADED + // Rewrite instruction so that we use a faster pre-resolved + // method. + pc[-2].insn = &&invokeinterface_resolved; + pc[-1].datum = rmeth; + #else + // Skip dummy bytes. + pc += 2; + #endif /* DIRECT_THREADED */ } goto perform_invoke; + #ifdef DIRECT_THREADED + invokeinterface_resolved: + { + rmeth = (_Jv_ResolvedMethod *) AVAL (); + sp -= rmeth->stack_item_count; + jobject rcv = sp[0].o; + NULLCHECK (rcv); + fun = (void (*)()) + _Jv_LookupInterfaceMethod (rcv->getClass (), + rmeth->method->name, + rmeth->method->signature); + } + goto perform_invoke; + #endif /* DIRECT_THREADED */ ! insn_new: { ! int index = GET2U (); jclass klass = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; _Jv_InitClass (klass); jobject res = _Jv_AllocObject (klass, klass->size_in_bytes); PUSHA (res); + + #ifdef DIRECT_THREADED + pc[-2].insn = &&new_resolved; + pc[-1].datum = klass; + #endif /* DIRECT_THREADED */ } NEXT_INSN; ! #ifdef DIRECT_THREADED ! new_resolved: { ! jclass klass = (jclass) AVAL (); ! jobject res = _Jv_AllocObject (klass, klass->size_in_bytes); ! PUSHA (res); ! } ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! ! insn_newarray: ! { ! int atype = GET1U (); int size = POPI(); jobject result = _Jv_NewArray (atype, size); PUSHA (result); } NEXT_INSN; ! insn_anewarray: { ! int index = GET2U (); jclass klass = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; int size = POPI(); _Jv_InitClass (klass); jobject result = _Jv_NewObjectArray (size, klass, 0); PUSHA (result); + + #ifdef DIRECT_THREADED + pc[-2].insn = &&anewarray_resolved; + pc[-1].datum = klass; + #endif /* DIRECT_THREADED */ + } + NEXT_INSN; + + #ifdef DIRECT_THREADED + anewarray_resolved: + { + jclass klass = (jclass) AVAL (); + int size = POPI (); + jobject result = _Jv_NewObjectArray (size, klass, 0); + PUSHA (result); } NEXT_INSN; + #endif /* DIRECT_THREADED */ ! insn_arraylength: { __JArray *arr = (__JArray*)POPA(); NULLARRAYCHECK (arr); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2210,2251 **** } NEXT_INSN; ! insn_athrow: ! SAVE_PC; { jobject value = POPA(); throw static_cast(value); } NEXT_INSN; ! insn_checkcast: ! SAVE_PC; { jobject value = POPA(); ! jint index = get2u (pc); pc += 2; jclass to = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; if (value != NULL && ! to->isInstance (value)) ! { ! throw new java::lang::ClassCastException (to->getName()); ! } PUSHA (value); } NEXT_INSN; ! insn_instanceof: ! SAVE_PC; { jobject value = POPA(); ! jint index = get2u (pc); pc += 2; jclass to = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; PUSHI (to->isInstance (value)); } NEXT_INSN; ! insn_monitorenter: ! SAVE_PC; { jobject value = POPA(); NULLCHECK(value); --- 2968,3035 ---- } NEXT_INSN; ! insn_athrow: { jobject value = POPA(); throw static_cast(value); } NEXT_INSN; ! insn_checkcast: { jobject value = POPA(); ! jint index = GET2U (); jclass to = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; if (value != NULL && ! to->isInstance (value)) ! throw new java::lang::ClassCastException (to->getName()); PUSHA (value); + + #ifdef DIRECT_THREADED + pc[-2].insn = &&checkcast_resolved; + pc[-1].datum = to; + #endif /* DIRECT_THREADED */ } NEXT_INSN; ! #ifdef DIRECT_THREADED ! checkcast_resolved: ! { ! jobject value = POPA (); ! jclass to = (jclass) AVAL (); ! if (value != NULL && ! to->isInstance (value)) ! throw new java::lang::ClassCastException (to->getName()); ! PUSHA (value); ! } ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! ! insn_instanceof: { jobject value = POPA(); ! jint index = GET2U (); jclass to = (_Jv_ResolvePoolEntry (defining_class, index)).clazz; PUSHI (to->isInstance (value)); + + #ifdef DIRECT_THREADED + pc[-2].insn = &&instanceof_resolved; + pc[-1].datum = to; + #endif /* DIRECT_THREADED */ } NEXT_INSN; ! #ifdef DIRECT_THREADED ! instanceof_resolved: ! { ! jobject value = POPA (); ! jclass to = (jclass) AVAL (); ! PUSHI (to->isInstance (value)); ! } ! NEXT_INSN; ! #endif /* DIRECT_THREADED */ ! ! insn_monitorenter: { jobject value = POPA(); NULLCHECK(value); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2253,2260 **** } NEXT_INSN; ! insn_monitorexit: ! SAVE_PC; { jobject value = POPA(); NULLCHECK(value); --- 3037,3043 ---- } NEXT_INSN; ! insn_monitorexit: { jobject value = POPA(); NULLCHECK(value); *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2262,2289 **** } NEXT_INSN; ! insn_ifnull: { - unsigned char* base_pc = pc-1; - jint offset = get2s (pc); pc += 2; jobject val = POPA(); if (val == NULL) ! pc = base_pc+offset; } NEXT_INSN; ! insn_ifnonnull: { - unsigned char* base_pc = pc-1; - jint offset = get2s (pc); pc += 2; jobject val = POPA(); if (val != NULL) ! pc = base_pc+offset; } NEXT_INSN; ! insn_wide: ! SAVE_PC; { jint the_mod_op = get1u (pc++); jint wide = get2u (pc); pc += 2; --- 3045,3093 ---- } NEXT_INSN; ! insn_ifnull: { jobject val = POPA(); if (val == NULL) ! TAKE_GOTO; ! else ! SKIP_GOTO; } NEXT_INSN; ! insn_ifnonnull: { jobject val = POPA(); if (val != NULL) ! TAKE_GOTO; ! else ! SKIP_GOTO; } NEXT_INSN; ! insn_multianewarray: ! { ! int kind_index = GET2U (); ! int dim = GET1U (); ! ! jclass type ! = (_Jv_ResolvePoolEntry (defining_class, kind_index)).clazz; ! _Jv_InitClass (type); ! jint *sizes = (jint*) __builtin_alloca (sizeof (jint)*dim); ! ! for (int i = dim - 1; i >= 0; i--) ! { ! sizes[i] = POPI (); ! } ! ! jobject res = _Jv_NewMultiArray (type,dim, sizes); ! ! PUSHA (res); ! } ! NEXT_INSN; ! ! #ifndef DIRECT_THREADED ! insn_wide: { jint the_mod_op = get1u (pc++); jint wide = get2u (pc); pc += 2; *************** void _Jv_InterpMethod::continue1 (_Jv_In *** 2343,2389 **** } } ! insn_multianewarray: ! SAVE_PC; ! { ! int kind_index = get2u (pc); pc += 2; ! int dim = get1u (pc); pc += 1; ! ! jclass type ! = (_Jv_ResolvePoolEntry (defining_class, kind_index)).clazz; ! _Jv_InitClass (type); ! jint *sizes = (jint*) __builtin_alloca (sizeof (jint)*dim); ! ! for (int i = dim - 1; i >= 0; i--) ! { ! sizes[i] = POPI (); ! } ! ! jobject res = _Jv_NewMultiArray (type,dim, sizes); ! ! PUSHA (res); ! } ! NEXT_INSN; ! insn_goto_w: ! { ! unsigned char* base_pc = pc-1; ! int offset = get4 (pc); pc += 4; ! pc = base_pc+offset; ! } ! NEXT_INSN; ! insn_jsr_w: ! { ! unsigned char* base_pc = pc-1; ! int offset = get4 (pc); pc += 4; ! PUSHA((jobject)pc); ! pc = base_pc+offset; ! } ! NEXT_INSN; } static void throw_internal_error (char *msg) --- 3147,3203 ---- } } + #endif /* DIRECT_THREADED */ + } + catch (java::lang::Throwable *ex) + { + #ifdef DIRECT_THREADED + void *logical_pc = (void *) ((insn_slot *) pc - 1); + #else + int logical_pc = pc - 1 - bytecode (); + #endif + _Jv_InterpException *exc = exceptions (); + jclass exc_class = ex->getClass (); ! for (int i = 0; i < exc_count; i++) ! { ! if (PCVAL (exc[i].start_pc) <= logical_pc ! && logical_pc < PCVAL (exc[i].end_pc)) ! { ! #ifdef DIRECT_THREADED ! jclass handler = (jclass) exc[i].handler_type.p; ! #else ! jclass handler = NULL; ! if (exc[i].handler_type.i != 0) ! handler = (_Jv_ResolvePoolEntry (defining_class, ! exc[i].handler_type.i)).clazz; ! #endif /* DIRECT_THREADED */ ! if (handler == NULL || handler->isAssignableFrom (exc_class)) ! { ! #ifdef DIRECT_THREADED ! pc = (insn_slot *) exc[i].handler_pc.p; ! #else ! pc = bytecode () + exc[i].handler_pc.i; ! #endif /* DIRECT_THREADED */ ! sp = stack; ! sp++->o = ex; // Push exception. ! NEXT_INSN; ! } ! } ! } ! // No handler, so re-throw. ! throw ex; ! } } + // This function exists so that the stack-tracing code can find the + // boundaries of the interpreter. + void + _Jv_EndOfInterpreter (void) + { + } static void throw_internal_error (char *msg) diff -Nrc3pad gcc-3.2.3/libjava/java/applet/AppletContext.java gcc-3.3/libjava/java/applet/AppletContext.java *** gcc-3.2.3/libjava/java/applet/AppletContext.java 2002-01-22 22:40:03.000000000 +0000 --- gcc-3.3/libjava/java/applet/AppletContext.java 2002-11-14 20:35:27.000000000 +0000 *************** *** 1,23 **** ! /* AppletContext.java -- Access the applet's runtime environment. ! Copyright (C) 1999 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole --- 1,23 ---- ! /* AppletContext.java -- access the applet's runtime environment ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole *************** exception statement from your version. * *** 39,119 **** package java.applet; import java.awt.Image; import java.net.URL; import java.util.Enumeration; /** ! * This interface allows an applet access to the browser to retrieve ! * additional data files and display documents. It also allows the ! * applet to find out other applets in the same document. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface AppletContext { /** ! * Returns an audio clip from the specified URL. ! * ! * @param url The URL of the audio clip. ! * ! * @return The retrieved audio clip // FIXME: What happens on error? ! */ AudioClip getAudioClip(URL url); /** ! * Returns an image from the specified URL. Note that the image is not ! * actually retrieved until the applet attempts to display it, so this ! * method returns immediately. ! * ! * @param url The URL of the image. ! * ! * @return The retrieved image. // FIXME: What happens on eror? ! */ Image getImage(URL url); /** ! * Returns the applet in the document for this object that has the ! * specified name. ! * ! * @param name The applet name. ! * ! * @return The requested applet, or null if an applet with ! * the requested name cannot be found. ! */ Applet getApplet(String name); /** ! * Returns a list of all the applets in the document for this object. ! * ! * @return A list of all the applets in the document for this object. ! */ Enumeration getApplets(); /** ! * Displays the web page pointed to by the specified URL in the window ! * for this object. This page replaces the document that is currently ! * there. ! * ! * @param url The URL of the web page to load. ! */ void showDocument(URL url); /** ! * Displays the web page pointed to be the sepcified URL in the window ! * with the specified name. The standard names "_top", "_blank", ! * "_parent", and "_self" are allowed. ! * ! * @param url The URL of the web page to load. ! * @param target The target window. ! */ void showDocument(URL url, String target); /** ! * Displays the specified message in the status window if that window ! * exists. ! * ! * @param message The status message. ! */ void showStatus(String message); } // interface AppletContext --- 39,154 ---- package java.applet; import java.awt.Image; + import java.io.InputStream; + import java.io.IOException; import java.net.URL; import java.util.Enumeration; + import java.util.Iterator; /** ! * This interface allows an applet access to the browser to retrieve ! * additional data files and display documents. It also allows the ! * applet to find out other applets in the same document. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface AppletContext { /** ! * Returns an audio clip from the specified URL. ! * ! * @param url the URL of the audio clip ! * @return the retrieved audio clip ! * @throws NullPointerException if url is null ! */ AudioClip getAudioClip(URL url); /** ! * Returns an image from the specified URL. Note that the image is not ! * actually retrieved until the applet attempts to display it, so this ! * method returns immediately. ! * ! * @param url the absolute URL of the image ! * @return the retrieved image ! * @throws NullPointerException if url is null ! */ Image getImage(URL url); /** ! * Returns the applet in the document for this object that has the ! * specified name. ! * ! * @param name the applet name ! * @return the requested applet, or null if not found ! */ Applet getApplet(String name); /** ! * Returns a list of all the applets in the document for this object. ! * ! * @return a list of all the applets ! */ Enumeration getApplets(); /** ! * Displays the web page pointed to by the specified URL in the window ! * for this object. This page replaces the document that is currently ! * there. ! * ! * @param url the URL of the web page to load; unspecified on an error ! */ void showDocument(URL url); /** ! * Displays the web page pointed to be the sepcified URL in the window ! * with the specified name. The standard names "_top", "_blank", ! * "_parent", and "_self" are allowed. An applet viewer may disregard ! * this request. ! * ! * @param url the URL of the web page to load ! * @param target the target window ! */ void showDocument(URL url, String target); /** ! * Displays the specified message in the status window if that window ! * exists. ! * ! * @param message the status message, may be null ! */ void showStatus(String message); + /** + * Associate a stream to a key for this applet context, possibly replacing + * the old value. Stream associations are local to the applet context, for + * security purposes. + * + * @param key the key to associate with + * @param stream the stream value to tie to the key, or null to remove + * @throws IOException if the stream is too large + * @since 1.4 + */ + void setStream(String key, InputStream stream) throws IOException; + + /** + * Return the stream associated with a given key in this applet context, or + * null if nothing is associated. Stream associations are local to the + * applet context, for security purposes. + * + * @param key the key to look up + * @return the associated stream, or null + * @since 1.4 + */ + InputStream getStream(String key); + + /** + * Iterate over all keys that have associated streams. Stream associated + * are local to the applet context, for security purposes. + * + * @return an iterator over the association keys + * @since 1.4 + */ + Iterator getStreamKeys(); } // interface AppletContext diff -Nrc3pad gcc-3.2.3/libjava/java/applet/Applet.java gcc-3.3/libjava/java/applet/Applet.java *** gcc-3.2.3/libjava/java/applet/Applet.java 2002-01-22 22:40:03.000000000 +0000 --- gcc-3.3/libjava/java/applet/Applet.java 2002-11-10 00:16:42.000000000 +0000 *************** *** 1,23 **** /* Applet.java -- Java base applet class ! Copyright (C) 1999 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole --- 1,23 ---- /* Applet.java -- Java base applet class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole *************** exception statement from your version. * *** 39,307 **** package java.applet; import java.awt.Dimension; import java.awt.Image; import java.net.URL; import java.util.Locale; /** ! * This is the base applet class. An applet is a Java program that ! * runs inside a web browser or other applet viewer in a restricted ! * environment. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class Applet extends java.awt.Panel implements java.io.Serializable { ! // The applet stub for this applet ! private AppletStub stub; /** ! * Default constructor for subclasses. ! */ ! public Applet() {} /** ! * Returns the URL of the document this applet is embedded in. ! * ! * @return The URL of the document this applet is embedded in. ! */ public URL getDocumentBase() { ! return (stub.getDocumentBase ()); } /** ! * Returns the URL of the code base for this applet. ! * ! * @return The URL of the code base for this applet. ! */ public URL getCodeBase() { ! return (stub.getCodeBase ()); } /** ! * Returns the value of the specified parameter that was specified in ! * the <APPLET> tag for this applet. ! * ! * @param name The parameter name. ! * ! * @param value The parameter value, or null if the parameter ! * does not exist. ! */ public String getParameter(String name) { ! return (stub.getParameter (name)); } /** ! * Returns the applet context for this applet. ! * ! * @return The applet context for this applet. ! */ public AppletContext getAppletContext() { ! return (stub.getAppletContext ()); } /** ! * Tests whether or not this applet is currently active. ! * ! * @return true if this applet is active, false ! * otherwise. ! */ ! public boolean isActive() { ! return (stub.isActive ()); } /** ! * Requests that the applet window for this applet be resized. ! * ! * @param width The new width in pixels. ! * @param height The new height in pixels. ! */ ! public void resize(int width, int height) { ! stub.appletResize (width, height); } /** ! * Requests that the applet window for this applet be resized. ! * ! * @param dim The Dimension object with the requested ! * width and height. ! */ ! public void resize(Dimension dim) { ! resize (dim.width, dim.height); } /** ! * Returns an audio clip from the specified URL. ! * ! * @param url The URL of the audio clip. ! * ! * @return The retrieved audio clip. ! */ public AudioClip getAudioClip(URL url) { ! return (getAppletContext ().getAudioClip (url)); } /** ! * Returns an audio clip from the specified URL and name ! * ! * @param url The base URL of the audio clip. ! * @param name The name of the clip relative to the URL. ! * ! * @return The retrieved audio clip. ! */ public AudioClip getAudioClip(URL url, String name) { try { ! return (getAppletContext ().getAudioClip (new URL (url.toExternalForm() ! + name))); } ! catch(Exception e) { ! return (getAudioClip (url)); } } /** ! * Loads and plays the audio clip pointed to by the specified URL. ! * ! * @param The URL of the audio clip. ! */ ! public void play (URL url) { ! getAudioClip (url).play (); } /** ! * Loads and plays the audio clip pointed to by the specified URL. ! * ! * @param The base URL of the audio clip. ! * @param name The name of the audio clip relative to the URL. ! */ ! public void play (URL url, String name) { ! getAudioClip (url, name).play (); } /** ! * Returns an image from the specified URL. Note that the image is not ! * actually retrieved until the applet attempts to display it, so this ! * method returns immediately. ! * ! * @param url The URL of the image. ! * ! * @return The retrieved image. ! */ ! public Image getImage(URL url) { ! return (getAppletContext ().getImage (url)); } /** ! * Returns an image from the specified URL. Note that the image is not ! * actually retrieved until the applet attempts to display it, so this ! * method returns immediately. ! * ! * @param url The base URL of the image. ! * @param name The name of the image relative to the URL. ! * ! * @return The retrieved image. ! */ ! public Image getImage(URL url, String name) { try { ! return (getAppletContext ().getImage (new URL (url.toExternalForm() ! + name))); } ! catch(Exception e) { - return (getImage (url)); } } /** ! * Returns the locale for this applet, if it has been set. If no applet ! * specific locale has been set, the default locale is returned. ! * ! * @return The locale for this applet. ! */ ! public Locale getLocale() { ! return (super.getLocale ()); } /** ! * Returns a descriptive string with applet defined information. The ! * implementation in this class returns null. Applets who ! * wish to return this information should override. ! * ! * @return A string describing the applet. ! */ ! public String getAppletInfo() { - return (null); } /** ! * Returns a list of parameters this applet supports. Each element of ! * the array is a list of three strings with the name of the parameter, ! * the data type or valid values, and a description. This method is ! * optional and the default implementation returns null. ! * ! * @return The list of parameters supported by this applet. ! */ ! public String[][] getParameterInfo() { - return (null); } /** ! * This method is called when the applet is first loaded. The default ! * implementation does nothing. Applets that wish to do one time ! * initialization should override. ! */ ! public void init() {} /** ! * This method is called when the applet is being unloaded. The default ! * implementation does nothing. Applets that need to clean up resources ! * on exit should override. ! */ ! public void destroy() {} /** ! * This method is called when the applet should start running. This is ! * normally each time a web page containing it is loaded. The default ! * implemention does nothing. Subclasses should override. ! */ ! public void start() {} /** ! * This method is called when the applet should stop running. This is ! * normally when the next web page is loaded. The default implementation ! * does nothing. ! */ ! public void stop() {} /** ! * The browser calls this method to set the applet's stub, which is the ! * low level interface to the browser. ! * ! * @param stub The applet stub for this applet. ! */ ! public final void setStub (AppletStub stub) { ! this.stub = stub; ! } ! } // class Applet --- 39,507 ---- package java.applet; import java.awt.Dimension; + import java.awt.GraphicsEnvironment; + import java.awt.HeadlessException; import java.awt.Image; + import java.awt.Panel; + import java.io.IOException; + import java.io.ObjectInputStream; + import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; /** ! * This is the base applet class. An applet is a Java program that ! * runs inside a web browser or other applet viewer in a restricted ! * environment. ! * ! *

    To be useful, a subclass should override at least start(). Also useful ! * are init, stop, and destroy for control purposes, and getAppletInfo and ! * getParameterInfo for descriptive purposes. ! * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 ! */ ! public class Applet extends Panel { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -5836846270535785031L; ! ! /** The applet stub for this applet. */ ! private transient AppletStub stub; /** ! * The accessibility context for this applet. ! * ! * @serial the accessibleContext for this ! * @since 1.2 ! */ ! private AccessibleContext accessibleContext; /** ! * Default constructor for subclasses. ! * ! * @throws HeadlessException if in a headless environment ! */ ! public Applet() ! { ! if (GraphicsEnvironment.isHeadless()) ! throw new HeadlessException(); ! } ! ! /** ! * The browser calls this method to set the applet's stub, which is the ! * low level interface to the browser. Manually setting this to null is ! * asking for problems down the road. ! * ! * @param stub the applet stub for this applet ! */ ! public final void setStub(AppletStub stub) ! { ! this.stub = stub; ! } ! ! /** ! * Tests whether or not this applet is currently active. An applet is active ! * just before the browser invokes start(), and becomes inactive just ! * before the browser invokes stop(). ! * ! * @return true if this applet is active ! */ ! public boolean isActive() ! { ! return stub.isActive(); ! } ! ! /** ! * Returns the basename URL of the document this applet is embedded in. This ! * is everything up to the final '/'. ! * ! * @return the URL of the document this applet is embedded in ! * @see #getCodeBase() ! */ public URL getDocumentBase() { ! return stub.getDocumentBase(); } /** ! * Returns the URL of the code base for this applet. ! * ! * @return the URL of the code base for this applet ! */ public URL getCodeBase() { ! return stub.getCodeBase(); } /** ! * Returns the value of the specified parameter that was specified in ! * the <APPLET> tag for this applet. ! * ! * @param name the parameter name ! * @return the parameter value, or null if the parameter does not exist ! * @throws NullPointerException if name is null ! */ public String getParameter(String name) { ! return stub.getParameter(name); } /** ! * Returns the applet context for this applet. ! * ! * @return the applet context for this applet ! */ public AppletContext getAppletContext() { ! return stub.getAppletContext(); } /** ! * Requests that the applet window for this applet be resized. ! * ! * @param width the new width in pixels ! * @param height the new height in pixels ! */ ! public void resize(int width, int height) { ! stub.appletResize(width, height); } /** ! * Requests that the applet window for this applet be resized. ! * ! * @param dim the requested dimensions ! * @throws NullPointerException if dim is null ! */ ! public void resize(Dimension dim) { ! resize(dim.width, dim.height); } /** ! * Displays the specified message in the status window if that window ! * exists. ! * ! * @param message the status message, may be null ! */ ! public void showStatus(String message) { ! getAppletContext().showStatus(message); } /** ! * Returns an image from the specified URL. Note that the image is not ! * actually retrieved until the applet attempts to display it, so this ! * method returns immediately. ! * ! * @param url the URL of the image ! * @return the retrieved image ! * @throws NullPointerException if url is null ! */ ! public Image getImage(URL url) ! { ! return getAppletContext().getImage(url); ! } ! ! /** ! * Returns an image from the specified absolute URL, and relative path ! * from that URL. Note that the image is not actually retrieved until the ! * applet attempts to display it, so this method returns immediately. ! * This calls getImage(new URL(url, name)), but if building ! * the new URL fails, this returns null. ! * ! * @param url the base URL of the image ! * @param name the name of the image relative to the URL ! * @return the retrieved image, or null on failure ! * @see #getImage(URL) ! */ ! public Image getImage(URL url, String name) ! { ! try ! { ! return getImage(new URL(url, name)); ! } ! catch (MalformedURLException e) ! { ! return null; ! } ! } ! ! /** ! * Returns an audio clip from the specified URL. This clip is not tied to ! * any particular applet. ! * ! * XXX Classpath does not yet implement this. ! * ! * @param url the URL of the audio clip ! * @return the retrieved audio clip ! * @throws NullPointerException if url is null ! * @see #getAudioClip(URL) ! * @since 1.2 ! */ ! public static final AudioClip newAudioClip(URL url) ! { ! // This requires an implementation of AudioClip in gnu.java.applet. ! throw new Error("Not implemented"); ! } ! ! /** ! * Returns an audio clip from the specified URL. Note that the clip is not ! * actually retrieved until the applet attempts to play it, so this method ! * returns immediately. ! * ! * @param url the URL of the audio clip ! * @return the retrieved audio clip ! * @throws NullPointerException if url is null ! */ public AudioClip getAudioClip(URL url) { ! return getAppletContext().getAudioClip(url); } /** ! * Returns an audio clip from the specified absolute URL, and relative path ! * from that URL. Note that the clip is not actually retrieved until the ! * applet attempts to play it, so this method returns immediately. This ! * calls getAudioClip(new URL(url, name)), but if building ! * the new URL fails, this returns null. ! * ! * @param url the base URL of the audio clip ! * @param name the name of the clip relative to the URL ! * @return the retrieved audio clip, or null on failure ! * @see #getAudioClip(URL) ! */ public AudioClip getAudioClip(URL url, String name) { try { ! return getAudioClip(new URL(url, name)); } ! catch (MalformedURLException e) { ! return null; } } /** ! * Returns a descriptive string with applet defined information. The ! * implementation in this class returns null, so subclasses ! * must override to return information. ! * ! * @return a string describing the author, version, and applet copyright ! */ ! public String getAppletInfo() { ! return null; } /** ! * Returns the locale for this applet, if it has been set. If no applet ! * specific locale has been set, the default locale is returned. ! * ! * @return the locale for this applet ! * @see Component#setLocale(Locale) ! * @since 1.1 ! */ ! public Locale getLocale() { ! return super.getLocale(); } /** ! * Returns a list of parameters this applet supports. Each element of ! * the outer array is an array of three strings with the name of the ! * parameter, the data type or valid values, and a description. This ! * method is optional and the default implementation returns null. ! * ! * @return the list of parameters supported by this applet ! */ ! public String[][] getParameterInfo() { ! return null; } /** ! * Loads and plays the audio clip pointed to by the specified URL. This does ! * nothing if the URL does not point to a valid audio clip. ! * ! * @param url the URL of the audio clip ! * @throws NullPointerException if url is null ! * @see #getAudioClip(URL) ! */ ! public void play(URL url) { + AudioClip ac = getAudioClip(url); try { ! ac.play(); } ! catch (Exception ignored) { } } /** ! * Loads and plays the audio clip pointed to by the specified absolute URL, ! * and relative path from that URL. This does nothing if the URL cannot be ! * constructed, or if it does not point to a valid audio clip. ! * ! * @param url the base URL of the audio clip ! * @param name the name of the audio clip relative to the URL ! * @see #getAudioClip(URL, String) ! * @see #play(URL) ! */ ! public void play(URL url, String name) { ! try ! { ! getAudioClip(url, name).play(); ! } ! catch (Exception ignored) ! { ! } } /** ! * This method is called when the applet is first loaded, before start(). ! * The default implementation does nothing; override to do any one-time ! * initialization. ! * ! * @see #start() ! * @see #stop() ! * @see #destroy() ! */ ! public void init() { } /** ! * This method is called when the applet should start running. This is ! * normally each time a web page containing it is loaded. The default ! * implemention does nothing; override for your applet to be useful. ! * ! * @see #init() ! * @see #stop() ! * @see #destroy() ! */ ! public void start() { } /** ! * This method is called when the applet should stop running. This is ! * normally when the next web page is loaded. The default implementation ! * does nothing; override for your applet to stop using resources when ! * it is no longer visible, but may be restarted soon. ! * ! * @see #init() ! * @see #start() ! * @see #destroy() ! */ ! public void stop() ! { ! } /** ! * This method is called when the applet is being unloaded. The default ! * implementation does nothing; override for your applet to clean up ! * resources on exit. ! * ! * @see #init() ! * @see #start() ! * @see #stop() ! */ ! public void destroy() ! { ! } /** ! * Gets the AccessibleContext associated with this applet, creating one if ! * necessary. This always returns an instance of {@link AccessibleApplet}. ! * ! * @return the accessibility context of this applet ! * @since 1.3 ! */ ! public AccessibleContext getAccessibleContext() ! { ! if (accessibleContext == null) ! accessibleContext = new AccessibleApplet(); ! return accessibleContext; ! } /** ! * Read an applet from an object stream. This checks for a headless ! * environment, then does the normal read. ! * ! * @param s the stream to read from ! * @throws ClassNotFoundException if a class is not found ! * @throws IOException if deserialization fails ! * @throws HeadlessException if this is a headless environment ! * @see GraphicsEnvironment#isHeadless() ! * @since 1.4 ! */ ! private void readObject(ObjectInputStream s) ! throws ClassNotFoundException, IOException ! { ! if (GraphicsEnvironment.isHeadless()) ! throw new HeadlessException(); ! s.defaultReadObject(); ! } /** ! * This class provides accessibility support for Applets, and is the ! * runtime type returned by {@link #getAccessibleContext()}. ! * ! * @author Eric Blake ! * @since 1.3 ! */ ! protected class AccessibleApplet extends AccessibleAWTPanel { ! /** ! * Compatible with JDK 1.4+. ! */ ! private static final long serialVersionUID = 8127374778187708896L; ! /** ! * The default constructor. ! */ ! protected AccessibleApplet() ! { ! } ! ! /** ! * Get the role of this accessible object, a frame. ! * ! * @return the role of the object ! * @see AccessibleRole#FRAME ! */ ! public AccessibleRole getAccessibleRole() ! { ! return AccessibleRole.FRAME; ! } + /** + * Get the state set of this accessible object. In addition to the default + * states of a Component, the applet can also be active. + * + * @return the role of the object + * @see AccessibleState + */ + public AccessibleStateSet getAccessibleStateSet() + { + AccessibleStateSet s = super.getAccessibleStateSet(); + if (isActive()) + s.add(AccessibleState.ACTIVE); + return s; + } + } // class AccessibleApplet + } // class Applet diff -Nrc3pad gcc-3.2.3/libjava/java/applet/AppletStub.java gcc-3.3/libjava/java/applet/AppletStub.java *** gcc-3.2.3/libjava/java/applet/AppletStub.java 2002-01-22 22:40:03.000000000 +0000 --- gcc-3.3/libjava/java/applet/AppletStub.java 2002-11-10 00:16:42.000000000 +0000 *************** *** 1,23 **** ! /* AppletStub.java -- Low level interface to the browser. ! Copyright (C) 1999 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole --- 1,23 ---- ! /* AppletStub.java -- low level interface to the browser ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole *************** package java.applet; *** 40,99 **** import java.net.URL; /** ! * This interface is the low level interface between the applet and the ! * browser. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface AppletStub { /** ! * Returns the URL of the document this applet is embedded in. ! * ! * @return The URL of the document this applet is embedded in. ! */ URL getDocumentBase(); /** ! * Returns the URL of the code base for this applet. ! * ! * @return The URL of the code base for this applet. ! */ URL getCodeBase(); /** ! * Returns the value of the specified parameter that was specified in ! * the <APPLET> tag for this applet. ! * ! * @param name The parameter name. ! * ! * @param value The parameter value, or null if the parameter ! * does not exist. ! */ String getParameter(String name); /** ! * Returns the applet context for this applet. ! * ! * @return The applet context for this applet. ! */ AppletContext getAppletContext(); /** ! * Tests whether or not this applet is currently active. ! * ! * @return true if this applet is active, false ! * otherwise. ! */ ! boolean isActive(); ! ! /** ! * Requests that the applet window for this applet be resized. ! * ! * @param width The new width in pixels. ! * @param height The new height in pixels. ! */ void appletResize(int width, int height); - } // interface AppletStub - --- 40,102 ---- import java.net.URL; /** ! * This interface is the low level interface between the applet and the ! * browser. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @see Applet#setStub(AppletStub) ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface AppletStub { /** ! * Tests whether or not this applet is currently active. An applet is active ! * just before the browser invokes start(), and becomes inactive just ! * before the browser invokes stop(). ! * ! * @return true if this applet is active ! */ ! boolean isActive(); ! ! /** ! * Returns the basename URL of the document this applet is embedded in. This ! * is everything up to the final '/'. ! * ! * @return the URL of the document this applet is embedded in ! * @see #getCodeBase() ! */ URL getDocumentBase(); /** ! * Returns the URL of the code base for this applet. ! * ! * @return the URL of the code base for this applet ! */ URL getCodeBase(); /** ! * Returns the value of the specified parameter that was specified in ! * the <APPLET> tag for this applet. ! * ! * @param name the parameter name ! * @return the parameter value, or null if the parameter does not exist ! * @throws NullPointerException if name is null ! */ String getParameter(String name); /** ! * Returns the applet context for this applet. ! * ! * @return the applet context for this applet ! */ AppletContext getAppletContext(); /** ! * Requests that the applet window for this applet be resized. ! * ! * @param width the new width in pixels ! * @param height the new height in pixels ! */ void appletResize(int width, int height); } // interface AppletStub diff -Nrc3pad gcc-3.2.3/libjava/java/applet/AudioClip.java gcc-3.3/libjava/java/applet/AudioClip.java *** gcc-3.2.3/libjava/java/applet/AudioClip.java 2002-01-22 22:40:03.000000000 +0000 --- gcc-3.3/libjava/java/applet/AudioClip.java 2002-11-10 00:16:42.000000000 +0000 *************** *** 1,23 **** ! /* AudioClip.java -- Play an audio clip. ! Copyright (C) 1999 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole --- 1,23 ---- ! /* AudioClip.java -- play an audio clip in an applet ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole *************** exception statement from your version. * *** 39,64 **** package java.applet; /** ! * This interface provides a simple mechanism for playing audio clips. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface AudioClip { /** ! * Plays the audio clip starting from the beginning. ! */ void play(); /** ! * Stops playing this audio clip. There is no mechanism for restarting ! * at the point where the clip is stopped. ! */ void stop(); /** ! * Plays this audio clip in a continuous loop. ! */ void loop(); - } // interface AudioClip --- 39,67 ---- package java.applet; /** ! * This interface provides a simple mechanism for playing audio clips. ! * If multiple clips are played at once, the browser combines them into a ! * composite clip. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface AudioClip { /** ! * Plays the audio clip starting from the beginning. ! */ void play(); /** ! * Stops playing this audio clip. There is no mechanism for restarting ! * at the point where the clip is stopped. ! */ void stop(); /** ! * Plays this audio clip in a continuous loop. ! */ void loop(); } // interface AudioClip diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ActiveEvent.java gcc-3.3/libjava/java/awt/ActiveEvent.java *** gcc-3.2.3/libjava/java/awt/ActiveEvent.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/ActiveEvent.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* ActiveEvent.java -- a self-dispatching event ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,50 **** package java.awt; /** * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public interface ActiveEvent { ! public void dispatch (); ! } --- 39,61 ---- package java.awt; /** + * An interface for events which can dispatch themselves in another thread. + * This has two uses: first, if your code is in a critical section, calling a + * synchronized method might deadlock. But by using an ActiveEvent to call + * the second section, it will not obtain the lock until you have left the + * critical section, avoiding deadlock. The second use is for calling + * untrusted code. For example, system code should use an ActiveEvent to + * invoke user code securely. + * * @author Tom Tromey ! * @since 1.2 ! * @status updated to 1.4 */ public interface ActiveEvent { ! /** ! * Dispatch the event, according to what the event needs done. Invoked ! * automatically if this is placed on the EventDispatchQueue. ! */ ! public void dispatch(); ! } // interface ActiveEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Adjustable.java gcc-3.3/libjava/java/awt/Adjustable.java *** gcc-3.2.3/libjava/java/awt/Adjustable.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Adjustable.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,5 **** ! /* Adjustable.java -- Objects with a numeric adjustment scale. ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Adjustable.java -- Objects with a numeric adjustment scale ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.awt; *** 41,223 **** import java.awt.event.AdjustmentListener; /** ! * This interface is for objects that take a numeric value that ! * can be adjusted within a bounded range. For example, a scroll bar. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface Adjustable { ! /* ! * Static Variables ! */ ! ! /** ! * Constant for a horizontal orientation ! */ ! public static final int HORIZONTAL = 0; ! ! /** ! * Constant for a vertical orientation ! */ ! public static final int VERTICAL = 1; ! ! /*************************************************************************/ ! ! /* ! * Instance Methods ! */ ! ! /** ! * Returns the current value of the object. ! * ! * @return The current value of the object. ! */ ! public abstract int ! getValue(); ! ! /*************************************************************************/ ! ! /** ! * Sets the current value of the object. ! * ! * @param value The current value of the object. ! */ ! public abstract void ! setValue(int value); ! ! /*************************************************************************/ ! ! /** ! * Returns the orientation of the object, either HORIZONTAL ! * or VERTICAL. ! * ! * @return The orientation of this object. ! */ ! public abstract int ! getOrientation(); ! ! /*************************************************************************/ ! ! /** ! * Returns the minimum value this object can take. ! * ! * @return The minimum value this object can take. ! */ ! public abstract int ! getMinimum(); ! ! /*************************************************************************/ ! ! /** ! * Sets the minimum value this object can take to the specified value. ! * ! * @param minimum The new minimum value for this object. ! */ ! public abstract void ! setMinimum(int minimum); ! ! /*************************************************************************/ ! ! /** ! * Returns the maximum value this object can take. ! * ! * @return The maximum value this object can take. ! */ ! public abstract int ! getMaximum(); ! ! /*************************************************************************/ ! ! /** ! * Sets the maximum value this object can take to the specified value. ! * ! * @param maximum The new maximum value for this object. ! */ ! public abstract void ! setMaximum(int maximum); ! ! /*************************************************************************/ ! /** ! * Returns the increment value for incrementing by units. ! * ! * @return The unit increment value. ! */ ! public abstract int ! getUnitIncrement(); ! /*************************************************************************/ ! /** ! * Sets the increment value for incrementing by units to the specified value. ! * ! * @param increment The unit increment value. ! */ ! public abstract void ! setUnitIncrement(int increment); ! /*************************************************************************/ ! /** ! * Returns the increment value for incrementing by blocks. ! * ! * @return The block increment value. ! */ ! public abstract int ! getBlockIncrement(); ! /*************************************************************************/ ! /** ! * Sets the increment value for incrementing by blocks to the specified value. ! * ! * @param increment The block increment value. ! */ ! public abstract void ! setBlockIncrement(int increment); ! /*************************************************************************/ ! /** ! * Returns the length of the indicator for this object. ! * ! * @return The indicator length. ! */ ! public abstract int ! getVisibleAmount(); ! /*************************************************************************/ ! /** ! * Sets the length of the indicator for this object to the specified value. ! * ! * @param length The indicator length ! */ ! public abstract void ! setVisibleAmount(int length); ! /*************************************************************************/ ! /** ! * Adds a listener that will receive adjustment events for this object. ! * ! * @param listener The adjustment listener to add. ! */ ! public abstract void ! addAdjustmentListener(AdjustmentListener listener); ! /*************************************************************************/ ! /** ! * Removes an adjustment listener from this object. It will no longer ! * receive adjustment events. ! * ! * @param listener The adjustment listener to remove. ! */ ! public abstract void ! removeAdjustmentListener(AdjustmentListener listener); } // interface Adjustable - --- 41,171 ---- import java.awt.event.AdjustmentListener; /** ! * This interface is for objects that take a numeric value that can be ! * adjusted within a bounded range. For example, a scroll bar. ! * ! * @author Aaron M. Renn ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface Adjustable { + /** Constant for an adjustable object with horizontal orientation. */ + int HORIZONTAL = 0; ! /** Constant for an adjustable object with vertical orientation. */ ! int VERTICAL = 1; ! /** Constant for an adjustable object with no orientation. */ ! int NO_ORIENTATION = 2; ! /** ! * Returns a constant representing the orientation of the object. ! * ! * @return the orientation of this object ! * @see #HORIZONTAL ! * @see #VERTICAL ! * @see #NO_ORIENTATION ! */ ! int getOrientation(); ! /** ! * Sets the minimum value this object can have. ! * ! * @param minimum the new minimum value ! */ ! void setMinimum(int minimum); ! /** ! * Returns the minimum value this object can have. ! * ! * @return the minimum value ! */ ! int getMinimum(); ! /** ! * Sets the maximum value this object can have. ! * ! * @param maximum the new maximum value ! */ ! void setMaximum(int maximum); ! /** ! * Returns the maximum value this object can have. ! * ! * @return the maximum value ! */ ! int getMaximum(); ! /** ! * Sets the increment value for incrementing the value by units. ! * ! * @param increment the unit increment value ! */ ! void setUnitIncrement(int increment); ! /** ! * Returns the increment value for incrementing the value by units. ! * ! * @return the unit increment value ! */ ! int getUnitIncrement(); ! /** ! * Sets the increment value for incrementing the value by blocks. ! * ! * @param increment the block increment value ! */ ! void setBlockIncrement(int increment); ! /** ! * Returns the increment value for incrementing the value by blocks. ! * ! * @return the block increment value ! */ ! int getBlockIncrement(); ! /** ! * Sets the length of the indicator for this object to the specified value. ! * ! * @param length the indicator length ! */ ! void setVisibleAmount(int length); ! /** ! * Returns the length of the indicator for this object. ! * ! * @return the indicator length ! */ ! int getVisibleAmount(); ! /** ! * Sets the current value of the object. ! * ! * @param value the new value ! */ ! void setValue(int value); ! /** ! * Returns the current value of the object. ! * ! * @return the current value ! */ ! int getValue(); ! /** ! * Adds a listener that will receive adjustment events for this object. ! * ! * @param listener the adjustment listener to add ! * @see AdjustmentEvent ! */ ! void addAdjustmentListener(AdjustmentListener listener); + /** + * Removes an adjustment listener from this object. + * + * @param listener the adjustment listener to remove + * @see AdjustmentEvent + */ + void removeAdjustmentListener(AdjustmentListener listener); } // interface Adjustable diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AlphaComposite.java gcc-3.3/libjava/java/awt/AlphaComposite.java *** gcc-3.2.3/libjava/java/awt/AlphaComposite.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/AlphaComposite.java 2003-01-02 00:14:03.000000000 +0000 *************** *** 0 **** --- 1,167 ---- + /* AlphaComposite.java -- provides a context for performing alpha compositing + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.image.ColorModel; + import java.util.LinkedHashMap; + import java.util.Map; + + /** + * + * @author Eric Blake + * @see Composite + * @see CompositeContext + * @since 1.3 + * @status updated to 1.4 except for createContext, needs documentation + */ + public final class AlphaComposite implements Composite + { + /** Map Long to AlphaComposites. See getInstance for details. */ + private static final LinkedHashMap cache = new LinkedHashMap(11, 0.75f, true) + { + /** The largest the alpha composite cache can grow. */ + private static final int MAX_CACHE_SIZE = 2048; + + /** Prune stale entries. */ + protected boolean removeEldestEntry(Map.Entry eldest) + { // XXX - FIXME Use Map.Entry, not just Entry as gcj 3.1 workaround. + return size() > MAX_CACHE_SIZE; + } + }; + + public static final int CLEAR = 1; + public static final int SRC = 2; + public static final int DST = 9; + public static final int SRC_OVER = 3; + public static final int DST_OVER = 4; + public static final int SRC_IN = 5; + public static final int DST_IN = 6; + public static final int SRC_OUT = 7; + public static final int DST_OUT = 8; + public static final int SRC_ATOP = 10; + public static final int DST_ATOP = 11; + public static final int XOR = 12; + public static final AlphaComposite Clear = getInstance(CLEAR); + public static final AlphaComposite Src = getInstance(SRC); + public static final AlphaComposite Dst = getInstance(DST); + public static final AlphaComposite SrcOver = getInstance(SRC_OVER); + public static final AlphaComposite DstOver = getInstance(DST_OVER); + public static final AlphaComposite SrcIn = getInstance(SRC_IN); + public static final AlphaComposite DstIn = getInstance(DST_IN); + public static final AlphaComposite SrcOut = getInstance(SRC_OUT); + public static final AlphaComposite DstOut = getInstance(DST_OUT); + public static final AlphaComposite SrcAtop = getInstance(SRC_ATOP); + public static final AlphaComposite DstAtop = getInstance(DST_ATOP); + public static final AlphaComposite Xor = getInstance(XOR); + + private final int rule; + private final float alpha; + private AlphaComposite(int rule, float alpha) + { + this.rule = rule; + this.alpha = alpha; + } + + /** + * Creates an AlphaComposite object with the specified rule. + * + * @param rule The compositing rule. + * + * @exception IllegalArgumentException If rule is not one of the following: + * CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT, + * SRC_ATOP, DST_ATOP, or XOR. + */ + public static AlphaComposite getInstance(int rule) + { + return getInstance(rule, 1); + } + + /** + * Creates an AlphaComposite object with the specified rule and the constant + * alpha to multiply with the alpha of the source. The source is multiplied + * with the specified alpha before being composited with the destination. + * + * @param rule The compositing rule. + * + * @exception IllegalArgumentException If rule is not one of the following: + * CLEAR, SRC, DST, SRC_OVER, DST_OVER, SRC_IN, DST_IN, SRC_OUT, DST_OUT, + * SRC_ATOP, DST_ATOP, or XOR. + */ + public static AlphaComposite getInstance(int rule, float alpha) + { + if (rule < CLEAR || rule > XOR || ! (alpha >= 0 && alpha <= 1)) + throw new IllegalArgumentException(); + // This long is guaranteed unique for all valid alpha composites. + Long l = new Long(rule + Double.doubleToLongBits(alpha)); + AlphaComposite a = (AlphaComposite) cache.get(l); + if (a == null) + { + a = new AlphaComposite(rule, alpha); + cache.put(l, a); + } + return a; + } + public CompositeContext createContext(ColorModel srcColorModel, + ColorModel dstColorModel, + RenderingHints hints) + { + // XXX Implement. Sun uses undocumented implementation class + // sun.java2d.SunCompositeContext. + throw new Error("not implemented"); + } + public float getAlpha() + { + return alpha; + } + public int getRule() + { + return rule; + } + public int hashCode() + { + return 31 * Float.floatToIntBits(alpha) + rule; + } + public boolean equals(Object o) + { + if (! (o instanceof AlphaComposite)) + return false; + AlphaComposite a = (AlphaComposite) o; + return rule == a.rule && alpha == a.alpha; + } + } // class AlphaComposite diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AttributeValue.java gcc-3.3/libjava/java/awt/AttributeValue.java *** gcc-3.2.3/libjava/java/awt/AttributeValue.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/AttributeValue.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,98 ---- + /* AttributeValue.java -- parent of type-safe enums of attributes + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * This class is undocumented by Sun, but it is the parent of several other + * classes, all of which are type-safe enumerations. This takes care of + * equals, toString, and hashCode, so + * that you don't have to (although hashCode is commonly overridden). + * + * @author Eric Blake + */ + class AttributeValue + { + /** The value of the enumeration. Package visible for speed. */ + final int value; + + /** The list of enumeration names for the given subclass. */ + private final String[] names; + + /** + * Construct a type-safe enumeration element. For example,
    + *

    +    * class Foo extends AttributeValue
    +    * {
    +    *   private static final String[] names = { "one", "two" }
    +    *   public static final Foo ONE = new Foo(0);
    +    *   public static final Foo TWO = new Foo(1);
    +    *   private Foo(int value) { super(value, names); }
    +    * }
    +    * 
    + * + * @param value the position of this enumeration element, consecutive from 0 + * @param names the constant list of enumeration names for the subclass + */ + AttributeValue(int value, String[] names) + { + this.value = value; + this.names = names; + } + + /** + * Returns the hashcode of this element. This is the index of the element + * in the enumeration. Note that equals defaults to the == relation. + * + * @return the hashcode + */ + public int hashCode() + { + return value; + } + + /** + * Returns the name of this enumeration element. + * + * @return the element name + */ + public String toString() + { + return names[value]; + } + } // class AttributeValue diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AWTError.java gcc-3.3/libjava/java/awt/AWTError.java *** gcc-3.2.3/libjava/java/awt/AWTError.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/AWTError.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,5 **** /* AWTError.java -- A serious AWT error occurred. ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* AWTError.java -- A serious AWT error occurred. ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,62 **** package java.awt; /** ! * This error is thrown when a critical AWT error occurs. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class AWTError extends Error { ! /** ! * Initializes a new instance of AWTError with the specified ! * descriptive error message. ! * ! * @param message The descriptive error message. ! */ ! public ! AWTError(String message) ! { ! super(message); ! } ! ! } // class AWTError ! --- 39,64 ---- package java.awt; /** ! * This error is thrown when a critical Abstract Window Toolkit (AWT) error ! * occurs. ! * ! * @author Aaron M. Renn ! * @status updated to 1.4 ! */ public class AWTError extends Error { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -1819846354050686206L; ! /** ! * Create a new instance with the specified descriptive error message. ! * ! * @param message the descriptive error message ! */ ! public AWTError(String message) ! { ! super(message); ! } ! } // class AWTError diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AWTEvent.java gcc-3.3/libjava/java/awt/AWTEvent.java *** gcc-3.2.3/libjava/java/awt/AWTEvent.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/AWTEvent.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* AWTEvent.java -- the root event in AWT ! Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,159 **** package java.awt; ! /* Written using on-line Java 2 Platform Standard Edition v1.3 API ! * Specification, as well as "The Java Class Libraries", 2nd edition ! * (Addison-Wesley, 1998). ! * Status: Believed complete and correct, except for the java.awt.Event ! * compatibility constructor. ! */ /** * AWTEvent is the root event class for all AWT events in the JDK 1.1 event ! * model. It supersedes the Event class from JDK 1.0. * @author Warren Levy ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public abstract class AWTEvent extends java.util.EventObject { /** ! * @serial Indicates whether or not this event has been consumed. */ ! protected boolean consumed; /** ! * @serial The identifier number of this event. */ protected int id; /** ! * Mask for selecting component events. ! */ ! public static final long COMPONENT_EVENT_MASK = 0x001; /** ! * Mask for selecting container events. ! */ ! public static final long CONTAINER_EVENT_MASK = 0x002; /** ! * Mask for selecting component focus events. ! */ ! public static final long FOCUS_EVENT_MASK = 0x004; /** ! * Mask for selecting keyboard events. ! */ ! public static final long KEY_EVENT_MASK = 0x008; /** ! * Mask for mouse button events. ! */ ! public static final long MOUSE_EVENT_MASK = 0x010; /** ! * Mask for mouse motion events. ! */ ! public static final long MOUSE_MOTION_EVENT_MASK = 0x020; /** ! * Mask for window events. ! */ ! public static final long WINDOW_EVENT_MASK = 0x040; /** ! * Mask for action events. ! */ ! public static final long ACTION_EVENT_MASK = 0x080; /** ! * Mask for adjustment events. ! */ ! public static final long ADJUSTMENT_EVENT_MASK = 0x100; /** ! * Mask for item events. ! */ ! public static final long ITEM_EVENT_MASK = 0x200; /** ! * Mask for text events. ! */ ! public static final long TEXT_EVENT_MASK = 0x400; /** * This is the highest number for event ids that are reserved for use by ! * the AWT system itself. */ public static final int RESERVED_ID_MAX = 1999; ! public static final long INPUT_METHOD_EVENT_MASK = 1 << 11; ! ! /* Additional event selection masks from JDK 1.3 javadocs */ ! public static final long PAINT_EVENT_MASK = 1 << 13, ! INVOCATION_EVENT_MASK = 1 << 14, ! HIERARCHY_EVENT_MASK = 1 << 15, ! HIERARCHY_BOUNDS_EVENT_MASK = 1 << 16; ! /** ! * Initializes a new instance of AWTEvent from the ! * specified Java 1.0 event object. ! * ! * @param event The Java 1.0 event to initialize from. ! * ! * ! * Removed this method because we no longer support Java 1.0 * */ public AWTEvent(Event event) { ! // FIXME?? ! super(event.target); ! this.id = event.id; } /** ! * Initializes a new instance of AWTEvent with the specified ! * source and id. * ! * @param source The object that caused the event. ! * @param id The event id. */ public AWTEvent(Object source, int id) { --- 38,206 ---- package java.awt; ! import java.util.EventObject; /** * AWTEvent is the root event class for all AWT events in the JDK 1.1 event ! * model. It supersedes the Event class from JDK 1.0. Subclasses outside of ! * the java.awt package should have IDs greater than RESERVED_ID_MAX. ! * ! *

    Event masks defined here are used by components in ! * enableEvents to select event types not selected by registered ! * listeners. Event masks are appropriately set when registering on ! * components. ! * * @author Warren Levy ! * @author Aaron M. Renn ! * @since 1.1 ! * @status updated to 1.4 */ ! public abstract class AWTEvent extends EventObject { /** ! * Compatible with JDK 1.1+. */ ! private static final long serialVersionUID = -1825314779160409405L; /** ! * The ID of the event. ! * ! * @see #getID() ! * @see #AWTEvent(Object, int) ! * @serial the identifier number of this event */ protected int id; /** ! * Indicates if the event has been consumed. False mean it is passed to ! * the peer, true means it has already been processed. Semantic events ! * generated by low-level events always have the value true. ! * ! * @see #consume() ! * @see #isConsumed() ! * @serial whether the event has been consumed ! */ ! protected boolean consumed; /** ! * Who knows? It's in the serial version. ! * ! * @serial No idea what this is for. ! */ ! byte[] bdata; ! ! /** Mask for selecting component events. */ ! public static final long COMPONENT_EVENT_MASK = 0x00001; ! ! /** Mask for selecting container events. */ ! public static final long CONTAINER_EVENT_MASK = 0x00002; ! ! /** Mask for selecting component focus events. */ ! public static final long FOCUS_EVENT_MASK = 0x00004; ! ! /** Mask for selecting keyboard events. */ ! public static final long KEY_EVENT_MASK = 0x00008; ! ! /** Mask for mouse button events. */ ! public static final long MOUSE_EVENT_MASK = 0x00010; ! ! /** Mask for mouse motion events. */ ! public static final long MOUSE_MOTION_EVENT_MASK = 0x00020; ! ! /** Mask for window events. */ ! public static final long WINDOW_EVENT_MASK = 0x00040; ! ! /** Mask for action events. */ ! public static final long ACTION_EVENT_MASK = 0x00080; ! ! /** Mask for adjustment events. */ ! public static final long ADJUSTMENT_EVENT_MASK = 0x00100; ! ! /** Mask for item events. */ ! public static final long ITEM_EVENT_MASK = 0x00200; ! ! /** Mask for text events. */ ! public static final long TEXT_EVENT_MASK = 0x00400; /** ! * Mask for input method events. ! * @since 1.3 ! */ ! public static final long INPUT_METHOD_EVENT_MASK = 0x00800; /** ! * Mask if input methods are enabled. Package visible only. ! */ ! static final long INPUT_ENABLED_EVENT_MASK = 0x01000; /** ! * Mask for paint events. ! * @since 1.3 ! */ ! public static final long PAINT_EVENT_MASK = 0x02000; /** ! * Mask for invocation events. ! * @since 1.3 ! */ ! public static final long INVOCATION_EVENT_MASK = 0x04000; /** ! * Mask for hierarchy events. ! * @since 1.3 ! */ ! public static final long HIERARCHY_EVENT_MASK = 0x08000; /** ! * Mask for hierarchy bounds events. ! * @since 1.3 ! */ ! public static final long HIERARCHY_BOUNDS_EVENT_MASK = 0x10000; /** ! * Mask for mouse wheel events. ! * @since 1.4 ! */ ! public static final long MOUSE_WHEEL_EVENT_MASK = 0x20000; /** ! * Mask for window state events. ! * @since 1.4 ! */ ! public static final long WINDOW_STATE_EVENT_MASK = 0x40000; /** ! * Mask for window focus events. ! * @since 1.4 ! */ ! public static final long WINDOW_FOCUS_EVENT_MASK = 0x80000; /** * This is the highest number for event ids that are reserved for use by ! * the AWT system itself. Subclasses outside of java.awt should use higher ! * ids. */ public static final int RESERVED_ID_MAX = 1999; ! /** ! * Initializes a new AWTEvent from the old Java 1.0 event object. * + * @param event the old-style event + * @throws NullPointerException if event is null */ public AWTEvent(Event event) { ! this(event.target, event.id); ! consumed = event.consumed; } /** ! * Create an event on the specified source object and id. * ! * @param source the object that caused the event ! * @param id the event id ! * @throws IllegalArgumentException if source is null */ public AWTEvent(Object source, int id) { *************** public abstract class AWTEvent extends j *** 162,170 **** } /** ! * Returns the id number of this event. * ! * @return The id number of this event. */ public int getID() { --- 209,229 ---- } /** ! * Retarget the event, such as converting a heavyweight component to a ! * lightweight child of the original. This is not for general use, but ! * is for event targeting systems like KeyboardFocusManager. * ! * @param source the new source ! */ ! public void setSource(Object source) ! { ! this.source = source; ! } ! ! /** ! * Returns the event type id. ! * ! * @return the id number of this event */ public int getID() { *************** public abstract class AWTEvent extends j *** 172,194 **** } /** ! * Returns a string representation of this event. * ! * @return A string representation of this event. */ ! public String paramString () { ! return ""; } /** ! * Returns a string representation of this event. * ! * @return A string representation of this event. */ ! public String toString () { ! return getClass().getName() + "[" + paramString() + "] on " + source; } /** --- 231,256 ---- } /** ! * Returns a string representation of this event. This is in the format ! * getClass().getName() + '[' + paramString() + "] on " ! * + source. * ! * @return a string representation of this event */ ! public String toString() { ! return getClass().getName() + "[" + paramString() + "] on " + source; } /** ! * Returns a string representation of the state of this event. It may be ! * empty, but must not be null; it is implementation defined. * ! * @return a string representation of this event */ ! public String paramString() { ! return ""; } /** *************** public abstract class AWTEvent extends j *** 201,214 **** } /** ! * Tests whether not not this event has been consumed. A consumed event * is not processed in the default manner. * ! * @return true if this event has been consumed, ! * false otherwise. */ protected boolean isConsumed() { return consumed; } ! } --- 263,275 ---- } /** ! * Tests whether not not this event has been consumed. A consumed event * is not processed in the default manner. * ! * @return true if this event has been consumed */ protected boolean isConsumed() { return consumed; } ! } // class AWTEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AWTEventMulticaster.java gcc-3.3/libjava/java/awt/AWTEventMulticaster.java *** gcc-3.2.3/libjava/java/awt/AWTEventMulticaster.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/AWTEventMulticaster.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* AWTEventMulticaster.java -- allows multicast chaining of listeners ! Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,96 **** package java.awt; ! import java.awt.event.*; ! import java.util.EventListener; import java.io.ObjectOutputStream; ! ! /* Written using on-line Java 2 Platform Standard Edition v1.3 API ! * Specification, as well as "The Java Class Libraries", 2nd edition ! * (Addison-Wesley, 1998). ! * Status: Believed complete and correct to J2SE 1.3, except for ! * serialization support methods, save() and saveInternal(), which are ! * stubbed. ! */ /** ! * This class is used to implement a chain of event handlers. Dispatching ! * using this class is thread safe. Here is a quick example of how to ! * add and delete listeners using this class. For this example, we will ! * assume are firing AdjustableEvent's. However, this ! * same approach is useful for all events in the java.awt.event ! * package, and more if this class is subclassed. ! *

    ! * ! * AdjustmentListener al; ! * ! * public void ! * addAdjustmentListener(AdjustmentListener listener) ! * { ! * al = AWTEventMulticaster.add(al, listener); ! * } ! * ! * public void ! * removeAdjustmentListener(AdjustmentListener listener) ! * { ! * al = AWTEventMulticaster.remove(al, listener); ! * } ! * ! *

    ! * When it come time to process an event, simply call al, ! * assuming it is not null. ! *

    ! * The first time add is called it is passed ! * null and listener as its arguments. This ! * starts building the chain. This class returns listener ! * which becomes the new al. The next time, add ! * is called with al and listener and the ! * new listener is then chained to the old. ! * ! * @author Bryce McKinlay ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class AWTEventMulticaster implements ComponentListener, ! ContainerListener, FocusListener, KeyListener, MouseListener, ! MouseMotionListener, WindowListener, ActionListener, ItemListener, ! AdjustmentListener, TextListener, InputMethodListener, HierarchyListener, ! HierarchyBoundsListener { /** * A variable in the event chain. --- 38,124 ---- package java.awt; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.awt.event.AdjustmentEvent; ! import java.awt.event.AdjustmentListener; ! import java.awt.event.ComponentEvent; ! import java.awt.event.ComponentListener; ! import java.awt.event.ContainerEvent; ! import java.awt.event.ContainerListener; ! import java.awt.event.FocusEvent; ! import java.awt.event.FocusListener; ! import java.awt.event.HierarchyBoundsListener; ! import java.awt.event.HierarchyEvent; ! import java.awt.event.HierarchyListener; ! import java.awt.event.InputMethodEvent; ! import java.awt.event.InputMethodListener; ! import java.awt.event.ItemEvent; ! import java.awt.event.ItemListener; ! import java.awt.event.KeyEvent; ! import java.awt.event.KeyListener; ! import java.awt.event.MouseEvent; ! import java.awt.event.MouseListener; ! import java.awt.event.MouseMotionListener; ! import java.awt.event.MouseWheelEvent; ! import java.awt.event.MouseWheelListener; ! import java.awt.event.TextEvent; ! import java.awt.event.TextListener; ! import java.awt.event.WindowEvent; ! import java.awt.event.WindowFocusListener; ! import java.awt.event.WindowListener; ! import java.awt.event.WindowStateListener; ! import java.io.IOException; import java.io.ObjectOutputStream; ! import java.io.Serializable; ! import java.lang.reflect.Array; ! import java.util.ArrayList; ! import java.util.EventListener; /** ! * This class is used to implement a chain of event handlers. Dispatching ! * using this class is thread safe. Here is a quick example of how to ! * add and delete listeners using this class. For this example, we will ! * assume are firing AdjustmentEvent's. However, this ! * same approach is useful for all events in the java.awt.event ! * package, and more if this class is subclassed. ! * ! *

    ! * AdjustmentListener al; ! * public void addAdjustmentListener(AdjustmentListener listener) ! * { ! * al = AWTEventMulticaster.add(al, listener); ! * } ! * public void removeAdjustmentListener(AdjustmentListener listener) ! * { ! * al = AWTEventMulticaster.remove(al, listener); ! * } ! * ! * ! *

    When it come time to process an event, simply call al, ! * assuming it is not null, and all listeners in the chain will ! * be fired. ! * ! *

    The first time add is called it is passed ! * null and listener as its arguments. This ! * starts building the chain. This class returns listener ! * which becomes the new al. The next time, add ! * is called with al and listener and the ! * new listener is then chained to the old. ! * ! * @author Bryce McKinlay ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class AWTEventMulticaster ! implements ComponentListener, ContainerListener, FocusListener, KeyListener, ! MouseListener, MouseMotionListener, WindowListener, ! WindowFocusListener, WindowStateListener, ActionListener, ! ItemListener, AdjustmentListener, TextListener, ! InputMethodListener, HierarchyListener, HierarchyBoundsListener, ! MouseWheelListener { /** * A variable in the event chain. *************** public class AWTEventMulticaster impleme *** 98,169 **** protected final EventListener a; /** ! * A variable in the event chain */ protected final EventListener b; /** * Initializes a new instance of AWTEventMulticaster with ! * the specified event listener parameters. * ! * @param a The "a" listener object. ! * @param b The "b" listener object. */ ! protected AWTEventMulticaster(EventListener a, ! EventListener b) { this.a = a; this.b = b; } /** ! * Chain EventListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. ! * ! * @return Latest entry in the chain. ! */ ! protected static EventListener addInternal(EventListener a, EventListener b) ! { ! if (a == null) ! return b; ! else if (b == null) ! return a; ! else return new AWTEventMulticaster(a, b); ! } ! ! /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. ! * ! * @return The resulting listener after the remove operation. ! */ ! protected static EventListener removeInternal(EventListener l, ! EventListener oldl) ! { ! if (l == oldl) ! return null; ! else if (l instanceof AWTEventMulticaster) ! { ! AWTEventMulticaster mc = (AWTEventMulticaster) l; ! return mc.remove(oldl); ! } ! return l; ! } ! ! /** ! * Removes the specified object from this multicaster object. If the ! * object to remove is not part of this multicaster, then the remove ! * method on the parent multicaster (if it exists) is called and a ! * new multicaster object is returned based on that object and this ! * multicaster's non-parent object. ! * ! * @param old The object to remove from this multicaster. * ! * @return The resulting multicaster with the specified listener removed. */ protected EventListener remove(EventListener oldl) { --- 126,157 ---- protected final EventListener a; /** ! * A variable in the event chain. */ protected final EventListener b; /** * Initializes a new instance of AWTEventMulticaster with ! * the specified event listener parameters. The parameters should not be ! * null, although it is not required to enforce this with a ! * NullPointerException. * ! * @param a the "a" listener object ! * @param b the "b" listener object */ ! protected AWTEventMulticaster(EventListener a, EventListener b) { this.a = a; this.b = b; } /** ! * Removes one instance of the specified listener from this multicaster ! * chain. This descends recursively if either child is a multicaster, and ! * returns a multicaster chain with the old listener removed. * ! * @param oldl the object to remove from this multicaster ! * @return the resulting multicaster with the specified listener removed */ protected EventListener remove(EventListener oldl) { *************** public class AWTEventMulticaster impleme *** 172,532 **** return b; if (b == oldl) return a; - // If a and/or b are Multicaster's, search them recursively. if (a instanceof AWTEventMulticaster) { ! AWTEventMulticaster mc = (AWTEventMulticaster) a; ! EventListener newa = mc.remove(oldl); ! if (newa != a) ! return new AWTEventMulticaster (newa, b); ! } if (b instanceof AWTEventMulticaster) { ! AWTEventMulticaster mc = (AWTEventMulticaster) a; ! EventListener newb = mc.remove(oldl); ! if (newb != b) ! return new AWTEventMulticaster (a, newb); } - // oldl was not found. return this; } /** ! * Chain ActionListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static ActionListener add(ActionListener a, ActionListener b) { ! return (ActionListener) addInternal(a, b); } /** ! * Chain AdjustmentListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static AdjustmentListener add(AdjustmentListener a, ! AdjustmentListener b) { ! return (AdjustmentListener) addInternal(a, b); ! } /** ! * Chain ComponentListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static ComponentListener add(ComponentListener a, ComponentListener b) { ! return (ComponentListener) addInternal(a, b); } /** ! * Chain ContainerListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static ContainerListener add(ContainerListener a, ContainerListener b) { ! return (ContainerListener) addInternal(a, b); } /** ! * Chain FocusListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static FocusListener add(FocusListener a, FocusListener b) { ! return (FocusListener) addInternal(a, b); } ! public static HierarchyBoundsListener add(HierarchyBoundsListener a, ! HierarchyBoundsListener b) { ! return (HierarchyBoundsListener) addInternal(a, b); } ! public static HierarchyListener add(HierarchyListener a, HierarchyListener b) { ! return (HierarchyListener) addInternal(a, b); } ! public static InputMethodListener add(InputMethodListener a, ! InputMethodListener b) { ! return (InputMethodListener) addInternal(a, b); } /** ! * Chain ItemListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static ItemListener add(ItemListener a, ItemListener b) { ! return (ItemListener) addInternal(a, b); } /** ! * Chain KeyListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static KeyListener add(KeyListener a, KeyListener b) { ! return (KeyListener) addInternal(a, b); } /** ! * Chain MouseListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static MouseListener add(MouseListener a, MouseListener b) { ! return (MouseListener) addInternal(a, b); } /** ! * Chain MouseMotionListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static MouseMotionListener add(MouseMotionListener a, ! MouseMotionListener b) { ! return (MouseMotionListener) addInternal(a, b); } /** ! * Chain AdjustmentListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static TextListener add(TextListener a, TextListener b) { ! return (TextListener) addInternal(a, b); } /** ! * Chain WindowListener b to a. ! * ! * @param a - Listener to chain to. ! * @param b - Listener to chain. * ! * @return Latest entry in the chain. */ ! public static WindowListener add(WindowListener a, WindowListener b) { ! return (WindowListener) addInternal(a, b); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static ActionListener remove(ActionListener l, ActionListener oldl) { ! return (ActionListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static AdjustmentListener remove(AdjustmentListener l, ! AdjustmentListener oldl) { ! return (AdjustmentListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static ComponentListener remove(ComponentListener l, ! ComponentListener oldl) { ! return (ComponentListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static ContainerListener remove(ContainerListener l, ! ContainerListener oldl) { ! return (ContainerListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static FocusListener remove(FocusListener l, FocusListener oldl) { ! return (FocusListener) removeInternal(l, oldl); } ! public static HierarchyBoundsListener remove(HierarchyBoundsListener l, ! HierarchyBoundsListener oldl) { ! return (HierarchyBoundsListener) removeInternal(l, oldl); } ! public static HierarchyListener remove(HierarchyListener l, ! HierarchyListener oldl) { ! return (HierarchyListener) removeInternal(l, oldl); } ! public static InputMethodListener remove(InputMethodListener l, ! InputMethodListener oldl) { ! return (InputMethodListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static ItemListener remove(ItemListener l, ItemListener oldl) { ! return (ItemListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static KeyListener remove(KeyListener l, KeyListener oldl) { ! return (KeyListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static MouseListener remove(MouseListener l, MouseListener oldl) { ! return (MouseListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static MouseMotionListener remove(MouseMotionListener l, ! MouseMotionListener oldl) { ! return (MouseMotionListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static TextListener remove(TextListener l, TextListener oldl) { ! return (TextListener) removeInternal(l, oldl); } /** ! * Removes the listener old from the listener lis. ! * ! * @param lis The listener to remove old from. ! * @param old The listener to remove. * ! * @return The resulting listener after the remove operation. */ ! public static WindowListener remove(WindowListener l, WindowListener oldl) { ! return (WindowListener) removeInternal(l, oldl); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void actionPerformed(ActionEvent e) { ((ActionListener) a).actionPerformed(e); ((ActionListener) b).actionPerformed(e); --- 160,528 ---- return b; if (b == oldl) return a; // If a and/or b are Multicaster's, search them recursively. if (a instanceof AWTEventMulticaster) { ! EventListener newa = ((AWTEventMulticaster) a).remove(oldl); ! if (newa != a) ! return new AWTEventMulticaster(newa, b); ! } if (b instanceof AWTEventMulticaster) { ! EventListener newb = ((AWTEventMulticaster) b).remove(oldl); ! if (newb != b) ! return new AWTEventMulticaster(a, newb); } // oldl was not found. return this; } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void componentResized(ComponentEvent e) { ! ((ComponentListener) a).componentResized(e); ! ((ComponentListener) b).componentResized(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void componentMoved(ComponentEvent e) { ! ((ComponentListener) a).componentMoved(e); ! ((ComponentListener) b).componentMoved(e); ! } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void componentShown(ComponentEvent e) { ! ((ComponentListener) a).componentShown(e); ! ((ComponentListener) b).componentShown(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void componentHidden(ComponentEvent e) { ! ((ComponentListener) a).componentHidden(e); ! ((ComponentListener) b).componentHidden(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void componentAdded(ContainerEvent e) { ! ((ContainerListener) a).componentAdded(e); ! ((ContainerListener) b).componentAdded(e); } ! /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. ! * ! * @param event the event to handle ! */ ! public void componentRemoved(ContainerEvent e) { ! ((ContainerListener) a).componentRemoved(e); ! ((ContainerListener) b).componentRemoved(e); } ! /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. ! * ! * @param event the event to handle ! */ ! public void focusGained(FocusEvent e) { ! ((FocusListener) a).focusGained(e); ! ((FocusListener) b).focusGained(e); } ! /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. ! * ! * @param event the event to handle ! */ ! public void focusLost(FocusEvent e) { ! ((FocusListener) a).focusLost(e); ! ((FocusListener) b).focusLost(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void keyTyped(KeyEvent e) { ! ((KeyListener) a).keyTyped(e); ! ((KeyListener) b).keyTyped(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void keyPressed(KeyEvent e) { ! ((KeyListener) a).keyPressed(e); ! ((KeyListener) b).keyPressed(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void keyReleased(KeyEvent e) { ! ((KeyListener) a).keyReleased(e); ! ((KeyListener) b).keyReleased(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void mouseClicked(MouseEvent e) { ! ((MouseListener) a).mouseClicked(e); ! ((MouseListener) b).mouseClicked(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void mousePressed(MouseEvent e) { ! ((MouseListener) a).mousePressed(e); ! ((MouseListener) b).mousePressed(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void mouseReleased(MouseEvent e) { ! ((MouseListener) a).mouseReleased(e); ! ((MouseListener) b).mouseReleased(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void mouseEntered(MouseEvent e) { ! ((MouseListener) a).mouseEntered(e); ! ((MouseListener) b).mouseEntered(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void mouseExited(MouseEvent e) { ! ((MouseListener) a).mouseExited(e); ! ((MouseListener) b).mouseExited(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void mouseDragged(MouseEvent e) { ! ((MouseMotionListener) a).mouseDragged(e); ! ((MouseMotionListener) b).mouseDragged(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void mouseMoved(MouseEvent e) { ! ((MouseMotionListener) a).mouseMoved(e); ! ((MouseMotionListener) b).mouseMoved(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void windowOpened(WindowEvent e) { ! ((WindowListener) a).windowOpened(e); ! ((WindowListener) b).windowOpened(e); } ! /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. ! * ! * @param event the event to handle ! */ ! public void windowClosing(WindowEvent e) { ! ((WindowListener) a).windowClosing(e); ! ((WindowListener) b).windowClosing(e); } ! /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. ! * ! * @param event the event to handle ! */ ! public void windowClosed(WindowEvent e) { ! ((WindowListener) a).windowClosed(e); ! ((WindowListener) b).windowClosed(e); } ! /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. ! * ! * @param event the event to handle ! */ ! public void windowIconified(WindowEvent e) { ! ((WindowListener) a).windowIconified(e); ! ((WindowListener) b).windowIconified(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void windowDeiconified(WindowEvent e) { ! ((WindowListener) a).windowDeiconified(e); ! ((WindowListener) b).windowDeiconified(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void windowActivated(WindowEvent e) { ! ((WindowListener) a).windowActivated(e); ! ((WindowListener) b).windowActivated(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle */ ! public void windowDeactivated(WindowEvent e) { ! ((WindowListener) a).windowDeactivated(e); ! ((WindowListener) b).windowDeactivated(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle ! * @since 1.4 */ ! public void windowStateChanged(WindowEvent e) { ! ((WindowStateListener) a).windowStateChanged(e); ! ((WindowStateListener) b).windowStateChanged(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle ! * @since 1.4 */ ! public void windowGainedFocus(WindowEvent e) { ! ((WindowFocusListener) a).windowGainedFocus(e); ! ((WindowFocusListener) b).windowGainedFocus(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event the event to handle ! * @since 1.4 */ ! public void windowLostFocus(WindowEvent e) { ! ((WindowFocusListener) a).windowLostFocus(e); ! ((WindowFocusListener) b).windowLostFocus(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle */ ! public void actionPerformed(ActionEvent e) { ((ActionListener) a).actionPerformed(e); ((ActionListener) b).actionPerformed(e); *************** public class AWTEventMulticaster impleme *** 536,940 **** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void adjustmentValueChanged(AdjustmentEvent e) { ! ((AdjustmentListener) a).adjustmentValueChanged(e); ! ((AdjustmentListener) b).adjustmentValueChanged(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void componentHidden(ComponentEvent e) { ! ((ComponentListener) a).componentHidden(e); ! ((ComponentListener) b).componentHidden(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void componentMoved(ComponentEvent e) { ! ((ComponentListener) a).componentMoved(e); ! ((ComponentListener) b).componentMoved(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void componentResized(ComponentEvent e) { ! ((ComponentListener) a).componentResized(e); ! ((ComponentListener) b).componentResized(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void componentShown(ComponentEvent e) { ! ((ComponentListener) a).componentShown(e); ! ((ComponentListener) b).componentShown(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void componentAdded(ContainerEvent e) { ! ((ContainerListener) a).componentAdded(e); ! ((ContainerListener) b).componentAdded(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void componentRemoved(ContainerEvent e) { ! ((ContainerListener) a).componentRemoved(e); ! ((ContainerListener) b).componentRemoved(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void focusGained(FocusEvent e) { ! ((FocusListener) a).focusGained(e); ! ((FocusListener) b).focusGained(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event The event to handle. */ ! public void focusLost(FocusEvent e) { ! ((FocusListener) a).focusLost(e); ! ((FocusListener) b).focusLost(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void ancestorMoved(HierarchyEvent e) { ! ((HierarchyBoundsListener) a).ancestorMoved(e); ! ((HierarchyBoundsListener) b).ancestorMoved(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void ancestorResized(HierarchyEvent e) { ! ((HierarchyBoundsListener) a).ancestorResized(e); ! ((HierarchyBoundsListener) b).ancestorResized(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void hierarchyChanged(HierarchyEvent e) { ! ((HierarchyListener) a).hierarchyChanged(e); ! ((HierarchyListener) b).hierarchyChanged(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void caretPositionChanged(InputMethodEvent e) { ! ((InputMethodListener) a).caretPositionChanged(e); ! ((InputMethodListener) b).caretPositionChanged(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void inputMethodTextChanged(InputMethodEvent e) { ! ((InputMethodListener) a).inputMethodTextChanged(e); ! ((InputMethodListener) b).inputMethodTextChanged(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void itemStateChanged(ItemEvent e) { ! ((ItemListener) a).itemStateChanged(e); ! ((ItemListener) b).itemStateChanged(e); ! } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void keyPressed(KeyEvent e) { ! ((KeyListener) a).keyPressed(e); ! ((KeyListener) b).keyPressed(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void keyReleased(KeyEvent e) { ! ((KeyListener) a).keyReleased(e); ! ((KeyListener) b).keyReleased(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void keyTyped(KeyEvent e) { ! ((KeyListener) a).keyTyped(e); ! ((KeyListener) b).keyTyped(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void mouseClicked(MouseEvent e) { ! ((MouseListener) a).mouseClicked(e); ! ((MouseListener) b).mouseClicked(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void mouseEntered(MouseEvent e) { ! ((MouseListener) a).mouseEntered(e); ! ((MouseListener) b).mouseEntered(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void mouseExited(MouseEvent e) { ! ((MouseListener) a).mouseExited(e); ! ((MouseListener) b).mouseExited(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void mousePressed(MouseEvent e) { ! ((MouseListener) a).mousePressed(e); ! ((MouseListener) b).mousePressed(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void mouseReleased(MouseEvent e) { ! ((MouseListener) a).mouseReleased(e); ! ((MouseListener) b).mouseReleased(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void mouseDragged(MouseEvent e) { ! ((MouseMotionListener) a).mouseDragged(e); ! ((MouseMotionListener) b).mouseDragged(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void mouseMoved(MouseEvent e) { ! ((MouseMotionListener) a).mouseMoved(e); ! ((MouseMotionListener) b).mouseMoved(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void textValueChanged(TextEvent e) { ! ((TextListener) a).textValueChanged(e); ! ((TextListener) b).textValueChanged(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void windowActivated(WindowEvent e) { ! ((WindowListener) a).windowActivated(e); ! ((WindowListener) b).windowActivated(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void windowClosed(WindowEvent e) { ! ((WindowListener) a).windowClosed(e); ! ((WindowListener) b).windowClosed(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void windowClosing(WindowEvent e) { ! ((WindowListener) a).windowClosing(e); ! ((WindowListener) b).windowClosing(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void windowDeactivated(WindowEvent e) { ! ((WindowListener) a).windowDeactivated(e); ! ((WindowListener) b).windowDeactivated(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void windowDeiconified(WindowEvent e) { ! ((WindowListener) a).windowDeiconified(e); ! ((WindowListener) b).windowDeiconified(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void windowIconified(WindowEvent e) { ! ((WindowListener) a).windowIconified(e); ! ((WindowListener) b).windowIconified(e); } /** ! * Handles this event by dispatching it to the "a" and "b" listener ! * instances. * ! * @param event The event to handle. */ ! public void windowOpened(WindowEvent e) { ! ((WindowListener) a).windowOpened(e); ! ((WindowListener) b).windowOpened(e); } ! protected static void save(ObjectOutputStream s, String k, EventListener l) { ! throw new RuntimeException("Not Implemented"); } protected void saveInternal(ObjectOutputStream s, String k) { ! throw new RuntimeException("Not Implemented"); } ! } --- 532,1209 ---- * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle */ ! public void itemStateChanged(ItemEvent e) { ! ((ItemListener) a).itemStateChanged(e); ! ((ItemListener) b).itemStateChanged(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle */ ! public void adjustmentValueChanged(AdjustmentEvent e) { ! ((AdjustmentListener) a).adjustmentValueChanged(e); ! ((AdjustmentListener) b).adjustmentValueChanged(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle */ ! public void textValueChanged(TextEvent e) { ! ((TextListener) a).textValueChanged(e); ! ((TextListener) b).textValueChanged(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle ! * @since 1.2 */ ! public void inputMethodTextChanged(InputMethodEvent e) { ! ((InputMethodListener) a).inputMethodTextChanged(e); ! ((InputMethodListener) b).inputMethodTextChanged(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle ! * @since 1.2 */ ! public void caretPositionChanged(InputMethodEvent e) { ! ((InputMethodListener) a).caretPositionChanged(e); ! ((InputMethodListener) b).caretPositionChanged(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle ! * @since 1.3 */ ! public void hierarchyChanged(HierarchyEvent e) { ! ((HierarchyListener) a).hierarchyChanged(e); ! ((HierarchyListener) b).hierarchyChanged(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle ! * @since 1.3 */ ! public void ancestorMoved(HierarchyEvent e) { ! ((HierarchyBoundsListener) a).ancestorMoved(e); ! ((HierarchyBoundsListener) b).ancestorMoved(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle ! * @since 1.3 */ ! public void ancestorResized(HierarchyEvent e) { ! ((HierarchyBoundsListener) a).ancestorResized(e); ! ((HierarchyBoundsListener) b).ancestorResized(e); } /** * Handles this event by dispatching it to the "a" and "b" listener * instances. * ! * @param event the event to handle ! * @since 1.4 */ ! public void mouseWheelMoved(MouseWheelEvent e) { ! ((MouseWheelListener) a).mouseWheelMoved(e); ! ((MouseWheelListener) b).mouseWheelMoved(e); } /** ! * Chain ComponentListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static ComponentListener add(ComponentListener a, ComponentListener b) { ! return (ComponentListener) addInternal(a, b); } /** ! * Chain ContainerListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static ContainerListener add(ContainerListener a, ContainerListener b) { ! return (ContainerListener) addInternal(a, b); } /** ! * Chain FocusListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static FocusListener add(FocusListener a, FocusListener b) { ! return (FocusListener) addInternal(a, b); } /** ! * Chain KeyListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static KeyListener add(KeyListener a, KeyListener b) { ! return (KeyListener) addInternal(a, b); } /** ! * Chain MouseListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static MouseListener add(MouseListener a, MouseListener b) { ! return (MouseListener) addInternal(a, b); } /** ! * Chain MouseMotionListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static MouseMotionListener add(MouseMotionListener a, ! MouseMotionListener b) { ! return (MouseMotionListener) addInternal(a, b); ! } /** ! * Chain WindowListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static WindowListener add(WindowListener a, WindowListener b) { ! return (WindowListener) addInternal(a, b); } /** ! * Chain WindowStateListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain ! * @since 1.4 */ ! public static WindowStateListener add(WindowStateListener a, ! WindowStateListener b) { ! return (WindowStateListener) addInternal(a, b); } /** ! * Chain WindowFocusListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain ! * @since 1.4 */ ! public static WindowFocusListener add(WindowFocusListener a, ! WindowFocusListener b) { ! return (WindowFocusListener) addInternal(a, b); } /** ! * Chain ActionListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static ActionListener add(ActionListener a, ActionListener b) { ! return (ActionListener) addInternal(a, b); } /** ! * Chain ItemListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static ItemListener add(ItemListener a, ItemListener b) { ! return (ItemListener) addInternal(a, b); } /** ! * Chain AdjustmentListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static AdjustmentListener add(AdjustmentListener a, ! AdjustmentListener b) { ! return (AdjustmentListener) addInternal(a, b); } /** ! * Chain AdjustmentListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain */ ! public static TextListener add(TextListener a, TextListener b) { ! return (TextListener) addInternal(a, b); } /** ! * Chain InputMethodListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain ! * @since 1.2 */ ! public static InputMethodListener add(InputMethodListener a, ! InputMethodListener b) { ! return (InputMethodListener) addInternal(a, b); } /** ! * Chain HierarchyListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain ! * @since 1.3 */ ! public static HierarchyListener add(HierarchyListener a, HierarchyListener b) { ! return (HierarchyListener) addInternal(a, b); } /** ! * Chain HierarchyBoundsListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain ! * @since 1.3 */ ! public static HierarchyBoundsListener add(HierarchyBoundsListener a, ! HierarchyBoundsListener b) { ! return (HierarchyBoundsListener) addInternal(a, b); } /** ! * Chain MouseWheelListener a and b. * ! * @param a the "a" listener, may be null ! * @param b the "b" listener, may be null ! * @return latest entry in the chain ! * @since 1.4 */ ! public static MouseWheelListener add(MouseWheelListener a, ! MouseWheelListener b) { ! return (MouseWheelListener) addInternal(a, b); } /** ! * Removes the listener oldl from the listener l. * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain */ ! public static ComponentListener remove(ComponentListener l, ! ComponentListener oldl) { ! return (ComponentListener) removeInternal(l, oldl); } /** ! * Removes the listener oldl from the listener l. * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain */ ! public static ContainerListener remove(ContainerListener l, ! ContainerListener oldl) { ! return (ContainerListener) removeInternal(l, oldl); } /** ! * Removes the listener oldl from the listener l. * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain */ ! public static FocusListener remove(FocusListener l, FocusListener oldl) { ! return (FocusListener) removeInternal(l, oldl); } /** ! * Removes the listener oldl from the listener l. * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain */ ! public static KeyListener remove(KeyListener l, KeyListener oldl) { ! return (KeyListener) removeInternal(l, oldl); } /** ! * Removes the listener oldl from the listener l. * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain */ ! public static MouseListener remove(MouseListener l, MouseListener oldl) { ! return (MouseListener) removeInternal(l, oldl); } /** ! * Removes the listener oldl from the listener l. * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain */ ! public static MouseMotionListener remove(MouseMotionListener l, ! MouseMotionListener oldl) { ! return (MouseMotionListener) removeInternal(l, oldl); } /** ! * Removes the listener oldl from the listener l. * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain */ ! public static WindowListener remove(WindowListener l, WindowListener oldl) { ! return (WindowListener) removeInternal(l, oldl); } ! /** ! * Removes the listener oldl from the listener l. ! * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain ! * @since 1.4 ! */ ! public static WindowStateListener remove(WindowStateListener l, ! WindowStateListener oldl) { ! return (WindowStateListener) removeInternal(l, oldl); ! } ! ! /** ! * Removes the listener oldl from the listener l. ! * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain ! * @since 1.4 ! */ ! public static WindowFocusListener remove(WindowFocusListener l, ! WindowFocusListener oldl) ! { ! return (WindowFocusListener) removeInternal(l, oldl); ! } ! ! /** ! * Removes the listener oldl from the listener l. ! * ! * @param l the listener chain to reduce ! * @param oldl the listener to remove ! * @return the resulting listener chain ! */ ! public static ActionListener remove(ActionListener l, ActionListener oldl) ! { ! return (ActionListener) removeInternal(l, oldl); } + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + */ + public static ItemListener remove(ItemListener l, ItemListener oldl) + { + return (ItemListener) removeInternal(l, oldl); + } + + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + */ + public static AdjustmentListener remove(AdjustmentListener l, + AdjustmentListener oldl) + { + return (AdjustmentListener) removeInternal(l, oldl); + } + + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + */ + public static TextListener remove(TextListener l, TextListener oldl) + { + return (TextListener) removeInternal(l, oldl); + } + + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + * @since 1.2 + */ + public static InputMethodListener remove(InputMethodListener l, + InputMethodListener oldl) + { + return (InputMethodListener) removeInternal(l, oldl); + } + + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + * @since 1.3 + */ + public static HierarchyListener remove(HierarchyListener l, + HierarchyListener oldl) + { + return (HierarchyListener) removeInternal(l, oldl); + } + + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + * @since 1.3 + */ + public static HierarchyBoundsListener remove(HierarchyBoundsListener l, + HierarchyBoundsListener oldl) + { + return (HierarchyBoundsListener) removeInternal(l, oldl); + } + + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + * @since 1.4 + */ + public static MouseWheelListener remove(MouseWheelListener l, + MouseWheelListener oldl) + { + return (MouseWheelListener) removeInternal(l, oldl); + } + + /** + * Chain EventListener a and b. + * + * @param a the "a" listener, may be null + * @param b the "b" listener, may be null + * @return latest entry in the chain + */ + protected static EventListener addInternal(EventListener a, EventListener b) + { + if (a == null) + return b; + if (b == null) + return a; + return new AWTEventMulticaster(a, b); + } + + /** + * Removes the listener oldl from the listener l. + * + * @param l the listener chain to reduce + * @param oldl the listener to remove + * @return the resulting listener chain + */ + protected static EventListener removeInternal(EventListener l, + EventListener oldl) + { + if (l == oldl) + return null; + if (l instanceof AWTEventMulticaster) + return ((AWTEventMulticaster) l).remove(oldl); + return l; + } + + /** + * Saves all Serializable listeners to a serialization stream. + * + * @param s the stream to save to + * @param k a prefix stream put before each serializable listener + * @throws IOException if serialization fails + */ protected void saveInternal(ObjectOutputStream s, String k) + throws IOException { ! // This is not documented by Sun, but I think it is correct. ! if (a instanceof AWTEventMulticaster) ! ((AWTEventMulticaster) a).saveInternal(s, k); ! else if (a instanceof Serializable) ! { ! s.writeObject(k); ! s.writeObject(a); ! } ! if (b instanceof AWTEventMulticaster) ! ((AWTEventMulticaster) b).saveInternal(s, k); ! else if (b instanceof Serializable) ! { ! s.writeObject(k); ! s.writeObject(b); ! } } ! ! /** ! * Saves a Serializable listener chain to a serialization stream. ! * ! * @param s the stream to save to ! * @param k a prefix stream put before each serializable listener ! * @param l the listener chain to save ! * @throws IOException if serialization fails ! */ ! protected static void save(ObjectOutputStream s, String k, EventListener l) ! throws IOException ! { ! // This is not documented by Sun, but I think it is correct. ! if (l instanceof AWTEventMulticaster) ! ((AWTEventMulticaster) l).saveInternal(s, k); ! else if (l instanceof Serializable) ! { ! s.writeObject(k); ! s.writeObject(l); ! } ! } ! ! /** ! * Returns an array of all chained listeners of the specified type in the ! * given chain. A null listener returns an empty array, and a listener ! * which is not an AWTEventMulticaster returns an array of one element. If ! * no listeners in the chain are of the specified type, an empty array is ! * returned. ! * ! * @param l the listener chain to convert to an array ! * @param type the type of listeners to collect ! * @return an array of the listeners of that type in the chain ! * @throws ClassCastException if type is not assignable from EventListener ! * @throws NullPointerException if type is null ! * @throws IllegalArgumentException if type is Void.TYPE ! * @since 1.4 ! */ ! public static EventListener[] getListeners(EventListener l, Class type) ! { ! ArrayList list = new ArrayList(); ! if (l instanceof AWTEventMulticaster) ! ((AWTEventMulticaster) l).getListeners(list, type); ! else if (type.isInstance(l)) ! list.add(l); ! EventListener[] r = (EventListener[]) Array.newInstance(type, list.size()); ! list.toArray(r); ! return r; ! } ! ! /** ! * Collects all instances of the given type in the chain into the list. ! * ! * @param l the list to collect into ! * @param type the type of listeners to collect ! * @throws NullPointerException if type is null ! * @see #getListeners(EventListener, Class) ! */ ! private void getListeners(ArrayList l, Class type) ! { ! if (a instanceof AWTEventMulticaster) ! ((AWTEventMulticaster) a).getListeners(l, type); ! else if (type.isInstance(a)) ! l.add(a); ! if (b instanceof AWTEventMulticaster) ! ((AWTEventMulticaster) b).getListeners(l, type); ! else if (type.isInstance(b)) ! l.add(b); ! } ! } // class AWTEventMulticaster diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AWTException.java gcc-3.3/libjava/java/awt/AWTException.java *** gcc-3.2.3/libjava/java/awt/AWTException.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/AWTException.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,5 **** /* AWTException.java -- Generic AWT exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* AWTException.java -- Generic AWT exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,63 **** package java.awt; /** ! * This is a generic exception that indicates an error occurred in the ! * AWT system. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class AWTException extends Exception { ! /** ! * Initializes a new instance of AWTException with the ! * specified detailed error message. ! * ! * @param message The detailed error message. ! */ ! public ! AWTException(String message) ! { ! super(message); ! } ! ! } // class AWTException ! --- 39,64 ---- package java.awt; /** ! * This is a generic exception that indicates an exception occurred in the ! * Abstract Window Toolkit (AWT) system. ! * ! * @author Aaron M. Renn ! * @status updated to 1.4 ! */ public class AWTException extends Exception { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -1900414231151323879L; ! /** ! * Create a new instance with the specified detailed error message. ! * ! * @param message the detailed error message ! */ ! public AWTException(String message) ! { ! super(message); ! } ! } // class AWTException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AWTKeyStroke.java gcc-3.3/libjava/java/awt/AWTKeyStroke.java *** gcc-3.2.3/libjava/java/awt/AWTKeyStroke.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/AWTKeyStroke.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,653 ---- + /* AWTKeyStroke.java -- an immutable key stroke + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.event.KeyEvent; + import java.io.ObjectStreamException; + import java.io.Serializable; + import java.lang.reflect.Constructor; + import java.lang.reflect.Field; + import java.lang.reflect.InvocationTargetException; + import java.security.AccessController; + import java.security.PrivilegedAction; + import java.security.PrivilegedActionException; + import java.security.PrivilegedExceptionAction; + import java.util.Map; + import java.util.HashMap; + import java.util.LinkedHashMap; + import java.util.StringTokenizer; + + /** + * This class mirrors KeyEvents, representing both low-level key presses and + * key releases, and high level key typed inputs. However, this class forms + * immutable strokes, and can be efficiently reused via the factory methods + * for creating them. + * + *

    For backwards compatibility with Swing, this supports a way to build + * instances of a subclass, using reflection, provided the subclass has a + * no-arg constructor (of any accessibility). + * + * @author Eric Blake + * @see #getAWTKeyStroke(char) + * @since 1.4 + * @status updated to 1.4 + */ + public class AWTKeyStroke implements Serializable + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -6430539691155161871L; + + /** The mask for modifiers. */ + private static final int MODIFIERS_MASK = 0x3fef; + + /** + * The cache of recently created keystrokes. This maps KeyStrokes to + * KeyStrokes in a cache which removes the least recently accessed entry, + * under the assumption that garbage collection of a new keystroke is + * easy when we find the old one that it matches in the cache. + */ + private static final LinkedHashMap cache = new LinkedHashMap(11, 0.75f, true) + { + /** The largest the keystroke cache can grow. */ + private static final int MAX_CACHE_SIZE = 2048; + + /** Prune stale entries. */ + protected boolean removeEldestEntry(Map.Entry eldest) + { // XXX - FIXME Use Map.Entry, not just Entry as gcj 3.1 workaround. + return size() > MAX_CACHE_SIZE; + } + }; + + /** The most recently generated keystroke, or null. */ + private static AWTKeyStroke recent; + + /** + * The no-arg constructor of a subclass, or null to use AWTKeyStroke. Note + * that this will be left accessible, to get around private access; but + * it should not be a security risk as it is highly unlikely that creating + * protected instances of the subclass via reflection will do much damage. + */ + private static Constructor ctor; + + /** + * A table of keyCode names to values. + * + * @see #getAWTKeyStroke(String) + */ + private static final HashMap vktable = new HashMap(); + static + { + // Using reflection saves the hassle of keeping this in sync with KeyEvent, + // at the price of an expensive initialization. + AccessController.doPrivileged(new PrivilegedAction() + { + public Object run() + { + Field[] fields = KeyEvent.class.getFields(); + int i = fields.length; + try + { + while (--i >= 0) + { + Field f = fields[i]; + String name = f.getName(); + if (name.startsWith("VK_")) + vktable.put(name.substring(3), f.get(null)); + } + } + catch (Exception e) + { + throw (Error) new InternalError().initCause(e); + } + return null; + } + }); + } + + /** + * The typed character, or CHAR_UNDEFINED for key presses and releases. + * + * @serial the keyChar + */ + private char keyChar; + + /** + * The virtual key code, or VK_UNDEFINED for key typed. Package visible for + * use by Component. + * + * @serial the keyCode + */ + int keyCode; + + /** + * The modifiers in effect. To match Sun, this stores the old style masks + * for shift, control, alt, meta, and alt-graph (but not button1); as well + * as the new style of extended modifiers for all modifiers. + * + * @serial bitwise or of the *_DOWN_MASK modifiers + */ + private int modifiers; + + /** + * True if this is a key release; should only be true if keyChar is + * CHAR_UNDEFINED. + * + * @serial true to distinguish key pressed from key released + */ + private boolean onKeyRelease; + + /** + * Construct a keystroke with default values: it will be interpreted as a + * key typed event with an invalid character and no modifiers. Client code + * should use the factory methods instead. + * + * @see #getAWTKeyStroke(char) + * @see #getAWTKeyStroke(Character, int) + * @see #getAWTKeyStroke(int, int, boolean) + * @see #getAWTKeyStroke(int, int) + * @see #getAWTKeyStrokeForEvent(KeyEvent) + * @see #getAWTKeyStroke(String) + */ + protected AWTKeyStroke() + { + keyChar = KeyEvent.CHAR_UNDEFINED; + } + + /** + * Construct a keystroke with the given values. Client code should use the + * factory methods instead. + * + * @param keyChar the character entered, if this is a key typed + * @param keyCode the key pressed or released, or VK_UNDEFINED for key typed + * @param modifiers the modifier keys for the keystroke, in old or new style + * @param onKeyRelease true if this is a key release instead of a press + * @see #getAWTKeyStroke(char) + * @see #getAWTKeyStroke(Character, int) + * @see #getAWTKeyStroke(int, int, boolean) + * @see #getAWTKeyStroke(int, int) + * @see #getAWTKeyStrokeForEvent(KeyEvent) + * @see #getAWTKeyStroke(String) + */ + protected AWTKeyStroke(char keyChar, int keyCode, int modifiers, + boolean onKeyRelease) + { + this.keyChar = keyChar; + this.keyCode = keyCode; + // No need to call extend(), as only trusted code calls this constructor. + this.modifiers = modifiers; + this.onKeyRelease = onKeyRelease; + } + + /** + * Registers a new subclass as being the type of keystrokes to generate in + * the factory methods. This operation flushes the cache of stored keystrokes + * if the class differs from the current one. The new class must be + * AWTKeyStroke or a subclass, and must have a no-arg constructor (which may + * be private). + * + * @param subclass the new runtime type of generated keystrokes + * @throws IllegalArgumentException subclass doesn't have no-arg constructor + * @throws ClassCastException subclass doesn't extend AWTKeyStroke + */ + protected static void registerSubclass(final Class subclass) + { + if (subclass == null) + throw new IllegalArgumentException(); + if (subclass.equals(ctor == null ? AWTKeyStroke.class + : ctor.getDeclaringClass())) + return; + if (subclass.equals(AWTKeyStroke.class)) + { + cache.clear(); + recent = null; + ctor = null; + return; + } + try + { + ctor = (Constructor) AccessController.doPrivileged + (new PrivilegedExceptionAction() + { + public Object run() + throws NoSuchMethodException, InstantiationException, + IllegalAccessException, InvocationTargetException + { + Constructor c = subclass.getDeclaredConstructor(null); + c.setAccessible(true); + // Create a new instance, to make sure that we can, and + // to cause any ClassCastException. + AWTKeyStroke dummy = (AWTKeyStroke) c.newInstance(null); + return c; + } + }); + } + catch (PrivilegedActionException e) + { + // e.getCause() will not ever be ClassCastException; that should + // escape on its own. + throw (RuntimeException) + new IllegalArgumentException().initCause(e.getCause()); + } + cache.clear(); + recent = null; + } + + /** + * Returns a keystroke representing a typed character. + * + * @param keyChar the typed character + * @return the specified keystroke + */ + public static AWTKeyStroke getAWTKeyStroke(char keyChar) + { + return getAWTKeyStroke(keyChar, KeyEvent.VK_UNDEFINED, 0, false); + } + + /** + * Returns a keystroke representing a typed character with the given + * modifiers. Note that keyChar is a Character instead of a + * char to avoid accidental ambiguity with + * getAWTKeyStroke(int, int). The modifiers are the bitwise + * or of the masks found in {@link InputEvent}; the new style (*_DOWN_MASK) + * is preferred, but the old style will work. + * + * @param keyChar the typed character + * @param modifiers the modifiers, or 0 + * @return the specified keystroke + * @throws IllegalArgumentException if keyChar is null + */ + public static AWTKeyStroke getAWTKeyStroke(Character keyChar, int modifiers) + { + if (keyChar == null) + throw new IllegalArgumentException(); + return getAWTKeyStroke(keyChar.charValue(), KeyEvent.VK_UNDEFINED, + extend(modifiers), false); + } + + /** + * Returns a keystroke representing a pressed or released key event, with + * the given modifiers. The "virtual key" should be one of the VK_* + * constants in {@link KeyEvent}. The modifiers are the bitwise or of the + * masks found in {@link InputEvent}; the new style (*_DOWN_MASK) is + * preferred, but the old style will work. + * + * @param keyCode the virtual key + * @param modifiers the modifiers, or 0 + * @param release true if this is a key release instead of a key press + * @return the specified keystroke + */ + public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers, + boolean release) + { + return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, keyCode, + extend(modifiers), release); + } + + /** + * Returns a keystroke representing a pressed key event, with the given + * modifiers. The "virtual key" should be one of the VK_* constants in + * {@link KeyEvent}. The modifiers are the bitwise or of the masks found + * in {@link InputEvent}; the new style (*_DOWN_MASK) is preferred, but the + * old style will work. + * + * @param keyCode the virtual key + * @param modifiers the modifiers, or 0 + * @return the specified keystroke + */ + public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers) + { + return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, keyCode, + extend(modifiers), false); + } + + /** + * Returns a keystroke representing what caused the key event. + * + * @param event the key event to convert + * @return the specified keystroke, or null if the event is invalid + * @throws NullPointerException if event is null + */ + public static AWTKeyStroke getAWTKeyStrokeForEvent(KeyEvent event) + { + switch (event.id) + { + case KeyEvent.KEY_TYPED: + return getAWTKeyStroke(event.getKeyChar(), KeyEvent.VK_UNDEFINED, + extend(event.getModifiersEx()), false); + case KeyEvent.KEY_PRESSED: + return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, event.getKeyCode(), + extend(event.getModifiersEx()), false); + case KeyEvent.KEY_RELEASED: + return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, event.getKeyCode(), + extend(event.getModifiersEx()), true); + default: + return null; + } + } + + /** + * Parses a string and returns the keystroke that it represents. The syntax + * for keystrokes is listed below, with tokens separated by an arbitrary + * number of spaces: + *

    +    * keyStroke := <modifiers>* ( <typedID> | <codeID> )
    +    * modifiers := ( shift | control | ctrl | meta | alt
    +    *                | button1 | button2 | button3 )
    +    * typedID := typed <single Unicode character>
    +    * codeID := ( pressed | released )? <name>
    +    * name := <the KeyEvent field name less the leading "VK_">
    +    * 
    + * + *

    Note that the grammar is rather weak, and not all valid keystrokes + * can be generated in this manner (for example, a typed space, or anything + * with the alt-graph modifier!). The output of AWTKeyStroke.toString() + * will not meet the grammar. If pressed or released is not specified, + * pressed is assumed. Examples:
    + * + * "INSERT" => getAWTKeyStroke(KeyEvent.VK_INSERT, 0);
    + * "control DELETE" => + * getAWTKeyStroke(KeyEvent.VK_DELETE, InputEvent.CTRL_MASK);
    + * "alt shift X" => getAWTKeyStroke(KeyEvent.VK_X, + * InputEvent.ALT_MASK | InputEvent.SHIFT_MASK);
    + * "alt shift released X" => getAWTKeyStroke(KeyEvent.VK_X, + * InputEvent.ALT_MASK | InputEvent.SHIFT_MASK, true);
    + * "typed a" => getAWTKeyStroke('a'); + *
    + * + * @param s the string to parse + * @return the specified keystroke + * @throws NullPointerException if s is null + * @throws IllegalArgumentException if s cannot be parsed + */ + public static AWTKeyStroke getAWTKeyStroke(String s) + { + StringTokenizer t = new StringTokenizer(s, " "); + if (! t.hasMoreTokens()) + throw new IllegalArgumentException(); + int modifiers = 0; + boolean released = false; + String token = null; + do + { + token = t.nextToken(); + if ("shift".equals(token)) + modifiers |= KeyEvent.SHIFT_MASK | KeyEvent.SHIFT_DOWN_MASK; + else if ("ctrl".equals(token) || "control".equals(token)) + modifiers |= KeyEvent.CTRL_MASK | KeyEvent.CTRL_DOWN_MASK; + else if ("meta".equals(token)) + modifiers |= KeyEvent.META_MASK | KeyEvent.META_DOWN_MASK; + else if ("alt".equals(token)) + modifiers |= KeyEvent.ALT_MASK | KeyEvent.ALT_DOWN_MASK; + else if ("button1".equals(token)) + modifiers |= KeyEvent.BUTTON1_DOWN_MASK; + else if ("button2".equals(token)) + modifiers |= KeyEvent.BUTTON2_DOWN_MASK; + else if ("button3".equals(token)) + modifiers |= KeyEvent.BUTTON3_DOWN_MASK; + else if ("typed".equals(token)) + { + if (t.hasMoreTokens()) + { + token = t.nextToken(); + if (! t.hasMoreTokens() && token.length() == 1) + return getAWTKeyStroke(token.charAt(0), + KeyEvent.VK_UNDEFINED, modifiers, + false); + } + throw new IllegalArgumentException(); + } + else if ("pressed".equals(token)) + { + if (t.hasMoreTokens()) + token = t.nextToken(); + break; + } + else if ("released".equals(token)) + { + released = true; + if (t.hasMoreTokens()) + token = t.nextToken(); + break; + } + else + break; + } + while (t.hasMoreTokens()); + // Now token contains the VK name we must parse. + Integer code = (Integer) vktable.get(token); + if (code == null || t.hasMoreTokens()) + throw new IllegalArgumentException(); + return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, code.intValue(), + modifiers, released); + } + + /** + * Returns the character of this keystroke, if it was typed. + * + * @return the character value, or CHAR_UNDEFINED + * @see #getAWTKeyStroke(char) + */ + public final char getKeyChar() + { + return keyChar; + } + + /** + * Returns the virtual key code of this keystroke, if it was pressed or + * released. This will be a VK_* constant from KeyEvent. + * + * @return the virtual key code value, or VK_UNDEFINED + * @see #getAWTKeyStroke(int, int) + */ + public final int getKeyCode() + { + return keyCode; + } + + /** + * Returns the modifiers for this keystroke. This will be a bitwise or of + * constants from InputEvent; it includes the old style masks for shift, + * control, alt, meta, and alt-graph (but not button1); as well as the new + * style of extended modifiers for all modifiers. + * + * @return the modifiers + * @see #getAWTKeyStroke(Character, int) + * @see #getAWTKeyStroke(int, int) + */ + public final int getModifiers() + { + return modifiers; + } + + /** + * Tests if this keystroke is a key release. + * + * @return true if this is a key release + * @see #getAWTKeyStroke(int, int, boolean) + */ + public final boolean isOnKeyRelease() + { + return onKeyRelease; + } + + /** + * Returns the AWT event type of this keystroke. This is one of + * {@link KeyEvent#KEY_TYPED}, {@link KeyEvent#KEY_PRESSED}, or + * {@link KeyEvent#KEY_RELEASED}. + * + * @return the key event type + */ + public final int getKeyEventType() + { + return keyCode == KeyEvent.VK_UNDEFINED ? KeyEvent.KEY_TYPED + : onKeyRelease ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED; + } + + /** + * Returns a hashcode for this key event. It is not documented, but appears + * to be: (getKeyChar() + 1) * (getKeyCode() + 1) + * * (getModifiers() + 1) * 2 + (isOnKeyRelease() ? 1 : 2). + * + * @return the hashcode + */ + public int hashCode() + { + return (keyChar + 1) * (keyCode + 1) * (modifiers + 1) * 2 + + (onKeyRelease ? 1 : 2); + } + + /** + * Tests two keystrokes for equality. + * + * @param o the object to test + * @return true if it is equal + */ + public final boolean equals(Object o) + { + if (! (o instanceof AWTKeyStroke)) + return false; + AWTKeyStroke s = (AWTKeyStroke) o; + return this == o || (keyChar == s.keyChar && keyCode == s.keyCode + && modifiers == s.modifiers + && onKeyRelease == s.onKeyRelease); + } + + /** + * Returns a string representation of this keystroke. For typed keystrokes, + * this is "keyChar " + KeyEvent.getKeyModifiersText(getModifiers()) + + getKeyChar(); for pressed and released keystrokes, this is + * "keyCode " + KeyEvent.getKeyModifiersText(getModifiers()) + * + KeyEvent.getKeyText(getKeyCode()) + * + (isOnKeyRelease() ? "-R" : "-P"). + * + * @return a string representation + */ + public String toString() + { + if (keyCode == KeyEvent.VK_UNDEFINED) + return "keyChar " + KeyEvent.getKeyModifiersText(modifiers) + keyChar; + return "keyCode " + KeyEvent.getKeyModifiersText(modifiers) + + KeyEvent.getKeyText(keyCode) + (onKeyRelease ? "-R" : "-P"); + } + + /** + * Returns a cached version of the deserialized keystroke, if available. + * + * @return a cached replacement + * @throws ObjectStreamException if something goes wrong + */ + protected Object readResolve() throws ObjectStreamException + { + AWTKeyStroke s = (AWTKeyStroke) cache.get(this); + if (s != null) + return s; + cache.put(this, this); + return this; + } + + /** + * Gets the appropriate keystroke, creating one if necessary. + * + * @param keyChar the keyChar + * @param keyCode the keyCode + * @param modifiers the modifiers + * @param release true for key release + * @return the specified keystroke + */ + private static AWTKeyStroke getAWTKeyStroke(char keyChar, int keyCode, + int modifiers, boolean release) + { + // Check level 0 cache. + AWTKeyStroke stroke = recent; // Avoid thread races. + if (stroke != null && stroke.keyChar == keyChar + && stroke.keyCode == keyCode && stroke.modifiers == modifiers + && stroke.onKeyRelease == release) + return stroke; + // Create a new object, on the assumption that if it has a match in the + // cache, the VM can easily garbage collect it as it is temporary. + Constructor c = ctor; // Avoid thread races. + if (c == null) + stroke = new AWTKeyStroke(keyChar, keyCode, modifiers, release); + else + try + { + stroke = (AWTKeyStroke) c.newInstance(null); + stroke.keyChar = keyChar; + stroke.keyCode = keyCode; + stroke.modifiers = modifiers; + stroke.onKeyRelease = release; + } + catch (Exception e) + { + throw (Error) new InternalError().initCause(e); + } + // Check level 1 cache. + AWTKeyStroke cached = (AWTKeyStroke) cache.get(stroke); + if (cached == null) + cache.put(stroke, stroke); + else + stroke = cached; + return recent = stroke; + } + + /** + * Converts the modifiers to the appropriate format. + * + * @param mod the modifiers to convert + * @return the adjusted modifiers + */ + private static int extend(int mod) + { + if ((mod & (KeyEvent.SHIFT_MASK | KeyEvent.SHIFT_DOWN_MASK)) != 0) + mod |= KeyEvent.SHIFT_MASK | KeyEvent.SHIFT_DOWN_MASK; + if ((mod & (KeyEvent.CTRL_MASK | KeyEvent.CTRL_DOWN_MASK)) != 0) + mod |= KeyEvent.CTRL_MASK | KeyEvent.CTRL_DOWN_MASK; + if ((mod & (KeyEvent.META_MASK | KeyEvent.META_DOWN_MASK)) != 0) + mod |= KeyEvent.META_MASK | KeyEvent.META_DOWN_MASK; + if ((mod & (KeyEvent.ALT_MASK | KeyEvent.ALT_DOWN_MASK)) != 0) + mod |= KeyEvent.ALT_MASK | KeyEvent.ALT_DOWN_MASK; + if ((mod & (KeyEvent.ALT_GRAPH_MASK | KeyEvent.ALT_GRAPH_DOWN_MASK)) != 0) + mod |= KeyEvent.ALT_GRAPH_MASK | KeyEvent.ALT_GRAPH_DOWN_MASK; + if ((mod & KeyEvent.BUTTON1_MASK) != 0) + mod |= KeyEvent.BUTTON1_DOWN_MASK; + return mod & MODIFIERS_MASK; + } + } // class AWTKeyStroke diff -Nrc3pad gcc-3.2.3/libjava/java/awt/AWTPermission.java gcc-3.3/libjava/java/awt/AWTPermission.java *** gcc-3.2.3/libjava/java/awt/AWTPermission.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/AWTPermission.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,6 **** ! // AWTPermission.java - AWT permissions ! ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* AWTPermission.java -- AWT related permissions ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** obligated to do so. If you do not wish *** 37,47 **** exception statement from your version. */ - /** - * @author Tom Tromey - * @date December 2, 2000 - */ - package java.awt; import java.security.BasicPermission; --- 36,41 ---- *************** import java.security.BasicPermission; *** 49,73 **** /** * This class implements permissions for AWT. This is a named * permission. No actions are defined. */ public final class AWTPermission extends BasicPermission { /** * Construct a AWTPermission with the given name. ! * @param name The permission name */ ! public AWTPermission (String name) { ! super (name); } /** ! * Construct a AWTPermission with the given name. ! * @param name The permission name ! * @param actions The actions; this is ignored and should be null. */ ! public AWTPermission (String name, String actions) { ! super (name, actions); } ! } --- 43,121 ---- /** * This class implements permissions for AWT. This is a named * permission. No actions are defined. + * + *

    The following table provides a list of all the possible AWTPermission + * permission names with a description of what that permission allows.
    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Permission NamePermission AllowsRisks + *
    accessClipboardposting and reading the AWT clipboardthe clipboard may contain sensitive data
    accessEventQueueaccess to the AWT event queuemalicious code could remove real events and replace them with bogus + * ones, including simulating the user granting permission
    listenToAllAWTEventslisten to system-wide AWT eventsmalicious code can read passwords entered in an AWT event, and in + * combination with accessEventQueue, could fake system events
    showWindowWithoutWarningBannerdisplay a window without a banner notification of insecuritymalicious code could install a Trojan horse applet that looks like + * a normal window, and thus steal data like passwords
    readDisplayPixelsread back pixels from the display screenmalicious code could snoop on the user's actions
    createRobotcreate an instance of java.awt.Robotthese objects can generate events as though they were the user; so + * malicious code could control the system
    fullScreenExclusiveenter full-screen exclusive modemalicious code could masquerade as a trusted program
    + * + * @author Tom Tromey + * @since 1.2 + * @status updated to 1.4 */ public final class AWTPermission extends BasicPermission { /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 8890392402588814465L; + + /** * Construct a AWTPermission with the given name. ! * ! * @param name the permission name ! * @throws NullPointerException if name is null ! * @throws IllegalArgumentException if name is invalid */ ! public AWTPermission(String name) { ! super(name); } /** ! * Create a new permission with the specified name. The actions argument ! * is ignored, as AWT permissions have no actions. ! * ! * @param name the permission name ! * @param actions ignored ! * @throws NullPointerException if name is null ! * @throws IllegalArgumentException if name is invalid */ ! public AWTPermission(String name, String actions) { ! super(name); } ! } // class AWTPermission diff -Nrc3pad gcc-3.2.3/libjava/java/awt/BasicStroke.java gcc-3.3/libjava/java/awt/BasicStroke.java *** gcc-3.2.3/libjava/java/awt/BasicStroke.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/BasicStroke.java 2003-01-02 00:14:03.000000000 +0000 *************** *** 0 **** --- 1,196 ---- + /* BasicStroke.java -- + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.util.Arrays; + + /** + * STUB CLASS ONLY + */ + public class BasicStroke implements Stroke + { + public static final int JOIN_MITER = 0; + public static final int JOIN_ROUND = 1; + public static final int JOIN_BEVEL = 2; + public static final int CAP_BUTT = 0; + public static final int CAP_ROUND = 1; + public static final int CAP_SQUARE = 2; + + private final float width; + private final int cap; + private final int join; + private final float limit; + private final float[] dash; + private final float phase; + + /** + * Creates a basic stroke. + * + * @param width May not be negative . + * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE. + * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER. + * @param miterlimit the limit to trim the miter join. The miterlimit must be + * greater than or equal to 1.0f. + * @param dash The array representing the dashing pattern. + * @param dash_phase is negative and dash is not null. + * + * @exception IllegalArgumentException If one input parameter doesn't meet + * its needs. + */ + public BasicStroke(float width, int cap, int join, float miterlimit, + float[] dash, float dashPhase) + { + if (width < 0 || + miterlimit < 1.0f || + cap < CAP_BUTT || + cap > CAP_SQUARE || + join < JOIN_MITER || + join > JOIN_BEVEL) + throw new IllegalArgumentException(); + + this.width = width; + this.cap = cap; + this.join = join; + limit = miterlimit; + this.dash = dash == null ? null : (float[]) dash.clone(); + phase = dashPhase; + } + + /** + * Creates a basic stroke. + * + * @param width The width of the BasicStroke. May not be negative . + * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE. + * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER. + * @param miterlimit the limit to trim the miter join. The miterlimit must be + * greater than or equal to 1.0f. + * + * @exception IllegalArgumentException If one input parameter doesn't meet + * its needs. + */ + public BasicStroke(float width, int cap, int join, float miterlimit) + { + this(width, cap, join, miterlimit, null, 0); + } + + /** + * Creates a basic stroke. + * + * @param width The width of the BasicStroke. May not be nehative. + * @param cap May be either CAP_BUTT, CAP_ROUND or CAP_SQUARE. + * @param join May be either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER. + * + * @exception IllegalArgumentException If one input parameter doesn't meet + * its needs. + * @exception IllegalArgumentException FIXME + */ + public BasicStroke(float width, int cap, int join) + { + this(width, cap, join, 10, null, 0); + } + + /** + * Creates a basic stroke. + * + * @param width The width of the BasicStroke. + * + * @exception IllegalArgumentException If width is negative. + */ + public BasicStroke(float width) + { + this(width, CAP_SQUARE, JOIN_MITER, 10, null, 0); + } + + /** + * Creates a basic stroke. + */ + public BasicStroke() + { + this(1, CAP_SQUARE, JOIN_MITER, 10, null, 0); + } + + public Shape createStrokedShape(Shape s) + { + throw new Error("not implemented"); + } + + public float getLineWidth() + { + return width; + } + + public int getEndCap() + { + return cap; + } + + public int getLineJoin() + { + return join; + } + + public float getMiterLimit() + { + return limit; + } + + public float[] getDashArray() + { + return dash; + } + + public float getDashPhase() + { + return phase; + } + + public int hashCode() + { + throw new Error("not implemented"); + } + + public boolean equals(Object o) + { + if (! (o instanceof BasicStroke)) + return false; + BasicStroke s = (BasicStroke) o; + return width == s.width && cap == s.cap && join == s.join + && limit == s.limit && Arrays.equals(dash, s.dash) && phase == s.phase; + } + } // class BasicStroke diff -Nrc3pad gcc-3.2.3/libjava/java/awt/BorderLayout.java gcc-3.3/libjava/java/awt/BorderLayout.java *** gcc-3.2.3/libjava/java/awt/BorderLayout.java 2002-01-24 06:39:29.000000000 +0000 --- gcc-3.3/libjava/java/awt/BorderLayout.java 2002-11-10 23:11:21.000000000 +0000 *************** public static final String WEST = "West" *** 77,103 **** */ public static final String CENTER = "Center"; - /** - * Constant indicating the position just after the last line of the - * layout. - */ - public static final String AFTER_LAST_LINE = "Last"; ! /** ! * Constant indicating the position just after the end of the line. ! */ ! public static final String AFTER_LINE_ENDS = "After"; - /** - * Constant indicating the position just before the first line of the - * layout. - */ - public static final String BEFORE_FIRST_LINE = "First"; - /** - * Constant indicating the position at the beginning of the line. - */ - public static final String BEFORE_LINE_BEGINS = "Before"; // Serialization constant private static final long serialVersionUID = -8658291919501921765L; --- 77,183 ---- */ public static final String CENTER = "Center"; ! /** ! * The constant indicating the position before the first line of the ! * layout. The exact position depends on the writing system: For a ! * top-to-bottom orientation, it is the same as {@link #NORTH}, for ! * a bottom-to-top orientation, it is the same as {@link #SOUTH}. ! * ! *

    This constant is an older name for {@link #PAGE_START} which ! * has exactly the same value. ! * ! * @since 1.2 ! */ ! public static final String BEFORE_FIRST_LINE = "First"; ! ! ! /** ! * The constant indicating the position after the last line of the ! * layout. The exact position depends on the writing system: For a ! * top-to-bottom orientation, it is the same as {@link #SOUTH}, for ! * a bottom-to-top orientation, it is the same as {@link #NORTH}. ! * ! *

    This constant is an older name for {@link #PAGE_END} which ! * has exactly the same value. ! * ! * @since 1.2 ! */ ! public static final String AFTER_LAST_LINE = "Last"; ! ! ! /** ! * The constant indicating the position before the first item of the ! * layout. The exact position depends on the writing system: For a ! * left-to-right orientation, it is the same as {@link #WEST}, for ! * a right-to-left orientation, it is the same as {@link #EAST}. ! * ! *

    This constant is an older name for {@link #LINE_START} which ! * has exactly the same value. ! * ! * @since 1.2 ! */ ! public static final String BEFORE_LINE_BEGINS = "Before"; ! ! ! /** ! * The constant indicating the position after the last item of the ! * layout. The exact position depends on the writing system: For a ! * left-to-right orientation, it is the same as {@link #EAST}, for ! * a right-to-left orientation, it is the same as {@link #WEST}. ! * ! *

    This constant is an older name for {@link #LINE_END} which ! * has exactly the same value. ! * ! * @since 1.2 ! */ ! public static final String AFTER_LINE_ENDS = "After"; ! ! ! /** ! * The constant indicating the position before the first line of the ! * layout. The exact position depends on the writing system: For a ! * top-to-bottom orientation, it is the same as {@link #NORTH}, for ! * a bottom-to-top orientation, it is the same as {@link #SOUTH}. ! * ! * @since 1.4 ! */ ! public static final String PAGE_START = BEFORE_FIRST_LINE; ! ! ! /** ! * The constant indicating the position after the last line of the ! * layout. The exact position depends on the writing system: For a ! * top-to-bottom orientation, it is the same as {@link #SOUTH}, for ! * a bottom-to-top orientation, it is the same as {@link #NORTH}. ! * ! * @since 1.4 ! */ ! public static final String PAGE_END = AFTER_LAST_LINE; ! ! ! /** ! * The constant indicating the position before the first item of the ! * layout. The exact position depends on the writing system: For a ! * left-to-right orientation, it is the same as {@link #WEST}, for ! * a right-to-left orientation, it is the same as {@link #EAST}. ! * ! * @since 1.4 ! */ ! public static final String LINE_START = BEFORE_LINE_BEGINS; ! ! ! /** ! * The constant indicating the position after the last item of the ! * layout. The exact position depends on the writing system: For a ! * left-to-right orientation, it is the same as {@link #EAST}, for ! * a right-to-left orientation, it is the same as {@link #WEST}. ! * ! * @since 1.4 ! */ ! public static final String LINE_END = AFTER_LINE_ENDS; // Serialization constant private static final long serialVersionUID = -8658291919501921765L; *************** invalidateLayout(Container parent) *** 449,528 **** public void layoutContainer(Container target) { ! Insets i = target.getInsets(); ! ComponentOrientation orient = target.getComponentOrientation (); ! boolean left_to_right = orient.isLeftToRight (); ! Component my_north = north; ! Component my_east = east; ! Component my_south = south; ! Component my_west = west; ! // Note that we currently don't handle vertical layouts. Neither ! // does JDK 1.3. ! if (firstLine != null) ! my_north = firstLine; ! if (lastLine != null) ! my_south = lastLine; ! if (firstItem != null) ! { ! if (left_to_right) ! my_west = firstItem; ! else ! my_east = firstItem; ! } ! if (lastItem != null) ! { ! if (left_to_right) ! my_east = lastItem; ! else ! my_west = lastItem; ! } ! Dimension c = calcCompSize(center, PREF); ! Dimension n = calcCompSize(my_north, PREF); ! Dimension s = calcCompSize(my_south, PREF); ! Dimension e = calcCompSize(my_east, PREF); ! Dimension w = calcCompSize(my_west, PREF); ! Dimension t = target.getSize(); ! /* ! <-> hgap <-> hgap ! +----------------------------+ } ! |t | } i.top ! | +----------------------+ | --- y1 } ! | |n | | ! | +----------------------+ | } vgap ! | +---+ +----------+ +---+ | --- y2 } } ! | |w | |c | |e | | } hh ! | +---+ +----------+ +---+ | } vgap } ! | +----------------------+ | --- y3 } ! | |s | | ! | +----------------------+ | } ! | | } i.bottom ! +----------------------------+ } ! |x1 |x2 |x3 ! <----------------------> ! <--> ww <--> ! i.left i.right ! */ ! int x1 = i.left; ! int x2 = x1 + w.width + hgap; ! int x3 = t.width - i.right - e.width; ! int ww = t.width - i.right - i.left; ! int y1 = i.top; ! int y2 = y1 + n.height + vgap; ! int y3 = t.height - i.bottom - s.height; ! int hh = y3-y2-vgap; ! setBounds(center, x2, y2, x3-x2-hgap, hh); ! setBounds(my_north, x1, y1, ww, n.height); ! setBounds(my_south, x1, y3, ww, s.height); ! setBounds(my_west, x1, y2, w.width, hh); ! setBounds(my_east, x3, y2, e.width, hh); } /*************************************************************************/ --- 529,611 ---- public void layoutContainer(Container target) { ! synchronized (target.getTreeLock ()) ! { ! Insets i = target.getInsets(); ! ComponentOrientation orient = target.getComponentOrientation (); ! boolean left_to_right = orient.isLeftToRight (); ! Component my_north = north; ! Component my_east = east; ! Component my_south = south; ! Component my_west = west; ! // Note that we currently don't handle vertical layouts. Neither ! // does JDK 1.3. ! if (firstLine != null) ! my_north = firstLine; ! if (lastLine != null) ! my_south = lastLine; ! if (firstItem != null) ! { ! if (left_to_right) ! my_west = firstItem; ! else ! my_east = firstItem; ! } ! if (lastItem != null) ! { ! if (left_to_right) ! my_east = lastItem; ! else ! my_west = lastItem; ! } ! Dimension c = calcCompSize(center, PREF); ! Dimension n = calcCompSize(my_north, PREF); ! Dimension s = calcCompSize(my_south, PREF); ! Dimension e = calcCompSize(my_east, PREF); ! Dimension w = calcCompSize(my_west, PREF); ! Dimension t = target.getSize(); ! /* ! <-> hgap <-> hgap ! +----------------------------+ } ! |t | } i.top ! | +----------------------+ | --- y1 } ! | |n | | ! | +----------------------+ | } vgap ! | +---+ +----------+ +---+ | --- y2 } } ! | |w | |c | |e | | } hh ! | +---+ +----------+ +---+ | } vgap } ! | +----------------------+ | --- y3 } ! | |s | | ! | +----------------------+ | } ! | | } i.bottom ! +----------------------------+ } ! |x1 |x2 |x3 ! <----------------------> ! <--> ww <--> ! i.left i.right ! */ ! int x1 = i.left; ! int x2 = x1 + w.width + hgap; ! int x3 = t.width - i.right - e.width; ! int ww = t.width - i.right - i.left; ! int y1 = i.top; ! int y2 = y1 + n.height + vgap; ! int y3 = t.height - i.bottom - s.height; ! int hh = y3-y2-vgap; ! setBounds(center, x2, y2, x3-x2-hgap, hh); ! setBounds(my_north, x1, y1, ww, n.height); ! setBounds(my_south, x1, y3, ww, s.height); ! setBounds(my_west, x1, y2, w.width, hh); ! setBounds(my_east, x3, y2, e.width, hh); ! } } /*************************************************************************/ *************** calcCompSize(Component comp, int what) *** 568,626 **** private Dimension calcSize(Container target, int what) { ! Insets ins = target.getInsets(); ! ComponentOrientation orient = target.getComponentOrientation (); ! boolean left_to_right = orient.isLeftToRight (); ! Component my_north = north; ! Component my_east = east; ! Component my_south = south; ! Component my_west = west; ! // Note that we currently don't handle vertical layouts. Neither ! // does JDK 1.3. ! if (firstLine != null) ! my_north = firstLine; ! if (lastLine != null) ! my_south = lastLine; ! if (firstItem != null) ! { ! if (left_to_right) ! my_west = firstItem; ! else ! my_east = firstItem; ! } ! if (lastItem != null) ! { ! if (left_to_right) ! my_east = lastItem; ! else ! my_west = lastItem; ! } ! Dimension ndim = calcCompSize(my_north, what); ! Dimension sdim = calcCompSize(my_south, what); ! Dimension edim = calcCompSize(my_east, what); ! Dimension wdim = calcCompSize(my_west, what); ! Dimension cdim = calcCompSize(center, what); ! int width = edim.width + cdim.width + wdim.width + (hgap * 2); ! if (ndim.width > width) ! width = ndim.width; ! if (sdim.width > width) ! width = sdim.width; ! width += (ins.left + ins.right); ! int height = edim.height; ! if (cdim.height > height) ! height = cdim.height; ! if (wdim.height > height) ! height = wdim.height; ! height += (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); ! return(new Dimension(width, height)); } } // class BorderLayout --- 651,712 ---- private Dimension calcSize(Container target, int what) { ! synchronized (target.getTreeLock ()) ! { ! Insets ins = target.getInsets(); ! ComponentOrientation orient = target.getComponentOrientation (); ! boolean left_to_right = orient.isLeftToRight (); ! Component my_north = north; ! Component my_east = east; ! Component my_south = south; ! Component my_west = west; ! // Note that we currently don't handle vertical layouts. Neither ! // does JDK 1.3. ! if (firstLine != null) ! my_north = firstLine; ! if (lastLine != null) ! my_south = lastLine; ! if (firstItem != null) ! { ! if (left_to_right) ! my_west = firstItem; ! else ! my_east = firstItem; ! } ! if (lastItem != null) ! { ! if (left_to_right) ! my_east = lastItem; ! else ! my_west = lastItem; ! } ! Dimension ndim = calcCompSize(my_north, what); ! Dimension sdim = calcCompSize(my_south, what); ! Dimension edim = calcCompSize(my_east, what); ! Dimension wdim = calcCompSize(my_west, what); ! Dimension cdim = calcCompSize(center, what); ! int width = edim.width + cdim.width + wdim.width + (hgap * 2); ! if (ndim.width > width) ! width = ndim.width; ! if (sdim.width > width) ! width = sdim.width; ! width += (ins.left + ins.right); ! int height = edim.height; ! if (cdim.height > height) ! height = cdim.height; ! if (wdim.height > height) ! height = wdim.height; ! height += (ndim.height + sdim.height + (vgap * 2) + ins.top + ins.bottom); ! return(new Dimension(width, height)); ! } } } // class BorderLayout diff -Nrc3pad gcc-3.2.3/libjava/java/awt/BufferCapabilities.java gcc-3.3/libjava/java/awt/BufferCapabilities.java *** gcc-3.2.3/libjava/java/awt/BufferCapabilities.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/BufferCapabilities.java 2003-01-02 00:14:03.000000000 +0000 *************** *** 0 **** --- 1,126 ---- + /* BufferCapabilities.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * Needs documentation... + * + * @author Eric Blake + * @see BufferStrategy#getCapabilities() + * @see GraphicsConfiguration#getCapabilities() + * @since 1.4 + * @status updated to 1.4, lacks documentation + */ + public class BufferCapabilities implements Cloneable + { + public static final class FlipContents extends AttributeValue + { + private static final String[] NAMES + = { "undefined", "background", "prior", "copied" }; + public static final FlipContents UNDEFINED = new FlipContents(0); + public static final FlipContents BACKGROUND = new FlipContents(1); + public static final FlipContents PRIOR = new FlipContents(2); + public static final FlipContents COPIED = new FlipContents(3); + private FlipContents(int value) + { + super(value, NAMES); + } + } // class FlipContents + + private final ImageCapabilities front; + private final ImageCapabilities back; + private final FlipContents flip; + + /** + * Creates a buffer capabilities object. + * + * @exception IllegalArgumentException If frontCaps or backCaps are null. + */ + public BufferCapabilities(ImageCapabilities front, ImageCapabilities back, + FlipContents flip) + { + this.front = front; + this.back = back; + this.flip = flip; + if (front == null || back == null) + throw new IllegalArgumentException(); + } + + public ImageCapabilities getFrontBufferCapabilities() + { + return front; + } + + public ImageCapabilities getBackBufferCapabilities() + { + return back; + } + + public boolean isPageFlipping() + { + return flip != null; + } + + public FlipContents getFlipContents() + { + return flip; + } + + public boolean isFullScreenRequired() + { + return true; + } + + public boolean isMultiBufferAvailable() + { + return false; + } + + public Object clone() + { + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + throw (Error) new InternalError().initCause(e); // Impossible + } + } + } // class BufferCapabilities diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Button.java gcc-3.3/libjava/java/awt/Button.java *** gcc-3.2.3/libjava/java/awt/Button.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/Button.java 2003-01-02 00:14:03.000000000 +0000 *************** import java.awt.event.ActionEvent; *** 42,47 **** --- 42,48 ---- import java.awt.event.ActionListener; import java.awt.peer.ButtonPeer; import java.awt.peer.ComponentPeer; + import java.lang.reflect.Array; import java.util.EventListener; /** *************** private transient ActionListener action_ *** 89,94 **** --- 90,98 ---- /** * Initializes a new instance of Button with no label. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true */ public Button() *************** Button() *** 103,114 **** --- 107,124 ---- * label. The action command name is also initialized to this value. * * @param label The label to display on the button. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true */ public Button(String label) { this.label = label; actionCommand = label; + + if (GraphicsEnvironment.isHeadless ()) + throw new HeadlessException (); } /*************************************************************************/ *************** removeActionListener(ActionListener list *** 200,212 **** action_listeners = AWTEventMulticaster.remove(action_listeners, listener); } ! public EventListener[] ! getListeners(Class listenerType) ! { ! if (listenerType == ActionListener.class) ! return getListenersImpl(listenerType, action_listeners); ! return super.getListeners(listenerType); ! } /*************************************************************************/ --- 210,237 ---- action_listeners = AWTEventMulticaster.remove(action_listeners, listener); } ! public synchronized ActionListener[] getActionListeners() ! { ! return (ActionListener[]) ! AWTEventMulticaster.getListeners(action_listeners, ! ActionListener.class); ! } ! ! /** Returns all registered EventListers of the given listenerType. ! * listenerType must be a subclass of EventListener, or a ! * ClassClassException is thrown. ! * ! * @exception ClassCastException If listenerType doesn't specify a class or ! * interface that implements @see java.util.EventListener. ! * ! * @since 1.3 ! */ ! public EventListener[] getListeners(Class listenerType) ! { ! if (listenerType == ActionListener.class) ! return getActionListeners(); ! return (EventListener[]) Array.newInstance(listenerType, 0); ! } /*************************************************************************/ *************** processActionEvent(ActionEvent event) *** 261,273 **** void dispatchEventImpl(AWTEvent e) { - super.dispatchEventImpl(e); - if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) processEvent(e); } /*************************************************************************/ --- 286,298 ---- void dispatchEventImpl(AWTEvent e) { if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) processEvent(e); + else + super.dispatchEventImpl(e); } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/CardLayout.java gcc-3.3/libjava/java/awt/CardLayout.java *** gcc-3.2.3/libjava/java/awt/CardLayout.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/CardLayout.java 2003-01-15 22:41:13.000000000 +0000 *************** *** 1,6 **** // CardLayout.java - Card-based layout engine ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,6 ---- // CardLayout.java - Card-based layout engine ! /* Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation This file is part of GNU Classpath. *************** import java.io.Serializable; *** 53,58 **** --- 53,60 ---- */ public class CardLayout implements LayoutManager2, Serializable { + static final long serialVersionUID = -4328196481005934313L; + /** * Initializes a new instance of CardLayout with horizontal * and vertical gaps of 0. *************** public class CardLayout implements Layou *** 108,114 **** */ public void first (Container parent) { ! gotoComponent (parent, FIRST, null); } /** Return this layout manager's horizontal gap. */ --- 110,116 ---- */ public void first (Container parent) { ! gotoComponent (parent, FIRST); } /** Return this layout manager's horizontal gap. */ *************** public class CardLayout implements Layou *** 152,158 **** */ public void last (Container parent) { ! gotoComponent (parent, LAST, null); } /** --- 154,160 ---- */ public void last (Container parent) { ! gotoComponent (parent, LAST); } /** *************** public class CardLayout implements Layou *** 163,183 **** */ public void layoutContainer (Container parent) { ! int width = parent.width; ! int height = parent.height; ! Insets ins = parent.getInsets (); ! int num = parent.ncomponents; ! Component[] comps = parent.component; ! int x = ins.left + hgap; ! int y = ins.top + vgap; ! width = width - 2 * hgap - ins.left - ins.right; ! height = height - 2 * vgap - ins.top - ins.bottom; ! for (int i = 0; i < num; ++i) ! comps[i].setBounds (x, y, width, height); } /** Get the maximum layout size of the container. --- 165,188 ---- */ public void layoutContainer (Container parent) { ! synchronized (parent.getTreeLock ()) ! { ! int width = parent.width; ! int height = parent.height; ! Insets ins = parent.getInsets (); ! int num = parent.ncomponents; ! Component[] comps = parent.component; ! int x = ins.left + hgap; ! int y = ins.top + vgap; ! width = width - 2 * hgap - ins.left - ins.right; ! height = height - 2 * vgap - ins.top - ins.bottom; ! for (int i = 0; i < num; ++i) ! comps[i].setBounds (x, y, width, height); ! } } /** Get the maximum layout size of the container. *************** public class CardLayout implements Layou *** 205,211 **** */ public void next (Container parent) { ! gotoComponent (parent, NEXT, null); } /** Get the preferred layout size of the container. --- 210,216 ---- */ public void next (Container parent) { ! gotoComponent (parent, NEXT); } /** Get the preferred layout size of the container. *************** public class CardLayout implements Layou *** 223,229 **** */ public void previous (Container parent) { ! gotoComponent (parent, PREV, null); } /** Remove the indicated component from this layout manager. --- 228,234 ---- */ public void previous (Container parent) { ! gotoComponent (parent, PREV); } /** Remove the indicated component from this layout manager. *************** public class CardLayout implements Layou *** 268,274 **** { Object target = tab.get (name); if (target != null) ! gotoComponent (parent, NONE, (Component) target); } /** --- 273,293 ---- { Object target = tab.get (name); if (target != null) ! { ! int num = parent.ncomponents; ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! for (int i = 0; i < num; ++i) ! { ! if (comps[i].isVisible()) ! { ! if (target == comps[i]) ! return; ! comps[i].setVisible (false); ! } ! } ! ((Component) target).setVisible (true); ! } } /** *************** public class CardLayout implements Layou *** 281,375 **** return getClass ().getName () + "[" + hgap + "," + vgap + "]"; } ! // This implements first(), last(), next(), and previous(). ! private void gotoComponent (Container parent, int what, ! Component target) { ! int num = parent.ncomponents; ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! int choice = -1; ! ! if (what == FIRST) ! choice = 0; ! else if (what == LAST) ! choice = num - 1; ! else if (what >= 0) ! choice = what; ! ! for (int i = 0; i < num; ++i) { ! // If TARGET is set then we are looking for a specific ! // component. ! if (target != null) ! { ! if (target == comps[i]) ! choice = i; ! } ! if (comps[i].isVisible ()) { ! if (what == NEXT) ! { ! choice = i + 1; ! if (choice == num) ! choice = 0; ! } ! else if (what == PREV) ! { ! choice = i - 1; ! if (choice < 0) ! choice = num - 1; ! } ! else if (choice == i) { ! // Do nothing if we're already looking at the right ! // component. ! return; } - comps[i].setVisible (false); - - if (choice >= 0) - break; } - } ! if (choice >= 0 && choice < num) ! comps[choice].setVisible (true); } // Compute the size according to WHAT. private Dimension getSize (Container parent, int what) { ! int w = 0, h = 0, num = parent.ncomponents; ! Component[] comps = parent.component; ! ! for (int i = 0; i < num; ++i) { ! Dimension d; ! if (what == MIN) ! d = comps[i].getMinimumSize (); ! else if (what == MAX) ! d = comps[i].getMaximumSize (); ! else ! d = comps[i].getPreferredSize (); ! w = Math.max (d.width, w); ! h = Math.max (d.height, h); ! } ! Insets i = parent.getInsets (); ! w += 2 * hgap + i.right + i.left; ! h += 2 * vgap + i.bottom + i.top; ! // Handle overflow. ! if (w < 0) ! w = Integer.MAX_VALUE; ! if (h < 0) ! h = Integer.MAX_VALUE; ! return new Dimension (w, h); } /** --- 300,392 ---- return getClass ().getName () + "[" + hgap + "," + vgap + "]"; } ! /** This implements first(), last(), next(), and previous(). ! * @param parent The parent container ! * @param what The type of goto: FIRST, LAST, NEXT or PREV ! */ ! private void gotoComponent (Container parent, int what) { ! synchronized (parent.getTreeLock ()) { ! int num = parent.ncomponents; ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! int choice = -1; ! if (what == FIRST) ! choice = 0; ! else if (what == LAST) ! choice = num - 1; ! ! for (int i = 0; i < num; ++i) { ! if (comps[i].isVisible ()) { ! if (what == NEXT) ! { ! choice = i + 1; ! if (choice == num) ! choice = 0; ! } ! else if (what == PREV) ! { ! choice = i - 1; ! if (choice < 0) ! choice = num - 1; ! } ! else if (choice == i) ! { ! // Do nothing if we're already looking at the right ! // component. ! return; ! } ! comps[i].setVisible (false); ! ! if (choice >= 0) ! break; } } ! if (choice >= 0 && choice < num) ! comps[choice].setVisible (true); ! } } // Compute the size according to WHAT. private Dimension getSize (Container parent, int what) { ! synchronized (parent.getTreeLock ()) { ! int w = 0, h = 0, num = parent.ncomponents; ! Component[] comps = parent.component; ! for (int i = 0; i < num; ++i) ! { ! Dimension d; ! if (what == MIN) ! d = comps[i].getMinimumSize (); ! else if (what == MAX) ! d = comps[i].getMaximumSize (); ! else ! d = comps[i].getPreferredSize (); ! w = Math.max (d.width, w); ! h = Math.max (d.height, h); ! } ! Insets i = parent.getInsets (); ! w += 2 * hgap + i.right + i.left; ! h += 2 * vgap + i.bottom + i.top; ! // Handle overflow. ! if (w < 0) ! w = Integer.MAX_VALUE; ! if (h < 0) ! h = Integer.MAX_VALUE; ! ! return new Dimension (w, h); ! } } /** *************** public class CardLayout implements Layou *** 392,398 **** private int LAST = 1; private int NEXT = 2; private int PREV = 3; - private int NONE = 4; // These constants are used by the private getSize method. private int MIN = 0; --- 409,414 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Checkbox.java gcc-3.3/libjava/java/awt/Checkbox.java *** gcc-3.2.3/libjava/java/awt/Checkbox.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/Checkbox.java 2002-03-24 22:37:51.000000000 +0000 *************** processItemEvent(ItemEvent event) *** 365,370 **** --- 365,382 ---- item_listeners.itemStateChanged(event); } + void + dispatchEventImpl(AWTEvent e) + { + if (e.id <= ItemEvent.ITEM_LAST + && e.id >= ItemEvent.ITEM_FIRST + && (item_listeners != null + || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) + processEvent(e); + else + super.dispatchEventImpl(e); + } + /*************************************************************************/ /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/CheckboxMenuItem.java gcc-3.3/libjava/java/awt/CheckboxMenuItem.java *** gcc-3.2.3/libjava/java/awt/CheckboxMenuItem.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/CheckboxMenuItem.java 2003-01-02 00:14:03.000000000 +0000 *************** private transient ItemListener item_list *** 84,89 **** --- 84,92 ---- /** * Initializes a new instance of CheckboxMenuItem with no * label and an initial state of off. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true. */ public CheckboxMenuItem() *************** CheckboxMenuItem() *** 98,103 **** --- 101,109 ---- * specified label and an initial state of off. * * @param label The label of the menu item. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true. */ public CheckboxMenuItem(String label) *************** CheckboxMenuItem(String label) *** 114,125 **** --- 120,137 ---- * @param label The label of the menu item. * @param state The initial state of the menu item, where true * is on, and false is off. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true. */ public CheckboxMenuItem(String label, boolean state) { super(label); this.state = state; + + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ *************** processItemEvent(ItemEvent event) *** 258,263 **** --- 270,287 ---- item_listeners.itemStateChanged(event); } + void + dispatchEventImpl(AWTEvent e) + { + if (e.id <= ItemEvent.ITEM_LAST + && e.id >= ItemEvent.ITEM_FIRST + && (item_listeners != null + || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) + processEvent(e); + else + super.dispatchEventImpl(e); + } + /*************************************************************************/ /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Choice.java gcc-3.3/libjava/java/awt/Choice.java *** gcc-3.2.3/libjava/java/awt/Choice.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Choice.java 2003-01-02 00:14:03.000000000 +0000 *************** private ItemListener item_listeners; *** 85,97 **** * Constructors */ ! /** ! * Initializes a new instance of Choice. ! */ ! public ! Choice() ! { ! } /*************************************************************************/ --- 85,101 ---- * Constructors */ ! /** ! * Initializes a new instance of Choice. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() ! * returns true ! */ ! public Choice() ! { ! if (GraphicsEnvironment.isHeadless()) ! throw new HeadlessException (); ! } /*************************************************************************/ *************** getItem(int index) *** 146,157 **** * Adds the specified item to this choice box. * * @param item The item to add. */ public synchronized void add(String item) { if (item == null) ! throw new IllegalArgumentException ("item must be non-null"); pItems.addElement(item); --- 150,165 ---- * Adds the specified item to this choice box. * * @param item The item to add. + * + * @exception NullPointerException If the item's value is null + * + * @since 1.1 */ public synchronized void add(String item) { if (item == null) ! throw new NullPointerException ("item must be non-null"); pItems.addElement(item); *************** add(String item) *** 171,177 **** --- 179,190 ---- /** * Adds the specified item to this choice box. * + * This method is oboslete since Java 2 platform 1.1. Please use @see add + * instead. + * * @param item The item to add. + * + * @exception NullPointerException If the item's value is equal to null */ public synchronized void addItem(String item) *************** addItem(String item) *** 189,198 **** --- 202,216 ---- * * @param item The item to add. * @param index The index at which the item should be inserted. + * + * @exception IllegalArgumentException If index is less than 0 */ public synchronized void insert(String item, int index) { + if (index < 0) + throw new IllegalArgumentException ("index may not be less then 0"); + if (index > getItemCount ()) index = getItemCount (); *************** insert(String item, int index) *** 215,221 **** * * @param item The item to remove. * ! * @param IllegalArgumentException If the specified item doesn't exist. */ public synchronized void remove(String item) --- 233,239 ---- * * @param item The item to remove. * ! * @exception IllegalArgumentException If the specified item doesn't exist. */ public synchronized void remove(String item) *************** remove(String item) *** 234,240 **** * * @param index The index of the item to remove. * ! * @exception ArrayIndexOutOfBoundException If the index is not valid. */ public synchronized void remove(int index) --- 252,258 ---- * * @param index The index of the item to remove. * ! * @exception IndexOutOfBoundsException If the index is not valid. */ public synchronized void remove(int index) *************** getSelectedIndex() *** 325,331 **** * * @param index The index of the row to make selected. * ! * @param IllegalArgumentException If the specified index is invalid. */ public synchronized void select(int index) --- 343,349 ---- * * @param index The index of the row to make selected. * ! * @exception IllegalArgumentException If the specified index is invalid. */ public synchronized void select(int index) *************** processItemEvent(ItemEvent event) *** 431,436 **** --- 449,466 ---- item_listeners.itemStateChanged(event); } + void + dispatchEventImpl(AWTEvent e) + { + if (e.id <= ItemEvent.ITEM_LAST + && e.id >= ItemEvent.ITEM_FIRST + && (item_listeners != null + || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) + processEvent(e); + else + super.dispatchEventImpl(e); + } + /*************************************************************************/ /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/color/CMMException.java gcc-3.3/libjava/java/awt/color/CMMException.java *** gcc-3.2.3/libjava/java/awt/color/CMMException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/color/CMMException.java 2003-01-02 00:14:06.000000000 +0000 *************** *** 0 **** --- 1,63 ---- + /* CMMException.java -- error in the native CMM + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.color; + + /** + * Thrown when there is an error in the native CMM. + * + * @author Eric Blake + * @status updated to 1.4 + */ + public class CMMException extends RuntimeException + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 5775558044142994965L; + + /** + * Create a new instance with a specified detailed error message. + * + * @param message the message + */ + public CMMException(String message) + { + super(message); + } + } // class CMMException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/color/ColorSpace.java gcc-3.3/libjava/java/awt/color/ColorSpace.java *** gcc-3.2.3/libjava/java/awt/color/ColorSpace.java 2002-01-22 22:40:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/color/ColorSpace.java 2003-01-14 22:12:52.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* ColorSpace.java -- transforms between color spaces ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,58 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.color; /** * @author Rolf W. Rasmussen */ ! public abstract class ColorSpace { ! public static final int TYPE_XYZ = 0; ! public static final int TYPE_Lab = 1; ! public static final int TYPE_Luv = 2; public static final int TYPE_YCbCr = 3; ! public static final int TYPE_Yxy = 4; ! public static final int TYPE_RGB = 5; ! public static final int TYPE_GRAY = 6; ! public static final int TYPE_HSV = 7; ! public static final int TYPE_HLS = 8; ! public static final int TYPE_CMYK = 9; // mysterious gap in the enumeration sequenece ! public static final int TYPE_CMY = 11; public static final int TYPE_2CLR = 12; public static final int TYPE_3CLR = 13; public static final int TYPE_4CLR = 14; --- 35,70 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.color; + import java.io.Serializable; + /** + * NEEDS DOCUMENTATION + * * @author Rolf W. Rasmussen + * @since 1.2 */ ! public abstract class ColorSpace implements Serializable { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -409452704308689724L; ! ! public static final int TYPE_XYZ = 0; ! public static final int TYPE_Lab = 1; ! public static final int TYPE_Luv = 2; public static final int TYPE_YCbCr = 3; ! public static final int TYPE_Yxy = 4; ! public static final int TYPE_RGB = 5; ! public static final int TYPE_GRAY = 6; ! public static final int TYPE_HSV = 7; ! public static final int TYPE_HLS = 8; ! public static final int TYPE_CMYK = 9; // mysterious gap in the enumeration sequenece ! public static final int TYPE_CMY = 11; public static final int TYPE_2CLR = 12; public static final int TYPE_3CLR = 13; public static final int TYPE_4CLR = 14; *************** public abstract class ColorSpace *** 67,120 **** public static final int TYPE_DCLR = 23; public static final int TYPE_ECLR = 24; public static final int TYPE_FCLR = 25; ! ! public static final int CS_sRGB = 1000; ! public static final int CS_CIEXYZ = 1001; ! public static final int CS_PYCC = 1002; ! public static final int CS_GRAY = 1003; public static final int CS_LINEAR_RGB = 1004; ! ! private static final int CS_BASE = CS_sRGB; ! private static final int CS_END = CS_LINEAR_RGB+1; private static final int CS_COUNT = CS_END - CS_BASE; ! // Instances are lazily instantiated private static final ColorSpace[] INSTANCES = new ColorSpace[CS_COUNT]; ! private int type; ! private int numcomponents; protected ColorSpace(int type, int numcomponents) { this.type = type; ! this.numcomponents = numcomponents; } ! public static ColorSpace getInstance(int colorspace) { if ((colorspace >= CS_BASE) && (colorspace < CS_END)) { ! int instanceIndex = colorspace - CS_BASE; ! if (INSTANCES[instanceIndex] == null) ! { ! ICC_Profile profile = new ICC_Profile(colorspace); ! INSTANCES[instanceIndex] = new ICC_ColorSpace(profile); ! } ! return INSTANCES[instanceIndex]; } throw new IllegalArgumentException("unknown/unsupported colorspace"); } ! public boolean isCS_sRGB() { return false; } public abstract float[] toRGB(float[] colorvalue); ! public abstract float[] fromRGB(float[] rgbvalue); ! public abstract float[] toCIEXYZ(float[] colorvalue); ! public abstract float[] fromCIEXYZ(float[] colorvalue); public int getType() --- 79,149 ---- public static final int TYPE_DCLR = 23; public static final int TYPE_ECLR = 24; public static final int TYPE_FCLR = 25; ! ! public static final int CS_sRGB = 1000; public static final int CS_LINEAR_RGB = 1004; ! public static final int CS_CIEXYZ = 1001; ! public static final int CS_PYCC = 1002; ! public static final int CS_GRAY = 1003; ! ! private static final int CS_BASE = CS_sRGB; ! private static final int CS_END = CS_LINEAR_RGB + 1; private static final int CS_COUNT = CS_END - CS_BASE; ! // Instances are lazily instantiated private static final ColorSpace[] INSTANCES = new ColorSpace[CS_COUNT]; ! /** ! * @serial ! */ ! // Visible in subclass. ! final int type; ! ! /** ! * @serial ! */ ! // Visible in subclass. ! final int numComponents; ! protected ColorSpace(int type, int numcomponents) { this.type = type; ! numComponents = numcomponents; } ! public static ColorSpace getInstance(int colorspace) { if ((colorspace >= CS_BASE) && (colorspace < CS_END)) { ! int instanceIndex = colorspace - CS_BASE; ! if (INSTANCES[instanceIndex] == null) ! { ! ICC_Profile profile = new ICC_Profile(colorspace); ! INSTANCES[instanceIndex] = new ICC_ColorSpace(profile); ! } ! return INSTANCES[instanceIndex]; } throw new IllegalArgumentException("unknown/unsupported colorspace"); } ! public boolean isCS_sRGB() { return false; } + /** + * Transforms a color value assumed to be in this ColorSpace into a value in + * the default CS_sRGB color space. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at least + * the number of components in this ColorSpace. + */ public abstract float[] toRGB(float[] colorvalue); ! public abstract float[] fromRGB(float[] rgbvalue); ! public abstract float[] toCIEXYZ(float[] colorvalue); ! public abstract float[] fromCIEXYZ(float[] colorvalue); public int getType() *************** public abstract class ColorSpace *** 124,139 **** public int getNumComponents() { ! return numcomponents; } ! public String getName(int idx) { return "type " + type; } ! ! public String toString() { ! return getClass().getName() + "[type=" + type + "]"; } ! } --- 153,183 ---- public int getNumComponents() { ! return numComponents; } ! public String getName(int idx) { return "type " + type; } ! ! /** ! * @since 1.4 ! */ ! public float getMinValue(int idx) { ! if (idx < 0 || idx >= numComponents) ! throw new IllegalArgumentException(); ! return 0; } ! ! /** ! * @since 1.4 ! */ ! public float getMaxValue(int idx) ! { ! if (idx < 0 || idx >= numComponents) ! throw new IllegalArgumentException(); ! return 1; ! } ! } // class ColorSpace diff -Nrc3pad gcc-3.2.3/libjava/java/awt/color/ICC_ColorSpace.java gcc-3.3/libjava/java/awt/color/ICC_ColorSpace.java *** gcc-3.2.3/libjava/java/awt/color/ICC_ColorSpace.java 2002-01-22 22:40:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/color/ICC_ColorSpace.java 2003-01-14 22:12:52.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* ICC_ColorSpace.java -- the canonical color space implementation ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,72 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.color; /** * @author Rolf W. Rasmussen */ public class ICC_ColorSpace extends ColorSpace { ! private ICC_Profile profile; public ICC_ColorSpace(ICC_Profile profile) { super(CS_sRGB, profile.getNumComponents()); ! ! this.profile = profile; } public ICC_Profile getProfile() { ! return profile; } public float[] toRGB(float[] colorvalue) { // FIXME: Always assumes sRGB: return colorvalue; } public float[] fromRGB(float[] rgbvalue) { // FIXME: Always assumes sRGB: return rgbvalue; } public float[] toCIEXYZ(float[] colorvalue) { // FIXME: Not implemented --- 35,142 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.color; /** + * NEEDS DOCUMENTATION + * * @author Rolf W. Rasmussen + * @since 1.2 */ public class ICC_ColorSpace extends ColorSpace { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 3455889114070431483L; + /** + * @serial + */ + private ICC_Profile thisProfile; + + /** + * @serial + */ + private float[] minVal; + + /** + * @serial + */ + private float[] maxVal; + + /** + * @serial + */ + private float[] diffMinMax; + + /** + * @serial + */ + private float[] invDiffMinMax; + + /** + * @serial + */ + private boolean needScaleInit; + + /** + * Constructs a new ICC_ColorSpace from an ICC_Profile object. + * + * @exception IllegalArgumentException If profile is inappropriate for + * representing a ColorSpace. + */ public ICC_ColorSpace(ICC_Profile profile) { super(CS_sRGB, profile.getNumComponents()); ! thisProfile = profile; } public ICC_Profile getProfile() { ! return thisProfile; } + /** + * Transforms a color value assumed to be in this ColorSpace into a value in + * the default CS_sRGB color space. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at least + * the number of components in this ColorSpace. + */ public float[] toRGB(float[] colorvalue) { + if (colorvalue.length < numComponents) + throw new IllegalArgumentException (); + // FIXME: Always assumes sRGB: return colorvalue; } + /** + * Transforms a color value assumed to be in the default CS_sRGB color space + * into this ColorSpace. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at + * least 3. + */ public float[] fromRGB(float[] rgbvalue) { + if (rgbvalue.length < 3) + throw new IllegalArgumentException (); + // FIXME: Always assumes sRGB: return rgbvalue; } + /** + * Transforms a color value assumed to be in this ColorSpace into the + * CS_CIEXYZ conversion color space. + * + * @exception ArrayIndexOutOfBoundsException If array length is not at + * least the number of components in this ColorSpace. + */ public float[] toCIEXYZ(float[] colorvalue) { // FIXME: Not implemented *************** public class ICC_ColorSpace extends Colo *** 78,81 **** // FIXME: Not implemented throw new UnsupportedOperationException(); } ! } --- 148,182 ---- // FIXME: Not implemented throw new UnsupportedOperationException(); } ! ! /** ! * @since 1.4 ! */ ! public float getMinValue(int idx) ! { ! if (type == TYPE_Lab && (idx == 1 || idx == 2)) ! return -128; ! if (idx < 0 || idx >= numComponents) ! throw new IllegalArgumentException(); ! return 0; ! } ! ! /** ! * @since 1.4 ! */ ! public float getMaxValue(int idx) ! { ! if (type == TYPE_XYZ && idx >= 0 && idx <= 2) ! return 1 + 32767 / 32768f; ! else if (type == TYPE_Lab) ! { ! if (idx == 0) ! return 100; ! if (idx == 1 || idx == 2) ! return 127; ! } ! if (idx < 0 || idx >= numComponents) ! throw new IllegalArgumentException(); ! return 1; ! } ! } // class ICC_ColorSpace diff -Nrc3pad gcc-3.2.3/libjava/java/awt/color/ICC_ProfileGray.java gcc-3.3/libjava/java/awt/color/ICC_ProfileGray.java *** gcc-3.2.3/libjava/java/awt/color/ICC_ProfileGray.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/color/ICC_ProfileGray.java 2002-11-10 00:16:42.000000000 +0000 *************** *** 0 **** --- 1,71 ---- + /* ICC_ProfileGray.java -- the ICC profile for a Gray colorspace + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.color; + + /** + * STUBBED + * @since 1.2 + */ + public class ICC_ProfileGray extends ICC_Profile + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -1124721290732002649L; + + ICC_ProfileGray() + { + super(ColorSpace.CS_GRAY); + } + + public float[] getMediaWhitePoint() + { + return null; + } + + public float getGamma() + { + return 0; + } + + public short[] getTRC() + { + return null; + } + } // class ICC_ProfileGray diff -Nrc3pad gcc-3.2.3/libjava/java/awt/color/ICC_Profile.java gcc-3.3/libjava/java/awt/color/ICC_Profile.java *** gcc-3.2.3/libjava/java/awt/color/ICC_Profile.java 2002-01-22 22:40:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/color/ICC_Profile.java 2003-01-02 00:14:06.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* ICC_Profile.java -- color space profiling ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,58 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.color; ! // Currently just a stub. /** * @author Rolf W. Rasmussen */ ! public class ICC_Profile { ! long profileID; // why long? ! ! ICC_Profile(long profileID) { this.profileID = profileID; } public int getNumComponents() { ! switch ((int) profileID) { case ColorSpace.CS_sRGB: case ColorSpace.CS_LINEAR_RGB: --- 35,273 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.color; ! import java.io.FileInputStream; ! import java.io.FileOutputStream; ! import java.io.InputStream; ! import java.io.IOException; ! import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.io.ObjectStreamException; ! import java.io.OutputStream; ! import java.io.Serializable; /** + * STUBBED * @author Rolf W. Rasmussen + * @since 1.2 */ ! public class ICC_Profile implements Serializable { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -3938515861990936766L; ! ! public static final int CLASS_INPUT = 0; ! public static final int CLASS_DISPLAY = 1; ! public static final int CLASS_OUTPUT = 2; ! public static final int CLASS_DEVICELINK = 3; ! public static final int CLASS_COLORSPACECONVERSION = 4; ! public static final int CLASS_ABSTRACT = 5; ! public static final int CLASS_NAMEDCOLOR = 6; ! ! public static final int icSigXYZData = 1482250784; ! public static final int icSigLabData = 1281450528; ! public static final int icSigLuvData = 1282766368; ! public static final int icSigYCbCrData = 1497588338; ! public static final int icSigYxyData = 1501067552; ! public static final int icSigRgbData = 1380401696; ! public static final int icSigGrayData = 1196573017; ! public static final int icSigHsvData = 1213421088; ! public static final int icSigHlsData = 1212961568; ! public static final int icSigCmykData = 1129142603; ! public static final int icSigCmyData = 1129142560; ! public static final int icSigSpace2CLR = 843271250; ! public static final int icSigSpace3CLR = 860048466; ! public static final int icSigSpace4CLR = 876825682; ! public static final int icSigSpace5CLR = 893602898; ! public static final int icSigSpace6CLR = 910380114; ! public static final int icSigSpace7CLR = 927157330; ! public static final int icSigSpace8CLR = 943934546; ! public static final int icSigSpace9CLR = 960711762; ! public static final int icSigSpaceACLR = 1094929490; ! public static final int icSigSpaceBCLR = 1111706706; ! public static final int icSigSpaceCCLR = 1128483922; ! public static final int icSigSpaceDCLR = 1145261138; ! public static final int icSigSpaceECLR = 1162038354; ! public static final int icSigSpaceFCLR = 1178815570; ! ! public static final int icSigInputClass = 1935896178; ! public static final int icSigDisplayClass = 1835955314; ! public static final int icSigOutputClass = 1886549106; ! public static final int icSigLinkClass = 1818848875; ! public static final int icSigAbstractClass = 1633842036; ! public static final int icSigColorSpaceClass = 1936744803; ! public static final int icSigNamedColorClass = 1852662636; ! ! public static final int icPerceptual = 0; ! public static final int icRelativeColorimetric = 1; ! public static final int icSaturation = 2; ! public static final int icAbsoluteColorimetric = 3; ! ! public static final int icSigHead = 1751474532; ! public static final int icSigAToB0Tag = 1093812784; ! public static final int icSigAToB1Tag = 1093812785; ! public static final int icSigAToB2Tag = 1093812786; ! public static final int icSigBlueColorantTag = 1649957210; ! public static final int icSigBlueTRCTag = 1649693251; ! public static final int icSigBToA0Tag = 1110589744; ! public static final int icSigBToA1Tag = 1110589745; ! public static final int icSigBToA2Tag = 1110589746; ! public static final int icSigCalibrationDateTimeTag = 1667329140; ! public static final int icSigCharTargetTag = 1952543335; ! public static final int icSigCopyrightTag = 1668313716; ! public static final int icSigCrdInfoTag = 1668441193; ! public static final int icSigDeviceMfgDescTag = 1684893284; ! public static final int icSigDeviceModelDescTag = 1684890724; ! public static final int icSigDeviceSettingsTag = 1684371059; ! public static final int icSigGamutTag = 1734438260; ! public static final int icSigGrayTRCTag = 1800688195; ! public static final int icSigGreenColorantTag = 1733843290; ! public static final int icSigGreenTRCTag = 1733579331; ! public static final int icSigLuminanceTag = 1819635049; ! public static final int icSigMeasurementTag = 1835360627; ! public static final int icSigMediaBlackPointTag = 1651208308; ! public static final int icSigMediaWhitePointTag = 2004119668; ! public static final int icSigNamedColor2Tag = 1852009522; ! public static final int icSigOutputResponseTag = 1919251312; ! public static final int icSigPreview0Tag = 1886545200; ! public static final int icSigPreview1Tag = 1886545201; ! public static final int icSigPreview2Tag = 1886545202; ! public static final int icSigProfileDescriptionTag = 1684370275; ! public static final int icSigProfileSequenceDescTag = 1886610801; ! public static final int icSigPs2CRD0Tag = 1886610480; ! public static final int icSigPs2CRD1Tag = 1886610481; ! public static final int icSigPs2CRD2Tag = 1886610482; ! public static final int icSigPs2CRD3Tag = 1886610483; ! public static final int icSigPs2CSATag = 1886597747; ! public static final int icSigPs2RenderingIntentTag = 1886597737; ! public static final int icSigRedColorantTag = 1918392666; ! public static final int icSigRedTRCTag = 1918128707; ! public static final int icSigScreeningDescTag = 1935897188; ! public static final int icSigScreeningTag = 1935897198; ! public static final int icSigTechnologyTag = 1952801640; ! public static final int icSigUcrBgTag = 1650877472; ! public static final int icSigViewingCondDescTag = 1987405156; ! public static final int icSigViewingConditionsTag = 1986618743; ! public static final int icSigChromaticityTag = 1667789421; ! ! public static final int icHdrSize = 0; ! public static final int icHdrCmmId = 4; ! public static final int icHdrVersion = 8; ! public static final int icHdrDeviceClass = 12; ! public static final int icHdrColorSpace = 16; ! public static final int icHdrPcs = 20; ! public static final int icHdrDate = 24; ! public static final int icHdrMagic = 36; ! public static final int icHdrPlatform = 40; ! public static final int icHdrFlags = 44; ! public static final int icHdrManufacturer = 48; ! public static final int icHdrModel = 52; ! public static final int icHdrAttributes = 56; ! public static final int icHdrRenderingIntent = 64; ! public static final int icHdrIlluminant = 68; ! public static final int icHdrCreator = 80; ! ! public static final int icTagType = 0; ! public static final int icTagReserved = 4; ! public static final int icCurveCount = 8; ! public static final int icCurveData = 12; ! ! public static final int icXYZNumberX = 8; ! ! /** ! * @serial ! */ ! final int iccProfileSerializedDataVersion = 1; ! ! transient int profileID; ! ! ICC_Profile(int profileID) { this.profileID = profileID; } + protected void finalize() + { + // XXX What resources should we free? + } + + public static ICC_Profile getInstance(byte[] data) + { + throw new Error("not implemented"); + } + + public static ICC_Profile getInstance(int cspace) + { + return new ICC_Profile(cspace); + } + + public static ICC_Profile getInstance(String filename) throws IOException + { + return getInstance(new FileInputStream(filename)); + } + + public static ICC_Profile getInstance(InputStream in) throws IOException + { + throw new Error("not implemented"); + } + + public int getMajorVersion() + { + throw new Error("not implemented"); + } + + public int getMinorVersion() + { + throw new Error("not implemented"); + } + + public int getProfileClass() + { + throw new Error("not implemented"); + } + + public int getColorSpaceType() + { + throw new Error("not implemented"); + } + + public int getPCSType() + { + throw new Error("not implemented"); + } + + public void write(String filename) throws IOException + { + write(new FileOutputStream(filename)); + } + + public void write(OutputStream out) throws IOException + { + throw new Error("not implemented"); + } + + public byte[] getData() + { + throw new Error("not implemented"); + } + + public byte[] getData(int tagSignature) + { + throw new Error("not implemented"); + } + + public void setData(int tagSignature, byte[] data) + { + throw new Error("not implemented"); + } + public int getNumComponents() { ! switch (profileID) { case ColorSpace.CS_sRGB: case ColorSpace.CS_LINEAR_RGB: *************** public class ICC_Profile *** 60,68 **** return 3; case ColorSpace.CS_GRAY: return 1; ! case ColorSpace.CS_PYCC: // have no clue about this one default: throw new UnsupportedOperationException("profile not implemented"); } } ! } --- 275,299 ---- return 3; case ColorSpace.CS_GRAY: return 1; ! case ColorSpace.CS_PYCC: // have no clue about this one default: throw new UnsupportedOperationException("profile not implemented"); } } ! ! protected Object readResolve() throws ObjectStreamException ! { ! throw new Error("not implemented"); ! } ! ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException ! { ! throw new Error("not implemented"); ! } ! ! private void writeObject(ObjectOutputStream s) throws IOException ! { ! throw new Error("not implemented"); ! } ! } // class ICC_Profile diff -Nrc3pad gcc-3.2.3/libjava/java/awt/color/ICC_ProfileRGB.java gcc-3.3/libjava/java/awt/color/ICC_ProfileRGB.java *** gcc-3.2.3/libjava/java/awt/color/ICC_ProfileRGB.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/color/ICC_ProfileRGB.java 2002-11-10 00:16:42.000000000 +0000 *************** *** 0 **** --- 1,80 ---- + /* ICC_ProfileRGB.java -- the ICC profile for a RGB colorspace + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.color; + + /** + * STUBBED + * @since 1.2 + */ + public class ICC_ProfileRGB extends ICC_Profile + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 8505067385152579334L; + + public static final int REDCOMPONENT = 0; + public static final int GREENCOMPONENT = 1; + public static final int BLUECOMPONENT = 2; + + ICC_ProfileRGB() + { + super(ColorSpace.CS_sRGB); + } + + public float[] getMediaWhitePoint() + { + return null; + } + + public float[][] getMatrix() + { + return null; + } + + public float getGamma(int component) + { + return 0; + } + + public short[] getTRC(int component) + { + return null; + } + } // class ICC_ProfileRGB diff -Nrc3pad gcc-3.2.3/libjava/java/awt/color/ProfileDataException.java gcc-3.3/libjava/java/awt/color/ProfileDataException.java *** gcc-3.2.3/libjava/java/awt/color/ProfileDataException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/color/ProfileDataException.java 2003-01-02 00:14:06.000000000 +0000 *************** *** 0 **** --- 1,64 ---- + /* ProfileDataException.java -- error in processing an ICC_Profile + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.color; + + /** + * Thrown when there is an error accessing or processing an + * ICC_Profile. + * + * @author Eric Blake + * @status updated to 1.4 + */ + public class ProfileDataException extends RuntimeException + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 7286140888240322498L; + + /** + * Create a new instance with a specified detailed error message. + * + * @param message the message + */ + public ProfileDataException(String message) + { + super(message); + } + } // class ProfileDataException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Color.java gcc-3.3/libjava/java/awt/Color.java *** gcc-3.2.3/libjava/java/awt/Color.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Color.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,4 **** ! /* Color.java -- Class representing a color in Java Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,4 ---- ! /* Color.java -- represents a color in Java Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,533 **** package java.awt; ! /** ! * This class represents a color value in the AWT system. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class Color implements java.io.Serializable ! { ! ! /* ! * Static Variables ! */ ! ! /** ! * Constant for the color white ! */ ! public static final Color white = new Color(255,255,255,255); ! ! /** ! * Constant for the color light gray ! */ ! public static final Color lightGray = new Color(192,192,192,255); ! ! /** ! * Constant for the color gray ! */ ! public static final Color gray = new Color(128,128,128,255); /** ! * Constant for the color dark gray ! */ ! public static final Color darkGray = new Color(64,64,64,255); ! /** ! * Constant for the color black ! */ ! public static final Color black = new Color(0,0,0,255); ! /** ! * Constant for the color red ! */ ! public static final Color red = new Color(255,0,0,255); ! /** ! * Constant for the color pink ! */ ! public static final Color pink = new Color(255, 175, 175,255); ! /** ! * Constant for the color orange ! */ ! public static final Color orange = new Color(255, 200, 0,255); ! /** ! * Constant for the color yellow ! */ ! public static final Color yellow = new Color(255,255,0,255); ! /** ! * Constant for the color green ! */ ! public static final Color green = new Color(0,255,0,255); ! /** ! * Constant for the color magenta ! */ ! public static final Color magenta = new Color(255,0,255,255); ! /** ! * Constant for the color cyan ! */ ! public static final Color cyan = new Color(0,255,255,255); ! /** ! * Constant for the color blue ! */ ! public static final Color blue = new Color(0,0,255,255); ! // Serialization Constant ! private static final long serialVersionUID = 118526816881161077L; ! // Masks for individual color components ! private static final int redmask = 255 << 16; ! private static final int greenmask = 255 << 8; ! private static final int bluemask = 255; ! private static final int alphamask = 255 << 24; ! private static final int BRIGHT_STEP = 0x30; ! /*************************************************************************/ ! /* ! * Instance Variables ! */ ! /** ! * @serial The RGB value of the color. ! */ ! private int value = 0xFFFFFFFF; ! /*************************************************************************/ ! /* ! * Static Methods ! */ ! /** ! * Converts the specified string to a number and creates a new instance ! * of Color from the value. ! * ! * @param str The numeric color string. ! * ! * @return A new instance of Color for the string. ! * ! * @exception NumberFormatException If the string cannot be parsed. ! */ ! public static Color ! decode(String str) throws NumberFormatException ! { ! Integer i = Integer.decode(str); ! return(new Color(i.intValue())); ! } ! /*************************************************************************/ ! /** ! * Returns a new instance of Color from the value of ! * the system property named by the specified string. If the property ! * does not exist, or cannot be parsed, then null will be ! * returned. ! * ! * @param prop The system property to retrieve. ! */ ! public static Color ! getColor(String prop) ! { ! return(getColor(prop, null)); ! } ! /*************************************************************************/ ! /** ! * Returns a new instance of Color from the value of the ! * system property named by the specified string. If the property does ! * not exist, or cannot be parsed, then the default RGB value will be ! * used to create a return value. ! * ! * @param prop The system property to retrieve. ! * @param defrgb The default RGB value. ! */ ! public static Color ! getColor(String prop, int defrgb) ! { ! return(getColor(prop, new Color(defrgb))); ! } ! /*************************************************************************/ ! /** ! * Returns a new instance of Color from the value of the ! * system property named by the specified string. If the property does ! * not exist, or cannot be parsed, then the default color value will be ! * returned ! * ! * @param prop The system property to retrieve. ! * @param defcolor The default color ! */ ! public static Color ! getColor(String prop, Color defcolor) ! { ! String val = System.getProperty(prop); ! if (val == null) ! return(defcolor); ! try ! { ! return(decode(val)); ! } ! catch(NumberFormatException e) ! { ! return(defcolor); ! } ! } ! /*************************************************************************/ ! /** ! * Converts from the HSB (hue, saturation, brightness) color model to ! * the RGB (red, green, blue) color model. ! * ! * @param hue The hue of the HSB value. ! * @param saturation The saturation of the HSB value. ! * @param brightness The brightness of the HSB value. ! * ! * @return The RGB value. ! */ ! public static int ! HSBtoRGB(float hue, float saturation, float brightness) ! { ! // FIXME: Implement ! throw new RuntimeException("Not implemented yet"); ! } ! /*************************************************************************/ ! /** ! * Converts from the RGB (red, green, blue) color model to the HSB ! * (hue, saturation, brightness) color model. ! * ! * @param red The red part of the RGB value. ! * @param green The green part of the RGB value. ! * @param blue The blue part of the RGB value. ! * @param hsbvals An array of three floats used for storing the HSB values, ! * or null if this return mechanism is not used. ! * ! * @return The HSB value. ! */ ! public static float[] ! RGBtoHSB(int red, int green, int blue, float hsbvals[]) ! { ! // FIXME: Implement ! throw new RuntimeException("Not implemented yet"); ! } ! /*************************************************************************/ ! /** ! * Returns a new instance of Color based on the specified ! * HSB values. ! * ! * @param hue The hue of the HSB value. ! * @param saturation The saturation of the HSB value. ! * @param brightness The brightness of the HSB value. ! * ! * @return The new Color object. ! */ ! public static Color ! getHSBColor(float hue, float saturation, float brightness) ! { ! return(new Color(HSBtoRGB(hue, saturation, brightness))); ! } ! /*************************************************************************/ ! /* ! * Constructors ! */ ! /** ! * Initializes a new instance of Color using the specified ! * red, green, and blue values, which must be given as integers in the ! * range of 0-255. ! * ! * @param red The red component of the RGB value. ! * @param green The green component of the RGB value. ! * @param blue The blue component of the RGB value. ! * ! * @exception IllegalArgumentException If the values are out of range. ! */ ! public ! Color(int red, int green, int blue) ! { ! if ((red < 0) || (red > 255) || (green < 0) || (green > 255) || ! (blue < 0) || (blue > 255)) ! throw new IllegalArgumentException("Bad RGB values"); ! value = blue + (green << 8) + (red << 16); ! } ! public ! Color(int red, int green, int blue, int alpha) ! { ! if ((red < 0) || (red > 255) || (green < 0) || (green > 255) || ! (blue < 0) || (blue > 255)) ! throw new IllegalArgumentException("Bad RGB values"); ! value = blue + (green << 8) + (red << 16) + (alpha << 24); ! } ! /*************************************************************************/ ! /** ! * Initializes a new instance of Color using the specified ! * RGB value. The blue value is in bits 0-7, green in bits 8-15, and ! * red in bits 16-23. The other bits are ignored. ! * ! * @param value The RGB value ! */ ! public ! Color(int value) ! { ! this.value = value; ! } ! public ! Color(int value, boolean hasalpha) ! { ! this.value = value; ! if (! hasalpha) ! this.value |= 0xFF000000; ! } ! /*************************************************************************/ ! /** ! * Initializes a new instance of Color using the specified ! * RGB values. These must be in the range of 0.0-1.0. ! * ! * @param red The red component of the RGB value. ! * @param green The green component of the RGB value. ! * @param blue The blue component of the RGB value. ! * ! * @exception IllegalArgumentException If the values are out of range. ! */ ! public ! Color(float red, float green, float blue) ! { ! if ((red < 0.0) || (red > 1.0) || (green < 0.0) || (green > 1.0) || ! (blue < 0.0) || (blue > 1.0)) ! throw new IllegalArgumentException("Bad RGB values"); ! int redval = (int)(255 * red); ! int greenval = (int)(255 * green); ! int blueval = (int)(255 * blue); ! value = blueval + (greenval << 8) + (redval << 16); ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * Returns the red value for this color. ! * ! * @return The red value for this color. ! */ ! public int ! getRed() ! { ! int redval = (value & redmask) >> 16; ! return(redval); ! } ! /*************************************************************************/ ! /** ! * Returns the green value for this color. ! * ! * @return The green value for this color. ! */ ! public int ! getGreen() ! { ! int greenval = (value & greenmask) >> 8; ! return(greenval); ! } ! /*************************************************************************/ ! /** ! * Returns the blue value for this color. ! * ! * @return The blue value for this color. ! */ ! public int ! getBlue() ! { ! int blueval = (value & bluemask); ! return(blueval); ! } ! public int ! getAlpha() ! { ! int alphaval = (value & alphamask); ! return(alphaval); ! } ! public int ! getTransparency() ! { ! if (getAlpha() == 0xFF) ! return Transparency.OPAQUE; ! else ! return Transparency.TRANSLUCENT; ! } ! /*************************************************************************/ ! /** ! * Returns the RGB value for this color. The blue value will be in bits ! * 0-7, green in 8-15, and red in 6-23. The upper bits should be ignored. ! * ! * @return The RGB value for this color. ! */ ! public int ! getRGB() ! { ! return(value); ! } ! /*************************************************************************/ ! /** ! * Returns a brighter version of this color. This is done by increasing ! * the RGB values by an arbitrary scale factor. Note that this method ! * and the darker() method are not necessarily inverses. ! * ! * @return A brighter version of this color. ! */ ! public Color ! brighter() ! { ! return new Color(Math.min(255, getRed() + BRIGHT_STEP), ! Math.min(255, getGreen() + BRIGHT_STEP), ! Math.min(255, getBlue() + BRIGHT_STEP), ! getAlpha()); ! } ! /*************************************************************************/ ! /** ! * Returns a darker version of this color. This is done by decreasing ! * the RGB values by an arbitrary scale factor. Note that this method ! * and the brighter() method are not necessarily inverses. ! * ! * @return A darker version of this color. ! */ ! public Color ! darker() ! { ! return new Color(Math.max(0, getRed() - BRIGHT_STEP), ! Math.max(0, getGreen() - BRIGHT_STEP), ! Math.max(0, getBlue() - BRIGHT_STEP), ! getAlpha()); ! } ! /*************************************************************************/ ! /** ! * Returns a hash value for this color. ! * ! * @return A hash value for this color. ! */ ! public int ! hashCode() ! { ! return(value); ! } ! /*************************************************************************/ ! /** ! * Tests this object for equality against the specified object. This will ! * be true if and only if the specified object is an instance of ! * Color and has the same red, green, and blue values as ! * this object. ! * ! * @return true if the specified object is equal to this one, ! * false otherwise. ! */ ! public boolean ! equals(Object obj) ! { ! if (!(obj instanceof Color)) ! return(false); ! Color c = (Color)obj; ! return value == c.value; ! } ! /*************************************************************************/ ! /** ! * Returns a string representation of this object. ! * ! * @return A string representation of this object. ! */ ! public String ! toString() ! { ! return(getClass().getName() + "(red=" + getRed() + ",green=" + getGreen() + ! ",blue=" + getBlue() + ")"); ! } } // class Color - --- 38,1003 ---- package java.awt; ! import java.awt.color.ColorSpace; ! import java.awt.geom.AffineTransform; ! import java.awt.geom.Rectangle2D; ! import java.awt.image.ColorModel; ! import java.io.Serializable; /** ! * This class represents a color value in the AWT system. It uses the sRGB ! * (standard Red-Green-Blue) system, along with an alpha value ranging from ! * transparent (0.0f or 0) and opaque (1.0f or 255). The color is not ! * pre-multiplied by the alpha value an any of the accessor methods. Further ! * information about sRGB can be found at ! * ! * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html. ! * ! * @author Aaron M. Renn ! * @see ColorSpace ! * @see AlphaComposite ! * @since 1.0 ! * @status updated to 1.4 ! */ ! public class Color implements Paint, Serializable ! { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 118526816881161077L; ! /** Constant for the color white: R=255, G=255, B=255. */ ! public static final Color white = new Color(0xffffff, false); ! /** ! * Constant for the color white: R=255, G=255, B=255. ! * ! * @since 1.4 ! */ ! public static final Color WHITE = white; ! /** Constant for the color light gray: R=192, G=192, B=192. */ ! public static final Color lightGray = new Color(0xc0c0c0, false); ! /** ! * Constant for the color light gray: R=192, G=192, B=192. ! * ! * @since 1.4 ! */ ! public static final Color LIGHT_GRAY = lightGray; ! /** Constant for the color gray: R=128, G=128, B=128. */ ! public static final Color gray = new Color(0x808080, false); ! /** ! * Constant for the color gray: R=128, G=128, B=128. ! * ! * @since 1.4 ! */ ! public static final Color GRAY = gray; ! /** Constant for the color dark gray: R=64, G=64, B=64. */ ! public static final Color darkGray = new Color(0x404040, false); ! /** ! * Constant for the color dark gray: R=64, G=64, B=64. ! * ! * @since 1.4 ! */ ! public static final Color DARK_GRAY = darkGray; ! /** Constant for the color black: R=0, G=0, B=0. */ ! public static final Color black = new Color(0x000000, false); ! /** ! * Constant for the color black: R=0, G=0, B=0. ! * ! * @since 1.4 ! */ ! public static final Color BLACK = black; ! /** Constant for the color red: R=255, G=0, B=0. */ ! public static final Color red = new Color(0xff0000, false); ! /** ! * Constant for the color red: R=255, G=0, B=0. ! * ! * @since 1.4 ! */ ! public static final Color RED = red; ! /** Constant for the color pink: R=255, G=175, B=175. */ ! public static final Color pink = new Color(0xffafaf, false); ! /** ! * Constant for the color pink: R=255, G=175, B=175. ! * ! * @since 1.4 ! */ ! public static final Color PINK = pink; ! /** Constant for the color orange: R=255, G=200, B=0. */ ! public static final Color orange = new Color(0xffc800, false); ! /** ! * Constant for the color orange: R=255, G=200, B=0. ! * ! * @since 1.4 ! */ ! public static final Color ORANGE = orange; ! /** Constant for the color yellow: R=255, G=255, B=0. */ ! public static final Color yellow = new Color(0xffff00, false); ! /** ! * Constant for the color yellow: R=255, G=255, B=0. ! * ! * @since 1.4 ! */ ! public static final Color YELLOW = yellow; ! /** Constant for the color green: R=0, G=255, B=0. */ ! public static final Color green = new Color(0x00ff00, false); ! /** ! * Constant for the color green: R=0, G=255, B=0. ! * ! * @since 1.4 ! */ ! public static final Color GREEN = green; ! /** Constant for the color magenta: R=255, G=0, B=255. */ ! public static final Color magenta = new Color(0xff00ff, false); ! /** ! * Constant for the color magenta: R=255, G=0, B=255. ! * ! * @since 1.4 ! */ ! public static final Color MAGENTA = magenta; ! /** Constant for the color cyan: R=0, G=255, B=255. */ ! public static final Color cyan = new Color(0x00ffff, false); ! /** ! * Constant for the color cyan: R=0, G=255, B=255. ! * ! * @since 1.4 ! */ ! public static final Color CYAN = cyan; ! /** Constant for the color blue: R=0, G=0, B=255. */ ! public static final Color blue = new Color(0x0000ff, false); ! /** ! * Constant for the color blue: R=0, G=0, B=255. ! * ! * @since 1.4 ! */ ! public static final Color BLUE = blue; ! /** Internal mask for red. */ ! private static final int RED_MASK = 255 << 16; ! /** Internal mask for green. */ ! private static final int GREEN_MASK = 255 << 8; ! /** Internal mask for blue. */ ! private static final int BLUE_MASK = 255; ! /** Internal mask for alpha. Package visible for use in subclass. */ ! static final int ALPHA_MASK = 255 << 24; ! /** Amount to scale a color by when brightening or darkening. */ ! private static final float BRIGHT_SCALE = 0.7f; ! /** ! * The color value, in sRGB. Note that the actual color may be more ! * precise if frgbvalue or fvalue is non-null. This class stores alpha, red, ! * green, and blue, each 0-255, packed in an int. However, the subclass ! * SystemColor stores an index into an array. Therefore, for serial ! * compatibility (and because of poor design on Sun's part), this value ! * cannot be used directly; instead you must use getRGB(). ! * ! * @see #getRGB() ! * @serial the value of the color, whether an RGB literal or array index ! */ ! final int value; ! /** ! * The color value, in sRGB. This may be null if the color was constructed ! * with ints; and it does not include alpha. This stores red, green, and ! * blue, in the range 0.0f - 1.0f. ! * ! * @see #getRGBColorComponents(float[]) ! * @see #getRGBComponents(float[]) ! * @serial the rgb components of the value ! * @since 1.2 ! */ ! private float[] frgbvalue; ! /** ! * The color value, in the native ColorSpace components. This may be null ! * if the color was constructed with ints or in the sRGB color space; and ! * it does not include alpha. ! * ! * @see #getRGBColorComponents(float[]) ! * @see #getRGBComponents(float[]) ! * @serial the original color space components of the color ! * @since 1.2 ! */ ! private float[] fvalue; ! /** ! * The alpha value. This is in the range 0.0f - 1.0f, but is invalid if ! * deserialized as 0.0 when frgbvalue is null. ! * ! * @see #getRGBComponents(float[]) ! * @see #getComponents(float[]) ! * @serial the alpha component of this color ! * @since 1.2 ! */ ! private final float falpha; ! /** ! * The ColorSpace. Null means the default sRGB space. ! * ! * @see #getColor(String) ! * @see #getColorSpace() ! * @see #getColorComponents(float[]) ! * @serial the color space for this color ! * @since 1.2 ! */ ! private final ColorSpace cs; ! /** ! * The paint context for this solid color. Package visible for use in ! * subclass. ! */ ! transient ColorPaintContext context; ! /** ! * Initializes a new instance of Color using the specified ! * red, green, and blue values, which must be given as integers in the ! * range of 0-255. Alpha will default to 255 (opaque). When drawing to ! * screen, the actual color may be adjusted to the best match of hardware ! * capabilities. ! * ! * @param red the red component of the RGB value ! * @param green the green component of the RGB value ! * @param blue the blue component of the RGB value ! * @throws IllegalArgumentException if the values are out of range 0-255 ! * @see #getRed() ! * @see #getGreen() ! * @see #getBlue() ! * @see #getRGB() ! * @see #Color(int, int, int, int) ! */ ! public Color(int red, int green, int blue) ! { ! this(red, green, blue, 255); ! } ! /** ! * Initializes a new instance of Color using the specified ! * red, green, blue, and alpha values, which must be given as integers in ! * the range of 0-255. When drawing to screen, the actual color may be ! * adjusted to the best match of hardware capabilities. ! * ! * @param red the red component of the RGB value ! * @param green the green component of the RGB value ! * @param blue the blue component of the RGB value ! * @param alpha the alpha value of the color ! * @throws IllegalArgumentException if the values are out of range 0-255 ! * @see #getRed() ! * @see #getGreen() ! * @see #getBlue() ! * @see #getAlpha() ! * @see #getRGB() ! */ ! public Color(int red, int green, int blue, int alpha) ! { ! if ((red & 255) != red || (green & 255) != green || (blue & 255) != blue ! || (alpha & 255) != alpha) ! throw new IllegalArgumentException("Bad RGB values"); ! value = (alpha << 24) | (red << 16) | (green << 8) | blue; ! falpha = 1; ! cs = null; ! } ! /** ! * Initializes a new instance of Color using the specified ! * RGB value. The blue value is in bits 0-7, green in bits 8-15, and ! * red in bits 16-23. The other bits are ignored. The alpha value is set ! * to 255 (opaque). When drawing to screen, the actual color may be ! * adjusted to the best match of hardware capabilities. ! * ! * @param value the RGB value ! * @see ColorModel#getRGBdefault() ! * @see #getRed() ! * @see #getGreen() ! * @see #getBlue() ! * @see #getRGB() ! * @see #Color(int, boolean) ! */ ! public Color(int value) ! { ! this(value, false); ! } ! /** ! * Initializes a new instance of Color using the specified ! * RGB value. The blue value is in bits 0-7, green in bits 8-15, and ! * red in bits 16-23. The alpha value is in bits 24-31, unless hasalpha ! * is false, in which case alpha is set to 255. When drawing to screen, the ! * actual color may be adjusted to the best match of hardware capabilities. ! * ! * @param value the RGB value ! * @param hasalpha true if value includes the alpha ! * @see ColorModel#getRGBdefault() ! * @see #getRed() ! * @see #getGreen() ! * @see #getBlue() ! * @see #getAlpha() ! * @see #getRGB() ! */ ! public Color(int value, boolean hasalpha) ! { ! // Note: SystemColor calls this constructor, setting falpha to 0; but ! // code in getRGBComponents correctly reports falpha as 1.0 to the user ! // for all instances of SystemColor since frgbvalue is left null here. ! if (hasalpha) ! falpha = ((value & ALPHA_MASK) >> 24) / 255f; ! else ! { ! value |= ALPHA_MASK; ! falpha = 1; ! } ! this.value = value; ! cs = null; ! } ! /** ! * Initializes a new instance of Color using the specified ! * RGB values. These must be in the range of 0.0-1.0. Alpha is assigned ! * the value of 1.0 (opaque). When drawing to screen, the actual color may ! * be adjusted to the best match of hardware capabilities. ! * ! * @param red the red component of the RGB value ! * @param green the green component of the RGB value ! * @param blue the blue component of the RGB value ! * @throws IllegalArgumentException tf the values are out of range 0.0f-1.0f ! * @see #getRed() ! * @see #getGreen() ! * @see #getBlue() ! * @see #getRGB() ! * @see #Color(float, float, float, float) ! */ ! public Color(float red, float green, float blue) ! { ! this(red, green, blue, 1.0f); ! } ! /** ! * Initializes a new instance of Color using the specified ! * RGB and alpha values. These must be in the range of 0.0-1.0. When drawing ! * to screen, the actual color may be adjusted to the best match of ! * hardware capabilities. ! * ! * @param red the red component of the RGB value ! * @param green the green component of the RGB value ! * @param blue the blue component of the RGB value ! * @param alpha the alpha value of the color ! * @throws IllegalArgumentException tf the values are out of range 0.0f-1.0f ! * @see #getRed() ! * @see #getGreen() ! * @see #getBlue() ! * @see #getAlpha() ! * @see #getRGB() ! */ ! public Color(float red, float green, float blue, float alpha) ! { ! value = convert(red, green, blue, alpha); ! frgbvalue = new float[] {red, green, blue}; ! falpha = alpha; ! cs = null; ! } ! /** ! * Creates a color in the given ColorSpace with the specified alpha. The ! * array must be non-null and have enough elements for the color space ! * (for example, RGB requires 3 elements, CMYK requires 4). When drawing ! * to screen, the actual color may be adjusted to the best match of ! * hardware capabilities. ! * ! * @param space the color space of components ! * @param components the color components, except alpha ! * @param alpha the alpha value of the color ! * @throws NullPointerException if cpsace or components is null ! * @throws ArrayIndexOutOfBoundsException if components is too small ! * @throws IllegalArgumentException if alpha or any component is out of range ! * @see #getComponents(float[]) ! * @see #getColorComponents(float[]) ! */ ! public Color(ColorSpace space, float[] components, float alpha) ! { ! frgbvalue = space.toRGB(components); ! fvalue = components; ! falpha = alpha; ! cs = space; ! value = convert(frgbvalue[0], frgbvalue[1], frgbvalue[2], alpha); ! } ! /** ! * Returns the red value for this color, as an integer in the range 0-255 ! * in the sRGB color space. ! * ! * @return the red value for this color ! * @see #getRGB() ! */ ! public int getRed() ! { ! // Do not inline getRGB() to value, because of SystemColor. ! return (getRGB() & RED_MASK) >> 16; ! } ! /** ! * Returns the green value for this color, as an integer in the range 0-255 ! * in the sRGB color space. ! * ! * @return the green value for this color ! * @see #getRGB() ! */ ! public int getGreen() ! { ! // Do not inline getRGB() to value, because of SystemColor. ! return (getRGB() & GREEN_MASK) >> 8; ! } ! /** ! * Returns the blue value for this color, as an integer in the range 0-255 ! * in the sRGB color space. ! * ! * @return the blue value for this color ! * @see #getRGB() ! */ ! public int getBlue() ! { ! // Do not inline getRGB() to value, because of SystemColor. ! return getRGB() & BLUE_MASK; ! } ! /** ! * Returns the alpha value for this color, as an integer in the range 0-255. ! * ! * @return the alpha value for this color ! * @see #getRGB() ! */ ! public int getAlpha() ! { ! // Do not inline getRGB() to value, because of SystemColor. ! return (getRGB() & ALPHA_MASK) >> 24; ! } ! /** ! * Returns the RGB value for this color, in the sRGB color space. The blue ! * value will be in bits 0-7, green in 8-15, red in 6-23, and alpha value in ! * 24-31. ! * ! * @return the RGB value for this color ! * @see ColorModel#getRGBdefault() ! * @see #getRed() ! * @see #getGreen() ! * @see #getBlue() ! * @see #getAlpha() ! */ ! public int getRGB() ! { ! return value; ! } ! /** ! * Returns a brighter version of this color. This is done by increasing the ! * RGB values by an arbitrary scale factor. The new color is opaque (an ! * alpha of 255). Note that this method and the darker() ! * method are not necessarily inverses. ! * ! * @return a brighter version of this color ! * @see #darker() ! */ ! public Color brighter() ! { ! // Do not inline getRGB() to this.value, because of SystemColor. ! int value = getRGB(); ! int red = (value & RED_MASK) >> 16; ! int green = (value & GREEN_MASK) >> 8; ! int blue = value & BLUE_MASK; ! // We have to special case 0-2 because they won't scale by division. ! red = red < 3 ? 3 : (int) Math.min(255, red / BRIGHT_SCALE); ! green = green < 3 ? 3 : (int) Math.min(255, green / BRIGHT_SCALE); ! blue = blue < 3 ? 3 : (int) Math.min(255, blue / BRIGHT_SCALE); ! return new Color(red, green, blue, 255); ! } ! /** ! * Returns a darker version of this color. This is done by decreasing the ! * RGB values by an arbitrary scale factor. The new color is opaque (an ! * alpha of 255). Note that this method and the brighter() ! * method are not necessarily inverses. ! * ! * @return a darker version of this color ! * @see #brighter() ! */ ! public Color darker() ! { ! // Do not inline getRGB() to this.value, because of SystemColor. ! int value = getRGB(); ! return new Color((int) (((value & RED_MASK) >> 16) * BRIGHT_SCALE), ! (int) (((value & GREEN_MASK) >> 8) * BRIGHT_SCALE), ! (int) ((value & BLUE_MASK) * BRIGHT_SCALE), 255); ! } ! /** ! * Returns a hash value for this color. This is simply the color in 8-bit ! * precision, in the format 0xAARRGGBB (alpha, red, green, blue). ! * ! * @return a hash value for this color ! */ ! public int hashCode() ! { ! return value; ! } ! /** ! * Tests this object for equality against the specified object. This will ! * be true if and only if the specified object is an instance of ! * Color and has the same 8-bit integer red, green, and blue ! * values as this object. Note that two colors may be slightly different ! * as float values, but round to the same integer values. Also note that ! * this does not accurately compare SystemColors, since that class does ! * not store its internal data in RGB format like regular colors. ! * ! * @param obj the object to compare to ! * @return true if the specified object is semantically equal to this one ! */ ! public boolean equals(Object obj) ! { ! return obj instanceof Color && ((Color) obj).value == value; ! } ! /** ! * Returns a string representation of this object. Subclasses may return ! * any desired format, except for null, but this implementation returns ! * getClass().getName() + "[r=" + getRed() + ",g=" + getGreen() ! * + ",b=" + getBlue() + ']'. ! * ! * @return a string representation of this object ! */ ! public String toString() ! { ! return getClass().getName() + "[r=" + ((value & RED_MASK) >> 16) ! + ",g=" + ((value & GREEN_MASK) >> 8) + ",b=" + (value & BLUE_MASK) ! + ']'; ! } ! /** ! * Converts the specified string to a number, using Integer.decode, and ! * creates a new instance of Color from the value. The alpha ! * value will be 255 (opaque). ! * ! * @param str the numeric color string ! * @return a new instance of Color for the string ! * @throws NumberFormatException if the string cannot be parsed ! * @throws NullPointerException if the string is null ! * @see Integer#decode(String) ! * @see #Color(int) ! * @since 1.1 ! */ ! public static Color decode(String str) ! { ! return new Color(Integer.decode(str).intValue(), false); ! } ! /** ! * Returns a new instance of Color from the value of the ! * system property named by the specified string. If the property does not ! * exist, or cannot be parsed, then null will be returned. ! * ! * @param prop the system property to retrieve ! * @throws SecurityException if getting the property is denied ! * @see #getColor(String, Color) ! * @see Integer#getInteger(String) ! */ ! public static Color getColor(String prop) ! { ! return getColor(prop, null); ! } ! /** ! * Returns a new instance of Color from the value of the ! * system property named by the specified string. If the property does ! * not exist, or cannot be parsed, then the default color value will be ! * returned. ! * ! * @param prop the system property to retrieve ! * @param defcolor the default color ! * @throws SecurityException if getting the property is denied ! * @see Integer#getInteger(String) ! */ ! public static Color getColor(String prop, Color defcolor) ! { ! Integer val = Integer.getInteger(prop, null); ! return val == null ? defcolor ! : new Color(val.intValue(), false); ! } ! /** ! * Returns a new instance of Color from the value of the ! * system property named by the specified string. If the property does ! * not exist, or cannot be parsed, then the default RGB value will be ! * used to create a return value. ! * ! * @param prop the system property to retrieve ! * @param defrgb the default RGB value ! * @throws SecurityException if getting the property is denied ! * @see #getColor(String, Color) ! * @see Integer#getInteger(String, int) ! */ ! public static Color getColor(String prop, int defrgb) ! { ! Color c = getColor(prop, null); ! return c == null ? new Color(defrgb, false) : c; ! } ! /** ! * Converts from the HSB (hue, saturation, brightness) color model to the ! * RGB (red, green, blue) color model. The hue may be any floating point; ! * it's fractional portion is used to select the angle in the HSB model. ! * The saturation and brightness must be between 0 and 1. The result is ! * suitable for creating an RGB color with the one-argument constructor. ! * ! * @param hue the hue of the HSB value ! * @param saturation the saturation of the HSB value ! * @param brightness the brightness of the HSB value ! * @return the RGB value ! * @see #getRGB() ! * @see #Color(int) ! * @see ColorModel#getRGBdefault() ! */ ! public static int HSBtoRGB(float hue, float saturation, float brightness) ! { ! if (saturation == 0) ! return convert(brightness, brightness, brightness, 0); ! if (saturation < 0 || saturation > 1 || brightness < 0 || brightness > 1) ! throw new IllegalArgumentException(); ! hue = hue - (float) Math.floor(hue); ! int i = (int) (6 * hue); ! float f = 6 * hue - i; ! float p = brightness * (1 - saturation); ! float q = brightness * (1 - saturation * f); ! float t = brightness * (1 - saturation * (1 - f)); ! switch (i) ! { ! case 0: ! return convert(brightness, t, p, 0); ! case 1: ! return convert(q, brightness, p, 0); ! case 2: ! return convert(p, brightness, t, 0); ! case 3: ! return convert(p, q, brightness, 0); ! case 4: ! return convert(t, p, brightness, 0); ! case 5: ! return convert(brightness, p, q, 0); ! default: ! throw new InternalError("impossible"); ! } ! } ! /** ! * Converts from the RGB (red, green, blue) color model to the HSB (hue, ! * saturation, brightness) color model. If the array is null, a new one ! * is created, otherwise it is recycled. The results will be in the range ! * 0.0-1.0 if the inputs are in the range 0-255. ! * ! * @param red the red part of the RGB value ! * @param green the green part of the RGB value ! * @param blue the blue part of the RGB value ! * @param array an array for the result (at least 3 elements), or null ! * @return the array containing HSB value ! * @throws ArrayIndexOutOfBoundsException of array is too small ! * @see #getRGB() ! * @see #Color(int) ! * @see ColorModel#getRGBdefault() ! */ ! public static float[] RGBtoHSB(int red, int green, int blue, float array[]) ! { ! if (array == null) ! array = new float[3]; ! // Calculate brightness. ! int min; ! int max; ! if (red < green) ! { ! min = red; ! max = green; ! } ! else ! { ! min = green; ! max = red; ! } ! if (blue > max) ! max = blue; ! else if (blue < min) ! min = blue; ! array[2] = max / 255f; ! // Calculate saturation. ! if (max == 0) ! array[1] = 0; ! else ! array[1] = (max - min) / max; ! // Calculate hue. ! if (array[1] == 0) ! array[0] = 0; ! else ! { ! float delta = (max - min) * 6; ! if (red == max) ! array[0] = (green - blue) / delta; ! else if (green == max) ! array[0] = 1 / 3 + (blue - red) / delta; ! else ! array[0] = 2 / 3 + (red - green) / delta; ! if (array[0] < 0) ! array[0]++; ! } ! return array; ! } ! /** ! * Returns a new instance of Color based on the specified ! * HSB values. The hue may be any floating point; it's fractional portion ! * is used to select the angle in the HSB model. The saturation and ! * brightness must be between 0 and 1. ! * ! * @param hue the hue of the HSB value ! * @param saturation the saturation of the HSB value ! * @param brightness the brightness of the HSB value ! * @return the new Color object ! */ ! public static Color getHSBColor(float hue, float saturation, ! float brightness) ! { ! return new Color(HSBtoRGB(hue, saturation, brightness), false); ! } ! /** ! * Returns a float array with the red, green, and blue components, and the ! * alpha value, in the default sRGB space, with values in the range 0.0-1.0. ! * If the array is null, a new one is created, otherwise it is recycled. ! * ! * @param array the array to put results into (at least 4 elements), or null ! * @return the RGB components and alpha value ! * @throws ArrayIndexOutOfBoundsException if array is too small ! */ ! public float[] getRGBComponents(float[] array) ! { ! if (array == null) ! array = new float[4]; ! getRGBColorComponents(array); ! // Stupid serialization issues require this check. ! array[3] = (falpha == 0 && frgbvalue == null ! ? ((getRGB() & ALPHA_MASK) >> 24) / 255f : falpha); ! return array; ! } ! /** ! * Returns a float array with the red, green, and blue components, in the ! * default sRGB space, with values in the range 0.0-1.0. If the array is ! * null, a new one is created, otherwise it is recycled. ! * ! * @param array the array to put results into (at least 3 elements), or null ! * @return the RGB components ! * @throws ArrayIndexOutOfBoundsException if array is too small ! */ ! public float[] getRGBColorComponents(float[] array) ! { ! if (array == null) ! array = new float[3]; ! else if (array == frgbvalue) ! return array; // Optimization for getColorComponents(float[]). ! if (frgbvalue == null) ! { ! // Do not inline getRGB() to this.value, because of SystemColor. ! int value = getRGB(); ! frgbvalue = new float[] { ((value & RED_MASK) >> 16) / 255f, ! ((value & GREEN_MASK) >> 8) / 255f, ! (value & BLUE_MASK) / 255f }; ! } ! array[0] = frgbvalue[0]; ! array[1] = frgbvalue[1]; ! array[2] = frgbvalue[2]; ! return array; ! } ! /** ! * Returns a float array containing the color and alpha components of this ! * color in the ColorSpace it was created with (the constructors which do ! * not take a ColorSpace parameter use a default sRGB ColorSpace). If the ! * array is null, a new one is created, otherwise it is recycled, and must ! * have at least one more position than components used in the color space. ! * ! * @param array the array to put results into, or null ! * @return the original color space components and alpha value ! * @throws ArrayIndexOutOfBoundsException if array is too small ! */ ! public float[] getComponents(float[] array) ! { ! int numComponents = cs == null ? 3 : cs.getNumComponents(); ! if (array == null) ! array = new float[1 + numComponents]; ! getColorComponents(array); ! // Stupid serialization issues require this check. ! array[numComponents] = (falpha == 0 && frgbvalue == null ! ? ((getRGB() & ALPHA_MASK) >> 24) / 255f : falpha); ! return array; ! } ! /** ! * Returns a float array containing the color components of this color in ! * the ColorSpace it was created with (the constructors which do not take ! * a ColorSpace parameter use a default sRGB ColorSpace). If the array is ! * null, a new one is created, otherwise it is recycled, and must have at ! * least as many positions as used in the color space. ! * ! * @param array the array to put results into, or null ! * @return the original color space components ! * @throws ArrayIndexOutOfBoundsException if array is too small ! */ ! public float[] getColorComponents(float[] array) ! { ! int numComponents = cs == null ? 3 : cs.getNumComponents(); ! if (array == null) ! array = new float[numComponents]; ! if (fvalue == null) // If fvalue is null, cs should be null too. ! fvalue = getRGBColorComponents(frgbvalue); ! System.arraycopy(fvalue, 0, array, 0, numComponents); ! return array; ! } ! /** ! * Returns a float array containing the color and alpha components of this ! * color in the given ColorSpace. If the array is null, a new one is ! * created, otherwise it is recycled, and must have at least one more ! * position than components used in the color space. ! * ! * @param space the color space to translate to ! * @param array the array to put results into, or null ! * @return the color space components and alpha value ! * @throws ArrayIndexOutOfBoundsException if array is too small ! * @throws NullPointerException if space is null ! */ ! public float[] getComponents(ColorSpace space, float[] array) ! { ! int numComponents = space.getNumComponents(); ! if (array == null) ! array = new float[1 + numComponents]; ! getColorComponents(space, array); ! // Stupid serialization issues require this check. ! array[numComponents] = (falpha == 0 && frgbvalue == null ! ? ((getRGB() & ALPHA_MASK) >> 24) / 255f : falpha); ! return array; ! } ! /** ! * Returns a float array containing the color components of this color in ! * the given ColorSpace. If the array is null, a new one is created, ! * otherwise it is recycled, and must have at least as many positions as ! * used in the color space. ! * ! * @param space the color space to translate to ! * @return the color space components ! * @throws ArrayIndexOutOfBoundsException if array is too small ! * @throws NullPointerException if space is null ! */ ! public float[] getColorComponents(ColorSpace space, float[] array) ! { ! float[] components = space.fromRGB(getRGBColorComponents(frgbvalue)); ! if (array == null) ! return components; ! System.arraycopy(components, 0, array, 0, components.length); ! return array; ! } ! /** ! * Returns the color space of this color. Except for the constructor which ! * takes a ColorSpace argument, this will be an implementation of ! * ColorSpace.CS_sRGB. ! * ! * @return the color space ! */ ! public ColorSpace getColorSpace() ! { ! return cs == null ? ColorSpace.getInstance(ColorSpace.CS_sRGB) : cs; ! } ! /** ! * Returns a paint context, used for filling areas of a raster scan with ! * this color. Since the color is constant across the entire rectangle, and ! * since it is always in sRGB space, this implementation returns the same ! * object, regardless of the parameters. Subclasses, however, may have a ! * mutable result. ! * ! * @param cm the requested color model, ignored ! * @param deviceBounds the bounding box in device coordinates, ignored ! * @param userBounds the bounding box in user coordinates, ignored ! * @param xform the bounds transformation, ignored ! * @param hints any rendering hints, ignored ! * @return a context for painting this solid color ! */ ! public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, ! Rectangle2D userBounds, ! AffineTransform xform, ! RenderingHints hints) ! { ! if (context == null) ! context = new ColorPaintContext(value); ! return context; ! } ! /** ! * Returns the transparency level of this color. ! * ! * @return one of {@link #OPAQUE}, {@link #BITMASK}, or {@link #TRANSLUCENT} ! */ ! public int getTransparency() ! { ! // Do not inline getRGB() to this.value, because of SystemColor. ! int alpha = getRGB() & ALPHA_MASK; ! return alpha == (255 << 24) ? OPAQUE : alpha == 0 ? BITMASK : TRANSLUCENT; ! } + /** + * Converts float values to integer value. + * + * @param red the red value + * @param green the green value + * @param blue the blue value + * @param alpha the alpha value + * @return the integer value made of 8-bit sections + * @throws IllegalArgumentException if parameters are out of range 0.0-1.0 + */ + private static int convert(float red, float green, float blue, float alpha) + { + if (red < 0 || red > 1 || green < 0 || green > 1 || blue < 0 || blue > 1 + || alpha < 0 || alpha > 1) + throw new IllegalArgumentException("Bad RGB values"); + int redval = Math.round(255 * red); + int greenval = Math.round(255 * green); + int blueval = Math.round(255 * blue); + int alphaval = Math.round(255 * alpha); + return (alphaval << 24) | (redval << 16) | (greenval << 8) | blueval; + } } // class Color diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ColorPaintContext.java gcc-3.3/libjava/java/awt/ColorPaintContext.java *** gcc-3.2.3/libjava/java/awt/ColorPaintContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/ColorPaintContext.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,103 ---- + /* ColorPaintContext.java -- context for painting solid colors + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.image.ColorModel; + import java.awt.image.Raster; + + /** + * This class provides a paint context which will fill a rectanglar region of + * a raster scan with the given color. However, it is not yet completely + * implemented. + * + * @author Eric Blake + */ + class ColorPaintContext implements PaintContext + { + /** + * The color to fill any raster with. Package visible for use in + * SystemColor. + */ + final int color; + + /** + * Create the context for a given color. + * + * @param c the solid color to use + */ + ColorPaintContext(int c) + { + color = c; + } + + /** + * Release the resources allocated for the paint. As the color is constant, + * there aren't any resources. + */ + public void dispose() + { + } + + /** + * Return the color model of this context. This ignores the model passed + * in the request, since colors are always in sRGB. + * + * @return the context color model + */ + public ColorModel getColorModel() + { + return ColorModel.getRGBdefault(); + } + + /** + * Return a raster containing the colors for the graphics operation. + * + * @param x the x-coordinate, in device space + * @param y the y-coordinate, in device space + * @param w the width, in device space + * @param h the height, in device space + * @return a raster for the given area and color + */ + public Raster getRaster(int x, int y, int w, int h) + { + // XXX Implement. Sun uses undocumented implementation class + // sun.awt.image.IntegerInterleavedRaster. + throw new Error("not implemented"); + } + } // class ColorPaintContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Component.java gcc-3.3/libjava/java/awt/Component.java *** gcc-3.2.3/libjava/java/awt/Component.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/Component.java 2003-01-28 23:47:21.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Component.java -- a graphics component ! Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,155 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt; ! import java.awt.event.*; ! import java.awt.image.*; import java.io.PrintStream; import java.io.PrintWriter; ! import java.lang.reflect.*; import java.util.EventListener; import java.util.Locale; ! import java.util.ResourceBundle; import java.util.Vector; ! import java.awt.peer.ComponentPeer; ! import java.awt.peer.LightweightPeer; ! import java.beans.PropertyChangeSupport; ! import java.beans.PropertyChangeListener; ! // import javax.accessibility.AccessibleContext; /** ! * The root of all evil. ! * ! * Status: Incomplete. The event dispatch mechanism is implemented. All ! * other methods defined in the J2SE 1.3 API javadoc exist, but are mostly ! * incomplete or only stubs; except for methods relating to the Drag and Drop, ! * Input Method, and Accessibility frameworks: These methods are present but ! * commented out. ! */ ! public abstract class Component implements ImageObserver, MenuContainer, ! java.io.Serializable { /** * Constant returned by the getAlignmentY method to indicate ! * that the component wishes to be aligned to the bottom relative to * other components. */ ! public static final float BOTTOM_ALIGNMENT = (float)1.0; /** ! * Constant returned by the getAlignmentY and * getAlignmentX methods to indicate * that the component wishes to be aligned to the center relative to * other components. */ ! public static final float CENTER_ALIGNMENT = (float)0.5; /** * Constant returned by the getAlignmentY method to indicate ! * that the component wishes to be aligned to the top relative to * other components. */ ! public static final float TOP_ALIGNMENT = (float)0.0; /** * Constant returned by the getAlignmentX method to indicate * that the component wishes to be aligned to the right relative to * other components. */ ! public static final float RIGHT_ALIGNMENT = (float)1.0; /** * Constant returned by the getAlignmentX method to indicate * that the component wishes to be aligned to the left relative to * other components. */ ! public static final float LEFT_ALIGNMENT = (float)0.0; ! /* Make the treelock a String so that it can easily be identified ! in debug dumps. We clone the String in order to avoid a conflict in ! the unlikely event that some other package uses exactly the same string ! as a lock object. */ ! static Object treeLock = new String("AWT_TREE_LOCK"); ! /* Serialized fields from the serialization spec. */ ! // FIXME: Default values? int x; int y; int width; int height; Color foreground; Color background; Font font; Font peerFont; Cursor cursor; Locale locale; ! boolean visible = true; // default (except for Window) boolean enabled = true; boolean valid; ! boolean hasFocus; ! //DropTarget dropTarget; Vector popups; String name; boolean nameExplicitlySet; Dimension minSize; Dimension prefSize; ! boolean newEventsOnly; ! long eventMask = AWTEvent.PAINT_EVENT_MASK; PropertyChangeSupport changeSupport; boolean isPacked; - int componentSerializedDataVersion; - /* AccessibleContext accessibleContext; */ ! /* Anything else is non-serializable, and should be declared "transient". */ ! transient Container parent; ! transient java.awt.peer.ComponentPeer peer; transient ComponentListener componentListener; transient FocusListener focusListener; transient KeyListener keyListener; transient MouseListener mouseListener; transient MouseMotionListener mouseMotionListener; transient InputMethodListener inputMethodListener; transient HierarchyListener hierarchyListener; transient HierarchyBoundsListener hierarchyBoundsListener; transient ComponentOrientation orientation = ComponentOrientation.UNKNOWN; /** ! * Default constructor for subclasses. */ protected Component() { --- 35,567 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt; ! ! import java.awt.dnd.DropTarget; ! import java.awt.event.ComponentEvent; ! import java.awt.event.ComponentListener; ! import java.awt.event.FocusEvent; ! import java.awt.event.FocusListener; ! import java.awt.event.HierarchyBoundsListener; ! import java.awt.event.HierarchyEvent; ! import java.awt.event.HierarchyListener; ! import java.awt.event.KeyEvent; ! import java.awt.event.KeyListener; ! import java.awt.event.InputMethodEvent; ! import java.awt.event.InputMethodListener; ! import java.awt.event.MouseEvent; ! import java.awt.event.MouseListener; ! import java.awt.event.MouseMotionListener; ! import java.awt.event.MouseWheelListener; ! import java.awt.event.MouseWheelEvent; ! import java.awt.event.PaintEvent; ! import java.awt.im.InputContext; ! import java.awt.im.InputMethodRequests; ! import java.awt.image.BufferStrategy; ! import java.awt.image.ColorModel; ! import java.awt.image.ImageObserver; ! import java.awt.image.ImageProducer; ! import java.awt.image.VolatileImage; ! import java.awt.peer.ComponentPeer; ! import java.awt.peer.LightweightPeer; ! import java.beans.PropertyChangeListener; ! import java.beans.PropertyChangeSupport; ! import java.io.ObjectInputStream; ! import java.io.IOException; ! import java.io.ObjectOutputStream; import java.io.PrintStream; import java.io.PrintWriter; ! import java.io.Serializable; ! import java.lang.reflect.Array; ! import java.util.Collections; import java.util.EventListener; + import java.util.HashSet; + import java.util.Iterator; import java.util.Locale; ! import java.util.Set; import java.util.Vector; ! import javax.accessibility.Accessible; ! import javax.accessibility.AccessibleComponent; ! import javax.accessibility.AccessibleContext; ! import javax.accessibility.AccessibleRole; ! import javax.accessibility.AccessibleState; ! import javax.accessibility.AccessibleStateSet; /** ! * The root of all evil. All graphical representations are subclasses of this ! * giant class, which is designed for screen display and user interaction. ! * This class can be extended directly to build a lightweight component (one ! * not associated with a native window); lightweight components must reside ! * inside a heavyweight window. ! * ! *

    This class is Serializable, which has some big implications. A user can ! * save the state of all graphical components in one VM, and reload them in ! * another. Note that this class will only save Serializable listeners, and ! * ignore the rest, without causing any serialization exceptions. However, by ! * making a listener serializable, and adding it to another element, you link ! * in that entire element to the state of this component. To get around this, ! * use the idiom shown in the example below - make listeners non-serializable ! * in inner classes, rather than using this object itself as the listener, if ! * external objects do not need to save the state of this object. ! * ! *

    !  * import java.awt.*;
    !  * import java.awt.event.*;
    !  * import java.io.Serializable;
    !  * class MyApp implements Serializable
    !  * {
    !  *   BigObjectThatShouldNotBeSerializedWithAButton bigOne;
    !  *   // Serializing aButton will not suck in an instance of MyApp, with its
    !  *   // accompanying field bigOne.
    !  *   Button aButton = new Button();
    !  *   class MyActionListener implements ActionListener
    !  *   {
    !  *     public void actionPerformed(ActionEvent e)
    !  *     {
    !  *       System.out.println("Hello There");
    !  *     }
    !  *   }
    !  *   MyApp()
    !  *   {
    !  *     aButton.addActionListener(new MyActionListener());
    !  *   }
    !  * }
    !  *
    !  * 

    Status: Incomplete. The event dispatch mechanism is implemented. All ! * other methods defined in the J2SE 1.3 API javadoc exist, but are mostly ! * incomplete or only stubs; except for methods relating to the Drag and ! * Drop, Input Method, and Accessibility frameworks: These methods are ! * present but commented out. ! * ! * @author original author unknown ! * @author Eric Blake ! * @since 1.0 ! * @status still missing 1.4 support ! */ ! public abstract class Component ! implements ImageObserver, MenuContainer, Serializable { + // Word to the wise - this file is huge. Search for '\f' (^L) for logical + // sectioning by fields, public API, private API, and nested classes. + + + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -7644114512714619750L; + /** * Constant returned by the getAlignmentY method to indicate ! * that the component wishes to be aligned to the top relative to * other components. + * + * @see #getAlignmentY() */ ! public static final float TOP_ALIGNMENT = 0; /** ! * Constant returned by the getAlignmentY and * getAlignmentX methods to indicate * that the component wishes to be aligned to the center relative to * other components. + * + * @see #getAlignmentX() + * @see #getAlignmentY() */ ! public static final float CENTER_ALIGNMENT = 0.5f; /** * Constant returned by the getAlignmentY method to indicate ! * that the component wishes to be aligned to the bottom relative to * other components. + * + * @see #getAlignmentY() */ ! public static final float BOTTOM_ALIGNMENT = 1; /** * Constant returned by the getAlignmentX method to indicate * that the component wishes to be aligned to the right relative to * other components. + * + * @see #getAlignmentX() */ ! public static final float RIGHT_ALIGNMENT = 1; /** * Constant returned by the getAlignmentX method to indicate * that the component wishes to be aligned to the left relative to * other components. + * + * @see #getAlignmentX() */ ! public static final float LEFT_ALIGNMENT = 0; ! /** ! * Make the treelock a String so that it can easily be identified ! * in debug dumps. We clone the String in order to avoid a conflict in ! * the unlikely event that some other package uses exactly the same string ! * as a lock object. ! */ ! static final Object treeLock = new String("AWT_TREE_LOCK"); ! // Serialized fields from the serialization spec. ! ! /** ! * The x position of the component in the parent's coordinate system. ! * ! * @see #getLocation() ! * @serial the x position ! */ int x; + + /** + * The y position of the component in the parent's coordinate system. + * + * @see #getLocation() + * @serial the y position + */ int y; + + /** + * The component width. + * + * @see #getSize() + * @serial the width + */ int width; + + /** + * The component height. + * + * @see #getSize() + * @serial the height + */ int height; + + /** + * The foreground color for the component. This may be null. + * + * @see #getForeground() + * @see #setForeground(Color) + * @serial the foreground color + */ Color foreground; + + /** + * The background color for the component. This may be null. + * + * @see #getBackground() + * @see #setBackground(Color) + * @serial the background color + */ Color background; + + /** + * The default font used in the component. This may be null. + * + * @see #getFont() + * @see #setFont(Font) + * @serial the font + */ Font font; + + /** + * The font in use by the peer, or null if there is no peer. + * + * @serial the peer's font + */ Font peerFont; + + /** + * The cursor displayed when the pointer is over this component. This may + * be null. + * + * @see #getCursor() + * @see #setCursor(Cursor) + */ Cursor cursor; + + /** + * The locale for the component. + * + * @see #getLocale() + * @see #setLocale(Locale) + */ Locale locale; ! ! /** ! * True if the object should ignore repaint events (usually because it is ! * not showing). ! * ! * @see #getIgnoreRepaint() ! * @see #setIgnoreRepaint(boolean) ! * @serial true to ignore repaints ! * @since 1.4 ! */ ! boolean ignoreRepaint; ! ! /** ! * True when the object is visible (although it is only showing if all ! * ancestors are likewise visible). For component, this defaults to true. ! * ! * @see #isVisible() ! * @see #setVisible(boolean) ! * @serial true if visible ! */ ! boolean visible = true; ! ! /** ! * True if the object is enabled, meaning it can interact with the user. ! * For component, this defaults to true. ! * ! * @see #isEnabled() ! * @see #setEnabled(boolean) ! * @serial true if enabled ! */ boolean enabled = true; + + /** + * True if the object is valid. This is set to false any time a size + * adjustment means the component need to be layed out again. + * + * @see #isValid() + * @see #validate() + * @see #invalidate() + * @serial true if layout is valid + */ boolean valid; ! ! /** ! * The DropTarget for drag-and-drop operations. ! * ! * @see #getDropTarget() ! * @see #setDropTarget(DropTarget) ! * @serial the drop target, or null ! * @since 1.2 ! */ ! DropTarget dropTarget; ! ! /** ! * The list of popup menus for this component. ! * ! * @see #add(PopupMenu) ! * @serial the list of popups ! */ Vector popups; + + /** + * The component's name. May be null, in which case a default name is + * generated on the first use. + * + * @see #getName() + * @see #setName(String) + * @serial the name + */ String name; + + /** + * True once the user has set the name. Note that the user may set the name + * to null. + * + * @see #name + * @see #getName() + * @see #setName(String) + * @serial true if the name has been explicitly set + */ boolean nameExplicitlySet; + + /** + * Indicates if the object can be focused. Defaults to true for components. + * + * @see #isFocusable() + * @see #setFocusable(boolean) + * @since 1.4 + */ + boolean focusable = true; + + /** + * Tracks whether this component uses default focus traversal, or has a + * different policy. + * + * @see #isFocusTraversableOverridden() + * @since 1.4 + */ + int isFocusTraversableOverridden; + + /** + * The focus traversal keys, if not inherited from the parent or default + * keyboard manager. These sets will contain only AWTKeyStrokes that + * represent press and release events to use as focus control. + * + * @see #getFocusTraversalKeys(int) + * @see #setFocusTraversalKeys(int, Set) + * @since 1.4 + */ + Set[] focusTraversalKeys; + + /** + * True if focus traversal keys are enabled. This defaults to true for + * Component. If this is true, keystrokes in focusTraversalKeys are trapped + * and processed automatically rather than being passed on to the component. + * + * @see #getFocusTraversalKeysEnabled() + * @see #setFocusTraversalKeysEnabled(boolean) + * @since 1.4 + */ + boolean focusTraversalKeysEnabled = true; + + /** + * Cached information on the minimum size. Should have been transient. + * + * @serial ignore + */ Dimension minSize; + + /** + * Cached information on the preferred size. Should have been transient. + * + * @serial ignore + */ Dimension prefSize; ! ! /** ! * Set to true if an event is to be handled by this component, false if ! * it is to be passed up the hierarcy. ! * ! * @see #dispatchEvent(AWTEvent) ! * @serial true to process event locally ! */ ! boolean newEventsOnly; ! ! /** ! * Set by subclasses to enable event handling of particular events, and ! * left alone when modifying listeners. For component, this defaults to ! * enabling only input methods. ! * ! * @see #enableInputMethods(boolean) ! * @see AWTEvent ! * @serial the mask of events to process ! */ ! long eventMask = AWTEvent.INPUT_ENABLED_EVENT_MASK; ! ! /** ! * Describes all registered PropertyChangeListeners. ! * ! * @see #addPropertyChangeListener(PropertyChangeListener) ! * @see #removePropertyChangeListener(PropertyChangeListener) ! * @see #firePropertyChange(String, Object, Object) ! * @serial the property change listeners ! * @since 1.2 ! */ PropertyChangeSupport changeSupport; + + /** + * True if the component has been packed (layed out). + * + * @serial true if this is packed + */ boolean isPacked; ! /** ! * The serialization version for this class. Currently at version 4. ! * ! * XXX How do we handle prior versions? ! * ! * @serial the serialization version ! */ ! int componentSerializedDataVersion = 4; ! ! /** ! * The accessible context associated with this component. This is only set ! * by subclasses. ! * ! * @see #getAccessibleContext() ! * @serial the accessibility context ! * @since 1.2 ! */ ! AccessibleContext accessibleContext; + + // Guess what - listeners are special cased in serialization. See + // readObject and writeObject. + + /** Component listener chain. */ transient ComponentListener componentListener; + + /** Focus listener chain. */ transient FocusListener focusListener; + + /** Key listener chain. */ transient KeyListener keyListener; + + /** Mouse listener chain. */ transient MouseListener mouseListener; + + /** Mouse motion listener chain. */ transient MouseMotionListener mouseMotionListener; + + /** + * Mouse wheel listener chain. + * + * @since 1.4 + */ + transient MouseWheelListener mouseWheelListener; + + /** + * Input method listener chain. + * + * @since 1.2 + */ transient InputMethodListener inputMethodListener; + + /** + * Hierarcy listener chain. + * + * @since 1.3 + */ transient HierarchyListener hierarchyListener; + + /** + * Hierarcy bounds listener chain. + * + * @since 1.3 + */ transient HierarchyBoundsListener hierarchyBoundsListener; + // Anything else is non-serializable, and should be declared "transient". + + /** The parent. */ + transient Container parent; + + /** The associated native peer. */ + transient ComponentPeer peer; + + /** The preferred component orientation. */ transient ComponentOrientation orientation = ComponentOrientation.UNKNOWN; /** ! * The associated graphics configuration. ! * ! * @since 1.4 ! */ ! transient GraphicsConfiguration graphicsConfig; ! ! /** ! * The buffer strategy for repainting. ! * ! * @since 1.4 ! */ ! transient BufferStrategy bufferStrategy; ! ! ! // Public and protected API. ! ! /** ! * Default constructor for subclasses. When Component is extended directly, ! * it forms a lightweight component that must be hosted in an opaque native ! * container higher in the tree. */ protected Component() { *************** public abstract class Component implemen *** 158,168 **** /** * Returns the name of this component. * ! * @return The name of this component. */ public String getName() { ! if (name == null && !nameExplicitlySet) name = generateName(); return name; } --- 570,582 ---- /** * Returns the name of this component. * ! * @return the name of this component ! * @see #setName(String) ! * @since 1.1 */ public String getName() { ! if (name == null && ! nameExplicitlySet) name = generateName(); return name; } *************** public abstract class Component implemen *** 170,305 **** /** * Sets the name of this component to the specified name. * ! * @param name The new name of this component. */ public void setName(String name) { nameExplicitlySet = true; this.name = name; } - - /** Subclasses should override this to return unique component names like - * "menuitem0". - */ - String generateName() - { - // Component is abstract. - return null; - } /** * Returns the parent of this component. ! * ! * @return The parent of this component. */ public Container getParent() { ! return parent; ! } ! ! // Sets the peer for this component. ! final void setPeer (ComponentPeer peer) ! { ! this.peer = peer; } /** ! * Returns the native windowing system peer for this component. * ! * @return The peer for this component. ! * @deprecated */ // Classpath's Gtk peers rely on this. ! public java.awt.peer.ComponentPeer getPeer() { return peer; } ! // FIXME: java.awt.dnd classes not yet implemented ! /* public void setDropTarget(DropTarget dt) { this.dropTarget = dt; } ! public DropTarget getDropTarget() { return dropTarget; } ! */ ! ! /** @since 1.3 */ public GraphicsConfiguration getGraphicsConfiguration() { return getGraphicsConfigurationImpl(); } - /** Implementation method that allows classes such as Canvas and - Window to override the graphics configuration without violating - the published API. */ - GraphicsConfiguration getGraphicsConfigurationImpl() - { - if (peer != null) - { - GraphicsConfiguration config = peer.getGraphicsConfiguration(); - if (config != null) - return config; - } - - if (parent != null) - return parent.getGraphicsConfiguration(); - - return null; - } - /** * Returns the object used for synchronization locks on this component * when performing tree and layout functions. * ! * @return The synchronization lock for this component. */ public final Object getTreeLock() { return treeLock; } - // The sync lock object for this component. - final void setTreeLock(Object tree_lock) - { - this.treeLock = tree_lock; - } - /** ! * Returns the toolkit in use for this component. * ! * @return The toolkit for this component. */ public Toolkit getToolkit() { if (peer != null) { ! Toolkit tk = peer.getToolkit(); ! if (tk != null) ! return tk; } if (parent != null) ! return parent.getToolkit (); ! return Toolkit.getDefaultToolkit (); } /** ! * Tests whether or not this component is valid. A invalid component needs * to have its layout redone. * ! * @return true if this component is valid, false ! * otherwise. */ public boolean isValid() { return valid; } ! ! /** @since 1.2 */ public boolean isDisplayable() { if (parent != null) --- 584,713 ---- /** * Sets the name of this component to the specified name. * ! * @param name the new name of this component ! * @see #getName() ! * @since 1.1 */ public void setName(String name) { nameExplicitlySet = true; this.name = name; } /** * Returns the parent of this component. ! * ! * @return the parent of this component */ public Container getParent() { ! return parent; } /** ! * Returns the native windowing system peer for this component. Only the ! * platform specific implementation code should call this method. * ! * @return the peer for this component ! * @deprecated user programs should not directly manipulate peers; use ! * {@link #isDisplayable()} instead */ // Classpath's Gtk peers rely on this. ! public ComponentPeer getPeer() { return peer; } ! /** ! * Set the associated drag-and-drop target, which receives events when this ! * is enabled. ! * ! * @param dt the new drop target ! * @see #isEnabled() ! */ public void setDropTarget(DropTarget dt) { this.dropTarget = dt; } ! ! /** ! * Gets the associated drag-and-drop target, if there is one. ! * ! * @return the drop target ! */ public DropTarget getDropTarget() { return dropTarget; } ! ! /** ! * Returns the graphics configuration of this component, if there is one. ! * If it has not been set, it is inherited from the parent. ! * ! * @return the graphics configuration, or null ! * @since 1.3 ! */ public GraphicsConfiguration getGraphicsConfiguration() { return getGraphicsConfigurationImpl(); } /** * Returns the object used for synchronization locks on this component * when performing tree and layout functions. * ! * @return the synchronization lock for this component */ public final Object getTreeLock() { return treeLock; } /** ! * Returns the toolkit in use for this component. The toolkit is associated ! * with the frame this component belongs to. * ! * @return the toolkit for this component */ public Toolkit getToolkit() { if (peer != null) { ! Toolkit tk = peer.getToolkit(); ! if (tk != null) ! return tk; } if (parent != null) ! return parent.getToolkit(); ! return Toolkit.getDefaultToolkit(); } /** ! * Tests whether or not this component is valid. A invalid component needs * to have its layout redone. * ! * @return true if this component is valid ! * @see #validate() ! * @see #invalidate() */ public boolean isValid() { return valid; } ! ! /** ! * Tests if the component is displayable. It must be connected to a native ! * screen resource, and all its ancestors must be displayable. A containment ! * hierarchy is made displayable when a window is packed or made visible. ! * ! * @return true if the component is displayable ! * @see Container#add(Component) ! * @see Container#remove(Component) ! * @see Window#pack() ! * @see Window#show() ! * @see Window#dispose() ! * @since 1.2 ! */ public boolean isDisplayable() { if (parent != null) *************** public abstract class Component implemen *** 308,317 **** } /** ! * Tests whether or not this component is visible. * ! * @return true if the component is visible, ! * false otherwise. */ public boolean isVisible() { --- 716,726 ---- } /** ! * Tests whether or not this component is visible. Except for top-level ! * frames, components are initially visible. * ! * @return true if the component is visible ! * @see #setVisible(boolean) */ public boolean isVisible() { *************** public abstract class Component implemen *** 320,344 **** /** * Tests whether or not this component is actually being shown on ! * the screen. This will be true if and only if it this component is * visible and its parent components are all visible. * ! * @return true if the component is showing on the screen, ! * false otherwise. */ public boolean isShowing() { if (! visible || peer == null) return false; ! return parent == null ? true : parent.isShowing (); } /** ! * Tests whether or not this component is enabled. * ! * @return true if the component is enabled, ! * false otherwise. */ public boolean isEnabled() { --- 729,754 ---- /** * Tests whether or not this component is actually being shown on ! * the screen. This will be true if and only if it this component is * visible and its parent components are all visible. * ! * @return true if the component is showing on the screen ! * @see #setVisible(boolean) */ public boolean isShowing() { if (! visible || peer == null) return false; ! return parent == null ? true : parent.isShowing(); } /** ! * Tests whether or not this component is enabled. Components are enabled ! * by default, and must be enabled to receive user input or generate events. * ! * @return true if the component is enabled ! * @see #setEnabled(boolean) */ public boolean isEnabled() { *************** public abstract class Component implemen *** 346,357 **** } /** ! * Enables or disables this component. ! * ! * @param enabled true to enable this component, ! * false to disable it. * ! * @deprecated Deprecated in favor of setEnabled(). */ public void setEnabled(boolean b) { --- 756,769 ---- } /** ! * Enables or disables this component. The component must be enabled to ! * receive events (except that lightweight components always receive mouse ! * events). * ! * @param enabled true to enable this component ! * @see #isEnabled() ! * @see #isLightweight() ! * @since 1.1 */ public void setEnabled(boolean b) { *************** public abstract class Component implemen *** 363,369 **** /** * Enables this component. * ! * @deprecated Deprecated in favor of setEnabled(). */ public void enable() { --- 775,781 ---- /** * Enables this component. * ! * @deprecated use {@link #setEnabled(boolean)} instead */ public void enable() { *************** public abstract class Component implemen *** 373,382 **** /** * Enables or disables this component. * ! * @param enabled true to enable this component, ! * false to disable it. ! * ! * @deprecated Deprecated in favor of setEnabled(). */ public void enable(boolean b) { --- 785,792 ---- /** * Enables or disables this component. * ! * @param enabled true to enable this component ! * @deprecated use {@link #setEnabled(boolean)} instead */ public void enable(boolean b) { *************** public abstract class Component implemen *** 386,591 **** /** * Disables this component. * ! * @deprecated Deprecated in favor of setEnabled(). */ public void disable() { setEnabled(false); } public boolean isDoubleBuffered() { return false; } ! /** @since 1.2 */ public void enableInputMethods(boolean enable) { ! // FIXME } /** ! * Makes this component visible or invisible. * ! * @param visible true to make this component visible, ! * false to make it invisible. ! * @specnote Inspection by subclassing shows that Sun's implementation ! * calls show(boolean) which then calls show() or hide(). It is ! * the show() method that is overriden in subclasses like Window. ! * We do the same to preserve compatibility for subclasses. */ public void setVisible(boolean b) { if (peer != null) ! peer.setVisible (b); this.visible = b; } /** * Makes this component visible on the screen. * ! * @deprecated Deprecated in favor of setVisible(). */ public void show() { ! setVisible (true); } /** * Makes this component visible or invisible. * ! * @param visible true to make this component visible, ! * false to make it invisible. ! * ! * @deprecated Deprecated in favor of setVisible(). */ public void show(boolean b) { ! setVisible (b); } /** * Hides this component so that it is no longer shown on the screen. * ! * @deprecated Deprecated in favor of setVisible(). */ public void hide() { ! setVisible (false); } /** ! * Returns this component's foreground color. * ! * @return This component's foreground color. */ public Color getForeground() { if (foreground != null) return foreground; ! if (parent != null) ! return parent.getForeground(); ! return null; } /** ! * Sets this component's foreground color to the specified color. * ! * @param foreground_color The new foreground color. */ public void setForeground(Color c) { if (peer != null) peer.setForeground(c); ! this.foreground = c; } /** ! * Returns this component's background color. * ! * @return the background color of the component. null may be ! * returned instead of the actual background color, if this ! * method is called before the component is added to the ! * component hierarchy. */ public Color getBackground() { if (background != null) return background; ! if (parent != null) ! return parent.getBackground(); ! return null; } /** ! * Sets this component's background color to the specified color. * ! * @param background_color The new background color */ public void setBackground(Color c) { if (peer != null) peer.setBackground(c); ! this.background = c; } /** ! * Returns the font in use for this component. * ! * @return The font for this component. */ public Font getFont() { if (font != null) return font; ! if (parent != null) ! return parent.getFont(); ! return null; } /** ! * Sets the font for this component to the specified font. * ! * @param font The new font for this component. */ public void setFont(Font f) { if (peer != null) peer.setFont(f); ! this.font = f; } /** ! * Returns the locale for this component. If this component does not ! * have a locale, the locale of the parent component is returned. If the ! * component has no parent, the system default locale is returned. * ! * @return The locale for this component. */ ! public Locale getLocale() throws IllegalComponentStateException { if (locale != null) return locale; if (parent == null) throw new IllegalComponentStateException ! ("Component has no parent: Can not determine Locale"); return parent.getLocale(); } /** ! * Sets the locale for this component to the specified locale. * ! * @param locale The new locale for this component. */ ! public void setLocale(Locale l) { ! this.locale = l; ! ! /* new writing/layout direction perhaps, or make more/less ! room for localized text labels */ invalidate(); } /** * Returns the color model of the device this componet is displayed on. * ! * @return This object's color model. */ public ColorModel getColorModel() { GraphicsConfiguration config = getGraphicsConfiguration(); ! ! if (config != null) ! return config.getColorModel(); ! ! return getToolkit().getColorModel(); } /** * Returns the location of this component's top left corner relative to ! * its parent component. * ! * @return The location of this component. */ public Point getLocation() { --- 796,1063 ---- /** * Disables this component. * ! * @deprecated use {@link #setEnabled(boolean)} instead */ public void disable() { setEnabled(false); } + /** + * Checks if this image is painted to an offscreen image buffer that is + * later copied to screen (double buffering reduces flicker). This version + * returns false, so subclasses must override it if they provide double + * buffering. + * + * @return true if this is double buffered; defaults to false + */ public boolean isDoubleBuffered() { return false; } ! /** ! * Enables or disables input method support for this component. By default, ! * components have this enabled. Input methods are given the opportunity ! * to process key events before this component and its listeners. ! * ! * @param enable true to enable input method processing ! * @see #processKeyEvent(KeyEvent) ! * @since 1.2 ! */ public void enableInputMethods(boolean enable) { ! // XXX Implement. ! throw new Error("not implemented"); } /** ! * Makes this component visible or invisible. Note that it wtill might ! * not show the component, if a parent is invisible. * ! * @param visible true to make this component visible ! * @see #isVisible() ! * @since 1.1 */ public void setVisible(boolean b) { + // Inspection by subclassing shows that Sun's implementation calls + // show(boolean) which then calls show() or hide(). It is the show() + // method that is overriden in subclasses like Window. if (peer != null) ! peer.setVisible(b); this.visible = b; } /** * Makes this component visible on the screen. * ! * @deprecated use {@link #setVisible(boolean)} instead */ public void show() { ! setVisible(true); } /** * Makes this component visible or invisible. * ! * @param visible true to make this component visible ! * @deprecated use {@link #setVisible(boolean)} instead */ public void show(boolean b) { ! setVisible(b); } /** * Hides this component so that it is no longer shown on the screen. * ! * @deprecated use {@link #setVisible(boolean)} instead */ public void hide() { ! setVisible(false); } /** ! * Returns this component's foreground color. If not set, this is inherited ! * from the parent. * ! * @return this component's foreground color, or null ! * @see #setForeground(Color) */ public Color getForeground() { if (foreground != null) return foreground; ! return parent == null ? null : parent.getForeground(); } /** ! * Sets this component's foreground color to the specified color. This is a ! * bound property. * ! * @param c the new foreground color ! * @see #getForeground() */ public void setForeground(Color c) { + firePropertyChange("foreground", foreground, c); if (peer != null) peer.setForeground(c); ! foreground = c; } /** ! * Tests if the foreground was explicitly set, or just inherited from the ! * parent. * ! * @return true if the foreground has been set ! * @since 1.4 ! */ ! public boolean isForegroundSet() ! { ! return foreground != null; ! } ! ! /** ! * Returns this component's background color. If not set, this is inherited ! * from the parent. ! * ! * @return the background color of the component, or null ! * @see #setBackground(Color) */ public Color getBackground() { if (background != null) return background; ! return parent == null ? null : parent.getBackground(); } /** ! * Sets this component's background color to the specified color. The parts ! * of the component affected by the background color may by system dependent. ! * This is a bound property. * ! * @param c the new background color ! * @see #getBackground() */ public void setBackground(Color c) { + firePropertyChange("background", background, c); if (peer != null) peer.setBackground(c); ! background = c; } /** ! * Tests if the background was explicitly set, or just inherited from the ! * parent. * ! * @return true if the background has been set ! * @since 1.4 ! */ ! public boolean isBackgroundSet() ! { ! return background != null; ! } ! ! /** ! * Returns the font in use for this component. If not set, this is inherited ! * from the parent. ! * ! * @return the font for this component ! * @see #setFont(Font) */ public Font getFont() { if (font != null) return font; ! return parent == null ? null : parent.getFont(); } /** ! * Sets the font for this component to the specified font. This is a bound ! * property. * ! * @param font the new font for this component ! * @see #getFont() */ public void setFont(Font f) { + firePropertyChange("font", font, f); if (peer != null) peer.setFont(f); ! font = f; } /** ! * Tests if the font was explicitly set, or just inherited from the parent. * ! * @return true if the font has been set ! * @since 1.4 */ ! public boolean isFontSet() ! { ! return font != null; ! } ! ! /** ! * Returns the locale for this component. If this component does not ! * have a locale, the locale of the parent component is returned. ! * ! * @return the locale for this component ! * @throws IllegalComponentStateException if it has no locale or parent ! * @see setLocale(Locale) ! * @since 1.1 ! */ ! public Locale getLocale() { if (locale != null) return locale; if (parent == null) throw new IllegalComponentStateException ! ("Component has no parent: can't determine Locale"); return parent.getLocale(); } /** ! * Sets the locale for this component to the specified locale. This is a ! * bound property. * ! * @param locale the new locale for this component */ ! public void setLocale(Locale l) { ! firePropertyChange("locale", locale, l); ! locale = l; ! // New writing/layout direction or more/less room for localized labels. invalidate(); } /** * Returns the color model of the device this componet is displayed on. * ! * @return this object's color model ! * @see Toolkit#getColorModel() */ public ColorModel getColorModel() { GraphicsConfiguration config = getGraphicsConfiguration(); ! return config != null ? config.getColorModel() ! : getToolkit().getColorModel(); } /** * Returns the location of this component's top left corner relative to ! * its parent component. This may be outdated, so for synchronous behavior, ! * you should use a component listner. * ! * @return the location of this component ! * @see #setLocation(int, int) ! * @see #getLocationOnScreen() ! * @since 1.1 */ public Point getLocation() { *************** public abstract class Component implemen *** 596,620 **** * Returns the location of this component's top left corner in screen * coordinates. * ! * @return The location of this component in screen coordinates. */ public Point getLocationOnScreen() { ! if (! isShowing ()) ! throw new IllegalComponentStateException ("component not showing"); ! // We know peer != null here. ! return peer.getLocationOnScreen (); } /** * Returns the location of this component's top left corner relative to * its parent component. * ! * @return The location of this component. ! * ! * @deprecated This method is deprecated in favor of ! * getLocation(). */ public Point location() { --- 1068,1090 ---- * Returns the location of this component's top left corner in screen * coordinates. * ! * @return the location of this component in screen coordinates ! * @throws IllegalComponentStateException if the component is not showing */ public Point getLocationOnScreen() { ! if (! isShowing()) ! throw new IllegalComponentStateException("component not showing"); // We know peer != null here. ! return peer.getLocationOnScreen(); } /** * Returns the location of this component's top left corner relative to * its parent component. * ! * @return the location of this component ! * @deprecated use {@link #getLocation()} instead */ public Point location() { *************** public abstract class Component implemen *** 622,640 **** } /** ! * Moves this component to the specified location. The coordinates are ! * the new upper left corner of this component. * ! * @param x The new X coordinate of this component. ! * @param y The new Y coordinate of this component. */ ! public void setLocation (int x, int y) { ! if ((this.x == x) && (this.y == y)) return; - invalidate(); - this.x = x; this.y = y; if (peer != null) --- 1092,1111 ---- } /** ! * Moves this component to the specified location, relative to the parent's ! * coordinates. The coordinates are the new upper left corner of this ! * component. * ! * @param x the new X coordinate of this component ! * @param y the new Y coordinate of this component ! * @see #getLocation() ! * @see #setBounds(int, int, int, int) */ ! public void setLocation(int x, int y) { ! if (this.x == x && this.y == y) return; invalidate(); this.x = x; this.y = y; if (peer != null) *************** public abstract class Component implemen *** 642,665 **** } /** ! * Moves this component to the specified location. The coordinates are ! * the new upper left corner of this component. ! * ! * @param x The new X coordinate of this component. ! * @param y The new Y coordinate of this component. * ! * @deprecated Deprecated in favor for setLocation. */ public void move(int x, int y) { ! setLocation(x,y); } /** ! * Moves this component to the specified location. The coordinates are ! * the new upper left corner of this component. * ! * @param p New coordinates for this component. */ public void setLocation(Point p) { --- 1113,1141 ---- } /** ! * Moves this component to the specified location, relative to the parent's ! * coordinates. The coordinates are the new upper left corner of this ! * component. * ! * @param x the new X coordinate of this component ! * @param y the new Y coordinate of this component ! * @deprecated use {@link #setLocation(int, int)} instead */ public void move(int x, int y) { ! setLocation(x, y); } /** ! * Moves this component to the specified location, relative to the parent's ! * coordinates. The coordinates are the new upper left corner of this ! * component. * ! * @param p new coordinates for this component ! * @throws NullPointerException if p is null ! * @see #getLocation() ! * @see #setBounds(int, int, int, int) ! * @since 1.1 */ public void setLocation(Point p) { *************** public abstract class Component implemen *** 669,675 **** /** * Returns the size of this object. * ! * @return The size of this object. */ public Dimension getSize() { --- 1145,1153 ---- /** * Returns the size of this object. * ! * @return the size of this object ! * @see #setSize(int, int) ! * @since 1.1 */ public Dimension getSize() { *************** public abstract class Component implemen *** 679,687 **** /** * Returns the size of this object. * ! * @return The size of this object. ! * ! * @deprecated This method is deprecated in favor of getSize. */ public Dimension size() { --- 1157,1164 ---- /** * Returns the size of this object. * ! * @return the size of this object ! * @deprecated use {@link #getSize()} instead */ public Dimension size() { *************** public abstract class Component implemen *** 690,706 **** /** * Sets the size of this component to the specified width and height. ! * ! * @param width The new width of this component. ! * @param height The new height of this component. */ public void setSize(int width, int height) { ! if ((this.width == width) && (this.height == height)) return; - invalidate(); - this.width = width; this.height = height; if (peer != null) --- 1167,1183 ---- /** * Sets the size of this component to the specified width and height. ! * ! * @param width the new width of this component ! * @param height the new height of this component ! * @see #getSize() ! * @see #setBounds(int, int, int, int) */ public void setSize(int width, int height) { ! if (this.width == width && this.height == height) return; invalidate(); this.width = width; this.height = height; if (peer != null) *************** public abstract class Component implemen *** 709,719 **** /** * Sets the size of this component to the specified value. - * - * @param width The new width of the component. - * @param height The new height of the component. * ! * @deprecated This method is deprecated in favor of setSize. */ public void resize(int width, int height) { --- 1186,1195 ---- /** * Sets the size of this component to the specified value. * ! * @param width the new width of the component ! * @param height the new height of the component ! * @deprecated use {@link #setSize(int, int)} instead */ public void resize(int width, int height) { *************** public abstract class Component implemen *** 722,729 **** /** * Sets the size of this component to the specified value. ! * ! * @param dim The new size of this component. */ public void setSize(Dimension d) { --- 1198,1209 ---- /** * Sets the size of this component to the specified value. ! * ! * @param d the new size of this component ! * @throws NullPointerException if d is null ! * @see #setSize(int, int) ! * @see #setBounds(int, int, int, int) ! * @since 1.1 */ public void setSize(Dimension d) { *************** public abstract class Component implemen *** 732,741 **** /** * Sets the size of this component to the specified value. - * - * @param dim The new size of this component. * ! * @deprecated This method is deprecated in favor of setSize. */ public void resize(Dimension d) { --- 1212,1221 ---- /** * Sets the size of this component to the specified value. * ! * @param d the new size of this component ! * @throws NullPointerException if d is null ! * @deprecated use {@link #setSize(Dimension)} instead */ public void resize(Dimension d) { *************** public abstract class Component implemen *** 743,767 **** } /** ! * Returns a bounding rectangle for this component. Note that the * returned rectange is relative to this component's parent, not to * the screen. * ! * @return The bounding rectangle for this component. */ public Rectangle getBounds() { ! return new Rectangle (x, y, width, height); } /** ! * Returns a bounding rectangle for this component. Note that the * returned rectange is relative to this component's parent, not to * the screen. * ! * @return The bounding rectangle for this component. ! * ! * @deprecated Deprecated in favor of getBounds(). */ public Rectangle bounds() { --- 1223,1249 ---- } /** ! * Returns a bounding rectangle for this component. Note that the * returned rectange is relative to this component's parent, not to * the screen. * ! * @return the bounding rectangle for this component ! * @see #setBounds(int, int, int, int) ! * @see #getLocation() ! * @see #getSize() */ public Rectangle getBounds() { ! return new Rectangle(x, y, width, height); } /** ! * Returns a bounding rectangle for this component. Note that the * returned rectange is relative to this component's parent, not to * the screen. * ! * @return the bounding rectangle for this component ! * @deprecated use {@link #getBounds()} instead */ public Rectangle bounds() { *************** public abstract class Component implemen *** 769,814 **** } /** ! * Sets the bounding rectangle for this component to the specified ! * values. Note that these coordinates are relative to the parent, ! * not to the screen. * ! * @param x The X coordinate of the upper left corner of the rectangle. ! * @param y The Y coordinate of the upper left corner of the rectangle. ! * @param width The width of the rectangle. ! * @param height The height of the rectangle. */ public void setBounds(int x, int y, int w, int h) { ! if (this.x == x ! && this.y == y ! && this.width == w ! && this.height == h) return; - invalidate(); - this.x = x; this.y = y; ! this.width = w; ! this.height = h; ! if (peer != null) peer.setBounds(x, y, w, h); } /** ! * Sets the bounding rectangle for this component to the specified ! * values. Note that these coordinates are relative to the parent, ! * not to the screen. ! * ! * @param x The X coordinate of the upper left corner of the rectangle. ! * @param y The Y coordinate of the upper left corner of the rectangle. ! * @param width The width of the rectangle. ! * @param height The height of the rectangle. * ! * @deprecated This method is deprecated in favor of ! * setBounds(int, int, int, int). */ public void reshape(int x, int y, int width, int height) { --- 1251,1292 ---- } /** ! * Sets the bounding rectangle for this component to the specified values. ! * Note that these coordinates are relative to the parent, not to the screen. * ! * @param x the X coordinate of the upper left corner of the rectangle ! * @param y the Y coordinate of the upper left corner of the rectangle ! * @param w the width of the rectangle ! * @param h the height of the rectangle ! * @see #getBounds() ! * @see #setLocation(int, int) ! * @see #setLocation(Point) ! * @see #setSize(int, int) ! * @see #setSize(Dimension) ! * @since 1.1 */ public void setBounds(int x, int y, int w, int h) { ! if (this.x == x && this.y == y && width == w && height == h) return; invalidate(); this.x = x; this.y = y; ! width = w; ! height = h; if (peer != null) peer.setBounds(x, y, w, h); } /** ! * Sets the bounding rectangle for this component to the specified values. ! * Note that these coordinates are relative to the parent, not to the screen. * ! * @param x the X coordinate of the upper left corner of the rectangle ! * @param y the Y coordinate of the upper left corner of the rectangle ! * @param w the width of the rectangle ! * @param h the height of the rectangle ! * @deprecated use {@link #setBounds(int, int, int, int)} instead */ public void reshape(int x, int y, int width, int height) { *************** public abstract class Component implemen *** 817,916 **** /** * Sets the bounding rectangle for this component to the specified ! * rectangle. Note that these coordinates are relative to the parent, ! * not to the screen. * ! * @param bounding_rectangle The new bounding rectangle. */ public void setBounds(Rectangle r) ! { setBounds(r.x, r.y, r.width, r.height); } ! ! /** @since 1.2 */ public int getX() { return x; } ! ! /** @since 1.2 */ public int getY() { return y; } ! ! /** @since 1.2 */ public int getWidth() { return width; } ! ! /** @since 1.2 */ public int getHeight() { return height; } ! public Rectangle getBounds(Rectangle r) { ! r.x = this.x; ! r.y = this.y; ! r.width = this.width; ! r.height = this.height; return r; } ! public Dimension getSize(Dimension d) { ! d.width = this.width; ! d.height = this.height; return d; } ! public Point getLocation(Point p) { p.x = x; p.y = y; return p; } ! ! /** @since 1.2 */ public boolean isOpaque() { ! return !isLightweight(); } ! ! /** ! * Return whether the component is lightweight. ! * ! * @return true if component has a peer and and the peer is lightweight. * * @since 1.2 ! */ public boolean isLightweight() { ! return (peer != null) && (peer instanceof LightweightPeer); } /** * Returns the component's preferred size. * ! * @return The component's preferred size. */ public Dimension getPreferredSize() { ! if (peer == null) ! return new Dimension(width, height); ! else ! return peer.getPreferredSize(); } /** * Returns the component's preferred size. * ! * @return The component's preferred size. ! * ! * @deprecated Deprecated in favor of getPreferredSize(). */ public Dimension preferredSize() { --- 1295,1463 ---- /** * Sets the bounding rectangle for this component to the specified ! * rectangle. Note that these coordinates are relative to the parent, not ! * to the screen. * ! * @param r the new bounding rectangle ! * @throws NullPointerException if r is null ! * @see #getBounds() ! * @see #setLocation(Point) ! * @see #setSize(Dimension) ! * @since 1.1 */ public void setBounds(Rectangle r) ! { setBounds(r.x, r.y, r.width, r.height); } ! ! /** ! * Gets the x coordinate of the upper left corner. This is more efficient ! * than getBounds().x or getLocation().x. ! * ! * @return the current x coordinate ! * @since 1.2 ! */ public int getX() { return x; } ! ! /** ! * Gets the y coordinate of the upper left corner. This is more efficient ! * than getBounds().y or getLocation().y. ! * ! * @return the current y coordinate ! * @since 1.2 ! */ public int getY() { return y; } ! ! /** ! * Gets the width of the component. This is more efficient than ! * getBounds().width or getSize().width. ! * ! * @return the current width ! * @since 1.2 ! */ public int getWidth() { return width; } ! ! /** ! * Gets the height of the component. This is more efficient than ! * getBounds().height or getSize().height. ! * ! * @return the current width ! * @since 1.2 ! */ public int getHeight() { return height; } ! ! /** ! * Returns the bounds of this component. This allows reuse of an existing ! * rectangle, if r is non-null. ! * ! * @param r the rectangle to use, or null ! * @return the bounds ! */ public Rectangle getBounds(Rectangle r) { ! if (r == null) ! r = new Rectangle(); ! r.x = x; ! r.y = y; ! r.width = width; ! r.height = height; return r; } ! ! /** ! * Returns the size of this component. This allows reuse of an existing ! * dimension, if d is non-null. ! * ! * @param d the dimension to use, or null ! * @return the size ! */ public Dimension getSize(Dimension d) { ! if (d == null) ! d = new Dimension(); ! d.width = width; ! d.height = height; return d; } ! ! /** ! * Returns the location of this component. This allows reuse of an existing ! * point, if p is non-null. ! * ! * @param p the point to use, or null ! * @return the location ! */ public Point getLocation(Point p) { + if (p == null) + p = new Point(); p.x = x; p.y = y; return p; } ! ! /** ! * Tests if this component is opaque. All "heavyweight" (natively-drawn) ! * components are opaque. A component is opaque if it draws all pixels in ! * the bounds; a lightweight component is partially transparent if it lets ! * pixels underneath show through. Subclasses that guarantee that all pixels ! * will be drawn should override this. ! * ! * @return true if this is opaque ! * @see #isLightweight() ! * @since 1.2 ! */ public boolean isOpaque() { ! return ! isLightweight(); } ! ! /** ! * Return whether the component is lightweight. That means the component has ! * no native peer, but is displayable. This applies to subclasses of ! * Component not in this package, such as javax.swing. * + * @return true if the component has a lightweight peer + * @see #isDisplayable() * @since 1.2 ! */ public boolean isLightweight() { ! return peer instanceof LightweightPeer; } /** * Returns the component's preferred size. * ! * @return the component's preferred size ! * @see #getMinimumSize() ! * @see LayoutManager */ public Dimension getPreferredSize() { ! if (prefSize == null) ! prefSize = (peer != null ? peer.getPreferredSize() ! : new Dimension(width, height)); ! return prefSize; } /** * Returns the component's preferred size. * ! * @return the component's preferred size ! * @deprecated use {@link #getPreferredSize()} instead */ public Dimension preferredSize() { *************** public abstract class Component implemen *** 920,941 **** /** * Returns the component's minimum size. * ! * @return The component's minimum size. */ public Dimension getMinimumSize() { ! if (peer == null) ! return new Dimension(width, height); ! else ! return peer.getMinimumSize(); } /** * Returns the component's minimum size. * ! * @return The component's minimum size. ! * ! * @deprecated Deprecated in favor of getMinimumSize() */ public Dimension minimumSize() { --- 1467,1489 ---- /** * Returns the component's minimum size. * ! * @return the component's minimum size ! * @see #getPreferredSize() ! * @see LayoutManager */ public Dimension getMinimumSize() { ! if (minSize == null) ! minSize = (peer != null ? peer.getMinimumSize() ! : new Dimension(width, height)); ! return minSize; } /** * Returns the component's minimum size. * ! * @return the component's minimum size ! * @deprecated use {@link #getMinimumSize()} instead */ public Dimension minimumSize() { *************** public abstract class Component implemen *** 945,951 **** /** * Returns the component's maximum size. * ! * @return The component's maximum size. */ public Dimension getMaximumSize() { --- 1493,1502 ---- /** * Returns the component's maximum size. * ! * @return the component's maximum size ! * @see #getMinimumSize() ! * @see #getPreferredSize() ! * @see LayoutManager */ public Dimension getMaximumSize() { *************** public abstract class Component implemen *** 953,962 **** } /** ! * Returns the preferred horizontal alignment of this component. The ! * value returned will be one of the constants defined in this class. * ! * @return The preferred horizontal alignment of this component. */ public float getAlignmentX() { --- 1504,1514 ---- } /** ! * Returns the preferred horizontal alignment of this component. The value ! * returned will be between {@link #LEFT_ALIGNMENT} and ! * {@link #RIGHT_ALIGNMENT}, inclusive. * ! * @return the preferred horizontal alignment of this component */ public float getAlignmentX() { *************** public abstract class Component implemen *** 964,973 **** } /** ! * Returns the preferred vertical alignment of this component. The ! * value returned will be one of the constants defined in this class. * ! * @return The preferred vertical alignment of this component. */ public float getAlignmentY() { --- 1516,1526 ---- } /** ! * Returns the preferred vertical alignment of this component. The value ! * returned will be between {@link #TOP_ALIGNMENT} and ! * {@link #BOTTOM_ALIGNMENT}, inclusive. * ! * @return the preferred vertical alignment of this component */ public float getAlignmentY() { *************** public abstract class Component implemen *** 975,982 **** } /** ! * Calls the layout manager to re-layout the component. This is called * during validation of a container in most cases. */ public void doLayout() { --- 1528,1538 ---- } /** ! * Calls the layout manager to re-layout the component. This is called * during validation of a container in most cases. + * + * @see #validate() + * @see LayoutManager */ public void doLayout() { *************** public abstract class Component implemen *** 984,993 **** } /** ! * Calls the layout manager to re-layout the component. This is called * during validation of a container in most cases. * ! * @deprecated This method is deprecated in favor of doLayout(). */ public void layout() { --- 1540,1549 ---- } /** ! * Calls the layout manager to re-layout the component. This is called * during validation of a container in most cases. * ! * @deprecated use {@link #doLayout()} instead */ public void layout() { *************** public abstract class Component implemen *** 995,1001 **** } /** ! * Called to ensure that the layout for this component is valid. */ public void validate() { --- 1551,1563 ---- } /** ! * Called to ensure that the layout for this component is valid. This is ! * usually called on containers. ! * ! * @see #invalidate() ! * @see #doLayout() ! * @see LayoutManager ! * @see Container#validate() */ public void validate() { *************** public abstract class Component implemen *** 1003,1043 **** } /** ! * Invalidates this component and all of its parent components. This will ! * cause them to have their layout redone. */ public void invalidate() { valid = false; ! ! if ((parent != null) && parent.valid) ! parent.invalidate (); } /** ! * Returns a graphics object for this component. Returns null * if this component is not currently displayed on the screen. * ! * @return A graphics object for this component. */ public Graphics getGraphics() { if (peer != null) { ! Graphics gfx = peer.getGraphics(); ! if (gfx != null) ! return gfx; ! ! // create graphics for lightweight: ! Container parent = getParent(); ! if (parent != null) ! { ! gfx = parent.getGraphics(); ! Rectangle bounds = getBounds(); ! gfx.setClip(bounds); ! gfx.translate(bounds.x, bounds.y); ! return gfx; ! } } return null; } --- 1565,1607 ---- } /** ! * Invalidates this component and all of its parent components. This will ! * cause them to have their layout redone. This is called frequently, so ! * make it fast. */ public void invalidate() { valid = false; ! prefSize = null; ! minSize = null; ! if (parent != null && parent.valid) ! parent.invalidate(); } /** ! * Returns a graphics object for this component. Returns null * if this component is not currently displayed on the screen. * ! * @return a graphics object for this component ! * @see #paint(Graphics) */ public Graphics getGraphics() { if (peer != null) { ! Graphics gfx = peer.getGraphics(); ! if (gfx != null) ! return gfx; ! // create graphics for lightweight: ! Container parent = getParent(); ! if (parent != null) ! { ! gfx = parent.getGraphics(); ! Rectangle bounds = getBounds(); ! gfx.setClip(bounds); ! gfx.translate(bounds.x, bounds.y); ! return gfx; ! } } return null; } *************** public abstract class Component implemen *** 1045,1101 **** /** * Returns the font metrics for the specified font in this component. * ! * @param font The font to retrieve metrics for. ! * ! * @return The font metrics for the specified font. */ public FontMetrics getFontMetrics(Font font) { ! if (peer == null) ! return getToolkit().getFontMetrics(font); ! return peer.getFontMetrics (font); } /** ! * Sets the cursor for this component to the specified cursor. * ! * @param cursor The new cursor for this component. */ public void setCursor(Cursor cursor) { this.cursor = cursor; if (peer != null) ! peer.setCursor (cursor); } /** ! * Returns the cursor for this component. * ! * @return The cursor for this component. */ public Cursor getCursor() { ! return this.cursor; } /** ! * Paints this component on the screen. The clipping region in the ! * graphics context will indicate the region that requires painting. * ! * @param graphics The graphics context for this paint job. */ public void paint(Graphics g) { } /** ! * Updates this component. This method fills the component ! * with the background color, then sets the foreground color of the ! * specified graphics context to the foreground color of this component ! * and calls the paint() method. ! * // FIXME: What are the coords relative to? * ! * @param graphics The graphics context for this update. */ public void update(Graphics g) { --- 1609,1697 ---- /** * Returns the font metrics for the specified font in this component. * ! * @param font the font to retrieve metrics for ! * @return the font metrics for the specified font ! * @throws NullPointerException if font is null ! * @see #getFont() ! * @see Toolkit#getFontMetrics(Font) */ public FontMetrics getFontMetrics(Font font) { ! return peer == null ? getToolkit().getFontMetrics(font) ! : peer.getFontMetrics(font); } /** ! * Sets the cursor for this component to the specified cursor. The cursor ! * is displayed when the point is contained by the component, and the ! * component is visible, displayable, and enabled. This is inherited by ! * subcomponents unless they set their own cursor. * ! * @param cursor the new cursor for this component ! * @see #isEnabled() ! * @see #isShowing() ! * @see #getCursor() ! * @see #contains(int, int) ! * @see Toolkit#createCustomCursor(Image, Point, String) */ public void setCursor(Cursor cursor) { this.cursor = cursor; if (peer != null) ! peer.setCursor(cursor); } /** ! * Returns the cursor for this component. If not set, this is inherited ! * from the parent, or from Cursor.getDefaultCursor(). * ! * @return the cursor for this component */ public Cursor getCursor() { ! if (cursor != null) ! return cursor; ! return parent != null ? parent.getCursor() : Cursor.getDefaultCursor(); } /** ! * Tests if the cursor was explicitly set, or just inherited from the parent. * ! * @return true if the cursor has been set ! * @since 1.4 ! */ ! public boolean isCursorSet() ! { ! return cursor != null; ! } ! ! /** ! * Paints this component on the screen. The clipping region in the graphics ! * context will indicate the region that requires painting. This is called ! * whenever the component first shows, or needs to be repaired because ! * something was temporarily drawn on top. It is not necessary for ! * subclasses to call super.paint(g). Components with no area ! * are not painted. ! * ! * @param g the graphics context for this paint job ! * @see #update(Graphics) */ public void paint(Graphics g) { } /** ! * Updates this component. This is called in response to ! * repaint. This method fills the component with the ! * background color, then sets the foreground color of the specified ! * graphics context to the foreground color of this component and calls ! * the paint() method. The coordinates of the graphics are ! * relative to this component. Subclasses should call either ! * super.update(g) or paint(g). * ! * @param graphics the graphics context for this update ! * @see #paint(Graphics) ! * @see #repaint() */ public void update(Graphics g) { *************** public abstract class Component implemen *** 1105,1196 **** /** * Paints this entire component, including any sub-components. * ! * @param graphics The graphics context for this paint job. */ public void paintAll(Graphics g) ! { ! if (!visible) return; - if (peer != null) peer.paint(g); paint(g); } /** ! * Repaint this entire component. The update() method * on this component will be called as soon as possible. ! * // FIXME: What are the coords relative to? */ public void repaint() { ! repaint(0, 0, 0, getWidth(), getHeight()); } /** ! * Repaint this entire component. The update() method ! * on this component will be called in approximate the specified number ! * of milliseconds. ! * // FIXME: What are the coords relative to? * ! * @param tm The number of milliseconds before this component should ! * be repainted. */ public void repaint(long tm) { ! repaint(tm, 0, 0, getWidth(), getHeight()); } /** ! * Repaints the specified rectangular region within this component. ! * This update method on this component will be called as ! * soon as possible. ! * // FIXME: What are the coords relative to? * ! * @param x The X coordinate of the upper left of the region to repaint ! * @param y The Y coordinate of the upper left of the region to repaint ! * @param width The width of the region to repaint. ! * @param height The height of the region to repaint. */ ! public void repaint(int x, int y, int width, int height) { ! repaint(0, x, y, width, height); } /** ! * Repaints the specified rectangular region within this component. ! * This update method on this component will be called in ! * approximately the specified number of milliseconds. ! * // FIXME: What are the coords relative to? * ! * @param tm The number of milliseconds before this component should ! * be repainted. ! * @param x The X coordinate of the upper left of the region to repaint ! * @param y The Y coordinate of the upper left of the region to repaint ! * @param width The width of the region to repaint. ! * @param height The height of the region to repaint. */ public void repaint(long tm, int x, int y, int width, int height) ! { // Handle lightweight repainting by forwarding to native parent ! if (isLightweight() && (parent != null)) { ! if (parent != null) ! parent.repaint(tm, x+getX(), y+getY(), width, height); ! return; } ! ! if (peer != null) peer.repaint(tm, x, y, width, height); } /** ! * Prints this component. This method is ! * provided so that printing can be done in a different manner from ! * painting. However, the implementation in this class simply calls ! * the paint() method. * ! * @param graphics The graphics context of the print device. */ public void print(Graphics g) { --- 1701,1793 ---- /** * Paints this entire component, including any sub-components. * ! * @param graphics the graphics context for this paint job ! * @see #paint(Graphics) */ public void paintAll(Graphics g) ! { ! if (! visible) return; if (peer != null) peer.paint(g); paint(g); } /** ! * Repaint this entire component. The update() method * on this component will be called as soon as possible. ! * ! * @see #update(Graphics) ! * @see #repaint(long, int, int, int, int) */ public void repaint() { ! repaint(0, 0, 0, width, height); } /** ! * Repaint this entire component. The update() method on this ! * component will be called in approximate the specified number of ! * milliseconds. * ! * @param tm milliseconds before this component should be repainted ! * @see #paint(Graphics) ! * @see #repaint(long, int, int, int, int) */ public void repaint(long tm) { ! repaint(tm, 0, 0, width, height); } /** ! * Repaints the specified rectangular region within this component. The ! * update method on this component will be called as soon as ! * possible. The coordinates are relative to this component. * ! * @param x the X coordinate of the upper left of the region to repaint ! * @param y the Y coordinate of the upper left of the region to repaint ! * @param w the width of the region to repaint ! * @param h the height of the region to repaint ! * @see #update(Graphics) ! * @see #repaint(long, int, int, int, int) */ ! public void repaint(int x, int y, int w, int h) { ! repaint(0, x, y, w, h); } /** ! * Repaints the specified rectangular region within this component. The ! * update method on this component will be called in ! * approximately the specified number of milliseconds. The coordinates ! * are relative to this component. * ! * @param tm milliseconds before this component should be repainted ! * @param x the X coordinate of the upper left of the region to repaint ! * @param y the Y coordinate of the upper left of the region to repaint ! * @param w the width of the region to repaint ! * @param h the height of the region to repaint ! * @see #update(Graphics) */ public void repaint(long tm, int x, int y, int width, int height) ! { // Handle lightweight repainting by forwarding to native parent ! if (isLightweight() && parent != null) { ! if (parent != null) ! parent.repaint(tm, x + getX(), y + getY(), width, height); } ! else if (peer != null) peer.repaint(tm, x, y, width, height); } /** ! * Prints this component. This method is provided so that printing can be ! * done in a different manner from painting. However, the implementation ! * in this class simply calls the paint() method. * ! * @param graphics the graphics context of the print device ! * @see #paint(Graphics) */ public void print(Graphics g) { *************** public abstract class Component implemen *** 1198,1209 **** } /** ! * Prints this component, including all sub-components. This method is * provided so that printing can be done in a different manner from ! * painting. However, the implementation in this class simply calls ! * the paintAll() method. * ! * @param graphics The graphics context of the print device. */ public void printAll(Graphics g) { --- 1795,1807 ---- } /** ! * Prints this component, including all sub-components. This method is * provided so that printing can be done in a different manner from ! * painting. However, the implementation in this class simply calls the ! * paintAll() method. * ! * @param graphics the graphics context of the print device ! * @see #paintAll(Graphics) */ public void printAll(Graphics g) { *************** public abstract class Component implemen *** 1211,1293 **** } /** ! * Called when an image has changed so that this component is ! * repainted. * ! * @param image The image that has been updated. ! * @param flags Flags as specified in ImageObserver. ! * @param x The X coordinate ! * @param y The Y coordinate ! * @param width The width ! * @param height The height * ! * @return true if the image has been fully loaded, ! * false otherwise. */ ! public boolean imageUpdate (Image img, int infoflags, int x, int y, ! int w, int h) { ! // FIXME ! return false; } /** * Creates an image from the specified producer. * ! * @param producer The image procedure to create the image from. ! * ! * @return The resulting image. */ public Image createImage(ImageProducer producer) { return peer.createImage(producer); } /** * Creates an image with the specified width and height for use in ! * double buffering. ! * ! * @param width The width of the image. ! * @param height The height of the image. * ! * @return The requested image. */ public Image createImage(int width, int height) { ! return getGraphicsConfiguration().createCompatibleImage(width, height); } /** ! * Prepares the specified image for rendering on this component. * ! * @param image The image to prepare for rendering. ! * @param observer The image observer to notify of the status of the ! * image preparation. * ! * @return true if the image is already fully prepared ! * for rendering, false otherwise. */ public boolean prepareImage(Image image, ImageObserver observer) { ! return prepareImage(image, image.getWidth(observer), ! image.getHeight(observer), observer); } /** * Prepares the specified image for rendering on this component at the * specified scaled width and height * ! * @param image The image to prepare for rendering. ! * @param width The scaled width of the image. ! * @param height The scaled height of the image. ! * @param observer The image observer to notify of the status of the ! * image preparation. ! * ! * @return true if the image is already fully prepared ! * for rendering, false otherwise. */ public boolean prepareImage(Image image, int width, int height, ! ImageObserver observer) { return peer.prepareImage(image, width, height, observer); } --- 1809,1938 ---- } /** ! * Called when an image has changed so that this component is repainted. ! * This incrementally draws an image as more bits are available, when ! * possible. Incremental drawing is enabled if the system property ! * awt.image.incrementalDraw is not present or is true, in which ! * case the redraw rate is set to 100ms or the value of the system property ! * awt.image.redrawrate. * ! *

    The coordinate system used depends on the particular flags. * ! * @param image the image that has been updated ! * @param flags tlags as specified in ImageObserver ! * @param x the X coordinate ! * @param y the Y coordinate ! * @param w the width ! * @param h the height ! * @return true if the image has been fully loaded ! * @see ImageObserver ! * @see Graphics#drawImage(Image, int, int, Color, ImageObserver) ! * @see Graphics#drawImage(Image, int, int, ImageObserver) ! * @see Graphics#drawImage(Image, int, int, int, int, Color, ImageObserver) ! * @see Graphics#drawImage(Image, int, int, int, int, ImageObserver) ! * @see ImageObserver#update(Image, int, int, int, int, int) */ ! public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) { ! // XXX Implement. ! throw new Error("not implemented"); } /** * Creates an image from the specified producer. * ! * @param producer the image procedure to create the image from ! * @return the resulting image */ public Image createImage(ImageProducer producer) { + // XXX What if peer or producer is null? return peer.createImage(producer); } /** * Creates an image with the specified width and height for use in ! * double buffering. Headless environments do not support images. * ! * @param width the width of the image ! * @param height the height of the image ! * @return the requested image, or null if it is not supported */ public Image createImage(int width, int height) { ! if (GraphicsEnvironment.isHeadless()) ! return null; ! GraphicsConfiguration config = getGraphicsConfiguration(); ! return config == null ? null : config.createCompatibleImage(width, height); } /** ! * Creates an image with the specified width and height for use in ! * double buffering. Headless environments do not support images. * ! * @param width the width of the image ! * @param height the height of the image ! * @return the requested image, or null if it is not supported ! * @since 1.4 ! */ ! public VolatileImage createVolatileImage(int width, int height) ! { ! if (GraphicsEnvironment.isHeadless()) ! return null; ! GraphicsConfiguration config = getGraphicsConfiguration(); ! return config == null ? null ! : config.createCompatibleVolatileImage(width, height); ! } ! ! /** ! * Creates an image with the specified width and height for use in ! * double buffering. Headless environments do not support images. The image ! * will support the specified capabilities. * ! * @param width the width of the image ! * @param height the height of the image ! * @param caps the requested capabilities ! * @return the requested image, or null if it is not supported ! * @throws AWTException if a buffer with the capabilities cannot be created ! * @since 1.4 ! */ ! public VolatileImage createVolatileImage(int width, int height, ! ImageCapabilities caps) ! throws AWTException ! { ! if (GraphicsEnvironment.isHeadless()) ! return null; ! GraphicsConfiguration config = getGraphicsConfiguration(); ! return config == null ? null ! : config.createCompatibleVolatileImage(width, height, caps); ! } ! ! /** ! * Prepares the specified image for rendering on this component. ! * ! * @param image the image to prepare for rendering ! * @param observer the observer to notify of image preparation status ! * @return true if the image is already fully prepared ! * @throws NullPointerException if image is null */ public boolean prepareImage(Image image, ImageObserver observer) { ! return prepareImage(image, image.getWidth(observer), ! image.getHeight(observer), observer); } /** * Prepares the specified image for rendering on this component at the * specified scaled width and height * ! * @param image the image to prepare for rendering ! * @param width the scaled width of the image ! * @param height the scaled height of the image ! * @param observer the observer to notify of image preparation status ! * @return true if the image is already fully prepared */ public boolean prepareImage(Image image, int width, int height, ! ImageObserver observer) { return peer.prepareImage(image, width, height, observer); } *************** public abstract class Component implemen *** 1296,1373 **** * Returns the status of the loading of the specified image. The value * returned will be those flags defined in ImageObserver. * ! * @param image The image to check on. ! * @param observer The observer to be notified as the image loading ! * progresses. ! * ! * @return The image observer flags indicating the status of the load. */ public int checkImage(Image image, ImageObserver observer) { ! return checkImage(image, image.getWidth(observer), ! image.getHeight(observer), observer); } /** * Returns the status of the loading of the specified image. The value * returned will be those flags defined in ImageObserver. * ! * @param image The image to check on. ! * @param width The scaled image width. ! * @param height The scaled image height. ! * @param observer The observer to be notified as the image loading ! * progresses. ! * ! * @return The image observer flags indicating the status of the load. */ ! public int checkImage (Image image, int width, int height, ! ImageObserver observer) { if (peer != null) ! return peer.checkImage (image, width, height, observer); ! return getToolkit ().checkImage (image, width, height, observer); } /** ! * Tests whether or not the specified point is contained within this ! * component. Coordinates are relative to this component. * ! * @param x The X coordinate of the point to test. ! * @param y The Y coordinate of the point to test. * ! * @return true if the point is within this component, ! * false otherwise. */ ! public boolean contains (int x, int y) { ! return (x >= 0) && (y >= 0) && (x < width) && (y < height); } /** * Tests whether or not the specified point is contained within this ! * component. Coordinates are relative to this component. ! * ! * @param x The X coordinate of the point to test. ! * @param y The Y coordinate of the point to test. * ! * @return true if the point is within this component, ! * false otherwise. * ! * @deprecated Deprecated in favor of contains(int, int). */ public boolean inside(int x, int y) { ! return contains(x,y); } /** * Tests whether or not the specified point is contained within this ! * component. Coordinates are relative to this component. ! * ! * @param point The point to test. * ! * @return true if the point is within this component, ! * false otherwise. */ public boolean contains(Point p) { --- 1941,2045 ---- * Returns the status of the loading of the specified image. The value * returned will be those flags defined in ImageObserver. * ! * @param image the image to check on ! * @param observer the observer to notify of image loading progress ! * @return the image observer flags indicating the status of the load ! * @see #prepareImage(Image, int, int, ImageObserver) ! * @see #Toolkit#checkImage(Image, int, int, ImageObserver) ! * @throws NullPointerException if image is null */ public int checkImage(Image image, ImageObserver observer) { ! return checkImage(image, image.getWidth(observer), ! image.getHeight(observer), observer); } /** * Returns the status of the loading of the specified image. The value * returned will be those flags defined in ImageObserver. * ! * @param image the image to check on ! * @param width the scaled image width ! * @param height the scaled image height ! * @param observer the observer to notify of image loading progress ! * @return the image observer flags indicating the status of the load ! * @see #prepareImage(Image, int, int, ImageObserver) ! * @see #Toolkit#checkImage(Image, int, int, ImageObserver) */ ! public int checkImage(Image image, int width, int height, ! ImageObserver observer) { if (peer != null) ! return peer.checkImage(image, width, height, observer); ! return getToolkit().checkImage(image, width, height, observer); } /** ! * Sets whether paint messages delivered by the operating system should be ! * ignored. This does not affect messages from AWT, except for those ! * triggered by OS messages. Setting this to true can allow faster ! * performance in full-screen mode or page-flipping. * ! * @param ignoreRepaint the new setting for ignoring repaint events ! * @see #getIgnoreRepaint() ! * @see BufferStrategy ! * @see GraphicsDevice.setFullScreenWindow(Window) ! * @since 1.4 ! */ ! public void setIgnoreRepaint(boolean ignoreRepaint) ! { ! this.ignoreRepaint = ignoreRepaint; ! } ! ! /** ! * Test whether paint events from the operating system are ignored. * ! * @return the status of ignoring paint events ! * @see #setIgnoreRepaint(boolean) ! * @since 1.4 */ ! public boolean getIgnoreRepaint() { ! return ignoreRepaint; } /** * Tests whether or not the specified point is contained within this ! * component. Coordinates are relative to this component. * ! * @param x the X coordinate of the point to test ! * @param y the Y coordinate of the point to test ! * @return true if the point is within this component ! * @see #getComponentAt(int, int) ! */ ! public boolean contains(int x, int y) ! { ! return x >= 0 && y >= 0 && x < width && y < height; ! } ! ! /** ! * Tests whether or not the specified point is contained within this ! * component. Coordinates are relative to this component. * ! * @param x the X coordinate of the point to test ! * @param y the Y coordinate of the point to test ! * @return true if the point is within this component ! * @deprecated use {@link #contains(int, int)} instead */ public boolean inside(int x, int y) { ! return contains(x, y); } /** * Tests whether or not the specified point is contained within this ! * component. Coordinates are relative to this component. * ! * @param p the point to test ! * @return true if the point is within this component ! * @throws NullPointerException if p is null ! * @see #getComponentAt(Point) ! * @since 1.1 */ public boolean contains(Point p) { *************** public abstract class Component implemen *** 1375,1410 **** } /** ! * Returns the component occupying the position (x,y). This will either * be this component, an immediate child component, or null * if neither of the first two occupies the specified location. * ! * @param x The X coordinate to search for components at. ! * @param y The Y coordinate to search for components at. ! * ! * @return The component at the specified location, for null ! * if there is none. */ public Component getComponentAt(int x, int y) { ! if (contains(x,y)) ! return this; ! return null; } /** ! * Returns the component occupying the position (x,y). This will either * be this component, an immediate child component, or null * if neither of the first two occupies the specified location. * ! * @param x The X coordinate to search for components at. ! * @param y The Y coordinate to search for components at. ! * ! * @return The component at the specified location, for null ! * if there is none. ! * ! * @deprecated The method is deprecated in favor of ! * getComponentAt(). */ public Component locate(int x, int y) { --- 2047,2075 ---- } /** ! * Returns the component occupying the position (x,y). This will either * be this component, an immediate child component, or null * if neither of the first two occupies the specified location. * ! * @param x the X coordinate to search for components at ! * @param y the Y coordinate to search for components at ! * @return the component at the specified location, or null ! * @see #contains(int, int) */ public Component getComponentAt(int x, int y) { ! return contains(x, y) ? this : null; } /** ! * Returns the component occupying the position (x,y). This will either * be this component, an immediate child component, or null * if neither of the first two occupies the specified location. * ! * @param x the X coordinate to search for components at ! * @param y the Y coordinate to search for components at ! * @return the component at the specified location, or null ! * @deprecated use {@link #getComponentAt(int, int)} instead */ public Component locate(int x, int y) { *************** public abstract class Component implemen *** 1412,1425 **** } /** ! * Returns the component occupying the specified point This will either * be this component, an immediate child component, or null * if neither of the first two occupies the specified location. * ! * @param point The point to search for components at. ! * ! * @return The component at the specified location, for null ! * if there is none. */ public Component getComponentAt(Point p) { --- 2077,2091 ---- } /** ! * Returns the component occupying the position (x,y). This will either * be this component, an immediate child component, or null * if neither of the first two occupies the specified location. * ! * @param p the point to search for components at ! * @return the component at the specified location, or null ! * @throws NullPointerException if p is null ! * @see #contains(Point) ! * @since 1.1 */ public Component getComponentAt(Point p) { *************** public abstract class Component implemen *** 1429,1519 **** /** * AWT 1.0 event dispatcher. * ! * @deprecated Deprecated in favor of dispatchEvent(). */ public void deliverEvent(Event e) { } ! /** Forward AWT events to processEvent() if: ! * - Events have been enabled for this type of event via enableEvents(), ! * OR: ! * - There is at least one registered listener for this type of event ! * ! * @param event The event to dispatch ! * ! * @specnote This method is final, but we need to be able to ! * override it in order to handle other event types in our ! * subclasses. The solution is to define a second, non-final ! * method - dispatchEventImpl() - to actually do the work. ! * Investigations with Thread.dumpStack() on the dispatch thread ! * in JDK 1.3 show Sun's implementation is doing the same ! * thing. ! */ public final void dispatchEvent(AWTEvent e) { dispatchEventImpl(e); ! ! /* Give the peer a chance to handle the event. */ ! if (peer != null) peer.handleEvent(e); } - void dispatchEventImpl(AWTEvent e) - { - // Make use of event id's in order to avoid multiple instanceof tests. - if (e.id <= ComponentEvent.COMPONENT_LAST - && e.id >= ComponentEvent.COMPONENT_FIRST - && (componentListener != null - || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0)) - processEvent(e); - else if (e.id <= KeyEvent.KEY_LAST - && e.id >= KeyEvent.KEY_FIRST - && (keyListener != null - || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0)) - processEvent(e); - else if (e.id <= MouseEvent.MOUSE_LAST - && e.id >= MouseEvent.MOUSE_FIRST - && (mouseListener != null - || mouseMotionListener != null - || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0)) - processEvent(e); - else if (e.id <= FocusEvent.FOCUS_LAST - && e.id >= FocusEvent.FOCUS_FIRST - && (focusListener != null - || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0)) - processEvent(e); - else if (e.id <= InputMethodEvent.INPUT_METHOD_LAST - && e.id >= InputMethodEvent.INPUT_METHOD_FIRST - && (inputMethodListener != null - || (eventMask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0)) - processEvent(e); - else if (e.id <= HierarchyEvent.HIERARCHY_LAST - && e.id >= HierarchyEvent.HIERARCHY_FIRST - && (hierarchyListener != null - || hierarchyBoundsListener != null - || (eventMask & AWTEvent.HIERARCHY_EVENT_MASK) != 0)) - processEvent(e); - else if (e.id <= PaintEvent.PAINT_LAST - && e.id >= PaintEvent.PAINT_FIRST - && (eventMask & AWTEvent.PAINT_EVENT_MASK) != 0) - processEvent(e); - } - /** * AWT 1.0 event dispatcher. * ! * @deprecated Deprecated in favor of dispatchEvent(). */ public boolean postEvent(Event e) { return false; } /** ! * Adds the specified listener to this component. * ! * @param listener The new listener to add. */ public synchronized void addComponentListener(ComponentListener l) { --- 2095,2149 ---- /** * AWT 1.0 event dispatcher. * ! * @param e the event to dispatch ! * @deprecated use {@link #dispatchEvent(AWTEvent)} instead */ public void deliverEvent(Event e) { + // XXX Add backward compatibility handling. } ! /** ! * Forwards AWT events to processEvent() if:

      ! *
    • Events have been enabled for this type of event via ! * enableEvents()
    • , ! *
    • There is at least one registered listener for this type of event
    • ! *
    ! * ! * @param e the event to dispatch ! */ public final void dispatchEvent(AWTEvent e) { + // Some subclasses in the AWT package need to override this behavior, + // hence the use of dispatchEventImpl(). dispatchEventImpl(e); ! if (peer != null && ! e.consumed) peer.handleEvent(e); } /** * AWT 1.0 event dispatcher. * ! * @param e the event to dispatch ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #dispatchEvent(AWTEvent)} instead */ public boolean postEvent(Event e) { + // XXX Add backward compatibility handling. return false; } /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. * ! * @param listener the new listener to add ! * @see ComponentEvent ! * @see #removeComponentListener(ComponentListener) ! * @see #getComponentListeners() ! * @since 1.1 */ public synchronized void addComponentListener(ComponentListener l) { *************** public abstract class Component implemen *** 1523,1531 **** } /** ! * Removes the specified listener from the component. * ! * @param listener The listener to remove. */ public synchronized void removeComponentListener(ComponentListener l) { --- 2153,2166 ---- } /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. * ! * @param listener the listener to remove ! * @see ComponentEvent ! * @see #addComponentListener(ComponentListener) ! * @see #getComponentListeners() ! * @since 1.1 */ public synchronized void removeComponentListener(ComponentListener l) { *************** public abstract class Component implemen *** 1533,1606 **** } /** ! * Adds the specified listener to this component. * ! * @param listener The new listener to add. */ public synchronized void addFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.add(focusListener, l); if (focusListener != null) ! enableEvents(AWTEvent.FOCUS_EVENT_MASK); } /** ! * Removes the specified listener from the component. * ! * @param listener The listener to remove. */ public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); } ! ! /** @since 1.3 */ public synchronized void addHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.add(hierarchyListener, l); if (hierarchyListener != null) ! enableEvents(AWTEvent.HIERARCHY_EVENT_MASK); } ! ! /** @since 1.3 */ public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); } ! /** @since 1.3 */ ! public synchronized void addHierarchyBoundsListener(HierarchyBoundsListener l) { ! hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l); if (hierarchyBoundsListener != null) ! enableEvents(AWTEvent.HIERARCHY_EVENT_MASK); } ! /** @since 1.3 */ ! public synchronized void removeHierarchyBoundsListener(HierarchyBoundsListener l) { ! hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); } /** ! * Adds the specified listener to this component. * ! * @param listener The new listener to add. */ public synchronized void addKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.add(keyListener, l); if (keyListener != null) ! enableEvents(AWTEvent.KEY_EVENT_MASK); } /** ! * Removes the specified listener from the component. * ! * @param listener The listener to remove. */ public synchronized void removeKeyListener(KeyListener l) { --- 2168,2361 ---- } /** ! * Returns an array of all specified listeners registered on this component. * ! * @return an array of listeners ! * @see #addComponentListener(ComponentListener) ! * @see #removeComponentListener(ComponentListener) ! * @since 1.4 ! */ ! public synchronized ComponentListener[] getComponentListeners() ! { ! return (ComponentListener[]) ! AWTEventMulticaster.getListeners(componentListener, ! ComponentListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see FocusEvent ! * @see #removeFocusListener(FocusListener) ! * @see #getFocusListeners() ! * @since 1.1 */ public synchronized void addFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.add(focusListener, l); if (focusListener != null) ! enableEvents(AWTEvent.FOCUS_EVENT_MASK); } /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. * ! * @param listener the listener to remove ! * @see FocusEvent ! * @see #addFocusListener(FocusListener) ! * @see #getFocusListeners() ! * @since 1.1 */ public synchronized void removeFocusListener(FocusListener l) { focusListener = AWTEventMulticaster.remove(focusListener, l); } ! ! /** ! * Returns an array of all specified listeners registered on this component. ! * ! * @return an array of listeners ! * @see #addFocusListener(FocusListener) ! * @see #removeFocusListener(FocusListener) ! * @since 1.4 ! */ ! public synchronized FocusListener[] getFocusListeners() ! { ! return (FocusListener[]) ! AWTEventMulticaster.getListeners(focusListener, FocusListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see HierarchyEvent ! * @see #removeHierarchyListener(HierarchyListener) ! * @see #getHierarchyListeners() ! * @since 1.3 ! */ public synchronized void addHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.add(hierarchyListener, l); if (hierarchyListener != null) ! enableEvents(AWTEvent.HIERARCHY_EVENT_MASK); } ! ! /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. ! * ! * @param listener the listener to remove ! * @see HierarchyEvent ! * @see #addHierarchyListener(HierarchyListener) ! * @see #getHierarchyListeners() ! * @since 1.3 ! */ public synchronized void removeHierarchyListener(HierarchyListener l) { hierarchyListener = AWTEventMulticaster.remove(hierarchyListener, l); } ! /** ! * Returns an array of all specified listeners registered on this component. ! * ! * @return an array of listeners ! * @see #addHierarchyListener(HierarchyListener) ! * @see #removeHierarchyListener(HierarchyListener) ! * @since 1.4 ! */ ! public synchronized HierarchyListener[] getHierarchyListeners() { ! return (HierarchyListener[]) ! AWTEventMulticaster.getListeners(hierarchyListener, ! HierarchyListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see HierarchyEvent ! * @see #removeHierarchyBoundsListener(HierarchyBoundsListener) ! * @see #getHierarchyBoundsListeners() ! * @since 1.3 ! */ ! public synchronized void ! addHierarchyBoundsListener(HierarchyBoundsListener l) ! { ! hierarchyBoundsListener = AWTEventMulticaster.add(hierarchyBoundsListener, l); if (hierarchyBoundsListener != null) ! enableEvents(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK); } ! /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. ! * ! * @param listener the listener to remove ! * @see HierarchyEvent ! * @see #addHierarchyBoundsListener(HierarchyBoundsListener) ! * @see #getHierarchyBoundsListeners() ! * @since 1.3 ! */ ! public synchronized void removeHierarchyBoundsListener(HierarchyBoundsListener l) { ! hierarchyBoundsListener = AWTEventMulticaster.remove(hierarchyBoundsListener, l); } /** ! * Returns an array of all specified listeners registered on this component. * ! * @return an array of listeners ! * @see #addHierarchyBoundsListener(HierarchyBoundsListener) ! * @see #removeHierarchyBoundsListener(HierarchyBoundsListener) ! * @since 1.4 ! */ ! public synchronized HierarchyBoundsListener[] getHierarchyBoundsListeners() ! { ! return (HierarchyBoundsListener[]) ! AWTEventMulticaster.getListeners(hierarchyBoundsListener, ! HierarchyBoundsListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see KeyEvent ! * @see #removeKeyListener(KeyListener) ! * @see #getKeyListeners() ! * @since 1.1 */ public synchronized void addKeyListener(KeyListener l) { keyListener = AWTEventMulticaster.add(keyListener, l); if (keyListener != null) ! enableEvents(AWTEvent.KEY_EVENT_MASK); } /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. * ! * @param listener the listener to remove ! * @see KeyEvent ! * @see #addKeyListener(KeyListener) ! * @see #getKeyListeners() ! * @since 1.1 */ public synchronized void removeKeyListener(KeyListener l) { *************** public abstract class Component implemen *** 1608,1765 **** } /** ! * Adds the specified listener to this component. * ! * @param listener The new listener to add. */ public synchronized void addMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.add(mouseListener, l); if (mouseListener != null) ! enableEvents(AWTEvent.MOUSE_EVENT_MASK); } /** ! * Removes the specified listener from the component. * ! * @param listener The listener to remove. */ public synchronized void removeMouseListener(MouseListener l) { ! mouseListener = AWTEventMulticaster.remove(mouseListener, l); } /** ! * Adds the specified listener to this component. * ! * @param listener The new listener to add. */ public synchronized void addMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l); if (mouseMotionListener != null) ! enableEvents(AWTEvent.MOUSE_EVENT_MASK); } /** ! * Removes the specified listener from the component. * ! * @param listener The listener to remove. */ public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); } ! /** @since 1.2 */ public synchronized void addInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l); if (inputMethodListener != null) ! enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK); } ! /** @since 1.2 */ public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); } ! /** Returns all registered EventListers of the given listenerType. ! * listenerType must be a subclass of EventListener, or a ! * ClassClassException is thrown. ! * @since 1.3 ! */ public EventListener[] getListeners(Class listenerType) { if (listenerType == ComponentListener.class) ! return getListenersImpl(listenerType, componentListener); ! else if (listenerType == FocusListener.class) ! return getListenersImpl(listenerType, focusListener); ! else if (listenerType == KeyListener.class) ! return getListenersImpl(listenerType, keyListener); ! else if (listenerType == MouseListener.class) ! return getListenersImpl(listenerType, mouseListener); ! else if (listenerType == MouseMotionListener.class) ! return getListenersImpl(listenerType, mouseMotionListener); ! else if (listenerType == InputMethodListener.class) ! return getListenersImpl(listenerType, inputMethodListener); ! else if (listenerType == HierarchyListener.class) ! return getListenersImpl(listenerType, hierarchyListener); ! else if (listenerType == HierarchyBoundsListener.class) ! return getListenersImpl(listenerType, hierarchyBoundsListener); ! else ! return getListenersImpl(listenerType, null); } ! ! static EventListener[] getListenersImpl(Class listenerType, EventListener el) { ! if (! EventListener.class.isAssignableFrom(listenerType)) ! throw new ClassCastException(); ! ! Vector v = new Vector(); ! if (el != null) ! getListenerList (el, v); ! EventListener[] el_a = (EventListener[]) Array.newInstance(listenerType, ! v.size()); ! v.copyInto(el_a); ! return el_a; } ! static void getListenerList(EventListener el, Vector v) { ! if (el instanceof AWTEventMulticaster) ! { ! AWTEventMulticaster mc = (AWTEventMulticaster) el; ! getListenerList(mc.a, v); ! getListenerList(mc.b, v); ! } ! else ! v.addElement(el); } - // The input method framework is currently unimplemented. - // /** @since 1.2 */ - // - //public InputMethodRequests getInputMethodRequests() - // - // /** @since 1.2 */ - // - // public InputContext getInputContext() - /** ! * Enables the specified events. The events to enable are specified * by OR-ing together the desired masks from AWTEvent. ! *

    ! * Events are enabled by default when a listener is attached to the ! * component for that event type. This method can be used by subclasses * to ensure the delivery of a specified event regardless of whether * or not a listener is attached. * ! * @param enable_events The desired events to enable. */ protected final void enableEvents(long eventsToEnable) { eventMask |= eventsToEnable; ! // TODO: Unlike Sun's implementation, I think we should try and ! // enable/disable events at the peer (gtk/X) level. This will avoid ! // clogging the event pipeline with useless mousemove events that ! // we arn't interested in, etc. This will involve extending the peer // interface, but thats okay because the peer interfaces have been ! // deprecated for a long time, and no longer feature in the // API specification at all. ! ! if (isLightweight() && (parent != null)) parent.enableEvents(eventsToEnable); else if (peer != null) ! peer.setEventMask (eventMask); } /** ! * Disables the specified events. The events to disable are specified * by OR-ing together the desired masks from AWTEvent. * ! * @param disable_events The desired events to disable. */ protected final void disableEvents(long eventsToDisable) { --- 2363,2680 ---- } /** ! * Returns an array of all specified listeners registered on this component. * ! * @return an array of listeners ! * @see #addKeyListener(KeyListener) ! * @see #removeKeyListener(KeyListener) ! * @since 1.4 ! */ ! public synchronized KeyListener[] getKeyListeners() ! { ! return (KeyListener[]) ! AWTEventMulticaster.getListeners(keyListener, KeyListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see MouseEvent ! * @see #removeMouseListener(MouseListener) ! * @see #getMouseListeners() ! * @since 1.1 */ public synchronized void addMouseListener(MouseListener l) { mouseListener = AWTEventMulticaster.add(mouseListener, l); if (mouseListener != null) ! enableEvents(AWTEvent.MOUSE_EVENT_MASK); } /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. * ! * @param listener the listener to remove ! * @see MouseEvent ! * @see #addMouseListener(MouseListener) ! * @see #getMouseListeners() ! * @since 1.1 */ public synchronized void removeMouseListener(MouseListener l) { ! mouseListener = AWTEventMulticaster.remove(mouseListener, l); } /** ! * Returns an array of all specified listeners registered on this component. * ! * @return an array of listeners ! * @see #addMouseListener(MouseListener) ! * @see #removeMouseListener(MouseListener) ! * @since 1.4 ! */ ! public synchronized MouseListener[] getMouseListeners() ! { ! return (MouseListener[]) ! AWTEventMulticaster.getListeners(mouseListener, MouseListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see MouseEvent ! * @see #removeMouseMotionListener(MouseMotionListener) ! * @see #getMouseMotionListeners() ! * @since 1.1 */ public synchronized void addMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, l); if (mouseMotionListener != null) ! enableEvents(AWTEvent.MOUSE_EVENT_MASK); } /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. * ! * @param listener the listener to remove ! * @see MouseEvent ! * @see #addMouseMotionListener(MouseMotionListener) ! * @see #getMouseMotionListeners() ! * @since 1.1 */ public synchronized void removeMouseMotionListener(MouseMotionListener l) { mouseMotionListener = AWTEventMulticaster.remove(mouseMotionListener, l); } ! /** ! * Returns an array of all specified listeners registered on this component. ! * ! * @return an array of listeners ! * @see #addMouseMotionListener(MouseMotionListener) ! * @see #removeMouseMotionListener(MouseMotionListener) ! * @since 1.4 ! */ ! public synchronized MouseMotionListener[] getMouseMotionListeners() ! { ! return (MouseMotionListener[]) ! AWTEventMulticaster.getListeners(mouseMotionListener, ! MouseMotionListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see MouseEvent ! * @see MouseWheelEvent ! * @see #removeMouseWheelListener(MouseWheelListener) ! * @see #getMouseWheelListeners() ! * @since 1.4 ! */ ! public synchronized void addMouseWheelListener(MouseWheelListener l) ! { ! mouseWheelListener = AWTEventMulticaster.add(mouseWheelListener, l); ! if (mouseWheelListener != null) ! enableEvents(AWTEvent.MOUSE_WHEEL_EVENT_MASK); ! } ! ! /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. ! * ! * @param listener the listener to remove ! * @see MouseEvent ! * @see MouseWheelEvent ! * @see #addMouseWheelListener(MouseWheelListener) ! * @see #getMouseWheelListeners() ! * @since 1.4 ! */ ! public synchronized void removeMouseWheelListener(MouseWheelListener l) ! { ! mouseWheelListener = AWTEventMulticaster.remove(mouseWheelListener, l); ! } ! ! /** ! * Returns an array of all specified listeners registered on this component. ! * ! * @return an array of listeners ! * @see #addMouseWheelListener(MouseWheelListener) ! * @see #removeMouseWheelListener(MouseWheelListener) ! * @since 1.4 ! */ ! public synchronized MouseWheelListener[] getMouseWheelListeners() ! { ! return (MouseWheelListener[]) ! AWTEventMulticaster.getListeners(mouseWheelListener, ! MouseWheelListener.class); ! } ! ! /** ! * Adds the specified listener to this component. This is harmless if the ! * listener is null, but if the listener has already been registered, it ! * will now be registered twice. ! * ! * @param listener the new listener to add ! * @see InputMethodEvent ! * @see #removeInputMethodListener(InputMethodListener) ! * @see #getInputMethodListeners() ! * @see #getInputMethodRequests() ! * @since 1.2 ! */ public synchronized void addInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.add(inputMethodListener, l); if (inputMethodListener != null) ! enableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK); } ! /** ! * Removes the specified listener from the component. This is harmless if ! * the listener was not previously registered. ! * ! * @param listener the listener to remove ! * @see InputMethodEvent ! * @see #addInputMethodListener(InputMethodListener) ! * @see #getInputMethodRequests() ! * @since 1.2 ! */ public synchronized void removeInputMethodListener(InputMethodListener l) { inputMethodListener = AWTEventMulticaster.remove(inputMethodListener, l); } ! /** ! * Returns an array of all specified listeners registered on this component. ! * ! * @return an array of listeners ! * @see #addInputMethodListener(InputMethodListener) ! * @see #removeInputMethodListener(InputMethodListener) ! * @since 1.4 ! */ ! public synchronized InputMethodListener[] getInputMethodListeners() ! { ! return (InputMethodListener[]) ! AWTEventMulticaster.getListeners(inputMethodListener, ! InputMethodListener.class); ! } ! ! /** ! * Returns all registered EventListers of the given listenerType. ! * ! * @param listenerType the class of listeners to filter ! * @return an array of registered listeners ! * @see #getComponentListeners() ! * @see #getFocusListeners() ! * @see #getHierarchyListeners() ! * @see #getHierarchyBoundsListeners() ! * @see #getKeyListeners() ! * @see #getMouseListeners() ! * @see #getMouseMotionListeners() ! * @see #getMouseWheelListeners() ! * @see #getInputMethodListeners() ! * @see #getPropertyChangeListeners() ! * @since 1.3 ! */ public EventListener[] getListeners(Class listenerType) { if (listenerType == ComponentListener.class) ! return getComponentListeners(); ! if (listenerType == FocusListener.class) ! return getFocusListeners(); ! if (listenerType == HierarchyListener.class) ! return getHierarchyListeners(); ! if (listenerType == HierarchyBoundsListener.class) ! return getHierarchyBoundsListeners(); ! if (listenerType == KeyListener.class) ! return getKeyListeners(); ! if (listenerType == MouseListener.class) ! return getMouseListeners(); ! if (listenerType == MouseMotionListener.class) ! return getMouseMotionListeners(); ! if (listenerType == MouseWheelListener.class) ! return getMouseWheelListeners(); ! if (listenerType == InputMethodListener.class) ! return getInputMethodListeners(); ! if (listenerType == PropertyChangeListener.class) ! return getPropertyChangeListeners(); ! return (EventListener[]) Array.newInstance(listenerType, 0); } ! ! /** ! * Returns the input method request handler, for subclasses which support ! * on-the-spot text input. By default, input methods are handled by AWT, ! * and this returns null. ! * ! * @return the input method handler, null by default ! * @since 1.2 ! */ ! public InputMethodRequests getInputMethodRequests() { ! return null; } ! /** ! * Gets the input context of this component, which is inherited from the ! * parent unless this is overridden. ! * ! * @return the text input context ! * @since 1.2 ! */ ! public InputContext getInputContext() { ! return parent == null ? null : parent.getInputContext(); } /** ! * Enables the specified events. The events to enable are specified * by OR-ing together the desired masks from AWTEvent. ! * ! *

    Events are enabled by default when a listener is attached to the ! * component for that event type. This method can be used by subclasses * to ensure the delivery of a specified event regardless of whether * or not a listener is attached. * ! * @param eventsToEnable the desired events to enable ! * @see #processEvent(AWTEvent) ! * @see #disableEvents(long) ! * @see AWTEvent ! * @since 1.1 */ protected final void enableEvents(long eventsToEnable) { eventMask |= eventsToEnable; ! // TODO: Unlike Sun's implementation, I think we should try and ! // enable/disable events at the peer (gtk/X) level. This will avoid ! // clogging the event pipeline with useless mousemove events that ! // we arn't interested in, etc. This will involve extending the peer // interface, but thats okay because the peer interfaces have been ! // deprecated for a long time, and no longer feature in the // API specification at all. ! if (isLightweight() && parent != null) parent.enableEvents(eventsToEnable); else if (peer != null) ! peer.setEventMask(eventMask); } /** ! * Disables the specified events. The events to disable are specified * by OR-ing together the desired masks from AWTEvent. * ! * @param eventsToDisable the desired events to disable ! * @see #enableEvents(long) ! * @since 1.1 */ protected final void disableEvents(long eventsToDisable) { *************** public abstract class Component implemen *** 1767,1846 **** // forward new event mask to peer? } ! /** coalesceEvents is called by the EventQueue if two events with the same ! * event id are queued. Returns a new combined event, or null if no ! * combining is done. ! */ protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent) { switch (existingEvent.id) { case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: ! // Just drop the old (intermediate) event and return the new one. ! return newEvent; case PaintEvent.PAINT: case PaintEvent.UPDATE: ! return coalescePaintEvents((PaintEvent) existingEvent, ! (PaintEvent) newEvent); } - return null; - } - - /** - * Coalesce paint events. Current heuristic is: Merge if the union of - * areas is less than twice that of the sum of the areas. The X server - * tend to create a lot of paint events that are adjacent but not - * overlapping. - * - *

    -    * +------+
    -    * |      +-----+  ...will be merged
    -    * |      |     |
    -    * |      |     |
    -    * +------+     |
    -    *        +-----+
    -    * 
    -    * +---------------+--+
    -    * |               |  |  ...will not be merged
    -    * +---------------+  |
    -    *                 |  |
    -    *                 |  |
    -    *                 |  |
    -    *                 |  |
    -    *                 |  |
    -    *                 +--+
    -    * 
    - */ - private PaintEvent coalescePaintEvents(PaintEvent queuedEvent, - PaintEvent newEvent) - { - Rectangle r1 = queuedEvent.getUpdateRect(); - Rectangle r2 = newEvent.getUpdateRect(); - Rectangle union = r1.union(r2); - - int r1a = r1.width * r1.height; - int r2a = r2.width * r2.height; - int ua = union.width * union.height; - - if (ua > (r1a+r2a)*2) - return null; - /* The 2 factor should maybe be reconsidered. Perhaps 3/2 - would be better? */ - - newEvent.setUpdateRect(union); - return newEvent; } /** ! * Processes the specified event. In this class, this method simply * calls one of the more specific event handlers. ! * ! * @param event The event to process. */ protected void processEvent(AWTEvent e) { - /* Note: the order of these if statements are important. Subclasses must be checked first. Eg. MouseEvent must be checked before ComponentEvent, since a MouseEvent --- 2682,2733 ---- // forward new event mask to peer? } ! /** ! * This is called by the EventQueue if two events with the same event id ! * and owner component are queued. Returns a new combined event, or null if ! * no combining is done. The coelesced events are currently mouse moves ! * (intermediate ones are discarded) and paint events (a merged paint is ! * created in place of the two events). ! * ! * @param existingEvent the event on the queue ! * @param newEvent the new event that might be entered on the queue ! * @return null if both events are kept, or the replacement coelesced event ! */ protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent) { switch (existingEvent.id) { case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: ! // Just drop the old (intermediate) event and return the new one. ! return newEvent; case PaintEvent.PAINT: case PaintEvent.UPDATE: ! return coalescePaintEvents((PaintEvent) existingEvent, ! (PaintEvent) newEvent); ! default: ! return null; } } /** ! * Processes the specified event. In this class, this method simply * calls one of the more specific event handlers. ! * ! * @param event the event to process ! * @throws NullPointerException if e is null ! * @see #processComponentEvent(ComponentEvent) ! * @see #processFocusEvent(FocusEvent) ! * @see #processKeyEvent(KeyEvent) ! * @see #processMouseEvent(MouseEvent) ! * @see #processMouseMotionEvent(MouseEvent) ! * @see #processInputMethodEvent(InputMethodEvent) ! * @see #processHierarchyEvent(HierarchyEvent) ! * @see #processMouseWheelEvent(MouseWheelEvent) ! * @since 1.1 */ protected void processEvent(AWTEvent e) { /* Note: the order of these if statements are important. Subclasses must be checked first. Eg. MouseEvent must be checked before ComponentEvent, since a MouseEvent *************** public abstract class Component implemen *** 1850,1884 **** processFocusEvent((FocusEvent) e); else if (e instanceof PaintEvent) processPaintEvent((PaintEvent) e); else if (e instanceof MouseEvent) { ! if (e.id == MouseEvent.MOUSE_MOVED ! || e.id == MouseEvent.MOUSE_DRAGGED) ! processMouseMotionEvent((MouseEvent) e); ! else ! processMouseEvent((MouseEvent) e); } - else if (e instanceof ComponentEvent) - processComponentEvent((ComponentEvent) e); else if (e instanceof KeyEvent) processKeyEvent((KeyEvent) e); else if (e instanceof InputMethodEvent) processInputMethodEvent((InputMethodEvent) e); else if (e instanceof HierarchyEvent) { if (e.id == HierarchyEvent.HIERARCHY_CHANGED) ! processHierarchyEvent((HierarchyEvent) e); ! else ! processHierarchyBoundsEvent((HierarchyEvent) e); } } /** * Called when a component event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event The ComponentEvent to process. */ protected void processComponentEvent(ComponentEvent e) { --- 2737,2778 ---- processFocusEvent((FocusEvent) e); else if (e instanceof PaintEvent) processPaintEvent((PaintEvent) e); + else if (e instanceof MouseWheelEvent) + processMouseWheelEvent((MouseWheelEvent) e); else if (e instanceof MouseEvent) { ! if (e.id == MouseEvent.MOUSE_MOVED ! || e.id == MouseEvent.MOUSE_DRAGGED) ! processMouseMotionEvent((MouseEvent) e); ! else ! processMouseEvent((MouseEvent) e); } else if (e instanceof KeyEvent) processKeyEvent((KeyEvent) e); else if (e instanceof InputMethodEvent) processInputMethodEvent((InputMethodEvent) e); + else if (e instanceof ComponentEvent) + processComponentEvent((ComponentEvent) e); else if (e instanceof HierarchyEvent) { if (e.id == HierarchyEvent.HIERARCHY_CHANGED) ! processHierarchyEvent((HierarchyEvent) e); ! else ! processHierarchyBoundsEvent((HierarchyEvent) e); } } /** * Called when a component event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event the ComponentEvent to process ! * @throws NullPointerException if e is null ! * @see ComponentListener ! * @see #addComponentListener(ComponentListener) ! * @see #enableEvents(long) ! * @since 1.1 */ protected void processComponentEvent(ComponentEvent e) { *************** public abstract class Component implemen *** 1886,1915 **** return; switch (e.id) { ! case ComponentEvent.COMPONENT_HIDDEN: ! componentListener.componentHidden(e); ! break; ! ! case ComponentEvent.COMPONENT_MOVED: ! componentListener.componentMoved(e); ! break; ! ! case ComponentEvent.COMPONENT_RESIZED: ! componentListener.componentResized(e); ! break; ! ! case ComponentEvent.COMPONENT_SHOWN: ! componentListener.componentShown(e); ! break; } } /** * Called when a focus event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event The FocusEvent to process. */ protected void processFocusEvent(FocusEvent e) { --- 2780,2811 ---- return; switch (e.id) { ! case ComponentEvent.COMPONENT_HIDDEN: ! componentListener.componentHidden(e); ! break; ! case ComponentEvent.COMPONENT_MOVED: ! componentListener.componentMoved(e); ! break; ! case ComponentEvent.COMPONENT_RESIZED: ! componentListener.componentResized(e); ! break; ! case ComponentEvent.COMPONENT_SHOWN: ! componentListener.componentShown(e); ! break; } } /** * Called when a focus event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event the FocusEvent to process ! * @throws NullPointerException if e is null ! * @see FocusListener ! * @see #addFocusListener(FocusListener) ! * @see #enableEvents(long) ! * @since 1.1 */ protected void processFocusEvent(FocusEvent e) { *************** public abstract class Component implemen *** 1918,1937 **** switch (e.id) { case FocusEvent.FOCUS_GAINED: ! focusListener.focusGained(e); ! break; case FocusEvent.FOCUS_LOST: ! focusListener.focusLost(e); ! break; ! } } /** * Called when a key event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event The KeyEvent to process. */ protected void processKeyEvent(KeyEvent e) { --- 2814,2838 ---- switch (e.id) { case FocusEvent.FOCUS_GAINED: ! focusListener.focusGained(e); ! break; case FocusEvent.FOCUS_LOST: ! focusListener.focusLost(e); ! break; ! } } /** * Called when a key event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event the KeyEvent to process ! * @throws NullPointerException if e is null ! * @see KeyListener ! * @see #addKeyListener(KeyListener) ! * @see #enableEvents(long) ! * @since 1.1 */ protected void processKeyEvent(KeyEvent e) { *************** public abstract class Component implemen *** 1939,1962 **** return; switch (e.id) { ! case KeyEvent.KEY_PRESSED: ! keyListener.keyPressed(e); ! break; ! case KeyEvent.KEY_RELEASED: ! keyListener.keyReleased(e); ! break; ! case KeyEvent.KEY_TYPED: ! keyListener.keyTyped(e); ! break; } } /** * Called when a regular mouse event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event The MouseEvent to process. */ protected void processMouseEvent(MouseEvent e) { --- 2840,2868 ---- return; switch (e.id) { ! case KeyEvent.KEY_PRESSED: ! keyListener.keyPressed(e); ! break; ! case KeyEvent.KEY_RELEASED: ! keyListener.keyReleased(e); ! break; ! case KeyEvent.KEY_TYPED: ! keyListener.keyTyped(e); ! break; } } /** * Called when a regular mouse event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event the MouseEvent to process ! * @throws NullPointerException if e is null ! * @see MouseListener ! * @see #addMouseListener(MouseListener) ! * @see #enableEvents(long) ! * @since 1.1 */ protected void processMouseEvent(MouseEvent e) { *************** public abstract class Component implemen *** 1964,1993 **** return; switch (e.id) { ! case MouseEvent.MOUSE_CLICKED: ! mouseListener.mouseClicked(e); ! break; case MouseEvent.MOUSE_ENTERED: ! mouseListener.mouseEntered(e); ! break; ! case MouseEvent.MOUSE_EXITED: ! mouseListener.mouseExited(e); ! break; ! case MouseEvent.MOUSE_PRESSED: ! mouseListener.mousePressed(e); ! break; ! case MouseEvent.MOUSE_RELEASED: ! mouseListener.mouseReleased(e); ! break; } } /** * Called when a mouse motion event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event The MouseMotionEvent to process. */ protected void processMouseMotionEvent(MouseEvent e) { --- 2870,2904 ---- return; switch (e.id) { ! case MouseEvent.MOUSE_CLICKED: ! mouseListener.mouseClicked(e); ! break; case MouseEvent.MOUSE_ENTERED: ! mouseListener.mouseEntered(e); ! break; ! case MouseEvent.MOUSE_EXITED: ! mouseListener.mouseExited(e); ! break; ! case MouseEvent.MOUSE_PRESSED: ! mouseListener.mousePressed(e); ! break; ! case MouseEvent.MOUSE_RELEASED: ! mouseListener.mouseReleased(e); ! break; } } /** * Called when a mouse motion event is dispatched and component events are ! * enabled. This method passes the event along to any listeners * that are attached. * ! * @param event the MouseMotionEvent to process ! * @throws NullPointerException if e is null ! * @see MouseMotionListener ! * @see #addMouseMotionListener(MouseMotionListener) ! * @see #enableEvents(long) ! * @since 1.1 */ protected void processMouseMotionEvent(MouseEvent e) { *************** public abstract class Component implemen *** 1995,2026 **** return; switch (e.id) { ! case MouseEvent.MOUSE_DRAGGED: ! mouseMotionListener.mouseDragged(e); ! break; case MouseEvent.MOUSE_MOVED: ! mouseMotionListener.mouseMoved(e); ! break; ! } } ! /** @since 1.2 */ protected void processInputMethodEvent(InputMethodEvent e) { if (inputMethodListener == null) return; switch (e.id) { ! case InputMethodEvent.CARET_POSITION_CHANGED: inputMethodListener.caretPositionChanged(e); ! break; ! case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED: inputMethodListener.inputMethodTextChanged(e); ! break; ! } } ! ! /** @since 1.3 */ protected void processHierarchyEvent(HierarchyEvent e) { if (hierarchyListener == null) --- 2906,2978 ---- return; switch (e.id) { ! case MouseEvent.MOUSE_DRAGGED: ! mouseMotionListener.mouseDragged(e); ! break; case MouseEvent.MOUSE_MOVED: ! mouseMotionListener.mouseMoved(e); ! break; ! } } ! /** ! * Called when a mouse wheel event is dispatched and component events are ! * enabled. This method passes the event along to any listeners that are ! * attached. ! * ! * @param event the MouseWheelEvent to process ! * @throws NullPointerException if e is null ! * @see MouseWheelListener ! * @see #addMouseWheelListener(MouseWheelListener) ! * @see #enableEvents(long) ! * @since 1.4 ! */ ! protected void processMouseWheelEvent(MouseWheelEvent e) ! { ! if (mouseWheelListener != null ! && e.id == MouseEvent.MOUSE_WHEEL) ! mouseWheelListener.mouseWheelMoved(e); ! } ! ! /** ! * Called when an input method event is dispatched and component events are ! * enabled. This method passes the event along to any listeners that are ! * attached. ! * ! * @param event the InputMethodEvent to process ! * @throws NullPointerException if e is null ! * @see InputMethodListener ! * @see #addInputMethodListener(InputMethodListener) ! * @see #enableEvents(long) ! * @since 1.2 ! */ protected void processInputMethodEvent(InputMethodEvent e) { if (inputMethodListener == null) return; switch (e.id) { ! case InputMethodEvent.CARET_POSITION_CHANGED: inputMethodListener.caretPositionChanged(e); ! break; ! case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED: inputMethodListener.inputMethodTextChanged(e); ! break; ! } } ! ! /** ! * Called when a hierarchy change event is dispatched and component events ! * are enabled. This method passes the event along to any listeners that are ! * attached. ! * ! * @param event the HierarchyEvent to process ! * @throws NullPointerException if e is null ! * @see HierarchyListener ! * @see #addHierarchyListener(HierarchyListener) ! * @see #enableEvents(long) ! * @since 1.3 ! */ protected void processHierarchyEvent(HierarchyEvent e) { if (hierarchyListener == null) *************** public abstract class Component implemen *** 2028,2035 **** if (e.id == HierarchyEvent.HIERARCHY_CHANGED) hierarchyListener.hierarchyChanged(e); } ! ! /** @since 1.3 */ protected void processHierarchyBoundsEvent(HierarchyEvent e) { if (hierarchyBoundsListener == null) --- 2980,2998 ---- if (e.id == HierarchyEvent.HIERARCHY_CHANGED) hierarchyListener.hierarchyChanged(e); } ! ! /** ! * Called when a hierarchy bounds event is dispatched and component events ! * are enabled. This method passes the event along to any listeners that are ! * attached. ! * ! * @param event the HierarchyEvent to process ! * @throws NullPointerException if e is null ! * @see HierarchyBoundsListener ! * @see #addHierarchyBoundsListener(HierarchyBoundsListener) ! * @see #enableEvents(long) ! * @since 1.3 ! */ protected void processHierarchyBoundsEvent(HierarchyEvent e) { if (hierarchyBoundsListener == null) *************** public abstract class Component implemen *** 2037,2191 **** switch (e.id) { case HierarchyEvent.ANCESTOR_MOVED: ! hierarchyBoundsListener.ancestorMoved(e); ! break; ! case HierarchyEvent.ANCESTOR_RESIZED: ! hierarchyBoundsListener.ancestorResized(e); ! break; ! } ! } ! ! private void processPaintEvent(PaintEvent event) ! { ! // Can't do graphics without peer ! if (peer == null) ! return; ! ! Graphics gfx = getGraphics(); ! Shape clip = event.getUpdateRect(); ! gfx.setClip(clip); ! ! switch (event.id) ! { ! case PaintEvent.PAINT: ! paint(gfx); ! break; ! case PaintEvent.UPDATE: ! update(gfx); ! break; ! default: ! throw new IllegalArgumentException("unknown paint event"); } } /** * AWT 1.0 event processor. * ! * @deprecated Deprecated in favor of processEvent. */ public boolean handleEvent(Event evt) { return false; } /** * AWT 1.0 mouse event. * ! * @deprecated Deprecated in favor of processMouseEvent(). */ public boolean mouseDown(Event evt, int x, int y) { return false; } ! /** * AWT 1.0 mouse event. * ! * @deprecated Deprecated in favor of processMouseMotionEvent(). */ public boolean mouseDrag(Event evt, int x, int y) { return false; } /** * AWT 1.0 mouse event. * ! * @deprecated Deprecated in favor of processMouseEvent(). */ public boolean mouseUp(Event evt, int x, int y) { return false; } /** * AWT 1.0 mouse event. * ! * @deprecated Deprecated in favor of processMouseMotionEvent(). */ public boolean mouseMove(Event evt, int x, int y) { return false; } /** * AWT 1.0 mouse event. * ! * @deprecated Deprecated in favor of processMouseEvent(). */ public boolean mouseEnter(Event evt, int x, int y) { return false; } /** * AWT 1.0 mouse event. * ! * @deprecated Deprecated in favor of processMouseEvent(). */ public boolean mouseExit(Event evt, int x, int y) { return false; } /** * AWT 1.0 key press event. * ! * @deprecated Deprecated in favor of processKeyEvent. */ public boolean keyDown(Event evt, int key) { return false; } /** * AWT 1.0 key press event. * ! * @deprecated Deprecated in favor of processKeyEvent. */ public boolean keyUp(Event evt, int key) { return false; } /** * AWT 1.0 action event processor. * ! * @deprecated Deprecated in favor of the ActionListener ! * interface. */ public boolean action(Event evt, Object what) { return false; } /** * Called to inform this component it has been added to a container. ! * A native peer - if any - is created at this time. This method is * called automatically by the AWT system and should not be called by * user level code. */ public void addNotify() { if (peer == null) peer = getToolkit().createComponent(this); - /* Now that all the children has gotten their peers, we should have the event mask needed for this component and its lightweight subcomponents. */ - peer.setEventMask(eventMask); - /* We do not invalidate here, but rather leave that job up to the peer. For efficiency, the peer can choose not to invalidate if it is happy with the current dimensions, --- 3000,3176 ---- switch (e.id) { case HierarchyEvent.ANCESTOR_MOVED: ! hierarchyBoundsListener.ancestorMoved(e); ! break; ! case HierarchyEvent.ANCESTOR_RESIZED: ! hierarchyBoundsListener.ancestorResized(e); ! break; } } /** * AWT 1.0 event processor. * ! * @param evt the event to handle ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processEvent(AWTEvent)} instead */ public boolean handleEvent(Event evt) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 mouse event. * ! * @param evt the event to handle ! * @param x the x coordinate, ignored ! * @param y the y coordinate, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processMouseEvent(MouseEvent)} instead */ public boolean mouseDown(Event evt, int x, int y) { + // XXX Add backward compatibility handling. return false; } ! /** * AWT 1.0 mouse event. * ! * @param evt the event to handle ! * @param x the x coordinate, ignored ! * @param y the y coordinate, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processMouseMotionEvent(MouseEvent)} instead */ public boolean mouseDrag(Event evt, int x, int y) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 mouse event. * ! * @param evt the event to handle ! * @param x the x coordinate, ignored ! * @param y the y coordinate, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processMouseEvent(MouseEvent)} instead */ public boolean mouseUp(Event evt, int x, int y) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 mouse event. * ! * @param evt the event to handle ! * @param x the x coordinate, ignored ! * @param y the y coordinate, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processMouseMotionEvent(MouseEvent)} instead */ public boolean mouseMove(Event evt, int x, int y) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 mouse event. * ! * @param evt the event to handle ! * @param x the x coordinate, ignored ! * @param y the y coordinate, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processMouseEvent(MouseEvent)} instead */ public boolean mouseEnter(Event evt, int x, int y) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 mouse event. * ! * @param evt the event to handle ! * @param x the x coordinate, ignored ! * @param y the y coordinate, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processMouseEvent(MouseEvent)} instead */ public boolean mouseExit(Event evt, int x, int y) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 key press event. * ! * @param evt the event to handle ! * @param key the key pressed, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processKeyEvent(KeyEvent)} instead */ public boolean keyDown(Event evt, int key) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 key press event. * ! * @param evt the event to handle ! * @param key the key pressed, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processKeyEvent(KeyEvent)} instead */ public boolean keyUp(Event evt, int key) { + // XXX Add backward compatibility handling. return false; } /** * AWT 1.0 action event processor. * ! * @param evt the event to handle ! * @param what the object acted on, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated in classes which support actions, use ! * processActionEvent(ActionEvent) instead */ public boolean action(Event evt, Object what) { + // XXX Add backward compatibility handling. return false; } /** * Called to inform this component it has been added to a container. ! * A native peer - if any - is created at this time. This method is * called automatically by the AWT system and should not be called by * user level code. + * + * @see #isDisplayable() + * @see #removeNotify() */ public void addNotify() { if (peer == null) peer = getToolkit().createComponent(this); /* Now that all the children has gotten their peers, we should have the event mask needed for this component and its lightweight subcomponents. */ peer.setEventMask(eventMask); /* We do not invalidate here, but rather leave that job up to the peer. For efficiency, the peer can choose not to invalidate if it is happy with the current dimensions, *************** public abstract class Component implemen *** 2194,2411 **** /** * Called to inform this component is has been removed from its ! * container. Its native peer - if any - is destroyed at this time. * This method is called automatically by the AWT system and should * not be called by user level code. */ public void removeNotify() ! { if (peer != null) peer.dispose(); peer = null; } ! ! /** @deprecated */ public boolean gotFocus(Event evt, Object what) { return false; } ! ! /** @deprecated */ public boolean lostFocus(Event evt, Object what) { return false; } /** ! * Tests whether or not this component is in the group that can ! * be traversed using the keyboard traversal mechanism (such as the TAB ! * key). * ! * @return true if the component is traversed via the TAB ! * key, false otherwise. */ public boolean isFocusTraversable() { ! return enabled && visible && (peer == null || peer.isFocusTraversable ()); } /** ! * Requests that this component be given focus. The gotFocus() ! * method on this event will be called when and if this request was ! * successful. */ public void requestFocus() { ! // If there's no peer then this component can't get the focus. We // treat it as a silent rejection of the request. if (peer != null) ! peer.requestFocus (); } ! // This method is used to implement transferFocus(). ! // CHILD is the child making the request. ! // This is overridden by Container; when called for an ordinary ! // component there is no child and so we always return null. ! Component findNextFocusComponent (Component child) { ! return null; } /** ! * Transfers focus to the next component in the focus traversal order. */ public void transferFocus() { Component next; if (parent == null) ! next = findNextFocusComponent (null); else ! next = parent.findNextFocusComponent (this); if (next != null && next != this) ! next.requestFocus (); } /** * AWT 1.0 focus event processor. * ! * @deprecated Deprecated in favor of transferFocus(). */ public void nextFocus() { transferFocus(); } ! /** @since 1.2 */ public boolean hasFocus() { ! return hasFocus; } /** * Adds the specified popup menu to this component. * ! * @param menu The popup menu to be added. */ public synchronized void add(PopupMenu popup) { if (popups == null) popups = new Vector(); ! popups.addElement(popup); } /** * Removes the specified popup menu from this component. * ! * @param menu The popup menu to remove. */ public synchronized void remove(MenuComponent popup) { ! popups.removeElement(popup); } /** ! * Returns a debugging string representing this component. * ! * @return A string representing this component. */ protected String paramString() { StringBuffer param = new StringBuffer(); String name = getName(); if (name != null) ! { ! param.append(name); ! param.append(","); ! } ! param.append(width); ! param.append("x"); ! param.append(height); ! param.append("+"); ! param.append(x); ! param.append("+"); ! param.append(y); ! ! if (!isValid()) param.append(",invalid"); ! if (!isVisible()) param.append(",invisible"); ! if (!isEnabled()) param.append(",disabled"); ! if (!isOpaque()) param.append(",translucent"); if (isDoubleBuffered()) param.append(",doublebuffered"); - return param.toString(); } /** ! * Returns a string representation of this component. * ! * @return A string representation of this component */ public String toString() { ! return this.getClass().getName() + "[" + paramString() + "]"; } /** ! * Prints a listing of this component to the standard output. */ ! public void list () { ! list (System.out, 0); } /** * Prints a listing of this component to the specified print stream. * ! * @param stream The PrintStream to print to. */ ! public void list (PrintStream out) { ! list (out, 0); } /** * Prints a listing of this component to the specified print stream, * starting at the specified indentation point. * ! * @param stream The PrintStream to print to. ! * @param indent The indentation point. */ ! public void list (PrintStream out, int indent) { for (int i = 0; i < indent; ++i) ! out.print (' '); ! out.println (toString ()); } /** * Prints a listing of this component to the specified print writer. * ! * @param writer The PrintWrinter to print to. */ ! public void list (PrintWriter out) { ! list (out, 0); } /** * Prints a listing of this component to the specified print writer, * starting at the specified indentation point. * ! * @param writer The PrintWriter to print to. ! * @param indent The indentation point. */ ! public void list (PrintWriter out, int indent) { for (int i = 0; i < indent; ++i) ! out.print (' '); ! out.println (toString ()); } public void addPropertyChangeListener(PropertyChangeListener listener) { if (changeSupport == null) --- 3179,3809 ---- /** * Called to inform this component is has been removed from its ! * container. Its native peer - if any - is destroyed at this time. * This method is called automatically by the AWT system and should * not be called by user level code. + * + * @see #isDisplayable() + * @see #addNotify() */ public void removeNotify() ! { if (peer != null) peer.dispose(); peer = null; } ! ! /** ! * AWT 1.0 focus event. ! * ! * @param evt the event to handle ! * @param what the Object focused, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processFocusEvent(FocusEvent)} instead ! */ public boolean gotFocus(Event evt, Object what) { + // XXX Add backward compatibility handling. return false; } ! ! /** ! * AWT 1.0 focus event. ! * ! * @param evt the event to handle ! * @param what the Object focused, ignored ! * @return false: since the method was deprecated, the return has no meaning ! * @deprecated use {@link #processFocusEvent(FocusEvent)} instead ! */ public boolean lostFocus(Event evt, Object what) { + // XXX Add backward compatibility handling. return false; } /** ! * Tests whether or not this component is in the group that can be ! * traversed using the keyboard traversal mechanism (such as the TAB key). * ! * @return true if the component is traversed via the TAB key ! * @see #setFocusable(boolean) ! * @since 1.1 ! * @deprecated use {@link #isFocusable()} instead */ public boolean isFocusTraversable() { ! return enabled && visible && (peer == null || peer.isFocusTraversable()); } /** ! * Tests if this component can receive focus. ! * ! * @return true if this component can receive focus ! * @since 1.4 ! */ ! public boolean isFocusable() ! { ! return focusable; ! } ! ! /** ! * Specify whether this component can receive focus. ! * ! * @param focusable the new focusable status ! * @since 1.4 ! */ ! public void setFocusable(boolean focusable) ! { ! firePropertyChange("focusable", this.focusable, focusable); ! this.focusable = focusable; ! } ! ! /** ! * Sets the focus traversal keys for a given type of focus events. Normally, ! * the default values should match the operating system's native choices. To ! * disable a given traversal, use Collections.EMPTY_SET. The ! * event dispatcher will consume PRESSED, RELEASED, and TYPED events for the ! * specified key, although focus can only transfer on PRESSED or RELEASED. ! * ! *

    The defauts are: ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *
    IdentifierMeaningDefault
    KeyboardFocusManager.FORWARD_TRAVERSAL_KEYSNormal forward traversalTAB on KEY_PRESSED, Ctrl-TAB on KEY_PRESSED
    KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYSNormal backward traversalShift-TAB on KEY_PRESSED, Ctrl-Shift-TAB on KEY_PRESSED
    KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYSGo up a traversal cycleNone
    ! * ! *

    Specifying null allows inheritance from the parent, or from the current ! * KeyboardFocusManager default set. If not null, the set must contain only ! * AWTKeyStrokes that are not already focus keys and are not KEY_TYPED ! * events. ! * ! * @param id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS, or ! * UP_CYCLE_TRAVERSAL_KEYS ! * @param keystrokes a set of keys, or null ! * @throws IllegalArgumentException if id or keystrokes is invalid ! * @see #getFocusTraversalKeys(int) ! * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS ! * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS ! * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS ! * @since 1.4 ! */ ! public void setFocusTraversalKeys(int id, Set keystrokes) ! { ! if (keystrokes == null) ! throw new IllegalArgumentException(); ! Set sa; ! Set sb; ! String name; ! switch (id) ! { ! case KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS: ! sa = getFocusTraversalKeys ! (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); ! sb = getFocusTraversalKeys ! (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); ! name = "forwardFocusTraversalKeys"; ! break; ! case KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS: ! sa = getFocusTraversalKeys ! (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); ! sb = getFocusTraversalKeys ! (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); ! name = "backwardFocusTraversalKeys"; ! break; ! case KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS: ! sa = getFocusTraversalKeys ! (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); ! sb = getFocusTraversalKeys ! (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); ! name = "upCycleFocusTraversalKeys"; ! break; ! default: ! throw new IllegalArgumentException(); ! } ! int i = keystrokes.size(); ! Iterator iter = keystrokes.iterator(); ! while (--i >= 0) ! { ! Object o = iter.next(); ! if (! (o instanceof AWTKeyStroke) ! || sa.contains(o) || sb.contains(o) ! || ((AWTKeyStroke) o).keyCode == KeyEvent.VK_UNDEFINED) ! throw new IllegalArgumentException(); ! } ! if (focusTraversalKeys == null) ! focusTraversalKeys = new Set[3]; ! keystrokes = Collections.unmodifiableSet(new HashSet(keystrokes)); ! firePropertyChange(name, focusTraversalKeys[id], keystrokes); ! focusTraversalKeys[id] = keystrokes; ! } ! ! /** ! * Returns the set of keys for a given focus traversal action, as defined ! * in setFocusTraversalKeys. If not set, this is inherited from ! * the parent component, which may have gotten it from the ! * KeyboardFocusManager. ! * ! * @param id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS, or ! * UP_CYCLE_TRAVERSAL_KEYS ! * @throws IllegalArgumentException if id is invalid ! * @see #setFocusTraversalKeys(int, Set) ! * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS ! * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS ! * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS ! * @since 1.4 ! */ ! public Set getFocusTraversalKeys(int id) ! { ! if (id < KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS ! || id > KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS) ! throw new IllegalArgumentException(); ! Set s = null; ! if (focusTraversalKeys != null) ! s = focusTraversalKeys[id]; ! if (s == null && parent != null) ! s = parent.getFocusTraversalKeys(id); ! return s == null ? (KeyboardFocusManager.getCurrentKeyboardFocusManager() ! .getDefaultFocusTraversalKeys(id)) : s; ! } ! ! /** ! * Tests whether the focus traversal keys for a given action are explicitly ! * set or inherited. ! * ! * @param id one of FORWARD_TRAVERSAL_KEYS, BACKWARD_TRAVERSAL_KEYS, or ! * UP_CYCLE_TRAVERSAL_KEYS ! * @return true if that set is explicitly specified ! * @throws IllegalArgumentException if id is invalid ! * @see #getFocusTraversalKeys(int) ! * @see KeyboardFocusManager#FORWARD_TRAVERSAL_KEYS ! * @see KeyboardFocusManager#BACKWARD_TRAVERSAL_KEYS ! * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS ! * @since 1.4 ! */ ! public boolean areFocusTraversalKeysSet(int id) ! { ! if (id < KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS ! || id > KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS) ! throw new IllegalArgumentException(); ! return focusTraversalKeys != null && focusTraversalKeys[id] != null; ! } ! ! /** ! * Sets whether focus traversal keys are enabled, which consumes traversal ! * keys and performs the focus event automatically. ! * ! * @param focusTraversalKeysEnabled the new value of the flag ! * @see #getFocusTraversalKeysEnabled() ! * @see #setFocusTraversalKeys(int, Set) ! * @see #getFocusTraversalKeys(int) ! * @since 1.4 ! */ ! public void setFocusTraversalKeysEnabled(boolean focusTraversalKeysEnabled) ! { ! firePropertyChange("focusTraversalKeysEnabled", ! this.focusTraversalKeysEnabled, ! focusTraversalKeysEnabled); ! this.focusTraversalKeysEnabled = focusTraversalKeysEnabled; ! } ! ! /** ! * Tests whether focus traversal keys are enabled. If they are, then focus ! * traversal keys are consumed and focus events performed automatically, ! * without the component seeing the keystrokes. ! * ! * @return true if focus traversal is enabled ! * @see #setFocusTraversalKeysEnabled(boolean) ! * @see #setFocusTraversalKeys(int, Set) ! * @see #getFocusTraversalKeys(int) ! * @since 1.4 ! */ ! public boolean getFocusTraversalKeysEnabled() ! { ! return focusTraversalKeysEnabled; ! } ! ! /** ! * Requests that this component be given focus. A FOCUS_GAINED ! * event will be fired if and only if this request is successful. To be ! * successful, the component must be displayable, visible, and focusable, ! * and the top-level Window must be able to receive focus. Thus, this ! * request may fail, or be delayed until the window receives focus. It is ! * recommended that requestFocusInWindow be used where ! * possible to be more platform-independent. ! * ! * @see #requestFocusInWindow() ! * @see FocusEvent ! * @see #addFocusListener(FocusListener) ! * @see #isFocusable() ! * @see #isDisplayable() ! * @see KeyboardFocusManager#clearGlobalFocusOwner() */ public void requestFocus() { ! // If there's no peer then this component can't get the focus. We // treat it as a silent rejection of the request. if (peer != null) ! peer.requestFocus(); } ! /** ! * Requests that this component be given focus. A FOCUS_GAINED ! * event will be fired if and only if this request is successful. To be ! * successful, the component must be displayable, visible, and focusable, ! * and the top-level Window must be able to receive focus. Thus, this ! * request may fail, or be delayed until the window receives focus. It is ! * recommended that requestFocusInWindow be used where ! * possible to be more platform-independent. ! * ! *

    If the return value is false, the request is guaranteed to fail. If ! * it is true, it will likely succeed unless the action is vetoed or ! * something in the native windowing system intervenes. The temporary flag, ! * and thus this method in general, is not designed for public use; rather ! * it is a hook for lightweight components to notify their container in ! * an attempt to reduce the amount of repainting necessary. ! * ! * @param temporary true if the focus request is temporary ! * @return true if the request has a chance of success ! * @see #requestFocusInWindow() ! * @see FocusEvent ! * @see #addFocusListener(FocusListener) ! * @see #isFocusable() ! * @see #isDisplayable() ! * @see KeyboardFocusManager#clearGlobalFocusOwner() ! * @since 1.4 ! */ ! protected boolean requestFocus(boolean temporary) { ! // XXX Implement correctly. ! requestFocus(); ! return true; } /** ! * Requests that this component be given focus, if it resides in the ! * top-level window which already has focus. A FOCUS_GAINED ! * event will be fired if and only if this request is successful. To be ! * successful, the component must be displayable, visible, and focusable, ! * and the top-level Window must be focused. ! * ! *

    If the return value is false, the request is guaranteed to fail. If ! * it is true, it will likely succeed unless the action is vetoed or ! * something in the native windowing system intervenes. The temporary flag, ! * and thus this method in general, is not designed for public use; rather ! * it is a hook for lightweight components to notify their container in ! * an attempt to reduce the amount of repainting necessary. ! * ! * @return true if the request has a chance of success ! * @see #requestFocus() ! * @see FocusEvent ! * @see #addFocusListener(FocusListener) ! * @see #isFocusable() ! * @see #isDisplayable() ! * @see KeyboardFocusManager#clearGlobalFocusOwner() ! * @since 1.4 ! */ ! public boolean requestFocusInWindow() ! { ! // XXX Implement correctly. ! requestFocus(); ! return true; ! } ! ! /** ! * Requests that this component be given focus, if it resides in the ! * top-level window which already has focus. A FOCUS_GAINED ! * event will be fired if and only if this request is successful. To be ! * successful, the component must be displayable, visible, and focusable, ! * and the top-level Window must be focused. ! * ! *

    If the return value is false, the request is guaranteed to fail. If ! * it is true, it will likely succeed unless the action is vetoed or ! * something in the native windowing system intervenes. The temporary flag, ! * and thus this method in general, is not designed for public use; rather ! * it is a hook for lightweight components to notify their container in ! * an attempt to reduce the amount of repainting necessary. ! * ! * @param temporary true if the focus request is temporary ! * @return true if the request has a chance of success ! * @see #requestFocus() ! * @see FocusEvent ! * @see #addFocusListener(FocusListener) ! * @see #isFocusable() ! * @see #isDisplayable() ! * @see KeyboardFocusManager#clearGlobalFocusOwner() ! * @since 1.4 ! */ ! protected boolean requestFocusInWindow(boolean temporary) ! { ! // XXX Implement correctly. ! requestFocus(); ! return true; ! } ! ! /** ! * Transfers focus to the next component in the focus traversal order, as ! * though this were the current focus owner. ! * ! * @see #requestFocus() ! * @since 1.1 */ public void transferFocus() { Component next; if (parent == null) ! next = findNextFocusComponent(null); else ! next = parent.findNextFocusComponent(this); if (next != null && next != this) ! next.requestFocus(); ! } ! ! /** ! * Returns the root container that owns the focus cycle where this component ! * resides. A focus cycle root is in two cycles, one as the ancestor, and ! * one as the focusable element; this call always returns the ancestor. ! * ! * @return the ancestor container that owns the focus cycle ! * @since 1.4 ! */ ! public Container getFocusCycleRootAncestor() ! { ! // XXX Implement. ! throw new Error("not implemented"); ! } ! ! /** ! * Tests if the container is the ancestor of the focus cycle that this ! * component belongs to. ! * ! * @param c the container to test ! * @return true if c is the focus cycle root ! * @since 1.4 ! */ ! public boolean isFocusCycleRoot(Container c) ! { ! return c == getFocusCycleRootAncestor(); } /** * AWT 1.0 focus event processor. * ! * @deprecated use {@link #transferFocus()} instead */ public void nextFocus() { transferFocus(); } ! /** ! * Transfers focus to the previous component in the focus traversal order, as ! * though this were the current focus owner. ! * ! * @see #requestFocus() ! * @since 1.4 ! */ ! public void transferFocusBackward() ! { ! // XXX Implement. ! throw new Error("not implemented"); ! } ! ! /** ! * Transfers focus to the focus cycle root of this component. However, if ! * this is a Window, the default focus owner in the window in the current ! * focus cycle is focused instead. ! * ! * @see #requestFocus() ! * @see #isFocusCycleRoot() ! * @since 1.4 ! */ ! public void transferFocusUpCycle() ! { ! // XXX Implement. ! throw new Error("not implemented"); ! } ! ! /** ! * Tests if this component is the focus owner. Use {@link #isFocusOwner()} ! * instead. ! * ! * @return true if this component owns focus ! * @since 1.2 ! */ public boolean hasFocus() { ! return isFocusOwner(); ! } ! ! /** ! * Tests if this component is the focus owner. ! * ! * @return true if this component owns focus ! * @since 1.4 ! */ ! public boolean isFocusOwner() ! { ! // XXX Implement. ! throw new Error("not implemented"); } /** * Adds the specified popup menu to this component. * ! * @param menu the popup menu to be added ! * @see #remove(MenuComponent) ! * @since 1.1 */ public synchronized void add(PopupMenu popup) { if (popups == null) popups = new Vector(); ! popups.add(popup); } /** * Removes the specified popup menu from this component. * ! * @param menu the popup menu to remove ! * @see #add(PopupMenu) ! * @since 1.1 */ public synchronized void remove(MenuComponent popup) { ! if (popups != null) ! popups.remove(popup); } /** ! * Returns a debugging string representing this component. The string may ! * be empty but not null. * ! * @return a string representing this component */ protected String paramString() { StringBuffer param = new StringBuffer(); String name = getName(); if (name != null) ! param.append(name).append(","); ! param.append(width).append("x").append(height).append("+").append(x) ! .append("+").append(y); ! if (! isValid()) param.append(",invalid"); ! if (! isVisible()) param.append(",invisible"); ! if (! isEnabled()) param.append(",disabled"); ! if (! isOpaque()) param.append(",translucent"); if (isDoubleBuffered()) param.append(",doublebuffered"); return param.toString(); } /** ! * Returns a string representation of this component. This is implemented ! * as getClass().getName() + '[' + paramString() + ']'. * ! * @return a string representation of this component */ public String toString() { ! return getClass().getName() + '[' + paramString() + ']'; } /** ! * Prints a listing of this component to System.out. ! * ! * @see #list(PrintStream) */ ! public void list() { ! list(System.out, 0); } /** * Prints a listing of this component to the specified print stream. * ! * @param stream the PrintStream to print to */ ! public void list(PrintStream out) { ! list(out, 0); } /** * Prints a listing of this component to the specified print stream, * starting at the specified indentation point. * ! * @param stream the PrintStream to print to ! * @param indent the indentation point */ ! public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) ! out.print(' '); ! out.println(toString()); } /** * Prints a listing of this component to the specified print writer. * ! * @param writer the PrintWrinter to print to ! * @since 1.1 */ ! public void list(PrintWriter out) { ! list(out, 0); } /** * Prints a listing of this component to the specified print writer, * starting at the specified indentation point. * ! * @param writer the PrintWriter to print to ! * @param indent the indentation point ! * @since 1.1 */ ! public void list(PrintWriter out, int indent) { for (int i = 0; i < indent; ++i) ! out.print(' '); ! out.println(toString()); } + /** + * Adds the specified property listener to this component. This is harmless + * if the listener is null, but if the listener has already been registered, + * it will now be registered twice. The property listener ignores inherited + * properties. Recognized properties include:
    + *

      + *
    • the font ("font")
    • + *
    • the background color ("background")
    • + *
    • the foreground color ("foreground")
    • + *
    • the focusability ("focusable")
    • + *
    • the focus key traversal enabled state + * ("focusTraversalKeysEnabled")
    • + *
    • the set of forward traversal keys + * ("forwardFocusTraversalKeys")
    • + *
    • the set of backward traversal keys + * ("backwardFocusTraversalKeys")
    • + *
    • the set of up-cycle traversal keys + * ("upCycleFocusTraversalKeys")
    • + *
    + * + * @param listener the new listener to add + * @see #removePropertyChangeListener(PropertyChangeListener) + * @see #getPropertyChangeListeners() + * @see #addPropertyChangeListener(String, PropertyChangeListener) + * @since 1.1 + */ public void addPropertyChangeListener(PropertyChangeListener listener) { if (changeSupport == null) *************** public abstract class Component implemen *** 2413,2432 **** changeSupport.addPropertyChangeListener(listener); } public void removePropertyChangeListener(PropertyChangeListener listener) { if (changeSupport != null) ! changeSupport.removePropertyChangeListener(listener); } public void addPropertyChangeListener(String propertyName, ! PropertyChangeListener listener) { if (changeSupport == null) changeSupport = new PropertyChangeSupport(this); ! changeSupport.addPropertyChangeListener(propertyName, listener); } public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { --- 3811,3895 ---- changeSupport.addPropertyChangeListener(listener); } + /** + * Removes the specified property listener from the component. This is + * harmless if the listener was not previously registered. + * + * @param listener the listener to remove + * @see #addPropertyChangeListener(PropertyChangeListener) + * @see #getPropertyChangeListeners() + * @see #removePropertyChangeListener(String, PropertyChangeListener) + * @since 1.1 + */ public void removePropertyChangeListener(PropertyChangeListener listener) { if (changeSupport != null) ! changeSupport.removePropertyChangeListener(listener); ! } ! ! /** ! * Returns an array of all specified listeners registered on this component. ! * ! * @return an array of listeners ! * @see #addPropertyChangeListener(PropertyChangeListener) ! * @see #removePropertyChangeListener(PropertyChangeListener) ! * @see #getPropertyChangeListeners(String) ! * @since 1.4 ! */ ! public PropertyChangeListener[] getPropertyChangeListeners() ! { ! return changeSupport == null ? new PropertyChangeListener[0] ! : changeSupport.getPropertyChangeListeners(); } + /** + * Adds the specified property listener to this component. This is harmless + * if the listener is null, but if the listener has already been registered, + * it will now be registered twice. The property listener ignores inherited + * properties. The listener is keyed to a single property. Recognized + * properties include:
    + *
      + *
    • the font ("font")
    • + *
    • the background color ("background")
    • + *
    • the foreground color ("foreground")
    • + *
    • the focusability ("focusable")
    • + *
    • the focus key traversal enabled state + * ("focusTraversalKeysEnabled")
    • + *
    • the set of forward traversal keys + * ("forwardFocusTraversalKeys")
    • + p *
    • the set of backward traversal keys + * ("backwardFocusTraversalKeys")
    • + *
    • the set of up-cycle traversal keys + * ("upCycleFocusTraversalKeys")
    • + *
    + * + * @param propertyName the property name to filter on + * @param listener the new listener to add + * @see #removePropertyChangeListener(String, PropertyChangeListener) + * @see #getPropertyChangeListeners(String) + * @see #addPropertyChangeListener(PropertyChangeListener) + * @since 1.1 + */ public void addPropertyChangeListener(String propertyName, ! PropertyChangeListener listener) { if (changeSupport == null) changeSupport = new PropertyChangeSupport(this); ! changeSupport.addPropertyChangeListener(propertyName, listener); } + /** + * Removes the specified property listener on a particular property from + * the component. This is harmless if the listener was not previously + * registered. + * + * @param propertyName the property name to filter on + * @param listener the listener to remove + * @see #addPropertyChangeListener(String, PropertyChangeListener) + * @see #getPropertyChangeListeners(String) + * @see #removePropertyChangeListener(PropertyChangeListener) + * @since 1.1 + */ public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { *************** public abstract class Component implemen *** 2434,2485 **** changeSupport.removePropertyChangeListener(propertyName, listener); } ! protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport != null) ! changeSupport.firePropertyChange(propertyName, oldValue, newValue); } public void setComponentOrientation(ComponentOrientation o) { orientation = o; } public ComponentOrientation getComponentOrientation() { return orientation; } ! /* public AccessibleContext getAccessibleContext() { ! return accessibleContext; } - */ ! /** ! * AWT 1.0 focus event processor. ! * ! * @deprecated Deprecated in favor of processFocusEvent. ! ! public boolean ! gotFocus(Event event, Object what) ! { ! return(true); ! } ! */ ! /** ! * AWT 1.0 focus event processor. ! * ! * @deprecated Deprecated in favor of processFocusEvent. ! ! public boolean ! lostFocus(Event event, Object what) ! { ! return(true); ! } ! */ ! } --- 3897,4970 ---- changeSupport.removePropertyChangeListener(propertyName, listener); } ! /** ! * Returns an array of all specified listeners on the named property that ! * are registered on this component. ! * ! * @return an array of listeners ! * @see #addPropertyChangeListener(String, PropertyChangeListener) ! * @see #removePropertyChangeListener(String, PropertyChangeListener) ! * @see #getPropertyChangeListeners() ! * @since 1.4 ! */ ! public PropertyChangeListener[] getPropertyChangeListeners(String property) ! { ! return changeSupport == null ? new PropertyChangeListener[0] ! : changeSupport.getPropertyChangeListeners(property); ! } ! ! /** ! * Report a change in a bound property to any registered property listeners. ! * ! * @param propertyName the property that changed ! * @param oldValue the old property value ! * @param newValue the new property value ! */ ! protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { if (changeSupport != null) ! changeSupport.firePropertyChange(propertyName, oldValue, newValue); ! } ! ! /** ! * Report a change in a bound property to any registered property listeners. ! * ! * @param propertyName the property that changed ! * @param oldValue the old property value ! * @param newValue the new property value ! */ ! protected void firePropertyChange(String propertyName, boolean oldValue, ! boolean newValue) ! { ! if (changeSupport != null) ! changeSupport.firePropertyChange(propertyName, oldValue, newValue); } + /** + * Report a change in a bound property to any registered property listeners. + * + * @param propertyName the property that changed + * @param oldValue the old property value + * @param newValue the new property value + */ + protected void firePropertyChange(String propertyName, int oldValue, + int newValue) + { + if (changeSupport != null) + changeSupport.firePropertyChange(propertyName, oldValue, newValue); + } + + /** + * Sets the text layout orientation of this component. New components default + * to UNKNOWN (which behaves like LEFT_TO_RIGHT). This method affects only + * the current component, while + * {@link #applyComponentOrientation(ComponentOrientation)} affects the + * entire hierarchy. + * + * @param o the new orientation + * @throws NullPointerException if o is null + * @see #getComponentOrientation() + */ public void setComponentOrientation(ComponentOrientation o) { + if (o == null) + throw new NullPointerException(); orientation = o; } + /** + * Determines the text layout orientation used by this component. + * + * @return the component orientation + * @see #setComponentOrientation(ComponentOrientation) + */ public ComponentOrientation getComponentOrientation() { return orientation; } ! /** ! * Sets the text layout orientation of this component. New components default ! * to UNKNOWN (which behaves like LEFT_TO_RIGHT). This method affects the ! * entire hierarchy, while ! * {@link #setComponentOrientation(ComponentOrientation)} affects only the ! * current component. ! * ! * @param o the new orientation ! * @throws NullPointerException if o is null ! * @see #getComponentOrientation() ! * @since 1.4 ! */ ! public void applyComponentOrientation(ComponentOrientation o) ! { ! setComponentOrientation(o); ! } ! ! /** ! * Returns the accessibility framework context of this class. Component is ! * not accessible, so the default implementation returns null. Subclasses ! * must override this behavior, and return an appropriate subclass of ! * {@link AccessibleAWTComponent}. ! * ! * @return the accessibility context ! */ public AccessibleContext getAccessibleContext() { ! return null; } ! ! // Helper methods; some are package visible for use by subclasses. ! /** ! * Subclasses should override this to return unique component names like ! * "menuitem0". ! * ! * @return the generated name for this component ! */ ! String generateName() ! { ! // Component is abstract. ! return null; ! } ! /** ! * Sets the peer for this component. ! * ! * @param peer the new peer ! */ ! final void setPeer(ComponentPeer peer) ! { ! this.peer = peer; ! } ! ! /** ! * Implementation method that allows classes such as Canvas and Window to ! * override the graphics configuration without violating the published API. ! * ! * @return the graphics configuration ! */ ! GraphicsConfiguration getGraphicsConfigurationImpl() ! { ! if (peer != null) ! { ! GraphicsConfiguration config = peer.getGraphicsConfiguration(); ! if (config != null) ! return config; ! } ! ! if (parent != null) ! return parent.getGraphicsConfiguration(); ! ! return null; ! } ! ! /** ! * Implementation of dispatchEvent. Allows trusted package classes to ! * dispatch additional events first. ! * ! * @param e the event to dispatch ! */ ! void dispatchEventImpl(AWTEvent e) ! { ! // Make use of event id's in order to avoid multiple instanceof tests. ! if (e.id <= ComponentEvent.COMPONENT_LAST ! && e.id >= ComponentEvent.COMPONENT_FIRST ! && (componentListener != null ! || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0)) ! processEvent(e); ! else if (e.id <= KeyEvent.KEY_LAST ! && e.id >= KeyEvent.KEY_FIRST ! && (keyListener != null ! || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0)) ! processEvent(e); ! else if (e.id <= MouseEvent.MOUSE_LAST ! && e.id >= MouseEvent.MOUSE_FIRST ! && (mouseListener != null ! || mouseMotionListener != null ! || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0)) ! processEvent(e); ! else if (e.id <= FocusEvent.FOCUS_LAST ! && e.id >= FocusEvent.FOCUS_FIRST ! && (focusListener != null ! || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0)) ! processEvent(e); ! else if (e.id <= InputMethodEvent.INPUT_METHOD_LAST ! && e.id >= InputMethodEvent.INPUT_METHOD_FIRST ! && (inputMethodListener != null ! || (eventMask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0)) ! processEvent(e); ! else if (e.id <= HierarchyEvent.HIERARCHY_LAST ! && e.id >= HierarchyEvent.HIERARCHY_FIRST ! && (hierarchyListener != null ! || hierarchyBoundsListener != null ! || (eventMask & AWTEvent.HIERARCHY_EVENT_MASK) != 0)) ! processEvent(e); ! else if (e.id <= PaintEvent.PAINT_LAST ! && e.id >= PaintEvent.PAINT_FIRST ! && (eventMask & AWTEvent.PAINT_EVENT_MASK) != 0) ! processEvent(e); ! } ! ! /** ! * Coalesce paint events. Current heuristic is: Merge if the union of ! * areas is less than twice that of the sum of the areas. The X server ! * tend to create a lot of paint events that are adjacent but not ! * overlapping. ! * ! *
    !    * +------+
    !    * |      +-----+  ...will be merged
    !    * |      |     |
    !    * |      |     |
    !    * +------+     |
    !    *        +-----+
    !    *
    !    * +---------------+--+
    !    * |               |  |  ...will not be merged
    !    * +---------------+  |
    !    *                 |  |
    !    *                 |  |
    !    *                 |  |
    !    *                 |  |
    !    *                 |  |
    !    *                 +--+
    !    * 
    ! * ! * @param queuedEvent the first paint event ! * @param newEvent the second paint event ! * @return the combined paint event, or null ! */ ! private PaintEvent coalescePaintEvents(PaintEvent queuedEvent, ! PaintEvent newEvent) ! { ! Rectangle r1 = queuedEvent.getUpdateRect(); ! Rectangle r2 = newEvent.getUpdateRect(); ! Rectangle union = r1.union(r2); ! ! int r1a = r1.width * r1.height; ! int r2a = r2.width * r2.height; ! int ua = union.width * union.height; ! ! if (ua > (r1a+r2a)*2) ! return null; ! /* The 2 factor should maybe be reconsidered. Perhaps 3/2 ! would be better? */ ! ! newEvent.setUpdateRect(union); ! return newEvent; ! } ! ! /** ! * Does the work for a paint event. ! * ! * @param event the event to process ! */ ! private void processPaintEvent(PaintEvent event) ! { ! // Can't do graphics without peer ! if (peer == null) ! return; ! ! Graphics gfx = getGraphics(); ! try ! { ! Shape clip = event.getUpdateRect(); ! gfx.setClip(clip); ! ! switch (event.id) ! { ! case PaintEvent.PAINT: ! paint(gfx); ! break; ! case PaintEvent.UPDATE: ! update(gfx); ! break; ! default: ! throw new IllegalArgumentException("unknown paint event"); ! } ! } ! finally ! { ! gfx.dispose(); ! } ! } ! ! /** ! * This method is used to implement transferFocus(). CHILD is the child ! * making the request. This is overridden by Container; when called for an ! * ordinary component there is no child and so we always return null. ! * ! * @param child the component making the request ! * @return the next component to focus on ! */ ! Component findNextFocusComponent(Component child) ! { ! return null; ! } ! ! /** ! * Deserializes this component. This regenerates all serializable listeners ! * which were registered originally. ! * ! * @param s the stream to read from ! * @throws ClassNotFoundException if deserialization fails ! * @throws IOException if the stream fails ! */ ! private void readObject(ObjectInputStream s) ! throws ClassNotFoundException, IOException ! { ! s.defaultReadObject(); ! String key = (String) s.readObject(); ! while (key != null) ! { ! Object listener = s.readObject(); ! if ("componentL".equals(key)) ! addComponentListener((ComponentListener) listener); ! else if ("focusL".equals(key)) ! addFocusListener((FocusListener) listener); ! else if ("keyL".equals(key)) ! addKeyListener((KeyListener) listener); ! else if ("mouseL".equals(key)) ! addMouseListener((MouseListener) listener); ! else if ("mouseMotionL".equals(key)) ! addMouseMotionListener((MouseMotionListener) listener); ! else if ("inputMethodL".equals(key)) ! addInputMethodListener((InputMethodListener) listener); ! else if ("hierarchyL".equals(key)) ! addHierarchyListener((HierarchyListener) listener); ! else if ("hierarchyBoundsL".equals(key)) ! addHierarchyBoundsListener((HierarchyBoundsListener) listener); ! else if ("mouseWheelL".equals(key)) ! addMouseWheelListener((MouseWheelListener) listener); ! key = (String) s.readObject(); ! } ! } ! ! /** ! * Serializes this component. This ignores all listeners which do not ! * implement Serializable, but includes those that do. ! * ! * @param s the stream to write to ! * @throws IOException if the stream fails ! */ ! private void writeObject(ObjectOutputStream s) throws IOException ! { ! s.defaultWriteObject(); ! AWTEventMulticaster.save(s, "componentL", componentListener); ! AWTEventMulticaster.save(s, "focusL", focusListener); ! AWTEventMulticaster.save(s, "keyL", keyListener); ! AWTEventMulticaster.save(s, "mouseL", mouseListener); ! AWTEventMulticaster.save(s, "mouseMotionL", mouseMotionListener); ! AWTEventMulticaster.save(s, "inputMethodL", inputMethodListener); ! AWTEventMulticaster.save(s, "hierarchyL", hierarchyListener); ! AWTEventMulticaster.save(s, "hierarchyBoundsL", hierarchyBoundsListener); ! AWTEventMulticaster.save(s, "mouseWheelL", mouseWheelListener); ! s.writeObject(null); ! } ! ! ! // Nested classes. ! ! /** ! * This class provides accessibility support for subclasses of container. ! * ! * @author Eric Blake ! * @since 1.3 ! * @status updated to 1.4 ! */ ! protected abstract class AccessibleAWTComponent extends AccessibleContext ! implements Serializable, AccessibleComponent ! { ! /** ! * Compatible with JDK 1.3+. ! */ ! private static final long serialVersionUID = 642321655757800191L; ! ! /** ! * Converts show/hide events to PropertyChange events, and is registered ! * as a component listener on this component. ! * ! * @serial the component handler ! */ ! protected ComponentListener accessibleAWTComponentHandler ! = new AccessibleAWTComponentHandler(); ! ! /** ! * Converts focus events to PropertyChange events, and is registered ! * as a focus listener on this component. ! * ! * @serial the focus handler ! */ ! protected FocusListener accessibleAWTFocusHandler ! = new AccessibleAWTFocusHandler(); ! ! /** ! * The default constructor. ! */ ! protected AccessibleAWTComponent() ! { ! Component.this.addComponentListener(accessibleAWTComponentHandler); ! Component.this.addFocusListener(accessibleAWTFocusHandler); ! } ! ! /** ! * Adds a global property change listener to the accessible component. ! * ! * @param l the listener to add ! * @see #ACCESSIBLE_NAME_PROPERTY ! * @see #ACCESSIBLE_DESCRIPTION_PROPERTY ! * @see #ACCESSIBLE_STATE_PROPERTY ! * @see #ACCESSIBLE_VALUE_PROPERTY ! * @see #ACCESSIBLE_SELECTION_PROPERTY ! * @see #ACCESSIBLE_TEXT_PROPERTY ! * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY ! */ ! public void addPropertyChangeListener(PropertyChangeListener l) ! { ! Component.this.addPropertyChangeListener(l); ! super.addPropertyChangeListener(l); ! } ! ! /** ! * Removes a global property change listener from this accessible ! * component. ! * ! * @param l the listener to remove ! */ ! public void removePropertyChangeListener(PropertyChangeListener l) ! { ! Component.this.removePropertyChangeListener(l); ! super.removePropertyChangeListener(l); ! } ! ! /** ! * Returns the accessible name of this component. It is almost always ! * wrong to return getName(), since it is not localized. In fact, for ! * things like buttons, this should be the text of the button, not the ! * name of the object. The tooltip text might also be appropriate. ! * ! * @return the name ! * @see #setAccessibleName(String) ! */ ! public String getAccessibleName() ! { ! return accessibleName == null ? getName() : accessibleName; ! } ! ! /** ! * Returns a brief description of this accessible context. This should ! * be localized. ! * ! * @return a description of this component ! * @see #setAccessibleDescription(String) ! */ ! public String getAccessibleDescription() ! { ! return accessibleDescription; ! } ! ! /** ! * Returns the role of this component. ! * ! * @return the accessible role ! */ ! public AccessibleRole getAccessibleRole() ! { ! return AccessibleRole.AWT_COMPONENT; ! } ! ! /** ! * Returns a state set describing this component's state. ! * ! * @return a new state set ! * @see AccessibleState ! */ ! public AccessibleStateSet getAccessibleStateSet() ! { ! AccessibleStateSet s = new AccessibleStateSet(); ! if (Component.this.isEnabled()) ! s.add(AccessibleState.ENABLED); ! if (isFocusable()) ! s.add(AccessibleState.FOCUSABLE); ! if (isFocusOwner()) ! s.add(AccessibleState.FOCUSED); ! if (isOpaque()) ! s.add(AccessibleState.OPAQUE); ! if (Component.this.isShowing()) ! s.add(AccessibleState.SHOWING); ! if (Component.this.isVisible()) ! s.add(AccessibleState.VISIBLE); ! return s; ! } ! ! /** ! * Returns the parent of this component, if it is accessible. ! * ! * @return the accessible parent ! */ ! public Accessible getAccessibleParent() ! { ! if (accessibleParent == null) ! { ! Container parent = getParent(); ! accessibleParent = parent instanceof Accessible ! ? (Accessible) parent : null; ! } ! return accessibleParent; ! } ! ! /** ! * Returns the index of this component in its accessible parent. ! * ! * @return the index, or -1 if the parent is not accessible ! * @see #getAccessibleParent() ! */ ! public int getAccessibleIndexInParent() ! { ! if (getAccessibleParent() == null) ! return -1; ! AccessibleContext context ! = ((Component) accessibleParent).getAccessibleContext(); ! if (context == null) ! return -1; ! for (int i = context.getAccessibleChildrenCount(); --i >= 0; ) ! if (context.getAccessibleChild(i) == Component.this) ! return i; ! return -1; ! } ! ! /** ! * Returns the number of children of this component which implement ! * Accessible. Subclasses must override this if they can have children. ! * ! * @return the number of accessible children, default 0 ! */ ! public int getAccessibleChildrenCount() ! { ! return 0; ! } ! ! /** ! * Returns the ith accessible child. Subclasses must override this if ! * they can have children. ! * ! * @return the ith accessible child, or null ! * @see #getAccessibleChildrenCount() ! */ ! public Accessible getAccessibleChild(int i) ! { ! return null; ! } ! ! /** ! * Returns the locale of this component. ! * ! * @return the locale ! * @throws IllegalComponentStateException if the locale is unknown ! */ ! public Locale getLocale() ! { ! return Component.this.getLocale(); ! } ! ! /** ! * Returns this, since it is an accessible component. ! * ! * @return the accessible component ! */ ! public AccessibleComponent getAccessibleComponent() ! { ! return this; ! } ! ! /** ! * Gets the background color. ! * ! * @return the background color ! * @see #setBackground(Color) ! */ ! public Color getBackground() ! { ! return Component.this.getBackground(); ! } ! ! /** ! * Sets the background color. ! * ! * @param c the background color ! * @see #getBackground() ! * @see #isOpaque() ! */ ! public void setBackground(Color c) ! { ! Component.this.setBackground(c); ! } ! ! /** ! * Gets the foreground color. ! * ! * @return the foreground color ! * @see #setForeground(Color) ! */ ! public Color getForeground() ! { ! return Component.this.getForeground(); ! } ! ! /** ! * Sets the foreground color. ! * ! * @param c the foreground color ! * @see #getForeground() ! */ ! public void setForeground(Color c) ! { ! Component.this.setForeground(c); ! } ! ! /** ! * Gets the cursor. ! * ! * @return the cursor ! * @see #setCursor(Cursor) ! */ ! public Cursor getCursor() ! { ! return Component.this.getCursor(); ! } ! ! /** ! * Sets the cursor. ! * ! * @param cursor the cursor ! * @see #getCursor() ! */ ! public void setCursor(Cursor cursor) ! { ! Component.this.setCursor(cursor); ! } ! ! /** ! * Gets the font. ! * ! * @return the font ! * @see #setFont(Font) ! */ ! public Font getFont() ! { ! return Component.this.getFont(); ! } ! ! /** ! * Sets the font. ! * ! * @param f the font ! * @see #getFont() ! */ ! public void setFont(Font f) ! { ! Component.this.setFont(f); ! } ! ! /** ! * Gets the font metrics for a font. ! * ! * @param f the font to look up ! * @return its metrics ! * @throws NullPointerException if f is null ! * @see #getFont() ! */ ! public FontMetrics getFontMetrics(Font f) ! { ! return Component.this.getFontMetrics(f); ! } ! ! /** ! * Tests if the component is enabled. ! * ! * @return true if the component is enabled ! * @see #setEnabled(boolean) ! * @see #getAccessibleStateSet() ! * @see AccessibleState#ENABLED ! */ ! public boolean isEnabled() ! { ! return Component.this.isEnabled(); ! } ! ! /** ! * Set whether the component is enabled. ! * ! * @param b the new enabled status ! * @see #isEnabled() ! */ ! public void setEnabled(boolean b) ! { ! Component.this.setEnabled(b); ! } ! ! /** ! * Test whether the component is visible (not necesarily showing). ! * ! * @return true if it is visible ! * @see #setVisible(boolean) ! * @see #getAccessibleStateSet() ! * @see AccessibleState#VISIBLE ! */ ! public boolean isVisible() ! { ! return Component.this.isVisible(); ! } ! ! /** ! * Sets the visibility of this component. ! * ! * @param b the desired visibility ! * @see #isVisible() ! */ ! public void setVisible(boolean b) ! { ! Component.this.setVisible(b); ! } ! ! /** ! * Tests if the component is showing. ! * ! * @return true if this is showing ! */ ! public boolean isShowing() ! { ! return Component.this.isShowing(); ! } ! ! /** ! * Tests if the point is contained in this component. ! * ! * @param p the point to check ! * @return true if it is contained ! * @throws NullPointerException if p is null ! */ ! public boolean contains(Point p) ! { ! return Component.this.contains(p.x, p.y); ! } ! ! /** ! * Returns the location of this object on the screen, or null if it is ! * not showing. ! * ! * @return the location relative to screen coordinates, if showing ! * @see #getBounds() ! * @see #getLocation() ! */ ! public Point getLocationOnScreen() ! { ! return Component.this.isShowing() ? Component.this.getLocationOnScreen() ! : null; ! } ! ! /** ! * Returns the location of this object relative to its parent's coordinate ! * system, or null if it is not showing. ! * ! * @return the location ! * @see #getBounds() ! * @see #getLocationOnScreen() ! */ ! public Point getLocation() ! { ! return Component.this.isShowing() ? Component.this.getLocation() : null; ! } ! ! /** ! * Sets the location of this relative to its parent's coordinate system. ! * ! * @param p the location ! * @throws NullPointerException if p is null ! * @see #getLocation() ! */ ! public void setLocation(Point p) ! { ! Component.this.setLocation(p.x, p.y); ! } ! ! /** ! * Gets the bounds of this component, or null if it is not on screen. ! * ! * @return the bounds ! * @see #contains(Point) ! * @see #setBounds(Rectangle) ! */ ! public Rectangle getBounds() ! { ! return Component.this.isShowing() ? Component.this.getBounds() : null; ! } ! ! /** ! * Sets the bounds of this component. ! * ! * @param r the bounds ! * @throws NullPointerException if r is null ! * @see #getBounds() ! */ ! public void setBounds(Rectangle r) ! { ! Component.this.setBounds(r.x, r.y, r.width, r.height); ! } ! ! /** ! * Gets the size of this component, or null if it is not showing. ! * ! * @return the size ! * @see #setSize(Dimension) ! */ ! public Dimension getSize() ! { ! return Component.this.isShowing() ? Component.this.getSize() : null; ! } ! ! /** ! * Sets the size of this component. ! * ! * @param d the size ! * @throws NullPointerException if d is null ! * @see #getSize() ! */ ! public void setSize(Dimension d) ! { ! Component.this.setSize(d.width, d.height); ! } ! ! /** ! * Returns the Accessible child at a point relative to the coordinate ! * system of this component, if one exists, or null. Since components ! * have no children, subclasses must override this to get anything besides ! * null. ! * ! * @param p the point to check ! * @return the accessible child at that point ! * @throws NullPointerException if p is null ! */ ! public Accessible getAccessibleAt(Point p) ! { ! return null; ! } ! ! /** ! * Tests whether this component can accept focus. ! * ! * @return true if this is focus traversable ! * @see #getAccessibleStateSet() ! * @see AccessibleState#FOCUSABLE ! * @see AccessibleState#FOCUSED ! */ ! public boolean isFocusTraversable() ! { ! return Component.this.isFocusTraversable(); ! } ! ! /** ! * Requests focus for this component. ! * ! * @see #isFocusTraversable() ! */ ! public void requestFocus() ! { ! Component.this.requestFocus(); ! } ! ! /** ! * Adds a focus listener. ! * ! * @param l the listener to add ! */ ! public void addFocusListener(FocusListener l) ! { ! Component.this.addFocusListener(l); ! } ! ! /** ! * Removes a focus listener. ! * ! * @param l the listener to remove ! */ ! public void removeFocusListener(FocusListener l) ! { ! Component.this.removeFocusListener(l); ! } ! ! /** ! * Converts component changes into property changes. ! * ! * @author Eric Blake ! * @since 1.3 ! * @status updated to 1.4 ! */ ! protected class AccessibleAWTComponentHandler implements ComponentListener ! { ! /** ! * Default constructor. ! */ ! protected AccessibleAWTComponentHandler() ! { ! } ! ! /** ! * Convert a component hidden to a property change. ! * ! * @param e the event to convert ! */ ! public void componentHidden(ComponentEvent e) ! { ! AccessibleAWTComponent.this.firePropertyChange ! (ACCESSIBLE_STATE_PROPERTY, AccessibleState.VISIBLE, null); ! } ! ! /** ! * Convert a component shown to a property change. ! * ! * @param e the event to convert ! */ ! public void componentShown(ComponentEvent e) ! { ! AccessibleAWTComponent.this.firePropertyChange ! (ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.VISIBLE); ! } ! ! /** ! * Moving a component does not affect properties. ! * ! * @param e ignored ! */ ! public void componentMoved(ComponentEvent e) ! { ! } ! ! /** ! * Resizing a component does not affect properties. ! * ! * @param e ignored ! */ ! public void componentResized(ComponentEvent e) ! { ! } ! } // class AccessibleAWTComponentHandler ! ! /** ! * Converts focus changes into property changes. ! * ! * @author Eric Blake ! * @since 1.3 ! * @status updated to 1.4 ! */ ! protected class AccessibleAWTFocusHandler implements FocusListener ! { ! /** ! * Default constructor. ! */ ! protected AccessibleAWTFocusHandler() ! { ! } ! ! /** ! * Convert a focus gained to a property change. ! * ! * @param e the event to convert ! */ ! public void focusGained(FocusEvent e) ! { ! AccessibleAWTComponent.this.firePropertyChange ! (ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.FOCUSED); ! } ! ! /** ! * Convert a focus lost to a property change. ! * ! * @param e the event to convert ! */ ! public void focusLost(FocusEvent e) ! { ! AccessibleAWTComponent.this.firePropertyChange ! (ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null); ! } ! } // class AccessibleAWTComponentHandler ! } // class AccessibleAWTComponent ! ! /** ! * This class provides support for blitting offscreen surfaces. ! * ! * @author Eric Blake ! * @since 1.4 ! * @XXX Shell class, to allow compilation. This needs documentation and ! * correct implementation. ! */ ! protected class BltBufferStrategy extends BufferStrategy ! { ! protected BufferCapabilities caps; ! protected VolatileImage[] backBuffers; ! protected boolean validatedContents; ! protected int width; ! protected int height; ! protected BltBufferStrategy(int num, BufferCapabilities caps) ! { ! this.caps = caps; ! createBackBuffers(num); ! } ! protected void createBackBuffers(int num) ! { ! backBuffers = new VolatileImage[num]; ! } ! public BufferCapabilities getCapabilities() ! { ! return caps; ! } ! public Graphics getDrawGraphics() { return null; } ! public void show() {} ! protected void revalidate() {} ! public boolean contentsLost() { return false; } ! public boolean contentsRestored() { return false; } ! } // class BltBufferStrategy ! ! /** ! * This class provides support for flipping component buffers. It is only ! * designed for use by Canvas and Window. ! * ! * @author Eric Blake ! * @since 1.4 ! * @XXX Shell class, to allow compilation. This needs documentation and ! * correct implementation. ! */ ! protected class FlipBufferStrategy extends BufferStrategy ! { ! protected int numBuffers; ! protected BufferCapabilities caps; ! protected Image drawBuffer; ! protected VolatileImage drawVBuffer; ! protected boolean validatedContents; ! protected FlipBufferStrategy(int num, BufferCapabilities caps) ! throws AWTException ! { ! this.caps = caps; ! createBuffers(num, caps); ! } ! protected void createBuffers(int num, BufferCapabilities caps) ! throws AWTException {} ! protected Image getBackBuffer() ! { ! return drawBuffer; ! } ! protected void flip(BufferCapabilities.FlipContents flipAction) {} ! protected void destroyBuffers() {} ! public BufferCapabilities getCapabilities() ! { ! return caps; ! } ! public Graphics getDrawGraphics() { return null; } ! protected void revalidate() {} ! public boolean contentsLost() { return false; } ! public boolean contentsRestored() { return false; } ! public void show() {} ! } // class FlipBufferStrategy ! } // class Component diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ComponentOrientation.java gcc-3.3/libjava/java/awt/ComponentOrientation.java *** gcc-3.2.3/libjava/java/awt/ComponentOrientation.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/ComponentOrientation.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* ComponentOrientation.java -- describes a component's orientation ! Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,116 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - /** - * @author Bryce McKinlay - */ - - /* Status: Incomplete. Needs a Locale lookup table. */ package java.awt; import java.util.Locale; import java.util.ResourceBundle; ! public final class ComponentOrientation implements java.io.Serializable { ! // Here is a wild guess. ! private static int HORIZONTAL_ID = 1 << 0, ! LEFT_TO_RIGHT_ID = 1 << 1; public static final ComponentOrientation LEFT_TO_RIGHT ! = new ComponentOrientation(HORIZONTAL_ID & LEFT_TO_RIGHT_ID); public static final ComponentOrientation RIGHT_TO_LEFT = new ComponentOrientation(HORIZONTAL_ID); public static final ComponentOrientation UNKNOWN ! = new ComponentOrientation(0); ! // FIXME: This field is from the serialization spec, but what are the ! // correct values? ! int orientation; ! ComponentOrientation(int orientation) { this.orientation = orientation; } public boolean isHorizontal() { ! return ((orientation & HORIZONTAL_ID) != 0); } public boolean isLeftToRight() { ! return ((orientation & LEFT_TO_RIGHT_ID) != 0); } public static ComponentOrientation getOrientation(Locale locale) { ! // FIXME: Use a table to look this up. return LEFT_TO_RIGHT; } public static ComponentOrientation getOrientation(ResourceBundle bdl) { ComponentOrientation r; - try ! { ! Object obj = bdl.getObject("Orientation"); ! r = (ComponentOrientation) obj; ! if (r != null) ! return r; ! } ! catch (Exception x) ! { ! // Fall through ! } ! try ! { ! Locale l = bdl.getLocale(); ! r = getOrientation(l); ! if (r != null) ! return r; ! } ! catch (Exception x) ! { ! // Fall through ! } ! ! return (getOrientation (Locale.getDefault ())); } ! } --- 35,213 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt; + import java.io.Serializable; import java.util.Locale; + import java.util.MissingResourceException; import java.util.ResourceBundle; ! /** ! * This class is used to differentiate different orientations for text layout. ! * It controls whether text flows left-to-right or right-to-left, and whether ! * lines are horizontal or vertical, as in this table:
    ! *
    !  * LT      RT      TL      TR
    !  * A B C   C B A   A D G   G D A
    !  * D E F   F E D   B E H   H E B
    !  * G H I   I H G   C F I   I F C
    !  * 
    ! * LT languages are most common (left-to-right lines, top-to-bottom). ! * This includes Western European languages, and optionally includes Japanese, ! * Chinese, and Korean. RT languages (right-to-left lines, ! * top-to-bottom) are mainly middle eastern, such as Hebrew and Arabic. ! * TR languages flow top-to-bottom in a line, right-to-left, and are ! * the basis of Japanese, Chinese, and Korean. Finally, TL languages ! * flow top-to-bottom in a line, left-to-right, as in Mongolian. ! * ! *

    This is a pretty poor excuse for a type-safe enum, since it is not ! * guaranteed that orientation objects are unique (thanks to serialization), ! * yet there is no equals() method. You would be wise to compare the output ! * of isHorizontal() and isLeftToRight() rather than comparing objects with ! * ==, especially since more constants may be added in the future. ! * ! * @author Bryce McKinlay ! * @since 1.0 ! * @status updated to 1.4 ! */ ! public final class ComponentOrientation implements Serializable { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4113291392143563828L; + /** Constant for unknown orientation. */ + private static final int UNKNOWN_ID = 1; + + /** Constant for horizontal line orientation. */ + private static final int HORIZONTAL_ID = 2; + + /** Constant for left-to-right orientation. */ + private static final int LEFT_TO_RIGHT_ID = 4; + + /** + * Items run left to right, and lines flow top to bottom. Examples: English, + * French. + */ public static final ComponentOrientation LEFT_TO_RIGHT ! = new ComponentOrientation(HORIZONTAL_ID | LEFT_TO_RIGHT_ID); ! ! /** ! * Items run right to left, and lines flow top to bottom. Examples: Arabic, ! * Hebrew. ! */ public static final ComponentOrientation RIGHT_TO_LEFT = new ComponentOrientation(HORIZONTAL_ID); + + /** + * The orientation is unknown for the locale. For backwards compatibility, + * this behaves like LEFT_TO_RIGHT in the instance methods. + */ public static final ComponentOrientation UNKNOWN ! = new ComponentOrientation(UNKNOWN_ID | HORIZONTAL_ID | LEFT_TO_RIGHT_ID); ! /** ! * The orientation of this object; bitwise-or of unknown (1), horizontal (2), ! * and left-to-right (4). ! * ! * @serial the orientation ! */ ! private final int orientation; ! /** ! * Construct a given orientation. ! * ! * @param orientation the orientation ! */ ! private ComponentOrientation(int orientation) { this.orientation = orientation; } + /** + * Returns true if the lines are horizontal, in which case lines flow + * top-to-bottom. For example, English, Hebrew. Counterexamples: Japanese, + * Chinese, Korean, Mongolian. + * + * @return true if this orientation has horizontal lines + */ public boolean isHorizontal() { ! return (orientation & HORIZONTAL_ID) != 0; } + /** + * If isHorizontal() returns true, then this determines whether items in + * the line flow left-to-right. If isHorizontal() returns false, items in + * a line flow top-to-bottom, and this determines if lines flow + * left-to-right. + * + * @return true if this orientation flows left-to-right + */ public boolean isLeftToRight() { ! return (orientation & LEFT_TO_RIGHT_ID) != 0; } + /** + * Gets an orientation appropriate for the locale. + * + * @param locale the locale + * @return the orientation for that locale + * @throws NullPointerException if locale is null + */ public static ComponentOrientation getOrientation(Locale locale) { ! // Based on iterating over all languages defined in JDK 1.4, this behavior ! // matches Sun's. However, it makes me wonder if any non-horizontal ! // orientations even exist, as it sure contradicts their documentation. ! String language = locale.getLanguage(); ! if ("ar".equals(language) || "fa".equals(language) || "iw".equals(language) ! || "ur".equals(language)) ! return RIGHT_TO_LEFT; return LEFT_TO_RIGHT; } + /** + * Gets an orientation from a resource bundle. This tries the following:

      + *
    1. Use the key "Orientation" to find an instance of ComponentOrientation + * in the bundle.
    2. + *
    3. Get the locale of the resource bundle, and get the orientation of + * that locale.
    4. + *
    5. Give up and get the orientation of the default locale.
    6. + *
        + * + * @param bdl the bundle to use + * @return the orientation + * @throws NullPointerException if bdl is null + * @deprecated use {@link #getOrientation(Locale)} instead + */ public static ComponentOrientation getOrientation(ResourceBundle bdl) { ComponentOrientation r; try ! { ! r = (ComponentOrientation) bdl.getObject("Orientation"); ! if (r != null) ! return r; ! } ! catch (MissingResourceException ignored) ! { ! } ! catch (ClassCastException ignored) ! { ! } try ! { ! r = getOrientation(bdl.getLocale()); ! if (r != null) ! return r; ! } ! catch (Exception ignored) ! { ! } ! return getOrientation(Locale.getDefault()); } ! } // class ComponentOrientation diff -Nrc3pad gcc-3.2.3/libjava/java/awt/CompositeContext.java gcc-3.3/libjava/java/awt/CompositeContext.java *** gcc-3.2.3/libjava/java/awt/CompositeContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/CompositeContext.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,71 ---- + /* Composite.java -- the context for compositing graphics layers + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.image.Raster; + import java.awt.image.WritableRaster; + + /** + * This interface provides an optimized environment for compositing graphics. + * Several such contexts may exist for a given Composite object. + * + * @author Eric Blake + * @see Composite + * @since 1.2 + * @status updated to 1.4 + */ + public interface CompositeContext + { + /** + * Release resources allocated for the compositing. + */ + void dispose(); + + /** + * Compose the two source images into the composite image. The destination + * can be the same as one of the two inputs, and the destination must be + * compatible with the ColorModel chosen in {@link Composite#createContext}. + * + * @param src the lower image source in compositing + * @param dstIn the upper image source in compositing + * @param dstOut the destination for the composite + * @see Composite + */ + void compose(Raster src, Raster dstIn, WritableRaster dstOut); + } // interface CompositeContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Composite.java gcc-3.3/libjava/java/awt/Composite.java *** gcc-3.2.3/libjava/java/awt/Composite.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/Composite.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,73 ---- + /* Composite.java -- graphics formed from composite layers + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.image.ColorModel; + + /** + * This interface is for graphics which are formed as composites of others. + * It combines {@link Graphics2D} shapes according to defined rules to form + * the new image. Implementations of this interface must be immutable, because + * they are not cloned when a Graphics2D container is cloned. + * + *

        Since this can expose pixels to untrusted code, there is a security + * check on custom objects, readDisplayPixels, to prevent leaking + * restricted information graphically. + * + * @author Eric Blake + * @see AlphaComposite + * @see CompositeContext + * @see Graphics2D#setComposite(Composite) + * @since 1.2 + * @status updated to 1.4 + */ + public interface Composite + { + /** + * Create a context state for performing the compositing operation. Several + * contexts may exist for this object, in a multi-threaded environment. + * + * @param srcColorModel the color model of the source + * @param dstColorModel the color model of the destination + * @param hints hints for choosing between rendering alternatives + */ + CompositeContext createContext(ColorModel srcColorModel, + ColorModel dstColorModel, + RenderingHints hints); + } // interface Composite diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Container.java gcc-3.3/libjava/java/awt/Container.java *** gcc-3.2.3/libjava/java/awt/Container.java 2002-01-25 07:04:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/Container.java 2003-01-02 00:14:03.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Container.java -- parent container class in AWT ! Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 36,63 **** package java.awt; ! import java.awt.event.*; ! import java.io.PrintStream; ! import java.io.PrintWriter; ! import java.util.EventListener; import java.awt.peer.ComponentPeer; import java.awt.peer.ContainerPeer; import java.awt.peer.LightweightPeer; ! /* A somewhat incomplete class. */ ! public class Container extends Component { /* Serialized fields from the serialization spec. */ int ncomponents; Component[] component; LayoutManager layoutMgr; ! /* LightweightDispatcher dispatcher; */ // wtf? Dimension maxSize; int containerSerializedDataVersion; /* Anything else is non-serializable, and should be declared "transient". */ ! transient ContainerListener containerListener; /** * Default constructor for subclasses. --- 37,94 ---- package java.awt; ! import java.awt.event.AWTEventListener; ! import java.awt.event.ContainerEvent; ! import java.awt.event.ContainerListener; ! import java.awt.event.MouseEvent; import java.awt.peer.ComponentPeer; import java.awt.peer.ContainerPeer; import java.awt.peer.LightweightPeer; + import java.beans.PropertyChangeListener; + import java.io.PrintStream; + import java.io.PrintWriter; + import java.io.Serializable; + import java.util.EventListener; + import java.util.Set; + import javax.accessibility.Accessible; ! /** ! * A generic window toolkit object that acts as a container for other objects. ! * Components are tracked in a list, and new elements are at the end of the ! * list or bottom of the stacking order. ! * ! * @author original author unknown ! * @author Eric Blake ! * ! * @since 1.0 ! * ! * @status still missing 1.4 support ! */ public class Container extends Component { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 4613797578919906343L; + /* Serialized fields from the serialization spec. */ int ncomponents; Component[] component; LayoutManager layoutMgr; ! ! LightweightDispatcher dispatcher; ! Dimension maxSize; + + /** + * @since 1.4 + */ + boolean focusCycleRoot; + int containerSerializedDataVersion; /* Anything else is non-serializable, and should be declared "transient". */ ! transient ContainerListener containerListener; /** * Default constructor for subclasses. *************** public class Container extends Component *** 81,92 **** * * @return The number of components in this container. * ! * @deprecated This method is deprecated in favor of ! * getComponentCount(). */ public int countComponents() { ! return ncomponents; } /** --- 112,122 ---- * * @return The number of components in this container. * ! * @deprecated use {@link #getComponentCount()} instead */ public int countComponents() { ! return getComponentCount(); } /** *************** public class Container extends Component *** 96,109 **** * * @return The requested component. * ! * @exception ArrayIndexOutOfBoundsException If the specified index is not ! * valid. */ ! public Component getComponent (int n) { ! if (n < 0 || n >= ncomponents) ! throw new ArrayIndexOutOfBoundsException("no such component"); ! return component[n]; } /** --- 126,142 ---- * * @return The requested component. * ! * @throws ArrayIndexOutOfBoundsException If the specified index is invalid */ ! public Component getComponent(int n) { ! synchronized (getTreeLock ()) ! { ! if (n < 0 || n >= ncomponents) ! throw new ArrayIndexOutOfBoundsException("no such component"); ! ! return component[n]; ! } } /** *************** public class Container extends Component *** 113,122 **** */ public Component[] getComponents() { ! Component[] result = new Component[ncomponents]; ! if (ncomponents > 0) ! System.arraycopy(component, 0, result, 0, ncomponents); ! return result; } /** --- 146,160 ---- */ public Component[] getComponents() { ! synchronized (getTreeLock ()) ! { ! Component[] result = new Component[ncomponents]; ! ! if (ncomponents > 0) ! System.arraycopy(component, 0, result, 0, ncomponents); ! ! return result; ! } } /** *************** public class Container extends Component *** 129,134 **** --- 167,173 ---- { if (peer == null) return new Insets(0, 0, 0, 0); + return ((ContainerPeer) peer).getInsets(); } *************** public class Container extends Component *** 137,145 **** * borders, the margin, etc. * * @return The insets for this container. ! * ! * @deprecated This method is deprecated in favor of ! * getInsets(). */ public Insets insets() { --- 176,182 ---- * borders, the margin, etc. * * @return The insets for this container. ! * @deprecated use {@link #getInsets()} instead */ public Insets insets() { *************** public class Container extends Component *** 154,162 **** * * @return The same component that was added. */ ! public Component add (Component comp) { ! addImpl (comp, null, -1); return comp; } --- 191,199 ---- * * @return The same component that was added. */ ! public Component add(Component comp) { ! addImpl(comp, null, -1); return comp; } *************** public class Container extends Component *** 165,178 **** * component list. This method should not be used. Instead, use * add(Component, Object. * ! * @param name FIXME * @param component The component to be added. * * @return The same component that was added. */ ! public Component add (String name, Component comp) { ! addImpl (comp, name, -1); return comp; } --- 202,215 ---- * component list. This method should not be used. Instead, use * add(Component, Object. * ! * @param name The name of the component to be added. * @param component The component to be added. * * @return The same component that was added. */ ! public Component add(String name, Component comp) { ! addImpl(comp, name, -1); return comp; } *************** public class Container extends Component *** 186,196 **** * * @return The same component that was added. * ! * @param throws ArrayIndexOutOfBounds If the specified index is invalid. */ ! public Component add (Component comp, int index) { ! addImpl (comp, null, index); return comp; } --- 223,233 ---- * * @return The same component that was added. * ! * @throws ArrayIndexOutOfBounds If the specified index is invalid. */ ! public Component add(Component comp, int index) { ! addImpl(comp, null, index); return comp; } *************** public class Container extends Component *** 202,210 **** * @param component The component to be added to this container. * @param constraints The layout constraints for this component. */ ! public void add (Component comp, Object constraints) { ! addImpl (comp, constraints, -1); } /** --- 239,247 ---- * @param component The component to be added to this container. * @param constraints The layout constraints for this component. */ ! public void add(Component comp, Object constraints) { ! addImpl(comp, constraints, -1); } /** *************** public class Container extends Component *** 217,227 **** * @param index The index in the component list to insert this child * at, or -1 to add at the end of the list. * ! * @param throws ArrayIndexOutOfBounds If the specified index is invalid. */ ! public void add (Component comp, Object constraints, int index) { ! addImpl (comp, constraints, index); } /** --- 254,264 ---- * @param index The index in the component list to insert this child * at, or -1 to add at the end of the list. * ! * @throws ArrayIndexOutOfBounds If the specified index is invalid. */ ! public void add(Component comp, Object constraints, int index) { ! addImpl(comp, constraints, index); } /** *************** public class Container extends Component *** 237,309 **** * @param index The index in the component list to insert this child * at, or -1 to add at the end of the list. * ! * @param throws ArrayIndexOutOfBounds If the specified index is invalid. */ ! protected void addImpl (Component comp, Object constraints, int index) { ! if (index > ncomponents ! || (index < 0 && index != -1) ! || comp instanceof Window ! || (comp instanceof Container ! && ((Container) comp).isAncestorOf (this))) ! throw new IllegalArgumentException (); ! ! // Reparent component, and make sure component is instantiated if ! // we are. ! if (comp.parent != null) ! comp.parent.remove (comp); ! comp.parent = this; ! if (peer != null) { ! comp.addNotify (); ! if (comp.isLightweight()) ! enableEvents(comp.eventMask); ! } ! invalidate (); ! if (component == null) ! component = new Component[4]; // FIXME, better initial size? ! // This isn't the most efficient implementation. We could do less ! // copying when growing the array. It probably doesn't matter. ! if (ncomponents >= component.length) ! { ! int nl = component.length * 2; ! Component[] c = new Component[nl]; ! System.arraycopy (component, 0, c, 0, ncomponents); ! component = c; ! } ! if (index == -1) ! component[ncomponents++] = comp; ! else ! { ! System.arraycopy (component, index, component, index + 1, ! ncomponents - index); ! component[index] = comp; ! ++ncomponents; ! } ! // Notify the layout manager. ! if (layoutMgr != null) ! { ! if (layoutMgr instanceof LayoutManager2) ! { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! lm2.addLayoutComponent (comp, constraints); ! } ! else if (constraints instanceof String) ! layoutMgr.addLayoutComponent ((String) constraints, comp); ! else ! layoutMgr.addLayoutComponent (null, comp); ! } ! // Post event to notify of adding the container. ! ContainerEvent ce = new ContainerEvent (this, ! ContainerEvent.COMPONENT_ADDED, ! comp); ! getToolkit().getSystemEventQueue().postEvent(ce); } /** --- 274,350 ---- * @param index The index in the component list to insert this child * at, or -1 to add at the end of the list. * ! * @throws ArrayIndexOutOfBounds If the specified index is invalid. */ ! protected void addImpl(Component comp, Object constraints, int index) { ! synchronized (getTreeLock ()) { ! if (index > ncomponents ! || (index < 0 && index != -1) ! || comp instanceof Window ! || (comp instanceof Container ! && ((Container) comp).isAncestorOf(this))) ! throw new IllegalArgumentException(); ! // Reparent component, and make sure component is instantiated if ! // we are. ! if (comp.parent != null) ! comp.parent.remove(comp); ! comp.parent = this; ! if (peer != null) ! { ! comp.addNotify(); ! if (comp.isLightweight()) ! enableEvents(comp.eventMask); ! } ! invalidate(); ! if (component == null) ! component = new Component[4]; // FIXME, better initial size? ! // This isn't the most efficient implementation. We could do less ! // copying when growing the array. It probably doesn't matter. ! if (ncomponents >= component.length) ! { ! int nl = component.length * 2; ! Component[] c = new Component[nl]; ! System.arraycopy(component, 0, c, 0, ncomponents); ! component = c; ! } ! ! if (index == -1) ! component[ncomponents++] = comp; ! else ! { ! System.arraycopy(component, index, component, index + 1, ! ncomponents - index); ! component[index] = comp; ! ++ncomponents; ! } ! // Notify the layout manager. ! if (layoutMgr != null) ! { ! if (layoutMgr instanceof LayoutManager2) ! { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! lm2.addLayoutComponent(comp, constraints); ! } ! else if (constraints instanceof String) ! layoutMgr.addLayoutComponent((String) constraints, comp); ! else ! layoutMgr.addLayoutComponent(null, comp); ! } ! ! // Post event to notify of adding the container. ! ContainerEvent ce = new ContainerEvent(this, ! ContainerEvent.COMPONENT_ADDED, ! comp); ! getToolkit().getSystemEventQueue().postEvent(ce); ! } } /** *************** public class Container extends Component *** 311,336 **** * * @param index The index of the component to remove. */ ! public void remove (int index) { ! Component r = component[index]; ! r.removeNotify (); ! System.arraycopy (component, index + 1, component, index, ! ncomponents - index - 1); ! component[--ncomponents] = null; ! invalidate (); ! if (layoutMgr != null) ! layoutMgr.removeLayoutComponent (r); ! // Post event to notify of adding the container. ! ContainerEvent ce = new ContainerEvent (this, ! ContainerEvent.COMPONENT_REMOVED, ! r); ! getToolkit().getSystemEventQueue().postEvent(ce); } /** --- 352,380 ---- * * @param index The index of the component to remove. */ ! public void remove(int index) { ! synchronized (getTreeLock ()) ! { ! Component r = component[index]; ! r.removeNotify(); ! System.arraycopy(component, index + 1, component, index, ! ncomponents - index - 1); ! component[--ncomponents] = null; ! invalidate(); ! if (layoutMgr != null) ! layoutMgr.removeLayoutComponent(r); ! // Post event to notify of adding the container. ! ContainerEvent ce = new ContainerEvent(this, ! ContainerEvent.COMPONENT_REMOVED, ! r); ! getToolkit().getSystemEventQueue().postEvent(ce); ! } } /** *************** public class Container extends Component *** 338,352 **** * * @return component The component to remove from this container. */ ! public void remove (Component comp) { ! for (int i = 0; i < ncomponents; ++i) { ! if (component[i] == comp) ! { ! remove (i); ! break; ! } } } --- 382,399 ---- * * @return component The component to remove from this container. */ ! public void remove(Component comp) { ! synchronized (getTreeLock ()) { ! for (int i = 0; i < ncomponents; ++i) ! { ! if (component[i] == comp) ! { ! remove(i); ! break; ! } ! } } } *************** public class Container extends Component *** 355,362 **** */ public void removeAll() { ! while (ncomponents > 0) ! remove (0); } /** --- 402,412 ---- */ public void removeAll() { ! synchronized (getTreeLock ()) ! { ! while (ncomponents > 0) ! remove(0); ! } } /** *************** public class Container extends Component *** 378,384 **** public void setLayout(LayoutManager mgr) { layoutMgr = mgr; ! invalidate (); } /** --- 428,434 ---- public void setLayout(LayoutManager mgr) { layoutMgr = mgr; ! invalidate(); } /** *************** public class Container extends Component *** 387,400 **** public void doLayout() { if (layoutMgr != null) ! layoutMgr.layoutContainer (this); } /** * Layout the components in this container. * ! * @deprecated This method is deprecated in favor of ! * doLayout(). */ public void layout() { --- 437,449 ---- public void doLayout() { if (layoutMgr != null) ! layoutMgr.layoutContainer(this); } /** * Layout the components in this container. * ! * @deprecated use {@link #doLayout()} instead */ public void layout() { *************** public class Container extends Component *** 407,413 **** */ public void invalidate() { ! super.invalidate (); } /** --- 456,462 ---- */ public void invalidate() { ! super.invalidate(); } /** *************** public class Container extends Component *** 415,427 **** */ public void validate() { ! // FIXME: use the tree lock? ! synchronized (this) { ! if (! isValid ()) ! { ! validateTree (); ! } } } --- 464,475 ---- */ public void validate() { ! synchronized (getTreeLock ()) { ! if (! isValid()) ! { ! validateTree(); ! } } } *************** public class Container extends Component *** 432,461 **** protected void validateTree() { if (valid) ! return; ContainerPeer cPeer = null; ! if ((peer != null) && !(peer instanceof LightweightPeer)) { ! cPeer = (ContainerPeer) peer; ! cPeer.beginValidate(); } ! doLayout (); for (int i = 0; i < ncomponents; ++i) { ! Component comp = component[i]; ! if (! comp.isValid ()) ! { ! if (comp instanceof Container) ! { ! ((Container) comp).validateTree(); ! } ! else ! { ! component[i].validate(); ! } ! } } /* children will call invalidate() when they are layed out. It --- 480,509 ---- protected void validateTree() { if (valid) ! return; ContainerPeer cPeer = null; ! if (peer != null && ! (peer instanceof LightweightPeer)) { ! cPeer = (ContainerPeer) peer; ! cPeer.beginValidate(); } ! doLayout(); for (int i = 0; i < ncomponents; ++i) { ! Component comp = component[i]; ! if (! comp.isValid()) ! { ! if (comp instanceof Container) ! { ! ((Container) comp).validateTree(); ! } ! else ! { ! component[i].validate(); ! } ! } } /* children will call invalidate() when they are layed out. It *************** public class Container extends Component *** 481,498 **** public Dimension getPreferredSize() { if (layoutMgr != null) ! return layoutMgr.preferredLayoutSize (this); else ! return super.getPreferredSize (); } /** * Returns the preferred size of this container. * * @return The preferred size of this container. ! * ! * @deprecated This method is deprecated in favor of ! * getPreferredSize(). */ public Dimension preferredSize() { --- 529,545 ---- public Dimension getPreferredSize() { if (layoutMgr != null) ! return layoutMgr.preferredLayoutSize(this); else ! return super.getPreferredSize(); } /** * Returns the preferred size of this container. * * @return The preferred size of this container. ! * ! * @deprecated use {@link #getPreferredSize()} instead */ public Dimension preferredSize() { *************** public class Container extends Component *** 507,524 **** public Dimension getMinimumSize() { if (layoutMgr != null) ! return layoutMgr.minimumLayoutSize (this); else ! return super.getMinimumSize (); } /** * Returns the minimum size of this container. * * @return The minimum size of this container. ! * ! * @deprecated This method is deprecated in favor of ! * getMinimumSize(). */ public Dimension minimumSize() { --- 554,570 ---- public Dimension getMinimumSize() { if (layoutMgr != null) ! return layoutMgr.minimumLayoutSize(this); else ! return super.getMinimumSize(); } /** * Returns the minimum size of this container. * * @return The minimum size of this container. ! * ! * @deprecated use {@link #getMinimumSize()} instead */ public Dimension minimumSize() { *************** public class Container extends Component *** 534,544 **** { if (layoutMgr != null && layoutMgr instanceof LayoutManager2) { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! return lm2.maximumLayoutSize (this); } else ! return super.getMaximumSize (); } /** --- 580,590 ---- { if (layoutMgr != null && layoutMgr instanceof LayoutManager2) { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! return lm2.maximumLayoutSize(this); } else ! return super.getMaximumSize(); } /** *************** public class Container extends Component *** 552,559 **** { if (layoutMgr instanceof LayoutManager2) { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! return lm2.getLayoutAlignmentX (this); } else return super.getAlignmentX(); --- 598,605 ---- { if (layoutMgr instanceof LayoutManager2) { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! return lm2.getLayoutAlignmentX(this); } else return super.getAlignmentX(); *************** public class Container extends Component *** 570,577 **** { if (layoutMgr instanceof LayoutManager2) { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! return lm2.getLayoutAlignmentY (this); } else return super.getAlignmentY(); --- 616,623 ---- { if (layoutMgr instanceof LayoutManager2) { ! LayoutManager2 lm2 = (LayoutManager2) layoutMgr; ! return lm2.getLayoutAlignmentY(this); } else return super.getAlignmentY(); *************** public class Container extends Component *** 594,657 **** visitChildren(g, GfxPaintVisitor.INSTANCE, true); } - /** - * Perform a graphics operation on the children of this container. - * For each applicable child, the visitChild() method will be called - * to perform the graphics operation. - * - * @param gfx The graphics object that will be used to derive new - * graphics objects for the children. - * - * @param visitor Object encapsulating the graphics operation that - * should be performed. - * - * @param lightweightOnly If true, only lightweight components will - * be visited. - */ - private void visitChildren(Graphics gfx, GfxVisitor visitor, - boolean lightweightOnly) - { - // FIXME: do locking - - for (int i = 0; i < ncomponents; ++i) - { - Component comp = component[i]; - boolean applicable = comp.isVisible() - && (comp.isLightweight() || !lightweightOnly); - - if (applicable) - visitChild(gfx, visitor, comp); - } - } - - /** - * Perform a graphics operation on a child. A translated and clipped - * graphics object will be created, and the visit() method of the - * visitor will be called to perform the operation. - * - * @param gfx The graphics object that will be used to derive new - * graphics objects for the child. - * - * @param visitor Object encapsulating the graphics operation that - * should be performed. - * - * @param comp The child component that should be visited. - */ - private void visitChild(Graphics gfx, GfxVisitor visitor, - Component comp) - { - Rectangle bounds = comp.getBounds(); - Rectangle clip = gfx.getClipBounds().intersection(bounds); - - if (clip.isEmpty()) return; - - Graphics gfx2 = gfx.create(); - gfx2.setClip(clip.x, clip.y, clip.width, clip.height); - gfx2.translate(bounds.x, bounds.y); - - visitor.visit(comp, gfx2); - } - /** * Updates this container. The implementation of this method in this * class forwards to any lightweight components in this container. If --- 640,645 ---- *************** public class Container extends Component *** 703,719 **** visitChildren(g, GfxPrintAllVisitor.INSTANCE, true); } - void dispatchEventImpl(AWTEvent e) - { - if ((e.id <= ContainerEvent.CONTAINER_LAST - && e.id >= ContainerEvent.CONTAINER_FIRST) - && (containerListener != null - || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)) - processEvent(e); - else - super.dispatchEventImpl(e); - } - /** * Adds the specified container listener to this object's list of * container listeners. --- 691,696 ---- *************** public class Container extends Component *** 722,728 **** */ public synchronized void addContainerListener(ContainerListener l) { ! containerListener = AWTEventMulticaster.add (containerListener, l); } /** --- 699,705 ---- */ public synchronized void addContainerListener(ContainerListener l) { ! containerListener = AWTEventMulticaster.add(containerListener, l); } /** *************** public class Container extends Component *** 736,747 **** containerListener = AWTEventMulticaster.remove(containerListener, l); } ! /** @since 1.3 */ public EventListener[] getListeners(Class listenerType) { if (listenerType == ContainerListener.class) ! return getListenersImpl(listenerType, containerListener); ! else return super.getListeners(listenerType); } /** --- 713,740 ---- containerListener = AWTEventMulticaster.remove(containerListener, l); } ! /** ! * @since 1.4 ! */ ! public synchronized ContainerListener[] getContainerListeners() ! { ! return (ContainerListener[]) ! AWTEventMulticaster.getListeners(containerListener, ! ContainerListener.class); ! } ! ! /** ! * Returns an array of all the objects currently registered as FooListeners ! * upon this Container. FooListeners are registered using the addFooListener ! * method. ! * ! * @since 1.3 ! */ public EventListener[] getListeners(Class listenerType) { if (listenerType == ContainerListener.class) ! return getContainerListeners(); ! return super.getListeners(listenerType); } /** *************** public class Container extends Component *** 756,762 **** { if (e instanceof ContainerEvent) processContainerEvent((ContainerEvent) e); ! else super.processEvent(e); } /** --- 749,756 ---- { if (e instanceof ContainerEvent) processContainerEvent((ContainerEvent) e); ! else ! super.processEvent(e); } /** *************** public class Container extends Component *** 772,783 **** switch (e.id) { case ContainerEvent.COMPONENT_ADDED: ! containerListener.componentAdded(e); ! break; case ContainerEvent.COMPONENT_REMOVED: ! containerListener.componentRemoved(e); ! break; } } --- 766,777 ---- switch (e.id) { case ContainerEvent.COMPONENT_ADDED: ! containerListener.componentAdded(e); ! break; case ContainerEvent.COMPONENT_REMOVED: ! containerListener.componentRemoved(e); ! break; } } *************** public class Container extends Component *** 786,793 **** * * @param event The event that occurred. * ! * @deprecated This method is deprecated in favor of ! * dispatchEvent(). */ public void deliverEvent(Event e) { --- 780,786 ---- * * @param event The event that occurred. * ! * @deprecated use {@link #dispatchEvent(AWTEvent)} instead */ public void deliverEvent(Event e) { *************** public class Container extends Component *** 807,828 **** * @return The component containing the specified point, or * null if there is no such point. */ ! public Component getComponentAt (int x, int y) { ! if (! contains (x, y)) ! return null; ! for (int i = 0; i < ncomponents; ++i) { ! // Ignore invisible children... ! if (!component[i].isVisible()) ! continue; ! int x2 = x - component[i].x; ! int y2 = y - component[i].y; ! if (component[i].contains (x2, y2)) ! return component[i]; } - return this; } /** --- 800,824 ---- * @return The component containing the specified point, or * null if there is no such point. */ ! public Component getComponentAt(int x, int y) { ! synchronized (getTreeLock ()) { ! if (! contains(x, y)) ! return null; ! for (int i = 0; i < ncomponents; ++i) ! { ! // Ignore invisible children... ! if (!component[i].isVisible()) ! continue; ! int x2 = x - component[i].x; ! int y2 = y - component[i].y; ! if (component[i].contains(x2, y2)) ! return component[i]; ! } ! return this; } } /** *************** public class Container extends Component *** 838,845 **** * @return The component containing the specified point, or null * if there is no such point. * ! * @deprecated This method is deprecated in favor of ! * getComponentAt(int, int). */ public Component locate(int x, int y) { --- 834,840 ---- * @return The component containing the specified point, or null * if there is no such point. * ! * @deprecated use {@link #getComponentAt(int, int)} instead */ public Component locate(int x, int y) { *************** public class Container extends Component *** 855,861 **** * case null is returned. * * @param point The point to return the component at. - * * @return The component containing the specified point, or null * if there is no such point. */ --- 850,855 ---- *************** public class Container extends Component *** 864,896 **** return getComponentAt(p.x, p.y); } ! public Component findComponentAt (int x, int y) { ! if (! contains (x, y)) ! return null; ! ! for (int i = 0; i < ncomponents; ++i) { ! // Ignore invisible children... ! if (!component[i].isVisible()) ! continue; ! int x2 = x - component[i].x; ! int y2 = y - component[i].y; ! // We don't do the contains() check right away because ! // findComponentAt would redundantly do it first thing. ! if (component[i] instanceof Container) ! { ! Container k = (Container) component[i]; ! Component r = k.findComponentAt (x2, y2); ! if (r != null) ! return r; ! } ! else if (component[i].contains (x2, y2)) ! return component[i]; ! } ! return this; } public Component findComponentAt(Point p) --- 858,893 ---- return getComponentAt(p.x, p.y); } ! public Component findComponentAt(int x, int y) { ! synchronized (getTreeLock ()) { ! if (! contains(x, y)) ! return null; ! for (int i = 0; i < ncomponents; ++i) ! { ! // Ignore invisible children... ! if (!component[i].isVisible()) ! continue; ! int x2 = x - component[i].x; ! int y2 = y - component[i].y; ! // We don't do the contains() check right away because ! // findComponentAt would redundantly do it first thing. ! if (component[i] instanceof Container) ! { ! Container k = (Container) component[i]; ! Component r = k.findComponentAt(x2, y2); ! if (r != null) ! return r; ! } ! else if (component[i].contains(x2, y2)) ! return component[i]; ! } ! ! return this; ! } } public Component findComponentAt(Point p) *************** public class Container extends Component *** 903,924 **** * to create its peer. Peers for any child components will also be * created. */ ! public void addNotify () { ! addNotifyContainerChildren (); super.addNotify(); } - private void addNotifyContainerChildren() - { - for (int i = ncomponents; --i >= 0; ) - { - component[i].addNotify(); - if (component[i].isLightweight()) - enableEvents(component[i].eventMask); - } - } - /** * Called when this container is removed from its parent container to * inform it to destroy its peer. This causes the peers of all child --- 900,911 ---- * to create its peer. Peers for any child components will also be * created. */ ! public void addNotify() { ! addNotifyContainerChildren(); super.addNotify(); } /** * Called when this container is removed from its parent container to * inform it to destroy its peer. This causes the peers of all child *************** public class Container extends Component *** 926,934 **** */ public void removeNotify() { ! for (int i = 0; i < ncomponents; ++i) ! component[i].removeNotify (); ! super.removeNotify(); } /** --- 913,924 ---- */ public void removeNotify() { ! synchronized (getTreeLock ()) ! { ! for (int i = 0; i < ncomponents; ++i) ! component[i].removeNotify(); ! super.removeNotify(); ! } } /** *************** public class Container extends Component *** 938,954 **** * @param component The component to test. * * @return true if this container is an ancestor of the ! * specified component, false. */ ! public boolean isAncestorOf (Component comp) { ! for (;;) { ! if (comp == null) ! return false; ! if (comp == this) ! return true; ! comp = comp.getParent(); } } --- 928,947 ---- * @param component The component to test. * * @return true if this container is an ancestor of the ! * specified component, false otherwise. */ ! public boolean isAncestorOf(Component comp) { ! synchronized (getTreeLock ()) { ! while (true) ! { ! if (comp == null) ! return false; ! if (comp == this) ! return true; ! comp = comp.getParent(); ! } } } *************** public class Container extends Component *** 974,984 **** * @param stream The PrintStream to write to. * @param indent The indentation point. */ ! public void list (PrintStream out, int indent) { ! super.list (out, indent); ! for (int i = 0; i < ncomponents; ++i) ! component[i].list (out, indent + 2); } /** --- 967,980 ---- * @param stream The PrintStream to write to. * @param indent The indentation point. */ ! public void list(PrintStream out, int indent) { ! synchronized (getTreeLock ()) ! { ! super.list(out, indent); ! for (int i = 0; i < ncomponents; ++i) ! component[i].list(out, indent + 2); ! } } /** *************** public class Container extends Component *** 990,1000 **** */ public void list(PrintWriter out, int indent) { ! super.list (out, indent); ! for (int i = 0; i < ncomponents; ++i) ! component[i].list (out, indent + 2); } /* The following classes are used in concert with the visitChildren() method to implement all the graphics operations --- 986,1218 ---- */ public void list(PrintWriter out, int indent) { ! synchronized (getTreeLock ()) ! { ! super.list(out, indent); ! for (int i = 0; i < ncomponents; ++i) ! component[i].list(out, indent + 2); ! } ! } ! ! public void setFocusTraversalKeys(int id, Set keys) ! { ! if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS) ! throw new IllegalArgumentException (); ! } ! ! public Set getFocusTraversalKeys(int id) ! { ! if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS) ! throw new IllegalArgumentException (); ! ! return null; ! } ! ! public boolean areFocusTraversalKeysSet(int id) ! { ! if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS && ! id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS) ! throw new IllegalArgumentException (); ! ! return false; ! } ! ! public boolean isFocusCycleRoot(Container c) ! { ! return false; ! } ! ! public void transferFocusBackward() ! { ! } ! ! public void setFocusTraversalPolicy(FocusTraversalPolicy policy) ! { ! } ! ! public FocusTraversalPolicy getFocusTraversalPolicy() ! { ! return null; ! } ! ! public boolean isFocusTraversalPolicySet() ! { ! return false; ! } ! ! public void setFocusCycleRoot(boolean focusCycleRoot) ! { ! } ! ! public boolean isFocusCycleRoot() ! { ! return false; ! } ! ! public void transferFocusDownCycle() ! { ! } ! ! public void applyComponentOrientation(ComponentOrientation o) ! { ! if (orientation == null) ! throw new NullPointerException (); ! } ! ! public void addPropertyChangeListener(PropertyChangeListener l) ! { ! } ! ! public void addPropertyChangeListener(String name, PropertyChangeListener l) ! { ! } ! ! // Hidden helper methods. ! ! /** ! * Perform a graphics operation on the children of this container. ! * For each applicable child, the visitChild() method will be called ! * to perform the graphics operation. ! * ! * @param gfx The graphics object that will be used to derive new ! * graphics objects for the children. ! * ! * @param visitor Object encapsulating the graphics operation that ! * should be performed. ! * ! * @param lightweightOnly If true, only lightweight components will ! * be visited. ! */ ! private void visitChildren(Graphics gfx, GfxVisitor visitor, ! boolean lightweightOnly) ! { ! synchronized (getTreeLock ()) ! { ! for (int i = 0; i < ncomponents; ++i) ! { ! Component comp = component[i]; ! boolean applicable = comp.isVisible() ! && (comp.isLightweight() || !lightweightOnly); ! ! if (applicable) ! visitChild(gfx, visitor, comp); ! } ! } ! } ! ! /** ! * Perform a graphics operation on a child. A translated and clipped ! * graphics object will be created, and the visit() method of the ! * visitor will be called to perform the operation. ! * ! * @param gfx The graphics object that will be used to derive new ! * graphics objects for the child. ! * ! * @param visitor Object encapsulating the graphics operation that ! * should be performed. ! * ! * @param comp The child component that should be visited. ! */ ! private void visitChild(Graphics gfx, GfxVisitor visitor, ! Component comp) ! { ! Rectangle bounds = comp.getBounds(); ! Rectangle clip = gfx.getClipBounds().intersection(bounds); ! ! if (clip.isEmpty()) return; ! ! Graphics gfx2 = gfx.create(); ! gfx2.setClip(clip.x, clip.y, clip.width, clip.height); ! gfx2.translate(bounds.x, bounds.y); ! ! visitor.visit(comp, gfx2); ! } ! ! void dispatchEventImpl(AWTEvent e) ! { ! if ((e.id <= ContainerEvent.CONTAINER_LAST ! && e.id >= ContainerEvent.CONTAINER_FIRST) ! && (containerListener != null ! || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)) ! processEvent(e); ! else ! super.dispatchEventImpl(e); ! } ! ! // This is used to implement Component.transferFocus. ! Component findNextFocusComponent(Component child) ! { ! synchronized (getTreeLock ()) ! { ! int start, end; ! if (child != null) ! { ! for (start = 0; start < ncomponents; ++start) ! { ! if (component[start] == child) ! break; ! } ! end = start; ! // This special case lets us be sure to terminate. ! if (end == 0) ! end = ncomponents; ! ++start; ! } ! else ! { ! start = 0; ! end = ncomponents; ! } ! ! for (int j = start; j != end; ++j) ! { ! if (j >= ncomponents) ! { ! // The JCL says that we should wrap here. However, that ! // seems wrong. To me it seems that focus order should be ! // global within in given window. So instead if we reach ! // the end we try to look in our parent, if we have one. ! if (parent != null) ! return parent.findNextFocusComponent(this); ! j -= ncomponents; ! } ! if (component[j] instanceof Container) ! { ! Component c = component[j]; ! c = c.findNextFocusComponent(null); ! if (c != null) ! return c; ! } ! else if (component[j].isFocusTraversable()) ! return component[j]; ! } ! ! return null; ! } } + private void addNotifyContainerChildren() + { + synchronized (getTreeLock ()) + { + for (int i = ncomponents; --i >= 0; ) + { + component[i].addNotify(); + if (component[i].isLightweight()) + enableEvents(component[i].eventMask); + } + } + } + + // Nested classes. /* The following classes are used in concert with the visitChildren() method to implement all the graphics operations *************** public class Container extends Component *** 1029,1080 **** public static final GfxVisitor INSTANCE = new GfxPrintAllVisitor(); } ! // This is used to implement Component.transferFocus. ! Component findNextFocusComponent (Component child) { ! int start, end; ! if (child != null) { - for (start = 0; start < ncomponents; ++start) - { - if (component[start] == child) - break; - } - end = start; - // This special case lets us be sure to terminate. - if (end == 0) - end = ncomponents; - ++start; } ! else { ! start = 0; ! end = ncomponents; } ! for (int j = start; j != end; ++j) { ! if (j >= ncomponents) ! { ! // The JCL says that we should wrap here. However, that ! // seems wrong. To me it seems that focus order should be ! // global within in given window. So instead if we reach ! // the end we try to look in our parent, if we have one. ! if (parent != null) ! return parent.findNextFocusComponent (this); ! j -= ncomponents; ! } ! if (component[j] instanceof Container) ! { ! Component c = component[j]; ! c = c.findNextFocusComponent (null); ! if (c != null) ! return c; ! } ! else if (component[j].isFocusTraversable ()) ! return component[j]; } ! return null; } ! } --- 1247,1443 ---- public static final GfxVisitor INSTANCE = new GfxPrintAllVisitor(); } ! /** ! * This class provides accessibility support for subclasses of container. ! * ! * @author Eric Blake ! * ! * @since 1.3 ! */ ! protected class AccessibleAWTContainer extends AccessibleAWTComponent { ! /** ! * Compatible with JDK 1.4+. ! */ ! private static final long serialVersionUID = 5081320404842566097L; ! ! /** ! * The handler to fire PropertyChange when children are added or removed. ! * ! * @serial the handler for property changes ! */ ! protected ContainerListener accessibleContainerHandler ! = new AccessibleContainerHandler(); ! ! /** ! * The default constructor. ! */ ! protected AccessibleAWTContainer() ! { ! Container.this.addContainerListener(accessibleContainerHandler); ! } ! ! /** ! * Return the number of accessible children of the containing accessible ! * object (at most the total number of its children). ! * ! * @return the number of accessible children ! */ ! public int getAccessibleChildrenCount() ! { ! synchronized (getTreeLock ()) ! { ! int count = 0; ! int i = component == null ? 0 : component.length; ! while (--i >= 0) ! if (component[i] instanceof Accessible) ! count++; ! return count; ! } ! } ! ! /** ! * Return the nth accessible child of the containing accessible object. ! * ! * @param i the child to grab, zero-based ! * @return the accessible child, or null ! */ ! public Accessible getAccessibleChild(int i) ! { ! synchronized (getTreeLock ()) ! { ! if (component == null) ! return null; ! int index = -1; ! while (i >= 0 && ++index < component.length) ! if (component[index] instanceof Accessible) ! i--; ! if (i < 0) ! return (Accessible) component[index]; ! return null; ! } ! } ! ! /** ! * Return the accessible child located at point (in the parent's ! * coordinates), if one exists. ! * ! * @param p the point to look at ! * ! * @return an accessible object at that point, or null ! * ! * @throws NullPointerException if p is null ! */ ! public Accessible getAccessibleAt(Point p) ! { ! Component c = getComponentAt(p.x, p.y); ! return c != Container.this && c instanceof Accessible ? (Accessible) c ! : null; ! } ! ! /** ! * This class fires a PropertyChange listener, if registered, ! * when children are added or removed from the enclosing accessible object. ! * ! * @author Eric Blake ! * ! * @since 1.3 ! */ ! protected class AccessibleContainerHandler implements ContainerListener ! { ! /** ! * Default constructor. ! */ ! protected AccessibleContainerHandler() { } ! ! /** ! * Fired when a component is added; forwards to the PropertyChange ! * listener. ! * ! * @param e the container event for adding ! */ ! public void componentAdded(ContainerEvent e) { ! AccessibleAWTContainer.this.firePropertyChange ! (ACCESSIBLE_CHILD_PROPERTY, null, e.getChild()); } ! /** ! * Fired when a component is removed; forwards to the PropertyChange ! * listener. ! * ! * @param e the container event for removing ! */ ! public void componentRemoved(ContainerEvent e) { ! AccessibleAWTContainer.this.firePropertyChange ! (ACCESSIBLE_CHILD_PROPERTY, e.getChild(), null); } + } // class AccessibleContainerHandler + } // class AccessibleAWTPanel + } // class Container ! /** ! * Undocumented helper class. ! * STUBBED ! */ ! class LightweightDispatcher implements Serializable, AWTEventListener ! { ! private static final long serialVersionUID = 5184291520170872969L; ! private Container nativeContainer; ! private Component focus; ! private transient Component mouseEventTarget; ! private transient Component targetLastEntered; ! private transient boolean isMouseInNativeContainer; ! private Cursor nativeCursor; ! private long eventMask; ! ! LightweightDispatcher(Container c) ! { } ! ! void dispose() ! { ! } ! ! void enableEvents(long l) ! { ! } ! ! boolean dispatchEvent(AWTEvent e) ! { ! return true; ! } ! ! boolean isMouseGrab(MouseEvent e) ! { ! return true; ! } ! ! boolean processMouseEvent(MouseEvent e) ! { ! return true; ! } ! ! void trackMouseEnterExit(Component c, MouseEvent e) ! { ! } ! ! void startListeningForOtherDrags() ! { ! } ! ! void stopListeningForOtherDrags() ! { ! } ! ! public void eventDispatched(AWTEvent e) ! { ! } ! ! void retargetMouseEvent(Component c, int i, MouseEvent e) ! { ! } ! } // class LightweightDispatcher diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java gcc-3.3/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java *** gcc-3.2.3/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java 2002-11-10 00:16:42.000000000 +0000 *************** *** 0 **** --- 1,98 ---- + /* ContainerOrderFocusTraversalPolicy.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.io.Serializable; + + /** + * STUB CLASS ONLY + */ + public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy + implements Serializable + { + static final long serialVersionUID = 486933713763926351L; + + private boolean downCycle = true; + + public ContainerOrderFocusTraversalPolicy() + { + throw new Error("not implemented"); + } + + public Component getComponentAfter(Container root, Component current) + { + return null; + } + + public Component getComponentBefore(Container root, Component current) + { + return null; + } + + public Component getFirstComponent(Container root) + { + return null; + } + + public Component getLastComponent(Container root) + { + return null; + } + + public Component getDefaultComponent(Container root) + { + return null; + } + + public void setImplicitDownCycleTraversal(boolean value) + { + downCycle = value; + } + + public boolean getImplicitDownCycleTraversal() + { + return downCycle; + } + + protected boolean accept(Component current) + { + return current.visible && current.isDisplayable() && current.enabled + && current.focusable; + } + } // class ContainerOrderFocusTraversalPolicy diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Cursor.java gcc-3.3/libjava/java/awt/Cursor.java *** gcc-3.2.3/libjava/java/awt/Cursor.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Cursor.java 2003-01-02 00:14:04.000000000 +0000 *************** package java.awt; *** 44,49 **** --- 44,51 ---- */ public class Cursor implements java.io.Serializable { + static final long serialVersionUID = 8028237497568985504L; + /** * Constant for the system default cursor type */ *************** public class Cursor implements java.io.S *** 131,141 **** --- 133,146 ---- * type. * * @param type The cursor type. + * + * @exception IllegalArgumentException If the specified cursor type is invalid */ public Cursor(int type) { if (type < 0 || type >= PREDEFINED_COUNT) throw new IllegalArgumentException ("invalid cursor " + type); + this.type = type; // FIXME: lookup and set name? } *************** public class Cursor implements java.io.S *** 169,177 **** --- 174,193 ---- return predefined[type]; } + /** + * Retrieves the system specific custom Cursor named Cursor names are, + * for example: "Invalid.16x16". + * + * @exception AWTException + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true. + */ public static Cursor getSystemCustomCursor(String name) throws AWTException { + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); + // FIXME return null; } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/Clipboard.java gcc-3.3/libjava/java/awt/datatransfer/Clipboard.java *** gcc-3.2.3/libjava/java/awt/datatransfer/Clipboard.java 2002-01-24 06:31:02.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/Clipboard.java 2003-01-02 00:14:06.000000000 +0000 *************** getName() *** 103,108 **** --- 103,110 ---- * Returns the contents of the clipboard. * * @param requestor The object requesting the contents. + * + * @exception IllegalStateException If the clipboard is currently unavailable */ public synchronized Transferable getContents(Object requestor) *************** getContents(Object requestor) *** 120,125 **** --- 122,129 ---- * * @param contents The new clipboard contents. * @param owner The new clipboard owner + * + * @exception IllegalStateException If the clipboard is currently unavailable */ public synchronized void setContents(Transferable contents, ClipboardOwner owner) diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/DataFlavor.java gcc-3.3/libjava/java/awt/datatransfer/DataFlavor.java *** gcc-3.2.3/libjava/java/awt/datatransfer/DataFlavor.java 2002-01-24 06:31:02.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/DataFlavor.java 2003-01-02 00:14:07.000000000 +0000 *************** import java.io.UnsupportedEncodingExcept *** 56,61 **** --- 56,62 ---- */ public class DataFlavor implements java.io.Externalizable, Cloneable { + static final long serialVersionUID = 8367026044764648243L; // FIXME: Serialization: Need to write methods for. *************** public static final DataFlavor stringFla *** 87,92 **** --- 88,95 ---- */ public static final DataFlavor javaFileListFlavor; + public static final DataFlavor imageFlavor; + /** * This is the MIME type used for transferring a serialized object. * The representation class is the type of object be deserialized. *************** static *** 125,130 **** --- 128,137 ---- "Java File List"); // javaFileListFlavor.mimeType = "application/x-java-file-list"; + + imageFlavor + = new DataFlavor(java.awt.Image.class, + "Java Image"); } /*************************************************************************/ *************** DataFlavor(Class representationClass, St *** 274,279 **** --- 281,287 ---- * * @exception IllegalArgumentException If the representation class * specified cannot be loaded. + * @exception ClassNotFoundException If the class is not loaded. */ public DataFlavor(String mimeType, String humanPresentableName, *************** setHumanPresentableName(String humanPres *** 497,504 **** * * @return true if the MIME type is equal to this object's * MIME type, false otherwise. */ ! public boolean isMimeTypeEqual(String mimeType) { // FIXME: Need to handle default attributes and parameters --- 505,514 ---- * * @return true if the MIME type is equal to this object's * MIME type, false otherwise. + * + * @exception NullPointerException If mimeType is null. */ ! public final boolean isMimeTypeEqual(String mimeType) { // FIXME: Need to handle default attributes and parameters *************** isFlavorJavaFileListType() *** 645,650 **** --- 655,664 ---- * Returns a copy of this object. * * @return A copy of this object. + * + * @exception CloneNotSupportedException If the object's class does not support + * the Cloneable interface. Subclasses that override the clone method can also + * throw this exception to indicate that an instance cannot be cloned. */ public Object clone() *************** normalizeMimeType(String type) *** 806,811 **** --- 820,827 ---- * Serialize this class. * * @param stream The ObjectOutput stream to serialize to. + * + * @exception IOException If an error occurs. */ public void writeExternal(ObjectOutput stream) throws IOException *************** writeExternal(ObjectOutput stream) throw *** 819,824 **** --- 835,844 ---- * De-serialize this class. * * @param stream The ObjectInput stream to deserialize from. + * + * @exception IOException If an error ocurs. + * @exception ClassNotFoundException If the class for an object being restored + * cannot be found. */ public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException *************** getTextPlainUnicodeFlavor() *** 861,867 **** * * @since 1.3 */ ! public static final Class getDefaultRepresentationClass() { return(java.io.InputStream.class); --- 881,887 ---- * * @since 1.3 */ ! public final Class getDefaultRepresentationClass() { return(java.io.InputStream.class); *************** getDefaultRepresentationClass() *** 871,877 **** /** * XXX - Currently returns java.io.InputStream. */ ! public static final String getDefaultRepresentationClassAsString() { return(getDefaultRepresentationClass().getName()); --- 891,897 ---- /** * XXX - Currently returns java.io.InputStream. */ ! public final String getDefaultRepresentationClassAsString() { return(getDefaultRepresentationClass().getName()); *************** selectBestTextFlavor(DataFlavor[] availa *** 943,948 **** --- 963,972 ---- * * @param transferable The Transferable for which a text * Reader is requested. + * + * @exception IllegalArgumentException If the representation class is not one + * of the seven listed above or the Transferable has null data. + * @exception NullPointerException If the Transferable is null. * @exception UnsupportedFlavorException when the transferable doesn't * support this DataFlavor. Or if the representable class * isn't a (subclass of) Reader, String, diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/FlavorMap.java gcc-3.3/libjava/java/awt/datatransfer/FlavorMap.java *** gcc-3.2.3/libjava/java/awt/datatransfer/FlavorMap.java 2002-01-24 06:31:02.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/FlavorMap.java 2003-01-02 00:14:07.000000000 +0000 *************** package java.awt.datatransfer; *** 41,82 **** import java.util.Map; /** ! * This interface maps between native platform type names and DataFlavors. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface FlavorMap { ! /** ! * Maps the specified DataFlavor objects to the native ! * data type name. The returned Map has keys that are ! * the data flavors and values that are strings. The returned map ! * may be modified. This can be useful for implementing nested mappings. ! * ! * @param flavors An array of data flavors to map ! * or null for all data flavors. ! * ! * @return A Map of native data types. ! */ ! public abstract Map ! getNativesForFlavors(DataFlavor[] flavors); ! ! /*************************************************************************/ ! ! /** ! * Maps the specified native type names to DataFlavor's. ! * The returned Map has keys that are strings and values ! * that are DataFlavor's. The returned map may be ! * modified. This can be useful for implementing nested mappings. ! * ! * @param natives An array of native types to map ! * or null for all native types. ! * ! * @return A Map of data flavors. ! */ ! public abstract Map ! getFlavorsForNatives(String[] natives); ! ! } // interface FlavorMap ! --- 41,75 ---- import java.util.Map; /** ! * This interface maps between native platform type names and DataFlavors. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface FlavorMap { + /** + * Maps the specified DataFlavor objects to the native + * data type name. The returned Map has keys that are + * the data flavors and values that are strings. The returned map + * may be modified. This can be useful for implementing nested mappings. + * + * @param flavors An array of data flavors to map + * or null for all data flavors. + * + * @return A Map of native data types. + */ + public abstract Map getNativesForFlavors (DataFlavor[] flavors); ! /** ! * Maps the specified native type names to DataFlavor's. ! * The returned Map has keys that are strings and values ! * that are DataFlavor's. The returned map may be ! * modified. This can be useful for implementing nested mappings. ! * ! * @param natives An array of native types to map ! * or null for all native types. ! * ! * @return A Map of data flavors. ! */ ! public abstract Map getFlavorsForNatives (String[] natives); ! } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/FlavorTable.java gcc-3.3/libjava/java/awt/datatransfer/FlavorTable.java *** gcc-3.2.3/libjava/java/awt/datatransfer/FlavorTable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/FlavorTable.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,73 ---- + /* FlavorTable.java -- A relaxed mapping between flavors + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.datatransfer; + + import java.util.List; + + /** + * A FlavorMap which no longer requires a 1-to-1 mapping between flavors. Any + * native can map to multiple flavors, and any flavor can map to multiple + * natives; although the mappings are usually symmetric. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public interface FlavorTable extends FlavorMap + { + /** + * Returns a list of String natives corresponding to the given flavor. The + * list should be sorted from best to worst. The list must be modifiable + * without affecting this table. + * + * @param flavor the flavor to look up, or null to return all natives + * @return the sorted list of natives + */ + List getNativesForFlavor(DataFlavor flavor); + + /** + * Returns a list of flavors corresponding to the given String native. The + * list should be sorted from best to worst. The list must be modifiable + * without affecting this table. + * + * @param native the native to look up, or null to return all flavors + * @return the sorted list of flavors + */ + List getFlavorsForNative(String name); + } // interface FlavorTable diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/MimeTypeParseException.java gcc-3.3/libjava/java/awt/datatransfer/MimeTypeParseException.java *** gcc-3.2.3/libjava/java/awt/datatransfer/MimeTypeParseException.java 2002-01-24 06:31:02.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/MimeTypeParseException.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* MimeTypeParseException.java -- Thrown when MIME string couldn't be parsed. ! Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* MimeTypeParseException.java -- thrown when MIME string couldn't be parsed ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.awt.datatransfer; *** 41,70 **** /** * MIME string couldn't be parsed correctly. * ! * @author Mark Wielaard (mark@klomp.org) ! */ ! public class MimeTypeParseException extends Exception ! { ! ! /** ! * Initializes a new instance of MimeTypeParseException ! * without any message. */ ! public ! MimeTypeParseException() { ! super(); ! } ! /** ! * Initializes a new instance of MimeTypeParseException ! * with a specified detailed error message. ! */ ! public ! MimeTypeParseException(String message) ! { ! super(message); ! } } // class MimeTypeParseException - --- 41,70 ---- /** * MIME string couldn't be parsed correctly. * ! * @author Mark Wielaard ! * @status updated to 1.4 */ ! public class MimeTypeParseException extends Exception { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -5604407764691570741L; ! /** ! * Create a new instance without any message. ! */ ! public MimeTypeParseException() ! { ! } + /** + * Create a new instance with a specified detailed error message. + * + * @param message the message + */ + public MimeTypeParseException(String message) + { + super(message); + } } // class MimeTypeParseException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/SystemFlavorMap.java gcc-3.3/libjava/java/awt/datatransfer/SystemFlavorMap.java *** gcc-3.2.3/libjava/java/awt/datatransfer/SystemFlavorMap.java 2002-01-24 06:31:02.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/SystemFlavorMap.java 2003-01-02 00:14:07.000000000 +0000 *************** package java.awt.datatransfer; *** 40,45 **** --- 40,46 ---- import java.util.HashMap; import java.util.Map; + import java.util.List; /** * This class maps between native platform type names and DataFlavors. *************** import java.util.Map; *** 47,180 **** * XXX - The current implementation does no mapping at all. * * @author Mark Wielaard (mark@klomp.org) - */ - public final class SystemFlavorMap implements FlavorMap - { - - /** - * The default (instance) flavor map. - */ - private static FlavorMap defaultFlavorMap; - - /** - * Private constructor. - */ - private SystemFlavorMap() - { - } - - /*************************************************************************/ - - /** - * Maps the specified DataFlavor objects to the native - * data type name. The returned Map has keys that are - * the data flavors and values that are strings. The returned map - * may be modified. This can be useful for implementing nested mappings. * ! * @param flavors An array of data flavors to map ! * or null for all data flavors. ! * ! * @return A Map of native data types to data flavors. ! */ ! public Map ! getNativesForFlavors(DataFlavor[] flavors) ! { ! return(new HashMap()); ! } ! ! /*************************************************************************/ ! ! /** ! * Maps the specified native type names to DataFlavor's. ! * The returned Map has keys that are strings and values ! * that are DataFlavor's. The returned map may be ! * modified. This can be useful for implementing nested mappings. ! * ! * @param natives An array of native types to map ! * or null for all native types. ! * ! * @return A Map of data flavors to native type names. */ ! public Map ! getFlavorsForNatives(String[] natives) { ! return(new HashMap()); ! } ! ! /*************************************************************************/ ! /** ! * Returns the default (instance) (System)FlavorMap. ! */ ! public static FlavorMap ! getDefaultFlavorMap() ! { ! if (defaultFlavorMap == null) ! defaultFlavorMap = new SystemFlavorMap(); ! return(defaultFlavorMap); ! } ! /*************************************************************************/ ! /** ! * Returns the native type name for the given java mime type. ! */ ! public static String ! encodeJavaMIMEType(String mime) ! { ! return null; ! } ! /*************************************************************************/ ! /** ! * Returns the native type name for the given data flavor. ! */ ! public static String ! encodeDataFlavor(DataFlavor df) ! { ! return null; ! } ! /*************************************************************************/ ! /** ! * Returns true if the native type name can be represented as ! * a java mime type. ! */ ! public static boolean ! isJavaMIMEType(String name) ! { ! return(false); ! } ! /*************************************************************************/ ! /** ! * Returns the java mime type for the given the native type name. ! */ ! public static String ! decodeJavaMIMEType(String name) ! { ! return null; ! } ! /*************************************************************************/ ! /** ! * Returns the data flavor given the native type name ! * or null when no such data flavor exists. ! */ ! public static DataFlavor ! decodeDataFlavor(String name) throws ClassNotFoundException ! { ! String javaMIMEType = decodeJavaMIMEType(name); ! if (javaMIMEType != null) ! return(new DataFlavor(javaMIMEType)); ! else ! return(null); ! } } // class SystemFlavorMap - --- 48,169 ---- * XXX - The current implementation does no mapping at all. * * @author Mark Wielaard (mark@klomp.org) * ! * @since 1.2 */ ! public final class SystemFlavorMap implements FlavorMap, FlavorTable { ! /** ! * The default (instance) flavor map. ! */ ! private static FlavorMap defaultFlavorMap; ! /** ! * Private constructor. ! */ ! private SystemFlavorMap () ! { ! } ! /** ! * Maps the specified DataFlavor objects to the native ! * data type name. The returned Map has keys that are ! * the data flavors and values that are strings. The returned map ! * may be modified. This can be useful for implementing nested mappings. ! * ! * @param flavors An array of data flavors to map ! * or null for all data flavors. ! * ! * @return A Map of native data types to data flavors. ! */ ! public Map getNativesForFlavors (DataFlavor[] flavors) ! { ! return new HashMap(); ! } ! /** ! * Maps the specified native type names to DataFlavor's. ! * The returned Map has keys that are strings and values ! * that are DataFlavor's. The returned map may be ! * modified. This can be useful for implementing nested mappings. ! * ! * @param natives An array of native types to map ! * or null for all native types. ! * ! * @return A Map of data flavors to native type names. ! */ ! public Map getFlavorsForNatives (String[] natives) ! { ! return new HashMap(); ! } ! /** ! * Returns the default (instance) (System)FlavorMap. ! */ ! public static FlavorMap getDefaultFlavorMap () ! { ! if (defaultFlavorMap == null) ! defaultFlavorMap = new SystemFlavorMap (); ! return defaultFlavorMap; ! } ! /** ! * Returns the native type name for the given java mime type. ! */ ! public static String encodeJavaMIMEType (String mime) ! { ! return null; ! } ! /** ! * Returns the native type name for the given data flavor. ! */ ! public static String encodeDataFlavor (DataFlavor df) ! { ! return null; ! } ! /** ! * Returns true if the native type name can be represented as ! * a java mime type. ! */ ! public static boolean isJavaMIMEType (String name) ! { ! return false; ! } ! /** ! * Returns the java mime type for the given the native type name. ! */ ! public static String decodeJavaMIMEType (String name) ! { ! return null; ! } ! /** ! * Returns the data flavor given the native type name ! * or null when no such data flavor exists. ! */ ! public static DataFlavor decodeDataFlavor (String name) ! throws ClassNotFoundException ! { ! String javaMIMEType = decodeJavaMIMEType (name); ! ! if (javaMIMEType != null) ! return new DataFlavor (javaMIMEType); ! else ! return null; ! } ! public List getFlavorsForNative (String nat) ! { ! throw new Error ("Not implemented"); ! } ! public List getNativesForFlavor (DataFlavor flav) ! { ! throw new Error ("Not implemented"); ! } } // class SystemFlavorMap diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/Transferable.java gcc-3.3/libjava/java/awt/datatransfer/Transferable.java *** gcc-3.2.3/libjava/java/awt/datatransfer/Transferable.java 2002-01-24 06:31:02.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/Transferable.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** /* Transferable.java -- Data transfer source ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Transferable.java -- Data transfer source ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.awt.datatransfer; *** 41,92 **** import java.io.IOException; /** ! * This interface is implemented by classes that can transfer data. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface Transferable { ! /** ! * Returns the data in the specified DataFlavor ! * ! * @param flavor The data flavor to return. ! * ! * @return The data in the appropriate flavor. ! * ! * @exception UnsupportedFlavorException If the flavor is not supported. ! * @exception IOException If the data is not available. ! */ ! public abstract Object ! getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, ! IOException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a list of available data flavors for the ! * data being transferred. The array returned will be sorted from most ! * preferred flavor at the beginning to least preferred at the end. ! * ! * @return A list of data flavors for this data. ! */ ! public abstract DataFlavor[] ! getTransferDataFlavors(); ! ! /*************************************************************************/ ! ! /** ! * Tests whether or not this data can be delivered in the specified ! * data flavor. ! * ! * @param flavor The data flavor to test. ! * ! * @return true if the data flavor is supported, ! * false otherwise. ! */ ! public abstract boolean ! isDataFlavorSupported(DataFlavor flavor); } // interface Transferable - --- 41,81 ---- import java.io.IOException; /** ! * This interface is implemented by classes that can transfer data. ! * ! * @author Aaron M. Renn ! * @since 1.1 ! * @status updated to 1.4 ! */ public interface Transferable { + /** + * This method returns a list of available data flavors for the data being + * transferred. The array returned will be sorted from most preferred + * flavor at the beginning to least preferred at the end. + * + * @return adA list of data flavors for this data + */ + public abstract DataFlavor[] getTransferDataFlavors(); ! /** ! * Tests whether or not this data can be delivered in the specified data ! * flavor. ! * ! * @param flavor the data flavor to test ! * @return true if the data flavor is supported ! */ ! public abstract boolean isDataFlavorSupported(DataFlavor flavor); + /** + * Returns the data in the specified DataFlavor. + * + * @param flavor the data flavor to return + * @return the data in the appropriate flavor + * @throws UnsupportedFlavorException if the flavor is not supported + * @throws IOException if the data is not available + * @see DataFlavor#getRepresentationClass + */ + public abstract Object getTransferData(DataFlavor flavor) + throws UnsupportedFlavorException, IOException; } // interface Transferable diff -Nrc3pad gcc-3.2.3/libjava/java/awt/datatransfer/UnsupportedFlavorException.java gcc-3.3/libjava/java/awt/datatransfer/UnsupportedFlavorException.java *** gcc-3.2.3/libjava/java/awt/datatransfer/UnsupportedFlavorException.java 2002-01-24 06:31:02.000000000 +0000 --- gcc-3.3/libjava/java/awt/datatransfer/UnsupportedFlavorException.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* UnsupportedFlavorException.java -- Data flavor is not valid. ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnsupportedFlavorException.java -- ata flavor is not valid ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,62 **** package java.awt.datatransfer; /** ! * The data flavor requested is not supported for the transfer data. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class UnsupportedFlavorException extends Exception ! { ! ! /** ! * Initializes a new instance of UnsupportedDataFlavor ! * for the specified data flavor. ! * ! * @param flavor The data flavor that is not supported. ! */ ! public ! UnsupportedFlavorException(DataFlavor flavor) { ! super(flavor.getHumanPresentableName()); ! } } // class UnsupportedFlavorException - --- 39,65 ---- package java.awt.datatransfer; /** ! * The data flavor requested is not supported for the transfer data. ! * ! * @author Aaron M. Renn ! * @see Transferable#getTransferData(DataFlavor) ! * @status updated to 1.4 ! */ ! public class UnsupportedFlavorException extends Exception { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 5383814944251665601L; + /** + * Initializes a new instance of UnsupportedDataFlavor + * for the specified data flavor. + * + * @param flavor the data flavor that is not supported + */ + public UnsupportedFlavorException(DataFlavor flavor) + { + super(flavor == null ? null : flavor.getHumanPresentableName()); + } } // class UnsupportedFlavorException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/DefaultFocusTraversalPolicy.java gcc-3.3/libjava/java/awt/DefaultFocusTraversalPolicy.java *** gcc-3.2.3/libjava/java/awt/DefaultFocusTraversalPolicy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/DefaultFocusTraversalPolicy.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* DefaultFocusTraversalPolicy.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * STUB CLASS ONLY + */ + public class DefaultFocusTraversalPolicy + extends ContainerOrderFocusTraversalPolicy + { + public DefaultFocusTraversalPolicy() + { + } + + protected boolean accept(Component comp) + { + throw new Error("not implemented"); + } + } // class DefaultFocusTraversalPolicy diff -Nrc3pad gcc-3.2.3/libjava/java/awt/DefaultKeyboardFocusManager.java gcc-3.3/libjava/java/awt/DefaultKeyboardFocusManager.java *** gcc-3.2.3/libjava/java/awt/DefaultKeyboardFocusManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/DefaultKeyboardFocusManager.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,96 ---- + /* DefaultKeyboardFocusManager.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.event.KeyEvent; + + /** + * STUB CLASS ONLY + */ + public class DefaultKeyboardFocusManager extends KeyboardFocusManager + { + public DefaultKeyboardFocusManager() + { + } + + public boolean dispatchEvent(AWTEvent e) + { + throw new Error("not implemented"); + } + public boolean dispatchKeyEvent(KeyEvent e) + { + throw new Error("not implemented"); + } + public boolean postProcessKeyEvent(KeyEvent e) + { + throw new Error("not implemented"); + } + public void processKeyEvent(Component comp, KeyEvent e) + { + throw new Error("not implemented"); + } + protected void enqueueKeyEvents(long after, Component comp) + { + throw new Error("not implemented"); + } + protected void dequeueKeyEvents(long after, Component comp) + { + throw new Error("not implemented"); + } + protected void discardKeyEvents(Component comp) + { + throw new Error("not implemented"); + } + public void focusPreviousComponent(Component comp) + { + throw new Error("not implemented"); + } + public void focusNextComponent(Component comp) + { + throw new Error("not implemented"); + } + public void upFocusCycle(Component comp) + { + throw new Error("not implemented"); + } + public void downFocusCycle(Container cont) + { + throw new Error("not implemented"); + } + } // class DefaultKeyboardFocusManager diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Dimension.java gcc-3.3/libjava/java/awt/Dimension.java *** gcc-3.2.3/libjava/java/awt/Dimension.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/Dimension.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Dimension.java -- represents a 2-dimensional span ! Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,172 **** package java.awt; ! /* Written using "Java Class Libraries", 2nd edition, plus online ! * API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: Believed complete and correct, except that neither toString ! * has not been compared with JDK output. ! */ /** ! * This class holds a width and height value pair. ! * ! * @author Per Bothner ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @date Fenruary 8, 1999. ! */ ! public class Dimension extends java.awt.geom.Dimension2D ! implements java.io.Serializable { /** ! * This width of this object. */ public int width; /** * The height of this object. */ public int height; /** ! * Initializes a new instance of Dimension with a width ! * and height of zero. */ ! public Dimension () { } /** ! * Initializes a new instance of Dimension to have a width ! * and height identical to that of the specified dimension object. * ! * @param dim The Dimension to take the width and height from. */ ! public Dimension (Dimension dim) { ! this.width = dim.width; ! this.height = dim.height; } /** ! * Initializes a new instance of Dimension with the ! * specified width and height. * ! * @param width The width of this object. ! * @param height The height of this object. */ ! public Dimension (int width, int height) { ! this.width = width; ! this.height = height; } /** ! * Tests this object for equality against the specified object. This will ! * be true if and only if the specified object: ! *

        ! *

          ! *
        • Is not null. ! *
        • Is an instance of Dimension. ! *
        • Has width and height values identical to this object. ! *
        * ! * @param obj The object to test against. * ! * @return true if the specified object is equal to this ! * object, false otherwise. */ ! public boolean equals (Object obj) { ! if (! (obj instanceof Dimension)) ! return false; ! Dimension dim = (Dimension) obj; ! return height == dim.height && width == dim.width; } /** ! * Returns the size of this object. Not very useful. * ! * @return This object. */ ! public Dimension getSize () { return new Dimension(this); } /** * Sets the width and height of this object to match that of the * specified object. * ! * @param dim The Dimension object to get the new width and ! * height from. */ ! public void setSize (Dimension dim) { ! this.width = dim.width; ! this.height = dim.height; } /** * Sets the width and height of this object to the specified values. * ! * @param width The new width value. ! * @param height The new height value. */ ! public void setSize (int width, int height) { ! this.width = width; ! this.height = height; } /** ! * Returns a string representation of this object. * ! * @return A string representation of this object. */ ! public String toString () { ! return "Dimension[w:"+width+",h:"+height+']'; } ! /* Note: There is no Dimension.hashCode. */ ! ! public double getWidth() { return width; } ! public double getHeight() { return height; } ! public void setSize (double width, double height) { ! this.width = (int) width; ! this.height = (int) height; } ! } --- 38,234 ---- package java.awt; ! import java.awt.geom.Dimension2D; ! import java.io.Serializable; /** ! * This class holds a width and height value pair. This is used in plenty ! * of windowing classes, but also has geometric meaning. ! * ! *

        It is valid for a dimension to have negative width or height; but it ! * is considered to have no area. Therefore, the behavior in various methods ! * is undefined in such a case. ! * ! *

        There are some public fields; if you mess with them in an inconsistent ! * manner, it is your own fault when you get invalid results. Also, this ! * class is not threadsafe. ! * ! * @author Per Bothner ! * @author Aaron M. Renn ! * @author Eric Blake ! * @see Component ! * @see LayoutManager ! * @since 1.0 ! * @status updated to 1.14 ! */ ! public class Dimension extends Dimension2D implements Serializable { /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 4723952579491349524L; ! ! /** ! * The width of this object. ! * ! * @see #getSize() ! * @see #setSize(double, double) ! * @serial the width */ public int width; /** * The height of this object. + * + * @see #getSize() + * @see #setSize(double, double) + * @serial the height */ public int height; /** ! * Create a new Dimension with a width and height of zero. */ ! public Dimension() ! { ! } /** ! * Create a new Dimension with width and height identical to that of the ! * specified dimension. * ! * @param d the Dimension to copy ! * @throws NullPointerException if d is null */ ! public Dimension(Dimension d) { ! width = d.width; ! height = d.height; } /** ! * Create a new Dimension with the specified width and height. * ! * @param w the width of this object ! * @param h the height of this object */ ! public Dimension(int w, int h) { ! width = w; ! height = h; } /** ! * Gets the width of this dimension. * ! * @return the width, as a double ! */ ! public double getWidth() ! { ! return width; ! } ! ! /** ! * Gets the height of this dimension. * ! * @return the height, as a double */ ! public double getHeight() { ! return height; } /** ! * Sets the size of this dimension. The values are rounded to int. * ! * @param w the new width ! * @param h the new height ! * @since 1.2 */ ! public void setSize(double w, double h) ! { ! width = (int) w; ! height = (int) h; ! } ! ! /** ! * Returns the size of this dimension. A pretty useless method, as this is ! * already a dimension. ! * ! * @return a copy of this dimension ! * @see #setSize(Dimension) ! * @since 1.1 ! */ ! public Dimension getSize() ! { ! return new Dimension(width, height); ! } /** * Sets the width and height of this object to match that of the * specified object. * ! * @param d the Dimension to get the new width and height from ! * @throws NullPointerException if d is null ! * @see #getSize() ! * @since 1.1 */ ! public void setSize(Dimension d) { ! width = d.width; ! height = d.height; } /** * Sets the width and height of this object to the specified values. * ! * @param w the new width value ! * @param h the new height value */ ! public void setSize(int w, int h) { ! width = w; ! height = h; } /** ! * Tests this object for equality against the specified object. This will ! * be true if and only if the specified object is an instance of ! * Dimension2D, and has the same width and height. * ! * @param obj the object to test against ! * @return true if the object is equal to this */ ! public boolean equals(Object obj) { ! if (! (obj instanceof Dimension)) ! return false; ! Dimension dim = (Dimension) obj; ! return height == dim.height && width == dim.width; } ! /** ! * Return the hashcode for this object. It is not documented, but appears ! * to be ((width + height) * (width + height + 1) / 2) + width. ! * ! * @return the hashcode ! */ ! public int hashCode() ! { ! // Reverse engineering this was fun! ! return (width + height) * (width + height + 1) / 2 + width; ! } ! /** ! * Returns a string representation of this object. The format is: ! * getClass().getName() + "[width=" + width + ",height=" + height ! * + ']'. ! * ! * @return a string representation of this object ! */ ! public String toString() { ! return getClass().getName() ! + "[width=" + width + ",height=" + height + ']'; } ! } // class Dimension diff -Nrc3pad gcc-3.2.3/libjava/java/awt/DisplayMode.java gcc-3.3/libjava/java/awt/DisplayMode.java *** gcc-3.2.3/libjava/java/awt/DisplayMode.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/DisplayMode.java 2003-01-11 00:50:29.000000000 +0000 *************** *** 0 **** --- 1,164 ---- + /* DisplayMode.java -- a description of display mode configurations + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * This encapsulates information about the display mode for a graphics + * device configuration. They are device dependent, and may not always be + * available. + * + * @author Eric Blake + * @see GraphicsDevice + * @since 1.4 + * @status updated to 1.4 + */ + public final class DisplayMode + { + /** + * Value of the bit depth if multiple depths are supported. + * + * @see #getBitDepth() + */ + public static final int BIT_DEPTH_MULTI = -1; + + /** + * Value of an unknown refresh rate. + * + * @see #getRefreshRate() + */ + public static final int REFRESH_RATE_UNKNOWN = 0; + + /** The width. */ + private final int width; + + /** The height. */ + private final int height; + + /** The bit depth. */ + private final int bitDepth; + + /** The refresh rate. */ + private final int refreshRate; + + /** + * Create a mode with the given parameters. + * + * @param width the width + * @param height the height + * @param bitDepth the bitDepth + * @param refreshRate the refreshRate + * @see #BIT_DEPTH_MULTI + * @see #REFRESH_RATE_UNKNOWN + */ + public DisplayMode(int width, int height, int bitDepth, int refreshRate) + { + this.width = width; + this.height = height; + this.bitDepth = bitDepth; + this.refreshRate = refreshRate; + } + + /** + * Returns the height, in pixels. + * + * @return the height + */ + public int getHeight() + { + return height; + } + + /** + * Returns the width, in pixels. + * + * @return the width + */ + public int getWidth() + { + return width; + } + + /** + * Returns the bit depth, in bits per pixel. This may be BIT_DEPTH_MULTI. + * + * @return the bit depth + * @see #BIT_DEPTH_MULTI + */ + public int getBitDepth() + { + return bitDepth; + } + + /** + * Returns the refresh rate, in hertz. This may be REFRESH_RATE_UNKNOWN. + * + * @return the refresh rate + * @see #REFRESH_RATE_UNKNOWN + */ + public int getRefreshRate() + { + return refreshRate; + } + + /** + * Test for equality. This returns true for two modes with identical + * parameters. + * + * @param dm The display mode to compare to + * + * @return true if it is equal + */ + public boolean equals (DisplayMode dm) + { + return (width == dm.width + && height == dm.height + && bitDepth == dm.bitDepth + && refreshRate == dm.refreshRate); + } + + /** + * Returns a hash code for the display mode. + * + * @return the hash code + */ + public int hashCode() + { + return width + height + bitDepth + refreshRate; + } + } // class DisplayMode diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/Autoscroll.java gcc-3.3/libjava/java/awt/dnd/Autoscroll.java *** gcc-3.2.3/libjava/java/awt/dnd/Autoscroll.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/Autoscroll.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,67 ---- + /* Autoscroll.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + import java.awt.Point; + import java.awt.Insets; + + /** + * During DnD operations it is possible that a user may wish to drop the + * subject of the operation on a region of a scrollable GUI control that + * is not currently visible to the user. + * + * @author Michael Koch + * @since 1.2 + * @status updated to 1.4 + */ + public interface Autoscroll + { + /** + * This method returns the Insets describing the autoscrolling region or + * border relative to the geometry of the implementing Component + */ + public Insets getAutoscrollInsets (); + + /** + * Notify the Component to autoscroll + * + * @param location A Point indicating the location of the cursor that + * triggered this operation + */ + public void autoscroll (Point location); + } // interface Autoscroll diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DnDConstants.java gcc-3.3/libjava/java/awt/dnd/DnDConstants.java *** gcc-3.2.3/libjava/java/awt/dnd/DnDConstants.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DnDConstants.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,72 ---- + /* DnDConstants.java -- constants for drag-and-drop operations + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + /** + * This class contains various constants used in drag-and-drop operations. + * Why it is not an interface is beyond me. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public final class DnDConstants + { + /** No action takes place. */ + public static final int ACTION_NONE = 0; + + /** The copy action. */ + public static final int ACTION_COPY = 1; + + /** The move action. */ + public static final int ACTION_MOVE = 2; + + /** Either a copy or a move. */ + public static final int ACTION_COPY_OR_MOVE = 3; + + /** + * A link action. This does not copy or move, but creates a reference back + * to the original. However, since platforms differ on how a reference should + * behave, this action is not recommended for common use. + */ + public static final int ACTION_LINK = 1073741824; + + /** A synonym for {@link #ACTION_LINK}. */ + public static final int ACTION_REFERENCE = ACTION_LINK; + } // class DnDConstants diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragGestureEvent.java gcc-3.3/libjava/java/awt/dnd/DragGestureEvent.java *** gcc-3.2.3/libjava/java/awt/dnd/DragGestureEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragGestureEvent.java 2003-01-02 00:14:07.000000000 +0000 *************** *** 0 **** --- 1,156 ---- + /* DragGestureEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.awt.Component; + import java.awt.Cursor; + import java.awt.Image; + import java.awt.Point; + import java.awt.datatransfer.Transferable; + import java.awt.event.InputEvent; + import java.util.EventObject; + import java.util.Iterator; + import java.util.List; + + /** + * STUBBED + * @see DragGestureRecognizer + * @see DragGestureListener + * @see DragSource + * @since 1.2 + */ + public class DragGestureEvent extends EventObject + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 9080172649166731306L; + + private DragSource dragSource; + private Component component; + private final Point origin; + private final int action; + + public DragGestureEvent(DragGestureRecognizer dgr, int action, Point origin, + List events) + { + super(dgr); + if (origin == null || events == null) + throw new IllegalArgumentException(); + this.origin = origin; + this.action = action; + } + + public DragGestureRecognizer getSourceAsDragGestureRecognizer() + { + return (DragGestureRecognizer) source; + } + public Component getComponent() + { + return null; + } + public DragSource getDragSource() + { + return null; + } + public Point getDragOrigin() + { + return origin; + } + public Iterator iterator() + { + return null; + } + public Object[] toArray() + { + return null; + } + public Object[] toArray(Object[] array) + { + return array; + } + public int getDragAction() + { + return 0; + } + public InputEvent getTriggerEvent() + { + return null; + } + + /** + * Starts the drag given the initial Cursor to display, the Transferable + * object, and the DragSourceListener to use. + * + * @exception InvalidDnDOperationException If the Drag and Drop system is + * unable to initiate a drag operation, or if the user attempts to start + * a drag while an existing drag operation is still executing. + */ + public void startDrag(Cursor dragCursor, Transferable trans) + { + startDrag(dragCursor, null, null, trans, null); + } + + /** + * Starts the drag given the initial Cursor to display, the Transferable + * object, and the DragSourceListener to use. + * + * @exception InvalidDnDOperationException If the Drag and Drop system is + * unable to initiate a drag operation, or if the user attempts to start + * a drag while an existing drag operation is still executing. + */ + public void startDrag(Cursor dragCursor, Transferable trans, + DragSourceListener l) + { + startDrag(dragCursor, null, null, trans, l); + } + + /** + * Starts the drag given the initial Cursor to display, the Transferable + * object, and the DragSourceListener to use. + * + * @exception InvalidDnDOperationException If the Drag and Drop system is + * unable to initiate a drag operation, or if the user attempts to start + * a drag while an existing drag operation is still executing. + */ + public void startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, + Transferable trans, DragSourceListener l) + { + } + } // class DragGestureEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragGestureListener.java gcc-3.3/libjava/java/awt/dnd/DragGestureListener.java *** gcc-3.2.3/libjava/java/awt/dnd/DragGestureListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragGestureListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,63 ---- + /* DragGestureListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.util.EventListener; + + /** + * This is a listener for starting a drag-and-drop gesture. Upon receiving + * notification, the implementor then starts the drag operation. + * + * @author Eric Blake + * @see DragGestureRecognizer + * @see DragGestureEvent + * @see DragSource + * @since 1.2 + * @status updated to 1.4 + */ + public interface DragGestureListener extends EventListener + { + /** + * Called when the native platform notifies the virtual machine that a + * drag-and-drop has been initiated. + * + * @param e the event + */ + void dragGestureRecognized(DragGestureEvent e); + } // interface DragGestureListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragGestureRecognizer.java gcc-3.3/libjava/java/awt/dnd/DragGestureRecognizer.java *** gcc-3.2.3/libjava/java/awt/dnd/DragGestureRecognizer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragGestureRecognizer.java 2003-01-02 00:14:08.000000000 +0000 *************** *** 0 **** --- 1,179 ---- + /* DragGestureRecognizer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.awt.Component; + import java.awt.Point; + import java.awt.event.InputEvent; + import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; + import java.io.Serializable; + import java.util.ArrayList; + import java.util.TooManyListenersException; + + /** + * STUBBED + * @since 1.2 + */ + public abstract class DragGestureRecognizer implements Serializable + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 8996673345831063337L; + + protected DragSource dragSource; + protected Component component; + protected transient DragGestureListener dragGestureListener; + protected int sourceActions; + protected ArrayList events = new ArrayList(); + + protected DragGestureRecognizer(DragSource ds, Component c, int sa, + DragGestureListener dgl) + { + if (ds == null) + throw new IllegalArgumentException(); + dragSource = ds; + component = c; + sourceActions = sa; + dragGestureListener = dgl; + } + + protected DragGestureRecognizer(DragSource ds, Component c, int sa) + { + this(ds, c, sa, null); + } + + protected DragGestureRecognizer(DragSource ds, Component c) + { + this(ds, c, 0, null); + } + + protected DragGestureRecognizer(DragSource ds) + { + this(ds, null, 0, null); + } + + protected abstract void registerListeners(); + + protected abstract void unregisterListeners(); + + public DragSource getDragSource() + { + return dragSource; + } + + public Component getComponent() + { + return component; + } + + public void setComponent(Component c) + { + component = c; + } + + public int getSourceActions() + { + return sourceActions; + } + + public void setSourceActions(int sa) + { + sourceActions = sa; + } + + public InputEvent getTriggerEvent() + { + return events.size() > 0 ? (InputEvent) events.get(0) : null; + } + + public void resetRecognizer() + { + throw new Error("not implemented"); + } + + /** + * Register a new DragGestureListener. + * + * @exception TooManyListenersException If a DragGestureListener has already + * been added. + */ + public void addDragGestureListener(DragGestureListener dgl) + throws TooManyListenersException + { + if (dragGestureListener != null) + throw new TooManyListenersException(); + dragGestureListener = dgl; + } + + public void removeDragGestureListener(DragGestureListener dgl) + { + if (dragGestureListener != dgl) + throw new IllegalArgumentException(); + dragGestureListener = null; + } + + protected void fireDragGestureRecognized(int dragAction, Point p) + { + throw new Error("not implemented"); + } + + protected void appendEvent(InputEvent e) + { + if (e == null) + return; + events.add(e); + } + + private void readObject(ObjectInputStream s) + throws ClassNotFoundException, IOException + { + s.defaultReadObject(); + dragGestureListener = (DragGestureListener) s.readObject(); + } + + private void writeObject(ObjectOutputStream s) throws IOException + { + s.defaultWriteObject(); + s.writeObject(dragGestureListener instanceof Serializable + ? dragGestureListener : null); + } + } // class DragGestureRecognizer diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSourceAdapter.java gcc-3.3/libjava/java/awt/dnd/DragSourceAdapter.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSourceAdapter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSourceAdapter.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,126 ---- + /* DragSourceAdapter.java -- drag-and-drop listener adapter + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + /** + * This class implements DragSourceListener and + * DragSourceMotionListener, and implements all methods + * with empty bodies. This allows a listener interested in implementing only + * a subset of these interfaces to extend this class and override only the + * desired methods. + * + * @author Eric Blake + * @see DragSourceEvent + * @see DragSourceListener + * @see DragSourceMotionListener + * @since 1.4 + * @status updated to 1.4 + */ + public abstract class DragSourceAdapter + implements DragSourceListener, DragSourceMotionListener + { + /** + * Default constructor. + */ + public DragSourceAdapter() + { + } + + /** + * Called when the cursor hotspot enters a drop site which will accept the + * drag. + * + * @param e the event + */ + public void dragEnter(DragSourceDragEvent e) + { + } + + /** + * Called when the cursor hotspot moves inside of a drop site which will + * accept the drag. + * + * @param e the event + */ + public void dragOver(DragSourceDragEvent e) + { + } + + /** + * Called whenever the mouse is moved during a drag-and-drop operation. + * + * @param e the event + */ + public void dragMouseMoved(DragSourceDragEvent e) + { + } + + /** + * Called when the user modifies the drop gesture. This is often the case + * when additional mouse or key events are received during the drag. + * + * @param e the event + */ + public void dropActionChanged(DragSourceDragEvent e) + { + } + + /** + * Called when the cursor hotspot moves outside of a drop site which will + * accept the drag. This could also happen if the drop site is no longer + * active, or no longer accepts the drag. + * + * @param e the event + */ + public void dragExit(DragSourceEvent e) + { + } + + /** + * Called when the drag and drop operation is complete. After this event, + * getDropSuccess of the event is valid, and + * getDropAction holds the action requested by the drop site. + * Furthermore, the DragSourceContext is invalidated. + * + * @param e the event + */ + public void dragDropEnd(DragSourceDropEvent e) + { + } + } // class DragSourceAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSourceContext.java gcc-3.3/libjava/java/awt/dnd/DragSourceContext.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSourceContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSourceContext.java 2002-11-10 00:16:43.000000000 +0000 *************** *** 0 **** --- 1,140 ---- + /* DragSourceContext.java -- + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.awt.Component; + import java.awt.Cursor; + import java.awt.Image; + import java.awt.Point; + import java.awt.datatransfer.Transferable; + import java.awt.dnd.peer.DragSourceContextPeer; + import java.io.Serializable; + import java.util.TooManyListenersException; + + public class DragSourceContext + implements DragSourceListener, DragSourceMotionListener, Serializable + { + static final long serialVersionUID = -115407898692194719L; + + protected static final int DEFAULT = 0; + protected static final int ENTER = 1; + protected static final int OVER = 2; + protected static final int CHANGED = 3; + + public DragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge, + Cursor cursor, Image image, Point offset, + Transferable trans, DragSourceListener dsl) + { + } + + public DragSource getDragSource() + { + return null; + } + + public Component getComponent() + { + return null; + } + + public DragGestureEvent getTrigger() + { + return null; + } + + public int getSourceActions() + { + return 0; + } + + public void setCursor(Cursor c) + { + } + + public Cursor getCursor() + { + return null; + } + + public void addDragSourceListener(DragSourceListener l) + throws TooManyListenersException + { + } + + public void removeDragSourceListener(DragSourceListener l) + { + } + + public void transferablesFlavorsChanged() + { + } + + public void dragEnter(DragSourceDragEvent e) + { + } + + public void dragOver(DragSourceDragEvent e) + { + } + + public void dragExit(DragSourceEvent e) + { + } + + public void dropActionChanged(DragSourceDragEvent e) + { + } + + public void dragDropEnd(DragSourceDropEvent e) + { + } + + public void dragMouseMoved(DragSourceDragEvent e) + { + } + + public Transferable getTransferable() + { + return null; + } + + protected void updateCurrentCursor(int dropOp, int targetAct, int status) + { + } + } // class DragSourceContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSourceDragEvent.java gcc-3.3/libjava/java/awt/dnd/DragSourceDragEvent.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSourceDragEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSourceDragEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,95 ---- + /* DragSourceDragEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import gnu.java.awt.EventModifier; + + /** + * STUBBED + */ + public class DragSourceDragEvent extends DragSourceEvent + { + private final int dropAction; + private final int targetActions; + private final int gestureModifiers; + + public DragSourceDragEvent(DragSourceContext context, int dropAction, + int actions, int modifiers) + { + super(context); + this.dropAction = dropAction; + targetActions = actions; + gestureModifiers = EventModifier.extend(modifiers); + } + + public DragSourceDragEvent(DragSourceContext context, int dropAction, + int actions, int modifiers, int x, int y) + { + super(context, x, y); + this.dropAction = dropAction; + targetActions = actions; + gestureModifiers = EventModifier.extend(modifiers); + } + + public int getTargetActions() + { + return targetActions; + } + + public int getGestureModifiers() + { + return EventModifier.revert(gestureModifiers); + } + + public int getGestureModifiersEx() + { + return gestureModifiers; + } + + public int getUserAction() + { + return dropAction; + } + + public int getDropAction() + { + return dropAction & targetActions + & ((DragSourceContext) source).getSourceActions(); + } + } // class DragSourceDragEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSourceDropEvent.java gcc-3.3/libjava/java/awt/dnd/DragSourceDropEvent.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSourceDropEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSourceDropEvent.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,84 ---- + /* DragSourceDragEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + /** + * @author Michael Koch + * @since 1.2 + * + * Written using JDK 1.4.1 Online API + * Status: JDK 1.4 complete + */ + public class DragSourceDropEvent extends DragSourceEvent + { + private final int dropAction; + private final boolean success; + + public DragSourceDropEvent (DragSourceContext context) + { + super (context); + this.dropAction = 0; + this.success = false; + } + + public DragSourceDropEvent (DragSourceContext context, int dropAction, + boolean success) + { + super (context); + this.dropAction = dropAction; + this.success = success; + } + + public DragSourceDropEvent (DragSourceContext context, int dropAction, + boolean success, int x, int y) + { + super (context, x, y); + this.dropAction = dropAction; + this.success = success; + } + + public int getDropAction() + { + return dropAction & ((DragSourceContext) source).getSourceActions(); + } + + public boolean getDropSuccess() + { + return success; + } + } // class DragSourceDropEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSourceEvent.java gcc-3.3/libjava/java/awt/dnd/DragSourceEvent.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSourceEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSourceEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,85 ---- + /* DragSourceEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.awt.Point; + import java.util.EventObject; + + public class DragSourceEvent extends EventObject + { + private final boolean locationSpecified; + private final int x; + private final int y; + + public DragSourceEvent(DragSourceContext context) + { + super(context); + locationSpecified = false; + x = 0; + y = 0; + } + + public DragSourceEvent(DragSourceContext context, int x, int y) + { + super(context); + locationSpecified = true; + this.x = x; + this.y = y; + } + + public DragSourceContext getDragSourceContext() + { + return (DragSourceContext) source; + } + + public Point getLocation() + { + return locationSpecified ? new Point(x, y) : null; + } + + public int getX() + { + return x; + } + + public int getY() + { + return y; + } + } // class DragSourceEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSource.java gcc-3.3/libjava/java/awt/dnd/DragSource.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSource.java 2003-01-02 00:14:08.000000000 +0000 *************** *** 0 **** --- 1,209 ---- + /* DragSource.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.awt.Component; + import java.awt.Cursor; + import java.awt.GraphicsEnvironment; + import java.awt.HeadlessException; + import java.awt.Image; + import java.awt.Point; + import java.awt.datatransfer.FlavorMap; + import java.awt.datatransfer.Transferable; + import java.awt.dnd.peer.DragSourceContextPeer; + import java.io.Serializable; + import java.util.EventListener; + + public class DragSource implements Serializable + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 6236096958971414066L; + + public static final Cursor DefaultCopyDrop = null; + public static final Cursor DefaultMoveDrop = null; + public static final Cursor DefaultLinkDrop = null; + public static final Cursor DefaultCopyNoDrop = null; + public static final Cursor DefaultMoveNoDrop = null; + public static final Cursor DefaultLinkNoDrop = null; + + /** + * Initializes the drag source. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. + */ + public DragSource() + { + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); + } + + /** + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. + */ + public static DragSource getDefaultDragSource() + { + return null; + } + + public static boolean isDragImageSupported() + { + return false; + } + + /** + * Start a drag, given the DragGestureEvent that initiated the drag. + * + * @exception InvalidDnDOperationException If the Drag and Drop system is + * unable to initiate a drag operation, or if the user attempts to start + * a drag while an existing drag operation is still executing. + */ + public void startDrag(DragGestureEvent trigger, Cursor dragCursor, + Image dragImage, Point imageOffset, + Transferable trans, DragSourceListener dsl, + FlavorMap map) + { + } + + /** + * Start a drag, given the DragGestureEvent that initiated the drag. + * + * @exception InvalidDnDOperationException If the Drag and Drop system is + * unable to initiate a drag operation, or if the user attempts to start + * a drag while an existing drag operation is still executing. + */ + public void startDrag(DragGestureEvent trigger, Cursor dragCursor, + Transferable trans, DragSourceListener dsl, + FlavorMap map) + { + startDrag(trigger, dragCursor, null, null, trans, dsl, map); + } + + /** + * Start a drag, given the DragGestureEvent that initiated the drag. + * + * @exception InvalidDnDOperationException If the Drag and Drop system is + * unable to initiate a drag operation, or if the user attempts to start + * a drag while an existing drag operation is still executing. + */ + public void startDrag(DragGestureEvent trigger, Cursor dragCursor, + Image dragImage, Point imageOffset, + Transferable trans, DragSourceListener dsl) + { + startDrag(trigger, dragCursor, dragImage, imageOffset, trans, dsl, null); + } + + /** + * Start a drag, given the DragGestureEvent that initiated the drag. + * + * @exception InvalidDnDOperationException If the Drag and Drop system is + * unable to initiate a drag operation, or if the user attempts to start + * a drag while an existing drag operation is still executing. + */ + public void startDrag(DragGestureEvent trigger, Cursor dragCursor, + Transferable trans, DragSourceListener dsl) + { + startDrag(trigger, dragCursor, null, null, trans, dsl, null); + } + + /** + * Creates the DragSourceContext to handle this drag. + * + * @exception IllegalArgumentException FIXME + * @exception NullPointerException If dscp, dgl, dragImage or t is null. + */ + protected DragSourceContext + createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge, + Cursor cursor, Image image, Point offset, + Transferable t, DragSourceListener dsl) + { + return null; + } + + public FlavorMap getFlavorMap() + { + return null; + } + + public DragGestureRecognizer + createDragGestureRecognizer(Class recognizer, Component c, int actions, + DragGestureListener dgl) + { + return null; + } + + public DragGestureRecognizer + createDefaultDragGestureRecognizer(Component c, int actions, + DragGestureListener dgl) + { + return null; + } + + public void addDragSourceListener(DragSourceListener l) + { + } + + public void removeDragSourceListener(DragSourceListener l) + { + } + + public DragSourceListener[] getDragSourceListeners() + { + return null; + } + + public void addDragSourceMotionListener(DragSourceMotionListener l) + { + } + + public void removeDragSourceMotionListener(DragSourceMotionListener l) + { + } + + public DragSourceMotionListener[] getDragSourceMotionListeners() + { + return null; + } + + public EventListener[] getListeners(Class type) + { + return null; + } + } // class DragSource diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSourceListener.java gcc-3.3/libjava/java/awt/dnd/DragSourceListener.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSourceListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSourceListener.java 2002-11-07 08:45:17.000000000 +0000 *************** *** 0 **** --- 1,97 ---- + /* DragSourceListener.java -- listen to events during the drag + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.util.EventListener; + + /** + * This class allows an object to listen for drag and drop events. It can + * be used to provide appropriate feedback for "drag over" actions. You can + * also use a DragSourceAdapter to filter the events you are + * interested in. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public interface DragSourceListener extends EventListener + { + /** + * Called when the cursor hotspot enters a drop site which will accept the + * drag. + * + * @param e the drag source drag event + */ + void dragEnter(DragSourceDragEvent e); + + /** + * Called when the cursor hotspot moves inside of a drop site which will + * accept the drag. + * + * @param e the drag source drag event + */ + void dragOver(DragSourceDragEvent e); + + /** + * Called when the user modifies the drop gesture. This is often the case + * when additional mouse or key events are received during the drag. + * + * @param e the drag source drag event + */ + void dropActionChanged(DragSourceDragEvent e); + + /** + * Called when the cursor hotspot moves outside of a drop site which will + * accept the drag. This could also happen if the drop site is no longer + * active, or no longer accepts the drag. + * + * @param e the drag source drag event + */ + void dragExit(DragSourceEvent e); + + /** + * Called when the drag and drop operation is complete. After this event, + * getDropSuccess of the event is valid, and + * getDropAction holds the action requested by the drop site. + * Furthermore, the DragSourceContext is invalidated. + * + * @param e the drag source drag event + */ + void dragDropEnd(DragSourceDropEvent e); + } // interface DragSourceListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DragSourceMotionListener.java gcc-3.3/libjava/java/awt/dnd/DragSourceMotionListener.java *** gcc-3.2.3/libjava/java/awt/dnd/DragSourceMotionListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DragSourceMotionListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,64 ---- + /* DragSourceMotionListener.java -- tracks motion in the drag source + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.util.EventListener; + + /** + * This is a listener for mouse motion in the drag source before the drop + * event occurs. You can also use a DragSourceAdapter to filter + * the events you are interested in. + * + * @author Eric Blake + * @see DragSourceDragEvent + * @see DragSource + * @see DragSourceListener + * @see DragSourceAdapter + * @since 1.4 + * @status updated to 1.4 + */ + public interface DragSourceMotionListener extends EventListener + { + /** + * Called whenever the mouse is moved during a drag-and-drop operation. + * + * @param e the event + */ + void dragMouseMoved(DragSourceDragEvent e); + } // interface DragSourceMotionListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DropTargetAdapter.java gcc-3.3/libjava/java/awt/dnd/DropTargetAdapter.java *** gcc-3.2.3/libjava/java/awt/dnd/DropTargetAdapter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DropTargetAdapter.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,100 ---- + /* DragSourceAdapter.java -- drag-and-drop listener adapter + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + /** + * This class implements DropTargetListener, and implements all methods + * with empty bodies. This allows a listener interested in implementing only + * a subset of these interfaces to extend this class and override only the + * desired methods. + * + * @author Michael Koch + * @since 1.4 + * @status updated to 1.4 + */ + public abstract class DropTargetAdapter + implements DropTargetListener + { + /** + * Default constructor. + */ + public DropTargetAdapter() + { + } + + /** + * Called when the cursor hotspot enters a drop site which will accept the + * drag. + * + * @param e the event + */ + public void dragEnter (DropTargetDragEvent e) + { + } + + /** + * Called when the cursor hotspot moves inside of a drop site which will + * accept the drag. + * + * @param e the event + */ + public void dragOver (DropTargetDragEvent e) + { + } + + /** + * Called when the user modifies the drop gesture. This is often the case + * when additional mouse or key events are received during the drag. + * + * @param e the event + */ + public void dropActionChanged (DropTargetDragEvent e) + { + } + + /** + * Called when the cursor hotspot moves outside of a drop site which will + * accept the drag. This could also happen if the drop site is no longer + * active, or no longer accepts the drag. + * + * @param e the event + */ + public void dragExit(DropTargetEvent e) + { + } + } // class DropTargetAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DropTargetContext.java gcc-3.3/libjava/java/awt/dnd/DropTargetContext.java *** gcc-3.2.3/libjava/java/awt/dnd/DropTargetContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DropTargetContext.java 2002-11-10 00:16:43.000000000 +0000 *************** *** 0 **** --- 1,176 ---- + /* DropTargetContext.java -- + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + import java.awt.dnd.peer.DropTargetContextPeer; + import java.io.Serializable; + import java.io.IOException; + import java.awt.Component; + import java.awt.datatransfer.DataFlavor; + import java.awt.datatransfer.Transferable; + import java.awt.datatransfer.UnsupportedFlavorException; + import java.util.List; + + public class DropTargetContext implements Serializable + { + static final long serialVersionUID = -634158968993743371L; + + protected class TransferableProxy implements Transferable + { + protected boolean isLocal; + protected Transferable transferable; + + public DataFlavor[] getTransferDataFlavors () + { + // FIXME: implement this + return null; + } + + public boolean isDataFlavorSupported (DataFlavor flavor) + { + // FIXME: implement this + return false; + } + + public Object getTransferData (DataFlavor flavor) + throws UnsupportedFlavorException, IOException + { + // FIXME: implement this + return null; + } + } + + private int targetActions; + + public DropTarget getDropTarget () + { + // FIXME: implement this + return null; + } + + public Component getComponent () + { + // FIXME: implement this + return null; + } + + public void addNotify (java.awt.dnd.peer.DropTargetContextPeer dtcp) + { + // FIXME: implement this + } + + public void removeNotify () + { + // FIXME: implement this + } + + protected void setTargetActions (int actions) + { + targetActions = actions; + } + + protected int getTargetActions() + { + return targetActions; + } + + /** + * FIXME + * + * @exception InvalidDnDOperationException FIXME + */ + public void dropComplete (boolean success) + { + // FIXME: implement this + } + + protected void acceptDrag (int dragOperation) + { + // FIXME: implement this + } + + protected void rejectDrag () + { + // FIXME: implement this + } + + protected void acceptDrop (int dropOperation) + { + // FIXME: implement this + } + + protected void rejectDrop () + { + // FIXME: implement this + } + + protected DataFlavor[] getCurrentDataFlavors () + { + // FIXME: implement this + return null; + } + + protected List getCurrentDataFlavorsAsList () + { + // FIXME: implement this + return null; + } + + protected boolean isDataFlavorSupported (DataFlavor flavor) + { + // FIXME: implement this + return false; + } + + /** + * FIXME + * + * @exception InvalidDnDOperationException FIXME + */ + protected Transferable getTransferable() throws InvalidDnDOperationException + { + // FIXME: implement this + return null; + } + + protected Transferable createTransferableProxy(Transferable t, boolean local) + { + // FIXME: implement this + return null; + } + } // class DropTargetContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DropTargetDragEvent.java gcc-3.3/libjava/java/awt/dnd/DropTargetDragEvent.java *** gcc-3.2.3/libjava/java/awt/dnd/DropTargetDragEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DropTargetDragEvent.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,107 ---- + /* DropTargetDragEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + import java.util.List; + import java.awt.Point; + import java.awt.datatransfer.DataFlavor; + + public class DropTargetDragEvent extends DropTargetEvent + { + private final int dropAction; + private final int srcActions; + private final Point location; + + /** + * FIXME + * + * @exception NullPointerException FIXME + */ + public DropTargetDragEvent (DropTargetContext context, Point location, + int dropAction, int srcActions) + { + super (context); + this.dropAction = dropAction; + this.srcActions = srcActions; + this.location = location; + } + + public void acceptDrag (int dragOperation) + { + // FIXME: implement this + } + + public DataFlavor[] getCurrentDataFlavors () + { + // FIXME: implement this + return null; + } + + public List getCurrentDataFlavorsAsList () + { + // FIXME: implement this + return null; + } + + public int getDropAction() + { + return 0; + //return dropAction & ((DropTargetContext) source).getTargetActions(); + } + + public Point getLocation () + { + return location; + } + + public int getSourceActions () + { + return srcActions; + } + + public boolean isDataFlavorSupported (DataFlavor df) + { + // FIXME: implement this + return true; + } + + public void rejectDrag () + { + // FIXME: implement this + } + } // class DropTargetDragEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DropTargetDropEvent.java gcc-3.3/libjava/java/awt/dnd/DropTargetDropEvent.java *** gcc-3.2.3/libjava/java/awt/dnd/DropTargetDropEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DropTargetDropEvent.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,132 ---- + /* DropTargetDropEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + import java.awt.Point; + import java.awt.datatransfer.DataFlavor; + import java.awt.datatransfer.Transferable; + import java.util.List; + + public class DropTargetDropEvent extends DropTargetEvent + { + private final int dropAction; + private final int srcActions; + private final Point location; + private final boolean isLocal; + + public DropTargetDropEvent (DropTargetContext dtc, Point location, + int dropAction, int srcActions) + { + super (dtc); + this.dropAction = dropAction; + this.srcActions = srcActions; + this.location = location; + this.isLocal = false; + } + + public DropTargetDropEvent (DropTargetContext dtc, Point location, + int dropAction, int srcActions, boolean isLocal) + { + super (dtc); + this.dropAction = dropAction; + this.srcActions = srcActions; + this.location = location; + this.isLocal = isLocal; + } + + public Point getLocation () + { + return location; + } + + public DataFlavor[] getCurrentDataFlavors () + { + // FIXME: implement this + return null; + } + + public List getCurrentDataFlavorsAsList () + { + // FIXME: implement this + return null; + } + + public boolean isDataFlavorSupported (DataFlavor flavor) + { + // FIXME: implement this + return false; + } + + public int getSourceActions () + { + // FIXME: implement this + return 0; + } + + public int getDropAction () + { + // FIXME: implement this + return 0; + } + + public Transferable getTransferable () + { + // FIXME: implement this + return null; + } + + public void acceptDrop (int dropAction) + { + // FIXME: implement this + } + + public void rejectDrop () + { + // FIXME: implement this + } + + public void dropComplete (boolean success) + { + // FIXME: implement this + } + + public boolean isLocalTransfer() + { + return isLocal; + } + } // class DropTargetDropEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DropTargetEvent.java gcc-3.3/libjava/java/awt/dnd/DropTargetEvent.java *** gcc-3.2.3/libjava/java/awt/dnd/DropTargetEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DropTargetEvent.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,56 ---- + /* DropTarget.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + import java.util.EventObject; + + public class DropTargetEvent extends EventObject + { + protected DropTargetContext context; + + public DropTargetEvent (DropTargetContext context) + { + super (context); + this.context = context; + } + + public DropTargetContext getDropTargetContext () + { + return context; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DropTarget.java gcc-3.3/libjava/java/awt/dnd/DropTarget.java *** gcc-3.2.3/libjava/java/awt/dnd/DropTarget.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DropTarget.java 2003-01-02 00:14:08.000000000 +0000 *************** *** 0 **** --- 1,226 ---- + /* DropTarget.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + import java.awt.Point; + import java.awt.Component; + import java.awt.datatransfer.FlavorMap; + import java.awt.event.ActionEvent; + import java.awt.event.ActionListener; + import java.io.Serializable; + import java.util.EventListener; + import java.util.TooManyListenersException; + + /** STUB CLASS ONLY */ + public class DropTarget + implements DropTargetListener, EventListener, Serializable + { + protected static class DropTargetAutoScroller + implements ActionListener + { + protected DropTargetAutoScroller (Component c, Point p) + { + } + + protected void updateLocation (Point newLocn) + { + } + + protected void stop () + { + } + + public void actionPerformed (ActionEvent e) + { + } + } + + // FIXME: check the correctness of default value. + private boolean isActive = false; + + /** + * FIXME + * + * @exception HeadlessException FIXME + */ + public DropTarget () + { + } + + /** + * FIXME + * + * @exception HeadlessException FIXME + */ + public DropTarget (Component c, DropTargetListener dtl) + { + } + + /** + * FIXME + * + * @exception HeadlessException FIXME + */ + public DropTarget (Component c, int i, DropTargetListener dtl) + { + } + + /** + * FIXME + * + * @exception HeadlessException FIXME + */ + public DropTarget (Component c, int i, DropTargetListener dtl, boolean b) + { + } + + /** + * FIXME + * + * @exception HeadlessException FIXME + */ + public DropTarget (Component c, int i, DropTargetListener dtl, boolean b, + FlavorMap fm) + { + } + + public void setComponent (Component c) + { + } + + public Component getComponent () + { + return null; + } + + public void setDefaultActions (int ops) + { + } + + public int getDefaultActions () + { + return 0; + } + + public void setActive(boolean isActive) + { + this.isActive = isActive; + } + + public boolean isActive() + { + return this.isActive; + } + + /** + * @exception TooManyListenersException FIXME + */ + public void addDropTargetListener (DropTargetListener dtl) + throws TooManyListenersException + { + } + + public void removeDropTargetListener(DropTargetListener dtl) + { + } + + public void dragEnter(DropTargetDragEvent dtde) + { + } + + public void dragOver(DropTargetDragEvent dtde) + { + } + + public void dropActionChanged(DropTargetDragEvent dtde) + { + } + + public void dragExit(DropTargetEvent dte) + { + } + + public void drop(DropTargetDropEvent dtde) + { + } + + public FlavorMap getFlavorMap() + { + return null; + } + + public void setFlavorMap(FlavorMap fm) + { + } + + public void addNotify(java.awt.peer.ComponentPeer peer) + { + } + + public void removeNotify(java.awt.peer.ComponentPeer peer) + { + } + + public DropTargetContext getDropTargetContext() + { + return null; + } + + protected DropTargetContext createDropTargetContext() + { + return null; + } + + protected DropTarget.DropTargetAutoScroller createDropTargetAutoScroller + (Component c, Point p) + { + return null; + } + + protected void initializeAutoscrolling(Point p) + { + } + + protected void updateAutoscroll(Point dragCursorLocn) + { + } + + protected void clearAutoscroll() + { + } + } // class DropTarget diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/DropTargetListener.java gcc-3.3/libjava/java/awt/dnd/DropTargetListener.java *** gcc-3.2.3/libjava/java/awt/dnd/DropTargetListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/DropTargetListener.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,89 ---- + /* DropTargetListener.java -- listen to events during the drop + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + import java.util.EventListener; + + /** + * @author Michael Koch + * @since 1.2 + * @status updated to 1.4 + */ + public interface DropTargetListener extends EventListener + { + /** + * Called when the cursor hotspot enters a drop site which will accept the + * drag. + * + * @param e the drag source drag event + */ + void dragEnter (DropTargetDragEvent e); + + /** + * Called when the cursor hotspot moves inside of a drop site which will + * accept the drag. + * + * @param e the drag source drag event + */ + void dragOver (DropTargetDragEvent e); + + /** + * Called when the user modifies the drop gesture. This is often the case + * when additional mouse or key events are received during the drag. + * + * @param e the drag source drag event + */ + void dropActionChanged (DropTargetDragEvent e); + + /** + * Called when the cursor hotspot moves outside of a drop site which will + * accept the drag. This could also happen if the drop site is no longer + * active, or no longer accepts the drag. + * + * @param e the drag source drag event + */ + void dragExit (DropTargetEvent e); + + /** + * FIXME + * + * @param e the drag source drag event + */ + void drop (DropTargetDropEvent e); + } // interface DropTargetListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/InvalidDnDOperationException.java gcc-3.3/libjava/java/awt/dnd/InvalidDnDOperationException.java *** gcc-3.2.3/libjava/java/awt/dnd/InvalidDnDOperationException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/InvalidDnDOperationException.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,73 ---- + /* InvalidDnDOperationException.java -- thrown when drag-and-drop fails + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd; + + /** + * Thrown when a method in the java.awt.dnd package is unable to perform a + * requested operation, usually because the underlying DnD system is in the + * wrong state. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public class InvalidDnDOperationException extends IllegalStateException + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -6062568741193956678L; + + /** + * Create an exception without a message. + */ + public InvalidDnDOperationException() + { + } + + /** + * Create an exception with a message. + * + * @param s the message + */ + public InvalidDnDOperationException(String s) + { + super(s); + } + } // class InvalidDnDOperationException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/MouseDragGestureRecognizer.java gcc-3.3/libjava/java/awt/dnd/MouseDragGestureRecognizer.java *** gcc-3.2.3/libjava/java/awt/dnd/MouseDragGestureRecognizer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/MouseDragGestureRecognizer.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,118 ---- + /* MouseDragGestureRecognizer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd; + + import java.awt.Component; + import java.awt.event.MouseEvent; + import java.awt.event.MouseListener; + import java.awt.event.MouseMotionListener; + + /** + * @author Michael Koch + */ + + public abstract class MouseDragGestureRecognizer + extends DragGestureRecognizer + implements MouseListener, MouseMotionListener + { + protected MouseDragGestureRecognizer (DragSource ds, Component c, int act, + DragGestureListener dgl) + { + super (ds, c, act, dgl); + } + + protected MouseDragGestureRecognizer (DragSource ds, Component c, int act) + { + super (ds, c, act); + } + + protected MouseDragGestureRecognizer (DragSource ds, Component c) + { + super (ds, c); + } + + protected MouseDragGestureRecognizer (DragSource ds) + { + super (ds); + } + + protected void registerListeners () + { + // FIXME: implement this + } + + protected void unregisterListeners () + { + // FIXME: implement this + } + + public void mouseClicked (MouseEvent e) + { + // FIXME: implement this + } + + public void mousePressed (MouseEvent e) + { + // FIXME: implement this + } + + public void mouseReleased (MouseEvent e) + { + // FIXME: implement this + } + + public void mouseEntered (MouseEvent e) + { + // FIXME: implement this + } + + public void mouseExited (MouseEvent e) + { + // FIXME: implement this + } + + public void mouseDragged (MouseEvent e) + { + // FIXME: implement this + } + + public void mouseMoved (MouseEvent e) + { + // FIXME: implement this + } + } // class MouseDragGestureRecognizer diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/peer/DragSourceContextPeer.java gcc-3.3/libjava/java/awt/dnd/peer/DragSourceContextPeer.java *** gcc-3.2.3/libjava/java/awt/dnd/peer/DragSourceContextPeer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/peer/DragSourceContextPeer.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* DragSourceContextPeer.java -- interface for drag-and-drop peers + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.dnd.peer; + + import java.awt.Cursor; + import java.awt.Image; + import java.awt.Point; + import java.awt.dnd.DragSourceContext; + + /** + * STUBBED + */ + public interface DragSourceContextPeer + { + void startDrag(DragSourceContext context, Cursor c, Image i, Point p); + Cursor getCursor(); + void setCursor(Cursor c); + void transferablesFlavorsChanged(); + } // interface DragSourceContextPeer diff -Nrc3pad gcc-3.2.3/libjava/java/awt/dnd/peer/DropTargetContextPeer.java gcc-3.3/libjava/java/awt/dnd/peer/DropTargetContextPeer.java *** gcc-3.2.3/libjava/java/awt/dnd/peer/DropTargetContextPeer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/dnd/peer/DropTargetContextPeer.java 2002-10-03 14:40:43.000000000 +0000 *************** *** 0 **** --- 1,45 ---- + /* DropTargetContextPeer.java -- interface for drag-and-drop peers + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.dnd.peer; + + /** + * @author Michael Koch + */ + public interface DropTargetContextPeer + { + } // interface DropTargetContextPeer diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ActionEvent.java gcc-3.3/libjava/java/awt/event/ActionEvent.java *** gcc-3.2.3/libjava/java/awt/event/ActionEvent.java 2000-08-16 18:03:47.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ActionEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,66 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; - import java.awt.*; ! /* Status: Believed complete and correct to JDK 1.2. */ public class ActionEvent extends AWTEvent { public static final int ACTION_FIRST = 1001; public static final int ACTION_LAST = 1001; public static final int ACTION_PERFORMED = 1001; - public static final int ALT_MASK = 8; - public static final int CTRL_MASK = 2; - public static final int META_MASK = 4; - public static final int SHIFT_MASK = 1; ! String cmd; ! int modifiers; ! public ActionEvent (Object source, int id, String command) { ! super(source, id); ! cmd = command; } ! public ActionEvent (Object source, int id, String command, int modifiers) { super(source, id); ! cmd = command; this.modifiers = modifiers; } ! public String getActionCommand () { ! return cmd; } ! public int getModifiers () { return modifiers; } ! public String paramString () { ! String r; ! switch (id) ! { ! case ACTION_PERFORMED: ! r = "ACTION_PERFORMED"; ! break; ! default: ! r = "unknown type"; ! break; ! } ! ! r += ",cmd=" + cmd; ! return r; } ! } --- 1,226 ---- ! /* ActionEvent.java -- an action has been triggered ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! import java.awt.AWTEvent; ! import java.awt.EventQueue; + /** + * This event is generated when an action on a component (such as a + * button press) occurs. + * + * @author Aaron M. Renn + * @see ActionListener + * @since 1.1 + * @status updated to 1.4 + */ public class ActionEvent extends AWTEvent { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -7671078796273832149L; + + /** Bit mask indicating the shift key was pressed. */ + public static final int SHIFT_MASK = InputEvent.SHIFT_MASK; + + /** Bit mask indicating the control key was pressed. */ + public static final int CTRL_MASK = InputEvent.CTRL_MASK; + + /** Bit mask indicating the that meta key was pressed. */ + public static final int META_MASK = InputEvent.META_MASK; + + /** Bit mask indicating that the alt key was pressed. */ + public static final int ALT_MASK = InputEvent.ALT_MASK; + + /** The first id number in the range of action id's. */ public static final int ACTION_FIRST = 1001; + + /** The last id number in the range of action id's. */ public static final int ACTION_LAST = 1001; + + /** An event id indicating that an action has occurred. */ public static final int ACTION_PERFORMED = 1001; ! /** ! * A nonlocalized string that gives more specific details of the event cause. ! * ! * @see #getActionCommand() ! * @serial the command for this event ! */ ! private final String actionCommand; ! /** ! * The bitmask of the modifiers that were pressed during the action. ! * ! * @see #getModifiers() ! * @serial modifiers for this event ! */ ! private final int modifiers; ! ! /** ! * The timestamp of this event; usually the same as the underlying input ! * event. ! * ! * @see #getWhen() ! * @serial the timestamp of the event ! * @since 1.4 ! */ ! private final long when; ! ! /** ! * Initializes a new instance of ActionEvent with the ! * specified source, id, and command. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the event source ! * @param id the event id ! * @param command the command string for this action ! * @throws IllegalArgumentException if source is null ! */ ! public ActionEvent(Object source, int id, String command) { ! this(source, id, command, EventQueue.getMostRecentEventTime(), 0); } ! /** ! * Initializes a new instance of ActionEvent with the ! * specified source, id, command, and modifiers. Note that an invalid id ! * leads to unspecified results. ! * ! * @param source the event source ! * @param id the event id ! * @param command the command string for this action ! * @param modifiers the bitwise or of modifier keys down during the action ! * @throws IllegalArgumentException if source is null ! */ ! public ActionEvent(Object source, int id, String command, int modifiers) ! { ! this(source, id, command, EventQueue.getMostRecentEventTime(), modifiers); ! } ! ! /** ! * Initializes a new instance of ActionEvent with the ! * specified source, id, command, and modifiers, and timestamp. Note that ! * an invalid id leads to unspecified results. ! * ! * @param source the event source ! * @param id the event id ! * @param command the command string for this action ! * @param when the timestamp of the event ! * @param modifiers the bitwise or of modifier keys down during the action ! * @throws IllegalArgumentException if source is null ! * @since 1.4 ! */ ! public ActionEvent(Object source, int id, String command, long when, ! int modifiers) { super(source, id); ! actionCommand = command; ! this.when = when; this.modifiers = modifiers; } ! /** ! * Returns the command string associated with this action. ! * ! * @return the command string associated with this action ! */ ! public String getActionCommand() { ! return actionCommand; } ! /** ! * Gets the timestamp of when this action took place. Usually, this ! * corresponds to the timestamp of the underlying InputEvent. ! * ! * @return the timestamp of this action ! * @since 1.4 ! */ ! public long getWhen() ! { ! return when; ! } ! ! /** ! * Returns the keys held down during the action. This value will be a ! * combination of the bit mask constants defined in this class, or 0 if no ! * modifiers were pressed. ! * ! * @return the modifier bits ! */ ! public int getModifiers() { return modifiers; } ! /** ! * Returns a string that identifies the action event. This is in the format ! * "ACTION_PERFORMED,cmd=" + getActionCommand() + ",when=" + getWhen() ! * + ",modifiers=" + <modifier string>, where the modifier ! * string is in the order "Meta", "Ctrl", "Alt", "Shift", "Alt Graph", and ! * "Button1", separated by '+', according to the bits set in getModifiers(). ! * ! * @return a string identifying the event ! */ ! public String paramString() { ! StringBuffer s = new StringBuffer(id == ACTION_PERFORMED ! ? "ACTION_PERFORMED,cmd=" ! : "unknown type,cmd="); ! s.append(actionCommand).append(",when=").append(when).append("modifiers"); ! int len = s.length(); ! s.setLength(len + 1); ! if ((modifiers & META_MASK) != 0) ! s.append("+Meta"); ! if ((modifiers & CTRL_MASK) != 0) ! s.append("+Ctrl"); ! if ((modifiers & ALT_MASK) != 0) ! s.append("+Alt"); ! if ((modifiers & SHIFT_MASK) != 0) ! s.append("+Shift"); ! if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) ! s.append("+Alt Graph"); ! if ((modifiers & InputEvent.BUTTON1_MASK) != 0) ! s.append("+Button1"); ! s.setCharAt(len, '='); ! return s.toString(); } ! } // class ActionEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ActionListener.java gcc-3.3/libjava/java/awt/event/ActionListener.java *** gcc-3.2.3/libjava/java/awt/event/ActionListener.java 2000-03-07 19:55:25.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ActionListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,21 **** ! /* Copyright (C) 1999 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Per Bothner ! * @date Fenruary, 1999. */ ! ! /* Status: Believed complete and correct. */ ! ! public interface ActionListener extends java.util.EventListener { ! public void actionPerformed (ActionEvent e); ! } --- 1,59 ---- ! /* ActionListener.java -- listens for action events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that listen for action events. ! * ! * @author Aaron M. Renn ! * @see ActionEvent ! * @since 1.1 ! * @status updated to 1.4 */ ! public interface ActionListener extends EventListener { ! /** ! * This method is invoked when an action occurs. ! * ! * @param event the ActionEvent that occurred ! */ ! void actionPerformed(ActionEvent e); ! } // interface ActionListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/AdjustmentEvent.java gcc-3.3/libjava/java/awt/event/AdjustmentEvent.java *** gcc-3.2.3/libjava/java/awt/event/AdjustmentEvent.java 2000-07-12 03:32:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/AdjustmentEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,95 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public class AdjustmentEvent extends AWTEvent { public static final int ADJUSTMENT_FIRST = 601; public static final int ADJUSTMENT_LAST = 601; public static final int ADJUSTMENT_VALUE_CHANGED = 601; public static final int BLOCK_DECREMENT = 3; public static final int BLOCK_INCREMENT = 4; public static final int TRACK = 5; - public static final int UNIT_DECREMENT = 2; - public static final int UNIT_INCREMENT = 1; ! public AdjustmentEvent (Adjustable source, int id, int type, int value) { ! super (source, id); ! this.adjType = type; ! this.value = value; } ! public Adjustable getAdjustable () { ! return (Adjustable) source; } ! public int getAdjustmentType () { ! return adjType; } ! public int getValue () { return value; } ! public String paramString () { ! String r; ! switch (id) ! { ! case ADJUSTMENT_VALUE_CHANGED: ! r = "ADJUSTMENT_VALUE_CHANGED"; ! break; ! default: ! r = "unknown id"; ! break; ! } ! ! r += ",adjType="; ! ! switch (adjType) ! { ! case BLOCK_DECREMENT: ! r += "BLOCK_DECREMENT"; ! break; ! case BLOCK_INCREMENT: ! r += "BLOCK_INCREMENT"; ! break; ! case TRACK: ! r += "TRACK"; ! break; ! case UNIT_DECREMENT: ! r += "UNIT_DECREMENT"; ! break; ! case UNIT_INCREMENT: ! r += "UNIT_INCREMENT"; ! break; ! default: ! r += "unknown type"; ! break; ! } ! ! r += ",value=" + value; ! return r; } ! private int adjType; ! private int value; ! } --- 1,222 ---- ! /* AdjustmentEvent.java -- an adjustable value was changed ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.Adjustable; ! import java.awt.AWTEvent; /** ! * This class represents an event that is generated when an adjustable ! * value is changed. ! * ! * @author Aaron M. Renn ! * @see Adjustable ! * @see AdjustmentListener ! * @since 1.1 ! * @status updated to 1.4 */ public class AdjustmentEvent extends AWTEvent { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5700290645205279921L; + + /** This is the first id in the range of ids used by adjustment events. */ public static final int ADJUSTMENT_FIRST = 601; + + /** This is the last id in the range of ids used by adjustment events. */ public static final int ADJUSTMENT_LAST = 601; + + /** This is the id indicating an adjustment value changed. */ public static final int ADJUSTMENT_VALUE_CHANGED = 601; + + /** Adjustment type for unit increments. */ + public static final int UNIT_INCREMENT = 1; + + /** Adjustment type for unit decrements. */ + public static final int UNIT_DECREMENT = 2; + + /** Adjustment type for block decrements. */ public static final int BLOCK_DECREMENT = 3; + + /** Adjustment type for block increments. */ public static final int BLOCK_INCREMENT = 4; + + /** Adjustment type for tracking adjustments. */ public static final int TRACK = 5; ! /** ! * The adjustable object that caused the event. ! * ! * @see #getAdjustable() ! * @serial the cause ! */ ! private final Adjustable adjustable; ! ! /** ! * The type of adjustment, one of {@link #UNIT_INCREMENT}, ! * {@link #UNIT_DECREMENT}, {@link #BLOCK_INCREMENT}, ! * {@link #BLOCK_DECREMENT}, or {@link #TRACK}. ! * ! * @see #getAdjustmentType() ! * @serial the adjustment type ! */ ! private final int adjustmentType; ! ! /** ! * The new value of the adjustable; it should be in the range of the ! * adjustable cause. ! * ! * @see #getValue() ! * @serial the adjustment value ! */ ! private final int value; ! ! /** ! * True if this is in a series of multiple adjustment events. ! * ! * @see #getValueIsAdjusting() ! * @serial true if this is not the last adjustment ! * @since 1.4 ! */ ! private final boolean isAdjusting; ! ! /** ! * Initializes an instance of AdjustmentEvent with the ! * specified source, id, type, and value. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the source of the event ! * @param id the event id ! * @param type the event type, one of the constants of this class ! * @param value the value of the adjustment ! * @throws IllegalArgumentException if source is null ! */ ! public AdjustmentEvent(Adjustable source, int id, int type, int value) { ! this(source, id, type, value, false); } ! /** ! * Initializes an instance of AdjustmentEvent with the ! * specified source, id, type, and value. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the source of the event ! * @param id the event id ! * @param type the event type, one of the constants of this class ! * @param value the value of the adjustment ! * @param isAdjusting if this event is in a chain of adjustments ! * @throws IllegalArgumentException if source is null ! * @since 1.4 ! */ ! public AdjustmentEvent(Adjustable source, int id, int type, int value, ! boolean isAdjusting) { ! super(source, id); ! this.adjustmentType = type; ! this.value = value; ! adjustable = source; ! this.isAdjusting = isAdjusting; } ! /** ! * This method returns the source of the event as an Adjustable. ! * ! * @return the Adjustable source of the event ! */ ! public Adjustable getAdjustable() { ! return adjustable; } ! /** ! * Returns the new value of the adjustable object. ! * ! * @return the value of the event ! */ ! public int getValue() { return value; } ! /** ! * Returns the type of the event, which will be one of ! * {@link #UNIT_INCREMENT}, {@link #UNIT_DECREMENT}, ! * {@link #BLOCK_INCREMENT}, {@link #BLOCK_DECREMENT}, or {@link #TRACK}. ! * ! * @return the type of the event ! */ ! public int getAdjustmentType() { ! return adjustmentType; } ! /** ! * Test if this event is part of a sequence of multiple adjustements. ! * ! * @return true if this is not the last adjustment ! * @since 1.4 ! */ ! public boolean getValueIsAdjusting() ! { ! return isAdjusting; ! } ! ! /** ! * Returns a string that describes the event. This is in the format ! * "ADJUSTMENT_VALUE_CHANGED,adjType=" + <type> + ",value=" ! * + getValue() + ",isAdjusting=" + getValueIsAdjusting(), where ! * type is the name of the constant returned by getAdjustmentType(). ! * ! * @return a string that describes the event ! */ ! public String paramString() ! { ! return (id == ADJUSTMENT_VALUE_CHANGED ! ? "ADJUSTMENT_VALUE_CHANGED,adjType=" : "unknown type,adjType=") ! + (adjustmentType == UNIT_INCREMENT ? "UNIT_INCREMENT,value=" ! : adjustmentType == UNIT_DECREMENT ? "UNIT_DECREMENT,value=" ! : adjustmentType == BLOCK_INCREMENT ? "BLOCK_INCREMENT,value=" ! : adjustmentType == BLOCK_DECREMENT ? "BLOCK_DECREMENT,value=" ! : adjustmentType == TRACK ? "TRACK,value=" : "unknown type,value=") ! + value + ",isAdjusting=" + isAdjusting; ! } ! } // class AdjustmentEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/AdjustmentListener.java gcc-3.3/libjava/java/awt/event/AdjustmentListener.java *** gcc-3.2.3/libjava/java/awt/event/AdjustmentListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/AdjustmentListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,21 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! ! /* Status: Believed complete and correct to JDK 1.2. */ ! ! public interface AdjustmentListener extends java.util.EventListener { ! public void adjustmentValueChanged (AdjustmentEvent e); ! } --- 1,58 ---- ! /* AdjustmentListener.java -- listen for adjustment events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * Interface for classes that listen for adjustment events. ! * ! * @author Aaron M. Renn ! * @since 1.1 ! * @status updated to 1.4 */ ! public interface AdjustmentListener extends EventListener { ! /** ! * This method is called when an adjustable value changes. ! * ! * @param event the AdjustmentEvent that occurred ! */ ! void adjustmentValueChanged(AdjustmentEvent event); ! } // interface AdjustmentListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/AWTEventListener.java gcc-3.3/libjava/java/awt/event/AWTEventListener.java *** gcc-3.2.3/libjava/java/awt/event/AWTEventListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/AWTEventListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,22 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! ! /* Status: Believed complete and correct to JDK 1.2. */ ! ! public interface AWTEventListener extends java.util.EventListener { ! public void eventDispatched (AWTEvent e); ! } --- 1,64 ---- ! /* AWTEventListener.java -- listen for all events in the AWT system ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.AWTEvent; ! import java.util.EventListener; /** ! * This listener is for classes that need to listen to all events in the AWT ! * system. In general, this should not be used except for classes like ! * javax.accessibility or by event recorders. ! * ! * @author Aaron M. Renn ! * @see AWTEvent ! * @see Toolkit#addAWTEventListener(AWTEventListener, long) ! * @see Toolkit#removeAWTEventListener(AWTEventListener) ! * @since 1.2 ! * @status updated to 1.4 */ ! public interface AWTEventListener extends EventListener { ! /** ! * This method is called when any event in the AWT system is dispatched. ! * ! * @param event the AWTEvent that was dispatched ! */ ! void eventDispatched(AWTEvent event); ! } // interface AWTEventListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/AWTEventListenerProxy.java gcc-3.3/libjava/java/awt/event/AWTEventListenerProxy.java *** gcc-3.2.3/libjava/java/awt/event/AWTEventListenerProxy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/AWTEventListenerProxy.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,154 ---- + /* AWTEventListenerProxy.java -- wrapper/filter for AWTEventListener + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.event; + + import java.awt.AWTEvent; + import java.util.EventListenerProxy; + + /** + * This class allows adding an AWTEventListener which only pays attention to + * a specific event mask. + * + * @author Eric Blake + * @see Toolkit + * @see EventListenerProxy + * @since 1.4 + * @status updated to 1.4 + */ + public class AWTEventListenerProxy extends EventListenerProxy + implements AWTEventListener + { + /** The event mask. */ + private final long mask; + + /** + * Construct an AWT Event Listener which only listens to events in the given + * mask, passing the work on to the real listener. + * + * @param eventMask the mask of events to listen to + * @param listener the wrapped listener + */ + public AWTEventListenerProxy(long eventMask, AWTEventListener listener) + { + super(listener); + mask = eventMask; + } + + /** + * Forwards events on to the delegate if they meet the event mask. + * + * @param event the property change event to filter + * @throws NullPointerException if the delegate this was created with is null + */ + public void eventDispatched(AWTEvent event) + { + int id = event == null ? 0 : event.getID(); + if (((mask & AWTEvent.ACTION_EVENT_MASK) != 0 + && event instanceof ActionEvent) + || ((mask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0 + && event instanceof AdjustmentEvent) + || ((mask & AWTEvent.COMPONENT_EVENT_MASK) != 0 + && event instanceof ComponentEvent + && (id >= ComponentEvent.COMPONENT_FIRST + && id <= ComponentEvent.COMPONENT_LAST)) + || ((mask & AWTEvent.CONTAINER_EVENT_MASK) != 0 + && event instanceof ContainerEvent) + || ((mask & AWTEvent.FOCUS_EVENT_MASK) != 0 + && event instanceof FocusEvent) + || ((mask & AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) != 0 + && event instanceof HierarchyEvent + && (id == HierarchyEvent.ANCESTOR_MOVED + || id == HierarchyEvent.ANCESTOR_RESIZED)) + || ((mask & AWTEvent.HIERARCHY_EVENT_MASK) != 0 + && event instanceof HierarchyEvent + && id == HierarchyEvent.HIERARCHY_CHANGED) + || ((mask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0 + && event instanceof InputMethodEvent) + || ((mask & AWTEvent.INVOCATION_EVENT_MASK) != 0 + && event instanceof InvocationEvent) + || ((mask & AWTEvent.ITEM_EVENT_MASK) != 0 + && event instanceof ItemEvent) + || ((mask & AWTEvent.KEY_EVENT_MASK) != 0 + && event instanceof KeyEvent) + || ((mask & AWTEvent.MOUSE_EVENT_MASK) != 0 + && event instanceof MouseEvent + && (id == MouseEvent.MOUSE_PRESSED + || id == MouseEvent.MOUSE_RELEASED + || id == MouseEvent.MOUSE_CLICKED + || id == MouseEvent.MOUSE_ENTERED + || id == MouseEvent.MOUSE_EXITED)) + || ((mask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0 + && event instanceof MouseEvent + && (id == MouseEvent.MOUSE_MOVED + || id == MouseEvent.MOUSE_DRAGGED)) + || ((mask & AWTEvent.MOUSE_WHEEL_EVENT_MASK) != 0 + && event instanceof MouseWheelEvent) + || ((mask & AWTEvent.PAINT_EVENT_MASK) != 0 + && event instanceof PaintEvent) + || ((mask & AWTEvent.TEXT_EVENT_MASK) != 0 + && event instanceof TextEvent) + || ((mask & AWTEvent.WINDOW_EVENT_MASK) != 0 + && event instanceof WindowEvent + && (id == WindowEvent.WINDOW_OPENED + || id == WindowEvent.WINDOW_CLOSING + || id == WindowEvent.WINDOW_CLOSED + || id == WindowEvent.WINDOW_ICONIFIED + || id == WindowEvent.WINDOW_DEICONIFIED + || id == WindowEvent.WINDOW_ACTIVATED + || id == WindowEvent.WINDOW_DEACTIVATED)) + || ((mask & AWTEvent.WINDOW_FOCUS_EVENT_MASK) != 0 + && event instanceof WindowEvent + && (id == WindowEvent.WINDOW_GAINED_FOCUS + || id == WindowEvent.WINDOW_LOST_FOCUS)) + || ((mask & AWTEvent.WINDOW_STATE_EVENT_MASK) != 0 + && event instanceof WindowEvent + && id == WindowEvent.WINDOW_STATE_CHANGED)) + ((AWTEventListener) getListener()).eventDispatched(event); + } + + /** + * This returns the event mask associated with this listener. + * + * @return the event mask + */ + public long getEventMask() + { + return mask; + } + } // class AWTEventListenerProxy diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ComponentAdapter.java gcc-3.3/libjava/java/awt/event/ComponentAdapter.java *** gcc-3.2.3/libjava/java/awt/event/ComponentAdapter.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ComponentAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,35 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public abstract class ComponentAdapter implements ComponentListener { ! public void componentHidden (ComponentEvent e) { } ! public void componentMoved (ComponentEvent e) { } ! public void componentResized (ComponentEvent e) { } ! public void componentShown (ComponentEvent e) { } ! } --- 1,97 ---- ! /* ComponentAdapter.java -- convenience class for writing component listeners ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; /** ! * This class implements ComponentListener and implements ! * all methods with empty bodies. This allows a listener interested in ! * implementing only a subset of the ComponentListener ! * interface to extend this class and override only the desired methods. ! * ! * @author Aaron M. Renn ! * @see ComponentEvent ! * @see ComponentListener ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class ComponentAdapter implements ComponentListener { ! /** ! * Do nothing default constructor for subclasses. ! */ ! public ComponentAdapter() { } ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void componentResized(ComponentEvent event) { } ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void componentMoved(ComponentEvent event) { } ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void componentShown(ComponentEvent event) { } ! ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void componentHidden(ComponentEvent event) ! { ! } ! } // class ComponentAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ComponentEvent.java gcc-3.3/libjava/java/awt/event/ComponentEvent.java *** gcc-3.2.3/libjava/java/awt/event/ComponentEvent.java 2000-07-12 03:32:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ComponentEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,61 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public class ComponentEvent extends AWTEvent { public static final int COMPONENT_FIRST = 100; ! public static final int COMPONENT_HIDDEN = 103; public static final int COMPONENT_LAST = 103; public static final int COMPONENT_MOVED = 100; public static final int COMPONENT_RESIZED = 101; public static final int COMPONENT_SHOWN = 102; ! public ComponentEvent (Component source, int id) { super(source, id); } ! public Component getComponent () { ! return (Component) source; } ! public String paramString () { ! String r; switch (id) { ! case COMPONENT_HIDDEN: ! r = "COMPONENT_HIDDEN"; ! break; ! case COMPONENT_MOVED: ! r = "COMPONENT_MOVED"; ! break; ! case COMPONENT_RESIZED: ! r = "COMPONENT_RESIZED"; ! break; ! case COMPONENT_SHOWN: ! r = "COMPONENT_SHOWN"; ! break; ! default: ! r = "unknown id"; ! break; ! } ! return r; } ! } --- 1,137 ---- ! /* ComponentEvent.java -- notification of events for components ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.AWTEvent; ! import java.awt.Component; /** ! * This class is for events generated when a component is moved, resized, ! * hidden, or shown. These events normally do not need to be handled by the ! * application, since the AWT system automatically takes care of them. This ! * is also the superclass for other events on components, but ! * ComponentListeners ignore such subclasses. ! * ! * @author Aaron M. Renn ! * @see ComponentAdapter ! * @see ComponentListener ! * @since 1.1 ! * @status updated to 1.4 */ public class ComponentEvent extends AWTEvent { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 8101406823902992965L; + + /** This is the first id in the range of ids used by this class. */ public static final int COMPONENT_FIRST = 100; ! ! /** This is the last id in the range of ids used by this class. */ public static final int COMPONENT_LAST = 103; + + /** This id indicates that a component was moved. */ public static final int COMPONENT_MOVED = 100; + + /** This id indicates that a component was resized. */ public static final int COMPONENT_RESIZED = 101; + + /** This id indicates that a component was shown. */ public static final int COMPONENT_SHOWN = 102; ! /** This id indicates that a component was hidden. */ ! public static final int COMPONENT_HIDDEN = 103; ! ! /** ! * Initializes a new instance of ComponentEvent with the ! * specified source and id. Note that an invalid id leads to unspecified ! * results. ! * ! * @param source the source of the event ! * @param id the event id ! * @throws IllegalArgumentException if source is null ! */ ! public ComponentEvent(Component source, int id) { super(source, id); } ! /** ! * This method returns the event source as a Component. If the ! * source has subsequently been modified to a non-Component, this returns ! * null. ! * ! * @return the event source as a Component, or null ! */ ! public Component getComponent() { ! return source instanceof Component ? (Component) source : null; } ! /** ! * This method returns a string identifying this event. This is the field ! * name of the id type, and for COMPONENT_MOVED or COMPONENT_RESIZED, the ! * new bounding box of the component. ! * ! * @return a string identifying this event ! */ ! public String paramString() { ! // Unlike Sun, we don't throw NullPointerException or ClassCastException ! // when source was illegally changed. switch (id) { ! case COMPONENT_MOVED: ! return "COMPONENT_MOVED " ! + (source instanceof Component ! ? ((Component) source).getBounds() : (Object) ""); ! case COMPONENT_RESIZED: ! return "COMPONENT_RESIZED " ! + (source instanceof Component ! ? ((Component) source).getBounds() : (Object) ""); ! case COMPONENT_SHOWN: ! return "COMPONENT_SHOWN"; ! case COMPONENT_HIDDEN: ! return "COMPONENT_HIDDEN"; ! default: ! return "unknown type"; ! } } ! } // class ComponentEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ComponentListener.java gcc-3.3/libjava/java/awt/event/ComponentListener.java *** gcc-3.2.3/libjava/java/awt/event/ComponentListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ComponentListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,24 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! /* Status: Believed complete and correct to JDK 1.2. */ ! public interface ComponentListener extends java.util.EventListener ! { ! public void componentHidden (ComponentEvent e); ! public void componentMoved (ComponentEvent e); ! public void componentResized (ComponentEvent e); ! public void componentShown (ComponentEvent e); ! } --- 1,84 ---- ! /* ComponentListener.java -- receive all events for a component ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that receive all events from a component. ! * Normally it is not necessary to process these events since the AWT ! * handles them internally, taking all appropriate actions. To watch a subset ! * of these events, use a ComponentAdapter. ! * ! * @author Aaron M. Renn ! * @see ComponentAdapter ! * @see ComponentEvent ! * @since 1.1 ! * @status updated to 1.4 */ + public interface ComponentListener extends EventListener + { + /** + * This method is called when the component is resized. + * + * @param event the ComponentEvent indicating the resize + */ + void componentResized(ComponentEvent event); ! /** ! * This method is called when the component is moved. ! * ! * @param event the ComponentEvent indicating the move ! */ ! void componentMoved(ComponentEvent event); ! /** ! * This method is called when the component is made visible. ! * ! * @param event the ComponentEvent indicating the visibility ! */ ! void componentShown(ComponentEvent event); ! ! /** ! * This method is called when the component is hidden. ! * ! * @param event the ComponentEvent indicating the visibility ! */ ! void componentHidden(ComponentEvent event); ! } // interface ComponentListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ContainerAdapter.java gcc-3.3/libjava/java/awt/event/ContainerAdapter.java *** gcc-3.2.3/libjava/java/awt/event/ContainerAdapter.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ContainerAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,27 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public abstract class ContainerAdapter implements ContainerListener { ! public void componentAdded (ContainerEvent e) { } ! public void componentRemoved (ContainerEvent e) { } ! } --- 1,79 ---- ! /* ContainerAdapter.java -- convenience class for writing container listeners ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; /** ! * This class implements ContainerListener and implements ! * all methods with empty bodies. This allows a listener interested in ! * implementing only a subset of the ContainerListener ! * interface to extend this class and override only the desired methods. ! * ! * @author Aaron M. Renn ! * @see ContainerEvent ! * @see ContainerListener ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class ContainerAdapter implements ContainerListener { ! /** ! * Do nothing default constructor for subclasses. ! */ ! public ContainerAdapter() { } ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void componentAdded(ContainerEvent event) { } ! ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void componentRemoved(ContainerEvent event) ! { ! } ! } // class ContainerAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ContainerEvent.java gcc-3.3/libjava/java/awt/event/ContainerEvent.java *** gcc-3.2.3/libjava/java/awt/event/ContainerEvent.java 2001-04-22 03:05:38.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ContainerEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,64 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public class ContainerEvent extends ComponentEvent { ! public static final int COMPONENT_ADDED = 300; ! public static final int COMPONENT_REMOVED = 301; public static final int CONTAINER_FIRST = 300; public static final int CONTAINER_LAST = 301; ! /** @specnote In JDK1.2 and 1.3, source is a Component. */ ! public ContainerEvent (Component source, int id, Component child) { ! super (source, id); this.child = child; } ! public Component getChild () { ! return child; } ! public Container getContainer () { ! return (Container) source; } ! public String paramString () { ! String r; ! switch (id) ! { ! case COMPONENT_ADDED: ! r = "COMPONENT_ADDED"; ! break; ! case COMPONENT_REMOVED: ! r = "COMPONENT_REMOVED"; ! break; ! default: ! r = "unknown id"; ! break; ! ! } ! r += ",child=" + child; ! return r; } ! ! private Component child; ! } --- 1,135 ---- ! /* ContainerEvent.java -- components added/removed from a container ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.Component; ! import java.awt.Container; /** ! * This event is generated when a component is added or removed from a ! * container. Applications do not ordinarily need to handle these events ! * since the AWT system handles them internally. ! * ! * @author Aaron M. Renn ! * @see ContainerAdapter ! * @see ContainerListener ! * @since 1.1 ! * @status updated to 1.4 */ public class ContainerEvent extends ComponentEvent { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -4114942250539772041L; ! ! /** This is the first id in the id range used by this class. */ public static final int CONTAINER_FIRST = 300; + + /** This is the last id in the id range used by this class. */ public static final int CONTAINER_LAST = 301; ! /** This id indicates a component was added to the container. */ ! public static final int COMPONENT_ADDED = 300; ! ! /** This id indicates a component was removed from the container. */ ! public static final int COMPONENT_REMOVED = 301; ! ! /** ! * The non-null child component that was added or removed. ! * ! * @serial the child component that changed ! */ ! private final Component child; ! ! /** ! * Initializes a new instance of ContainerEvent with the ! * specified source and id. Additionally, the affected child component ! * is also passed as a parameter. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the source container of the event ! * @param id the event id ! * @param child the child component affected by this event ! * @throws IllegalArgumentException if source is null ! */ ! public ContainerEvent(Component source, int id, Component child) { ! super(source, id); this.child = child; } ! /** ! * Returns the source of this event as a Container. ! * ! * @return the source of the event ! * @throws ClassCastException if the source is changed to a non-Container ! */ ! public Container getContainer() { ! return (Container) source; } ! /** ! * This method returns the child object that was added or removed from ! * the container. ! * ! * @return the child object added or removed ! */ ! public Component getChild() { ! return child; } ! /** ! * This method returns a string identifying this event. It is formatted as: ! * (getID() == COMPONENT_ADDED ? "COMPONENT_ADDED" ! * : "COMPONENT_REMOVED") + ",child=" + getChild().getName(). ! * ! * @return a string identifying this event ! */ ! public String paramString() { ! // Unlike Sun, we don't throw NullPointerException if child is illegally ! // null. ! return (id == COMPONENT_ADDED ? "COMPONENT_ADDED,child=" ! : id == COMPONENT_REMOVED ? "COMPONENT_REMOVED,child=" ! : "unknown type,child=") + (child == null ? "" : child.getName()); } ! } // class ContainerEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ContainerListener.java gcc-3.3/libjava/java/awt/event/ContainerListener.java *** gcc-3.2.3/libjava/java/awt/event/ContainerListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ContainerListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,22 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! ! /* Status: Believed complete and correct to JDK 1.2. */ ! ! public interface ContainerListener extends java.util.EventListener { ! public void componentAdded (ContainerEvent e); ! public void componentRemoved (ContainerEvent e); ! } --- 1,70 ---- ! /* ContainerListener.java -- listen for container events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to listen for all events from ! * container objects. This is normally not necessary since the AWT system ! * listens for and processes these events. To watch a subset of these events, ! * use a ContainerAdapter. ! * ! * @author Aaron M. Renn ! * @see ContainerAdapter ! * @see ContainerEvent ! * @since 1.1 ! * @status updated to 1.4 */ ! public interface ContainerListener extends EventListener { ! /** ! * This method is called when a component is added to the container. ! * ! * @param event the ContainerEvent indicating component addition ! */ ! void componentAdded(ContainerEvent event); ! ! /** ! * This method is called when a component is removed from the container. ! * ! * @param event the ContainerEvent indicating component removal ! */ ! void componentRemoved(ContainerEvent event); ! } // interface ContainerListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/FocusAdapter.java gcc-3.3/libjava/java/awt/event/FocusAdapter.java *** gcc-3.2.3/libjava/java/awt/event/FocusAdapter.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/FocusAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,27 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public abstract class FocusAdapter implements FocusListener { ! public void focusGained (FocusEvent e) { } ! public void focusLost (FocusEvent e) { } ! } --- 1,79 ---- ! /* FocusAdapter.java -- convenience class for writing focus listeners ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; /** ! * This class implements FocusListener and implements all ! * methods with empty bodies. This allows a listener interested in ! * implementing only a subset of the FocusListener interface to ! * extend this class and override only the desired methods. ! * ! * @author Aaron M. Renn ! * @see FocusEvent ! * @see FocusListener ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class FocusAdapter implements FocusListener { ! /** ! * Do nothing default constructor for subclasses. ! */ ! public FocusAdapter() { } ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void focusGained(FocusEvent event) { } ! ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void focusLost(FocusEvent event) ! { ! } ! } // class FocusAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/FocusEvent.java gcc-3.3/libjava/java/awt/event/FocusEvent.java *** gcc-3.2.3/libjava/java/awt/event/FocusEvent.java 2000-12-04 02:27:20.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/FocusEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,63 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public class FocusEvent extends ComponentEvent { public static final int FOCUS_FIRST = 1004; ! public static final int FOCUS_GAINED = 1004; public static final int FOCUS_LAST = 1005; public static final int FOCUS_LOST = 1005; ! public FocusEvent (Component source, int id) { ! super (source, id); ! this.temporary = false; } ! public FocusEvent (Component source, int id, boolean temporary) { ! super (source, id); ! this.temporary = temporary; } ! public boolean isTemporary () { return temporary; } ! public String paramString () { ! String r = ""; ! switch (id) ! { ! case FOCUS_GAINED: ! r += "FOCUS_GAINED"; ! break; ! case FOCUS_LOST: ! r += "FOCUS_LOST"; ! break; ! default: ! r += "unknown id"; ! break; ! } ! r += (temporary ? "temporary" : "permanent"); ! return r; } ! private boolean temporary; ! } --- 1,181 ---- ! /* FocusEvent.java -- generated for a focus change ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.Component; /** ! * This class represents an event generated when a focus change occurs for a ! * component. There are both temporary changes, such as when focus is stolen ! * during a sroll then returned, and permanent changes, such as when the user ! * TABs through focusable components. ! * ! * @author Aaron M. Renn ! * @see FocusAdapter ! * @see FocusListener ! * @since 1.1 ! * @status updated to 1.4 */ public class FocusEvent extends ComponentEvent { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 523753786457416396L; + + /** This is the first id in the range of ids used by this class. */ public static final int FOCUS_FIRST = 1004; ! ! /** This is the last id in the range of ids used by this class. */ public static final int FOCUS_LAST = 1005; + + /** This is the event id for a focus gained event. */ + public static final int FOCUS_GAINED = 1004; + + /** This is the event id for a focus lost event. */ public static final int FOCUS_LOST = 1005; ! /** ! * Indicates whether or not the focus change is temporary. ! * ! * @see #isTemporary() ! * @serial true if the focus change is temporary ! */ ! private final boolean temporary; ! ! /** ! * The other component which is giving up or stealing focus from this ! * component, if known. ! * ! * @see #getOppositeComponent() ! * @serial the component with the opposite focus event, or null ! * @since 1.4 ! */ ! private final Component opposite; ! ! /** ! * Initializes a new instance of FocusEvent with the ! * specified source, id, temporary status, and opposite counterpart. Note ! * that an invalid id leads to unspecified results. ! * ! * @param source the component that is gaining or losing focus ! * @param id the event id ! * @param temporary true if the focus change is temporary ! * @param opposite the component receiving the opposite focus event, or null ! * @throws IllegalArgumentException if source is null ! */ ! public FocusEvent(Component source, int id, boolean temporary, ! Component opposite) { ! super(source, id); ! this.temporary = temporary; ! this.opposite = opposite; } ! /** ! * Initializes a new instance of FocusEvent with the ! * specified source, id, and temporary status. Note that an invalid id ! * leads to unspecified results. ! * ! * @param source the component that is gaining or losing focus ! * @param id the event id ! * @param temporary true if the focus change is temporary ! * @throws IllegalArgumentException if source is null ! */ ! public FocusEvent(Component source, int id, boolean temporary) { ! this(source, id, temporary, null); } ! /** ! * Initializes a new instance of FocusEvent with the ! * specified source and id. Note that an invalid id leads to unspecified ! * results. ! * ! * @param source the component that is gaining or losing focus ! * @param id the event id ! * @throws IllegalArgumentException if source is null ! */ ! public FocusEvent(Component source, int id) ! { ! this(source, id, false, null); ! } ! ! /** ! * This method tests whether or not the focus change is temporary or ! * permanent. ! * ! * @return true if the focus change is temporary ! */ ! public boolean isTemporary() { return temporary; } ! /** ! * Returns the component which received the opposite focus event. If this ! * component gained focus, the opposite lost focus; likewise if this ! * component is giving up focus, the opposite is gaining it. If this ! * information is unknown, perhaps because the opposite is a native ! * application, this returns null. ! * ! * @return the component with the focus opposite, or null ! * @since 1.4 ! */ ! public Component getOppositeComponent() { ! return opposite; } ! /** ! * Returns a string identifying this event. This is formatted as: ! * (getID() == FOCUS_GAINED ? "FOCUS_GAINED" : "FOCUS_LOST") ! * + (isTemporary() ? ",temporary," : ",permanent,") + "opposite=" ! * + getOppositeComponent(). ! * ! * @return a string identifying this event ! */ ! public String paramString() ! { ! return (id == FOCUS_GAINED ? "FOCUS_GAINED" ! : id == FOCUS_LOST ? "FOCUS_LOST" : "unknown type") ! + (temporary ? ",temporary,opposite=" : ",permanent,opposite=") ! + opposite; ! } ! } // class FocusEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/FocusListener.java gcc-3.3/libjava/java/awt/event/FocusListener.java *** gcc-3.2.3/libjava/java/awt/event/FocusListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/FocusListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,22 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! ! /* Status: Believed complete and correct to JDK 1.2. */ ! ! public interface FocusListener extends java.util.EventListener { ! public void focusGained (FocusEvent e); ! public void focusLost (FocusEvent e); ! } --- 1,69 ---- ! /* FocusListener.java -- listen for focus changes ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to be notified of changes of ! * keyboard focus for a component. To watch a subset of these events, use a ! * FocusAdapter. ! * ! * @author Aaron M. Renn ! * @see FocusAdapter ! * @see FocusEvent ! * @since 1.1 ! * @status updated to 1.4 */ ! public interface FocusListener extends EventListener { ! /** ! * This method is called when a component gains the keyboard focus. ! * ! * @param event the FocusEvent indicating that focus was gained ! */ ! void focusGained(FocusEvent event); ! ! /** ! * This method is invoked when a component loses the keyboard focus. ! * ! * @param event the FocusEvent indicating that focus was lost ! */ ! void focusLost(FocusEvent event); ! } // interface FocusListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/HierarchyBoundsAdapter.java gcc-3.3/libjava/java/awt/event/HierarchyBoundsAdapter.java *** gcc-3.2.3/libjava/java/awt/event/HierarchyBoundsAdapter.java 2002-01-22 22:40:07.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/HierarchyBoundsAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* HierarchyBoundsAdapter.java -- convenience class for writing listeners ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,55 **** package java.awt.event; /** ! * @since 1.3 * @author Bryce McKinlay */ - - /* Status: Believed complete and correct. */ - public abstract class HierarchyBoundsAdapter implements HierarchyBoundsListener { public void ancestorMoved(HierarchyEvent e) { } ! public void ancestorResized(HierarchyEvent e) { } ! } --- 38,78 ---- package java.awt.event; /** ! * This class implements HierarchyBoundsListener and implements ! * all methods with empty bodies. This allows a listener interested in ! * implementing only a subset of the HierarchyBoundsListener ! * interface to extend this class and override only the desired methods. ! * * @author Bryce McKinlay + * @see HierarchyBoundsListener + * @see HierarchyEvent + * @since 1.3 + * @status updated to 1.4 */ public abstract class HierarchyBoundsAdapter implements HierarchyBoundsListener { + /** + * Do nothing default constructor for subclasses. + */ + public HierarchyBoundsAdapter() + { + } + + /** + * Implements this method from the interface with an empty body. + * + * @param event the event, ignored in this implementation + */ public void ancestorMoved(HierarchyEvent e) { } ! ! /** ! * Implements this method from the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ public void ancestorResized(HierarchyEvent e) { } ! } // class HierarchyBoundsAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/HierarchyBoundsListener.java gcc-3.3/libjava/java/awt/event/HierarchyBoundsListener.java *** gcc-3.2.3/libjava/java/awt/event/HierarchyBoundsListener.java 2002-01-22 22:40:07.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/HierarchyBoundsListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* HierarchyBoundsListener.java -- listens to bounds changes of parents ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,50 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.event; /** ! * @since 1.3 * @author Bryce McKinlay */ ! ! /* Status: Believed complete and correct. */ ! ! public interface HierarchyBoundsListener extends java.util.EventListener { ! public void ancestorMoved(HierarchyEvent e); ! public void ancestorResized(HierarchyEvent e); ! } --- 35,70 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.event; + import java.util.EventListener; + /** ! * This listens for changes in an ancestors size or location. Normally it is ! * not necessary to process these events since the AWT handles them ! * internally, taking all appropriate actions. To watch a subset of these ! * events, use a HierarchyBoundsAdapter. ! * * @author Bryce McKinlay + * @see HierarchyBoundsAdapter + * @see HierarchyEvent + * @since 1.3 + * @status updated to 1.4 */ ! public interface HierarchyBoundsListener extends EventListener { ! /** ! * Called when an ancestor component of the source is moved. ! * ! * @param e the event describing the ancestor's motion ! */ ! void ancestorMoved(HierarchyEvent e); ! ! /** ! * Called when an ancestor component is resized. ! * ! * @param e the event describing the ancestor's resizing ! */ ! void ancestorResized(HierarchyEvent e); ! } // interface HierarchyBoundsListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/HierarchyEvent.java gcc-3.3/libjava/java/awt/event/HierarchyEvent.java *** gcc-3.2.3/libjava/java/awt/event/HierarchyEvent.java 2002-01-22 22:40:07.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/HierarchyEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* HierarchyEvent.java -- generated for a change in hierarchy ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** package java.awt.event; *** 38,124 **** import java.awt.*; /** ! * @since 1.3 * @author Bryce McKinlay */ - - /* Status: thought to be complete and correct. */ - public class HierarchyEvent extends AWTEvent { ! public static final int PARENT_CHANGED = 1 << 0, ! DISPLAYABILITY_CHANGED = 1 << 1, ! SHOWING_CHANGED = 1 << 2, ! HIERARCHY_FIRST = 1400, ! HIERARCHY_CHANGED = 1400, ! ANCESTOR_MOVED = 1401, ! ANCESTOR_RESIZED = 1402, ! HIERARCHY_LAST = 1402; ! ! /* Serialized fields from the serialization spec. */ ! Component changed; ! Container changedParent; ! long changeFlags = 0; ! public HierarchyEvent(Component source, int id, Component changed, ! Container changedParent) { ! super(source, id); ! this.changed = changed; ! this.changedParent = changedParent; } ! ! public HierarchyEvent(Component source, int id, Component changed, Container changedParent, long changeFlags) { ! super(source,id); this.changed = changed; this.changedParent = changedParent; this.changeFlags = changeFlags; } ! public Component getComponent() { ! return (Component) source; } ! public Component getChanged() { return changed; } ! public Container getChangedParent() { return changedParent; } ! public long getChangeFlags() { return changeFlags; } ! public String paramString() { ! String r; switch (id) { ! case HIERARCHY_CHANGED: ! r = "HIERARCHY_CHANGED"; ! break; ! ! case ANCESTOR_MOVED: ! r = "ANCESTOR_MOVED"; ! break; ! ! case ANCESTOR_RESIZED: ! r = "ANCESTOR_RESIZED"; ! break; ! ! default: ! return "unknown type"; } ! ! r += "(" + changed + "," + changedParent + ")"; ! return r; } ! } --- 39,249 ---- import java.awt.*; /** ! * This class represents an event generated for an ancestor component which ! * may affect this component. These events normally do not need to be handled ! * by the application, since the AWT system automatically takes care of them. ! * ! *

        There are two types of hierarchy events. The first type is handled by ! * HierarchyListener, and includes addition or removal of an ancestor, or ! * an ancestor changing its on-screen status (visible and/or displayble). The ! * second type is handled by HierarchyBoundsListener, and includes resizing ! * or moving of an ancestor. ! * * @author Bryce McKinlay + * @see HierarchyListener + * @see HierarchyBoundsAdapter + * @see HierarchyBoundsListener + * @since 1.3 + * @status updated to 1.4 */ public class HierarchyEvent extends AWTEvent { ! /** ! * Compatible with JDK 1.3+. ! */ ! private static final long serialVersionUID = -5337576970038043990L; ! ! /** This is the first id in the range of ids used by this class. */ ! public static final int HIERARCHY_FIRST = 1400; ! ! /** This id indicates that the hierarchy tree changed. */ ! public static final int HIERARCHY_CHANGED = 1400; ! ! /** This id indicates that an ancestor was moved. */ ! public static final int ANCESTOR_MOVED = 1401; ! ! /** This id indicates that an ancestor was resized. */ ! public static final int ANCESTOR_RESIZED = 1402; ! ! /** This is the last id in the range of ids used by this class. */ ! public static final int HIERARCHY_LAST = 1402; ! ! /** This indicates that the HIERARCHY_CHANGED is a changed parent. */ ! public static final int PARENT_CHANGED = 1; ! ! /** ! * This indicates that the HIERARCHY_CHANGED is caused by a change in ! * displayability. ! * ! * @see Component#isDisplayable() ! * @see Component#addNotify() ! * @see Component#removeNotify() ! */ ! public static final int DISPLAYABILITY_CHANGED = 2; ! ! /** ! * This indicates that the HIERARCHY_CHANGED is a changed visibility. ! * ! * @see Component#isShowing() ! * @see Component#addNotify() ! * @see Component#removeNotify() ! * @see Component#show() ! * @see Component#hide() ! */ ! public static final int SHOWING_CHANGED = 4; ! ! /** ! * The component at the top of the changed hierarchy. ! * ! * @serial the top component changed ! */ ! private final Component changed; ! ! /** ! * The parent of this component, either before or after the change depending ! * on the type of change. ! * ! * @serial the parent component changed ! */ ! private final Container changedParent; ! ! /** ! * The bitmask of HIERARCHY_CHANGED event types. ! * ! * @serial the change flags ! */ ! private final long changeFlags; ! ! /** ! * Initializes a new instance of HierarchyEvent with the ! * specified parameters. Note that an invalid id leads to unspecified ! * results. ! * ! * @param source the component whose hierarchy changed ! * @param id the event id ! * @param changed the top component in the tree of changed hierarchy ! * @param changedParent the updated parent of this object ! * @throws IllegalArgumentException if source is null ! */ public HierarchyEvent(Component source, int id, Component changed, ! Container changedParent) { ! this(source, id, changed, changedParent, 0); } ! ! /** ! * Initializes a new instance of HierarchyEvent with the ! * specified parameters. Note that an invalid id leads to unspecified ! * results. ! * ! * @param source the component whose hierarchy changed ! * @param id the event id ! * @param changed the top component in the tree of changed hierarchy ! * @param changedParent the updated parent of this object ! * @param changeFlags the bitmask of specific HIERARCHY_CHANGED events ! * @throws IllegalArgumentException if source is null ! */ ! public HierarchyEvent(Component source, int id, Component changed, Container changedParent, long changeFlags) { ! super(source, id); this.changed = changed; this.changedParent = changedParent; this.changeFlags = changeFlags; } ! ! /** ! * This method returns the event source as a Component. If the ! * source has subsequently been modified to a non-Component, this returns ! * null. ! * ! * @return the event source as a Component, or null ! */ public Component getComponent() { ! return source instanceof Component ? (Component) source : null; } ! ! /** ! * Returns the component at the top of the hierarchy which changed. ! * ! * @return the top changed component ! */ public Component getChanged() { return changed; } ! ! /** ! * Returns the parent of the component listed in getChanged(). ! * If the cause of this event was Container.add, this is the ! * new parent; if the cause was Container.remove, this is the ! * old parent; otherwise it is the unchanged parent. ! * ! * @return the parent container of the changed component ! */ public Container getChangedParent() { return changedParent; } ! ! /** ! * If this is a HIERARCHY_CHANGED event, this returns a bitmask of the ! * types of changes that took place. ! * ! * @return the bitwise or of hierarchy change types, or 0 ! * @see #PARENT_CHANGED ! * @see #DISPLAYABILITY_CHANGED ! * @see #SHOWING_CHANGED ! */ public long getChangeFlags() { return changeFlags; } ! ! /** ! * This method returns a string identifying this event. This is the field ! * name of the id type, followed by a parenthesized listing of the changed ! * component and its parent container. In addition, if the type is ! * HIERARCHY_CHANGED, the flags preceed the changed component, in the ! * order PARENT_CHANGED, DISPLAYABILITY_CHANGED, and SHOWING_CHANGED. ! * ! * @return a string identifying this event ! */ public String paramString() { ! StringBuffer r = new StringBuffer(); switch (id) { ! case HIERARCHY_CHANGED: ! r.append("HIERARCHY_CHANGED ("); ! if ((changeFlags & PARENT_CHANGED) != 0) ! r.append("PARENT_CHANGED,"); ! if ((changeFlags & DISPLAYABILITY_CHANGED) != 0) ! r.append("DISPLAYABILITY_CHANGED,"); ! if ((changeFlags & SHOWING_CHANGED) != 0) ! r.append("SHOWING_CHANGED,"); ! break; ! case ANCESTOR_MOVED: ! r.append("ANCESTOR_MOVED ("); ! break; ! case ANCESTOR_RESIZED: ! r.append("ANCESTOR_RESIZED ("); ! break; ! default: ! return "unknown type"; } ! r.append(changed).append(',').append(changedParent).append(')'); ! return r.toString(); } ! } // class HierarchyEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/HierarchyListener.java gcc-3.3/libjava/java/awt/event/HierarchyListener.java *** gcc-3.2.3/libjava/java/awt/event/HierarchyListener.java 2002-01-22 22:40:07.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/HierarchyListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* HierarchyListener.java -- listens to changes in the component hierarchy ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,49 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.event; /** ! * @since 1.3 * @author Bryce McKinlay */ ! ! /* Status: Believed complete and correct. */ ! ! public interface HierarchyListener extends java.util.EventListener { ! public void hierarchyChanged(HierarchyEvent e); ! } --- 35,62 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.event; + import java.util.EventListener; + /** ! * This listens for changes in the hierarchy tree of components. Normally it is ! * not necessary to process these events since the AWT handles them ! * internally, taking all appropriate actions. ! * * @author Bryce McKinlay + * @see HierarchyEvent + * @since 1.3 + * @status updated to 1.4 */ ! public interface HierarchyListener extends EventListener { ! /** ! * Called when the hierarchy of this component changes. Use ! * getChangeFlags() on the event to see what exactly changed. ! * ! * @param e the event describing the change ! */ ! void hierarchyChanged(HierarchyEvent e); ! } // interface HierarchyListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/InputEvent.java gcc-3.3/libjava/java/awt/event/InputEvent.java *** gcc-3.2.3/libjava/java/awt/event/InputEvent.java 2002-01-28 06:34:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/InputEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,78 **** ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; - import java.awt.*; ! /* Status: Believed complete and correct to JDK 1.2. */ public abstract class InputEvent extends ComponentEvent { ! public static final int ALT_GRAPH_MASK = 32; public static final int ALT_MASK = 8; ! public static final int BUTTON1_MASK = 16; public static final int BUTTON2_MASK = 8; public static final int BUTTON3_MASK = 4; - public static final int CTRL_MASK = 2; - public static final int META_MASK = 4; - public static final int SHIFT_MASK = 1; ! InputEvent (Component source, int id) // Not public { super(source, id); } ! public boolean isShiftDown () { ! return (modifiers & SHIFT_MASK) != 0; } ! public boolean isControlDown () { ! return (modifiers & CTRL_MASK) != 0; } ! public boolean isMetaDown () { ! return (modifiers & META_MASK) != 0; } ! public boolean isAltDown () { ! return (modifiers & ALT_MASK) != 0; } ! public boolean isAltGraphDown () { ! return (modifiers & ALT_GRAPH_MASK) != 0; } ! public long getWhen () { return when; } ! public int getModifiers () { ! return modifiers; } ! public boolean isConsumed () { ! return consumed; } ! public void consume () { - /* FIXME */ consumed = true; } ! long when; ! int modifiers; ! } --- 1,379 ---- ! /* InputEvent.java -- common superclass of component input events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! import java.awt.Component; ! import gnu.java.awt.EventModifier; + /** + * This is the common superclass for all component input classes. These are + * passed to listeners before the component, so that listeners can consume + * the event before it does its default behavior. + * + * @author Aaron M. Renn + * @see KeyEvent + * @see KeyAdapter + * @see MouseEvent + * @see MouseAdapter + * @see MouseMotionAdapter + * @see MouseWheelEvent + * @since 1.1 + * @status updated to 1.4 + */ public abstract class InputEvent extends ComponentEvent { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -2482525981698309786L; ! ! /** ! * This is the bit mask which indicates the shift key is down. It is ! * recommended that SHIFT_DOWN_MASK be used instead. ! * ! * @see #SHIFT_DOWN_MASK ! */ ! public static final int SHIFT_MASK = 1; ! ! /** ! * This is the bit mask which indicates the control key is down. It is ! * recommended that CTRL_DOWN_MASK be used instead. ! * ! * @see #CTRL_DOWN_MASK ! */ ! public static final int CTRL_MASK = 2; ! ! /** ! * This is the bit mask which indicates the meta key is down. It is ! * recommended that META_DOWN_MASK be used instead. ! * ! * @see #META_DOWN_MASK ! */ ! public static final int META_MASK = 4; ! ! /** ! * This is the bit mask which indicates the alt key is down. It is ! * recommended that ALT_DOWN_MASK be used instead. ! * ! * @see #ALT_DOWN_MASK ! */ public static final int ALT_MASK = 8; ! ! /** ! * This is the bit mask which indicates the alt-graph modifier is in effect. ! * It is recommended that ALT_GRAPH_DOWN_MASK be used instead. ! * ! * @see #ALT_GRAPH_DOWN_MASK ! */ ! public static final int ALT_GRAPH_MASK = 0x20; ! ! /** ! * This bit mask indicates mouse button one is down. It is recommended that ! * BUTTON1_DOWN_MASK be used instead. ! * ! * @see #BUTTON1_DOWN_MASK ! */ ! public static final int BUTTON1_MASK = 0x10; ! ! /** ! * This bit mask indicates mouse button two is down. It is recommended that ! * BUTTON2_DOWN_MASK be used instead. ! * ! * @see #BUTTON2_DOWN_MASK ! */ public static final int BUTTON2_MASK = 8; + + /** + * This bit mask indicates mouse button three is down. It is recommended + * that BUTTON3_DOWN_MASK be used instead. + * + * @see #BUTTON3_DOWN_MASK + */ public static final int BUTTON3_MASK = 4; ! /** ! * The SHIFT key extended modifier. ! * ! * @since 1.4 ! */ ! public static final int SHIFT_DOWN_MASK = 0x0040; ! ! /** ! * The CTRL key extended modifier. ! * ! * @since 1.4 ! */ ! public static final int CTRL_DOWN_MASK = 0x0080; ! ! /** ! * The META key extended modifier. ! * ! * @since 1.4 ! */ ! public static final int META_DOWN_MASK = 0x0100; ! ! /** ! * The ALT key extended modifier. ! * ! * @since 1.4 ! */ ! public static final int ALT_DOWN_MASK = 0x0200; ! ! /** ! * The mouse button1 key extended modifier. ! * ! * @since 1.4 ! */ ! public static final int BUTTON1_DOWN_MASK = 0x0400; ! ! /** ! * The mouse button2 extended modifier. ! * ! * @since 1.4 ! */ ! public static final int BUTTON2_DOWN_MASK = 0x0800; ! ! /** ! * The mouse button3 extended modifier. ! * ! * @since 1.4 ! */ ! public static final int BUTTON3_DOWN_MASK = 0x1000; ! ! /** ! * The ALT_GRAPH key extended modifier. ! * ! * @since 1.4 ! */ ! public static final int ALT_GRAPH_DOWN_MASK = 0x2000; ! ! /** The mask to convert new to old, package visible for use in subclasses. */ ! static final int CONVERT_MASK ! = EventModifier.NEW_MASK & ~(BUTTON2_DOWN_MASK | BUTTON3_DOWN_MASK); ! ! /** ! * The timestamp when this event occurred. ! * ! * @see #getWhen() ! * @serial the timestamp ! */ ! private final long when; ! ! /** ! * The modifiers in effect for this event. Package visible for use by ! * subclasses. The old style (bitmask 0x3f) should not be mixed with the ! * new style (bitmasks 0xffffffc0). ! * ! * @see #getModifiers() ! * @see MouseEvent ! * @serial the modifier state, stored in the new style ! */ ! int modifiers; ! ! /** ! * Initializes a new instance of InputEvent with the specified ! * source, id, timestamp, and modifiers. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the source of the event ! * @param id the event id ! * @param when the timestamp when the event occurred ! * @param modifiers the modifiers in effect for this event, old or new style ! * @throws IllegalArgumentException if source is null ! */ ! InputEvent(Component source, int id, long when, int modifiers) { super(source, id); + this.when = when; + this.modifiers = EventModifier.extend(modifiers); } ! /** ! * This method tests whether or not the shift key was down during the event. ! * ! * @return true if the shift key is down ! */ ! public boolean isShiftDown() { ! return (modifiers & SHIFT_DOWN_MASK) != 0; } ! /** ! * This method tests whether or not the control key was down during the ! * event. ! * ! * @return true if the control key is down ! */ ! public boolean isControlDown() { ! return (modifiers & CTRL_DOWN_MASK) != 0; } ! /** ! * This method tests whether or not the meta key was down during the event. ! * ! * @return true if the meta key is down ! */ ! public boolean isMetaDown() { ! return (modifiers & META_DOWN_MASK) != 0; } ! /** ! * This method tests whether or not the alt key was down during the event. ! * ! * @return true if the alt key is down ! */ ! public boolean isAltDown() { ! return (modifiers & ALT_DOWN_MASK) != 0; } ! /** ! * This method tests whether or not the alt-graph modifier was in effect ! * during the event. ! * ! * @return true if the alt-graph modifier is down ! */ ! public boolean isAltGraphDown() { ! return (modifiers & ALT_GRAPH_DOWN_MASK) != 0; } ! /** ! * This method returns the timestamp when this event occurred. ! * ! * @return the timestamp when this event occurred ! */ ! public long getWhen() { return when; } ! /** ! * This method returns the old-style modifiers in effect for this event. ! * Note that this is ambiguous between button2 and alt, and between ! * button3 and meta. Also, code which generated these modifiers tends to ! * only list the modifier that just changed, even if others were down at ! * the time. Consider using getModifiersEx instead. This will be a union ! * of the bit masks defined in this class that are applicable to the event. ! * ! * @return the modifiers in effect for this event ! * @see #getModifiersEx() ! */ ! public int getModifiers() { ! return EventModifier.revert(modifiers); } ! /** ! * Returns the extended modifiers (new-style) for this event. This represents ! * the state of all modal keys and mouse buttons at the time of the event, ! * and does not suffer from the problems mentioned in getModifiers. ! * ! *

        For an example of checking multiple modifiers, this code will return ! * true only if SHIFT and BUTTON1 were pressed and CTRL was not: ! *

        !    * int onmask = InputEvent.SHIFT_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK;
        !    * int offmask = InputEvent.CTRL_DOWN_MASK;
        !    * return (event.getModifiersEx() & (onmask | offmask)) == onmask;
        !    * 
        ! * ! * @return the bitwise or of all modifiers pressed during the event ! * @since 1.4 ! */ ! public int getModifiersEx() { ! return modifiers; } ! /** ! * Consumes this event. A consumed event is not processed further by the AWT ! * system. ! */ ! public void consume() { consumed = true; } ! /** ! * This method tests whether or not this event has been consumed. ! * ! * @return true if this event has been consumed ! */ ! public boolean isConsumed() ! { ! return consumed; ! } ! ! /** ! * Convert the extended modifier bitmask into a String, such as "Shift" or ! * "Ctrl+Button1". ! * ! * XXX Sun claims this can be localized via the awt.properties file - how ! * do we implement that? ! * ! * @return a string representation of the modifiers in this bitmask ! * @since 1.4 ! */ ! public static String getModifiersExText(int modifiers) ! { ! modifiers &= EventModifier.NEW_MASK; ! if (modifiers == 0) ! return ""; ! StringBuffer s = new StringBuffer(); ! if ((modifiers & META_DOWN_MASK) != 0) ! s.append("Meta+"); ! if ((modifiers & CTRL_DOWN_MASK) != 0) ! s.append("Ctrl+"); ! if ((modifiers & ALT_DOWN_MASK) != 0) ! s.append("Alt+"); ! if ((modifiers & SHIFT_DOWN_MASK) != 0) ! s.append("Shift+"); ! if ((modifiers & ALT_GRAPH_DOWN_MASK) != 0) ! s.append("Alt Graph+"); ! if ((modifiers & BUTTON1_DOWN_MASK) != 0) ! s.append("Button1+"); ! if ((modifiers & BUTTON2_DOWN_MASK) != 0) ! s.append("Button2+"); ! if ((modifiers & BUTTON3_DOWN_MASK) != 0) ! s.append("Button3+"); ! return s.substring(0, s.length() - 1); ! } ! } // class InputEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/InputMethodEvent.java gcc-3.3/libjava/java/awt/event/InputMethodEvent.java *** gcc-3.2.3/libjava/java/awt/event/InputMethodEvent.java 2000-07-12 03:32:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/InputMethodEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,68 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; - import java.awt.*; ! /* A very incomplete placeholder. */ public class InputMethodEvent extends AWTEvent { ! public static final int CARET_POSITION_CHANGED = 1101; public static final int INPUT_METHOD_FIRST = 1100; ! public static final int INPUT_METHOD_LAST = 1101; public static final int INPUT_METHOD_TEXT_CHANGED = 1100; ! /* ! public InputMethodEvent (Component source, int id, ! AttributedCharacterIterator text, ! int committedCharacterCount, TextHitInfo caret, ! TextHitInfo visiblePosition) { ! if (id < INPUT_METHOD_FIRST ! || id > INPUT_METHOD_LAST ! || (id == CARET_POSITION_CHANGED && text != null) ! || committedCharacterCount < 0 ! || (committedCharacterCount ! > text.getEndIndex () - text.getBeginIndex ())) ! throw new IllegalArgumentException (); } ! public InputMethodEvent (Component source, int id, TextHitInfo caret, ! TextHitInfo visiblePosition); ! public void consume (); ! public TextHitInfo getCaret (); ! public int getCommittedCharacterCount (); ! public AttributedCharacterIterator getText (); ! public TextHitInfo getVisiblePosition (); ! public boolean isConsumed (); ! public String paramString () { ! String r; ! switch (id) { ! case CARET_POSITION_CHANGED: ! r = "CARET_POSITION_CHANGED"; ! break; ! case INPUT_METHOD_TEXT_CHANGED: ! r = "INPUT_METHOD_TEXT_CHANGED"; ! break; } ! r += ""; // FIXME ! return r; } - */ ! // FIXME: this is just to let it compile. ! private InputMethodEvent () { ! super (null, -1); } ! } --- 1,303 ---- ! /* InputMethodEvent.java -- events from a text input method ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! import java.awt.AWTEvent; ! import java.awt.Component; ! import java.awt.EventQueue; ! import java.awt.font.TextHitInfo; ! import java.io.IOException; ! import java.io.ObjectInputStream; ! import java.text.AttributedCharacterIterator; + /** + * This class is for event generated by change in a text input method. + * + * @author Aaron M. Renn + * @see InputMethodListener + * @since 1.2 + * @status updated to 1.4 + */ public class InputMethodEvent extends AWTEvent { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 4727190874778922661L; ! ! /** This is the first id in the range of event ids used by this class. */ public static final int INPUT_METHOD_FIRST = 1100; ! ! /** This event id indicates that the text in the input method has changed. */ public static final int INPUT_METHOD_TEXT_CHANGED = 1100; ! /** This event id indicates that the input method curor point has changed. */ ! public static final int CARET_POSITION_CHANGED = 1101; ! ! /** This is the last id in the range of event ids used by this class. */ ! public static final int INPUT_METHOD_LAST = 1101; ! ! /** ! * The timestamp when this event was created. ! * ! * @serial the timestamp ! * @since 1.4 ! */ ! private long when; ! ! /** The input method text. */ ! private final transient AttributedCharacterIterator text; ! ! /** The number of committed characters in the text. */ ! private final transient int committedCharacterCount; ! ! /** The caret. */ ! private final transient TextHitInfo caret; ! ! /** The most important position to be visible. */ ! private final transient TextHitInfo visiblePosition; ! ! /** ! * Initializes a new instance of InputMethodEvent with the ! * specified source, id, timestamp, text, char count, caret, and visible ! * position. ! * ! * @param source the source that generated the event ! * @param id the event id ! * @param when the timestamp of the event ! * @param text the input text ! * @param committedCharacterCount the number of committed characters ! * @param caret the caret position ! * @param visiblePosition the position most important to make visible ! * @throws IllegalArgumentException if source is null, id is invalid, id is ! * CARET_POSITION_CHANGED and text is non-null, or if ! * committedCharacterCount is out of range ! * @since 1.4 ! */ ! public InputMethodEvent(Component source, int id, long when, ! AttributedCharacterIterator text, ! int committedCharacterCount, TextHitInfo caret, ! TextHitInfo visiblePosition) { ! super(source, id); ! this.when = when; ! this.text = text; ! this.committedCharacterCount = committedCharacterCount; ! this.caret = caret; ! this.visiblePosition = visiblePosition; ! if (id < INPUT_METHOD_FIRST || id > INPUT_METHOD_LAST ! || (id == CARET_POSITION_CHANGED && text != null) ! || committedCharacterCount < 0 ! || (committedCharacterCount ! > (text == null ? 0 : text.getEndIndex() - text.getBeginIndex()))) ! throw new IllegalArgumentException(); } ! /** ! * Initializes a new instance of InputMethodEvent with the ! * specified source, id, text, char count, caret, and visible position. ! * ! * @param source the source that generated the event ! * @param id the event id ! * @param text the input text ! * @param committedCharacterCount the number of committed characters ! * @param caret the caret position ! * @param visiblePosition the position most important to make visible ! * @throws IllegalArgumentException if source is null, id is invalid, id is ! * CARET_POSITION_CHANGED and text is non-null, or if ! * committedCharacterCount is out of range ! * @since 1.4 ! */ ! public InputMethodEvent(Component source, int id, ! AttributedCharacterIterator text, ! int committedCharacterCount, TextHitInfo caret, ! TextHitInfo visiblePosition) ! { ! this(source, id, EventQueue.getMostRecentEventTime(), text, ! committedCharacterCount, caret, visiblePosition); ! } ! /** ! * Initializes a new instance of InputMethodEvent with the ! * specified source, id, caret, and visible position, and with a null ! * text and char count. ! * ! * @param source the source that generated the event ! * @param id the event id ! * @param caret the caret position ! * @param visiblePosition the position most important to make visible ! * @throws IllegalArgumentException if source is null or id is invalid ! * @since 1.4 ! */ ! public InputMethodEvent(Component source, int id, TextHitInfo caret, ! TextHitInfo visiblePosition) ! { ! this(source, id, EventQueue.getMostRecentEventTime(), null, 0, caret, ! visiblePosition); ! } ! /** ! * This method returns the input method text. This can be null, ! * and will always be null for CARET_POSITION_CHANGED events. ! * Characters from 0 to getCommittedCharacterCount()-1 have ! * been committed, the remaining characters are composed text. ! * ! * @return the input method text, or null ! */ ! public AttributedCharacterIterator getText() { ! return text; ! } ! ! /** ! * Returns the number of committed characters in the input method text. ! * ! * @return the number of committed characters in the input method text ! */ ! public int getCommittedCharacterCount() ! { ! return committedCharacterCount; ! } ! ! /** ! * Returns the caret position. The caret offset is relative to the composed ! * text of the most recent INPUT_METHOD_TEXT_CHANGED event. ! * ! * @return the caret position, or null ! */ ! public TextHitInfo getCaret() ! { ! return caret; ! } ! ! /** ! * Returns the position that is most important to be visible, or null if ! * such a hint is not necessary. The caret offset is relative to the composed ! * text of the most recent INPUT_METHOD_TEXT_CHANGED event. ! * ! * @return the position that is most important to be visible ! */ ! public TextHitInfo getVisiblePosition() ! { ! return visiblePosition; ! } ! ! /** ! * This method consumes the event. A consumed event is not processed ! * in the default manner by the component that generated it. ! */ ! public void consume() ! { ! consumed = true; ! } ! ! /** ! * This method tests whether or not this event has been consumed. ! * ! * @return true if the event has been consumed ! */ ! public boolean isConsumed() ! { ! return consumed; ! } ! ! /** ! * Return the timestamp of this event. ! * ! * @return the timestamp ! * @since 1.4 ! */ ! public long getWhen() ! { ! return when; ! } ! ! /** ! * This method returns a string identifying the event. This contains the ! * event ID, the committed and composed characters separated by '+', the ! * number of committed characters, the caret, and the visible position. ! * ! * @return a string identifying the event ! */ ! public String paramString() ! { ! StringBuffer s ! = new StringBuffer(80 + (text == null ? 0 ! : text.getEndIndex() - text.getBeginIndex())); ! s.append(id == INPUT_METHOD_TEXT_CHANGED ? "INPUT_METHOD_TEXT_CHANGED, " ! : "CARET_POSITION_CHANGED, "); ! if (text == null) ! s.append("no text, 0 characters committed, caret: "); ! else { ! s.append('"'); ! int i = text.getBeginIndex(); ! int j = committedCharacterCount; ! while (--j >= 0) ! s.append(text.setIndex(i++)); ! s.append("\" + \""); ! j = text.getEndIndex() - i; ! while (--j >= 0) ! s.append(text.setIndex(i++)); ! s.append("\", ").append(committedCharacterCount) ! .append(" characters committed, caret: "); } ! s.append(caret == null ? (Object) "no caret" : caret).append(", ") ! .append(visiblePosition == null ? (Object) "no visible position" ! : visiblePosition); ! return s.toString(); } ! /** ! * Reads in the object from a serial stream, updating when to ! * {@link EventQueue#getMostRecentEventTime()} if necessary. ! * ! * @param s the stream to read from ! * @throws IOException if deserialization fails ! * @throws ClassNotFoundException if deserialization fails ! * @serialData default, except for updating when ! */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException { ! s.defaultReadObject(); ! if (when == 0) ! when = EventQueue.getMostRecentEventTime(); } ! } // class InputMethodEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/InputMethodListener.java gcc-3.3/libjava/java/awt/event/InputMethodListener.java *** gcc-3.2.3/libjava/java/awt/event/InputMethodListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/InputMethodListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,22 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! ! /* Status: Believed complete and correct to JDK 1.2. */ ! ! public interface InputMethodListener extends java.util.EventListener { ! public void caretPositionChanged (InputMethodEvent e); ! public void inputMethodTextChanged (InputMethodEvent e); ! } --- 1,69 ---- ! /* InputMethodListener.java -- listen for input method events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to receive events from an input ! * method. For a text component to use input methods, it must also install ! * an InputMethodRequests handler. ! * ! * @author Aaron M. Renn ! * @see InputMethodEvent ! * @see InputMethodRequests ! * @since 1.2 ! * @status updated to 1.4 */ ! public interface InputMethodListener extends EventListener { ! /** ! * This method is called when the text is changed. ! * ! * @param event the InputMethodEvent indicating the text change ! */ ! void inputMethodTextChanged(InputMethodEvent event); ! ! /** ! * This method is called when the cursor position within the text is changed. ! * ! * @param event the InputMethodEvent indicating the change ! */ ! void caretPositionChanged(InputMethodEvent event); ! } // interface InputMethodListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/InvocationEvent.java gcc-3.3/libjava/java/awt/event/InvocationEvent.java *** gcc-3.2.3/libjava/java/awt/event/InvocationEvent.java 2000-07-15 04:42:47.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/InvocationEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,96 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed to be complete and correct. */ - public class InvocationEvent extends AWTEvent implements ActiveEvent { ! public static final int INVOCATION_DEFAULT = 1200; public static final int INVOCATION_FIRST = 1200; public static final int INVOCATION_LAST = 1200; ! protected InvocationEvent (Object source, int id, Runnable runnable, ! Object notifier, boolean catchExceptions) { ! super (source, id); ! this.runnable = runnable; ! this.notifier = notifier; ! this.catchExceptions = catchExceptions; } ! public InvocationEvent (Object source, Runnable runnable) { ! super (source, INVOCATION_DEFAULT); ! this.runnable = runnable; } ! public InvocationEvent(Object source, Runnable runnable, Object notifier, ! boolean catchExceptions) { ! super (source, INVOCATION_DEFAULT); this.runnable = runnable; this.notifier = notifier; this.catchExceptions = catchExceptions; } ! public void dispatch () { - Exception e = null; if (catchExceptions) try ! { ! runnable.run (); ! } ! catch (Exception x) ! { ! exception = x; ! } else ! runnable.run (); ! if (notifier != null) ! { ! synchronized (notifier) ! { ! notifier.notifyAll (); ! } ! } } ! public Exception getException () { return exception; } ! public String paramString () { ! String r; ! if (id == INVOCATION_DEFAULT) ! r = "INVOCATION_DEFAULT"; ! else ! r = "unknown type"; ! ! r += ",runnable=" + runnable + ",notifier=" + notifier + ! ",catchExceptions=" + catchExceptions; ! return r; } ! protected boolean catchExceptions; ! protected Object notifier; ! protected Runnable runnable; ! ! private Exception exception; ! } --- 1,232 ---- ! /* InvocationEvent.java -- call a runnable when dispatched ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.ActiveEvent; ! import java.awt.AWTEvent; ! import java.awt.EventQueue; /** ! * This event executes {@link Runnable#run()} of a target object when it is ! * dispatched. This class is used by calls to invokeLater and ! * invokeAndWait, so client code can use this fact to avoid ! * writing special-casing AWTEventListener objects. ! * ! * @author Aaron M. Renn ! * @see ActiveEvent ! * @see EventQueue#invokeLater(Runnable) ! * @see EventQueue#invokeAndWait(Runnable) ! * @see AWTEventListener ! * @since 1.2 ! * @status updated to 1.4 */ public class InvocationEvent extends AWTEvent implements ActiveEvent { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 436056344909459450L; ! ! /** This is the first id in the range of event ids used by this class. */ public static final int INVOCATION_FIRST = 1200; + + /** This is the default id for this event type. */ + public static final int INVOCATION_DEFAULT = 1200; + + /** This is the last id in the range of event ids used by this class. */ public static final int INVOCATION_LAST = 1200; ! /** ! * This is the Runnable object to call when dispatched. ! * ! * @serial the runnable to execute ! */ ! protected Runnable runnable; ! ! /** ! * This is the object to call notifyAll() on when ! * the call to run() returns, or null if no ! * object is to be notified. ! * ! * @serial the object to notify ! */ ! protected Object notifier; ! ! /** ! * This variable is set to true if exceptions are caught ! * and stored in a variable during the call to run(), otherwise ! * exceptions are ignored and propagate up. ! * ! * @serial true to catch exceptions ! */ ! protected boolean catchExceptions; ! ! /** ! * This is the caught exception thrown in the run() method. It ! * is null if exceptions are ignored, the run method hasn't completed, or ! * there were no exceptions. ! * ! * @serial the caught exception, if any ! */ ! private Exception exception; ! ! /** ! * The timestamp when this event was created. ! * ! * @see #getWhen() ! * @serial the timestamp ! * @since 1.4 ! */ ! private final long when = EventQueue.getMostRecentEventTime(); ! ! /** ! * Initializes a new instance of InvocationEvent with the ! * specified source and runnable. ! * ! * @param source the source of the event ! * @param runnable the Runnable object to invoke ! * @throws IllegalArgumentException if source is null ! */ ! public InvocationEvent(Object source, Runnable runnable) { ! this(source, INVOCATION_DEFAULT, runnable, null, false); } ! /** ! * Initializes a new instance of InvocationEvent with the ! * specified source, runnable, and notifier. It will also catch exceptions ! * if specified. If notifier is non-null, this will call notifyAll() on ! * the object when the runnable is complete. If catchExceptions is true, ! * this traps any exception in the runnable, otherwise it lets the exception ! * propagate up the Event Dispatch thread. ! * ! * @param source the source of the event ! * @param runnable the Runnable object to invoke ! * @param notifier the object to notify, or null ! * @param catchExceptions true to catch exceptions from the runnable ! */ ! public InvocationEvent(Object source, Runnable runnable, Object notifier, ! boolean catchExceptions) { ! this(source, INVOCATION_DEFAULT, runnable, notifier, catchExceptions); } ! /** ! * Initializes a new instance of InvocationEvent with the ! * specified source, runnable, and notifier. It will also catch exceptions ! * if specified. If notifier is non-null, this will call notifyAll() on ! * the object when the runnable is complete. If catchExceptions is true, ! * this traps any exception in the runnable, otherwise it lets the exception ! * propagate up the Event Dispatch thread. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the source of the event ! * @param id the event id ! * @param runnable the Runnable object to invoke ! * @param notifier the object to notify, or null ! * @param catchExceptions true to catch exceptions from the runnable ! */ ! protected InvocationEvent(Object source, int id, Runnable runnable, ! Object notifier, boolean catchExceptions) { ! super(source, id); this.runnable = runnable; this.notifier = notifier; this.catchExceptions = catchExceptions; } ! /** ! * This method calls the run() method of the runnable, traps ! * exceptions if instructed to do so, and calls notifyAll() ! * on any notifier if all worked successfully. ! */ ! public void dispatch() { if (catchExceptions) try ! { ! runnable.run(); ! } ! catch (Exception e) ! { ! exception = e; ! } else ! runnable.run(); if (notifier != null) ! notifier.notifyAll(); } ! /** ! * This method returns the exception that occurred during the execution of ! * the runnable, or null if not exception was thrown or ! * exceptions were not caught. ! * ! * @return the exception thrown by the runnable ! */ ! public Exception getException() { return exception; } ! /** ! * Gets the timestamp of when this event was created. ! * ! * @return the timestamp of this event ! * @since 1.4 ! */ ! public long getWhen() { ! return when; } ! /** ! * This method returns a string identifying this event. This is formatted as: ! * "INVOCATION_DEFAULT,runnable=" + runnable + ",notifier=" + notifier ! * + ",catchExceptions=" + catchExceptions + ",when=" + getWhen(). ! * ! * @return a string identifying this event ! */ ! public String paramString() ! { ! return (id == INVOCATION_DEFAULT ? "INVOCATION_DEFAULT,runnable=" ! : "unknown type,runnable=") + runnable + ",notifier=" + notifier ! + ",catchExceptions=" + catchExceptions + ",when=" + when; ! } ! } // class InvocationEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ItemEvent.java gcc-3.3/libjava/java/awt/event/ItemEvent.java *** gcc-3.2.3/libjava/java/awt/event/ItemEvent.java 2000-07-12 03:32:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ItemEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,81 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public class ItemEvent extends AWTEvent { ! public static final int DESELECTED = 2; public static final int ITEM_FIRST = 701; public static final int ITEM_LAST = 701; public static final int ITEM_STATE_CHANGED = 701; public static final int SELECTED = 1; ! public ItemEvent (ItemSelectable source, int id, Object item, int sc) { ! super (source, id); this.item = item; ! this.stateChange = sc; } ! public Object getItem () { ! return item; } ! public ItemSelectable getItemSelectable () { ! return (ItemSelectable) source; } ! public int getStateChange () { return stateChange; } ! public String paramString () { ! String r; ! switch (id) ! { ! case ITEM_STATE_CHANGED: ! r = "ITEM_STATE_CHANGED"; ! break; ! default: ! r = "unknown id"; ! break; ! } ! ! r += ",item=" + item + ",stateChange="; ! switch (stateChange) ! { ! case SELECTED: ! r += "SELECTED"; ! break; ! case DESELECTED: ! r += "DESELECTED"; ! break; ! default: ! r += "unknown"; ! break; ! } ! ! return r; } ! ! private Object item; ! private int stateChange; ! } --- 1,155 ---- ! /* ItemEvent.java -- event for item state changes ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.AWTEvent; ! import java.awt.ItemSelectable; /** ! * This event is generated when a selection item changes state. This is an ! * abstraction that distills a large number of individual mouse or keyboard ! * events into a simpler "item selected" and "item deselected" events. ! * ! * @author Aaron M. Renn ! * @see ItemSelectable ! * @see ItemListener ! * @since 1.1 ! * @status updated to 1.4 */ public class ItemEvent extends AWTEvent { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -608708132447206933L; ! ! /** This is the first id in the event id range used by this class. */ public static final int ITEM_FIRST = 701; + + /** This is the last id in the event id range used by this class. */ public static final int ITEM_LAST = 701; + + /** This event id indicates a state change occurred. */ public static final int ITEM_STATE_CHANGED = 701; + + /** This type indicates that the item was selected. */ public static final int SELECTED = 1; ! /** This type indicates that the item was deselected. */ ! public static final int DESELECTED = 2; ! ! /** ! * The item affected by this event. ! * ! * @serial the item of the selection ! */ ! private final Object item; ! ! /** ! * The state change direction, one of {@link #SELECTED} or ! * {@link #DESELECTED}. ! * ! * @serial the selection state ! */ ! private final int stateChange; ! ! /** ! * Initializes a new instance of ItemEvent with the specified ! * source, id, and state change constant. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the source of the event ! * @param id the event id ! * @param item the item affected by the state change ! * @param stateChange one of {@link #SELECTED} or {@link #DESELECTED} ! */ ! public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) { ! super(source, id); this.item = item; ! this.stateChange = stateChange; } ! /** ! * This method returns the event source as an ItemSelectable. ! * ! * @return the event source as an ItemSelected ! * @throws ClassCastException if source is changed to a non-ItemSelectable ! */ ! public ItemSelectable getItemSelectable() { ! return (ItemSelectable) source; } ! /** ! * Returns the item affected by this state change. ! * ! * @return the item affected by this state change ! */ ! public Object getItem() { ! return item; } ! /** ! * Returns the type of state change, either {@link #SELECTED} or ! * {@link #DESELECTED}. ! * ! * @return the type of state change ! */ ! public int getStateChange() { return stateChange; } ! /** ! * Returns a string identifying this event. This is in the format: ! * "ITEM_STATE_CHANGED,item=" + item + ",stateChange=" ! * + (getStateChange() == DESELECTED ? "DESELECTED" : "SELECTED"). ! * ! * @return a string identifying this event ! */ ! public String paramString() { ! return (id == ITEM_STATE_CHANGED ? "ITEM_STATE_CHANGED,item=" ! : "unknown type,item=") + item + ",stateChange=" ! + (stateChange == SELECTED ? "SELECTED" ! : stateChange == DESELECTED ? "DESELECTED" : "unknown type"); } ! } // class ItemEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/ItemListener.java gcc-3.3/libjava/java/awt/event/ItemListener.java *** gcc-3.2.3/libjava/java/awt/event/ItemListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/ItemListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,21 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! ! /* Status: Believed complete and correct to JDK 1.2. */ ! ! public interface ItemListener extends java.util.EventListener { ! public void itemStateChanged (ItemEvent e); ! } --- 1,61 ---- ! /* ItemListener.java -- listen for item events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to receive events when an ! * item's selection state changes. ! * ! * @author Aaron M. Renn ! * @see ItemSelectable ! * @see ItemEvent ! * @since 1.1 ! * @status updated to 1.4 */ ! public interface ItemListener extends EventListener { ! /** ! * This method is called when an item's state is changed. ! * ! * @param event the ItemEvent indicating the change ! */ ! void itemStateChanged(ItemEvent event); ! } // interface ItemListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/KeyAdapter.java gcc-3.3/libjava/java/awt/event/KeyAdapter.java *** gcc-3.2.3/libjava/java/awt/event/KeyAdapter.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/KeyAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,31 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public abstract class KeyAdapter implements KeyListener { ! public void keyPressed (KeyEvent w) { } ! public void keyReleased (KeyEvent w) { } ! public void keyTyped (KeyEvent w) { } ! } --- 1,88 ---- ! /* KeyAdapter.java -- convenience class for writing key listeners ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; /** ! * This class implements KeyListener and implements all methods ! * with empty bodies. This allows a listener interested in implementing only ! * a subset of the KeyListener interface to extend this class ! * and override only the desired methods. ! * ! * @author Aaron M. Renn ! * @see KeyEvent ! * @see KeyListener ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class KeyAdapter implements KeyListener { ! /** ! * Do nothing default constructor for subclasses. ! */ ! public KeyAdapter() { } ! /** ! * Implements this method in the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void keyTyped(KeyEvent event) { } ! /** ! * Implements this method in the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void keyPressed(KeyEvent event) { } ! ! /** ! * Implements this method in the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void keyReleased(KeyEvent event) ! { ! } ! } // class KeyAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/KeyEvent.java gcc-3.3/libjava/java/awt/event/KeyEvent.java *** gcc-3.2.3/libjava/java/awt/event/KeyEvent.java 2000-12-04 02:27:20.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/KeyEvent.java 2002-11-10 00:16:43.000000000 +0000 *************** *** 1,275 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; - import java.awt.*; ! /* Status: still incomplete. */ public class KeyEvent extends InputEvent { ! public static final char CHAR_UNDEFINED = 0;; public static final int KEY_FIRST = 400; public static final int KEY_LAST = 402; public static final int KEY_PRESSED = 401; public static final int KEY_RELEASED = 402; ! public static final int KEY_TYPED = 400; ! public static final int VK_0 = 48; ! public static final int VK_1 = 49; ! public static final int VK_2 = 50; ! public static final int VK_3 = 51; ! public static final int VK_4 = 52; ! public static final int VK_5 = 53; ! public static final int VK_6 = 54; ! public static final int VK_7 = 55; ! public static final int VK_8 = 56; ! public static final int VK_9 = 57; ! public static final int VK_A = 65; ! public static final int VK_ACCEPT = 30; ! public static final int VK_ADD = 107; ! public static final int VK_AGAIN = 65481; ! public static final int VK_ALL_CANDIDATES = 256; ! public static final int VK_ALPHANUMERIC = 240; ! public static final int VK_ALT = 18; ! public static final int VK_ALT_GRAPH = 65406; ! public static final int VK_AMPERSAND = 150; ! public static final int VK_ASTERISK = 151; ! public static final int VK_AT = 512; ! public static final int VK_B = 66; ! public static final int VK_BACK_QUOTE = 192; ! public static final int VK_BACK_SLASH = 92; ! public static final int VK_BACK_SPACE = 8; ! public static final int VK_BRACELEFT = 161; ! public static final int VK_BRACERIGHT = 162; ! public static final int VK_C = 67; public static final int VK_CANCEL = 3; ! public static final int VK_CAPS_LOCK = 20; ! public static final int VK_CIRCUMFLEX = 514; public static final int VK_CLEAR = 12; ! public static final int VK_CLOSE_BRACKET = 93; ! public static final int VK_CODE_INPUT = 258; ! public static final int VK_COLON = 513; ! public static final int VK_COMMA = 44; ! public static final int VK_COMPOSE = 65312; public static final int VK_CONTROL = 17; ! public static final int VK_CONVERT = 28; ! public static final int VK_COPY = 65485; ! public static final int VK_CUT = 65489; ! public static final int VK_D = 68; ! public static final int VK_DEAD_ABOVEDOT = 134; ! public static final int VK_DEAD_ABOVERING = 136; ! public static final int VK_DEAD_ACUTE = 129; ! public static final int VK_DEAD_BREVE = 133; ! public static final int VK_DEAD_CARON = 138; ! public static final int VK_DEAD_CEDILLA = 139; ! public static final int VK_DEAD_CIRCUMFLEX = 130; ! public static final int VK_DEAD_DIAERESIS = 135; ! public static final int VK_DEAD_DOUBLEACUTE = 137; ! public static final int VK_DEAD_GRAVE = 128; ! public static final int VK_DEAD_IOTA = 141; ! public static final int VK_DEAD_MACRON = 132; ! public static final int VK_DEAD_OGONEK = 140; ! public static final int VK_DEAD_SEMIVOICED_SOUND = 143; ! public static final int VK_DEAD_TILDE = 131; ! public static final int VK_DEAD_VOICED_SOUND = 142; public static final int VK_DECIMAL = 110; ! public static final int VK_DELETE = 127; public static final int VK_DIVIDE = 111; ! public static final int VK_DOLLAR = 515; ! public static final int VK_DOWN = 40; ! public static final int VK_E = 69; ! public static final int VK_END = 35; ! public static final int VK_ENTER = 10; ! public static final int VK_EQUALS = 61; ! public static final int VK_ESCAPE = 27; ! public static final int VK_EURO_SIGN = 516; ! public static final int VK_EXCLAMATION_MARK = 517; ! public static final int VK_F = 70; public static final int VK_F1 = 112; public static final int VK_F10 = 121; public static final int VK_F11 = 122; public static final int VK_F12 = 123; public static final int VK_F13 = 61440; public static final int VK_F14 = 61441; public static final int VK_F15 = 61442; public static final int VK_F16 = 61443; public static final int VK_F17 = 61444; public static final int VK_F18 = 61445; public static final int VK_F19 = 61446; ! public static final int VK_F2 = 113; public static final int VK_F20 = 61447; public static final int VK_F21 = 61448; public static final int VK_F22 = 61449; public static final int VK_F23 = 61450; public static final int VK_F24 = 61451; ! public static final int VK_F3 = 114; ! public static final int VK_F4 = 115; ! public static final int VK_F5 = 116; ! public static final int VK_F6 = 117; ! public static final int VK_F7 = 118; ! public static final int VK_F8 = 119; ! public static final int VK_F9 = 120; ! public static final int VK_FINAL = 24; ! public static final int VK_FIND = 65488; ! public static final int VK_FULL_WIDTH = 243; ! public static final int VK_G = 71; ! public static final int VK_GREATER = 160; ! public static final int VK_H = 72; ! public static final int VK_HALF_WIDTH = 244; ! public static final int VK_HELP = 156; ! public static final int VK_HIRAGANA = 242; ! public static final int VK_HOME = 36; ! public static final int VK_I = 73; public static final int VK_INSERT = 155; ! public static final int VK_INVERTED_EXCLAMATION_MARK = 518; ! public static final int VK_J = 74; ! public static final int VK_JAPANESE_HIRAGANA = 260; ! public static final int VK_JAPANESE_KATAKANA = 259; ! public static final int VK_JAPANESE_ROMAN = 261; ! public static final int VK_K = 75; ! public static final int VK_KANA = 21; ! public static final int VK_KANJI = 25; ! public static final int VK_KATAKANA = 241; public static final int VK_KP_DOWN = 225; public static final int VK_KP_LEFT = 226; public static final int VK_KP_RIGHT = 227; ! public static final int VK_KP_UP = 224; ! public static final int VK_L = 76; ! public static final int VK_LEFT = 37; ! public static final int VK_LEFT_PARENTHESIS = 519; public static final int VK_LESS = 153; ! public static final int VK_M = 77; ! public static final int VK_META = 157; ! public static final int VK_MINUS = 45; ! public static final int VK_MODECHANGE = 31; ! public static final int VK_MULTIPLY = 106; ! public static final int VK_N = 78; ! public static final int VK_NONCONVERT = 29; ! public static final int VK_NUM_LOCK = 144; public static final int VK_NUMBER_SIGN = 520; ! public static final int VK_NUMPAD0 = 96; ! public static final int VK_NUMPAD1 = 97; ! public static final int VK_NUMPAD2 = 98; ! public static final int VK_NUMPAD3 = 99; ! public static final int VK_NUMPAD4 = 100; ! public static final int VK_NUMPAD5 = 101; ! public static final int VK_NUMPAD6 = 102; ! public static final int VK_NUMPAD7 = 103; ! public static final int VK_NUMPAD8 = 104; ! public static final int VK_NUMPAD9 = 105; ! public static final int VK_O = 79; ! public static final int VK_OPEN_BRACKET = 91; ! public static final int VK_P = 80; ! public static final int VK_PAGE_DOWN = 34; ! public static final int VK_PAGE_UP = 33; ! public static final int VK_PASTE = 65487; ! public static final int VK_PAUSE = 19; ! public static final int VK_PERIOD = 46; public static final int VK_PLUS = 521; ! public static final int VK_PREVIOUS_CANDIDATE = 257; ! public static final int VK_PRINTSCREEN = 154; ! public static final int VK_PROPS = 65482; ! public static final int VK_Q = 81; ! public static final int VK_QUOTE = 222; ! public static final int VK_QUOTEDBL = 152; ! public static final int VK_R = 82; ! public static final int VK_RIGHT = 39; public static final int VK_RIGHT_PARENTHESIS = 522; public static final int VK_ROMAN_CHARACTERS = 245; ! public static final int VK_S = 83; ! public static final int VK_SCROLL_LOCK = 145; ! public static final int VK_SEMICOLON = 59; ! public static final int VK_SEPARATER = 108; ! public static final int VK_SHIFT = 16; ! public static final int VK_SLASH = 47; ! public static final int VK_SPACE = 32; public static final int VK_STOP = 65480; ! public static final int VK_SUBTRACT = 109; ! public static final int VK_T = 84; ! public static final int VK_TAB = 9; ! public static final int VK_U = 85; public static final int VK_UNDEFINED = 0; - public static final int VK_UNDERSCORE = 523; - public static final int VK_UNDO = 65483; - public static final int VK_UP = 38; - public static final int VK_V = 86; - public static final int VK_W = 87; - public static final int VK_X = 88; - public static final int VK_Y = 89; - public static final int VK_Z = 90; ! public KeyEvent (Component source, int id, long when, ! int modifiers, int keyCode, char keyChar) { ! super (source, id); this.keyCode = keyCode; this.keyChar = keyChar; ! this.modifiers = modifiers; } ! public KeyEvent (Component source, int id, long when, ! int modifiers, int keyCode) { ! super (source, id); ! this.keyCode = keyCode; ! this.keyChar = CHAR_UNDEFINED; // FIXME? ! this.modifiers = modifiers; } ! public int getKeyCode () { return keyCode; } ! public char getKeyChar () { return keyChar; } ! public void setKeyCode (int keyCode) { this.keyCode = keyCode; } ! public void setKeyChar (char keyChar) { this.keyChar = keyChar; } ! public void setModifiers (int modifiers) { this.modifiers = modifiers; } ! public static String getKeyText (int keyCode) { ! // FIXME ! throw new InternalError ("unimplemented"); } ! public static String getKeyModifiersText (int modifiers) { ! // FIXME ! throw new InternalError ("unimplemented"); } ! public boolean isActionKey () { ! // FIXME ! return false; } ! public String paramString () { ! String r = ""; switch (id) { ! case KEY_PRESSED: ! r = "KEY_PRESSED"; ! break; ! case KEY_RELEASED: ! r = "KEY_RELEASED"; ! break; ! case KEY_TYPED: ! r = "KEY_TYPED"; ! break; ! } ! r += ",keyCode=" + keyCode + "," + getKeyText(keyCode) + ",modifiers=" + ! getKeyModifiersText(modifiers); ! return r; } ! private int keyCode; ! private char keyChar; ! private int modifiers; ! } --- 1,1733 ---- ! /* KeyEvent.java -- event for key presses ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! import java.awt.Component; ! import java.io.IOException; ! import java.io.ObjectInputStream; ! import gnu.java.awt.EventModifier; + /** + * This event is generated when a key is pressed or released. There are two + * categories of key events: + * + *

        "Key typed" events are higher-level, and have already + * compensated for modifiers and keyboard layout to generate a single Unicode + * character. It may take several key press events to generate one key typed. + * The getKeyCode method will return VK_UNDEFINED, + * and getKeyChar will return a valid Unicode character or + * CHAR_UNDEFINED. + * + *

        "Key pressed" and "key released" events are lower-level, and + * are platform and keyboard dependent. They correspond to the actaul motion + * on a keyboard, and return a virtual key code which labels the key that was + * pressed. The getKeyCode method will return one of the + * VK_* constants (except VK_UNDEFINED), and the + * getKeyChar method is undefined. + * + *

        Some keys do not generate key typed events, such as the F1 or HELP keys. + * Not all keyboards can generate all virtual keys, and no attempt is made to + * simulate the ones that can't be typed. Virtual keys correspond to the + * keyboard layout, so for example, VK_Q in English is VK_A in French. Also, + * there are some additional virtual keys to ease handling of actions, such + * as VK_ALL_CANDIDATES in place of ALT+VK_CONVERT. Do not rely on the value + * of the VK_* constants, except for VK_ENTER, VK_BACK_SPACE, and VK_TAB. + * + * @author Aaron M. Renn + * @author Eric Blake + * @see KeyAdapter + * @see KeyListener + * @since 1.1 + * @status updated to 1.4 + */ public class KeyEvent extends InputEvent { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -2352130953028126954L; ! ! /** This is the first id in the range of event ids used by this class. */ public static final int KEY_FIRST = 400; + + /** This is the last id in the range of event ids used by this class. */ public static final int KEY_LAST = 402; + + /** + * This event id indicates a key was typed, which is a key press followed + * by a key release to generate an actual Unicode character. It may take + * several key presses to generate one key typed event, and some action + * keys have no corresponding key typed. + */ + public static final int KEY_TYPED = 400; + + /** This event id indicates a key was pressed. */ public static final int KEY_PRESSED = 401; + + /** This event it indicates a key was released. */ public static final int KEY_RELEASED = 402; ! ! /** The virtual key Enter, which will always map to '\n'. */ ! public static final int VK_ENTER = '\n'; ! ! /** The virtual key Backspace, which will always map to '\b'. */ ! public static final int VK_BACK_SPACE = '\b'; ! ! /** The virtual key Tab, which will always map to '\t'. */ ! public static final int VK_TAB = '\t'; ! ! /** The virtual key Cancel. */ public static final int VK_CANCEL = 3; ! ! /** The virtual key VK_CLEAR. */ public static final int VK_CLEAR = 12; ! ! /** The virtual key VK_SHIFT. */ ! public static final int VK_SHIFT = 16; ! ! /** The virtual key VK_CONTROL. */ public static final int VK_CONTROL = 17; ! ! /** The virtual key VK_ALT. */ ! public static final int VK_ALT = 18; ! ! /** The virtual key VK_PAUSE. */ ! public static final int VK_PAUSE = 19; ! ! /** The virtual key VK_CAPS_LOCK. */ ! public static final int VK_CAPS_LOCK = 20; ! ! /** The virtual key VK_ESCAPE. */ ! public static final int VK_ESCAPE = 27; ! ! /** The virtual key VK_SPACE. */ ! public static final int VK_SPACE = ' '; ! ! /** The virtual key VK_PAGE_UP. */ ! public static final int VK_PAGE_UP = 33; ! ! /** The virtual key VK_PAGE_DOWN. */ ! public static final int VK_PAGE_DOWN = 34; ! ! /** The virtual key VK_END. */ ! public static final int VK_END = 35; ! ! /** The virtual key VK_HOME. */ ! public static final int VK_HOME = 36; ! ! /** ! * The virtual key for the non-numpad VK_LEFT. ! * ! * @see #VK_KP_LEFT ! */ ! public static final int VK_LEFT = 37; ! ! /** ! * The virtual key for the non-numpad VK_UP. ! * ! * @see #VK_KP_UP ! */ ! public static final int VK_UP = 38; ! ! /** ! * The virtual key for the non-numpad VK_RIGHT. ! * ! * @see #VK_KP_RIGHT ! */ ! public static final int VK_RIGHT = 39; ! ! /** ! * The virtual key for the non-numpad VK_DOWN. ! * ! * @see #VK_KP_DOWN ! */ ! public static final int VK_DOWN = 40; ! ! /** The virtual key VK_COMMA. */ ! public static final int VK_COMMA = ','; ! ! /** ! * The virtual key VK_MINUS. ! * ! * @since 1.2 ! */ ! public static final int VK_MINUS = '-'; ! ! /** The virtual key VK_PERIOD. */ ! public static final int VK_PERIOD = '.'; ! ! /** The virtual key VK_SLASH. */ ! public static final int VK_SLASH = '/'; ! ! /** The virtual key VK_0. */ ! public static final int VK_0 = '0'; ! ! /** The virtual key VK_1. */ ! public static final int VK_1 = '1'; ! ! /** The virtual key VK_2. */ ! public static final int VK_2 = '2'; ! ! /** The virtual key VK_3. */ ! public static final int VK_3 = '3'; ! ! /** The virtual key VK_4. */ ! public static final int VK_4 = '4'; ! ! /** The virtual key VK_5. */ ! public static final int VK_5 = '5'; ! ! /** The virtual key VK_6. */ ! public static final int VK_6 = '6'; ! ! /** The virtual key VK_7. */ ! public static final int VK_7 = '7'; ! ! /** The virtual key VK_8. */ ! public static final int VK_8 = '8'; ! ! /** The virtual key VK_9. */ ! public static final int VK_9 = '9'; ! ! /** The virtual key VK_SEMICOLON. */ ! public static final int VK_SEMICOLON = ';'; ! ! /** The virtual key VK_EQUALS. */ ! public static final int VK_EQUALS = '='; ! ! /** The virtual key VK_A. */ ! public static final int VK_A = 'A'; ! ! /** The virtual key VK_B. */ ! public static final int VK_B = 'B'; ! ! /** The virtual key VK_C. */ ! public static final int VK_C = 'C'; ! ! /** The virtual key VK_D. */ ! public static final int VK_D = 'D'; ! ! /** The virtual key VK_E. */ ! public static final int VK_E = 'E'; ! ! /** The virtual key VK_F. */ ! public static final int VK_F = 'F'; ! ! /** The virtual key VK_G. */ ! public static final int VK_G = 'G'; ! ! /** The virtual key VK_H. */ ! public static final int VK_H = 'H'; ! ! /** The virtual key VK_I. */ ! public static final int VK_I = 'I'; ! ! /** The virtual key VK_J. */ ! public static final int VK_J = 'J'; ! ! /** The virtual key VK_K. */ ! public static final int VK_K = 'K'; ! ! /** The virtual key VK_L. */ ! public static final int VK_L = 'L'; ! ! /** The virtual key VK_M. */ ! public static final int VK_M = 'M'; ! ! /** The virtual key VK_N. */ ! public static final int VK_N = 'N'; ! ! /** The virtual key VK_O. */ ! public static final int VK_O = 'O'; ! ! /** The virtual key VK_P. */ ! public static final int VK_P = 'P'; ! ! /** The virtual key VK_Q. */ ! public static final int VK_Q = 'Q'; ! ! /** The virtual key VK_R. */ ! public static final int VK_R = 'R'; ! ! /** The virtual key VK_S. */ ! public static final int VK_S = 'S'; ! ! /** The virtual key VK_T. */ ! public static final int VK_T = 'T'; ! ! /** The virtual key VK_U. */ ! public static final int VK_U = 'U'; ! ! /** The virtual key VK_V. */ ! public static final int VK_V = 'V'; ! ! /** The virtual key VK_W. */ ! public static final int VK_W = 'W'; ! ! /** The virtual key VK_X. */ ! public static final int VK_X = 'X'; ! ! /** The virtual key VK_Y. */ ! public static final int VK_Y = 'Y'; ! ! /** The virtual key VK_Z. */ ! public static final int VK_Z = 'Z'; ! ! /** The virtual key VK_OPEN_BRACKET. */ ! public static final int VK_OPEN_BRACKET = '['; ! ! /** The virtual key VK_BACK_SLASH. */ ! public static final int VK_BACK_SLASH = '\\'; ! ! /** The virtual key VK_CLOSE_BRACKET. */ ! public static final int VK_CLOSE_BRACKET = ']'; ! ! /** The virtual key VK_NUMPAD0. */ ! public static final int VK_NUMPAD0 = 96; ! ! /** The virtual key VK_NUMPAD1. */ ! public static final int VK_NUMPAD1 = 97; ! ! /** The virtual key VK_NUMPAD2. */ ! public static final int VK_NUMPAD2 = 98; ! ! /** The virtual key VK_NUMPAD3. */ ! public static final int VK_NUMPAD3 = 99; ! ! /** The virtual key VK_NUMPAD4. */ ! public static final int VK_NUMPAD4 = 100; ! ! /** The virtual key VK_NUMPAD5. */ ! public static final int VK_NUMPAD5 = 101; ! ! /** The virtual key VK_NUMPAD6. */ ! public static final int VK_NUMPAD6 = 102; ! ! /** The virtual key VK_NUMPAD7. */ ! public static final int VK_NUMPAD7 = 103; ! ! /** The virtual key VK_NUMPAD8. */ ! public static final int VK_NUMPAD8 = 104; ! ! /** The virtual key VK_NUMPAD9. */ ! public static final int VK_NUMPAD9 = 105; ! ! /** The virtual key VK_MULTIPLY. */ ! public static final int VK_MULTIPLY = 106; ! ! /** The virtual key VK_ADD. */ ! public static final int VK_ADD = 107; ! ! /** ! * The virtual key VK_SEPARATOR, handily mispelled for those who can't ! * figure it out. ! * ! * @deprecated use {@link #VK_SEPARATOR} ! */ ! public static final int VK_SEPARATER = 108; ! ! /** ! * The virtual key VK_SEPARATOR. ! * ! * @since 1.4 ! */ ! public static final int VK_SEPARATOR = 108; ! ! /** The virtual key VK_SUBTRACT. */ ! public static final int VK_SUBTRACT = 109; ! ! /** The virtual key VK_DECIMAL. */ public static final int VK_DECIMAL = 110; ! ! /** The virtual key VK_DIVIDE. */ public static final int VK_DIVIDE = 111; ! ! /** The virtual key VK_DELETE. */ ! public static final int VK_DELETE = 127; ! ! /** The virtual key VK_NUM_LOCK. */ ! public static final int VK_NUM_LOCK = 144; ! ! /** The virtual key VK_SCROLL_LOCK. */ ! public static final int VK_SCROLL_LOCK = 145; ! ! /** The virtual key VK_F1. */ public static final int VK_F1 = 112; + + /** The virtual key VK_F2. */ + public static final int VK_F2 = 113; + + /** The virtual key VK_F3. */ + public static final int VK_F3 = 114; + + /** The virtual key VK_F4. */ + public static final int VK_F4 = 115; + + /** The virtual key VK_F5. */ + public static final int VK_F5 = 116; + + /** The virtual key VK_F6. */ + public static final int VK_F6 = 117; + + /** The virtual key VK_F7. */ + public static final int VK_F7 = 118; + + /** The virtual key VK_F8. */ + public static final int VK_F8 = 119; + + /** The virtual key VK_F9. */ + public static final int VK_F9 = 120; + + /** The virtual key VK_F10. */ public static final int VK_F10 = 121; + + /** The virtual key VK_F11. */ public static final int VK_F11 = 122; + + /** The virtual key VK_F12. */ public static final int VK_F12 = 123; + + /** + * The virtual key VK_F13. + * + * @since 1.2 + */ public static final int VK_F13 = 61440; + + /** + * The virtual key VK_F14. + * + * @since 1.2 + */ public static final int VK_F14 = 61441; + + /** + * The virtual key VK_F15. + * + * @since 1.2 + */ public static final int VK_F15 = 61442; + + /** + * The virtual key VK_F16. + * + * @since 1.2 + */ public static final int VK_F16 = 61443; + + /** + * The virtual key VK_F17. + * + * @since 1.2 + */ public static final int VK_F17 = 61444; + + /** + * The virtual key VK_F18. + * + * @since 1.2 + */ public static final int VK_F18 = 61445; + + /** + * The virtual key VK_F19. + * + * @since 1.2 + */ public static final int VK_F19 = 61446; ! ! /** ! * The virtual key VK_F20. ! * ! * @since 1.2 ! */ public static final int VK_F20 = 61447; + + /** + * The virtual key VK_F21. + * + * @since 1.2 + */ public static final int VK_F21 = 61448; + + /** + * The virtual key VK_F22. + * + * @since 1.2 + */ public static final int VK_F22 = 61449; + + /** + * The virtual key VK_F23. + * + * @since 1.2 + */ public static final int VK_F23 = 61450; + + /** + * The virtual key VK_F24. + * + * @since 1.2 + */ public static final int VK_F24 = 61451; ! ! /** The virtual key VK_PRINTSCREEN. */ ! public static final int VK_PRINTSCREEN = 154; ! ! /** The virtual key VK_INSERT. */ public static final int VK_INSERT = 155; ! ! /** The virtual key VK_HELP. */ ! public static final int VK_HELP = 156; ! ! /** The virtual key VK_META. */ ! public static final int VK_META = 157; ! ! /** The virtual key VK_BACK_QUOTE. */ ! public static final int VK_BACK_QUOTE = 192; ! ! /** The virtual key VK_QUOTE. */ ! public static final int VK_QUOTE = 222; ! ! /** ! * The virtual key for the numpad VK_KP_UP. ! * ! * @see #VK_UP ! * @since 1.2 ! */ ! public static final int VK_KP_UP = 224; ! ! /** ! * The virtual key for the numpad VK_KP_DOWN. ! * ! * @see #VK_DOWN ! * @since 1.2 ! */ public static final int VK_KP_DOWN = 225; + + /** + * The virtual key for the numpad VK_KP_LEFT. + * + * @see #VK_LEFT + * @since 1.2 + */ public static final int VK_KP_LEFT = 226; + + /** + * The virtual key for the numpad VK_KP_RIGHT. + * + * @see #VK_RIGHT + * @since 1.2 + */ public static final int VK_KP_RIGHT = 227; ! ! /** ! * The virtual key VK_DEAD_GRAVE. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_GRAVE = 128; ! ! /** ! * The virtual key VK_DEAD_ACUTE. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_ACUTE = 129; ! ! /** ! * The virtual key VK_DEAD_CIRCUMFLEX. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_CIRCUMFLEX = 130; ! ! /** ! * The virtual key VK_DEAD_TILDE. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_TILDE = 131; ! ! /** ! * The virtual key VK_DEAD_MACRON. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_MACRON = 132; ! ! /** ! * The virtual key VK_DEAD_BREVE. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_BREVE = 133; ! ! /** ! * The virtual key VK_DEAD_ABOVEDOT. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_ABOVEDOT = 134; ! ! /** ! * The virtual key VK_DEAD_DIAERESIS. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_DIAERESIS = 135; ! ! /** ! * The virtual key VK_DEAD_ABOVERING. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_ABOVERING = 136; ! ! /** ! * The virtual key VK_DEAD_DOUBLEACUTE. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_DOUBLEACUTE = 137; ! ! /** ! * The virtual key VK_DEAD_CARON. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_CARON = 138; ! ! /** ! * The virtual key VK_DEAD_CEDILLA. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_CEDILLA = 139; ! ! /** ! * The virtual key VK_DEAD_OGONEK. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_OGONEK = 140; ! ! /** ! * The virtual key VK_DEAD_IOTA. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_IOTA = 141; ! ! /** ! * The virtual key VK_DEAD_VOICED_SOUND. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_VOICED_SOUND = 142; ! ! /** ! * The virtual key VK_DEAD_SEMIVOICED_SOUND. ! * ! * @since 1.2 ! */ ! public static final int VK_DEAD_SEMIVOICED_SOUND = 143; ! ! /** ! * The virtual key VK_AMPERSAND. ! * ! * @since 1.2 ! */ ! public static final int VK_AMPERSAND = 150; ! ! /** ! * The virtual key VK_ASTERISK. ! * ! * @since 1.2 ! */ ! public static final int VK_ASTERISK = 151; ! ! /** ! * The virtual key VK_QUOTEDBL. ! * ! * @since 1.2 ! */ ! public static final int VK_QUOTEDBL = 152; ! ! /** ! * The virtual key VK_LESS. ! * ! * @since 1.2 ! */ public static final int VK_LESS = 153; ! ! /** ! * The virtual key VK_GREATER. ! * ! * @since 1.2 ! */ ! public static final int VK_GREATER = 160; ! ! /** ! * The virtual key VK_BRACELEFT. ! * ! * @since 1.2 ! */ ! public static final int VK_BRACELEFT = 161; ! ! /** ! * The virtual key VK_BRACERIGHT. ! * ! * @since 1.2 ! */ ! public static final int VK_BRACERIGHT = 162; ! ! /** ! * The virtual key VK_AT. ! * ! * @since 1.2 ! */ ! public static final int VK_AT = 512; ! ! /** ! * The virtual key VK_COLON. ! * ! * @since 1.2 ! */ ! public static final int VK_COLON = 513; ! ! /** ! * The virtual key VK_CIRCUMFLEX. ! * ! * @since 1.2 ! */ ! public static final int VK_CIRCUMFLEX = 514; ! ! /** ! * The virtual key VK_DOLLAR. ! * ! * @since 1.2 ! */ ! public static final int VK_DOLLAR = 515; ! ! /** ! * The virtual key VK_EURO_SIGN. ! * ! * @since 1.2 ! */ ! public static final int VK_EURO_SIGN = 516; ! ! /** ! * The virtual key VK_EXCLAMATION_MARK. ! * ! * @since 1.2 ! */ ! public static final int VK_EXCLAMATION_MARK = 517; ! ! /** ! * The virtual key VK_INVERTED_EXCLAMATION_MARK. ! * ! * @since 1.2 ! */ ! public static final int VK_INVERTED_EXCLAMATION_MARK = 518; ! ! /** ! * The virtual key VK_LEFT_PARENTHESIS. ! * ! * @since 1.2 ! */ ! public static final int VK_LEFT_PARENTHESIS = 519; ! ! /** ! * The virtual key VK_NUMBER_SIGN. ! * ! * @since 1.2 ! */ public static final int VK_NUMBER_SIGN = 520; ! ! /** ! * The virtual key VK_PLUS. ! * ! * @since 1.2 ! */ public static final int VK_PLUS = 521; ! ! /** ! * The virtual key VK_RIGHT_PARENTHESIS. ! * ! * @since 1.2 ! */ public static final int VK_RIGHT_PARENTHESIS = 522; + + /** + * The virtual key VK_UNDERSCORE. + * + * @since 1.2 + */ + public static final int VK_UNDERSCORE = 523; + + /** The virtual key VK_FINAL. */ + public static final int VK_FINAL = 24; + + /** The virtual key VK_CONVERT. */ + public static final int VK_CONVERT = 28; + + /** The virtual key VK_NONCONVERT. */ + public static final int VK_NONCONVERT = 29; + + /** The virtual key VK_ACCEPT. */ + public static final int VK_ACCEPT = 30; + + /** The virtual key VK_MODECHANGE. */ + public static final int VK_MODECHANGE = 31; + + /** The virtual key VK_KANA. */ + public static final int VK_KANA = 21; + + /** The virtual key VK_KANJI. */ + public static final int VK_KANJI = 25; + + /** + * The virtual key VK_ALPHANUMERIC. + * + * @since 1.2 + */ + public static final int VK_ALPHANUMERIC = 240; + + /** + * The virtual key VK_KATAKANA. + * + * @since 1.2 + */ + public static final int VK_KATAKANA = 241; + + /** + * The virtual key VK_HIRAGANA. + * + * @since 1.2 + */ + public static final int VK_HIRAGANA = 242; + + /** + * The virtual key VK_FULL_WIDTH. + * + * @since 1.2 + */ + public static final int VK_FULL_WIDTH = 243; + + /** + * The virtual key VK_HALF_WIDTH. + * + * @since 1.2 + */ + public static final int VK_HALF_WIDTH = 244; + + /** + * The virtual key VK_ROMAN_CHARACTERS. + * + * @since 1.2 + */ public static final int VK_ROMAN_CHARACTERS = 245; ! ! /** ! * The virtual key VK_ALL_CANDIDATES. ! * ! * @since 1.2 ! */ ! public static final int VK_ALL_CANDIDATES = 256; ! ! /** ! * The virtual key VK_PREVIOUS_CANDIDATE. ! * ! * @since 1.2 ! */ ! public static final int VK_PREVIOUS_CANDIDATE = 257; ! ! /** ! * The virtual key VK_CODE_INPUT. ! * ! * @since 1.2 ! */ ! public static final int VK_CODE_INPUT = 258; ! ! /** ! * The virtual key VK_JAPANESE_KATAKANA. ! * ! * @since 1.2 ! */ ! public static final int VK_JAPANESE_KATAKANA = 259; ! ! /** ! * The virtual key VK_JAPANESE_HIRAGANA. ! * ! * @since 1.2 ! */ ! public static final int VK_JAPANESE_HIRAGANA = 260; ! ! /** ! * The virtual key VK_JAPANESE_ROMAN. ! * ! * @since 1.2 ! */ ! public static final int VK_JAPANESE_ROMAN = 261; ! ! /** ! * The virtual key VK_KANA_LOCK. ! * ! * @since 1.3 ! */ ! public static final int VK_KANA_LOCK = 262; ! ! /** ! * The virtual key VK_INPUT_METHOD_ON_OFF. ! * ! * @since 1.3 ! */ ! public static final int VK_INPUT_METHOD_ON_OFF = 263; ! ! /** ! * The virtual key VK_CUT. ! * ! * @since 1.2 ! */ ! public static final int VK_CUT = 65489; ! ! /** ! * The virtual key VK_COPY. ! * ! * @since 1.2 ! */ ! public static final int VK_COPY = 65485; ! ! /** ! * The virtual key VK_PASTE. ! * ! * @since 1.2 ! */ ! public static final int VK_PASTE = 65487; ! ! /** ! * The virtual key VK_UNDO. ! * ! * @since 1.2 ! */ ! public static final int VK_UNDO = 65483; ! ! /** ! * The virtual key VK_AGAIN. ! * ! * @since 1.2 ! */ ! public static final int VK_AGAIN = 65481; ! ! /** ! * The virtual key VK_FIND. ! * ! * @since 1.2 ! */ ! public static final int VK_FIND = 65488; ! ! /** ! * The virtual key VK_PROPS. ! * ! * @since 1.2 ! */ ! public static final int VK_PROPS = 65482; ! ! /** ! * The virtual key VK_STOP. ! * ! * @since 1.2 ! */ public static final int VK_STOP = 65480; ! ! /** ! * The virtual key VK_COMPOSE. ! * ! * @since 1.2 ! */ ! public static final int VK_COMPOSE = 65312; ! ! /** ! * The virtual key VK_ALT_GRAPH. ! * ! * @since 1.2 ! */ ! public static final int VK_ALT_GRAPH = 65406; ! ! /** ! * The virtual key VK_UNDEFINED. This is used for key typed events, which ! * do not have a virtual key. ! */ public static final int VK_UNDEFINED = 0; ! /** ! * The only char with no valid Unicode interpretation. This is used for ! * key pressed and key released events which do not have a valid keyChar. ! */ ! public static final char CHAR_UNDEFINED = '\uffff'; ! ! /** ! * Indicates unknown or irrelavent key location. This is also used for ! * key typed events, which do not need a location. ! * ! * @since 1.4 ! */ ! public static final int KEY_LOCATION_UNKNOWN = 0; ! ! /** ! * Indicates a standard key location, with no left/right variants and not ! * on the numeric pad. ! * ! * @since 1.4 ! */ ! public static final int KEY_LOCATION_STANDARD = 1; ! ! /** ! * Indicates the key is on the left side of the keyboard, such as the left ! * shift. ! * ! * @since 1.4 ! */ ! public static final int KEY_LOCATION_LEFT = 2; ! ! /** ! * Indicates the key is on the right side of the keyboard, such as the right ! * shift. ! * ! * @since 1.4 ! */ ! public static final int KEY_LOCATION_RIGHT = 3; ! ! /** ! * Indicates the key is on the numeric pad, such as the numpad 0. ! * ! * @since 1.4 ! */ ! public static final int KEY_LOCATION_NUMPAD = 4; ! ! /** ! * The code assigned to the physical keyboard location (as adjusted by the ! * keyboard layout). Use the symbolic VK_* names instead of numbers. ! * ! * @see #getKeyCode() ! * @serial the VK_ code for this key ! */ ! private int keyCode; ! ! /** ! * The Unicode character produced by the key type event. This has no meaning ! * for key pressed and key released events. ! * ! * @see #getKeyChar() ! * @serial the Unicode value for this key ! */ ! private char keyChar; ! ! /** ! * The keyboard location of the key. One of {@link #KEY_LOCATION_UNKNOWN}, ! * {@link #KEY_LOCATION_STANDARD}, {@link #KEY_LOCATION_LEFT}, ! * {@link #KEY_LOCATION_RIGHT}, or {@link #KEY_LOCATION_NUMPAD}. ! * ! * @see #getKeyLocation() ! * @serial the key location ! * @since 1.4 ! */ ! private final int keyLocation; ! ! /** ! * Stores the state of the native event dispatching system, to correctly ! * dispatch in Component#dispatchEventImpl when a proxy is active. ! * ! * XXX Does this matter in Classpath? ! * ! * @serial whether the proxy is active ! */ ! private boolean isProxyActive; ! ! ! /** ! * Initializes a new instance of KeyEvent with the specified ! * information. Note that an invalid id leads to unspecified results. ! * ! * @param source the component that generated this event ! * @param id the event id ! * @param when the timestamp when the even occurred ! * @param modifiers the modifier keys during the event, in old or new style ! * @param keyCode the integer constant for the virtual key type ! * @param keyChar the Unicode value of the key ! * @param keyLocation the location of the key ! * @throws IllegalArgumentException if source is null, if keyLocation is ! * invalid, or if (id == KEY_TYPED && (keyCode != VK_UNDEFINED ! * || keyChar == CHAR_UNDEFINED)) ! */ ! public KeyEvent(Component source, int id, long when, int modifiers, ! int keyCode, char keyChar, int keyLocation) { ! super(source, id, when, modifiers); this.keyCode = keyCode; this.keyChar = keyChar; ! this.keyLocation = keyLocation; ! if ((id == KEY_TYPED && (keyCode != VK_UNDEFINED ! || keyChar == CHAR_UNDEFINED)) ! || keyLocation < KEY_LOCATION_UNKNOWN ! || keyLocation > KEY_LOCATION_NUMPAD) ! throw new IllegalArgumentException(); } ! /** ! * Initializes a new instance of KeyEvent with the specified ! * information. Note that an invalid id leads to unspecified results. ! * ! * @param source the component that generated this event ! * @param id the event id ! * @param when the timestamp when the even occurred ! * @param modifiers the modifier keys during the event, in old or new style ! * @param keyCode the integer constant for the virtual key type ! * @param keyChar the Unicode value of the key ! * @throws IllegalArgumentException if source is null, or if ! * (id == KEY_TYPED && (keyCode != VK_UNDEFINED ! * || keyChar == CHAR_UNDEFINED)) ! */ ! public KeyEvent(Component source, int id, long when, int modifiers, ! int keyCode, char keyChar) { ! this(source, id, when, modifiers, keyCode, keyChar, KEY_LOCATION_UNKNOWN); } ! /** ! * Initializes a new instance of KeyEvent with the specified ! * information. Note that an invalid id leads to unspecified results. ! * ! * @param source the component that generated this event ! * @param id the event id ! * @param when the timestamp when the even occurred ! * @param modifiers the modifier keys during the event, in old or new style ! * @param keyCode the integer constant for the virtual key type ! * @throws IllegalArgumentException if source is null, or if ! * id == KEY_TYPED but keyCode != VK_UNDEFINED ! */ ! public KeyEvent(Component source, int id, long when, int modifiers, ! int keyCode) ! { ! this(source, id, when, modifiers, keyCode, '\0', KEY_LOCATION_UNKNOWN); ! } ! /** ! * Returns the key code for the event key. This will be one of the ! * VK_* constants defined in this class. If the event type is ! * KEY_TYPED, the result will be VK_UNDEFINED. ! * ! * @return the key code for this event ! */ ! public int getKeyCode() ! { ! return keyCode; ! } ! /** ! * Sets the key code for this event. This must be one of the ! * VK_* constants defined in this class. ! * ! * @param keyCode the new key code for this event ! */ ! public void setKeyCode(int keyCode) ! { ! this.keyCode = keyCode; ! } ! /** ! * Returns the Unicode value for the event key. This will be ! * CHAR_UNDEFINED if there is no Unicode equivalent for ! * this key, usually when this is a KEY_PRESSED or KEY_RELEASED event. ! * ! * @return the Unicode character for this event ! */ ! public char getKeyChar() ! { ! return keyChar; ! } ! /** ! * Sets the Unicode character for this event to the specified value. ! * ! * @param keyChar the new Unicode character for this event ! */ ! public void setKeyChar(char keyChar) ! { ! this.keyChar = keyChar; ! } ! /** ! * Sets the modifier keys to the specified value. This should be a union ! * of the bit mask constants from InputEvent. The use of this ! * method is not recommended, particularly for KEY_TYPED events, which do ! * not check if the modifiers were changed. ! * ! * @param modifiers the new modifier value, in either old or new style ! * @see InputEvent ! */ ! public void setModifiers(int modifiers) { ! this.modifiers = EventModifier.extend(modifiers); } ! /** ! * Returns the keyboard location of the key that generated this event. This ! * provides a way to distinguish between keys like left and right shift ! * which share a common key code. The result will be one of ! * {@link #KEY_LOCATION_UNKNOWN}, {@link #KEY_LOCATION_STANDARD}, ! * {@link #KEY_LOCATION_LEFT}, {@link #KEY_LOCATION_RIGHT}, or ! * {@link #KEY_LOCATION_NUMPAD}. ! * ! * @return the key location ! * @since 1.4 ! */ ! public int getKeyLocation() { ! return keyLocation; } ! /** ! * Returns the text name of key code, such as "HOME", "F1", or "A". ! * ! * XXX Sun claims this can be localized via the awt.properties file - how ! * do we implement that? ! * ! * @return the text name of the key code ! */ ! public static String getKeyText(int keyCode) { ! switch (keyCode) ! { ! case VK_CANCEL: ! return "Cancel"; ! case VK_BACK_SPACE: ! return "Backspace"; ! case VK_TAB: ! return "Tab"; ! case VK_ENTER: ! return "Enter"; ! case VK_CLEAR: ! return "Clear"; ! case VK_SHIFT: ! return "Shift"; ! case VK_CONTROL: ! return "Ctrl"; ! case VK_ALT: ! return "Alt"; ! case VK_PAUSE: ! return "Pause"; ! case VK_CAPS_LOCK: ! return "Caps Lock"; ! case VK_KANA: ! return "Kana"; ! case VK_FINAL: ! return "Final"; ! case VK_KANJI: ! return "Kanji"; ! case VK_ESCAPE: ! return "Escape"; ! case VK_CONVERT: ! return "Convert"; ! case VK_NONCONVERT: ! return "No Convert"; ! case VK_ACCEPT: ! return "Accept"; ! case VK_MODECHANGE: ! return "Mode Change"; ! case VK_SPACE: ! return "Space"; ! case VK_PAGE_UP: ! return "Page Up"; ! case VK_PAGE_DOWN: ! return "Page Down"; ! case VK_END: ! return "End"; ! case VK_HOME: ! return "Home"; ! case VK_LEFT: ! case VK_KP_LEFT: ! return "Left"; ! case VK_UP: ! case VK_KP_UP: ! return "Up"; ! case VK_RIGHT: ! case VK_KP_RIGHT: ! return "Right"; ! case VK_DOWN: ! case VK_KP_DOWN: ! return "Down"; ! case VK_MINUS: ! return "Minus"; ! case VK_MULTIPLY: ! return "NumPad *"; ! case VK_ADD: ! return "NumPad +"; ! case VK_SEPARATOR: ! return "NumPad ,"; ! case VK_SUBTRACT: ! return "NumPad -"; ! case VK_DECIMAL: ! return "NumPad ."; ! case VK_DIVIDE: ! return "NumPad /"; ! case VK_DELETE: ! return "Delete"; ! case VK_DEAD_GRAVE: ! return "Dead Grave"; ! case VK_DEAD_ACUTE: ! return "Dead Acute"; ! case VK_DEAD_CIRCUMFLEX: ! return "Dead Circumflex"; ! case VK_DEAD_TILDE: ! return "Dead Tilde"; ! case VK_DEAD_MACRON: ! return "Dead Macron"; ! case VK_DEAD_BREVE: ! return "Dead Breve"; ! case VK_DEAD_ABOVEDOT: ! return "Dead Above Dot"; ! case VK_DEAD_DIAERESIS: ! return "Dead Diaeresis"; ! case VK_DEAD_ABOVERING: ! return "Dead Above Ring"; ! case VK_DEAD_DOUBLEACUTE: ! return "Dead Double Acute"; ! case VK_DEAD_CARON: ! return "Dead Caron"; ! case VK_DEAD_CEDILLA: ! return "Dead Cedilla"; ! case VK_DEAD_OGONEK: ! return "Dead Ogonek"; ! case VK_DEAD_IOTA: ! return "Dead Iota"; ! case VK_DEAD_VOICED_SOUND: ! return "Dead Voiced Sound"; ! case VK_DEAD_SEMIVOICED_SOUND: ! return "Dead Semivoiced Sound"; ! case VK_NUM_LOCK: ! return "Num Lock"; ! case VK_SCROLL_LOCK: ! return "Scroll Lock"; ! case VK_AMPERSAND: ! return "Ampersand"; ! case VK_ASTERISK: ! return "Asterisk"; ! case VK_QUOTEDBL: ! return "Double Quote"; ! case VK_LESS: ! return "Less"; ! case VK_PRINTSCREEN: ! return "Print Screen"; ! case VK_INSERT: ! return "Insert"; ! case VK_HELP: ! return "Help"; ! case VK_META: ! return "Meta"; ! case VK_GREATER: ! return "Greater"; ! case VK_BRACELEFT: ! return "Left Brace"; ! case VK_BRACERIGHT: ! return "Right Brace"; ! case VK_BACK_QUOTE: ! return "Back Quote"; ! case VK_QUOTE: ! return "Quote"; ! case VK_ALPHANUMERIC: ! return "Alphanumeric"; ! case VK_KATAKANA: ! return "Katakana"; ! case VK_HIRAGANA: ! return "Hiragana"; ! case VK_FULL_WIDTH: ! return "Full-Width"; ! case VK_HALF_WIDTH: ! return "Half-Width"; ! case VK_ROMAN_CHARACTERS: ! return "Roman Characters"; ! case VK_ALL_CANDIDATES: ! return "All Candidates"; ! case VK_PREVIOUS_CANDIDATE: ! return "Previous Candidate"; ! case VK_CODE_INPUT: ! return "Code Input"; ! case VK_JAPANESE_KATAKANA: ! return "Japanese Katakana"; ! case VK_JAPANESE_HIRAGANA: ! return "Japanese Hiragana"; ! case VK_JAPANESE_ROMAN: ! return "Japanese Roman"; ! case VK_KANA_LOCK: ! return "Kana Lock"; ! case VK_INPUT_METHOD_ON_OFF: ! return "Input Method On/Off"; ! case VK_AT: ! return "At"; ! case VK_COLON: ! return "Colon"; ! case VK_CIRCUMFLEX: ! return "Circumflex"; ! case VK_DOLLAR: ! return "Dollar"; ! case VK_EURO_SIGN: ! return "Euro"; ! case VK_EXCLAMATION_MARK: ! return "Exclamation Mark"; ! case VK_INVERTED_EXCLAMATION_MARK: ! return "Inverted Exclamation Mark"; ! case VK_LEFT_PARENTHESIS: ! return "Left Parenthesis"; ! case VK_NUMBER_SIGN: ! return "Number Sign"; ! case VK_PLUS: ! return "Plus"; ! case VK_RIGHT_PARENTHESIS: ! return "Right Parenthesis"; ! case VK_UNDERSCORE: ! return "Underscore"; ! case VK_COMPOSE: ! return "Compose"; ! case VK_ALT_GRAPH: ! return "Alt Graph"; ! case VK_STOP: ! return "Stop"; ! case VK_AGAIN: ! return "Again"; ! case VK_PROPS: ! return "Props"; ! case VK_UNDO: ! return "Undo"; ! case VK_COPY: ! return "Copy"; ! case VK_PASTE: ! return "Paste"; ! case VK_FIND: ! return "Find"; ! case VK_CUT: ! return "Cut"; ! case VK_COMMA: ! case VK_PERIOD: ! case VK_SLASH: ! case VK_0: ! case VK_1: ! case VK_2: ! case VK_3: ! case VK_4: ! case VK_5: ! case VK_6: ! case VK_7: ! case VK_8: ! case VK_9: ! case VK_SEMICOLON: ! case VK_EQUALS: ! case VK_A: ! case VK_B: ! case VK_C: ! case VK_D: ! case VK_E: ! case VK_F: ! case VK_G: ! case VK_H: ! case VK_I: ! case VK_J: ! case VK_K: ! case VK_L: ! case VK_M: ! case VK_N: ! case VK_O: ! case VK_P: ! case VK_Q: ! case VK_R: ! case VK_S: ! case VK_T: ! case VK_U: ! case VK_V: ! case VK_W: ! case VK_X: ! case VK_Y: ! case VK_Z: ! case VK_OPEN_BRACKET: ! case VK_BACK_SLASH: ! case VK_CLOSE_BRACKET: ! return "" + (char) keyCode; ! case VK_NUMPAD0: ! case VK_NUMPAD1: ! case VK_NUMPAD2: ! case VK_NUMPAD3: ! case VK_NUMPAD4: ! case VK_NUMPAD5: ! case VK_NUMPAD6: ! case VK_NUMPAD7: ! case VK_NUMPAD8: ! case VK_NUMPAD9: ! return "NumPad-" + (char) (keyCode - VK_NUMPAD0); ! case VK_F1: ! case VK_F2: ! case VK_F3: ! case VK_F4: ! case VK_F5: ! case VK_F6: ! case VK_F7: ! case VK_F8: ! case VK_F9: ! case VK_F10: ! case VK_F11: ! case VK_F12: ! return "F" + (keyCode - (VK_F1 - 1)); ! case VK_F13: ! case VK_F14: ! case VK_F15: ! case VK_F16: ! case VK_F17: ! case VK_F18: ! case VK_F19: ! case VK_F20: ! case VK_F21: ! case VK_F22: ! case VK_F23: ! case VK_F24: ! return "F" + (keyCode - (VK_F13 - 13)); ! default: ! // This is funky on negative numbers, but that's Sun's fault. ! return "Unknown keyCode: 0x" + (keyCode < 0 ? "-" : "") ! + Integer.toHexString(Math.abs(keyCode)); ! } } ! /** ! * Returns a string describing the modifiers, such as "Shift" or ! * "Ctrl+Button1". ! * ! * XXX Sun claims this can be localized via the awt.properties file - how ! * do we implement that? ! * ! * @param modifiers the old-style modifiers to convert to text ! * @return a string representation of the modifiers in this bitmask ! */ ! public static String getKeyModifiersText(int modifiers) { ! return getModifiersExText(EventModifier.extend(modifiers ! & EventModifier.OLD_MASK)); ! } ! ! /** ! * Tests whether or not this key is an action key. An action key typically ! * does not fire a KEY_TYPED event, and is not a modifier. ! * ! * @return true if this is an action key ! */ ! public boolean isActionKey() ! { ! switch (keyCode) ! { ! case VK_PAUSE: ! case VK_CAPS_LOCK: ! case VK_KANA: ! case VK_FINAL: ! case VK_KANJI: ! case VK_CONVERT: ! case VK_NONCONVERT: ! case VK_ACCEPT: ! case VK_MODECHANGE: ! case VK_PAGE_UP: ! case VK_PAGE_DOWN: ! case VK_END: ! case VK_HOME: ! case VK_LEFT: ! case VK_UP: ! case VK_RIGHT: ! case VK_DOWN: ! case VK_F1: ! case VK_F2: ! case VK_F3: ! case VK_F4: ! case VK_F5: ! case VK_F6: ! case VK_F7: ! case VK_F8: ! case VK_F9: ! case VK_F10: ! case VK_F11: ! case VK_F12: ! case VK_NUM_LOCK: ! case VK_SCROLL_LOCK: ! case VK_PRINTSCREEN: ! case VK_INSERT: ! case VK_HELP: ! case VK_KP_UP: ! case VK_KP_DOWN: ! case VK_KP_LEFT: ! case VK_KP_RIGHT: ! case VK_ALPHANUMERIC: ! case VK_KATAKANA: ! case VK_HIRAGANA: ! case VK_FULL_WIDTH: ! case VK_HALF_WIDTH: ! case VK_ROMAN_CHARACTERS: ! case VK_ALL_CANDIDATES: ! case VK_PREVIOUS_CANDIDATE: ! case VK_CODE_INPUT: ! case VK_JAPANESE_KATAKANA: ! case VK_JAPANESE_HIRAGANA: ! case VK_JAPANESE_ROMAN: ! case VK_KANA_LOCK: ! case VK_INPUT_METHOD_ON_OFF: ! case VK_F13: ! case VK_F14: ! case VK_F15: ! case VK_F16: ! case VK_F17: ! case VK_F18: ! case VK_F19: ! case VK_F20: ! case VK_F21: ! case VK_F22: ! case VK_F23: ! case VK_F24: ! case VK_STOP: ! case VK_AGAIN: ! case VK_PROPS: ! case VK_UNDO: ! case VK_COPY: ! case VK_PASTE: ! case VK_FIND: ! case VK_CUT: ! return true; ! default: ! return false; ! } ! } ! ! /** ! * Returns a string identifying the event. This is formatted as the field ! * name of the id type, followed by the keyCode, then the keyChar (if ! * available), modifiers (if any), extModifiers (if any), and keyLocation. ! * The keyChar is available unless the keyCode is Backspace, Tab, Enter, ! * Escape, Numpad-[0-9], Delete, or a keyCode which is an action. ! * ! * @return a string identifying the event ! */ ! public String paramString() ! { ! StringBuffer s = new StringBuffer(); switch (id) { ! case KEY_PRESSED: ! s.append("KEY_PRESSED,keyCode="); ! break; ! case KEY_RELEASED: ! s.append("KEY_RELEASED,keyCode="); ! break; ! case KEY_TYPED: ! s.append("KEY_TYPED,keyCode="); ! break; ! default: ! s.append("unknown type,keyCode="); ! } ! s.append(keyCode); ! switch (keyCode) ! { ! default: ! if (! isActionKey()) ! { ! s.append(",keyChar='").append(keyChar).append('\''); ! break; ! } ! // Fallthrough. ! case VK_BACK_SPACE: ! case VK_TAB: ! case VK_ENTER: ! case VK_ESCAPE: ! case VK_NUMPAD0: ! case VK_NUMPAD1: ! case VK_NUMPAD2: ! case VK_NUMPAD3: ! case VK_NUMPAD4: ! case VK_NUMPAD5: ! case VK_NUMPAD6: ! case VK_NUMPAD7: ! case VK_NUMPAD8: ! case VK_NUMPAD9: ! case VK_DELETE: ! s.append(',').append(getKeyText(keyCode)); ! } ! if ((modifiers & CONVERT_MASK) != 0) ! s.append(",modifiers=").append(getModifiersExText(modifiers ! & CONVERT_MASK)); ! if (modifiers != 0) ! s.append(",extModifiers=").append(getModifiersExText(modifiers)); ! s.append(",keyLocation=KEY_LOCATION_"); ! switch (keyLocation) ! { ! case KEY_LOCATION_UNKNOWN: ! s.append("UNKNOWN"); ! break; ! case KEY_LOCATION_STANDARD: ! s.append("STANDARD"); ! break; ! case KEY_LOCATION_LEFT: ! s.append("LEFT"); ! break; ! case KEY_LOCATION_RIGHT: ! s.append("RIGHT"); ! break; ! case KEY_LOCATION_NUMPAD: ! s.append("NUMPAD"); ! } ! return s.toString(); } ! /** ! * Reads in the object from a serial stream. ! * ! * @param s the stream to read from ! * @throws IOException if deserialization fails ! * @throws ClassNotFoundException if deserialization fails ! * @serialData default, except that the modifiers are converted to new style ! */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException ! { ! s.defaultReadObject(); ! modifiers = EventModifier.extend(modifiers); ! } ! } // class KeyEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/KeyListener.java gcc-3.3/libjava/java/awt/event/KeyListener.java *** gcc-3.2.3/libjava/java/awt/event/KeyListener.java 2000-03-07 19:55:25.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/KeyListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,23 **** ! /* Copyright (C) 1999 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Per Bothner ! * @date Fenruary, 1999. */ ! /* Status: Believed complete and correct. */ ! public interface KeyListener extends java.util.EventListener ! { ! public void keyPressed (KeyEvent w); ! public void keyReleased (KeyEvent w); ! public void keyTyped (KeyEvent w); ! } --- 1,77 ---- ! /* KeyListener.java -- listen for keyboard presses ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to receive keyboard events. To ! * watch a subset of these events, use a KeyAdapter. ! * ! * @author Aaron M. Renn ! * @see KeyAdapter ! * @see KeyEvent ! * @since 1.1 ! * @status updated to 1.4 */ + public interface KeyListener extends EventListener + { + /** + * This method is called when a key is typed. A key is considered typed + * when it and all modifiers have been pressed and released, mapping to + * a single virtual key. + * + * @param event the KeyEvent indicating that a key was typed + */ + void keyTyped(KeyEvent event); ! /** ! * This method is called when a key is pressed. ! * ! * @param event the KeyEvent indicating the key press ! */ ! void keyPressed(KeyEvent event); ! /** ! * This method is called when a key is released. ! * ! * @param event the KeyEvent indicating the key release ! */ ! void keyReleased(KeyEvent event); ! } // interface KeyListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/MouseAdapter.java gcc-3.3/libjava/java/awt/event/MouseAdapter.java *** gcc-3.2.3/libjava/java/awt/event/MouseAdapter.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/MouseAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,39 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public abstract class MouseAdapter implements MouseListener { ! public void mouseClicked (MouseEvent e) { } ! public void mouseEntered (MouseEvent e) { } ! public void mouseExited (MouseEvent e) { } ! public void mousePressed (MouseEvent e) { } ! public void mouseReleased (MouseEvent e) { } ! } --- 1,106 ---- ! /* MouseAdapter.java -- convenience class for writing mouse listeners ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; /** ! * This class implements MouseListener and implements all methods ! * with empty bodies. This allows a listener interested in implementing only ! * a subset of the MouseListener interface to extend this class ! * and override only the desired methods. ! * ! * @author Aaron M. Renn ! * @see MouseEvent ! * @see MouseListener ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class MouseAdapter implements MouseListener { ! /** ! * Do nothing default constructor for subclasses. ! */ ! public MouseAdapter() { } ! /** ! * Implements this method in the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void mouseClicked(MouseEvent event) { } ! /** ! * Implements this method in the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void mousePressed(MouseEvent event) { } ! /** ! * Implements this method in the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void mouseReleased(MouseEvent event) { } ! /** ! * Implements this method in the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void mouseEntered(MouseEvent event) { } ! ! /** ! * Implements this method in the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void mouseExited(MouseEvent event) ! { ! } ! } // class MouseAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/MouseEvent.java gcc-3.3/libjava/java/awt/event/MouseEvent.java *** gcc-3.2.3/libjava/java/awt/event/MouseEvent.java 2002-01-28 06:34:01.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/MouseEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,113 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public class MouseEvent extends InputEvent { ! public static final int MOUSE_CLICKED = 500; ! public static final int MOUSE_DRAGGED = 506; ! public static final int MOUSE_ENTERED = 504; ! public static final int MOUSE_EXITED = 505; public static final int MOUSE_FIRST = 500; ! public static final int MOUSE_LAST = 506; ! public static final int MOUSE_MOVED = 503; public static final int MOUSE_PRESSED = 501; public static final int MOUSE_RELEASED = 502; ! public MouseEvent (Component source, int id, long when, int modifiers, ! int x, int y, int clickCount, boolean popupTrigger) { ! super (source, id); ! this.when = when; ! this.modifiers = modifiers; this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; } ! public int getClickCount () { ! return clickCount; } ! public Point getPoint () { ! return new Point (x, y); } ! public int getX () { ! return x; } ! public int getY () { ! return y; } ! public boolean isPopupTrigger () { return popupTrigger; } ! public String paramString () { ! String r; switch (id) { ! case MOUSE_CLICKED: ! r = "MOUSE_CLICKED"; ! break; ! case MOUSE_DRAGGED: ! r = "MOUSE_DRAGGED"; ! break; ! case MOUSE_ENTERED: ! r = "MOUSE_ENTERED"; ! break; ! case MOUSE_EXITED: ! r = "MOUSE_EXITED"; ! break; ! case MOUSE_MOVED: ! r = "MOUSE_MOVED"; ! break; ! case MOUSE_PRESSED: ! r = "MOUSE_PRESSED"; ! break; ! case MOUSE_RELEASED: ! r = "MOUSE_RELEASED"; ! break; ! default: ! r = "unknown id"; ! break; } ! r += ",(" + x + "," + y + "),modifiers=" + modifiers + ",clickCount=" + ! clickCount; ! return r; } ! public void translatePoint (int x, int y) { ! this.x += x; ! this.y += y; } ! ! private int x; ! private int y; ! private int clickCount; ! private boolean popupTrigger; ! } --- 1,431 ---- ! /* MouseEvent.java -- a mouse event ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.Component; ! import java.awt.Point; ! import java.io.IOException; ! import java.io.ObjectInputStream; ! import gnu.java.awt.EventModifier; /** ! * This event is generated for a mouse event. There are three main categories ! * of mouse events: Regular events include pressing, releasing, and clicking ! * buttons, as well as moving over the boundary of the unobscured portion of ! * a component. Motion events include movement and dragging. Wheel events are ! * covered separately by the subclass MouseWheelEvent. ! * ! *

        A mouse event is tied to the unobstructed visible component that the ! * mouse cursor was over at the time of the action. The button that was ! * most recently pressed is the only one that shows up in ! * getModifiers, and is returned by getButton, ! * while all buttons that are down show up in getModifiersEx. ! * ! *

        Drag events may be cut short if native drag-and-drop operations steal ! * the event. Likewise, if a mouse drag exceeds the bounds of a window or ! * virtual device, some platforms may clip the path to fit in the bounds of ! * the component. ! * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @see MouseAdapter ! * @see MouseListener ! * @see MouseMotionAdapter ! * @see MouseMotionListener ! * @see MouseWheelListener ! * @since 1.1 ! * @status updated to 1.4 */ public class MouseEvent extends InputEvent { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -991214153494842848L; ! ! /** This is the first id in the range of event ids used by this class. */ public static final int MOUSE_FIRST = 500; ! ! /** This is the last id in the range of event ids used by this class. */ ! public static final int MOUSE_LAST = 507; ! ! /** This event id indicates that the mouse was clicked. */ ! public static final int MOUSE_CLICKED = 500; ! ! /** This event id indicates that the mouse was pressed. */ public static final int MOUSE_PRESSED = 501; + + /** This event id indicates that the mouse was released. */ public static final int MOUSE_RELEASED = 502; ! /** This event id indicates that the mouse was moved. */ ! public static final int MOUSE_MOVED = 503; ! ! /** This event id indicates that the mouse entered a component. */ ! public static final int MOUSE_ENTERED = 504; ! ! /** This event id indicates that the mouse exited a component. */ ! public static final int MOUSE_EXITED = 505; ! ! /** ! * This indicates that no button changed state. ! * ! * @see #getButton() ! * @since 1.4 ! */ ! public static final int NOBUTTON = 0; ! ! /** ! * This indicates that button 1 changed state. ! * ! * @see #getButton() ! * @since 1.4 ! */ ! public static final int BUTTON1 = 1; ! ! /** ! * This indicates that button 2 changed state. ! * ! * @see #getButton() ! * @since 1.4 ! */ ! public static final int BUTTON2 = 2; ! ! /** ! * This indicates that button 3 changed state. ! * ! * @see #getButton() ! * @since 1.4 ! */ ! public static final int BUTTON3 = 3; ! ! /** This event id indicates that the mouse was dragged over a component. */ ! public static final int MOUSE_DRAGGED = 506; ! ! /** ! * This event id indicates that the mouse wheel was rotated. ! * ! * @since 1.4 ! */ ! public static final int MOUSE_WHEEL = 507; ! ! /** ! * The X coordinate of the mouse cursor at the time of the event. ! * ! * @see #getX() ! * @serial the x coordinate ! */ ! private int x; ! ! /** ! * The Y coordinate of the mouse cursor at the time of the event. ! * ! * @see #getY() ! * @serial the y coordinate ! */ ! private int y; ! ! /** ! * The number of clicks that took place. For MOUSE_CLICKED, MOUSE_PRESSED, ! * and MOUSE_RELEASED, this will be at least 1; otherwise it is 0. ! * ! * see #getClickCount() ! * @serial the number of clicks ! */ ! private final int clickCount; ! ! /** ! * Indicates which mouse button changed state. Can only be one of ! * {@link #NOBUTTON}, {@link #BUTTON1}, {@link #BUTTON2}, or ! * {@link #BUTTON3}. ! * ! * @see #getButton() ! * @since 1.4 ! */ ! private int button; ! ! /** ! * Whether or not this event should trigger a popup menu. ! * ! * @see PopupMenu ! * @see #isPopupTrigger() ! * @serial true if this is a popup trigger ! */ ! private final boolean popupTrigger; ! ! /** ! * Initializes a new instance of MouseEvent with the specified ! * information. Note that an invalid id leads to unspecified results. ! * ! * @param source the source of the event ! * @param id the event id ! * @param when the timestamp of when the event occurred ! * @param modifiers the modifier keys during the event, in old or new style ! * @param x the X coordinate of the mouse point ! * @param y the Y coordinate of the mouse point ! * @param clickCount the number of mouse clicks for this event ! * @param popupTrigger true if this event triggers a popup menu ! * @param button the most recent mouse button to change state ! * @throws IllegalArgumentException if source is null or button is invalid ! * @since 1.4 ! */ ! public MouseEvent(Component source, int id, long when, int modifiers, ! int x, int y, int clickCount, boolean popupTrigger, ! int button) { ! super(source, id, when, modifiers); this.x = x; this.y = y; this.clickCount = clickCount; this.popupTrigger = popupTrigger; + this.button = button; + if (button < NOBUTTON || button > BUTTON3) + throw new IllegalArgumentException(); + if ((modifiers & EventModifier.OLD_MASK) != 0) + { + if ((modifiers & BUTTON1_MASK) != 0) + button = BUTTON1; + else if ((modifiers & BUTTON2_MASK) != 0) + button = BUTTON2; + else if ((modifiers & BUTTON3_MASK) != 0) + button = BUTTON3; + } } ! /** ! * Initializes a new instance of MouseEvent with the specified ! * information. Note that an invalid id leads to unspecified results. ! * ! * @param source the source of the event ! * @param id the event id ! * @param when the timestamp of when the event occurred ! * @param modifiers the modifier keys during the event, in old or new style ! * @param x the X coordinate of the mouse point ! * @param y the Y coordinate of the mouse point ! * @param clickCount the number of mouse clicks for this event ! * @param popupTrigger true if this event triggers a popup menu ! * @throws IllegalArgumentException if source is null ! */ ! public MouseEvent(Component source, int id, long when, int modifiers, ! int x, int y, int clickCount, boolean popupTrigger) { ! this(source, id, when, modifiers, x, y, clickCount, popupTrigger, ! NOBUTTON); } ! /** ! * This method returns the X coordinate of the mouse position. This is ! * relative to the source component. ! * ! * @return the x coordinate ! */ ! public int getX() { ! return x; } ! /** ! * This method returns the Y coordinate of the mouse position. This is ! * relative to the source component. ! * ! * @return the y coordinate ! */ ! public int getY() { ! return y; } ! /** ! * This method returns a Point for the x,y position of ! * the mouse pointer. This is relative to the source component. ! * ! * @return a Point for the event position ! */ ! public Point getPoint() { ! return new Point(x, y); } ! /** ! * Translates the event coordinates by the specified x and y offsets. ! * ! * @param dx the value to add to the X coordinate of this event ! * @param dy the value to add to the Y coordiante of this event ! */ ! public void translatePoint(int dx, int dy) ! { ! x += dx; ! y += dy; ! } ! ! /** ! * This method returns the number of mouse clicks associated with this ! * event. ! * ! * @return the number of mouse clicks for this event ! */ ! public int getClickCount() ! { ! return clickCount; ! } ! ! /** ! * Returns which button, if any, was the most recent to change state. This ! * will be one of {@link #NOBUTTON}, {@link #BUTTON1}, {@link #BUTTON2}, or ! * {@link #BUTTON3}. ! * ! * @return the button that changed state ! * @since 1.4 ! */ ! public int getButton() ! { ! return button; ! } ! ! /** ! * This method tests whether or not the event is a popup menu trigger. This ! * should be checked in both MousePressed and MouseReleased to be ! * cross-platform compatible, as different systems have different popup ! * triggers. ! * ! * @return true if the event is a popup menu trigger ! */ ! public boolean isPopupTrigger() { return popupTrigger; } ! /** ! * Returns a string describing the modifiers, such as "Shift" or ! * "Ctrl+Button1". ! * ! * XXX Sun claims this can be localized via the awt.properties file - how ! * do we implement that? ! * ! * @param modifiers the old-style modifiers to convert to text ! * @return a string representation of the modifiers in this bitmask ! */ ! public static String getMouseModifiersText(int modifiers) { ! modifiers &= EventModifier.OLD_MASK; ! if ((modifiers & BUTTON2_MASK) != 0) ! modifiers |= BUTTON2_DOWN_MASK; ! if ((modifiers & BUTTON3_MASK) != 0) ! modifiers |= BUTTON3_DOWN_MASK; ! return getModifiersExText(EventModifier.extend(modifiers)); ! } ! ! /** ! * Returns a string identifying this event. This is formatted as the field ! * name of the id type, followed by the (x,y) point, the most recent button ! * changed, modifiers (if any), extModifiers (if any), and clickCount. ! * ! * @return a string identifying this event ! */ ! public String paramString() ! { ! StringBuffer s = new StringBuffer(); switch (id) { ! case MOUSE_CLICKED: ! s.append("MOUSE_CLICKED,("); ! break; ! case MOUSE_PRESSED: ! s.append("MOUSE_PRESSED,("); ! break; ! case MOUSE_RELEASED: ! s.append("MOUSE_RELEASED,("); ! break; ! case MOUSE_MOVED: ! s.append("MOUSE_MOVED,("); ! break; ! case MOUSE_ENTERED: ! s.append("MOUSE_ENTERED,("); ! break; ! case MOUSE_EXITED: ! s.append("MOUSE_EXITED,("); ! break; ! case MOUSE_DRAGGED: ! s.append("MOUSE_DRAGGED,("); ! break; ! case MOUSE_WHEEL: ! s.append("MOUSE_WHEEL,("); ! break; ! default: ! s.append("unknown type,("); } ! s.append(x).append(',').append(y).append("),button=").append(button); ! if ((modifiers & EventModifier.NEW_MASK) != 0) ! { ! int mod = modifiers; ! if ((mod & (ALT_DOWN_MASK | BUTTON2_DOWN_MASK)) != 0) ! mod |= ALT_DOWN_MASK | BUTTON2_DOWN_MASK; ! if ((mod & (META_DOWN_MASK | BUTTON3_DOWN_MASK)) != 0) ! mod |= META_DOWN_MASK | BUTTON3_DOWN_MASK; ! s.append(",modifiers=").append(getModifiersExText(mod)); ! } ! if (modifiers != 0) ! s.append(",extModifiers=").append(getModifiersExText(modifiers)); ! return s.append(",clickCount=").append(clickCount).toString(); } ! /** ! * Reads in the object from a serial stream. ! * ! * @param s the stream to read from ! * @throws IOException if deserialization fails ! * @throws ClassNotFoundException if deserialization fails ! * @serialData default, except that the modifiers are converted to new style ! */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException { ! s.defaultReadObject(); ! if ((modifiers & EventModifier.OLD_MASK) != 0) ! { ! if ((modifiers & BUTTON1_MASK) != 0) ! button = BUTTON1; ! else if ((modifiers & BUTTON2_MASK) != 0) ! button = BUTTON2; ! else if ((modifiers & BUTTON3_MASK) != 0) ! button = BUTTON3; ! modifiers = EventModifier.extend(modifiers); ! } } ! } // class MouseEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/MouseListener.java gcc-3.3/libjava/java/awt/event/MouseListener.java *** gcc-3.2.3/libjava/java/awt/event/MouseListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/MouseListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,25 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! /* Status: Believed complete and correct to JDK 1.2. */ ! public interface MouseListener extends java.util.EventListener ! { ! public void mouseClicked (MouseEvent e); ! public void mouseEntered (MouseEvent e); ! public void mouseExited (MouseEvent e); ! public void mousePressed (MouseEvent e); ! public void mouseReleased (MouseEvent e); ! } --- 1,94 ---- ! /* MouseListener.java -- listen for mouse clicks and crossing component edges ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to receive mouse events other than ! * simple motion events. This includes clicks (but not mouse wheel events), ! * and crossing component boundaries without change in button status. To ! * track moves and drags, use MouseMotionListener, and to track wheel events, ! * use MouseWheelListener. To watch a subset of these events, use a ! * MouseAdapter. ! * ! * @author Aaron M. Renn ! * @see MouseAdapter ! * @see MouseEvent ! * @since 1.1 ! * @status updated to 1.4 */ + public interface MouseListener extends EventListener + { + /** + * This method is called when the mouse is clicked (pressed and released + * in short succession) on a component. + * + * @param event the MouseEvent indicating the click + */ + void mouseClicked(MouseEvent event); ! /** ! * This method is called when the mouse is pressed over a component. ! * ! * @param event the MouseEvent for the press ! */ ! void mousePressed(MouseEvent event); ! /** ! * This method is called when the mouse is released over a component. ! * ! * @param event the MouseEvent for the release ! */ ! void mouseReleased(MouseEvent event); ! ! /** ! * This method is called when the mouse enters a component. ! * ! * @param event the MouseEvent for the entry ! */ ! void mouseEntered(MouseEvent event); ! ! /** ! * This method is called when the mouse exits a component. ! * ! * @param event the MouseEvent for the exit ! */ ! void mouseExited(MouseEvent event); ! } // interface MouseListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/MouseMotionAdapter.java gcc-3.3/libjava/java/awt/event/MouseMotionAdapter.java *** gcc-3.2.3/libjava/java/awt/event/MouseMotionAdapter.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/MouseMotionAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,27 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public abstract class MouseMotionAdapter implements MouseMotionListener { ! public void mouseDragged (MouseEvent e) { } ! public void mouseMoved (MouseEvent e) { } ! } --- 1,79 ---- ! /* MouseMotionAdapter.java -- convenience class for mouse motion listeners ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; /** ! * This class implements MouseMotionListener and implements all ! * methods with empty bodies. This allows a listener interested in ! * implementing only a subset of the MouseMotionListener ! * interface to extend this class and override only the desired methods. ! * ! * @author Aaron M. Renn ! * @see MouseEvent ! * @see MouseMotionListener ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class MouseMotionAdapter implements MouseMotionListener { ! /** ! * Do nothing default constructor for subclasses. ! */ ! public MouseMotionAdapter() { } ! /** ! * Implement this method in the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void mouseDragged(MouseEvent event) { } ! ! /** ! * Implement this method in the interface with an empty body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void mouseMoved(MouseEvent event) ! { ! } ! } // class MouseMotionAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/MouseMotionListener.java gcc-3.3/libjava/java/awt/event/MouseMotionListener.java *** gcc-3.2.3/libjava/java/awt/event/MouseMotionListener.java 2000-04-09 04:13:27.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/MouseMotionListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,22 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ ! ! /* Status: Believed complete and correct to JDK 1.2. */ ! ! public interface MouseMotionListener extends java.util.EventListener { ! public void mouseDragged (MouseEvent e); ! public void mouseMoved (MouseEvent e); ! } --- 1,72 ---- ! /* MouseMotionListener.java -- listen to mouse motion events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to be notified of mouse movements. ! * This includes moves and drags, but not crossing component boundaries. To ! * track other mouse events, use MouseListener or MouseWheelListener. To ! * watch a subset of these events, use a MouseMotionAdapter. ! * ! * @author Aaron M. Renn ! * @see MouseMotionAdapter ! * @see MouseEvent ! * @since 1.1 ! * @status updated to 1.4 */ ! public interface MouseMotionListener extends EventListener { ! /** ! * This method is called when the mouse is moved over a component ! * while a button has been pressed. ! * ! * @param event the MouseEvent indicating the motion ! */ ! void mouseDragged(MouseEvent event); ! ! /** ! * This method is called when the mouse is moved over a component ! * while no button is pressed. ! * ! * @param event the MouseEvent indicating the motion ! */ ! void mouseMoved(MouseEvent event); ! } // interface MouseMotionListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/MouseWheelEvent.java gcc-3.3/libjava/java/awt/event/MouseWheelEvent.java *** gcc-3.2.3/libjava/java/awt/event/MouseWheelEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/MouseWheelEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,227 ---- + /* MouseWheelEvent.java -- a mouse wheel event + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.event; + + import java.awt.Component; + import java.awt.Point; + + /** + * This event is generated for a mouse wheel rotation. The wheel (the middle + * mouse button on most modern mice) can be rotated towards or away from the + * user, and is ofteh used for scrolling. + * + *

        Because of the special use for scrolling components, MouseWheelEvents + * often affect a different component than the one located at the point of + * the event. If the component under the mouse cursor does not accept wheel + * events, the event is passed to the first ancestor container which does. This + * is often a ScrollPane, which knows how to scroll. If an AWT component is + * built from a native widget that knows how to use mouse wheel events, that + * component will consume the event. + * + *

        The two most common scroll types are "units" (lines at a time) or + * "blocks" (pages at a time). The initial setting is taken from the platform, + * although the user can adjust the setting at any time. + * + * @author Eric Blake + * @see MouseWheelListener + * @see ScrollPane + * @see ScrollPane#setWheelScrollingEnabled(boolean) + * @see JScrollPane + * @see JScrollPane#setWheelScrollingEnabled(boolean) + * @since 1.4 + * @status updated to 1.4 + */ + public class MouseWheelEvent extends MouseEvent + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 6459879390515399677L; + + /** + * Indicates scrolling by units (lines). + * + * @see #getScrollType() + */ + public static final int WHEEL_UNIT_SCROLL = 0; + + /** + * Indicates scrolling by blocks (pages). + * + * @see #getScrollType() + */ + public static final int WHEEL_BLOCK_SCROLL = 1; + + /** + * Indicates what scroll type should take place. This should be limited + * to {@link #WHEEL_UNIT_SCROLL} and {@link #WHEEL_BLOCK_SCROLL}. + * + * @serial the scroll type + */ + private final int scrollType; + + /** + * Indicates the scroll amount. This is only meaningful if scrollType is + * WHEEL_UNIT_SCROLL. + * + * @serial the number of lines to scroll + */ + private final int scrollAmount; + + /** + * Indicates how far the mouse wheel was rotated. + * + * @serial the rotation amount + */ + private final int wheelRotation; + + /** + * Initializes a new instance of MouseWheelEvent with the + * specified information. Note that an invalid id leads to unspecified + * results. + * + * @param source the source of the event + * @param id the event id + * @param when the timestamp of when the event occurred + * @param modifiers any modifier bits for this event + * @param x the X coordinate of the mouse point + * @param y the Y coordinate of the mouse point + * @param clickCount the number of mouse clicks for this event + * @param popupTrigger true if this event triggers a popup menu + * @param scrollType one of {@link #WHEEL_UNIT_SCROLL}, + * {@link #WHEEL_BLOCK_SCROLL} + * @param scrollAmount the number of units to scroll, ignored for block type + * @param wheelRotation the number of rotation "clicks" + * @throws IllegalArgumentException if source is null + * @see MouseEvent#MouseEvent(Component, int, long, int, int, int, int, + * boolean) + */ + public MouseWheelEvent(Component source, int id, long when, int modifiers, + int x, int y, int clickCount, boolean popupTrigger, + int scrollType, int scrollAmount, int wheelRotation) + { + super(source, id, when, modifiers, x, y, clickCount, popupTrigger); + this.scrollType = scrollType; + this.scrollAmount = scrollAmount; + this.wheelRotation = wheelRotation; + } + + /** + * This method returns the scrolling pattern this event requests. Legal + * values are WHEEL_UNIT_SCROLL and WHEEL_BLOCK_SCROLL. + * + * @return the scroll type + * @see Adjustable#getUnitIncrement() + * @see Adjustable#getBlockIncrement() + * @see Scrollable#getScrollableUnitIncrement(Rectangle, int, int) + * @see Scrollable#getScrollableBlockIncrement(Rectangle, int, int) + */ + public int getScrollType() + { + return scrollType; + } + + /** + * Returns the number of units to scroll in response to this event. This + * only makes sense when the scroll type is WHEEL_UNIT_SCROLL. + * + * @return the number of scroll units, if defined + * @see #getScrollType() + */ + public int getScrollAmount() + { + return scrollAmount; + } + + /** + * Gets the number of "clicks" the wheel was rotated. Negative values move + * up (away) from the user, positive values move down (towards) the user. + * + * @return the number of rotation clicks + */ + public int getWheelRotation() + { + return wheelRotation; + } + + /** + * This is a convenience method which aids in a common listener for scrolling + * a scrollpane (although this is already built into ScrollPane and + * JScrollPane). This method only makes sense when getScrollType() returns + * WHEEL_UNIT_SCROLL. + * + *

        This accounts for direction of scroll and amount of wheel movement, as + * interpreted by the platform settings. + * + * @return the number of units to scroll + * @see #getScrollType() + * @see #getScrollAmount() + * @see MouseWheelListener + * @see Adjustable + * @see Adjustable#getUnitIncrement() + * @see Scrollable + * @see Scrollable#getScrollableUnitIncrement(Rectangle, int, int) + * @see ScrollPane + * @see ScrollPane#setWheelScrollingEnabled(boolean) + * @see JScrollPane + * @see JScrollPane#setWheelScrollingEnabled(boolean) + */ + public int getUnitsToScroll() + { + return wheelRotation * scrollAmount; + } + + /** + * Returns a string identifying this event. For mouse wheel events, this + * is super.paramString() + ",scrollType=WHEEL_" + + * (getScrollType() == WHEEL_UNIT_SCROLL ? "UNIT" : "BLOCK") + * + "_SCROLL,scrollAmount=" + getScrollAmount() + ",wheelRotation=" + * + getWheelRotation(). + * + * @return a string identifying this event + */ + public String paramString() + { + return super.paramString() + ",scrollType=" + + (scrollType == WHEEL_UNIT_SCROLL ? "WHEEL_UNIT_SCROLL" + : scrollType == WHEEL_BLOCK_SCROLL ? "WHEEL_BLOCK_SCROLL" + : "unknown scroll type") + + ",scrollAmount=" + scrollAmount + ",wheelRotation=" + wheelRotation; + } + } // class MouseWheelEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/MouseWheelListener.java gcc-3.3/libjava/java/awt/event/MouseWheelListener.java *** gcc-3.2.3/libjava/java/awt/event/MouseWheelListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/MouseWheelListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,60 ---- + /* MouseWheelListener.java -- listen for mouse wheel events + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.event; + + import java.util.EventListener; + + /** + * This interface is for classes that wish to receive mouse wheel events. For + * other events, use MouseListener or MouseMotionListener. + * + * @author Eric Blake + * @see MouseWheelEvent + * @since 1.4 + * @status updated to 1.4 + */ + public interface MouseWheelListener extends EventListener + { + /** + * This method is called when the mouse wheel is rotated. + * + * @param event the MouseWheelEvent indicating the rotation + */ + void mouseWheelMoved(MouseWheelEvent event); + } // interface MouseWheelListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/PaintEvent.java gcc-3.3/libjava/java/awt/event/PaintEvent.java *** gcc-3.2.3/libjava/java/awt/event/PaintEvent.java 2000-07-12 03:32:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/PaintEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,63 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; ! import java.awt.*; /** ! * @author Tom Tromey ! * @date April 8, 2000 */ - - /* Status: Believed complete and correct to JDK 1.2. */ - public class PaintEvent extends ComponentEvent { ! public static final int PAINT = 800; public static final int PAINT_FIRST = 800; public static final int PAINT_LAST = 801; public static final int UPDATE = 801; ! public PaintEvent (Component source, int id, Rectangle updateRect) { ! super (source, id); this.updateRect = updateRect; } ! public Rectangle getUpdateRect () { return updateRect; } ! public String paramString () { ! String r; ! switch (id) ! { ! case UPDATE: ! r = "UPDATE"; ! break; ! case PAINT: ! r = "PAINT"; ! break; ! default: ! r = "unknown id"; ! break; ! } ! ! r += ",updateRect=" + updateRect; ! return r; } ! public void setUpdateRect (Rectangle updateRect) { ! this.updateRect = updateRect; } ! ! private Rectangle updateRect; ! } --- 1,127 ---- ! /* PaintEvent.java -- an area of the screen needs to be repainted ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! ! import java.awt.Component; ! import java.awt.Rectangle; /** ! * This event is generated when an area of the screen needs to be painted. ! * This event is not meant for users, but exists to allow proper serialization ! * behavior in the EventQueue with user-accessible events. ! * ! * @author Aaron M. Renn ! * @since 1.1 ! * @status updated to 1.4 */ public class PaintEvent extends ComponentEvent { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 1267492026433337593L; ! ! /** This is the first id in the range of event ids used by this class. */ public static final int PAINT_FIRST = 800; + + /** This is the last id in the range of event ids used by this class. */ public static final int PAINT_LAST = 801; + + /** This id is for paint event types. */ + public static final int PAINT = 800; + + /** This id is for update event types. */ public static final int UPDATE = 801; ! /** ! * This is the rectange to be painted or updated. ! * ! * @see #getUpdateRect() ! * @see #setUpdateRect(Rectangle) ! * @serial the non-null rectangle to be painted ! */ ! private Rectangle updateRect; ! ! /** ! * Initializes a new instance of PaintEvent with the specified ! * source, id, and update region. Note that an invalid id leads to ! * unspecified results. ! * ! * @param source the event source ! * @param id the event id ! * @param updateRect the rectangle to repaint ! * @throws IllegalArgumentException if source is null ! */ ! public PaintEvent(Component source, int id, Rectangle updateRect) { ! super(source, id); this.updateRect = updateRect; } ! /** ! * Returns the rectange to be updated for this event. ! * ! * @return the rectangle to update ! */ ! public Rectangle getUpdateRect() { return updateRect; } ! /** ! * Sets the rectangle to be updated for this event. ! * ! * @param updateRect the new update rectangle for this event ! */ ! public void setUpdateRect(Rectangle updateRect) { ! this.updateRect = updateRect; } ! /** ! * Returns a string identifying this event. ! * ! * @return a string identifying this event ! */ ! public String paramString() { ! return (id == PAINT ? "PAINT,updateRect=" : id == UPDATE ! ? "UPDATE,updateRect=" : "unknown type,updateRect=") + updateRect; } ! } // class PaintEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/TextEvent.java gcc-3.3/libjava/java/awt/event/TextEvent.java *** gcc-3.2.3/libjava/java/awt/event/TextEvent.java 2000-07-12 03:32:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/TextEvent.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,29 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; - import java.awt.*; ! /* Status: Believed complete and correct to JDK 1.2. */ public class TextEvent extends AWTEvent { public static final int TEXT_FIRST = 900; public static final int TEXT_LAST = 900; public static final int TEXT_VALUE_CHANGED = 900; ! public TextEvent (Object source, int id) { ! super (source, id); } ! public String paramString () { ! return "TEXT_VALUE_CHANGED"; } ! } --- 1,92 ---- ! /* TextEvent.java -- event for text changes ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! import java.awt.AWTEvent; + /** + * This event is generated when a text box changes contents. This is an + * abstraction that distills a large number of individual mouse or keyboard + * events into a simpler "text changed" event. + * + * @author Aaron M. Renn + * @see TextComponent + * @see TextListener + * @since 1.1 + * @status updated to 1.4 + */ public class TextEvent extends AWTEvent { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 6269902291250941179L; + + /** This is the first id in the range of event ids used by this class. */ public static final int TEXT_FIRST = 900; + + /** This is the last id in the range of event ids used by this class. */ public static final int TEXT_LAST = 900; + + /** This event id indicates that the text of an object has changed. */ public static final int TEXT_VALUE_CHANGED = 900; ! /** ! * Initializes a new instance of TextEvent with the specified ! * source and id. Note that an invalid id leads to unspecified results. ! * ! * @param source the (TextComponent) object that generated this event ! * @param id the event id ! * @throws IllegalArgumentException if source is null ! */ ! public TextEvent(Object source, int id) { ! super(source, id); } ! /** ! * Returns a string identifying this event. This is "TEXT_VALUE_CHANGED". ! * ! * @return a string identifying this event ! */ ! public String paramString() { ! return id == TEXT_VALUE_CHANGED ? "TEXT_VALUE_CHANGED" : "unknown type"; } ! } // class TextEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/TextListener.java gcc-3.3/libjava/java/awt/event/TextListener.java *** gcc-3.2.3/libjava/java/awt/event/TextListener.java 2000-03-07 19:55:25.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/TextListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,22 **** ! /* Copyright (C) 1999 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Per Bothner ! * @date Fenruary, 1999. */ ! ! /* Status: Believed complete and correct. */ ! ! public interface TextListener extends java.util.EventListener { ! public void textValueChanged (TextEvent w); ! } ! --- 1,60 ---- ! /* TextListener.java -- listen for text changes ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to be notified when text changes ! * in a component. ! * ! * @author Aaron M. Renn ! * @see TextEvent ! * @since 1.1 ! * @status updated to 1.4 */ ! public interface TextListener extends EventListener { ! /** ! * This method is called when the text being monitored changes. ! * ! * @param event the TextEvent indicating the change ! */ ! void textValueChanged(TextEvent event); ! } // interface TextListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/WindowAdapter.java gcc-3.3/libjava/java/awt/event/WindowAdapter.java *** gcc-3.2.3/libjava/java/awt/event/WindowAdapter.java 2000-12-04 02:27:20.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/WindowAdapter.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,27 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Per Bothner ! * @date February, 1999. */ ! /* Status: Believed complete and correct. */ ! public abstract class WindowAdapter implements WindowListener ! { ! public void windowActivated (WindowEvent w) { } ! public void windowClosed (WindowEvent w) { } ! public void windowClosing (WindowEvent w) { } ! public void windowDeactivated (WindowEvent w) { } ! public void windowDeiconified (WindowEvent w) { } ! public void windowIconified (WindowEvent w) { } ! public void windowOpened (WindowEvent w) { } ! } --- 1,156 ---- ! /* WindowAdapter.java -- convenience class for writing window listeners ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; /** ! * This class implements WindowListener, ! * WindowStateListener, and WindowFocusListener, and ! * implements all methods with empty bodies. This allows a listener ! * interested in listening to only a subset of any WindowEvent ! * actions to extend this class and override only the desired methods. ! * ! * @author Aaron M. Renn ! * @see ComponentEvent ! * @see ComponentListener ! * @since 1.1 ! * @status updated to 1.4 */ + public abstract class WindowAdapter + implements WindowListener, WindowStateListener, WindowFocusListener + { + /** + * Do nothing default constructor for subclasses. + */ + public WindowAdapter() + { + } ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void windowOpened(WindowEvent event) ! { ! } ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void windowClosing(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void windowClosed(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void windowIconified(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void windowDeiconified(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void windowActivated(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! */ ! public void windowDeactivated(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! * @since 1.4 ! */ ! public void windowStateChanged(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! * @since 1.4 ! */ ! public void windowGainedFocus(WindowEvent event) ! { ! } ! ! /** ! * Implements this method from the interface with an empty method body. ! * ! * @param event the event, ignored in this implementation ! * @since 1.4 ! */ ! public void windowLostFocus(WindowEvent event) ! { ! } ! } // class WindowAdapter diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/WindowEvent.java gcc-3.3/libjava/java/awt/event/WindowEvent.java *** gcc-3.2.3/libjava/java/awt/event/WindowEvent.java 2000-08-09 13:01:44.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/WindowEvent.java 2003-01-02 00:14:08.000000000 +0000 *************** *** 1,65 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; - import java.awt.*; ! /* Status: Believed complete and correct to JDK 1.2. */ public class WindowEvent extends ComponentEvent { ! public static final int WINDOW_ACTIVATED = 205; ! public static final int WINDOW_CLOSED = 202; ! public static final int WINDOW_CLOSING = 201; ! public static final int WINDOW_DEACTIVATED = 206; ! public static final int WINDOW_DEICONIFIED = 204; public static final int WINDOW_FIRST = 200; ! public static final int WINDOW_ICONIFIED = 203; ! public static final int WINDOW_LAST = 206; public static final int WINDOW_OPENED = 200; ! public WindowEvent (Window source, int id) { ! super (source, id); } ! public Window getWindow () { ! return (Window) source; } ! public String paramString () { ! String r = ""; switch (id) { ! case WINDOW_ACTIVATED: ! r = "WINDOW_ACTIVATED"; ! break; ! case WINDOW_CLOSED: ! r = "WINDOW_CLOSED"; ! break; ! case WINDOW_CLOSING: ! r = "WINDOW_CLOSING"; ! break; ! case WINDOW_DEACTIVATED: ! r = "WINDOW_DEACTIVATED"; ! break; ! case WINDOW_DEICONIFIED: ! r = "WINDOW_DEICONIFIED"; ! break; ! case WINDOW_ICONIFIED: ! r = "WINDOW_ICONIFIED"; ! break; ! case WINDOW_OPENED: ! r = "WINDOW_OPENED"; ! break; } ! return r; } ! } --- 1,311 ---- ! /* WindowEvent.java -- window change event ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; ! import java.awt.Window; + /** + * This event is generated when there is a change in a window. This includes + * creation, closing, iconification, activation, and focus changes. There + * are three listeners, for three types of events: WindowListeners deal with + * the lifecycle of a window, WindowStateListeners deal with window state + * like maximization, and WindowFocusListeners deal with focus switching to + * or from a window. + * + * @author Aaron M. Renn + * @see WindowAdapter + * @see WindowListener + * @see WindowFocusListener + * @see WindowStateListener + * @since 1.1 + * @status updated to 1.4 + */ public class WindowEvent extends ComponentEvent { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -1567959133147912127L; ! ! /** This is the first id in the range of event ids used by this class. */ public static final int WINDOW_FIRST = 200; ! ! /** This is the id for a window that is opened. */ public static final int WINDOW_OPENED = 200; ! /** This is the id for a window that is about to close. */ ! public static final int WINDOW_CLOSING = 201; ! ! /** This is the id for a window that finished closing. */ ! public static final int WINDOW_CLOSED = 202; ! ! /** This is the id for a window that is iconified. */ ! public static final int WINDOW_ICONIFIED = 203; ! ! /** This is the id for a window that is de-iconified. */ ! public static final int WINDOW_DEICONIFIED = 204; ! ! /** This is the id for a window that is activated. */ ! public static final int WINDOW_ACTIVATED = 205; ! ! /** This is the id for a window that is de-activated. */ ! public static final int WINDOW_DEACTIVATED = 206; ! ! /** ! * This is the id for a window becoming the focused window. ! * ! * @since 1.4 ! */ ! public static final int WINDOW_GAINED_FOCUS = 207; ! ! /** ! * This is the id for a window losing all focus. ! * ! * @since 1.4 ! */ ! public static final int WINDOW_LOST_FOCUS = 208; ! ! /** ! * This is the id for a window state change, such as maximization. ! * ! * @since 1.4 ! */ ! public static final int WINDOW_STATE_CHANGED = 209; ! ! /** This is the last id in the range of event ids used by this class. */ ! public static final int WINDOW_LAST = 209; ! ! /** ! * The other Window involved in a focus or activation change. For ! * WINDOW_ACTIVATED and WINDOW_GAINED_FOCUS events, this is the window that ! * lost focus; for WINDOW_DEACTIVATED and WINDOW_LOST_FOCUS, this is the ! * window that stole focus; and for other events (or when native ! * implementation does not have the data available), this is null. ! * ! * @see #getOppositeWindow() ! * @serial the opposite window, or null ! * @since 1.4 ! */ ! private final Window opposite; ! ! /** ! * The former state of the window. ! * ! * @serial bitmask of the old window state ! * @since 1.4 ! */ ! private final int oldState; ! ! /** ! * The present state of the window. ! * ! * @serial bitmask of the new window state ! * @since 1.4 ! */ ! private final int newState; ! ! /** ! * Initializes a new instance of WindowEvent with the specified ! * parameters. Note that an invalid id leads to unspecified results. ! * ! * @param source the window that generated this event ! * @param id the event id ! * @param opposite the window that received the opposite event, or null ! * @param oldState the previous state of this window ! * @param newState the new state of this window ! * @throws IllegalArgumentException if source is null ! * @since 1.4 ! */ ! public WindowEvent(Window source, int id, Window opposite, ! int oldState, int newState) { ! super(source, id); ! this.opposite = opposite; ! this.oldState = oldState; ! this.newState = newState; } ! /** ! * Initializes a new instance of WindowEvent with the specified ! * parameters. Note that an invalid id leads to unspecified results. ! * ! * @param source the window that generated this event ! * @param id the event id ! * @param opposite the window that received the opposite event, or null ! * @throws IllegalArgumentException if source is null ! * @since 1.4 ! */ ! public WindowEvent(Window source, int id, Window opposite) { ! this(source, id, opposite, 0, 0); } ! /** ! * Initializes a new instance of WindowEvent with the specified ! * parameters. Note that an invalid id leads to unspecified results. ! * ! * @param source the window that generated this event ! * @param id the event id ! * @param oldState the previous state of this window ! * @param newState the new state of this window ! * @throws IllegalArgumentException if source is null ! * @since 1.4 ! */ ! public WindowEvent(Window source, int id, int oldState, int newState) { ! this(source, id, null, oldState, newState); ! } ! ! /** ! * Initializes a new instance of WindowEvent with the specified ! * parameters. Note that an invalid id leads to unspecified results. ! * ! * @param source the window that generated this event ! * @param id the event id ! * @throws IllegalArgumentException if source is null ! */ ! public WindowEvent(Window source, int id) ! { ! this(source, id, null, 0, 0); ! } ! ! /** ! * Returns the event source as a Window. If the source has ! * subsequently been modified to a non-Window, this returns null. ! * ! * @return the event source as a Window ! */ ! public Window getWindow() ! { ! return source instanceof Window ? (Window) source : null; ! } ! ! /** ! * Returns the opposite window if this window was involved in an activation ! * or focus change. For WINDOW_ACTIVATED and WINDOW_GAINED_FOCUS events, ! * this is the window that lost focus; for WINDOW_DEACTIVATED and ! * WINDOW_LOST_FOCUS, this is the window that stole focus; and for other ! * events (or when native implementation does not have the data available), ! * this is null. ! * ! * @return the opposite window, or null ! * @since 1.4 ! */ ! public Window getOppositeWindow() ! { ! return opposite; ! } ! ! /** ! * Returns the state of this window before the event. This is the bitwise ! * or of fields in Frame: NORMAL, ICONIFIED, MAXIMIZED_HORIZ, MAXIMIZED_VERT, ! * and MAXIMIZED_BOTH. ! * ! * @return the former state ! * @see Frame#getExtendedState() ! * @since 1.4 ! */ ! public int getOldState() ! { ! return oldState; ! } ! ! /** ! * Returns the state of this window after the event. This is the bitwise ! * or of fields in Frame: NORMAL, ICONIFIED, MAXIMIZED_HORIZ, MAXIMIZED_VERT, ! * and MAXIMIZED_BOTH. ! * ! * @return the updated state ! * @see Frame#getExtendedState() ! * @since 1.4 ! */ ! public int getNewState() ! { ! return newState; ! } ! ! /** ! * Returns a string that identifies this event. This is formatted as the ! * field name of the id, followed by the opposite window, old state, and ! * new state. ! * ! * @return a string that identifies this event ! */ ! public String paramString() ! { ! StringBuffer s = new StringBuffer(); switch (id) { ! case WINDOW_OPENED: ! s.append("WINDOW_OPENED,opposite="); ! break; ! case WINDOW_CLOSING: ! s.append("WINDOW_CLOSING,opposite="); ! break; ! case WINDOW_CLOSED: ! s.append("WINDOW_CLOSED,opposite="); ! break; ! case WINDOW_ICONIFIED: ! s.append("WINDOW_ICONIFIED,opposite="); ! break; ! case WINDOW_DEICONIFIED: ! s.append("WINDOW_DEICONIFIED,opposite="); ! break; ! case WINDOW_ACTIVATED: ! s.append("WINDOW_ACTIVATED,opposite="); ! break; ! case WINDOW_DEACTIVATED: ! s.append("WINDOW_DEACTIVATED,opposite="); ! break; ! case WINDOW_GAINED_FOCUS: ! s.append("WINDOW_GAINED_FOCUS,opposite="); ! break; ! case WINDOW_LOST_FOCUS: ! s.append("WINDOW_LOST_FOCUS,opposite="); ! break; ! case WINDOW_STATE_CHANGED: ! s.append("WINDOW_STATE_CHANGED,opposite="); ! break; ! default: ! s.append("unknown type,opposite="); } ! return s.append(opposite).append(",oldState=").append(oldState) ! .append(",newState=").append(newState).toString(); } ! } // class WindowEvent diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/WindowFocusListener.java gcc-3.3/libjava/java/awt/event/WindowFocusListener.java *** gcc-3.2.3/libjava/java/awt/event/WindowFocusListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/WindowFocusListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,68 ---- + /* WindowFocusListener.java -- listens for window focus events + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.event; + + import java.util.EventListener; + + /** + * This interface is for classes that wish to monitor events for window + * focus changes. To watch a subset of these events, use a WindowAdapter. + * + * @author Eric Blake + * @see WindowAdapter + * @see WindowEvent + * @since 1.4 + * @status updated to 1.4 + */ + public interface WindowFocusListener extends EventListener + { + /** + * This method is called when a window gains focus. + * + * @param event the WindowEvent indicating the focus change + */ + void windowGainedFocus(WindowEvent event); + + /** + * This method is called when a window loses focus. + * + * @param event the WindowEvent indicating the focus change + */ + void windowLostFocus(WindowEvent event); + } // interface WindowFocusListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/WindowListener.java gcc-3.3/libjava/java/awt/event/WindowListener.java *** gcc-3.2.3/libjava/java/awt/event/WindowListener.java 2000-03-07 19:55:25.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/WindowListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,27 **** ! /* Copyright (C) 1999 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt.event; /** ! * @author Per Bothner ! * @date Fenruary, 1999. */ ! /* Status: Believed complete and correct. */ ! public interface WindowListener extends java.util.EventListener ! { ! public void windowActivated (WindowEvent w); ! public void windowClosed (WindowEvent w); ! public void windowClosing (WindowEvent w); ! public void windowDeactivated (WindowEvent w); ! public void windowDeiconified (WindowEvent w); ! public void windowIconified (WindowEvent w); ! public void windowOpened (WindowEvent w); ! } --- 1,107 ---- ! /* WindowListener.java -- listens for window events ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt.event; + import java.util.EventListener; + /** ! * This interface is for classes that wish to monitor events for window ! * changes. To watch a subset of these events, use a WindowAdapter. ! * ! * @author Aaron M. Renn ! * @see WindowAdapter ! * @see WindowEvent ! * @since 1.1 ! * @status updated to 1.4 */ + public interface WindowListener extends EventListener + { + /** + * This method is called when the window is made visible. + * + * @param event the WindowEvent indicating the change + */ + void windowOpened(WindowEvent event); ! /** ! * This method is called when the user calls the system menu close ! * function, giving the program a chance to cancel the close. ! * ! * @param event the WindowEvent indicating the close attempt ! */ ! void windowClosing(WindowEvent event); ! /** ! * This method is called when the window is closed. ! * ! * @param event the WindowEvent indicating the dispose ! */ ! void windowClosed(WindowEvent event); ! ! /** ! * This method is called when the window is iconified. ! * ! * @param event the WindowEvent indicating the iconification ! * @see Frame#setIconImage(Image) ! */ ! void windowIconified(WindowEvent event); ! ! /** ! * This method is called when the window is deiconified. ! * ! * @param event the WindowEvent indicating the deiconification ! */ ! void windowDeiconified(WindowEvent event); ! ! /** ! * This method is called when a window is activated. Only Frames and Dialogs ! * can be active, and the active window always contains the component with ! * focus. ! * ! * @param event the WindowEvent indicating the activation ! */ ! void windowActivated(WindowEvent event); ! ! /** ! * This method is called when the window is deactivated. ! * ! * @param event the WindowEvent indicating the deactivation ! */ ! void windowDeactivated(WindowEvent event); ! } // interface WindowListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/event/WindowStateListener.java gcc-3.3/libjava/java/awt/event/WindowStateListener.java *** gcc-3.2.3/libjava/java/awt/event/WindowStateListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/event/WindowStateListener.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* WindowStateListener.java -- listens for window state changes + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.event; + + import java.util.EventListener; + + /** + * This interface is for classes that wish to monitor events for window + * state changes. + * + * @author Eric Blake + * @see WindowAdapter + * @see WindowEvent + * @since 1.4 + * @status updated to 1.4 + */ + public interface WindowStateListener extends EventListener + { + /** + * This method is called when the window state is changed, because of + * iconification or maximization. + * + * @param event the WindowEvent indicating the change + */ + void windowStateChanged(WindowEvent event); + } // interface WindowStateListener diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Event.java gcc-3.3/libjava/java/awt/Event.java *** gcc-3.2.3/libjava/java/awt/Event.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/Event.java 2002-11-10 00:16:42.000000000 +0000 *************** package java.awt; *** 45,115 **** public class Event implements java.io.Serializable { ! public static final int SHIFT_MASK = 1, ! CTRL_MASK = 2, ! META_MASK = 4, ! ALT_MASK = 8; ! public static final int ACTION_EVENT = 1001, ! BACK_SPACE = 8, ! CAPS_LOCK = 1022, ! DELETE = 127, ! DOWN = 1005, ! END = 1001, ! ENTER = 10, ! ESCAPE = 27, ! F1 = 1008, ! F10 = 1017, ! F11 = 1018, ! F12 = 1019, ! F2 = 1009, ! F3 = 1010, ! F4 = 1011, ! F5 = 1012, ! F6 = 1013, ! F7 = 1014, ! F8 = 1015, ! F9 = 1016, ! GOT_FOCUS = 1004, ! HOME = 1000, ! INSERT = 1025, ! KEY_ACTION = 403, ! KEY_ACTION_RELEASE = 404, ! KEY_PRESS = 401, ! KEY_RELEASE = 402, ! LEFT = 1006, ! LIST_DESELECT = 702, ! LIST_SELECT = 701, ! LOAD_FILE = 1002, ! LOST_FOCUS = 1005, ! MOUSE_DOWN = 501, ! MOUSE_DRAG = 506, ! MOUSE_ENTER = 504, ! MOUSE_EXIT = 505, ! MOUSE_MOVE = 503, ! MOUSE_UP = 502, ! NUM_LOCK = 1023, ! PAUSE = 1024, ! PGDN = 1003, ! PGUP = 1002, ! PRINT_SCREEN = 1020, ! RIGHT = 1007, ! SAVE_FILE = 1003, ! SCROLL_ABSOLUTE = 605, ! SCROLL_BEGIN = 606, ! SCROLL_END = 607, ! SCROLL_LINE_DOWN = 602, ! SCROLL_LINE_UP = 601, ! SCROLL_LOCK = 1021, ! SCROLL_PAGE_DOWN = 604, ! SCROLL_PAGE_UP = 603, ! TAB = 9, ! UP = 1004, ! WINDOW_DEICONIFY = 204, ! WINDOW_DESTROY = 201, ! WINDOW_EXPOSE = 202, ! WINDOW_ICONIFY = 203, ! WINDOW_MOVED = 205; public Object arg; public int clickCount; --- 45,117 ---- public class Event implements java.io.Serializable { ! static final long serialVersionUID = 5488922509400504703L; ! public static final int SHIFT_MASK = 1; ! public static final int CTRL_MASK = 2; ! public static final int META_MASK = 4; ! public static final int ALT_MASK = 8; ! ! public static final int ACTION_EVENT = 1001; ! public static final int BACK_SPACE = 8; ! public static final int CAPS_LOCK = 1022; ! public static final int DELETE = 127; ! public static final int DOWN = 1005; ! public static final int END = 1001; ! public static final int ENTER = 10; ! public static final int ESCAPE = 27; ! public static final int F1 = 1008; ! public static final int F10 = 1017; ! public static final int F11 = 1018; ! public static final int F12 = 1019; ! public static final int F2 = 1009; ! public static final int F3 = 1010; ! public static final int F4 = 1011; ! public static final int F5 = 1012; ! public static final int F6 = 1013; ! public static final int F7 = 1014; ! public static final int F8 = 1015; ! public static final int F9 = 1016; ! public static final int GOT_FOCUS = 1004; ! public static final int HOME = 1000; ! public static final int INSERT = 1025; ! public static final int KEY_ACTION = 403; ! public static final int KEY_ACTION_RELEASE = 404; ! public static final int KEY_PRESS = 401; ! public static final int KEY_RELEASE = 402; ! public static final int LEFT = 1006; ! public static final int LIST_DESELECT = 702; ! public static final int LIST_SELECT = 701; ! public static final int LOAD_FILE = 1002; ! public static final int LOST_FOCUS = 1005; ! public static final int MOUSE_DOWN = 501; ! public static final int MOUSE_DRAG = 506; ! public static final int MOUSE_ENTER = 504; ! public static final int MOUSE_EXIT = 505; ! public static final int MOUSE_MOVE = 503; ! public static final int MOUSE_UP = 502; ! public static final int NUM_LOCK = 1023; ! public static final int PAUSE = 1024; ! public static final int PGDN = 1003; ! public static final int PGUP = 1002; ! public static final int PRINT_SCREEN = 1020; ! public static final int RIGHT = 1007; ! public static final int SAVE_FILE = 1003; ! public static final int SCROLL_ABSOLUTE = 605; ! public static final int SCROLL_BEGIN = 606; ! public static final int SCROLL_END = 607; ! public static final int SCROLL_LINE_DOWN = 602; ! public static final int SCROLL_LINE_UP = 601; ! public static final int SCROLL_LOCK = 1021; ! public static final int SCROLL_PAGE_DOWN = 604; ! public static final int SCROLL_PAGE_UP = 603; ! public static final int TAB = 9; ! public static final int UP = 1004; ! public static final int WINDOW_DEICONIFY = 204; ! public static final int WINDOW_DESTROY = 201; ! public static final int WINDOW_EXPOSE = 202; ! public static final int WINDOW_ICONIFY = 203; ! public static final int WINDOW_MOVED = 205; public Object arg; public int clickCount; diff -Nrc3pad gcc-3.2.3/libjava/java/awt/EventQueue.java gcc-3.3/libjava/java/awt/EventQueue.java *** gcc-3.2.3/libjava/java/awt/EventQueue.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/EventQueue.java 2003-01-02 00:14:04.000000000 +0000 *************** public class EventQueue *** 151,156 **** --- 151,158 ---- * Posts a new event to the queue. * * @param event The event to post to the queue. + * + * @exception NullPointerException If event is null. */ public synchronized void postEvent(AWTEvent evt) { *************** public class EventQueue *** 209,215 **** notify(); } ! /** @since JDK1.2 */ public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { --- 211,229 ---- notify(); } ! /** ! * Causes runnable to have its run method called in the dispatch thread of the ! * EventQueue. This will happen after all pending events are processed. The ! * call blocks until this has happened. This method will throw an Error if ! * called from the event dispatcher thread. ! * ! * @exception InterruptedException If another thread has interrupted ! * this thread. ! * @exception InvocationTargetException If an exception is thrown when running ! * runnable. ! * ! * @since 1.2 ! */ public static void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException { *************** public class EventQueue *** 254,259 **** --- 268,275 ---- * All pending events are transferred to the new queue. Calls to postEvent, * getNextEvent, and peekEvent are forwarded to the pushed queue until it * is removed with a pop(). + * + * @exception NullPointerException if newEventQueue is null. */ public synchronized void push(EventQueue newEventQueue) { *************** public class EventQueue *** 271,277 **** } /** Transfer any pending events from this queue back to the parent queue that ! * was previously push()ed. Event dispatch from this queue is suspended. */ protected void pop() throws EmptyStackException { if (prev == null) --- 287,297 ---- } /** Transfer any pending events from this queue back to the parent queue that ! * was previously push()ed. Event dispatch from this queue is suspended. ! * ! * @exception EmptyStackException If no previous push was made on this ! * EventQueue. ! */ protected void pop() throws EmptyStackException { if (prev == null) *************** public class EventQueue *** 297,302 **** --- 317,328 ---- } } + /** + * Dispatches an event. The manner in which the event is dispatched depends + * upon the type of the event and the type of the event's source object. + * + * @exception NullPointerException If event is null. + */ protected void dispatchEvent(AWTEvent evt) { if (evt instanceof ActiveEvent) *************** public class EventQueue *** 320,323 **** } } } ! } --- 346,372 ---- } } } ! ! /** ! * Returns the timestamp of the most recent event that had a timestamp, or ! * the initialization time of the event queue if no events have been fired. ! * At present, only InputEvents, ActionEvents, ! * InputMethodEvents, and InvocationEvents have ! * timestamps, but this may be added to other events in future versions. ! * If this is called by the event dispatching thread, it can be any ! * (sequential) value, but to other threads, the safest bet is to return ! * System.currentTimeMillis(). ! * ! * @return the most recent timestamp ! * @see InputEvent#getWhen() ! * @see ActionEvent#getWhen() ! * @see InvocationEvent#getWhen() ! * @see InputMethodEvent#getWhen() ! * @since 1.4 ! */ ! public static long getMostRecentEventTime() ! { ! // XXX For now, this ONLY does the current time. ! return System.currentTimeMillis(); ! } ! } // class EventQueue diff -Nrc3pad gcc-3.2.3/libjava/java/awt/FileDialog.java gcc-3.3/libjava/java/awt/FileDialog.java *** gcc-3.2.3/libjava/java/awt/FileDialog.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/FileDialog.java 2003-01-02 00:14:04.000000000 +0000 *************** FileDialog(Frame parent, String title) *** 142,157 **** * @param title The title for this dialog. * @param mode The mode of the dialog, either LOAD or * SAVE. */ public FileDialog(Frame parent, String title, int mode) { super(parent, title, true); ! ! if ((mode != LOAD) && (mode != SAVE)) ! throw new IllegalArgumentException("Bad mode: " + mode); ! ! this.mode = mode; } /*************************************************************************/ --- 142,156 ---- * @param title The title for this dialog. * @param mode The mode of the dialog, either LOAD or * SAVE. + * + * @exception IllegalArgumentException If an illegal file dialog mode + * is supplied. */ public FileDialog(Frame parent, String title, int mode) { super(parent, title, true); ! setMode (mode); } /*************************************************************************/ *************** getMode() *** 180,185 **** --- 179,187 ---- * peer is created. * * @param mode The new mode of this file dialog. + * + * @exception IllegalArgumentException If an illegal file dialog mode + * is supplied. */ public void setMode(int mode) diff -Nrc3pad gcc-3.2.3/libjava/java/awt/FlowLayout.java gcc-3.3/libjava/java/awt/FlowLayout.java *** gcc-3.2.3/libjava/java/awt/FlowLayout.java 2002-01-29 16:31:24.000000000 +0000 --- gcc-3.3/libjava/java/awt/FlowLayout.java 2002-11-10 23:11:21.000000000 +0000 *************** public class FlowLayout implements Layou *** 150,225 **** */ public void layoutContainer (Container parent) { ! int num = parent.getComponentCount (); ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! Dimension d = parent.getSize (); ! Insets ins = parent.getInsets (); ! ComponentOrientation orient = parent.getComponentOrientation (); ! boolean left_to_right = orient.isLeftToRight (); ! int y = ins.top + vgap; ! int i = 0; ! while (i < num) ! { ! // Find the components which go in the current row. ! int new_w = ins.left + hgap + ins.right; ! int new_h = 0; ! int j; ! boolean found_one = false; ! for (j = i; j < num && ! found_one; ++j) { ! // Skip invisible items. ! if (! comps[i].visible) ! continue; ! Dimension c = comps[i].getPreferredSize (); ! int next_w = new_w + hgap + c.width; ! if (next_w <= d.width || ! found_one) ! { ! new_w = next_w; ! new_h = Math.max (new_h, c.height); ! found_one = true; ! } ! else ! { ! // Must start a new row, and we already found an item ! break; } - } ! // Set the location of each component for this row. ! int x; ! int myalign = align; ! if (align == LEADING) ! myalign = left_to_right ? LEFT : RIGHT; ! else if (align == TRAILING) ! myalign = left_to_right ? RIGHT : LEFT; ! if (myalign == LEFT) ! x = ins.left + hgap; ! else if (myalign == CENTER) ! x = (d.width - new_w) / 2; ! else ! x = d.width - new_w; ! for (int k = i; k < j; ++k) ! { ! if (comps[k].visible) { ! Dimension c = comps[k].getPreferredSize (); ! comps[k].setBounds (x, y, c.width, new_h); ! x += c.width + hgap; } - } ! // Advance to next row. ! i = j; ! y += new_h + vgap; } } --- 150,228 ---- */ public void layoutContainer (Container parent) { ! synchronized (parent.getTreeLock ()) ! { ! int num = parent.getComponentCount (); ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! Dimension d = parent.getSize (); ! Insets ins = parent.getInsets (); ! ComponentOrientation orient = parent.getComponentOrientation (); ! boolean left_to_right = orient.isLeftToRight (); ! int y = ins.top + vgap; ! int i = 0; ! while (i < num) { ! // Find the components which go in the current row. ! int new_w = ins.left + hgap + ins.right; ! int new_h = 0; ! int j; ! boolean found_one = false; ! for (j = i; j < num && ! found_one; ++j) ! { ! // Skip invisible items. ! if (! comps[i].visible) ! continue; ! Dimension c = comps[i].getPreferredSize (); ! int next_w = new_w + hgap + c.width; ! if (next_w <= d.width || ! found_one) ! { ! new_w = next_w; ! new_h = Math.max (new_h, c.height); ! found_one = true; ! } ! else ! { ! // Must start a new row, and we already found an item ! break; ! } } ! // Set the location of each component for this row. ! int x; ! int myalign = align; ! if (align == LEADING) ! myalign = left_to_right ? LEFT : RIGHT; ! else if (align == TRAILING) ! myalign = left_to_right ? RIGHT : LEFT; ! if (myalign == LEFT) ! x = ins.left + hgap; ! else if (myalign == CENTER) ! x = (d.width - new_w) / 2; ! else ! x = d.width - new_w; ! for (int k = i; k < j; ++k) { ! if (comps[k].visible) ! { ! Dimension c = comps[k].getPreferredSize (); ! comps[k].setBounds (x, y, c.width, new_h); ! x += c.width + hgap; ! } } ! // Advance to next row. ! i = j; ! y += new_h + vgap; ! } } } *************** public class FlowLayout implements Layou *** 304,339 **** // This method is used to compute the various sizes. private Dimension getSize (Container parent, boolean is_min) { ! int w, h, num = parent.getComponentCount (); ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! ! w = 0; ! h = 0; ! for (int i = 0; i < num; ++i) { ! if (! comps[i].visible) ! continue; ! // FIXME: can we just directly read the fields in Component? ! // Or will that not work with subclassing? ! Dimension d; ! if (is_min) ! d = comps[i].getMinimumSize (); ! else ! d = comps[i].getPreferredSize (); ! w += d.width; ! h = Math.max (d.height, h); ! } ! Insets ins = parent.getInsets (); ! w += (num + 1) * hgap + ins.left + ins.right; ! h += 2 * vgap + ins.top + ins.bottom; ! return new Dimension (w, h); } /** --- 307,345 ---- // This method is used to compute the various sizes. private Dimension getSize (Container parent, boolean is_min) { ! synchronized (parent.getTreeLock ()) { ! int w, h, num = parent.getComponentCount (); ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! w = 0; ! h = 0; ! for (int i = 0; i < num; ++i) ! { ! if (! comps[i].visible) ! continue; ! // FIXME: can we just directly read the fields in Component? ! // Or will that not work with subclassing? ! Dimension d; ! if (is_min) ! d = comps[i].getMinimumSize (); ! else ! d = comps[i].getPreferredSize (); ! w += d.width; ! h = Math.max (d.height, h); ! } ! Insets ins = parent.getInsets (); ! w += (num + 1) * hgap + ins.left + ins.right; ! h += 2 * vgap + ins.top + ins.bottom; ! ! return new Dimension (w, h); ! } } /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/FocusTraversalPolicy.java gcc-3.3/libjava/java/awt/FocusTraversalPolicy.java *** gcc-3.2.3/libjava/java/awt/FocusTraversalPolicy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/FocusTraversalPolicy.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,66 ---- + /* FocusTraversalPolicy.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * STUB CLASS ONLY + */ + public abstract class FocusTraversalPolicy + { + public FocusTraversalPolicy() + { + } + + public abstract Component getComponentAfter(Container root, + Component current); + + public abstract Component getComponentBefore(Container root, + Component current); + + public abstract Component getFirstComponent(Container root); + + public abstract Component getLastComponent(Container root); + + public abstract Component getDefaultComponent(Container root); + + public Component getInitialComponent(Window window) + { + return getDefaultComponent(window); + } + } // class FocusTraversalPolicy diff -Nrc3pad gcc-3.2.3/libjava/java/awt/font/TextHitInfo.java gcc-3.3/libjava/java/awt/font/TextHitInfo.java *** gcc-3.2.3/libjava/java/awt/font/TextHitInfo.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/font/TextHitInfo.java 2002-11-07 08:45:17.000000000 +0000 *************** *** 0 **** --- 1,114 ---- + /* TextHitInfo.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.font; + + /** + * @author John Leuner + * + * + */ + + public final class TextHitInfo { + + public int getCharIndex() + { + return -1; + } + + public boolean isLeadingEdge() + { + return false; + } + + public int getInsertionIndex() + { + return -1; + } + + public int hashCode() + { + return getCharIndex(); + } + + public boolean equals(Object obj) + { + if(obj instanceof TextHitInfo) + return this.equals((TextHitInfo) obj); + return false; + } + + public boolean equals(TextHitInfo hitInfo) + { + return (getCharIndex() == hitInfo.getCharIndex()) && (isLeadingEdge() == hitInfo.isLeadingEdge()); + } + + public static TextHitInfo leading(int charIndex) + { + return new TextHitInfo(); + } + + public static TextHitInfo trailing(int charIndex) + { + return new TextHitInfo(); + } + + public static TextHitInfo beforeOffset(int offset) + { + return new TextHitInfo(); + } + + public static TextHitInfo afterOffset(int offset) + { + return new TextHitInfo(); + } + + public TextHitInfo getOtherHit() + { + return new TextHitInfo(); + } + + public TextHitInfo getOffsetHit(int offset) + { + return new TextHitInfo(); + } + + public String toString() + { + return ""; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/FontFormatException.java gcc-3.3/libjava/java/awt/FontFormatException.java *** gcc-3.2.3/libjava/java/awt/FontFormatException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/FontFormatException.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,65 ---- + /* FontFormatException.java -- the specified font is bad + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * Thrown when a specified font is bad. + * + * @author Eric Blake + * @see Font + * @since 1.3 + * @status updated to 1.4 + */ + public class FontFormatException extends Exception + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -4481290147811361272L; + + /** + * Create a new instance with the specified detailed error message. + * + * @param message the detailed error message + */ + public FontFormatException(String message) + { + super(message); + } + } // class FontFormatException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Font.java gcc-3.3/libjava/java/awt/Font.java *** gcc-3.2.3/libjava/java/awt/Font.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Font.java 2002-08-09 04:26:14.000000000 +0000 *************** public static final int ROMAN_BASELINE = *** 73,78 **** --- 73,138 ---- public static final int CENTER_BASELINE = 1; public static final int HANGING_BASELINE = 2; + + /** + * Indicates to createFont that the supplied font data + * is in TrueType format. + * + *

        Specification Note: The Sun JavaDoc for J2SE 1.4 does + * not indicate whether this value also subsumes OpenType. OpenType + * is essentially the same format as TrueType, but allows to define + * glyph shapes in the same way as PostScript, using cubic bezier + * curves. + * + * @since 1.3 + */ + public static final int TRUETYPE_FONT = 0; + + + /** + * A flag for layoutGlyphVector, indicating that the + * orientation of a text run is from left to right. + * + * @since 1.4 + */ + public static final int LAYOUT_LEFT_TO_RIGHT = 0; + + + /** + * A flag for layoutGlyphVector, indicating that the + * orientation of a text run is from right to left. + * + * @since 1.4 + */ + public static final int LAYOUT_RIGHT_TO_LEFT = 1; + + + /** + * A flag for layoutGlyphVector, indicating that the + * text does not contain valid characters before the + * start position. If this flag is set, + * layoutGlyphVector does not examine the text before + * start, even if this would be necessary to select the + * correct glyphs (e.g., for Arabic text). + * + * @since 1.4 + */ + public static final int LAYOUT_NO_START_CONTEXT = 2; + + + /** + * A flag for layoutGlyphVector, indicating that the + * text does not contain valid characters after the + * limit position. If this flag is set, + * layoutGlyphVector does not examine the text after + * limit, even if this would be necessary to select the + * correct glyphs (e.g., for Arabic text). + * + * @since 1.4 + */ + public static final int LAYOUT_NO_LIMIT_CONTEXT = 4; + + // Serialization constant private static final long serialVersionUID = -4206021311591459213L; *************** decode(String fontspec) *** 162,168 **** { tokenval = Integer.parseInt(token); } ! catch(Exception e) { ; } if (tokenval != 0) size = tokenval; --- 222,228 ---- { tokenval = Integer.parseInt(token); } ! catch(NumberFormatException e) { ; } if (tokenval != 0) size = tokenval; diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Frame.java gcc-3.3/libjava/java/awt/Frame.java *** gcc-3.2.3/libjava/java/awt/Frame.java 2002-01-22 22:40:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/Frame.java 2002-11-10 00:16:42.000000000 +0000 *************** public class Frame extends Window implem *** 60,65 **** --- 60,71 ---- */ /** + * Constant for the default cursor. + * Deprecated. replaced by Cursor.DEFAULT_CURSOR instead. + */ + public static final int DEFAULT_CURSOR = Cursor.DEFAULT_CURSOR; + + /** * Constant for a cross-hair cursor. * @deprecated Use Cursor.CROSSHAIR_CURSOR instead. */ *************** public static final int HAND_CURSOR = Cu *** 137,142 **** --- 143,154 ---- */ public static final int MOVE_CURSOR = Cursor.MOVE_CURSOR; + public static final int ICONIFIED = 1; + public static final int MAXIMIZED_BOTH = 6; + public static final int MAXIMIZED_HORIZ = 2; + public static final int MAXIMIZED_VERT = 4; + public static final int NORMAL = 0; + // Serialization version constant private static final long serialVersionUID = 2673458971256075116L; *************** public *** 218,226 **** Frame(String title) { super(); - System.err.println("returned"); this.title = title; - System.err.println("end"); } public --- 230,236 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/AffineTransform.java gcc-3.3/libjava/java/awt/geom/AffineTransform.java *** gcc-3.2.3/libjava/java/awt/geom/AffineTransform.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/AffineTransform.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* AffineTransform.java -- transform coordinates between two 2-D spaces ! Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,77 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.geom; ! import java.awt.*; import java.io.Serializable; /** * @author Tom Tromey ! * @date April 16, 2000 */ - - /* Status: mostly complete. Search for fixme to see problems. - Also, TYPE_ returns are not handled correctly. */ - public class AffineTransform implements Cloneable, Serializable { public static final int TYPE_IDENTITY = 0; ! public static final int TYPE_FLIP = 64; ! public static final int TYPE_GENERAL_ROTATION = 16; public static final int TYPE_GENERAL_SCALE = 4; ! public static final int TYPE_GENERAL_TRANSFORM = 32; ! public static final int TYPE_MASK_ROTATION = 24; public static final int TYPE_MASK_SCALE = 6; public static final int TYPE_QUADRANT_ROTATION = 8; - public static final int TYPE_TRANSLATION = 1; - public static final int TYPE_UNIFORM_SCALE = 2; ! public AffineTransform () { ! setToIdentity (); } ! public AffineTransform (AffineTransform tx) { ! setTransform (tx); } ! public AffineTransform (float m00, float m10, ! float m01, float m11, ! float m02, float m12) { this.m00 = m00; this.m10 = m10; --- 35,310 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.geom; ! ! import java.awt.Shape; ! import java.io.IOException; ! import java.io.ObjectInputStream; import java.io.Serializable; /** + * This class represents an affine transformation between two coordinate + * spaces in 2 dimensions. Such a transform preserves the "straightness" + * and "parallelness" of lines. The transform is built from a sequence of + * translations, scales, flips, rotations, and shears. + * + *

        The transformation can be represented using matrix math on a 3x3 array. + * Given (x,y), the transformation (x',y') can be found by: + *

        +  * [ x']   [ m00 m01 m02 ] [ x ]   [ m00*x + m01*y + m02 ]
        +  * [ y'] = [ m10 m11 m12 ] [ y ] = [ m10*x + m11*y + m12 ]
        +  * [ 1 ]   [  0   0   1  ] [ 1 ]   [          1          ]
        +  * 
        + * The bottom row of the matrix is constant, so a transform can be uniquely + * represented (as in toString) by "[[m00, m01, m02], [m10, m11, m12]]". + * * @author Tom Tromey ! * @author Eric Blake ! * @since 1.2 ! * @status partially updated to 1.4, still has some problems */ public class AffineTransform implements Cloneable, Serializable { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 1330973210523860834L; + + /** + * The transformation is the identity (x' = x, y' = y). All other transforms + * have either a combination of the appropriate transform flag bits for + * their type, or the type GENERAL_TRANSFORM. + * + * @see #TYPE_TRANSLATION + * @see #TYPE_UNIFORM_SCALE + * @see #TYPE_GENERAL_SCALE + * @see #TYPE_FLIP + * @see #TYPE_QUADRANT_ROTATION + * @see #TYPE_GENERAL_ROTATION + * @see #TYPE_GENERAL_TRANSFORM + * @see #getType() + */ public static final int TYPE_IDENTITY = 0; ! ! /** ! * The transformation includes a translation - shifting in the x or y ! * direction without changing length or angles. ! * ! * @see #TYPE_IDENTITY ! * @see #TYPE_UNIFORM_SCALE ! * @see #TYPE_GENERAL_SCALE ! * @see #TYPE_FLIP ! * @see #TYPE_QUADRANT_ROTATION ! * @see #TYPE_GENERAL_ROTATION ! * @see #TYPE_GENERAL_TRANSFORM ! * @see #getType() ! */ ! public static final int TYPE_TRANSLATION = 1; ! ! /** ! * The transformation includes a uniform scale - length is scaled in both ! * the x and y directions by the same amount, without affecting angles. ! * This is mutually exclusive with TYPE_GENERAL_SCALE. ! * ! * @see #TYPE_IDENTITY ! * @see #TYPE_TRANSLATION ! * @see #TYPE_GENERAL_SCALE ! * @see #TYPE_FLIP ! * @see #TYPE_QUADRANT_ROTATION ! * @see #TYPE_GENERAL_ROTATION ! * @see #TYPE_GENERAL_TRANSFORM ! * @see #TYPE_MASK_SCALE ! * @see #getType() ! */ ! public static final int TYPE_UNIFORM_SCALE = 2; ! ! /** ! * The transformation includes a general scale - length is scaled in either ! * or both the x and y directions, but by different amounts; without ! * affecting angles. This is mutually exclusive with TYPE_UNIFORM_SCALE. ! * ! * @see #TYPE_IDENTITY ! * @see #TYPE_TRANSLATION ! * @see #TYPE_UNIFORM_SCALE ! * @see #TYPE_FLIP ! * @see #TYPE_QUADRANT_ROTATION ! * @see #TYPE_GENERAL_ROTATION ! * @see #TYPE_GENERAL_TRANSFORM ! * @see #TYPE_MASK_SCALE ! * @see #getType() ! */ public static final int TYPE_GENERAL_SCALE = 4; ! ! /** ! * This constant checks if either variety of scale transform is performed. ! * ! * @see #TYPE_UNIFORM_SCALE ! * @see #TYPE_GENERAL_SCALE ! */ public static final int TYPE_MASK_SCALE = 6; + + /** + * The transformation includes a flip about an axis, swapping between + * right-handed and left-handed coordinate systems. In a right-handed + * system, the positive x-axis rotates counter-clockwise to the positive + * y-axis; in a left-handed system it rotates clockwise. + * + * @see #TYPE_IDENTITY + * @see #TYPE_TRANSLATION + * @see #TYPE_UNIFORM_SCALE + * @see #TYPE_GENERAL_SCALE + * @see #TYPE_QUADRANT_ROTATION + * @see #TYPE_GENERAL_ROTATION + * @see #TYPE_GENERAL_TRANSFORM + * @see #getType() + */ + public static final int TYPE_FLIP = 64; + + /** + * The transformation includes a rotation of a multiple of 90 degrees (PI/2 + * radians). Angles are rotated, but length is preserved. This is mutually + * exclusive with TYPE_GENERAL_ROTATION. + * + * @see #TYPE_IDENTITY + * @see #TYPE_TRANSLATION + * @see #TYPE_UNIFORM_SCALE + * @see #TYPE_GENERAL_SCALE + * @see #TYPE_FLIP + * @see #TYPE_GENERAL_ROTATION + * @see #TYPE_GENERAL_TRANSFORM + * @see #TYPE_MASK_ROTATION + * @see #getType() + */ public static final int TYPE_QUADRANT_ROTATION = 8; ! /** ! * The transformation includes a rotation by an arbitrary angle. Angles are ! * rotated, but length is preserved. This is mutually exclusive with ! * TYPE_QUADRANT_ROTATION. ! * ! * @see #TYPE_IDENTITY ! * @see #TYPE_TRANSLATION ! * @see #TYPE_UNIFORM_SCALE ! * @see #TYPE_GENERAL_SCALE ! * @see #TYPE_FLIP ! * @see #TYPE_QUADRANT_ROTATION ! * @see #TYPE_GENERAL_TRANSFORM ! * @see #TYPE_MASK_ROTATION ! * @see #getType() ! */ ! public static final int TYPE_GENERAL_ROTATION = 16; ! ! /** ! * This constant checks if either variety of rotation is performed. ! * ! * @see #TYPE_QUADRANT_ROTATION ! * @see #TYPE_GENERAL_ROTATION ! */ ! public static final int TYPE_MASK_ROTATION = 24; ! ! /** ! * The transformation is an arbitrary conversion of coordinates which ! * could not be decomposed into the other TYPEs. ! * ! * @see #TYPE_IDENTITY ! * @see #TYPE_TRANSLATION ! * @see #TYPE_UNIFORM_SCALE ! * @see #TYPE_GENERAL_SCALE ! * @see #TYPE_FLIP ! * @see #TYPE_QUADRANT_ROTATION ! * @see #TYPE_GENERAL_ROTATION ! * @see #getType() ! */ ! public static final int TYPE_GENERAL_TRANSFORM = 32; ! ! /** ! * The X coordinate scaling element of the transform matrix. ! * ! * @serial matrix[0,0] ! */ ! private double m00; ! ! /** ! * The Y coordinate scaling element of the transform matrix. ! * ! * @serial matrix[1,0] ! */ ! private double m10; ! ! /** ! * The X coordinate shearing element of the transform matrix. ! * ! * @serial matrix[0,1] ! */ ! private double m01; ! ! /** ! * The Y coordinate shearing element of the transform matrix. ! * ! * @serial matrix[1,1] ! */ ! private double m11; ! ! /** ! * The X coordinate translation element of the transform matrix. ! * ! * @serial matrix[0,2] ! */ ! private double m02; ! ! /** ! * The Y coordinate translation element of the transform matrix. ! * ! * @serial matrix[1,2] ! */ ! private double m12; ! ! /** The type of this transform. */ ! private transient int type; ! ! /** ! * Construct a new identity transform: ! *
        !    * [ 1 0 0 ]
        !    * [ 0 1 0 ]
        !    * [ 0 0 1 ]
        !    * 
        ! */ ! public AffineTransform() { ! m00 = m11 = 1; } ! /** ! * Create a new transform which copies the given one. ! * ! * @param tx the transform to copy ! * @throws NullPointerException if tx is null ! */ ! public AffineTransform(AffineTransform tx) { ! setTransform(tx); } ! /** ! * Construct a transform with the given matrix entries: ! *
        !    * [ m00 m01 m02 ]
        !    * [ m10 m11 m12 ]
        !    * [  0   0   1  ]
        !    * 
        ! * ! * @param m00 the x scaling component ! * @param m10 the y shearing component ! * @param m01 the x shearing component ! * @param m11 the y scaling component ! * @param m02 the x translation component ! * @param m12 the y translation component ! */ ! public AffineTransform(float m00, float m10, ! float m01, float m11, ! float m02, float m12) { this.m00 = m00; this.m10 = m10; *************** public class AffineTransform implements *** 79,102 **** this.m11 = m11; this.m02 = m02; this.m12 = m12; ! this.type = TYPE_GENERAL_TRANSFORM; } ! public AffineTransform (float[] flatmatrix) { ! m00 = flatmatrix[0]; ! m10 = flatmatrix[1]; ! m01 = flatmatrix[2]; ! m11 = flatmatrix[3]; ! if (flatmatrix.length >= 6) { ! m02 = flatmatrix[4]; ! m12 = flatmatrix[5]; } } ! public AffineTransform (double m00, double m10, double m01, ! double m11, double m02, double m12) { this.m00 = m00; this.m10 = m10; --- 312,365 ---- this.m11 = m11; this.m02 = m02; this.m12 = m12; ! updateType(); } ! /** ! * Construct a transform from a sequence of float entries. The array must ! * have at least 4 entries, which has a translation factor of 0; or 6 ! * entries, for specifying all parameters: ! *
        !    * [ f[0] f[2] (f[4]) ]
        !    * [ f[1] f[3] (f[5]) ]
        !    * [  0     0    1    ]
        !    * 
        ! * ! * @param f the matrix to copy from, with at least 4 (6) entries ! * @throws NullPointerException if f is null ! * @throws ArrayIndexOutOfBoundsException if f is too small ! */ ! public AffineTransform(float[] f) { ! m00 = f[0]; ! m10 = f[1]; ! m01 = f[2]; ! m11 = f[3]; ! if (f.length >= 6) { ! m02 = f[4]; ! m12 = f[5]; } + updateType(); } ! /** ! * Construct a transform with the given matrix entries: ! *
        !    * [ m00 m01 m02 ]
        !    * [ m10 m11 m12 ]
        !    * [  0   0   1  ]
        !    * 
        ! * ! * @param m00 the x scaling component ! * @param m10 the y shearing component ! * @param m01 the x shearing component ! * @param m11 the y scaling component ! * @param m02 the x translation component ! * @param m12 the y translation component ! */ ! public AffineTransform(double m00, double m10, double m01, ! double m11, double m02, double m12) { this.m00 = m00; this.m10 = m10; *************** public class AffineTransform implements *** 104,325 **** this.m11 = m11; this.m02 = m02; this.m12 = m12; ! this.type = TYPE_GENERAL_TRANSFORM; } ! public AffineTransform (double[] flatmatrix) { ! m00 = flatmatrix[0]; ! m10 = flatmatrix[1]; ! m01 = flatmatrix[2]; ! m11 = flatmatrix[3]; ! if (flatmatrix.length >= 6) { ! m02 = flatmatrix[4]; ! m12 = flatmatrix[5]; } } ! public static AffineTransform getTranslateInstance (double tx, double ty) { ! AffineTransform t = new AffineTransform (); ! t.setToTranslation (tx, ty); return t; } ! public static AffineTransform getRotateInstance (double theta) { ! AffineTransform t = new AffineTransform (); ! t.setToRotation (theta); return t; } ! public static AffineTransform getRotateInstance (double theta, ! double x, double y) { ! AffineTransform t = new AffineTransform (); ! t.rotate (theta, x, y); return t; } ! public static AffineTransform getScaleInstance (double sx, double sy) { ! AffineTransform t = new AffineTransform (); ! t.setToScale (sx, sy); return t; } ! public static AffineTransform getShearInstance (double shx, double shy) { ! AffineTransform t = new AffineTransform (); ! t.setToShear (shx, shy); return t; } ! public int getType () { return type; } ! public double getDeterminant () { return m00 * m11 - m01 * m10; } ! public void getMatrix (double[] flatmatrix) { ! flatmatrix[0] = m00; ! flatmatrix[1] = m10; ! flatmatrix[2] = m01; ! flatmatrix[3] = m11; ! if (flatmatrix.length >= 6) { ! flatmatrix[4] = m02; ! flatmatrix[5] = m12; } } ! public double getScaleX () { return m00; } ! public double getScaleY () { return m11; } ! public double getShearX () { return m01; } ! public double getShearY () { return m10; } ! public double getTranslateX () { return m02; } ! public double getTranslateY () { return m12; } ! public void translate (double tx, double ty) { m02 += tx * m00 + ty * m01; m12 += tx * m10 + ty * m11; } ! public void rotate (double theta) { ! double c = Math.cos (theta); ! double s = Math.sin (theta); double n00 = m00 * c + m01 * s; double n01 = m00 * -s + m01 * c; double n10 = m10 * c + m11 * s; double n11 = m10 * -s + m11 * c; - m00 = n00; m01 = n01; m10 = n10; m11 = n11; } ! public void rotate (double theta, double x, double y) { ! translate (x, y); ! rotate (theta); ! translate (-x, -y); } ! public void scale (double sx, double sy) { m00 *= sx; m01 *= sy; m10 *= sx; m11 *= sy; } ! public void shear (double shx, double shy) { double n00 = m00 + shx * m01; double n01 = shx * m00 + m01; double n10 = m10 * shy + m11; double n11 = shx * m10 + m11; - m00 = n00; m01 = n01; m10 = n10; m11 = n11; } ! public void setToIdentity () { m00 = m11 = 1; m01 = m02 = m10 = m12 = 0; type = TYPE_IDENTITY; } ! public void setToTranslation (double tx, double ty) { m00 = m11 = 1; m01 = m10 = 0; m02 = tx; m12 = ty; ! type = TYPE_TRANSLATION; } ! public void setToRotation (double theta) { ! double c = Math.cos (theta); ! double s = Math.sin (theta); ! m00 = c; m01 = -s; m02 = 0; m10 = s; m11 = c; m12 = 0; ! type = TYPE_GENERAL_ROTATION; } ! public void setToRotation (double theta, double x, double y) { ! double c = Math.cos (theta); ! double s = Math.sin (theta); ! m00 = c; m01 = -s; m02 = x - x * c + y * s; m10 = s; m11 = c; m12 = y - x * s - y * c; ! type = TYPE_GENERAL_TRANSFORM; } ! public void setToScale (double sx, double sy) { m00 = sx; m01 = m02 = m10 = m12 = 0; m11 = sy; ! type = (sx == sy) ? TYPE_UNIFORM_SCALE : TYPE_GENERAL_SCALE; } ! public void setToShear (double shx, double shy) { m00 = m11 = 1; m01 = shx; m10 = shy; m02 = m12 = 0; ! type = TYPE_GENERAL_TRANSFORM; } ! public void setTransform (AffineTransform tx) { m00 = tx.m00; m01 = tx.m01; --- 367,898 ---- this.m11 = m11; this.m02 = m02; this.m12 = m12; ! updateType(); } ! /** ! * Construct a transform from a sequence of double entries. The array must ! * have at least 4 entries, which has a translation factor of 0; or 6 ! * entries, for specifying all parameters: ! *
        !    * [ d[0] d[2] (d[4]) ]
        !    * [ d[1] d[3] (d[5]) ]
        !    * [  0     0    1    ]
        !    * 
        ! * ! * @param d the matrix to copy from, with at least 4 (6) entries ! * @throws NullPointerException if d is null ! * @throws ArrayIndexOutOfBoundsException if d is too small ! */ ! public AffineTransform(double[] d) { ! m00 = d[0]; ! m10 = d[1]; ! m01 = d[2]; ! m11 = d[3]; ! if (d.length >= 6) { ! m02 = d[4]; ! m12 = d[5]; } + updateType(); } ! /** ! * Returns a translation transform: ! *
        !    * [ 1 0 tx ]
        !    * [ 0 1 ty ]
        !    * [ 0 0 1  ]
        !    * 
        ! * ! * @param tx the x translation distance ! * @param ty the y translation distance ! * @return the translating transform ! */ ! public static AffineTransform getTranslateInstance(double tx, double ty) { ! AffineTransform t = new AffineTransform(); ! t.setToTranslation(tx, ty); return t; } ! /** ! * Returns a rotation transform. A positive angle (in radians) rotates ! * the positive x-axis to the positive y-axis: ! *
        !    * [ cos(theta) -sin(theta) 0 ]
        !    * [ sin(theta)  cos(theta) 0 ]
        !    * [     0           0      1 ]
        !    * 
        ! * ! * @param theta the rotation angle ! * @return the rotating transform ! */ ! public static AffineTransform getRotateInstance(double theta) { ! AffineTransform t = new AffineTransform(); ! t.setToRotation(theta); return t; } ! /** ! * Returns a rotation transform about a point. A positive angle (in radians) ! * rotates the positive x-axis to the positive y-axis. This is the same ! * as calling: ! *
        !    * AffineTransform tx = new AffineTransform();
        !    * tx.setToTranslation(x, y);
        !    * tx.rotate(theta);
        !    * tx.translate(-x, -y);
        !    * 
        ! * ! *

        The resulting matrix is: ! *

        !    * [ cos(theta) -sin(theta) x-x*cos+y*sin ]
        !    * [ sin(theta)  cos(theta) y-x*sin-y*cos ]
        !    * [     0           0            1       ]
        !    * 
        ! * ! * @param theta the rotation angle ! * @param x the x coordinate of the pivot point ! * @param y the y coordinate of the pivot point ! * @return the rotating transform ! */ ! public static AffineTransform getRotateInstance(double theta, ! double x, double y) { ! AffineTransform t = new AffineTransform(); ! t.setToTranslation(x, y); ! t.rotate(theta); ! t.translate(-x, -y); return t; } ! /** ! * Returns a scaling transform: ! *
        !    * [ sx 0  0 ]
        !    * [ 0  sy 0 ]
        !    * [ 0  0  1 ]
        !    * 
        ! * ! * @param sx the x scaling factor ! * @param sy the y scaling factor ! * @return the scaling transform ! */ ! public static AffineTransform getScaleInstance(double sx, double sy) { ! AffineTransform t = new AffineTransform(); ! t.setToScale(sx, sy); return t; } ! /** ! * Returns a shearing transform (points are shifted in the x direction based ! * on a factor of their y coordinate, and in the y direction as a factor of ! * their x coordinate): ! *
        !    * [  1  shx 0 ]
        !    * [ shy  1  0 ]
        !    * [  0   0  1 ]
        !    * 
        ! * ! * @param shx the x shearing factor ! * @param shy the y shearing factor ! * @return the shearing transform ! */ ! public static AffineTransform getShearInstance(double shx, double shy) { ! AffineTransform t = new AffineTransform(); ! t.setToShear(shx, shy); return t; } ! /** ! * Returns the type of this transform. The result is always valid, although ! * it may not be the simplest interpretation (in other words, there are ! * sequences of transforms which reduce to something simpler, which this ! * does not always detect). The result is either TYPE_GENERAL_TRANSFORM, ! * or a bit-wise combination of TYPE_TRANSLATION, the mutually exclusive ! * TYPE_*_ROTATIONs, and the mutually exclusive TYPE_*_SCALEs. ! * ! * @see #TYPE_IDENTITY ! * @see #TYPE_TRANSLATION ! * @see #TYPE_UNIFORM_SCALE ! * @see #TYPE_GENERAL_SCALE ! * @see #TYPE_QUADRANT_ROTATION ! * @see #TYPE_GENERAL_ROTATION ! * @see #TYPE_GENERAL_TRANSFORM ! */ ! public int getType() { return type; } ! /** ! * Return the determinant of this transform matrix. If the determinant is ! * non-zero, the transform is invertible; otherwise operations which require ! * an inverse throw a NoninvertibleTransformException. A result very near ! * zero, due to rounding errors, may indicate that inversion results do not ! * carry enough precision to be meaningful. ! * ! *

        If this is a uniform scale transformation, the determinant also ! * represents the squared value of the scale. Otherwise, it carries little ! * additional meaning. The determinant is calculated as: ! *

        !    * | m00 m01 m02 |
        !    * | m10 m11 m12 | = m00 * m11 - m01 * m10
        !    * |  0   0   1  |
        !    * 
        ! * ! * @return the determinant ! * @see #createInverse() ! */ ! public double getDeterminant() { return m00 * m11 - m01 * m10; } ! /** ! * Return the matrix of values used in this transform. If the matrix has ! * fewer than 6 entries, only the scale and shear factors are returned; ! * otherwise the translation factors are copied as well. The resulting ! * values are: ! *
        !    * [ d[0] d[2] (d[4]) ]
        !    * [ d[1] d[3] (d[5]) ]
        !    * [  0     0    1    ]
        !    * 
        ! * ! * @param d the matrix to store the results into; with 4 (6) entries ! * @throws NullPointerException if d is null ! * @throws ArrayIndexOutOfBoundsException if d is too small ! */ ! public void getMatrix(double[] d) { ! d[0] = m00; ! d[1] = m10; ! d[2] = m01; ! d[3] = m11; ! if (d.length >= 6) { ! d[4] = m02; ! d[5] = m12; } } ! /** ! * Returns the X coordinate scaling factor of the matrix. ! * ! * @return m00 ! * @see #getMatrix(double[]) ! */ ! public double getScaleX() { return m00; } ! /** ! * Returns the Y coordinate scaling factor of the matrix. ! * ! * @return m11 ! * @see #getMatrix(double[]) ! */ ! public double getScaleY() { return m11; } ! /** ! * Returns the X coordinate shearing factor of the matrix. ! * ! * @return m01 ! * @see #getMatrix(double[]) ! */ ! public double getShearX() { return m01; } ! /** ! * Returns the Y coordinate shearing factor of the matrix. ! * ! * @return m10 ! * @see #getMatrix(double[]) ! */ ! public double getShearY() { return m10; } ! /** ! * Returns the X coordinate translation factor of the matrix. ! * ! * @return m02 ! * @see #getMatrix(double[]) ! */ ! public double getTranslateX() { return m02; } ! /** ! * Returns the Y coordinate translation factor of the matrix. ! * ! * @return m12 ! * @see #getMatrix(double[]) ! */ ! public double getTranslateY() { return m12; } ! /** ! * Concatenate a translation onto this transform. This is equivalent, but ! * more efficient than ! * concatenate(AffineTransform.getTranslateInstance(tx, ty)). ! * ! * @param tx the x translation distance ! * @param ty the y translation distance ! * @see #getTranslateInstance(double, double) ! * @see #concatenate(AffineTransform) ! */ ! public void translate(double tx, double ty) { m02 += tx * m00 + ty * m01; m12 += tx * m10 + ty * m11; + updateType(); } ! /** ! * Concatenate a rotation onto this transform. This is equivalent, but ! * more efficient than ! * concatenate(AffineTransform.getRotateInstance(theta)). ! * ! * @param theta the rotation angle ! * @see #getRotateInstance(double) ! * @see #concatenate(AffineTransform) ! */ ! public void rotate(double theta) { ! double c = Math.cos(theta); ! double s = Math.sin(theta); double n00 = m00 * c + m01 * s; double n01 = m00 * -s + m01 * c; double n10 = m10 * c + m11 * s; double n11 = m10 * -s + m11 * c; m00 = n00; m01 = n01; m10 = n10; m11 = n11; + updateType(); } ! /** ! * Concatenate a rotation about a point onto this transform. This is ! * equivalent, but more efficient than ! * concatenate(AffineTransform.getRotateInstance(theta, x, y)). ! * ! * @param theta the rotation angle ! * @param x the x coordinate of the pivot point ! * @param y the y coordinate of the pivot point ! * @see #getRotateInstance(double, double, double) ! * @see #concatenate(AffineTransform) ! */ ! public void rotate(double theta, double x, double y) { ! translate(x, y); ! rotate(theta); ! translate(-x, -y); } ! /** ! * Concatenate a scale onto this transform. This is equivalent, but more ! * efficient than ! * concatenate(AffineTransform.getScaleInstance(sx, sy)). ! * ! * @param sx the x scaling factor ! * @param sy the y scaling factor ! * @see #getScaleInstance(double, double) ! * @see #concatenate(AffineTransform) ! */ ! public void scale(double sx, double sy) { m00 *= sx; m01 *= sy; m10 *= sx; m11 *= sy; + updateType(); } ! /** ! * Concatenate a shearing onto this transform. This is equivalent, but more ! * efficient than ! * concatenate(AffineTransform.getShearInstance(sx, sy)). ! * ! * @param shx the x shearing factor ! * @param shy the y shearing factor ! * @see #getShearInstance(double, double) ! * @see #concatenate(AffineTransform) ! */ ! public void shear(double shx, double shy) { double n00 = m00 + shx * m01; double n01 = shx * m00 + m01; double n10 = m10 * shy + m11; double n11 = shx * m10 + m11; m00 = n00; m01 = n01; m10 = n10; m11 = n11; + updateType(); } ! /** ! * Reset this transform to the identity (no transformation): ! *
        !    * [ 1 0 0 ]
        !    * [ 0 1 0 ]
        !    * [ 0 0 1 ]
        !    * 
        ! */ ! public void setToIdentity() { m00 = m11 = 1; m01 = m02 = m10 = m12 = 0; type = TYPE_IDENTITY; } ! /** ! * Set this transform to a translation: ! *
        !    * [ 1 0 tx ]
        !    * [ 0 1 ty ]
        !    * [ 0 0 1  ]
        !    * 
        ! * ! * @param tx the x translation distance ! * @param ty the y translation distance ! */ ! public void setToTranslation(double tx, double ty) { m00 = m11 = 1; m01 = m10 = 0; m02 = tx; m12 = ty; ! type = (tx == 0 && ty == 0) ? TYPE_UNIFORM_SCALE : TYPE_TRANSLATION; } ! /** ! * Set this transform to a rotation. A positive angle (in radians) rotates ! * the positive x-axis to the positive y-axis: ! *
        !    * [ cos(theta) -sin(theta) 0 ]
        !    * [ sin(theta)  cos(theta) 0 ]
        !    * [     0           0      1 ]
        !    * 
        ! * ! * @param theta the rotation angle ! */ ! public void setToRotation(double theta) { ! double c = Math.cos(theta); ! double s = Math.sin(theta); m00 = c; m01 = -s; m02 = 0; m10 = s; m11 = c; m12 = 0; ! type = (c == 1 ? TYPE_IDENTITY ! : c == 0 || c == -1 ? TYPE_QUADRANT_ROTATION ! : TYPE_GENERAL_ROTATION); } ! /** ! * Set this transform to a rotation about a point. A positive angle (in ! * radians) rotates the positive x-axis to the positive y-axis. This is the ! * same as calling: ! *
        !    * tx.setToTranslation(x, y);
        !    * tx.rotate(theta);
        !    * tx.translate(-x, -y);
        !    * 
        ! * ! *

        The resulting matrix is: ! *

        !    * [ cos(theta) -sin(theta) x-x*cos+y*sin ]
        !    * [ sin(theta)  cos(theta) y-x*sin-y*cos ]
        !    * [     0           0            1       ]
        !    * 
        ! * ! * @param theta the rotation angle ! * @param x the x coordinate of the pivot point ! * @param y the y coordinate of the pivot point ! */ ! public void setToRotation(double theta, double x, double y) { ! double c = Math.cos(theta); ! double s = Math.sin(theta); m00 = c; m01 = -s; m02 = x - x * c + y * s; m10 = s; m11 = c; m12 = y - x * s - y * c; ! updateType(); } ! /** ! * Set this transform to a scale: ! *
        !    * [ sx 0  0 ]
        !    * [ 0  sy 0 ]
        !    * [ 0  0  1 ]
        !    * 
        ! * ! * @param sx the x scaling factor ! * @param sy the y scaling factor ! */ ! public void setToScale(double sx, double sy) { m00 = sx; m01 = m02 = m10 = m12 = 0; m11 = sy; ! type = (sx != sy ? TYPE_GENERAL_SCALE ! : sx == 1 ? TYPE_IDENTITY : TYPE_UNIFORM_SCALE); } ! /** ! * Set this transform to a shear (points are shifted in the x direction based ! * on a factor of their y coordinate, and in the y direction as a factor of ! * their x coordinate): ! *
        !    * [  1  shx 0 ]
        !    * [ shy  1  0 ]
        !    * [  0   0  1 ]
        !    * 
        ! * ! * @param shx the x shearing factor ! * @param shy the y shearing factor ! */ ! public void setToShear(double shx, double shy) { m00 = m11 = 1; m01 = shx; m10 = shy; m02 = m12 = 0; ! updateType(); } ! /** ! * Set this transform to a copy of the given one. ! * ! * @param tx the transform to copy ! * @throws NullPointerException if tx is null ! */ ! public void setTransform(AffineTransform tx) { m00 = tx.m00; m01 = tx.m01; *************** public class AffineTransform implements *** 330,337 **** type = tx.type; } ! public void setTransform (double m00, double m10, double m01, ! double m11, double m02, double m12) { this.m00 = m00; this.m10 = m10; --- 903,925 ---- type = tx.type; } ! /** ! * Set this transform to the given values: ! *
        !    * [ m00 m01 m02 ]
        !    * [ m10 m11 m12 ]
        !    * [  0   0   1  ]
        !    * 
        ! * ! * @param m00 the x scaling component ! * @param m10 the y shearing component ! * @param m01 the x shearing component ! * @param m11 the y scaling component ! * @param m02 the x translation component ! * @param m12 the y translation component ! */ ! public void setTransform(double m00, double m10, double m01, ! double m11, double m02, double m12) { this.m00 = m00; this.m10 = m10; *************** public class AffineTransform implements *** 339,348 **** this.m11 = m11; this.m02 = m02; this.m12 = m12; ! this.type = 0; // FIXME } ! public void concatenate (AffineTransform tx) { double n00 = m00 * tx.m00 + m01 * tx.m10; double n01 = m00 * tx.m01 + m01 * tx.m11; --- 927,948 ---- this.m11 = m11; this.m02 = m02; this.m12 = m12; ! updateType(); } ! /** ! * Set this transform to the result of performing the original version of ! * this followed by tx. This is commonly used when chaining transformations ! * from one space to another. In matrix form: ! *
        !    * [ this ] = [ this ] x [ tx ]
        !    * 
        ! * ! * @param tx the transform to concatenate ! * @throws NullPointerException if tx is null ! * @see #preConcatenate(AffineTransform) ! */ ! public void concatenate(AffineTransform tx) { double n00 = m00 * tx.m00 + m01 * tx.m10; double n01 = m00 * tx.m01 + m01 * tx.m11; *************** public class AffineTransform implements *** 350,365 **** double n10 = m10 * tx.m00 + m11 * tx.m10; double n11 = m10 * tx.m01 + m11 * tx.m11; double n12 = m10 * tx.m02 + m11 * tx.m12 + m12; - m00 = n00; m01 = n01; m02 = n02; m10 = n10; m11 = n11; m12 = n12; } ! public void preConcatenate (AffineTransform tx) { double n00 = tx.m00 * m00 + tx.m01 * m10; double n01 = tx.m00 * m01 + tx.m01 * m11; --- 950,978 ---- double n10 = m10 * tx.m00 + m11 * tx.m10; double n11 = m10 * tx.m01 + m11 * tx.m11; double n12 = m10 * tx.m02 + m11 * tx.m12 + m12; m00 = n00; m01 = n01; m02 = n02; m10 = n10; m11 = n11; m12 = n12; + updateType(); } ! /** ! * Set this transform to the result of performing tx followed by the ! * original version of this. This is less common than normal concatenation, ! * but can still be used to chain transformations from one space to another. ! * In matrix form: ! *
        !    * [ this ] = [ tx ] x [ this ]
        !    * 
        ! * ! * @param tx the transform to concatenate ! * @throws NullPointerException if tx is null ! * @see #concatenate(AffineTransform) ! */ ! public void preConcatenate(AffineTransform tx) { double n00 = tx.m00 * m00 + tx.m01 * m10; double n01 = tx.m00 * m01 + tx.m01 * m11; *************** public class AffineTransform implements *** 367,694 **** double n10 = tx.m10 * m00 + tx.m11 * m10; double n11 = tx.m10 * m01 + tx.m11 * m11; double n12 = tx.m10 * m02 + tx.m11 * m12 + tx.m12; - m00 = n00; m01 = n01; m02 = n02; m10 = n10; m11 = n11; m12 = n12; } ! public AffineTransform createInverse () throws NoninvertibleTransformException { ! double det = getDeterminant (); if (det == 0) ! throw new NoninvertibleTransformException ("can't invert transform"); ! ! double i00 = m11 / det; ! double i01 = -m10 / det; ! double i02 = 0; ! double i10 = m01 / det; ! double i11 = -m00 / det; ! double i12 = 0; ! ! return new AffineTransform (i00, i01, i02, ! i10, i11, i12); } ! public Point2D transform (Point2D src, Point2D dst) { if (dst == null) ! dst = new Point2D.Double (); ! ! // We compute and set separately to correctly overwrite if ! // src==dst. ! double x = src.getX (); ! double y = src.getY (); double nx = m00 * x + m01 * y + m02; double ny = m10 * x + m11 * y + m12; ! ! dst.setLocation (nx, ny); ! return dst; } ! public void transform (Point2D[] src, int srcOff, ! Point2D[] dst, int dstOff, ! int num) { ! while (num-- > 0) ! { ! dst[dstOff] = transform (src[srcOff], dst[dstOff]); ! ++srcOff; ! ++dstOff; ! } } ! public void transform (float[] srcPts, int srcOff, ! float[] dstPts, int dstOff, ! int num) { ! while (num-- > 0) { ! float x = srcPts[srcOff]; ! float y = srcPts[srcOff + 1]; ! srcOff += 2; ! float nx = (float) (m00 * x + m01 * y + m02); ! float ny = (float) (m10 * x + m10 * y + m12); ! dstPts[dstOff] = nx; ! dstPts[dstOff + 1] = ny; ! dstOff += 2; } } ! public void transform (double[] srcPts, int srcOff, ! double[] dstPts, int dstOff, ! int num) { ! while (num-- > 0) { ! double x = srcPts[srcOff]; ! double y = srcPts[srcOff + 1]; ! srcOff += 2; ! double nx = m00 * x + m01 * y + m02; ! double ny = m10 * x + m10 * y + m12; ! dstPts[dstOff] = nx; ! dstPts[dstOff + 1] = ny; ! dstOff += 2; } } ! public void transform (float[] srcPts, int srcOff, ! double[] dstPts, int dstOff, ! int num) { ! while (num-- > 0) { ! float x = srcPts[srcOff]; ! float y = srcPts[srcOff + 1]; ! srcOff += 2; ! double nx = m00 * x + m01 * y + m02; ! double ny = m10 * x + m10 * y + m12; ! dstPts[dstOff] = nx; ! dstPts[dstOff + 1] = ny; ! dstOff += 2; } } ! public void transform (double[] srcPts, int srcOff, ! float[] dstPts, int dstOff, ! int num) { ! while (num-- > 0) { ! double x = srcPts[srcOff]; ! double y = srcPts[srcOff + 1]; ! srcOff += 2; ! float nx = (float) (m00 * x + m01 * y + m02); ! float ny = (float) (m10 * x + m10 * y + m12); ! dstPts[dstOff] = nx; ! dstPts[dstOff + 1] = ny; ! dstOff += 2; } } ! public Point2D inverseTransform (Point2D src, Point2D dst) throws NoninvertibleTransformException { ! double det = getDeterminant (); if (det == 0) ! throw new NoninvertibleTransformException ("couldn't invert transform"); ! if (dst == null) ! dst = new Point2D.Double (); ! double x = src.getX (); ! double y = src.getY (); ! double nx = (m11 * x + - m10 * y) / det; ! double ny = (m01 * x + - m00 * y) / det; ! dst.setLocation (nx, ny); return dst; } ! public void inverseTransform (double[] srcPts, int srcOff, ! double[] dstPts, int dstOff, ! int num) throws NoninvertibleTransformException { ! double det = getDeterminant (); if (det == 0) ! throw new NoninvertibleTransformException ("couldn't invert transform"); ! ! while (num-- > 0) { ! double x = srcPts[srcOff]; ! double y = srcPts[srcOff + 1]; ! double nx = (m11 * x + - m10 * y) / det; ! double ny = (m01 * x + - m00 * y) / det; ! dstPts[dstOff] = nx; ! dstPts[dstOff + 1] = ny; ! dstOff += 2; ! srcOff += 2; } } ! public Point2D deltaTransform (Point2D src, Point2D dst) { if (dst == null) ! dst = new Point2D.Double (); ! double x = src.getX (); ! double y = src.getY (); double nx = m00 * x + m01 * y; double ny = m10 * x + m11 * y; ! dst.setLocation (nx, ny); return dst; } ! public void deltaTransform (double[] srcPts, int srcOff, ! double[] dstPts, int dstOff, ! int num) { ! while (num-- > 0) { ! double x = srcPts[srcOff]; ! double y = srcPts[srcOff + 1]; ! double nx = m00 * x + m01 * y; ! double ny = m10 * x + m11 * y; ! dstPts[dstOff] = nx; ! dstPts[dstOff + 1] = ny; ! dstOff += 2; ! srcOff += 2; } } ! public Shape createTransformedShape (Shape pSrc) { ! // FIXME ! return null; } ! public String toString () { ! // FIXME ! return null; } ! public boolean isIdentity () { return (m00 == 1 && m01 == 0 && m02 == 0 ! && m10 == 0 && m11 == 1 && m12 == 0); } ! public Object clone () { ! return new AffineTransform (this); } ! public int hashCode () { ! // FIXME ! return 23; } ! public boolean equals (Object obj) { if (! (obj instanceof AffineTransform)) return false; AffineTransform t = (AffineTransform) obj; return (m00 == t.m00 && m01 == t.m01 && m02 == t.m02 ! && m10 == t.m10 && m11 == t.m11 && m12 == t.m12); } ! // This iterator is used to apply an AffineTransform to some other ! // iterator. It is not private because we want to be able to access ! // it from the rest of this package. ! class Iterator implements PathIterator { ! // The iterator we are applied to. ! private PathIterator subIterator; ! ! public Iterator (PathIterator subIterator) ! { ! this.subIterator = subIterator; ! } ! ! public int currentSegment (double[] coords) ! { ! int r = subIterator.currentSegment (coords); ! int count = 0; ! ! switch (r) ! { ! case SEG_CUBICTO: ! count = 3; ! break; ! ! case SEG_QUADTO: ! count = 2; ! break; ! ! case SEG_LINETO: ! case SEG_MOVETO: ! count = 1; ! break; ! ! default: ! // Error. But how to report? ! case SEG_CLOSE: ! break; ! } ! ! transform (coords, 0, coords, 0, count); ! ! return r; ! } ! ! public int currentSegment (float[] coords) ! { ! int r = subIterator.currentSegment (coords); ! int count = 0; ! ! switch (r) ! { ! case SEG_CUBICTO: ! count = 3; ! break; ! ! case SEG_QUADTO: ! count = 2; ! break; ! ! case SEG_LINETO: ! case SEG_MOVETO: ! count = 1; ! break; ! ! default: ! // Error. But how to report? ! case SEG_CLOSE: ! break; ! } ! ! transform (coords, 0, coords, 0, count); ! ! return r; ! } ! ! public int getWindingRule () ! { ! return subIterator.getWindingRule (); ! } ! ! public boolean isDone () ! { ! return subIterator.isDone (); ! } ! ! public void next () ! { ! subIterator.next (); ! } } ! private double m00, m01, m02; ! private double m10, m11, m12; ! private int type; ! } --- 980,1469 ---- double n10 = tx.m10 * m00 + tx.m11 * m10; double n11 = tx.m10 * m01 + tx.m11 * m11; double n12 = tx.m10 * m02 + tx.m11 * m12 + tx.m12; m00 = n00; m01 = n01; m02 = n02; m10 = n10; m11 = n11; m12 = n12; + updateType(); } ! /** ! * Returns a transform, which if concatenated to this one, will result in ! * the identity transform. This is useful for undoing transformations, but ! * is only possible if the original transform has an inverse (ie. does not ! * map multiple points to the same line or point). A transform exists only ! * if getDeterminant() has a non-zero value. ! * ! * @return a new inverse transform ! * @throws NoninvertibleTransformException if inversion is not possible ! * @see #getDeterminant() ! */ ! public AffineTransform createInverse() throws NoninvertibleTransformException { ! double det = getDeterminant(); if (det == 0) ! throw new NoninvertibleTransformException("can't invert transform"); ! return new AffineTransform(m11 / det, -m10 / det, m01 / det, -m00 / det, ! -m02, -m12); } ! /** ! * Perform this transformation on the given source point, and store the ! * result in the destination (creating it if necessary). It is safe for ! * src and dst to be the same. ! * ! * @param src the source point ! * @param dst the destination, or null ! * @return the transformation of src, in dst if it was non-null ! * @throws NullPointerException if src is null ! */ ! public Point2D transform(Point2D src, Point2D dst) { if (dst == null) ! dst = new Point2D.Double(); ! double x = src.getX(); ! double y = src.getY(); double nx = m00 * x + m01 * y + m02; double ny = m10 * x + m11 * y + m12; ! dst.setLocation(nx, ny); return dst; } ! /** ! * Perform this transformation on an array of points, storing the results ! * in another (possibly same) array. This will not create a destination ! * array, but will create points for the null entries of the destination. ! * The transformation is done sequentially. While having a single source ! * and destination point be the same is safe, you should be aware that ! * duplicate references to the same point in the source, and having the ! * source overlap the destination, may result in your source points changing ! * from a previous transform before it is their turn to be evaluated. ! * ! * @param src the array of source points ! * @param srcOff the starting offset into src ! * @param dst the array of destination points (may have null entries) ! * @param dstOff the starting offset into dst ! * @param num the number of points to transform ! * @throws NullPointerException if src or dst is null, or src has null ! * entries ! * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded ! * @throws ArrayStoreException if new points are incompatible with dst ! */ ! public void transform(Point2D[] src, int srcOff, ! Point2D[] dst, int dstOff, int num) { ! while (--num >= 0) ! dst[dstOff] = transform(src[srcOff++], dst[dstOff++]); } ! /** ! * Perform this transformation on an array of points, in (x,y) pairs, ! * storing the results in another (possibly same) array. This will not ! * create a destination array. All sources are copied before the ! * transformation, so that no result will overwrite a point that has not yet ! * been evaluated. ! * ! * @param src the array of source points ! * @param srcOff the starting offset into src ! * @param dst the array of destination points ! * @param dstOff the starting offset into dst ! * @param num the number of points to transform ! * @throws NullPointerException if src or dst is null ! * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded ! */ ! public void transform(float[] srcPts, int srcOff, ! float[] dstPts, int dstOff, int num) { ! if (srcPts == dstPts && dstOff > srcOff ! && num > 1 && srcOff + 2 * num > dstOff) { ! float[] f = new float[2 * num]; ! System.arraycopy(srcPts, srcOff, f, 0, 2 * num); ! srcPts = f; ! } ! while (--num >= 0) ! { ! float x = srcPts[srcOff++]; ! float y = srcPts[srcOff++]; ! dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02); ! dstPts[dstOff++] = (float) (m10 * x + m10 * y + m12); } } ! /** ! * Perform this transformation on an array of points, in (x,y) pairs, ! * storing the results in another (possibly same) array. This will not ! * create a destination array. All sources are copied before the ! * transformation, so that no result will overwrite a point that has not yet ! * been evaluated. ! * ! * @param src the array of source points ! * @param srcOff the starting offset into src ! * @param dst the array of destination points ! * @param dstOff the starting offset into dst ! * @param num the number of points to transform ! * @throws NullPointerException if src or dst is null ! * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded ! */ ! public void transform(double[] srcPts, int srcOff, ! double[] dstPts, int dstOff, int num) { ! if (srcPts == dstPts && dstOff > srcOff ! && num > 1 && srcOff + 2 * num > dstOff) { ! double[] d = new double[2 * num]; ! System.arraycopy(srcPts, srcOff, d, 0, 2 * num); ! srcPts = d; ! } ! while (--num >= 0) ! { ! double x = srcPts[srcOff++]; ! double y = srcPts[srcOff++]; ! dstPts[dstOff++] = m00 * x + m01 * y + m02; ! dstPts[dstOff++] = m10 * x + m10 * y + m12; } } ! /** ! * Perform this transformation on an array of points, in (x,y) pairs, ! * storing the results in another array. This will not create a destination ! * array. ! * ! * @param src the array of source points ! * @param srcOff the starting offset into src ! * @param dst the array of destination points ! * @param dstOff the starting offset into dst ! * @param num the number of points to transform ! * @throws NullPointerException if src or dst is null ! * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded ! */ ! public void transform(float[] srcPts, int srcOff, ! double[] dstPts, int dstOff, int num) { ! while (--num >= 0) { ! float x = srcPts[srcOff++]; ! float y = srcPts[srcOff++]; ! dstPts[dstOff++] = m00 * x + m01 * y + m02; ! dstPts[dstOff++] = m10 * x + m10 * y + m12; } } ! /** ! * Perform this transformation on an array of points, in (x,y) pairs, ! * storing the results in another array. This will not create a destination ! * array. ! * ! * @param src the array of source points ! * @param srcOff the starting offset into src ! * @param dst the array of destination points ! * @param dstOff the starting offset into dst ! * @param num the number of points to transform ! * @throws NullPointerException if src or dst is null ! * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded ! */ ! public void transform(double[] srcPts, int srcOff, ! float[] dstPts, int dstOff, int num) { ! while (--num >= 0) { ! double x = srcPts[srcOff++]; ! double y = srcPts[srcOff++]; ! dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02); ! dstPts[dstOff++] = (float) (m10 * x + m10 * y + m12); } } ! /** ! * Perform the inverse of this transformation on the given source point, ! * and store the result in the destination (creating it if necessary). It ! * is safe for src and dst to be the same. ! * ! * @param src the source point ! * @param dst the destination, or null ! * @return the inverse transformation of src, in dst if it was non-null ! * @throws NullPointerException if src is null ! * @throws NoninvertibleTransformException if the inverse does not exist ! * @see #getDeterminant() ! */ ! public Point2D inverseTransform(Point2D src, Point2D dst) throws NoninvertibleTransformException { ! double det = getDeterminant(); if (det == 0) ! throw new NoninvertibleTransformException("couldn't invert transform"); if (dst == null) ! dst = new Point2D.Double(); ! double x = src.getX(); ! double y = src.getY(); ! double nx = (m11 * x + -m10 * y) / det - m02; ! double ny = (m01 * x + -m00 * y) / det - m12; ! dst.setLocation(nx, ny); return dst; } ! /** ! * Perform the inverse of this transformation on an array of points, in ! * (x,y) pairs, storing the results in another (possibly same) array. This ! * will not create a destination array. All sources are copied before the ! * transformation, so that no result will overwrite a point that has not yet ! * been evaluated. ! * ! * @param src the array of source points ! * @param srcOff the starting offset into src ! * @param dst the array of destination points ! * @param dstOff the starting offset into dst ! * @param num the number of points to transform ! * @throws NullPointerException if src or dst is null ! * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded ! * @throws NoninvertibleTransformException if the inverse does not exist ! * @see #getDeterminant() ! */ ! public void inverseTransform(double[] srcPts, int srcOff, ! double[] dstPts, int dstOff, int num) throws NoninvertibleTransformException { ! double det = getDeterminant(); if (det == 0) ! throw new NoninvertibleTransformException("couldn't invert transform"); ! if (srcPts == dstPts && dstOff > srcOff ! && num > 1 && srcOff + 2 * num > dstOff) { ! double[] d = new double[2 * num]; ! System.arraycopy(srcPts, srcOff, d, 0, 2 * num); ! srcPts = d; ! } ! while (--num >= 0) ! { ! double x = srcPts[srcOff++]; ! double y = srcPts[srcOff++]; ! dstPts[dstOff++] = (m11 * x + -m10 * y) / det - m02; ! dstPts[dstOff++] = (m01 * x + -m00 * y) / det - m12; } } ! /** ! * Perform this transformation, less any translation, on the given source ! * point, and store the result in the destination (creating it if ! * necessary). It is safe for src and dst to be the same. The reduced ! * transform is equivalent to: ! *
        !    * [ x' ] = [ m00 m01 ] [ x ] = [ m00 * x + m01 * y ]
        !    * [ y' ]   [ m10 m11 ] [ y ] = [ m10 * x + m11 * y ]
        !    * 
        ! * ! * @param src the source point ! * @param dst the destination, or null ! * @return the delta transformation of src, in dst if it was non-null ! * @throws NullPointerException if src is null ! */ ! public Point2D deltaTransform(Point2D src, Point2D dst) { if (dst == null) ! dst = new Point2D.Double(); ! double x = src.getX(); ! double y = src.getY(); double nx = m00 * x + m01 * y; double ny = m10 * x + m11 * y; ! dst.setLocation(nx, ny); return dst; } ! /** ! * Perform this transformation, less any translation, on an array of points, ! * in (x,y) pairs, storing the results in another (possibly same) array. ! * This will not create a destination array. All sources are copied before ! * the transformation, so that no result will overwrite a point that has ! * not yet been evaluated. The reduced transform is equivalent to: ! *
        !    * [ x' ] = [ m00 m01 ] [ x ] = [ m00 * x + m01 * y ]
        !    * [ y' ]   [ m10 m11 ] [ y ] = [ m10 * x + m11 * y ]
        !    * 
        ! * ! * @param src the array of source points ! * @param srcOff the starting offset into src ! * @param dst the array of destination points ! * @param dstOff the starting offset into dst ! * @param num the number of points to transform ! * @throws NullPointerException if src or dst is null ! * @throws ArrayIndexOutOfBoundsException if array bounds are exceeded ! */ ! public void deltaTransform(double[] srcPts, int srcOff, ! double[] dstPts, int dstOff, ! int num) { ! if (srcPts == dstPts && dstOff > srcOff ! && num > 1 && srcOff + 2 * num > dstOff) { ! double[] d = new double[2 * num]; ! System.arraycopy(srcPts, srcOff, d, 0, 2 * num); ! srcPts = d; ! } ! while (--num >= 0) ! { ! double x = srcPts[srcOff++]; ! double y = srcPts[srcOff++]; ! dstPts[dstOff++] = m00 * x + m01 * y; ! dstPts[dstOff++] = m10 * x + m11 * y; } } ! /** ! * Return a new Shape, based on the given one, where the path of the shape ! * has been transformed by this transform. Notice that this uses GeneralPath, ! * which only stores points in float precision. ! * ! * @param src the shape source to transform ! * @return the shape, transformed by this ! * @throws NullPointerException if src is null ! * @see GeneralPath#transform(AffineTransform) ! */ ! public Shape createTransformedShape(Shape src) { ! GeneralPath p = new GeneralPath(src); ! p.transform(this); ! return p; } ! /** ! * Returns a string representation of the transform, in the format: ! * "AffineTransform[[" + m00 + ", " + m01 + ", " + m02 + "], [" ! * + m10 + ", " + m11 + ", " + m12 + "]]". ! * ! * @return the string representation ! */ ! public String toString() { ! return "AffineTransform[[" + m00 + ", " + m01 + ", " + m02 + "], [" ! + m10 + ", " + m11 + ", " + m12 + "]]"; } ! /** ! * Tests if this transformation is the identity: ! *
        !    * [ 1 0 0 ]
        !    * [ 0 1 0 ]
        !    * [ 0 0 1 ]
        !    * 
        ! * ! * @return true if this is the identity transform ! */ ! public boolean isIdentity() { + // Rather than rely on type, check explicitly. return (m00 == 1 && m01 == 0 && m02 == 0 ! && m10 == 0 && m11 == 1 && m12 == 0); } ! /** ! * Create a new transform of the same run-time type, with the same ! * transforming properties as this one. ! * ! * @return the clone ! */ ! public Object clone() { ! try ! { ! return super.clone(); ! } ! catch (CloneNotSupportedException e) ! { ! throw (Error) new InternalError().initCause(e); // Impossible ! } } ! /** ! * Return the hashcode for this transformation. The formula is not ! * documented, but appears to be the same as: ! *
        !    * long l = Double.doubleToLongBits(getScaleX());
        !    * l = l * 31 + Double.doubleToLongBits(getShearY());
        !    * l = l * 31 + Double.doubleToLongBits(getShearX());
        !    * l = l * 31 + Double.doubleToLongBits(getScaleY());
        !    * l = l * 31 + Double.doubleToLongBits(getTranslateX());
        !    * l = l * 31 + Double.doubleToLongBits(getTranslateY());
        !    * return (int) ((l >> 32) ^ l);
        !    * 
        ! * ! * @return the hashcode ! */ ! public int hashCode() { ! long l = Double.doubleToLongBits(m00); ! l = l * 31 + Double.doubleToLongBits(m10); ! l = l * 31 + Double.doubleToLongBits(m01); ! l = l * 31 + Double.doubleToLongBits(m11); ! l = l * 31 + Double.doubleToLongBits(m02); ! l = l * 31 + Double.doubleToLongBits(m12); ! return (int) ((l >> 32) ^ l); } ! /** ! * Compares two transforms for equality. This returns true if they have the ! * same matrix values. ! * ! * @param o the transform to compare ! * @return true if it is equal ! */ ! public boolean equals(Object obj) { if (! (obj instanceof AffineTransform)) return false; AffineTransform t = (AffineTransform) obj; return (m00 == t.m00 && m01 == t.m01 && m02 == t.m02 ! && m10 == t.m10 && m11 == t.m11 && m12 == t.m12); } ! /** ! * Helper to decode the type from the matrix. This is not guaranteed ! * to find the optimal type, but at least it will be valid. ! */ ! private void updateType() { ! double det = getDeterminant(); ! if (det == 0) ! { ! type = TYPE_GENERAL_TRANSFORM; ! return; ! } ! // Scale (includes rotation by PI) or translation. ! if (m01 == 0 && m10 == 0) ! { ! if (m00 == m11) ! type = m00 == 1 ? TYPE_IDENTITY : TYPE_UNIFORM_SCALE; ! else ! type = TYPE_GENERAL_SCALE; ! if (m02 != 0 || m12 != 0) ! type |= TYPE_TRANSLATION; ! } ! // Rotation. ! else if (m00 == m11 && m01 == -m10) ! { ! type = m00 == 0 ? TYPE_QUADRANT_ROTATION : TYPE_GENERAL_ROTATION; ! if (det != 1) ! type |= TYPE_UNIFORM_SCALE; ! if (m02 != 0 || m12 != 0) ! type |= TYPE_TRANSLATION; ! } ! else ! type = TYPE_GENERAL_TRANSFORM; } ! /** ! * Reads a transform from an object stream. ! * ! * @param s the stream to read from ! * @throws ClassNotFoundException if there is a problem deserializing ! * @throws IOException if there is a problem deserializing ! */ ! private void readObject(ObjectInputStream s) ! throws ClassNotFoundException, IOException ! { ! s.defaultReadObject(); ! updateType(); ! } ! } // class AffineTransform diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/Arc2D.java gcc-3.3/libjava/java/awt/geom/Arc2D.java *** gcc-3.2.3/libjava/java/awt/geom/Arc2D.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/Arc2D.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,1123 ---- + /* Arc2D.java -- represents an arc in 2-D space + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.geom; + + import java.util.NoSuchElementException; + + /** + * This class represents all arcs (segments of an ellipse in 2-D space). The + * arcs are defined by starting angle and extent (arc length) in degrees, as + * opposed to radians (like the rest of Java), and can be open, chorded, or + * wedge shaped. The angles are skewed according to the ellipse, so that 45 + * degrees always points to the upper right corner (positive x, negative y) + * of the bounding rectangle. A positive extent draws a counterclockwise arc, + * and while the angle can be any value, the path iterator only traverses the + * first 360 degrees. Storage is up to the subclasses. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4, but still missing functionality + */ + public abstract class Arc2D extends RectangularShape + { + /** + * An open arc, with no segment connecting the endpoints. This type of + * arc still contains the same points as a chorded version. + */ + public static final int OPEN = 0; + + /** + * A closed arc with a single segment connecting the endpoints (a chord). + */ + public static final int CHORD = 1; + + /** + * A closed arc with two segments, one from each endpoint, meeting at the + * center of the ellipse. + */ + public static final int PIE = 2; + + /** The closure type of this arc. */ + private int type; + + /** + * Create a new arc, with the specified closure type. + * + * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}. + * @throws IllegalArgumentException if type is invalid + */ + protected Arc2D(int type) + { + if (type < OPEN || type > PIE) + throw new IllegalArgumentException(); + this.type = type; + } + + /** + * Get the starting angle of the arc in degrees. + * + * @return the starting angle + * @see #setAngleStart(double) + */ + public abstract double getAngleStart(); + + /** + * Get the extent angle of the arc in degrees. + * + * @return the extent angle + * @see #setAngleExtent(double) + */ + public abstract double getAngleExtent(); + + /** + * Return the closure type of the arc. + * + * @return the closure type + * @see #OPEN + * @see #CHORD + * @see #PIE + * @see #setArcType(int) + */ + public int getArcType() + { + return type; + } + + /** + * Returns the starting point of the arc. + * + * @return the start point + */ + public Point2D getStartPoint() + { + double angle = getAngleStart() * (-180 / Math.PI); + double x = (Math.cos(angle) * getWidth() + getX()) / 2; + double y = (Math.sin(angle) * getHeight() + getY()) / 2; + return new Point2D.Double(x, y); + } + + /** + * Returns the ending point of the arc. + * + * @return the end point + */ + public Point2D getEndPoint() + { + double angle = (getAngleStart() + getAngleExtent()) * (-180 / Math.PI); + double x = (Math.cos(angle) * getWidth() + getX()) / 2; + double y = (Math.sin(angle) * getHeight() + getY()) / 2; + return new Point2D.Double(x, y); + } + + /** + * Set the parameters of the arc. The angles are in degrees, and a positive + * extent sweeps counterclockwise (from the positive x-axis to the negative + * y-axis). + * + * @param x the new x coordinate of the lower left of the bounding box + * @param y the new y coordinate of the lower left of the bounding box + * @param w the new width of the bounding box + * @param h the new height of the bounding box + * @param start the start angle, in degrees + * @param extent the arc extent, in degrees + * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE} + * @throws IllegalArgumentException if type is invalid + */ + public abstract void setArc(double x, double y, double w, double h, + double start, double extent, int type); + + /** + * Set the parameters of the arc. The angles are in degrees, and a positive + * extent sweeps counterclockwise (from the positive x-axis to the negative + * y-axis). + * + * @param p the lower left point of the bounding box + * @param d the dimensions of the bounding box + * @param start the start angle, in degrees + * @param extent the arc extent, in degrees + * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE} + * @throws IllegalArgumentException if type is invalid + * @throws NullPointerException if p or d is null + */ + public void setArc(Point2D p, Dimension2D d, + double start, double extent, int type) + { + setArc(p.getX(), p.getY(), d.getWidth(), d.getHeight(), + start, extent, type); + } + + /** + * Set the parameters of the arc. The angles are in degrees, and a positive + * extent sweeps counterclockwise (from the positive x-axis to the negative + * y-axis). + * + * @param r the new bounding box + * @param start the start angle, in degrees + * @param extent the arc extent, in degrees + * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE} + * @throws IllegalArgumentException if type is invalid + * @throws NullPointerException if r is null + */ + public void setArc(Rectangle2D r, double start, double extent, int type) + { + setArc(r.getX(), r.getY(), r.getWidth(), r.getHeight(), + start, extent, type); + } + + /** + * Set the parameters of the arc from the given one. + * + * @param a the arc to copy + * @throws NullPointerException if a is null + */ + public void setArc(Arc2D a) + { + setArc(a.getX(), a.getY(), a.getWidth(), a.getHeight(), + a.getAngleStart(), a.getAngleExtent(), a.getArcType()); + } + + /** + * Set the parameters of the arc. The angles are in degrees, and a positive + * extent sweeps counterclockwise (from the positive x-axis to the negative + * y-axis). This controls the center point and radius, so the arc will be + * circular. + * + * @param x the x coordinate of the center of the circle + * @param y the y coordinate of the center of the circle + * @param r the radius of the circle + * @param start the start angle, in degrees + * @param extent the arc extent, in degrees + * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE} + * @throws IllegalArgumentException if type is invalid + */ + public void setArcByCenter(double x, double y, double r, + double start, double extent, int type) + { + setArc(x - r, y - r, r + r, r + r, start, extent, type); + } + + /** + * Sets the parameters of the arc by finding the tangents of two lines, and + * using the specified radius. The arc will be circular, will begin on the + * tangent point of the line extending from p1 to p2, and will end on the + * tangent point of the line extending from p2 to p3. + * + * XXX What happens if the points are colinear, or the radius negative? + * + * @param p1 the first point + * @param p2 the tangent line intersection point + * @param p3 the third point + * @param r the radius of the arc + * @throws NullPointerException if any point is null + */ + public void setArcByTangent(Point2D p1, Point2D p2, Point2D p3, double r) + { + // XXX Implement. + throw new Error("not implemented"); + } + + /** + * Set the start, in degrees. + * + * @param start the new start angle + * @see #getAngleStart() + */ + public abstract void setAngleStart(double start); + + /** + * Set the extent, in degrees. + * + * @param extent the new extent angle + * @see #getAngleExtent() + */ + public abstract void setAngleExtent(double extent); + + /** + * Sets the starting angle to the angle of the given point relative to + * the center of the arc. The extent remains constant; in other words, + * this rotates the arc. + * + * @param p the new start point + * @throws NullPointerException if p is null + * @see #getStartPoint() + * @see #getAngleStart() + */ + public void setAngleStart(Point2D p) + { + double x = ((p.getX() * 2) - getX()) / getWidth(); + double y = ((p.getY() * 2) - getY()) / getHeight(); + setAngleStart(Math.atan2(y, x) * (-180 / Math.PI)); + } + + /** + * Sets the starting and extent angles to those of the given points + * relative to the center of the arc. The arc will be non-empty, and will + * extend counterclockwise. + * + * @param x1 the first x coordinate + * @param y1 the first y coordinate + * @param x2 the second x coordinate + * @param y2 the second y coordinate + * @see #setAngleStart(Point2D) + */ + public void setAngles(double x1, double y1, double x2, double y2) + { + // Normalize the points. + double mx = getX(); + double my = getY(); + double mw = getWidth(); + double mh = getHeight(); + x1 = ((x1 * 2) - mx) / mw; + y1 = ((y1 * 2) - my) / mh; + x2 = ((x2 * 2) - mx) / mw; + y2 = ((y2 * 2) - my) / mh; + double start = Math.atan2(y1, x1) * (-180 / Math.PI); + double extent = Math.atan2(y2, x2) * (-180 / Math.PI) - start; + if (extent < 0) + extent += 360; + setAngleStart(start); + setAngleExtent(extent); + } + + /** + * Sets the starting and extent angles to those of the given points + * relative to the center of the arc. The arc will be non-empty, and will + * extend counterclockwise. + * + * @param p1 the first point + * @param p2 the second point + * @throws NullPointerException if either point is null + * @see #setAngleStart(Point2D) + */ + public void setAngles(Point2D p1, Point2D p2) + { + setAngles(p1.getX(), p1.getY(), p2.getX(), p2.getY()); + } + + /** + * Set the closure type of this arc. + * + * @param type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE} + * @throws IllegalArgumentException if type is invalid + * @see #getArcType() + */ + public void setArcType(int type) + { + if (type < OPEN || type > PIE) + throw new IllegalArgumentException(); + this.type = type; + } + + /** + * Sets the location and bounds of the ellipse of which this arc is a part. + * + * @param x the new x coordinate + * @param y the new y coordinate + * @param w the new width + * @param h the new height + * @see #getFrame() + */ + public void setFrame(double x, double y, double w, double h) + { + setArc(x, y, w, h, getAngleStart(), getAngleExtent(), type); + } + + /** + * Gets the bounds of the arc. This is much tighter than + * getBounds, as it takes into consideration the start and + * end angles, and the center point of a pie wedge, rather than just the + * overall ellipse. + * + * @return the bounds of the arc + * @see #getBounds() + */ + public Rectangle2D getBounds2D() + { + double extent = getAngleExtent(); + if (Math.abs(extent) >= 360) + return makeBounds(getX(), getY(), getWidth(), getHeight()); + // XXX Finish implementing. + throw new Error("not implemented"); + } + + /** + * Construct a bounding box in a precision appropriate for the subclass. + * + * @param x the x coordinate + * @param y the y coordinate + * @param w the width + * @param h the height + * @return the rectangle for use in getBounds2D + */ + protected abstract Rectangle2D makeBounds(double x, double y, + double w, double h); + + /** + * Tests if the given angle, in degrees, is included in the arc. + * + * XXX Does this normalize all angles to -180 - 180 first? + * + * @param a the angle to test + * @return true if it is contained + */ + public boolean containsAngle(double a) + { + // XXX Implement. + throw new Error("not implemented"); + } + + /** + * Determines if the arc contains the given point. If the bounding box + * is empty, then this will return false. + * + * @param x the x coordinate to test + * @param y the y coordinate to test + * @return true if the point is inside the arc + */ + public boolean contains(double x, double y) + { + double w = getWidth(); + double h = getHeight(); + if (w <= 0 || h <= 0) + return false; + // XXX Finish implementing. + throw new Error("not implemented"); + } + + /** + * Tests if a given rectangle intersects the area of the arc. + * + * @param x the x coordinate of the rectangle + * @param y the y coordinate of the rectangle + * @param w the width of the rectangle + * @param h the height of the rectangle + * @return true if the two shapes share common points + */ + public boolean intersects(double x, double y, double w, double h) + { + double mw = getWidth(); + double mh = getHeight(); + if (mw <= 0 || mh <= 0 || w <= 0 || h <= 0) + return false; + // XXX Finish implementing. + throw new Error("not implemented"); + } + + /** + * Tests if a given rectangle is contained in the area of the arc. + * + * @param x the x coordinate of the rectangle + * @param y the y coordinate of the rectangle + * @param w the width of the rectangle + * @param h the height of the rectangle + * @return true if the arc contains the rectangle + */ + public boolean contains(double x, double y, double w, double h) + { + double mw = getWidth(); + double mh = getHeight(); + if (mw <= 0 || mh <= 0 || w <= 0 || h <= 0) + return false; + // XXX Finish implementing. + throw new Error("not implemented"); + } + + /** + * Tests if a given rectangle is contained in the area of the arc. + * + * @param r the rectangle + * @return true if the arc contains the rectangle + */ + public boolean contains(Rectangle2D r) + { + return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); + } + + /** + * Returns an iterator over this arc, with an optional transformation. + * This iterator is threadsafe, so future modifications to the arc do not + * affect the iteration. + * + * @param at the transformation, or null + * @return a path iterator + */ + public PathIterator getPathIterator(AffineTransform at) + { + return new ArcIterator(this, at); + } + + /** + * This class is used to iterate over an arc. Since ellipses are a subclass + * of arcs, this is used by Ellipse2D as well. + * + * @author Eric Blake + */ + static final class ArcIterator implements PathIterator + { + /** The current iteration. */ + private int current; + + /** The last iteration. */ + private final int limit; + + /** The optional transformation. */ + private final AffineTransform xform; + + /** The x coordinate of the bounding box. */ + private final double x; + + /** The y coordinate of the bounding box. */ + private final double y; + + /** The width of the bounding box. */ + private final double w; + + /** The height of the bounding box. */ + private final double h; + + /** The start angle, in radians (not degrees). */ + private final double start; + + /** The extent angle, in radians (not degrees). */ + private final double extent; + + /** The arc closure type. */ + private final int type; + + /** + * Construct a new iterator over an arc. + * + * @param a the arc + * @param xform the transform + */ + ArcIterator(Arc2D a, AffineTransform xform) + { + this.xform = xform; + x = a.getX(); + y = a.getY(); + w = a.getWidth(); + h = a.getHeight(); + start = a.getAngleStart() * (Math.PI / 180); + extent = a.getAngleExtent() * (Math.PI / 180); + type = a.type; + double e = extent < 0 ? -extent : extent; + if (w < 0 || h < 0) + limit = -1; + else if (e == 0) + limit = type; + else if (e <= 90) + limit = type + 1; + else if (e <= 180) + limit = type + 2; + else if (e <= 270) + limit = type + 3; + else + limit = type + 4; + } + + /** + * Construct a new iterator over an ellipse. + * + * @param e the ellipse + * @param xform the transform + */ + ArcIterator(Ellipse2D e, AffineTransform xform) + { + this.xform = xform; + x = e.getX(); + y = e.getY(); + w = e.getWidth(); + h = e.getHeight(); + start = 0; + extent = -2 * Math.PI; + type = CHORD; + limit = (w < 0 || h < 0) ? -1 : 5; + } + + /** + * Return the winding rule. + * + * @return {@link PathIterator#WIND_NON_ZERO} + */ + public int getWindingRule() + { + return WIND_NON_ZERO; + } + + /** + * Test if the iteration is complete. + * + * @return true if more segments exist + */ + public boolean isDone() + { + return current > limit; + } + + /** + * Advance the iterator. + */ + public void next() + { + current++; + } + + /** + * Put the current segment into the array, and return the segment type. + * + * @param coords an array of 6 elements + * @return the segment type + * @throws NullPointerException if coords is null + * @throws ArrayIndexOutOfBoundsException if coords is too small + */ + public int currentSegment(float[] coords) + { + if (current > limit) + throw new NoSuchElementException("arc iterator out of bounds"); + if (current == 0) + { + coords[0] = (float) (Math.cos(start) * w + x) / 2; + coords[1] = (float) (Math.sin(start) * h + y) / 2; + if (xform != null) + xform.transform(coords, 0, coords, 0, 1); + return SEG_MOVETO; + } + if (type != OPEN && current == limit) + return SEG_CLOSE; + if (type == PIE && current == limit - 1) + { + coords[0] = (float) (x + w / 2); + coords[1] = (float) (y + h / 2); + if (xform != null) + xform.transform(coords, 0, coords, 0, 1); + return SEG_LINETO; + } + // XXX Fill coords with 2 control points and next quarter point + coords[0] = (float) 0; + coords[1] = (float) 0; + coords[2] = (float) 0; + coords[3] = (float) 0; + coords[4] = (float) 0; + coords[5] = (float) 0; + if (xform != null) + xform.transform(coords, 0, coords, 0, 3); + return SEG_CUBICTO; + } + + /** + * Put the current segment into the array, and return the segment type. + * + * @param coords an array of 6 elements + * @return the segment type + * @throws NullPointerException if coords is null + * @throws ArrayIndexOutOfBoundsException if coords is too small + */ + public int currentSegment(double[] coords) + { + if (current > limit) + throw new NoSuchElementException("arc iterator out of bounds"); + if (current == 0) + { + coords[0] = (Math.cos(start) * w + x) / 2; + coords[1] = (Math.sin(start) * h + y) / 2; + if (xform != null) + xform.transform(coords, 0, coords, 0, 1); + return SEG_MOVETO; + } + if (type != OPEN && current == limit) + return SEG_CLOSE; + if (type == PIE && current == limit - 1) + { + coords[0] = (float) (x + w / 2); + coords[1] = (float) (y + h / 2); + if (xform != null) + xform.transform(coords, 0, coords, 0, 1); + return SEG_LINETO; + } + // XXX Fill coords with 2 control points and next quarter point + coords[0] = 0; + coords[1] = 0; + coords[2] = 0; + coords[3] = 0; + coords[4] = 0; + coords[5] = 0; + if (xform != null) + xform.transform(coords, 0, coords, 0, 3); + return SEG_CUBICTO; + } + } // class ArcIterator + + /** + * This class implements an arc in double precision. + * + * @author Eric Blake ! * @date February, 1999. ! */ ! ! /* Written using online API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: Believed complete and correct. */ - public abstract class Dimension2D implements Cloneable { public abstract double getWidth(); public abstract double getHeight(); ! public abstract void setSize (double width, double height); ! public void setSize (Dimension2D dim) { ! setSize(dim.getWidth(), dim.getHeight()); } ! public Object clone () { try ! { ! return super.clone (); ! } ! catch (CloneNotSupportedException _) {return null;} ! } ! ! protected Dimension2D () ! { } ! } --- 35,118 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.geom; /** + * This stores a dimension in 2-dimensional space - a width (along the x-axis) + * and height (along the y-axis). The storage is left to subclasses. + * * @author Per Bothner ! * @author Eric Blake ! * @since 1.2 ! * @status updated to 1.4 */ public abstract class Dimension2D implements Cloneable { + /** + * The default constructor. + */ + protected Dimension2D() + { + } + + /** + * Get the width of this dimension. A negative result, while legal, is + * undefined in meaning. + * + * @return the width + */ public abstract double getWidth(); + + /** + * Get the height of this dimension. A negative result, while legal, is + * undefined in meaning. + * + * @return the height + */ public abstract double getHeight(); ! /** ! * Set the size of this dimension to the requested values. Loss of precision ! * may occur. ! * ! * @param w the new width ! * @param h the new height ! */ ! public abstract void setSize(double w, double h); ! /** ! * Set the size of this dimension to the requested value. Loss of precision ! * may occur. ! * ! * @param d the dimension containing the new values ! * ! * @throws NullPointerException if d is null ! */ ! public void setSize(Dimension2D d) { ! setSize(d.getWidth(), d.getHeight()); } ! /** ! * Create a new dimension of the same run-time type with the same contents ! * as this one. ! * ! * @return the clone ! * ! * @exception OutOfMemoryError If there is not enough memory available. ! * ! * @since 1.2 ! */ ! public Object clone() { try ! { ! return super.clone(); ! } ! catch (CloneNotSupportedException e) ! { ! throw (Error) new InternalError().initCause(e); // Impossible ! } } ! } // class Dimension2D diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/Ellipse2D.java gcc-3.3/libjava/java/awt/geom/Ellipse2D.java *** gcc-3.2.3/libjava/java/awt/geom/Ellipse2D.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/Ellipse2D.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Ellipse2D.java -- represents an ellipse in 2-D space ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** package java.awt.geom; *** 38,76 **** /** * @author Tom Tromey ! * @date April 16, 2000 */ - public abstract class Ellipse2D extends RectangularShape { ! protected Ellipse2D () { } ! public boolean contains (double x, double y) { ! double rx = getWidth () / 2; ! double ry = getHeight () / 2; ! double tx = (x - getCenterX ()) / rx; ! double ty = (y - getCenterY ()) / ry; return tx * tx + ty * ty <= 1.0; } ! public boolean contains (double x, double y, double w, double h) { double x2 = x + w; double y2 = y + h; ! return (contains (x, y) && contains (x, y2) ! && contains (x2, y) && contains (x2, y2)); } ! public PathIterator getPathIterator (AffineTransform at) { ! // fixme; ! return null; } ! public boolean intersects (double x, double y, double w, double h) { // fixme return false; --- 39,78 ---- /** * @author Tom Tromey ! * @author Eric Blake ! * @since 1.2 ! * @status still needs documentation */ public abstract class Ellipse2D extends RectangularShape { ! protected Ellipse2D() { } ! public boolean contains(double x, double y) { ! double rx = getWidth() / 2; ! double ry = getHeight() / 2; ! double tx = (x - getCenterX()) / rx; ! double ty = (y - getCenterY()) / ry; return tx * tx + ty * ty <= 1.0; } ! public boolean contains(double x, double y, double w, double h) { double x2 = x + w; double y2 = y + h; ! return (contains(x, y) && contains(x, y2) ! && contains(x2, y) && contains(x2, y2)); } ! public PathIterator getPathIterator(AffineTransform at) { ! // An ellipse is just a complete arc. ! return new Arc2D.ArcIterator(this, at); } ! public boolean intersects(double x, double y, double w, double h) { // fixme return false; *************** public abstract class Ellipse2D extends *** 83,139 **** public double x; public double y; ! public Double () { - height = width = x = y = 0; } ! public Double (double x, double y, double w, double h) { this.x = x; this.y = y; ! this.height = h; ! this.width = w; } ! public Rectangle2D getBounds2D () { ! return new Rectangle2D.Double (x, y, width, height); } ! public double getHeight () { return height; } ! public double getWidth () { return width; } ! public double getX () { return x; } ! public double getY () { return y; } ! public boolean isEmpty () { return height <= 0 || width <= 0; } ! public void setFrame (double x, double y, double w, double h) { this.x = x; this.y = y; ! this.height = h; ! this.width = w; } ! } public static class Float extends Ellipse2D { --- 85,140 ---- public double x; public double y; ! public Double() { } ! public Double(double x, double y, double w, double h) { this.x = x; this.y = y; ! height = h; ! width = w; } ! public Rectangle2D getBounds2D() { ! return new Rectangle2D.Double(x, y, width, height); } ! public double getHeight() { return height; } ! public double getWidth() { return width; } ! public double getX() { return x; } ! public double getY() { return y; } ! public boolean isEmpty() { return height <= 0 || width <= 0; } ! public void setFrame(double x, double y, double w, double h) { this.x = x; this.y = y; ! height = h; ! width = w; } ! } // class Double public static class Float extends Ellipse2D { *************** public abstract class Ellipse2D extends *** 142,153 **** public float x; public float y; ! public Float () { - height = width = x = y = 0; } ! public Float (float x, float y, float w, float h) { this.x = x; this.y = y; --- 143,153 ---- public float x; public float y; ! public Float() { } ! public Float(float x, float y, float w, float h) { this.x = x; this.y = y; *************** public abstract class Ellipse2D extends *** 155,204 **** this.width = w; } ! public Rectangle2D getBounds2D () { ! return new Rectangle2D.Float (x, y, width, height); } ! public double getHeight () { return height; } ! public double getWidth () { return width; } ! public double getX () { return x; } ! public double getY () { return y; } ! public boolean isEmpty () { return height <= 0 || width <= 0; } ! public void setFrame (float x, float y, float w, float h) { this.x = x; this.y = y; ! this.height = h; ! this.width = w; } ! public void setFrame (double x, double y, double w, double h) { this.x = (float) x; this.y = (float) y; ! this.height = (float) h; ! this.width = (float) w; } ! } ! } --- 155,204 ---- this.width = w; } ! public Rectangle2D getBounds2D() { ! return new Rectangle2D.Float(x, y, width, height); } ! public double getHeight() { return height; } ! public double getWidth() { return width; } ! public double getX() { return x; } ! public double getY() { return y; } ! public boolean isEmpty() { return height <= 0 || width <= 0; } ! public void setFrame(float x, float y, float w, float h) { this.x = x; this.y = y; ! height = h; ! width = w; } ! public void setFrame(double x, double y, double w, double h) { this.x = (float) x; this.y = (float) y; ! height = (float) h; ! width = (float) w; } ! } // class Float ! } // class Ellipse2D diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/FlatteningPathIterator.java gcc-3.3/libjava/java/awt/geom/FlatteningPathIterator.java *** gcc-3.2.3/libjava/java/awt/geom/FlatteningPathIterator.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/FlatteningPathIterator.java 2002-08-09 04:26:15.000000000 +0000 *************** *** 0 **** --- 1,105 ---- + /* FlatteningPathIterator.java -- performs interpolation of curved paths + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.geom; + + /** + * This class can be used to perform the flattening required by the Shape + * interface. It interpolates a curved path segment into a sequence of flat + * ones within a certain flatness, up to a recursion limit. + * + * @author Eric Blake + * @see Shape + * @see RectangularShape#getPathIterator(AffineTransform, double) + * @since 1.2 + * @status STUBS ONLY + */ + public class FlatteningPathIterator implements PathIterator + { + // The iterator we are applied to. + private PathIterator subIterator; + private double flatness; + private int limit; + + public FlatteningPathIterator(PathIterator src, double flatness) + { + this(src, flatness, 10); + } + public FlatteningPathIterator(PathIterator src, double flatness, int limit) + { + subIterator = src; + this.flatness = flatness; + this.limit = limit; + if (flatness < 0 || limit < 0) + throw new IllegalArgumentException(); + } + + public double getFlatness() + { + return flatness; + } + + public int getRecursionLimit() + { + return limit; + } + + public int getWindingRule() + { + return subIterator.getWindingRule(); + } + + public boolean isDone() + { + return subIterator.isDone(); + } + + public void next() + { + throw new Error("not implemented"); + } + + public int currentSegment(double[] coords) + { + throw new Error("not implemented"); + } + public int currentSegment(float[] coords) + { + throw new Error("not implemented"); + } + } // class FlatteningPathIterator diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/GeneralPath.java gcc-3.3/libjava/java/awt/geom/GeneralPath.java *** gcc-3.2.3/libjava/java/awt/geom/GeneralPath.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/GeneralPath.java 2003-01-14 22:12:52.000000000 +0000 *************** *** 0 **** --- 1,365 ---- + /* GeneralPath.java -- represents a shape built from subpaths + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.geom; + + import java.awt.Rectangle; + import java.awt.Shape; + + /** + * STUBS ONLY + * XXX Implement and document. Note that Sun's implementation only expects + * float precision, not double. + */ + public final class GeneralPath implements Shape, Cloneable + { + public static final int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD; + public static final int WIND_NON_ZERO = PathIterator.WIND_NON_ZERO; + + /** Initial size if not specified. */ + private static final int INIT_SIZE = 20; + + /** The winding rule. */ + private int rule; + /** + * The path type in points. Note that points[index] maps to + * types[index >> 1]; the control points of quad and cubic paths map as + * well but are ignored. + */ + private byte[] types; + /** + * The list of all points seen. Since you can only append floats, it makes + * sense for this to be a float[]. I have no idea why Sun didn't choose to + * allow a general path of double precision points. + */ + private float[] points; + /** The index of the most recent moveto point, or null. */ + private int subpath = -1; + /** The next available index into points. */ + private int index; + + public GeneralPath() + { + this(WIND_NON_ZERO, INIT_SIZE); + } + public GeneralPath(int rule) + { + this(rule, INIT_SIZE); + } + public GeneralPath(int rule, int capacity) + { + if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) + throw new IllegalArgumentException(); + this.rule = rule; + if (capacity < INIT_SIZE) + capacity = INIT_SIZE; + types = new byte[capacity >> 1]; + points = new float[capacity]; + } + public GeneralPath(Shape s) + { + types = new byte[INIT_SIZE >> 1]; + points = new float[INIT_SIZE]; + PathIterator pi = s.getPathIterator(null); + setWindingRule(pi.getWindingRule()); + append(pi, false); + } + + public void moveTo(float x, float y) + { + subpath = index; + ensureSize(index + 2); + types[index >> 1] = PathIterator.SEG_MOVETO; + points[index++] = x; + points[index++] = y; + } + public void lineTo(float x, float y) + { + ensureSize(index + 2); + types[index >> 1] = PathIterator.SEG_LINETO; + points[index++] = x; + points[index++] = y; + } + public void quadTo(float x1, float y1, float x2, float y2) + { + ensureSize(index + 4); + types[index >> 1] = PathIterator.SEG_QUADTO; + points[index++] = x1; + points[index++] = y1; + points[index++] = x2; + points[index++] = y2; + } + public void curveTo(float x1, float y1, float x2, float y2, + float x3, float y3) + { + ensureSize(index + 6); + types[index >> 1] = PathIterator.SEG_QUADTO; + points[index++] = x1; + points[index++] = y1; + points[index++] = x2; + points[index++] = y2; + points[index++] = x3; + points[index++] = y3; + } + public void closePath() + { + ensureSize(index + 2); + types[index >> 1] = PathIterator.SEG_CLOSE; + points[index++] = points[subpath]; + points[index++] = points[subpath + 1]; + } + + public void append(Shape s, boolean connect) + { + append(s.getPathIterator(null), connect); + } + public void append(PathIterator i, boolean connect) + { + float[] f = new float[6]; + while (! i.isDone()) + { + int result = i.currentSegment(f); + switch (result) + { + case PathIterator.SEG_MOVETO: + if (! connect) + { + moveTo(f[0], f[1]); + break; + } + if (subpath >= 0 && f[0] == points[subpath] + && f[1] == points[subpath + 1]) + break; + // Fallthrough. + case PathIterator.SEG_LINETO: + lineTo(f[0], f[1]); + break; + case PathIterator.SEG_QUADTO: + quadTo(f[0], f[1], f[2], f[3]); + break; + case PathIterator.SEG_CUBICTO: + curveTo(f[0], f[1], f[2], f[3], f[4], f[5]); + break; + default: + closePath(); + } + connect = false; + } + } + + public int getWindingRule() + { + return rule; + } + public void setWindingRule(int rule) + { + if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) + throw new IllegalArgumentException(); + this.rule = rule; + } + + public Point2D getCurrentPoint() + { + if (subpath < 0) + return null; + return new Point2D.Float(points[subpath], points[subpath + 1]); + } + public void reset() + { + subpath = -1; + index = 0; + } + + public void transform(AffineTransform xform) + { + xform.transform(points, 0, points, 0, index >> 1); + } + public Shape createTransformedShape(AffineTransform xform) + { + GeneralPath p = new GeneralPath(this); + p.transform(xform); + return p; + } + + public Rectangle getBounds() + { + return getBounds2D().getBounds(); + } + public Rectangle2D getBounds2D() + { + // XXX Implement. + throw new Error("not implemented"); + } + + public boolean contains(double x, double y) + { + // XXX Implement. + throw new Error("not implemented"); + } + public boolean contains(Point2D p) + { + return contains(p.getX(), p.getY()); + } + public boolean contains(double x, double y, double w, double h) + { + // XXX Implement. + throw new Error("not implemented"); + } + public boolean contains(Rectangle2D r) + { + return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); + } + + public boolean intersects(double x, double y, double w, double h) + { + // XXX Implement. + throw new Error("not implemented"); + } + public boolean intersects(Rectangle2D r) + { + return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); + } + public PathIterator getPathIterator(final AffineTransform at) + { + return new PathIterator() + { + int current = 0; + + public int getWindingRule() + { + return rule; + } + + public boolean isDone() + { + return current >= index; + } + + public void next() + { + current++; + } + + public int currentSegment(float[] coords) + { + if (current >= index) + return SEG_CLOSE; + int result = types[current >> 1]; + int i = 0; + if (result == 3) + { + coords[i++] = points[current++]; + coords[i++] = points[current++]; + } + if (result == 2) + { + coords[i++] = points[current++]; + coords[i++] = points[current++]; + } + if (result < 2) + { + coords[i++] = points[current++]; + coords[i++] = points[current++]; + if (at != null) + at.transform(coords, 0, coords, 0, result == 0 ? 1 : result); + } + return result; + } + + public int currentSegment(double[] coords) + { + if (current >= index) + return SEG_CLOSE; + int result = types[current >> 1]; + int i = 0; + if (result == 3) + { + coords[i++] = points[current++]; + coords[i++] = points[current++]; + } + if (result == 2) + { + coords[i++] = points[current++]; + coords[i++] = points[current++]; + } + if (result < 2) + { + coords[i++] = points[current++]; + coords[i++] = points[current++]; + if (at != null) + at.transform(coords, 0, coords, 0, result == 0 ? 1 : result); + } + return result; + } + }; + } + public PathIterator getPathIterator(AffineTransform at, double flatness) + { + return new FlatteningPathIterator(getPathIterator(at), flatness); + } + + /** + * Create a new shape of the same run-time type with the same contents as + * this one. + * + * @return the clone + * + * @exception OutOfMemoryError If there is not enough memory available. + * + * @since 1.2 + */ + public Object clone() + { + // This class is final; no need to use super.clone(). + return new GeneralPath(this); + } + + private void ensureSize(int size) + { + if (subpath < 0) + throw new IllegalPathStateException("need initial moveto"); + if (size <= points.length) + return; + byte[] b = new byte[points.length]; + System.arraycopy(types, 0, b, 0, index >> 1); + types = b; + float[] f = new float[points.length << 1]; + System.arraycopy(points, 0, f, 0, index); + points = f; + } + } // class GeneralPath diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/IllegalPathStateException.java gcc-3.3/libjava/java/awt/geom/IllegalPathStateException.java *** gcc-3.2.3/libjava/java/awt/geom/IllegalPathStateException.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/IllegalPathStateException.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* IllegalPathStateException.java -- an operation was in an illegal path state ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,55 **** package java.awt.geom; /** * @author Tom Tromey ! * @date July 17, 2000 */ - public class IllegalPathStateException extends RuntimeException { ! public IllegalPathStateException () { - super (); } ! public IllegalPathStateException (String msg) { ! super (msg); } } --- 38,71 ---- package java.awt.geom; /** + * Thrown when an operation on a path is in an illegal state, such as appending + * a segment to a GeneralPath without an initial moveto. + * * @author Tom Tromey ! * @see GeneralPath ! * @status updated to 1.4 */ public class IllegalPathStateException extends RuntimeException { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -5158084205220481094L; ! ! /** ! * Create an exception with no message. ! */ ! public IllegalPathStateException() { } ! /** ! * Create an exception with a message. ! * ! * @param msg the message ! */ ! public IllegalPathStateException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/Line2D.java gcc-3.3/libjava/java/awt/geom/Line2D.java *** gcc-3.2.3/libjava/java/awt/geom/Line2D.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/Line2D.java 2003-01-14 22:12:53.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Line2D.java -- represents a line in 2-D space, plus operations on a line ! Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** package java.awt.geom; *** 38,362 **** import java.awt.Rectangle; import java.awt.Shape; /** * @author Tom Tromey ! * @date April 21, 2001 */ - public abstract class Line2D implements Shape, Cloneable { ! protected Line2D () { } ! public Object clone () ! { ! try ! { ! return super.clone (); ! } ! catch (CloneNotSupportedException _) ! { ! // Can't happen. ! return null; ! } ! } ! public boolean contains (double x, double y) ! { ! double x1 = getX1 (); ! double t1 = (x - x1) / (getX2 () - x1); ! if (t1 < 0 || t1 > 1) ! return false; ! double y1 = getY1 (); ! double t2 = (y - y1) / (getY2 () - y1); ! // FIXME: use of == here is bogus ! return t2 >= 0 && t2 <= 1 && t1 == t2; ! } ! public boolean contains (double x, double y, double w, double h) ! { ! return false; ! } ! public boolean contains (Point2D p) { ! return contains (p.getX (), p.getY ()); } ! public boolean contains (Rectangle2D r) { ! return false; } ! public Rectangle getBounds () { ! double x1 = getX1 (); ! double y1 = getY1 (); ! double x2 = getX2 (); ! double y2 = getY2 (); ! ! double x = Math.min (x1, x2); ! double y = Math.min (y1, y2); ! double w = Math.abs (x1 - x2); ! double h = Math.abs (y1 - y2); ! ! return new Rectangle ((int) x, (int) y, (int) w, (int) h); } ! public abstract Point2D getP1 (); ! public abstract Point2D getP2 (); ! ! public PathIterator getPathIterator (AffineTransform at) { ! return getPathIterator (at, 0); } ! public PathIterator getPathIterator (AffineTransform at, double flatness) { ! return at.new Iterator (new Iterator ()); } ! public abstract double getX1 (); ! public abstract double getY1 (); ! public abstract double getX2 (); ! public abstract double getY2 (); ! ! public boolean intersects (double x, double y, double w, double h) { ! double x1 = getX1 (); ! double y1 = getY1 (); ! double x2 = getX2 (); ! double y2 = getY2 (); ! ! if (x1 >= x && x1 <= x + w && y1 >= y && y1 <= y +h) ! return true; ! if (x2 >= x && x2 <= x + w && y2 >= y && y2 <= y +h) ! return true; ! ! double x3 = x + w; ! double y3 = y + h; ! ! return (linesIntersect (x1, y1, x2, y2, x, y, x, y3) ! || linesIntersect (x1, y1, x2, y2, x, y3, x3, y3) ! || linesIntersect (x1, y1, x2, y2, x3, y3, x3, y) ! || linesIntersect (x1, y1, x2, y2, x3, y, x, y)); } ! public boolean intersects (Rectangle2D r) { ! return intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); } ! public boolean intersectsLine (double x1, double y1, double x2, double y2) { ! return linesIntersect (getX1 (), getY1 (), getX2 (), getY2(), ! x1, y1, x2, y2); } ! public boolean intersectsLine (Line2D l) { ! return linesIntersect (getX1 (), getY1 (), getX2 (), getY2(), ! l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 ()); } ! public static boolean linesIntersect (double x1, double y1, ! double x2, double y2, ! double x3,double y3, ! double x4, double y4) { ! double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3)) ! / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3))); ! if (beta < 0.0 || beta > 1.0) ! return false; ! double alpha = (x1 + beta * (x2 - x1) - x3) / (x4 - x3); ! return alpha >= 0.0 && alpha <= 1.0; } ! public double ptLineDist (double px, double py) { ! return ptLineDist (getX1 (), getY1 (), getX2 (), getY2 (), ! px, py); } ! public static double ptLineDist (double x1, double y1, ! double x2, double y2, ! double px, double py) { ! return Math.sqrt (ptLineDistSq (x1, y1, x2, y2, px, py)); } ! public double ptLineDist (Point2D p) { ! return ptLineDist (getX1 (), getY1 (), getX2 (), getY2 (), ! p.getX (), p.getY ()); } ! public double ptLineDistSq (double px, double py) { ! return ptLineDistSq (getX1 (), getY1 (), getX2 (), getY2 (), ! px, py); } ! public static double ptLineDistSq (double x1, double y1, ! double x2, double y2, ! double px, double py) { double pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); double x, y; if (pd2 == 0) { ! // Points are coincident. ! x = x1; ! y = y2; } else { ! double u = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / pd2; ! x = x1 + u * (x2 - x1); ! y = y1 + u * (y2 - y1); } return (x - px) * (x - px) + (y - py) * (y - py); } ! public double ptLineDistSq (Point2D p) { ! return ptLineDistSq (getX1 (), getY1 (), getX2 (), getY2 (), ! p.getX (), p.getY ()); } ! public double ptSegDist (double px, double py) { ! return ptSegDist (getX1 (), getY1 (), getX2 (), getY2 (), ! px, py); } ! public static double ptSegDist (double x1, double y1, ! double x2, double y2, ! double px, double py) { ! return Math.sqrt (ptSegDistSq (x1, y1, x2, y2, px, py)); } ! public double ptSegDist (Point2D p) { ! return ptSegDist (getX1 (), getY1 (), getX2 (), getY2 (), ! p.getX (), p.getY ()); } ! public double ptSegDistSq (double px, double py) { ! return ptSegDistSq (getX1 (), getY1 (), getX2 (), getY2 (), ! px, py); } ! public static double ptSegDistSq (double x1, double y1, ! double x2, double y2, ! double px, double py) { ! double pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); ! double x, y; ! if (pd2 == 0) ! { ! // Points are coincident. ! x = x1; ! y = y2; ! } ! else ! { ! double u = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / pd2; ! if (u < 0) ! { ! // "Off the end" ! x = x1; ! y = y1; ! } ! else if (u > 1.0) ! { ! x = x2; ! y = y2; ! } ! else ! { ! x = x1 + u * (x2 - x1); ! y = y1 + u * (y2 - y1); ! } ! } ! return (x - px) * (x - px) + (y - py) * (y - py); } ! public double ptSegDistSq (Point2D p) { ! return ptSegDistSq (getX1 (), getY1 (), getX2 (), getY2 (), ! p.getX (), p.getY ()); } ! public int relativeCCW (double px, double py) { ! return relativeCCW (getX1 (), getY1 (), ! getX2 (), getY2 (), ! px, py); } ! public static int relativeCCW (double x1, double y1, ! double x2, double y2, ! double px, double py) { ! // This is a somewhat silly way to compute this. ! // Please write a better one. ! double a1 = Math.atan2 (y2 - y1, x2 - x1); ! double a2 = Math.atan2 (py - y1, px - x1); ! double a = (a1 - a2) % (2 * Math.PI); ! if (a == 0 || a == Math.PI) { ! double u = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)); ! if (u < 0.0) ! return 1; ! else if (u > 1.0) ! return -1; ! else ! return 0; } ! return (a > 0 && a < Math.PI) ? 1 : -1; } ! public int relativeCCW (Point2D p) { ! return relativeCCW (getX1 (), getY1 (), ! getX2 (), getY2 (), ! p.getX (), p.getY ()); } ! public abstract void setLine (double x1, double y1, double x2, double y2); ! ! public void setLine (Line2D l) { ! setLine (l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 ()); } ! public void setLine (Point2D p1, Point2D p2) { ! setLine (p1.getX (), p1.getY (), p2.getX (), p2.getY ()); ! } ! public static class Float extends Line2D ! { ! float x1, y1, x2, y2; ! public Float () { - this (0.0F, 0.0F, 0.0F, 0.0F); } ! public Float (float x1, float y1, float x2, float y2) { this.x1 = x1; this.y1 = y1; --- 39,811 ---- import java.awt.Rectangle; import java.awt.Shape; + import java.util.NoSuchElementException; /** + * Represents a directed line bewteen two points in (x,y) Cartesian space. + * Remember, on-screen graphics have increasing x from left-to-right, and + * increasing y from top-to-bottom. The storage is left to subclasses. + * * @author Tom Tromey ! * @author Eric Blake ! * @since 1.2 ! * @status updated to 1.4 */ public abstract class Line2D implements Shape, Cloneable { ! /** ! * The default constructor. ! */ ! protected Line2D() { } ! /** ! * Return the x coordinate of the first point. ! * ! * @return the starting x coordinate ! */ ! public abstract double getX1(); ! /** ! * Return the y coordinate of the first point. ! * ! * @return the starting y coordinate ! */ ! public abstract double getY1(); ! /** ! * Return the first point. ! * ! * @return the starting point ! */ ! public abstract Point2D getP1(); ! /** ! * Return the x coordinate of the second point. ! * ! * @return the ending x coordinate ! */ ! public abstract double getX2(); ! ! /** ! * Return the y coordinate of the second point. ! * ! * @return the ending y coordinate ! */ ! public abstract double getY2(); ! ! /** ! * Return the second point. ! * ! * @return the ending point ! */ ! public abstract Point2D getP2(); ! ! /** ! * Set the coordinates of the line to the given coordinates. Loss of ! * precision may occur due to rounding issues. ! * ! * @param x1 the first x coordinate ! * @param y1 the first y coordinate ! * @param x2 the second x coordinate ! * @param y2 the second y coordinate ! */ ! public abstract void setLine(double x1, double y1, double x2, double y2); ! ! /** ! * Set the coordinates to the given points. ! * ! * @param p1 the first point ! * @param p2 the second point ! * @throws NullPointerException if either point is null ! */ ! public void setLine(Point2D p1, Point2D p2) { ! setLine(p1.getX(), p1.getY(), p2.getX(), p2.getY()); } ! /** ! * Set the coordinates to those of the given line. ! * ! * @param l the line to copy ! * @throws NullPointerException if l is null ! */ ! public void setLine(Line2D l) { ! setLine(l.getX1(), l.getY1(), l.getX2(), l.getY2()); } ! /** ! * Computes the relative rotation direction needed to pivot the line about ! * the first point in order to have the second point colinear with point p. ! * Because of floating point rounding, don't expect this to be a perfect ! * measure of colinearity. The answer is 1 if the line has a shorter rotation ! * in the direction of the positive X axis to the negative Y axis ! * (counter-clockwise in the default Java coordinate system), or -1 if the ! * shortest rotation is in the opposite direction (clockwise). If p ! * is already colinear, the return value is -1 if it lies beyond the first ! * point, 0 if it lies in the segment, or 1 if it lies beyond the second ! * point. If the first and second point are coincident, this returns 0. ! * ! * @param x1 the first x coordinate ! * @param y1 the first y coordinate ! * @param x2 the second x coordinate ! * @param y2 the second y coordinate ! * @param px the reference x coordinate ! * @param py the reference y coordinate ! * @return the relative rotation direction ! */ ! public static int relativeCCW(double x1, double y1, double x2, double y2, ! double px, double py) { ! if ((x1 == x2 && y1 == y2) ! || (x1 == px && y1 == py)) ! return 0; // Coincident points. ! // Translate to the origin. ! x2 -= x1; ! y2 -= y1; ! px -= x1; ! py -= y1; ! double slope2 = y2 / x2; ! double slopep = py / px; ! if (slope2 == slopep || (x2 == 0 && px == 0)) ! return y2 > 0 // Colinear. ! ? (py < 0 ? -1 : py > y2 ? 1 : 0) ! : (py > 0 ? -1 : py < y2 ? 1 : 0); ! if (x2 >= 0 && slope2 >= 0) ! return px >= 0 // Quadrant 1. ! ? (slope2 > slopep ? 1 : -1) ! : (slope2 < slopep ? 1 : -1); ! if (y2 > 0) ! return px < 0 // Quadrant 2. ! ? (slope2 > slopep ? 1 : -1) ! : (slope2 < slopep ? 1 : -1); ! if (slope2 >= 0.0) ! return px >= 0 // Quadrant 3. ! ? (slope2 < slopep ? 1 : -1) ! : (slope2 > slopep ? 1 : -1); ! return px < 0 // Quadrant 4. ! ? (slope2 < slopep ? 1 : -1) ! : (slope2 > slopep ? 1 : -1); } ! /** ! * Computes the relative rotation direction needed to pivot this line about ! * the first point in order to have the second point colinear with point p. ! * Because of floating point rounding, don't expect this to be a perfect ! * measure of colinearity. The answer is 1 if the line has a shorter rotation ! * in the direction of the positive X axis to the negative Y axis ! * (counter-clockwise in the default Java coordinate system), or -1 if the ! * shortest rotation is in the opposite direction (clockwise). If p ! * is already colinear, the return value is -1 if it lies beyond the first ! * point, 0 if it lies in the segment, or 1 if it lies beyond the second ! * point. If the first and second point are coincident, this returns 0. ! * ! * @param px the reference x coordinate ! * @param py the reference y coordinate ! * @return the relative rotation direction ! * @see #relativeCCW(double, double, double, double, double, double) ! */ ! public int relativeCCW(double px, double py) { ! return relativeCCW(getX1(), getY1(), getX2(), getY2(), px, py); } ! /** ! * Computes the relative rotation direction needed to pivot this line about ! * the first point in order to have the second point colinear with point p. ! * Because of floating point rounding, don't expect this to be a perfect ! * measure of colinearity. The answer is 1 if the line has a shorter rotation ! * in the direction of the positive X axis to the negative Y axis ! * (counter-clockwise in the default Java coordinate system), or -1 if the ! * shortest rotation is in the opposite direction (clockwise). If p ! * is already colinear, the return value is -1 if it lies beyond the first ! * point, 0 if it lies in the segment, or 1 if it lies beyond the second ! * point. If the first and second point are coincident, this returns 0. ! * ! * @param p the reference point ! * @return the relative rotation direction ! * @throws NullPointerException if p is null ! * @see #relativeCCW(double, double, double, double, double, double) ! */ ! public int relativeCCW(Point2D p) { ! return relativeCCW(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY()); } ! /** ! * Test if the line segment (x1,y1)->(x2,y2) intersects the line segment ! * (x3,y3)->(x4,y4). ! * ! * @param x1 the first x coordinate of the first segment ! * @param y1 the first y coordinate of the first segment ! * @param x2 the second x coordinate of the first segment ! * @param y2 the second y coordinate of the first segment ! * @param x3 the first x coordinate of the second segment ! * @param y3 the first y coordinate of the second segment ! * @param x4 the second x coordinate of the second segment ! * @param y4 the second y coordinate of the second segment ! * @return true if the segments intersect ! */ ! public static boolean linesIntersect(double x1, double y1, ! double x2, double y2, ! double x3, double y3, ! double x4, double y4) { ! double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3)) ! / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3))); ! if (beta < 0.0 || beta > 1.0) ! return false; ! double alpha = (x1 + beta * (x2 - x1) - x3) / (x4 - x3); ! return alpha >= 0.0 && alpha <= 1.0; } ! /** ! * Test if this line intersects the line given by (x1,y1)->(x2,y2). ! * ! * @param x1 the first x coordinate of the other segment ! * @param y1 the first y coordinate of the other segment ! * @param x2 the second x coordinate of the other segment ! * @param y2 the second y coordinate of the other segment ! * @return true if the segments intersect ! * @see #linesIntersect(double, double, double, double, ! * double, double, double, double) ! */ ! public boolean intersectsLine(double x1, double y1, double x2, double y2) { ! return linesIntersect(getX1(), getY1(), getX2(), getY2(), ! x1, y1, x2, y2); } ! /** ! * Test if this line intersects the given line. ! * ! * @param l the other segment ! * @return true if the segments intersect ! * @throws NullPointerException if l is null ! * @see #linesIntersect(double, double, double, double, ! * double, double, double, double) ! */ ! public boolean intersectsLine(Line2D l) { ! return linesIntersect(getX1(), getY1(), getX2(), getY2(), ! l.getX1(), l.getY1(), l.getX2(), l.getY2()); } ! /** ! * Measures the square of the shortest distance from the reference point ! * to a point on the line segment. If the point is on the segment, the ! * result will be 0. ! * ! * @param x1 the first x coordinate of the segment ! * @param y1 the first y coordinate of the segment ! * @param x2 the second x coordinate of the segment ! * @param y2 the second y coordinate of the segment ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the square of the distance from the point to the segment ! * @see #ptSegDist(double, double, double, double, double, double) ! * @see #ptLineDistSq(double, double, double, double, double, double) ! */ ! public static double ptSegDistSq(double x1, double y1, double x2, double y2, ! double px, double py) { ! double pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); ! ! double x, y; ! if (pd2 == 0) ! { ! // Points are coincident. ! x = x1; ! y = y2; ! } ! else ! { ! double u = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / pd2; ! ! if (u < 0) ! { ! // "Off the end" ! x = x1; ! y = y1; ! } ! else if (u > 1.0) ! { ! x = x2; ! y = y2; ! } ! else ! { ! x = x1 + u * (x2 - x1); ! y = y1 + u * (y2 - y1); ! } ! } ! ! return (x - px) * (x - px) + (y - py) * (y - py); } ! /** ! * Measures the shortest distance from the reference point to a point on ! * the line segment. If the point is on the segment, the result will be 0. ! * ! * @param x1 the first x coordinate of the segment ! * @param y1 the first y coordinate of the segment ! * @param x2 the second x coordinate of the segment ! * @param y2 the second y coordinate of the segment ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the distance from the point to the segment ! * @see #ptSegDistSq(double, double, double, double, double, double) ! * @see #ptLineDist(double, double, double, double, double, double) ! */ ! public static double ptSegDist(double x1, double y1, double x2, double y2, ! double px, double py) { ! return Math.sqrt(ptSegDistSq(x1, y1, x2, y2, px, py)); } ! /** ! * Measures the square of the shortest distance from the reference point ! * to a point on this line segment. If the point is on the segment, the ! * result will be 0. ! * ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the square of the distance from the point to the segment ! * @see #ptSegDistSq(double, double, double, double, double, double) ! */ ! public double ptSegDistSq(double px, double py) { ! return ptSegDistSq(getX1(), getY1(), getX2(), getY2(), px, py); } ! /** ! * Measures the square of the shortest distance from the reference point ! * to a point on this line segment. If the point is on the segment, the ! * result will be 0. ! * ! * @param p the point ! * @return the square of the distance from the point to the segment ! * @throws NullPointerException if p is null ! * @see #ptSegDistSq(double, double, double, double, double, double) ! */ ! public double ptSegDistSq(Point2D p) { ! return ptSegDistSq(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY()); } ! /** ! * Measures the shortest distance from the reference point to a point on ! * this line segment. If the point is on the segment, the result will be 0. ! * ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the distance from the point to the segment ! * @see #ptSegDist(double, double, double, double, double, double) ! */ ! public double ptSegDist(double px, double py) { ! return ptSegDist(getX1(), getY1(), getX2(), getY2(), px, py); } ! /** ! * Measures the shortest distance from the reference point to a point on ! * this line segment. If the point is on the segment, the result will be 0. ! * ! * @param p the point ! * @return the distance from the point to the segment ! * @throws NullPointerException if p is null ! * @see #ptSegDist(double, double, double, double, double, double) ! */ ! public double ptSegDist(Point2D p) { ! return ptSegDist(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY()); } ! /** ! * Measures the square of the shortest distance from the reference point ! * to a point on the infinite line extended from the segment. If the point ! * is on the segment, the result will be 0. If the segment is length 0, ! * the distance is to the common endpoint. ! * ! * @param x1 the first x coordinate of the segment ! * @param y1 the first y coordinate of the segment ! * @param x2 the second x coordinate of the segment ! * @param y2 the second y coordinate of the segment ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the square of the distance from the point to the extended line ! * @see #ptLineDist(double, double, double, double, double, double) ! * @see #ptSegDistSq(double, double, double, double, double, double) ! */ ! public static double ptLineDistSq(double x1, double y1, double x2, double y2, ! double px, double py) { double pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); double x, y; if (pd2 == 0) { ! // Points are coincident. ! x = x1; ! y = y2; } else { ! double u = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / pd2; ! x = x1 + u * (x2 - x1); ! y = y1 + u * (y2 - y1); } return (x - px) * (x - px) + (y - py) * (y - py); } ! /** ! * Measures the shortest distance from the reference point to a point on ! * the infinite line extended from the segment. If the point is on the ! * segment, the result will be 0. If the segment is length 0, the distance ! * is to the common endpoint. ! * ! * @param x1 the first x coordinate of the segment ! * @param y1 the first y coordinate of the segment ! * @param x2 the second x coordinate of the segment ! * @param y2 the second y coordinate of the segment ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the distance from the point to the extended line ! * @see #ptLineDistSq(double, double, double, double, double, double) ! * @see #ptSegDist(double, double, double, double, double, double) ! */ ! public static double ptLineDist(double x1, double y1, ! double x2, double y2, ! double px, double py) { ! return Math.sqrt(ptLineDistSq(x1, y1, x2, y2, px, py)); } ! /** ! * Measures the square of the shortest distance from the reference point ! * to a point on the infinite line extended from this segment. If the point ! * is on the segment, the result will be 0. If the segment is length 0, ! * the distance is to the common endpoint. ! * ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the square of the distance from the point to the extended line ! * @see #ptLineDistSq(double, double, double, double, double, double) ! */ ! public double ptLineDistSq(double px, double py) { ! return ptLineDistSq(getX1(), getY1(), getX2(), getY2(), px, py); } ! /** ! * Measures the square of the shortest distance from the reference point ! * to a point on the infinite line extended from this segment. If the point ! * is on the segment, the result will be 0. If the segment is length 0, ! * the distance is to the common endpoint. ! * ! * @param p the point ! * @return the square of the distance from the point to the extended line ! * @throws NullPointerException if p is null ! * @see #ptLineDistSq(double, double, double, double, double, double) ! */ ! public double ptLineDistSq(Point2D p) { ! return ptLineDistSq(getX1(), getY1(), getX2(), getY2(), ! p.getX(), p.getY()); } ! /** ! * Measures the shortest distance from the reference point to a point on ! * the infinite line extended from this segment. If the point is on the ! * segment, the result will be 0. If the segment is length 0, the distance ! * is to the common endpoint. ! * ! * @param px the x coordinate of the point ! * @param py the y coordinate of the point ! * @return the distance from the point to the extended line ! * @see #ptLineDist(double, double, double, double, double, double) ! */ ! public double ptLineDist(double px, double py) { ! return ptLineDist(getX1(), getY1(), getX2(), getY2(), px, py); } ! /** ! * Measures the shortest distance from the reference point to a point on ! * the infinite line extended from this segment. If the point is on the ! * segment, the result will be 0. If the segment is length 0, the distance ! * is to the common endpoint. ! * ! * @param p the point ! * @return the distance from the point to the extended line ! * @throws NullPointerException if p is null ! * @see #ptLineDist(double, double, double, double, double, double) ! */ ! public double ptLineDist(Point2D p) { ! return ptLineDist(getX1(), getY1(), getX2(), getY2(), p.getX(), p.getY()); } ! /** ! * Test if a point is contained inside the line. Since a line has no area, ! * this returns false. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @return false; the line does not contain points ! */ ! public boolean contains(double x, double y) { ! return false; ! } ! /** ! * Test if a point is contained inside the line. Since a line has no area, ! * this returns false. ! * ! * @param p the point ! * @return false; the line does not contain points ! */ ! public boolean contains(Point2D p) ! { ! return false; ! } ! /** ! * Tests if this line intersects the interior of the specified rectangle. ! * ! * @param x the x coordinate of the rectangle ! * @param y the y coordinate of the rectangle ! * @param w the width of the rectangle ! * @param h the height of the rectangle ! * @return true if the line intersects the rectangle ! */ ! public boolean intersects(double x, double y, double w, double h) ! { ! if (w <= 0 || h <= 0) ! return false; ! double x1 = getX1(); ! double y1 = getY1(); ! double x2 = getX2(); ! double y2 = getY2(); ! if (x1 >= x && x1 <= x + w && y1 >= y && y1 <= y + h) ! return true; ! if (x2 >= x && x2 <= x + w && y2 >= y && y2 <= y + h) ! return true; ! ! double x3 = x + w; ! double y3 = y + h; ! ! return (linesIntersect(x1, y1, x2, y2, x, y, x, y3) ! || linesIntersect(x1, y1, x2, y2, x, y3, x3, y3) ! || linesIntersect(x1, y1, x2, y2, x3, y3, x3, y) ! || linesIntersect(x1, y1, x2, y2, x3, y, x, y)); } ! /** ! * Tests if this line intersects the interior of the specified rectangle. ! * ! * @param r the rectangle ! * @return true if the line intersects the rectangle ! * @throws NullPointerException if r is null ! */ ! public boolean intersects(Rectangle2D r) { ! return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } ! /** ! * Tests if the line contains a rectangle. Since lines have no area, this ! * always returns false. ! * ! * @param x the x coordinate of the rectangle ! * @param y the y coordinate of the rectangle ! * @param w the width of the rectangle ! * @param h the height of the rectangle ! * @return false; the line does not contain points ! */ ! public boolean contains(double x, double y, double w, double h) { ! return false; } ! /** ! * Tests if the line contains a rectangle. Since lines have no area, this ! * always returns false. ! * ! * @param r the rectangle ! * @return false; the line does not contain points ! */ ! public boolean contains(Rectangle2D r) { ! return false; ! } ! /** ! * Gets a bounding box (not necessarily minimal) for this line. ! * ! * @return the integer bounding box ! * @see #getBounds2D() ! */ ! public Rectangle getBounds() ! { ! return getBounds2D().getBounds(); ! } ! ! /** ! * Return a path iterator, possibly applying a transform on the result. This ! * iterator is not threadsafe. ! * ! * @param at the transform, or null ! * @return a new path iterator ! */ ! public PathIterator getPathIterator(final AffineTransform at) ! { ! return new PathIterator() ! { ! /** Current coordinate. */ ! private int current; ! ! public int getWindingRule() { ! return WIND_NON_ZERO; } ! public boolean isDone() ! { ! return current < 2; ! } ! ! public void next() ! { ! current++; ! } ! ! public int currentSegment(float[] coords) ! { ! int result; ! switch (current) ! { ! case 0: ! coords[0] = (float) getX1(); ! coords[1] = (float) getY1(); ! result = SEG_MOVETO; ! break; ! case 1: ! coords[0] = (float) getX2(); ! coords[1] = (float) getY2(); ! result = SEG_LINETO; ! break; ! default: ! throw new NoSuchElementException("line iterator out of bounds"); ! } ! if (at != null) ! at.transform(coords, 0, coords, 0, 1); ! return result; ! } ! ! public int currentSegment(double[] coords) ! { ! int result; ! switch (current) ! { ! case 0: ! coords[0] = getX1(); ! coords[1] = getY1(); ! result = SEG_MOVETO; ! break; ! case 1: ! coords[0] = getX2(); ! coords[1] = getY2(); ! result = SEG_LINETO; ! break; ! default: ! throw new NoSuchElementException("line iterator out of bounds"); ! } ! if (at != null) ! at.transform(coords, 0, coords, 0, 1); ! return result; ! } ! }; } ! /** ! * Return a flat path iterator, possibly applying a transform on the result. ! * This iterator is not threadsafe. ! * ! * @param at the transform, or null ! * @param flatness ignored, since lines are already flat ! * @return a new path iterator ! * @see #getPathIterator(AffineTransform) ! */ ! public PathIterator getPathIterator(AffineTransform at, double flatness) { ! return getPathIterator(at); } ! /** ! * Create a new line of the same run-time type with the same contents as ! * this one. ! * ! * @return the clone ! * ! * @exception OutOfMemoryError If there is not enough memory available. ! * ! * @since 1.2 ! */ ! public Object clone() { ! try ! { ! return super.clone(); ! } ! catch (CloneNotSupportedException e) ! { ! throw (Error) new InternalError().initCause(e); // Impossible ! } } ! /** ! * This class defines a point in double precision. ! * ! * @author Eric Blake ! * @since 1.2 ! * @status updated to 1.4 ! */ ! public static class Double extends Line2D { ! /** The x coordinate of the first point. */ ! public double x1; ! /** The y coordinate of the first point. */ ! public double y1; ! /** The x coordinate of the second point. */ ! public double x2; ! ! /** The y coordinate of the second point. */ ! public double y2; ! ! /** ! * Construct the line segment (0,0)->(0,0). ! */ ! public Double() { } ! /** ! * Construct the line segment with the specified points. ! * ! * @param x1 the x coordinate of the first point ! * @param y1 the y coordinate of the first point ! * @param x2 the x coordinate of the second point ! * @param y2 the y coordinate of the second point ! */ ! public Double(double x1, double y1, double x2, double y2) { this.x1 = x1; this.y1 = y1; *************** public abstract class Line2D implements *** 364,443 **** this.y2 = y2; } ! public Float (Point2D p1, Point2D p2) ! { ! this.x1 = (float) p1.getX (); ! this.y1 = (float) p1.getY (); ! this.x2 = (float) p2.getX (); ! this.y2 = (float) p2.getY (); ! } ! ! public Rectangle2D getBounds2D () ! { ! float x = Math.min (x1, x2); ! float w = Math.abs (x1 - x2); ! float y = Math.min (y1, y2); ! float h = Math.abs (y1 - y2); ! return new Rectangle2D.Float (x, y, w, h); ! } ! ! public Point2D getP1 () { ! return new Point2D.Float (x1, y1); } ! public Point2D getP2 () { ! return new Point2D.Float (x2, y2); } ! public double getX1 () { ! return x1; } ! public double getY1 () { ! return y1; } ! public double getX2 () { return x2; } ! public double getY2 () { return y2; } ! public void setLine (double x1, double y1, double x2, double y2) { ! this.x1 = (float) x1; ! this.y1 = (float) y1; ! this.x2 = (float) x2; ! this.y2 = (float) y2; } ! public void setLine (float x1, float y1, float x2, float y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } - } ! public static class Double extends Line2D { ! double x1, y1, x2, y2; ! public Double () { - this (0.0, 0.0, 0.0, 0.0); } ! public Double (double x1, double y1, double x2, double y2) { this.x1 = x1; this.y1 = y1; --- 813,961 ---- this.y2 = y2; } ! /** ! * Construct the line segment with the specified points. ! * ! * @param p1 the first point ! * @param p2 the second point ! * @throws NullPointerException if either point is null ! */ ! public Double(Point2D p1, Point2D p2) { ! x1 = p1.getX(); ! y1 = p1.getY(); ! x2 = p2.getX(); ! y2 = p2.getY(); } ! /** ! * Return the x coordinate of the first point. ! * ! * @return the value of x1 ! */ ! public double getX1() { ! return x1; } ! /** ! * Return the y coordinate of the first point. ! * ! * @return the value of y1 ! */ ! public double getY1() { ! return y1; } ! /** ! * Return the first point. ! * ! * @return the point (x1,y1) ! */ ! public Point2D getP1() { ! return new Point2D.Double(x1, y1); } ! /** ! * Return the x coordinate of the second point. ! * ! * @return the value of x2 ! */ ! public double getX2() { return x2; } ! /** ! * Return the y coordinate of the second point. ! * ! * @return the value of y2 ! */ ! public double getY2() { return y2; } ! /** ! * Return the second point. ! * ! * @return the point (x2,y2) ! */ ! public Point2D getP2() { ! return new Point2D.Double(x2, y2); } ! /** ! * Set this line to the given points. ! * ! * @param x1 the new x coordinate of the first point ! * @param y1 the new y coordinate of the first point ! * @param x2 the new x coordinate of the second point ! * @param y2 the new y coordinate of the second point ! */ ! public void setLine(double x1, double y1, double x2, double y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } ! /** ! * Return the exact bounds of this line segment. ! * ! * @return the bounding box ! */ ! public Rectangle2D getBounds2D() ! { ! double x = Math.min(x1, x2); ! double y = Math.min(y1, y2); ! double w = Math.abs(x1 - x2); ! double h = Math.abs(y1 - y2); ! return new Rectangle2D.Double(x, y, w, h); ! } ! } // class Double ! ! /** ! * This class defines a point in float precision. ! * ! * @author Eric Blake ! * @since 1.2 ! * @status updated to 1.4 ! */ ! public static class Float extends Line2D { ! /** The x coordinate of the first point. */ ! public float x1; ! /** The y coordinate of the first point. */ ! public float y1; ! ! /** The x coordinate of the second point. */ ! public float x2; ! ! /** The y coordinate of the second point. */ ! public float y2; ! ! /** ! * Construct the line segment (0,0)->(0,0). ! */ ! public Float() { } ! /** ! * Construct the line segment with the specified points. ! * ! * @param x1 the x coordinate of the first point ! * @param y1 the y coordinate of the first point ! * @param x2 the x coordinate of the second point ! * @param y2 the y coordinate of the second point ! */ ! public Float(float x1, float y1, float x2, float y2) { this.x1 = x1; this.y1 = y1; *************** public abstract class Line2D implements *** 445,573 **** this.y2 = y2; } ! public Double (Point2D p1, Point2D p2) { ! this.x1 = (double) p1.getX (); ! this.y1 = p1.getY (); ! this.x2 = p2.getX (); ! this.y2 = p2.getY (); } ! public Rectangle2D getBounds2D () { ! double x = Math.min (x1, x2); ! double w = Math.abs (x1 - x2); ! double y = Math.min (y1, y2); ! double h = Math.abs (y1 - y2); ! return new Rectangle2D.Double (x, y, w, h); } ! public Point2D getP1 () { ! return new Point2D.Double (x1, y1); } ! public Point2D getP2 () { ! return new Point2D.Double (x2, y2); } ! public double getX1 () { ! return x1; } ! public double getY1 () { ! return y1; } ! public double getX2 () { ! return x2; } ! public double getY2 () { ! return y2; } ! public void setLine (double x1, double y1, double x2, double y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } - } - - // This implements the PathIterator for all line objects that don't - // override getPathIterator. - private class Iterator implements PathIterator - { - // Current coordinate. - private int coord; - - private static final int START = 0; - private static final int END_PLUS_ONE = 2; - - public Iterator () - { - coord = START; - } - - public int currentSegment (double[] coords) - { - int r = SEG_MOVETO; - if (coord == 0) - { - coords[0] = getX1 (); - coords[1] = getY1 (); - } - else if (coord == 1) - { - coords[0] = getX2 (); - coords[1] = getY2 (); - } - else - r = SEG_CLOSE; - - return r; - } - - public int currentSegment (float[] coords) - { - int r = SEG_MOVETO; - if (coord == 0) - { - coords[0] = (float) getX1 (); - coords[1] = (float) getY1 (); - } - else if (coord == 1) - { - coords[0] = (float) getX2 (); - coords[1] = (float) getY2 (); - } - else - r = SEG_CLOSE; - - return r; - } - - public int getWindingRule () - { - return WIND_NON_ZERO; - } - - public boolean isDone () - { - return coord == END_PLUS_ONE; - } ! public void next () { ! if (coord < END_PLUS_ONE) ! ++coord; } ! } ! } --- 963,1087 ---- this.y2 = y2; } ! /** ! * Construct the line segment with the specified points. ! * ! * @param p1 the first point ! * @param p2 the second point ! * @throws NullPointerException if either point is null ! */ ! public Float(Point2D p1, Point2D p2) { ! x1 = (float) p1.getX(); ! y1 = (float) p1.getY(); ! x2 = (float) p2.getX(); ! y2 = (float) p2.getY(); } ! /** ! * Return the x coordinate of the first point. ! * ! * @return the value of x1 ! */ ! public double getX1() { ! return x1; } ! /** ! * Return the y coordinate of the first point. ! * ! * @return the value of y1 ! */ ! public double getY1() { ! return y1; } ! /** ! * Return the first point. ! * ! * @return the point (x1,y1) ! */ ! public Point2D getP1() { ! return new Point2D.Float(x1, y1); } ! /** ! * Return the x coordinate of the second point. ! * ! * @return the value of x2 ! */ ! public double getX2() { ! return x2; } ! /** ! * Return the y coordinate of the second point. ! * ! * @return the value of y2 ! */ ! public double getY2() { ! return y2; } ! /** ! * Return the second point. ! * ! * @return the point (x2,y2) ! */ ! public Point2D getP2() { ! return new Point2D.Float(x2, y2); } ! /** ! * Set this line to the given points. ! * ! * @param x1 the new x coordinate of the first point ! * @param y1 the new y coordinate of the first point ! * @param x2 the new x coordinate of the second point ! * @param y2 the new y coordinate of the second point ! */ ! public void setLine(double x1, double y1, double x2, double y2) { ! this.x1 = (float) x1; ! this.y1 = (float) y1; ! this.x2 = (float) x2; ! this.y2 = (float) y2; } ! /** ! * Set this line to the given points. ! * ! * @param x1 the new x coordinate of the first point ! * @param y1 the new y coordinate of the first point ! * @param x2 the new x coordinate of the second point ! * @param y2 the new y coordinate of the second point ! */ ! public void setLine(float x1, float y1, float x2, float y2) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } ! /** ! * Return the exact bounds of this line segment. ! * ! * @return the bounding box ! */ ! public Rectangle2D getBounds2D() { ! float x = Math.min(x1, x2); ! float y = Math.min(y1, y2); ! float w = Math.abs(x1 - x2); ! float h = Math.abs(y1 - y2); ! return new Rectangle2D.Float(x, y, w, h); } ! } // class Float ! } // class Line2D diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/NoninvertibleTransformException.java gcc-3.3/libjava/java/awt/geom/NoninvertibleTransformException.java *** gcc-3.2.3/libjava/java/awt/geom/NoninvertibleTransformException.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/NoninvertibleTransformException.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* NoninvertibleTransformException.java -- a transform can't be inverted ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,50 **** package java.awt.geom; /** * @author Tom Tromey ! * @date July 15, 2000 */ - public class NoninvertibleTransformException extends Exception { ! public NoninvertibleTransformException (String s) { ! super (s); } } --- 38,65 ---- package java.awt.geom; /** + * Thrown if an operation requires an inverse of an + * AffineTransform, but the transform is in a non-invertible + * state. + * * @author Tom Tromey ! * @see AffineTransform ! * @status updated to 1.4 */ public class NoninvertibleTransformException extends Exception { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 6137225240503990466L; ! ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public NoninvertibleTransformException(String s) { ! super(s); } } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/PathIterator.java gcc-3.3/libjava/java/awt/geom/PathIterator.java *** gcc-3.2.3/libjava/java/awt/geom/PathIterator.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/PathIterator.java 2003-01-02 00:14:09.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* PathIterator.java -- describes a shape by iterating over its vertices ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,59 **** package java.awt.geom; /** * @author Tom Tromey ! * @date April 16, 2000 */ - public interface PathIterator { ! public static final int SEG_CLOSE = 4; ! public static final int SEG_CUBICTO = 3; ! public static final int SEG_LINETO = 1; ! public static final int SEG_MOVETO = 0; ! public static final int SEG_QUADTO = 2; ! public static final int WIND_EVEN_ODD = 0; ! public static final int WIND_NON_ZERO = 1; ! public int currentSegment (double[] coords); ! public int currentSegment (float[] coords); ! public int getWindingRule (); ! public boolean isDone (); ! public void next (); ! } --- 38,189 ---- package java.awt.geom; /** + * This interface provides a directed path over the boundary of a shape. The + * path can contain 1st through 3rd order Bezier curves (lines, and quadratic + * and cubic splines). A shape can have multiple disjoint paths via the + * MOVETO directive, and can close a circular path back to the previos + * MOVETO via the CLOSE directive. + * * @author Tom Tromey ! * @author Eric Blake ! * @see Shape ! * @see Stroke ! * @see FlatteningPathIterator ! * @since 1.2 ! * @status updated to 1.4 */ public interface PathIterator { ! /** ! * The even-odd winding mode: a point is internal to the shape if a ray ! * from the point to infinity (in any direction) crosses an odd number of ! * segments. ! */ ! static final int WIND_EVEN_ODD = 0; ! /** ! * The non-zero winding mode: a point is internal to the shape if a ray ! * from the point to infinity (in any direction) crosses a different number ! * of segments headed clockwise than those headed counterclockwise. ! */ ! static final int WIND_NON_ZERO = 1; ! ! /** ! * Starts a new subpath. There is no segment from the previous vertex. ! */ ! static final int SEG_MOVETO = 0; ! ! /** ! * The current segment is a line. ! */ ! static final int SEG_LINETO = 1; ! ! /** ! * The current segment is a quadratic parametric curve. It is interpolated ! * as t varies from 0 to 1 over the current point (CP), first control point ! * (P1), and final interpolated control point (P2): ! *
        !    *  P(t) = B(2,0)*CP + B(2,1)*P1 + B(2,2)*P2
        !    *    0 <= t <= 1
        !    *  B(n,m) = mth coefficient of nth degree Bernstein polynomial
        !    *         = C(n,m) * t^(m) * (1 - t)^(n-m)
        !    *  C(n,m) = Combinations of n things, taken m at a time
        !    *         = n! / (m! * (n-m)!)
        !    * 
        ! */ ! static final int SEG_QUADTO = 2; ! ! /** ! * The current segment is a cubic parametric curve (more commonly known as ! * a Bezier curve). It is interpolated as t varies from 0 to 1 over the ! * current point (CP), first control point (P1), the second control point ! * (P2), and final interpolated control point (P3): ! *
        !    *  P(t) = B(3,0)*CP + B(3,1)*P1 + B(3,2)*P2 + B(3,3)*P3
        !    *    0 <= t <= 1
        !    *  B(n,m) = mth coefficient of nth degree Bernstein polynomial
        !    *         = C(n,m) * t^(m) * (1 - t)^(n-m)
        !    *  C(n,m) = Combinations of n things, taken m at a time
        !    *         = n! / (m! * (n-m)!)
        !    * 
        ! */ ! static final int SEG_CUBICTO = 3; ! ! /** ! * The current segment closes a loop by an implicit line to the previous ! * SEG_MOVETO coordinate. ! */ ! static final int SEG_CLOSE = 4; ! ! /** ! * Returns the winding rule to determine which points are inside this path. ! * ! * @return the winding rule ! * @see #WIND_EVEN_ODD ! * @see #WIND_NON_ZERO ! */ ! int getWindingRule(); ! ! /** ! * Tests if the iterator is exhausted. If this returns false, currentSegment ! * and next may throw a NoSuchElementException (although this is not ! * required). ! * ! * @return true if the iteration is complete ! */ ! boolean isDone(); ! ! /** ! * Advance to the next segment in the iteration. It is not specified what ! * this does if called when isDone() returns false. ! * ! * @throws java.util.NoSuchElementException optional when isDone() is true ! */ ! void next(); ! ! /** ! * Returns the coordinates of the next point(s), as well as the type of ! * line segment. The input array must be at least a float[6], to accomodate ! * up to three (x,y) point pairs (although if you know the iterator is ! * flat, you can probably get by with a float[2]). If the returned type is ! * SEG_MOVETO or SEG_LINETO, the first point in the array is modified; if ! * the returned type is SEG_QUADTO, the first two points are modified; if ! * the returned type is SEG_CUBICTO, all three points are modified; and if ! * the returned type is SEG_CLOSE, the array is untouched. ! * ! * @param coords the array to place the point coordinates in ! * @return the segment type ! * @throws NullPointerException if coords is null ! * @throws ArrayIndexOutOfBoundsException if coords is too small ! * @throws java.util.NoSuchElementException optional when isDone() is true ! * @see #SEG_MOVETO ! * @see #SEG_LINETO ! * @see #SEG_QUADTO ! * @see #SEG_CUBICTO ! * @see #SEG_CLOSE ! */ ! int currentSegment(float[] coords); ! ! /** ! * Returns the coordinates of the next point(s), as well as the type of ! * line segment. The input array must be at least a double[6], to accomodate ! * up to three (x,y) point pairs (although if you know the iterator is ! * flat, you can probably get by with a double[2]). If the returned type is ! * SEG_MOVETO or SEG_LINETO, the first point in the array is modified; if ! * the returned type is SEG_QUADTO, the first two points are modified; if ! * the returned type is SEG_CUBICTO, all three points are modified; and if ! * the returned type is SEG_CLOSE, the array is untouched. ! * ! * @param coords the array to place the point coordinates in ! * @return the segment type ! * @throws NullPointerException if coords is null ! * @throws ArrayIndexOutOfBoundsException if coords is too small ! * @throws java.util.NoSuchElementException optional when isDone() is true ! * @see #SEG_MOVETO ! * @see #SEG_LINETO ! * @see #SEG_QUADTO ! * @see #SEG_CUBICTO ! * @see #SEG_CLOSE ! */ ! int currentSegment(double[] coords); ! } // interface PathIterator diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/Point2D.java gcc-3.3/libjava/java/awt/geom/Point2D.java *** gcc-3.2.3/libjava/java/awt/geom/Point2D.java 2002-04-08 18:48:55.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/Point2D.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Point2D.java -- generic point in 2-D space ! Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,197 **** package java.awt.geom; /** * @author Per Bothner ! * @date February 8, 1999. ! */ ! ! /* Written using "Java Class Libraries", 2nd edition, plus online ! * API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: Believed complete and correct, except that neither toString ! * nor hashCode have been compared with JDK output. */ - public abstract class Point2D implements Cloneable { public abstract double getX(); public abstract double getY(); ! public abstract void setLocation (double x, double y); ! protected Point2D () { } ! public void setLocation (Point2D pt) { setLocation(pt.getX(), pt.getY()); } ! ! static public double distanceSq (double X1, double Y1, double X2, double Y2) { ! X2 -= X1; ! Y2 -= Y1; ! return X2*X2 + Y2*Y2; } ! static public double distance (double X1, double Y1, double X2, double Y2) { ! return Math.sqrt(distanceSq(X1, Y1, X2, Y2)); } ! public double distanceSq (double PX, double PY) { ! return distanceSq (getX(), PX, getY(), PY); } ! public double distance (double PX, double PY) { ! return distance (getX(), PX, getY(), PY); } ! public double distanceSq (Point2D pt) { ! return distanceSq (getX(), pt.getX(), getY(), pt.getY()); } ! public double distance (Point2D pt) { ! return distance (getX(), pt.getX(), getY(), pt.getY()); } ! public int hashCode() { return (int) getX() ^ (int) getY(); } ! public Object clone() { try ! { ! return super.clone (); ! } ! catch (CloneNotSupportedException _) {return null;} } ! public boolean equals (Object o) { if (! (o instanceof Point2D)) return false; Point2D p = (Point2D) o; ! return getX () == p.getX () && getY () == p.getY (); } public static class Double extends Point2D { public double x; public double y; ! public Double () { - x = 0; - y = 0; } ! public Double (double x, double y) { this.x = x; this.y = y; } ! public double getX () { return x; } ! public double getY () { return y; } ! public void setLocation (double x, double y) { this.x = x; this.y = y; } ! public String toString () { ! return "(" + x + ", " + y + ")"; } ! } public static class Float extends Point2D { public float x; public float y; ! public Float () { - x = 0; - y = 0; } ! public Float (float x, float y) { this.x = x; this.y = y; } ! public double getX () { return x; } ! public double getY () { return y; } ! public void setLocation (double x, double y) { this.x = (float) x; this.y = (float) y; } ! public void setLocation (float x, float y) { this.x = x; this.y = y; } ! public String toString () { ! return "(" + x + ", " + y + ")"; } ! } ! } --- 38,395 ---- package java.awt.geom; /** + * This class implements a generic point in 2D Cartesian space. The storage + * representation is left up to the subclass. Point includes two useful + * nested classes, for float and double storage respectively. + * * @author Per Bothner ! * @author Eric Blake ! * @since 1.2 ! * @status updated to 1.4 */ public abstract class Point2D implements Cloneable { + /** + * The default constructor. + * + * @see Point + * @see Point2D.Float + * @see Point2D.Double + */ + protected Point2D() + { + } + + /** + * Get the X coordinate, in double precision. + * + * @return the x coordinate + */ public abstract double getX(); + + /** + * Get the Y coordinate, in double precision. + * + * @return the y coordinate + */ public abstract double getY(); ! /** ! * Set the location of this point to the new coordinates. There may be a ! * loss of precision. ! * ! * @param x the new x coordinate ! * @param y the new y coordinate ! */ ! public abstract void setLocation(double x, double y); ! /** ! * Set the location of this point to the new coordinates. There may be a ! * loss of precision. ! * ! * @param p the point to copy ! * @throws NullPointerException if p is null ! */ ! public void setLocation(Point2D p) { + setLocation(p.getX(), p.getY()); } ! /** ! * Return the square of the distance between two points. ! * ! * @param x1 the x coordinate of point 1 ! * @param y1 the y coordinate of point 1 ! * @param x2 the x coordinate of point 2 ! * @param y2 the y coordinate of point 2 ! * @return (x2 - x1)^2 + (y2 - y1)^2 ! */ ! public static double distanceSq(double x1, double y1, double x2, double y2) { ! x2 -= x1; ! y2 -= y1; ! return x2 * x2 + y2 * y2; } ! /** ! * Return the distance between two points. ! * ! * @param x1 the x coordinate of point 1 ! * @param y1 the y coordinate of point 1 ! * @param x2 the x coordinate of point 2 ! * @param y2 the y coordinate of point 2 ! * @return the distance from (x1,y1) to (x2,y2) ! */ ! static public double distance(double x1, double y1, double x2, double y2) { ! return Math.sqrt(distanceSq(x1, y1, x2, y2)); } ! /** ! * Return the square of the distance from this point to the given one. ! * ! * @param x the x coordinate of the other point ! * @param y the y coordinate of the other point ! * @return the square of the distance ! */ ! public double distanceSq(double x, double y) { ! return distanceSq(getX(), x, getY(), y); } ! /** ! * Return the square of the distance from this point to the given one. ! * ! * @param p the other point ! * @return the square of the distance ! * @throws NullPointerException if p is null ! */ ! public double distanceSq(Point2D p) { ! return distanceSq(getX(), p.getX(), getY(), p.getY()); } ! /** ! * Return the distance from this point to the given one. ! * ! * @param x the x coordinate of the other point ! * @param y the y coordinate of the other point ! * @return the distance ! */ ! public double distance(double x, double y) { ! return distance(getX(), x, getY(), y); } ! /** ! * Return the distance from this point to the given one. ! * ! * @param p the other point ! * @return the distance ! * @throws NullPointerException if p is null ! */ ! public double distance(Point2D p) { ! return distance(getX(), p.getX(), getY(), p.getY()); } ! /** ! * Create a new point of the same run-time type with the same contents as ! * this one. ! * ! * @return the clone ! */ public Object clone() { try ! { ! return super.clone(); ! } ! catch (CloneNotSupportedException e) ! { ! throw (Error) new InternalError().initCause(e); // Impossible ! } } ! /** ! * Return the hashcode for this point. The formula is not documented, but ! * appears to be the same as: ! *
        !    * long l = Double.doubleToLongBits(getY());
        !    * l = l * 31 ^ Double.doubleToLongBits(getX());
        !    * return (int) ((l >> 32) ^ l);
        !    * 
        ! * ! * @return the hashcode ! */ ! public int hashCode() ! { ! // Talk about a fun time reverse engineering this one! ! long l = java.lang.Double.doubleToLongBits(getY()); ! l = l * 31 ^ java.lang.Double.doubleToLongBits(getX()); ! return (int) ((l >> 32) ^ l); ! } ! ! /** ! * Compares two points for equality. This returns true if they have the ! * same coordinates. ! * ! * @param o the point to compare ! * @return true if it is equal ! */ ! public boolean equals(Object o) { if (! (o instanceof Point2D)) return false; Point2D p = (Point2D) o; ! return getX() == p.getX() && getY() == p.getY(); } + /** + * This class defines a point in double precision. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ public static class Double extends Point2D { + /** The X coordinate. */ public double x; + + /** The Y coordinate. */ public double y; ! /** ! * Create a new point at (0,0). ! */ ! public Double() { } ! /** ! * Create a new point at (x,y). ! * ! * @param x the x coordinate ! * @param y the y coordinate ! */ ! public Double(double x, double y) { this.x = x; this.y = y; } ! /** ! * Return the x coordinate. ! * ! * @return the x coordinate ! */ ! public double getX() { return x; } ! /** ! * Return the y coordinate. ! * ! * @return the y coordinate ! */ ! public double getY() { return y; } ! /** ! * Sets the location of this point. ! * ! * @param x the new x coordinate ! * @param y the new y coordinate ! */ ! public void setLocation(double x, double y) { this.x = x; this.y = y; } ! /** ! * Returns a string representation of this object. The format is: ! * "Point2D.Double[" + x + ", " + y + ']'. ! * ! * @return a string representation of this object ! */ ! public String toString() { ! return "Point2D.Double[" + x + ", " + y + ']'; } ! } // class Double + /** + * This class defines a point in float precision. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ public static class Float extends Point2D { + /** The X coordinate. */ public float x; + + /** The Y coordinate. */ public float y; ! /** ! * Create a new point at (0,0). ! */ ! public Float() { } ! /** ! * Create a new point at (x,y). ! * ! * @param x the x coordinate ! * @param y the y coordinate ! */ ! public Float(float x, float y) { this.x = x; this.y = y; } ! /** ! * Return the x coordinate. ! * ! * @return the x coordinate ! */ ! public double getX() { return x; } ! /** ! * Return the y coordinate. ! * ! * @return the y coordinate ! */ ! public double getY() { return y; } ! /** ! * Sets the location of this point. ! * ! * @param x the new x coordinate ! * @param y the new y coordinate ! */ ! public void setLocation(double x, double y) { this.x = (float) x; this.y = (float) y; } ! /** ! * Sets the location of this point. ! * ! * @param x the new x coordinate ! * @param y the new y coordinate ! */ ! public void setLocation(float x, float y) { this.x = x; this.y = y; } ! /** ! * Returns a string representation of this object. The format is: ! * "Point2D.Float[" + x + ", " + y + ']'. ! * ! * @return a string representation of this object ! */ ! public String toString() { ! return "Point2D.Float[" + x + ", " + y + ']'; } ! } // class Float ! } // class Point2D diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/QuadCurve2D.java gcc-3.3/libjava/java/awt/geom/QuadCurve2D.java *** gcc-3.2.3/libjava/java/awt/geom/QuadCurve2D.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/QuadCurve2D.java 2003-01-14 22:12:53.000000000 +0000 *************** *** 0 **** --- 1,490 ---- + /* QuadCurve2D.java -- represents a parameterized quadratic curve in 2-D space + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.geom; + + import java.awt.Rectangle; + import java.awt.Shape; + import java.util.NoSuchElementException; + + /** + * STUBS ONLY + * XXX Implement and document. + */ + public abstract class QuadCurve2D implements Shape, Cloneable + { + protected QuadCurve2D() + { + } + + public abstract double getX1(); + public abstract double getY1(); + public abstract Point2D getP1(); + public abstract double getCtrlX(); + public abstract double getCtrlY(); + public abstract Point2D getCtrlPt(); + public abstract double getX2(); + public abstract double getY2(); + public abstract Point2D getP2(); + + public abstract void setCurve(double x1, double y1, double cx, double cy, + double x2, double y2); + public void setCurve(double[] coords, int offset) + { + setCurve(coords[offset++], coords[offset++], + coords[offset++], coords[offset++], + coords[offset++], coords[offset++]); + } + public void setCurve(Point2D p1, Point2D c, Point2D p2) + { + setCurve(p1.getX(), p1.getY(), c.getX(), c.getY(), + p2.getX(), p2.getY()); + } + public void setCurve(Point2D[] pts, int offset) + { + setCurve(pts[offset].getX(), pts[offset++].getY(), + pts[offset].getX(), pts[offset++].getY(), + pts[offset].getX(), pts[offset++].getY()); + } + public void setCurve(QuadCurve2D c) + { + setCurve(c.getX1(), c.getY1(), c.getCtrlX(), c.getCtrlY(), + c.getX2(), c.getY2()); + } + public static double getFlatnessSq(double x1, double y1, double cx, + double cy, double x2, double y2) + { + // XXX Implement. + throw new Error("not implemented"); + } + public static double getFlatness(double x1, double y1, double cx, double cy, + double x2, double y2) + { + return Math.sqrt(getFlatnessSq(x1, y1, cx, cy, x2, y2)); + } + public static double getFlatnessSq(double[] coords, int offset) + { + return getFlatnessSq(coords[offset++], coords[offset++], + coords[offset++], coords[offset++], + coords[offset++], coords[offset++]); + } + public static double getFlatness(double[] coords, int offset) + { + return Math.sqrt(getFlatnessSq(coords[offset++], coords[offset++], + coords[offset++], coords[offset++], + coords[offset++], coords[offset++])); + } + public double getFlatnessSq() + { + return getFlatnessSq(getX1(), getY1(), getCtrlX(), getCtrlY(), + getX2(), getY2()); + } + public double getFlatness() + { + return Math.sqrt(getFlatnessSq(getX1(), getY1(), getCtrlX(), getCtrlY(), + getX2(), getY2())); + } + + public void subdivide(QuadCurve2D l, QuadCurve2D r) + { + if (l == null) + l = new QuadCurve2D.Double(); + if (r == null) + r = new QuadCurve2D.Double(); + // Use empty slots at end to share single array. + double[] d = new double[] { getX1(), getY1(), getCtrlX(), getCtrlY(), + getX2(), getY2(), 0, 0, 0, 0 }; + subdivide(d, 0, d, 0, d, 4); + l.setCurve(d, 0); + r.setCurve(d, 4); + } + public static void subdivide(QuadCurve2D src, QuadCurve2D l, QuadCurve2D r) + { + src.subdivide(l, r); + } + public static void subdivide(double[] src, int srcOff, + double[] left, int leftOff, + double[] right, int rightOff) + { + // XXX Implement. + throw new Error("not implemented"); + } + public static int solveQuadratic(double[] eqn) + { + return solveQuadratic(eqn, eqn); + } + public static int solveQuadratic(double[] eqn, double[] res) + { + double c = eqn[0]; + double b = eqn[1]; + double a = eqn[2]; + if (a == 0) + { + if (b == 0) + return -1; + res[0] = -c / b; + return 1; + } + c /= a; + b /= a * 2; + double det = Math.sqrt(b * b - c); + if (det != det) + return 0; + // For fewer rounding errors, we calculate the two roots differently. + if (b > 0) + { + res[0] = -b - det; + res[1] = -c / (b + det); + } + else + { + res[0] = -c / (b - det); + res[1] = -b + det; + } + return 2; + } + + public boolean contains(double x, double y) + { + // XXX Implement. + throw new Error("not implemented"); + } + public boolean contains(Point2D p) + { + return contains(p.getX(), p.getY()); + } + public boolean intersects(double x, double y, double w, double h) + { + // XXX Implement. + throw new Error("not implemented"); + } + public boolean intersects(Rectangle2D r) + { + return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); + } + public boolean contains(double x, double y, double w, double h) + { + // XXX Implement. + throw new Error("not implemented"); + } + public boolean contains(Rectangle2D r) + { + return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); + } + public Rectangle getBounds() + { + return getBounds2D().getBounds(); + } + public PathIterator getPathIterator(final AffineTransform at) + { + return new PathIterator() + { + /** Current coordinate. */ + private int current; + + public int getWindingRule() + { + return WIND_NON_ZERO; + } + + public boolean isDone() + { + return current < 2; + } + + public void next() + { + current++; + } + + public int currentSegment(float[] coords) + { + if (current == 0) + { + coords[0] = (float) getX1(); + coords[1] = (float) getY1(); + if (at != null) + at.transform(coords, 0, coords, 0, 1); + return SEG_MOVETO; + } + if (current == 1) + { + coords[0] = (float) getCtrlX(); + coords[1] = (float) getCtrlY(); + coords[2] = (float) getX2(); + coords[3] = (float) getY2(); + if (at != null) + at.transform(coords, 0, coords, 0, 2); + return SEG_QUADTO; + } + throw new NoSuchElementException("quad iterator out of bounds"); + } + + public int currentSegment(double[] coords) + { + if (current == 0) + { + coords[0] = getX1(); + coords[1] = getY1(); + if (at != null) + at.transform(coords, 0, coords, 0, 1); + return SEG_MOVETO; + } + if (current == 1) + { + coords[0] = getCtrlX(); + coords[1] = getCtrlY(); + coords[2] = getX2(); + coords[3] = getY2(); + if (at != null) + at.transform(coords, 0, coords, 0, 2); + return SEG_QUADTO; + } + throw new NoSuchElementException("quad iterator out of bounds"); + } + }; + } + public PathIterator getPathIterator(AffineTransform at, double flatness) + { + return new FlatteningPathIterator(getPathIterator(at), flatness); + } + + /** + * Create a new curve of the same run-time type with the same contents as + * this one. + * + * @return the clone + * + * @exception OutOfMemoryError If there is not enough memory available. + * + * @since 1.2 + */ + public Object clone() + { + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + throw (Error) new InternalError().initCause(e); // Impossible + } + } + + /** + * STUBS ONLY + */ + public static class Double extends QuadCurve2D + { + public double x1; + public double y1; + public double ctrlx; + public double ctrly; + public double x2; + public double y2; + + public Double() + { + } + + public Double(double x1, double y1, double cx, double cy, + double x2, double y2) + { + this.x1 = x1; + this.y1 = y1; + ctrlx = cx; + ctrly = cy; + this.x2 = x2; + this.y2 = y2; + } + + public double getX1() + { + return x1; + } + public double getY1() + { + return y1; + } + public Point2D getP1() + { + return new Point2D.Double(x1, y1); + } + + public double getCtrlX() + { + return ctrlx; + } + public double getCtrlY() + { + return ctrly; + } + public Point2D getCtrlPt() + { + return new Point2D.Double(ctrlx, ctrly); + } + + public double getX2() + { + return x2; + } + public double getY2() + { + return y2; + } + public Point2D getP2() + { + return new Point2D.Double(x2, y2); + } + + public void setCurve(double x1, double y1, double cx, double cy, + double x2, double y2) + { + this.x1 = x1; + this.y1 = y1; + ctrlx = cx; + ctrly = cy; + this.x2 = x2; + this.y2 = y2; + } + public Rectangle2D getBounds2D() + { + double nx1 = Math.min(Math.min(x1, ctrlx), x2); + double ny1 = Math.min(Math.min(y1, ctrly), y2); + double nx2 = Math.max(Math.max(x1, ctrlx), x2); + double ny2 = Math.max(Math.max(y1, ctrly), y2); + return new Rectangle2D.Double(nx1, ny1, nx2 - nx1, ny2 - ny1); + } + } // class Double + + /** + * STUBS ONLY + */ + public static class Float extends QuadCurve2D + { + public float x1; + public float y1; + public float ctrlx; + public float ctrly; + public float x2; + public float y2; + + public Float() + { + } + + public Float(float x1, float y1, float cx, float cy, + float x2, float y2) + { + this.x1 = x1; + this.y1 = y1; + ctrlx = cx; + ctrly = cy; + this.x2 = x2; + this.y2 = y2; + } + + public double getX1() + { + return x1; + } + public double getY1() + { + return y1; + } + public Point2D getP1() + { + return new Point2D.Float(x1, y1); + } + + public double getCtrlX() + { + return ctrlx; + } + public double getCtrlY() + { + return ctrly; + } + public Point2D getCtrlPt() + { + return new Point2D.Float(ctrlx, ctrly); + } + + public double getX2() + { + return x2; + } + public double getY2() + { + return y2; + } + public Point2D getP2() + { + return new Point2D.Float(x2, y2); + } + + public void setCurve(double x1, double y1, double cx, double cy, + double x2, double y2) + { + this.x1 = (float) x1; + this.y1 = (float) y1; + ctrlx = (float) cx; + ctrly = (float) cy; + this.x2 = (float) x2; + this.y2 = (float) y2; + } + public void setCurve(float x1, float y1, float cx, float cy, + float x2, float y2) + { + this.x1 = x1; + this.y1 = y1; + ctrlx = cx; + ctrly = cy; + this.x2 = x2; + this.y2 = y2; + } + public Rectangle2D getBounds2D() + { + float nx1 = (float) Math.min(Math.min(x1, ctrlx), x2); + float ny1 = (float) Math.min(Math.min(y1, ctrly), y2); + float nx2 = (float) Math.max(Math.max(x1, ctrlx), x2); + float ny2 = (float) Math.max(Math.max(y1, ctrly), y2); + return new Rectangle2D.Float(nx1, ny1, nx2 - nx1, ny2 - ny1); + } + } // class Float + } // class CubicCurve2D diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/Rectangle2D.java gcc-3.3/libjava/java/awt/geom/Rectangle2D.java *** gcc-3.2.3/libjava/java/awt/geom/Rectangle2D.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/Rectangle2D.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Rectangle2D.java -- generic rectangles in 2-D space ! Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,464 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.geom; /** * @author Tom Tromey ! * @date April 16, 2000 */ - public abstract class Rectangle2D extends RectangularShape { public static final int OUT_LEFT = 1; public static final int OUT_TOP = 2; public static final int OUT_RIGHT = 4; public static final int OUT_BOTTOM = 8; ! protected Rectangle2D () { } ! /** Set the bounding box of this rectangle. ! * @param x X coordinate ! * @param y Y coordinate ! * @param w Width ! * @param h Height */ ! public abstract void setRect (double x, double y, double w, double h); ! /** Set the bounding box of this rectangle. ! * @param r Bounding rectangle. */ ! public void setRect (Rectangle2D r) { ! setRect (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); } ! /** Returns true if line segment intersects interior of this ! * rectangle. ! * @param x1 X coordinate of first end of line segment ! * @param y1 Y coordinate of first end of line segment ! * @param x2 X coordinate of second end of line segment ! * @param y2 Y coordinate of segment end of line segment */ ! public boolean intersectsLine (double x1, double y1, double x2, double y2) { ! int o1 = outcode (x1, y1); ! int o2 = outcode (x2, y2); ! ! double mx = getX (); ! double my = getY (); ! double mx2 = getWidth (); ! double my2 = getHeight (); ! x1 -= mx; ! x2 -= mx; ! y1 -= my; ! y2 -= my; ! ! // Here we handle all lines that stay entirely on one side of the ! // rectangle. We also handle some lines that intersect the ! // rectangle. All vertical and horizontal lines are handled here. ! int xor = o1 ^ o2; ! int or = o1 | o2; ! if ((xor & (OUT_BOTTOM | OUT_TOP)) == 0) ! { ! if ((or & (OUT_BOTTOM | OUT_TOP)) != 0) ! return false; ! return ((o1 & (OUT_LEFT | OUT_RIGHT)) != 0 ! || (o2 & (OUT_LEFT | OUT_RIGHT)) != 0); ! } ! else if ((xor & (OUT_LEFT | OUT_RIGHT)) == 0) ! { ! if ((or & (OUT_LEFT | OUT_RIGHT)) != 0) ! return false; ! return ((o1 & (OUT_BOTTOM | OUT_TOP)) != 0 ! || (o2 & (OUT_BOTTOM | OUT_TOP)) != 0); ! } ! double dx = x2 - x1; ! double dy = y2 - y1; ! double t1l = - x1 / dx; ! double t1h = (mx2 - x1) / dx; ! if (t1l >= t1h) ! return false; ! double t2l = - y1 / dy; ! double t2h = (my2 - y1) / dy; ! if (t2l >= t2h || t2l >= t1h || t2h < t1l) ! return false; ! return true; } ! /** Return true if line segment intersects interior of this ! * rectangle. ! * @param l The line segment */ ! // public boolean intersectsLine (Line2D l) ! // { ! // } ! public abstract int outcode (double x, double y); ! public int outcode (Point2D p) { ! return outcode (p.getX (), p.getY ()); } ! /** Set bounding frame for this rectangle. ! * @param x X coordinate ! * @param y Y coordinate ! * @param w Width ! * @param h Height */ ! public void setFrame (double x, double y, double w, double h) { ! setRect (x, y, w, h); } ! public Rectangle2D getBounds2D () { ! // FIXME. ! return (Rectangle2D) clone (); } ! public boolean contains (double x, double y) { ! double mx = getX (); ! double mw = getWidth (); ! if (x < mx || x >= mx + mw) ! return false; ! double my = getY (); ! double mh = getHeight (); ! return y >= my && y < my + mh; } ! public boolean intersects (double x, double y, double w, double h) { ! double mx = getX (); ! double mw = getWidth (); ! if (x < mx || x >= mx + mw || x + w < mx || x + w >= mx + mw) ! return false; ! double my = getY (); ! double mh = getHeight (); ! return y >= my && y < my + mh && y + h >= my && y + h < my + mh; } ! public boolean contains (double x, double y, double w, double h) { ! return contains (x, y) && contains (x + w, y + h); } ! public abstract Rectangle2D createIntersection (Rectangle2D r); ! public static void intersect (Rectangle2D src1, Rectangle2D src2, ! Rectangle2D dest) { ! double x1l = src1.getMinX (); ! double x2l = src2.getMinX (); ! double nxl = Math.max (x1l, x2l); ! double x1h = src1.getMaxX (); ! double x2h = src2.getMaxX (); ! double nxh = Math.min (x1h, x2h); ! if (nxh < nxl) ! nxh = nxl; ! double y1l = src1.getMinY (); ! double y2l = src2.getMinY (); ! double nyl = Math.max (y1l, y2l); ! double y1h = src1.getMaxY (); ! double y2h = src2.getMaxY (); ! double nyh = Math.min (y1h, y2h); ! if (nyh < nyl) ! nyh = nyl; ! dest.setFrameFromDiagonal (nxl, nyl, nxh, nyh); } ! public abstract Rectangle2D createUnion (Rectangle2D r); ! public static void union (Rectangle2D src1, Rectangle2D src2, ! Rectangle2D dest) { ! double x1l = src1.getMinX (); ! double x2l = src2.getMinX (); ! double nxl = Math.max (x1l, x2l); ! double x1h = src1.getMaxX (); ! double x2h = src2.getMaxX (); ! double nxh = Math.min (x1h, x2h); ! double y1l = src1.getMinY (); ! double y2l = src2.getMinY (); ! double nyl = Math.max (y1l, y2l); ! double y1h = src1.getMaxY (); ! double y2h = src2.getMaxY (); ! double nyh = Math.min (y1h, y2h); ! dest.setFrameFromDiagonal (nxl, nyl, nxh, nyh); } ! public void add (double newx, double newy) { ! double minx = Math.min (getMinX (), newx); ! double maxx = Math.max (getMaxX (), newx); ! double miny = Math.min (getMinY (), newy); ! double maxy = Math.max (getMaxY (), newy); ! setFrameFromDiagonal (minx, miny, maxx, maxy); } ! public void add (Point2D p) { ! add (p.getX (), p.getY ()); } ! public void add (Rectangle2D r) { ! add (r.getMinX (), r.getMinY ()); ! add (r.getMaxX (), r.getMaxY ()); } ! public PathIterator getPathIterator (AffineTransform at) { ! // We know the superclass just ignores the flatness parameter. ! return getPathIterator (at, 0); } public static class Double extends Rectangle2D { ! public double height; ! public double width; public double x; public double y; ! public Double () { - height = width = x = y = 0; } ! public Double (double x, double y, double w, double h) { this.x = x; this.y = y; ! this.width = w; ! this.height = h; } ! public double getX () { return x; } ! public double getY () { return y; } ! public double getWidth () { return width; } ! public double getHeight () { return height; } ! public boolean isEmpty () { return width <= 0 || height <= 0; } ! public void setRect (double x, double y, double w, double h) { this.x = x; this.y = y; ! this.width = w; ! this.height = h; } ! public void setRect (Rectangle2D r) { ! this.x = r.getX (); ! this.y = r.getY (); ! this.width = r.getWidth (); ! this.height = r.getHeight (); } ! public int outcode (double x, double y) { ! int code = 0; ! if (x < this.x) ! code |= OUT_LEFT; ! else if (x >= this.x + this.width) ! code |= OUT_RIGHT; ! if (y < this.y) ! code |= OUT_TOP; ! else if (y >= this.y + this.height) ! code |= OUT_BOTTOM; ! return code; } ! public Rectangle2D getBounds2D () { ! return new Rectangle2D.Double (x, y, width, height); } ! public Rectangle2D createIntersection (Rectangle2D r) { ! Double res = new Double (); ! intersect (this, r, res); return res; } ! public Rectangle2D createUnion (Rectangle2D r) { ! Double res = new Double (); ! union (this, r, res); return res; } ! public String toString () { ! return "fixme"; } ! } public static class Float extends Rectangle2D { ! public float height; ! public float width; public float x; public float y; ! public Float () { - height = width = x = y = 0; } ! public Float (float x, float y, float w, float h) { this.x = x; this.y = y; ! this.width = w; ! this.height = h; } ! public double getX () { return x; } ! public double getY () { return y; } ! public double getWidth () { return width; } ! public double getHeight () { return height; } ! public boolean isEmpty () { return width <= 0 || height <= 0; } ! public void setRect (double x, double y, double w, double h) { ! this.x = (float) x; ! this.y = (float) y; ! this.width = (float) w; ! this.height = (float) h; } ! public void setRect (float x, float y, float w, float h) { ! this.x = x; ! this.y = y; ! this.width = w; ! this.height = h; } ! public void setRect (Rectangle2D r) { ! this.x = (float) r.getX (); ! this.y = (float) r.getY (); ! this.width = (float) r.getWidth (); ! this.height = (float) r.getHeight (); } ! public int outcode (double x, double y) { ! int code = 0; ! if (x < this.x) ! code |= OUT_LEFT; ! else if (x >= this.x + this.width) ! code |= OUT_RIGHT; ! if (y < this.y) ! code |= OUT_TOP; ! else if (y >= this.y + this.height) ! code |= OUT_BOTTOM; ! return code; } ! public Rectangle2D getBounds2D () { ! return new Rectangle2D.Float (x, y, width, height); } ! public Rectangle2D createIntersection (Rectangle2D r) { ! Float res = new Float (); ! intersect (this, r, res); return res; } ! public Rectangle2D createUnion (Rectangle2D r) { ! Float res = new Float (); ! union (this, r, res); return res; } ! public String toString () { ! return "fixme"; } ! } ! } --- 35,986 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.geom; + import java.util.NoSuchElementException; + /** + * This class describes a rectangle by a point (x,y) and dimension (w x h). + * The actual storage is left up to subclasses. + * + *

        It is valid for a rectangle to have negative width or height; but it + * is considered to have no area or internal points. Therefore, the behavior + * in methods like contains or intersects is + * undefined unless the rectangle has positive width and height. + * * @author Tom Tromey ! * @author Eric Blake ! * @since 1.2 ! * @status updated to 1.4 */ public abstract class Rectangle2D extends RectangularShape { + /** + * The point lies left of the rectangle (p.x < r.x). + * + * @see #outcode() + */ public static final int OUT_LEFT = 1; + + /** + * The point lies above the rectangle (p.y < r.y). + * + * @see #outcode() + */ public static final int OUT_TOP = 2; + + /** + * The point lies right of the rectangle (p.x > r.maxX). + * + * @see #outcode() + */ public static final int OUT_RIGHT = 4; + + /** + * The point lies below of the rectangle (p.y > r.maxY). + * + * @see #outcode() + */ public static final int OUT_BOTTOM = 8; ! /** ! * Default constructor. ! */ ! protected Rectangle2D() { } ! /** ! * Set the bounding box of this rectangle. ! * ! * @param x the new X coordinate ! * @param y the new Y coordinate ! * @param w the new width ! * @param h the new height */ ! public abstract void setRect(double x, double y, double w, double h); ! /** ! * Set the bounding box of this rectangle from the given one. ! * ! * @param r rectangle to copy ! * @throws NullPointerException if r is null */ ! public void setRect(Rectangle2D r) { ! setRect(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } ! /** ! * Tests if the specified line intersects the interior of this rectangle. ! * ! * @param x1 the first x coordinate of line segment ! * @param y1 the first y coordinate of line segment ! * @param x2 the second x coordinate of line segment ! * @param y2 the second y coordinate of line segment ! * @return true if the line intersects the rectangle */ ! public boolean intersectsLine(double x1, double y1, double x2, double y2) { ! double x = getX(); ! double y = getY(); ! double w = getWidth(); ! double h = getHeight(); ! if (w <= 0 || h <= 0) ! return false; ! if (x1 >= x && x1 <= x + w && y1 >= y && y1 <= y + h) ! return true; ! if (x2 >= x && x2 <= x + w && y2 >= y && y2 <= y + h) ! return true; ! double x3 = x + w; ! double y3 = y + h; ! return (Line2D.linesIntersect(x1, y1, x2, y2, x, y, x, y3) ! || Line2D.linesIntersect(x1, y1, x2, y2, x, y3, x3, y3) ! || Line2D.linesIntersect(x1, y1, x2, y2, x3, y3, x3, y) ! || Line2D.linesIntersect(x1, y1, x2, y2, x3, y, x, y)); ! } ! /** ! * Tests if the specified line intersects the interior of this rectangle. ! * ! * @param l the line segment ! * @return true if the line intersects the rectangle ! * @throws NullPointerException if l is null ! */ ! public boolean intersectsLine(Line2D l) ! { ! return intersectsLine(l.getX1(), l.getY1(), l.getX2(), l.getY2()); } ! /** ! * Determine where the point lies with respect to this rectangle. The ! * result will be the binary OR of the appropriate bit masks. ! * ! * @param x the x coordinate to check ! * @param y the y coordinate to check ! * @return the binary OR of the result ! * @see #OUT_LEFT ! * @see #OUT_TOP ! * @see #OUT_RIGHT ! * @see #OUT_BOTTOM */ ! public abstract int outcode(double x, double y); ! /** ! * Determine where the point lies with respect to this rectangle. The ! * result will be the binary OR of the appropriate bit masks. ! * ! * @param p the point to check ! * @return the binary OR of the result ! * @throws NullPointerException if p is null ! * @see #OUT_LEFT ! * @see #OUT_TOP ! * @see #OUT_RIGHT ! * @see #OUT_BOTTOM ! */ ! public int outcode(Point2D p) ! { ! return outcode(p.getX(), p.getY()); ! } ! /** ! * Set the bounding box of this rectangle. ! * ! * @param x the new X coordinate ! * @param y the new Y coordinate ! * @param w the new width ! * @param h the new height ! */ ! public void setFrame(double x, double y, double w, double h) { ! setRect(x, y, w, h); } ! /** ! * Returns the bounds of this rectangle. A pretty useless method, as this ! * is already a rectangle. ! * ! * @return a copy of this rectangle */ ! public Rectangle2D getBounds2D() { ! return (Rectangle2D) clone(); } ! /** ! * Test if the given point is contained in the rectangle. ! * ! * @param x the x coordinate of the point ! * @param y the y coordinate of the point ! * @return true if (x,y) is in the rectangle ! */ ! public boolean contains(double x, double y) { ! double mx = getX(); ! double my = getY(); ! double w = getWidth(); ! double h = getHeight(); ! return w > 0 && h > 0 && x >= mx && x < mx + w && y >= my && y < my + h; } ! /** ! * Tests if the given rectangle intersects this one. In other words, test if ! * the two rectangles share at least one internal point. ! * ! * @param x the x coordinate of the other rectangle ! * @param y the y coordinate of the other rectangle ! * @param w the width of the other rectangle ! * @param h the height of the other rectangle ! * @return true if the rectangles intersect ! */ ! public boolean intersects(double x, double y, double w, double h) { ! double mx = getX(); ! double my = getY(); ! double mw = getWidth(); ! double mh = getHeight(); ! return w > 0 && h > 0 && mw > 0 && mh > 0 ! && x < mx + mw && x + w > mx && y < my + mh && y + h > my; } ! /** ! * Tests if this rectangle contains the given one. In other words, test if ! * this rectangle contains all points in the given one. ! * ! * @param x the x coordinate of the other rectangle ! * @param y the y coordinate of the other rectangle ! * @param w the width of the other rectangle ! * @param h the height of the other rectangle ! * @return true if this rectangle contains the other ! */ ! public boolean contains(double x, double y, double w, double h) { ! double mx = getX(); ! double my = getY(); ! double mw = getWidth(); ! double mh = getHeight(); ! return w > 0 && h > 0 && mw > 0 && mh > 0 ! && x >= mx && x + w <= mx + mw && y >= my && y + h <= my + mh; } ! /** ! * Return a new rectangle which is the intersection of this and the given ! * one. The result will be empty if there is no intersection. ! * ! * @param r the rectangle to be intersected ! * @return the intersection ! * @throws NullPointerException if r is null ! */ ! public abstract Rectangle2D createIntersection(Rectangle2D r); ! ! /** ! * Intersects a pair of rectangles, and places the result in the ! * destination; this can be used to avoid object creation. This method ! * even works when the destination is also a source, although you stand ! * to lose the original data. ! * ! * @param src1 the first source ! * @param src2 the second source ! * @param dest the destination for the intersection ! * @throws NullPointerException if any rectangle is null ! */ ! public static void intersect(Rectangle2D src1, Rectangle2D src2, ! Rectangle2D dest) { ! double x = Math.max(src1.getX(), src2.getX()); ! double y = Math.max(src1.getY(), src2.getY()); ! double maxx = Math.min(src1.getMaxX(), src2.getMaxX()); ! double maxy = Math.min(src1.getMaxY(), src2.getMaxY()); ! dest.setRect(x, y, maxx - x, maxy - y); } ! /** ! * Return a new rectangle which is the union of this and the given one. ! * ! * @param r the rectangle to be merged ! * @return the union ! * @throws NullPointerException if r is null ! */ ! public abstract Rectangle2D createUnion(Rectangle2D r); ! /** ! * Joins a pair of rectangles, and places the result in the destination; ! * this can be used to avoid object creation. This method even works when ! * the destination is also a source, although you stand to lose the ! * original data. ! * ! * @param src1 the first source ! * @param src2 the second source ! * @param dest the destination for the union ! * @throws NullPointerException if any rectangle is null ! */ ! public static void union(Rectangle2D src1, Rectangle2D src2, ! Rectangle2D dest) { ! double x = Math.min(src1.getX(), src2.getX()); ! double y = Math.min(src1.getY(), src2.getY()); ! double maxx = Math.max(src1.getMaxX(), src2.getMaxX()); ! double maxy = Math.max(src1.getMaxY(), src2.getMaxY()); ! dest.setRect(x, y, maxx - x, maxy - y); } ! /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified point. ! * However, if the point falls on one of the two borders which are not ! * inside the rectangle, a subsequent call to contains may ! * return false. ! * ! * @param x the X coordinate of the point to add to this rectangle ! * @param y the Y coordinate of the point to add to this rectangle ! */ ! public void add(double newx, double newy) ! { ! double minx = Math.min(getX(), newx); ! double maxx = Math.max(getMaxX(), newx); ! double miny = Math.min(getY(), newy); ! double maxy = Math.max(getMaxY(), newy); ! setRect(minx, miny, maxx - minx, maxy - miny); ! } ! /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified point. ! * However, if the point falls on one of the two borders which are not ! * inside the rectangle, a subsequent call to contains may ! * return false. ! * ! * @param p the point to add to this rectangle ! * @throws NullPointerException if p is null ! */ ! public void add(Point2D p) { ! add(p.getX(), p.getY()); } ! /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified rectangle. ! * ! * @param r the rectangle to add to this rectangle ! * @throws NullPointerException if r is null ! * @see #union(Rectangle2D) ! */ ! public void add(Rectangle2D r) { ! union(this, r, this); } ! /** ! * Return an iterator along the shape boundary. If the optional transform ! * is provided, the iterator is transformed accordingly. Each call returns ! * a new object, independent from others in use. This iterator is thread ! * safe; modifications to the rectangle do not affect the results of this ! * path instance. ! * ! * @param transform an optional transform to apply to the iterator ! * @return a new iterator over the boundary ! * @since 1.2 ! */ ! public PathIterator getPathIterator(final AffineTransform at) { ! final double minx = getX(); ! final double miny = getY(); ! final double maxx = minx + getWidth(); ! final double maxy = miny + getHeight(); ! return new PathIterator() ! { ! /** Current coordinate. */ ! private int current = (maxx >= minx && maxy >= miny) ? 6 : 0; ! ! public int getWindingRule() ! { ! return WIND_EVEN_ODD; ! } ! ! public boolean isDone() ! { ! return current > 5; ! } ! ! public void next() ! { ! current++; ! } ! ! public int currentSegment(float[] coords) ! { ! switch (current) ! { ! case 1: ! coords[0] = (float) maxx; ! coords[1] = (float) miny; ! break; ! case 2: ! coords[0] = (float) maxx; ! coords[1] = (float) maxy; ! break; ! case 3: ! coords[0] = (float) minx; ! coords[1] = (float) maxy; ! break; ! case 0: ! case 4: ! coords[0] = (float) minx; ! coords[1] = (float) miny; ! break; ! case 5: ! return SEG_CLOSE; ! default: ! throw new NoSuchElementException("rect iterator out of bounds"); ! } ! if (at != null) ! at.transform(coords, 0, coords, 0, 1); ! return current == 0 ? SEG_MOVETO : SEG_LINETO; ! } ! ! public int currentSegment(double[] coords) ! { ! switch (current) ! { ! case 1: ! coords[0] = maxx; ! coords[1] = miny; ! break; ! case 2: ! coords[0] = maxx; ! coords[1] = maxy; ! break; ! case 3: ! coords[0] = minx; ! coords[1] = maxy; ! break; ! case 0: ! case 4: ! coords[0] = minx; ! coords[1] = miny; ! break; ! case 5: ! return SEG_CLOSE; ! default: ! throw new NoSuchElementException("rect iterator out of bounds"); ! } ! if (at != null) ! at.transform(coords, 0, coords, 0, 1); ! return current == 0 ? SEG_MOVETO : SEG_LINETO; ! } ! }; } ! /** ! * Return an iterator along the shape boundary. If the optional transform ! * is provided, the iterator is transformed accordingly. Each call returns ! * a new object, independent from others in use. This iterator is thread ! * safe; modifications to the rectangle do not affect the results of this ! * path instance. As the rectangle is already flat, the flatness parameter ! * is ignored. ! * ! * @param transform an optional transform to apply to the iterator ! * @param double the maximum distance for deviation from the real boundary ! * @return a new iterator over the boundary ! * @since 1.2 ! */ ! public PathIterator getPathIterator(AffineTransform at, double flatness) { ! return getPathIterator(at); } ! /** ! * Return the hashcode for this rectangle. The formula is not documented, but ! * appears to be the same as: ! *

        !    * long l = Double.doubleToLongBits(getX())
        !    *   + 37 * Double.doubleToLongBits(getY())
        !    *   + 43 * Double.doubleToLongBits(getWidth())
        !    *   + 47 * Double.doubleToLongBits(getHeight());
        !    * return (int) ((l >> 32) ^ l);
        !    * 
        ! * ! * @return the hashcode ! */ ! public int hashCode() { ! // Talk about a fun time reverse engineering this one! ! long l = java.lang.Double.doubleToLongBits(getX()) ! + 37 * java.lang.Double.doubleToLongBits(getY()) ! + 43 * java.lang.Double.doubleToLongBits(getWidth()) ! + 47 * java.lang.Double.doubleToLongBits(getHeight()); ! return (int) ((l >> 32) ^ l); ! } ! ! /** ! * Tests this rectangle for equality against the specified object. This ! * will be true if an only if the specified object is an instance of ! * Rectangle2D with the same coordinates and dimensions. ! * ! * @param obj the object to test against for equality ! * @return true if the specified object is equal to this one ! */ ! public boolean equals(Object obj) ! { ! if (! (obj instanceof Rectangle2D)) ! return false; ! Rectangle2D r = (Rectangle2D) obj; ! return r.getX() == getX() && r.getY() == getY() ! && r.getWidth() == getWidth() && r.getHeight() == getHeight(); } + /** + * This class defines a rectangle in double precision. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ public static class Double extends Rectangle2D { ! /** The x coordinate of the lower left corner. */ public double x; + + /** The y coordinate of the lower left corner. */ public double y; ! /** The width of the rectangle. */ ! public double width; ! ! /** The height of the rectangle. */ ! public double height; ! ! /** ! * Create a rectangle at (0,0) with width 0 and height 0. ! */ ! public Double() { } ! /** ! * Create a rectangle with the given values. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @param w the width ! * @param h the height ! */ ! public Double(double x, double y, double w, double h) { this.x = x; this.y = y; ! width = w; ! height = h; } ! /** ! * Return the X coordinate. ! * ! * @return the value of x ! */ ! public double getX() { return x; } ! /** ! * Return the Y coordinate. ! * ! * @return the value of y ! */ ! public double getY() { return y; } ! /** ! * Return the width. ! * ! * @return the value of width ! */ ! public double getWidth() { return width; } ! /** ! * Return the height. ! * ! * @return the value of height ! */ ! public double getHeight() { return height; } ! /** ! * Test if the rectangle is empty. ! * ! * @return true if width or height is not positive ! */ ! public boolean isEmpty() { return width <= 0 || height <= 0; } ! /** ! * Set the contents of this rectangle to those specified. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @param w the width ! * @param h the height ! */ ! public void setRect(double x, double y, double w, double h) { this.x = x; this.y = y; ! width = w; ! height = h; } ! /** ! * Set the contents of this rectangle to those specified. ! * ! * @param r the rectangle to copy ! * @throws NullPointerException if r is null ! */ ! public void setRect(Rectangle2D r) { ! x = r.getX(); ! y = r.getY(); ! width = r.getWidth(); ! height = r.getHeight(); } ! /** ! * Determine where the point lies with respect to this rectangle. The ! * result will be the binary OR of the appropriate bit masks. ! * ! * @param x the x coordinate to check ! * @param y the y coordinate to check ! * @return the binary OR of the result ! * @see #OUT_LEFT ! * @see #OUT_TOP ! * @see #OUT_RIGHT ! * @see #OUT_BOTTOM ! * @since 1.2 ! */ ! public int outcode(double x, double y) { ! int result = 0; ! if (width <= 0) ! result |= OUT_LEFT | OUT_RIGHT; ! else if (x < this.x) ! result |= OUT_LEFT; ! else if (x > this.x + width) ! result |= OUT_RIGHT; ! if (height <= 0) ! result |= OUT_BOTTOM | OUT_TOP; ! else if (y < this.y) // Remember that +y heads top-to-bottom. ! result |= OUT_TOP; ! else if (y > this.y + height) ! result |= OUT_BOTTOM; ! return result; } ! /** ! * Returns the bounds of this rectangle. A pretty useless method, as this ! * is already a rectangle. ! * ! * @return a copy of this rectangle ! */ ! public Rectangle2D getBounds2D() { ! return new Double(x, y, width, height); } ! /** ! * Return a new rectangle which is the intersection of this and the given ! * one. The result will be empty if there is no intersection. ! * ! * @param r the rectangle to be intersected ! * @return the intersection ! * @throws NullPointerException if r is null ! */ ! public Rectangle2D createIntersection(Rectangle2D r) { ! Double res = new Double(); ! intersect(this, r, res); return res; } ! /** ! * Return a new rectangle which is the union of this and the given one. ! * ! * @param r the rectangle to be merged ! * @return the union ! * @throws NullPointerException if r is null ! */ ! public Rectangle2D createUnion(Rectangle2D r) { ! Double res = new Double(); ! union(this, r, res); return res; } ! /** ! * Returns a string representation of this rectangle. This is in the form ! * getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width ! * + ",h=" + height + ']'. ! * ! * @return a string representation of this rectangle ! */ ! public String toString() { ! return getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width ! + ",h=" + height + ']'; } ! } // class Double + /** + * This class defines a rectangle in float precision. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ public static class Float extends Rectangle2D { ! /** The x coordinate of the lower left corner. */ public float x; + + /** The y coordinate of the lower left corner. */ public float y; ! /** The width of the rectangle. */ ! public float width; ! ! /** The height of the rectangle. */ ! public float height; ! ! /** ! * Create a rectangle at (0,0) with width 0 and height 0. ! */ ! public Float() { } ! /** ! * Create a rectangle with the given values. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @param w the width ! * @param h the height ! */ ! public Float(float x, float y, float w, float h) { this.x = x; this.y = y; ! width = w; ! height = h; } ! /** ! * Create a rectangle with the given values. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @param w the width ! * @param h the height ! */ ! Float(double x, double y, double w, double h) ! { ! this.x = (float) x; ! this.y = (float) y; ! width = (float) w; ! height = (float) h; ! } ! ! /** ! * Return the X coordinate. ! * ! * @return the value of x ! */ ! public double getX() { return x; } ! /** ! * Return the Y coordinate. ! * ! * @return the value of y ! */ ! public double getY() { return y; } ! /** ! * Return the width. ! * ! * @return the value of width ! */ ! public double getWidth() { return width; } ! /** ! * Return the height. ! * ! * @return the value of height ! */ ! public double getHeight() { return height; } ! /** ! * Test if the rectangle is empty. ! * ! * @return true if width or height is not positive ! */ ! public boolean isEmpty() { return width <= 0 || height <= 0; } ! /** ! * Set the contents of this rectangle to those specified. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @param w the width ! * @param h the height ! */ ! public void setRect(float x, float y, float w, float h) { ! this.x = x; ! this.y = y; ! width = w; ! height = h; } ! /** ! * Set the contents of this rectangle to those specified. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @param w the width ! * @param h the height ! */ ! public void setRect(double x, double y, double w, double h) { ! this.x = (float) x; ! this.y = (float) y; ! width = (float) w; ! height = (float) h; } ! /** ! * Set the contents of this rectangle to those specified. ! * ! * @param r the rectangle to copy ! * @throws NullPointerException if r is null ! */ ! public void setRect(Rectangle2D r) { ! x = (float) r.getX(); ! y = (float) r.getY(); ! width = (float) r.getWidth(); ! height = (float) r.getHeight(); } ! /** ! * Determine where the point lies with respect to this rectangle. The ! * result will be the binary OR of the appropriate bit masks. ! * ! * @param x the x coordinate to check ! * @param y the y coordinate to check ! * @return the binary OR of the result ! * @see #OUT_LEFT ! * @see #OUT_TOP ! * @see #OUT_RIGHT ! * @see #OUT_BOTTOM ! * @since 1.2 ! */ ! public int outcode(double x, double y) { ! int result = 0; ! if (width <= 0) ! result |= OUT_LEFT | OUT_RIGHT; ! else if (x < this.x) ! result |= OUT_LEFT; ! else if (x > this.x + width) ! result |= OUT_RIGHT; ! if (height <= 0) ! result |= OUT_BOTTOM | OUT_TOP; ! else if (y < this.y) // Remember that +y heads top-to-bottom. ! result |= OUT_TOP; ! else if (y > this.y + height) ! result |= OUT_BOTTOM; ! return result; } ! /** ! * Returns the bounds of this rectangle. A pretty useless method, as this ! * is already a rectangle. ! * ! * @return a copy of this rectangle ! */ ! public Rectangle2D getBounds2D() { ! return new Float(x, y, width, height); } ! /** ! * Return a new rectangle which is the intersection of this and the given ! * one. The result will be empty if there is no intersection. ! * ! * @param r the rectangle to be intersected ! * @return the intersection ! * @throws NullPointerException if r is null ! */ ! public Rectangle2D createIntersection(Rectangle2D r) { ! Float res = new Float(); ! intersect(this, r, res); return res; } ! /** ! * Return a new rectangle which is the union of this and the given one. ! * ! * @param r the rectangle to be merged ! * @return the union ! * @throws NullPointerException if r is null ! */ ! public Rectangle2D createUnion(Rectangle2D r) { ! Float res = new Float(); ! union(this, r, res); return res; } ! /** ! * Returns a string representation of this rectangle. This is in the form ! * getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width ! * + ",h=" + height + ']'. ! * ! * @return a string representation of this rectangle ! */ ! public String toString() { ! return getClass().getName() + "[x=" + x + ",y=" + y + ",w=" + width ! + ",h=" + height + ']'; } ! } // class Float ! } // class Rectangle2D diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/RectangularShape.java gcc-3.3/libjava/java/awt/geom/RectangularShape.java *** gcc-3.2.3/libjava/java/awt/geom/RectangularShape.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/RectangularShape.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* RectangularShape.java -- a rectangular frame for several generic shapes ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,110 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.geom; ! import java.awt.*; ! import java.awt.geom.Rectangle2D; /** * @author Tom Tromey ! * @date April 16, 2000 */ - public abstract class RectangularShape implements Shape, Cloneable { ! protected RectangularShape () { } ! public abstract double getX (); ! public abstract double getY (); ! public abstract double getWidth (); ! public abstract double getHeight (); ! public double getMinX () ! { ! return Math.min (getX (), getX () + getWidth ()); } ! public double getMinY () { ! return Math.min (getY (), getY () + getHeight ()); } ! public double getMaxX () ! { ! return Math.max (getX (), getX () + getWidth ()); } ! public double getMaxY () { ! return Math.max (getY (), getY () + getHeight ()); } ! public double getCenterX () { ! return getX () + getWidth () / 2; } ! public double getCenterY () { ! return getY () + getHeight () / 2; } ! public Rectangle2D getFrame () { ! return new Rectangle2D.Double (getX (), getY (), ! getWidth (), getHeight ()); } ! public abstract boolean isEmpty (); ! public abstract void setFrame (double x, double y, double w, double h); ! public void setFrame (Point2D loc, Dimension2D size) { ! setFrame (loc.getX (), loc.getY (), size.getWidth (), size.getHeight ()); } ! public void setFrame (Rectangle2D r) { ! setFrame (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); } ! public void setFrameFromDiagonal (double x1, double y1, ! double x2, double y2) { if (x1 > x2) { --- 35,230 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt.geom; ! ! import java.awt.Rectangle; ! import java.awt.Shape; /** + * This class provides a generic framework, and several helper methods, for + * subclasses which represent geometric objects inside a rectangular frame. + * This does not specify any geometry except for the bounding box. + * * @author Tom Tromey ! * @author Eric Blake ! * @since 1.2 ! * @see Arc2D ! * @see Ellipse2D ! * @see Rectangle2D ! * @see RoundRectangle2D ! * @status updated to 1.4 */ public abstract class RectangularShape implements Shape, Cloneable { ! /** ! * Default constructor. ! */ ! protected RectangularShape() { } ! /** ! * Get the x coordinate of the upper-left corner of the framing rectangle. ! * ! * @return the x coordinate ! */ ! public abstract double getX(); ! /** ! * Get the y coordinate of the upper-left corner of the framing rectangle. ! * ! * @return the y coordinate ! */ ! public abstract double getY(); ! ! /** ! * Get the width of the framing rectangle. ! * ! * @return the width ! */ ! public abstract double getWidth(); ! ! /** ! * Get the height of the framing rectangle. ! * ! * @return the height ! */ ! public abstract double getHeight(); ! ! /** ! * Get the minimum x coordinate in the frame. This is misnamed, or else ! * Sun has a bug, because the implementation returns getX() even when ! * getWidth() is negative. ! * ! * @return the minimum x coordinate ! */ ! public double getMinX() ! { ! return getX(); } ! /** ! * Get the minimum y coordinate in the frame. This is misnamed, or else ! * Sun has a bug, because the implementation returns getY() even when ! * getHeight() is negative. ! * ! * @return the minimum y coordinate ! */ ! public double getMinY() { ! return getY(); } ! /** ! * Get the maximum x coordinate in the frame. This is misnamed, or else ! * Sun has a bug, because the implementation returns getX()+getWidth() even ! * when getWidth() is negative. ! * ! * @return the maximum x coordinate ! */ ! public double getMaxX() ! { ! return getX() + getWidth(); } ! /** ! * Get the maximum y coordinate in the frame. This is misnamed, or else ! * Sun has a bug, because the implementation returns getY()+getHeight() even ! * when getHeight() is negative. ! * ! * @return the maximum y coordinate ! */ ! public double getMaxY() { ! return getY() + getHeight(); } ! /** ! * Return the x coordinate of the center point of the framing rectangle. ! * ! * @return the central x coordinate ! */ ! public double getCenterX() { ! return getX() + getWidth() / 2; } ! /** ! * Return the y coordinate of the center point of the framing rectangle. ! * ! * @return the central y coordinate ! */ ! public double getCenterY() { ! return getY() + getHeight() / 2; } ! /** ! * Return the frame around this object. Note that this may be a looser ! * bounding box than getBounds2D. ! * ! * @return the frame, in double precision ! * @see #setFrame(double, double, double, double) ! */ ! public Rectangle2D getFrame() { ! return new Rectangle2D.Double(getX(), getY(), getWidth(), getHeight()); } ! /** ! * Test if the shape is empty, meaning that no points are inside it. ! * ! * @return true if the shape is empty ! */ ! public abstract boolean isEmpty(); ! /** ! * Set the framing rectangle of this shape to the given coordinate and size. ! * ! * @param x the new x coordinate ! * @param y the new y coordinate ! * @param w the new width ! * @param h the new height ! * @see #getFrame() ! */ ! public abstract void setFrame(double x, double y, double w, double h); ! ! /** ! * Set the framing rectangle of this shape to the given coordinate and size. ! * ! * @param p the new point ! * @param d the new dimension ! * @throws NullPointerException if p or d is null ! * @see #getFrame() ! */ ! public void setFrame(Point2D p, Dimension2D d) { ! setFrame(p.getX(), p.getY(), d.getWidth(), d.getHeight()); } ! /** ! * Set the framing rectangle of this shape to the given rectangle. ! * ! * @param r the new framing rectangle ! * @throws NullPointerException if r is null ! * @see #getFrame() ! */ ! public void setFrame(Rectangle2D r) { ! setFrame(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } ! /** ! * Set the framing rectangle of this shape using two points on a diagonal. ! * The area will be positive. ! * ! * @param x1 the first x coordinate ! * @param y1 the first y coordinate ! * @param x2 the second x coordinate ! * @param y2 the second y coordinate ! */ ! public void setFrameFromDiagonal(double x1, double y1, double x2, double y2) { if (x1 > x2) { *************** public abstract class RectangularShape i *** 118,323 **** y2 = y1; y1 = t; } ! setFrame (x1, y1, x2 - x1, y2 - y1); ! } ! ! public void setFrameFromDiagonal (Point2D p1, Point2D p2) ! { ! setFrameFromDiagonal (p1.getX (), p1.getY (), ! p2.getX (), p2.getY ()); } ! public void setFrameFromCenter (double centerX, double centerY, ! double cornerX, double cornerY) { ! double halfw = Math.abs (cornerX - centerX); ! double halfh = Math.abs (cornerY - centerY); ! setFrame (centerX - halfw, centerY - halfh, ! 2 * halfw, 2 * halfh); } ! public void setFrameFromCenter (Point2D center, Point2D corner) { ! setFrameFromCenter (center.getX (), center.getY (), ! corner.getX (), corner.getY ()); } ! public boolean contains (Point2D p) { ! double x = p.getX (); ! double y = p.getY (); ! double rx = getX (); ! double ry = getY (); ! double w = getWidth (); ! double h = getHeight (); ! return x >= rx && x < rx + w && y >= ry && y < ry + h; } ! public boolean intersects (Rectangle2D r) { ! double x = getX (); ! double w = getWidth (); ! double mx = r.getX (); ! double mw = r.getWidth (); ! if (x < mx || x >= mx + mw || x + w < mx || x + w >= mx + mw) ! return false; ! double y = getY (); ! double h = getHeight (); ! double my = r.getY (); ! double mh = r.getHeight (); ! return y >= my && y < my + mh && y + h >= my && y + h < my + mh; } ! private boolean containsPoint (double x, double y) { ! double mx = getX (); ! double mw = getWidth (); ! if (x < mx || x >= mx + mw) ! return false; ! double my = getY (); ! double mh = getHeight (); ! return y >= my && y < my + mh; } ! public boolean contains (Rectangle2D r) { ! return (containsPoint (r.getMinX (), r.getMinY ()) ! && containsPoint (r.getMaxX (), r.getMaxY ())); } ! public Rectangle getBounds () { ! return new Rectangle ((int) getX (), (int) getY (), ! (int) getWidth (), (int) getHeight ()); } ! public PathIterator getPathIterator (AffineTransform at, double flatness) { ! return at.new Iterator (new Iterator ()); } ! public Object clone () { try ! { ! return super.clone (); ! } ! catch (CloneNotSupportedException _) {return null;} ! } ! ! // This implements the PathIterator for all RectangularShape objects ! // that don't override getPathIterator. ! private class Iterator implements PathIterator ! { ! // Our current coordinate. ! private int coord; ! ! private static final int START = 0; ! private static final int END_PLUS_ONE = 5; ! ! public Iterator () ! { ! coord = START; ! } ! ! public int currentSegment (double[] coords) ! { ! int r; ! switch (coord) ! { ! case 0: ! coords[0] = getX (); ! coords[1] = getY (); ! r = SEG_MOVETO; ! break; ! ! case 1: ! coords[0] = getX () + getWidth (); ! coords[1] = getY (); ! r = SEG_LINETO; ! break; ! ! case 2: ! coords[0] = getX () + getWidth (); ! coords[1] = getY () + getHeight (); ! r = SEG_LINETO; ! break; ! ! case 3: ! coords[0] = getX (); ! coords[1] = getY () + getHeight (); ! r = SEG_LINETO; ! break; ! ! case 4: ! r = SEG_CLOSE; ! break; ! ! default: ! // It isn't clear what to do if the caller calls us after ! // isDone returns true. ! r = SEG_CLOSE; ! break; ! } ! ! return r; ! } ! ! public int currentSegment (float[] coords) ! { ! int r; ! switch (coord) ! { ! case 0: ! coords[0] = (float) getX (); ! coords[1] = (float) getY (); ! r = SEG_MOVETO; ! break; ! ! case 1: ! coords[0] = (float) (getX () + getWidth ()); ! coords[1] = (float) getY (); ! r = SEG_LINETO; ! break; ! ! case 2: ! coords[0] = (float) (getX () + getWidth ()); ! coords[1] = (float) (getY () + getHeight ()); ! r = SEG_LINETO; ! break; ! ! case 3: ! coords[0] = (float) getX (); ! coords[1] = (float) (getY () + getHeight ()); ! r = SEG_LINETO; ! break; ! ! case 4: ! default: ! // It isn't clear what to do if the caller calls us after ! // isDone returns true. We elect to keep returning ! // SEG_CLOSE. ! r = SEG_CLOSE; ! break; ! } ! ! return r; ! } ! ! public int getWindingRule () ! { ! return WIND_NON_ZERO; ! } ! ! public boolean isDone () ! { ! return coord == END_PLUS_ONE; ! } ! ! public void next () ! { ! if (coord < END_PLUS_ONE) ! ++coord; ! } } ! } --- 238,385 ---- y2 = y1; y1 = t; } ! setFrame(x1, y1, x2 - x1, y2 - y1); } ! /** ! * Set the framing rectangle of this shape using two points on a diagonal. ! * The area will be positive. ! * ! * @param p1 the first point ! * @param p2 the second point ! * @throws NullPointerException if either point is null ! */ ! public void setFrameFromDiagonal(Point2D p1, Point2D p2) { ! setFrameFromDiagonal(p1.getX(), p1.getY(), p2.getX(), p2.getY()); } ! /** ! * Set the framing rectangle of this shape using the center of the frame, ! * and one of the four corners. The area will be positive. ! * ! * @param centerX the x coordinate at the center ! * @param centerY the y coordinate at the center ! * @param cornerX the x coordinate at a corner ! * @param cornerY the y coordinate at a corner ! */ ! public void setFrameFromCenter(double centerX, double centerY, ! double cornerX, double cornerY) { ! double halfw = Math.abs(cornerX - centerX); ! double halfh = Math.abs(cornerY - centerY); ! setFrame(centerX - halfw, centerY - halfh, halfw + halfw, halfh + halfh); } ! /** ! * Set the framing rectangle of this shape using the center of the frame, ! * and one of the four corners. The area will be positive. ! * ! * @param center the center point ! * @param corner a corner point ! * @throws NullPointerException if either point is null ! */ ! public void setFrameFromCenter(Point2D center, Point2D corner) { ! setFrameFromCenter(center.getX(), center.getY(), ! corner.getX(), corner.getY()); } ! /** ! * Tests if a point is inside the boundary of the shape. ! * ! * @param p the point to test ! * @return true if the point is inside the shape ! * @throws NullPointerException if p is null ! * @see #contains(double, double) ! */ ! public boolean contains(Point2D p) { ! return contains(p.getX(), p.getY()); } ! /** ! * Tests if a rectangle and this shape share common internal points. ! * ! * @param r the rectangle to test ! * @return true if the rectangle intersects this shpae ! * @throws NullPointerException if r is null ! * @see #intersects(double, double, double, double) ! */ ! public boolean intersects(Rectangle2D r) { ! return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } ! /** ! * Tests if the shape completely contains the given rectangle. ! * ! * @param r the rectangle to test ! * @return true if r is contained in this shape ! * @throws NullPointerException if r is null ! * @see #contains(double, double, double, double) ! */ ! public boolean contains(Rectangle2D r) { ! return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } ! /** ! * Returns a bounding box for this shape, in integer format. Notice that you ! * may get a tighter bound with getBounds2D. If the frame is empty, the ! * box is the default empty box at the origin. ! * ! * @return a bounding box ! */ ! public Rectangle getBounds() { ! if (isEmpty()) ! return new Rectangle(); ! double x = getX(); ! double y = getY(); ! double maxx = Math.ceil(x + getWidth()); ! double maxy = Math.ceil(y + getHeight()); ! x = Math.floor(x); ! y = Math.floor(y); ! return new Rectangle((int) x, (int) y, (int) (maxx - x), (int) (maxy - y)); } ! /** ! * Return an iterator along the shape boundary. If the optional transform ! * is provided, the iterator is transformed accordingly. The path is ! * flattened until all segments differ from the curve by at most the value ! * of the flatness parameter, within the limits of the default interpolation ! * recursion limit of 1024 segments between actual points. Each call ! * returns a new object, independent from others in use. The result is ! * threadsafe if and only if the iterator returned by ! * {@link #getPathIterator(AffineTransform)} is as well. ! * ! * @param transform an optional transform to apply to the iterator ! * @param flatness the desired flatness ! * @return a new iterator over the boundary ! * @throws IllegalArgumentException if flatness is invalid ! * @since 1.2 ! */ ! public PathIterator getPathIterator(AffineTransform at, double flatness) { ! return new FlatteningPathIterator(getPathIterator(at), flatness); } ! /** ! * Create a new shape of the same run-time type with the same contents as ! * this one. ! * ! * @return the clone ! */ ! public Object clone() { try ! { ! return super.clone(); ! } ! catch (CloneNotSupportedException e) ! { ! throw (Error) new InternalError().initCause(e); // Impossible ! } } ! } // class RectangularShape diff -Nrc3pad gcc-3.2.3/libjava/java/awt/geom/RoundRectangle2D.java gcc-3.3/libjava/java/awt/geom/RoundRectangle2D.java *** gcc-3.2.3/libjava/java/awt/geom/RoundRectangle2D.java 2002-01-22 22:40:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/geom/RoundRectangle2D.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* RoundRectangle2D.java -- represents a rectangle with rounded corners ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** package java.awt.geom; *** 43,52 **** public abstract class RoundRectangle2D extends RectangularShape { /** Return the arc height of this round rectangle. */ ! public abstract double getArcHeight (); /** Return the arc width of this round rectangle. */ ! public abstract double getArcWidth (); /** Set the values of this round rectangle * @param x The x coordinate --- 44,53 ---- public abstract class RoundRectangle2D extends RectangularShape { /** Return the arc height of this round rectangle. */ ! public abstract double getArcHeight(); /** Return the arc width of this round rectangle. */ ! public abstract double getArcWidth(); /** Set the values of this round rectangle * @param x The x coordinate *************** public abstract class RoundRectangle2D e *** 56,68 **** * @param arcWidth The arc width * @param arcHeight The arc height */ ! public abstract void setRoundRect (double x, double y, double w, double h, ! double arcWidth, double arcHeight); /** Create a RoundRectangle2D. This is protected because this class * is abstract and cannot be instantiated. */ ! protected RoundRectangle2D () { } --- 57,69 ---- * @param arcWidth The arc width * @param arcHeight The arc height */ ! public abstract void setRoundRect(double x, double y, double w, double h, ! double arcWidth, double arcHeight); /** Create a RoundRectangle2D. This is protected because this class * is abstract and cannot be instantiated. */ ! protected RoundRectangle2D() { } *************** public abstract class RoundRectangle2D e *** 70,91 **** * @param x The x coordinate * @param y The y coordinate */ ! public boolean contains (double x, double y) { ! double mx = getX (); ! double mw = getWidth (); if (x < mx || x >= mx + mw) return false; ! double my = getY (); ! double mh = getHeight (); if (y < my || y >= my + mh) return false; // Now check to see if the point is in range of an arc. ! double dy = Math.min (Math.abs (my - y), Math.abs (my + mh - y)); ! double dx = Math.min (Math.abs (mx - x), Math.abs (mx + mw - x)); ! double aw = getArcWidth (); ! double ah = getArcHeight (); if (dx > aw || dy > ah) return true; --- 71,92 ---- * @param x The x coordinate * @param y The y coordinate */ ! public boolean contains(double x, double y) { ! double mx = getX(); ! double mw = getWidth(); if (x < mx || x >= mx + mw) return false; ! double my = getY(); ! double mh = getHeight(); if (y < my || y >= my + mh) return false; // Now check to see if the point is in range of an arc. ! double dy = Math.min(Math.abs(my - y), Math.abs(my + mh - y)); ! double dx = Math.min(Math.abs(mx - x), Math.abs(mx + mw - x)); ! double aw = getArcWidth(); ! double ah = getArcHeight(); if (dx > aw || dy > ah) return true; *************** public abstract class RoundRectangle2D e *** 105,122 **** * @param w The width * @param h The height */ ! public boolean contains (double x, double y, double w, double h) { // We have to check all four points here (for ordinary rectangles // we can just check opposing corners). ! return (contains (x, y) && contains (x + w, h) ! && contains (x, y + h) && contains (x + w, y + h)); } /** Return a new path iterator which iterates over this rectangle. * @param at An affine transform to apply to the object */ ! public PathIterator getPathIterator (AffineTransform at) { // FIXME. return null; --- 106,123 ---- * @param w The width * @param h The height */ ! public boolean contains(double x, double y, double w, double h) { // We have to check all four points here (for ordinary rectangles // we can just check opposing corners). ! return (contains(x, y) && contains(x + w, h) ! && contains(x, y + h) && contains(x + w, y + h)); } /** Return a new path iterator which iterates over this rectangle. * @param at An affine transform to apply to the object */ ! public PathIterator getPathIterator(AffineTransform at) { // FIXME. return null; *************** public abstract class RoundRectangle2D e *** 128,142 **** * @param w The width * @param h The height */ ! public boolean intersects (double x, double y, double w, double h) { // Here we can use the same code we use for an ordinary rectangle. ! double mx = getX (); ! double mw = getWidth (); if (x < mx || x >= mx + mw || x + w < mx || x + w >= mx + mw) return false; ! double my = getY (); ! double mh = getHeight (); return y >= my && y < my + mh && y + h >= my && y + h < my + mh; } --- 129,143 ---- * @param w The width * @param h The height */ ! public boolean intersects(double x, double y, double w, double h) { // Here we can use the same code we use for an ordinary rectangle. ! double mx = getX(); ! double mw = getWidth(); if (x < mx || x >= mx + mw || x + w < mx || x + w >= mx + mw) return false; ! double my = getY(); ! double mh = getHeight(); return y >= my && y < my + mh && y + h >= my && y + h < my + mh; } *************** public abstract class RoundRectangle2D e *** 146,193 **** * @param w The width * @param h The height */ ! public void setFrame (double x, double y, double w, double h) { // This is a bit lame. ! setRoundRect (x, y, w, h, getArcWidth (), getArcHeight ()); } /** Set the values of this round rectangle to be the same as those * of the argument. * @param rr The round rectangle to copy */ ! public void setRoundRect (RoundRectangle2D rr) { ! setRoundRect (rr.getX (), rr.getY (), rr.getWidth (), rr.getHeight (), ! rr.getArcWidth (), rr.getArcHeight ()); } /** A subclass of RoundRectangle which keeps its parameters as ! * floats. */ ! public static class Float extends RoundRectangle2D { /** The height of the corner arc. */ ! public float archeight; /** The width of the corner arc. */ ! public float arcwidth; /** The x coordinate of this object. */ ! public float x; /** The y coordinate of this object. */ ! public float y; /** The width of this object. */ ! public float width; /** The height of this object. */ ! public float height; /** Construct a new instance, with all parameters set to 0. */ ! public Float () { - this (0, 0, 0, 0, 0, 0); } /** Construct a new instance with the given arguments. --- 147,193 ---- * @param w The width * @param h The height */ ! public void setFrame(double x, double y, double w, double h) { // This is a bit lame. ! setRoundRect(x, y, w, h, getArcWidth(), getArcHeight()); } /** Set the values of this round rectangle to be the same as those * of the argument. * @param rr The round rectangle to copy */ ! public void setRoundRect(RoundRectangle2D rr) { ! setRoundRect(rr.getX(), rr.getY(), rr.getWidth(), rr.getHeight(), ! rr.getArcWidth(), rr.getArcHeight()); } /** A subclass of RoundRectangle which keeps its parameters as ! * doubles. */ ! public static class Double extends RoundRectangle2D { /** The height of the corner arc. */ ! public double archeight; /** The width of the corner arc. */ ! public double arcwidth; /** The x coordinate of this object. */ ! public double x; /** The y coordinate of this object. */ ! public double y; /** The width of this object. */ ! public double width; /** The height of this object. */ ! public double height; /** Construct a new instance, with all parameters set to 0. */ ! public Double() { } /** Construct a new instance with the given arguments. *************** public abstract class RoundRectangle2D e *** 198,205 **** * @param arcWidth The arc width * @param arcHeight The arc height */ ! public Float (float x, float y, float w, float h, ! float arcWidth, float arcHeight) { this.x = x; this.y = y; --- 198,205 ---- * @param arcWidth The arc width * @param arcHeight The arc height */ ! public Double(double x, double y, double w, double h, ! double arcWidth, double arcHeight) { this.x = x; this.y = y; *************** public abstract class RoundRectangle2D e *** 209,256 **** this.archeight = arcHeight; } ! public double getArcHeight () { return archeight; } ! public double getArcWidth () { return arcwidth; } ! public Rectangle2D getBounds2D () { ! return new Rectangle2D.Float (x, y, width, height); } ! public double getX () { return x; } ! public double getY () { return y; } ! public double getWidth () { return width; } ! public double getHeight () { return height; } ! public boolean isEmpty () { return width <= 0 || height <= 0; } ! public void setRoundRect (float x, float y, float w, float h, ! float arcWidth, float arcHeight) { this.x = x; this.y = y; --- 209,256 ---- this.archeight = arcHeight; } ! public double getArcHeight() { return archeight; } ! public double getArcWidth() { return arcwidth; } ! public Rectangle2D getBounds2D() { ! return new Rectangle2D.Double(x, y, width, height); } ! public double getX() { return x; } ! public double getY() { return y; } ! public double getWidth() { return width; } ! public double getHeight() { return height; } ! public boolean isEmpty() { return width <= 0 || height <= 0; } ! public void setRoundRect(double x, double y, double w, double h, ! double arcWidth, double arcHeight) { this.x = x; this.y = y; *************** public abstract class RoundRectangle2D e *** 259,303 **** this.arcwidth = arcWidth; this.archeight = arcHeight; } ! ! public void setRoundRect (double x, double y, double w, double h, ! double arcWidth, double arcHeight) ! { ! this.x = (float) x; ! this.y = (float) y; ! this.width = (float) w; ! this.height = (float) h; ! this.arcwidth = (float) arcWidth; ! this.archeight = (float) arcHeight; ! } ! } /** A subclass of RoundRectangle which keeps its parameters as ! * doubles. */ ! public static class Double extends RoundRectangle2D { /** The height of the corner arc. */ ! public double archeight; /** The width of the corner arc. */ ! public double arcwidth; /** The x coordinate of this object. */ ! public double x; /** The y coordinate of this object. */ ! public double y; /** The width of this object. */ ! public double width; /** The height of this object. */ ! public double height; /** Construct a new instance, with all parameters set to 0. */ ! public Double () { - this (0, 0, 0, 0, 0, 0); } /** Construct a new instance with the given arguments. --- 259,291 ---- this.arcwidth = arcWidth; this.archeight = arcHeight; } ! } // class Double /** A subclass of RoundRectangle which keeps its parameters as ! * floats. */ ! public static class Float extends RoundRectangle2D { /** The height of the corner arc. */ ! public float archeight; /** The width of the corner arc. */ ! public float arcwidth; /** The x coordinate of this object. */ ! public float x; /** The y coordinate of this object. */ ! public float y; /** The width of this object. */ ! public float width; /** The height of this object. */ ! public float height; /** Construct a new instance, with all parameters set to 0. */ ! public Float() { } /** Construct a new instance with the given arguments. *************** public abstract class RoundRectangle2D e *** 308,315 **** * @param arcWidth The arc width * @param arcHeight The arc height */ ! public Double (double x, double y, double w, double h, ! double arcWidth, double arcHeight) { this.x = x; this.y = y; --- 296,303 ---- * @param arcWidth The arc width * @param arcHeight The arc height */ ! public Float(float x, float y, float w, float h, ! float arcWidth, float arcHeight) { this.x = x; this.y = y; *************** public abstract class RoundRectangle2D e *** 319,366 **** this.archeight = arcHeight; } ! public double getArcHeight () { return archeight; } ! public double getArcWidth () { return arcwidth; } ! public Rectangle2D getBounds2D () { ! return new Rectangle2D.Double (x, y, width, height); } ! public double getX () { return x; } ! public double getY () { return y; } ! public double getWidth () { return width; } ! public double getHeight () { return height; } ! public boolean isEmpty () { return width <= 0 || height <= 0; } ! public void setRoundRect (double x, double y, double w, double h, ! double arcWidth, double arcHeight) { this.x = x; this.y = y; --- 307,354 ---- this.archeight = arcHeight; } ! public double getArcHeight() { return archeight; } ! public double getArcWidth() { return arcwidth; } ! public Rectangle2D getBounds2D() { ! return new Rectangle2D.Float(x, y, width, height); } ! public double getX() { return x; } ! public double getY() { return y; } ! public double getWidth() { return width; } ! public double getHeight() { return height; } ! public boolean isEmpty() { return width <= 0 || height <= 0; } ! public void setRoundRect(float x, float y, float w, float h, ! float arcWidth, float arcHeight) { this.x = x; this.y = y; *************** public abstract class RoundRectangle2D e *** 369,373 **** this.arcwidth = arcWidth; this.archeight = arcHeight; } ! } ! } --- 357,372 ---- this.arcwidth = arcWidth; this.archeight = arcHeight; } ! ! public void setRoundRect(double x, double y, double w, double h, ! double arcWidth, double arcHeight) ! { ! this.x = (float) x; ! this.y = (float) y; ! this.width = (float) w; ! this.height = (float) h; ! this.arcwidth = (float) arcWidth; ! this.archeight = (float) arcHeight; ! } ! } // class Float ! } // class RoundRectangle2D diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GradientPaint.java gcc-3.3/libjava/java/awt/GradientPaint.java *** gcc-3.2.3/libjava/java/awt/GradientPaint.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/GradientPaint.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,129 ---- + /* GradientPaint.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.geom.AffineTransform; + import java.awt.geom.Point2D; + import java.awt.geom.Rectangle2D; + import java.awt.image.ColorModel; + + /** + * STUB CLASS ONLY + */ + public class GradientPaint implements Paint + { + private final float x1; + private final float y1; + private final Color c1; + private final float x2; + private final float y2; + private final Color c2; + private final boolean cyclic; + + public GradientPaint(float x1, float y1, Color c1, + float x2, float y2, Color c2) + { + this(x1, y1, c1, x2, y2, c2, false); + } + + public GradientPaint(Point2D p1, Color c1, Point2D p2, Color c2) + { + this((float) p1.getX(), (float) p1.getY(), c1, + (float) p2.getX(), (float) p2.getY(), c2, false); + } + + public GradientPaint(float x1, float y1, Color c1, + float x2, float y2, Color c2, boolean cyclic) + { + if (c1 == null || c2 == null) + throw new NullPointerException(); + this.x1 = x1; + this.y1 = y1; + this.c1 = c1; + this.x2 = x2; + this.y2 = y2; + this.c2 = c2; + this.cyclic = cyclic; + } + + public GradientPaint(Point2D p1, Color c1, Point2D p2, Color c2, + boolean cyclic) + { + this((float) p1.getX(), (float) p1.getY(), c1, + (float) p2.getX(), (float) p2.getY(), c2, cyclic); + } + + public Point2D getPoint1() + { + return new Point2D.Float(x1, y1); + } + + public Color getColor1() + { + return c1; + } + + public Point2D getPoint2() + { + return new Point2D.Float(x2, y2); + } + + public Color getColor2() + { + return c2; + } + + public boolean isCyclic() + { + return cyclic; + } + + public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, + Rectangle2D userBounds, + AffineTransform xform, + RenderingHints hints) + { + throw new Error("not implemented"); + } + + public int getTransparency() + { + throw new Error("not implemented"); + } + } // class GradientPaint diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Graphics2D.java gcc-3.3/libjava/java/awt/Graphics2D.java *** gcc-3.2.3/libjava/java/awt/Graphics2D.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/Graphics2D.java 2003-01-02 00:14:04.000000000 +0000 *************** exception statement from your version. * *** 37,45 **** package java.awt; import java.awt.geom.AffineTransform; import java.awt.image.ImageObserver; ! //import java.util.Map; /** * @author Rolf W. Rasmussen --- 37,51 ---- package java.awt; import java.awt.geom.AffineTransform; + import java.awt.image.BufferedImage; + import java.awt.image.BufferedImageOp; + import java.awt.image.RenderedImage; import java.awt.image.ImageObserver; + import java.awt.image.renderable.RenderableImage; ! import java.text.AttributedCharacterIterator; ! ! import java.util.Map; /** * @author Rolf W. Rasmussen *************** public abstract class Graphics2D extends *** 68,107 **** public abstract boolean drawImage(Image image, AffineTransform xform, ImageObserver obs); - /* public abstract void drawImage(BufferedImage image, BufferedImageOp op, int x, int y); - */ - /* public abstract void drawRenderedImage(RenderedImage image, AffineTransform xform); - */ - /* public abstract void drawRenderableImage(RenderableImage image, AffineTransform xform); - */ public abstract void drawString(String text, int x, int y); public abstract void drawString(String text, float x, float y); - /* public abstract void drawString(AttributedCharacterIterator iterator, int x, int y); - */ - /* public abstract void drawString(AttributedCharacterIterator iterator, float x, float y); - */ ! /* ! public abstract void drawGlyphVector(GlyphVector g, float x, float y); ! */ public abstract void fill(Shape shape); --- 74,101 ---- public abstract boolean drawImage(Image image, AffineTransform xform, ImageObserver obs); public abstract void drawImage(BufferedImage image, BufferedImageOp op, int x, int y); public abstract void drawRenderedImage(RenderedImage image, AffineTransform xform); public abstract void drawRenderableImage(RenderableImage image, AffineTransform xform); public abstract void drawString(String text, int x, int y); public abstract void drawString(String text, float x, float y); public abstract void drawString(AttributedCharacterIterator iterator, int x, int y); public abstract void drawString(AttributedCharacterIterator iterator, float x, float y); ! // public abstract void drawGlyphVector(GlyphVector g, float x, float y); public abstract void fill(Shape shape); *************** public abstract class Graphics2D extends *** 110,129 **** public abstract GraphicsConfiguration getDeviceConfiguration(); ! //public abstract void setComposite(Composite comp); public abstract void setPaint(Paint paint); ! //public abstract void setStroke(Stroke stroke) public abstract void setRenderingHint(RenderingHints.Key hintKey, Object hintValue); public abstract Object getRenderingHint(RenderingHints.Key hintKey); ! //public abstract void setRenderingHints(Map hints); ! //public abstract void addRenderingHints(Map hints); public abstract RenderingHints getRenderingHints(); --- 104,123 ---- public abstract GraphicsConfiguration getDeviceConfiguration(); ! public abstract void setComposite(Composite comp); public abstract void setPaint(Paint paint); ! public abstract void setStroke(Stroke stroke); public abstract void setRenderingHint(RenderingHints.Key hintKey, Object hintValue); public abstract Object getRenderingHint(RenderingHints.Key hintKey); ! public abstract void setRenderingHints(Map hints); ! public abstract void addRenderingHints(Map hints); public abstract RenderingHints getRenderingHints(); *************** public abstract class Graphics2D extends *** 147,161 **** public abstract Paint getPaint(); ! //public abstract Composite getComposite(); public abstract void setBackground(Color color); public abstract Color getBackground(); ! //public abstract Stroke getStroke(); public abstract void clip(Shape s); ! //public abstract FontRenderContext getFontRenderContext() } --- 141,155 ---- public abstract Paint getPaint(); ! public abstract Composite getComposite(); public abstract void setBackground(Color color); public abstract Color getBackground(); ! public abstract Stroke getStroke(); public abstract void clip(Shape s); ! // public abstract FontRenderContext getFontRenderContext(); } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GraphicsConfigTemplate.java gcc-3.3/libjava/java/awt/GraphicsConfigTemplate.java *** gcc-3.2.3/libjava/java/awt/GraphicsConfigTemplate.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/GraphicsConfigTemplate.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,106 ---- + /* GraphicsConfigTemplate.java -- a template for selecting configurations + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.io.Serializable; + + /** + * This allows filtering an array of GraphicsConfigurations for the best + * one based on various requirements. The resulting configuration has had + * all non-default attributes set as required to meet or exceed the request. + * + * @author Eric Blake + * @see GraphicsConfiguration + * @see GraphicsDevice + * @since 1.2 + * @status updated to 1.4 + */ + public abstract class GraphicsConfigTemplate implements Serializable + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -8061369279557787079L; + + /** States that a feature is required to select a configuration. */ + public static final int REQUIRED = 1; + + /** + * States that a feature is preferred, but not required, to select a + * configuration. In the case of multiple valid configurations, the tie + * breaks in favor of the one with the feature. + */ + public static final int PREFERRED = 2; + + /** + * States that a feature is not necessary in the configuration. In the case + * of multiple valid configurations, the tie breaks in favor of the one + * without the feature, to reduce overhead. + */ + public static final int UNNECESSARY = 3; + + /** + * The default constructor. + */ + public GraphicsConfigTemplate() + { + } + + /** + * Returns the "best" match among the array of possible configurations, given + * the criteria of this template. + * + * @param array the array to choose from + * @return the best match + * @throws NullPointerException if array is null + */ + public abstract GraphicsConfiguration getBestConfiguration + (GraphicsConfiguration[] array); + + /** + * Returns true if the given configuration supports all the features required + * by this template. + * + * @param config the configuration to test + * @return true if it is a match + * @throws NullPointerException if config is null + */ + public abstract boolean isGraphicsConfigSupported + (GraphicsConfiguration config); + } // class GraphicsConfigTemplate diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GraphicsConfiguration.java gcc-3.3/libjava/java/awt/GraphicsConfiguration.java *** gcc-3.2.3/libjava/java/awt/GraphicsConfiguration.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/GraphicsConfiguration.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* GraphicsConfiguration.java -- describes characteristics of graphics ! Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,68 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - /* Status: Complete, but commented out until we have the required - GraphicsDevice. */ package java.awt; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; ! import java.awt.geom.AffineTransform; public abstract class GraphicsConfiguration { ! // Can't instantiate directly. Having a protected constructor seems ! // redundant, but that is what the docs specify. protected GraphicsConfiguration () { } ! /* public abstract GraphicsDevice getDevice(); - */ ! public abstract BufferedImage createCompatibleImage(int width, int height); ! public abstract BufferedImage createCompatibleImage(int width, int height, int transparency); public abstract ColorModel getColorModel(); public abstract ColorModel getColorModel(int transparency); public abstract AffineTransform getDefaultTransform(); public abstract AffineTransform getNormalizingTransform(); ! /* @since 1.3 */ public abstract Rectangle getBounds(); ! } --- 35,218 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt; + import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; ! import java.awt.image.VolatileImage; + /** + * This class describes the configuration of various graphics devices, such + * as a monitor or printer. Different configurations may exist for the same + * device, according to the different native modes supported. + * + *

        Virtual devices are supported (for example, in a multiple screen + * environment, a virtual device covers all screens simultaneously); the + * configuration will have a non-zero relative coordinate system in such + * a case. + * + * @author Eric Blake + * @see Window + * @see Frame + * @see GraphicsEnvironment + * @see GraphicsDevice + * @since 1.0 + * @status updated to 1.4 + */ public abstract class GraphicsConfiguration { ! /** ! * The default constructor. ! * ! * @see GraphicsDevice#getConfigurations() ! * @see GraphicsDevice#getDefaultConfiguration() ! * @see GraphicsDevice#getBestConfiguration(GraphicsConfigTemplate) ! * @see Graphics2D#getDeviceConfiguration() ! */ protected GraphicsConfiguration () { } ! /** ! * Gets the associated device that this configuration describes. ! * ! * @return the device ! */ public abstract GraphicsDevice getDevice(); ! /** ! * Returns a buffered image optimized to this device, so that blitting can ! * be supported in the buffered image. ! * ! * @param w the width of the buffer ! * @param h the height of the buffer ! * @return the buffered image, or null if none is supported ! */ ! public abstract BufferedImage createCompatibleImage(int w, int h); ! ! /** ! * Returns a buffered volatile image optimized to this device, so that ! * blitting can be supported in the buffered image. Because the buffer is ! * volatile, it can be optimized by native graphics accelerators. ! * ! * @param w the width of the buffer ! * @param h the height of the buffer ! * @return the buffered image, or null if none is supported ! * @see Component#createVolatileImage(int, int) ! * @since 1.4 ! */ ! public abstract VolatileImage createCompatibleVolatileImage(int w, int h); ! ! /** ! * Returns a buffered volatile image optimized to this device, and with the ! * given capabilities, so that blitting can be supported in the buffered ! * image. Because the buffer is volatile, it can be optimized by native ! * graphics accelerators. ! * ! * @param w the width of the buffer ! * @param h the height of the buffer ! * @param caps the desired capabilities of the image buffer ! * @return the buffered image, or null if none is supported ! * @throws AWTException if the capabilities cannot be met ! * @since 1.4 ! */ ! public VolatileImage createCompatibleVolatileImage(int w, int h, ! ImageCapabilities caps) ! throws AWTException ! { ! throw new AWTException("not implemented"); ! } ! ! /** ! * Returns a buffered image optimized to this device, and with the specified ! * transparency, so that blitting can be supported in the buffered image. ! * ! * @param w the width of the buffer ! * @param h the height of the buffer ! * @param transparency the transparency of the buffer ! * @return the buffered image, or null if none is supported ! * @see Transparency#OPAQUE ! * @see Transparency#BITMASK ! * @see Transparency#TRANSLUCENT ! */ ! public abstract BufferedImage createCompatibleImage(int w, int h, int transparency); + + /** + * Gets the color model of the corresponding device. + * + * @return the color model + */ public abstract ColorModel getColorModel(); + + /** + * Gets a color model for the corresponding device which supports the desired + * transparency level. + * + * @param transparency the transparency of the model + * @return the color model, with transparency + * @see Transparency#OPAQUE + * @see Transparency#BITMASK + * @see Transparency#TRANSLUCENT + */ public abstract ColorModel getColorModel(int transparency); + + /** + * Returns a transform that maps user coordinates to device coordinates. The + * preferred mapping is about 72 user units to 1 inch (2.54 cm) of physical + * space. This is often the identity transform. The device coordinates have + * the origin at the upper left, with increasing x to the right, and + * increasing y to the bottom. + * + * @return the transformation from user space to device space + * @see #getNormalizingTransform() + */ public abstract AffineTransform getDefaultTransform(); + + /** + * Returns a transform that maps user coordinates to device coordinates. The + * exact mapping is 72 user units to 1 inch (2.54 cm) of physical space. + * This is often the identity transform. The device coordinates have the + * origin at the upper left, with increasing x to the right, and increasing + * y to the bottom. Note that this is more accurate (and thus, sometimes more + * costly) than the default transform. + * + * @return the normalized transformation from user space to device space + * @see #getDefaultTransform() + */ public abstract AffineTransform getNormalizingTransform(); ! /** ! * Returns the bounds of the configuration, in device coordinates. If this ! * is a virtual device (for example, encompassing several screens), the ! * bounds may have a non-zero origin. ! * ! * @return the device bounds ! * @since 1.3 ! */ public abstract Rectangle getBounds(); ! ! /** ! * Returns the buffering capabilities of this configuration. ! * ! * @return the buffer capabilities ! * @since 1.4 ! */ ! public BufferCapabilities getBufferCapabilities() ! { ! throw new Error("not implemented"); ! } ! ! /** ! * Returns the imaging capabilities of this configuration. ! * ! * @return the image capabilities ! * @since 1.4 ! */ ! public ImageCapabilities getImageCapabilities() ! { ! throw new Error("not implemented"); ! } ! } // class GraphicsConfiguration diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GraphicsDevice.java gcc-3.3/libjava/java/awt/GraphicsDevice.java *** gcc-3.2.3/libjava/java/awt/GraphicsDevice.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/GraphicsDevice.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,271 ---- + /* GraphicsDevice.java -- information about a graphics device + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * This describes a graphics device available to the given environment. This + * includes screen and printer devices, and the different configurations for + * each device. Also, this allows you to create virtual devices which operate + * over a multi-screen environment. + * + * @author Eric Blake + * @see GraphicsEnvironment + * @see GraphicsConfiguration + * @since 1.3 + * @status updated to 1.4 + */ + public abstract class GraphicsDevice + { + /** Device is a raster screen. */ + public static final int TYPE_RASTER_SCREEN = 0; + + /** Device is a printer. */ + public static final int TYPE_PRINTER = 1; + + /** Device is an image buffer not visible to the user. */ + public static final int TYPE_IMAGE_BUFFER = 2; + + /** The current full-screen window, or null if there is none. */ + private Window full_screen; + + /** The current display mode, or null if unknown. */ + private DisplayMode mode; + + /** + * The default constructor. + * + * @see GraphicsEnvironment#getScreenDevices() + * @see GraphicsEnvironment#getDefaultScreenDevice() + * @see GraphicsConfiguration#getDevice() + */ + protected GraphicsDevice() + { + } + + /** + * Returns the type of the device. + * + * @return the device type + * @see #TYPE_RASTER_SCREEN + * @see #TYPE_PRINTER + * @see #TYPE_IMAGE_BUFFER + */ + public abstract int getType(); + + /** + * Returns an identification string for the device. This can be + * vendor-specific, and may be useful for debugging. + * + * @return the identification + */ + public abstract String getIDstring(); + + /** + * Return all configurations valid for this device. + * + * @return an array of configurations + */ + public abstract GraphicsConfiguration[] getConfigurations(); + + /** + * Return the default configuration for this device. + * + * @return the default configuration + */ + public abstract GraphicsConfiguration getDefaultConfiguration(); + + /** + * Return the best configuration, according to the criteria in the given + * template. + * + * @param template the template to adjust by + * @return the best configuration + * @throws NullPointerException if template is null + */ + public GraphicsConfiguration getBestConfiguration + (GraphicsConfigTemplate template) + { + return template.getBestConfiguration(getConfigurations()); + } + + /** + * Returns true if the device supports full-screen exclusive mode. The + * default implementation returns true; subclass it if this is not the case. + * + * @return true if full screen support is available + * @since 1.4 + */ + public boolean isFullScreenSupported() + { + return true; + } + + /** + * Toggle the given window between full screen and normal mode. The previous + * full-screen window, if different, is restored; if the given window is + * null, no window will be full screen. If + * isFullScreenSupported() returns true, full screen mode is + * considered to be exclusive, which implies:

          + *
        • Windows cannot overlap the full-screen window. All other application + * windows will always appear beneath the full-screen window in the + * Z-order.
        • + *
        • Input method windows are disabled. It is advisable to call + * Component.enableInputMethods(false) to make a component + * a non-client of the input method framework.
        • + *

        + * If isFullScreenSupported() returns false, full-screen + * exclusive mode is simulated by resizing the window to the size of the + * screen and positioning it at (0,0). + * + * XXX Not yet implemented in Classpath. + * + * @param w the window to toggle + * @see #isFullScreenSupported() + * @see getFullScreenWindow() + * @see setDisplayMode(DisplayMode) + * @see Component#enableInputMethods(boolean) + * @since 1.4 + */ + public synchronized void setFullScreenWindow(Window w) + { + if (full_screen != null) + ; // XXX Restore the previous window to normal mode. + full_screen = w; + // XXX If w != null, make it full-screen. + throw new Error("not implemented"); + } + + /** + * Returns the current full-screen window of the device, or null if no + * window is full-screen. + * + * @return the full-screen window + * @see #setFullScreenWindow(Window) + * @since 1.4 + */ + public Window getFullScreenWindow() + { + return full_screen; + } + + /** + * Returns whether this device supports low-level display changes. This may + * depend on whether full-screen exclusive mode is available. + * + * XXX The default implementation returns false for now. + * + * @return true if display changes are supported + * @see #setDisplayMode(DisplayMode) + * @since 1.4 + */ + public boolean isDisplayChangeSupported() + { + return false; + } + + /** + * Sets the display mode. This may be dependent on the availability of + * full-screen exclusive mode. + * + * @param mode the new mode + * @throws IllegalArgumentException if the new mode is not in getDisplayModes + * @throws UnsupportedOperationException if ! isDisplayChangeSupported() + * @see #getDisplayMode() + * @see #getDisplayModes() + * @see #isDisplayChangeSupported() + * @since 1.4 + */ + public void setDisplayMode(DisplayMode mode) + { + DisplayMode[] array = getDisplayModes(); + if (! isDisplayChangeSupported()) + throw new UnsupportedOperationException(); + int i = array == null ? 0 : array.length; + while (--i >= 0) + if (array[i].equals(mode)) + break; + if (i < 0) + throw new IllegalArgumentException(); + this.mode = mode; + } + + /** + * Returns the current display mode of this device, or null if unknown. + * + * @return the current display mode + * @see #setDisplayMode(DisplayMode) + * @see #getDisplayModes() + * @since 1.4 + */ + public DisplayMode getDisplayMode() + { + return mode; + } + + /** + * Return an array of all available display modes. This implementation + * returns a 0-length array, so subclasses must override this. + * + * @return the array of available modes + * @since 1.4 + */ + public DisplayMode[] getDisplayModes() + { + return new DisplayMode[0]; + } + + /** + * Return the number of bytes available in accelerated memory on this + * device. The device may support creation or caching on a first-come, + * first-served basis, depending on the operating system and driver. + * Memory may be a finite resource, and because of multi-threading, you + * are not guaranteed that the result of this method ensures your image + * will successfully be put in accelerated memory. A negative result means + * the memory is unlimited. The default implementation assumes no special + * memory is available, and returns 0. + * + * @return the size of accelerated memory available + * @see VolatileImage#flush() + * @see ImageCapabilities#isAccelerated() + */ + public int getAvailableAcceleratedMemory() + { + return 0; + } + } // class GraphicsDevice diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GraphicsEnvironment.java gcc-3.3/libjava/java/awt/GraphicsEnvironment.java *** gcc-3.2.3/libjava/java/awt/GraphicsEnvironment.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/GraphicsEnvironment.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,210 ---- + /* GraphicsEnvironment.java -- information about the graphics environment + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.image.BufferedImage; + import java.util.Locale; + + /** + * This descibes the collection of GraphicsDevice and Font objects available + * on a given platform. The resources might be local or remote, and specify + * the valid configurations for displaying graphics. + * + * @author Eric Blake + * @see GraphicsDevice + * @see GraphicsConfiguration + * @since 1.4 + * @status updated to 1.4 + */ + public abstract class GraphicsEnvironment + { + /** + * The environment must be obtained from a factory or query method, hence + * this constructor is protected. + */ + protected GraphicsEnvironment() + { + } + + /** + * Returns the local graphics environment. + * + * XXX Not implemented in Classpath yet. + * @return the local environment + */ + public static GraphicsEnvironment getLocalGraphicsEnvironment() + { + throw new Error("not implemented"); + } + + /** + * Check if the local environment is headless, meaning that it does not + * support a display, keyboard, or mouse. Many methods in the Abstract + * Windows Toolkit (java.awt) throw a {@link HeadlessException} if this + * returns true. + * + * XXX For now, Classpath assumes that it is never headless. + * + * @return true if the environment is headless, meaning that graphics are + * unsupported + * @since 1.4 + */ + public static boolean isHeadless() + { + // XXX Should be: getLocalGraphicsEnvironment().isHeadlessInstance(); + return false; + } + + /** + * Check if the given environment is headless, meaning that it does not + * support a display, keyboard, or mouse. Many methods in the Abstract + * Windows Toolkit (java.awt) throw a {@link HeadlessException} if this + * returns true. This default implementation returns false, so subclasses + * need only override it if they are headless. + * + * @return true if the environment is headless, meaning that graphics are + * unsupported + * @since 1.4 + */ + public boolean isHeadlessInstance() + { + return false; + } + + /** + * Get an array of all the GraphicsDevice objects. + * + * @return the available graphics devices, may be 0 length + * @throws HeadlessException if the environment is headless + */ + public abstract GraphicsDevice[] getScreenDevices(); + + /** + * Get the default screen GraphicsDevice object. + * + * @return the default screen device + * @throws HeadlessException if the environment is headless + */ + public abstract GraphicsDevice getDefaultScreenDevice(); + + /** + * Return a Graphics2D object which will render into the specified image. + * + * @param image the image to render into + * @return the object that renders into the image + */ + public abstract Graphics2D createGraphics(BufferedImage image); + + /** + * Returns an array of the one-point size fonts available in this + * environment. From there, the user can select the font and derive the + * correct one of proper size and attributes, using deriveFont. + * Only one master version of each font appears in this array; if a font + * can be derived from another, it must be created in that way. + * + * @return the array of available fonts + * @see #getAvailableFontFamilyNames() + * @see Font#deriveFont(int, float) + * @since 1.2 + */ + public abstract Font[] getAllFonts(); + + /** + * Returns an array of the font family names available in this environment. + * This allows flexibility in choosing the style of font, while still letting + * the Font class decide its best match. + * + * @return the array of available font families + * @see #getAllFonts() + * @see Font#getFamily() + * @since 1.2 + */ + public abstract String[] getAvailableFontFamilyNames(); + + /** + * Returns an array of the font family names available in this environment, + * localized to the current Locale if l is non-null. This allows + * flexibility in choosing the style of font, while still letting the Font + * class decide its best match. + * + * @param l the locale to use + * @return the array of available font families, localized + * @see #getAllFonts() + * @see Font#getFamily() + * @since 1.2 + */ + public abstract String[] getAvailableFontFamilyNames(Locale l); + + /** + * Returns the point where a window should be centered. You should probably + * also check that the window fits within the screen bounds. The default + * simply returns the center of the maximum window bounds; subclasses should + * override this if native objects (like scrollbars) make that off-centered. + * + * @return the centering point + * @throws HeadlessException if the environment is headless + * @see #getMaximumWindowBounds() + * @since 1.4 + */ + public Point getCenterPoint() + { + Rectangle r = getMaximumWindowBounds(); + return new Point(r.x + r.width / 2, r.y + r.height / 2); + } + + /** + * Returns the maximum bounds for a centered window object. The default + * implementation simply returns the bounds of the default configuration + * of the default screen; subclasses should override this to if native + * objects (like scrollbars) reduce what is truly available. Also, + * subclasses should override this if the window should be centered across + * a multi-screen display. + * + * @return the maximum window bounds + * @throws HeadlessException if the environment is headless + * @see #getCenterPoint() + * @see GraphicsConfiguration#getBounds() + * @see Toolkit#getScreenInsets(GraphicsConfiguration) + * @since 1.4 + */ + public Rectangle getMaximumWindowBounds() + { + return getDefaultScreenDevice().getDefaultConfiguration().getBounds(); + } + } // class GraphicsEnvironment diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GridBagConstraints.java gcc-3.3/libjava/java/awt/GridBagConstraints.java *** gcc-3.2.3/libjava/java/awt/GridBagConstraints.java 2002-01-24 01:05:10.000000000 +0000 --- gcc-3.3/libjava/java/awt/GridBagConstraints.java 2002-11-10 00:16:42.000000000 +0000 *************** import java.io.Serializable; *** 45,50 **** --- 45,52 ---- * GridBagLayout layout manager. */ public class GridBagConstraints implements Cloneable, Serializable { + static final long serialVersionUID = -1000070633030801713L; + /** Fill in both directions. */ public static final int BOTH = 1; /** Don't fill. */ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GridBagLayout.java gcc-3.3/libjava/java/awt/GridBagLayout.java *** gcc-3.2.3/libjava/java/awt/GridBagLayout.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/GridBagLayout.java 2002-11-10 00:16:42.000000000 +0000 *************** *** 0 **** --- 1,98 ---- + /* GridBagLayout - Layout manager for components according to GridBagConstraints + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt; + + import java.io.Serializable; + + /** + * Stub implementation. + */ + public class GridBagLayout + implements Serializable, LayoutManager2 + { + static final long serialVersionUID = 8838754796412211005L; + + public void addLayoutComponent(String name, Component component) + { + } + + public void removeLayoutComponent(Component component) + { + } + + public Dimension preferredLayoutSize(Container parent) + { + return null; + } + + public Dimension minimumLayoutSize(Container parent) + { + return null; + } + + public void layoutContainer(Container parent) + { + } + + public void addLayoutComponent(Component component, Object contraint) + { + } + + public Dimension maximumLayoutSize(Container target) + { + return null; + } + + public float getLayoutAlignmentX(Container target) + { + return 0.0f; + } + + public float getLayoutAlignmentY(Container target) + { + return 0.0f; + } + + public void invalidateLayout(Container target) + { + } + + public void setConstraints(Component comp, GridBagConstraints constraints) + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/GridLayout.java gcc-3.3/libjava/java/awt/GridLayout.java *** gcc-3.2.3/libjava/java/awt/GridLayout.java 2002-01-29 16:31:24.000000000 +0000 --- gcc-3.3/libjava/java/awt/GridLayout.java 2002-11-10 23:11:21.000000000 +0000 *************** import java.io.Serializable; *** 58,63 **** --- 58,65 ---- */ public class GridLayout implements LayoutManager, Serializable { + static final long serialVersionUID = -7411804673224730901L; + /** Add a new component to the layout. This particular implementation * does nothing. * @param name The name of the component to add. *************** public class GridLayout implements Layou *** 151,206 **** */ public void layoutContainer (Container parent) { ! int num = parent.ncomponents; ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! int real_rows = rows; ! int real_cols = cols; ! if (real_rows == 0) ! real_rows = (num + real_cols - 1) / real_cols; ! else ! real_cols = (num + real_rows - 1) / real_rows; ! // We might have less than a single row. In this case we expand ! // to fill. ! if (num < real_cols) ! real_cols = num; ! Dimension d = parent.getSize (); ! Insets ins = parent.getInsets (); ! // Compute width and height of each cell in the grid. ! int tw = d.width - ins.left - ins.right; ! tw = (tw - (real_cols - 1) * hgap) / real_cols; ! int th = d.height - ins.top - ins.bottom; ! th = (th - (real_rows - 1) * vgap) / real_rows; ! // If the cells are too small, still try to do something. ! if (tw < 0) ! tw = 1; ! if (th < 0) ! th = 1; ! int x = ins.left; ! int y = ins.top; ! int i = 0; ! int recount = 0; ! while (i < num) ! { ! comps[i].setBounds (x, y, tw, th); ! ++i; ! ++recount; ! if (recount == real_cols) { ! recount = 0; ! y += vgap + th; ! x = ins.left; } - else - x += hgap + tw; } } --- 153,217 ---- */ public void layoutContainer (Container parent) { ! synchronized (parent.getTreeLock ()) ! { ! int num = parent.ncomponents; ! // There's no point, and handling this would mean adding special ! // cases. ! if (num == 0) ! return; ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! int real_rows = rows; ! int real_cols = cols; ! if (real_rows == 0) ! real_rows = (num + real_cols - 1) / real_cols; ! else ! real_cols = (num + real_rows - 1) / real_rows; ! // We might have less than a single row. In this case we expand ! // to fill. ! if (num < real_cols) ! real_cols = num; ! Dimension d = parent.getSize (); ! Insets ins = parent.getInsets (); ! // Compute width and height of each cell in the grid. ! int tw = d.width - ins.left - ins.right; ! tw = (tw - (real_cols - 1) * hgap) / real_cols; ! int th = d.height - ins.top - ins.bottom; ! th = (th - (real_rows - 1) * vgap) / real_rows; ! // If the cells are too small, still try to do something. ! if (tw < 0) ! tw = 1; ! if (th < 0) ! th = 1; ! int x = ins.left; ! int y = ins.top; ! int i = 0; ! int recount = 0; ! ! while (i < num) { ! comps[i].setBounds (x, y, tw, th); ! ! ++i; ! ++recount; ! if (recount == real_cols) ! { ! recount = 0; ! y += vgap + th; ! x = ins.left; ! } ! else ! x += hgap + tw; } } } *************** public class GridLayout implements Layou *** 237,243 **** */ public void setColumns (int newCols) { ! if (cols < 0) throw new IllegalArgumentException ("number of columns cannot be negative"); if (newCols == 0 && rows == 0) throw new IllegalArgumentException ("number of rows is already 0"); --- 248,254 ---- */ public void setColumns (int newCols) { ! if (newCols < 0) throw new IllegalArgumentException ("number of columns cannot be negative"); if (newCols == 0 && rows == 0) throw new IllegalArgumentException ("number of rows is already 0"); *************** public class GridLayout implements Layou *** 263,269 **** */ public void setRows (int newRows) { ! if (rows < 0) throw new IllegalArgumentException ("number of rows cannot be negative"); if (newRows == 0 && cols == 0) throw new IllegalArgumentException ("number of columns is already 0"); --- 274,280 ---- */ public void setRows (int newRows) { ! if (newRows < 0) throw new IllegalArgumentException ("number of rows cannot be negative"); if (newRows == 0 && cols == 0) throw new IllegalArgumentException ("number of columns is already 0"); *************** public class GridLayout implements Layou *** 293,328 **** // This method is used to compute the various sizes. private Dimension getSize (Container parent, boolean is_min) { ! int w = 0, h = 0, num = parent.ncomponents; ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! ! for (int i = 0; i < num; ++i) { ! Dimension d; ! if (is_min) ! d = comps[i].getMinimumSize (); ! else ! d = comps[i].getPreferredSize (); ! w = Math.max (d.width, w); ! h = Math.max (d.height, h); ! } ! int real_rows = rows; ! int real_cols = cols; ! if (real_rows == 0) ! real_rows = (num + real_cols - 1) / real_cols; ! else ! real_cols = (num + real_rows - 1) / real_rows; ! Insets ins = parent.getInsets (); ! // We subtract out an extra gap here because the gaps are only ! // between cells. ! w = ins.left + ins.right + real_cols * (w + hgap) - hgap; ! h = ins.top + ins.bottom + real_rows * (h + vgap) - vgap; ! return new Dimension (w, h); } /** --- 304,342 ---- // This method is used to compute the various sizes. private Dimension getSize (Container parent, boolean is_min) { ! synchronized (parent.getTreeLock ()) { ! int w = 0, h = 0, num = parent.ncomponents; ! // This is more efficient than calling getComponents(). ! Component[] comps = parent.component; ! for (int i = 0; i < num; ++i) ! { ! Dimension d; ! if (is_min) ! d = comps[i].getMinimumSize (); ! else ! d = comps[i].getPreferredSize (); ! w = Math.max (d.width, w); ! h = Math.max (d.height, h); ! } ! int real_rows = rows; ! int real_cols = cols; ! if (real_rows == 0) ! real_rows = (num + real_cols - 1) / real_cols; ! else ! real_cols = (num + real_rows - 1) / real_rows; ! ! Insets ins = parent.getInsets (); ! // We subtract out an extra gap here because the gaps are only ! // between cells. ! w = ins.left + ins.right + real_cols * (w + hgap) - hgap; ! h = ins.top + ins.bottom + real_rows * (h + vgap) - vgap; ! return new Dimension (w, h); ! } } /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/HeadlessException.java gcc-3.3/libjava/java/awt/HeadlessException.java *** gcc-3.2.3/libjava/java/awt/HeadlessException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/HeadlessException.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,72 ---- + /* HeadlessException.java -- operation not possible in headless environment + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * This exception is thrown when code dependent on a keyboard, mouse, or + * display is executed in a headless environment. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public class HeadlessException extends UnsupportedOperationException + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 167183644944358563L; + + /** + * Create a new instance with no detailed error message. + */ + public HeadlessException() + { + } + + /** + * Create a new instance with the specified detailed error message. + * + * @param message the detailed error message + */ + public HeadlessException(String message) + { + super(message); + } + } // class HeadlessException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/IllegalComponentStateException.java gcc-3.3/libjava/java/awt/IllegalComponentStateException.java *** gcc-3.2.3/libjava/java/awt/IllegalComponentStateException.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/IllegalComponentStateException.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* IllegalComponentStateException.java -- Bad component state ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* IllegalComponentStateException.java -- bad component state ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,75 **** package java.awt; /** ! * This exception is thrown when the requested operation failed because ! * a component was not in the proper state. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class IllegalComponentStateException extends IllegalStateException { ! /** ! * Initializes a new instance of IllegalComponentStateException ! * with the specified detailed error message. ! * ! * @param message The detailed error message. ! */ ! public ! IllegalComponentStateException(String message) ! { ! super(message); ! } ! ! /*************************************************************************/ ! ! /** ! * Initializes a new instance of IllegalComponentStateException ! * with no detailed error message. ! */ ! public ! IllegalComponentStateException() ! { ! super(); ! } } // class IllegalComponentStateException - --- 39,71 ---- package java.awt; /** ! * This exception is thrown when the requested operation failed because ! * a component was not in the proper state. ! * ! * @author Aaron M. Renn ! * @status updated to 1.4 ! */ public class IllegalComponentStateException extends IllegalStateException { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -1889339587208144238L; ! /** ! * Create a new instance with no detailed error message. ! */ ! public IllegalComponentStateException() ! { ! } + /** + * Create a new instance with the specified detailed error message. + * + * @param message the detailed error message + */ + public IllegalComponentStateException(String message) + { + super(message); + } } // class IllegalComponentStateException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/im/InputContext.java gcc-3.3/libjava/java/awt/im/InputContext.java *** gcc-3.2.3/libjava/java/awt/im/InputContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/im/InputContext.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,434 ---- + /* InputContext.java -- provides the context for text input + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.im; + + import java.awt.AWTEvent; + import java.awt.AWTException; + import java.awt.Component; + import java.awt.im.spi.InputMethod; + import java.awt.im.spi.InputMethodDescriptor; + import java.io.BufferedReader; + import java.io.InputStreamReader; + import java.io.IOException; + import java.net.URL; + import java.net.URLConnection; + import java.util.ArrayList; + import java.util.Enumeration; + import java.util.HashMap; + import java.util.Locale; + import gnu.java.util.EmptyEnumeration; + + /** + * Provides a context for controlling input methods and keyboard layouts. + * This class provides the communication layer between the client component, + * and the various locale-dependent text entry input methods that can be used + * for the client. By default, there is one instance per Window, shared among + * all components, but this limits text entry to one component at a time. + * Thus, text components can create their own instance to allow text entry + * in multiple components at a time. + * + *

        By using the interfaces of {@link java.awt.im.spi}, you can install + * extensions which allow additional input methods. Some of these may use + * platform native input methods, or keyboard layouts provided by the platform. + * Input methods are unavailable if none have been installed and the platform + * has no underlying native input methods. Extensions are installed as jar + * files, usually accessed in the default extension location or specified by + * the -extdir VM flag. The jar must contain a file named + * "META_INF/services/java.awt.im.spi.InputMethodDescriptor" which lists, + * one entry per line in UTF-8 encoding, each class in the jar that implements + * java.awt.im.spi.InputMethodDescriptor. + * + * @author Eric Blake + * @see Component#getInputContext() + * @see Component#enableInputMethods(boolean) + * @since 1.2 + * @status updated to 1.4, but unverified + */ + public class InputContext + { + /** + * The list of installed input method descriptors. + */ + private static final ArrayList descriptors = new ArrayList(); + static + { + Enumeration enum; + try + { + enum = ClassLoader.getSystemResources + ("META_INF/services/java.awt.im.spi.InputMethodDescriptor"); + } + catch (IOException ex) + { + // XXX Should we do something else? + enum = EmptyEnumeration.getInstance(); + } + while (enum.hasMoreElements()) + { + URL url = (URL) enum.nextElement(); + BufferedReader in; + String line; + try + { + in = new BufferedReader + (new InputStreamReader(url.openConnection().getInputStream(), + "UTF-8")); + line = in.readLine().trim(); + } + catch (IOException ignored) + { + continue; + } + outer: + while (line != null) + { + try + { + if (line.charAt(0) != '#') + { + Class c = Class.forName(line); + descriptors.add((InputMethodDescriptor) c.newInstance()); + } + line = in.readLine().trim(); + } + catch (IOException e) + { + continue outer; + } + catch (Exception ignored) + { + } + } + } + } + + /** The current input method; null if no input methods are installed. */ + private InputMethod im; + + /** Map of locales to the most recently selected input method. */ + private final HashMap recent = new HashMap(); + + /** The list of acceptable character subsets. */ + private Character.Subset[] subsets; + + /** + * Construct an InputContext. This is protected, so clients must use + * {@link #getInstance()} instead. + */ + protected InputContext() + { + } + + /** + * Returns a new InputContext. + * + * @return a new instance, initialized to the default locale if available + */ + public static InputContext getInstance() + { + InputContext ic = new InputContext(); + ic.selectInputMethod(Locale.getDefault()); + return ic; + } + + /** + * Attempts to select an input method or keyboard layout which supports the + * given locale. This returns true if a locale is available and was selected. + * The following steps are taken in choosing an input method:

          + *
        • If the currently selected input method or keyboard layout supports + * the requested locale, it remains selected.
        • + *
        • If there is no input method or keyboard layout available that + * supports the requested locale, the current input method or keyboard + * layout remains selected.
        • + *
        • If the user has previously selected an input method or keyboard + * layout for the requested locale from the user interface, then the most + * recently selected such input method or keyboard layout is reselected.
        • + *
        • Otherwise, an input method or keyboard layout that supports the + * requested locale is selected in an implementation dependent way. This + * implementation chooses the first input method which supports the requested + * locale based on the InputMethodDescriptors loaded from the extensions + * installed on the CLASSPATH.
        • + *
        + * + *

        Before switching away from an input method, any currently uncommitted + * text is committed. Not all host operating systems provide API to + * determine the locale of the currently selected native input method or + * keyboard layout, and to select a native input method or keyboard layout + * by locale. For host operating systems that don't provide such API, + * selectInputMethod assumes that native input methods or keyboard layouts + * provided by the host operating system support only the system's default + * locale. + * + *

        An example of where this may be called is in a multi-language document, + * when moving the insertion point between sections of different locale, so + * that the user may use the input method appropriate to that section of the + * document. + * + * @param locale the desired new locale + * @return true if the new locale is active + * @throws NullPointerException if locale is null + */ + public boolean selectInputMethod(Locale locale) + { + if (im != null && im.setLocale(locale)) + { + recent.put(locale, im); + return true; + } + InputMethod next = (InputMethod) recent.get(locale); + outer: + if (next != null) + for (int i = 0, limit = descriptors.size(); i < limit; i++) + { + InputMethodDescriptor d = (InputMethodDescriptor) descriptors.get(i); + Locale[] list; + try + { + list = d.getAvailableLocales(); + } + catch (AWTException ignored) + { + continue; + } + for (int j = list.length; --j >= 0; ) + if (locale.equals(list[j])) + { + try + { + next = d.createInputMethod(); + recent.put(locale, next); + } + catch (Exception ignored) + { + continue; + } + } + } + if (next == null) + return false; + // XXX I'm not sure if this does all the necessary steps in the switch. + if (im != null) + { + try + { + next.setCompositionEnabled(im.isCompositionEnabled()); + } + catch (UnsupportedOperationException ignored) + { + } + im.endComposition(); + im.deactivate(false); + im.hideWindows(); + } + im = next; + im.setLocale(locale); + im.setCharacterSubsets(subsets); + return true; + } + + /** + * Returns the current locale of the current input method or keyboard + * layout. Returns null if the input context does not have a current input + * method or keyboard layout or if the current input method's + * {@link InputMethod#getLocale()} method returns null. Not all host + * operating systems provide API to determine the locale of the currently + * selected native input method or keyboard layout. For host operating + * systems that don't provide such API, getLocale assumes that the current + * locale of all native input methods or keyboard layouts provided by the + * host operating system is the system's default locale. + * + * @return the locale of the current input method, or null + * @since 1.3 + */ + public Locale getLocale() + { + return im == null ? null : im.getLocale(); + } + + /** + * Sets the subsets of Unicode characters allowed to be input by the current + * input method, as well as subsequent input methods. The value of null + * implies all characters are legal. Applications should not rely on this + * behavior, since native host input methods may not allow restrictions. + * If no current input method is available, this has no immediate effect. + * + * @param subsets the set of Unicode subsets to accept, or null + */ + public void setCharacterSubsets(Character.Subset[] subsets) + { + this.subsets = subsets; + if (im != null) + im.setCharacterSubsets(subsets); + } + + /** + * Changes the enabled status of the current input method. An input method + * that is enabled for composition interprets incoming events for both + * composition and control purposes, while a disabled input method only + * interprets control commands (including commands to enable itself). + * + * @param enable whether to enable the input method + * @throws UnsupportedOperationException if there is no current input method, + * or the input method does not support enabling + * @see #isCompositionEnabled() + * @since 1.3 + */ + public void setCompositionEnabled(boolean enable) + { + if (im == null) + throw new UnsupportedOperationException(); + im.setCompositionEnabled(enable); + } + + /** + * Find out if the current input method is enabled. + * + * @return true if the current input method is enabled + * @throws UnsupportedOperationException if there is no current input method, + * or the input method does not support enabling + * @see #setCompositionEnabled(boolean) + * @since 1.3 + */ + public boolean isCompositionEnabled() + { + if (im == null) + throw new UnsupportedOperationException(); + return im.isCompositionEnabled(); + } + + /** + * Starts a reconversion operation in the current input method. The input + * method gets theh text to reconvert from the client component, using + * {@link InputMethodRequests#getSelectedText(Attribute[])}. Then the + * composed and committed text produced by the operation is sent back to + * the client using a sequence of InputMethodRequests. + * + * @throws UnsupportedOperationException if there is no current input method, + * or the input method does not support reconversion + * @throws UnsupportedOperationException if ther + * @since 1.3 + */ + public void reconvert() + { + if (im == null) + throw new UnsupportedOperationException(); + im.reconvert(); + } + + /** + * Dispatches an event to the current input method. This is called + * automatically by AWT. If no input method is available, then the event + * will never be consumed. + * + * @param event the event to dispatch + * @throws NullPointerException if event is null + */ + public void dispatchEvent(AWTEvent event) + { + if (im != null) + im.dispatchEvent(event); + } + + /** + * Notifies the input context that a client component has been removed from + * its containment hierarchy, or that input method support has been disabled + * for the component. This method is usually called from the client + * component's {@link Component#removeNotify()} method. Potentially pending + * input from input methods for this component is discarded. If no input + * methods are available, then this method has no effect. + * + * @param client the client component + * @throws NullPointerException if client is null + */ + public void removeNotify(Component client) + { + // XXX What to do with client information? + if (im != null) + { + im.deactivate(false); + im.removeNotify(); + } + } + + /** + * Ends any input composition that may currently be going on in this + * context. Depending on the platform and possibly user preferences, this + * may commit or delete uncommitted text. Any changes to the text are + * communicated to the active component using an input method event. If no + * input methods are available, then this method has no effect. This may + * be called for a variety of reasons, such as when the user moves the + * insertion point in the client text outside the range of the composed text, + * or when text is saved to file. + */ + public void endComposition() + { + if (im != null) + im.endComposition(); + } + + /** + * Disposes of the input context and release the resources used by it. + * Called automatically by AWT for the default input context of each + * Window. If no input methods are available, then this method has no + * effect. + */ + public void dispose() + { + if (im != null) + { + im.deactivate(false); + im.dispose(); + } + } + + /** + * Returns a control object from the current input method, or null. A + * control object provides implementation-dependent methods that control + * the behavior of the input method or obtain information from the input + * method. Clients have to compare the result against known input method + * control object types. If no input methods are available or the current + * input method does not provide an input method control object, then null + * is returned. + * + * @return the control object, or null + */ + public Object getInputMethodControlObject() + { + return im == null ? null : im.getControlObject(); + } + } // class InputContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/im/InputMethodHighlight.java gcc-3.3/libjava/java/awt/im/InputMethodHighlight.java *** gcc-3.2.3/libjava/java/awt/im/InputMethodHighlight.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/im/InputMethodHighlight.java 2003-01-02 00:14:09.000000000 +0000 *************** *** 0 **** --- 1,185 ---- + /* InputMethodHighlight.java -- highlights the current text selection + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.im; + + import java.util.Map; + + /** + * This describes the highlight attributes of text composed in an input method. + * The description includes an abstract level (whether text has been converted + * yet, and whether it is selected), and a concrete level (which style + * attributes are used in rendering). If no concrete level is defined, the + * renderer should use + * {@link Toolkit#mapInputMethodHighlight(InputMethodHighlight)}. An example + * of conversion state is kana -> kanji. + * + *

        Instances of this class are typically used in + * AttributedCharacterIterators, and may be wrapped in Annotations to separate + * text segments. + * + * @author Eric Blake + * @see AttributedCharacterIterators + * @see Annotation + * @since 1.2 + * @status updated to 1.4 + */ + public class InputMethodHighlight + { + /** Raw text state (before conversion). */ + public static final int RAW_TEXT = 0; + + /** Converted text state (after conversion). */ + public static final int CONVERTED_TEXT = 1; + + /** Default do-nothing highlighting for unselected raw text. */ + public static final InputMethodHighlight UNSELECTED_RAW_TEXT_HIGHLIGHT + = new InputMethodHighlight(false, RAW_TEXT); + + /** Default do-nothing highlighting for selected raw text. */ + public static final InputMethodHighlight SELECTED_RAW_TEXT_HIGHLIGHT + = new InputMethodHighlight(true, RAW_TEXT); + + /** Default do-nothing highlighting for unselected converted text. */ + public static final InputMethodHighlight UNSELECTED_CONVERTED_TEXT_HIGHLIGHT + = new InputMethodHighlight(false, CONVERTED_TEXT); + + /** Default do-nothing highlighting for selected converted text. */ + public static final InputMethodHighlight SELECTED_CONVERTED_TEXT_HIGHLIGHT + = new InputMethodHighlight(true, CONVERTED_TEXT); + + /** Whether the highlighting applies to selected text. */ + private final boolean selected; + + /** The state of highlighted text. */ + private final int state; + + /** Any variation on the highlighting style. */ + private final int variation; + + /** The unmodifiable map of rendering styles. */ + private final Map style; + + /** + * Create an input method highlight style, with variation 0 and null style + * mapping. + * + * @param selected whether the text range is selected + * @param state either {@link #RAW_TEXT} or {@link #CONVERTED_TEXT} + * @throws IllegalArgumentException if state is invalid + */ + public InputMethodHighlight(boolean selected, int state) + { + this(selected, state, 0, null); + } + + /** + * Create an input method highlight style, with null style mapping. + * + * @param selected whether the text range is selected + * @param state either {@link #RAW_TEXT} or {@link #CONVERTED_TEXT} + * @param variation the style variation + * @throws IllegalArgumentException if state is invalid + */ + public InputMethodHighlight(boolean selected, int state, int variation) + { + this(selected, state, variation, null); + } + + /** + * Create an input method highlight style. + * + * @param selected whether the text range is selected + * @param state either {@link #RAW_TEXT} or {@link #CONVERTED_TEXT} + * @param variation the style variation + * @param style an unmodifiable map of rendering styles, or null + * @throws IllegalArgumentException if state is invalid + * @since 1.3 + */ + public InputMethodHighlight(boolean selected, int state, int variation, + Map style) + { + if (state != RAW_TEXT && state != CONVERTED_TEXT) + throw new IllegalArgumentException(); + this.selected = selected; + this.state = state; + this.variation = variation; + this.style = style; + } + + /** + * Return whether the highlighting applies to selected text. + * + * @return the selection status + */ + public boolean isSelected() + { + return selected; + } + + /** + * Return the conversion state of the highlighted text. + * + * @return one of {@link #RAW_TEXT} or {@link #CONVERTED_TEXT} + */ + public int getState() + { + return state; + } + + /** + * Return the highlighting style variation. + * + * @return the variation + */ + public int getVariation() + { + return variation; + } + + /** + * Return the rendering style attributes map, or null if it should be the + * default mapping. + * + * @return the style map + * @since 1.3 + */ + public Map getStyle() + { + return style; + } + } // class InputMethodHighlight diff -Nrc3pad gcc-3.2.3/libjava/java/awt/im/InputMethodRequests.java gcc-3.3/libjava/java/awt/im/InputMethodRequests.java *** gcc-3.2.3/libjava/java/awt/im/InputMethodRequests.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/im/InputMethodRequests.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,153 ---- + /* InputMethodRequests.java -- handles text insertion via input methods + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.im; + + import java.awt.Rectangle; + import java.awt.font.TextHitInfo; + import java.text.AttributedCharacterIterator; + import java.text.AttributedCharacterIterator.Attribute; + + /** + * This interface handles requests made by input methods on text editing + * components. A component must specify a handler for input methods that + * implements this interface, and which supports one of two user interfaces: + *

        • on-the-spot: composed text is shown in place
        • + *
        • below-the-spot: composed text is in a separate window, + * usually below the main text window, until it is committed into place at + * the insertion point, overwriting any selected text
        + * + * @author Eric Blake + * @see Component#getInputMethodRequests() + * @see InputMethodListener + * @since 1.2 + * @status updated to 1.4 + */ + public interface InputMethodRequests + { + /** + * Gets the location of a given offset of the text. This can be used to + * position a composition window near the location of where the composed + * text will be inserted. + * + *

        If the component has composed text (from the most recent + * InputMethodEvent), then offset 0 indicates the location of the first + * character of this composed text. Otherwise, the offset is ignored, and + * the location should be the beginning of the final line of selected + * text (in horizontal left-to-right text, like English, this would be the + * lower left corner of the selction; in vertical top-to-bottom text, like + * Chinese, this would be the top right corner of the selection). + * + *

        The location returned is a 0-thickness caret (either horizontal or + * vertical, depending on text flow), mapped to absolute screen coordinates. + * + * @param offset offset within composed text, or null + * @return the screen location of the caret at the offset + */ + Rectangle getTextLocation(TextHitInfo offset); + + /** + * Get the text offset for the given screen coordinate. The offset is + * relative to the composed text, and the return is null if it is outside + * the range of composed text. For example, this can be used to find + * where a mouse click should pop up a text composition window. + * + * @param x the x screen coordinate + * @param y the y screen coordinate + * @return a text hit info describing the composed text offset + */ + TextHitInfo getLocationOffset(int x, int y); + + /** + * Gets the offset where the committed text exists in the text editing + * component. This can be used to examine the text surrounding the insert + * position. + * + * @return the offset of the insert position + */ + int getInsertPositionOffset(); + + /** + * Gets an interator which provides access to the text and its attributes, + * except for the uncommitted text. The input method may provide a list of + * attributes it is interested in; and the iterator need not provide + * information on the remaining attributes. If the attribute list is null, + * the iterator must list all attributes. + * + * @param beginIndex the index of the first character in the iteration + * @param endIndex the index of the last character in the iteration + * @param attributes a list of attributes interested in, or null + * @return an iterator over the region of text with its attributes + */ + AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex, + Attribute[] attributes); + + /** + * Gets the length of committed text. + * + * @return the number of committed characters + */ + int getCommittedTextLength(); + + /** + * Gets the latest committed text, and removes it from the component's text + * body. This allows an input method to provide an "Undo" command. In + * general, this should only be supported immediately after a commit, and + * not when other actions intervene; if not supported, simply return null. + * The input method may provide a list of attributes it is interested in; + * and the iterator need not provide information on the remaining attributes. + * If the attribute list is null, the iterator must list all attributes. + * + * @param attributes a list of attributes interested in, or null + * @return the latest committed text, or null + */ + AttributedCharacterIterator cancelLatestCommittedText + (Attribute[] attributes); + + /** + * Gets the currently selected text. One use of this is to implement a + * "Reconvert" feature in an input method, which modifies the selection + * based on the text in the composition window. The input method may + * provide a list of attributes it is interested in; and the iterator need + * not provide information on the remaining attributes. If the attribute + * list is null, the iterator must list all attributes. + * + * @param attributes a list of attributes interested in, or null + * @return the current selection + */ + AttributedCharacterIterator getSelectedText(Attribute[] attributes); + } // interface InputMethodRequests diff -Nrc3pad gcc-3.2.3/libjava/java/awt/im/InputSubset.java gcc-3.3/libjava/java/awt/im/InputSubset.java *** gcc-3.2.3/libjava/java/awt/im/InputSubset.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/im/InputSubset.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,129 ---- + /* InputSubset.java -- subsets of Unicode important in text input + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.im; + + /** + * Defines additional Unicode character blocks for use by input methods. + * These constants encompass several Unicode blocks, or portions thereof, for + * simplification over {@link Character.UnicodeBlock}. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public final class InputSubset extends java.lang.Character.Subset + { // XXX - FIXME Use fully qualified extends as gcj 3.1 workaround. + /** + * Constant for all Latin characters, including the characters in the + * BASIC_LATIN, LATIN_1_SUPPLEMENT, LATIN_EXTENDED_A, LATIN_EXTENDED_B + * Unicode character blocks. + */ + public static final InputSubset LATIN = new InputSubset("LATIN"); + + /** + * Constant for the digits included in the BASIC_LATIN Unicode character + * block. + */ + public static final InputSubset LATIN_DIGITS + = new InputSubset("LATIN_DIGITS"); + + /** + * Constant for all Han characters used in writing Traditional Chinese, + * including a subset of the CJK unified ideographs as well as Traditional + * Chinese Han characters that may be defined as surrogate characters. + */ + public static final InputSubset TRADITIONAL_HANZI + = new InputSubset("TRADITIONAL_HANZI"); + + /** + * Constant for all Han characters used in writing Simplified Chinese, + * including a subset of the CJK unified ideographs as well as Simplified + * Chinese Han characters that may be defined as surrogate characters. + */ + public static final InputSubset SIMPLIFIED_HANZI + = new InputSubset("SIMPLIFIED_HANZI"); + + /** + * Constant for all Han characters used in writing Japanese, including a + * subset of the CJK unified ideographs as well as Japanese Han characters + * that may be defined as surrogate characters. + */ + public static final InputSubset KANJI = new InputSubset("KANJI"); + + /** + * Constant for all Han characters used in writing Korean, including a + * subset of the CJK unified ideographs as well as Korean Han characters + * that may be defined as surrogate characters. + */ + public static final InputSubset HANJA = new InputSubset("HANJA"); + + /** + * Constant for the halfwidth katakana subset of the Unicode halfwidth and + * fullwidth forms character block. + */ + public static final InputSubset HALFWIDTH_KATAKANA + = new InputSubset("HALFWIDTH_KATAKANA"); + + /** + * Constant for the fullwidth ASCII variants subset of the Unicode + * halfwidth and fullwidth forms character block. + * + * @since 1.3 + */ + public static final InputSubset FULLWIDTH_LATIN + = new InputSubset("FULLWIDTH_LATIN"); + + /** + * Constant for the fullwidth digits included in the Unicode halfwidth and + * fullwidth forms character block. + * + * @since 1.3 + */ + public static final InputSubset FULLWIDTH_DIGITS + = new InputSubset("FULLWIDTH_DIGITS"); + + /** + * Construct a subset. + * + * @param name the subset name + */ + private InputSubset(String name) + { + super(name); + } + } // class InputSubset diff -Nrc3pad gcc-3.2.3/libjava/java/awt/im/spi/InputMethodContext.java gcc-3.3/libjava/java/awt/im/spi/InputMethodContext.java *** gcc-3.2.3/libjava/java/awt/im/spi/InputMethodContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/im/spi/InputMethodContext.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,122 ---- + /* InputMethodContext.java -- communication between an input method and client + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.im.spi; + + import java.awt.HeadlessException; + import java.awt.Window; + import java.awt.font.TextHitInfo; + import java.awt.im.InputMethodRequests; + import java.text.AttributedCharacterIterator; + import javax.swing.JFrame; + + /** + * Provides methods for the communication context between an input method + * and the client component. This should be passed to + * {@link InputMethod#setInputMethodContext(InputMethodContext)}. + * + * @author Eric Blake + * @since 1.3 + * @status updated to 1.4 + */ + public interface InputMethodContext extends InputMethodRequests + { + /** + * Create an input method event and dispatch it to the client. + * + * @param id the event type + * @param text an iterator over the text to be committed + * @param count the count of characters to be committed + * @param caret the insertion point of the commit, or null + * @param visiblePosition the best location to make visible, or null + */ + void dispatchInputMethodEvent(int id, AttributedCharacterIterator text, + int count, TextHitInfo caret, + TextHitInfo visiblePosition); + + /** + * Creates a top-level window for use by the input method. This window should + * float above all document windows and dialogs, not receive focus, and have + * lightweight decorations (such as no title, reduced drag regions). But + * this behavior may be modified to meet the platform style. The title may + * or may not be displayed, depending on the platform. + * + *

        If attachToInputContext is true, the new window will share the input + * context of the input method, so that events in the new window are + * dispatched to the input method. Also, this supresses deactivate and + * activate calls to the input method caused by setVisible. + * + * @param title the window title, if one is displayed; null becomes "" + * @param attachToInputContext true for the window to share context with + * the input method + * @return the new window for use by the input method + * @throws HeadlessException if GraphicsEnvironment.isHeadless is true + */ + Window createInputMethodWindow(String title, boolean attachToInputContext); + + /** + * Creates a top-level Swing JFrame for use by the input method. This frame + * should float above all document windows and dialogs, not receive focus, + * and have lightweight decorations (such as no title, reduced drag + * regions). But this behavior may be modified to meet the platform style. + * The title may or may not be displayed, depending on the platform. + * + *

        If attachToInputContext is true, the new window will share the input + * context of the input method, so that events in the new window are + * dispatched to the input method. Also, this supresses deactivate and + * activate calls to the input method caused by setVisible. + * + * @param title the window title, if one is displayed; null becomes "" + * @param attachToInputContext true for the window to share context with + * the input method + * @return the new window for use by the input method + * @throws HeadlessException if GraphicsEnvironment.isHeadless is true + * @since 1.4 + */ + JFrame createInputMethodJFrame(String title, boolean attachToInputContext); + + /** + * Sets whether notification of the client window's location and state should + * be enabled for the input method. When enabled, the input method's + * {@link #notifyClientWindowChange(Rectangle)} method is called. + * Notification is automatically disabled when the input method is disposed. + * + * @param inputMethod the method to change status of + * @param enable true to enable notification + */ + void enableClientWindowNotification(InputMethod inputMethod, boolean enable); + } // interface InputMethodContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/im/spi/InputMethodDescriptor.java gcc-3.3/libjava/java/awt/im/spi/InputMethodDescriptor.java *** gcc-3.2.3/libjava/java/awt/im/spi/InputMethodDescriptor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/im/spi/InputMethodDescriptor.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,111 ---- + /* InputMethodDescriptor.java -- enables loading and use of an input method + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.im.spi; + + import java.awt.AWTException; + import java.awt.Image; + import java.util.Locale; + + /** + * This interface provides information about an InputMethod before it is + * loaded. + * + * @author Eric Blake + * @since 1.3 + * @status updated to 1.4 + */ + public interface InputMethodDescriptor + { + /** + * Returns the locales supported by the input method this describes. This + * allows the selection of input methods by locale (by language only, or + * also by country and variant), via + * {@link InputContext#selectInputMethod(Locale)}. The returned list should + * ignore pass-through locales, so it is usually a subset of locales for + * which {@link InputMethod#setContext(Locale)} returns true. If + * {@link #hasDynamicLocaleList()} returns true, this is called each time + * information is needed, allowing dynamic addition or removal of supported + * locales. + * + * @return the list of supported locales + * @throws AWTException if the input method is not available + */ + Locale[] getAvailableLocales() throws AWTException; + + /** + * Test whether the input method this describes has a static or dynamic + * locale list. For example, this would return true if the list of supported + * locales depends on adapters currently loaded over a network. + * + * @return true if the locale list is dynamic + */ + boolean hasDynamicLocaleList(); + + /** + * Returns a user visible name of the input locale, displayed in the + * specified locale. The inputLocale parameter must be one obtained from + * the list in {@link #getAvailableLocales()}, or null for a + * locale-independent description of the input method. If a translation to + * the desired display language is not available, another language may be + * used. + * + * @param inputLocale the locale of the input method, or null + * @param displayLanguage the language of the result + * @return the name of the input method when using the given inputLocale + */ + public String getInputMethodDisplayName(Locale inputLocale, + Locale displayLanguage); + + /** + * Returns a 16x16 icon for the input locale. The inputLocale parameter + * must be one obtained from the list in {@link #getAvailableLocales()}, or + * null for a locale-independent icon for the input method. + * + * @param inputLocale the locale of the input method, or null + * @return a 16x16 icon for the input method when using the given inputLocale + */ + public Image getInputMethodIcon(Locale inputLocale); + + /** + * Creates a new instance of the input method. + * + * @return the newly created input method + * @throws Exception if anything goes wrong + */ + public InputMethod createInputMethod() throws Exception; + } // interface InputMethodDescriptor diff -Nrc3pad gcc-3.2.3/libjava/java/awt/im/spi/InputMethod.java gcc-3.3/libjava/java/awt/im/spi/InputMethod.java *** gcc-3.2.3/libjava/java/awt/im/spi/InputMethod.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/im/spi/InputMethod.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,240 ---- + /* InputMethod.java -- defines an interface for complex text input + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.awt.im.spi; + + import java.awt.AWTEvent; + import java.awt.Rectangle; + import java.util.Locale; + + /** + * This interface supports complex text input, often for situations where + * the text is more complex than a keyboard will accomodate. For example, + * this can be used for Chinese, Japanese, and Korean, where multiple + * keystrokes are necessary to compose text. This could also support things + * like phonetic English, or reordering Thai. + * + *

        These contexts can be loaded by the input method framework, using + * {@link InputContext#selectInputMethod(Locale)}. + * + * @author Eric Blake + * @since 1.3 + * @status updated to 1.4 + */ + public interface InputMethod + { + /** + * Set the input method context, which ties the input method to a client + * component. This is called once automatically when creating the input + * method. + * + * @param context the context for this input method + * @throws NullPointerException if context is null + */ + void setInputMethodContext(InputMethodContext context); + + /** + * Sets the input locale. If the input method supports that locale, it + * changes its behavior to be consistent with the locale and returns true. + * Otherwise, it returns false. This is called by + * {@link InputContext#selectInputMethod(Locale)} when the user specifies + * a locale, or when the previously selected input method had a locale. + * + * @param locale the locale to use for input + * @return true if the change is successful + * @throws NullPointerException if locale is null + */ + boolean setLocale(Locale locale); + + /** + * Returns the current input locale, or null if none is defined. This is + * called by {@link InputContext#getLocale()}, or before switching input + * methods. + * + * @return the current input locale, or null + */ + Locale getLocale(); + + /** + * Sets the allowed Unicode subsets that this input method can use. Null + * indicates that all characters are allowed. This is called after creation, + * or when switching to this input method, by + * {@link InputContext#setCharacterSubsets(Character.Subset[])}. + * + * @param subsets the accepted subsets for this input method, or null for all + */ + void setCharacterSubsets(Character.Subset[] subsets); + + /** + * Changes the enabled status of this input method. An enabled input method + * accepts incoming events for composition and control purposes, while a + * disabled input method ignores events (except for control purposes). This + * is called by {@link InputContext#setCompositionEnabled(boolean)} or when + * switching from an input method if the previous input method returned + * without exception on {@link #isCompositionEnabled()}. + * + * @param enable whether to enable this input method + * @throws UnsupportedOperationException if enabling/disabling is unsupported + * @see #isCompositionEnabled() + */ + void setCompositionEnabled(boolean enable); + + /** + * Find out if this input method is enabled. This is called by + * {@link InputContext#isCompositionEnabled()}, or when switching input + * methods via {@link InputContext#selectInputMethod(Locale)}. + * + * @return true if this input method is enabled + * @throws UnsupportedOperationException if enabling/disabling is unsupported + * @see #setCompositionEnabled(boolean) + */ + boolean isCompositionEnabled(); + + /** + * Starts a reconversion operation. The input method gets its text from the + * client, using {@link InputMethodRequests#getSelectedText(Attribute[])}. + * Then the composed and committed text produced by the operation is sent + * back to the client using a sequence of InputMethodEvents. This is called + * by {@link InputContext#reconvert()}. + * + * @throws UnsupportedOperationException if reconversion is unsupported + */ + void reconvert(); + + /** + * Dispatch an event to the input method. If input method support is enabled, + * certain events are dispatched to the input method before the client + * component or event listeners. The input method must either consume the + * event or pass it on to the component. Instances of InputEvent, including + * KeyEvent and MouseEvent, are given to this input method. This method is + * called by {@link InputContext#dispatchEvent(AWTEvent)}. + * + * @param event the event to dispatch + * @throws NullPointerException if event is null + */ + void dispatchEvent(AWTEvent event); + + /** + * Notify this input method of changes in the client window. This is called + * when notifications are enabled (see {@link + * InputMethodContext#enableClientWindowNotification(InputMethod, boolean)}, + * if {@link #removeNotify(Component)} has not been called. The following + * situations trigger a notification:

          + *
        • The client window changes in location, size, visibility, + * iconification, or is closed.
        • + *
        • When enabling client notification (or on the first activation after + * enabling if no client existed at the time).
        • + *
        • When activating a new client after removeNotify was + * called on a previous client.
        • + *
        + * + * @param the client window's current bounds, or null + */ + void notifyClientWindowChange(Rectangle bounds); + + /** + * Activate this input method for input processing. If the input method + * provides its own windows, it should make them open and visible at this + * time. This method is called when a client component receives a + * FOCUS_GAINED event, or when switching to this input method from another + * one. It is only called when the input method is inactive, assuming that + * new instances begin in an inactive state. + */ + void activate(); + + /** + * Deactivate this input method, either temporarily or permanently for the + * given client. If the input method provides its own windows, it should + * only close those related to the current composition (such as a lookup + * choice panel), while leaving more persistant windows (like a control + * panel) open to avoid screen flicker. Before control is given to another + * input method, {@link #hideWindows()} will be called on this instance. + * This method is called when a client component receives a + * FOCUS_LOST event, when switching to another input method, or before + * {@link #removeNotify()} when the client is removed. + * + * @param isTemporary true if the focus change is temporary + */ + void deactivate(boolean isTemporary); + + /** + * Close or hide all windows opened by this input method. This is called + * before activating a different input method, and before calling + * {@link #dispose()} on this instance. It is only called when the input + * method is inactive. + */ + void hideWindows(); + + /** + * Notify the input method that a client component has been removed from its + * hierarchy, or that input method support has been disabled. This is + * called by {@link InputContext#removeNotify()}, and only when the input + * method is inactive. + */ + void removeNotify(); + + /** + * End any input composition currently taking place. Depending on the + * platform and user preferences, this may commit or delete uncommitted text, + * using input method events. This may be called for a variety of reasons, + * such as when the user moves the insertion point in the client text outside + * the range of the composed text, or when text is saved to file. This is + * called by {@link InputContext#endComposition()}, when switching to a + * new input method, or by {@link InputContext#selectInputMethod(Locale)}. + */ + void endComposition(); + + /** + * Disposes the input method and release any resources it is using. In + * particular, the input method should dispose windows and close files. This + * is called by {@link InputContext#dispose()}, when the input method is + * inactive; and nothing will be called on this instance afterwards. + */ + void dispose(); + + /** + * Returns a control object from this input method, or null. A control object + * provides method to control the behavior of this input method, as well as + * query information about it. The object is implementation dependent, so + * clients must compare the result against known input method control + * object types. This is called by + * {@link InputContext#getInputMethodControlObject()}. + * + * @return the control object, or null + */ + Object getControlObject(); + } // interface InputMethod diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/BufferedImageOp.java gcc-3.3/libjava/java/awt/image/BufferedImageOp.java *** gcc-3.2.3/libjava/java/awt/image/BufferedImageOp.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/BufferedImageOp.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* BufferedImageOp.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image; + + import java.awt.RenderingHints; + import java.awt.geom.Point2D; + import java.awt.geom.Rectangle2D; + + /** + * NEEDS DOCUMENTATION + */ + public interface BufferedImageOp + { + BufferedImage filter(BufferedImage src, BufferedImage dst); + Rectangle2D getBounds2D(BufferedImage src); + BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM); + Point2D getPoint2D(Point2D src, Point2D dst); + RenderingHints getRenderingHints(); + } // interface BufferedImageOp diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/BufferStrategy.java gcc-3.3/libjava/java/awt/image/BufferStrategy.java *** gcc-3.2.3/libjava/java/awt/image/BufferStrategy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/BufferStrategy.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* BufferStrategy.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image; + + import java.awt.BufferCapabilities; + import java.awt.Graphics; + + /** STUBS ONLY */ + public abstract class BufferStrategy + { + public BufferStrategy() + { + } + public abstract BufferCapabilities getCapabilities(); + public abstract Graphics getDrawGraphics(); + public abstract boolean contentsLost(); + public abstract boolean contentsRestored(); + public abstract void show(); + } // class BufferStrategy diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/ColorModel.java gcc-3.3/libjava/java/awt/image/ColorModel.java *** gcc-3.2.3/libjava/java/awt/image/ColorModel.java 2002-01-25 05:44:03.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/ColorModel.java 2003-01-14 22:12:53.000000000 +0000 *************** public abstract class ColorModel impleme *** 120,129 **** --- 120,151 ---- Buffers.smallestAppropriateTransferType(bits * 4)); } + /** + * Constructs a ColorModel that translates pixel values to + * color/alpha components. + * + * @exception IllegalArgumentException If the length of the bit array is less + * than the number of color or alpha components in this ColorModel, or if the + * transparency is not a valid value, or if the sum of the number of bits in + * bits is less than 1 or if any of the elements in bits is less than 0. + */ protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType) { + int bits_sum = 0; + for (int i = 0; i < bits.length; i++) + { + if (bits [i] < 0) + throw new IllegalArgumentException (); + + bits_sum |= bits [i]; + } + + if ((bits.length < cspace.numComponents) + || (bits_sum < 1)) + throw new IllegalArgumentException (); + this.pixel_bits = pixel_bits; this.bits = bits; this.cspace = cspace; *************** public abstract class ColorModel impleme *** 424,430 **** for (int i=0; iBufferedImageOp or + * RasterOp filters cannot process an image. + * + * @author Eric Blake + * @see BufferedImageOp + * @see RasterOp + * @status updated to 1.4 + */ + public class ImagingOpException extends RuntimeException + { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 96598996116164315L; + + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public ImagingOpException(String message) + { + super(message); + } + } // class ImagingOpException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/IndexColorModel.java gcc-3.3/libjava/java/awt/image/IndexColorModel.java *** gcc-3.2.3/libjava/java/awt/image/IndexColorModel.java 2002-01-16 04:21:35.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/IndexColorModel.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 1,355 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ ! package java.awt.image; ! import java.awt.Transparency; ! import java.awt.color.ColorSpace; ! import gnu.java.awt.Buffers; /** ! * @author Rolf W. Rasmussen */ public class IndexColorModel extends ColorModel { ! private byte[] r; ! private byte[] g; ! private byte[] b; ! private byte[] a; ! private int[] argb; ! private byte[] cmap; ! private int start; ! private int transparent; ! private int size; ! ! public IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b) ! { ! super(bits, nArray(bits, 3), ! ColorSpace.getInstance(ColorSpace.CS_sRGB), ! false, // no transparency ! false, // no premultiplied ! Transparency.OPAQUE, ! Buffers.smallestAppropriateTransferType(bits)); ! this.r = r; ! this.g = g; ! this.b = b; ! this.size = size; ! } ! public IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b, ! int transparent) ! { ! super(bits, nArray(bits, 4), ! ColorSpace.getInstance(ColorSpace.CS_sRGB), ! true, // has transparency ! false, ! Transparency.BITMASK, ! Buffers.smallestAppropriateTransferType(bits)); ! this.r = r; ! this.g = g; ! this.b = b; ! this.transparent = transparent; ! this.size = size; ! } ! public IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b, ! byte[] a) ! { ! super(bits, nArray(bits, 4), ! ColorSpace.getInstance(ColorSpace.CS_sRGB), ! true, // has transparency ! false, ! Transparency.BITMASK, ! Buffers.smallestAppropriateTransferType(bits)); ! this.r = r; ! this.g = g; ! this.b = b; ! this.a = a; ! this.size = size; ! } ! public IndexColorModel(int bits, int size, byte[] cmap, int start, ! boolean hasAlpha) ! { ! super(bits, nArray(bits, hasAlpha ? 4 : 3), ! ColorSpace.getInstance(ColorSpace.CS_sRGB), ! hasAlpha, ! false, ! hasAlpha ? Transparency.TRANSLUCENT : Transparency.OPAQUE, ! Buffers.smallestAppropriateTransferType(bits)); ! this.cmap = cmap; ! this.start = start; ! this.size = size; ! } ! public IndexColorModel(int bits, int size, byte[] cmap, int start, ! boolean hasAlpha, int transparent, ! int transferType) ! { ! super(bits, nArray(bits, hasAlpha ? 4 : 3), ! ColorSpace.getInstance(ColorSpace.CS_sRGB), ! hasAlpha, ! false, ! hasAlpha ? ! Transparency.TRANSLUCENT : ! ((transparent < 0) ? ! Transparency.OPAQUE : ! Transparency.BITMASK), ! transferType); ! this.cmap = cmap; ! this.start = start; ! this.size = size; ! } ! public final int getMapSize() ! { ! return size; ! } ! ! public final int getTransparentPixel() ! { ! return transparent; ! } ! public final void getReds(byte r[]) ! { ! if (this.r == null) calcRGBArrays(); ! System.arraycopy(this.r, 0, r, 0, getMapSize()); ! } ! ! public final void getGreens(byte g[]) ! { ! if (this.g == null) calcRGBArrays(); ! System.arraycopy(this.g, 0, g, 0, getMapSize()); ! } ! ! public final void getBlues(byte b[]) ! { ! if (this.b == null) calcRGBArrays(); ! System.arraycopy(this.b, 0, b, 0, getMapSize()); ! } ! public final void getAlphas(byte a[]) ! { ! if (this.a == null) calcAlphaArray(); ! System.arraycopy(this.a, 0, a, 0, getMapSize()); ! } ! public final void getRGBs(int rgb[]) ! { ! if (this.argb == null) calcARGBArray(); ! System.arraycopy(this.argb, 0, rgb, 0, getMapSize()); ! } ! public int getRed(int pixel) ! { ! try ! { ! return r[pixel]; ! } ! catch (NullPointerException npe) ! { ! calcRGBArrays(); ! return r[pixel]; ! } ! } ! public int getGreen(int pixel) ! { ! try ! { ! return g[pixel]; ! } ! catch (NullPointerException npe) ! { ! calcRGBArrays(); ! return g[pixel]; ! } ! } ! public int getBlue(int pixel) ! { ! try ! { ! return b[pixel]; ! } ! catch (NullPointerException npe) ! { ! calcRGBArrays(); ! return b[pixel]; ! } ! } ! ! public int getAlpha(int pixel) ! { ! try ! { ! return a[pixel]; ! } ! catch (NullPointerException npe) ! { ! calcAlphaArray(); ! return a[pixel]; ! } ! } ! private void calcRGBArrays() { ! int j=0; ! boolean hasAlpha = hasAlpha(); ! r = new byte[size]; ! g = new byte[size]; ! b = new byte[size]; ! if (hasAlpha) a = new byte[size]; ! ! for (int i=0; i>> 24) & 0xff; ! rv = (rgb >>> 16) & 0xff; ! gv = (rgb >>> 8) & 0xff; ! bv = (rgb >>> 0) & 0xff; ! ! int pixelValue = getPixelValue(av, rv, gv, bv); ! /* In this color model, the whole pixel fits in the first element ! of the array. */ ! DataBuffer buffer = Buffers.createBuffer(transferType, pixel, 1); ! buffer.setElem(0, pixelValue); ! return Buffers.getData(buffer); ! } ! ! private int getPixelValue(int av, int rv, int gv, int bv) ! { ! if (r == null) calcRGBArrays(); ! if (a == null) calcAlphaArray(); ! int minDAlpha = 1<<8; ! int minDRGB = (1<<8)*(1<<8)*3; ! int pixelValue = -1; ! for (int i=0; i minDAlpha) continue; ! int dR = rv-(r[i]&0xff); ! int dG = gv-(g[i]&0xff); ! int dB = bv-(b[i]&0xff); ! int dRGB = dR*dR + dG*dG + dB*dB; ! ! if (dRGB >= minDRGB) continue; ! ! pixelValue = i; ! minDRGB = dRGB; ! } ! return pixelValue; ! } - public int[] getComponents(int pixel, int[] components, int offset) - { - int numComponents = getNumComponents(); - if (components == null) components = new int[offset + numComponents]; - components[offset++] = (r[pixel]&0xff); - components[offset++] = (g[pixel]&0xff); - components[offset++] = (b[pixel]&0xff); - if (hasAlpha()) components[offset++] = (a[pixel]&0xff); - return components; - } - - public final int[] getComponents(Object pixel, int[] components, - int offset) - { - return getComponents(getPixelFromArray(pixel), components, offset); - } - - public int getDataElement(int[] components, int offset) - { - int r = components[offset++]; - int g = components[offset++]; - int b = components[offset++]; - int a = hasAlpha() ? components[offset++] : 255; - - return getPixelValue(a, r, g, b); - } - - public Object getDataElements(int[] components, int offset, Object pixel) - { - int pixelValue = getDataElement(components, offset); - - /* In this color model, the whole pixel fits in the first element - of the array. */ - DataBuffer buffer = Buffers.createBuffer(transferType, pixel, 1); - buffer.setElem(0, pixelValue); - return Buffers.getData(buffer); - } - - public SampleModel createCompatibleSampleModel(int w, int h) - { - int[] bandOffsets = {0}; - return new ComponentSampleModel(transferType, w, h, - 1, // pixel stride - w, // scanline stride - bandOffsets); - } } --- 1,271 ---- ! /* IndexColorModel.java -- Java class for interpreting Pixel objects ! Copyright (C) 1999 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ ! ! ! package java.awt.image; /** ! * ! * @author C. Brian Jones (cbj@gnu.org) */ public class IndexColorModel extends ColorModel { ! private int map_size; ! private boolean opaque; ! private int trans = -1; ! private int[] rgb; ! /** ! * Each array much contain size elements. For each ! * array, the i-th color is described by reds[i], greens[i], ! * blues[i], alphas[i], unless alphas is not specified, then all the ! * colors are opaque except for the transparent color. ! * ! * @param bits the number of bits needed to represent size colors ! * @param size the number of colors in the color map ! * @param reds the red component of all colors ! * @param greens the green component of all colors ! * @param blues the blue component of all colors ! */ ! public IndexColorModel(int bits, int size, byte[] reds, byte[] greens, ! byte[] blues) { ! this(bits, size, reds, greens, blues, (byte[])null); ! } ! /** ! * Each array much contain size elements. For each ! * array, the i-th color is described by reds[i], greens[i], ! * blues[i], alphas[i], unless alphas is not specified, then all the ! * colors are opaque except for the transparent color. ! * ! * @param bits the number of bits needed to represent size colors ! * @param size the number of colors in the color map ! * @param reds the red component of all colors ! * @param greens the green component of all colors ! * @param blues the blue component of all colors ! * @param trans the index of the transparent color ! */ ! public IndexColorModel(int bits, int size, byte[] reds, byte[] greens, ! byte[] blues, int trans) { ! this(bits, size, reds, greens, blues, (byte[])null); ! this.trans = trans; ! } ! /** ! * Each array much contain size elements. For each ! * array, the i-th color is described by reds[i], greens[i], ! * blues[i], alphas[i], unless alphas is not specified, then all the ! * colors are opaque except for the transparent color. ! * ! * @param bits the number of bits needed to represent size colors ! * @param size the number of colors in the color map ! * @param reds the red component of all colors ! * @param greens the green component of all colors ! * @param blues the blue component of all colors ! * @param alphas the alpha component of all colors ! */ ! public IndexColorModel(int bits, int size, byte[] reds, byte[] greens, ! byte[] blues, byte[] alphas) { ! super(bits); ! map_size = size; ! opaque = (alphas == null); ! rgb = new int[size]; ! if (alphas == null) { ! for (int i = 0; i < size; i++) { ! rgb[i] = 0xff000000 | ! ((reds[i] & 0xff) << 16) | ! ((greens[i] & 0xff) << 8) | ! (blues[i] & 0xff); ! } ! } ! else { ! for (int i = 0; i < size; i++) { ! rgb[i] = ((alphas[i] & 0xff) << 24 | ! ((reds[i] & 0xff) << 16) | ! ((greens[i] & 0xff) << 8) | ! (blues[i] & 0xff)); ! } ! } ! } ! /** ! * Each array much contain size elements. For each ! * array, the i-th color is described by reds[i], greens[i], ! * blues[i], alphas[i], unless alphas is not specified, then all the ! * colors are opaque except for the transparent color. ! * ! * @param bits the number of bits needed to represent size colors ! * @param size the number of colors in the color map ! * @param cmap packed color components ! * @param start the offset of the first color component in cmap ! * @param hasAlpha cmap has alpha values ! */ ! public IndexColorModel(int bits, int size, byte[] cmap, int start, ! boolean hasAlpha) { ! this(bits, size, cmap, start, hasAlpha, -1); ! } ! /** ! * Each array much contain size elements. For each ! * array, the i-th color is described by reds[i], greens[i], ! * blues[i], alphas[i], unless alphas is not specified, then all the ! * colors are opaque except for the transparent color. ! * ! * @param bits the number of bits needed to represent size colors ! * @param size the number of colors in the color map ! * @param cmap packed color components ! * @param start the offset of the first color component in cmap ! * @param hasAlpha cmap has alpha values ! * @param trans the index of the transparent color ! */ ! public IndexColorModel(int bits, int size, byte[] cmap, int start, ! boolean hasAlpha, int trans) { ! super(bits); ! map_size = size; ! opaque = !hasAlpha; ! this.trans = trans; ! } ! public final int getMapSize() { ! return map_size; ! } ! /** ! * Get the index of the transparent color in this color model ! */ ! public final int getTransparentPixel() { ! return trans; ! } ! /** ! *
        ! */ ! public final void getReds(byte[] r) { ! getComponents( r, 2 ); ! } ! /** ! *
        ! */ ! public final void getGreens(byte[] g) { ! getComponents( g, 1 ); ! } ! /** ! *
        ! */ ! public final void getBlues(byte[] b) { ! getComponents( b, 0 ); ! } ! /** ! *
        ! */ ! public final void getAlphas(byte[] a) { ! getComponents( a, 3 ); ! } ! private void getComponents( byte[] c, int ci ) ! { ! int i, max = ( map_size < c.length ) ? map_size : c.length; ! for( i = 0; i < max; i++ ) ! c[i] = (byte)(( generateMask( ci ) & rgb[i]) >> ( ci * pixel_bits) ); ! } ! /** ! * Get the red component of the given pixel. ! *
        ! */ ! public final int getRed(int pixel) { ! if( pixel < map_size ) ! return (int)(( generateMask( 2 ) & rgb[pixel]) >> (2 * pixel_bits ) ); ! return 0; ! } ! /** ! * Get the green component of the given pixel. ! *
        ! */ ! public final int getGreen(int pixel) { ! if( pixel < map_size ) ! return (int)(( generateMask( 1 ) & rgb[pixel]) >> (1 * pixel_bits ) ); ! return 0; ! } ! /** ! * Get the blue component of the given pixel. ! *
        ! */ ! public final int getBlue(int pixel) { ! if( pixel < map_size ) ! return (int)( generateMask( 0 ) & rgb[pixel]); ! return 0; ! } ! /** ! * Get the alpha component of the given pixel. ! *
        ! */ ! public final int getAlpha(int pixel) { ! if( pixel < map_size ) ! return (int)(( generateMask( 3 ) & rgb[pixel]) >> (3 * pixel_bits ) ); ! return 0; ! } ! /** ! * Get the RGB color value of the given pixel using the default ! * RGB color model. ! *
        ! * ! * @param pixel a pixel value ! */ ! public final int getRGB(int pixel) { ! if( pixel < map_size ) ! return rgb[pixel]; ! return 0; ! } ! //pixel_bits is number of bits to be in generated mask ! private int generateMask( int offset ) ! { ! return ( ( ( 2 << pixel_bits ) - 1 ) << ( pixel_bits * offset ) ); ! } } + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/MemoryImageSource.java gcc-3.3/libjava/java/awt/image/MemoryImageSource.java *** gcc-3.2.3/libjava/java/awt/image/MemoryImageSource.java 2002-01-26 08:35:34.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/MemoryImageSource.java 2002-08-09 05:52:52.000000000 +0000 *************** public class MemoryImageSource implement *** 116,122 **** Constructs an ImageProducer from memory using the default RGB ColorModel */ public MemoryImageSource(int w, int h, ! byte pix[], int off, int scan) { this ( w, h, ColorModel.getRGBdefault(), pix, off, scan, null); } --- 116,122 ---- Constructs an ImageProducer from memory using the default RGB ColorModel */ public MemoryImageSource(int w, int h, ! int pix[], int off, int scan) { this ( w, h, ColorModel.getRGBdefault(), pix, off, scan, null); } *************** public class MemoryImageSource implement *** 312,318 **** int scansize) { ! // FIXME } public synchronized void newPixels(int newpix[], --- 312,321 ---- int scansize) { ! if( animated == true ) ! { ! //FIXME ! } } public synchronized void newPixels(int newpix[], *************** public class MemoryImageSource implement *** 321,327 **** int scansize) { ! // FIXME } } --- 324,333 ---- int scansize) { ! if( animated == true ) ! { ! //FIXME ! } } } diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/PixelGrabber.java gcc-3.3/libjava/java/awt/image/PixelGrabber.java *** gcc-3.2.3/libjava/java/awt/image/PixelGrabber.java 2002-01-25 04:39:04.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/PixelGrabber.java 2002-08-09 04:26:16.000000000 +0000 *************** public class PixelGrabber implements Ima *** 151,157 **** @return true if successful ! @throws InterruptedExcpetion if interrupted by another thread. */ public boolean grabPixels() throws InterruptedException { --- 151,157 ---- @return true if successful ! @throws InterruptedException if interrupted by another thread. */ public boolean grabPixels() throws InterruptedException { *************** public class PixelGrabber implements Ima *** 163,169 **** @return true if successful ! @throws InterruptedExcpetion if interrupted by another thread. or time runs out */ public synchronized boolean grabPixels(long ms) throws InterruptedException --- 163,169 ---- @return true if successful ! @throws InterruptedException if interrupted by another thread. or time runs out */ public synchronized boolean grabPixels(long ms) throws InterruptedException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/RasterFormatException.java gcc-3.3/libjava/java/awt/image/RasterFormatException.java *** gcc-3.2.3/libjava/java/awt/image/RasterFormatException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/RasterFormatException.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,65 ---- + /* RasterFormatException.java -- indicates invalid layout in Raster + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image; + + /** + * This exception is thrown when there is invalid layout information in + * Raster + * + * @author Eric Blake + * @see Raster + * @status updated to 1.4 + */ + public class RasterFormatException extends RuntimeException + { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 96598996116164315L; + + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public RasterFormatException(String message) + { + super(message); + } + } // class RasterFormatException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java gcc-3.3/libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java *** gcc-3.2.3/libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/renderable/ContextualRenderedImageFactory.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,56 ---- + /* ContextualRenderedImageFactory.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image.renderable; + + import java.awt.geom.Rectangle2D; + import java.awt.image.RenderedImage; + + /** + * STUBBED + */ + public interface ContextualRenderedImageFactory extends RenderedImageFactory + { + RenderContext mapRenderContext(int i, RenderContext context, + ParameterBlock block, RenderableImage image); + RenderedImage create(RenderContext context, ParameterBlock block); + Rectangle2D getBounds2D(ParameterBlock block); + Object getProperty(ParameterBlock block, String name); + String[] getPropertyNames(); + boolean isDynamic(); + } // interface ContextualRenderedImageFactory diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/renderable/ParameterBlock.java gcc-3.3/libjava/java/awt/image/renderable/ParameterBlock.java *** gcc-3.2.3/libjava/java/awt/image/renderable/ParameterBlock.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/renderable/ParameterBlock.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,308 ---- + /* ParameterBlock.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image.renderable; + + import java.awt.image.RenderedImage; + import java.io.Serializable; + import java.util.Vector; + + public class ParameterBlock implements Cloneable, Serializable + { + private static final long serialVersionUID = -7577115551785240750L; + protected Vector sources; + protected Vector parameters; + + public ParameterBlock() + { + this(new Vector(), new Vector()); + } + + public ParameterBlock(Vector sources) + { + this(sources, new Vector()); + } + + public ParameterBlock(Vector sources, Vector parameters) + { + this.sources = sources; + this.parameters = parameters; + } + + public Object shallowClone() + { + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + throw (Error) new InternalError().initCause(e); // impossible + } + } + + public Object clone() + { + ParameterBlock pb = (ParameterBlock) shallowClone(); + if (sources != null) + pb.sources = (Vector) sources.clone(); + if (parameters != null) + pb.parameters = (Vector) parameters.clone(); + return pb; + } + + public ParameterBlock addSource(Object source) + { + sources.add(source); + return this; + } + + public Object getSource(int index) + { + return sources.get(index); + } + + public ParameterBlock setSource(Object source, int index) + { + sources.ensureCapacity(index); + sources.set(index, source); + return this; + } + + public RenderedImage getRenderedSource(int index) + { + return (RenderedImage) sources.get(index); + } + + public RenderableImage getRenderableSource(int index) + { + return (RenderableImage) sources.get(index); + } + + public int getNumSources() + { + return sources.size(); + } + + public Vector getSources() + { + return sources; + } + + public void setSources(Vector sources) + { + this.sources = sources; + } + + public void removeSources() + { + if (sources != null) + sources.clear(); + } + + public int getNumParameters() + { + return parameters.size(); + } + + public Vector getParameters() + { + return parameters; + } + + public void setParameters(Vector parameters) + { + this.parameters = parameters; + } + + public void removeParameters() + { + if (parameters != null) + parameters.clear(); + } + + public ParameterBlock add(Object o) + { + parameters.add(o); + return this; + } + + public ParameterBlock add(byte b) + { + return add(new Byte(b)); + } + + public ParameterBlock add(char c) + { + return add(new Character(c)); + } + + public ParameterBlock add(short s) + { + return add(new Short(s)); + } + + public ParameterBlock add(int i) + { + return add(new Integer(i)); + } + + public ParameterBlock add(long l) + { + return add(new Long(l)); + } + + public ParameterBlock add(float f) + { + return add(new Float(f)); + } + + public ParameterBlock add(double d) + { + return add(new Double(d)); + } + + public ParameterBlock set(Object o, int index) + { + parameters.ensureCapacity(index); + parameters.set(index, o); + return this; + } + + public ParameterBlock set(byte b, int index) + { + return set(new Byte(b), index); + } + + public ParameterBlock set(char c, int index) + { + return set(new Character(c), index); + } + + public ParameterBlock set(short s, int index) + { + return set(new Short(s), index); + } + + public ParameterBlock set(int i, int index) + { + return set(new Integer(i), index); + } + + public ParameterBlock set(long l, int index) + { + return set(new Long(l), index); + } + + public ParameterBlock set(float f, int index) + { + return set(new Float(f), index); + } + + public ParameterBlock set(double d, int index) + { + return set(new Double(d), index); + } + + public Object getObjectParameter(int index) + { + return parameters.get(index); + } + + public byte getByteParameter(int index) + { + return ((Byte) parameters.get(index)).byteValue(); + } + + public char getCharParameter(int index) + { + return ((Character) parameters.get(index)).charValue(); + } + + public short getShortParameter(int index) + { + return ((Short) parameters.get(index)).shortValue(); + } + + public int getIntParameter(int index) + { + return ((Integer) parameters.get(index)).intValue(); + } + + public long getLongParameter(int index) + { + return ((Long) parameters.get(index)).longValue(); + } + + public float getFloatParameter(int index) + { + return ((Float) parameters.get(index)).floatValue(); + } + + public double getDoubleParameter(int index) + { + return ((Double) parameters.get(index)).doubleValue(); + } + + public Class[] getParamClasses() + { + int i = parameters.size(); + Class[] result = new Class[i]; + while (--i >= 0) + { + Class c = parameters.get(i).getClass(); + if (c == Byte.class) + result[i] = byte.class; + else if (c == Character.class) + result[i] = char.class; + else if (c == Short.class) + result[i] = short.class; + else if (c == Integer.class) + result[i] = int.class; + else if (c == Long.class) + result[i] = long.class; + else if (c == Float.class) + result[i] = float.class; + else if (c == Double.class) + result[i] = double.class; + else + result[i] = c; + } + return result; + } + } // class ParameterBlock diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/renderable/RenderableImage.java gcc-3.3/libjava/java/awt/image/renderable/RenderableImage.java *** gcc-3.2.3/libjava/java/awt/image/renderable/RenderableImage.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/renderable/RenderableImage.java 2002-11-07 08:45:19.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* RenderableImage.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image.renderable; + + import java.awt.RenderingHints; + import java.awt.image.RenderedImage; + import java.util.Vector; + + public interface RenderableImage + { + static final String HINTS_OBSERVED = "HINTS_OBSERVED"; + Vector getSources(); + Object getProperty(String name); + String[] getPropertyNames(); + boolean isDynamic(); + float getWidth(); + float getHeight(); + float getMinX(); + float getMinY(); + RenderedImage createScaledRendering(int w, int h, RenderingHints hints); + RenderedImage createDefaultRendering(); + RenderedImage createRendering(RenderContext context); + } // interface RenderableImage diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/renderable/RenderableImageOp.java gcc-3.3/libjava/java/awt/image/renderable/RenderableImageOp.java *** gcc-3.2.3/libjava/java/awt/image/renderable/RenderableImageOp.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/renderable/RenderableImageOp.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,157 ---- + /* RenderableImageOp.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image.renderable; + + import java.awt.RenderingHints; + import java.awt.geom.AffineTransform; + import java.awt.image.RenderedImage; + import java.util.Vector; + + public class RenderableImageOp implements RenderableImage + { + private final ContextualRenderedImageFactory crif; + private ParameterBlock block; + + public RenderableImageOp(ContextualRenderedImageFactory crif, + ParameterBlock block) + { + this.crif = crif; + this.block = (ParameterBlock) block.clone(); + } + + public Vector getSources() + { + if (block.sources == null) + return null; + int size = block.sources.size(); + Vector v = new Vector(); + for (int i = 0; i < size; i++) + { + Object o = block.sources.get(i); + if (o instanceof RenderableImage) + v.add(o); + } + return v; + } + + public Object getProperty(String name) + { + return crif.getProperty(block, name); + } + + public String[] getPropertyNames() + { + return crif.getPropertyNames(); + } + + public boolean isDynamic() + { + return crif.isDynamic(); + } + + public float getWidth() + { + return (float) crif.getBounds2D(block).getWidth(); + } + + public float getHeight() + { + return (float) crif.getBounds2D(block).getHeight(); + } + + public float getMinX() + { + return (float) crif.getBounds2D(block).getX(); + } + + public float getMinY() + { + return (float) crif.getBounds2D(block).getY(); + } + + public ParameterBlock setParameterBlock(ParameterBlock block) + { + ParameterBlock result = this.block; + this.block = (ParameterBlock) block.clone(); + return result; + } + + public ParameterBlock getParameterBlock() + { + return block; + } + + public RenderedImage createScaledRendering(int w, int h, + RenderingHints hints) + { + if (w == 0) + if (h == 0) + throw new IllegalArgumentException(); + else + w = Math.round(h * getWidth() / getHeight()); + if (h == 0) + h = Math.round(w * getHeight() / getWidth()); + AffineTransform xform = AffineTransform.getScaleInstance(w * getWidth(), + h * getHeight()); + return createRendering(new RenderContext(xform, hints)); + } + + public RenderedImage createDefaultRendering() + { + return createRendering(new RenderContext(new AffineTransform())); + } + + public RenderedImage createRendering(RenderContext context) + { + ParameterBlock copy = (ParameterBlock) block.clone(); + int i = block.sources.size(); + while (--i >= 0) + { + Object o = block.sources.get(i); + if (o instanceof RenderableImage) + { + RenderableImage ri = (RenderableImage) o; + RenderContext rc = crif.mapRenderContext(i, context, block, ri); + copy.sources.set(i, ri.createRendering(rc)); + } + } + // Now copy.sources should be only RenderedImages. + return crif.create(context, copy); + } + } // class RenderableImageOp diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/renderable/RenderableImageProducer.java gcc-3.3/libjava/java/awt/image/renderable/RenderableImageProducer.java *** gcc-3.2.3/libjava/java/awt/image/renderable/RenderableImageProducer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/renderable/RenderableImageProducer.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,79 ---- + /* RenderableImageProducer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image.renderable; + + import java.awt.image.ImageConsumer; + import java.awt.image.ImageProducer; + + public class RenderableImageProducer implements ImageProducer, Runnable + { + public RenderableImageProducer(RenderableImage image, RenderContext context) + { + throw new Error("not implemented"); + } + + public void setRenderContext(RenderContext context) + { + } + + public void addConsumer(ImageConsumer consumer) + { + } + + public boolean isConsumer(ImageConsumer consumer) + { + return false; + } + + public void removeConsumer(ImageConsumer consumer) + { + } + + public void startProduction(ImageConsumer consumer) + { + } + + public void requestTopDownLeftRightResend(ImageConsumer consumer) + { + } + + public void run() + { + } + } // class RenderableImageProducer diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/renderable/RenderContext.java gcc-3.3/libjava/java/awt/image/renderable/RenderContext.java *** gcc-3.2.3/libjava/java/awt/image/renderable/RenderContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/renderable/RenderContext.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,141 ---- + /* RenderContext.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image.renderable; + + import java.awt.RenderingHints; + import java.awt.Shape; + import java.awt.geom.AffineTransform; + + public class RenderContext implements Cloneable + { + private AffineTransform xform; + private Shape aoi; + private RenderingHints hints; + + public RenderContext(AffineTransform xform, Shape aoi, RenderingHints hints) + { + this.xform = xform; + this.aoi = aoi; + this.hints = hints; + } + + public RenderContext(AffineTransform xform) + { + this(xform, null, null); + } + + public RenderContext(AffineTransform xform, RenderingHints hints) + { + this(xform, null, hints); + } + + public RenderContext(AffineTransform xform, Shape aoi) + { + this(xform, aoi, null); + } + + public RenderingHints getRenderingHints() + { + return hints; + } + + public void setRenderingHints(RenderingHints hints) + { + this.hints = hints; + } + + public void setTransform(AffineTransform xform) + { + this.xform = xform; + } + + public void preConcatenateTransform(AffineTransform pre) + { + xform.preConcatenate(pre); + } + + /** @deprecated Sun can't spell concatenate */ + public void preConcetenateTransform(AffineTransform pre) + { + preConcetenateTransform(pre); + } + + public void concatenateTransform(AffineTransform post) + { + xform.concatenate(post); + } + + /** @deprecated Sun can't spell concatenate */ + public void concetenateTransform(AffineTransform post) + { + concatenateTransform(post); + } + + public AffineTransform getTransform() + { + return xform; + } + + public void setAreaOfInterest(Shape aoi) + { + this.aoi = aoi; + } + + public Shape getAreaOfInterest() + { + return aoi; + } + + public Object clone() + { + try + { + RenderContext copy = (RenderContext) super.clone(); + if (xform != null) + copy.xform = (AffineTransform) xform.clone(); + if (hints != null) + copy.hints = (RenderingHints) hints.clone(); + return copy; + } + catch (CloneNotSupportedException e) + { + throw (Error) new InternalError().initCause(e); // impossible + } + } + } // class RenderContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/renderable/RenderedImageFactory.java gcc-3.3/libjava/java/awt/image/renderable/RenderedImageFactory.java *** gcc-3.2.3/libjava/java/awt/image/renderable/RenderedImageFactory.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/renderable/RenderedImageFactory.java 2002-08-09 04:29:59.000000000 +0000 *************** *** 0 **** --- 1,47 ---- + /* RenderedImageFactory.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image.renderable; + + import java.awt.RenderingHints; + import java.awt.image.RenderedImage; + + public interface RenderedImageFactory + { + RenderedImage create(ParameterBlock block, RenderingHints hints); + } // interface RenderedImageFactory diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/RenderedImage.java gcc-3.3/libjava/java/awt/image/RenderedImage.java *** gcc-3.2.3/libjava/java/awt/image/RenderedImage.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/RenderedImage.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,70 ---- + /* RenderedImage.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image; + + import java.awt.Rectangle; + import java.util.Vector; + + /** + * NEEDS DOCUMENTATION + */ + public interface RenderedImage + { + Vector getSources(); + Object getProperty(String name); + String[] getPropertyNames(); + ColorModel getColorModel(); + SampleModel getSampleModel(); + int getWidth(); + int getHeight(); + int getMinX(); + int getMinY(); + int getNumXTiles(); + int getNumYTiles(); + int getMinTileX(); + int getMinTileY(); + int getTileWidth(); + int getTileHeight(); + int getTileGridXOffset(); + int getTileGridYOffset(); + Raster getTile(int x, int y); + Raster getData(); + Raster getData(Rectangle r); + WritableRaster copyData(WritableRaster raster); + } // interface RenderedImage diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/TileObserver.java gcc-3.3/libjava/java/awt/image/TileObserver.java *** gcc-3.2.3/libjava/java/awt/image/TileObserver.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/TileObserver.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,47 ---- + /* TileObserver.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image; + + /** + * NEEDS DOCUMENTATION + */ + public interface TileObserver + { + void tileUpdate(WritableRenderedImage src, int x, int y, boolean writable); + } // interface TileObserver diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/VolatileImage.java gcc-3.3/libjava/java/awt/image/VolatileImage.java *** gcc-3.2.3/libjava/java/awt/image/VolatileImage.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/VolatileImage.java 2002-11-07 08:45:18.000000000 +0000 *************** *** 0 **** --- 1,74 ---- + /* VolatileImage.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image; + + import java.awt.Graphics; + import java.awt.Graphics2D; + import java.awt.GraphicsConfiguration; + import java.awt.Image; + import java.awt.ImageCapabilities; + + /** STUBS ONLY */ + public abstract class VolatileImage extends Image + { + public static final int IMAGE_OK = 0; + public static final int IMAGE_RESTORED = 1; + public static final int IMAGE_INCOMPATIBLE = 2; + public VolatileImage() + { + } + public abstract BufferedImage getSnapshot(); + public abstract int getWidth(); + public abstract int getHeight(); + public ImageProducer getSource() + { + return getSnapshot().getSource(); + } + public void flush() + { + } + public Graphics getGraphics() + { + return createGraphics(); + } + public abstract Graphics2D createGraphics(); + public abstract int validate(GraphicsConfiguration gc); + public abstract boolean contentsLost(); + public abstract ImageCapabilities getCapabilities(); + } // class VolatileImage diff -Nrc3pad gcc-3.2.3/libjava/java/awt/image/WritableRenderedImage.java gcc-3.3/libjava/java/awt/image/WritableRenderedImage.java *** gcc-3.2.3/libjava/java/awt/image/WritableRenderedImage.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/image/WritableRenderedImage.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,56 ---- + /* WritableRenderedImage.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.image; + + import java.awt.Point; + + /** + * NEEDS DOCUMENTATION + */ + public interface WritableRenderedImage extends RenderedImage + { + void addTileObserver(TileObserver to); + void removeTileObserver(TileObserver to); + WritableRaster getWritableTile(int x, int y); + void releaseWritableTile(int x, int y); + boolean isTileWritable(int x, int y); + Point[] getWritableTileIndices(); + boolean hasTileWriters(); + void setData(Raster r); + } // interface WritableRenderedImage diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ImageCapabilities.java gcc-3.3/libjava/java/awt/ImageCapabilities.java *** gcc-3.2.3/libjava/java/awt/ImageCapabilities.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/ImageCapabilities.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,70 ---- + /* ImageCapabilities.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * STUBS ONLY + */ + public class ImageCapabilities implements Cloneable + { + private final boolean accelerated; + public ImageCapabilities(boolean accelerated) + { + this.accelerated = accelerated; + } + public boolean isAccelerated() + { + return accelerated; + } + public boolean isTrueVolatile() + { + return true; + } + public Object clone() + { + try + { + return super.clone(); + } + catch (CloneNotSupportedException e) + { + throw (Error) new InternalError().initCause(e); // Impossible + } + } + } // class ImageCapabilities diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Image.java gcc-3.3/libjava/java/awt/Image.java *** gcc-3.2.3/libjava/java/awt/Image.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Image.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* Image.java -- Java class for images ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Image.java -- superclass for images ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,197 **** package java.awt; ! import java.awt.image.*; ! ! /** ! * This is the abstract superclass of all image objects in Java. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public abstract class Image ! { ! ! /* ! * Static Variables ! */ ! ! /** ! * Constant indicating that the default scaling algorithm should be used. ! */ ! public static final int SCALE_DEFAULT = 1; ! ! /** ! * Constant indicating that a fast scaling algorithm should be used. ! */ ! public static final int SCALE_FAST = 2; ! ! /** ! * Constant indicating that a smooth scaling algorithm should be used. ! */ ! public static final int SCALE_SMOOTH = 4; ! ! /** ! * Constant indicating that the ReplicateScaleFilter class ! * algorithm should be used for scaling. ! */ ! public static final int SCALE_REPLICATE = 8; ! ! /** ! * Constant indicating that the area averaging scaling algorithm should be ! * used. ! */ ! public static final int SCALE_AREA_AVERAGING = 16; /** ! * This variable is returned whenever a property that is not defined ! * is requested. ! */ ! public static final Object UndefinedProperty = Image.class; ! ! /*************************************************************************/ ! ! /* ! * Constructors */ ! ! /** ! * A default constructor for subclasses. ! */ ! public ! Image() { ! } ! ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * Returns the width of the image, or -1 if it is unknown. If the ! * image width is unknown, the observer object will be notified when ! * the value is known. ! * ! * @param observer The image observer for this object. ! */ ! public abstract int ! getWidth(ImageObserver observer); ! /*************************************************************************/ ! /** ! * Returns the height of the image, or -1 if it is unknown. If the ! * image height is unknown, the observer object will be notified when ! * the value is known. ! * ! * @param observer The image observer for this object. ! */ ! public abstract int ! getHeight(ImageObserver observer); ! /*************************************************************************/ ! /** ! * Returns the image producer object for this object. ! * ! * @return The image producer for this object. ! */ ! public abstract ImageProducer ! getSource(); ! /*************************************************************************/ ! /** ! * Returns a graphics context object for drawing an off-screen object. ! * This method is only valid for off-screen objects. ! * ! * @return A graphics context object for an off-screen object. ! */ ! public abstract Graphics ! getGraphics(); ! /*************************************************************************/ ! /** ! * This method requests a named property for an object. The value of the ! * property is returned. The value UndefinedProperty is ! * returned if there is no property with the specified name. The value ! * null is returned if the properties for the object are ! * not yet known. In this case, the specified image observer is notified ! * when the properties are known. ! * ! * @param name The requested property name. ! * @param observer The image observer for this object. ! */ ! public abstract Object ! getProperty(String name, ImageObserver observer); ! /*************************************************************************/ ! /** ! * Scales the image to the requested dimension. ! * ! * XXX: FIXME ! * ! * @param width The width of the scaled image. ! * @param height The height of the scaled image. ! * @param flags A value indicating the algorithm to use, which will be ! * set from contants defined in this class. ! * ! * @return The scaled Image object. ! */ ! public Image ! getScaledInstance(int width, int height, int flags) { ! return null; } ! /*************************************************************************/ ! ! /** ! * Flushes (that is, destroys) any resources used for this image. This ! * includes the actual image data. ! */ ! public abstract void ! flush(); ! } // class Image - --- 38,190 ---- package java.awt; ! import java.awt.image.AreaAveragingScaleFilter; ! import java.awt.image.ImageObserver; ! import java.awt.image.ImageProducer; ! import java.awt.image.ReplicateScaleFilter; /** ! * This is the abstract superclass of all image objects in Java. ! * ! * @author Aaron M. Renn ! * @since 1.0 ! * @status updated to 1.4 */ ! public abstract class Image { ! /** ! * This variable is returned whenever a property that is not defined ! * is requested. ! */ ! // For debug purposes, this might as well be a unique string. ! public static final Object UndefinedProperty ! = new String("undefined property"); ! /** ! * Constant indicating that the default scaling algorithm should be used. ! * ! * @since 1.1 ! */ ! public static final int SCALE_DEFAULT = 1; ! /** ! * Constant indicating that a fast scaling algorithm should be used. ! * ! * @since 1.1 ! */ ! public static final int SCALE_FAST = 2; ! /** ! * Constant indicating that a smooth scaling algorithm should be used. ! * ! * @since 1.1 ! */ ! public static final int SCALE_SMOOTH = 4; ! /** ! * Constant indicating that the ReplicateScaleFilter class ! * algorithm should be used for scaling. ! * ! * @see ReplicateScaleFilter ! * @since 1.1 ! */ ! public static final int SCALE_REPLICATE = 8; ! /** ! * Constant indicating that the area averaging scaling algorithm should be ! * used. ! * ! * @see AreaAveragingScaleFilter ! * @since 1.1 ! */ ! public static final int SCALE_AREA_AVERAGING = 16; ! /** ! * A default constructor for subclasses. ! */ ! public Image() ! { ! } ! /** ! * Returns the width of the image, or -1 if it is unknown. If the ! * image width is unknown, the observer object will be notified when ! * the value is known. ! * ! * @param observer the image observer for this object ! * @return the width in pixels ! * @see #getHeight(ImageObserver) ! */ ! public abstract int getWidth(ImageObserver observer); ! /** ! * Returns the height of the image, or -1 if it is unknown. If the ! * image height is unknown, the observer object will be notified when ! * the value is known. ! * ! * @param observer the image observer for this object ! * @return the height in pixels ! * @see #getWidth(ImageObserver) ! */ ! public abstract int getHeight(ImageObserver observer); ! /** ! * Returns the image producer object for this object. The producer is the ! * object which generates pixels for this image. ! * ! * @return the image producer for this object ! */ ! public abstract ImageProducer getSource(); ! /** ! * Returns a graphics context object for drawing an off-screen object. ! * This method is only valid for off-screen objects. ! * ! * @return a graphics context object for an off-screen object ! * @see Graphics#createImage(int, int) ! */ ! public abstract Graphics getGraphics(); ! /** ! * This method requests a named property for an object. The value of the ! * property is returned. The value UndefinedProperty is ! * returned if there is no property with the specified name. The value ! * null is returned if the properties for the object are ! * not yet known. In this case, the specified image observer is notified ! * when the properties are known. ! * ! * @param name the requested property name ! * @param observer the image observer for this object ! * @return the named property, if available ! * @see #UndefinedProperty ! */ ! public abstract Object getProperty(String name, ImageObserver observer); ! /** ! * Scales the image to the requested dimension. A new Image with asynchronous ! * loading will be produced according to the hints of the algorithm ! * requested. If either the width or height is non-positive, it is adjusted ! * to preserve the original aspect ratio. ! * ! * @param width the width of the scaled image ! * @param height the height of the scaled image ! * @param flags a value indicating the algorithm to use ! * @return the scaled Image object ! * @see #SCALE_DEFAULT ! * @see #SCALE_FAST ! * @see #SCALE_SMOOTH ! * @see #SCALE_REPLICATE ! * @see #SCALE_AREA_AVERAGING ! * @since 1.1 ! */ ! public Image getScaledInstance(int width, int height, int flags) { ! throw new Error("not implemented"); } ! /** ! * Flushes (that is, destroys) any resources used for this image. This ! * includes the actual image data. ! */ ! public abstract void flush(); } // class Image diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Insets.java gcc-3.3/libjava/java/awt/Insets.java *** gcc-3.2.3/libjava/java/awt/Insets.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Insets.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Insets.java -- Information about a container border. Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,4 ---- ! /* Insets.java -- information about a container border Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,174 **** package java.awt; ! /** ! * This class represents the "margin" or space around a container. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class Insets implements Cloneable, java.io.Serializable ! { ! ! /* ! * Instance Variable ! */ ! ! /** ! * @serial The top inset ! */ ! public int top; ! ! /** ! * @serial This bottom inset ! */ ! public int bottom; ! ! /** ! * @serial The left inset ! */ ! public int left; ! ! /** ! * @serial The right inset ! */ ! public int right; ! ! /*************************************************************************/ /** ! * Initializes a new instance of Inset with the specified ! * inset values. ! * ! * @param top The top inset ! * @param left The left inset ! * @param bottom The bottom inset ! * @param right The right inset ! */ ! public ! Insets(int top, int left, int bottom, int right) ! { ! this.top = top; ! this.left = left; ! this.bottom = bottom; ! this.right = right; ! } ! ! /*************************************************************************/ ! ! /* ! * Instance Methods */ ! ! /** ! * Tests whether this object is equal to the specified object. This will ! * be true if and only if the specified object: ! *

        ! *

          ! *
        • Is not null. ! *
        • Is an instance of Insets. ! *
        • Has the same top, bottom, left, and right inset values as this object. ! *
        ! * ! * @param obj The object to test against. ! * ! * @return true if the specified object is equal to this ! * one, false otherwise. ! */ ! public boolean ! equals(Object obj) { ! if (!(obj instanceof Insets)) ! return(false); ! Insets i = (Insets)obj; ! if (i.top != top) ! return(false); ! if (i.bottom != bottom) ! return(false); ! if (i.left != left) ! return(false); ! if (i.right != right) ! return(false); ! return(true); ! } ! public int ! hashCode() ! { ! return top + bottom + left + right; ! } ! /*************************************************************************/ ! /** ! * Returns a string representation of this object. ! * ! * @return A string representation of this object. ! */ ! public String ! toString() ! { ! return(getClass().getName() + "(top=" + top + ",bottom=" + bottom + ! ",left=" + left + ",right=" + right + ")"); ! } ! /*************************************************************************/ ! /** ! * Returns a copy of this object. ! * ! * @return A copy of this object. ! */ ! public Object ! clone() ! { ! try ! { ! return(super.clone()); ! } ! catch(Exception e) ! { ! return(null); ! } ! } ! } // class Insets --- 38,158 ---- package java.awt; ! import java.io.Serializable; /** ! * This class represents the "margin" or space around a container. ! * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @status */ ! public class Insets implements Cloneable, Serializable { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -2272572637695466749L; ! /** ! * The gap from the top. ! * ! * @serial the top inset ! */ ! public int top; ! /** ! * The gap from the left. ! * ! * @serial the left inset ! */ ! public int left; ! /** ! * The gap from the bottom. ! * ! * @serial the bottom inset ! */ ! public int bottom; ! /** ! * The gap from the right. ! * ! * @serial the right inset ! */ ! public int right; ! /** ! * Initializes a new instance of Inset with the specified ! * inset values. ! * ! * @param top the top inset ! * @param left the left inset ! * @param bottom the bottom inset ! * @param right the right inset ! */ ! public Insets(int top, int left, int bottom, int right) ! { ! this.top = top; ! this.left = left; ! this.bottom = bottom; ! this.right = right; ! } ! /** ! * Tests whether this object is equal to the specified object. The other ! * object must be an instance of Insets with identical field values. ! * ! * @param obj the object to test against ! * @return true if the specified object is equal to this one ! */ ! public boolean equals(Object obj) ! { ! if (! (obj instanceof Insets)) ! return false; ! Insets i = (Insets) obj; ! return top == i.top && bottom == i.bottom ! && left == i.left && right == i.right; ! } ! /** ! * Returns a hashcode for this instance. The formula is unspecified, but ! * appears to be XXX what is it? . ! * ! * @return the hashcode ! */ ! public int hashCode() ! { ! // This can't be right... ! return top + bottom + left + right; ! } ! /** ! * Returns a string representation of this object, which will be non-null. ! * The format is unspecified, but appears to be XXX what is it?. ! * ! * @return a string representation of this object ! */ ! public String toString() ! { ! return getClass().getName() + "(top=" + top + ",bottom=" + bottom + ! ",left=" + left + ",right=" + right + ')'; ! } ! /** ! * Returns a copy of this object. ! * ! * @return a copy of this object ! */ ! public Object clone() ! { ! try ! { ! return super.clone(); ! } ! catch (CloneNotSupportedException e) ! { ! throw (Error) new InternalError().initCause(e); // Impossible ! } ! } ! } // class Insets diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ItemSelectable.java gcc-3.3/libjava/java/awt/ItemSelectable.java *** gcc-3.2.3/libjava/java/awt/ItemSelectable.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/ItemSelectable.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* ItemSelectable.java -- Items that can be selected ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ItemSelectable.java -- items that can be selected ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.awt; *** 41,84 **** import java.awt.event.ItemListener; /** ! * This interface is for objects that can have one or more items ! * selected. For example, radio buttons. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface ItemSelectable { ! /** ! * Returns the list of objects that are selected in this component. ! * ! * @return The list of objects that are selected, or null if ! * no objects are selected. ! */ ! public abstract Object[] ! getSelectedObjects(); ! ! /*************************************************************************/ ! ! /** ! * Adds an item listener to this object. It will receive ! * selection events for this object. ! * ! * @param listener The item listener to add. ! */ ! public abstract void ! addItemListener(ItemListener listener); ! ! /*************************************************************************/ ! ! /** ! * Removes an item listener from this object. It will no longer receive ! * selection change events. ! * ! * @param listener The item listener to remove. ! */ ! public abstract void ! removeItemListener(ItemListener listener); } // interface ItemSelectable - --- 41,75 ---- import java.awt.event.ItemListener; /** ! * This interface is for objects that can have one or more items selected. ! * For example, radio buttons. ! * ! * @author Aaron M. Renn ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface ItemSelectable { + /** + * Returns the list of objects that are selected in this component. + * + * @return the list of selected objects, or null + */ + Object[] getSelectedObjects(); ! /** ! * Adds an item listener to this object. It will receive selection events ! * for this object by the user (but not programatically). If listener is ! * null, it is ignored. ! * ! * @param listener the item listener to add ! */ ! void addItemListener(ItemListener listener); + /** + * Removes an item listener from this object. + * + * @param listener the item listener to remove + */ + void removeItemListener(ItemListener listener); } // interface ItemSelectable diff -Nrc3pad gcc-3.2.3/libjava/java/awt/JobAttributes.java gcc-3.3/libjava/java/awt/JobAttributes.java *** gcc-3.2.3/libjava/java/awt/JobAttributes.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/JobAttributes.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,500 ---- + /* JobAttributes.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * Needs documentation... + * + * @author Eric Blake + * @since 1.3 + * @status updated to 1.4, lacks documentation + */ + public final class JobAttributes implements Cloneable + { + public static final class DefaultSelectionType extends AttributeValue + { + private static final String[] NAMES = { "all", "range", "selection" }; + public static final DefaultSelectionType ALL + = new DefaultSelectionType(0); + public static final DefaultSelectionType RANGE + = new DefaultSelectionType(1); + public static final DefaultSelectionType SELECTION + = new DefaultSelectionType(2); + private DefaultSelectionType(int value) + { + super(value, NAMES); + } + } // class DefaultSelectionType + + public static final class DestinationType extends AttributeValue + { + private static final String[] NAMES = { "file", "printer" }; + public static final DestinationType FILE = new DestinationType(0); + public static final DestinationType PRINTER = new DestinationType(1); + private DestinationType(int value) + { + super(value, NAMES); + } + } // class DestinationType + + public static final class DialogType extends AttributeValue + { + private static final String[] NAMES = { "common", "native", "none" }; + public static final DialogType COMMON = new DialogType(0); + public static final DialogType NATIVE = new DialogType(1); + public static final DialogType NONE = new DialogType(2); + private DialogType(int value) + { + super(value, NAMES); + } + } // class DialogType + + public static final class MultipleDocumentHandlingType + extends AttributeValue + { + private static final String[] NAMES = { + "separate-documents-collated-copies", + "separate-documents-uncollated-copies" + }; + public static final MultipleDocumentHandlingType + SEPARATE_DOCUMENTS_COLLATED_COPIES + = new MultipleDocumentHandlingType(0); + public static final MultipleDocumentHandlingType + SEPARATE_DOCUMENTS_UNCOLLATED_COPIES + = new MultipleDocumentHandlingType(1); + private MultipleDocumentHandlingType(int value) + { + super(value, NAMES); + } + } // class MultipleDocumentHandlingType + + public static final class SidesType extends AttributeValue + { + private static final String[] NAMES + = { "one-sided", "two-sided-long-edge", "two-sided-short-edge" }; + public static final SidesType ONE_SIDED = new SidesType(0); + public static final SidesType TWO_SIDED_LONG_EDGE = new SidesType(1); + public static final SidesType TWO_SIDED_SHORT_EDGE = new SidesType(2); + private SidesType(int value) + { + super(value, NAMES); + } + } // class SidesType + + private int copies; + private DefaultSelectionType selection; + private DestinationType destination; + private DialogType dialog; + private String filename; + private int maxPage; + private int minPage; + private MultipleDocumentHandlingType multiple; + private int[][] pageRanges; // null for default value + private int fromPage; // 0 for default value + private int toPage; // 0 for default value + private String printer; + private SidesType sides; + + public JobAttributes() + { + copies = 1; + selection = DefaultSelectionType.ALL; + destination = DestinationType.PRINTER; + dialog = DialogType.NATIVE; + maxPage = Integer.MAX_VALUE; + minPage = 1; + multiple + = MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES; + sides = SidesType.ONE_SIDED; + } + + public JobAttributes(JobAttributes attr) + { + set(attr); + } + + public JobAttributes(int copies, DefaultSelectionType selection, + DestinationType destination, DialogType dialog, + String filename, int max, int min, + MultipleDocumentHandlingType multiple, + int[][] pageRanges, String printer, SidesType sides) + { + if (copies <= 0 || selection == null || destination == null + || dialog == null || max < min || min <= 0 || multiple == null + || sides == null) + throw new IllegalArgumentException(); + this.copies = copies; + this.selection = selection; + this.destination = destination; + this.dialog = dialog; + this.filename = filename; + maxPage = max; + minPage = min; + this.multiple = multiple; + setPageRanges(pageRanges); + this.printer = printer; + this.sides = sides; + } + + public Object clone() + { + return new JobAttributes(this); + } + + public void set(JobAttributes attr) + { + copies = attr.copies; + selection = attr.selection; + destination = attr.destination; + dialog = attr.dialog; + filename = attr.filename; + maxPage = attr.maxPage; + minPage = attr.minPage; + multiple = attr.multiple; + pageRanges = (int[][]) attr.pageRanges.clone(); + printer = attr.printer; + sides = attr.sides; + fromPage = attr.fromPage; + toPage = attr.toPage; + } + + public int getCopies() + { + return copies; + } + + public void setCopies(int copies) + { + if (copies <= 0) + throw new IllegalArgumentException(); + this.copies = copies; + } + + public void setCopiesToDefault() + { + copies = 1; + } + + public DefaultSelectionType getDefaultSelection() + { + return selection; + } + + public void setDefaultSelection(DefaultSelectionType selection) + { + if (selection == null) + throw new IllegalArgumentException(); + this.selection = selection; + } + + public DestinationType getDestination() + { + return destination; + } + + public void setDestination(DestinationType destination) + { + if (destination == null) + throw new IllegalArgumentException(); + this.destination = destination; + } + + public DialogType getDialog() + { + return dialog; + } + + public void setDialog(DialogType dialog) + { + if (dialog == null) + throw new IllegalArgumentException(); + this.dialog = dialog; + } + + public String getFileName() + { + return filename; + } + + public void setFileName(String filename) + { + this.filename = filename; + } + + public int getFromPage() + { + return fromPage != 0 ? fromPage + : pageRanges != null ? pageRanges[0][0] + : toPage != 0 ? toPage : minPage; + } + + public void setFromPage(int fromPage) + { + if (fromPage < minPage || (fromPage > toPage && toPage != 0) + || fromPage > maxPage) + throw new IllegalArgumentException(); + if (pageRanges == null) + this.fromPage = fromPage; + } + + public int getMaxPage() + { + return maxPage; + } + + public void setMaxPage(int maxPage) + { + if (maxPage < minPage) + throw new IllegalArgumentException(); + this.maxPage = maxPage; + if (maxPage < fromPage) + fromPage = maxPage; + if (maxPage < toPage) + toPage = maxPage; + if (pageRanges != null) + { + int i = pageRanges.length - 1; + while (i >= 0 && maxPage < pageRanges[i][1]) + i--; + if (maxPage >= pageRanges[++i][0]) + pageRanges[i++][1] = maxPage; + if (i == 0) + pageRanges = null; + else if (i < pageRanges.length) + { + int[][] tmp = new int[i][]; + System.arraycopy(pageRanges, 0, tmp, 0, i); + pageRanges = tmp; + } + } + } + + public int getMinPage() + { + return minPage; + } + + public void setMinPage(int minPage) + { + if (minPage <= 0 || minPage > maxPage) + throw new IllegalArgumentException(); + this.minPage = minPage; + if (minPage > toPage) + toPage = minPage; + if (minPage > fromPage) + fromPage = minPage; + if (pageRanges != null) + { + int size = pageRanges.length; + int i = 0; + while (i < size && minPage > pageRanges[i][0]) + i++; + if (minPage <= pageRanges[i - 1][1]) + pageRanges[--i][0] = minPage; + if (i == size) + pageRanges = null; + else if (i > 0) + { + int[][] tmp = new int[size - i][]; + System.arraycopy(pageRanges, i, tmp, 0, size - i); + pageRanges = tmp; + } + } + } + + public MultipleDocumentHandlingType getMultipleDocumentHandling() + { + return multiple; + } + + public void setMultipleDocumentHandling + (MultipleDocumentHandlingType multiple) + { + if (multiple == null) + throw new IllegalArgumentException(); + this.multiple = multiple; + } + + public void setMultipleDocumentHandlingToDefault() + { + multiple + = MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES; + } + + public int[][] getPageRanges() + { + if (pageRanges == null) + return new int[][] { { getFromPage(), getToPage() } }; + // Perform a deep clone, so user code cannot affect original arrays. + int i = pageRanges.length; + int[][] result = new int[i][]; + while (--i >= 0) + result[i] = (int[]) pageRanges[i].clone(); + return result; + } + + public void setPageRanges(int[][] pageRanges) + { + int size = pageRanges == null ? 0 : pageRanges.length; + if (size == 0) + throw new IllegalArgumentException(); + while (--size >= 0) + { + int[] range = pageRanges[size]; + if (range == null || range.length != 2 + || range[0] < minPage || range[1] < range[0] || range[1] > maxPage + || (size != 0 && range[0] <= pageRanges[size - 1][1])) + throw new IllegalArgumentException(); + } + size = pageRanges.length; + if (fromPage > 0 && pageRanges[0][0] > fromPage) + fromPage = pageRanges[0][0]; + if (toPage > 0 && pageRanges[size - 1][1] < toPage) + toPage = pageRanges[size - 1][1]; + this.pageRanges = new int[size][]; + while (--size >= 0) + this.pageRanges[size] = (int[]) pageRanges[size].clone(); + } + + public String getPrinter() + { + return printer; + } + + public void setPrinter(String printer) + { + this.printer = printer; + } + + public SidesType getSides() + { + return sides; + } + + public void setSides(SidesType sides) + { + if (sides == null) + throw new IllegalArgumentException(); + this.sides = sides; + } + + public void setSidesToDefault() + { + sides = SidesType.ONE_SIDED; + } + + public int getToPage() + { + return toPage != 0 ? toPage + : pageRanges != null ? pageRanges[pageRanges.length - 1][1] + : fromPage != 0 ? fromPage : maxPage; + } + + public void setToPage(int toPage) + { + if (toPage < minPage || (fromPage > toPage && fromPage != 0) + || toPage > maxPage) + throw new IllegalArgumentException(); + if (pageRanges == null) + this.toPage = toPage; + } + + public boolean equals(Object o) + { + if (this == o) + return true; + if (! (o instanceof JobAttributes)) + return false; + JobAttributes ja = (JobAttributes) o; + if (copies != ja.copies || selection != ja.selection + || destination != ja.destination || dialog != ja.dialog + || ! filename.equals(ja.filename) || maxPage != ja.maxPage + || minPage != ja.minPage || multiple != ja.multiple + || fromPage != ja.fromPage || toPage != ja.toPage + || ! printer.equals(ja.printer) || sides != ja.sides + || (pageRanges == null) != (ja.pageRanges == null)) + return false; + if (pageRanges != ja.pageRanges) + for (int i = pageRanges.length; --i >= 0; ) + if (pageRanges[i][0] != ja.pageRanges[i][0] + || pageRanges[i][1] != ja.pageRanges[i][1]) + return false; + return true; + } + + public int hashCode() + { + int hash = (selection.value << 6) ^ (destination.value << 5) + ^ (dialog.value << 3) ^ (multiple.value << 2) ^ sides.value + ^ (filename == null ? 0 : filename.hashCode()) + ^ (printer == null ? 0 : printer.hashCode()); + // The effect of the above fields on the hashcode match the JDK. However, + // I am unable to reverse engineer the effect of the fields listed below, + // so I am using my own implementation. Note that this still satisfies + // the general contract of hashcode, it just doesn't match the JDK. + hash ^= (copies << 27) ^ (maxPage << 22) ^ (minPage << 17); + if (pageRanges == null) + hash ^= (getFromPage() << 13) ^ (getToPage() << 8); + else + for (int i = pageRanges.length; --i >= 0; ) + hash ^= (pageRanges[i][0] << 13) ^ (pageRanges[i][1] << 8); + return hash; + } + + public String toString() + { + StringBuffer s = new StringBuffer("copies=").append(copies) + .append(",defaultSelection=").append(selection).append(",destination=") + .append(destination).append(",dialog=").append(dialog) + .append(",fileName=").append(filename).append(",fromPage=") + .append(getFromPage()).append(",maxPage=").append(maxPage) + .append(",minPage=").append(minPage) + .append(",multiple-document-handling=").append(multiple) + .append(",page-ranges=["); + if (pageRanges == null) + s.append(minPage).append(':').append(minPage).append(']'); + else + for (int i = 0; i < pageRanges.length; i++) + s.append(pageRanges[i][0]).append(':').append(pageRanges[i][1]) + .append(','); + s.setLength(s.length() - 1); + return s.append("],printer=").append(printer).append(",sides=") + .append(sides).append(",toPage=").append(getToPage()).toString(); + } + } // class JobAttributes diff -Nrc3pad gcc-3.2.3/libjava/java/awt/KeyboardFocusManager.java gcc-3.3/libjava/java/awt/KeyboardFocusManager.java *** gcc-3.2.3/libjava/java/awt/KeyboardFocusManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/KeyboardFocusManager.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,556 ---- + /* KeyboardFocusManager.java -- manage component focusing via the keyboard + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.event.KeyEvent; + import java.beans.PropertyChangeListener; + import java.beans.PropertyChangeSupport; + import java.beans.PropertyVetoException; + import java.beans.VetoableChangeListener; + import java.beans.VetoableChangeSupport; + import java.util.ArrayList; + import java.util.Collections; + import java.util.HashSet; + import java.util.Iterator; + import java.util.List; + import java.util.Set; + + /** + * + * @author Eric Blake + * @since 1.4 + * @status partially updated to 1.4, needs documentation. + */ + public abstract class KeyboardFocusManager + implements KeyEventDispatcher, KeyEventPostProcessor + { + public static final int FORWARD_TRAVERSAL_KEYS = 0; + public static final int BACKWARD_TRAVERSAL_KEYS = 1; + public static final int UP_CYCLE_TRAVERSAL_KEYS = 2; + public static final int DOWN_CYCLE_TRAVERSAL_KEYS = 3; + + private static final Set DEFAULT_FORWARD_KEYS; + private static final Set DEFAULT_BACKWARD_KEYS; + static + { + Set s = new HashSet(); + s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0)); + s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, + KeyEvent.CTRL_DOWN_MASK)); + DEFAULT_FORWARD_KEYS = Collections.unmodifiableSet(s); + s = new HashSet(); + s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, + KeyEvent.SHIFT_DOWN_MASK)); + s.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, + KeyEvent.SHIFT_DOWN_MASK + | KeyEvent.CTRL_DOWN_MASK)); + DEFAULT_BACKWARD_KEYS = Collections.unmodifiableSet(s); + } + + private static KeyboardFocusManager current + = new DefaultKeyboardFocusManager(); + + // XXX Not implemented correctly. I think a good implementation here may + // be to have permanentFocusOwner be null, and fall back to focusOwner, + // unless a temporary focus change is in effect. + private static Component focusOwner; + private static Component permanentFocusOwner; + + private static Window focusedWindow; + private static Window activeWindow; + private static Container focusCycleRoot; + + private FocusTraversalPolicy defaultPolicy; + private Set[] defaultFocusKeys = new Set[] { + DEFAULT_FORWARD_KEYS, DEFAULT_BACKWARD_KEYS, + Collections.EMPTY_SET, Collections.EMPTY_SET + }; + + private final PropertyChangeSupport propertyChangeSupport + = new PropertyChangeSupport(this); + private final VetoableChangeSupport vetoableChangeSupport + = new VetoableChangeSupport(this); + private final ArrayList keyEventDispatchers = new ArrayList(); + private final ArrayList keyEventPostProcessors = new ArrayList(); + + + public KeyboardFocusManager() + { + } + + public static KeyboardFocusManager getCurrentKeyboardFocusManager() + { + // XXX Need a way to divide this into contexts. + return current; + } + + public static void setCurrentKeyboardFocusManager(KeyboardFocusManager m) + { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkPermission(new AWTPermission("replaceKeyboardFocusManager")); + // XXX Need a way to divide this into contexts. + current = m == null ? new DefaultKeyboardFocusManager() : m; + } + + public Component getFocusOwner() + { + // XXX Need an easy way to test if this thread is in the context of the + // global focus owner, to avoid creating the exception in the first place. + try + { + return getGlobalFocusOwner(); + } + catch (SecurityException e) + { + return null; + } + } + + protected Component getGlobalFocusOwner() + { + // XXX Need a way to test if this thread is in the context of the focus + // owner, and throw a SecurityException if that is the case. + // XXX Implement. + return focusOwner; + } + + protected void setGlobalFocusOwner(Component owner) + { + // XXX Should this send focus events to the components involved? + if (owner == null || owner.focusable) + { + firePropertyChange("focusOwner", focusOwner, owner); + try + { + fireVetoableChange("focusOwner", focusOwner, owner); + focusOwner = owner; + } + catch (PropertyVetoException e) + { + } + } + } + + public void clearGlobalFocusOwner() + { + // XXX Is this enough? + setGlobalFocusOwner(null); + } + + public Component getPermanentFocusOwner() + { + // XXX Need an easy way to test if this thread is in the context of the + // global focus owner, to avoid creating the exception in the first place. + try + { + return getGlobalPermanentFocusOwner(); + } + catch (SecurityException e) + { + return null; + } + } + + protected Component getGlobalPermanentFocusOwner() + { + // XXX Need a way to test if this thread is in the context of the focus + // owner, and throw a SecurityException if that is the case. + // XXX Implement. + return permanentFocusOwner == null ? focusOwner : permanentFocusOwner; + } + + protected void setGlobalPermanentFocusOwner(Component focusOwner) + { + // XXX Should this send focus events to the components involved? + if (focusOwner == null || focusOwner.focusable) + { + firePropertyChange("permanentFocusOwner", permanentFocusOwner, + focusOwner); + try + { + fireVetoableChange("permanentFocusOwner", permanentFocusOwner, + focusOwner); + permanentFocusOwner = focusOwner; + } + catch (PropertyVetoException e) + { + } + } + } + + public Window getFocusedWindow() + { + // XXX Need an easy way to test if this thread is in the context of the + // global focus owner, to avoid creating the exception in the first place. + try + { + return getGlobalFocusedWindow(); + } + catch (SecurityException e) + { + return null; + } + } + + protected Window getGlobalFocusedWindow() + { + // XXX Need a way to test if this thread is in the context of the focus + // owner, and throw a SecurityException if that is the case. + // XXX Implement. + return focusedWindow; + } + + protected void setGlobalFocusedWindow(Window window) + { + // XXX Should this send focus events to the windows involved? + if (window == null || window.focusable) + { + firePropertyChange("focusedWindow", focusedWindow, window); + try + { + fireVetoableChange("focusedWindow", focusedWindow, window); + focusedWindow = window; + } + catch (PropertyVetoException e) + { + } + } + } + + public Window getActiveWindow() + { + // XXX Need an easy way to test if this thread is in the context of the + // global focus owner, to avoid creating the exception in the first place. + try + { + return getGlobalActiveWindow(); + } + catch (SecurityException e) + { + return null; + } + } + + protected Window getGlobalActiveWindow() + { + // XXX Need a way to test if this thread is in the context of the focus + // owner, and throw a SecurityException if that is the case. + // XXX Implement. + return activeWindow; + } + + protected void setGlobalActiveWindow(Window window) + { + // XXX Should this send focus events to the windows involved? + firePropertyChange("activeWindow", activeWindow, window); + try + { + fireVetoableChange("activeWindow", activeWindow, window); + activeWindow = window; + } + catch (PropertyVetoException e) + { + } + } + + public FocusTraversalPolicy getDefaultFocusTraversalPolicy() + { + if (defaultPolicy == null) + defaultPolicy = new DefaultFocusTraversalPolicy(); + return defaultPolicy; + } + + public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy policy) + { + if (policy == null) + throw new IllegalArgumentException(); + firePropertyChange("defaultFocusTraversalPolicy", defaultPolicy, policy); + defaultPolicy = policy; + } + + public void setDefaultFocusTraversalKeys(int id, Set keystrokes) + { + if (keystrokes == null) + throw new IllegalArgumentException(); + Set sa; + Set sb; + Set sc; + String type; + switch (id) + { + case FORWARD_TRAVERSAL_KEYS: + sa = defaultFocusKeys[BACKWARD_TRAVERSAL_KEYS]; + sb = defaultFocusKeys[UP_CYCLE_TRAVERSAL_KEYS]; + sc = defaultFocusKeys[DOWN_CYCLE_TRAVERSAL_KEYS]; + type = "forwardDefaultFocusTraversalKeys"; + break; + case BACKWARD_TRAVERSAL_KEYS: + sa = defaultFocusKeys[FORWARD_TRAVERSAL_KEYS]; + sb = defaultFocusKeys[UP_CYCLE_TRAVERSAL_KEYS]; + sc = defaultFocusKeys[DOWN_CYCLE_TRAVERSAL_KEYS]; + type = "backwardDefaultFocusTraversalKeys"; + break; + case UP_CYCLE_TRAVERSAL_KEYS: + sa = defaultFocusKeys[FORWARD_TRAVERSAL_KEYS]; + sb = defaultFocusKeys[BACKWARD_TRAVERSAL_KEYS]; + sc = defaultFocusKeys[DOWN_CYCLE_TRAVERSAL_KEYS]; + type = "upCycleDefaultFocusTraversalKeys"; + break; + case DOWN_CYCLE_TRAVERSAL_KEYS: + sa = defaultFocusKeys[FORWARD_TRAVERSAL_KEYS]; + sb = defaultFocusKeys[BACKWARD_TRAVERSAL_KEYS]; + sc = defaultFocusKeys[UP_CYCLE_TRAVERSAL_KEYS]; + type = "downCycleDefaultFocusTraversalKeys"; + break; + default: + throw new IllegalArgumentException(); + } + int i = keystrokes.size(); + Iterator iter = keystrokes.iterator(); + while (--i >= 0) + { + Object o = iter.next(); + if (! (o instanceof AWTKeyStroke) + || sa.contains(o) || sb.contains(o) || sc.contains(o) + || ((AWTKeyStroke) o).keyCode == KeyEvent.VK_UNDEFINED) + throw new IllegalArgumentException(); + } + keystrokes = Collections.unmodifiableSet(new HashSet(keystrokes)); + firePropertyChange(type, defaultFocusKeys[id], keystrokes); + defaultFocusKeys[id] = keystrokes; + } + + public Set getDefaultFocusTraversalKeys(int id) + { + if (id < FORWARD_TRAVERSAL_KEYS || id > DOWN_CYCLE_TRAVERSAL_KEYS) + throw new IllegalArgumentException(); + return defaultFocusKeys[id]; + } + + public Container getCurrentFocusCycleRoot() + { + // XXX Need an easy way to test if this thread is in the context of the + // global focus owner, to avoid creating the exception in the first place. + try + { + return getGlobalCurrentFocusCycleRoot(); + } + catch (SecurityException e) + { + return null; + } + } + + protected Container getGlobalCurrentFocusCycleRoot() + { + // XXX Need a way to test if this thread is in the context of the focus + // owner, and throw a SecurityException if that is the case. + // XXX Implement. + return focusCycleRoot; + } + + protected void setGlobalCurrentFocusCycleRoot(Container cycleRoot) + { + firePropertyChange("currentFocusCycleRoot", focusCycleRoot, cycleRoot); + focusCycleRoot = cycleRoot; + } + + public void addPropertyChangeListener(PropertyChangeListener l) + { + if (l != null) + propertyChangeSupport.addPropertyChangeListener(l); + } + + public void removePropertyChangeListener(PropertyChangeListener l) + { + if (l != null) + propertyChangeSupport.removePropertyChangeListener(l); + } + + public PropertyChangeListener[] getPropertyChangeListeners() + { + return propertyChangeSupport.getPropertyChangeListeners(); + } + + public void addPropertyChangeListener(String name, PropertyChangeListener l) + { + if (l != null) + propertyChangeSupport.addPropertyChangeListener(name, l); + } + + public void removePropertyChangeListener(String name, + PropertyChangeListener l) + { + if (l != null) + propertyChangeSupport.removePropertyChangeListener(name, l); + } + + public PropertyChangeListener[] getPropertyChangeListeners(String name) + { + return propertyChangeSupport.getPropertyChangeListeners(name); + } + + protected void firePropertyChange(String name, Object o, Object n) + { + propertyChangeSupport.firePropertyChange(name, o, n); + } + + public void addVetoableChangeListener(VetoableChangeListener l) + { + if (l != null) + vetoableChangeSupport.addVetoableChangeListener(l); + } + + public void removeVetoableChangeListener(VetoableChangeListener l) + { + if (l != null) + vetoableChangeSupport.removeVetoableChangeListener(l); + } + + public VetoableChangeListener[] getVetoableChangeListeners() + { + return vetoableChangeSupport.getVetoableChangeListeners(); + } + + public void addVetoableChangeListener(String name, VetoableChangeListener l) + { + if (l != null) + vetoableChangeSupport.addVetoableChangeListener(name, l); + } + + public void removeVetoableChangeListener(String name, + VetoableChangeListener l) + { + if (l != null) + vetoableChangeSupport.removeVetoableChangeListener(name, l); + } + + public VetoableChangeListener[] getVetoableChangeListeners(String name) + { + return vetoableChangeSupport.getVetoableChangeListeners(name); + } + + protected void fireVetoableChange(String name, Object o, Object n) + throws PropertyVetoException + { + vetoableChangeSupport.fireVetoableChange(name, o, n); + } + + public void addKeyEventDispatcher(KeyEventDispatcher dispatcher) + { + if (dispatcher != null) + keyEventDispatchers.add(dispatcher); + } + + public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher) + { + keyEventDispatchers.remove(dispatcher); + } + + protected List getKeyEventDispatchers() + { + return (List) keyEventDispatchers.clone(); + } + + public void addKeyEventPostProcessor(KeyEventPostProcessor postProcessor) + { + if (postProcessor != null) + keyEventPostProcessors.add(postProcessor); + } + + public void removeKeyEventPostProcessor(KeyEventPostProcessor postProcessor) + { + keyEventPostProcessors.remove(postProcessor); + } + + protected List getKeyEventPostProcessors() + { + return (List) keyEventPostProcessors.clone(); + } + + public abstract boolean dispatchEvent(AWTEvent e); + + public final void redispatchEvent(Component target, AWTEvent e) + { + throw new Error("not implemented"); + } + + public abstract boolean dispatchKeyEvent(KeyEvent e); + + public abstract boolean postProcessKeyEvent(KeyEvent e); + + public abstract void processKeyEvent(Component focused, KeyEvent e); + + protected abstract void enqueueKeyEvents(long after, Component untilFocused); + + protected abstract void dequeueKeyEvents(long after, Component untilFocused); + + protected abstract void discardKeyEvents(Component comp); + + public abstract void focusNextComponent(Component comp); + + public abstract void focusPreviousComponent(Component comp); + + public abstract void upFocusCycle(Component comp); + + public abstract void downFocusCycle(Container cont); + + public final void focusNextComponent() + { + focusNextComponent(focusOwner); + } + + public final void focusPreviousComponent() + { + focusPreviousComponent(focusOwner); + } + + public final void upFocusCycle() + { + upFocusCycle(focusOwner); + } + + public final void downFocusCycle() + { + if (focusOwner instanceof Container + && ((Container) focusOwner).isFocusCycleRoot()) + downFocusCycle((Container) focusOwner); + } + } // class KeyboardFocusManager diff -Nrc3pad gcc-3.2.3/libjava/java/awt/KeyEventDispatcher.java gcc-3.3/libjava/java/awt/KeyEventDispatcher.java *** gcc-3.2.3/libjava/java/awt/KeyEventDispatcher.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/KeyEventDispatcher.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,82 ---- + /* KeyEventDispatcher.java -- dispatches key events + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.event.KeyEvent; + + /** + * An instance of this interface coordinates with a KeyboardFocusManager to + * target and dispatch all key events. This allows retargeting, consuming, + * changing, or otherwise manipulating the key event before sending it on to + * a target. + * + *

        By default, the KeyboardFocusManager is the sink for all key events not + * dispatched by other dispatchers. Therefore, it is unnecessary for the user + * to register the focus manager as a dispatcher. + * + * @author Eric Blake + * @see KeyboardFocusManager#addKeyEventDispatcher(KeyEventDispatcher) + * @see KeyboardFocusManager#removeKeyEventDispatcher(KeyEventDispatcher) + * @since 1.4 + * @status updated to 1.4 + */ + public interface KeyEventDispatcher + { + /** + * Called by the KeyboardFocusManager to request that a key event be + * dispatched. The dispatcher is free to retarget the event, consume it, + * dispatch it, or make other changes. This is usually done to allow + * delivery of key events to objects other than the window in focus, such + * as for navigating non-focusable components. If this dispatcher chooses + * to dispatch the event itself, it should call redispatchEvent + * to avoid infinite recursion. + * + *

        If the return value is false, the KeyEvent is passed to the next + * dispatcher in the chain, ending with the KeyboardFocusManager. If the + * return value is true, the event has been consumed (although it might + * have been ignored), and no further action will be taken on the event. Be + * sure to check whether the event was consumed before dispatching it + * further. + * + * @param e the key event + * @return true if the event has been consumed + * @see KeyboardFocusManager#redispatchEvent(Component, AWTEvent) + */ + boolean dispatchKeyEvent(KeyEvent e); + } // interface KeyEventDispatcher diff -Nrc3pad gcc-3.2.3/libjava/java/awt/KeyEventPostProcessor.java gcc-3.3/libjava/java/awt/KeyEventPostProcessor.java *** gcc-3.2.3/libjava/java/awt/KeyEventPostProcessor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/KeyEventPostProcessor.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,81 ---- + /* KeyEventPostProcessor.java -- performs actions after a key event dispatch + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.event.KeyEvent; + + /** + * An instance of this interface coordinates with a KeyboardFocusManager to + * target and dispatch all key events that are otherwise unconsumed. This + * allows events which take place when nothing has focus to still operate, + * such as menu keyboard shortcuts. + * + *

        By default, the KeyboardFocusManager is the sink for all key events not + * post-processed elsewhere. Therefore, it is unnecessary for the user + * to register the focus manager as a dispatcher. + * + * @author Eric Blake + * @see KeyboardFocusManager#addKeyEventPostProcessor(KeyEventPostProcessor) + * @see KeyboardFocusManager#removeKeyEventPostProcessor(KeyEventPostProcessor) + * @since 1.4 + * @status updated to 1.4 + */ + public interface KeyEventPostProcessor + { + /** + * Called by the KeyboardFocusManager to request that a key event be + * post-processed. Typically, the event has already been dispatched and + * handled, unless no object has focus. Thus, this allows global event + * handling for things like menu shortcuts. If this post-processor chooses + * to dispatch the event, it should call redispatchEvent + * to avoid infinite recursion. + * + *

        If the return value is false, the KeyEvent is passed to the next + * dispatcher in the chain, ending with the KeyboardFocusManager. If the + * return value is true, the event has been consumed (although it might + * have been ignored), and no further action will be taken on the event. Be + * sure to check whether the event was consumed before dispatching it + * further. + * + * @param e the key event + * @return true if the event has been consumed + * @see KeyboardFocusManager#redispatchEvent(Component, AWTEvent) + */ + boolean postProcessKeyEvent(KeyEvent e); + } // interface KeyEventPostProcessor diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Label.java gcc-3.3/libjava/java/awt/Label.java *** gcc-3.2.3/libjava/java/awt/Label.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/Label.java 2003-01-14 22:12:51.000000000 +0000 *************** package java.awt; *** 40,45 **** --- 40,47 ---- import java.awt.peer.LabelPeer; import java.awt.peer.ComponentPeer; + import java.io.Serializable; + import javax.accessibility.Accessible; /** * This component is used for displaying simple text strings that cannot *************** import java.awt.peer.ComponentPeer; *** 48,54 **** * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey */ ! public class Label extends Component implements java.io.Serializable { /* --- 50,56 ---- * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey */ ! public class Label extends Component implements Serializable, Accessible { /* *************** private String text; *** 99,104 **** --- 101,108 ---- /** * Initializes a new instance of Label with no text. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public Label() *************** Label() *** 113,118 **** --- 117,124 ---- * text that is aligned to the left. * * @param text The text of the label. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public Label(String text) *************** Label(String text) *** 130,141 **** --- 136,152 ---- * @param alignment The desired alignment for the text in this label, * which must be one of LEFT, CENTER, or * RIGHT. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public Label(String text, int alignment) { setAlignment (alignment); setText (text); + + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/LayoutManager2.java gcc-3.3/libjava/java/awt/LayoutManager2.java *** gcc-3.2.3/libjava/java/awt/LayoutManager2.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/LayoutManager2.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* LayoutManager2.java -- Enhanced layout manager. ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* LayoutManager2.java -- enhanced layout manager ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,108 **** package java.awt; /** ! * Layout manager for laying out containers based on contraints. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface LayoutManager2 extends LayoutManager { ! /** ! * Adds the specified component to the layout, with the specified ! * constraint object. ! * ! * @param component The component to add. ! * @param constraint The constraint object. ! */ ! public abstract void ! addLayoutComponent(Component component, Object contraint); ! ! /*************************************************************************/ ! ! /** ! * Determines the minimum size of the specified target container. ! * ! * @param target The target container. ! */ ! public abstract Dimension ! maximumLayoutSize(Container target); ! ! /*************************************************************************/ ! ! /** ! * Returns the preferred X axis alignment for the specified target ! * container. This value will range from 0 to 1 where 0 is alignment ! * closest to the origin, 0.5 is centered, and 1 is aligned furthest ! * from the origin. ! * ! * @param target The target container. ! */ ! public abstract float ! getLayoutAlignmentX(Container target); ! ! /*************************************************************************/ ! ! /** ! * Returns the preferred Y axis alignment for the specified target ! * container. This value will range from 0 to 1 where 0 is alignment ! * closest to the origin, 0.5 is centered, and 1 is aligned furthest ! * from the origin. ! * ! * @param target The target container. ! */ ! public abstract float ! getLayoutAlignmentY(Container target); ! ! /*************************************************************************/ ! /** ! * Forces the layout manager to purge any cached information about ! * the layout of the target container. This will force it to be ! * recalculated. ! * ! * @param target The target container. ! */ ! public abstract void ! invalidateLayout(Container target); ! } // interface LayoutManager2 --- 39,100 ---- package java.awt; /** ! * Layout manager for laying out containers based on contraints. The ! * constraints control how the layout will proceed. ! * ! * @author Aaron M. Renn ! * @see LayoutManager ! * @see Container ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface LayoutManager2 extends LayoutManager { + /** + * Adds the specified component to the layout, with the specified + * constraint object. + * + * @param component the component to add + * @param constraint the constraint to satisfy + */ + void addLayoutComponent(Component component, Object contraint); ! /** ! * Determines the maximum size of the specified target container. ! * ! * @param target the container to lay out ! * @return the maximum size of the container ! * @see Component#getMaximumSize() ! */ ! Dimension maximumLayoutSize(Container target); ! /** ! * Returns the preferred X axis alignment for the specified target ! * container. This value will range from 0 to 1 where 0 is alignment ! * closest to the origin, 0.5 is centered, and 1 is aligned furthest ! * from the origin. ! * ! * @param target the target container ! * @return the x-axis alignment preference ! */ ! float getLayoutAlignmentX(Container target); ! /** ! * Returns the preferred Y axis alignment for the specified target ! * container. This value will range from 0 to 1 where 0 is alignment ! * closest to the origin, 0.5 is centered, and 1 is aligned furthest ! * from the origin. ! * ! * @param target the target container ! * @return the y-axis alignment preference ! */ ! float getLayoutAlignmentY(Container target); + /** + * Forces the layout manager to purge any cached information about the + * layout of the target container. This will force it to be recalculated. + * + * @param target the target container + */ + void invalidateLayout(Container target); + } // interface LayoutManager2 diff -Nrc3pad gcc-3.2.3/libjava/java/awt/LayoutManager.java gcc-3.3/libjava/java/awt/LayoutManager.java *** gcc-3.2.3/libjava/java/awt/LayoutManager.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/LayoutManager.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* LayoutManager.java -- Layout containers in a Window ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* LayoutManager.java -- lay out elements in a Container ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,106 **** package java.awt; /** ! * This interface is for laying out containers. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface LayoutManager { ! /** ! * Adds the specified component to the layout group. ! * ! * @param name The name of the component to add. ! * @param component The component to add. ! */ ! public abstract void ! addLayoutComponent(String name, Component component); ! ! /*************************************************************************/ ! ! /** ! * Removes the specified component from the layout group. ! * ! * @param component The component to remove. ! */ ! public abstract void ! removeLayoutComponent(Component component); ! ! /*************************************************************************/ ! ! /** ! * Calculates the preferred size for this container, taking into account ! * the components in the specified parent container. ! * ! * @param parent The parent container. ! * ! * @return The preferred dimensions of this container. ! */ ! public abstract Dimension ! preferredLayoutSize(Container parent); ! ! /*************************************************************************/ ! ! /** ! * Calculates the minimum size for this container, taking into account ! * the components in the specified parent container. ! * ! * @param parent The parent container. ! * ! * @return The minimum dimensions of this container. ! */ ! public abstract Dimension ! minimumLayoutSize(Container parent); ! /*************************************************************************/ ! /** ! * Lays out the components in this container on the specified parent ! * container. ! * ! * @param parent The parent container. ! */ ! public abstract void ! layoutContainer(Container parent); } // interface LayoutManager - --- 39,92 ---- package java.awt; /** ! * This interface is for laying out containers in a particular sequence. ! * ! * @author Aaron M. Renn ! * @see Container ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface LayoutManager { + /** + * Adds the specified component to the layout group. + * + * @param name the name of the component to add + * @param component the component to add + */ + void addLayoutComponent(String name, Component component); ! /** ! * Removes the specified component from the layout group. ! * ! * @param component the component to remove ! */ ! void removeLayoutComponent(Component component); ! /** ! * Calculates the preferred size for this container, taking into account ! * the components it contains. ! * ! * @param parent the parent container to lay out ! * @return the preferred dimensions of this container ! * @see #minimumLayoutSize(Container) ! */ ! Dimension preferredLayoutSize(Container parent); ! /** ! * Calculates the minimum size for this container, taking into account ! * the components it contains. ! * ! * @param parent the parent container to lay out ! * @return the minimum dimensions of this container ! * @see #preferredLayoutSize(Container) ! */ ! Dimension minimumLayoutSize(Container parent); + /** + * Lays out the components in the given container. + * + * @param parent the container to lay out + */ + void layoutContainer(Container parent); } // interface LayoutManager diff -Nrc3pad gcc-3.2.3/libjava/java/awt/List.java gcc-3.3/libjava/java/awt/List.java *** gcc-3.2.3/libjava/java/awt/List.java 2002-01-30 02:47:48.000000000 +0000 --- gcc-3.3/libjava/java/awt/List.java 2003-01-14 22:12:51.000000000 +0000 *************** import java.awt.event.ItemListener; *** 46,58 **** import java.awt.peer.ListPeer; import java.awt.peer.ComponentPeer; import java.util.Vector; /** * Class that implements a listbox widget * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class List extends Component implements ItemSelectable, Serializable { /* --- 46,60 ---- import java.awt.peer.ListPeer; import java.awt.peer.ComponentPeer; import java.util.Vector; + import javax.accessibility.Accessible; /** * Class that implements a listbox widget * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class List extends Component ! implements ItemSelectable, Serializable, Accessible { /* *************** private ActionListener action_listeners; *** 113,118 **** --- 115,122 ---- /** * Initializes a new instance of List with no visible lines * and multi-select disabled. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public List() *************** List() *** 127,132 **** --- 131,138 ---- * number of visible lines and multi-select disabled. * * @param lines The number of visible lines in the list. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public List(int rows) *************** List(int rows) *** 143,154 **** --- 149,165 ---- * @param lines The number of visible lines in the list. * @param multipleMode true if multiple lines can be selected * simultaneously, false otherwise. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public List(int rows, boolean multipleMode) { this.rows = rows; this.multipleMode = multipleMode; + + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ *************** processEvent(AWTEvent event) *** 947,956 **** { if (event instanceof ActionEvent) processActionEvent((ActionEvent)event); ! if (event instanceof ItemEvent) processItemEvent((ItemEvent)event); ! ! super.processEvent(event); } /*************************************************************************/ --- 958,967 ---- { if (event instanceof ActionEvent) processActionEvent((ActionEvent)event); ! else if (event instanceof ItemEvent) processItemEvent((ItemEvent)event); ! else ! super.processEvent(event); } /*************************************************************************/ *************** processItemEvent(ItemEvent event) *** 989,994 **** --- 1000,1022 ---- item_listeners.itemStateChanged(event); } + void + dispatchEventImpl(AWTEvent e) + { + if (e.id <= ItemEvent.ITEM_LAST + && e.id >= ItemEvent.ITEM_FIRST + && (item_listeners != null + || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) + processEvent(e); + else if (e.id <= ActionEvent.ACTION_LAST + && e.id >= ActionEvent.ACTION_FIRST + && (action_listeners != null + || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) + processEvent(e); + else + super.dispatchEventImpl(e); + } + /*************************************************************************/ /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/MenuBar.java gcc-3.3/libjava/java/awt/MenuBar.java *** gcc-3.2.3/libjava/java/awt/MenuBar.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/MenuBar.java 2003-01-02 00:14:05.000000000 +0000 *************** private Vector menus = new Vector(); *** 86,95 **** --- 86,99 ---- /** * Initializes a new instance of MenuBar. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public MenuBar() { + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/MenuComponent.java gcc-3.3/libjava/java/awt/MenuComponent.java *** gcc-3.2.3/libjava/java/awt/MenuComponent.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/MenuComponent.java 2003-01-02 00:14:05.000000000 +0000 *************** private static transient Toolkit toolkit *** 92,101 **** --- 92,105 ---- /** * Default constructor for subclasses. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ protected MenuComponent() { + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/MenuContainer.java gcc-3.3/libjava/java/awt/MenuContainer.java *** gcc-3.2.3/libjava/java/awt/MenuContainer.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/MenuContainer.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* MenuContainer.java -- Container for menu items. Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,4 ---- ! /* MenuContainer.java -- container for menu items Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,80 **** package java.awt; /** ! * This interface is a container for menu components. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface MenuContainer { ! /** ! * Returns the font in use by this container. ! * ! * @return The font in use by this container. ! */ ! public abstract Font ! getFont(); ! ! /*************************************************************************/ ! ! /** ! * Removes the specified menu component from the menu. ! * ! * @param component The menu component to remove. ! */ ! public abstract void ! remove(MenuComponent component); ! ! /*************************************************************************/ ! ! /** ! * Posts and event to the listeners. This is replaced by ! * dispatchEvent. ! * ! * @param event The event to dispatch. ! * ! * @deprecated ! */ ! public abstract boolean ! postEvent(Event event); } // interface MenuContainer --- 39,71 ---- package java.awt; /** ! * This interface is a container for menu components. ! * ! * @author Aaron M. Renn ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface MenuContainer { + /** + * Returns the font in use by this container. + * + * @return the menu font + */ + Font getFont(); ! /** ! * Removes the specified menu component from the menu. ! * ! * @param component the menu component to remove ! */ ! void remove(MenuComponent component); + /** + * Posts an event to the listeners. + * + * @param event the event to dispatch + * @deprecated use {@link MenuComponent#dispatchEvent(AWTEvent)} instead + */ + boolean postEvent(Event event); } // interface MenuContainer diff -Nrc3pad gcc-3.2.3/libjava/java/awt/MenuItem.java gcc-3.3/libjava/java/awt/MenuItem.java *** gcc-3.2.3/libjava/java/awt/MenuItem.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/MenuItem.java 2002-08-09 04:26:14.000000000 +0000 *************** import java.awt.peer.MenuItemPeer; *** 42,47 **** --- 42,48 ---- import java.awt.peer.MenuComponentPeer; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import java.lang.reflect.Array; import java.util.EventListener; /** *************** private boolean enabled; *** 80,86 **** /** * @serial The mask of events that are enabled for this menu item. */ ! private long eventMask; /** * @serial This menu item's label --- 81,87 ---- /** * @serial The mask of events that are enabled for this menu item. */ ! long eventMask; /** * @serial This menu item's label *************** removeActionListener(ActionListener l) *** 385,403 **** action_listeners = AWTEventMulticaster.remove(action_listeners, l); } /** Returns all registered EventListers of the given listenerType. * listenerType must be a subclass of EventListener, or a * ClassClassException is thrown. * @since 1.3 */ ! public EventListener[] ! getListeners(Class listenerType) ! { ! if (listenerType == ActionListener.class) ! return Component.getListenersImpl(listenerType, action_listeners); ! else ! return Component.getListenersImpl(listenerType, null); ! } /*************************************************************************/ --- 386,409 ---- action_listeners = AWTEventMulticaster.remove(action_listeners, l); } + public synchronized ActionListener[] getActionListeners() + { + return (ActionListener[]) + AWTEventMulticaster.getListeners(action_listeners, + ActionListener.class); + } + /** Returns all registered EventListers of the given listenerType. * listenerType must be a subclass of EventListener, or a * ClassClassException is thrown. * @since 1.3 */ ! public EventListener[] getListeners(Class listenerType) ! { ! if (listenerType == ActionListener.class) ! return getActionListeners(); ! return (EventListener[]) Array.newInstance(listenerType, 0); ! } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Menu.java gcc-3.3/libjava/java/awt/Menu.java *** gcc-3.2.3/libjava/java/awt/Menu.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Menu.java 2003-01-02 00:14:04.000000000 +0000 *************** static final MenuItem separator = new Me *** 95,100 **** --- 95,102 ---- /** * Initializes a new instance of Menu with no label and that * is not a tearoff; + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public Menu() *************** Menu() *** 108,113 **** --- 110,117 ---- * that has the specified label. * * @param label The menu label. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public Menu(String label) *************** Menu(String label) *** 124,129 **** --- 128,135 ---- * @param label The label for this menu * @param isTearOff true if this menu is a tear off menu, * false otherwise. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. */ public Menu(String label, boolean isTearOff) *************** Menu(String label, boolean isTearOff) *** 134,139 **** --- 140,148 ---- if (label.equals("Help")) isHelpMenu = true; + + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/PageAttributes.java gcc-3.3/libjava/java/awt/PageAttributes.java *** gcc-3.2.3/libjava/java/awt/PageAttributes.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/PageAttributes.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,482 ---- + /* PageAttributes.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.util.Locale; + + /** + * Missing Documentation + * + * @author Eric Blake + * @since 1.3 + * @status updated to 1.4, but missing documentation + */ + public final class PageAttributes implements Cloneable + { + public static final class ColorType extends AttributeValue + { + private static final String[] NAMES = { "color", "monochrome" }; + public static final ColorType COLOR = new ColorType(0); + public static final ColorType MONOCHROME = new ColorType(1); + private ColorType(int value) + { + super(value, NAMES); + } + } // class ColorType + public static final class MediaType extends AttributeValue + { + private static final String[] NAMES + = { "iso-4a0", "iso-2a0", "iso-a0", "iso-a1", "iso-a2", "iso-a3", + "iso-a4", "iso-a5", "iso-a6", "iso-a7", "iso-a8", "iso-a9", + "iso-a10", "iso-b0", "iso-b1", "iso-b2", "iso-b3", "iso-b4", + "iso-b5", "iso-b6", "iso-b7", "iso-b8", "iso-b9", "iso-b10", + "jis-b0", "jis-b1", "jis-b2", "jis-b3", "jis-b4", "jis-b5", + "jis-b6", "jis-b7", "jis-b8", "jis-b9", "jis-b10", "iso-c0", + "iso-c1", "iso-c2", "iso-c3", "iso-c4", "iso-c5", "iso-c6", + "iso-c7", "iso-c8", "iso-c9", "iso-c10", "iso-designated-long", + "executive", "folio", "invoice", "ledger", "na-letter", "na-legal", + "quarto", "a", "b", "c", "d", "e", "na-10x15-envelope", + "na-10x14-envelope", "na-10x13-envelope", "na-9x12-envelope", + "na-9x11-envelope", "na-7x9-envelope", "na-6x9-envelope", + "na-number-9-envelope", "na-number-10-envelope", + "na-number-11-envelope", "na-number-12-envelope", + "na-number-14-envelope", "invite-envelope", "italy-envelope", + "monarch-envelope", "personal-envelope" }; + public static final MediaType ISO_4A0 = new MediaType(0); + public static final MediaType ISO_2A0 = new MediaType(1); + public static final MediaType ISO_A0 = new MediaType(2); + public static final MediaType ISO_A1 = new MediaType(3); + public static final MediaType ISO_A2 = new MediaType(4); + public static final MediaType ISO_A3 = new MediaType(5); + public static final MediaType ISO_A4 = new MediaType(6); + public static final MediaType ISO_A5 = new MediaType(7); + public static final MediaType ISO_A6 = new MediaType(8); + public static final MediaType ISO_A7 = new MediaType(9); + public static final MediaType ISO_A8 = new MediaType(10); + public static final MediaType ISO_A9 = new MediaType(11); + public static final MediaType ISO_A10 = new MediaType(12); + public static final MediaType ISO_B0 = new MediaType(13); + public static final MediaType ISO_B1 = new MediaType(14); + public static final MediaType ISO_B2 = new MediaType(15); + public static final MediaType ISO_B3 = new MediaType(16); + public static final MediaType ISO_B4 = new MediaType(17); + public static final MediaType ISO_B5 = new MediaType(18); + public static final MediaType ISO_B6 = new MediaType(19); + public static final MediaType ISO_B7 = new MediaType(20); + public static final MediaType ISO_B8 = new MediaType(21); + public static final MediaType ISO_B9 = new MediaType(22); + public static final MediaType ISO_B10 = new MediaType(23); + public static final MediaType JIS_B0 = new MediaType(24); + public static final MediaType JIS_B1 = new MediaType(25); + public static final MediaType JIS_B2 = new MediaType(26); + public static final MediaType JIS_B3 = new MediaType(27); + public static final MediaType JIS_B4 = new MediaType(28); + public static final MediaType JIS_B5 = new MediaType(29); + public static final MediaType JIS_B6 = new MediaType(30); + public static final MediaType JIS_B7 = new MediaType(31); + public static final MediaType JIS_B8 = new MediaType(32); + public static final MediaType JIS_B9 = new MediaType(33); + public static final MediaType JIS_B10 = new MediaType(34); + public static final MediaType ISO_C0 = new MediaType(35); + public static final MediaType ISO_C1 = new MediaType(36); + public static final MediaType ISO_C2 = new MediaType(37); + public static final MediaType ISO_C3 = new MediaType(38); + public static final MediaType ISO_C4 = new MediaType(39); + public static final MediaType ISO_C5 = new MediaType(40); + public static final MediaType ISO_C6 = new MediaType(41); + public static final MediaType ISO_C7 = new MediaType(42); + public static final MediaType ISO_C8 = new MediaType(43); + public static final MediaType ISO_C9 = new MediaType(44); + public static final MediaType ISO_C10 = new MediaType(45); + public static final MediaType ISO_DESIGNATED_LONG = new MediaType(46); + public static final MediaType EXECUTIVE = new MediaType(47); + public static final MediaType FOLIO = new MediaType(48); + public static final MediaType INVOICE = new MediaType(49); + public static final MediaType LEDGER = new MediaType(50); + public static final MediaType NA_LETTER = new MediaType(51); + public static final MediaType NA_LEGAL = new MediaType(52); + public static final MediaType QUARTO = new MediaType(53); + public static final MediaType A = new MediaType(54); + public static final MediaType B = new MediaType(55); + public static final MediaType C = new MediaType(56); + public static final MediaType D = new MediaType(57); + public static final MediaType E = new MediaType(58); + public static final MediaType NA_10X15_ENVELOPE = new MediaType(59); + public static final MediaType NA_10X14_ENVELOPE = new MediaType(60); + public static final MediaType NA_10X13_ENVELOPE = new MediaType(61); + public static final MediaType NA_9X12_ENVELOPE = new MediaType(62); + public static final MediaType NA_9X11_ENVELOPE = new MediaType(63); + public static final MediaType NA_7X9_ENVELOPE = new MediaType(64); + public static final MediaType NA_6X9_ENVELOPE = new MediaType(65); + public static final MediaType NA_NUMBER_9_ENVELOPE = new MediaType(66); + public static final MediaType NA_NUMBER_10_ENVELOPE = new MediaType(67); + public static final MediaType NA_NUMBER_11_ENVELOPE = new MediaType(68); + public static final MediaType NA_NUMBER_12_ENVELOPE = new MediaType(69); + public static final MediaType NA_NUMBER_14_ENVELOPE = new MediaType(70); + public static final MediaType INVITE_ENVELOPE = new MediaType(71); + public static final MediaType ITALY_ENVELOPE = new MediaType(72); + public static final MediaType MONARCH_ENVELOPE = new MediaType(73); + public static final MediaType PERSONAL_ENVELOPE = new MediaType(74); + public static final MediaType A0 = ISO_A0; + public static final MediaType A1 = ISO_A1; + public static final MediaType A2 = ISO_A2; + public static final MediaType A3 = ISO_A3; + public static final MediaType A4 = ISO_A4; + public static final MediaType A5 = ISO_A5; + public static final MediaType A6 = ISO_A6; + public static final MediaType A7 = ISO_A7; + public static final MediaType A8 = ISO_A8; + public static final MediaType A9 = ISO_A9; + public static final MediaType A10 = ISO_A10; + public static final MediaType B0 = ISO_B0; + public static final MediaType B1 = ISO_B1; + public static final MediaType B2 = ISO_B2; + public static final MediaType B3 = ISO_B3; + public static final MediaType B4 = ISO_B4; + public static final MediaType ISO_B4_ENVELOPE = ISO_B4; + public static final MediaType B5 = ISO_B5; + public static final MediaType ISO_B5_ENVELOPE = ISO_B4; + public static final MediaType B6 = ISO_B6; + public static final MediaType B7 = ISO_B7; + public static final MediaType B8 = ISO_B8; + public static final MediaType B9 = ISO_B9; + public static final MediaType B10 = ISO_B10; + public static final MediaType C0 = ISO_B0; + public static final MediaType ISO_C0_ENVELOPE = ISO_C0; + public static final MediaType C1 = ISO_C1; + public static final MediaType ISO_C1_ENVELOPE = ISO_C1; + public static final MediaType C2 = ISO_C2; + public static final MediaType ISO_C2_ENVELOPE = ISO_C2; + public static final MediaType C3 = ISO_C3; + public static final MediaType ISO_C3_ENVELOPE = ISO_C3; + public static final MediaType C4 = ISO_C4; + public static final MediaType ISO_C4_ENVELOPE = ISO_C4; + public static final MediaType C5 = ISO_C5; + public static final MediaType ISO_C5_ENVELOPE = ISO_C5; + public static final MediaType C6 = ISO_C6; + public static final MediaType ISO_C6_ENVELOPE = ISO_C6; + public static final MediaType C7 = ISO_C7; + public static final MediaType ISO_C7_ENVELOPE = ISO_C7; + public static final MediaType C8 = ISO_C8; + public static final MediaType ISO_C8_ENVELOPE = ISO_C8; + public static final MediaType C9 = ISO_C9; + public static final MediaType ISO_C9_ENVELOPE = ISO_C9; + public static final MediaType C10 = ISO_C10; + public static final MediaType ISO_C10_ENVELOPE = ISO_C10; + public static final MediaType ISO_DESIGNATED_LONG_ENVELOPE + = ISO_DESIGNATED_LONG; + public static final MediaType STATEMENT = INVOICE; + public static final MediaType TABLOID = LEDGER; + public static final MediaType LETTER = NA_LETTER; + public static final MediaType NOTE = NA_LETTER; + public static final MediaType LEGAL = NA_LEGAL; + public static final MediaType ENV_10X15 = NA_10X15_ENVELOPE; + public static final MediaType ENV_10X14 = NA_10X14_ENVELOPE; + public static final MediaType ENV_10X13 = NA_10X13_ENVELOPE; + public static final MediaType ENV_9X12 = NA_9X12_ENVELOPE; + public static final MediaType ENV_9X11 = NA_9X11_ENVELOPE; + public static final MediaType ENV_7X9 = NA_7X9_ENVELOPE; + public static final MediaType ENV_6X9 = NA_6X9_ENVELOPE; + public static final MediaType ENV_9 = NA_NUMBER_9_ENVELOPE; + public static final MediaType ENV_10 = NA_NUMBER_10_ENVELOPE; + public static final MediaType ENV_11 = NA_NUMBER_11_ENVELOPE; + public static final MediaType ENV_12 = NA_NUMBER_12_ENVELOPE; + public static final MediaType ENV_14 = NA_NUMBER_14_ENVELOPE; + public static final MediaType ENV_INVITE = INVITE_ENVELOPE; + public static final MediaType ENV_ITALY = ITALY_ENVELOPE; + public static final MediaType ENV_MONARCH = MONARCH_ENVELOPE; + public static final MediaType ENV_PERSONAL = PERSONAL_ENVELOPE; + public static final MediaType INVITE = INVITE_ENVELOPE; + public static final MediaType ITALY = ITALY_ENVELOPE; + public static final MediaType MONARCH = MONARCH_ENVELOPE; + public static final MediaType PERSONAL = PERSONAL_ENVELOPE; + private MediaType(int value) + { + super(value, NAMES); + } + } // class MediaType + public static final class OrientationRequestedType extends AttributeValue + { + private static final String[] NAMES = { "portrait", "landscape" }; + public static final OrientationRequestedType PORTRAIT + = new OrientationRequestedType(0); + public static final OrientationRequestedType LANDSCAPE + = new OrientationRequestedType(1); + private OrientationRequestedType(int value) + { + super(value, NAMES); + } + } // class OrientationRequestedType + public static final class OriginType extends AttributeValue + { + private static final String[] NAMES = { "physical", "printable" }; + public static final OriginType PHYSICAL = new OriginType(0); + public static final OriginType PRINTABLE = new OriginType(1); + private OriginType(int value) + { + super(value, NAMES); + } + } // class OriginType + public static final class PrintQualityType extends AttributeValue + { + private static final String[] NAMES = { "high", "normal", "draft" }; + public static final PrintQualityType HIGH = new PrintQualityType(0); + public static final PrintQualityType NORMAL = new PrintQualityType(1); + public static final PrintQualityType DRAFT = new PrintQualityType(2); + private PrintQualityType(int value) + { + super(value, NAMES); + } + } // class PrintQualityType + + + private ColorType color; + private MediaType media; + private OrientationRequestedType orientation; + private OriginType origin; + private PrintQualityType quality; + private int resolutionX; + private int resolutionY; + private int resolutionScale; + public PageAttributes() + { + color = ColorType.MONOCHROME; + setMediaToDefault(); + orientation = OrientationRequestedType.PORTRAIT; + origin = OriginType.PHYSICAL; + quality = PrintQualityType.NORMAL; + setPrinterResolutionToDefault(); + } + + public PageAttributes(PageAttributes attr) + { + set(attr); + } + + public PageAttributes(ColorType color, MediaType media, + OrientationRequestedType orientation, + OriginType origin, PrintQualityType quality, + int[] resolution) + { + if (color == null || media == null || orientation == null + || origin == null || quality == null) + throw new IllegalArgumentException(); + setPrinterResolution(resolution); + this.color = color; + this.media = media; + this.orientation = orientation; + this.origin = origin; + this.quality = quality; + } + + public Object clone() + { + return new PageAttributes(this); + } + + public void set(PageAttributes attr) + { + color = attr.color; + media = attr.media; + orientation = attr.orientation; + origin = attr.origin; + quality = attr.quality; + resolutionX = attr.resolutionX; + resolutionY = attr.resolutionY; + resolutionScale = attr.resolutionScale; + } + + public ColorType getColor() + { + return color; + } + + public void setColor(ColorType color) + { + if (color == null) + throw new IllegalArgumentException(); + this.color = color; + } + + public MediaType getMedia() + { + return media; + } + + public void setMedia(MediaType media) + { + if (media == null) + throw new IllegalArgumentException(); + this.media = media; + } + + public void setMediaToDefault() + { + String country = Locale.getDefault().getCountry(); + media = ("US".equals(country) || "CA".equals(country)) ? MediaType.LETTER + : MediaType.A4; + } + + public OrientationRequestedType getOrientationRequested() + { + return orientation; + } + + public void setOrientationRequested(OrientationRequestedType orientation) + { + if (orientation == null) + throw new IllegalArgumentException(); + this.orientation = orientation; + } + + public void setOrientationRequested(int orientation) + { + if (orientation == 3) + this.orientation = OrientationRequestedType.PORTRAIT; + else if (orientation == 4) + this.orientation = OrientationRequestedType.LANDSCAPE; + else + throw new IllegalArgumentException(); + } + + public void setOrientationRequestedToDefault() + { + orientation = OrientationRequestedType.PORTRAIT; + } + + public OriginType getOrigin() + { + return origin; + } + + public void setOrigin(OriginType origin) + { + if (origin == null) + throw new IllegalArgumentException(); + this.origin = origin; + } + + public PrintQualityType getPrintQuality() + { + return quality; + } + + public void setPrintQuality(PrintQualityType quality) + { + if (quality == null) + throw new IllegalArgumentException(); + this.quality = quality; + } + + public void setPrintQuality(int quality) + { + if (quality == 3) + this.quality = PrintQualityType.DRAFT; + else if (quality == 4) + this.quality = PrintQualityType.NORMAL; + else if (quality == 5) + this.quality = PrintQualityType.HIGH; + else + throw new IllegalArgumentException(); + } + + public void setPrintQualityToDefault() + { + quality = PrintQualityType.NORMAL; + } + + public int[] getPrinterResolution() + { + return new int[] { resolutionX, resolutionY, resolutionScale }; + } + + public void setPrinterResolution(int[] resolution) + { + if (resolution == null || resolution.length != 3 || resolution[0] <= 0 + || resolution[1] <= 0 || resolution[2] < 3 || resolution[2] > 4) + throw new IllegalArgumentException(); + resolutionX = resolution[0]; + resolutionY = resolution[1]; + resolutionScale = resolution[2]; + } + + public void setPrinterResolution(int resolution) + { + if (resolution <= 0) + throw new IllegalArgumentException(); + resolutionX = resolution; + resolutionY = resolution; + resolutionScale = 3; + } + + public void setPrinterResolutionToDefault() + { + resolutionX = 72; + resolutionY = 72; + resolutionScale = 3; + } + + public boolean equals(Object o) + { + if (this == o) + return true; + if (! (o instanceof PageAttributes)) + return false; + PageAttributes pa = (PageAttributes) o; + return color == pa.color && media == pa.media + && orientation == pa.orientation && origin == pa.origin + && quality == pa.quality && resolutionX == pa.resolutionX + && resolutionY == pa.resolutionY + && resolutionScale == pa.resolutionScale; + } + public int hashCode() + { + return (color.value << 31) ^ (media.value << 24) + ^ (orientation.value << 23) ^ (origin.value << 22) + ^ (quality.value << 20) ^ (resolutionScale << 19) + ^ (resolutionY << 10) ^ resolutionX; + } + public String toString() + { + return "color=" + color + ",media=" + media + ",orientation-requested=" + + orientation + ",origin=" + origin + ",print-quality=" + quality + + ",printer-resolution=[" + resolutionX + ',' + resolutionY + ',' + + resolutionScale + ']'; + } + } // class PageAttributes diff -Nrc3pad gcc-3.2.3/libjava/java/awt/PaintContext.java gcc-3.3/libjava/java/awt/PaintContext.java *** gcc-3.2.3/libjava/java/awt/PaintContext.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/PaintContext.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* PaintContext.java -- the environment for performing a paint operation ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,57 **** package java.awt; ! /** ! * @author Warren Levy ! * @date March 16, 2000. ! */ /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Partially stubbed. */ - public interface PaintContext { ! public void dispose(); ! // FIXME ! // public ColorModel getColorModel(); ! // public Raster getRaster(int x, int y, int w, int h); ! } --- 38,76 ---- package java.awt; ! import java.awt.image.ColorModel; ! import java.awt.image.Raster; /** ! * @author Warren Levy ! * @see Paint ! * @since 1.1 ! * @status updated to 1.4 */ public interface PaintContext { ! /** ! * Release the resources allocated for the paint. ! */ ! void dispose(); ! ! /** ! * Return the color model of this context. It may be different from the ! * hint specified during createContext, as not all contexts can generate ! * color patterns in an arbitrary model. ! * ! * @return the context color model ! */ ! ColorModel getColorModel(); ! ! /** ! * Return a raster containing the colors for the graphics operation. ! * ! * @param x the x-coordinate, in device space ! * @param y the y-coordinate, in device space ! * @param w the width, in device space ! * @param h the height, in device space ! * @return a raster for the given area and color ! */ ! Raster getRaster(int x, int y, int w, int h); ! } // interface PaintContext diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Paint.java gcc-3.3/libjava/java/awt/Paint.java *** gcc-3.2.3/libjava/java/awt/Paint.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/Paint.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Paint.java -- generate colors for Graphics2D operations ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,59 **** package java.awt; ! /** ! * @author Warren Levy ! * @date March 15, 2000. ! */ /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Stubbed. */ - public interface Paint extends Transparency { ! // FIXME ! // public PaintContext createContext(ColorModel cm, ! // Rectangle deviceBounds, ! // Rectangle2D userBounds, ! // AffineTransform xform, ! // RenderingHints hints); ! } --- 38,79 ---- package java.awt; ! import java.awt.geom.AffineTransform; ! import java.awt.geom.Rectangle2D; ! import java.awt.image.ColorModel; /** ! * Defines how color patterns are generated for Graphics2D operations. This ! * is used to perform the draw and fill methods ! * of the graphics object. Instances must be immutable, because the graphics ! * object does not clone them. ! * ! * @author Warren Levy ! * @see PaintContext ! * @see Color ! * @see GradientPaint ! * @see TexturePaint ! * @see Graphics2D#setPaint(Paint) ! * @since 1.1 ! * @status updated to 1.4 */ public interface Paint extends Transparency { ! /** ! * Create the context necessary for performing the color pattern generation. ! * The color model is a hint, and may be null for Classpath implementations; ! * however some legacy code may throw a NullPointerException when passed a ! * null. Leaving the color model null provides the most efficiency and leeway ! * in the generation of the color pattern. ! * ! * @param cm the color model, used as a hint ! * @param deviceBounds the device space bounding box of the painted area ! * @param userBounds the user space bounding box of the painted area ! * @param xform the transformation from user space to device space ! * @param hints any hints for choosing between rendering alternatives ! * @return the context for performing the paint ! */ ! PaintContext createContext(ColorModel cm, Rectangle deviceBounds, ! Rectangle2D userBounds, AffineTransform xform, ! RenderingHints hints); ! } // interface Paint diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Panel.java gcc-3.3/libjava/java/awt/Panel.java *** gcc-3.2.3/libjava/java/awt/Panel.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/Panel.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Panel.java -- Simple container object. Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,4 ---- ! /* Panel.java -- Simple container object Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.awt; *** 41,99 **** import java.awt.peer.PanelPeer; import java.awt.peer.ContainerPeer; import java.awt.peer.ComponentPeer; /** ! * A panel is a simple container class. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class Panel extends Container implements java.io.Serializable { ! /* ! * Constructors ! */ ! /** ! * Initializes a new instance of Panel that has a default ! * layout manager of FlowLayout. ! */ ! public ! Panel() ! { ! this(new FlowLayout()); ! } ! /*************************************************************************/ ! /** ! * Initializes a new instance of Panel with the specified ! * layout manager. ! * ! * @param layoutManager The layout manager for this object. ! */ ! public ! Panel(LayoutManager layoutManager) ! { ! setLayout(layoutManager); ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * Notifies this object to create its native peer. ! */ ! public void ! addNotify() ! { ! if (peer == null) ! peer = getToolkit().createPanel(this); ! super.addNotify(); ! } } // class Panel - --- 41,149 ---- import java.awt.peer.PanelPeer; import java.awt.peer.ContainerPeer; import java.awt.peer.ComponentPeer; + import java.io.Serializable; + import javax.accessibility.Accessible; + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; /** ! * A panel is a simple container class. It's default layout is the ! * FlowLayout manager. ! * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @see FlowLayout ! * @since 1.0 ! * @status updated to 1.4 ! */ ! public class Panel extends Container implements Accessible { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -2728009084054400034L; ! /** The cached accessible context. */ ! private transient AccessibleContext context; ! /** ! * Initializes a new instance of Panel that has a default ! * layout manager of FlowLayout. ! */ ! public Panel() ! { ! this(new FlowLayout()); ! } ! /** ! * Initializes a new instance of Panel with the specified ! * layout manager. ! * ! * @param layoutManager the layout manager for this object ! * @since 1.1 ! */ ! public Panel(LayoutManager layoutManager) ! { ! setLayout(layoutManager); ! } ! /** ! * Notifies this object to create its native peer. ! * ! * @see #isDisplayable() ! * @see #removeNotify() ! */ ! public void addNotify() ! { ! if (peer == null) ! peer = getToolkit().createPanel(this); ! super.addNotify(); ! } ! /** ! * Gets the AccessibleContext associated with this panel, creating one if ! * necessary. This always returns an instance of {@link AccessibleAWTPanel}. ! * ! * @return the accessibility context of this panel ! * @since 1.3 ! */ ! public AccessibleContext getAccessibleContext() ! { ! if (context == null) ! context = new AccessibleAWTPanel(); ! return context; ! } ! /** ! * This class provides accessibility support for Panels, and is the ! * runtime type returned by {@link #getAccessibleContext()}. ! * ! * @author Eric Blake ! * @since 1.3 ! */ ! protected class AccessibleAWTPanel extends AccessibleAWTContainer ! { ! /** ! * Compatible with JDK 1.4+. ! */ ! private static final long serialVersionUID = -6409552226660031050L; ! /** ! * The default constructor. ! */ ! protected AccessibleAWTPanel() ! { ! } + /** + * Get the role of this accessible object, a panel. + * + * @return the role of the object + * @see AccessibleRole#PANEL + */ + public AccessibleRole getAccessibleRole() + { + return AccessibleRole.PANEL; + } + } // class AccessibleAWTPanel } // class Panel diff -Nrc3pad gcc-3.2.3/libjava/java/awt/peer/ContainerPeer.java gcc-3.3/libjava/java/awt/peer/ContainerPeer.java *** gcc-3.2.3/libjava/java/awt/peer/ContainerPeer.java 2002-01-22 22:58:09.000000000 +0000 --- gcc-3.3/libjava/java/awt/peer/ContainerPeer.java 2002-11-07 13:01:34.000000000 +0000 *************** this exception to your version of the li *** 35,52 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.awt.peer; import java.awt.Insets; public interface ContainerPeer extends ComponentPeer { ! ! public abstract Insets insets(); ! public abstract Insets getInsets(); ! public abstract void beginValidate(); ! public abstract void endValidate(); ! } // interface ContainerPeer --- 35,49 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt.peer; import java.awt.Insets; public interface ContainerPeer extends ComponentPeer { ! public abstract Insets insets(); ! public abstract Insets getInsets(); ! public abstract void beginValidate(); ! public abstract void endValidate(); } // interface ContainerPeer diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Point.java gcc-3.3/libjava/java/awt/Point.java *** gcc-3.2.3/libjava/java/awt/Point.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/Point.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Point.java -- represents a point in 2-D space ! Copyright (C) 1999, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 36,179 **** package java.awt; - import java.awt.geom.Point2D; ! /* Written using "Java Class Libraries", 2nd edition, plus online ! * API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: Believed complete and correct, except that neither toString ! * nor hashCode have been compared with JDK output. ! */ /** * This class represents a point on the screen using cartesian coordinates. * * @author Per Bothner ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @date February 8, 1999. */ ! public class Point extends Point2D implements java.io.Serializable { /** ! * @serial The X coordinate of the point. */ public int x; /** ! * @serial The Y coordinate of the point. */ public int y; /** * Initializes a new instance of Point representing the * coordiates (0,0). */ ! public Point () { } /** * Initializes a new instance of Point with coordinates * identical to the coordinates of the specified points. * ! * @param point The point to copy the coordinates from. */ ! public Point (Point p) { this.x = p.x; this.y = p.y; } /** * Initializes a new instance of Point with the specified * coordinates. * ! * @param x The X coordinate of this point. ! * @param y The Y coordinate of this point. */ ! public Point (int x, int y) { this.x = x; this.y = y; } /** ! * Tests whether or not this object is equal to the specified object. ! * This will be true if and only if the specified objectj: ! *

        ! *

          ! *
        • Is not null. ! *
        • Is an instance of Point. ! *
        • Has X and Y coordinates equal to this object's. ! *
        * ! * @param obj The object to test against for equality. * ! * @return true if the specified object is equal to this ! * object, false otherwise. ! */ ! public boolean equals (Object obj) { ! if (! (obj instanceof Point)) ! return false; ! Point p = (Point) obj; ! return this.x == p.x && this.y == p.y; } /** ! * Returns a hash value for this point. * ! * @param A hash value for this point. */ ! public int hashCode () { return x ^ y; } /** ! * Returns the location of this object as a point. A pretty useless ! * method. It is included to mimic the getLocation method ! * in component. * ! * @return This point. */ ! public Point getLocation () { return new Point(this); } /** * Sets this object's coordinates to the specified values. This method ! * is identical to the setLocation(int, int) method. * ! * @param x The new X coordinate. ! * @param y The new Y coordinate. */ ! public void move (int x, int y) { this.x = x; this.y = y; } /** * Sets this object's coordinates to the specified values. This method ! * is identical to the move() method. * ! * @param x The new X coordinate. ! * @param y The new Y coordinate. */ ! public void setLocation (int x, int y) { this.x = x; this.y = y; } /** ! * Sets this object's coordinates to match those of the specified point. * ! * @param point The point to copy the coordinates from. */ ! public void setLocation (Point pt) { this.x = pt.x; this.y = pt.y; } /** ! * Changes the coordinates of this point such that the specified * dx parameter is added to the existing X coordinate and * dy is added to the existing Y coordinate. * ! * @param dx The amount to add to the X coordinate. ! * @param dy The amount to add to the Y coordinate. */ ! public void translate (int x, int y) { this.x += x; this.y += y; } /** ! * Returns a string representation of this object. * ! * @return A string representation of this object. ! */ ! public String toString () { ! return getClass().getName() + "[x:"+x+",y:"+y+']'; } ! public double getX() { return x; } ! public double getY() { return y; } ! ! public void setLocation (double x, double y) ! { this.x = (int) x; this.y = (int) y; } ! ! } --- 37,245 ---- package java.awt; ! import java.awt.geom.Point2D; ! import java.io.Serializable; /** * This class represents a point on the screen using cartesian coordinates. + * Remember that in screen coordinates, increasing x values go from left to + * right, and increasing y values go from top to bottom. + * + *

        There are some public fields; if you mess with them in an inconsistent + * manner, it is your own fault when you get invalid results. Also, this + * class is not threadsafe. * * @author Per Bothner ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ ! public class Point extends Point2D implements Serializable { /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -5276940640259749850L; ! ! /** ! * The x coordinate. ! * ! * @see #getLocation() ! * @see #move(int, int) ! * @serial the X coordinate of the point */ public int x; /** ! * The y coordinate. ! * ! * @see #getLocation() ! * @see #move(int, int) ! * @serial The Y coordinate of the point */ public int y; /** * Initializes a new instance of Point representing the * coordiates (0,0). + * + * @since 1.1 */ ! public Point() ! { ! } /** * Initializes a new instance of Point with coordinates * identical to the coordinates of the specified points. * ! * @param point the point to copy the coordinates from ! * @throws NullPointerException if p is null */ ! public Point(Point p) ! { ! x = p.x; ! y = p.y; ! } /** * Initializes a new instance of Point with the specified * coordinates. * ! * @param x the X coordinate ! * @param y the Y coordinate */ ! public Point(int x, int y) ! { ! this.x = x; ! this.y = y; ! } /** ! * Get the x coordinate. * ! * @return the value of x, as a double ! */ ! public double getX() ! { ! return x; ! } ! ! /** ! * Get the y coordinate. * ! * @return the value of y, as a double ! */ ! public double getY() { ! return y; } /** ! * Returns the location of this point. A pretty useless method, as this ! * is already a point. * ! * @return a copy of this point ! * @see #setLocation(Point) ! * @since 1.1 */ ! public Point getLocation() ! { ! return new Point(x, y); ! } /** ! * Sets this object's coordinates to match those of the specified point. * ! * @param p the point to copy the coordinates from ! * @throws NullPointerException if p is null ! * @since 1.1 */ ! public void setLocation(Point p) ! { ! x = p.x; ! y = p.y; ! } /** * Sets this object's coordinates to the specified values. This method ! * is identical to the move() method. * ! * @param x the new X coordinate ! * @param y the new Y coordinate */ ! public void setLocation(int x, int y) ! { ! this.x = x; ! this.y = y; ! } /** * Sets this object's coordinates to the specified values. This method ! * performs normal casting from double to int, so you may lose precision. * ! * @param x the new X coordinate ! * @param y the new Y coordinate */ ! public void setLocation(double x, double y) ! { ! this.x = (int) x; ! this.y = (int) y; ! } /** ! * Sets this object's coordinates to the specified values. This method ! * is identical to the setLocation(int, int) method. * ! * @param x the new X coordinate ! * @param y the new Y coordinate */ ! public void move(int x, int y) ! { ! this.x = x; ! this.y = y; ! } /** ! * Changes the coordinates of this point such that the specified * dx parameter is added to the existing X coordinate and * dy is added to the existing Y coordinate. * ! * @param dx the amount to add to the X coordinate ! * @param dy the amount to add to the Y coordinate */ ! public void translate(int dx, int dy) ! { ! x += dx; ! y += dy; ! } /** ! * Tests whether or not this object is equal to the specified object. ! * This will be true if and only if the specified object is an instance ! * of Point2D and has the same X and Y coordinates. * ! * @param obj the object to test against for equality ! * @return true if the specified object is equal ! */ ! public boolean equals(Object obj) { ! if (! (obj instanceof Point2D)) ! return false; ! Point2D p = (Point2D) obj; ! return x == p.getX() && y == p.getY(); } ! /** ! * Returns a string representation of this object. The format is: ! * getClass().getName() + "[x=" + x + ",y=" + y + ']'. ! * ! * @return a string representation of this object ! */ ! public String toString() ! { ! return getClass().getName() + "[x=" + x + ",y=" + y + ']'; ! } ! } // class Point diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Polygon.java gcc-3.3/libjava/java/awt/Polygon.java *** gcc-3.2.3/libjava/java/awt/Polygon.java 2001-05-11 01:03:45.000000000 +0000 --- gcc-3.3/libjava/java/awt/Polygon.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,422 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libjava. - This software is copyrighted work licensed under the terms of the - Libjava License. Please consult the file "LIBJAVA_LICENSE" for - details. */ package java.awt; ! import java.awt.geom.*; import java.io.Serializable; - import java.util.Arrays; /** ! * @author Tom Tromey ! * @date May 10, 2001 */ - - /** The Polygon class represents a closed region whose boundary is - made of line segments. The Polygon is defined by its vertices. */ public class Polygon implements Shape, Serializable { ! /** The bounds of the polygon. This is null until the bounds have ! * been computed for the first time; then it is correctly ! * maintained whenever it is modified. */ ! protected Rectangle bounds; ! /** The number of points in the polygon. */ public int npoints; ! /** The x coordinates of the points. */ public int[] xpoints; ! /** The y coordinates of the points. */ public int[] ypoints; ! /** Create a new, empty Polygon. */ ! public Polygon () { ! this.xpoints = new int[0]; ! this.ypoints = new int[0]; ! this.npoints = 0; } ! /** Create a new Polygon from the given vertices. ! * @param xpoints The x coordinates ! * @param ypoints The y coordinates ! * @param npoints The number of points */ ! public Polygon (int[] xpoints, int[] ypoints, int npoints) { - // We make explicit copies instead of relying on clone so that we - // ensure the new arrays are the same size. this.xpoints = new int[npoints]; this.ypoints = new int[npoints]; ! System.arraycopy (xpoints, 0, this.xpoints, 0, npoints); ! System.arraycopy (ypoints, 0, this.ypoints, 0, npoints); } ! /** Append the specified point to this Polygon. ! * @param x The x coordinate ! * @param y The y coordinate */ ! public void addPoint (int x, int y) { ! int[] newx = new int[npoints + 1]; ! System.arraycopy (xpoints, 0, newx, 0, npoints); ! int[] newy = new int[npoints + 1]; ! System.arraycopy (ypoints, 0, newy, 0, npoints); ! newx[npoints] = x; ! newy[npoints] = y; ! ++npoints; ! xpoints = newx; ! ypoints = newy; ! // It is simpler to just recompute. ! if (bounds != null) ! computeBoundingBox (); } ! /** Return true if the indicated point is inside this Polygon. ! * This uses an even-odd rule to determine insideness. ! * @param x The x coordinate ! * @param y The y coordinate ! * @returns true if the point is contained by this Polygon. */ ! public boolean contains (double x, double y) { ! // What we do is look at each line segment. If the line segment ! // crosses the "scan line" at y at a point x' < x, then we ! // increment our counter. At the end, an even number means the ! // point is outside the polygon. Instead of a number, though, we ! // use a boolean. ! boolean inside = false; ! for (int i = 0; i < npoints; ++i) { ! // Handle the wrap case. ! int x2 = (i == npoints) ? xpoints[0] : xpoints[i + 1]; ! int y2 = (i == npoints) ? ypoints[0] : ypoints[i + 1]; ! ! if (ypoints[i] == y2) ! { ! // We ignore horizontal lines. This might give weird ! // results in some situations -- ? ! continue; ! } ! ! double t = (y - ypoints[i]) / (double) (y2 - ypoints[i]); ! double x3 = xpoints[i] + t * (x2 - xpoints[i]); ! if (x3 < x) ! inside = ! inside; } ! ! return inside; } ! /** Return true if the indicated rectangle is entirely inside this ! * Polygon. ! * This uses an even-odd rule to determine insideness. ! * @param x The x coordinate ! * @param y The y coordinate ! * @param w The width ! * @param h The height ! * @returns true if the rectangle is contained by this Polygon. */ ! public boolean contains (double x, double y, double w, double h) { ! return intersectOrContains (x, y, w, h, false); } ! /** Return true if the indicated point is inside this Polygon. ! * This uses an even-odd rule to determine insideness. ! * @param x The x coordinate ! * @param y The y coordinate ! * @returns true if the point is contained by this Polygon. */ ! public boolean contains (int x, int y) { ! return contains ((double) x, (double) y); } ! /** Return true if the indicated point is inside this Polygon. ! * This uses an even-odd rule to determine insideness. ! * @param p The point ! * @returns true if the point is contained by this Polygon. */ ! public boolean contains (Point p) { ! return contains (p.x, p.y); } ! /** Return true if the indicated point is inside this Polygon. ! * This uses an even-odd rule to determine insideness. ! * @param p The point ! * @returns true if the point is contained by this Polygon. */ ! public boolean contains (Point2D p) { ! return contains (p.getX (), p.getY ()); } ! /** Return true if the indicated rectangle is entirely inside this ! * Polygon. This uses an even-odd rule to determine insideness. ! * @param r The rectangle ! * @returns true if the rectangle is contained by this Polygon. */ ! public boolean contains (Rectangle2D r) { ! return contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); } ! /** Returns the bounds of this Polygon. ! * @deprecated Use getBounds() instead. */ ! public Rectangle getBoundingBox () { ! if (bounds == null) ! computeBoundingBox (); ! return bounds; } ! /** Returns the bounds of this Polygon. */ ! public Rectangle getBounds () { ! if (bounds == null) ! computeBoundingBox (); ! return bounds; } ! /** Returns the bounds of this Polygon. */ ! public Rectangle2D getBounds2D () { ! if (bounds == null) ! computeBoundingBox (); ! return bounds; // Why not? } ! /** Return an iterator for the boundary of this Polygon. ! * @param at A transform to apply to the coordinates. ! * @returns A path iterator for the Polygon's boundary. */ ! public PathIterator getPathIterator (AffineTransform at) { ! return new Iterator (at); } ! /** Return an iterator for the boundary of this Polygon. ! * @param at A transform to apply to the coordinates. ! * @param flatness The flatness of the result; it is ignored by ! * this class. ! * @returns A path iterator for the Polygon's boundary. */ ! public PathIterator getPathIterator (AffineTransform at, double flatness) { ! // We ignore the flatness. ! return new Iterator (at); } ! /** @deprecated use contains(int,int). */ ! public boolean inside (int x, int y) { ! return contains (x, y); } ! /** Return true if this Polygon's interior intersects the given ! * rectangle's interior. ! * @param x The x coordinate ! * @param y The y coordinate ! * @param w The width ! * @param h The height */ ! public boolean intersects (double x, double y, double w, double h) { ! return intersectOrContains (x, y, w, h, true); } ! /** Return true if this Polygon's interior intersects the given ! * rectangle's interior. ! * @param r The rectangle */ ! public boolean intersects (Rectangle2D r) { ! return intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); } ! // This tests for intersection with or containment of a rectangle, ! // depending on the INTERSECT argument. ! private boolean intersectOrContains (double x, double y, double w, double h, ! boolean intersect) { ! // First compute the rectangle of possible intersection points. ! Rectangle r = getBounds (); ! int minx = Math.max (r.x, (int) x); ! int maxx = Math.min (r.x + r.width, (int) (x + w)); ! int miny = Math.max (r.y, (int) y); ! int maxy = Math.min (r.y + r.height, (int) (y + h)); ! ! if (miny > maxy) ! return false; ! ! double[] crosses = new double[npoints + 1]; ! for (; miny < maxy; ++miny) { ! // First compute every place where the polygon might intersect ! // the scan line at Y. ! int ins = 0; ! for (int i = 0; i < npoints; ++i) ! { ! // Handle the wrap case. ! int x2 = (i == npoints) ? xpoints[0] : xpoints[i + 1]; ! int y2 = (i == npoints) ? ypoints[0] : ypoints[i + 1]; ! ! if (ypoints[i] == y2) ! { ! // We ignore horizontal lines. This might give weird ! // results in some situations -- ? ! continue; ! } ! ! double t = (((double) miny - ypoints[i]) ! / (double) (y2 - ypoints[i])); ! double x3 = xpoints[i] + t * (x2 - xpoints[i]); ! crosses[ins++] = x3; ! } ! ! // Now we can sort into increasing order and look to see if ! // any point in the rectangle is in the polygon. We examine ! // every other pair due to our even-odd rule. ! Arrays.sort (crosses, 0, ins); ! int i = intersect ? 0 : 1; ! for (; i < ins - 1; i += 2) ! { ! // Pathological case. ! if (crosses[i] == crosses[i + 1]) ! continue; ! ! // Found a point on the inside. ! if ((crosses[i] >= x && crosses[i] < x + w) ! || (crosses[i + 1] >= x && crosses[i + 1] < x + w)) ! { ! // If we're checking containment then we just lost. ! // But if we're checking intersection then we just ! // won. ! return intersect; ! } ! } } ! return false; ! } ! ! /** Translates all the vertices of the polygon via a given vector. ! * @param deltaX The X offset ! * @param deltaY The Y offset ! */ ! public void translate (int deltaX, int deltaY) ! { ! for (int i = 0; i < npoints; ++i) { ! xpoints[i] += deltaX; ! ypoints[i] += deltaY; } ! if (bounds != null) { ! bounds.x += deltaX; ! bounds.y += deltaY; } - } ! // This computes the bounding box if required. ! private void computeBoundingBox () ! { ! if (npoints == 0) { ! // This is wrong if the user adds a new point, but we ! // account for that in addPoint(). ! bounds = new Rectangle (0, 0, 0, 0); } - else - { - int maxx = xpoints[0]; - int minx = xpoints[0]; - int maxy = ypoints[0]; - int miny = ypoints[0]; - - for (int i = 1; i < npoints; ++i) - { - maxx = Math.max (maxx, xpoints[i]); - minx = Math.min (minx, xpoints[i]); - maxy = Math.max (maxy, ypoints[i]); - miny = Math.min (miny, ypoints[i]); - } ! bounds = new Rectangle (minx, miny, maxx - minx, maxy - miny); } } ! private class Iterator implements PathIterator { ! public AffineTransform xform; ! public int where; ! ! public Iterator (AffineTransform xform) ! { ! this.xform = xform; ! where = 0; ! } ! ! public int currentSegment (double[] coords) ! { ! int r; ! ! if (where < npoints) ! { ! coords[0] = xpoints[where]; ! coords[1] = ypoints[where]; ! r = (where == 0) ? SEG_MOVETO : SEG_LINETO; ! xform.transform (coords, 0, coords, 0, 1); ! ++where; ! } ! else ! r = SEG_CLOSE; ! ! return r; ! } ! ! public int currentSegment (float[] coords) ! { ! int r; ! ! if (where < npoints) ! { ! coords[0] = xpoints[where]; ! coords[1] = ypoints[where]; ! r = (where == 0) ? SEG_MOVETO : SEG_LINETO; ! xform.transform (coords, 0, coords, 0, 1); ! } ! else ! r = SEG_CLOSE; ! ! return r; ! } ! ! public int getWindingRule () ! { ! return WIND_EVEN_ODD; ! } ! ! public boolean isDone () ! { ! return where == npoints + 1; ! } ! public void next () ! { ! ++where; ! } } ! } --- 1,751 ---- ! /* Polygon.java -- class representing a polygon ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt; ! import java.awt.geom.AffineTransform; ! import java.awt.geom.PathIterator; ! import java.awt.geom.Point2D; ! import java.awt.geom.Rectangle2D; import java.io.Serializable; /** ! * This class represents a polygon, a closed, two-dimensional region in a ! * coordinate space. The region is bounded by an arbitrary number of line ! * segments, between (x,y) coordinate vertices. The polygon has even-odd ! * winding, meaning that a point is inside the shape if it crosses the ! * boundary an odd number of times on the way to infinity. ! * ! *

        There are some public fields; if you mess with them in an inconsistent ! * manner, it is your own fault when you get NullPointerException, ! * ArrayIndexOutOfBoundsException, or invalid results. Also, this class is ! * not threadsafe. ! * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ public class Polygon implements Shape, Serializable { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -6460061437900069969L; ! /** ! * This total number of endpoints. ! * ! * @serial the number of endpoints, possibly less than the array sizes ! */ public int npoints; ! /** ! * The array of X coordinates of endpoints. This should not be null. ! * ! * @see #addPoint(int, int) ! * @serial the x coordinates ! */ public int[] xpoints; ! /** ! * The array of Y coordinates of endpoints. This should not be null. ! * ! * @see #addPoint(int, int) ! * @serial the y coordinates ! */ public int[] ypoints; ! /** ! * The bounding box of this polygon. This is lazily created and cached, so ! * it must be invalidated after changing points. ! * ! * @see #getBounds() ! * @serial the bounding box, or null ! */ ! protected Rectangle bounds; ! ! /** ! * Cached flattened version - condense points and parallel lines, so the ! * result has area if there are >= 3 condensed vertices. flat[0] is the ! * number of condensed points, and (flat[odd], flat[odd+1]) form the ! * condensed points. ! * ! * @see #condense() ! * @see #contains(double, double) ! * @see #contains(double, double, double, double) ! */ ! private transient int[] condensed; ! ! /** ! * Initializes an empty polygon. ! */ ! public Polygon() { ! // Leave room for growth. ! xpoints = new int[4]; ! ypoints = new int[4]; } ! /** ! * Create a new polygon with the specified endpoints. The arrays are copied, ! * so that future modifications to the parameters do not affect the polygon. ! * ! * @param xpoints the array of X coordinates for this polygon ! * @param ypoints the array of Y coordinates for this polygon ! * @param npoints the total number of endpoints in this polygon ! * @throws NegativeArraySizeException if npoints is negative ! * @throws IndexOutOfBoundsException if npoints exceeds either array ! * @throws NullPointerException if xpoints or ypoints is null */ ! public Polygon(int[] xpoints, int[] ypoints, int npoints) { this.xpoints = new int[npoints]; this.ypoints = new int[npoints]; ! System.arraycopy(xpoints, 0, this.xpoints, 0, npoints); ! System.arraycopy(ypoints, 0, this.ypoints, 0, npoints); ! this.npoints = npoints; } ! /** ! * Reset the polygon to be empty. The arrays are left alone, to avoid object ! * allocation, but the number of points is set to 0, and all cached data ! * is discarded. If you are discarding a huge number of points, it may be ! * more efficient to just create a new Polygon. ! * ! * @see #invalidate() ! * @since 1.4 */ ! public void reset() { ! npoints = 0; ! invalidate(); ! } ! /** ! * Invalidate or flush all cached data. After direct manipulation of the ! * public member fields, this is necessary to avoid inconsistent results ! * in methods like contains. ! * ! * @see #getBounds() ! * @since 1.4 ! */ ! public void invalidate() ! { ! bounds = null; ! condensed = null; } ! /** ! * Translates the polygon by adding the specified values to all X and Y ! * coordinates. This updates the bounding box, if it has been calculated. ! * ! * @param dx the amount to add to all X coordinates ! * @param dy the amount to add to all Y coordinates ! * @since 1.1 */ ! public void translate(int dx, int dy) { ! int i = npoints; ! while (--i >= 0) { ! xpoints[i] += dx; ! xpoints[i] += dy; } ! if (bounds != null) ! { ! bounds.x += dx; ! bounds.y += dy; ! } ! condensed = null; } ! /** ! * Adds the specified endpoint to the polygon. This updates the bounding ! * box, if it has been created. ! * ! * @param x the X coordinate of the point to add ! * @param y the Y coordiante of the point to add */ ! public void addPoint(int x, int y) { ! if (npoints + 1 > xpoints.length) ! { ! int[] newx = new int[npoints + 1]; ! System.arraycopy(xpoints, 0, newx, 0, npoints); ! xpoints = newx; ! } ! if (npoints + 1 > ypoints.length) ! { ! int[] newy = new int[npoints + 1]; ! System.arraycopy(ypoints, 0, newy, 0, npoints); ! ypoints = newy; ! } ! xpoints[npoints] = x; ! ypoints[npoints] = y; ! npoints++; ! if (bounds != null) ! { ! if (npoints == 1) ! { ! bounds.x = x; ! bounds.y = y; ! } ! else ! { ! if (x < bounds.x) ! { ! bounds.width += bounds.x - x; ! bounds.x = x; ! } ! else if (x > bounds.x + bounds.width) ! bounds.width = x - bounds.x; ! if (y < bounds.y) ! { ! bounds.height += bounds.y - y; ! bounds.y = y; ! } ! else if (y > bounds.y + bounds.height) ! bounds.height = y - bounds.y; ! } ! } ! condensed = null; } ! /** ! * Returns the bounding box of this polygon. This is the smallest ! * rectangle with sides parallel to the X axis that will contain this ! * polygon. ! * ! * @return the bounding box for this polygon ! * @see #getBounds2D() ! * @since 1.1 */ ! public Rectangle getBounds() { ! if (bounds == null) ! { ! if (npoints == 0) ! return bounds = new Rectangle(); ! int i = npoints - 1; ! int minx = xpoints[i]; ! int maxx = minx; ! int miny = ypoints[i]; ! int maxy = miny; ! while (--i >= 0) ! { ! int x = xpoints[i]; ! int y = ypoints[i]; ! if (x < minx) ! minx = x; ! else if (x > maxx) ! maxx = x; ! if (y < miny) ! miny = y; ! else if (y > maxy) ! maxy = y; ! } ! bounds = new Rectangle(minx, maxy, maxx - minx, maxy - miny); ! } ! return bounds; } ! /** ! * Returns the bounding box of this polygon. This is the smallest ! * rectangle with sides parallel to the X axis that will contain this ! * polygon. ! * ! * @return the bounding box for this polygon ! * @see #getBounds2D() ! * @deprecated use {@link #getBounds()} instead */ ! public Rectangle getBoundingBox() { ! return getBounds(); } ! /** ! * Tests whether or not the specified point is inside this polygon. ! * ! * @param p the point to test ! * @return true if the point is inside this polygon ! * @throws NullPointerException if p is null ! * @see #contains(double, double) */ ! public boolean contains(Point p) { ! return contains(p.getX(), p.getY()); } ! /** ! * Tests whether or not the specified point is inside this polygon. ! * ! * @param x the X coordinate of the point to test ! * @param y the Y coordinate of the point to test ! * @return true if the point is inside this polygon ! * @see #contains(double, double) ! * @since 1.1 */ ! public boolean contains(int x, int y) { ! return contains((double) x, (double) y); } ! /** ! * Tests whether or not the specified point is inside this polygon. ! * ! * @param x the X coordinate of the point to test ! * @param y the Y coordinate of the point to test ! * @return true if the point is inside this polygon ! * @see #contains(double, double) ! * @deprecated use {@link #contains(int, int)} instead */ ! public boolean inside(int x, int y) { ! return contains((double) x, (double) y); } ! /** ! * Returns a high-precision bounding box of this polygon. This is the ! * smallest rectangle with sides parallel to the X axis that will contain ! * this polygon. ! * ! * @return the bounding box for this polygon ! * @see #getBounds() ! * @since 1.2 ! */ ! public Rectangle2D getBounds2D() { ! // For polygons, the integer version is exact! ! return getBounds(); } ! /** ! * Tests whether or not the specified point is inside this polygon. ! * ! * @param x the X coordinate of the point to test ! * @param y the Y coordinate of the point to test ! * @return true if the point is inside this polygon ! * @since 1.2 ! */ ! public boolean contains(double x, double y) { ! // First, the obvious bounds checks. ! if (! condense() || ! getBounds().contains(x, y)) ! return false; ! // A point is contained if a ray to (-inf, y) crosses an odd number ! // of segments. This must obey the semantics of Shape when the point is ! // exactly on a segment or vertex: a point is inside only if the adjacent ! // point in the increasing x or y direction is also inside. Note that we ! // are guaranteed that the condensed polygon has area, and no consecutive ! // segments with identical slope. ! boolean inside = false; ! int limit = condensed[0]; ! int curx = condensed[(limit << 1) - 1]; ! int cury = condensed[limit << 1]; ! for (int i = 1; i <= limit; i++) ! { ! int priorx = curx; ! int priory = cury; ! curx = condensed[(i << 1) - 1]; ! cury = condensed[i << 1]; ! if ((priorx > x && curx > x) // Left of segment, or NaN. ! || (priory > y && cury > y) // Below segment, or NaN. ! || (priory < y && cury < y)) // Above segment. ! continue; ! if (priory == cury) // Horizontal segment, y == cury == priory ! { ! if (priorx < x && curx < x) // Right of segment. ! { ! inside = ! inside; ! continue; ! } ! // Did we approach this segment from above or below? ! // This mess is necessary to obey rules of Shape. ! priory = condensed[((limit + i - 2) % limit) << 1]; ! boolean above = priory > cury; ! if ((curx == x && (curx > priorx || above)) ! || (priorx == x && (curx < priorx || ! above)) ! || (curx > priorx && ! above) || above) ! inside = ! inside; ! continue; ! } ! if (priorx == x && priory == y) // On prior vertex. ! continue; ! if (priorx == curx // Vertical segment. ! || (priorx < x && curx < x)) // Right of segment. ! { ! inside = ! inside; ! continue; ! } ! // The point is inside the segment's bounding box, compare slopes. ! double leftx = curx > priorx ? priorx : curx; ! double lefty = curx > priorx ? priory : cury; ! double slopeseg = (double) (cury - priory) / (curx - priorx); ! double slopepoint = (double) (y - lefty) / (x - leftx); ! if ((slopeseg > 0 && slopeseg > slopepoint) ! || slopeseg < slopepoint) ! inside = ! inside; ! } ! return inside; } ! /** ! * Tests whether or not the specified point is inside this polygon. ! * ! * @param p the point to test ! * @return true if the point is inside this polygon ! * @throws NullPointerException if p is null ! * @see #contains(double, double) ! * @since 1.2 */ ! public boolean contains(Point2D p) { ! return contains(p.getX(), p.getY()); } ! /** ! * Test if a high-precision rectangle intersects the shape. This is true ! * if any point in the rectangle is in the shape. This implementation is ! * precise. ! * ! * @param x the x coordinate of the rectangle ! * @param y the y coordinate of the rectangle ! * @param w the width of the rectangle, treated as point if negative ! * @param h the height of the rectangle, treated as point if negative ! * @return true if the rectangle intersects this shape ! * @since 1.2 */ ! public boolean intersects(double x, double y, double w, double h) { ! // First, the obvious bounds checks. ! if (w <= 0 || h <= 0 || npoints == 0 || ! ! getBounds().intersects(x, y, w, h)) ! return false; // Disjoint bounds. ! if ((x <= bounds.x && x + w >= bounds.x + bounds.width ! && y <= bounds.y && y + h >= bounds.y + bounds.height) ! || contains(x, y)) ! return true; // Rectangle contains the polygon, or one point matches. ! // If any vertex is in the rectangle, the two might intersect. ! int curx = 0; ! int cury = 0; ! for (int i = 0; i < npoints; i++) ! { ! curx = xpoints[i]; ! cury = ypoints[i]; ! if (curx >= x && curx < x + w && cury >= y && cury < y + h ! && contains(curx, cury)) // Boundary check necessary. ! return true; ! } ! // Finally, if at least one of the four bounding lines intersect any ! // segment of the polygon, return true. Be careful of the semantics of ! // Shape; coinciding lines do not necessarily return true. ! for (int i = 0; i < npoints; i++) ! { ! int priorx = curx; ! int priory = cury; ! curx = xpoints[i]; ! cury = ypoints[i]; ! if (priorx == curx) // Vertical segment. ! { ! if (curx < x || curx >= x + w) // Outside rectangle. ! continue; ! if ((cury >= y + h && priory <= y) ! || (cury <= y && priory >= y + h)) ! return true; // Bisects rectangle. ! continue; ! } ! if (priory == cury) // Horizontal segment. ! { ! if (cury < y || cury >= y + h) // Outside rectangle. ! continue; ! if ((curx >= x + w && priorx <= x) ! || (curx <= x && priorx >= x + w)) ! return true; // Bisects rectangle. ! continue; ! } ! // Slanted segment. ! double slope = (double) (cury - priory) / (curx - priorx); ! double intersect = slope * (x - curx) + cury; ! if (intersect > y && intersect < y + h) // Intersects left edge. ! return true; ! intersect = slope * (x + w - curx) + cury; ! if (intersect > y && intersect < y + h) // Intersects right edge. ! return true; ! intersect = (y - cury) / slope + curx; ! if (intersect > x && intersect < x + w) // Intersects bottom edge. ! return true; ! intersect = (y + h - cury) / slope + cury; ! if (intersect > x && intersect < x + w) // Intersects top edge. ! return true; ! } ! return false; } ! /** ! * Test if a high-precision rectangle intersects the shape. This is true ! * if any point in the rectangle is in the shape. This implementation is ! * precise. ! * ! * @param r the rectangle ! * @return true if the rectangle intersects this shape ! * @throws NullPointerException if r is null ! * @see #intersects(double, double, double, double) ! * @since 1.2 ! */ ! public boolean intersects(Rectangle2D r) { ! return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } ! /** ! * Test if a high-precision rectangle lies completely in the shape. This is ! * true if all points in the rectangle are in the shape. This implementation ! * is precise. ! * ! * @param x the x coordinate of the rectangle ! * @param y the y coordinate of the rectangle ! * @param w the width of the rectangle, treated as point if negative ! * @param h the height of the rectangle, treated as point if negative ! * @return true if the rectangle is contained in this shape ! * @since 1.2 */ ! public boolean contains(double x, double y, double w, double h) { ! // First, the obvious bounds checks. ! if (w <= 0 || h <= 0 || ! contains(x, y) ! || ! bounds.contains(x, y, w, h)) ! return false; ! // Now, if any of the four bounding lines intersects a polygon segment, ! // return false. The previous check had the side effect of setting ! // the condensed array, which we use. Be careful of the semantics of ! // Shape; coinciding lines do not necessarily return false. ! int limit = condensed[0]; ! int curx = condensed[(limit << 1) - 1]; ! int cury = condensed[limit << 1]; ! for (int i = 1; i <= limit; i++) ! { ! int priorx = curx; ! int priory = cury; ! curx = condensed[(i << 1) - 1]; ! cury = condensed[i << 1]; ! if (curx > x && curx < x + w && cury > y && cury < y + h) ! return false; // Vertex is in rectangle. ! if (priorx == curx) // Vertical segment. ! { ! if (curx < x || curx > x + w) // Outside rectangle. ! continue; ! if ((cury >= y + h && priory <= y) ! || (cury <= y && priory >= y + h)) ! return false; // Bisects rectangle. ! continue; ! } ! if (priory == cury) // Horizontal segment. ! { ! if (cury < y || cury > y + h) // Outside rectangle. ! continue; ! if ((curx >= x + w && priorx <= x) ! || (curx <= x && priorx >= x + w)) ! return false; // Bisects rectangle. ! continue; ! } ! // Slanted segment. ! double slope = (double) (cury - priory) / (curx - priorx); ! double intersect = slope * (x - curx) + cury; ! if (intersect > y && intersect < y + h) // Intersects left edge. ! return false; ! intersect = slope * (x + w - curx) + cury; ! if (intersect > y && intersect < y + h) // Intersects right edge. ! return false; ! intersect = (y - cury) / slope + curx; ! if (intersect > x && intersect < x + w) // Intersects bottom edge. ! return false; ! intersect = (y + h - cury) / slope + cury; ! if (intersect > x && intersect < x + w) // Intersects top edge. ! return false; ! } ! return true; } ! /** ! * Test if a high-precision rectangle lies completely in the shape. This is ! * true if all points in the rectangle are in the shape. This implementation ! * is precise. ! * ! * @param r the rectangle ! * @return true if the rectangle is contained in this shape ! * @throws NullPointerException if r is null ! * @see #contains(double, double, double, double) ! * @since 1.2 */ ! public boolean contains(Rectangle2D r) { ! return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight()); } ! /** ! * Return an iterator along the shape boundary. If the optional transform ! * is provided, the iterator is transformed accordingly. Each call returns ! * a new object, independent from others in use. This class is not ! * threadsafe to begin with, so the path iterator is not either. ! * ! * @param transform an optional transform to apply to the iterator ! * @return a new iterator over the boundary ! * @since 1.2 ! */ ! public PathIterator getPathIterator(final AffineTransform transform) { ! return new PathIterator() ! { ! /** The current vertex of iteration. */ ! private int vertex; ! public int getWindingRule() { ! return WIND_EVEN_ODD; } ! public boolean isDone() { ! return vertex > npoints; } ! public void next() { ! vertex++; } ! public int currentSegment(float[] coords) { ! if (vertex >= npoints) ! return SEG_CLOSE; ! coords[0] = xpoints[vertex]; ! coords[1] = ypoints[vertex]; ! if (transform != null) ! transform.transform(coords, 0, coords, 0, 1); ! return vertex == 0 ? SEG_MOVETO : SEG_LINETO; } ! public int currentSegment(double[] coords) ! { ! if (vertex >= npoints) ! return SEG_CLOSE; ! coords[0] = xpoints[vertex]; ! coords[1] = ypoints[vertex]; ! if (transform != null) ! transform.transform(coords, 0, coords, 0, 1); ! return vertex == 0 ? SEG_MOVETO : SEG_LINETO; } + }; } ! /** ! * Return an iterator along the flattened version of the shape boundary. ! * Since polygons are already flat, the flatness parameter is ignored, and ! * the resulting iterator only has SEG_MOVETO, SEG_LINETO and SEG_CLOSE ! * points. If the optional transform is provided, the iterator is ! * transformed accordingly. Each call returns a new object, independent ! * from others in use. This class is not threadsafe to begin with, so the ! * path iterator is not either. ! * ! * @param transform an optional transform to apply to the iterator ! * @param double the maximum distance for deviation from the real boundary ! * @return a new iterator over the boundary ! * @since 1.2 ! */ ! public PathIterator getPathIterator(AffineTransform transform, ! double flatness) { ! return getPathIterator(transform); ! } ! /** ! * Helper for contains, which caches a condensed version of the polygon. ! * This condenses all colinear points, so that consecutive segments in ! * the condensed version always have different slope. ! * ! * @return true if the condensed polygon has area ! * @see #condensed ! * @see #contains(double, double) ! */ ! private boolean condense() ! { ! if (npoints <= 2) ! return false; ! if (condensed != null) ! return condensed[0] > 2; ! condensed = new int[npoints * 2 + 1]; ! int curx = xpoints[npoints - 1]; ! int cury = ypoints[npoints - 1]; ! double curslope = Double.NaN; ! int count = 0; ! outer: ! for (int i = 0; i < npoints; i++) ! { ! int priorx = curx; ! int priory = cury; ! double priorslope = curslope; ! curx = xpoints[i]; ! cury = ypoints[i]; ! while (curx == priorx && cury == priory) ! { ! if (++i == npoints) ! break outer; ! curx = xpoints[i]; ! cury = ypoints[i]; ! } ! curslope = (curx == priorx ? Double.POSITIVE_INFINITY ! : (double) (cury - priory) / (curx - priorx)); ! if (priorslope == curslope) ! { ! if (count > 1 && condensed[(count << 1) - 3] == curx ! && condensed[(count << 1) - 2] == cury) ! { ! count--; ! continue; ! } ! } ! else ! count++; ! condensed[(count << 1) - 1] = curx; ! condensed[count << 1] = cury; ! } ! condensed[0] = count; ! return count > 2; } ! } // class Polygon diff -Nrc3pad gcc-3.2.3/libjava/java/awt/PopupMenu.java gcc-3.3/libjava/java/awt/PopupMenu.java *** gcc-3.2.3/libjava/java/awt/PopupMenu.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/PopupMenu.java 2003-01-02 00:14:05.000000000 +0000 *************** private static final long serialVersionU *** 65,70 **** --- 65,73 ---- /** * Initializes a new instance of PopupMenu. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true. */ public PopupMenu() *************** PopupMenu() *** 78,88 **** --- 81,97 ---- * label. * * @param label The label for this popup menu. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() + * returns true. */ public PopupMenu(String label) { super(label); + + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/Book.java gcc-3.3/libjava/java/awt/print/Book.java *** gcc-3.2.3/libjava/java/awt/print/Book.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/Book.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,188 ---- + /* Book.java -- A mixed group of pages to print. + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + import java.util.Vector; + + /** + * This class allows documents to be created with different paper types, + * page formatters, and painters. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + public class Book implements Pageable + { + + /* + * Instance Variables + */ + + // Painter objects for the book + Vector printables = new Vector(); + + // Page formats for the book + Vector page_formats = new Vector(); + + /*************************************************************************/ + + /* + * Constructors + */ + + /** + * Initializes a new instance of Book that is empty. + */ + public + Book() + { + ; + } + + /*************************************************************************/ + + /** + * Returns the number of pages in this book. + * + * @return The number of pages in this book. + */ + public int + getNumberOfPages() + { + return(printables.size()); + } + + /*************************************************************************/ + + /** + * This method returns the PageFormat object for the + * specified page. + * + * @param page_numbers The number of the page to get information for, where + * page numbers start at 0. + * + * @return The PageFormat object for the specified page. + * + * @exception IndexOutOfBoundsException If the page number is not valid. + */ + public PageFormat + getPageFormat(int page_number) + { + return((PageFormat)page_formats.elementAt(page_number)); + } + + /*************************************************************************/ + + /** + * This method returns the Printable object for the + * specified page. + * + * @param page_numbers The number of the page to get information for, where + * page numbers start at 0. + * + * @return The Printable object for the specified page. + * + * @exception IndexOutOfBoundsException If the page number is not valid. + */ + public Printable + getPrintable(int page_number) + { + return((Printable)printables.elementAt(page_number)); + } + + /*************************************************************************/ + + /** + * This method appends a page to the end of the book. + * + * @param printable The Printable for this page. + * @param page_format The PageFormat for this page. + * + * @exception NullPointerException If either argument is null. + */ + public void + append(Printable printable, PageFormat page_format) + { + append(printable, page_format, 1); + } + + /*************************************************************************/ + + /** + * This method appends the specified number of pages to the end of the book. + * Each one will be associated with the specified Printable + * and PageFormat. + * + * @param printable The Printable for this page. + * @param page_format The PageFormat for this page. + * @param num_pages The number of pages to append. + * + * @exception NullPointerException If any argument is null. + */ + public void + append(Printable painter, PageFormat page_format, int num_pages) + { + for (int i = 0; i < num_pages; i++) + { + printables.addElement(painter); + page_formats.addElement(page_format); + } + } + + /*************************************************************************/ + + /** + * This method changes the Printable and PageFormat + * for the specified page. The page must already exist or an exception + * will be thrown. + * + * @param page_num The page number to alter. + * @param printable The new Printable for the page. + * @param page_format The new PageFormat for the page. + * + * @param IndexOutOfBoundsException If the specified page does not exist. + */ + public void + setPage(int page_num, Printable printable, PageFormat page_format) + { + printables.setElementAt(printable, page_num); + page_formats.setElementAt(page_format, page_num); + } + + } // class Book + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/Pageable.java gcc-3.3/libjava/java/awt/print/Pageable.java *** gcc-3.2.3/libjava/java/awt/print/Pageable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/Pageable.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,113 ---- + /* Pageable.java -- Pages to be printed + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + /** + * This interface represents pages that are to be printed. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + public interface Pageable + { + + /* + * Static Variables + */ + + /** + * This constant is returned when getNumberOfPages() + * cannot determine the number of pages available for printing. + */ + public static final int UNKNOWN_NUMBER_OF_PAGES = -1; + + /*************************************************************************/ + + /* + * Instance Methods + */ + + /** + * This method returns the number of pages this object contains, or + * UNKNOWN_NUMBER_OF_PAGES if it cannot determine the number + * of pages to be printed. + * + * @return The number of pages to be printed, or + * UNKNOWN_NUMBER_OF_PAGES if this is unknown. + */ + public abstract int + getNumberOfPages(); + + /*************************************************************************/ + + /** + * This method returns the PageFormat instance for the + * specified page. Page numbers start at zero. An exception is thrown if + * the requested page does not exist. + * + * @param pageIndex The index of the page to return the + * PageFormat for. + * + * @return The PageFormat for the requested page. + * + * @exception IndexOutOfBoundsException If the requested page number does + * not exist. + */ + public abstract PageFormat + getPageFormat(int pageIndex) throws IndexOutOfBoundsException; + + /*************************************************************************/ + + /** + * This method returns the Printable instance for the + * specified page. Page numbers start at zero. An exception is thrown if + * the requested page does not exist. + * + * @param pageIndex The index of the page to return the + * Printable for. + * + * @return The Printable for the requested page. + * + * @exception IndexOutOfBoundsException If the requested page number does + * not exist. + */ + public abstract Printable + getPrintable(int pageIndex) throws IndexOutOfBoundsException; + + } // interface Pageable + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/PageFormat.java gcc-3.3/libjava/java/awt/print/PageFormat.java *** gcc-3.2.3/libjava/java/awt/print/PageFormat.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/PageFormat.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,293 ---- + /* PageFormat.java -- Information about the page format + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + /** + * This class contains information about the desired page format to + * use for printing a particular set of pages. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + public class PageFormat implements Cloneable + { + + /* + * Static Variables + */ + + /** + * A constant for a landscaped page orientation. Used by + * getOrientation and setOrientation. + */ + public static final int LANDSCAPE = 0; + + /** + * A constant for a portrait page orientation. Used by + * getOrientation and setOrientation. + */ + public static final int PORTRAIT = 1; + + /** + * A constant for a reversed landscaped page orientation. This is + * the orientation used by Macintosh's for landscape. The origin is + * in the upper right hand corner instead of the upper left. The + * X and Y axes are reversed. Used by getOrientation and + * setOrientation. + */ + public static final int REVERSE_LANDSCAPE = 2; + + /*************************************************************************/ + + /* + * Instance Variables + */ + + // The page orientation + private int orientation; + + // The paper type + private Paper paper; + + /*************************************************************************/ + + /* + * Constructors + */ + + /** + * This method creates a default page layout, which will be in portrait + * format. + */ + public + PageFormat() + { + this.paper = new Paper(); + this.orientation = PORTRAIT; + } + + /*************************************************************************/ + + /* + * Instance Methods + */ + + /** + * This method returns the width of the page, in 1/72nd's of an inch. The + * "width" measured depends on orientation. + * + * @return The width of the page. + */ + public double + getWidth() + { + return(paper.getWidth()); + } + + /*************************************************************************/ + + /** + * This method returns the height of the page, in 1/72nd's of an inch. + * The "height" measured depends on the orientation. + * + * @return The height of the page. + */ + public double + getHeight() + { + return(paper.getHeight()); + } + + /*************************************************************************/ + + /** + * This method returns the X coordinate value of the upper leftmost + * drawable area of the paper. + * + * @return The upper leftmost imageable X coordinate. + */ + public double + getImageableX() + { + return(paper.getImageableX()); + } + + /*************************************************************************/ + + /** + * This method returns the Y coordinate value of the upper leftmost + * drawable area of the paper. + * + * @return The upper leftmost imageable Y coordinate. + */ + public double + getImageableY() + { + return(paper.getImageableY()); + } + + /*************************************************************************/ + + /** + * This method returns the imageable width of the paper, in 1/72nd's of + * an inch. + * + * @return The imageable width of the paper. + */ + public double + getImageableWidth() + { + return(paper.getImageableWidth()); + } + + /*************************************************************************/ + + /** + * This method returns the imageable height of the paper, in 1/72nd's of + * an inch. + * + * @return The imageable height of the paper. + */ + public double + getImageableHeigth() + { + return(paper.getImageableHeight()); + } + + /*************************************************************************/ + + /** + * Returns a copy of the paper object being used for this + * page format. + * + * @return A copy of the Paper object for this format. + */ + public Paper + getPaper() + { + return((Paper)paper.clone()); + } + + /*************************************************************************/ + + /** + * Sets the Paper object to be used by this page format. + * + * @param paper The new Paper object for this page format. + */ + public void + setPaper(Paper paper) + { + this.paper = paper; + } + + /*************************************************************************/ + + /** + * This method returns the current page orientation. The value returned + * will be one of the page orientation constants from this class. + * + * @return The current page orientation. + */ + public int + getOrientation() + { + return(orientation); + } + + /*************************************************************************/ + + /** + * This method sets the page orientation for this format to the + * specified value. It must be one of the page orientation constants + * from this class or an exception will be thrown. + * + * @param orientation The new page orientation. + * + * @exception IllegalArgumentException If the specified page orientation + * value is not one of the constants from this class. + */ + public void + setOrientation(int orientation) throws IllegalArgumentException + { + if ((orientation != PORTRAIT) && + (orientation != LANDSCAPE) && + (orientation != REVERSE_LANDSCAPE)) + throw new IllegalArgumentException("Bad page orientation value: " + + orientation); + + this.orientation = orientation; + } + + /*************************************************************************/ + + /** + * This method returns a matrix used for transforming user space + * coordinates to page coordinates. The value returned will be six + * doubles as described in java.awt.geom.AffineTransform. + * + * @return The transformation matrix for this page format. + */ + public double[] + getMatrix() + { + throw new RuntimeException("Not implemented since I don't know what to do"); + } + + /*************************************************************************/ + + /** + * This method returns a copy of this object. + * + * @return A copy of this object. + */ + public Object + clone() + { + try + { + return(super.clone()); + } + catch(CloneNotSupportedException e) + { + return(null); + } + } + + } // class PageFormat + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/Paper.java gcc-3.3/libjava/java/awt/print/Paper.java *** gcc-3.2.3/libjava/java/awt/print/Paper.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/Paper.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,236 ---- + /* Paper.java -- Information about a paper type. + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + /** + * This class describes a particular type of paper. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + public class Paper + { + + /* + * Instance Variables + */ + + // Height of the paper + private double height; + + // Width of the paper + private double width; + + // Upper left imageable X coordinate + private double imageableX; + + // Upper left imageable Y coordinate + private double imageableY; + + // Imageable width of the page + private double imageableWidth; + + // Imageable height of the page + private double imageableHeight; + + /*************************************************************************/ + + /* + * Constructor + */ + + /** + * This method creates a letter sized paper with one inch margins + */ + public + Paper() + { + width = 8.5 * 72; + height = 11 * 72; + imageableX = 72; + imageableY = 72; + imageableWidth = width - (2 * 72); + imageableHeight = height - (2 * 72); + } + + /*************************************************************************/ + + /** + * This method returns the height of the paper in 1/72nds of an inch. + * + * @return The height of the paper in 1/72nds of an inch. + */ + public double + getHeight() + { + return(height); + } + + /*************************************************************************/ + + /** + * Returns the width of the paper in 1/72nds of an inch. + * + * @return The width of the paper in 1/72nds of an inch. + */ + public double + getWidth() + { + return(width); + } + + /*************************************************************************/ + + /** + * This method returns the X coordinate of the upper left hand corner + * of the imageable area of the paper. + * + * @return The X coordinate of the upper left hand corner of the imageable + * area of the paper. + */ + public double + getImageableX() + { + return(imageableX); + } + + /*************************************************************************/ + + /** + * This method returns the Y coordinate of the upper left hand corner + * of the imageable area of the paper. + * + * @return The Y coordinate of the upper left hand corner of the imageable + * area of the paper. + */ + public double + getImageableY() + { + return(imageableY); + } + + /*************************************************************************/ + + /** + * Returns the width of the imageable area of the paper. + * + * @return The width of the imageable area of the paper. + */ + public double + getImageableWidth() + { + return(imageableWidth); + } + + /*************************************************************************/ + + /** + * Returns the height of the imageable area of the paper. + * + * @return The height of the imageable area of the paper. + */ + public double + getImageableHeight() + { + return(imageableHeight); + } + + /*************************************************************************/ + + /** + * This method sets the size of the paper to the specified width and + * height, which are specified in 1/72nds of an inch. + * + * @param width The width of the paper in 1/72nds of an inch. + * @param height The height of the paper in 1/72nds of an inch. + */ + public void + setSize(double width, double height) + { + this.width = width; + this.height = height; + } + + /*************************************************************************/ + + /** + * This method sets the imageable area of the paper by specifying the + * coordinates of the upper left hand corner of that area, and its + * length and height. All values are in 1/72nds of an inch. + * + * @param imageableX The X coordinate of the upper left hand corner of + * the imageable area, in 1/72nds of an inch. + * @param imageableY The Y coordinate of the upper left hand corner of + * the imageable area, in 1/72nds of an inch. + * @param imageableWidth The width of the imageable area of the paper, + * in 1/72nds of an inch. + * @param imageableHeight The heigth of the imageable area of the paper, + * in 1/72nds of an inch. + */ + public void + setImageableArea(double imageableX, double imageableY, + double imageableWidth, double imageableHeight) + { + this.imageableX = imageableX; + this.imageableY = imageableY; + this.imageableWidth = imageableWidth; + this.imageableHeight = imageableHeight; + } + + /*************************************************************************/ + + /** + * This method creates a copy of this object. + * + * @return A copy of this object. + */ + public Object + clone() + { + try + { + return(super.clone()); + } + catch(CloneNotSupportedException e) + { + return(null); + } + } + + } // class Paper + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/Printable.java gcc-3.3/libjava/java/awt/print/Printable.java *** gcc-3.2.3/libjava/java/awt/print/Printable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/Printable.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,90 ---- + /* Printable.java -- Renders a page to the print device + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + import java.awt.Graphics; + + /** + * This interface provides a mechanism for the actual printing of pages to the + * printer. The object implementing this interface performs the page + * rendering. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + public interface Printable + { + + /* + * Static Variables + */ + + /** + * This value is returned by the print() method to indicate + * that the requested page number does not exist. + */ + public static final int NO_SUCH_PAGE = 0; + + /** + * This value is returned by the print() method to indicate + * that the requested page exists and has been printed. + */ + public static final int PAGE_EXISTS = 1; + + /*************************************************************************/ + + /** + * This method prints the specified page to the specified graphics + * context in the specified format. The pages are numbered starting + * from zero. + * + * @param graphics The graphics context to render the pages on. + * @param format The format in which to print the page. + * @param page_number The page number to print, where numbers start at zero. + * + * @return PAGE_EXISTS if the requested page exists and was + * successfully printed, NO_SUCH_PAGE otherwise. + * + * @exception PrinterException If an error occurs during printing. + */ + public abstract int + print(Graphics graphics, PageFormat format, int page_number) + throws PrinterException; + + } // interface Printable + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/PrinterAbortException.java gcc-3.3/libjava/java/awt/print/PrinterAbortException.java *** gcc-3.2.3/libjava/java/awt/print/PrinterAbortException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/PrinterAbortException.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,71 ---- + /* PrinterAbortException.java -- Indicates the print job was aborted + Copyright (C) 1999, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + /** + * This exception is thrown when the print job is aborted, either by the + * user or by the application. + * + * @author Aaron M. Renn + * @status updated to 1.4 + */ + public class PrinterAbortException extends PrinterException + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 4725169026278854136L; + + /** + * Create a new instance with no detailed error message. + */ + public PrinterAbortException() + { + } + + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public PrinterAbortException(String message) + { + super(message); + } + } // class PrinterAbortException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/PrinterException.java gcc-3.3/libjava/java/awt/print/PrinterException.java *** gcc-3.2.3/libjava/java/awt/print/PrinterException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/PrinterException.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,71 ---- + /* PrinterException.java -- generic problem in the printing subsystem + Copyright (C) 1999, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + /** + * This is the generic toplevel exception for printing errors. Subclasses + * provide more detailed descriptions of the problem. + * + * @author Aaron M. Renn + * @status updated to 1.4 + */ + public class PrinterException extends Exception + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -3757589981158265819L; + + /** + * Create a new instance with no detailed error message. + */ + public PrinterException() + { + } + + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public PrinterException(String message) + { + super(message); + } + } // class PrinterException diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/PrinterGraphics.java gcc-3.3/libjava/java/awt/print/PrinterGraphics.java *** gcc-3.2.3/libjava/java/awt/print/PrinterGraphics.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/PrinterGraphics.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,61 ---- + /* PrinterGraphics.java -- Hook to return print job controller. + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + /** + * This interface is implemented by the Graphics instance + * that is used for rendering pages. It provides a hook to return the + * object that is controlling the print job. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + public interface PrinterGraphics + { + + /** + * This method returns the instance of PrinterJob that is + * controlling this print job. + * + * @return The PrinterJob that is controlling this print job. + */ + public abstract PrinterJob + getPrinterJob(); + + } // interface PrinterGraphics + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/PrinterIOException.java gcc-3.3/libjava/java/awt/print/PrinterIOException.java *** gcc-3.2.3/libjava/java/awt/print/PrinterIOException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/PrinterIOException.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,98 ---- + /* PrinterIOException.java -- The print job encountered an I/O error + Copyright (C) 1999, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + import java.io.IOException; + + /** + * This exception is thrown when the print job encounters an I/O problem + * of some kind. + * + * @author Aaron M. Renn + * @author Eric Blake + * @status updated to 1.4 + */ + public class PrinterIOException extends PrinterException + { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 5850870712125932846L; + + /** + * The exception that caused this (duplicates Throwable). + * + * @serial the I/O exception that terminated the job + */ + private final IOException mException; + + /** + * Initializes a new instance with the given cause. + * + * @param mException the cause + */ + public PrinterIOException(IOException mException) + { + super(mException == null ? null : mException.toString()); + initCause(mException); + this.mException = mException; + } + + /** + * Gets the underlying IOException that caused this exception. + * This legacy method has been replaced by {@link #getCause()}. + * + * @return the cause + */ + public IOException getIOException() + { + return mException; + } + + /** + * Gets the cause. + * + * @return the cause + */ + public Throwable getCause() + { + return mException; + } + } // class PrinterIOException + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/print/PrinterJob.java gcc-3.3/libjava/java/awt/print/PrinterJob.java *** gcc-3.2.3/libjava/java/awt/print/PrinterJob.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/print/PrinterJob.java 2002-08-09 04:26:16.000000000 +0000 *************** *** 0 **** --- 1,259 ---- + /* PrinterJob.java -- This job is the printer control class + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt.print; + + /** + * This class controls printing. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + public abstract class PrinterJob + { + + /* + * Class Methods + */ + + /** + * Creates a new print job. + * + * @return A PrinterJob object for the newly created print job. + */ + public static PrinterJob + getPrinterJob() + { + // FIXME: Need to fix this to load a default implementation instance. + return(null); + } + + /*************************************************************************/ + + /* + * Constructors + */ + + /** + * Initializes a new instance of PrinterJob. + */ + public + PrinterJob() + { + ; + } + + /*************************************************************************/ + + /* + * Instance Methods + */ + + /** + * Returns the number of copies to be printed. + * + * @return The number of copies to be printed. + */ + public abstract int + getCopies(); + + /*************************************************************************/ + + /** + * Sets the number of copies to be printed. + * + * @param copies The number of copies to be printed. + */ + public abstract void + setCopies(); + + /*************************************************************************/ + + /** + * Returns the name of the print job. + * + * @return The name of the print job. + */ + public abstract String + getJobName(); + + /*************************************************************************/ + + /** + * Sets the name of the print job. + * + * @param job_name The name of the print job. + */ + public abstract String + setJobName(String job_name); + + /*************************************************************************/ + + /** + * Returns the printing user name. + * + * @return The printing username. + */ + public abstract String + getUserName(); + + /*************************************************************************/ + + /** + * Cancels an in progress print job. + */ + public abstract void + cancel(); + + /*************************************************************************/ + + /** + * Tests whether or not this job has been cancelled. + * + * @param true if this job has been cancelled, false + * otherwise. + */ + public abstract boolean + isCancelled(); + + /*************************************************************************/ + + /** + * Returns an instance of the default page which will have the default + * paper and orientation. + * + * @return A default instance of PageFormat. + */ + public PageFormat + defaultPage() + { + return(new PageFormat()); + } + + /*************************************************************************/ + + /** + * Clones the specified PageFormat object then alters the + * clone so that it represents the default page format. + * + * @param page_format The PageFormat to clone. + * + * @return A new default page format. + */ + public abstract PageFormat + defaultPage(PageFormat page_format); + + /*************************************************************************/ + + /** + * Displays a dialog box to the user which allows the page format + * attributes to be modified. + * + * @param page_format The PageFormat object to modify. + * + * @return The modified PageFormat. + */ + public abstract PageFormat + pageDialog(PageFormat page_format); + + /*************************************************************************/ + + /** + * Prints the pages. + */ + public abstract void + print(); + + /** + * Displays a dialog box to the user which allows the print job + * attributes to be modified. + * + * @return false if the user cancels the dialog box, + * true otherwise. + */ + public abstract boolean + printDialog(); + + /*************************************************************************/ + + /** + * This sets the pages that are to be printed. + * + * @param pageable The pages to be printed, which may not be null. + */ + public abstract void + setPageable(Pageable pageable); + + /*************************************************************************/ + + /** + * Sets this specified Printable as the one to use for + * rendering the pages on the print device. + * + * @param printable The Printable for the print job. + */ + public abstract void + setPrintable(Printable printable); + + /*************************************************************************/ + + /** + * Sets the Printable and the page format for the pages + * to be printed. + * + * @param printable The Printable for the print job. + * @param page_format The PageFormat for the print job. + */ + public abstract void + setPrintable(Printable printable, PageFormat page_format); + + /*************************************************************************/ + + /** + * Makes any alterations to the specified PageFormat + * necessary to make it work with the current printer. The alterations + * are made to a clone of the input object, which is then returned. + * + * @param page_format The PageFormat to validate. + * + * @return The validated PageFormat. + */ + public abstract PageFormat + validatePage(PageFormat page); + + } // class PrinterJob + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/PrintGraphics.java gcc-3.3/libjava/java/awt/PrintGraphics.java *** gcc-3.2.3/libjava/java/awt/PrintGraphics.java 2002-01-24 06:30:58.000000000 +0000 --- gcc-3.3/libjava/java/awt/PrintGraphics.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* PrintGraphics.java -- A print graphics context. ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PrintGraphics.java -- a print graphics context ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,59 **** package java.awt; /** ! * This interface allows the originating print job to be obtained. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public interface PrintGraphics { ! ! /** ! * Returns the PrintJob that this object is being ! * managed by. ! * ! * @return The print job for this object. ! */ ! public abstract PrintJob ! getPrintJob(); ! } // interface PrintGraphics - --- 39,57 ---- package java.awt; /** ! * This interface allows the originating print job to be obtained. ! * ! * @author Aaron M. Renn ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface PrintGraphics { ! /** ! * Returns the PrintJob that this object is being ! * managed by. ! * ! * @return the print job for this object ! */ ! PrintJob getPrintJob(); } // interface PrintGraphics diff -Nrc3pad gcc-3.2.3/libjava/java/awt/PrintJob.java gcc-3.3/libjava/java/awt/PrintJob.java *** gcc-3.2.3/libjava/java/awt/PrintJob.java 2002-01-24 06:30:59.000000000 +0000 --- gcc-3.3/libjava/java/awt/PrintJob.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** /* PrintJob.java -- A print job class ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* PrintJob.java -- A print job class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,128 **** package java.awt; /** ! * This abstract class represents a print job. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public abstract class PrintJob ! { ! ! /* ! * Constructors */ ! ! /** ! * This method initializes a new instance of PrintJob. ! */ ! public ! PrintJob() { ! } ! ! /*************************************************************************/ ! ! /* ! * Instance Methods ! */ ! ! /** ! * Returns a graphics context suitable for rendering the next page. ! * ! * @return A graphics context for printing the next page. ! */ ! public abstract Graphics ! getGraphics(); ! ! /*************************************************************************/ ! ! /** ! * Returns the dimension of the page in pixels. The resolution will be ! * chosen to be similar to the on screen image. ! * ! * @return The page dimensions. ! */ ! public abstract Dimension ! getPageDimension(); ! ! /*************************************************************************/ ! ! /** ! * Returns the resolution of the page in pixels per inch. ! * ! * @return The resolution of the page in pixels per inch. ! */ ! public abstract int ! getPageResolution(); ! ! /*************************************************************************/ ! /** ! * Tests whether or not the last page will be printed first. ! * ! * @return true if the last page prints first, false ! * otherwise. ! */ ! public abstract boolean ! lastPageFirst(); ! /*************************************************************************/ ! /** ! * Informs the print job that printing is complete. ! */ ! public abstract void ! end(); ! /*************************************************************************/ ! /** ! * This method explicitly ends the print job in the event the job ! * becomes un-referenced without the application having done so. ! */ ! public void ! finalize() ! { ! end(); ! } } // class PrintJob - --- 39,102 ---- package java.awt; /** ! * This abstract class represents a print job. ! * ! * @author Aaron M. Renn ! * @see Toolkit#getPrintJob(Frame, String, Properties) ! * @since 1.0 ! * @status updated to 1.4 */ ! public abstract class PrintJob { ! /** ! * Create a new PrintJob. ! */ ! public PrintJob() ! { ! } ! /** ! * Returns a graphics context suitable for rendering the next page. The ! * return must also implement {@link PrintGraphics}. ! * ! * @return a graphics context for printing the next page ! */ ! public abstract Graphics getGraphics(); ! /** ! * Returns the dimension of the page in pixels. The resolution will be ! * chosen to be similar to the on screen image. ! * ! * @return the page dimensions ! */ ! public abstract Dimension getPageDimension(); ! /** ! * Returns the resolution of the page in pixels per inch. Note that this is ! * not necessarily the printer's resolution. ! * ! * @return the resolution of the page in pixels per inch ! */ ! public abstract int getPageResolution(); ! /** ! * Tests whether or not the last page will be printed first. ! * ! * @return true if the last page prints first ! */ ! public abstract boolean lastPageFirst(); ! /** ! * Informs the print job that printing is complete or should be aborted. ! */ ! public abstract void end(); + /** + * This method explicitly ends the print job in the event the job + * becomes un-referenced without the application having done so. + */ + public void finalize() + { + end(); + } } // class PrintJob diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Rectangle.java gcc-3.3/libjava/java/awt/Rectangle.java *** gcc-3.2.3/libjava/java/awt/Rectangle.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/Rectangle.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Rectangle.java -- represents a graphics rectangle ! Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,77 **** package java.awt; ! import java.awt.geom.*; import java.io.Serializable; - /* Status: Mostly complete. Some of the Java2D stuff is commented out. */ - /** * This class represents a rectangle and all the interesting things you * might want to do with it. Note that the coordinate system uses * the origin (0,0) as the top left of the screen, with the x and y * values increasing as they move to the right and down respectively. * * @author Warren Levy ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class Rectangle extends Rectangle2D ! implements Cloneable, Shape, Serializable { /** ! * The X coordinate of the top-left corner of the rectangle. ! */ public int x; /** ! * The Y coordinate of the top-left corner of the rectangle; ! */ public int y; /** ! * The width of the rectangle ! */ public int width; /** ! * The height of the rectangle ! */ public int height; /** --- 38,110 ---- package java.awt; ! import java.awt.geom.AffineTransform; ! import java.awt.geom.Rectangle2D; import java.io.Serializable; /** * This class represents a rectangle and all the interesting things you * might want to do with it. Note that the coordinate system uses * the origin (0,0) as the top left of the screen, with the x and y * values increasing as they move to the right and down respectively. * + *

        It is valid for a rectangle to have negative width or height; but it + * is considered to have no area or internal points. Therefore, the behavior + * in methods like contains or intersects is + * undefined unless the rectangle has positive width and height. + * + *

        There are some public fields; if you mess with them in an inconsistent + * manner, it is your own fault when you get NullPointerException, + * ArrayIndexOutOfBoundsException, or invalid results. Also, this class is + * not threadsafe. + * * @author Warren Levy ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ ! public class Rectangle extends Rectangle2D implements Shape, Serializable { /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4345857070255674764L; ! ! /** ! * The X coordinate of the top-left corner of the rectangle. ! * ! * @see #setLocation(int, int) ! * @see #getLocation() ! * @serial the x coordinate ! */ public int x; /** ! * The Y coordinate of the top-left corner of the rectangle. ! * ! * @see #setLocation(int, int) ! * @see #getLocation() ! * @serial the y coordinate ! */ public int y; /** ! * The width of the rectangle. ! * ! * @see #setSize(int, int) ! * @see #getSize() ! * @serial ! */ public int width; /** ! * The height of the rectangle. ! * ! * @see #setSize(int, int) ! * @see #getSize() ! * @serial ! */ public int height; /** *************** public class Rectangle extends Rectangle *** 80,96 **** */ public Rectangle() { - x = 0; - y = 0; - width = 0; - height = 0; } /** * Initializes a new instance of Rectangle from the * coordinates of the specified rectangle. * ! * @param rect The rectangle to copy from. */ public Rectangle(Rectangle r) { --- 113,127 ---- */ public Rectangle() { } /** * Initializes a new instance of Rectangle from the * coordinates of the specified rectangle. * ! * @param r the rectangle to copy from ! * @throws NullPointerException if r is null ! * @since 1.1 */ public Rectangle(Rectangle r) { *************** public class Rectangle extends Rectangle *** 104,113 **** * Initializes a new instance of Rectangle from the specified * inputs. * ! * @param x The X coordinate of the top left corner of the rectangle. ! * @param y The Y coordinate of the top left corner of the rectangle. ! * @param width The width of the rectangle. ! * @param height The height of the rectangle. */ public Rectangle(int x, int y, int width, int height) { --- 135,144 ---- * Initializes a new instance of Rectangle from the specified * inputs. * ! * @param x the X coordinate of the top left corner ! * @param y the Y coordinate of the top left corner ! * @param width the width of the rectangle ! * @param height the height of the rectangle */ public Rectangle(int x, int y, int width, int height) { *************** public class Rectangle extends Rectangle *** 119,134 **** /** * Initializes a new instance of Rectangle with the specified ! * width and height. The upper left corner of the rectangle will be at * the origin (0,0). * ! * @param width The width of the rectangle. ! * @param height the height of the rectange. */ public Rectangle(int width, int height) { - x = 0; - y = 0; this.width = width; this.height = height; } --- 150,163 ---- /** * Initializes a new instance of Rectangle with the specified ! * width and height. The upper left corner of the rectangle will be at * the origin (0,0). * ! * @param width the width of the rectangle ! * @param height the height of the rectange */ public Rectangle(int width, int height) { this.width = width; this.height = height; } *************** public class Rectangle extends Rectangle *** 138,145 **** * corner represented by the specified point and the width and height * represented by the specified dimension. * ! * @param point The upper left corner of the rectangle. ! * @param dim The width and height of the rectangle. */ public Rectangle(Point p, Dimension d) { --- 167,175 ---- * corner represented by the specified point and the width and height * represented by the specified dimension. * ! * @param p the upper left corner of the rectangle ! * @param d the width and height of the rectangle ! * @throws NullPointerException if p or d is null */ public Rectangle(Point p, Dimension d) { *************** public class Rectangle extends Rectangle *** 153,166 **** * Initializes a new instance of Rectangle with a top left * corner at the specified point and a width and height of zero. * ! * @param poin The upper left corner of the rectangle. */ public Rectangle(Point p) { x = p.x; y = p.y; - width = 0; - height = 0; } /** --- 183,194 ---- * Initializes a new instance of Rectangle with a top left * corner at the specified point and a width and height of zero. * ! * @param p the upper left corner of the rectangle */ public Rectangle(Point p) { x = p.x; y = p.y; } /** *************** public class Rectangle extends Rectangle *** 168,318 **** * upper left corner at the origin (0,0) and a width and height represented * by the specified dimension. * ! * @param dim The width and height of the rectangle. */ public Rectangle(Dimension d) { - x = 0; - y = 0; width = d.width; height = d.height; } /** ! * Returns the bounding rectangle for this rectangle, which is simply ! * this rectange itself. * ! * @return This rectangle. */ ! public Rectangle getBounds () { ! return (Rectangle) this.clone(); } /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified point. * ! * @param x The X coordinate of the point to add to this rectangle. ! * @param y The Y coordinate of the point to add to this rectangle. */ ! public void add(int newx, int newy) { ! int x = this.x > newx ? newx : this.x; ! int y = this.y > newy ? newy : this.y; ! width = (this.x + width > newx ? this.x + width : newx) - x; ! height = (this.y + height > newy ? this.y + height : newy) - y; ! this.x = x; ! this.y = y; } /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified point. * ! * @param point The point to add to this rectangle. */ ! public void add(Point pt) { ! add (pt.x, pt.y); } /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified rectangle. * ! * @param rect The rectangle to add to this rectangle. */ ! public void add(Rectangle r) { ! int x = this.x > r.x ? r.x : this.x; ! int y = this.y > r.y ? r.y : this.y; ! width = (this.x + width > r.x + r.width ? ! this.x + width : r.x + r.width) - x; ! height = (this.y + height > r.y + r.height ? ! this.y + height : r.y + r.height) - y; ! this.x = x; ! this.y = y; } /** ! * Tests whether or not the specified point is inside this rectangle. ! * ! * @param x The X coordinate of the point to test. ! * @param y The Y coordinate of the point to test. * ! * @return true if the point is inside the rectangle, ! * false otherwise. */ ! public boolean contains(int x, int y) { ! return (x >= this.x && x <= this.x + this.width ! && y >= this.y && y <= this.y + this.height); ! } ! public boolean contains(int x, int y, int w, int h) { ! return (x >= this.x && x + w <= this.x + this.width ! && y >= this.y && y + h <= this.y + this.height); } /** ! * Tests whether or not the specified point is inside this rectangle. ! * ! * @param point The point to test. * ! * @return true if the point is inside the rectangle, ! * false otherwise. */ ! public boolean contains(Point p) { ! return contains(p.x, p.y); } ! public boolean contains(Rectangle r) { ! return contains(r.x, r.y, r.width, r.height); } /** ! * Tests this rectangle for equality against the specified object. This ! * will be true if an only if the specified object: ! *

        ! *

          ! *
        • Is not null. ! *
        • Is an instance of Rectangle. ! *
        • Has X and Y coordinates identical to this rectangle. ! *
        • Has a width and height identical to this rectangle. ! *
        ! * ! * @param obj The object to test against for equality. * ! * @return true if the specified object is equal to this one, ! * false otherwise. */ ! public boolean equals(Object obj) { ! if (obj instanceof Rectangle) ! { ! Rectangle r = (Rectangle) obj; ! return (r.x == x ! && r.y == y ! && r.width == width ! && r.height == height); ! } ! return false; } ! public double getHeight() { ! return (double) this.height; } /** * Returns the location of this rectangle, which is the coordinates of * its upper left corner. * ! * @return The point where this rectangle is located. */ public Point getLocation() { --- 196,349 ---- * upper left corner at the origin (0,0) and a width and height represented * by the specified dimension. * ! * @param d the width and height of the rectangle */ public Rectangle(Dimension d) { width = d.width; height = d.height; } /** ! * Get the X coordinate of the upper-left corner. * ! * @return the value of x, as a double */ ! public double getX() { ! return x; } /** ! * Get the Y coordinate of the upper-left corner. * ! * @return the value of y, as a double */ ! public double getY() { ! return y; } /** ! * Get the width of the rectangle. * ! * @return the value of width, as a double */ ! public double getWidth() { ! return width; } /** ! * Get the height of the rectangle. * ! * @return the value of height, as a double */ ! public double getHeight() { ! return height; } /** ! * Returns the bounds of this rectangle. A pretty useless method, as this ! * is already a rectangle; it is included to mimic the ! * getBounds method in Component. * ! * @return a copy of this rectangle ! * @see #setBounds(Rectangle) ! * @since 1.1 */ ! public Rectangle getBounds() { ! return new Rectangle(this); ! } ! /** ! * Returns the high-precision bounds of this rectangle. A pretty useless ! * method, as this is already a rectangle. ! * ! * @return a copy of this rectangle ! * @see #setBounds(Rectangle) ! * @since 1.2 ! */ ! public Rectangle2D getBounds2D() { ! return new Rectangle(x, y, width, height); } /** ! * Updates this rectangle to match the dimensions of the specified ! * rectangle. * ! * @param r the rectangle to update from ! * @throws NullPointerException if r is null ! * @see #setBounds(int, int, int, int) ! * @since 1.1 */ ! public void setBounds(Rectangle r) { ! x = r.x; ! y = r.y; ! width = r.width; ! height = r.height; } ! /** ! * Updates this rectangle to have the specified dimensions. ! * ! * @param x the new X coordinate of the upper left hand corner ! * @param y the new Y coordinate of the upper left hand corner ! * @param width the new width of this rectangle ! * @param height the new height of this rectangle ! * @since 1.1 ! */ ! public void setBounds(int x, int y, int width, int height) { ! this.x = x; ! this.y = y; ! this.width = width; ! this.height = height; } /** ! * Updates this rectangle to have the specified dimensions, as rounded to ! * integers. * ! * @param x the new X coordinate of the upper left hand corner ! * @param y the new Y coordinate of the upper left hand corner ! * @param width the new width of this rectangle ! * @param height the new height of this rectangle ! * @since 1.2 */ ! public void setRect(double x, double y, double width, double height) { ! this.x = (int) x; ! this.y = (int) y; ! this.width = (int) width; ! this.height = (int) height; } ! /** ! * Updates this rectangle to have the specified dimensions. ! * ! * @param x the new X coordinate of the upper left hand corner ! * @param y the new Y coordinate of the upper left hand corner ! * @param width the new width of this rectangle ! * @param height the new height of this rectangle ! * @deprecated use {@link #setBounds(int, int, int, int)} instead ! */ ! public void reshape(int x, int y, int width, int height) { ! setBounds(x, y, width, height); } /** * Returns the location of this rectangle, which is the coordinates of * its upper left corner. * ! * @return the point where this rectangle is located ! * @see setLocation(Point) ! * @since 1.1 */ public Point getLocation() { *************** public class Rectangle extends Rectangle *** 320,645 **** } /** ! * Returns the size of this rectangle. * ! * @return The size of this rectangle. */ ! public Dimension getSize() { ! return new Dimension(width, height); } ! public double getWidth() { ! return (double) this.width; } ! public double getX() { ! return (double) x; } ! public double getY() { ! return (double) y; } /** ! * Expands the rectangle by the specified amount. The horizontal ! * and vertical expansion values are applied both to the X,Y coordinate ! * of this rectangle, and its width and height. Thus the width and ! * height will increase by 2h and 2v accordingly. * ! * @param h The horizontal expansion value. ! * @param v The vertical expansion value. */ ! public void grow(int h, int v) { ! width += h; ! height += v; } /** ! * Tests whether or not the specified point is inside this rectangle. ! * ! * @param x The X coordinate of the point to test. ! * @param y The Y coordinate of the point to test. ! * ! * @return true if the point is inside the rectangle, ! * false otherwise. * ! * @deprecated This method is deprecated in favor of ! * contains(int, int). */ ! public boolean inside(int x, int y) { ! return contains(x, y); } /** ! * Determines the rectange which is formed by the intersection of this ! * rectangle with the specified rectangle. ! * ! * @param rect The rectange to calculate the intersection with. ! * ! * @return The rectangle bounding the intersection. * ! * @specnote If there is no intersection, an empty rectangle at 0,0 ! * is returned. */ ! public Rectangle intersection(Rectangle r) { ! int newx = x < r.x ? r.x : x; ! int newy = y < r.y ? r.y : y; ! int neww = (x + width < r.x + r.width ? ! x + width : r.x + r.width) - newx; ! int newh = (y + height < r.y + r.height ? ! y + height : r.y + r.height) - newy; ! if (neww >= 0 && newh >= 0) ! return new Rectangle(newx, newy, neww, newh); ! else ! return new Rectangle(0, 0, 0, 0); } /** ! * Tests whether or not the specified rectangle intersects this rectangle. ! * ! * @param rect The rectangle to test against. ! * ! * @return true if the specified rectangle intersects this ! * one, false otherwise. * ! * @specnote If the intersection is at an edge or corner only (an empty ! * intersection with a non-zero location), false is returned. */ ! public boolean intersects(Rectangle r) { ! int neww = (x + width < r.x + r.width ? ! x + width : r.x + r.width) - (x < r.x ? r.x : x); ! int newh = (y + height < r.y + r.height ? ! y + height : r.y + r.height) - (y < r.y ? r.y : y); ! return (neww > 0 && newh > 0); } /** ! * Tests whether or not this rectangle is empty. An empty rectangle ! * has a width or height of zero. * ! * @return true if the rectangle is empty, false ! * otherwise. */ ! public boolean isEmpty() { ! return !(width > 0 && height > 0); } /** ! * Moves the location of this rectangle by setting its upper left ! * corner to the specified coordinates. ! * // FIXME: Is this true? ! * ! * @param x The new X coordinate for this rectangle. ! * @param y The new Y coordinate for this rectangle. * ! * @deprecated This method is deprecated in favor of ! * setLocation(int, int). */ ! public void move(int x, int y) { ! setLocation(x, y); } ! public int outcode(double x, double y) { ! // FIXME ! return 0; } /** ! * Updates this rectangle to have the specified dimensions. ! * ! * @param x The new X coordinate of the upper left hand corner. ! * @param y The new Y coordinate of the upper left hand corner. ! * @param width The new width of this rectangle. ! * @param height The new height of this rectangle. * ! * @deprecated This method is deprecated in favor of ! * setBounds(int, int, int, int). */ ! public void reshape(int x, int y, int width, int height) { ! setBounds(x, y, width, height); } /** ! * Sets the size of this rectangle based on the specified dimensions. ! * ! * @param width The new width of the rectangle. ! * @param height The new height of the rectangle. * ! * @deprecated This method is deprecated in favor of ! * setSize(int, int). */ ! public void resize(int width, int height) { ! setSize(width, height); } /** ! * Updates this rectangle to have the specified dimensions. * ! * @param x The new X coordinate of the upper left hand corner. ! * @param y The new Y coordinate of the upper left hand corner. ! * @param width The new width of this rectangle. ! * @param height The new height of this rectangle. */ ! public void setBounds(int x, int y, int width, int height) { ! this.x = x; ! this.y = y; ! this.width = width; ! this.height = height; } /** ! * Updates this rectangle to match the dimensions of the specified ! * rectangle. * ! * @param rect The rectangle to update from. */ ! public void setBounds(Rectangle r) { ! this.x = r.x; ! this.y = r.y; ! this.width = r.width; ! this.height = r.height; } /** ! * Moves the location of this rectangle by setting its upper left ! * corner to the specified coordinates. ! * // FIXME: Is this true? * ! * @param x The new X coordinate for this rectangle. ! * @param y The new Y coordinate for this rectangle. */ ! public void setLocation(int x, int y) { ! this.x = x; ! this.y = y; } /** ! * Moves the location of this rectangle by setting its upper left ! * corner to the specified point. ! * // FIXME: Is this true? * ! * @param point The point to move the rectange to. */ ! public void setLocation(Point p) { ! this.x = p.x; ! this.y = p.y; } ! public void setRect(double x, double y, double width, double height) { ! this.x = (int) x; ! this.y = (int) y; ! this.width = (int) width; ! this.height = (int) height; } /** ! * Sets the size of this rectangle based on the specified dimensions. * ! * @param dim The new dimensions of the rectangle. */ ! public void setSize(Dimension d) { ! this.width = d.width; ! this.height = d.height; } /** ! * Sets the size of this rectangle based on the specified dimensions. * ! * @param width The new width of the rectangle. ! * @param height The new height of the rectangle. */ ! public void setSize(int width, int height) { ! this.width = width; ! this.height = height; } ! public void translate(int x, int y) { ! x += x; ! y += y; } /** ! * Returns the smallest rectangle that contains both this rectangle ! * and the specified rectangle. ! * ! * @param rect The rectangle to compute the union with. * ! * @return The smallest rectangle containing both rectangles. */ ! public Rectangle union(Rectangle r) { ! int newx = x > r.x ? r.x : x; ! int newy = y > r.y ? r.y : y; ! int neww = (this.x + width > r.x + r.width ? ! this.x + width : r.x + r.width) - newx; ! int newh = (this.y + height > r.y + r.height ? ! this.y + height : r.y + r.height) - newy; ! return new Rectangle(newx, newy, neww, newh); } ! // Commented out until we have Rectangle2D public Rectangle2D createIntersection(Rectangle2D r) { ! // FIXME: maybe we should consider returning a Rectangle or ! // Rectangle2D.Float depending on type of R. ! Rectangle2D.Double res = new Rectangle2D.Double (); ! intersect (this, r, res); return res; } public Rectangle2D createUnion(Rectangle2D r) { ! // FIXME: maybe we should consider returning a Rectangle or ! // Rectangle2D.Float depending on type of R. ! Rectangle2D.Double res = new Rectangle2D.Double (); ! union (this, r, res); return res; } - public Rectangle2D getBounds2D() - { - return new Rectangle (x, y, width, height); - } - /** ! * Returns a string representation of this rectangle. * ! * @return A string representation of this rectangle. */ ! public String toString() { ! return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ! ",height=" + height + "]"; } /** ! * Returns a hash value for this object. * ! * @return A hash value for this object. */ ! public int hashCode() { ! return x * y * width * height * 37; } ! } --- 351,759 ---- } /** ! * Moves the location of this rectangle by setting its upper left ! * corner to the specified point. * ! * @param p the point to move the rectangle to ! * @throws NullPointerException if p is null ! * @see #getLocation() ! * @since 1.1 */ ! public void setLocation(Point p) { ! this.x = p.x; ! this.y = p.y; } ! /** ! * Moves the location of this rectangle by setting its upper left ! * corner to the specified coordinates. ! * ! * @param x the new X coordinate for this rectangle ! * @param y the new Y coordinate for this rectangle ! * @since 1.1 ! */ ! public void setLocation(int x, int y) { ! this.x = x; ! this.y = y; } ! /** ! * Moves the location of this rectangle by setting its upper left ! * corner to the specified coordinates. ! * ! * @param x the new X coordinate for this rectangle ! * @param y the new Y coordinate for this rectangle ! * @deprecated use {@link #setLocation(int, int)} instead ! */ ! public void move(int x, int y) { ! setLocation(x, y); } ! /** ! * Translate the location of this rectangle by the given amounts. ! * ! * @param dx the x distance to move by ! * @param dy the y distance to move by ! * @see #setLocation(int, int) ! */ ! public void translate(int dx, int dy) { ! x += dx; ! y += dy; } /** ! * Returns the size of this rectangle. * ! * @return the size of this rectangle ! * @see #setSize(Dimension) ! * @since 1.1 */ ! public Dimension getSize() { ! return new Dimension(width, height); } /** ! * Sets the size of this rectangle based on the specified dimensions. * ! * @param d the new dimensions of the rectangle ! * @throws NullPointerException if d is null ! * @see #getSize() ! * @since 1.1 */ ! public void setSize(Dimension d) { ! width = d.width; ! height = d.height; } /** ! * Sets the size of this rectangle based on the specified dimensions. * ! * @param width the new width of the rectangle ! * @param height the new height of the rectangle ! * @since 1.1 */ ! public void setSize(int width, int height) { ! this.width = width; ! this.height = height; } /** ! * Sets the size of this rectangle based on the specified dimensions. * ! * @param width the new width of the rectangle ! * @param height the new height of the rectangle ! * @deprecated use {@link #setSize(int, int)} instead */ ! public void resize(int width, int height) { ! setSize(width, height); } /** ! * Tests whether or not the specified point is inside this rectangle. ! * According to the contract of Shape, a point on the border is in only if ! * it has an adjacent point inside the rectangle in either the increasing ! * x or y direction. * ! * @param p the point to test ! * @return true if the point is inside the rectangle ! * @throws NullPointerException if p is null ! * @see #contains(int, int) ! * @since 1.1 */ ! public boolean contains(Point p) { ! return width > 0 && height > 0 ! && p.x >= x && p.x < x + width ! && p.y >= y && p.y < y + height; } /** ! * Tests whether or not the specified point is inside this rectangle. ! * According to the contract of Shape, a point on the border is in only if ! * it has an adjacent point inside the rectangle in either the increasing ! * x or y direction. * ! * @param x the X coordinate of the point to test ! * @param y the Y coordinate of the point to test ! * @return true if the point is inside the rectangle ! * @since 1.1 */ ! public boolean contains(int x, int y) { ! return width > 0 && height > 0 ! && x >= this.x && x < this.x + width ! && y >= this.y && y < this.y + height; } ! /** ! * Checks whether all points in the given rectangle are contained in this ! * rectangle. ! * ! * @param r the rectangle to check ! * @return true if r is contained in this rectangle ! * @throws NullPointerException if r is null ! * @see #contains(int, int, int, int) ! * @since 1.1 ! */ ! public boolean contains(Rectangle r) { ! return width > 0 && height > 0 && r.width > 0 && r.height > 0 ! && r.x >= x && r.x + r.width <= x + width ! && r.y >= y && r.y + r.height <= y + height; } /** ! * Checks whether all points in the given rectangle are contained in this ! * rectangle. * ! * @param x the x coordinate of the rectangle to check ! * @param y the y coordinate of the rectangle to check ! * @param w the width of the rectangle to check ! * @param h the height of the rectangle to check ! * @return true if the parameters are contained in this rectangle ! * @since 1.1 */ ! public boolean contains(int x, int y, int w, int h) { ! return width > 0 && height > 0 && w > 0 && h > 0 ! && x >= this.x && x + w <= this.x + this.width ! && y >= this.y && y + h <= this.y + this.height; } /** ! * Tests whether or not the specified point is inside this rectangle. * ! * @param x the X coordinate of the point to test ! * @param y the Y coordinate of the point to test ! * @return true if the point is inside the rectangle ! * @deprecated use {@link #contains(int, int)} instead */ ! public boolean inside(int x, int y) { ! return contains(x, y); } /** ! * Tests whether or not the specified rectangle intersects this rectangle. ! * This means the two rectangles share at least one internal point. * ! * @param r the rectangle to test against ! * @return true if the specified rectangle intersects this one ! * @throws NullPointerException if r is null ! * @since 1.2 */ ! public boolean intersects(Rectangle r) { ! return width > 0 && height > 0 && r.width > 0 && r.height > 0 ! && r.x < x + width && r.x + r.width > x ! && r.y < y + height && r.y + r.height > y; } /** ! * Determines the rectangle which is formed by the intersection of this ! * rectangle with the specified rectangle. If the two do not intersect, ! * an empty rectangle will be returned (meaning the width and/or height ! * will be non-positive). * ! * @param r the rectange to calculate the intersection with ! * @return a new rectangle bounding the intersection ! * @throws NullPointerException if r is null */ ! public Rectangle intersection(Rectangle r) { ! Rectangle res = new Rectangle(); ! intersect(this, r, res); ! return res; } /** ! * Returns the smallest rectangle that contains both this rectangle ! * and the specified rectangle. * ! * @param r the rectangle to compute the union with ! * @return the smallest rectangle containing both rectangles ! * @throws NullPointerException if r is null */ ! public Rectangle union(Rectangle r) { ! Rectangle res = new Rectangle(); ! union(this, r, res); ! return res; } /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified point. ! * However, if the point falls on one of the two borders which are not ! * inside the rectangle, a subsequent call to contains may ! * return false. * ! * @param x the X coordinate of the point to add to this rectangle ! * @param y the Y coordinate of the point to add to this rectangle */ ! public void add(int x, int y) { ! add((double) x, (double) y); } ! /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified point. ! * However, if the point falls on one of the two borders which are not ! * inside the rectangle, a subsequent call to contains may ! * return false. ! * ! * @param p the point to add to this rectangle ! * @throws NullPointerException if p is null ! */ ! public void add(Point p) { ! add((double) p.x, (double) p.y); } /** ! * Modifies this rectangle so that it represents the smallest rectangle ! * that contains both the existing rectangle and the specified rectangle. * ! * @param r the rectangle to add to this rectangle ! * @throws NullPointerException if r is null ! * @see #union(Rectangle) */ ! public void add(Rectangle r) { ! union(this, r, this); } /** ! * Expands the rectangle by the specified amount. The horizontal ! * and vertical expansion values are applied both to the X,Y coordinate ! * of this rectangle, and its width and height. Thus the width and ! * height will increase by 2h and 2v accordingly. * ! * @param h the horizontal expansion value ! * @param v the vertical expansion value */ ! public void grow(int h, int v) { ! x -= h; ! y -= v; ! width += h + h; ! height += v + v; } ! /** ! * Tests whether or not this rectangle is empty. An empty rectangle ! * has a non-positive width or height. ! * ! * @return true if the rectangle is empty ! */ ! public boolean isEmpty() { ! return width <= 0 || height <= 0; } /** ! * Determine where the point lies with respect to this rectangle. The ! * result will be the binary OR of the appropriate bit masks. * ! * @param x the x coordinate to check ! * @param y the y coordinate to check ! * @return the binary OR of the result ! * @see #OUT_LEFT ! * @see #OUT_TOP ! * @see #OUT_RIGHT ! * @see #OUT_BOTTOM ! * @since 1.2 */ ! public int outcode(double x, double y) { ! int result = 0; ! if (width <= 0) ! result |= OUT_LEFT | OUT_RIGHT; ! else if (x < this.x) ! result |= OUT_LEFT; ! else if (x > this.x + width) ! result |= OUT_RIGHT; ! if (height <= 0) ! result |= OUT_BOTTOM | OUT_TOP; ! else if (y < this.y) // Remember that +y heads top-to-bottom. ! result |= OUT_TOP; ! else if (y > this.y + height) ! result |= OUT_BOTTOM; ! return result; } ! /** ! * Determines the rectangle which is formed by the intersection of this ! * rectangle with the specified rectangle. If the two do not intersect, ! * an empty rectangle will be returned (meaning the width and/or height ! * will be non-positive). ! * ! * @param r the rectange to calculate the intersection with ! * @return a new rectangle bounding the intersection ! * @throws NullPointerException if r is null ! * @since 1.2 ! */ public Rectangle2D createIntersection(Rectangle2D r) { ! // Favor runtime type of other rectangle. ! Rectangle2D res = r.getBounds2D(); ! intersect(this, r, res); return res; } + /** + * Returns the smallest rectangle that contains both this rectangle + * and the specified rectangle. + * + * @param r the rectangle to compute the union with + * @return the smallest rectangle containing both rectangles + * @throws NullPointerException if r is null + * @since 1.2 + */ public Rectangle2D createUnion(Rectangle2D r) { ! // Favor runtime type of other rectangle. ! Rectangle2D res = r.getBounds2D(); ! union(this, r, res); return res; } /** ! * Tests this rectangle for equality against the specified object. This ! * will be true if an only if the specified object is an instance of ! * Rectangle2D with the same coordinates and dimensions. * ! * @param obj the object to test against for equality ! * @return true if the specified object is equal to this one */ ! public boolean equals(Object obj) { ! if (! (obj instanceof Rectangle2D)) ! return false; ! Rectangle2D r = (Rectangle2D) obj; ! return r.getX() == x && r.getY() == y ! && r.getWidth() == width && r.getHeight() == height; } /** ! * Returns a string representation of this rectangle. This is in the form ! * getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width ! * + ",height=" + height + ']'. * ! * @return a string representation of this rectangle */ ! public String toString() { ! return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width ! + ",height=" + height + ']'; } ! } // class Rectangle diff -Nrc3pad gcc-3.2.3/libjava/java/awt/RenderingHints.java gcc-3.3/libjava/java/awt/RenderingHints.java *** gcc-3.2.3/libjava/java/awt/RenderingHints.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/RenderingHints.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* RenderingHints.java -- ! Copyright (C) 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 34,83 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.awt; /** * @author Rolf W. Rasmussen */ ! public class RenderingHints implements ! //java.util.Map, ! Cloneable { - public abstract static class Key { ! private int intKey; protected Key(int privateKey) { ! intKey = privateKey; } public abstract boolean isCompatibleValue(Object value); ! ! protected final int intKey() { ! return intKey; ! } ! public final int hashCode() { return System.identityHashCode(this); } ! ! public final boolean equals(Object other) { ! return (this == other); } ! } ! private static class KeyImpl extends Key { ! String description; ! Object v1, v2, v3; KeyImpl(int privateKey, String description, ! Object v1, Object v2, Object v3) { super(privateKey); this.description = description; --- 35,93 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt; + import java.util.Collection; + import java.util.Collections; + import java.util.HashMap; + import java.util.Map; + import java.util.Set; + /** + * NEEDS DOCUMENTATION + * * @author Rolf W. Rasmussen + * @author Eric Blake */ ! public class RenderingHints implements Map, Cloneable { public abstract static class Key { ! private final int key; protected Key(int privateKey) { ! key = privateKey; } public abstract boolean isCompatibleValue(Object value); ! ! protected final int intKey() { ! return key; ! } ! public final int hashCode() { return System.identityHashCode(this); } ! ! public final boolean equals(Object other) { ! return this == other; } ! } // class Key ! private static final class KeyImpl extends Key { ! final String description; ! final Object v1; ! final Object v2; ! final Object v3; KeyImpl(int privateKey, String description, ! Object v1, Object v2, Object v3) { super(privateKey); this.description = description; *************** public class RenderingHints implements *** 85,327 **** this.v2 = v2; this.v3 = v3; } ! ! public boolean isCompatibleValue(Object value) { ! return (value == v1) || (value == v2) || (value == v3); } ! public String toString() { return description; } ! } ! ! //java.util.HashMap hintMap; public static final Key KEY_ANTIALIASING; - public static final Object - VALUE_ANTIALIAS_ON = "Antialiased rendering mode", - VALUE_ANTIALIAS_DEFAULT = "Default antialiasing rendering mode"; ! static ! { ! KEY_ANTIALIASING = new KeyImpl(1, "Global antialiasing enable key", ! VALUE_ANTIALIAS_ON, ! VALUE_ANTIALIAS_DEFAULT, ! VALUE_ANTIALIAS_DEFAULT); ! } public static final Key KEY_RENDERING; - public static final Object - VALUE_RENDER_SPEED = "Fastest rendering methods", - VALUE_RENDER_QUALITY = "Highest quality rendering methods", - VALUE_RENDER_DEFAULT = "Default rendering methods"; ! static ! { ! KEY_RENDERING = new KeyImpl(2, "Global rendering quality key", ! VALUE_RENDER_SPEED, ! VALUE_RENDER_QUALITY, ! VALUE_RENDER_DEFAULT); ! } ! public static final Key KEY_DITHERING; - public static final Object - VALUE_DITHER_DISABLE = "Nondithered rendering mode", - VALUE_DITHER_ENABLE = "Dithered rendering mode", - VALUE_DITHER_DEFAULT = "Default dithering mode"; ! static ! { ! KEY_DITHERING = new KeyImpl(3, "Dithering quality key", ! VALUE_DITHER_DISABLE, ! VALUE_DITHER_ENABLE, ! VALUE_DITHER_DEFAULT); ! } ! public static final Key KEY_TEXT_ANTIALIASING; - public static final Object - VALUE_TEXT_ANTIALIAS_ON = "Antialiased text mode", - VALUE_TEXT_ANTIALIAS_OFF = "Nonantialiased text mode", - VALUE_TEXT_ANTIALIAS_DEFAULT = "Default antialiasing text mode"; ! static ! { ! KEY_TEXT_ANTIALIASING = new KeyImpl(4, "Text-specific antialiasing enable key", ! VALUE_TEXT_ANTIALIAS_ON, ! VALUE_TEXT_ANTIALIAS_OFF, ! VALUE_TEXT_ANTIALIAS_DEFAULT); ! } ! public static final Key KEY_FRACTIONALMETRICS; - public static final Object - VALUE_FRACTIONALMETRICS_OFF = "Integer text metrics mode", - VALUE_FRACTIONALMETRICS_ON = "Fractional text metrics mode", - VALUE_FRACTIONALMETRICS_DEFAULT = "Default fractional text metrics mode"; ! static ! { ! KEY_FRACTIONALMETRICS = new KeyImpl(5, "Fractional metrics enable key", ! VALUE_FRACTIONALMETRICS_OFF, ! VALUE_FRACTIONALMETRICS_ON, ! VALUE_FRACTIONALMETRICS_DEFAULT); ! } ! public static final Key KEY_INTERPOLATION; - public static final Object - VALUE_INTERPOLATION_NEAREST_NEIGHBOR = "Nearest Neighbor image interpolation mode", - VALUE_INTERPOLATION_BILINEAR = "Bilinear image interpolation mode", - VALUE_INTERPOLATION_BICUBIC = "Bicubic image interpolation mode"; ! static ! { ! KEY_INTERPOLATION = new KeyImpl(6, "Image interpolation method key", ! VALUE_INTERPOLATION_NEAREST_NEIGHBOR, ! VALUE_INTERPOLATION_BILINEAR, ! VALUE_INTERPOLATION_BICUBIC); ! } ! public static final Key KEY_ALPHA_INTERPOLATION; - public static final Object - VALUE_ALPHA_INTERPOLATION_SPEED = "Fastest alpha blending methods", - VALUE_ALPHA_INTERPOLATION_QUALITY = "Highest quality alpha blending methods", - VALUE_ALPHA_INTERPOLATION_DEFAULT = "Default alpha blending methods"; ! static ! { ! KEY_ALPHA_INTERPOLATION = new KeyImpl(7, "Alpha blending interpolation method key", ! VALUE_ALPHA_INTERPOLATION_SPEED, ! VALUE_ALPHA_INTERPOLATION_QUALITY, ! VALUE_ALPHA_INTERPOLATION_DEFAULT); ! } ! public static final Key KEY_COLOR_RENDERING; - public static final Object - VALUE_COLOR_RENDER_SPEED = "Fastest color rendering mode", - VALUE_COLOR_RENDER_QUALITY = "Highest quality color rendering mode", - VALUE_COLOR_RENDER_DEFAULT = "Default color rendering mode"; ! static ! { ! KEY_COLOR_RENDERING = new KeyImpl(8, "Color rendering quality key", ! VALUE_COLOR_RENDER_SPEED, ! VALUE_COLOR_RENDER_QUALITY, ! VALUE_COLOR_RENDER_DEFAULT); ! } public static final Key KEY_STROKE_CONTROL; - public static final Object - VALUE_STROKE_DEFAULT = "Default stroke control mode", - VALUE_STROKE_NORMALIZE = "Normalize stroke control mode", - VALUE_STROKE_PURE = "Pure stroke control mode"; ! static { KEY_STROKE_CONTROL = new KeyImpl(9, "Stroke normalization control key", ! VALUE_STROKE_DEFAULT, ! VALUE_STROKE_NORMALIZE, ! VALUE_STROKE_PURE); } - - //public RenderingHints(Map init); public RenderingHints(Key key, Object value) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! public int size() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public boolean isEmpty() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! public boolean containsKey(Object key) ! { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public boolean containsValue(Object value) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! public Object get(Object key) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public Object put(Object key, Object value) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public void add(RenderingHints hints) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! public void clear() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public Object remove(Object key) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! /* ! public void putAll(Map m) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! */ ! ! /* ! public Set keySet() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! */ ! ! /* ! public Collection values() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! */ ! ! /* ! public Set entrySet() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! */ ! ! public boolean equals(Object o) { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public int hashCode() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public Object clone() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! ! public String toString() { ! throw new UnsupportedOperationException("FIXME, not implemented yet"); } ! } --- 95,362 ---- this.v2 = v2; this.v3 = v3; } ! ! public boolean isCompatibleValue(Object value) { ! return value == v1 || value == v2 || value == v3; } ! public String toString() { return description; } ! } // class KeyImpl ! private HashMap hintMap = new HashMap(); public static final Key KEY_ANTIALIASING; ! public static final Object VALUE_ANTIALIAS_ON ! = "Antialiased rendering mode"; ! ! public static final Object VALUE_ANTIALIAS_OFF ! = "Nonantialiased rendering mode"; ! ! public static final Object VALUE_ANTIALIAS_DEFAULT ! = "Default antialiasing rendering mode"; public static final Key KEY_RENDERING; ! public static final Object VALUE_RENDER_SPEED ! = "Fastest rendering methods"; ! ! public static final Object VALUE_RENDER_QUALITY ! = "Highest quality rendering methods"; ! ! public static final Object VALUE_RENDER_DEFAULT ! = "Default rendering methods"; ! public static final Key KEY_DITHERING; ! public static final Object VALUE_DITHER_DISABLE ! = "Nondithered rendering mode"; ! ! public static final Object VALUE_DITHER_ENABLE ! = "Dithered rendering mode"; ! ! public static final Object VALUE_DITHER_DEFAULT ! = "Default dithering mode"; ! public static final Key KEY_TEXT_ANTIALIASING; ! public static final Object VALUE_TEXT_ANTIALIAS_ON ! = "Antialiased text mode"; ! ! public static final Object VALUE_TEXT_ANTIALIAS_OFF ! = "Nonantialiased text mode"; ! ! public static final Object VALUE_TEXT_ANTIALIAS_DEFAULT ! = "Default antialiasing text mode"; ! public static final Key KEY_FRACTIONALMETRICS; ! public static final Object VALUE_FRACTIONALMETRICS_OFF ! = "Integer text metrics mode"; ! ! public static final Object VALUE_FRACTIONALMETRICS_ON ! = "Fractional text metrics mode"; ! ! public static final Object VALUE_FRACTIONALMETRICS_DEFAULT ! = "Default fractional text metrics mode"; ! public static final Key KEY_INTERPOLATION; ! public static final Object VALUE_INTERPOLATION_NEAREST_NEIGHBOR ! = "Nearest Neighbor image interpolation mode"; ! ! public static final Object VALUE_INTERPOLATION_BILINEAR ! = "Bilinear image interpolation mode"; ! ! public static final Object VALUE_INTERPOLATION_BICUBIC ! = "Bicubic image interpolation mode"; ! public static final Key KEY_ALPHA_INTERPOLATION; ! public static final Object VALUE_ALPHA_INTERPOLATION_SPEED ! = "Fastest alpha blending methods"; ! ! public static final Object VALUE_ALPHA_INTERPOLATION_QUALITY ! = "Highest quality alpha blending methods"; ! ! public static final Object VALUE_ALPHA_INTERPOLATION_DEFAULT ! = "Default alpha blending methods"; ! public static final Key KEY_COLOR_RENDERING; ! public static final Object VALUE_COLOR_RENDER_SPEED ! = "Fastest color rendering mode"; ! ! public static final Object VALUE_COLOR_RENDER_QUALITY ! = "Highest quality color rendering mode"; ! ! public static final Object VALUE_COLOR_RENDER_DEFAULT ! = "Default color rendering mode"; public static final Key KEY_STROKE_CONTROL; ! public static final Object VALUE_STROKE_DEFAULT ! = "Default stroke normalization"; ! ! public static final Object VALUE_STROKE_NORMALIZE ! = "Normalize strokes for consistent rendering"; ! ! public static final Object VALUE_STROKE_PURE ! = "Pure stroke conversion for accurate paths"; ! ! static { + KEY_ANTIALIASING = new KeyImpl(1, "Global antialiasing enable key", + VALUE_ANTIALIAS_ON, + VALUE_ANTIALIAS_OFF, + VALUE_ANTIALIAS_DEFAULT); + KEY_RENDERING = new KeyImpl(2, "Global rendering quality key", + VALUE_RENDER_SPEED, + VALUE_RENDER_QUALITY, + VALUE_RENDER_DEFAULT); + KEY_DITHERING = new KeyImpl(3, "Dithering quality key", + VALUE_DITHER_DISABLE, + VALUE_DITHER_ENABLE, + VALUE_DITHER_DEFAULT); + KEY_TEXT_ANTIALIASING + = new KeyImpl(4, "Text-specific antialiasing enable key", + VALUE_TEXT_ANTIALIAS_ON, + VALUE_TEXT_ANTIALIAS_OFF, + VALUE_TEXT_ANTIALIAS_DEFAULT); + KEY_FRACTIONALMETRICS = new KeyImpl(5, "Fractional metrics enable key", + VALUE_FRACTIONALMETRICS_OFF, + VALUE_FRACTIONALMETRICS_ON, + VALUE_FRACTIONALMETRICS_DEFAULT); + KEY_INTERPOLATION = new KeyImpl(6, "Image interpolation method key", + VALUE_INTERPOLATION_NEAREST_NEIGHBOR, + VALUE_INTERPOLATION_BILINEAR, + VALUE_INTERPOLATION_BICUBIC); + KEY_ALPHA_INTERPOLATION + = new KeyImpl(7, "Alpha blending interpolation method key", + VALUE_ALPHA_INTERPOLATION_SPEED, + VALUE_ALPHA_INTERPOLATION_QUALITY, + VALUE_ALPHA_INTERPOLATION_DEFAULT); + KEY_COLOR_RENDERING = new KeyImpl(8, "Color rendering quality key", + VALUE_COLOR_RENDER_SPEED, + VALUE_COLOR_RENDER_QUALITY, + VALUE_COLOR_RENDER_DEFAULT); KEY_STROKE_CONTROL = new KeyImpl(9, "Stroke normalization control key", ! VALUE_STROKE_DEFAULT, ! VALUE_STROKE_NORMALIZE, ! VALUE_STROKE_PURE); ! } ! ! public RenderingHints(Map init) ! { ! putAll(init); } public RenderingHints(Key key, Object value) { ! put(key, value); } ! public int size() { ! return hintMap.size(); } ! ! public boolean isEmpty() { ! return hintMap.isEmpty(); } ! public boolean containsKey(Object key) ! { ! if (key == null) ! throw new NullPointerException(); ! return hintMap.containsKey((Key) key); } ! ! public boolean containsValue(Object value) { ! return hintMap.containsValue(value); } ! public Object get(Object key) { ! return hintMap.get((Key) key); } ! ! public Object put(Object key, Object value) { ! if (key == null || value == null) ! throw new NullPointerException(); ! if (! ((Key) key).isCompatibleValue(value)) ! throw new IllegalArgumentException(); ! return hintMap.put(key, value); } ! ! public void add(RenderingHints hints) { ! hintMap.putAll(hints); } ! public void clear() { ! hintMap.clear(); } ! ! public Object remove(Object key) { ! return remove((Key) key); } ! ! public void putAll(Map m) { ! hintMap.putAll(m); } ! ! public Set keySet() { ! return hintMap.keySet(); } ! ! public Collection values() { ! return hintMap.values(); } ! ! public Set entrySet() { ! return Collections.unmodifiableSet(hintMap.entrySet()); } ! ! public boolean equals(Object o) { ! return hintMap.equals(o); } ! ! public int hashCode() { ! return hintMap.hashCode(); } ! ! public Object clone() { ! try ! { ! RenderingHints copy = (RenderingHints) super.clone(); ! copy.hintMap = (HashMap) hintMap.clone(); ! return copy; ! } ! catch (CloneNotSupportedException e) ! { ! throw (Error) new InternalError().initCause(e); // Impossible ! } } ! ! public String toString() { ! return hintMap.toString(); } ! } // class RenderingHints diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Robot.java gcc-3.3/libjava/java/awt/Robot.java *** gcc-3.2.3/libjava/java/awt/Robot.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/Robot.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,112 ---- + /* Robot.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.image.BufferedImage; + + /** STUB CLASS ONLY */ + public class Robot + { + private boolean waitForIdle; + private int autoDelay; + public Robot() throws AWTException + { + throw new Error("not implemented"); + } + public Robot(GraphicsDevice screen) throws AWTException + { + this(); + } + public void mouseMove(int x, int y) + { + } + public void mousePress(int buttons) + { + } + public void mouseRelease(int buttons) + { + } + public void mouseWheel(int wheelAmt) + { + } + public void keyPress(int keycode) + { + } + public void keyRelease(int keycode) + { + } + public Color getPixelColor(int x, int y) + { + return null; + } + public BufferedImage createScreenCapture(Rectangle screen) + { + return null; + } + public boolean isAutoWaitForIdle() + { + return waitForIdle; + } + public void setAutoWaitForIdle(boolean value) + { + waitForIdle = value; + } + public int getAutoDelay() + { + return autoDelay; + } + public void setAutoDelay(int ms) + { + if (ms < 0 || ms > 60000) + throw new IllegalArgumentException(); + autoDelay = ms; + } + public void delay(int ms) + { + if (ms < 0 || ms > 60000) + throw new IllegalArgumentException(); + } + public void waitForIdle() + { + } + public String toString() + { + return "unimplemented"; + } + } // class Robot diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Scrollbar.java gcc-3.3/libjava/java/awt/Scrollbar.java *** gcc-3.2.3/libjava/java/awt/Scrollbar.java 2002-01-25 07:06:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/Scrollbar.java 2003-01-14 22:12:51.000000000 +0000 *************** *** 1,5 **** /* Scrollbar.java -- AWT Scrollbar widget ! Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Scrollbar.java -- AWT Scrollbar widget ! Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.awt; *** 40,48 **** import java.awt.peer.ScrollbarPeer; import java.awt.peer.ComponentPeer; - import java.awt.event.AdjustmentListener; import java.awt.event.AdjustmentEvent; /** * This class implements a scrollbar widget. --- 40,49 ---- import java.awt.peer.ScrollbarPeer; import java.awt.peer.ComponentPeer; import java.awt.event.AdjustmentListener; import java.awt.event.AdjustmentEvent; + import java.io.Serializable; + import javax.accessibility.Accessible; /** * This class implements a scrollbar widget. *************** import java.awt.event.AdjustmentEvent; *** 50,57 **** * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey */ ! public class Scrollbar extends Component implements Adjustable, ! java.io.Serializable { // FIXME: Serialization readObject/writeObject --- 51,59 ---- * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey */ ! public class Scrollbar extends Component implements Accessible, ! Adjustable, ! Serializable { // FIXME: Serialization readObject/writeObject *************** private AdjustmentListener adjustment_li *** 126,132 **** /** * Initializes a new instance of Scrollbar with a ! * veritical orientation and default values for all other parameters. */ public Scrollbar() --- 128,136 ---- /** * Initializes a new instance of Scrollbar with a ! * vertical orientation and default values for all other parameters. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public Scrollbar() *************** Scrollbar() *** 145,150 **** --- 149,155 ---- * * @param orientation The orientation of this scrollbar. * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, * @exception IllegalArgumentException If the orientation value is not valid. */ public *************** Scrollbar(int orientation) throws Illega *** 168,179 **** --- 173,188 ---- * @param minimum The minimum value of the scrollbar. * @param maximum The maximum value of the scrollbar. * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, * @exception IllegalArgumentException If the orientation value is not valid. */ public Scrollbar(int orientation, int value, int visibleAmount, int minimum, int maximum) throws IllegalArgumentException { + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); + if ((orientation != HORIZONTAL) && (orientation != VERTICAL)) throw new IllegalArgumentException("Bad orientation value: " + orientation); *************** processAdjustmentEvent(AdjustmentEvent e *** 660,665 **** --- 669,686 ---- adjustment_listeners.adjustmentValueChanged(event); } + void + dispatchEventImpl(AWTEvent e) + { + if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST + && e.id >= AdjustmentEvent.ADJUSTMENT_FIRST + && (adjustment_listeners != null + || (eventMask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0)) + processEvent(e); + else + super.dispatchEventImpl(e); + } + /*************************************************************************/ /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ScrollPaneAdjustable.java gcc-3.3/libjava/java/awt/ScrollPaneAdjustable.java *** gcc-3.2.3/libjava/java/awt/ScrollPaneAdjustable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/ScrollPaneAdjustable.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,72 ---- + /* ScrollPaneAdjustable.java -- Scrollbars for a ScrollPane + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * Need this class since the serialization spec for ScrollPane + * uses it. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ + class ScrollPaneAdjustable extends Scrollbar + { + + public + ScrollPaneAdjustable(int orientation) + { + super(orientation); + } + + public void + setMaximum(int maximum) + { + } + + public void + setMinimum(int minimum) + { + } + + public void + setVisibleAmount(int visibleAmount) + { + } + + } // class ScrollPaneAdjustable + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/ScrollPane.java gcc-3.3/libjava/java/awt/ScrollPane.java *** gcc-3.2.3/libjava/java/awt/ScrollPane.java 2001-01-03 20:34:43.000000000 +0000 --- gcc-3.3/libjava/java/awt/ScrollPane.java 2003-01-14 22:12:51.000000000 +0000 *************** *** 1,340 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package java.awt; - import java.awt.event.AdjustmentListener; import java.awt.peer.ScrollPanePeer; ! /** A ScrollPane is a component that has vertical and horizontal ! * scrollbars as well as a single child which is scrolled by them. ! * @author Tom Tromey ! * @date December 31, 2000 */ ! public class ScrollPane extends Container { ! /** This indicates that scrollbars should only be displayed when ! * needed. */ ! public static final int SCROLLBARS_AS_NEEDED = 0; ! /** This indicates that scrollbars should always be displayed. */ ! public static final int SCROLLBARS_ALWAYS = 1; ! /** This indicates that scrollbars should never be displayed. */ ! public static final int SCROLLBARS_NEVER = 2; ! /** Create a new ScrollPane object using the indicated scrollbar ! * display policy. If the policy is not specified it defaults to ! * SCROLLBARS_AS_NEEDED. The default size of this component is ! * 100x100. ! * @param policy The scrollbar display policy ! */ ! public ScrollPane () ! { ! this (SCROLLBARS_AS_NEEDED); ! } ! public ScrollPane (int policy) ! { ! if (policy != SCROLLBARS_AS_NEEDED ! && policy != SCROLLBARS_ALWAYS ! && policy != SCROLLBARS_NEVER) ! throw new IllegalArgumentException ("invalid value for policy"); ! this.policy = policy; ! setSize (100, 100); ! } ! /** Add a component to this ScrollPane. ! * @param comp The component to add ! * @param constraints Constraints. This is ignored. ! * @param pos Position. This must be <= 0, but is otherwise ignored. ! */ ! protected final void addImpl (Component comp, Object constraints, ! int pos) ! { ! if (pos > 0) ! throw new IllegalArgumentException ("pos must be <= 0"); ! if (ncomponents > 0) ! remove (component[0]); ! if (comp.isLightweight ()) ! { ! Panel p = new Panel (); ! p.add (comp); ! comp = p; ! } ! super.addImpl (comp, constraints, pos); ! } ! /** This creates the component's peer. */ ! public void addNotify () ! { ! if (peer == null) ! peer = getToolkit ().createScrollPane (this); ! super.addNotify (); ! } ! /** Lays out the components in this container. */ ! public void doLayout () ! { ! ScrollPanePeer spp = (ScrollPanePeer) peer; ! Dimension c = component[0].getPreferredSize (); ! component[0].setSize (c.width, c.height); ! spp.childResized (c.width, c.height); ! // Update the scrollbar position to the closest valid value. ! setScrollPosition (hscroll.getValue (), vscroll.getValue ()); ! } ! /** Returns an Adjustable representing the horizontal scrollbar. ! * The methods setMaximum, setMinimum, and setVisibleAmount should ! * not be called on this Adjustable. They will throw AWTError if ! * called. ! */ ! public Adjustable getHAdjustable () ! { ! return hscroll; ! } ! /** Returns the height of the horizontal scrollbar. */ ! public int getHScrollbarHeight () ! { ! if (peer == null) ! return 0; ! ScrollPanePeer spp = (ScrollPanePeer) peer; ! return spp.getHScrollbarHeight (); ! } ! /** Returns the scrollbar display policy. */ ! public int getScrollbarDisplayPolicy () ! { ! return policy; ! } ! /** Returns the viewport's scroll position. */ ! public Point getScrollPosition () ! { ! return new Point (hscroll.getValue (), vscroll.getValue ()); ! } ! /** Returns an Adjustable representing the vertical scrollbar. ! * The methods setMaximum, setMinimum, and setVisibleAmount should ! * not be called on this Adjustable. They will throw AWTError if ! * called. ! */ ! public Adjustable getVAdjustable () ! { ! return vscroll; ! } ! /** Returns the size of the viewport. */ ! public Dimension getViewportSize () ! { ! // Note: according to the online docs, the Insets are ! // automatically updated by the peer to include the scrollbar ! // sizes. ! Insets ins = getInsets (); ! int myw = width - ins.left - ins.right; ! int myh = height - ins.top - ins.bottom; ! Dimension cs; ! if (ncomponents > 0) ! cs = component[0].getPreferredSize (); ! else ! cs = new Dimension (myw, myh); ! // A little optimization -- reuse the Dimension. ! cs.setSize (myw, myh); ! return cs; ! } ! /** Returns the width of the vertical scrollbar. */ ! public int getVScrollbarWidth () ! { ! if (peer == null) ! return 0; ! ScrollPanePeer spp = (ScrollPanePeer) peer; ! return spp.getVScrollbarWidth (); ! } ! /** Generates a String representation of this ScrollPane's state. */ ! public String paramString () ! { ! return ("[" + getClass ().getName () ! + ": " + ((ncomponents > 0) ? component[0].paramString () : "") ! + "]"); ! } ! /** Set the layout manager for this component. ScrollPane has its ! * own layout manager and overrides this method so that the layout ! * manager cannot be changed. ! * @param m The new layout manager (ignored) ! */ ! public final void setLayout (LayoutManager m) ! { ! // Nothing. ! } ! /** Sets the scroll position for this ScrollPane. If the point if ! * out of range it is silently moved within range. ! * @param x The x coordinate ! * @param y The y coordinate ! */ ! public void setScrollPosition (int x, int y) ! { ! // According to the JCL we throw a NullPointerException if there ! // is no child. ! if (ncomponents == 0) ! throw new NullPointerException ("no child in ScrollPane"); ! Dimension child_d = component[0].getPreferredSize (); ! Dimension our_d = getViewportSize (); ! int xmax = Math.max (0, child_d.width - our_d.width); ! int ymax = Math.max (0, child_d.height - our_d.height); ! if (x < 0) ! x = 0; ! else if (x > xmax) ! x = xmax; ! if (y < 0) ! y = 0; ! else if (y > ymax) ! y = ymax; ! ScrollPanePeer spp = (ScrollPanePeer) peer; ! spp.setScrollPosition (x, y); ! } ! /** Sets the scroll position for this ScrollPane. If the point if ! * out of range it is silently moved within range. ! * @param p The new point ! */ ! public void setScrollPosition (Point p) ! { ! setScrollPosition (p.x, p.y); ! } ! // This implements the Adjustable for each scrollbar. The ! // expectation is that the peer will look at these objects directly ! // and modify the values in them when the user manipulates the ! // scrollbars. This has to be done from CNI to bypass Java ! // protection rules. The peer should also take care of calling the ! // adjustment listeners. ! class ScrollPaneAdjustable implements Adjustable ! { ! AdjustmentListener listeners; ! int orient; ! int unit; ! int block; ! int value; ! public ScrollPaneAdjustable (int orient) ! { ! this.orient = orient; ! } ! public void addAdjustmentListener (AdjustmentListener l) ! { ! listeners = AWTEventMulticaster.add (listeners, l); ! } ! public int getBlockIncrement () ! { ! return block; ! } ! public int getMaximum () ! { ! Dimension child_d = component[0].getPreferredSize (); ! Dimension our_d = getViewportSize (); ! int xmax = Math.max (0, child_d.width - our_d.width); ! int ymax = Math.max (0, child_d.height - our_d.height); ! return (orient == Adjustable.HORIZONTAL) ? xmax : ymax; ! } ! public int getMinimum () ! { ! return 0; ! } ! public int getOrientation () ! { ! return orient; ! } ! public int getUnitIncrement () ! { ! return unit; ! } ! public int getValue () ! { ! return value; ! } ! public int getVisibleAmount () ! { ! Dimension d = getViewportSize (); ! return (orient == Adjustable.HORIZONTAL) ? d.width : d.height; ! } ! public void removeAdjustmentListener (AdjustmentListener l) ! { ! listeners = AWTEventMulticaster.remove (listeners, l); ! } ! public void setBlockIncrement (int b) ! { ! throw new AWTError ("can't use setBlockIncrement on this Adjustable"); ! } ! public void setMaximum (int max) ! { ! throw new AWTError ("can't use setMaximum on this Adjustable"); ! } ! public void setMinimum (int min) ! { ! throw new AWTError ("can't use setMinimum on this Adjustable"); ! } ! public void setUnitIncrement (int u) ! { ! unit = u; ! if (peer != null) ! { ! ScrollPanePeer spp = (ScrollPanePeer) peer; ! spp.setUnitIncrement (this, u); ! } ! } ! public void setValue (int v) ! { ! value = v; ! if (peer != null) ! { ! ScrollPanePeer spp = (ScrollPanePeer) peer; ! spp.setValue (this, v); ! } ! } ! public void setVisibleAmount (int v) { ! throw new AWTError ("can't use setVisibleAmount on this Adjustable"); } ! } ! ScrollPaneAdjustable hscroll ! = new ScrollPaneAdjustable (Adjustable.HORIZONTAL); ! ScrollPaneAdjustable vscroll ! = new ScrollPaneAdjustable (Adjustable.VERTICAL); ! int policy; } --- 1,475 ---- ! /* ScrollPane.java -- Scrolling window ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.awt; import java.awt.peer.ScrollPanePeer; + import java.awt.peer.ContainerPeer; + import java.awt.peer.ComponentPeer; + import java.io.Serializable; + import javax.accessibility.Accessible; ! /** ! * This widget provides a scrollable region that allows a single ! * subcomponent to be viewed through a smaller window. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class ScrollPane extends Container implements Accessible, Serializable ! { ! ! /* ! * Static Variables */ ! ! /** ! * Constant indicating that scrollbars are created as needed in this ! * windows. ! */ ! public static final int SCROLLBARS_AS_NEEDED = 0; ! ! /** ! * Constant indicating that scrollbars are always displayed in this ! * window. ! */ ! public static final int SCROLLBARS_ALWAYS = 1; ! ! /** ! * Constant indicating that scrollbars are never displayed in this window. ! */ ! public static final int SCROLLBARS_NEVER = 2; ! ! // Serialization constant ! private static final long serialVersionUID = 7956609840827222915L; ! ! /*************************************************************************/ ! ! /* ! * Instance Variables ! */ ! ! /** ! * @serial The horizontal scrollbar for this window. The methods ! * setMinimum(), setMaximum, and ! * setVisibleAmount must not be called on this scrollbar. ! */ ! private ScrollPaneAdjustable hAdjustable; ! ! /** ! * @serial The vertical scrollbar for this window. The methods ! * setMinimum(), setMaximum, and ! * setVisibleAmount must not be called on this scrollbar. ! */ ! private ScrollPaneAdjustable vAdjustable; ! ! /** ! * @serial Indicates when scrollbars are displayed in this window, will ! * be one of the constants from this class. ! */ ! private int scrollbarDisplayPolicy; ! ! // Current scroll position ! private Point scrollPosition = new Point(0, 0); ! ! /*************************************************************************/ ! ! /* ! * Constructors ! */ ! ! /** ! * Initializes a new instance of ScrollPane with a default ! * scrollbar policy of SCROLLBARS_AS_NEEDED. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! public ! ScrollPane() { ! this(SCROLLBARS_AS_NEEDED); ! } ! /*************************************************************************/ ! /** ! * Initializes a new instance of ScrollPane with the ! * specified scrollbar policy. ! * ! * @param scrollbarDisplayPolicy When to display scrollbars, which must ! * be one of the constants defined in this class. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! public ! ScrollPane(int scrollbarDisplayPolicy) ! { ! if (GraphicsEnvironment.isHeadless ()) ! throw new HeadlessException (); ! this.scrollbarDisplayPolicy = scrollbarDisplayPolicy; ! if (scrollbarDisplayPolicy != SCROLLBARS_ALWAYS ! && scrollbarDisplayPolicy != SCROLLBARS_AS_NEEDED ! && scrollbarDisplayPolicy != SCROLLBARS_NEVER) ! throw new IllegalArgumentException("Bad scrollbarDisplayPolicy: " + ! scrollbarDisplayPolicy); ! if (scrollbarDisplayPolicy != SCROLLBARS_NEVER) ! { ! hAdjustable = new ScrollPaneAdjustable(Scrollbar.HORIZONTAL); ! vAdjustable = new ScrollPaneAdjustable(Scrollbar.VERTICAL); ! } ! } ! /*************************************************************************/ ! /* ! * Instance Variables ! */ ! /** ! * Returns the current scrollbar display policy. ! * ! * @return The current scrollbar display policy. ! */ ! public int ! getScrollbarDisplayPolicy() ! { ! return(scrollbarDisplayPolicy); ! } ! /*************************************************************************/ ! /** ! * Returns the horizontal scrollbar for this object. If the scrollbar ! * display policy is set to SCROLLBARS_NEVER then this ! * will be null. ! * ! * @return The horizontal scrollbar for this window. ! */ ! public Adjustable ! getHAdjustable() ! { ! return(hAdjustable); ! } ! /*************************************************************************/ ! /** ! * Returns the vertical scrollbar for this object. If the scrollbar ! * display policy is set to SCROLLBARS_NEVER then this ! * will be null. ! * ! * @return The horizontal scrollbar for this window. ! */ ! public Adjustable ! getVAdjustable() ! { ! return(vAdjustable); ! } ! /*************************************************************************/ ! /** ! * Returns the current viewport size. The viewport is the region of ! * this object's window where the child is actually displayed. ! * ! * @return The viewport size. ! */ ! public Dimension ! getViewportSize() ! { ! Dimension viewsize = getSize(); ! Insets insets = getInsets(); ! viewsize.width = viewsize.width - (insets.left + insets.right); ! viewsize.height = viewsize.height - (insets.top + insets.bottom); ! ScrollPaneAdjustable v = (ScrollPaneAdjustable)getVAdjustable(); ! ScrollPaneAdjustable h = (ScrollPaneAdjustable)getHAdjustable(); ! if ((v != null) && v.isVisible()) ! viewsize.width = viewsize.width - v.getSize().width; ! if ((h != null) && h.isVisible()) ! viewsize.height = viewsize.height - v.getSize().height; ! return(viewsize); ! } ! /*************************************************************************/ ! /** ! * Returns the height of a horizontal scrollbar. ! * ! * @return The height of a horizontal scrollbar. ! */ ! public int ! getHScrollbarHeight() ! { ! ScrollPanePeer spp = (ScrollPanePeer)getPeer(); ! if (spp != null) ! return(spp.getHScrollbarHeight()); ! else ! return(0); // FIXME: What to do here? ! } ! /*************************************************************************/ ! /** ! * Returns the width of a vertical scrollbar. ! * ! * @return The width of a vertical scrollbar. ! */ ! public int ! getVScrollbarWidth() ! { ! ScrollPanePeer spp = (ScrollPanePeer)getPeer(); ! if (spp != null) ! return(spp.getVScrollbarWidth()); ! else ! return(0); // FIXME: What to do here? ! } ! /*************************************************************************/ ! /** ! * Returns the current scroll position of the viewport. ! * ! * @return The current scroll position of the viewport. ! */ ! public Point ! getScrollPosition() ! { ! int x = 0; ! int y = 0; ! Adjustable v = getVAdjustable(); ! Adjustable h = getHAdjustable(); ! if (v != null) ! y = v.getValue(); ! if (h != null) ! x = h.getValue(); ! return(new Point(x, y)); ! } ! /*************************************************************************/ ! /** ! * Sets the scroll position to the specified value. ! * ! * @param scrollPosition The new scrollPosition. ! * ! * @exception IllegalArgumentException If the specified value is outside ! * the legal scrolling range. ! */ ! public void ! setScrollPosition(Point scrollPosition) throws IllegalArgumentException ! { ! setScrollPosition(scrollPosition.x, scrollPosition.y); ! } ! /*************************************************************************/ ! /** ! * Sets the scroll position to the specified value. ! * ! * @param x The new X coordinate of the scroll position. ! * @param y The new Y coordinate of the scroll position. ! * ! * @exception IllegalArgumentException If the specified value is outside ! * the legal scrolling range. ! */ ! public void ! setScrollPosition(int x, int y) ! { ! Adjustable h = getHAdjustable(); ! Adjustable v = getVAdjustable(); ! if (h != null) ! h.setValue(x); ! if (v != null) ! v.setValue(y); ! ScrollPanePeer spp = (ScrollPanePeer)getPeer(); ! if (spp != null) ! spp.setScrollPosition(x, y); ! } ! /*************************************************************************/ ! /** ! * Notifies this object that it should create its native peer. ! */ ! public void ! addNotify() ! { ! if (getPeer() == null) ! return; ! setPeer((ComponentPeer)getToolkit().createScrollPane(this)); ! if (hAdjustable != null) ! hAdjustable.addNotify(); ! if (vAdjustable != null) ! vAdjustable.removeNotify(); ! } ! /*************************************************************************/ ! /** ! * Notifies this object that it should destroy its native peers. ! */ ! public void ! removeNotify() ! { ! if (hAdjustable != null) ! hAdjustable.removeNotify(); ! if (vAdjustable != null) ! vAdjustable.removeNotify(); ! super.removeNotify(); ! } ! /*************************************************************************/ ! /** ! * Adds the specified child component to this container. A ! * ScrollPane can have at most one child, so if a second ! * one is added, then first one is removed. ! * ! * @param component The component to add to this container. ! * @param constraints A list of layout constraints for this object. ! * @param index The index at which to add the child, which is ignored ! * in this implementation. ! */ ! public final void ! addImpl(Component component, Object constraints, int index) ! { ! Component[] list = getComponents(); ! if ((list != null) && (list.length > 0)) ! remove(list[0]); ! super.addImpl(component, constraints, -1); ! doLayout(); ! } ! /*************************************************************************/ ! /** ! * Lays out this component. This consists of resizing the sole child ! * component to its perferred size. ! */ ! public void ! doLayout() ! { ! Component[] list = getComponents(); ! if ((list != null) && (list.length > 0)) { ! Dimension dim = list[0].getPreferredSize(); ! list[0].resize(dim); ! ! Point p = getScrollPosition(); ! if (p.x > dim.width) ! p.x = dim.width; ! if (p.y > dim.height) ! p.y = dim.height; ! ! setScrollPosition(p); } ! } ! /*************************************************************************/ ! ! /** ! * Lays out this component. This consists of resizing the sole child ! * component to its perferred size. ! * ! * @deprecated This method is deprecated in favor of ! * doLayout(). ! */ ! public void ! layout() ! { ! doLayout(); } + + /*************************************************************************/ + + /** + * This method overrides its superclass method to ensure no layout + * manager is set for this container. ScrollPane's do + * not have layout managers. + * + * @param layoutManager Ignored + */ + public final void + setLayout(LayoutManager layoutManager) + { + return; + } + + /*************************************************************************/ + + /** + * Prints all of the components in this container. + * + * @param graphics The desired graphics context for printing. + */ + public void + printComponents(Graphics graphics) + { + super.printComponents(graphics); + } + + /*************************************************************************/ + + /** + * Returns a debug string for this object. + * + * @return A debug string for this object. + */ + public String + paramString() + { + return(getClass().getName()); + } + + } // class ScrollPane + diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Shape.java gcc-3.3/libjava/java/awt/Shape.java *** gcc-3.2.3/libjava/java/awt/Shape.java 2002-01-25 07:06:06.000000000 +0000 --- gcc-3.3/libjava/java/awt/Shape.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* Shape.java -- Interface for shape abstractions. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Shape.java -- the classic Object-Oriented shape interface ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,75 **** package java.awt; ! import java.awt.geom.*; ! ! /* Written using "Java Class Libraries", 2nd edition. ! * Status: Believed complete and correct to JDK 1.2. ! */ /** ! * This interface represents an abstract shape. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Per Bothner ! */ public interface Shape { ! /** ! * Returns a Rectange that bounds the shape. ! * ! * @return A Rectange that bounds the shape. ! */ ! public abstract Rectangle ! getBounds(); ! public boolean contains (double x, double y); ! public boolean contains (double x, double y, double w, double h); ! public boolean contains (Point2D p); ! public boolean contains (Rectangle2D r); ! public Rectangle2D getBounds2D (); ! public PathIterator getPathIterator (AffineTransform at); ! public PathIterator getPathIterator (AffineTransform at, double flatness); ! public boolean intersects (double x, double y, double w, double h); ! public boolean intersects (Rectangle2D r); ! } // interface Shape --- 38,203 ---- package java.awt; ! import java.awt.geom.AffineTransform; ! import java.awt.geom.PathIterator; ! import java.awt.geom.Point2D; ! import java.awt.geom.Rectangle2D; /** ! * This interface represents an abstract shape. The shape is described by ! * a {@link PathIterator}, and has callbacks for determining bounding box, ! * where points and rectangles lie in relation to the shape, and tracing ! * the trajectory. ! * ! *

        A point is inside if it is completely inside, or on the boundary and ! * adjacent points in the increasing x or y direction are completely inside. ! * Unclosed shapes are considered as implicitly closed when performing ! * contains or intersects. ! * ! * @author Aaron M. Renn ! * @see PathIterator ! * @see AffineTransform ! * @see FlatteningPathIterator ! * @see GeneralPath ! * @since 1.0 ! * @status updated to 1.4 ! */ public interface Shape { + /** + * Returns a Rectange that bounds the shape. There is no + * guarantee that this is the minimum bounding box, particularly if + * the shape overflows the finite integer range of a bound. Generally, + * getBounds2D returns a tighter bound. + * + * @return the shape's bounding box + * @see #getBounds2D() + */ + Rectangle getBounds(); ! /** ! * Returns a high precision bounding box of the shape. There is no guarantee ! * that this is the minimum bounding box, but at least it never overflows. ! * ! * @return the shape's bounding box ! * @see #getBounds() ! * @since 1.2 ! */ ! Rectangle2D getBounds2D(); ! /** ! * Test if the coordinates lie in the shape. ! * ! * @param x the x coordinate ! * @param y the y coordinate ! * @return true if (x,y) lies inside the shape ! * @since 1.2 ! */ ! boolean contains(double x, double y); ! /** ! * Test if the point lie in the shape. ! * ! * @param p the high-precision point ! * @return true if p lies inside the shape ! * @throws NullPointerException if p is null ! * @since 1.2 ! */ ! boolean contains(Point2D p); ! ! /** ! * Test if a high-precision rectangle intersects the shape. This is true ! * if any point in the rectangle is in the shape, with the caveat that the ! * operation may include high probability estimates when the actual ! * calculation is prohibitively expensive. The {@link Area} class can ! * be used for more precise answers. ! * ! * @param x the x coordinate of the rectangle ! * @param y the y coordinate of the rectangle ! * @param w the width of the rectangle, undefined results if negative ! * @param h the height of the rectangle, undefined results if negative ! * @return true if the rectangle intersects this shape ! * @see Area ! * @since 1.2 ! */ ! boolean intersects(double x, double y, double w, double h); + /** + * Test if a high-precision rectangle intersects the shape. This is true + * if any point in the rectangle is in the shape, with the caveat that the + * operation may include high probability estimates when the actual + * calculation is prohibitively expensive. The {@link Area} class can + * be used for more precise answers. + * + * @param r the rectangle + * @return true if the rectangle intersects this shape + * @throws NullPointerException if r is null + * @see #intersects(double, double, double, double) + * @since 1.2 + */ + boolean intersects(Rectangle2D r); + + /** + * Test if a high-precision rectangle lies completely in the shape. This is + * true if all points in the rectangle are in the shape, with the caveat + * that the operation may include high probability estimates when the actual + * calculation is prohibitively expensive. The {@link Area} class can + * be used for more precise answers. + * + * @param x the x coordinate of the rectangle + * @param y the y coordinate of the rectangle + * @param w the width of the rectangle, undefined results if negative + * @param h the height of the rectangle, undefined results if negative + * @return true if the rectangle is contained in this shape + * @see Area + * @since 1.2 + */ + boolean contains(double x, double y, double w, double h); + + /** + * Test if a high-precision rectangle lies completely in the shape. This is + * true if all points in the rectangle are in the shape, with the caveat + * that the operation may include high probability estimates when the actual + * calculation is prohibitively expensive. The {@link Area} class can + * be used for more precise answers. + * + * @param r the rectangle + * @return true if the rectangle is contained in this shape + * @throws NullPointerException if r is null + * @see #contains(double, double, double, double) + * @since 1.2 + */ + boolean contains(Rectangle2D r); + + /** + * Return an iterator along the shape boundary. If the optional transform + * is provided, the iterator is transformed accordingly. Each call returns + * a new object, independent from others in use. It is recommended, but + * not required, that the Shape isolate iterations from future changes to + * the boundary, and document this fact. + * + * @param transform an optional transform to apply to the iterator + * @return a new iterator over the boundary + * @since 1.2 + */ + PathIterator getPathIterator(AffineTransform transform); + + /** + * Return an iterator along the flattened version of the shape boundary. + * Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE points are returned in the + * iterator. The flatness paramter controls how far points are allowed to + * differ from the real curve; although a limit on accuracy may cause this + * parameter to be enlarged if needed. + * + *

        If the optional transform is provided, the iterator is transformed + * accordingly. Each call returns a new object, independent from others in + * use. It is recommended, but not required, that the Shape isolate + * iterations from future changes to the boundary, and document this fact. + * + * @param transform an optional transform to apply to the iterator + * @param double the maximum distance for deviation from the real boundary + * @return a new iterator over the boundary + * @since 1.2 + */ + PathIterator getPathIterator(AffineTransform transform, double flatness); + } // interface Shape diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Stroke.java gcc-3.3/libjava/java/awt/Stroke.java *** gcc-3.2.3/libjava/java/awt/Stroke.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/Stroke.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,65 ---- + /* Stroke.java -- a stroked outline of a shape + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + /** + * This interface allows a Graphics2D to grab the outline of a shape, as if + * stroked by a marking pen of appropriate size and shape. The area inked + * by the pen is the area of this stroke. Anything in the graphic which + * traces an outline will use this stroke, such as drawLine. + * Strokes must be immutable, because the graphics object does not clone + * them. + * + * @author Eric Blake + * @see BasicStroke + * @see Graphics2D#setStroke(Stroke) + * @since 1.1 + * @status updated to 1.4 + */ + public interface Stroke + { + /** + * Returns a shape which outlines the boundary of the given shape, in + * effect converting the infinitely thin line into a new shape. + * + * @param s the shape to stroke + * @return the stroked outline shape + */ + Shape createStrokedShape(Shape s); + } // interface Stroke diff -Nrc3pad gcc-3.2.3/libjava/java/awt/SystemColor.java gcc-3.3/libjava/java/awt/SystemColor.java *** gcc-3.2.3/libjava/java/awt/SystemColor.java 2002-01-22 22:58:08.000000000 +0000 --- gcc-3.3/libjava/java/awt/SystemColor.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,5 **** ! /* SystemColor.java -- Class to access system color values. ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* SystemColor.java -- access dynamic system color values ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,430 **** package java.awt; ! /** ! * This class contains the various "system colors" in use by the ! * native windowing system. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public final class SystemColor extends Color implements java.io.Serializable ! { ! ! /* ! * Static Variables ! */ ! ! /** ! * Array index of the desktop color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int DESKTOP = 0; ! ! /** ! * Array index of the active caption color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int ACTIVE_CAPTION = 1; ! ! /** ! * Array index of the active caption text color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int ACTIVE_CAPTION_TEXT = 2; ! ! /** ! * Array index of the active caption border color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int ACTIVE_CAPTION_BORDER = 3; ! ! /** ! * Array index of the inactive caption color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int INACTIVE_CAPTION = 4; ! ! /** ! * Array index of the inactive caption text color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int INACTIVE_CAPTION_TEXT = 5; /** ! * Array index of the inactive caption border color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int INACTIVE_CAPTION_BORDER = 6; ! /** ! * Array index of the window background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int WINDOW = 7; ! /** ! * Array index of the window border color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int WINDOW_BORDER = 8; ! /** ! * Array index of the window text color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int WINDOW_TEXT = 9; ! /** ! * Array index of the menu background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int MENU = 10; ! /** ! * Array index of the menu text color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int MENU_TEXT = 11; ! /** ! * Array index of the text background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int TEXT = 12; ! /** ! * Array index of the text foreground color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int TEXT_TEXT = 13; ! /** ! * Array index of the highlighted text background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int TEXT_HIGHLIGHT = 14; ! /** ! * Array index of the highlighted text foreground color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int TEXT_HIGHLIGHT_TEXT = 15; ! /** ! * Array index of the inactive text foreground color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int TEXT_INACTIVE_TEXT = 16; ! /** ! * Array index of the control background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int CONTROL = 17; ! /** ! * Array index of the control text color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int CONTROL_TEXT = 18; ! /** ! * Array index of the highlighted control background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int CONTROL_HIGHLIGHT = 19; ! /** ! * Array index of the lightly highlighted control background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int CONTROL_LT_HIGHLIGHT = 20; ! /** ! * Array index of the shadowed control background color. Used by ! * Toolkit.loadSystemColors(). */ ! public static final int CONTROL_SHADOW = 21; ! /** ! * Array index of the darkly shadowed control background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int CONTROL_DK_SHADOW = 22; ! /** ! * Array index of the scrollbar background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int SCROLLBAR = 23; ! /** ! * Array index of the info background color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int INFO = 24; ! /** ! * Array index of the info text color. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int INFO_TEXT = 25; ! /** ! * The number of system colors. Used by ! * Toolkit.loadSystemColors(). ! */ ! public static final int NUM_COLORS = 26; ! /** ! * The desktop color. ! */ ! public static final SystemColor desktop; ! /** ! * The active caption background color. ! */ ! public static final SystemColor activeCaption; ! /** ! * The active caption text color. ! */ ! public static final SystemColor activeCaptionText; ! /** ! * The active caption border color. ! */ ! public static final SystemColor activeCaptionBorder; ! /** ! * The inactive caption background color. ! */ ! public static final SystemColor inactiveCaption; ! /** ! * The inactive caption text color. ! */ ! public static final SystemColor inactiveCaptionText; ! /** ! * The inactive caption border color. ! */ ! public static final SystemColor inactiveCaptionBorder; ! /** ! * The window background color. ! */ ! public static final SystemColor window; ! /** ! * The window border color. ! */ ! public static final SystemColor windowBorder; ! /** ! * The window text color. ! */ ! public static final SystemColor windowText; ! /** ! * The menu background color. ! */ ! public static final SystemColor menu; ! /** ! * The menu text color. ! */ ! public static final SystemColor menuText; ! /** ! * The text background color. ! */ ! public static final SystemColor text; ! /** ! * The text foreground color. ! */ ! public static final SystemColor textText; ! /** ! * The highlighted text background color. ! */ ! public static final SystemColor textHighlight; ! /** ! * The highlighted text foreground color. ! */ ! public static final SystemColor textHighlightText; ! /** ! * The inactive text color. ! */ ! public static final SystemColor textInactiveText; ! /** ! * The control background color. ! */ ! public static final SystemColor control; ! /** ! * The control text color. ! */ ! public static final SystemColor controlText; ! /** ! * The control highlight color. ! */ ! public static final SystemColor controlHighlight; ! /** ! * The control light highlight color. ! */ ! public static final SystemColor controlLtHighlight; ! /** ! * The control shadow color. ! */ ! public static final SystemColor controlShadow; ! /** ! * The control dark shadow color. ! */ ! public static final SystemColor controlDkShadow; ! /** ! * The scrollbar color. ! */ ! public static final SystemColor scrollbar; ! /** ! * The info text background color. ! */ ! public static final SystemColor info; ! /** ! * The info text foreground color. ! */ ! public static final SystemColor infoText; ! // Serialization version constant ! private static final long serialVersionUID = 4503142729533789064L; ! static ! { ! int[] sys_color_rgbs = new int[NUM_COLORS]; ! Toolkit.getDefaultToolkit().loadSystemColors(sys_color_rgbs); ! desktop = new SystemColor(sys_color_rgbs[DESKTOP]); ! activeCaption= new SystemColor(sys_color_rgbs[ACTIVE_CAPTION]); ! activeCaptionText= new SystemColor(sys_color_rgbs[ACTIVE_CAPTION_TEXT]); ! activeCaptionBorder = new SystemColor(sys_color_rgbs[ACTIVE_CAPTION_BORDER]); ! inactiveCaption = new SystemColor(sys_color_rgbs[INACTIVE_CAPTION]); ! inactiveCaptionText = new SystemColor(sys_color_rgbs[INACTIVE_CAPTION_TEXT]); ! inactiveCaptionBorder = ! new SystemColor(sys_color_rgbs[INACTIVE_CAPTION_BORDER]); ! window = new SystemColor(sys_color_rgbs[WINDOW]); ! windowBorder = new SystemColor(sys_color_rgbs[WINDOW_BORDER]); ! windowText = new SystemColor(sys_color_rgbs[WINDOW_TEXT]); ! menu = new SystemColor(sys_color_rgbs[MENU]); ! menuText = new SystemColor(sys_color_rgbs[MENU_TEXT]); ! text = new SystemColor(sys_color_rgbs[TEXT]); ! textText = new SystemColor(sys_color_rgbs[TEXT_TEXT]); ! textHighlight = new SystemColor(sys_color_rgbs[TEXT_HIGHLIGHT]); ! textHighlightText = new SystemColor(sys_color_rgbs[TEXT_HIGHLIGHT_TEXT]); ! textInactiveText = new SystemColor(sys_color_rgbs[TEXT_INACTIVE_TEXT]); ! control = new SystemColor(sys_color_rgbs[CONTROL]); ! controlText = new SystemColor(sys_color_rgbs[CONTROL_TEXT]); ! controlHighlight = new SystemColor(sys_color_rgbs[CONTROL_HIGHLIGHT]); ! controlLtHighlight = new SystemColor(sys_color_rgbs[CONTROL_LT_HIGHLIGHT]); ! controlShadow = new SystemColor(sys_color_rgbs[CONTROL_SHADOW]); ! controlDkShadow = new SystemColor(sys_color_rgbs[CONTROL_DK_SHADOW]); ! scrollbar = new SystemColor(sys_color_rgbs[SCROLLBAR]); ! info = new SystemColor(sys_color_rgbs[INFO]); ! infoText = new SystemColor(sys_color_rgbs[INFO_TEXT]); ! } ! /*************************************************************************/ ! /* ! * Constructors ! */ ! private ! SystemColor(int rgb) ! { ! super(rgb); ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * Returns the RGB value for this color as an int. The first ! * byte is the blue value, the second the green value, the third the ! * red value and the fourth is set to 0xFF. ! * ! * @return The RGB value. ! */ ! public int ! getRGB() ! { ! // Override only to be spec consistent. ! return(super.getRGB()); ! } ! /*************************************************************************/ ! /** ! * Returns a string describing this color. ! * ! * @return A string describing this color. ! */ ! public String ! toString() ! { ! return("SystemColor(R=" + getRed() + ",G=" + getGreen() + ",B=" + ! getBlue() + ")"); ! } ! } // class SystemColor --- 38,462 ---- package java.awt; ! import java.awt.image.ColorModel; ! import java.awt.geom.AffineTransform; ! import java.awt.geom.Rectangle2D; ! import java.io.Serializable; /** ! * This class contains the various "system colors" in use by the native ! * windowing system. The getRGB() method is dynamic on systems ! * which support dynamic system color changes, and most methods in the ! * superclass are written to use this dynamic value when reporting colors. ! * However, the equals() method is not dynamic, and does not ! * track the actual color of instances in this class. This means that equals ! * may give surprising results; you are better off relying on getRGB. ! * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public final class SystemColor extends Color implements Serializable ! { ! // Implementation note: To be serial compatible with JDK, this class must ! // violate the semantic meaning of super.value to be one of the ! // NUM_COLORS constants instead of the actual RGB value. Hence there are ! // a lot of ugly workarounds in Color and in this class. I would have ! // designed it MUCH differently, making a separate id field in this class. ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 4503142729533789064L; ! /** ! * Array index of the desktop color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #desktop ! */ ! public static final int DESKTOP = 0; ! /** ! * Array index of the active caption color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #activeCaption ! */ ! public static final int ACTIVE_CAPTION = 1; ! /** ! * Array index of the active caption text color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #activeCaptionText ! */ ! public static final int ACTIVE_CAPTION_TEXT = 2; ! /** ! * Array index of the active caption border color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #activeCaptionBorder ! */ ! public static final int ACTIVE_CAPTION_BORDER = 3; ! /** ! * Array index of the inactive caption color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #inactiveCaption ! */ ! public static final int INACTIVE_CAPTION = 4; ! /** ! * Array index of the inactive caption text color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #inactiveCaptionText ! */ ! public static final int INACTIVE_CAPTION_TEXT = 5; ! /** ! * Array index of the inactive caption border color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #inactiveCaptionBorder ! */ ! public static final int INACTIVE_CAPTION_BORDER = 6; ! /** ! * Array index of the window background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #window ! */ ! public static final int WINDOW = 7; ! /** ! * Array index of the window border color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #windowBorder ! */ ! public static final int WINDOW_BORDER = 8; ! /** ! * Array index of the window text color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #windowText ! */ ! public static final int WINDOW_TEXT = 9; ! /** ! * Array index of the menu background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #menu ! */ ! public static final int MENU = 10; ! /** ! * Array index of the menu text color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #menuText ! */ ! public static final int MENU_TEXT = 11; ! /** ! * Array index of the text background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #text ! */ ! public static final int TEXT = 12; ! /** ! * Array index of the text foreground color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #textText */ ! public static final int TEXT_TEXT = 13; ! /** ! * Array index of the highlighted text background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #textHighlight ! */ ! public static final int TEXT_HIGHLIGHT = 14; ! /** ! * Array index of the highlighted text foreground color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #textHighlightText ! */ ! public static final int TEXT_HIGHLIGHT_TEXT = 15; ! /** ! * Array index of the inactive text foreground color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #textInactiveText ! */ ! public static final int TEXT_INACTIVE_TEXT = 16; ! /** ! * Array index of the control background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #control ! */ ! public static final int CONTROL = 17; ! /** ! * Array index of the control text color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #controlText ! */ ! public static final int CONTROL_TEXT = 18; ! /** ! * Array index of the highlighted control background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #controlHighlight ! */ ! public static final int CONTROL_HIGHLIGHT = 19; ! /** ! * Array index of the lightly highlighted control background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #controlLtHighlight ! */ ! public static final int CONTROL_LT_HIGHLIGHT = 20; ! /** ! * Array index of the shadowed control background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #controlShadow ! */ ! public static final int CONTROL_SHADOW = 21; ! /** ! * Array index of the darkly shadowed control background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #controlDkShadow ! */ ! public static final int CONTROL_DK_SHADOW = 22; ! /** ! * Array index of the scrollbar background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #scrollbar ! */ ! public static final int SCROLLBAR = 23; ! /** ! * Array index of the info background color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #info ! */ ! public static final int INFO = 24; ! /** ! * Array index of the info text color. Used by ! * {@link Toolkit#loadSystemColors()}. ! * ! * @see #infoText ! */ ! public static final int INFO_TEXT = 25; ! /** ! * The number of system colors. Used by ! * {@link Toolkit#loadSystemColors()}. ! */ ! public static final int NUM_COLORS = 26; ! /** ! * The internal array used to dynamically update getRGB(). ! */ ! private static final int[] colors = new int[NUM_COLORS]; ! /** The desktop color. */ ! public static final SystemColor desktop ! = new SystemColor(DESKTOP); ! /** The active caption background color. */ ! public static final SystemColor activeCaption ! = new SystemColor(ACTIVE_CAPTION); ! /** The active caption text color. */ ! public static final SystemColor activeCaptionText ! = new SystemColor(ACTIVE_CAPTION_TEXT); ! /** The active caption border color. */ ! public static final SystemColor activeCaptionBorder ! = new SystemColor(ACTIVE_CAPTION_BORDER); ! /** The inactive caption background color. */ ! public static final SystemColor inactiveCaption ! = new SystemColor(INACTIVE_CAPTION); ! /** The inactive caption text color. */ ! public static final SystemColor inactiveCaptionText ! = new SystemColor(INACTIVE_CAPTION_TEXT); ! /** The inactive caption border color. */ ! public static final SystemColor inactiveCaptionBorder ! = new SystemColor(INACTIVE_CAPTION_BORDER); ! /** The window background color. */ ! public static final SystemColor window ! = new SystemColor(WINDOW); ! /** The window border color. */ ! public static final SystemColor windowBorder ! = new SystemColor(WINDOW_BORDER); ! /** The window text color. */ ! public static final SystemColor windowText ! = new SystemColor(WINDOW_TEXT); ! /** The menu background color. */ ! public static final SystemColor menu ! = new SystemColor(MENU); ! /** The menu text color. */ ! public static final SystemColor menuText ! = new SystemColor(MENU_TEXT); ! /** The text background color. */ ! public static final SystemColor text ! = new SystemColor(TEXT); ! /** The text foreground color. */ ! public static final SystemColor textText ! = new SystemColor(TEXT_TEXT); ! /** The highlighted text background color. */ ! public static final SystemColor textHighlight ! = new SystemColor(TEXT_HIGHLIGHT); ! /** The highlighted text foreground color. */ ! public static final SystemColor textHighlightText ! = new SystemColor(TEXT_HIGHLIGHT_TEXT); ! /** The inactive text color. */ ! public static final SystemColor textInactiveText ! = new SystemColor(TEXT_INACTIVE_TEXT); ! /** The control background color. */ ! public static final SystemColor control ! = new SystemColor(CONTROL); ! /** The control text color. */ ! public static final SystemColor controlText ! = new SystemColor(CONTROL_TEXT); ! /** The control highlight color. */ ! public static final SystemColor controlHighlight ! = new SystemColor(CONTROL_HIGHLIGHT); ! /** The control light highlight color. */ ! public static final SystemColor controlLtHighlight ! = new SystemColor(CONTROL_LT_HIGHLIGHT); ! /** The control shadow color. */ ! public static final SystemColor controlShadow ! = new SystemColor(CONTROL_SHADOW); ! /** The control dark shadow color. */ ! public static final SystemColor controlDkShadow ! = new SystemColor(CONTROL_DK_SHADOW); ! /** The scrollbar color. */ ! public static final SystemColor scrollbar ! = new SystemColor(SCROLLBAR); ! /** The info text background color. */ ! public static final SystemColor info ! = new SystemColor(INFO); ! /** The info text foreground color. */ ! public static final SystemColor infoText ! = new SystemColor(INFO_TEXT); ! /** ! * Construct a system color which is dynamically updated. ! * ! * @param id the color id ! */ ! private SystemColor(int id) ! { ! // Note: See Color#Color(int, boolean) to explain why we use this ! // particular constructor. ! super(id, true); ! } ! /** ! * Returns the RGB value for this color, in the sRGB color space. The blue ! * value will be in bits 0-7, green in 8-15, red in 6-23, and the alpha ! * value (bits 24-31) is 0xff. This is dynamically updated, so it may not ! * match the results of getRed(), getGreen(), or ! * getBlue(). ! * ! * @return the current RGB value ! */ ! public int getRGB() ! { ! Toolkit.getDefaultToolkit().loadSystemColors(colors); ! return colors[value] | ALPHA_MASK; ! } ! /** ! * Returns a paint context, used for filling areas of a raster scan with ! * the current value of this system color. Since the system colors may be ! * dynamically updated, the returned value may not always be the same; but ! * as the system color is solid, the context does not need any of the ! * passed parameters to do its job. ! * ! * @param cm the requested color model, ignored ! * @param deviceBounds the bounding box in device coordinates, ignored ! * @param userBounds the bounding box in user coordinates, ignored ! * @param xform the bounds transformation, ignored ! * @param hints any rendering hints, ignored ! * @return a context for painting this solid color ! */ ! public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, ! Rectangle2D userBounds, ! AffineTransform xform, ! RenderingHints hints) ! { ! Toolkit.getDefaultToolkit().loadSystemColors(colors); ! int color = colors[value] | ALPHA_MASK; ! if (context == null || color != context.color) ! context = new ColorPaintContext(color); ! return context; ! } + /** + * Returns a string describing this color. This is in the format + * "java.awt.SystemColor[i=" + index + ']', where index is one of the + * integer constants of this class. Unfortunately, this description + * does not describe the current value of the color; for that you should + * use new Color(syscolor.getRGB()).toString(). + * + * @return a string describing this color + */ + public String toString() + { + return "java.awt.SystemColor[i=" + value + ']'; + } + } // class SystemColor diff -Nrc3pad gcc-3.2.3/libjava/java/awt/TextArea.java gcc-3.3/libjava/java/awt/TextArea.java *** gcc-3.2.3/libjava/java/awt/TextArea.java 2002-01-23 00:07:39.000000000 +0000 --- gcc-3.3/libjava/java/awt/TextArea.java 2003-01-02 00:14:05.000000000 +0000 *************** private int scrollbarVisibility; *** 109,114 **** --- 109,116 ---- * Initialize a new instance of TextArea that is empty * and is one row and one column. Both horizontal and vertical * scrollbars will be used. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextArea() *************** TextArea() *** 124,129 **** --- 126,133 ---- * scrollbars will be used. * * @param text The text to display in this text area. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextArea(String text) *************** TextArea(String text) *** 140,145 **** --- 144,151 ---- * * @param rows The number of rows in this text area. * @param columns The number of columns in this text area. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextArea(int rows, int columns) *************** TextArea(int rows, int columns) *** 156,161 **** --- 162,169 ---- * @param text The text to display in this text area. * @param rows The number of rows in this text area. * @param columns The number of columns in this text area. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextArea(String text, int rows, int columns) *************** TextArea(String text, int rows, int colu *** 174,185 **** --- 182,198 ---- * @param rows The number of rows in this text area. * @param columns The number of columns in this text area. * @param scrollbarVisibility Which scrollbars to display. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextArea(String text, int rows, int columns, int scrollbarVisibility) { super(text); + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); + if ((rows < 1) || (columns < 0)) throw new IllegalArgumentException("Bad row or column value"); diff -Nrc3pad gcc-3.2.3/libjava/java/awt/TextComponent.java gcc-3.3/libjava/java/awt/TextComponent.java *** gcc-3.2.3/libjava/java/awt/TextComponent.java 2002-01-23 00:07:39.000000000 +0000 --- gcc-3.3/libjava/java/awt/TextComponent.java 2003-01-14 22:12:52.000000000 +0000 *************** *** 1,5 **** /* TextComponent.java -- Widgets for entering text ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* TextComponent.java -- Widgets for entering text ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** protected transient TextListener textLis *** 97,102 **** --- 97,103 ---- TextComponent(String text) { this.text = text; + this.editable = true; } /*************************************************************************/ *************** getCaretPosition() *** 290,299 **** --- 291,308 ---- * Sets the caret position to the specified value. * * @param caretPosition The new caret position. + * + * @exception IllegalArgumentException If the value supplied for position + * is less than zero. + * + * @since 1.1 */ public synchronized void setCaretPosition(int caretPosition) { + if (caretPosition < 0) + throw new IllegalArgumentException (); + TextComponentPeer tcp = (TextComponentPeer)getPeer(); if (tcp != null) tcp.setCaretPosition(caretPosition); *************** processTextEvent(TextEvent event) *** 408,413 **** --- 417,434 ---- textListener.textValueChanged(event); } + void + dispatchEventImpl(AWTEvent e) + { + if (e.id <= TextEvent.TEXT_LAST + && e.id >= TextEvent.TEXT_FIRST + && (textListener != null + || (eventMask & AWTEvent.TEXT_EVENT_MASK) != 0)) + processEvent(e); + else + super.dispatchEventImpl(e); + } + /*************************************************************************/ /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/TextField.java gcc-3.3/libjava/java/awt/TextField.java *** gcc-3.2.3/libjava/java/awt/TextField.java 2002-01-23 00:07:39.000000000 +0000 --- gcc-3.3/libjava/java/awt/TextField.java 2003-01-02 00:14:06.000000000 +0000 *************** *** 1,5 **** /* TextField.java -- A one line text entry field ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* TextField.java -- A one line text entry field ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** private ActionListener action_listeners; *** 84,92 **** * Constructors */ ! /* * Initializes a new instance of TextField that is empty * and has one column. */ public TextField() --- 84,94 ---- * Constructors */ ! /** * Initializes a new instance of TextField that is empty * and has one column. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextField() *************** TextField() *** 102,107 **** --- 104,111 ---- * length of the text string. * * @param text The text to display in the field. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextField(String text) *************** TextField(String text) *** 116,121 **** --- 120,127 ---- * and has the specified number of columns. * * @param columns The number of columns in the text field. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextField(int columns) *************** TextField(int columns) *** 131,142 **** --- 137,153 ---- * * @param text The text to display in the field. * @param columns The number of columns in the field. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true, */ public TextField(String text, int columns) { super(text); this.columns = columns; + + if (GraphicsEnvironment.isHeadless()) + throw new HeadlessException (); } /*************************************************************************/ *************** processActionEvent(ActionEvent event) *** 452,457 **** --- 463,480 ---- action_listeners.actionPerformed(event); } + void + dispatchEventImpl(AWTEvent e) + { + if (e.id <= ActionEvent.ACTION_LAST + && e.id >= ActionEvent.ACTION_FIRST + && (action_listeners != null + || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) + processEvent(e); + else + super.dispatchEventImpl(e); + } + /*************************************************************************/ /** diff -Nrc3pad gcc-3.2.3/libjava/java/awt/TexturePaint.java gcc-3.3/libjava/java/awt/TexturePaint.java *** gcc-3.2.3/libjava/java/awt/TexturePaint.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/awt/TexturePaint.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 0 **** --- 1,75 ---- + /* TexturePaint.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.awt; + + import java.awt.geom.AffineTransform; + import java.awt.geom.Rectangle2D; + import java.awt.image.BufferedImage; + import java.awt.image.ColorModel; + + /** STUB CLASS ONLY */ + public class TexturePaint implements Paint + { + private final BufferedImage texture; + private final Rectangle2D anchor; + public TexturePaint(BufferedImage texture, Rectangle2D anchor) + { + this.texture = texture; + this.anchor = anchor; + } + public BufferedImage getImage() + { + return texture; + } + public Rectangle2D getAnchorRect() + { + return anchor; + } + public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, + Rectangle2D userBounds, + AffineTransform xform, + RenderingHints hints) + { + throw new Error("not implemented"); + } + public int getTransparency() + { + throw new Error("not implemented"); + } + } // class TexturePaint diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Toolkit.java gcc-3.3/libjava/java/awt/Toolkit.java *** gcc-3.2.3/libjava/java/awt/Toolkit.java 2002-01-24 06:30:59.000000000 +0000 --- gcc-3.3/libjava/java/awt/Toolkit.java 2003-01-14 22:12:52.000000000 +0000 *************** exception statement from your version. * *** 38,825 **** package java.awt; - import java.awt.event.*; - import java.awt.peer.*; - import java.awt.image.*; import java.awt.datatransfer.Clipboard; ! import java.util.Properties; import java.net.URL; ! import java.beans.*; ! ! /** ! * The AWT system uses a set of native peer objects to implement its ! * widgets. These peers are provided by a peer toolkit, that is accessed ! * via a subclass of this superclass. The system toolkit is retrieved ! * by the static methods getDefaultToolkit. This method ! * determines the system toolkit by examining the system property ! * awt.toolkit. That property is set to the name of the ! * Toolkit subclass for the specified peer set. If the ! * awt.toolkit property is not set, then the default ! * toolkit gnu.java.awt.peer.gtk.GtkToolkit is used. This ! * toolkit creates its peers using the GTK+ toolkit. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public abstract class Toolkit ! { ! ! /* ! * Static Variables ! */ ! ! // The default toolkit name. ! private static String default_toolkit_name = ! "gnu.java.awt.peer.gtk.GtkToolkit"; ! ! // The toolkit in use. Once we load it, we don't ever change it ! // if the awt.toolkit propert is set. ! private static Toolkit toolkit; ! ! // The toolkit properties ! private static Properties props = new Properties(); ! ! private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this); ! ! private Properties desktopProperties = new Properties(); ! ! /*************************************************************************/ ! ! /* ! * Static Methods ! */ ! ! /** ! * Returns an instance of the default toolkit. The default toolkit is ! * the subclass of Toolkit specified in the system property ! * awt.toolkit, or gnu.java.awt.peer.gtk.GtkToolkit ! * if the property is not set. ! * ! * @return An instance of the system default toolkit. ! * ! * @error AWTError If the toolkit cannot be loaded. ! */ ! public static Toolkit ! getDefaultToolkit() ! { ! if (toolkit != null) ! return(toolkit); ! ! String toolkit_name = System.getProperty("awt.toolkit", ! default_toolkit_name); ! ! try ! { ! Class cls = Class.forName(toolkit_name); ! Object obj = cls.newInstance(); ! ! if (!(obj instanceof Toolkit)) ! throw new AWTError(toolkit_name + " is not a subclass of " + ! "java.awt.Toolkit"); ! ! toolkit = (Toolkit)obj; ! return(toolkit); ! } ! catch(Exception e) ! { ! throw new AWTError("Cannot load AWT toolkit: " + e.getMessage()); ! } ! } ! ! /*************************************************************************/ ! ! /** ! * Returns the value of the property with the specified name, or the ! * default value if the property does not exist. ! * ! * @param key The name of the property to retrieve. ! * @param defThe default value of the property. ! */ ! public static String ! getProperty(String key, String def) ! { ! return(props.getProperty(key, def)); ! } ! ! /*************************************************************************/ /** ! * Returns the native container object of the specified component. This ! * method is necessary because the parent component might be a lightweight ! * component. ! * ! * @param component The component to fetch the native container for. ! * ! * @return The native container object for this component. ! */ ! protected static Container ! getNativeContainer(Component component) ! { ! component = component.getParent(); ! ! for(;;) ! { ! if (component == null) ! return(null); ! ! if (!(component instanceof Container)) ! { ! component = component.getParent(); ! continue; ! } ! ! if (component.getPeer() instanceof LightweightPeer) ! { ! component = component.getParent(); ! continue; ! } ! ! return((Container)component); ! } ! } ! ! /*************************************************************************/ ! ! /* ! * Constructors */ ! ! /** ! * Default constructor for subclasses. ! */ ! public ! Toolkit() { ! } ! ! /*************************************************************************/ ! ! /* ! * Instance Methods ! */ ! ! /** ! * Creates a peer object for the specified Button. ! * ! * @param target The Button to create the peer for. ! * ! * @return The peer for the specified Button object. ! */ ! protected abstract ButtonPeer ! createButton(Button target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified TextField. ! * ! * @param target The TextField to create the peer for. ! * ! * @return The peer for the specified TextField object. ! */ ! protected abstract TextFieldPeer ! createTextField(TextField target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified Label. ! * ! * @param target The Label to create the peer for. ! * ! * @return The peer for the specified Label object. ! */ ! protected abstract LabelPeer ! createLabel(Label target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified List. ! * ! * @param target The List to create the peer for. ! * ! * @return The peer for the specified List object. ! */ ! protected abstract ListPeer ! createList(List target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified Checkbox. ! * ! * @param target The Checkbox to create the peer for. ! * ! * @return The peer for the specified Checkbox object. ! */ ! protected abstract CheckboxPeer ! createCheckbox(Checkbox target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified Scrollbar. ! * ! * @param target The Scrollbar to create the peer for. ! * ! * @return The peer for the specified Scrollbar object. ! */ ! protected abstract ScrollbarPeer ! createScrollbar(Scrollbar target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified ScrollPane. ! * ! * @param target The ScrollPane to create the peer for. ! * ! * @return The peer for the specified ScrollPane object. ! */ ! protected abstract ScrollPanePeer ! createScrollPane(ScrollPane target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified TextArea. ! * ! * @param target The TextArea to create the peer for. ! * ! * @return The peer for the specified TextArea object. ! */ ! protected abstract TextAreaPeer ! createTextArea(TextArea target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified Choice. ! * ! * @param target The Choice to create the peer for. ! * ! * @return The peer for the specified Choice object. ! */ ! protected abstract ChoicePeer ! createChoice(Choice target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified Frame. ! * ! * @param target The Frame to create the peer for. ! * ! * @return The peer for the specified Frame object. ! */ ! protected abstract FramePeer ! createFrame(Frame target); ! ! /*************************************************************************/ ! ! /** ! * Creates a peer object for the specified Canvas. ! * ! * @param target The Canvas to create the peer for. ! * ! * @return The peer for the specified Canvas object. ! */ ! protected abstract CanvasPeer ! createCanvas(Canvas target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified Panel. ! * ! * @param target The Panel to create the peer for. ! * ! * @return The peer for the specified Panel object. ! */ ! protected abstract PanelPeer ! createPanel(Panel target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified Window. ! * ! * @param target The Window to create the peer for. ! * ! * @return The peer for the specified Window object. ! */ ! protected abstract WindowPeer ! createWindow(Window target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified Dialog. ! * ! * @param target The dialog to create the peer for ! * ! * @return The peer for the specified font name. ! */ ! protected abstract DialogPeer ! createDialog(Dialog target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified MenuBar. ! * ! * @param target The MenuBar to create the peer for. ! * ! * @return The peer for the specified MenuBar object. ! */ ! protected abstract MenuBarPeer ! createMenuBar(MenuBar target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified Menu. ! * ! * @param target The Menu to create the peer for. ! * ! * @return The peer for the specified Menu object. ! */ ! protected abstract MenuPeer ! createMenu(Menu target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified PopupMenu. ! * ! * @param target The PopupMenu to create the peer for. ! * ! * @return The peer for the specified PopupMenu object. ! */ ! protected abstract PopupMenuPeer ! createPopupMenu(PopupMenu target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified MenuItem. ! * ! * @param target The MenuItem to create the peer for. ! * ! * @return The peer for the specified MenuItem object. ! */ ! protected abstract MenuItemPeer ! createMenuItem(MenuItem target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified FileDialog. ! * ! * @param target The FileDialog to create the peer for. ! * ! * @return The peer for the specified FileDialog object. ! */ ! protected abstract FileDialogPeer ! createFileDialog(FileDialog target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified CheckboxMenuItem. ! * ! * @param target The CheckboxMenuItem to create the peer for. ! * ! * @return The peer for the specified CheckboxMenuItem object. ! */ ! protected abstract CheckboxMenuItemPeer ! createCheckboxMenuItem(CheckboxMenuItem target); ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified Component. The ! * peer returned by this method is not a native windowing system peer ! * with its own native window. Instead, this method allows the component ! * to draw on its parent window as a "lightweight" widget. ! * ! * XXX: FIXME ! * ! * @param target The Component to create the peer for. ! * ! * @return The peer for the specified Component object. ! */ ! protected LightweightPeer ! createComponent(Component target) ! { ! return null; ! } ! /*************************************************************************/ ! /** ! * Creates a peer object for the specified font name. ! * ! * @param name The font to create the peer for. ! * @param style The font style to create the peer for. ! * ! * @return The peer for the specified font name. ! */ ! protected abstract FontPeer ! getFontPeer(String name, int style); ! /*************************************************************************/ ! /** ! * Copies the current system colors into the specified array. This is ! * the interface used by the SystemColors class. ! * ! * @param colors The array to copy the system colors into. ! */ ! protected void ! loadSystemColors(int systemColors[]) ! { ! } ! /*************************************************************************/ ! /** ! * Returns the dimensions of the screen in pixels. ! * ! * @return The dimensions of the screen in pixels. ! */ ! public abstract Dimension ! getScreenSize(); ! /*************************************************************************/ ! /** ! * Returns the screen resolution in dots per square inch. ! * ! * @return The screen resolution in dots per square inch. ! */ ! public abstract int ! getScreenResolution(); ! /*************************************************************************/ ! /** ! * Returns the color model of the screen. ! * ! * @return The color model of the screen. ! */ ! public abstract ColorModel ! getColorModel(); ! /*************************************************************************/ ! /** ! * Returns the names of the available fonts. ! * ! * @return The names of the available fonts. ! */ ! public abstract String[] ! getFontList(); ! /*************************************************************************/ ! /** ! * Return the font metrics for the specified font ! * ! * @param name The name of the font to return metrics for. ! * ! * @return The requested font metrics. ! */ ! public abstract FontMetrics ! getFontMetrics(Font name); ! /*************************************************************************/ ! /** ! * Flushes any buffered data to the screen so that it is in sync with ! * what the AWT system has drawn to it. ! */ ! public abstract void ! sync(); ! /*************************************************************************/ ! /** ! * Returns an image from the specified file, which must be in a ! * recognized format. Supported formats vary from toolkit to toolkit. ! * ! * @return name The name of the file to read the image from. ! */ ! public abstract Image ! getImage(String name); ! /*************************************************************************/ ! /** ! * Returns an image from the specified URL, which must be in a ! * recognized format. Supported formats vary from toolkit to toolkit. ! * ! * @return url The URl to read the image from. ! */ ! public abstract Image ! getImage(URL url); ! /*************************************************************************/ ! /** ! * Readies an image to be rendered on the screen. The width and height ! * values can be set to the default sizes for the image by passing -1 ! * in those parameters. ! * ! * @param image The image to prepare for rendering. ! * @param width The width of the image. ! * @param height The height of the image. ! * @param observer The observer to receive events about the preparation ! * process. ! * ! * @return true if the image is already prepared for rendering, ! * false otherwise. ! */ ! public abstract boolean ! prepareImage(Image image, int width, int height, ImageObserver observer); ! /*************************************************************************/ ! /** ! * Checks the status of specified image as it is being readied for ! * rendering. ! * ! * @param image The image to prepare for rendering. ! * @param width The width of the image. ! * @param height The height of the image. ! * @param observer The observer to receive events about the preparation ! * process. ! * ! * @return A union of the bitmasks from ! * java.awt.image.ImageObserver that indicates the current ! * state of the imaging readying process. ! */ ! public abstract int ! checkImage(Image image, int width, int height, ImageObserver observer); ! /*************************************************************************/ ! /** ! * Creates an image using the specified ImageProducer ! * ! * @param producer The ImageProducer to create the image from. ! * ! * @return The created image. ! */ ! public abstract Image ! createImage(ImageProducer producer); ! /*************************************************************************/ ! /** ! * Creates an image from the specified portion of the byte array passed. ! * The array must be in a recognized format. Supported formats vary from ! * toolkit to toolkit. ! * ! * @param data The raw image data. ! * @param offset The offset into the data where the image data starts. ! * @param len The length of the image data. ! * ! * @return The created image. ! */ ! public abstract Image ! createImage(byte[] data, int offset, int len); ! /*************************************************************************/ - /** - * Creates an image from the specified byte array. The array must be in - * a recognized format. Supported formats vary from toolkit to toolkit. - * - * @param data The raw image data. - * - * @return The created image. - */ - public Image - createImage(byte[] data) - { - return(createImage(data, 0, data.length)); - } ! public abstract Image ! createImage(String filename); ! public abstract Image ! createImage(URL url); ! /*************************************************************************/ ! /** ! * Returns a instance of PrintJob for the specified ! * arguments. ! * ! * @param frame The window initiating the print job. ! * @param title The print job title. ! * @param props The print job properties. ! * ! * @return The requested print job, or null if the job ! * was cancelled. ! */ ! public abstract PrintJob ! getPrintJob(Frame frame, String title, Properties props); ! /*************************************************************************/ ! /** ! * Returns the system clipboard. ! * ! * @return THe system clipboard. ! */ ! public abstract Clipboard ! getSystemClipboard(); ! /*************************************************************************/ ! /** ! * Returns the accelerator key mask for menu shortcuts. The default is ! * Event.CTRL_MASK. A toolkit must override this method ! * to change the default. ! * ! * @return The key mask for the menu accelerator key. ! */ ! public int ! getMenuShortcutKeyMask() ! { ! return Event.CTRL_MASK; ! } ! public boolean ! getLockingKeyState(int keyCode) ! { ! if (keyCode != KeyEvent.VK_CAPS_LOCK ! && keyCode != KeyEvent.VK_NUM_LOCK ! && keyCode != KeyEvent.VK_SCROLL_LOCK) ! throw new IllegalArgumentException(); ! throw new UnsupportedOperationException(); ! } ! public void ! setLockingKeyState(int keyCode, boolean on) ! { ! if (keyCode != KeyEvent.VK_CAPS_LOCK ! && keyCode != KeyEvent.VK_NUM_LOCK ! && keyCode != KeyEvent.VK_SCROLL_LOCK) ! throw new IllegalArgumentException(); ! throw new UnsupportedOperationException(); ! } ! /*************************************************************************/ ! /** ! * Returns the event queue for the applet. Despite the word "System" ! * in the name of this method, there is no guarantee that the same queue ! * is shared system wide. ! * ! * @return The event queue for this applet (or application) ! */ ! public final EventQueue ! getSystemEventQueue() ! { ! return(getSystemEventQueueImpl()); ! } ! /*************************************************************************/ ! /** ! * // FIXME: What does this do? ! */ ! protected abstract EventQueue ! getSystemEventQueueImpl(); ! /*************************************************************************/ ! /** ! * Causes a "beep" tone to be generated. ! */ ! public abstract void ! beep(); ! public Cursor ! createCustomCursor(Image cursor, Point hotSpot, String name) ! throws IndexOutOfBoundsException ! { ! // Presumably the only reason this isn't abstract is for backwards ! // compatibility? FIXME? ! return null; ! } ! public Dimension ! getBestCursorSize(int preferredWidth, int preferredHeight) ! { ! return new Dimension (0,0); ! } ! public int ! getMaximumCursorColors() ! { ! return 0; ! } ! public final Object ! getDesktopProperty(String propertyName) ! { ! return desktopProperties.get(propertyName); ! } ! protected final void ! setDesktopProperty(String name, Object newValue) ! { ! Object oldValue = getDesktopProperty(name); ! desktopProperties.put(name, newValue); ! changeSupport.firePropertyChange(name, oldValue, newValue); ! } ! protected Object ! lazilyLoadDesktopProperty(String name) ! { ! // FIXME - what is this?? ! return null; ! } ! protected void ! initializeDesktopProperties() ! { ! // Overridden by toolkit implementation? ! } ! public void ! addPropertyChangeListener(String name, PropertyChangeListener pcl) ! { ! changeSupport.addPropertyChangeListener(name, pcl); ! } ! ! public void ! removePropertyChangeListener(String name, PropertyChangeListener pcl) ! { ! changeSupport.removePropertyChangeListener(name, pcl); ! } ! public void ! addAWTEventListener(AWTEventListener listener, long eventMask) ! { ! // SecurityManager s = System.getSecurityManager(); ! // if (s != null) ! // s.checkPermission(AWTPermission("listenToAllAWTEvents")); ! // FIXME ! } ! public void ! removeAWTEventListener(AWTEventListener listener) ! { ! // FIXME ! } } // class Toolkit --- 38,828 ---- package java.awt; import java.awt.datatransfer.Clipboard; ! import java.awt.dnd.DragGestureEvent; ! import java.awt.dnd.DragGestureListener; ! import java.awt.dnd.DragGestureRecognizer; ! import java.awt.dnd.DragSource; ! import java.awt.dnd.peer.DragSourceContextPeer; ! import java.awt.event.AWTEventListener; ! import java.awt.event.KeyEvent; ! import java.awt.im.InputMethodHighlight; ! import java.awt.image.ColorModel; ! import java.awt.image.ImageObserver; ! import java.awt.image.ImageProducer; ! import java.awt.peer.ButtonPeer; ! import java.awt.peer.CanvasPeer; ! import java.awt.peer.CheckboxPeer; ! import java.awt.peer.CheckboxMenuItemPeer; ! import java.awt.peer.ChoicePeer; ! import java.awt.peer.DialogPeer; ! import java.awt.peer.FileDialogPeer; ! import java.awt.peer.FontPeer; ! import java.awt.peer.FramePeer; ! import java.awt.peer.LabelPeer; ! import java.awt.peer.LightweightPeer; ! import java.awt.peer.ListPeer; ! import java.awt.peer.MenuPeer; ! import java.awt.peer.MenuBarPeer; ! import java.awt.peer.MenuItemPeer; ! import java.awt.peer.PanelPeer; ! import java.awt.peer.PopupMenuPeer; ! import java.awt.peer.ScrollbarPeer; ! import java.awt.peer.ScrollPanePeer; ! import java.awt.peer.TextAreaPeer; ! import java.awt.peer.TextFieldPeer; ! import java.awt.peer.WindowPeer; ! import java.beans.PropertyChangeListener; ! import java.beans.PropertyChangeSupport; import java.net.URL; ! import java.util.Map; ! import java.util.Properties; /** ! * The AWT system uses a set of native peer objects to implement its ! * widgets. These peers are provided by a peer toolkit, that is accessed ! * via a subclass of this superclass. The system toolkit is retrieved ! * by the static methods getDefaultToolkit. This method ! * determines the system toolkit by examining the system property ! * awt.toolkit. That property is set to the name of the ! * Toolkit subclass for the specified peer set. If the ! * awt.toolkit property is not set, then the default ! * toolkit gnu.java.awt.peer.gtk.GtkToolkit is used. This ! * toolkit creates its peers using the GTK+ toolkit. ! * ! * @author Aaron M. Renn */ ! public abstract class Toolkit { ! /** The default toolkit name. */ ! private static String default_toolkit_name ! = "gnu.awt.gtk.GtkToolkit"; ! /** ! * The toolkit in use. Once we load it, we don't ever change it ! * if the awt.toolkit property is set. ! */ ! private static Toolkit toolkit; ! /** The toolkit properties. */ ! private static Properties props = new Properties(); ! protected final Map desktopProperties = new Properties(); ! protected final PropertyChangeSupport desktopPropsSupport ! = new PropertyChangeSupport(this); ! /** ! * Default constructor for subclasses. ! */ ! public Toolkit() ! { ! } ! /** ! * Creates a peer object for the specified Button. ! * ! * @param target The Button to create the peer for. ! * ! * @return The peer for the specified Button object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract ButtonPeer createButton(Button target); ! /** ! * Creates a peer object for the specified TextField. ! * ! * @param target The TextField to create the peer for. ! * @return The peer for the specified TextField object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract TextFieldPeer createTextField(TextField target); ! /** ! * Creates a peer object for the specified Label. ! * ! * @param target The Label to create the peer for. ! * @return The peer for the specified Label object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract LabelPeer createLabel(Label target); ! /** ! * Creates a peer object for the specified List. ! * ! * @param target The List to create the peer for. ! * @return The peer for the specified List object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract ListPeer createList(List target); ! /** ! * Creates a peer object for the specified Checkbox. ! * ! * @param target The Checkbox to create the peer for. ! * @return The peer for the specified Checkbox object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract CheckboxPeer createCheckbox(Checkbox target); ! /** ! * Creates a peer object for the specified Scrollbar. ! * ! * @param target The Scrollbar to create the peer for. ! * @return The peer for the specified Scrollbar object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract ScrollbarPeer createScrollbar(Scrollbar target); ! /** ! * Creates a peer object for the specified ScrollPane. ! * ! * @param target The ScrollPane to create the peer for. ! * @return The peer for the specified ScrollPane object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract ScrollPanePeer createScrollPane(ScrollPane target); ! /** ! * Creates a peer object for the specified TextArea. ! * ! * @param target The TextArea to create the peer for. ! * @return The peer for the specified TextArea object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract TextAreaPeer createTextArea(TextArea target); ! /** ! * Creates a peer object for the specified Choice. ! * ! * @param target The Choice to create the peer for. ! * @return The peer for the specified Choice object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract ChoicePeer createChoice(Choice target); ! /** ! * Creates a peer object for the specified Frame. ! * ! * @param target The Frame to create the peer for. ! * @return The peer for the specified Frame object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract FramePeer createFrame(Frame target); ! /** ! * Creates a peer object for the specified Canvas. ! * ! * @param target The Canvas to create the peer for. ! * @return The peer for the specified Canvas object. ! */ ! protected abstract CanvasPeer createCanvas(Canvas target); ! /** ! * Creates a peer object for the specified Panel. ! * ! * @param target The Panel to create the peer for. ! * @return The peer for the specified Panel object. ! */ ! protected abstract PanelPeer createPanel(Panel target); ! /** ! * Creates a peer object for the specified Window. ! * ! * @param target The Window to create the peer for. ! * @return The peer for the specified Window object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract WindowPeer createWindow(Window target); ! /** ! * Creates a peer object for the specified Dialog. ! * ! * @param target The dialog to create the peer for ! * @return The peer for the specified font name. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract DialogPeer createDialog(Dialog target); ! /** ! * Creates a peer object for the specified MenuBar. ! * ! * @param target The MenuBar to create the peer for. ! * @return The peer for the specified MenuBar object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract MenuBarPeer createMenuBar(MenuBar target); ! /** ! * Creates a peer object for the specified Menu. ! * ! * @param target The Menu to create the peer for. ! * @return The peer for the specified Menu object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract MenuPeer createMenu(Menu target); ! /** ! * Creates a peer object for the specified PopupMenu. ! * ! * @param target The PopupMenu to create the peer for. ! * @return The peer for the specified PopupMenu object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract PopupMenuPeer createPopupMenu(PopupMenu target); ! /** ! * Creates a peer object for the specified MenuItem. ! * ! * @param target The MenuItem to create the peer for. ! * @return The peer for the specified MenuItem object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract MenuItemPeer createMenuItem(MenuItem target); ! /** ! * Creates a peer object for the specified FileDialog. ! * ! * @param target The FileDialog to create the peer for. ! * @return The peer for the specified FileDialog object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract FileDialogPeer createFileDialog(FileDialog target); ! /** ! * Creates a peer object for the specified CheckboxMenuItem. ! * ! * @param target The CheckboxMenuItem to create the peer for. ! * @return The peer for the specified CheckboxMenuItem object. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected abstract CheckboxMenuItemPeer ! createCheckboxMenuItem(CheckboxMenuItem target); ! /** ! * Creates a peer object for the specified Component. The ! * peer returned by this method is not a native windowing system peer ! * with its own native window. Instead, this method allows the component ! * to draw on its parent window as a "lightweight" widget. ! * ! * XXX: FIXME ! * ! * @param target The Component to create the peer for. ! * @return The peer for the specified Component object. ! */ ! protected LightweightPeer createComponent(Component target) ! { ! return null; ! } ! /** ! * Creates a peer object for the specified font name. ! * ! * @param name The font to create the peer for. ! * @param style The font style to create the peer for. ! * @return The peer for the specified font name. ! */ ! protected abstract FontPeer getFontPeer(String name, int style); ! /** ! * Copies the current system colors into the specified array. This is ! * the interface used by the SystemColors class. ! * ! * @param colors The array to copy the system colors into. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected void loadSystemColors(int systemColors[]) ! { ! // XXX Implement. ! } ! /** ! * @since 1.4 ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! public void setDynamicLayout(boolean dynamic) ! { ! } ! /** ! * @since 1.4 ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! protected boolean isDynamicLayoutSet() ! { ! return false; ! } ! /** ! * @since 1.4 ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! public boolean isDynamicLayoutActive() ! { ! return false; ! } ! /** ! * Returns the dimensions of the screen in pixels. ! * ! * @return The dimensions of the screen in pixels. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! public abstract Dimension getScreenSize(); ! /** ! * Returns the screen resolution in dots per square inch. ! * ! * @return The screen resolution in dots per square inch. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! public abstract int getScreenResolution(); ! /** ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! * ! * @since 1.4 ! */ ! public Insets getScreenInsets(GraphicsConfiguration gc) ! { ! return null; ! } ! /** ! * Returns the color model of the screen. ! * ! * @return The color model of the screen. ! */ ! public abstract ColorModel getColorModel(); ! /** ! * Returns the names of the available fonts. ! * ! * @return The names of the available fonts. ! */ ! public abstract String[] getFontList(); ! /** ! * Return the font metrics for the specified font ! * ! * @param name The name of the font to return metrics for. ! * @return The requested font metrics. ! */ ! public abstract FontMetrics getFontMetrics(Font name); ! /** ! * Flushes any buffered data to the screen so that it is in sync with ! * what the AWT system has drawn to it. ! */ ! public abstract void sync(); ! /** ! * Returns an instance of the default toolkit. The default toolkit is ! * the subclass of Toolkit specified in the system property ! * awt.toolkit, or gnu.java.awt.peer.gtk.GtkToolkit ! * if the property is not set. ! * ! * @return An instance of the system default toolkit. ! * ! * @throws AWTError If the toolkit cannot be loaded. ! */ ! public static Toolkit getDefaultToolkit() ! { ! if (toolkit != null) ! return toolkit; ! String toolkit_name = System.getProperty("awt.toolkit", ! default_toolkit_name); ! try ! { ! Class cls = Class.forName(toolkit_name); ! Object obj = cls.newInstance(); ! if (!(obj instanceof Toolkit)) ! throw new AWTError(toolkit_name + " is not a subclass of " + ! "java.awt.Toolkit"); ! toolkit = (Toolkit) obj; ! return toolkit; ! } ! catch (Exception e) ! { ! throw new AWTError("Cannot load AWT toolkit: " + e.getMessage()); ! } ! } ! /** ! * Returns an image from the specified file, which must be in a ! * recognized format. Supported formats vary from toolkit to toolkit. ! * ! * @return name The name of the file to read the image from. ! */ ! public abstract Image getImage(String name); ! /** ! * Returns an image from the specified URL, which must be in a ! * recognized format. Supported formats vary from toolkit to toolkit. ! * ! * @return url The URl to read the image from. ! */ ! public abstract Image getImage(URL url); ! public abstract Image createImage(String filename); ! public abstract Image createImage(URL url); ! /** ! * Readies an image to be rendered on the screen. The width and height ! * values can be set to the default sizes for the image by passing -1 ! * in those parameters. ! * ! * @param image The image to prepare for rendering. ! * @param width The width of the image. ! * @param height The height of the image. ! * @param observer The observer to receive events about the preparation ! * process. ! * ! * @return true if the image is already prepared for rendering, ! * false otherwise. ! */ ! public abstract boolean prepareImage(Image image, int width, int height, ! ImageObserver observer); ! /** ! * Checks the status of specified image as it is being readied for ! * rendering. ! * ! * @param image The image to prepare for rendering. ! * @param width The width of the image. ! * @param height The height of the image. ! * @param observer The observer to receive events about the preparation ! * process. ! * ! * @return A union of the bitmasks from ! * java.awt.image.ImageObserver that indicates the current ! * state of the imaging readying process. ! */ ! public abstract int checkImage(Image image, int width, int height, ! ImageObserver observer); ! /** ! * Creates an image using the specified ImageProducer ! * ! * @param producer The ImageProducer to create the image from. ! * ! * @return The created image. ! */ ! public abstract Image createImage(ImageProducer producer); ! /** ! * Creates an image from the specified byte array. The array must be in ! * a recognized format. Supported formats vary from toolkit to toolkit. ! * ! * @param data The raw image data. ! * ! * @return The created image. ! */ ! public Image createImage(byte[] data) ! { ! return createImage(data, 0, data.length); ! } ! /** ! * Creates an image from the specified portion of the byte array passed. ! * The array must be in a recognized format. Supported formats vary from ! * toolkit to toolkit. ! * ! * @param data The raw image data. ! * @param offset The offset into the data where the image data starts. ! * @param len The length of the image data. ! * ! * @return The created image. ! */ ! public abstract Image createImage(byte[] data, int offset, int len); ! /** ! * Returns a instance of PrintJob for the specified ! * arguments. ! * ! * @param frame The window initiating the print job. ! * @param title The print job title. ! * @param props The print job properties. ! * ! * @return The requested print job, or null if the job ! * was cancelled. ! */ ! public abstract PrintJob getPrintJob(Frame frame, String title, ! Properties props); ! /** ! * @since 1.3 ! */ ! public PrintJob getPrintJob(Frame frame, String title, ! JobAttributes jobAttr, PageAttributes pageAttr) ! { ! return null; ! } ! /** ! * Causes a "beep" tone to be generated. ! */ ! public abstract void beep(); + /** + * Returns the system clipboard. + * + * @return THe system clipboard. + * + * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. + */ + public abstract Clipboard getSystemClipboard(); ! /** ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! * ! * @since 1.4 ! */ ! public Clipboard getSystemSelection() ! { ! return null; ! } ! /** ! * Returns the accelerator key mask for menu shortcuts. The default is ! * Event.CTRL_MASK. A toolkit must override this method ! * to change the default. ! * ! * @return The key mask for the menu accelerator key. ! * ! * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. ! */ ! public int getMenuShortcutKeyMask() ! { ! return Event.CTRL_MASK; ! } ! public boolean getLockingKeyState(int keyCode) ! { ! if (keyCode != KeyEvent.VK_CAPS_LOCK ! && keyCode != KeyEvent.VK_NUM_LOCK ! && keyCode != KeyEvent.VK_SCROLL_LOCK) ! throw new IllegalArgumentException(); ! throw new UnsupportedOperationException(); ! } ! public void setLockingKeyState(int keyCode, boolean on) ! { ! if (keyCode != KeyEvent.VK_CAPS_LOCK ! && keyCode != KeyEvent.VK_NUM_LOCK ! && keyCode != KeyEvent.VK_SCROLL_LOCK) ! throw new IllegalArgumentException(); ! throw new UnsupportedOperationException(); ! } ! /** ! * Returns the native container object of the specified component. This ! * method is necessary because the parent component might be a lightweight ! * component. ! * ! * @param component The component to fetch the native container for. ! * @return The native container object for this component. ! */ ! protected static Container getNativeContainer(Component component) ! { ! component = component.getParent(); ! while (true) ! { ! if (component == null) ! return null; ! if (! (component instanceof Container)) ! { ! component = component.getParent(); ! continue; ! } ! if (component.getPeer() instanceof LightweightPeer) ! { ! component = component.getParent(); ! continue; ! } ! return (Container) component; ! } ! } ! public Cursor createCustomCursor(Image cursor, Point hotSpot, String name) ! { ! // Presumably the only reason this isn't abstract is for backwards ! // compatibility? FIXME? ! return null; ! } ! public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) ! { ! return new Dimension (0,0); ! } ! public int getMaximumCursorColors() ! { ! return 0; ! } ! /** ! * @since 1.4 ! */ ! public boolean isFrameStateSupported(int state) ! { ! return false; ! } ! /** ! * Returns the value of the property with the specified name, or the ! * default value if the property does not exist. ! * ! * @param key The name of the property to retrieve. ! * @param defThe default value of the property. ! */ ! public static String getProperty(String key, String def) ! { ! return props.getProperty(key, def); ! } ! /** ! * Returns the event queue for the applet. Despite the word "System" ! * in the name of this method, there is no guarantee that the same queue ! * is shared system wide. ! * ! * @return The event queue for this applet (or application) ! */ ! public final EventQueue getSystemEventQueue() ! { ! return getSystemEventQueueImpl(); ! } ! /** ! * // FIXME: What does this do? ! */ ! protected abstract EventQueue getSystemEventQueueImpl(); ! /** ! * @since 1.3 ! */ ! public abstract DragSourceContextPeer ! createDragSourceContextPeer(DragGestureEvent e); ! /** ! * @since 1.3 ! */ ! public DragGestureRecognizer ! createDragGestureRecognizer(Class recognizer, DragSource ds, ! Component comp, int actions, ! DragGestureListener l) ! { ! return null; ! } ! public final Object getDesktopProperty(String propertyName) ! { ! return desktopProperties.get(propertyName); ! } ! protected final void setDesktopProperty(String name, Object newValue) ! { ! Object oldValue = getDesktopProperty(name); ! desktopProperties.put(name, newValue); ! desktopPropsSupport.firePropertyChange(name, oldValue, newValue); ! } ! protected Object lazilyLoadDesktopProperty(String name) ! { ! // FIXME - what is this?? ! return null; ! } ! protected void initializeDesktopProperties() ! { ! // Overridden by toolkit implementation? ! } ! public void addPropertyChangeListener(String name, ! PropertyChangeListener pcl) ! { ! desktopPropsSupport.addPropertyChangeListener(name, pcl); ! } ! public void removePropertyChangeListener(String name, ! PropertyChangeListener pcl) ! { ! desktopPropsSupport.removePropertyChangeListener(name, pcl); ! } ! /** ! * @since 1.4 ! */ ! public PropertyChangeListener[] getPropertyChangeListeners() ! { ! return desktopPropsSupport.getPropertyChangeListeners(); ! } ! /** ! * @since 1.4 ! */ ! public PropertyChangeListener[] getPropertyChangeListeners(String name) ! { ! return desktopPropsSupport.getPropertyChangeListeners(name); ! } ! public void addAWTEventListener(AWTEventListener listener, long eventMask) ! { ! // SecurityManager s = System.getSecurityManager(); ! // if (s != null) ! // s.checkPermission(AWTPermission("listenToAllAWTEvents")); ! // FIXME ! } ! public void removeAWTEventListener(AWTEventListener listener) ! { ! // FIXME ! } ! /** ! * @since 1.4 ! */ ! public AWTEventListener[] getAWTEventListeners() ! { ! return null; ! } ! /** ! * @since 1.4 ! */ ! public AWTEventListener[] getAWTEventListeners(long mask) ! { ! return null; ! } + /** + * @since 1.3 + */ + public abstract Map mapInputMethodHighlight(InputMethodHighlight highlight); } // class Toolkit diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Transparency.java gcc-3.3/libjava/java/awt/Transparency.java *** gcc-3.2.3/libjava/java/awt/Transparency.java 2002-01-22 22:40:05.000000000 +0000 --- gcc-3.3/libjava/java/awt/Transparency.java 2002-08-09 04:26:14.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* Transparency.java -- common transparency modes in graphics ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,57 **** package java.awt; /** * @author Warren Levy ! * @date March 15, 2000. ! */ ! ! /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. */ - public interface Transparency { ! public static final int OPAQUE = 1; ! public static final int BITMASK = 2; ! public static final int TRANSLUCENT = 3; ! public int getTransparency(); ! } --- 38,67 ---- package java.awt; /** + * A common transparency mode for layering graphics. + * * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ public interface Transparency { ! /** Image data which is completely opaque, for an alpha value of 1.0. */ ! int OPAQUE = 1; ! /** ! * Image data which is either completely opaque or transparent, for an ! * exact integer alpha value. ! */ ! int BITMASK = 2; ! ! /** Image data which is translucent, for a non-integer alpha value. */ ! int TRANSLUCENT = 3; ! ! /** ! * Return the transparency type. ! * ! * @return One of {@see #OPAQUE}, {@see #BITMASK}, or {@see #TRANSLUCENT}. ! */ ! int getTransparency(); ! } // interface Transparency diff -Nrc3pad gcc-3.2.3/libjava/java/awt/Window.java gcc-3.3/libjava/java/awt/Window.java *** gcc-3.2.3/libjava/java/awt/Window.java 2002-01-29 16:31:24.000000000 +0000 --- gcc-3.3/libjava/java/awt/Window.java 2003-01-14 22:12:52.000000000 +0000 *************** *** 1,6 **** ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation ! ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Window.java -- ! Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** this exception to your version of the li *** 36,42 **** --- 35,43 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.awt; + import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.awt.peer.WindowPeer; *************** public class Window extends Container *** 85,116 **** * parent. The window will initially be invisible. * * @param parent The owning Frame of this window. */ public Window(Frame owner) { ! this((Window) owner); } ! /** @since 1.2 */ public Window(Window owner) { ! this(); ! if (owner == null) ! throw new IllegalArgumentException("owner must not be null"); ! ! this.parent = owner; ! ! // FIXME: add to owner's "owned window" list ! //owner.owned.add(this); // this should be a weak reference } ! /** @since 1.3 */ public Window(Window owner, GraphicsConfiguration gc) { ! this(owner); /* FIXME: Security check SecurityManager.checkTopLevelWindow(...) if (gc != null && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN) --- 86,141 ---- * parent. The window will initially be invisible. * * @param parent The owning Frame of this window. + * + * @exception IllegalArgumentException If the owner's GraphicsConfiguration + * is not from a screen device, or if owner is null; this exception is always + * thrown when GraphicsEnvironment.isHeadless returns true. */ public Window(Frame owner) { ! this (owner, owner.getGraphicsConfiguration ()); } ! /** ! * Initializes a new instance of Window with the specified ! * parent. The window will initially be invisible. ! * ! * @exception IllegalArgumentException If the owner's GraphicsConfiguration ! * is not from a screen device, or if owner is null; this exception is always ! * thrown when GraphicsEnvironment.isHeadless returns true. ! * ! * @since 1.2 ! */ public Window(Window owner) { ! this (owner, owner.getGraphicsConfiguration ()); } ! /** ! * Initializes a new instance of Window with the specified ! * parent. The window will initially be invisible. ! * ! * @exception IllegalArgumentException If owner is null or if gc is not from a ! * screen device; this exception is always thrown when ! * GraphicsEnvironment.isHeadless returns true. ! * ! * @since 1.3 ! */ public Window(Window owner, GraphicsConfiguration gc) { ! this (); ! ! if (owner == null) ! throw new IllegalArgumentException ("owner must not be null"); + this.parent = owner; + + // FIXME: add to owner's "owned window" list + //owner.owned.add(this); // this should be a weak reference + /* FIXME: Security check SecurityManager.checkTopLevelWindow(...) + */ if (gc != null && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN) *************** public class Window extends Container *** 118,128 **** if (gc == null) graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment() ! .getDefaultScreenDevice() ! .getDefaultConfiguration(); else ! */ ! graphicsConfiguration = gc; } GraphicsConfiguration getGraphicsConfigurationImpl() --- 143,152 ---- if (gc == null) graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment() ! .getDefaultScreenDevice() ! .getDefaultConfiguration(); else ! graphicsConfiguration = gc; } GraphicsConfiguration getGraphicsConfigurationImpl() *************** public class Window extends Container *** 133,138 **** --- 157,168 ---- return super.getGraphicsConfigurationImpl(); } + /** + * Disposes of the input methods and context, and removes the WeakReference + * which formerly pointed to this Window from the parent's owned Window list. + * + * @exception Throwable The Exception raised by this method. + */ protected void finalize() throws Throwable { // FIXME: remove from owner's "owned window" list (Weak References) *************** public class Window extends Container *** 145,152 **** public void addNotify() { if (peer == null) ! peer = getToolkit ().createWindow (this); ! super.addNotify (); } /** --- 175,182 ---- public void addNotify() { if (peer == null) ! peer = getToolkit().createWindow(this); ! super.addNotify(); } /** *************** public class Window extends Container *** 157,191 **** */ public void pack() { ! if (parent != null ! && !parent.isDisplayable()) parent.addNotify(); if (peer == null) addNotify(); setSize(getPreferredSize()); ! validate(); } /** * Makes this window visible and brings it to the front. */ ! public void show () { if (peer == null) addNotify(); super.show(); toFront(); } public void hide() { ! // FIXME: call hide() on amy "owned" children here. super.hide(); } /** * Called to free any resource associated with this window. */ --- 187,230 ---- */ public void pack() { ! if (parent != null && !parent.isDisplayable()) parent.addNotify(); if (peer == null) addNotify(); setSize(getPreferredSize()); ! validate(); } /** * Makes this window visible and brings it to the front. */ ! public void show() { + if (parent != null && !parent.isDisplayable()) + parent.addNotify(); if (peer == null) addNotify(); + validate(); super.show(); toFront(); } public void hide() { ! // FIXME: call hide() on any "owned" children here. super.hide(); } + public boolean isDisplayable() + { + if (super.isDisplayable()) + return true; + return peer != null; + } + /** * Called to free any resource associated with this window. */ *************** public class Window extends Container *** 206,217 **** * Sends this window to the back so that all other windows display in * front of it. */ ! public void toBack () { if (peer != null) { WindowPeer wp = (WindowPeer) peer; ! wp.toBack (); } } --- 245,256 ---- * Sends this window to the back so that all other windows display in * front of it. */ ! public void toBack() { if (peer != null) { WindowPeer wp = (WindowPeer) peer; ! wp.toBack(); } } *************** public class Window extends Container *** 219,230 **** * Brings this window to the front so that it displays in front of * any other windows. */ ! public void toFront () { if (peer != null) { ! WindowPeer wp = (WindowPeer) peer; ! wp.toFront (); } } --- 258,269 ---- * Brings this window to the front so that it displays in front of * any other windows. */ ! public void toFront() { if (peer != null) { ! WindowPeer wp = (WindowPeer) peer; ! wp.toFront(); } } *************** public class Window extends Container *** 238,244 **** */ public Toolkit getToolkit() { ! return Toolkit.getDefaultToolkit (); } /** --- 277,283 ---- */ public Toolkit getToolkit() { ! return Toolkit.getDefaultToolkit(); } /** *************** public class Window extends Container *** 255,266 **** if (!secure) { if (warningString != null) ! return warningString; ! else ! { ! String warning = System.getProperty("awt.appletWarning"); ! return warning; ! } } return null; } --- 294,305 ---- if (!secure) { if (warningString != null) ! return warningString; ! else ! { ! String warning = System.getProperty("awt.appletWarning"); ! return warning; ! } } return null; } *************** public class Window extends Container *** 270,278 **** * * @return The locale this window is configured for. */ ! public Locale getLocale () { ! return locale == null ? Locale.getDefault () : locale; } /* --- 309,317 ---- * * @return The locale this window is configured for. */ ! public Locale getLocale() { ! return locale == null ? Locale.getDefault() : locale; } /* *************** public class Window extends Container *** 312,320 **** * * @param listener The WindowListener to add. */ ! public synchronized void addWindowListener (WindowListener listener) { ! windowListener = AWTEventMulticaster.add (windowListener, listener); } /** --- 351,359 ---- * * @param listener The WindowListener to add. */ ! public synchronized void addWindowListener(WindowListener listener) { ! windowListener = AWTEventMulticaster.add(windowListener, listener); } /** *************** public class Window extends Container *** 323,339 **** * * @param listener The WindowListener to remove. */ ! public synchronized void removeWindowListener (WindowListener listener) { ! windowListener = AWTEventMulticaster.remove (windowListener, listener); } ! /** @since 1.3 */ public EventListener[] getListeners(Class listenerType) { if (listenerType == WindowListener.class) ! return getListenersImpl(listenerType, windowListener); ! else return super.getListeners(listenerType); } void dispatchEventImpl(AWTEvent e) --- 362,399 ---- * * @param listener The WindowListener to remove. */ ! public synchronized void removeWindowListener(WindowListener listener) { ! windowListener = AWTEventMulticaster.remove(windowListener, listener); } ! /** ! * Returns an array of all the window listeners registered on this window. ! * ! * @since 1.4 ! */ ! public synchronized WindowListener[] getWindowListeners() ! { ! return (WindowListener[]) ! AWTEventMulticaster.getListeners(windowListener, ! WindowListener.class); ! } ! ! /** ! * Returns an array of all the objects currently registered as FooListeners ! * upon this Window. FooListeners are registered using the addFooListener ! * method. ! * ! * @exception ClassCastException If listenerType doesn't specify a class or ! * interface that implements java.util.EventListener. ! * ! * @since 1.3 ! */ public EventListener[] getListeners(Class listenerType) { if (listenerType == WindowListener.class) ! return getWindowListeners(); ! return super.getListeners(listenerType); } void dispatchEventImpl(AWTEvent e) *************** public class Window extends Container *** 356,367 **** * * @param event The event to process. */ ! protected void processEvent (AWTEvent evt) { if (evt instanceof WindowEvent) ! processWindowEvent ((WindowEvent) evt); else ! super.processEvent (evt); } /** --- 416,427 ---- * * @param event The event to process. */ ! protected void processEvent(AWTEvent evt) { if (evt instanceof WindowEvent) ! processWindowEvent((WindowEvent) evt); else ! super.processEvent(evt); } /** *************** public class Window extends Container *** 372,403 **** * * @param event The event to process. */ ! protected void processWindowEvent (WindowEvent evt) { if (windowListener != null) { ! switch (evt.getID ()) { case WindowEvent.WINDOW_ACTIVATED: ! windowListener.windowActivated (evt); break; case WindowEvent.WINDOW_CLOSED: ! windowListener.windowClosed (evt); break; case WindowEvent.WINDOW_CLOSING: ! windowListener.windowClosing (evt); break; case WindowEvent.WINDOW_DEACTIVATED: ! windowListener.windowDeactivated (evt); break; case WindowEvent.WINDOW_DEICONIFIED: ! windowListener.windowDeiconified (evt); break; case WindowEvent.WINDOW_ICONIFIED: ! windowListener.windowIconified (evt); break; case WindowEvent.WINDOW_OPENED: ! windowListener.windowOpened (evt); break; } } --- 432,463 ---- * * @param event The event to process. */ ! protected void processWindowEvent(WindowEvent evt) { if (windowListener != null) { ! switch (evt.getID()) { case WindowEvent.WINDOW_ACTIVATED: ! windowListener.windowActivated(evt); break; case WindowEvent.WINDOW_CLOSED: ! windowListener.windowClosed(evt); break; case WindowEvent.WINDOW_CLOSING: ! windowListener.windowClosing(evt); break; case WindowEvent.WINDOW_DEACTIVATED: ! windowListener.windowDeactivated(evt); break; case WindowEvent.WINDOW_DEICONIFIED: ! windowListener.windowDeiconified(evt); break; case WindowEvent.WINDOW_ICONIFIED: ! windowListener.windowIconified(evt); break; case WindowEvent.WINDOW_OPENED: ! windowListener.windowOpened(evt); break; } } *************** public class Window extends Container *** 471,475 **** if (peer != null) return peer.getGraphicsConfiguration(); return null; } - } --- 531,534 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/beans/beancontext/BeanContextChildSupport.java gcc-3.3/libjava/java/beans/beancontext/BeanContextChildSupport.java *** gcc-3.2.3/libjava/java/beans/beancontext/BeanContextChildSupport.java 2002-01-22 22:40:12.000000000 +0000 --- gcc-3.3/libjava/java/beans/beancontext/BeanContextChildSupport.java 2002-10-04 08:48:01.000000000 +0000 *************** import java.io.Serializable; *** 60,66 **** * @see java.beans.beancontext.BeanContextChild */ ! public class BeanContextChildSupport implements BeanContextChild, BeanContextServicesListener, Serializable { /** * The peer on which to perform set actions. * This is here so that this class can be used as a peer. --- 60,70 ---- * @see java.beans.beancontext.BeanContextChild */ ! public class BeanContextChildSupport ! implements BeanContextChild, BeanContextServicesListener, Serializable ! { ! static final long serialVersionUID = 6328947014421475877L; ! /** * The peer on which to perform set actions. * This is here so that this class can be used as a peer. diff -Nrc3pad gcc-3.2.3/libjava/java/beans/BeanInfo.java gcc-3.3/libjava/java/beans/BeanInfo.java *** gcc-3.2.3/libjava/java/beans/BeanInfo.java 2002-01-22 22:40:11.000000000 +0000 --- gcc-3.3/libjava/java/beans/BeanInfo.java 2002-11-07 08:45:19.000000000 +0000 *************** package java.beans; *** 74,86 **** public interface BeanInfo { /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static int ICON_COLOR_16x16 = 1; /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static int ICON_COLOR_32x32 = 2; /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static int ICON_MONO_16x16 = 3; /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static int ICON_MONO_32x32 = 4; /** Get the general description of this Bean type. ** @return the BeanDescriptor for the Bean, or null if --- 74,86 ---- public interface BeanInfo { /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static final int ICON_COLOR_16x16 = 1; /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static final int ICON_COLOR_32x32 = 2; /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static final int ICON_MONO_16x16 = 3; /** Use this as a parameter for the getIcon() command to retrieve a certain type of icon. **/ ! public static final int ICON_MONO_32x32 = 4; /** Get the general description of this Bean type. ** @return the BeanDescriptor for the Bean, or null if diff -Nrc3pad gcc-3.2.3/libjava/java/beans/ExceptionListener.java gcc-3.3/libjava/java/beans/ExceptionListener.java *** gcc-3.2.3/libjava/java/beans/ExceptionListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/beans/ExceptionListener.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* ExceptionListener.java -- listen for recoverable internal exceptions + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.beans; + + /** + * This interface allows a class to monitor internal exceptions, to try to + * recover from them. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public interface ExceptionListener + { + /** + * Fired after an exception occurs. + * + * @param e the trapped exception + */ + void exceptionThrown(Exception e); + } // interface ExceptionListener diff -Nrc3pad gcc-3.2.3/libjava/java/beans/Introspector.java gcc-3.3/libjava/java/beans/Introspector.java *** gcc-3.2.3/libjava/java/beans/Introspector.java 2002-03-24 21:32:22.000000000 +0000 --- gcc-3.3/libjava/java/beans/Introspector.java 2002-11-30 04:41:59.000000000 +0000 *************** *** 1,5 **** /* java.beans.Introspector ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* java.beans.Introspector ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class Introspector { *** 209,214 **** --- 209,240 ---- } } + /** + * Flush all of the Introspector's internal caches. + * + * @since 1.2 + */ + public static void flushCaches() + { + beanInfoCache.clear(); + } + + /** + * Flush the Introspector's internal cached information for a given + * class. + * + * @param clz the class to be flushed. + * @throws NullPointerException if clz is null. + * @since 1.2 + */ + public static void flushFromCaches(Class clz) + { + synchronized (clz) + { + beanInfoCache.remove(clz); + } + } + /** * Get the BeanInfo for class beanClass, * first by looking for explicit information, next by diff -Nrc3pad gcc-3.2.3/libjava/java/beans/PropertyChangeEvent.java gcc-3.3/libjava/java/beans/PropertyChangeEvent.java *** gcc-3.2.3/libjava/java/beans/PropertyChangeEvent.java 2002-01-22 22:40:11.000000000 +0000 --- gcc-3.3/libjava/java/beans/PropertyChangeEvent.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 1,5 **** ! /* java.beans.PropertyChangeEvent ! Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PropertyChangeEvent.java -- describes a change in a property ! Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,124 **** package java.beans; /** ! ** PropertyChangeEvents are fired in the PropertyChange ! ** and VetoableChange event classes. They represent the ! ** old and new values as well as the source Bean.

        ! ** ! ** If the old or new value is a primitive type, it must ! ** be wrapped in the appropriate wrapper type ! ** (java.lang.Integer for int, etc., etc.).

        ! ** ! ** If the old or new values are unknown (although why ! ** that would be I do not know), they may be null.

        ! ** ! ** Right now Sun put in a propagationId, reserved for ! ** future use. Read the comments on the constructor ! ** and on setPropagationId for more information. ! ** ! ** @author John Keiser ! ** @since JDK1.1 ! ** @version 1.1.0, 29 Jul 1998 ! **/ ! public class PropertyChangeEvent extends java.util.EventObject { ! String propertyName; ! Object oldValue; ! Object newValue; ! Object propagationId; ! private static final long serialVersionUID = 7042693688939648123L; ! /** Create a new PropertyChangeEvent. Remember that if ! ** you received a PropertyChangeEvent and are sending ! ** a new one, you should also set the propagation ID ! ** from the old PropertyChangeEvent. ! ** @param source the Bean containing the property. ! ** @param propertyName the property's name. ! ** @param oldValue the old value of the property. ! ** @param newValue the new value of the property. ! **/ ! public PropertyChangeEvent(Object source, String propertyName, Object oldVal, Object newVal) { ! super(source); ! this.propertyName = propertyName; ! oldValue = oldVal; ! newValue = newVal; ! } ! /** Get the property name. ! ** @return the property name. ! **/ ! public String getPropertyName() { ! return propertyName; ! } ! /** Get the property's old value. ! ** @return the property's old value. ! **/ ! public Object getOldValue() { ! return oldValue; ! } ! /** Get the property's new value. ! ** @return the property's new value. ! **/ ! public Object getNewValue() { ! return newValue; ! } ! /** Set the propagation ID. This is a way for the event ! ** to be passed from hand to hand and retain a little ! ** extra state. Right now it is unused, but it should ! ** be propagated anyway so that future versions of ! ** JavaBeans can use it, for God knows what. ! ** @param propagationId the propagation ID. ! **/ ! public void setPropagationId(Object propagationId) { ! this.propagationId = propagationId; ! } ! /** Get the propagation ID. ! ** @return the propagation ID. ! **/ ! public Object getPropagationId() { ! return propagationId; ! } ! } --- 38,189 ---- package java.beans; + import java.util.EventObject; + /** ! * PropertyChangeEvents are fired in the PropertyChange and VetoableChange ! * event classes. They represent the old and new values as well as the ! * source Bean. If the old or new value is a primitive type, it must be ! * wrapped in the appropriate wrapper type (java.lang.Integer for int, etc., ! * etc.). ! * ! *

        If the old or new values are unknown (although why that would be I do ! * not know), they may be null. Also, if the set of properties itself has ! * changed, the name should be null, and the old and new values may also be ! * null. Right now Sun put in a propagationId, reserved for future use. Read ! * the comments on the constructor and on setPropagationId for more ! * information. ! * ! * @author John Keiser ! * @author Eric Blake ! * @since 1.1 ! * @status udpated to 1.4 ! */ ! public class PropertyChangeEvent extends EventObject ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 7042693688939648123L; ! /** ! * The name of the property that changed, may be null. Package visible for ! * use by PropertyChangeSupport. ! * ! * @serial the changed property name ! */ ! final String propertyName; ! /** ! * The new value of the property, may be null. Package visible for use by ! * PropertyChangeSupport. ! * ! * @serial the new property value ! */ ! final Object newValue; ! /** ! * The old value of the property, may be null. Package visible for use by ! * PropertyChangeSupport. ! * ! * @serial the old property value ! */ ! final Object oldValue; ! /** ! * The propagation ID, reserved for future use. May be null. ! * ! * @see #getPropagationId() ! * @serial the Propagation ID ! */ ! private Object propagationId; ! /** ! * Create a new PropertyChangeEvent. Remember that if you received a ! * PropertyChangeEvent and are sending a new one, you should also set the ! * propagation ID from the old PropertyChangeEvent. ! * ! * @param source the Bean containing the property ! * @param propertyName the property's name ! * @param oldValue the old value of the property ! * @param newValue the new value of the property ! * @throws IllegalArgumentException if source is null ! */ ! public PropertyChangeEvent(Object source, String propertyName, ! Object oldVal, Object newVal) ! { ! super(source); ! this.propertyName = propertyName; ! oldValue = oldVal; ! newValue = newVal; ! } ! /** ! * Get the property name. May be null if multiple properties changed. ! * ! * @return the property name ! */ ! public String getPropertyName() ! { ! return propertyName; ! } ! /** ! * Get the property's new value. May be null if multiple properties changed. ! * ! * @return the property's new value ! */ ! public Object getNewValue() ! { ! return newValue; ! } ! /** ! * Get the property's old value. May be null if multiple properties changed. ! * ! * @return the property's old value ! */ ! public Object getOldValue() ! { ! return oldValue; ! } ! ! /** ! * Set the propagation ID. This is a way for the event to be passed from ! * hand to hand and retain a little extra state. Right now it is unused, ! * but it should be propagated anyway so that future versions of JavaBeans ! * can use it, for God knows what. ! * ! * @param propagationId the propagation ID ! * @see #getPropagationId() ! */ ! public void setPropagationId(Object propagationId) ! { ! this.propagationId = propagationId; ! } ! ! /** ! * Get the propagation ID. Right now, it is not used for anything. ! * ! * @return the propagation ID ! * @see #setPropagationId(Object) ! */ ! public Object getPropagationId() ! { ! return propagationId; ! } ! ! /** ! * Utility method to rollback a change. ! * ! * @param event the event to rollback ! * @return a new event with old and new swapped ! */ ! PropertyChangeEvent rollback() ! { ! PropertyChangeEvent result ! = new PropertyChangeEvent(source, propertyName, newValue, oldValue); ! result.propagationId = propagationId; ! return result; ! } ! } // class PropertyChangeEvent diff -Nrc3pad gcc-3.2.3/libjava/java/beans/PropertyChangeListener.java gcc-3.3/libjava/java/beans/PropertyChangeListener.java *** gcc-3.2.3/libjava/java/beans/PropertyChangeListener.java 2002-01-22 22:40:11.000000000 +0000 --- gcc-3.3/libjava/java/beans/PropertyChangeListener.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 1,5 **** ! /* java.beans.PropertyChangeListener ! Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PropertyChangeListener.java -- listen for changes in a bound property ! Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.beans; *** 41,62 **** import java.util.EventListener; /** ! ** PropertyChangeListener allows a class to monitor ! ** properties of a Bean for changes.

        ! ** ! ** A propertyChange() event will only be fired ! ** after the property has changed. ! ** ! ** @author John Keiser ! ** @since JDK1.1 ! ** @version 1.1.0, 29 Jul 1998 ! ** @see java.beans.PropertyChangeSupport ! **/ ! public interface PropertyChangeListener extends EventListener { ! /** Fired after a Bean's property has changed. ! ** @param e the change (containing the old and new values) ! **/ ! public abstract void propertyChange(PropertyChangeEvent e); ! } --- 41,61 ---- import java.util.EventListener; /** ! * PropertyChangeListener allows a class to monitor properties of a Bean for ! * changes. A propertyChange() event will only be fired after the ! * property has changed. ! * ! * @author John Keiser ! * @see PropertyChangeSupport ! * @since 1.1 ! * @status updated to 1.4 ! */ public interface PropertyChangeListener extends EventListener { ! /** ! * Fired after a Bean's property has changed. ! * ! * @param e the change (containing the old and new values) ! */ ! void propertyChange(PropertyChangeEvent e); ! } // interface PropertyChangeListener diff -Nrc3pad gcc-3.2.3/libjava/java/beans/PropertyChangeListenerProxy.java gcc-3.3/libjava/java/beans/PropertyChangeListenerProxy.java *** gcc-3.2.3/libjava/java/beans/PropertyChangeListenerProxy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/beans/PropertyChangeListenerProxy.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 0 **** --- 1,102 ---- + /* PropertyChangeListenerProxy.java -- adds a name to a property listener + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.beans; + + import java.util.EventListenerProxy; + + /** + * This class provides an extension to PropertyChangeListener - + * associating a name with the listener. This can be used to filter the + * changes that one is interested in. + * + * @author Eric Blake + * @since 1.4 + * @status udpated to 1.4 + */ + public class PropertyChangeListenerProxy extends EventListenerProxy + implements PropertyChangeListener + { + /** + * The name of the property to listen for. Package visible for use by + * PropertyChangeSupport. + */ + final String propertyName; + + /** + * Create a new proxy which filters property change events and only passes + * changes to the named property on to the delegate. A null propertyName + * or listener does not fail now, but may cause a NullPointerException down + * the road. + * + * @param propertyName the property's name to filter on + * @param listener the delegate listener + */ + public PropertyChangeListenerProxy(String propertyName, + PropertyChangeListener listener) + { + super(listener); + this.propertyName = propertyName; + } + + /** + * Forwards the event on to the delegate if the property name matches. + * + * @param event the event to pass on, if it meets the filter + * @throws NullPointerException if the delegate this was created with is null + */ + public void propertyChange(PropertyChangeEvent event) + { + // Note: Sun does not filter, under the assumption that since + // PropertyChangeSupport unwraps proxys, this method should never be + // called by normal use of listeners. + String name = event == null ? null : event.getPropertyName(); + if (name == null ? propertyName == null : name.equals(propertyName)) + ((PropertyChangeListener) getListener()).propertyChange(event); + } + + /** + * Gets the name of the property this proxy is filtering on. + * + * @return the property name + */ + public String getPropertyName() + { + return propertyName; + } + } // class PropertyChangeListenerProxy diff -Nrc3pad gcc-3.2.3/libjava/java/beans/PropertyChangeSupport.java gcc-3.3/libjava/java/beans/PropertyChangeSupport.java *** gcc-3.2.3/libjava/java/beans/PropertyChangeSupport.java 2002-01-22 22:40:11.000000000 +0000 --- gcc-3.3/libjava/java/beans/PropertyChangeSupport.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 1,5 **** ! /* java.beans.PropertyChangeSupport ! Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PropertyChangeSupport.java -- support to manage property change listeners ! Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,250 **** package java.beans; ! import java.util.Hashtable; ! import java.util.Vector; ! import java.util.Enumeration; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; - import java.io.IOException; import java.io.Serializable; /** ! ** PropertyChangeSupport makes it easy to fire property ! ** change events and handle listeners. ! ** ! ** @author John Keiser ! ** @since JDK1.1 ! ** @version 1.2.0, 15 Mar 1999 ! **/ ! public class PropertyChangeSupport implements java.io.Serializable { ! transient Hashtable propertyListeners = new Hashtable(); ! transient Vector listeners = new Vector(); ! Hashtable children; ! Object source; ! int propertyChangeSupportSerializedDataVersion = 2; ! private static final long serialVersionUID = 6401253773779951803L; ! /** ! * Saves the state of the object to the stream. */ ! private void writeObject(ObjectOutputStream stream) throws IOException { ! children = propertyListeners.isEmpty() ? null : propertyListeners; ! stream.defaultWriteObject(); ! for (Enumeration e = listeners.elements(); e.hasMoreElements(); ) { ! PropertyChangeListener l = (PropertyChangeListener)e.nextElement(); ! if (l instanceof Serializable) ! stream.writeObject(l); ! } ! stream.writeObject(null); ! } ! /** ! * Reads the object back from stream (deserialization). ! */ ! private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { ! stream.defaultReadObject(); ! propertyListeners = (children == null) ? new Hashtable() : children; ! PropertyChangeListener l; ! while ((l = (PropertyChangeListener)stream.readObject()) != null) { ! addPropertyChangeListener(l); ! } ! // FIXME: XXX: There is no spec for JDK 1.1 serialization ! // so it is unclear what to do if the value of ! // propertyChangeSupportSerializedDataVersion is 1. ! } ! /** Create PropertyChangeSupport to work with a specific ! ** source bean. ! ** @param source the source bean to use. ! **/ ! public PropertyChangeSupport(Object source) { ! this.source = source; ! } ! /** Adds a PropertyChangeListener to the list of listeners. ! ** All property change events will be sent to this listener. ! **

        ! ** ! ** The listener add is not unique: that is, n adds with ! ** the same listener will result in n events being sent ! ** to that listener for every property change. ! **

        ! ** ! ** Adding a null listener will cause undefined behavior. ! ** ! ** @param l the listener to add. ! **/ ! public void addPropertyChangeListener(PropertyChangeListener l) { ! listeners.addElement(l); ! } ! /** Adds a PropertyChangeListener listening on the specified property. ! ** Events will be sent to the listener for that particular property. ! **

        ! ** ! ** The listener add is not unique; that is, n adds on a ! ** particular property for a particular listener will result in ! ** n events being sent to that listener when that ! ** property is changed. ! **

        ! ** ! ** The effect is cumulative, too; if you are registered to listen ! ** to receive events on all property changes, and then you ! ** register on a particular property, you will receive change ! ** events for that property twice. ! **

        ! ** ! ** Adding a null listener will cause undefined behavior. ! ** ! ** @param propertyName the name of the property to listen on. ! ** @param l the listener to add. ! **/ ! public void addPropertyChangeListener(String propertyName, PropertyChangeListener l) { ! synchronized(propertyListeners) { ! Vector v = (Vector)propertyListeners.get(propertyName); ! try { ! v.addElement(l); ! } catch(NullPointerException e) { ! /* If v is not found, create a new vector. */ ! v = new Vector(); ! v.addElement(l); ! propertyListeners.put(propertyName, v); ! } ! } ! } ! /** Removes a PropertyChangeListener from the list of listeners. ! ** If any specific properties are being listened on, they must ! ** be deregistered by themselves; this will only remove the ! ** general listener to all properties. ! **

        ! ** ! ** If add() has been called multiple times for a ! ** particular listener, remove() will have to be ! ** called the same number of times to deregister it. ! ** ! ** @param l the listener to remove. ! **/ ! public void removePropertyChangeListener(PropertyChangeListener l) { ! listeners.removeElement(l); ! } ! /** Removes a PropertyChangeListener from listening to a specific property. ! **

        ! ** ! ** If add() has been called multiple times for a ! ** particular listener on a property, remove() will ! ** have to be called the same number of times to deregister it. ! ** ! ** @param propertyName the property to stop listening on. ! ** @param l the listener to remove. ! **/ ! public void removePropertyChangeListener(String propertyName, PropertyChangeListener l) { ! synchronized(propertyListeners) { ! Vector v = (Vector)propertyListeners.get(propertyName); ! try { ! v.removeElement(l); ! if(v.size() == 0) { ! propertyListeners.remove(propertyName); ! } ! } catch(NullPointerException e) { ! /* if v is not found, do nothing. */ ! } ! } ! } ! /** Fire a PropertyChangeEvent to all the listeners. ! ** ! ** @param event the event to fire. ! **/ ! public void firePropertyChange(PropertyChangeEvent event) { ! for(int i=0;itrue if there are listeners ! ** on all properties or if there is a listener specifically on this ! ** property. ! ** ! ** @param propertyName the property that may be listened on ! ** @return whether the property is being listened on ! **/ ! public boolean hasListeners(String propertyName) { ! return listeners.size() > 0 || propertyListeners.get(propertyName) != null; ! } ! } --- 37,488 ---- package java.beans; ! ! import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Hashtable; + import java.util.Iterator; + import java.util.Map.Entry; + import java.util.Vector; /** ! * PropertyChangeSupport makes it easy to fire property change events and ! * handle listeners. It allows chaining of listeners, as well as filtering ! * by property name. In addition, it will serialize only those listeners ! * which are serializable, ignoring the others without problem. This class ! * is thread-safe. ! * ! * @author John Keiser ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class PropertyChangeSupport implements Serializable ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 6401253773779951803L; ! /** ! * Maps property names (String) to named listeners (PropertyChangeSupport). ! * If this is a child instance, this field will be null. ! * ! * @serial the map of property names to named listener managers ! * @since 1.2 ! */ ! private Hashtable children; ! /** ! * The non-null source object for any generated events. ! * ! * @serial the event source ! */ ! private final Object source; ! /** ! * A field to compare serialization versions - this class uses version 2. ! * ! * @serial the serialization format ! */ ! private final int propertyChangeSupportSerializedDataVersion = 2; ! /** ! * The list of all registered property listeners. If this instance was ! * created by user code, this only holds the global listeners (ie. not tied ! * to a name), and may be null. If it was created by this class, as a ! * helper for named properties, then this vector will be non-null, and this ! * instance appears as a value in the children hashtable of ! * another instance, so that the listeners are tied to the key of that ! * hashtable entry. ! */ ! private transient Vector listeners; ! /** ! * Create a PropertyChangeSupport to work with a specific source bean. ! * ! * @param source the source bean to use ! * @throws NullPointerException if source is null ! */ ! public PropertyChangeSupport(Object source) ! { ! this.source = source; ! if (source == null) ! throw new NullPointerException(); ! } ! /** ! * Adds a PropertyChangeListener to the list of global listeners. All ! * property change events will be sent to this listener. The listener add ! * is not unique: that is, n adds with the same listener will ! * result in n events being sent to that listener for every ! * property change. Adding a null listener may cause a NullPointerException ! * down the road. This method will unwrap a PropertyChangeListenerProxy, ! * registering the underlying delegate to the named property list. ! * ! * @param l the listener to add ! */ ! public synchronized void addPropertyChangeListener(PropertyChangeListener l) ! { ! if (l instanceof PropertyChangeListenerProxy) ! { ! PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l; ! addPropertyChangeListener(p.propertyName, ! (PropertyChangeListener) p.getListener()); ! } ! else ! { ! if (listeners == null) ! listeners = new Vector(); ! listeners.add(l); ! } ! } ! /** ! * Removes a PropertyChangeListener from the list of global listeners. If ! * any specific properties are being listened on, they must be deregistered ! * by themselves; this will only remove the general listener to all ! * properties. If add() has been called multiple times for a ! * particular listener, remove() will have to be called the ! * same number of times to deregister it. This method will unwrap a ! * PropertyChangeListenerProxy, removing the underlying delegate from the ! * named property list. ! * ! * @param l the listener to remove ! */ ! public synchronized void ! removePropertyChangeListener(PropertyChangeListener l) ! { ! if (l instanceof PropertyChangeListenerProxy) ! { ! PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l; ! removePropertyChangeListener(p.propertyName, ! (PropertyChangeListener) p.getListener()); ! } ! else if (listeners != null) ! { ! listeners.remove(l); ! if (listeners.isEmpty()) ! listeners = null; ! } ! } ! /** ! * Returns an array of all registered property change listeners. Those that ! * were registered under a name will be wrapped in a ! * PropertyChangeListenerProxy, so you must check whether the ! * listener is an instance of the proxy class in order to see what name the ! * real listener is registered under. If there are no registered listeners, ! * this returns an empty array. ! * ! * @return the array of registered listeners ! * @see PropertyChangeListenerProxy ! * @since 1.4 ! */ ! public synchronized PropertyChangeListener[] getPropertyChangeListeners() ! { ! ArrayList list = new ArrayList(); ! if (listeners != null) ! list.addAll(listeners); ! if (children != null) ! { ! int i = children.size(); ! Iterator iter = children.entrySet().iterator(); ! while (--i >= 0) ! { ! Entry e = (Entry) iter.next(); ! String name = (String) e.getKey(); ! Vector v = ((PropertyChangeSupport) e.getValue()).listeners; ! int j = v.size(); ! while (--j >= 0) ! list.add(new PropertyChangeListenerProxy ! (name, (PropertyChangeListener) v.get(j))); ! } ! } ! return (PropertyChangeListener[]) ! list.toArray(new PropertyChangeListener[list.size()]); ! } ! /** ! * Adds a PropertyChangeListener listening on the specified property. Events ! * will be sent to the listener only if the property name matches. The ! * listener add is not unique; that is, n adds on a particular ! * property for a particular listener will result in n events ! * being sent to that listener when that property is changed. The effect is ! * cumulative, too; if you are registered to listen to receive events on ! * all property changes, and then you register on a particular property, ! * you will receive change events for that property twice. Adding a null ! * listener may cause a NullPointerException down the road. This method ! * will unwrap a PropertyChangeListenerProxy, registering the underlying ! * delegate to the named property list if the names match, and discarding ! * it otherwise. ! * ! * @param propertyName the name of the property to listen on ! * @param l the listener to add ! * @throws NullPointerException if propertyName is null ! */ ! public synchronized void addPropertyChangeListener(String propertyName, ! PropertyChangeListener l) ! { ! while (l instanceof PropertyChangeListenerProxy) ! { ! PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l; ! if (propertyName == null ? p.propertyName != null ! : ! propertyName.equals(p.propertyName)) ! return; ! l = (PropertyChangeListener) p.getListener(); ! } ! PropertyChangeSupport s = null; ! if (children == null) ! children = new Hashtable(); ! else ! s = (PropertyChangeSupport) children.get(propertyName); ! if (s == null) ! { ! s = new PropertyChangeSupport(source); ! s.listeners = new Vector(); ! children.put(propertyName, s); ! } ! s.listeners.add(l); ! } ! /** ! * Removes a PropertyChangeListener from listening to a specific property. ! * If add() has been called multiple times for a particular ! * listener on a property, remove() will have to be called the ! * same number of times to deregister it. This method will unwrap a ! * PropertyChangeListenerProxy, removing the underlying delegate from the ! * named property list if the names match. ! * ! * @param propertyName the property to stop listening on ! * @param l the listener to remove ! * @throws NullPointerException if propertyName is null ! */ ! public synchronized void ! removePropertyChangeListener(String propertyName, PropertyChangeListener l) ! { ! if (children == null) ! return; ! PropertyChangeSupport s ! = (PropertyChangeSupport) children.get(propertyName); ! if (s == null) ! return; ! while (l instanceof PropertyChangeListenerProxy) ! { ! PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l; ! if (propertyName == null ? p.propertyName != null ! : ! propertyName.equals(p.propertyName)) ! return; ! l = (PropertyChangeListener) p.getListener(); ! } ! s.listeners.remove(l); ! if (s.listeners.isEmpty()) ! { ! children.remove(propertyName); ! if (children.isEmpty()) ! children = null; ! } ! } ! /** ! * Returns an array of all property change listeners registered under the ! * given property name. If there are no registered listeners, this returns ! * an empty array. ! * ! * @return the array of registered listeners ! * @throws NullPointerException if propertyName is null ! * @since 1.4 ! */ ! public synchronized PropertyChangeListener[] ! getPropertyChangeListeners(String propertyName) ! { ! if (children == null) ! return new PropertyChangeListener[0]; ! PropertyChangeSupport s ! = (PropertyChangeSupport) children.get(propertyName); ! if (s == null) ! return new PropertyChangeListener[0]; ! return (PropertyChangeListener[]) ! s.listeners.toArray(new PropertyChangeListener[s.listeners.size()]); ! } ! /** ! * Fire a PropertyChangeEvent containing the old and new values of the ! * property to all the global listeners, and to all the listeners for the ! * specified property name. This does nothing if old and new are non-null ! * and equal. ! * ! * @param propertyName the name of the property that changed ! * @param oldVal the old value ! * @param newVal the new value ! */ ! public void firePropertyChange(String propertyName, ! Object oldVal, Object newVal) ! { ! firePropertyChange(new PropertyChangeEvent(source, propertyName, ! oldVal, newVal)); ! } ! /** ! * Fire a PropertyChangeEvent containing the old and new values of the ! * property to all the global listeners, and to all the listeners for the ! * specified property name. This does nothing if old and new are equal. ! * ! * @param propertyName the name of the property that changed ! * @param oldVal the old value ! * @param newVal the new value ! */ ! public void firePropertyChange(String propertyName, int oldVal, int newVal) ! { ! if (oldVal != newVal) ! firePropertyChange(new PropertyChangeEvent(source, propertyName, ! new Integer(oldVal), ! new Integer(newVal))); ! } ! ! /** ! * Fire a PropertyChangeEvent containing the old and new values of the ! * property to all the global listeners, and to all the listeners for the ! * specified property name. This does nothing if old and new are equal. ! * ! * @param propertyName the name of the property that changed ! * @param oldVal the old value ! * @param newVal the new value ! */ ! public void firePropertyChange(String propertyName, ! boolean oldVal, boolean newVal) ! { ! if (oldVal != newVal) ! firePropertyChange(new PropertyChangeEvent(source, propertyName, ! Boolean.valueOf(oldVal), ! Boolean.valueOf(newVal))); ! } ! ! /** ! * Fire a PropertyChangeEvent to all the global listeners, and to all the ! * listeners for the specified property name. This does nothing if old and ! * new values of the event are equal. ! * ! * @param event the event to fire ! * @throws NullPointerException if event is null ! */ ! public void firePropertyChange(PropertyChangeEvent event) ! { ! if (event.oldValue != null && event.oldValue.equals(event.newValue)) ! return; ! Vector v = listeners; // Be thread-safe. ! if (v != null) ! { ! int i = v.size(); ! while (--i >= 0) ! ((PropertyChangeListener) v.get(i)).propertyChange(event); ! } ! Hashtable h = children; // Be thread-safe. ! if (h != null && event.propertyName != null) ! { ! PropertyChangeSupport s ! = (PropertyChangeSupport) h.get(event.propertyName); ! if (s != null) ! { ! v = s.listeners; // Be thread-safe. ! int i = v == null ? 0 : v.size(); ! while (--i >= 0) ! ((PropertyChangeListener) v.get(i)).propertyChange(event); ! } ! } ! } ! ! /** ! * Tell whether the specified property is being listened on or not. This ! * will only return true if there are listeners on all ! * properties or if there is a listener specifically on this property. ! * ! * @param propertyName the property that may be listened on ! * @return whether the property is being listened on ! * @throws NullPointerException if propertyName is null ! */ ! public synchronized boolean hasListeners(String propertyName) ! { ! return listeners != null || (children != null ! && children.get(propertyName) != null); ! } ! ! /** ! * Saves the state of the object to the stream. ! * ! * @param s the stream to write to ! * @throws IOException if anything goes wrong ! * @serialData this writes out a null-terminated list of serializable ! * global property change listeners (the listeners for a named ! * property are written out as the global listeners of the ! * children, when the children hashtable is saved) ! */ ! private synchronized void writeObject(ObjectOutputStream s) ! throws IOException ! { ! s.defaultWriteObject(); ! if (listeners != null) ! { ! int i = listeners.size(); ! while (--i >= 0) ! if (listeners.get(i) instanceof Serializable) ! s.writeObject(listeners.get(i)); ! } ! s.writeObject(null); ! } ! ! /** ! * Reads the object back from stream (deserialization). ! * ! * XXX Since serialization for 1.1 streams was not documented, this may ! * not work if propertyChangeSupportSerializedDataVersion is 1. ! * ! * @param s the stream to read from ! * @throws IOException if reading the stream fails ! * @throws ClassNotFoundException if deserialization fails ! * @serialData this reads in a null-terminated list of serializable ! * global property change listeners (the listeners for a named ! * property are written out as the global listeners of the ! * children, when the children hashtable is saved) ! */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException ! { ! s.defaultReadObject(); ! PropertyChangeListener l = (PropertyChangeListener) s.readObject(); ! while (l != null) ! { ! addPropertyChangeListener(l); ! l = (PropertyChangeListener) s.readObject(); ! } ! // Sun is not as careful with children as we are, and lets some proxys ! // in that can never receive events. So, we clean up anything that got ! // serialized, to make sure our invariants hold. ! if (children != null) ! { ! int i = children.size(); ! Iterator iter = children.entrySet().iterator(); ! while (--i >= 0) ! { ! Entry e = (Entry) iter.next(); ! String name = (String) e.getKey(); ! PropertyChangeSupport pcs = (PropertyChangeSupport) e.getValue(); ! if (pcs.listeners == null) ! pcs.listeners = new Vector(); ! if (pcs.children != null) ! pcs.listeners.addAll ! (Arrays.asList(pcs.getPropertyChangeListeners(name))); ! if (pcs.listeners.size() == 0) ! iter.remove(); ! else ! pcs.children = null; ! } ! if (children.size() == 0) ! children = null; ! } ! } ! } // class PropertyChangeSupport diff -Nrc3pad gcc-3.2.3/libjava/java/beans/PropertyDescriptor.java gcc-3.3/libjava/java/beans/PropertyDescriptor.java *** gcc-3.2.3/libjava/java/beans/PropertyDescriptor.java 2002-01-22 22:40:11.000000000 +0000 --- gcc-3.3/libjava/java/beans/PropertyDescriptor.java 2003-02-07 20:22:16.000000000 +0000 *************** import java.lang.reflect.*; *** 65,344 **** **/ public class PropertyDescriptor extends FeatureDescriptor { ! Class propertyType; ! Method getMethod; ! Method setMethod; ! ! Class propertyEditorClass; ! boolean bound; ! boolean constrained; ! ! PropertyDescriptor(String name) { ! setName(name); ! } ! ! /** Create a new PropertyDescriptor by introspection. ! ** This form of constructor creates the PropertyDescriptor by ! ** looking for a getter method named get<name>() ! ** (or, optionally, if the property is boolean, ! ** is<name>()) and ! ** set<name>() in class ! ** <beanClass>, where <name> has its ! ** first letter capitalized by the constructor.

        ! ** ! ** Implementation note: If there is a get method (or ! ** boolean isXXX() method), then the return type of that method ! ** is used to find the set method. If there is no get method, ! ** then the set method is searched for exhaustively.

        ! ** ! ** Spec note: ! ** If there is no get method and multiple set methods with ! ** the same name and a single parameter (different type of course), ! ** then an IntrospectionException is thrown. While Sun's spec ! ** does not state this, it can make Bean behavior different on ! ** different systems (since method order is not guaranteed) and as ! ** such, can be treated as a bug in the spec. I am not aware of ! ** whether Sun's implementation catches this. ! ** ! ** @param name the programmatic name of the property, usually ! ** starting with a lowercase letter (e.g. fooManChu ! ** instead of FooManChu). ! ** @param beanClass the class the get and set methods live in. ! ** @exception IntrospectionException if the methods are not found or invalid. ! **/ ! public PropertyDescriptor(String name, Class beanClass) throws IntrospectionException { ! setName(name); ! String capitalized; ! try { ! capitalized = Character.toUpperCase(name.charAt(0)) + name.substring(1); ! } catch(StringIndexOutOfBoundsException e) { ! capitalized = ""; ! } ! findMethods(beanClass, "is" + capitalized, "get" + capitalized, "set" + capitalized); ! } ! ! /** Create a new PropertyDescriptor by introspection. ! ** This form of constructor allows you to specify the ! ** names of the get and set methods to search for.

        ! ** ! ** Implementation note: If there is a get method (or ! ** boolean isXXX() method), then the return type of that method ! ** is used to find the set method. If there is no get method, ! ** then the set method is searched for exhaustively.

        ! ** ! ** Spec note: ! ** If there is no get method and multiple set methods with ! ** the same name and a single parameter (different type of course), ! ** then an IntrospectionException is thrown. While Sun's spec ! ** does not state this, it can make Bean behavior different on ! ** different systems (since method order is not guaranteed) and as ! ** such, can be treated as a bug in the spec. I am not aware of ! ** whether Sun's implementation catches this. ! ** ! ** @param name the programmatic name of the property, usually ! ** starting with a lowercase letter (e.g. fooManChu ! ** instead of FooManChu). ! ** @param beanClass the class the get and set methods live in. ! ** @param getMethodName the name of the get method. ! ** @param setMethodName the name of the set method. ! ** @exception IntrospectionException if the methods are not found or invalid. ! **/ ! public PropertyDescriptor(String name, Class beanClass, String getMethodName, String setMethodName) throws IntrospectionException { ! setName(name); ! findMethods(beanClass, getMethodName, null, setMethodName); ! } ! ! /** Create a new PropertyDescriptor using explicit Methods. ! ** Note that the methods will be checked for conformance to standard ! ** Property method rules, as described above at the top of this class. ! ** ! ** @param name the programmatic name of the property, usually ! ** starting with a lowercase letter (e.g. fooManChu ! ** instead of FooManChu). ! ** @param getMethod the get method. ! ** @param setMethod the set method. ! ** @exception IntrospectionException if the methods are not found or invalid. ! **/ ! public PropertyDescriptor(String name, Method getMethod, Method setMethod) throws IntrospectionException { ! setName(name); ! if(getMethod != null && getMethod.getParameterTypes().length > 0) { ! throw new IntrospectionException("get method has parameters"); ! } ! if(setMethod != null && setMethod.getParameterTypes().length != 1) { ! throw new IntrospectionException("set method does not have exactly one parameter"); ! } ! if(getMethod != null && setMethod != null) { ! if(!getMethod.getReturnType().equals(setMethod.getParameterTypes()[0])) { ! throw new IntrospectionException("set and get methods do not share the same type"); ! } ! if(!getMethod.getDeclaringClass().isAssignableFrom(setMethod.getDeclaringClass()) ! && !setMethod.getDeclaringClass().isAssignableFrom(getMethod.getDeclaringClass())) { ! throw new IntrospectionException("set and get methods are not in the same class."); ! } ! } ! this.getMethod = getMethod; ! this.setMethod = setMethod; ! if(getMethod != null) { ! this.propertyType = getMethod.getReturnType(); ! } else { ! this.propertyType = setMethod.getParameterTypes()[0]; ! } ! } ! ! /** Get the property type. ! ** This is the type the get method returns and the set method ! ** takes in. ! **/ ! public Class getPropertyType() { ! return propertyType; ! } ! ! /** Get the get method. Why they call it readMethod here and ! ** get everywhere else is beyond me. ! **/ ! public Method getReadMethod() { ! return getMethod; ! } ! ! /** Get the set method. Why they call it writeMethod here and ! ** set everywhere else is beyond me. ! **/ ! public Method getWriteMethod() { ! return setMethod; ! } ! ! /** Get whether the property is bound. Defaults to false. **/ ! public boolean isBound() { ! return bound; ! } ! ! /** Set whether the property is bound. ! ** As long as the the bean implements addPropertyChangeListener() and ! ** removePropertyChangeListener(), setBound(true) may safely be called.

        ! ** If these things are not true, then the behavior of the system ! ** will be undefined.

        ! ** ! ** When a property is bound, its set method is required to fire the ! ** PropertyChangeListener.propertyChange()) event ! ** after the value has changed. ! ** @param bound whether the property is bound or not. ! **/ ! public void setBound(boolean bound) { ! this.bound = bound; } ! /** Get whether the property is constrained. Defaults to false. **/ ! public boolean isConstrained() { ! return constrained; } ! /** Set whether the property is constrained. ! ** If the set method throws java.beans.PropertyVetoException ! ** (or subclass thereof) and the bean implements addVetoableChangeListener() ! ** and removeVetoableChangeListener(), then setConstrained(true) may safely ! ** be called. Otherwise, the system behavior is undefined. ! ** Spec note: given those strict parameters, it would be nice if it ! ** got set automatically by detection, but oh well.

        ! ** When a property is constrained, its set method is required to:

        ! **

          ! **
        1. Fire the VetoableChangeListener.vetoableChange() ! ** event notifying others of the change and allowing them a chance to ! ** say it is a bad thing.
        2. ! **
        3. If any of the listeners throws a PropertyVetoException, then ! ** it must fire another vetoableChange() event notifying the others ! ** of a reversion to the old value (though, of course, the change ! ** was never made). Then it rethrows the PropertyVetoException and ! ** exits.
        4. ! **
        5. If all has gone well to this point, the value may be changed.
        6. ! **
        ! ** @param constrained whether the property is constrained or not. ! **/ ! public void setConstrained(boolean constrained) { ! this.constrained = constrained; } ! ! /** Get the PropertyEditor class. Defaults to null. **/ ! public Class getPropertyEditorClass() { ! return propertyEditorClass; } ! /** Set the PropertyEditor class. If the class does not implement ! ** the PropertyEditor interface, you will likely get an exception ! ** late in the game. ! ** @param propertyEditorClass the PropertyEditor class for this class to use. ! **/ ! public void setPropertyEditorClass(Class propertyEditorClass) { ! this.propertyEditorClass = propertyEditorClass; } ! ! private void findMethods(Class beanClass, String getMethodName1, String getMethodName2, String setMethodName) throws IntrospectionException { ! try { ! if(getMethodName1 != null) { ! try { ! getMethod = beanClass.getMethod(getMethodName1, new Class[0]); ! } catch(NoSuchMethodException E) { ! } ! if(getMethodName2 != null) { ! if(getMethod != null && !getMethod.getReturnType().equals(java.lang.Boolean.TYPE)) { ! // If the is() method exists but isn't boolean, we'll just go on and look for ! // an ordinary get() method. ! getMethod = null; ! } ! ! Method getMethod2; ! try { ! getMethod2 = beanClass.getMethod(getMethodName2, new Class[0]); ! } catch(NoSuchMethodException E) { ! getMethod2 = null; ! } ! if(getMethod2 != null) { ! if(getMethod != null) { ! if(!getMethod.getReturnType().equals(getMethod2.getReturnType())) { ! throw new IntrospectionException("Both " + getMethodName1 + " and " + getMethodName2 + " exist, and have contradictory return types."); ! } ! } else { ! getMethod = getMethod2; ! } ! } ! } ! } ! ! if(getMethod != null) { ! propertyType = getMethod.getReturnType(); ! if(setMethodName != null) { ! Class[] setArgs = new Class[1]; ! setArgs[0] = propertyType; ! try { ! setMethod = beanClass.getMethod(setMethodName, setArgs); ! if(!setMethod.getReturnType().equals(java.lang.Void.TYPE)) { ! throw new IntrospectionException(setMethodName + " has non-void return type"); ! } ! } catch(NoSuchMethodException E) { ! } ! } ! } else if(setMethodName != null) { ! Method[] m = beanClass.getMethods(); ! for(int i=0;iget<name>() ! ** (or, optionally, if the property is boolean, ! ** is<name>()) and ! ** set<name>() in class ! ** <beanClass>, where <name> has its ! ** first letter capitalized by the constructor.

        ! ** ! ** Implementation note: If there is both are both isXXX and ! ** getXXX methods, the former is used in preference to the latter. ! ** We do not check that an isXXX method returns a boolean. In both ! ** cases, this matches the behaviour of JDK 1.4

        ! ** ! ** @param name the programmatic name of the property, usually ! ** starting with a lowercase letter (e.g. fooManChu ! ** instead of FooManChu). ! ** @param beanClass the class the get and set methods live in. ! ** @exception IntrospectionException if the methods are not found ! ** or invalid. ! **/ ! public PropertyDescriptor(String name, Class beanClass) ! throws IntrospectionException ! { ! setName(name); ! if (name.length() == 0) { ! throw new IntrospectionException("empty property name"); ! } ! String caps = Character.toUpperCase(name.charAt(0)) + name.substring(1); ! findMethods(beanClass, "is" + caps, "get" + caps, "set" + caps); ! if (getMethod == null) { ! throw new IntrospectionException("Cannot find an is" + caps + ! " or get" + caps + " method"); ! } ! if (setMethod == null) { ! throw new IntrospectionException("Cannot find a " + caps + " method"); ! } ! checkMethods(); ! } ! ! /** Create a new PropertyDescriptor by introspection. ! ** This form of constructor allows you to specify the ! ** names of the get and set methods to search for.

        ! ** ! ** Implementation note: If there is a get method (or ! ** boolean isXXX() method), then the return type of that method ! ** is used to find the set method. If there is no get method, ! ** then the set method is searched for exhaustively.

        ! ** ! ** Spec note: ! ** If there is no get method and multiple set methods with ! ** the same name and a single parameter (different type of course), ! ** then an IntrospectionException is thrown. While Sun's spec ! ** does not state this, it can make Bean behavior different on ! ** different systems (since method order is not guaranteed) and as ! ** such, can be treated as a bug in the spec. I am not aware of ! ** whether Sun's implementation catches this. ! ** ! ** @param name the programmatic name of the property, usually ! ** starting with a lowercase letter (e.g. fooManChu ! ** instead of FooManChu). ! ** @param beanClass the class the get and set methods live in. ! ** @param getMethodName the name of the get method. ! ** @param setMethodName the name of the set method. ! ** @exception IntrospectionException if the methods are not found ! ** or invalid. ! **/ ! public PropertyDescriptor(String name, Class beanClass, ! String getMethodName, String setMethodName) ! throws IntrospectionException ! { ! setName(name); ! findMethods(beanClass, getMethodName, null, setMethodName); ! if (getMethod == null && getMethodName != null) { ! throw new IntrospectionException("Cannot find a getter method called " + ! getMethodName); ! } ! if (setMethod == null && setMethodName != null) { ! throw new IntrospectionException("Cannot find a setter method called " + ! setMethodName); ! } ! checkMethods(); ! } ! ! /** Create a new PropertyDescriptor using explicit Methods. ! ** Note that the methods will be checked for conformance to standard ! ** Property method rules, as described above at the top of this class. ! ** ! ** @param name the programmatic name of the property, usually ! ** starting with a lowercase letter (e.g. fooManChu ! ** instead of FooManChu). ! ** @param getMethod the get method. ! ** @param setMethod the set method. ! ** @exception IntrospectionException if the methods are not found ! ** or invalid. ! **/ ! public PropertyDescriptor(String name, Method getMethod, Method setMethod) ! throws IntrospectionException ! { ! setName(name); ! this.getMethod = getMethod; ! this.setMethod = setMethod; ! if (getMethod != null) { ! this.propertyType = getMethod.getReturnType(); ! } ! else if (setMethod != null) { ! this.propertyType = setMethod.getParameterTypes()[0]; ! } ! checkMethods(); ! } ! ! /** Get the property type. ! ** This is the type the get method returns and the set method ! ** takes in. ! **/ ! public Class getPropertyType() { ! return propertyType; ! } ! ! /** Get the get method. Why they call it readMethod here and ! ** get everywhere else is beyond me. ! **/ ! public Method getReadMethod() { ! return getMethod; ! } ! ! /** Get the set method. Why they call it writeMethod here and ! ** set everywhere else is beyond me. ! **/ ! public Method getWriteMethod() { ! return setMethod; ! } ! ! /** Get whether the property is bound. Defaults to false. **/ ! public boolean isBound() { ! return bound; ! } ! ! /** Set whether the property is bound. ! ** As long as the the bean implements addPropertyChangeListener() and ! ** removePropertyChangeListener(), setBound(true) may safely be called.

        ! ** If these things are not true, then the behavior of the system ! ** will be undefined.

        ! ** ! ** When a property is bound, its set method is required to fire the ! ** PropertyChangeListener.propertyChange()) event ! ** after the value has changed. ! ** @param bound whether the property is bound or not. ! **/ ! public void setBound(boolean bound) { ! this.bound = bound; ! } ! ! /** Get whether the property is constrained. Defaults to false. **/ ! public boolean isConstrained() { ! return constrained; ! } ! ! /** Set whether the property is constrained. ! ** If the set method throws java.beans.PropertyVetoException ! ** (or subclass thereof) and the bean implements addVetoableChangeListener() ! ** and removeVetoableChangeListener(), then setConstrained(true) may safely ! ** be called. Otherwise, the system behavior is undefined. ! ** Spec note: given those strict parameters, it would be nice if it ! ** got set automatically by detection, but oh well.

        ! ** When a property is constrained, its set method is required to:

        ! **

          ! **
        1. Fire the VetoableChangeListener.vetoableChange() ! ** event notifying others of the change and allowing them a chance to ! ** say it is a bad thing.
        2. ! **
        3. If any of the listeners throws a PropertyVetoException, then ! ** it must fire another vetoableChange() event notifying the others ! ** of a reversion to the old value (though, of course, the change ! ** was never made). Then it rethrows the PropertyVetoException and ! ** exits.
        4. ! **
        5. If all has gone well to this point, the value may be changed.
        6. ! **
        ! ** @param constrained whether the property is constrained or not. ! **/ ! public void setConstrained(boolean constrained) { ! this.constrained = constrained; ! } ! ! /** Get the PropertyEditor class. Defaults to null. **/ ! public Class getPropertyEditorClass() { ! return propertyEditorClass; ! } ! ! /** Set the PropertyEditor class. If the class does not implement ! ** the PropertyEditor interface, you will likely get an exception ! ** late in the game. ! ** @param propertyEditorClass the PropertyEditor class for this ! ** class to use. ! **/ ! public void setPropertyEditorClass(Class propertyEditorClass) { ! this.propertyEditorClass = propertyEditorClass; ! } ! ! private void findMethods(Class beanClass, String getMethodName1, ! String getMethodName2, String setMethodName) ! throws IntrospectionException ! { ! try { ! // Try the first get method name ! if (getMethodName1 != null) { ! try { ! getMethod = beanClass.getMethod(getMethodName1, new Class[0]); ! } ! catch (NoSuchMethodException e) { } + } ! // Fall back to the second get method name ! if (getMethod == null && getMethodName2 != null) { ! try { ! getMethod = beanClass.getMethod(getMethodName2, new Class[0]); ! } ! catch (NoSuchMethodException e) { } + } ! // Try the set method name ! if (setMethodName != null) { ! if (getMethod != null) { ! // If there is a get method, use its return type to help ! // select the corresponding set method. ! Class propertyType = getMethod.getReturnType(); ! if (propertyType == Void.TYPE) { ! String msg = "The property's read method has return type 'void'"; ! throw new IntrospectionException(msg); ! } ! ! Class[] setArgs = new Class[]{propertyType}; ! try { ! setMethod = beanClass.getMethod(setMethodName, setArgs); ! } ! catch (NoSuchMethodException e) { ! } } ! else if (getMethodName1 == null && getMethodName2 == null) { ! // If this is a write-only property, choose the first set method ! // with the required name, one parameter and return type 'void' ! Method[] methods = beanClass.getMethods(); ! for (int i = 0; i < methods.length; i++) { ! if (methods[i].getName().equals(setMethodName) && ! methods[i].getParameterTypes().length == 1 && ! methods[i].getReturnType() == Void.TYPE) { ! setMethod = methods[i]; ! break; ! } ! } } + } + } + catch (SecurityException e) { + // FIXME -- shouldn't we just allow SecurityException to propagate? + String msg = "SecurityException thrown on attempt to access methods."; + throw new IntrospectionException(msg); + } + } ! private void checkMethods() ! throws IntrospectionException ! { ! if (getMethod != null) { ! if (getMethod.getParameterTypes().length > 0) { ! throw new IntrospectionException("get method has parameters"); ! } ! this.propertyType = getMethod.getReturnType(); ! if (propertyType == Void.TYPE) { ! throw new IntrospectionException("get method has void return type"); ! } ! } ! if (setMethod != null) { ! if (setMethod.getParameterTypes().length != 1) { ! String msg = "set method does not have exactly one parameter"; ! throw new IntrospectionException(msg); ! } ! if (getMethod == null) { ! propertyType = setMethod.getParameterTypes()[0]; ! } ! else { ! if (!propertyType.equals(setMethod.getParameterTypes()[0])) { ! String msg = "set and get methods do not share the same type"; ! throw new IntrospectionException(msg); } ! if ((!getMethod.getDeclaringClass(). ! isAssignableFrom(setMethod.getDeclaringClass())) && ! (!setMethod.getDeclaringClass(). ! isAssignableFrom(getMethod.getDeclaringClass()))) { ! String msg = "set and get methods are not in the same class."; ! throw new IntrospectionException(msg); } + } + } + } } diff -Nrc3pad gcc-3.2.3/libjava/java/beans/VetoableChangeListener.java gcc-3.3/libjava/java/beans/VetoableChangeListener.java *** gcc-3.2.3/libjava/java/beans/VetoableChangeListener.java 2002-01-22 22:40:11.000000000 +0000 --- gcc-3.3/libjava/java/beans/VetoableChangeListener.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 1,5 **** ! /* java.beans.VetoableChangeListener ! Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* VetoableChangeListener.java -- listen for a change which can be vetoed ! Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.beans; *** 41,77 **** import java.util.EventListener; /** ! ** VetoableChangeListener allows a class to monitor ! ** proposed changes to properties of a Bean and, if ! ** desired, prevent them from occurring.

        ! ** ! ** A vetoableChange() event will be fired before ! ** the property has changed. If any listener rejects the ! ** change by throwing the PropertyChangeException, a new ! ** vetoableChange() event will be fired to all listeners ! ** who received a vetoableChange() event in the first ! ** place informing them of a reversion to the old value. ! ** The value, of course, never actually changed.

        ! ** ! ** Note: This class may not be reliably ! ** used to determine whether a property has actually ! ** changed. Use the PropertyChangeListener interface ! ** for that instead. ! ** ! ** @author John Keiser ! ** @version 1.1.0, 29 Jul 1998 ! ** @since JDK1.1 ! ** @see java.beans.PropertyChangeListener ! ** @see java.beans.VetoableChangeSupport ! **/ ! public interface VetoableChangeListener extends EventListener { ! /** Fired before a Bean's property changes. ! ** @param e the change (containing the old and new values) ! ** @exception PropertyChangeException if the listener ! ** does not desire the change to be made. ! **/ ! public abstract void vetoableChange(PropertyChangeEvent e) ! throws PropertyVetoException; ! } --- 41,73 ---- import java.util.EventListener; /** ! * VetoableChangeListener allows a class to monitor proposed changes to ! * properties of a Bean and, if desired, prevent them from occurring. A ! * vetoableChange() event will be fired after the property change has ! * been requested, but before it is permanent. If any listener rejects the ! * change by throwing the PropertyChangeException, a new vetoableChange() ! * event will be fired to all listeners who received a vetoableChange() event ! * in the first place, informing them to revert back to the old value. Thus, ! * the listener that threw the exception the first time should be prepared ! * to rethrow it the second time. The value, of course, never actually changed. ! * ! *

        Note: This class may not be reliably used to determine ! * whether a property has actually changed. Use the PropertyChangeListener ! * interface for that instead. ! * ! * @author John Keiser ! * @see java.beans.PropertyChangeListener ! * @see java.beans.VetoableChangeSupport ! * @since 1.1 ! * @status updated to 1.4 ! */ public interface VetoableChangeListener extends EventListener { ! /** ! * Fired before a Bean's property changes. ! * ! * @param e the change (containing the old and new values) ! * @throws PropertyVetoException if the change is vetoed by the listener ! */ ! void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException; ! } // interface VetoableChangeListener diff -Nrc3pad gcc-3.2.3/libjava/java/beans/VetoableChangeListenerProxy.java gcc-3.3/libjava/java/beans/VetoableChangeListenerProxy.java *** gcc-3.2.3/libjava/java/beans/VetoableChangeListenerProxy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/beans/VetoableChangeListenerProxy.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 0 **** --- 1,102 ---- + /* VetoableChangeListenerProxy.java -- adds a name to a vetoable listener + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.beans; + + import java.util.EventListenerProxy; + + /** + * This class provides an extension to VetoableChangeListener - + * associating a name with the listener. This can be used to filter the + * changes that one is interested in. + * + * @author Eric Blake + * @since 1.4 + * @status udpated to 1.4 + */ + public class VetoableChangeListenerProxy extends EventListenerProxy + implements VetoableChangeListener + { + /** + * The name of the property to listen for. Package visible for use by + * VetoableChangeSupport. + */ + final String propertyName; + + /** + * Create a new proxy which filters property change events and only passes + * changes to the named property on to the delegate. + * + * @param propertyName the property's name to filter on + * @param listener the delegate listener + */ + public VetoableChangeListenerProxy(String propertyName, + VetoableChangeListener listener) + { + super(listener); + this.propertyName = propertyName; + } + + /** + * Forwards the event on to the delegate if the property name matches. + * + * @param event the event to pass on, if it meets the filter + * @throws NullPointerException if the delegate this was created with is null + * @throws PropertyVetoException if the change is vetoed by the listener + */ + public void vetoableChange(PropertyChangeEvent event) + throws PropertyVetoException + { + // Note: Sun does not filter, under the assumption that since + // VetoableChangeSupport unwraps proxys, this method should never be + // called by normal use of listeners. + String name = event == null ? null : event.getPropertyName(); + if (name == null ? propertyName == null : name.equals(propertyName)) + ((VetoableChangeListener) getListener()).vetoableChange(event); + } + + /** + * Gets the name of the property this proxy is filtering on. + * + * @return the property name + */ + public String getPropertyName() + { + return propertyName; + } + } // class VetoableChangeListenerProxy diff -Nrc3pad gcc-3.2.3/libjava/java/beans/VetoableChangeSupport.java gcc-3.3/libjava/java/beans/VetoableChangeSupport.java *** gcc-3.2.3/libjava/java/beans/VetoableChangeSupport.java 2002-01-22 22:40:11.000000000 +0000 --- gcc-3.3/libjava/java/beans/VetoableChangeSupport.java 2002-07-15 16:05:13.000000000 +0000 *************** *** 1,5 **** ! /* java.beans.VetoableChangeSupport ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* VetoableChangeSupport.java -- support to manage vetoable change listeners ! Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** this exception to your version of the li *** 35,299 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.beans; ! import java.util.Hashtable; ! import java.util.Vector; ! import java.util.Enumeration; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; - import java.io.IOException; import java.io.Serializable; /** ! ** VetoableChangeSupport makes it easy to fire vetoable ! ** change events and handle listeners as well as reversion ! ** of old values when things go wrong. ! ** ! ** @author John Keiser ! ** @since JDK1.1 ! ** @version 1.2.0, 15 Mar 1998 ! **/ ! public class VetoableChangeSupport implements java.io.Serializable { ! transient Hashtable propertyListeners = new Hashtable(); ! transient Vector listeners = new Vector(); ! Hashtable children; ! Object source; ! int vetoableChangeSupportSerializedDataVersion = 2; ! private static final long serialVersionUID = -5090210921595982017L; ! /** ! * Saves the state of the object to the stream. */ ! private void writeObject(ObjectOutputStream stream) throws IOException { ! children = propertyListeners.isEmpty() ? null : propertyListeners; ! stream.defaultWriteObject(); ! for (Enumeration e = listeners.elements(); e.hasMoreElements(); ) { ! VetoableChangeListener l = (VetoableChangeListener)e.nextElement(); ! if (l instanceof Serializable) ! stream.writeObject(l); ! } ! stream.writeObject(null); ! } ! /** ! * Reads the object back from stream (deserialization). ! */ ! private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { ! stream.defaultReadObject(); ! propertyListeners = (children == null) ? new Hashtable() : children; ! VetoableChangeListener l; ! while ((l = (VetoableChangeListener)stream.readObject()) != null) { ! addVetoableChangeListener(l); ! } ! // FIXME: XXX: There is no spec for JDK 1.1 serialization ! // so it is unclear what to do if the value of ! // vetoableChangeSupportSerializedDataVersion is 1. ! } ! /** Create VetoableChangeSupport to work with a specific ! ** source bean. ! ** @param source the source bean to use. ! **/ ! public VetoableChangeSupport(Object source) { ! this.source = source; ! } ! /** Adds a VetoableChangeListener to the list of listeners. ! ** All property change events will be sent to this listener. ! **

        ! ** ! ** The listener add is not unique: that is, n adds with ! ** the same listener will result in n events being sent ! ** to that listener for every property change. ! **

        ! ** ! ** Adding a null listener will cause undefined behavior. ! ** ! ** @param l the listener to add. ! **/ ! public void addVetoableChangeListener(VetoableChangeListener l) { ! listeners.addElement(l); ! } ! /** Adds a VetoableChangeListener listening on the specified property. ! ** Events will be sent to the listener for that particular property. ! **

        ! ** ! ** The listener add is not unique; that is, n adds on a ! ** particular property for a particular listener will result in ! ** n events being sent to that listener when that ! ** property is changed. ! **

        ! ** ! ** The effect is cumulative, too; if you are registered to listen ! ** to receive events on all property changes, and then you ! ** register on a particular property, you will receive change ! ** events for that property twice. ! **

        ! ** ! ** Adding a null listener will cause undefined behavior. ! ** ! ** @param propertyName the name of the property to listen on. ! ** @param l the listener to add. ! **/ ! public void addVetoableChangeListener(String propertyName, VetoableChangeListener l) { ! synchronized(propertyListeners) { ! Vector v = (Vector)propertyListeners.get(propertyName); ! try { ! v.addElement(l); ! } catch(NullPointerException e) { ! /* If v is not found, create a new vector. */ ! v = new Vector(); ! v.addElement(l); ! propertyListeners.put(propertyName, v); ! } ! } ! } ! /** Removes a VetoableChangeListener from the list of listeners. ! ** If any specific properties are being listened on, they must ! ** be deregistered by themselves; this will only remove the ! ** general listener to all properties. ! **

        ! ** ! ** If add() has been called multiple times for a ! ** particular listener, remove() will have to be ! ** called the same number of times to deregister it. ! ** ! ** @param l the listener to remove. ! **/ ! public void removeVetoableChangeListener(VetoableChangeListener l) { ! listeners.removeElement(l); ! } ! /** Removes a VetoableChangeListener from listening to a specific property. ! **

        ! ** ! ** If add() has been called multiple times for a ! ** particular listener on a property, remove() will ! ** have to be called the same number of times to deregister it. ! ** ! ** @param propertyName the property to stop listening on. ! ** @param l the listener to remove. ! **/ ! public void removeVetoableChangeListener(String propertyName, VetoableChangeListener l) { ! synchronized(propertyListeners) { ! Vector v = (Vector)propertyListeners.get(propertyName); ! try { ! v.removeElement(l); ! if(v.size() == 0) { ! propertyListeners.remove(propertyName); ! } ! } catch(NullPointerException e) { ! /* if v is not found, do nothing. */ ! } ! } ! } ! /** Fire a VetoableChangeEvent to all the listeners. ! ** If any listener objects, a reversion event will be sent to ! ** those listeners who received the initial event. ! ** ! ** @param proposedChange the event to send. ! ** @exception PropertyVetoException if the change is vetoed. ! **/ ! public void fireVetoableChange(PropertyChangeEvent proposedChange) throws PropertyVetoException { ! int currentListener=0; ! try { ! for(;currentListenertrue if there are listeners ! ** on all properties or if there is a listener specifically on this ! ** property. ! ** ! ** @param propertyName the property that may be listened on ! ** @return whether the property is being listened on ! **/ ! public boolean hasListeners(String propertyName) { ! return listeners.size() > 0 || propertyListeners.get(propertyName) != null; ! } ! } --- 35,530 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.beans; ! ! import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Hashtable; + import java.util.Iterator; + import java.util.Map.Entry; + import java.util.Vector; /** ! * VetoableChangeSupport makes it easy to fire vetoable change events and ! * handle listeners. It allows chaining of listeners, as well as filtering ! * by property name. In addition, it will serialize only those listeners ! * which are serializable, ignoring the others without problem. This class ! * is thread-safe. ! * ! * @author John Keiser ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class VetoableChangeSupport implements Serializable ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -5090210921595982017L; ! /** ! * Maps property names (String) to named listeners (VetoableChangeSupport). ! * If this is a child instance, this field will be null. ! * ! * @serial the map of property names to named listener managers ! * @since 1.2 ! */ ! private Hashtable children; ! /** ! * The non-null source object for any generated events. ! * ! * @serial the event source ! */ ! private final Object source; ! /** ! * A field to compare serialization versions - this class uses version 2. ! * ! * @serial the serialization format ! */ ! private final int vetoableChangeSupportSerializedDataVersion = 2; + /** + * The list of all registered vetoable listeners. If this instance was + * created by user code, this only holds the global listeners (ie. not tied + * to a name), and may be null. If it was created by this class, as a + * helper for named properties, then this vector will be non-null, and this + * instance appears as a value in the children hashtable of + * another instance, so that the listeners are tied to the key of that + * hashtable entry. + */ + private transient Vector listeners; ! /** ! * Create a VetoableChangeSupport to work with a specific source bean. ! * ! * @param source the source bean to use ! * @throws NullPointerException if source is null ! */ ! public VetoableChangeSupport(Object source) ! { ! this.source = source; ! if (source == null) ! throw new NullPointerException(); ! } ! /** ! * Adds a VetoableChangeListener to the list of global listeners. All ! * vetoable change events will be sent to this listener. The listener add ! * is not unique: that is, n adds with the same listener will ! * result in n events being sent to that listener for every ! * vetoable change. Adding a null listener may cause a NullPointerException ! * down the road. This method will unwrap a VetoableChangeListenerProxy, ! * registering the underlying delegate to the named property list. ! * ! * @param l the listener to add ! */ ! public synchronized void addVetoableChangeListener(VetoableChangeListener l) ! { ! if (l instanceof VetoableChangeListenerProxy) ! { ! VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l; ! addVetoableChangeListener(p.propertyName, ! (VetoableChangeListener) p.getListener()); ! } ! else ! { ! if (listeners == null) ! listeners = new Vector(); ! listeners.add(l); ! } ! } ! /** ! * Removes a VetoableChangeListener from the list of global listeners. If ! * any specific properties are being listened on, they must be deregistered ! * by themselves; this will only remove the general listener to all ! * properties. If add() has been called multiple times for a ! * particular listener, remove() will have to be called the ! * same number of times to deregister it. This method will unwrap a ! * VetoableChangeListenerProxy, removing the underlying delegate from the ! * named property list. ! * ! * @param l the listener to remove ! */ ! public synchronized void ! removeVetoableChangeListener(VetoableChangeListener l) ! { ! if (l instanceof VetoableChangeListenerProxy) ! { ! VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l; ! removeVetoableChangeListener(p.propertyName, ! (VetoableChangeListener) p.getListener()); ! } ! else if (listeners != null) ! { ! listeners.remove(l); ! if (listeners.isEmpty()) ! listeners = null; ! } ! } ! /** ! * Returns an array of all registered vetoable change listeners. Those that ! * were registered under a name will be wrapped in a ! * VetoableChangeListenerProxy, so you must check whether the ! * listener is an instance of the proxy class in order to see what name the ! * real listener is registered under. If there are no registered listeners, ! * this returns an empty array. ! * ! * @return the array of registered listeners ! * @see VetoableChangeListenerProxy ! * @since 1.4 ! */ ! public synchronized VetoableChangeListener[] getVetoableChangeListeners() ! { ! ArrayList list = new ArrayList(); ! if (listeners != null) ! list.addAll(listeners); ! if (children != null) ! { ! int i = children.size(); ! Iterator iter = children.entrySet().iterator(); ! while (--i >= 0) ! { ! Entry e = (Entry) iter.next(); ! String name = (String) e.getKey(); ! Vector v = ((VetoableChangeSupport) e.getValue()).listeners; ! int j = v.size(); ! while (--j >= 0) ! list.add(new VetoableChangeListenerProxy ! (name, (VetoableChangeListener) v.get(j))); ! } ! } ! return (VetoableChangeListener[]) ! list.toArray(new VetoableChangeListener[list.size()]); ! } ! /** ! * Adds a VetoableChangeListener listening on the specified property. Events ! * will be sent to the listener only if the property name matches. The ! * listener add is not unique; that is, n adds on a particular ! * property for a particular listener will result in n events ! * being sent to that listener when that property is changed. The effect is ! * cumulative, too; if you are registered to listen to receive events on ! * all vetoable changes, and then you register on a particular property, ! * you will receive change events for that property twice. Adding a null ! * listener may cause a NullPointerException down the road. This method ! * will unwrap a VetoableChangeListenerProxy, registering the underlying ! * delegate to the named property list if the names match, and discarding ! * it otherwise. ! * ! * @param propertyName the name of the property to listen on ! * @param l the listener to add ! * @throws NullPointerException if propertyName is null ! */ ! public synchronized void addVetoableChangeListener(String propertyName, ! VetoableChangeListener l) ! { ! while (l instanceof VetoableChangeListenerProxy) ! { ! VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l; ! if (propertyName == null ? p.propertyName != null ! : ! propertyName.equals(p.propertyName)) ! return; ! l = (VetoableChangeListener) p.getListener(); ! } ! VetoableChangeSupport s = null; ! if (children == null) ! children = new Hashtable(); ! else ! s = (VetoableChangeSupport) children.get(propertyName); ! if (s == null) ! { ! s = new VetoableChangeSupport(source); ! s.listeners = new Vector(); ! children.put(propertyName, s); ! } ! s.listeners.add(l); ! } + /** + * Removes a VetoableChangeListener from listening to a specific property. + * If add() has been called multiple times for a particular + * listener on a property, remove() will have to be called the + * same number of times to deregister it. This method will unwrap a + * VetoableChangeListenerProxy, removing the underlying delegate from the + * named property list if the names match. + * + * @param propertyName the property to stop listening on + * @param l the listener to remove + * @throws NullPointerException if propertyName is null + */ + public synchronized void + removeVetoableChangeListener(String propertyName, VetoableChangeListener l) + { + if (children == null) + return; + VetoableChangeSupport s + = (VetoableChangeSupport) children.get(propertyName); + if (s == null) + return; + while (l instanceof VetoableChangeListenerProxy) + { + VetoableChangeListenerProxy p = (VetoableChangeListenerProxy) l; + if (propertyName == null ? p.propertyName != null + : ! propertyName.equals(p.propertyName)) + return; + l = (VetoableChangeListener) p.getListener(); + } + s.listeners.remove(l); + if (s.listeners.isEmpty()) + { + children.remove(propertyName); + if (children.isEmpty()) + children = null; + } + } ! /** ! * Returns an array of all vetoable change listeners registered under the ! * given property name. If there are no registered listeners, this returns ! * an empty array. ! * ! * @return the array of registered listeners ! * @throws NullPointerException if propertyName is null ! * @since 1.4 ! */ ! public synchronized VetoableChangeListener[] ! getVetoableChangeListeners(String propertyName) ! { ! if (children == null) ! return new VetoableChangeListener[0]; ! VetoableChangeSupport s ! = (VetoableChangeSupport) children.get(propertyName); ! if (s == null) ! return new VetoableChangeListener[0]; ! return (VetoableChangeListener[]) ! s.listeners.toArray(new VetoableChangeListener[s.listeners.size()]); ! } ! /** ! * Fire a PropertyChangeEvent containing the old and new values of the ! * property to all the global listeners, and to all the listeners for the ! * specified property name. This does nothing if old and new are non-null ! * and equal. If the change is vetoed, a new event is fired to notify ! * listeners about the rollback before the exception is thrown. ! * ! * @param propertyName the name of the property that changed ! * @param oldVal the old value ! * @param newVal the new value ! * @throws PropertyVetoException if the change is vetoed by a listener ! */ ! public void fireVetoableChange(String propertyName, ! Object oldVal, Object newVal) ! throws PropertyVetoException ! { ! fireVetoableChange(new PropertyChangeEvent(source, propertyName, ! oldVal, newVal)); ! } ! /** ! * Fire a PropertyChangeEvent containing the old and new values of the ! * property to all the global listeners, and to all the listeners for the ! * specified property name. This does nothing if old and new are equal. ! * If the change is vetoed, a new event is fired to notify listeners about ! * the rollback before the exception is thrown. ! * ! * @param propertyName the name of the property that changed ! * @param oldVal the old value ! * @param newVal the new value ! * @throws PropertyVetoException if the change is vetoed by a listener ! */ ! public void fireVetoableChange(String propertyName, int oldVal, int newVal) ! throws PropertyVetoException ! { ! if (oldVal != newVal) ! fireVetoableChange(new PropertyChangeEvent(source, propertyName, ! new Integer(oldVal), ! new Integer(newVal))); ! } ! /** ! * Fire a PropertyChangeEvent containing the old and new values of the ! * property to all the global listeners, and to all the listeners for the ! * specified property name. This does nothing if old and new are equal. ! * If the change is vetoed, a new event is fired to notify listeners about ! * the rollback before the exception is thrown. ! * ! * @param propertyName the name of the property that changed ! * @param oldVal the old value ! * @param newVal the new value ! * @throws PropertyVetoException if the change is vetoed by a listener ! */ ! public void fireVetoableChange(String propertyName, ! boolean oldVal, boolean newVal) ! throws PropertyVetoException ! { ! if (oldVal != newVal) ! fireVetoableChange(new PropertyChangeEvent(source, propertyName, ! Boolean.valueOf(oldVal), ! Boolean.valueOf(newVal))); ! } ! /** ! * Fire a PropertyChangeEvent to all the global listeners, and to all the ! * listeners for the specified property name. This does nothing if old and ! * new values of the event are equal. If the change is vetoed, a new event ! * is fired to notify listeners about the rollback before the exception is ! * thrown. ! * ! * @param event the event to fire ! * @throws NullPointerException if event is null ! * @throws PropertyVetoException if the change is vetoed by a listener ! */ ! public void fireVetoableChange(PropertyChangeEvent event) ! throws PropertyVetoException ! { ! if (event.oldValue != null && event.oldValue.equals(event.newValue)) ! return; ! Vector v = listeners; // Be thread-safe. ! if (v != null) ! { ! int i = v.size(); ! try ! { ! while (--i >= 0) ! ((VetoableChangeListener) v.get(i)).vetoableChange(event); ! } ! catch (PropertyVetoException e) ! { ! event = event.rollback(); ! int limit = i; ! i = v.size(); ! while (--i >= limit) ! ((VetoableChangeListener) v.get(i)).vetoableChange(event); ! throw e; ! } ! } ! Hashtable h = children; // Be thread-safe. ! if (h != null && event.propertyName != null) ! { ! VetoableChangeSupport s ! = (VetoableChangeSupport) h.get(event.propertyName); ! if (s != null) ! { ! Vector v1 = s.listeners; // Be thread-safe. ! int i = v1 == null ? 0 : v1.size(); ! try ! { ! while (--i >= 0) ! ((VetoableChangeListener) v1.get(i)).vetoableChange(event); ! } ! catch (PropertyVetoException e) ! { ! event = event.rollback(); ! int limit = i; ! i = v.size(); ! while (--i >= 0) ! ((VetoableChangeListener) v.get(i)).vetoableChange(event); ! i = v1.size(); ! while (--i >= limit) ! ((VetoableChangeListener) v1.get(i)).vetoableChange(event); ! throw e; ! } ! } ! } ! } ! /** ! * Tell whether the specified property is being listened on or not. This ! * will only return true if there are listeners on all ! * properties or if there is a listener specifically on this property. ! * ! * @param propertyName the property that may be listened on ! * @return whether the property is being listened on ! * @throws NullPointerException if propertyName is null ! */ ! public synchronized boolean hasListeners(String propertyName) ! { ! return listeners != null || (children != null ! && children.get(propertyName) != null); ! } + /** + * Saves the state of the object to the stream. + * + * @param s the stream to write to + * @throws IOException if anything goes wrong + * @serialData this writes out a null-terminated list of serializable + * global vetoable change listeners (the listeners for a named + * property are written out as the global listeners of the + * children, when the children hashtable is saved) + */ + private synchronized void writeObject(ObjectOutputStream s) + throws IOException + { + s.defaultWriteObject(); + if (listeners != null) + { + int i = listeners.size(); + while (--i >= 0) + if (listeners.get(i) instanceof Serializable) + s.writeObject(listeners.get(i)); + } + s.writeObject(null); + } ! /** ! * Reads the object back from stream (deserialization). ! * ! * XXX Since serialization for 1.1 streams was not documented, this may ! * not work if vetoableChangeSupportSerializedDataVersion is 1. ! * ! * @param s the stream to read from ! * @throws IOException if reading the stream fails ! * @throws ClassNotFoundException if deserialization fails ! * @serialData this reads in a null-terminated list of serializable ! * global vetoable change listeners (the listeners for a named ! * property are written out as the global listeners of the ! * children, when the children hashtable is saved) ! */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException ! { ! s.defaultReadObject(); ! VetoableChangeListener l = (VetoableChangeListener) s.readObject(); ! while (l != null) ! { ! addVetoableChangeListener(l); ! l = (VetoableChangeListener) s.readObject(); ! } ! // Sun is not as careful with children as we are, and lets some proxys ! // in that can never receive events. So, we clean up anything that got ! // serialized, to make sure our invariants hold. ! if (children != null) ! { ! int i = children.size(); ! Iterator iter = children.entrySet().iterator(); ! while (--i >= 0) ! { ! Entry e = (Entry) iter.next(); ! String name = (String) e.getKey(); ! VetoableChangeSupport vcs = (VetoableChangeSupport) e.getValue(); ! if (vcs.listeners == null) ! vcs.listeners = new Vector(); ! if (vcs.children != null) ! vcs.listeners.addAll ! (Arrays.asList(vcs.getVetoableChangeListeners(name))); ! if (vcs.listeners.size() == 0) ! iter.remove(); ! else ! vcs.children = null; ! } ! if (children.size() == 0) ! children = null; ! } ! } ! } // class VetoableChangeSupport diff -Nrc3pad gcc-3.2.3/libjava/java/io/BufferedOutputStream.java gcc-3.3/libjava/java/io/BufferedOutputStream.java *** gcc-3.2.3/libjava/java/io/BufferedOutputStream.java 2002-01-22 22:40:13.000000000 +0000 --- gcc-3.3/libjava/java/io/BufferedOutputStream.java 2003-02-13 22:51:04.000000000 +0000 *************** *** 1,5 **** /* BufferedOutputStream.java -- Buffer output into large blocks before writing ! Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* BufferedOutputStream.java -- Buffer output into large blocks before writing ! Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** flush() throws IOException *** 140,145 **** --- 140,146 ---- out.write(buf, 0, count); count = 0; + out.flush(); } /*************************************************************************/ *************** finalize() throws IOException *** 188,198 **** public synchronized void write(int b) throws IOException { - buf[count] = (byte)(b & 0xFF); - - ++count; if (count == buf.length) flush(); } /*************************************************************************/ --- 189,199 ---- public synchronized void write(int b) throws IOException { if (count == buf.length) flush(); + + buf[count] = (byte)(b & 0xFF); + ++count; } /*************************************************************************/ diff -Nrc3pad gcc-3.2.3/libjava/java/io/BufferedReader.java gcc-3.3/libjava/java/io/BufferedReader.java *** gcc-3.2.3/libjava/java/io/BufferedReader.java 2002-01-22 22:40:13.000000000 +0000 --- gcc-3.3/libjava/java/io/BufferedReader.java 2002-04-30 23:55:57.000000000 +0000 *************** *** 1,5 **** /* BufferedReader.java ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* BufferedReader.java ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class BufferedReader extends Read *** 355,361 **** if (retAtEndOfBuffer && buffer[pos] == '\n') { --count; ! pos++; } return count; --- 355,366 ---- if (retAtEndOfBuffer && buffer[pos] == '\n') { --count; ! // If the mark was set to the location of the \n, then we ! // must change it to fully pretend that the \n does not ! // exist. ! if (markPos == pos) ! ++markPos; ! ++pos; } return count; diff -Nrc3pad gcc-3.2.3/libjava/java/io/CharArrayWriter.java gcc-3.3/libjava/java/io/CharArrayWriter.java *** gcc-3.2.3/libjava/java/io/CharArrayWriter.java 2002-01-22 22:40:13.000000000 +0000 --- gcc-3.3/libjava/java/io/CharArrayWriter.java 2002-12-02 21:30:13.000000000 +0000 *************** *** 1,5 **** /* CharArrayWriter.java -- Write chars to a buffer ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* CharArrayWriter.java -- Write chars to a buffer ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class CharArrayWriter extends Wri *** 98,116 **** */ public void close () { - closed = true; } /** * This method flushes all buffered chars to the stream. */ ! public void flush () throws IOException { - synchronized (lock) - { - if (closed) - throw new IOException ("Stream closed"); - } } /** --- 98,110 ---- */ public void close () { } /** * This method flushes all buffered chars to the stream. */ ! public void flush () { } /** *************** public class CharArrayWriter extends Wri *** 123,131 **** synchronized (lock) { count = 0; - // Allow this to reopen the stream. - // FIXME - what does the JDK do? - closed = false; } } --- 117,122 ---- *************** public class CharArrayWriter extends Wri *** 187,199 **** * * @param oneChar The char to be read passed as an int */ ! public void write (int oneChar) throws IOException { synchronized (lock) { - if (closed) - throw new IOException ("Stream closed"); - resize (1); buf[count++] = (char) oneChar; } --- 178,187 ---- * * @param oneChar The char to be read passed as an int */ ! public void write (int oneChar) { synchronized (lock) { resize (1); buf[count++] = (char) oneChar; } *************** public class CharArrayWriter extends Wri *** 207,219 **** * @param offset The index into the buffer to start writing data from * @param len The number of chars to write */ ! public void write (char[] buffer, int offset, int len) throws IOException { synchronized (lock) { - if (closed) - throw new IOException ("Stream closed"); - if (len >= 0) resize (len); System.arraycopy(buffer, offset, buf, count, len); --- 195,204 ---- * @param offset The index into the buffer to start writing data from * @param len The number of chars to write */ ! public void write (char[] buffer, int offset, int len) { synchronized (lock) { if (len >= 0) resize (len); System.arraycopy(buffer, offset, buf, count, len); *************** public class CharArrayWriter extends Wri *** 230,242 **** * @param offset The index into the string to start writing data from * @param len The number of chars to write */ ! public void write (String str, int offset, int len) throws IOException { synchronized (lock) { - if (closed) - throw new IOException ("Stream closed"); - if (len >= 0) resize (len); str.getChars(offset, offset + len, buf, count); --- 215,224 ---- * @param offset The index into the string to start writing data from * @param len The number of chars to write */ ! public void write (String str, int offset, int len) { synchronized (lock) { if (len >= 0) resize (len); str.getChars(offset, offset + len, buf, count); *************** public class CharArrayWriter extends Wri *** 289,297 **** * The number of chars that have been written to the buffer */ protected int count; - - /** - * True if the stream has been closed. - */ - private boolean closed; } --- 271,274 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/io/CharConversionException.java gcc-3.3/libjava/java/io/CharConversionException.java *** gcc-3.2.3/libjava/java/io/CharConversionException.java 2002-01-22 22:40:13.000000000 +0000 --- gcc-3.3/libjava/java/io/CharConversionException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** /* CharConversionException.java -- Character conversion exceptions ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* CharConversionException.java -- Character conversion exceptions ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,86 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Complete to 1.1. - */ - /** ! * This exception is thrown to indicate that a problem occurred with ! * an attempted character conversion. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @date September 25, 1998 ! */ ! public class CharConversionException extends IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new CharConversionException without a descriptive error message ! */ ! public ! CharConversionException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new CharConversionException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! CharConversionException(String message) ! { ! super(message); ! } } // class CharConversionException - --- 38,73 ---- package java.io; /** ! * This exception is thrown to indicate that a problem occurred with ! * an attempted character conversion. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @since 1.1 ! * @status updated to 1.4 */ ! public class CharConversionException extends IOException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -8680016352018427031L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public CharConversionException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public CharConversionException(String message) + { + super(message); + } } // class CharConversionException diff -Nrc3pad gcc-3.2.3/libjava/java/io/DataInputStream.java gcc-3.3/libjava/java/io/DataInputStream.java *** gcc-3.2.3/libjava/java/io/DataInputStream.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/DataInputStream.java 2002-11-03 20:27:30.000000000 +0000 *************** public class DataInputStream extends Fil *** 734,740 **** static String convertFromUTF(byte[] buf) throws EOFException, UTFDataFormatException { ! StringBuffer strbuf = new StringBuffer(); for (int i = 0; i < buf.length; ) { --- 734,742 ---- static String convertFromUTF(byte[] buf) throws EOFException, UTFDataFormatException { ! // Give StringBuffer an initial estimated size to avoid ! // enlarge buffer frequently ! StringBuffer strbuf = new StringBuffer(buf.length/2 + 2); for (int i = 0; i < buf.length; ) { diff -Nrc3pad gcc-3.2.3/libjava/java/io/EOFException.java gcc-3.3/libjava/java/io/EOFException.java *** gcc-3.2.3/libjava/java/io/EOFException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/EOFException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* EOFException.java -- Unexpected end of file exception ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* EOFException.java -- unexpected end of file exception ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,90 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Complete to 1.1. - */ - /** ! * This exception is thrown when the end of the file or stream was ! * encountered unexpectedly. This is not the normal way that a normal ! * EOF condition is reported. Normally a special value such as -1 is ! * returned. However, certain types of streams expecting certain data ! * in a certain format might reach EOF before reading their expected ! * data pattern and thus throw this exception. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @date September 24, 1998 ! */ ! public class EOFException extends IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new EOFException without a descriptive error message ! */ ! public ! EOFException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new EOFException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! EOFException(String message) ! { ! super(message); ! } } // class EOFException - --- 38,76 ---- package java.io; /** ! * This exception is thrown when the end of the file or stream was ! * encountered unexpectedly. This is not the normal way that an EOF ! * condition is reported; such as a special value like -1 being returned. ! * However, certain types of streams expecting certain data in a certain ! * format might reach EOF before reading their expected data pattern and ! * thus throw this exception. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @status updated to 1.4 */ ! public class EOFException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 6433858223774886977L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public EOFException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public EOFException(String message) + { + super(message); + } } // class EOFException diff -Nrc3pad gcc-3.2.3/libjava/java/io/Externalizable.java gcc-3.3/libjava/java/io/Externalizable.java *** gcc-3.2.3/libjava/java/io/Externalizable.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/Externalizable.java 2002-11-10 22:06:48.000000000 +0000 *************** package java.io; *** 62,67 **** --- 62,68 ---- */ public interface Externalizable extends Serializable { + static final long serialVersionUID = -282491828744381764L; /** * This method restores an object's state by reading in the instance data diff -Nrc3pad gcc-3.2.3/libjava/java/io/FileDescriptor.java gcc-3.3/libjava/java/io/FileDescriptor.java *** gcc-3.2.3/libjava/java/io/FileDescriptor.java 2002-03-08 00:43:29.000000000 +0000 --- gcc-3.3/libjava/java/io/FileDescriptor.java 2003-01-04 03:55:28.000000000 +0000 *************** *** 1,6 **** // FileDescriptor.java - Open file or device ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // FileDescriptor.java - Open file or device ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** public final class FileDescriptor *** 65,70 **** --- 65,71 ---- native void write (byte[] b, int offset, int len) throws IOException, NullPointerException, IndexOutOfBoundsException; native void close () throws IOException; + native void setLength (long pos) throws IOException; // EOF_TRUNC is true if a request to seek past the end of file // should actually stop at the end of file. If false, then a seek // past the end is ok (and if a subsequent write occurs the file *************** public final class FileDescriptor *** 100,103 **** --- 101,106 ---- // we want to make sure this has the value -1. This is the most // efficient way to accomplish that. private int fd = -1; + + private long position = 0; } diff -Nrc3pad gcc-3.2.3/libjava/java/io/FileInputStream.java gcc-3.3/libjava/java/io/FileInputStream.java *** gcc-3.2.3/libjava/java/io/FileInputStream.java 2002-03-25 01:59:54.000000000 +0000 --- gcc-3.3/libjava/java/io/FileInputStream.java 2003-01-04 00:08:27.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1998, 1999, 2001 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 8,13 **** --- 8,15 ---- package java.io; + import java.nio.channels.FileChannel; + /** * @author Warren Levy * @date October 28, 1998. *************** public class FileInputStream extends Inp *** 23,28 **** --- 25,32 ---- /* Contains the file descriptor for referencing the actual file. */ private FileDescriptor fd; + private FileChannel ch; + public FileInputStream(String name) throws FileNotFoundException { SecurityManager s = System.getSecurityManager(); *************** public class FileInputStream extends Inp *** 57,64 **** protected void finalize() throws IOException { ! if (fd != null) ! fd.finalize(); } public final FileDescriptor getFD() throws IOException --- 61,68 ---- protected void finalize() throws IOException { ! // We don't actually need this, but we include it because it is ! // mentioned in the JCL. } public final FileDescriptor getFD() throws IOException *************** public class FileInputStream extends Inp *** 92,95 **** --- 96,104 ---- long endPos = fd.seek(n, FileDescriptor.CUR, true); return endPos - startPos; } + + public FileChannel getChannel () + { + return ch; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/io/File.java gcc-3.3/libjava/java/io/File.java *** gcc-3.2.3/libjava/java/io/File.java 2002-04-17 23:01:09.000000000 +0000 --- gcc-3.3/libjava/java/io/File.java 2003-04-19 19:19:50.000000000 +0000 *************** *** 1,6 **** // File.java - File name ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // File.java - File name ! /* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of libgcj. *************** public class File implements Serializabl *** 96,104 **** if (dupIndex == -1) { ! // Ignore trailing separator. ! if (plen > 1 && p.charAt(plen - 1) == separatorChar) ! return p.substring(0, plen - 1); else return p; } --- 96,108 ---- if (dupIndex == -1) { ! // Ignore trailing separator (though on Windows "a:\", for ! // example, is a valid and minimal path). ! if (plen > 1 && p.charAt (plen - 1) == separatorChar) ! { ! if (! (separatorChar == '\\' && plen == 3 && p.charAt (1) == ':')) ! return p.substring (0, plen - 1); ! } else return p; } *************** public class File implements Serializabl *** 120,129 **** dupIndex = p.indexOf(dupSeparator, last); } ! // Again, ignore possible trailing separator. int end; ! if (plen > 1 && p.charAt(plen - 1) == separatorChar) ! end = plen - 1; else end = plen; newpath.append(p.substring(last, end)); --- 124,139 ---- dupIndex = p.indexOf(dupSeparator, last); } ! // Again, ignore possible trailing separator (except special cases ! // like "a:\" on Windows). int end; ! if (plen > 1 && p.charAt (plen - 1) == separatorChar) ! { ! if (separatorChar == '\\' && plen == 3 && p.charAt (1) == ':') ! end = plen; ! else ! end = plen - 1; ! } else end = plen; newpath.append(p.substring(last, end)); *************** public class File implements Serializabl *** 153,164 **** this (dir == null ? null : dir.path, name); } - // FIXME ??? public String getAbsolutePath () { if (isAbsolute ()) return path; ! return System.getProperty("user.dir") + separatorChar + path; } /** @since 1.2 */ --- 163,209 ---- this (dir == null ? null : dir.path, name); } public String getAbsolutePath () { if (isAbsolute ()) return path; ! else if (separatorChar == '\\' ! && path.length () > 0 && path.charAt (0) == '\\') ! { ! // On Windows, even if the path starts with a '\\' it is not ! // really absolute until we prefix the drive specifier from ! // the current working directory to it. ! return System.getProperty ("user.dir").substring (0, 2) + path; ! } ! else if (separatorChar == '\\' ! && path.length () > 1 && path.charAt (1) == ':' ! && ((path.charAt (0) >= 'a' && path.charAt (0) <= 'z') ! || (path.charAt (0) >= 'A' && path.charAt (0) <= 'Z'))) ! { ! // On Windows, a process has a current working directory for ! // each drive and a path like "G:foo\bar" would mean the ! // absolute path "G:\wombat\foo\bar" if "\wombat" is the ! // working directory on the G drive. ! String drvDir = null; ! try ! { ! drvDir = new File (path.substring (0, 2)).getCanonicalPath (); ! } ! catch (IOException e) ! { ! drvDir = path.substring (0, 2) + "\\"; ! } ! ! // Note: this would return "C:\\." for the path "C:.", if "\" ! // is the working folder on the C drive, but this is ! // consistent with what Sun's JRE 1.4.1.01 actually returns! ! if (path.length () > 2) ! return drvDir + '\\' + path.substring (2, path.length ()); ! else ! return drvDir; ! } ! else ! return System.getProperty ("user.dir") + separatorChar + path; } /** @since 1.2 */ *************** public class File implements Serializabl *** 177,195 **** public String getName () { ! int last = path.lastIndexOf(separatorChar); ! return path.substring(last + 1); } public String getParent () { ! int last = path.lastIndexOf(separatorChar); ! if (last == -1) return null; - // FIXME: POSIX assumption. - if (last == 0 && path.charAt (0) == '/') - ++last; - return path.substring(0, last); } /** @since 1.2 */ --- 222,305 ---- public String getName () { ! int nameSeqIndex = 0; ! ! if (separatorChar == '\\' && path.length () > 1) ! { ! // On Windows, ignore the drive specifier or the leading '\\' ! // of a UNC network path, if any (a.k.a. the "prefix"). ! if ((path.charAt (0) == '\\' && path.charAt (1) == '\\') ! || (((path.charAt (0) >= 'a' && path.charAt (0) <= 'z') ! || (path.charAt (0) >= 'A' && path.charAt (0) <= 'Z')) ! && path.charAt (1) == ':')) ! { ! if (path.length () > 2) ! nameSeqIndex = 2; ! else ! return ""; ! } ! } ! ! String nameSeq ! = (nameSeqIndex > 0 ? path.substring (nameSeqIndex) : path); ! ! int last = nameSeq.lastIndexOf (separatorChar); ! ! return nameSeq.substring (last + 1); } public String getParent () { ! String prefix = null; ! int nameSeqIndex = 0; ! ! // The "prefix", if present, is the leading "/" on UNIX and ! // either the drive specifier (e.g. "C:") or the leading "\\" ! // of a UNC network path on Windows. ! if (separatorChar == '/' && path.charAt (0) == '/') ! { ! prefix = "/"; ! nameSeqIndex = 1; ! } ! else if (separatorChar == '\\' && path.length () > 1) ! { ! if ((path.charAt (0) == '\\' && path.charAt (1) == '\\') ! || (((path.charAt (0) >= 'a' && path.charAt (0) <= 'z') ! || (path.charAt (0) >= 'A' && path.charAt (0) <= 'Z')) ! && path.charAt (1) == ':')) ! { ! prefix = path.substring (0, 2); ! nameSeqIndex = 2; ! } ! } ! ! // According to the JDK docs, the returned parent path is the ! // portion of the name sequence before the last separator ! // character, if found, prefixed by the prefix, otherwise null. ! if (nameSeqIndex < path.length ()) ! { ! String nameSeq = path.substring (nameSeqIndex, path.length ()); ! int last = nameSeq.lastIndexOf (separatorChar); ! if (last == -1) ! return prefix; ! else if (last == (nameSeq.length () - 1)) ! // Note: The path would not have a trailing separator ! // except for cases like "C:\" on Windows (see ! // normalizePath( )), where Sun's JRE 1.4 returns null. ! return null; ! else if (last == 0) ! last++; ! ! if (prefix != null) ! return prefix + nameSeq.substring (0, last); ! else ! return nameSeq.substring (0, last); ! } ! else ! // Sun's JRE 1.4 returns null if the prefix is the only ! // component of the path - so "/" gives null on UNIX and ! // "C:", "\\", etc. return null on Windows. return null; } /** @since 1.2 */ *************** public class File implements Serializabl *** 289,296 **** public URL toURL () throws MalformedURLException { ! return new URL ("file://" + getAbsolutePath () ! + (isDirectory() ? "/" : "")); } private final native boolean performMkdir (); --- 399,412 ---- public URL toURL () throws MalformedURLException { ! // On Win32, Sun's JDK returns URLs of the form "file:/c:/foo/bar.txt", ! // while on UNIX, it returns URLs of the form "file:/foo/bar.txt". ! if (separatorChar == '\\') ! return new URL ("file:/" + getAbsolutePath ().replace ('\\', '/') ! + (isDirectory() ? "/" : "")); ! else ! return new URL ("file:" + getAbsolutePath () ! + (isDirectory() ? "/" : "")); } private final native boolean performMkdir (); diff -Nrc3pad gcc-3.2.3/libjava/java/io/FileNotFoundException.java gcc-3.3/libjava/java/io/FileNotFoundException.java *** gcc-3.2.3/libjava/java/io/FileNotFoundException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/FileNotFoundException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* FileNotFoundException.java -- The requested file could not be found ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* FileNotFoundException.java -- the requested file could not be found ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,86 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Complete to 1.1. - */ - /** ! * This exception is thrown when an attempt is made to access a file that ! * does not exist. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @date September 24, 1998 ! */ ! public class FileNotFoundException extends IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new FileNotFoundException without a descriptive error message ! */ ! public ! FileNotFoundException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new FileNotFoundException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! FileNotFoundException(String message) ! { ! super(message); ! } } // class FileNotFoundException - --- 38,73 ---- package java.io; /** ! * This exception is thrown when an attempt is made to access a file that ! * does not exist, or is inaccessible for some other reason (such as writing ! * a read-only file). ! * ! * @author Aaron M. Renn ! * @author Tom Tromey ! * @status updated to 1.4 */ ! public class FileNotFoundException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -897856973823710492L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public FileNotFoundException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public FileNotFoundException(String message) + { + super(message); + } } // class FileNotFoundException diff -Nrc3pad gcc-3.2.3/libjava/java/io/FileOutputStream.java gcc-3.3/libjava/java/io/FileOutputStream.java *** gcc-3.2.3/libjava/java/io/FileOutputStream.java 2001-07-12 15:37:43.000000000 +0000 --- gcc-3.3/libjava/java/io/FileOutputStream.java 2002-11-20 16:19:05.000000000 +0000 *************** details. */ *** 10,15 **** --- 10,17 ---- package java.io; + import java.nio.channels.FileChannel; + /** * @author Tom Tromey * @date September 24, 1998 *************** public class FileOutputStream extends Ou *** 93,96 **** --- 95,103 ---- // Instance variables. private FileDescriptor fd; + + public FileChannel getChannel () + { + return null; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/io/FilePermission.java gcc-3.3/libjava/java/io/FilePermission.java *** gcc-3.2.3/libjava/java/io/FilePermission.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/FilePermission.java 2002-11-10 22:06:48.000000000 +0000 *************** package java.io; *** 41,47 **** import java.security.*; ! public final class FilePermission extends Permission implements Serializable { private static final String CURRENT_DIRECTORY = System.getProperty("user.dir"); private boolean usingPerms = false; private boolean readPerm = false; --- 41,50 ---- import java.security.*; ! public final class FilePermission extends Permission implements Serializable ! { ! static final long serialVersionUID = 7930732926638008763L; ! private static final String CURRENT_DIRECTORY = System.getProperty("user.dir"); private boolean usingPerms = false; private boolean readPerm = false; diff -Nrc3pad gcc-3.2.3/libjava/java/io/InputStreamReader.java gcc-3.3/libjava/java/io/InputStreamReader.java *** gcc-3.2.3/libjava/java/io/InputStreamReader.java 2001-08-06 22:01:32.000000000 +0000 --- gcc-3.3/libjava/java/io/InputStreamReader.java 2003-02-13 23:30:00.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1998, 1999, 2001 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation This file is part of libgcj. *************** public class InputStreamReader extends R *** 70,76 **** } } ! public String getEncoding() { return converter.getName(); } public boolean ready() throws IOException { --- 70,79 ---- } } ! public String getEncoding() ! { ! return in != null ? converter.getName() : null; ! } public boolean ready() throws IOException { diff -Nrc3pad gcc-3.2.3/libjava/java/io/InterruptedIOException.java gcc-3.3/libjava/java/io/InterruptedIOException.java *** gcc-3.2.3/libjava/java/io/InterruptedIOException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/InterruptedIOException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* InterruptedIOException.java -- An I/O operation was interrupted. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InterruptedIOException.java -- an I/O operation was interrupted ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,115 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Complete to 1.1. - */ - /** ! * This exception is thrown when a in process I/O operation is ! * interrupted for some reason. The field bytesTransferred will contain ! * the number of bytes that were read/written prior to the interruption. ! * ! * @version 0.0 * ! * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey ! * @date September 24, 1998 */ public class InterruptedIOException extends IOException { ! private static final long serialVersionUID = 4020568460727500567L; ! ! /* ! * Instance Variables ! */ ! ! /** ! * The number of bytes read/written prior to the interruption ! */ ! public int bytesTransferred; ! ! /*************************************************************************/ ! ! /* ! * Constructors ! */ ! ! /** ! * Create a new InterruptedIOException without a descriptive error message ! */ ! public ! InterruptedIOException() ! { ! super(); ! } ! ! /*************************************************************************/ ! ! /** ! * Create a new InterruptedIOException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! InterruptedIOException(String message) ! { ! super(message); ! } ! /*************************************************************************/ ! /** ! * Create a new InterruptedIOException with a descriptive error message ! * String. Also sets the value of the bytesTransferred field. ! * ! * @param message The descriptive error message ! * @param bytesTransferred The number of bytes tranferred before the interruption ! */ ! InterruptedIOException(String message, int bytesTransferred) ! { ! super(message); ! this.bytesTransferred = bytesTransferred; ! } } // class InterruptedIOException - --- 38,94 ---- package java.io; /** ! * This exception is thrown when a in process I/O operation is interrupted ! * for some reason. The field bytesTransferred will contain the number of ! * bytes that were read/written prior to the interruption. * ! * @author Aaron M. Renn * @author Tom Tromey ! * @see Thread#interrupt() ! * @status updated to 1.4 */ public class InterruptedIOException extends IOException { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 4020568460727500567L; ! /** ! * The number of bytes read/written prior to the interruption. ! * ! * @serial count of bytes successfully transferred ! */ ! public int bytesTransferred; ! /** ! * Create an extends without a descriptive error message. ! */ ! public InterruptedIOException() ! { ! } ! /** ! * Create an exception with a descriptive error message. ! * ! * @param message the descriptive error message ! */ ! public InterruptedIOException(String message) ! { ! super(message); ! } + /** + * Create an exception with a descriptive error message and count of + * bytes transferred. + * + * @param message the descriptive error message + * @param bytesTransferred number of bytes tranferred before interruption + */ + InterruptedIOException(String message, int bytesTransferred) + { + super(message); + this.bytesTransferred = bytesTransferred; + } } // class InterruptedIOException diff -Nrc3pad gcc-3.2.3/libjava/java/io/InvalidClassException.java gcc-3.3/libjava/java/io/InvalidClassException.java *** gcc-3.2.3/libjava/java/io/InvalidClassException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/InvalidClassException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* InvalidClassException.java -- An I/O operation was interrupted. ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InvalidClassException.java -- deserializing a class failed ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,82 **** package java.io; /** ! * This exception is thrown when there is some sort of problem with a ! * class during a serialization operation. This could be that the ! * versions don't match, that there are unknown datatypes in the class ! * or that the class doesn't have a default no-arg constructor. ! *

        ! * The field classname will contain the name of the ! * class that caused the problem if known. The getMessage() method ! * for this exception will always include the name of that class ! * if known. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class InvalidClassException extends ObjectStreamException { /** ! * The name of the class which encountered the error. ! */ public String classname; /** ! * Create a new InvalidClassException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ public InvalidClassException(String message) { super(message); } /** ! * Create a new InvalidClassException with a descriptive error message ! * String, and the name of the class that caused the problem. ! * ! * @param classname The number of bytes tranferred before the interruption ! * @param message The descriptive error message ! */ public InvalidClassException(String classname, String message) { super(message); --- 39,92 ---- package java.io; /** ! * This exception is thrown when there is some sort of problem with a ! * class during a serialization operation. This could be:

          ! *
        • the serial version of the class doesn't match
        • ! *
        • the class contains unknown datatypes
        • ! *
        • the class does not have an accessible no-arg constructor
        • ! *
        . ! * ! *

        The field classname will contain the name of the ! * class that caused the problem if known. The getMessage() method ! * for this exception will always include the name of that class ! * if known. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.1 ! * @status updated to 1.4 ! */ public class InvalidClassException extends ObjectStreamException { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -4333316296251054416L; ! ! /** ! * The name of the class which encountered the error. ! * ! * @serial the classname causing the error ! */ public String classname; /** ! * Create an exception with a descriptive error message, but a null ! * classname. ! * ! * @param message the descriptive error message ! */ public InvalidClassException(String message) { super(message); } /** ! * Create an exception with a descriptive error message, and the name of ! * the class that caused the problem. ! * ! * @param classname the name of the faulty class ! * @param message the descriptive error message ! */ public InvalidClassException(String classname, String message) { super(message); *************** public class InvalidClassException exten *** 84,98 **** } /** ! * Returns the descriptive error message for this exception. It will ! * include the class name that caused the problem if known. This method ! * overrides Throwable.getMessage() ! * ! * @return A descriptive error message ! */ public String getMessage() { ! return super.getMessage() + (classname == null ? "" : ": " + classname); } } --- 94,111 ---- } /** ! * Returns the descriptive error message for this exception. It will ! * include the class name that caused the problem if known, in the format: ! * [classname][; ][super.getMessage()]. ! * ! * @return A descriptive error message, may be null ! */ public String getMessage() { ! String msg = super.getMessage(); ! if (msg == null) ! return classname; ! return (classname == null ? "" : classname + "; ") + msg; } } diff -Nrc3pad gcc-3.2.3/libjava/java/io/InvalidObjectException.java gcc-3.3/libjava/java/io/InvalidObjectException.java *** gcc-3.2.3/libjava/java/io/InvalidObjectException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/InvalidObjectException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* InvalidObjectException.java -- An I/O operation was interrupted. ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InvalidObjectException.java -- deserialization failed verification ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,68 **** package java.io; /** ! * This exception is thrown when an object fails a validation test ! * during serialization. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class InvalidObjectException extends ObjectStreamException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new InvalidObjectException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! InvalidObjectException(String message) { ! super(message); ! } } // class InvalidObjectException - --- 39,66 ---- package java.io; /** ! * This exception is thrown when an object fails a validation test ! * during serialization. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.1 ! * @status updated to 1.4 */ ! public class InvalidObjectException extends ObjectStreamException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 3233174318281839583L; + /** + * Create an exception with a descriptive error message String. This should + * be the cause of the verification failure. + * + * @param message the descriptive error message + */ + public InvalidObjectException(String message) + { + super(message); + } } // class InvalidObjectException diff -Nrc3pad gcc-3.2.3/libjava/java/io/IOException.java gcc-3.3/libjava/java/io/IOException.java *** gcc-3.2.3/libjava/java/io/IOException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/IOException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** /* IOException.java -- Generic input/output exception ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* IOException.java -- Generic input/output exception ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,88 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Complete to 1.1. - */ - /** * This exception is thrown to indicate an I/O problem of some sort * occurred. Since this is a fairly generic exception, often a subclass * of IOException will actually be thrown in order to provide a more * detailed indication of what happened. * - * @version 0.0 - * * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey ! * @date September 24, 1998 */ public class IOException extends Exception { ! /* ! * Constructors ! */ ! ! /** ! * Create a new IOException without a descriptive error message ! */ ! public ! IOException() ! { ! super(); ! } ! ! /*************************************************************************/ ! ! /** ! * Create a new IOException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! IOException(String message) ! { ! super(message); ! } } // class IOException - --- 38,74 ---- package java.io; /** * This exception is thrown to indicate an I/O problem of some sort * occurred. Since this is a fairly generic exception, often a subclass * of IOException will actually be thrown in order to provide a more * detailed indication of what happened. * * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey ! * @status updated to 1.4 */ public class IOException extends Exception { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 7818375828146090155L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public IOException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public IOException(String message) + { + super(message); + } } // class IOException diff -Nrc3pad gcc-3.2.3/libjava/java/io/LineNumberInputStream.java gcc-3.3/libjava/java/io/LineNumberInputStream.java *** gcc-3.2.3/libjava/java/io/LineNumberInputStream.java 2000-03-07 19:55:26.000000000 +0000 --- gcc-3.3/libjava/java/io/LineNumberInputStream.java 2002-06-17 03:52:24.000000000 +0000 *************** *** 1,41 **** ! /* Copyright (C) 1998, 1999 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package java.io; /** * @author Warren Levy - * @date November 11, 1998. - * @deprecated */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. Deprecated in JDK 1.1. - */ - public class LineNumberInputStream extends FilterInputStream { ! /* The current line number. */ private int lineNumber = 0; ! /* The line number when the stream was marked. */ private int markLineNumber = 0; ! /* Flag to indicate a '\r' was just read so that an immediately subsequent ! * '\n' can be ignored. */ private boolean justReadReturnChar = false; public LineNumberInputStream(InputStream in) { super(in); } public int available() throws IOException { // We can only guarantee half the characters that might be available --- 1,114 ---- ! /* LineNumberInputStream.java -- An input stream which counts line numbers ! Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.io; /** + * This class functions like a standard InputStream + * except that it counts line numbers, and canonicalizes newline + * characters. As data is read, whenever the byte sequences "\r", + * "\n", or "\r\n" are encountered, the running line count is + * incremeted by one. Additionally, the whatever line termination + * sequence was encountered will be converted to a "\n" byte. Note + * that this class numbers lines from 0. When the first line + * terminator is encountered, the line number is incremented to 1, and + * so on. + *

        + * This class counts only line termination characters. If the last line + * read from the stream does not end in a line termination sequence, it + * will not be counted as a line. + *

        + * Note that since this class operates as a filter on an underlying + * stream, it has the same mark/reset functionality as the underlying + * stream. The mark() and reset() methods + * in this class handle line numbers correctly. Calling + * @code{reset()} resets the line number to the point at which + * mark() was called if the subordinate stream supports + * that functionality. + *

        + * @deprecated This class is deprecated in favor if + * LineNumberReader because it operates on ASCII bytes + * instead of an encoded character stream. This class is for backward + * compatibility only and should not be used in new applications. + * + * @author Aaron M. Renn (arenn@urbanophile.com) * @author Warren Levy */ public class LineNumberInputStream extends FilterInputStream { ! /** The current line number. */ private int lineNumber = 0; ! /** The line number when the stream was marked. */ private int markLineNumber = 0; ! /** Flag to indicate a '\r' was just read so that an immediately ! * subsequent '\n' can be ignored. */ private boolean justReadReturnChar = false; + /** + * Create a new LineNumberInputStream that reads from the + * specified subordinate InputStream + * + * @param in The subordinate InputStream to read from + */ public LineNumberInputStream(InputStream in) { super(in); } + /** + * This method returns the number of bytes that can be read from the + * stream before the stream can block. This method is tricky + * because the subordinate InputStream might return + * only "\r\n" characters, which are replaced by a single "\n" + * character by the read() method of this class. So + * this method can only guarantee that in.available() / + * 2 bytes can actually be read before blocking. In + * practice, considerably more bytes might be read before blocking + *

        + * Note that the stream may not block if additional bytes beyond the count + * returned by this method are read. + * + * @return The number of bytes that can be read before blocking could occur + * + * @exception IOException If an error occurs + */ public int available() throws IOException { // We can only guarantee half the characters that might be available *************** public class LineNumberInputStream exten *** 43,59 **** --- 116,178 ---- return in.available() / 2; } + /** + * This method returns the current line number + * + * @returns The current line number + */ public int getLineNumber() { return lineNumber; } + /** + * This method marks a position in the input to which the stream can + * be "reset" byte calling the reset() method. The + * parameter readlimit is the number of bytes that can + * be read from the stream after setting the mark before the mark + * becomes invalid. For example, if mark() is called + * with a read limit of 10, then when 11 bytes of data are read from + * the stream before the reset() method is called, then + * the mark is invalid and the stream object instance is not + * required to remember the mark. + *

        + * In this class, this method will remember the current line number + * as well as the current position in the stream. When the + * reset() method is called, the line number will be + * restored to the saved line number in addition to the stream + * position. + *

        + * This method only works if the subordinate stream supports mark/reset + * functionality. + * + * @param readlimit The number of bytes that can be read before the + * mark becomes invalid + */ public void mark(int readlimit) { in.mark(readlimit); markLineNumber = lineNumber; } + /** + * This method reads an unsigned byte from the input stream and returns it + * as an int in the range of 0-255. This method will return -1 if the + * end of the stream has been reached. + *

        + * Note that if a line termination sequence is encountered (ie, "\r", + * "\n", or "\r\n") then that line termination sequence is converted to + * a single "\n" value which is returned from this method. This means + * that it is possible this method reads two bytes from the subordinate + * stream instead of just one. + *

        + * Note that this method will block until a byte of data is available + * to be read. + * + * @return The byte read or -1 if end of stream + * + * @exception IOException If an error occurs + */ public int read() throws IOException { // Treat "\r\n" as a single character. A '\r' may have been read by *************** public class LineNumberInputStream exten *** 82,87 **** --- 201,229 ---- return ch; } + /** + * This method reads bytes from a stream and stores them into a caller + * supplied buffer. It starts storing data at index offset into + * the buffer and attemps to read len bytes. This method can + * return before reading the number of bytes requested. The actual number + * of bytes read is returned as an int. A -1 is returned to indicated the + * end of the stream. + *

        + * This method will block until some data can be read. + *

        + * Note that if a line termination sequence is encountered (ie, "\r", + * "\n", or "\r\n") then that line termination sequence is converted to + * a single "\n" value which is stored in the buffer. Only a single + * byte is counted towards the number of bytes read in this case. + * + * @param buf The array into which the bytes read should be stored + * @param offset The offset into the array to start storing bytes + * @param len The requested number of bytes to read + * + * @return The actual number of bytes read, or -1 if end of stream + * + * @exception IOException If an error occurs. + */ public int read(byte[] b, int off, int len) throws IOException { if (off < 0 || len < 0 || off + len > b.length) *************** public class LineNumberInputStream exten *** 109,114 **** --- 251,270 ---- return off == origOff ? -1 : off - origOff; } + /** + * This method resets a stream to the point where the + * mark() method was called. Any bytes that were read + * after the mark point was set will be re-read during subsequent + * reads. + *

        + * In this class, this method will also restore the line number that was + * current when the mark() method was called. + *

        + * This method only works if the subordinate stream supports mark/reset + * functionality. + * + * @exception IOException If an error occurs + */ public void reset() throws IOException { in.reset(); *************** public class LineNumberInputStream exten *** 116,126 **** --- 272,298 ---- justReadReturnChar = false; } + /** + * This method sets the current line number to the specified value. + * + * @param lineNumber The new line number + */ public void setLineNumber(int lineNumber) { this.lineNumber = lineNumber; } + /** + * This method skips up to the requested number of bytes in the + * input stream. The actual number of bytes skipped is returned. If the + * desired number of bytes to skip is negative, no bytes are skipped. + * + * @param n requested number of bytes to skip. + * + * @return The actual number of bytes skipped. + * + * @exception IOException If an error occurs. + */ public long skip(long n) throws IOException { if (n <= 0) diff -Nrc3pad gcc-3.2.3/libjava/java/io/natFileDescriptorEcos.cc gcc-3.3/libjava/java/io/natFileDescriptorEcos.cc *** gcc-3.2.3/libjava/java/io/natFileDescriptorEcos.cc 2002-03-08 00:43:29.000000000 +0000 --- gcc-3.3/libjava/java/io/natFileDescriptorEcos.cc 2002-07-24 17:48:41.000000000 +0000 *************** *** 1,6 **** // natFileDescriptor.cc - Native part of FileDescriptor class. ! /* Copyright (C) 1998, 1999, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natFileDescriptor.cc - Native part of FileDescriptor class. ! /* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** java::io::FileDescriptor::close (void) *** 95,100 **** --- 95,105 ---- { } + void + java::io::FileDescriptor::setLength (long) + { + } + jint java::io::FileDescriptor::seek (jlong pos, jint whence, jboolean) { diff -Nrc3pad gcc-3.2.3/libjava/java/io/natFileDescriptorPosix.cc gcc-3.3/libjava/java/io/natFileDescriptorPosix.cc *** gcc-3.2.3/libjava/java/io/natFileDescriptorPosix.cc 2002-03-10 18:00:04.000000000 +0000 --- gcc-3.3/libjava/java/io/natFileDescriptorPosix.cc 2003-03-09 22:49:43.000000000 +0000 *************** *** 1,6 **** // natFileDescriptor.cc - Native part of FileDescriptor class. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natFileDescriptor.cc - Native part of FileDescriptor class. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 45,51 **** #define NO_FSYNC_MESSAGE "sync unsupported" void ! java::io::FileDescriptor::init(void) { in = new java::io::FileDescriptor(0); out = new java::io::FileDescriptor(1); --- 45,51 ---- #define NO_FSYNC_MESSAGE "sync unsupported" void ! java::io::FileDescriptor::init (void) { in = new java::io::FileDescriptor(0); out = new java::io::FileDescriptor(1); *************** jboolean *** 56,62 **** java::io::FileDescriptor::valid (void) { struct stat sb; ! return ::fstat (fd, &sb) == 0; } void --- 56,62 ---- java::io::FileDescriptor::valid (void) { struct stat sb; ! return fd >= 0 && ::fstat (fd, &sb) == 0; } void *************** java::io::FileDescriptor::write (jint b) *** 147,152 **** --- 147,153 ---- throw new IOException (JvNewStringLatin1 (strerror (errno))); } } + position++; } void *************** java::io::FileDescriptor::write (jbyteAr *** 177,182 **** --- 178,184 ---- written += r; len -= r; bytes += r; + position += r; } } *************** java::io::FileDescriptor::close (void) *** 189,212 **** throw new IOException (JvNewStringLatin1 (strerror (errno))); } jint java::io::FileDescriptor::seek (jlong pos, jint whence, jboolean eof_trunc) { JvAssert (whence == SET || whence == CUR); ! jlong len = length (); ! jlong here = getFilePointer (); ! ! if (eof_trunc ! && ((whence == SET && pos > len) || (whence == CUR && here + pos > len))) { ! whence = SET; ! pos = len; } off_t r = ::lseek (fd, (off_t) pos, whence == SET ? SEEK_SET : SEEK_CUR); if (r == -1) throw new IOException (JvNewStringLatin1 (strerror (errno))); return r; } --- 191,259 ---- throw new IOException (JvNewStringLatin1 (strerror (errno))); } + void + java::io::FileDescriptor::setLength (jlong pos) + { + struct stat sb; + + #ifdef HAVE_FTRUNCATE + if (::fstat (fd, &sb)) + throw new IOException (JvNewStringLatin1 (strerror (errno))); + + if ((jlong) sb.st_size == pos) + return; + + // If the file is too short, we extend it. We can't rely on + // ftruncate() extending the file. So we lseek() to 1 byte less + // than we want, and then we write a single byte at the end. + if ((jlong) sb.st_size < pos) + { + if (::lseek (fd, (off_t) (pos - 1), SEEK_SET) == -1) + throw new IOException (JvNewStringLatin1 (strerror (errno))); + char out = '\0'; + int r = ::write (fd, &out, 1); + if (r <= 0 || ::lseek (fd, position, SEEK_SET) == -1) + throw new IOException (JvNewStringLatin1 (strerror (errno))); + } + else + { + if (::ftruncate (fd, (off_t) pos)) + throw new IOException (JvNewStringLatin1 (strerror (errno))); + position = pos; + } + #else /* HAVE_FTRUNCATE */ + throw new IOException (JvNewStringLatin1 ("FileDescriptor.setLength not implemented")); + #endif /* HAVE_FTRUNCATE */ + } + jint java::io::FileDescriptor::seek (jlong pos, jint whence, jboolean eof_trunc) { JvAssert (whence == SET || whence == CUR); ! if (eof_trunc) { ! jlong len = length (); ! if (whence == SET) ! { ! if (pos > len) ! pos = len; ! } ! else ! { ! jlong here = getFilePointer (); ! if (here + pos > len) ! { ! pos = len; ! whence = SET; ! } ! } } off_t r = ::lseek (fd, (off_t) pos, whence == SET ? SEEK_SET : SEEK_CUR); if (r == -1) throw new IOException (JvNewStringLatin1 (strerror (errno))); + position = r; return r; } *************** java::io::FileDescriptor::length (void) *** 222,231 **** jlong java::io::FileDescriptor::getFilePointer (void) { ! off_t r = ::lseek (fd, 0, SEEK_CUR); ! if (r == -1) ! throw new IOException (JvNewStringLatin1 (strerror (errno))); ! return r; } jint --- 269,275 ---- jlong java::io::FileDescriptor::getFilePointer (void) { ! return position; } jint *************** java::io::FileDescriptor::read (void) *** 246,251 **** --- 290,296 ---- } throw new IOException (JvNewStringLatin1 (strerror (errno))); } + position++; return b & 0xFF; } *************** java::io::FileDescriptor::read (jbyteArr *** 257,262 **** --- 302,312 ---- jsize bsize = JvGetArrayLength (buffer); if (offset < 0 || count < 0 || offset + count > bsize) throw new java::lang::ArrayIndexOutOfBoundsException; + + // Must return 0 if an attempt is made to read 0 bytes. + if (count == 0) + return 0; + jbyte *bytes = elements (buffer) + offset; int r = ::read (fd, bytes, count); if (r == 0) *************** java::io::FileDescriptor::read (jbyteArr *** 272,277 **** --- 322,328 ---- } throw new IOException (JvNewStringLatin1 (strerror (errno))); } + position += r; return r; } *************** java::io::FileDescriptor::available (voi *** 320,326 **** off_t where = 0; if (fstat (fd, &sb) != -1 && S_ISREG (sb.st_mode) ! && (where = lseek (fd, SEEK_CUR, 0)) != (off_t) -1) { num = (long) (sb.st_size - where); num_set = true; --- 371,377 ---- off_t where = 0; if (fstat (fd, &sb) != -1 && S_ISREG (sb.st_mode) ! && (where = lseek (fd, 0, SEEK_CUR)) != (off_t) -1) { num = (long) (sb.st_size - where); num_set = true; *************** java::io::FileDescriptor::available (voi *** 346,351 **** return (jint) num; #else ! throw new IOException (JvNewStringLatin1 ("unimplemented")); #endif } --- 397,402 ---- return (jint) num; #else ! return 0; #endif } diff -Nrc3pad gcc-3.2.3/libjava/java/io/natFileDescriptorWin32.cc gcc-3.3/libjava/java/io/natFileDescriptorWin32.cc *** gcc-3.2.3/libjava/java/io/natFileDescriptorWin32.cc 2002-06-06 20:06:03.000000000 +0000 --- gcc-3.3/libjava/java/io/natFileDescriptorWin32.cc 2003-02-11 20:56:05.000000000 +0000 *************** *** 1,6 **** // natFileDescriptorWin32.cc - Native part of FileDescriptor class. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of libgcj. --- 1,7 ---- // natFileDescriptorWin32.cc - Native part of FileDescriptor class. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software ! Foundation, Inc. This file is part of libgcj. *************** details. */ *** 32,37 **** --- 33,41 ---- #include #include + // FIXME: casting a FILE (pointer) to a jint will not work on Win64 -- + // we should be using gnu.gcj.RawData's. + void java::io::FileDescriptor::init(void) { *************** java::io::FileDescriptor::open (jstring *** 118,123 **** --- 122,134 ---- throw new FileNotFoundException (JvNewStringLatin1 (msg)); } + // For APPEND mode, move the file pointer to the end of the file. + if (jflags & APPEND) + { + DWORD low = SetFilePointer (handle, 0, NULL, FILE_END); + if ((low == 0xffffffff) && (GetLastError () != NO_ERROR)) + throw new FileNotFoundException (JvNewStringLatin1 (winerr ())); + } return (jint)handle; } *************** java::io::FileDescriptor::close (void) *** 176,181 **** --- 187,244 ---- throw new IOException (JvNewStringLatin1 (winerr ())); } + void + java::io::FileDescriptor::setLength(jlong pos) + { + LONG liOrigFilePointer; + LONG liNewFilePointer; + LONG liEndFilePointer; + + // Get the original file pointer. + if (SetFilePointer((HANDLE) fd, (LONG) 0, &liOrigFilePointer, + FILE_CURRENT) != (BOOL) 0 + && (GetLastError() != NO_ERROR)) + throw new IOException (JvNewStringLatin1 (winerr ())); + + // Get the length of the file. + if (SetFilePointer((HANDLE) fd, (LONG) 0, &liEndFilePointer, + FILE_END) != (BOOL) 0 + && (GetLastError() != NO_ERROR)) + throw new IOException (JvNewStringLatin1 (winerr ())); + + if ((jlong)liEndFilePointer == pos) + { + // Restore the file pointer. + if (liOrigFilePointer != liEndFilePointer) + { + if (SetFilePointer((HANDLE) fd, liOrigFilePointer, &liNewFilePointer, + FILE_BEGIN) != (BOOL) 0 + && (GetLastError() != NO_ERROR)) + throw new IOException (JvNewStringLatin1 (winerr ())); + } + return; + } + + // Seek to the new end of file. + if (SetFilePointer((HANDLE) fd, (LONG) pos, &liNewFilePointer, + FILE_BEGIN) != (BOOL) 0 + && (GetLastError() != NO_ERROR)) + throw new IOException (JvNewStringLatin1 (winerr ())); + + // Truncate the file at this point. + if (SetEndOfFile((HANDLE) fd) != (BOOL) 0 && (GetLastError() != NO_ERROR)) + throw new IOException (JvNewStringLatin1 (winerr ())); + + if (liOrigFilePointer < liNewFilePointer) + { + // Restore the file pointer. + if (SetFilePointer((HANDLE) fd, liOrigFilePointer, &liNewFilePointer, + FILE_BEGIN) != (BOOL) 0 + && (GetLastError() != NO_ERROR)) + throw new IOException (JvNewStringLatin1 (winerr ())); + } + } + jint java::io::FileDescriptor::seek (jlong pos, jint whence, jboolean eof_trunc) { *************** java::io::FileDescriptor::read(void) *** 226,232 **** DWORD read; if (! ReadFile ((HANDLE)fd, &buf, 1, &read, NULL)) ! throw new IOException (JvNewStringLatin1 (winerr ())); if (! read) return -1; else --- 289,301 ---- DWORD read; if (! ReadFile ((HANDLE)fd, &buf, 1, &read, NULL)) ! { ! if (GetLastError () == ERROR_BROKEN_PIPE) ! return -1; ! else ! throw new IOException (JvNewStringLatin1 (winerr ())); ! } ! if (! read) return -1; else *************** java::io::FileDescriptor::read(jbyteArra *** 243,255 **** if (offset < 0 || count < 0 || offset + count > bsize) throw new java::lang::ArrayIndexOutOfBoundsException; jbyte *bytes = elements (buffer) + offset; DWORD read; if (! ReadFile((HANDLE)fd, bytes, count, &read, NULL)) ! throw new IOException (JvNewStringLatin1 (winerr ())); if (read == 0) return -1; return (jint)read; } --- 312,334 ---- if (offset < 0 || count < 0 || offset + count > bsize) throw new java::lang::ArrayIndexOutOfBoundsException; + // Must return 0 if an attempt is made to read 0 bytes. + if (count == 0) + return 0; + jbyte *bytes = elements (buffer) + offset; DWORD read; if (! ReadFile((HANDLE)fd, bytes, count, &read, NULL)) ! { ! if (GetLastError () == ERROR_BROKEN_PIPE) ! return -1; ! else ! throw new IOException (JvNewStringLatin1 (winerr ())); ! } if (read == 0) return -1; + return (jint)read; } diff -Nrc3pad gcc-3.2.3/libjava/java/io/natFilePosix.cc gcc-3.3/libjava/java/io/natFilePosix.cc *** gcc-3.2.3/libjava/java/io/natFilePosix.cc 2002-02-12 05:52:33.000000000 +0000 --- gcc-3.3/libjava/java/io/natFilePosix.cc 2003-01-21 20:46:24.000000000 +0000 *************** *** 1,6 **** // natFile.cc - Native part of File class for POSIX. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natFile.cc - Native part of File class for POSIX. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** java::io::File::_access (jint query) *** 60,73 **** jboolean java::io::File::_stat (jint query) { char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1); jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf); buf[total] = '\0'; - if (query == ISHIDDEN) - return (getName()->charAt(0) == '.'); - - #ifdef HAVE_STAT struct stat sb; if (::stat (buf, &sb)) return false; --- 60,73 ---- jboolean java::io::File::_stat (jint query) { + if (query == ISHIDDEN) + return getName()->charAt(0) == '.'; + + #ifdef HAVE_STAT char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1); jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf); buf[total] = '\0'; struct stat sb; if (::stat (buf, &sb)) return false; *************** java::io::File::attr (jint query) *** 104,112 **** jstring java::io::File::getCanonicalPath (void) { ! char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1); char buf2[MAXPATHLEN]; jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf); buf[total] = '\0'; #ifdef HAVE_REALPATH --- 104,119 ---- jstring java::io::File::getCanonicalPath (void) { ! // We use `+2' here because we might need to use `.' for our special ! // case. ! char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 2); char buf2[MAXPATHLEN]; jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf); + + // Special case: treat "" the same as ".". + if (total == 0) + buf[total++] = '.'; + buf[total] = '\0'; #ifdef HAVE_REALPATH *************** java::io::File::getCanonicalPath (void) *** 124,130 **** jboolean java::io::File::isAbsolute (void) { ! return path->charAt(0) == '/'; } jobjectArray --- 131,137 ---- jboolean java::io::File::isAbsolute (void) { ! return path->length() > 0 && path->charAt(0) == '/'; } jobjectArray diff -Nrc3pad gcc-3.2.3/libjava/java/io/natFileWin32.cc gcc-3.3/libjava/java/io/natFileWin32.cc *** gcc-3.2.3/libjava/java/io/natFileWin32.cc 2002-04-16 15:35:20.000000000 +0000 --- gcc-3.3/libjava/java/io/natFileWin32.cc 2003-04-19 19:19:50.000000000 +0000 *************** *** 1,6 **** ! // natFileWin32.cc - Native part of File class. ! /* Copyright (C) 1998, 1999, 2002 Red Hat, Inc. This file is part of libgcj. --- 1,6 ---- ! // natFileWin32.cc - Native part of File class for Win32. ! /* Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc. This file is part of libgcj. *************** details. */ *** 26,31 **** --- 26,44 ---- #include #include + // Java timestamps are milliseconds since the UNIX epoch (00:00:00 UTC on + // January 1, 1970) while Win32 file-times are 100-nanosecond intervals + // since the Win32 epoch (00:00:00 UTC on January 1, 1601). The following + // constant represents the number of milliseconds to be added to a + // Java timestamp to base it on the Win32 epoch. + // + // There were 369 years between 1601 and 1970, including 89 leap years + // (since 1700, 1800 and 1900 were not leap years): + // + // (89*366 + 280*365) days * 86400 seconds/day = 11644473600 seconds + // + #define WIN32_EPOCH_MILLIS 11644473600000LL + jboolean java::io::File::_access (jint query) { *************** java::io::File::attr (jint query) *** 83,99 **** JvAssert (query == MODIFIED || query == LENGTH); ! WIN32_FILE_ATTRIBUTE_DATA info; ! if (! GetFileAttributesEx(buf, GetFileExInfoStandard, &info)) return 0; ! if (query == LENGTH) ! return ((long long)info.nFileSizeHigh) << 32 | (unsigned long long)info.nFileSizeLow; ! else { ! // FIXME? This is somewhat compiler dependant (the LL constant suffix) ! // The file time as return by windows is the number of 100-nanosecond intervals since January 1, 1601 ! return (((((long long)info.ftLastWriteTime.dwHighDateTime) << 32) | ((unsigned long long)info.ftLastWriteTime.dwLowDateTime)) - 116444736000000000LL) / 10000LL; ! } } jstring --- 96,119 ---- JvAssert (query == MODIFIED || query == LENGTH); ! WIN32_FIND_DATA info; ! HANDLE sHandle; ! if ( ( sHandle = FindFirstFile( buf, &info)) == INVALID_HANDLE_VALUE) return 0; ! ! FindClose( sHandle); ! if (query == LENGTH) ! return ((long long)info.nFileSizeHigh) << 32 ! | (unsigned long long)info.nFileSizeLow; ! else ! { ! // The file time as returned by Windows is in terms of the number ! // of 100-nanosecond intervals since 00:00:00 UTC, January 1, 1601. ! return (((((long long)info.ftLastWriteTime.dwHighDateTime) << 32) ! | ((unsigned long long)info.ftLastWriteTime.dwLowDateTime)) ! - WIN32_EPOCH_MILLIS*10000LL) / 10000LL; ! } } jstring *************** java::io::File::getCanonicalPath (void) *** 116,123 **** jboolean java::io::File::isAbsolute (void) { ! if (path->charAt(0) == '/' || path->charAt(0) == '\\') return true; if (path->length() < 3) return false; // Hard-code A-Za-z because Windows (I think) can't use non-ASCII --- 136,149 ---- jboolean java::io::File::isAbsolute (void) { ! // See if the path represents a Windows UNC network path. ! if (path->length () > 2 ! && (path->charAt (0) == '\\') && (path->charAt (1) == '\\')) return true; + + // Note that the path is not an absolute path even if it starts with + // a '/' or a '\' because it lacks a drive specifier. + if (path->length() < 3) return false; // Hard-code A-Za-z because Windows (I think) can't use non-ASCII *************** java::io::File::isAbsolute (void) *** 129,136 **** && (path->charAt(2) == '/' || path->charAt(2) == '\\')); } ! void java::io::File::init_native() { } ! jobjectArray java::io::File::performList (java::io::FilenameFilter *filter, --- 155,165 ---- && (path->charAt(2) == '/' || path->charAt(2) == '\\')); } ! void java::io::File::init_native () ! { ! maxPathLen = MAX_PATH; ! caseSensitive = false; ! } jobjectArray java::io::File::performList (java::io::FilenameFilter *filter, *************** java::io::File::performList (java::io::F *** 142,149 **** return NULL; char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 5); jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf); ! // FIXME? ! strcpy(&buf[total], "\\*.*"); WIN32_FIND_DATA data; HANDLE handle = FindFirstFile (buf, &data); --- 171,180 ---- return NULL; char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 5); jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf); ! if (buf[total-1] == '\\') ! strcpy (&buf[total], "*.*"); ! else ! strcpy (&buf[total], "\\*.*"); WIN32_FIND_DATA data; HANDLE handle = FindFirstFile (buf, &data); *************** java::io::File::performList (java::io::F *** 183,189 **** return ret; } - jboolean java::io::File::performMkdir (void) { --- 214,219 ---- *************** java::io::File::performDelete () *** 226,232 **** return (DeleteFile (buf)) ? true : false; } ! jboolean java::io::File::performCreate (void) { JvFail("unimplemented\n"); } ! jboolean java::io::File::performSetReadOnly() { JvFail("unimplemented"); } ! jboolean java::io::File::performSetLastModified(jlong time) { JvFail("unimplemented"); } ! JArray* java::io::File::performListRoots() { JvFail("unimplemented"); } --- 256,367 ---- return (DeleteFile (buf)) ? true : false; } ! jboolean java::io::File::performCreate (void) ! { ! jstring canon = getCanonicalPath (); ! char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1); ! jsize total = JvGetStringUTFRegion (canon, 0, canon->length (), buf); ! buf[total] = '\0'; ! ! HANDLE h = CreateFile (buf, 0, 0, NULL, CREATE_NEW, ! FILE_ATTRIBUTE_NORMAL, NULL); ! if (h != INVALID_HANDLE_VALUE) ! { ! CloseHandle (h); ! return true; ! } ! else ! { ! if (GetLastError () == ERROR_ALREADY_EXISTS) ! return false; ! else ! throw new IOException (JvNewStringLatin1 ("CreateFile failed")); ! } ! } ! ! jboolean java::io::File::performSetReadOnly () ! { ! jstring canon = getCanonicalPath (); ! char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1); ! jsize total = JvGetStringUTFRegion (canon, 0, canon->length (), buf); ! buf[total] = '\0'; ! ! DWORD attrs = GetFileAttributes (buf); ! if (attrs != INVALID_FILE_ATTRIBUTES) ! { ! if (SetFileAttributes (buf, attrs | FILE_ATTRIBUTE_READONLY) != 0) ! return true; ! else ! return false; ! } ! else ! return false; ! } ! ! jboolean java::io::File::performSetLastModified (jlong time) ! { ! jstring canon = getCanonicalPath (); ! char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 1); ! jsize total = JvGetStringUTFRegion (canon, 0, canon->length (), buf); ! buf[total] = '\0'; ! ! FILETIME modTime; ! long long mTime100ns = ((long long) time /* Ha! */ ! + WIN32_EPOCH_MILLIS) * 10000LL; ! ! modTime.dwLowDateTime = (DWORD) mTime100ns; ! modTime.dwHighDateTime = (DWORD) (mTime100ns >> 32); ! ! jboolean retVal = false; ! HANDLE h = CreateFile (buf, FILE_WRITE_ATTRIBUTES, ! FILE_SHARE_READ | FILE_SHARE_WRITE, ! NULL, OPEN_EXISTING, 0, NULL); ! ! if (h != INVALID_HANDLE_VALUE) ! { ! if (SetFileTime (h, NULL, &modTime, &modTime) != 0) ! retVal = true; ! ! CloseHandle (h); ! } ! ! return retVal; ! } ! ! JArray* java::io::File::performListRoots () ! { ! DWORD drivesBitmap = GetLogicalDrives (); ! DWORD mask; ! ! // Possible drive letters are from ASCII 'A'-'Z'. ! int numDrives = 0; ! mask = 1; ! for (int i = 0; i < 26; i++) ! { ! if ((drivesBitmap & mask) != 0) ! numDrives++; ! mask <<= 1; ! } ! ! JArray *roots ! = reinterpret_cast *> ! (JvNewObjectArray (numDrives, &java::io::File::class$, NULL)); ! ! ::java::io::File **rootsArray = elements (roots); ! ! char aDriveRoot[] = {'A', ':', '\\', '\0'}; ! mask = 1; ! for (int i = 0, j = 0; i < 26; i++) ! { ! if ((drivesBitmap & mask) != 0) ! { ! rootsArray[j] ! = new ::java::io::File (JvNewStringLatin1 (aDriveRoot)); ! j++; ! } ! mask <<= 1; ! aDriveRoot[0]++; ! } ! ! return roots; ! } diff -Nrc3pad gcc-3.2.3/libjava/java/io/natObjectInputStream.cc gcc-3.3/libjava/java/io/natObjectInputStream.cc *** gcc-3.2.3/libjava/java/io/natObjectInputStream.cc 2001-12-09 00:17:07.000000000 +0000 --- gcc-3.3/libjava/java/io/natObjectInputStream.cc 2003-02-28 12:37:01.000000000 +0000 *************** java::io::ObjectInputStream::callConstru *** 69,84 **** + m->offset); _Jv_CallAnyMethodA (obj, JvPrimClass (void), meth, false, arg_types, NULL); } - - java::lang::reflect::Field * - java::io::ObjectInputStream::getField (jclass klass, jstring name) - { - return klass->getPrivateField (name); - } - - java::lang::reflect::Method * - java::io::ObjectInputStream::getMethod (jclass klass, jstring name, - JArray *arg_types) - { - return klass->getPrivateMethod (name, arg_types); - } --- 69,71 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/io/natObjectOutputStream.cc gcc-3.3/libjava/java/io/natObjectOutputStream.cc *** gcc-3.2.3/libjava/java/io/natObjectOutputStream.cc 2000-05-19 17:55:31.000000000 +0000 --- gcc-3.3/libjava/java/io/natObjectOutputStream.cc 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,33 **** - // natObjectOutputStream.cc - Native part of ObjectOutputStream class. - - /* Copyright (C) 1998, 1999 Free Software Foundation - - This ObjectOutputStream is part of libgcj. - - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the ObjectOutputStream "LIBGCJ_LICENSE" for - details. */ - - #include - - #include - #include - #include - #include - #include - #include - - - java::lang::reflect::Field * - java::io::ObjectOutputStream::getField (jclass klass, jstring name) - { - return klass->getPrivateField (name); - } - - java::lang::reflect::Method * - java::io::ObjectOutputStream::getMethod (jclass klass, jstring name, - JArray *arg_types) - { - return klass->getPrivateMethod (name, arg_types); - } - --- 0 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/io/natVMObjectStreamClass.cc gcc-3.3/libjava/java/io/natVMObjectStreamClass.cc *** gcc-3.2.3/libjava/java/io/natVMObjectStreamClass.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/io/natVMObjectStreamClass.cc 2003-01-20 06:49:28.000000000 +0000 *************** *** 0 **** --- 1,23 ---- + // natVMObjectStreamClass.cc - Native part of VMObjectStreamClass class. + + /* Copyright (C) 2003 Free Software Foundation + + This VMObjectStreamClass is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the ObjectInputStream "LIBGCJ_LICENSE" for + details. */ + + #include + #include + + #include + #include + + jboolean + java::io::VMObjectStreamClass::hasClassInitializer (jclass klass) + { + _Jv_Method *meth = _Jv_GetMethodLocal(klass, gcj::clinit_name, + gcj::void_signature); + return (meth != NULL); + } diff -Nrc3pad gcc-3.2.3/libjava/java/io/NotActiveException.java gcc-3.3/libjava/java/io/NotActiveException.java *** gcc-3.2.3/libjava/java/io/NotActiveException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/NotActiveException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* NotActiveException.java -- Unexpected end of file exception ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NotActiveException.java -- thrown when serialization is not active ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,79 **** package java.io; /** ! * This exception is thrown when a problem occurs due to the fact that ! * serialization is not active. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class NotActiveException extends ObjectStreamException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new NotActiveException without a descriptive error message ! */ ! public ! NotActiveException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new NotActiveException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! NotActiveException(String message) ! { ! super(message); ! } } // class NotActiveException - --- 39,72 ---- package java.io; /** ! * This exception is thrown when a problem occurs due to the fact that ! * serialization is not active. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.1 ! * @status updated to 1.4 */ ! public class NotActiveException extends ObjectStreamException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -3893467273049808895L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public NotActiveException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public NotActiveException(String message) + { + super(message); + } } // class NotActiveException diff -Nrc3pad gcc-3.2.3/libjava/java/io/NotSerializableException.java gcc-3.3/libjava/java/io/NotSerializableException.java *** gcc-3.2.3/libjava/java/io/NotSerializableException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/NotSerializableException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* NotSerializableException.java -- Unexpected end of file exception ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NotSerializableException.java -- a Serializable class that isn't ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,80 **** package java.io; /** ! * This exception is thrown when a class may not be serialized. The ! * descriptive message will consist of the name of the class in question. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class NotSerializableException extends ObjectStreamException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new NotSerializableException without a descriptive error message ! */ ! public ! NotSerializableException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new NotSerializableException with a descriptive error message String ! * This should be the name of the class that cannot be serialized. ! * ! * @param message The descriptive error message ! */ ! public ! NotSerializableException(String message) ! { ! super(message); ! } } // class NotSerializableException - --- 39,74 ---- package java.io; /** ! * This exception is thrown when a class implements Serializable because ! * of a superclass, but should not be serialized. The descriptive message ! * will consist of the name of the class in question. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.1 ! * @status updated to 1.4 */ ! public class NotSerializableException extends ObjectStreamException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 2906642554793891381L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public NotSerializableException() ! { ! } + /** + * Create an exception with a descriptive error message, which should + * be the name of the class. + * + * @param message the descriptive error message + */ + public NotSerializableException(String message) + { + super(message); + } } // class NotSerializableException diff -Nrc3pad gcc-3.2.3/libjava/java/io/ObjectInputStream.java gcc-3.3/libjava/java/io/ObjectInputStream.java *** gcc-3.2.3/libjava/java/io/ObjectInputStream.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/ObjectInputStream.java 2003-03-14 12:06:41.000000000 +0000 *************** *** 1,5 **** /* ObjectInputStream.java -- Class used to read serialized objects ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ObjectInputStream.java -- Class used to read serialized objects ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,47 **** package java.io; - import gnu.classpath.Configuration; - import java.lang.reflect.Array; import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.Hashtable; import java.util.Vector; --- 38,46 ---- package java.io; import java.lang.reflect.Array; import java.lang.reflect.Modifier; + import java.lang.reflect.Proxy; import java.util.Arrays; import java.util.Hashtable; import java.util.Vector; *************** import java.lang.reflect.Field; *** 52,58 **** import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; ! public class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants --- 51,57 ---- import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; ! import gnu.classpath.Configuration; public class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants *************** public class ObjectInputStream extends I *** 129,415 **** Object ret_val; was_deserializing = this.isDeserializing; ! if (! was_deserializing) ! setBlockDataMode (false); this.isDeserializing = true; byte marker = this.realInputStream.readByte (); dumpElement ("MARKER: 0x" + Integer.toHexString(marker) + " "); ! switch (marker) ! { ! case TC_BLOCKDATA: ! case TC_BLOCKDATALONG: ! if (marker == TC_BLOCKDATALONG) ! dumpElementln ("BLOCKDATALONG"); ! else ! dumpElementln ("BLOCKDATA"); ! readNextBlock (marker); ! throw new StreamCorruptedException ("Unexpected blockData"); ! ! case TC_NULL: ! dumpElementln ("NULL"); ! ret_val = null; ! break; ! ! case TC_REFERENCE: ! { ! dumpElement ("REFERENCE "); ! Integer oid = new Integer (this.realInputStream.readInt ()); ! dumpElementln (Integer.toHexString(oid.intValue())); ! ret_val = ((ObjectIdentityWrapper) ! this.objectLookupTable.get (oid)).object; ! break; ! } ! ! case TC_CLASS: ! { ! dumpElementln ("CLASS"); ! ObjectStreamClass osc = (ObjectStreamClass)readObject (); ! Class clazz = osc.forClass (); ! assignNewHandle (clazz); ! ret_val = clazz; ! break; ! } ! ! case TC_CLASSDESC: ! { ! dumpElement ("CLASSDESC NAME="); ! String name = this.realInputStream.readUTF (); ! dumpElement (name + "; UID="); ! long uid = this.realInputStream.readLong (); ! dumpElement (Long.toHexString(uid) + "; FLAGS="); ! byte flags = this.realInputStream.readByte (); ! dumpElement (Integer.toHexString(flags) + "; FIELD COUNT="); ! short field_count = this.realInputStream.readShort (); ! dumpElementln (Short.toString(field_count)); ! ObjectStreamField[] fields = new ObjectStreamField[field_count]; ! ! ObjectStreamClass osc = new ObjectStreamClass (name, uid, ! flags, fields); ! assignNewHandle (osc); ! ! for (int i=0; i < field_count; i++) ! { ! dumpElement (" TYPE CODE="); ! char type_code = (char)this.realInputStream.readByte (); ! dumpElement (type_code + "; FIELD NAME="); ! String field_name = this.realInputStream.readUTF (); ! dumpElementln (field_name); ! String class_name; ! ! if (type_code == 'L' || type_code == '[') ! class_name = (String)readObject (); ! else ! class_name = String.valueOf (type_code); ! ! fields[i] = ! new ObjectStreamField (field_name, ! TypeSignature.getClassForEncoding ! (class_name)); ! } ! ! Class cl = resolveClass (osc); ! osc.setClass (cl); ! setBlockDataMode (false); ! ! if (this.realInputStream.readByte () != TC_ENDBLOCKDATA) ! throw new IOException ("Data annotated to class was not consumed."); ! dumpElementln ("ENDBLOCKDATA "); ! ! osc.setSuperclass ((ObjectStreamClass)readObject ()); ! ret_val = osc; ! break; ! } ! ! case TC_STRING: ! { ! dumpElement ("STRING="); ! String s = this.realInputStream.readUTF (); ! dumpElementln (s); ! ret_val = processResolution (s, assignNewHandle (s)); ! break; ! } ! ! case TC_ARRAY: ! { ! dumpElementln ("ARRAY"); ! ObjectStreamClass osc = (ObjectStreamClass)readObject (); ! Class componentType = osc.forClass ().getComponentType (); ! dumpElement ("ARRAY LENGTH="); ! int length = this.realInputStream.readInt (); ! dumpElementln (length + "; COMPONENT TYPE=" + componentType); ! Object array = Array.newInstance (componentType, length); ! int handle = assignNewHandle (array); ! readArrayElements (array, componentType); ! for (int i=0, len=Array.getLength(array); i < len; i++) ! dumpElementln (" ELEMENT[" + i + "]=" + Array.get(array, i).toString()); ! ret_val = processResolution (array, handle); ! break; ! } ! ! case TC_OBJECT: { ! dumpElementln ("OBJECT"); ! ObjectStreamClass osc = (ObjectStreamClass)readObject (); ! Class clazz = osc.forClass (); ! ! if (!Serializable.class.isAssignableFrom (clazz)) ! throw new NotSerializableException (clazz + " is not Serializable, and thus cannot be deserialized."); ! ! if (Externalizable.class.isAssignableFrom (clazz)) ! { ! Externalizable obj = null; ! ! try ! { ! obj = (Externalizable)clazz.newInstance (); ! } ! catch (InstantiationException e) ! { ! throw new ClassNotFoundException ("Instance of " + clazz ! + " could not be created"); ! } ! catch (IllegalAccessException e) ! { ! throw new ClassNotFoundException ("Instance of " + clazz ! + " could not be created because class or zero-argument constructor is not accessible"); ! } ! catch (NoSuchMethodError e) { ! throw new ClassNotFoundException ("Instance of " + clazz ! + " could not be created because zero-argument constructor is not defined"); ! } ! ! int handle = assignNewHandle (obj); ! ! boolean read_from_blocks = ((osc.getFlags () & SC_BLOCK_DATA) != 0); ! ! if (read_from_blocks) ! setBlockDataMode (true); ! ! obj.readExternal (this); ! if (read_from_blocks) ! setBlockDataMode (false); ! ret_val = processResolution (obj, handle); ! break; ! } // end if (Externalizable.class.isAssignableFrom (clazz)) ! // find the first non-serializable, non-abstract ! // class in clazz's inheritance hierarchy ! Class first_nonserial = clazz.getSuperclass (); ! while (Serializable.class.isAssignableFrom (first_nonserial) ! || Modifier.isAbstract (first_nonserial.getModifiers ())) ! first_nonserial = first_nonserial.getSuperclass (); ! // DEBUGln ("Using " + first_nonserial ! // + " as starting point for constructing " + clazz); ! Object obj = null; ! obj = newObject (clazz, first_nonserial); ! if (obj == null) ! throw new ClassNotFoundException ("Instance of " + clazz + ! " could not be created"); ! int handle = assignNewHandle (obj); ! this.currentObject = obj; ! ObjectStreamClass[] hierarchy = ! ObjectStreamClass.getObjectStreamClasses (clazz); ! // DEBUGln ("Got class hierarchy of depth " + hierarchy.length); ! boolean has_read; ! for (int i=0; i < hierarchy.length; i++) ! { ! this.currentObjectStreamClass = hierarchy[i]; ! dumpElementln ("Reading fields of " ! + this.currentObjectStreamClass.getName ()); ! has_read = true; ! try ! { ! this.currentObjectStreamClass.forClass (). ! getDeclaredMethod ("readObject", readObjectParams); ! } ! catch (NoSuchMethodException e) ! { ! has_read = false; ! } ! // XXX: should initialize fields in classes in the hierarchy ! // that aren't in the stream ! // should skip over classes in the stream that aren't in the ! // real classes hierarchy ! readFields (obj, this.currentObjectStreamClass.fields, ! has_read, this.currentObjectStreamClass); ! if (has_read) ! { ! dumpElement ("ENDBLOCKDATA? "); ! try ! { ! // FIXME: XXX: This try block is to catch EOF which is ! // thrown for some objects. That indicates a bug in the logic. ! if (this.realInputStream.readByte () != TC_ENDBLOCKDATA) ! throw new IOException ("No end of block data seen for class with readObject (ObjectInputStream) method."); ! dumpElementln ("yes"); ! } ! catch (EOFException e) ! { ! dumpElementln ("no, got EOFException"); ! } ! catch (IOException e) ! { ! dumpElementln ("no, got IOException"); ! } } - } - - this.currentObject = null; - this.currentObjectStreamClass = null; - ret_val = processResolution (obj, handle); - break; } ! ! case TC_RESET: ! dumpElementln ("RESET"); ! clearHandles (); ! ret_val = readObject (); ! break; ! ! case TC_EXCEPTION: { ! dumpElement ("EXCEPTION="); ! Exception e = (Exception)readObject (); ! dumpElementln (e.toString()); ! clearHandles (); ! throw new WriteAbortedException ("Exception thrown during writing of stream", e); } ! ! default: ! throw new IOException ("Unknown marker on stream"); ! } ! ! this.isDeserializing = was_deserializing; ! ! if (! was_deserializing) ! { ! setBlockDataMode (true); ! ! if (validators.size () > 0) ! invokeValidators (); ! } ! return ret_val; } - /** Reads the current objects non-transient, non-static fields from the current class from the underlying output stream. --- 128,456 ---- Object ret_val; was_deserializing = this.isDeserializing; ! boolean is_consumed = false; ! boolean old_mode = setBlockDataMode (false); this.isDeserializing = true; byte marker = this.realInputStream.readByte (); dumpElement ("MARKER: 0x" + Integer.toHexString(marker) + " "); ! try { ! switch (marker) { ! case TC_ENDBLOCKDATA: ! { ! ret_val = null; ! is_consumed = true; ! break; ! } ! case TC_BLOCKDATA: ! case TC_BLOCKDATALONG: ! { ! if (marker == TC_BLOCKDATALONG) ! dumpElementln ("BLOCKDATALONG"); ! else ! dumpElementln ("BLOCKDATA"); ! readNextBlock (marker); ! throw new StreamCorruptedException ("Unexpected blockData"); ! } ! case TC_NULL: ! { ! dumpElementln ("NULL"); ! ret_val = null; ! break; ! } ! case TC_REFERENCE: ! { ! dumpElement ("REFERENCE "); ! Integer oid = new Integer (this.realInputStream.readInt ()); ! dumpElementln (Integer.toHexString(oid.intValue())); ! ret_val = ((ObjectIdentityWrapper) ! this.objectLookupTable.get (oid)).object; ! break; ! } ! case TC_CLASS: ! { ! dumpElementln ("CLASS"); ! ObjectStreamClass osc = (ObjectStreamClass)readObject (); ! Class clazz = osc.forClass (); ! assignNewHandle (clazz); ! ret_val = clazz; ! break; ! } ! case TC_PROXYCLASSDESC: ! { ! dumpElementln ("PROXYCLASS"); ! int n_intf = this.realInputStream.readInt(); ! String[] intfs = new String[n_intf]; ! for (int i = 0; i < n_intf; i++) ! { ! intfs[i] = this.realInputStream.readUTF(); ! System.out.println(intfs[i]); ! } ! ! boolean oldmode = setBlockDataMode (true); ! Class cl = resolveProxyClass(intfs); ! setBlockDataMode(oldmode); ! ! ObjectStreamClass osc = ObjectStreamClass.lookup(cl); ! assignNewHandle (osc); ! ! if (!is_consumed) ! { ! byte b = this.realInputStream.readByte (); ! if (b != TC_ENDBLOCKDATA) ! throw new IOException ("Data annotated to class was not consumed." + b); ! } ! else ! is_consumed = false; ! ObjectStreamClass superosc = (ObjectStreamClass)readObject (); ! osc.setSuperclass (superosc); ! ret_val = osc; ! break; ! } ! case TC_CLASSDESC: ! { ! dumpElement ("CLASSDESC NAME="); ! String name = this.realInputStream.readUTF (); ! dumpElement (name + "; UID="); ! long uid = this.realInputStream.readLong (); ! dumpElement (Long.toHexString(uid) + "; FLAGS="); ! byte flags = this.realInputStream.readByte (); ! dumpElement (Integer.toHexString(flags) + "; FIELD COUNT="); ! short field_count = this.realInputStream.readShort (); ! dumpElementln (Short.toString(field_count)); ! ObjectStreamField[] fields = new ObjectStreamField[field_count]; ! ObjectStreamClass osc = new ObjectStreamClass (name, uid, ! flags, fields); ! assignNewHandle (osc); ! ! for (int i=0; i < field_count; i++) ! { ! dumpElement (" TYPE CODE="); ! char type_code = (char)this.realInputStream.readByte (); ! dumpElement (type_code + "; FIELD NAME="); ! String field_name = this.realInputStream.readUTF (); ! dumpElementln (field_name); ! String class_name; ! ! if (type_code == 'L' || type_code == '[') ! class_name = (String)readObject (); ! else ! class_name = String.valueOf (type_code); ! ! // There're many cases you can't get java.lang.Class from ! // typename if your context class loader can't load it, ! // then use typename to construct the field ! fields[i] = ! new ObjectStreamField (field_name, class_name); ! } ! ! boolean oldmode = setBlockDataMode (true); ! osc.setClass (resolveClass (osc)); ! setBlockDataMode (oldmode); ! ! if (!is_consumed) ! { ! byte b = this.realInputStream.readByte (); ! if (b != TC_ENDBLOCKDATA) ! throw new IOException ("Data annotated to class was not consumed." + b); ! } ! else ! is_consumed = false; ! ! osc.setSuperclass ((ObjectStreamClass)readObject ()); ! ret_val = osc; ! break; ! } ! case TC_STRING: ! case TC_LONGSTRING: ! { ! dumpElement ("STRING="); ! String s = this.realInputStream.readUTF (); ! dumpElementln (s); ! ret_val = processResolution (s, assignNewHandle (s)); ! break; ! } ! case TC_ARRAY: ! { ! dumpElementln ("ARRAY"); ! ObjectStreamClass osc = (ObjectStreamClass)readObject (); ! Class componentType = osc.forClass ().getComponentType (); ! dumpElement ("ARRAY LENGTH="); ! int length = this.realInputStream.readInt (); ! dumpElementln (length + "; COMPONENT TYPE=" + componentType); ! Object array = Array.newInstance (componentType, length); ! int handle = assignNewHandle (array); ! readArrayElements (array, componentType); ! for (int i=0, len=Array.getLength(array); i < len; i++) ! dumpElementln (" ELEMENT[" + i + "]=" + Array.get(array, i)); ! ret_val = processResolution (array, handle); ! break; ! } ! case TC_OBJECT: ! { ! dumpElementln ("OBJECT"); ! ObjectStreamClass osc = (ObjectStreamClass)readObject (); ! Class clazz = osc.forClass (); ! ! if (!Serializable.class.isAssignableFrom (clazz)) ! throw new NotSerializableException (clazz + " is not Serializable, and thus cannot be deserialized."); ! ! if (Externalizable.class.isAssignableFrom (clazz)) ! { ! Externalizable obj = null; ! ! try ! { ! obj = (Externalizable)clazz.newInstance (); ! } ! catch (InstantiationException e) ! { ! throw new ClassNotFoundException ("Instance of " + clazz ! + " could not be created"); ! } ! catch (IllegalAccessException e) ! { ! throw new ClassNotFoundException ("Instance of " + clazz ! + " could not be created because class or zero-argument constructor is not accessible"); ! } ! catch (NoSuchMethodError e) ! { ! throw new ClassNotFoundException ("Instance of " + clazz ! + " could not be created because zero-argument constructor is not defined"); ! } ! ! int handle = assignNewHandle (obj); ! ! boolean read_from_blocks = ((osc.getFlags () & SC_BLOCK_DATA) != 0); ! ! boolean oldmode = this.readDataFromBlock; ! if (read_from_blocks) ! setBlockDataMode (true); ! ! obj.readExternal (this); ! ! if (read_from_blocks) ! setBlockDataMode (oldmode); ! ! ret_val = processResolution (obj, handle); ! break; ! } // end if (Externalizable.class.isAssignableFrom (clazz)) ! ! // find the first non-serializable, non-abstract ! // class in clazz's inheritance hierarchy ! Class first_nonserial = clazz.getSuperclass (); ! while (Serializable.class.isAssignableFrom (first_nonserial) ! || Modifier.isAbstract (first_nonserial.getModifiers ())) ! first_nonserial = first_nonserial.getSuperclass (); ! ! Object obj = null; ! obj = newObject (clazz, first_nonserial); ! ! if (obj == null) ! throw new ClassNotFoundException ("Instance of " + clazz + ! " could not be created"); ! ! int handle = assignNewHandle (obj); ! this.currentObject = obj; ! ObjectStreamClass[] hierarchy = ! ObjectStreamClass.getObjectStreamClasses (clazz); ! ! for (int i=0; i < hierarchy.length; i++) ! { ! this.currentObjectStreamClass = hierarchy[i]; ! ! dumpElementln ("Reading fields of " ! + this.currentObjectStreamClass.getName ()); ! // XXX: should initialize fields in classes in the hierarchy ! // that aren't in the stream ! // should skip over classes in the stream that aren't in the ! // real classes hierarchy ! ! if (this.currentObjectStreamClass.hasReadMethod()) ! { ! fieldsAlreadyRead = false; ! boolean oldmode = setBlockDataMode (true); ! callReadMethod (obj, this.currentObjectStreamClass); ! setBlockDataMode (oldmode); ! dumpElement ("ENDBLOCKDATA? "); ! try ! { ! // FIXME: XXX: This try block is to catch EOF which is ! // thrown for some objects. That indicates a bug in the logic. ! if (this.realInputStream.readByte () != TC_ENDBLOCKDATA) ! throw new IOException ("No end of block data seen for class with readObject (ObjectInputStream) method."); ! dumpElementln ("yes"); ! } ! catch (EOFException e) ! { ! dumpElementln ("no, got EOFException"); ! } ! catch (IOException e) ! { ! dumpElementln ("no, got IOException"); ! } ! } ! else ! { ! readFields (obj, currentObjectStreamClass); ! } ! } ! this.currentObject = null; ! this.currentObjectStreamClass = null; ! ret_val = processResolution (obj, handle); ! break; ! } ! case TC_RESET: ! dumpElementln ("RESET"); ! clearHandles (); ! ret_val = readObject (); ! break; ! case TC_EXCEPTION: ! { ! dumpElement ("EXCEPTION="); ! Exception e = (Exception)readObject (); ! dumpElementln (e.toString()); ! clearHandles (); ! throw new WriteAbortedException ("Exception thrown during writing of stream", e); ! } ! default: ! throw new IOException ("Unknown marker on stream: " + marker); } } ! finally { ! setBlockDataMode (old_mode); ! ! this.isDeserializing = was_deserializing; ! ! if (! was_deserializing) ! { ! if (validators.size () > 0) ! invokeValidators (); ! } } ! return ret_val; } /** Reads the current objects non-transient, non-static fields from the current class from the underlying output stream. *************** public class ObjectInputStream extends I *** 438,446 **** if (fieldsAlreadyRead) throw new NotActiveException ("defaultReadObject called but fields already read from stream (by defaultReadObject or readFields)"); ! readFields (this.currentObject, ! this.currentObjectStreamClass.fields, ! false, this.currentObjectStreamClass); fieldsAlreadyRead = true; } --- 479,487 ---- if (fieldsAlreadyRead) throw new NotActiveException ("defaultReadObject called but fields already read from stream (by defaultReadObject or readFields)"); ! boolean oldmode = setBlockDataMode(false); ! readFields (this.currentObject, this.currentObjectStreamClass); ! setBlockDataMode(oldmode); fieldsAlreadyRead = true; } *************** public class ObjectInputStream extends I *** 499,511 **** throws ClassNotFoundException, IOException { SecurityManager sm = System.getSecurityManager (); // FIXME: currentClassLoader doesn't yet do anything useful. We need // to call forName() with the classloader of the class which called // readObject(). See SecurityManager.getClassContext(). ClassLoader cl = currentClassLoader (sm); ! return Class.forName (osc.getName (), true, cl); } /** --- 540,557 ---- throws ClassNotFoundException, IOException { SecurityManager sm = System.getSecurityManager (); + if (sm == null) + sm = new SecurityManager () {}; // FIXME: currentClassLoader doesn't yet do anything useful. We need // to call forName() with the classloader of the class which called // readObject(). See SecurityManager.getClassContext(). ClassLoader cl = currentClassLoader (sm); ! if (cl == null) ! return Class.forName (osc.getName ()); ! else ! return cl.loadClass (osc.getName ()); } /** *************** public class ObjectInputStream extends I *** 527,532 **** --- 573,604 ---- } + protected Class resolveProxyClass (String[] intfs) + throws IOException, ClassNotFoundException + { + SecurityManager sm = System.getSecurityManager (); + + if (sm == null) + sm = new SecurityManager () {}; + + ClassLoader cl = currentClassLoader (sm); + + Class[] clss = new Class[intfs.length]; + if(cl == null){ + for (int i = 0; i < intfs.length; i++) + clss[i] = Class.forName(intfs[i]); + cl = ClassLoader.getSystemClassLoader(); + } + else + for (int i = 0; i < intfs.length; i++) + clss[i] = cl.loadClass(intfs[i]); + try { + return Proxy.getProxyClass(cl, clss); + } catch (IllegalArgumentException e) { + throw new ClassNotFoundException(null, e); + } + } + /** If enable is true and this object is trusted, then resolveObject (Object) will be called *************** public class ObjectInputStream extends I *** 576,586 **** public int read () throws IOException { if (this.readDataFromBlock) ! { ! if (this.blockDataPosition >= this.blockDataBytes) ! readNextBlock (); ! return (this.blockData[this.blockDataPosition++] & 0xff); ! } else return this.realInputStream.read (); } --- 648,658 ---- public int read () throws IOException { if (this.readDataFromBlock) ! { ! if (this.blockDataPosition >= this.blockDataBytes) ! readNextBlock (); ! return (this.blockData[this.blockDataPosition++] & 0xff); ! } else return this.realInputStream.read (); } *************** public class ObjectInputStream extends I *** 588,603 **** public int read (byte[] data, int offset, int length) throws IOException { if (this.readDataFromBlock) ! { ! if (this.blockDataPosition + length > this.blockDataBytes) ! readNextBlock (); ! System.arraycopy (this.blockData, this.blockDataPosition, ! data, offset, length); ! blockDataPosition += length; ! return length; ! } else return this.realInputStream.read (data, offset, length); } --- 660,685 ---- public int read (byte[] data, int offset, int length) throws IOException { if (this.readDataFromBlock) ! { ! if (this.blockDataPosition + length > this.blockDataBytes) ! { ! int remain = this.blockDataBytes - this.blockDataPosition; ! if (remain != 0) ! { ! System.arraycopy (this.blockData, this.blockDataPosition, ! data, offset, remain); ! offset += remain; ! length -= remain; ! } ! readNextBlock (); ! } ! System.arraycopy (this.blockData, this.blockDataPosition, ! data, offset, length); ! this.blockDataPosition += length; ! return length; ! } else return this.realInputStream.read (data, offset, length); } *************** public class ObjectInputStream extends I *** 605,616 **** public int available () throws IOException { if (this.readDataFromBlock) ! { ! if (this.blockDataPosition >= this.blockDataBytes) ! readNextBlock (); ! return this.blockDataBytes - this.blockDataPosition; ! } else return this.realInputStream.available (); } --- 687,698 ---- public int available () throws IOException { if (this.readDataFromBlock) ! { ! if (this.blockDataPosition >= this.blockDataBytes) ! readNextBlock (); ! return this.blockDataBytes - this.blockDataPosition; ! } else return this.realInputStream.available (); } *************** public class ObjectInputStream extends I *** 758,938 **** // Apparently Block data is not used with GetField as per // empirical evidence against JDK 1.2. Also see Mauve test // java.io.ObjectInputOutput.Test.GetPutField. ! setBlockDataMode (false); readFully (prim_field_data); for (int i = 0; i < objs.length; ++ i) objs[i] = readObject (); ! setBlockDataMode (true); return new GetField () - { - public ObjectStreamClass getObjectStreamClass () { ! return clazz; ! } ! public boolean defaulted (String name) ! throws IOException, IllegalArgumentException ! { ! return clazz.getField (name) == null; ! } ! public boolean get (String name, boolean defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Boolean.TYPE); ! if (field == null) ! return defvalue; ! return prim_field_data[field.getOffset ()] == 0 ? false : true; ! } ! public char get (String name, char defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Character.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return (char)(((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public byte get (String name, byte defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Byte.TYPE); ! if (field == null) ! return defvalue; ! return prim_field_data[field.getOffset ()]; ! } ! public short get (String name, short defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Short.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return (short)(((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public int get (String name, int defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Integer.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return ((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF); ! } ! public long get (String name, long defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Long.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return (long)(((prim_field_data[off++] & 0xFF) << 56) ! | ((prim_field_data[off++] & 0xFF) << 48) ! | ((prim_field_data[off++] & 0xFF) << 40) ! | ((prim_field_data[off++] & 0xFF) << 32) ! | ((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public float get (String name, float defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Float.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return Float.intBitsToFloat (((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public double get (String name, double defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Double.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return Double.longBitsToDouble ( ! (long)(((prim_field_data[off++] & 0xFF) << 56) ! | ((prim_field_data[off++] & 0xFF) << 48) ! | ((prim_field_data[off++] & 0xFF) << 40) ! | ((prim_field_data[off++] & 0xFF) << 32) ! | ((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF))); ! } ! public Object get (String name, Object defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = ! getField (name, defvalue == null ? null : defvalue.getClass ()); ! if (field == null) ! return defvalue; ! return objs[field.getOffset ()]; ! } ! private ObjectStreamField getField (String name, Class type) ! throws IllegalArgumentException ! { ! ObjectStreamField field = clazz.getField (name); ! if (field == null) ! return null; ! Class field_type = field.getType (); ! if (type == field_type || ! (type == null && ! field_type.isPrimitive ())) ! return field; ! throw new IllegalArgumentException ("Field requested is of type " ! + field_type.getName () ! + ", but requested type was " ! + (type == null ? ! "Object" : type.getName ())); ! } ! }; } --- 840,1020 ---- // Apparently Block data is not used with GetField as per // empirical evidence against JDK 1.2. Also see Mauve test // java.io.ObjectInputOutput.Test.GetPutField. ! boolean oldmode = setBlockDataMode (false); readFully (prim_field_data); for (int i = 0; i < objs.length; ++ i) objs[i] = readObject (); ! setBlockDataMode (oldmode); return new GetField () { ! public ObjectStreamClass getObjectStreamClass () ! { ! return clazz; ! } ! public boolean defaulted (String name) ! throws IOException, IllegalArgumentException ! { ! return clazz.getField (name) == null; ! } ! public boolean get (String name, boolean defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Boolean.TYPE); ! if (field == null) ! return defvalue; ! return prim_field_data[field.getOffset ()] == 0 ? false : true; ! } ! public char get (String name, char defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Character.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return (char)(((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public byte get (String name, byte defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Byte.TYPE); ! if (field == null) ! return defvalue; ! return prim_field_data[field.getOffset ()]; ! } ! public short get (String name, short defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Short.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return (short)(((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public int get (String name, int defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Integer.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return ((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF); ! } ! public long get (String name, long defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Long.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return (long)(((prim_field_data[off++] & 0xFF) << 56) ! | ((prim_field_data[off++] & 0xFF) << 48) ! | ((prim_field_data[off++] & 0xFF) << 40) ! | ((prim_field_data[off++] & 0xFF) << 32) ! | ((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public float get (String name, float defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Float.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return Float.intBitsToFloat (((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF)); ! } ! public double get (String name, double defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = getField (name, Double.TYPE); ! if (field == null) ! return defvalue; ! int off = field.getOffset (); ! return Double.longBitsToDouble ! ( (long) (((prim_field_data[off++] & 0xFF) << 56) ! | ((prim_field_data[off++] & 0xFF) << 48) ! | ((prim_field_data[off++] & 0xFF) << 40) ! | ((prim_field_data[off++] & 0xFF) << 32) ! | ((prim_field_data[off++] & 0xFF) << 24) ! | ((prim_field_data[off++] & 0xFF) << 16) ! | ((prim_field_data[off++] & 0xFF) << 8) ! | (prim_field_data[off] & 0xFF))); ! } ! public Object get (String name, Object defvalue) ! throws IOException, IllegalArgumentException ! { ! ObjectStreamField field = ! getField (name, defvalue == null ? null : defvalue.getClass ()); ! if (field == null) ! return defvalue; ! return objs[field.getOffset ()]; ! } ! private ObjectStreamField getField (String name, Class type) ! throws IllegalArgumentException ! { ! ObjectStreamField field = clazz.getField (name); ! if (field == null) ! return null; ! Class field_type = field.getType (); ! if (type == field_type || ! (type == null && ! field_type.isPrimitive ())) ! return field; ! throw new IllegalArgumentException ("Field requested is of type " ! + field_type.getName () ! + ", but requested type was " ! + (type == null ? ! "Object" : type.getName ())); ! } ! }; } *************** public class ObjectInputStream extends I *** 963,969 **** de serialization mechanism provided by ObjectInputStream. To make this method be used for writing objects, subclasses must invoke the 0-argument ! constructor on this class from there constructor. @see ObjectInputStream () */ --- 1045,1051 ---- de serialization mechanism provided by ObjectInputStream. To make this method be used for writing objects, subclasses must invoke the 0-argument ! constructor on this class from their constructor. @see ObjectInputStream () */ *************** public class ObjectInputStream extends I *** 978,992 **** private int assignNewHandle (Object obj) { this.objectLookupTable.put (new Integer (this.nextOID), ! new ObjectIdentityWrapper (obj)); ! ! // try ! // { ! // DEBUG ("Assigning handle " + this.nextOID); ! // DEBUGln (" to " + obj); ! // } ! // catch (Throwable t) {} ! return this.nextOID++; } --- 1060,1066 ---- private int assignNewHandle (Object obj) { this.objectLookupTable.put (new Integer (this.nextOID), ! new ObjectIdentityWrapper (obj)); return this.nextOID++; } *************** public class ObjectInputStream extends I *** 998,1019 **** { Method m = null; try ! { ! Class classArgs[] = {}; ! m = obj.getClass ().getDeclaredMethod ("readResolve", classArgs); ! // m can't be null by definition since an exception would ! // have been thrown so a check for null is not needed. ! obj = m.invoke (obj, new Object[] {}); ! } catch (NoSuchMethodException ignore) ! { ! } catch (IllegalAccessException ignore) ! { ! } catch (InvocationTargetException ignore) ! { ! } } if (this.resolveEnabled) --- 1072,1093 ---- { Method m = null; try ! { ! Class classArgs[] = {}; ! m = obj.getClass ().getDeclaredMethod ("readResolve", classArgs); ! // m can't be null by definition since an exception would ! // have been thrown so a check for null is not needed. ! obj = m.invoke (obj, new Object[] {}); ! } catch (NoSuchMethodException ignore) ! { ! } catch (IllegalAccessException ignore) ! { ! } catch (InvocationTargetException ignore) ! { ! } } if (this.resolveEnabled) *************** public class ObjectInputStream extends I *** 1035,1041 **** private void readNextBlock () throws IOException { - // DEBUGln ("In readNextBlock "); readNextBlock (this.realInputStream.readByte ()); } --- 1109,1114 ---- *************** public class ObjectInputStream extends I *** 1043,1063 **** private void readNextBlock (byte marker) throws IOException { if (marker == TC_BLOCKDATA) ! { ! dumpElement ("BLOCK DATA SIZE="); ! this.blockDataBytes = this.realInputStream.readUnsignedByte (); ! dumpElementln (Integer.toString(this.blockDataBytes)); ! } else if (marker == TC_BLOCKDATALONG) ! { ! dumpElement ("BLOCK DATA LONG SIZE="); ! this.blockDataBytes = this.realInputStream.readInt (); ! dumpElementln (Integer.toString(this.blockDataBytes)); ! } else ! { ! throw new EOFException ("Attempt to read primitive data, but no data block is active."); ! } if (this.blockData.length < this.blockDataBytes) this.blockData = new byte[this.blockDataBytes]; --- 1116,1136 ---- private void readNextBlock (byte marker) throws IOException { if (marker == TC_BLOCKDATA) ! { ! dumpElement ("BLOCK DATA SIZE="); ! this.blockDataBytes = this.realInputStream.readUnsignedByte (); ! dumpElementln (Integer.toString(this.blockDataBytes)); ! } else if (marker == TC_BLOCKDATALONG) ! { ! dumpElement ("BLOCK DATA LONG SIZE="); ! this.blockDataBytes = this.realInputStream.readInt (); ! dumpElementln (Integer.toString(this.blockDataBytes)); ! } else ! { ! throw new EOFException ("Attempt to read primitive data, but no data block is active."); ! } if (this.blockData.length < this.blockDataBytes) this.blockData = new byte[this.blockDataBytes]; *************** public class ObjectInputStream extends I *** 1071,1159 **** throws ClassNotFoundException, IOException { if (clazz.isPrimitive ()) - { - if (clazz == Boolean.TYPE) - { - boolean[] cast_array = (boolean[])array; - for (int i=0; i < cast_array.length; i++) - cast_array[i] = this.realInputStream.readBoolean (); - return; - } - if (clazz == Byte.TYPE) - { - byte[] cast_array = (byte[])array; - for (int i=0; i < cast_array.length; i++) - cast_array[i] = this.realInputStream.readByte (); - return; - } - if (clazz == Character.TYPE) - { - char[] cast_array = (char[])array; - for (int i=0; i < cast_array.length; i++) - cast_array[i] = this.realInputStream.readChar (); - return; - } - if (clazz == Double.TYPE) - { - double[] cast_array = (double[])array; - for (int i=0; i < cast_array.length; i++) - cast_array[i] = this.realInputStream.readDouble (); - return; - } - if (clazz == Float.TYPE) { ! float[] cast_array = (float[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readFloat (); ! return; ! } ! if (clazz == Integer.TYPE) ! { ! int[] cast_array = (int[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readInt (); ! return; ! } ! if (clazz == Long.TYPE) ! { ! long[] cast_array = (long[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readLong (); ! return; } ! if (clazz == Short.TYPE) { ! short[] cast_array = (short[])array; for (int i=0; i < cast_array.length; i++) - cast_array[i] = this.realInputStream.readShort (); - return; - } - } - else - { - Object[] cast_array = (Object[])array; - for (int i=0; i < cast_array.length; i++) cast_array[i] = readObject (); ! } } ! private void readFields (Object obj, ObjectStreamField[] stream_fields, ! boolean call_read_method, ! ObjectStreamClass stream_osc) throws ClassNotFoundException, IOException { ! // DEBUGln ("In readFields"); ! if (call_read_method) ! { ! // DEBUGln (" call_read_method is true"); ! fieldsAlreadyRead = false; ! setBlockDataMode (true); ! callReadMethod (obj, stream_osc.forClass ()); ! setBlockDataMode (false); ! return; ! } ! ObjectStreamField[] real_fields = ObjectStreamClass.lookup (stream_osc.forClass ()).fields; --- 1144,1220 ---- throws ClassNotFoundException, IOException { if (clazz.isPrimitive ()) { ! if (clazz == Boolean.TYPE) ! { ! boolean[] cast_array = (boolean[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readBoolean (); ! return; ! } ! if (clazz == Byte.TYPE) ! { ! byte[] cast_array = (byte[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readByte (); ! return; ! } ! if (clazz == Character.TYPE) ! { ! char[] cast_array = (char[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readChar (); ! return; ! } ! if (clazz == Double.TYPE) ! { ! double[] cast_array = (double[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readDouble (); ! return; ! } ! if (clazz == Float.TYPE) ! { ! float[] cast_array = (float[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readFloat (); ! return; ! } ! if (clazz == Integer.TYPE) ! { ! int[] cast_array = (int[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readInt (); ! return; ! } ! if (clazz == Long.TYPE) ! { ! long[] cast_array = (long[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readLong (); ! return; ! } ! if (clazz == Short.TYPE) ! { ! short[] cast_array = (short[])array; ! for (int i=0; i < cast_array.length; i++) ! cast_array[i] = this.realInputStream.readShort (); ! return; ! } } ! else { ! Object[] cast_array = (Object[])array; for (int i=0; i < cast_array.length; i++) cast_array[i] = readObject (); ! } } ! private void readFields (Object obj, ObjectStreamClass stream_osc) throws ClassNotFoundException, IOException { ! ObjectStreamField[] stream_fields = stream_osc.fields; ObjectStreamField[] real_fields = ObjectStreamClass.lookup (stream_osc.forClass ()).fields; *************** public class ObjectInputStream extends I *** 1167,1310 **** while (stream_idx < stream_fields.length && real_idx < real_fields.length) - { - default_initialize = false; - set_value = true; - - if (stream_idx == stream_fields.length) - default_initialize = true; - else - { - stream_field = stream_fields[stream_idx]; - type = stream_field.getType (); - } - - if (real_idx == real_fields.length) - set_value = false; - else { ! real_field = real_fields[real_idx]; ! type = real_field.getType (); ! field_name = real_field.getName (); ! } ! ! if (set_value && !default_initialize) ! { ! int comp_val = ! real_field.compareTo (stream_field); ! if (comp_val < 0) ! { default_initialize = true; ! real_idx++; ! } ! else if (comp_val > 0) ! { set_value = false; - stream_idx++; - } else ! { ! real_idx++; ! stream_idx++; ! } ! } ! if (type == Boolean.TYPE) ! { ! boolean value = ! default_initialize ? false : this.realInputStream.readBoolean (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setBooleanField (obj, field_name, value); ! } ! else if (type == Byte.TYPE) ! { ! byte value = ! default_initialize ? 0 : this.realInputStream.readByte (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setByteField (obj, field_name, value); ! } ! else if (type == Character.TYPE) ! { ! char value = ! default_initialize ? (char)0 : this.realInputStream.readChar (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setCharField (obj, field_name, value); ! } ! else if (type == Double.TYPE) ! { ! double value = ! default_initialize ? 0 : this.realInputStream.readDouble (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setDoubleField (obj, field_name, value); ! } ! else if (type == Float.TYPE) ! { ! float value = ! default_initialize ? 0 : this.realInputStream.readFloat (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setFloatField (obj, field_name, value); ! } ! else if (type == Integer.TYPE) ! { ! int value = ! default_initialize ? 0 : this.realInputStream.readInt (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setIntField (obj, field_name, value); ! } ! else if (type == Long.TYPE) ! { ! long value = ! default_initialize ? 0 : this.realInputStream.readLong (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setLongField (obj, field_name, value); ! } ! else if (type == Short.TYPE) ! { ! short value = ! default_initialize ? (short)0 : this.realInputStream.readShort (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setShortField (obj, field_name, value); ! } ! else ! { ! Object value = ! default_initialize ? null : readObject (); ! if (set_value) ! setObjectField (obj, field_name, ! real_field.getTypeString (), value); } - } } - // Toggles writing primitive data to block-data buffer. ! private void setBlockDataMode (boolean on) { ! // DEBUGln ("Setting block data mode to " + on); ! this.readDataFromBlock = on; if (on) this.dataInputStream = this.blockDataInput; else this.dataInputStream = this.realInputStream; } --- 1228,1377 ---- while (stream_idx < stream_fields.length && real_idx < real_fields.length) { ! default_initialize = false; ! set_value = true; ! if (stream_idx == stream_fields.length) default_initialize = true; ! else ! { ! stream_field = stream_fields[stream_idx]; ! type = stream_field.getType (); ! } ! ! if (real_idx == real_fields.length) set_value = false; else ! { ! real_field = real_fields[real_idx]; ! type = real_field.getType (); ! field_name = real_field.getName (); ! } ! if (set_value && !default_initialize) ! { ! int comp_val = ! real_field.compareTo (stream_field); ! ! if (comp_val < 0) ! { ! default_initialize = true; ! real_idx++; ! } ! else if (comp_val > 0) ! { ! set_value = false; ! stream_idx++; ! } ! else ! { ! real_idx++; ! stream_idx++; ! } ! } ! ! try ! { ! if (type == Boolean.TYPE) ! { ! boolean value = ! default_initialize ? false : this.realInputStream.readBoolean (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setBooleanField (obj, stream_osc.forClass (), field_name, value); ! } ! else if (type == Byte.TYPE) ! { ! byte value = ! default_initialize ? 0 : this.realInputStream.readByte (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setByteField (obj, stream_osc.forClass (), field_name, value); ! } ! else if (type == Character.TYPE) ! { ! char value = ! default_initialize ? (char)0 : this.realInputStream.readChar (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setCharField (obj, stream_osc.forClass (), field_name, value); ! } ! else if (type == Double.TYPE) ! { ! double value = ! default_initialize ? 0 : this.realInputStream.readDouble (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setDoubleField (obj, stream_osc.forClass (), field_name, value); ! } ! else if (type == Float.TYPE) ! { ! float value = ! default_initialize ? 0 : this.realInputStream.readFloat (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setFloatField (obj, stream_osc.forClass (), field_name, value); ! } ! else if (type == Integer.TYPE) ! { ! int value = ! default_initialize ? 0 : this.realInputStream.readInt (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setIntField (obj, stream_osc.forClass (), field_name, value); ! } ! else if (type == Long.TYPE) ! { ! long value = ! default_initialize ? 0 : this.realInputStream.readLong (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setLongField (obj, stream_osc.forClass (), field_name, value); ! } ! else if (type == Short.TYPE) ! { ! short value = ! default_initialize ? (short)0 : this.realInputStream.readShort (); ! if (!default_initialize && set_value) ! dumpElementln (" " + field_name + ": " + value); ! if (set_value) ! setShortField (obj, stream_osc.forClass (), field_name, value); ! } ! else ! { ! Object value = ! default_initialize ? null : readObject (); ! if (set_value) ! setObjectField (obj, stream_osc.forClass (), field_name, ! real_field.getTypeString (), value); ! } ! } ! catch (NoSuchFieldError e) ! { ! dumpElementln("XXXX " + field_name + " does not exist."); ! } } } // Toggles writing primitive data to block-data buffer. ! private boolean setBlockDataMode (boolean on) { ! boolean oldmode = this.readDataFromBlock; this.readDataFromBlock = on; if (on) this.dataInputStream = this.blockDataInput; else this.dataInputStream = this.realInputStream; + return oldmode; } *************** public class ObjectInputStream extends I *** 1313,1327 **** private Object newObject (Class real_class, Class constructor_class) { try ! { ! Object obj = allocateObject (real_class); ! callConstructor (constructor_class, obj); ! return obj; ! } catch (InstantiationException e) ! { ! return null; ! } } --- 1380,1394 ---- private Object newObject (Class real_class, Class constructor_class) { try ! { ! Object obj = allocateObject (real_class); ! callConstructor (constructor_class, obj); ! return obj; ! } catch (InstantiationException e) ! { ! return null; ! } } *************** public class ObjectInputStream extends I *** 1334,1347 **** Arrays.sort (validators); try ! { ! for (int i=0; i < validators.length; i++) ! ((ObjectInputValidation)validators[i]).validateObject (); ! } finally ! { ! this.validators.removeAllElements (); ! } } --- 1401,1414 ---- Arrays.sort (validators); try ! { ! for (int i=0; i < validators.length; i++) ! ((ObjectInputValidation)validators[i]).validateObject (); ! } finally ! { ! this.validators.removeAllElements (); ! } } *************** public class ObjectInputStream extends I *** 1353,1366 **** return ClassLoader.getSystemClassLoader (); } ! private static native Field getField (Class klass, String name) ! throws java.lang.NoSuchFieldException; ! private static native Method getMethod (Class klass, String name, Class args[]) ! throws java.lang.NoSuchMethodException; ! private void callReadMethod (Object obj, Class klass) throws IOException { try { Class classArgs[] = {ObjectInputStream.class}; --- 1420,1440 ---- return ClassLoader.getSystemClassLoader (); } ! private static Field getField (Class klass, String name) ! throws java.lang.NoSuchFieldException ! { ! return klass.getDeclaredField(name); ! } ! private static Method getMethod (Class klass, String name, Class args[]) ! throws java.lang.NoSuchMethodException ! { ! return klass.getDeclaredMethod(name, args); ! } ! private void callReadMethod (Object obj, ObjectStreamClass osc) throws IOException { + Class klass = osc.forClass(); try { Class classArgs[] = {ObjectInputStream.class}; *************** public class ObjectInputStream extends I *** 1394,1406 **** private native void callConstructor (Class clazz, Object obj); ! private void setBooleanField (Object obj, String field_name, boolean val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setBoolean (obj, val); } catch (Exception _) --- 1468,1480 ---- private native void callConstructor (Class clazz, Object obj); ! private void setBooleanField (Object obj, Class klass, String field_name, boolean val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setBoolean (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1408,1420 **** } } ! private void setByteField (Object obj, String field_name, ! byte val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setByte (obj, val); } catch (Exception _) --- 1482,1494 ---- } } ! private void setByteField (Object obj, Class klass, String field_name, ! byte val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setByte (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1422,1434 **** } } ! private void setCharField (Object obj, String field_name, char val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setChar (obj, val); } catch (Exception _) --- 1496,1508 ---- } } ! private void setCharField (Object obj, Class klass, String field_name, char val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setChar (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1436,1448 **** } } ! private void setDoubleField (Object obj, String field_name, double val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setDouble (obj, val); } catch (Exception _) --- 1510,1522 ---- } } ! private void setDoubleField (Object obj, Class klass, String field_name, double val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setDouble (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1450,1462 **** } } ! private void setFloatField (Object obj, String field_name, float val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setFloat (obj, val); } catch (Exception _) --- 1524,1536 ---- } } ! private void setFloatField (Object obj, Class klass, String field_name, float val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setFloat (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1464,1476 **** } } ! private void setIntField (Object obj, String field_name, ! int val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setInt (obj, val); } catch (Exception _) --- 1538,1550 ---- } } ! private void setIntField (Object obj, Class klass, String field_name, ! int val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setInt (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1479,1491 **** } ! private void setLongField (Object obj, String field_name, ! long val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setLong (obj, val); } catch (Exception _) --- 1553,1565 ---- } ! private void setLongField (Object obj, Class klass, String field_name, ! long val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setLong (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1494,1506 **** } ! private void setShortField (Object obj, String field_name, short val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); f.setShort (obj, val); } catch (Exception _) --- 1568,1580 ---- } ! private void setShortField (Object obj, Class klass, String field_name, short val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); f.setShort (obj, val); } catch (Exception _) *************** public class ObjectInputStream extends I *** 1509,1521 **** } ! private void setObjectField (Object obj, String field_name, String type_code, Object val) { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); // FIXME: We should check the type_code here f.set (obj, val); } --- 1583,1595 ---- } ! private void setObjectField (Object obj, Class klass, String field_name, String type_code, Object val) { try { Field f = getField (klass, field_name); + f.setAccessible(true); // FIXME: We should check the type_code here f.set (obj, val); } *************** public class ObjectInputStream extends I *** 1544,1550 **** private boolean fieldsAlreadyRead; private Vector validators; ! private static boolean dump; private void dumpElement (String msg) { --- 1618,1624 ---- private boolean fieldsAlreadyRead; private Vector validators; ! private static boolean dump; private void dumpElement (String msg) { *************** public class ObjectInputStream extends I *** 1557,1562 **** --- 1631,1644 ---- if (Configuration.DEBUG && dump) System.out.println(msg); } + + static + { + if (Configuration.INIT_LOAD_LIBRARY) + { + System.loadLibrary ("javaio"); + } + } } diff -Nrc3pad gcc-3.2.3/libjava/java/io/ObjectOutputStream.java gcc-3.3/libjava/java/io/ObjectOutputStream.java *** gcc-3.2.3/libjava/java/io/ObjectOutputStream.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/ObjectOutputStream.java 2003-03-14 12:06:41.000000000 +0000 *************** *** 1,5 **** /* ObjectOutputStream.java -- Class used to write serialized objects ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ObjectOutputStream.java -- Class used to write serialized objects ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** import java.util.Hashtable; *** 46,51 **** --- 46,52 ---- import gnu.java.io.ObjectIdentityWrapper; import gnu.java.lang.reflect.TypeSignature; + import gnu.classpath.Configuration; /** An ObjectOutputStream can be used to write objects *************** import gnu.java.lang.reflect.TypeSignatu *** 76,97 **** in a graph lost. Example usage: !

        !      Hashtable map = new Hashtable ();
        !      map.put ("one", new Integer (1));
        !      map.put ("two", new Integer (2));
          
        !      ObjectOutputStream oos =
        !        new ObjectOutputStream (new FileOutputStream ("numbers"));
        !      oos.writeObject (map);
        !      oos.close ();
          
        !      ObjectInputStream ois =
        !        new ObjectInputStream (new FileInputStream ("numbers"));
        !      Hashtable newmap = (Hashtable)ois.readObject ();
          
        !      System.out.println (newmap);
        !      
        The default serialization can be overriden in two ways. --- 77,98 ---- in a graph lost. Example usage: !
        !    Hashtable map = new Hashtable ();
        !    map.put ("one", new Integer (1));
        !    map.put ("two", new Integer (2));
          
        !    ObjectOutputStream oos =
        !    new ObjectOutputStream (new FileOutputStream ("numbers"));
        !    oos.writeObject (map);
        !    oos.close ();
          
        !    ObjectInputStream ois =
        !    new ObjectInputStream (new FileInputStream ("numbers"));
        !    Hashtable newmap = (Hashtable)ois.readObject ();
          
        !    System.out.println (newmap);
        !    
        The default serialization can be overriden in two ways. *************** public class ObjectOutputStream extends *** 167,398 **** public final void writeObject (Object obj) throws IOException { if (useSubclassMethod) ! { ! writeObjectOverride (obj); ! return; ! } boolean was_serializing = isSerializing; ! ! if (! was_serializing) ! setBlockDataMode (false); ! try - { - isSerializing = true; - boolean replaceDone = false; - - drain (); - - while (true) { ! if (obj == null) ! { ! realOutput.writeByte (TC_NULL); ! break; ! } ! Integer handle = findHandle (obj); ! if (handle != null) ! { ! realOutput.writeByte (TC_REFERENCE); ! realOutput.writeInt (handle.intValue ()); ! break; ! } ! if (obj instanceof Class) ! { ! realOutput.writeByte (TC_CLASS); ! writeObject (ObjectStreamClass.lookup ((Class)obj)); ! assignNewHandle (obj); ! break; ! } ! if (obj instanceof ObjectStreamClass) ! { ! ObjectStreamClass osc = (ObjectStreamClass)obj; ! realOutput.writeByte (TC_CLASSDESC); ! realOutput.writeUTF (osc.getName ()); ! realOutput.writeLong (osc.getSerialVersionUID ()); ! assignNewHandle (obj); ! int flags = osc.getFlags (); ! if (protocolVersion == PROTOCOL_VERSION_2 ! && osc.isExternalizable ()) ! flags |= SC_BLOCK_DATA; ! realOutput.writeByte (flags); ! ObjectStreamField[] fields = osc.fields; ! realOutput.writeShort (fields.length); ! ObjectStreamField field; ! for (int i=0; i < fields.length; i++) ! { ! field = fields[i]; ! realOutput.writeByte (field.getTypeCode ()); ! realOutput.writeUTF (field.getName ()); ! if (! field.isPrimitive ()) ! writeObject (field.getTypeString ()); ! } ! setBlockDataMode (true); ! annotateClass (osc.forClass ()); ! setBlockDataMode (false); ! realOutput.writeByte (TC_ENDBLOCKDATA); ! if (osc.isSerializable ()) ! writeObject (osc.getSuper ()); ! else ! writeObject (null); ! break; ! } ! Object replacedObject = null; ! if ((replacementEnabled || obj instanceof Serializable) ! && ! replaceDone) ! { ! replacedObject = obj; ! if (obj instanceof Serializable) ! { ! Method m = null; ! try ! { ! Class classArgs[] = {}; ! m = obj.getClass ().getDeclaredMethod ("writeReplace", ! classArgs); ! // m can't be null by definition since an exception would ! // have been thrown so a check for null is not needed. ! obj = m.invoke (obj, new Object[] {}); ! } ! catch (NoSuchMethodException ignore) ! { } ! catch (IllegalAccessException ignore) { } ! catch (InvocationTargetException ignore) { } - } - - if (replacementEnabled) - obj = replaceObject (obj); ! replaceDone = true; ! continue; ! } ! if (obj instanceof String) ! { ! realOutput.writeByte (TC_STRING); ! assignNewHandle (obj); ! realOutput.writeUTF ((String)obj); ! break; ! } ! Class clazz = obj.getClass (); ! ObjectStreamClass osc = ObjectStreamClass.lookup (clazz); ! if (osc == null) ! throw new NotSerializableException (clazz.getName ()); ! if (clazz.isArray ()) ! { ! realOutput.writeByte (TC_ARRAY); ! writeObject (osc); ! assignNewHandle (obj); ! writeArraySizeAndElements (obj, clazz.getComponentType ()); ! break; ! } ! realOutput.writeByte (TC_OBJECT); ! writeObject (osc); ! if (replaceDone) ! assignNewHandle (replacedObject); ! else ! assignNewHandle (obj); ! if (obj instanceof Externalizable) ! { ! if (protocolVersion == PROTOCOL_VERSION_2) ! setBlockDataMode (true); ! ((Externalizable)obj).writeExternal (this); ! if (protocolVersion == PROTOCOL_VERSION_2) ! { ! setBlockDataMode (false); ! drain (); ! } ! break; ! } ! if (obj instanceof Serializable) ! { ! currentObject = obj; ! ObjectStreamClass[] hierarchy = ! ObjectStreamClass.getObjectStreamClasses (clazz); ! boolean has_write; ! for (int i=0; i < hierarchy.length; i++) { ! currentObjectStreamClass = hierarchy[i]; ! ! fieldsAlreadyWritten = false; ! has_write = currentObjectStreamClass.hasWriteMethod (); ! ! writeFields (obj, currentObjectStreamClass.fields, ! has_write); ! ! if (has_write) ! { ! drain (); ! realOutput.writeByte (TC_ENDBLOCKDATA); ! } } ! currentObject = null; ! currentObjectStreamClass = null; ! currentPutField = null; ! break; ! } ! ! throw new NotSerializableException (clazz.getName ()); ! } // end pseudo-loop ! } ! catch (IOException e) ! { ! realOutput.writeByte (TC_EXCEPTION); ! reset (true); ! ! try ! { ! writeObject (e); } ! catch (IOException ioe) { ! throw new StreamCorruptedException ("Exception " + ioe + " thrown while exception was being written to stream."); } - - reset (true); - } - finally - { - isSerializing = was_serializing; - - if (! was_serializing) - setBlockDataMode (true); - } } - /** Writes the current objects non-transient, non-static fields from the current class to the underlying output stream. --- 168,413 ---- public final void writeObject (Object obj) throws IOException { if (useSubclassMethod) ! { ! writeObjectOverride (obj); ! return; ! } boolean was_serializing = isSerializing; ! boolean old_mode = setBlockDataMode (false); try { ! isSerializing = true; ! boolean replaceDone = false; ! Object replacedObject = null; ! ! while (true) ! { ! if (obj == null) ! { ! realOutput.writeByte (TC_NULL); ! break; ! } ! Integer handle = findHandle (obj); ! if (handle != null) ! { ! realOutput.writeByte (TC_REFERENCE); ! realOutput.writeInt (handle.intValue ()); ! break; ! } ! if (obj instanceof Class) ! { ! Class cl = (Class)obj; ! ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject (cl); ! assignNewHandle (obj); ! realOutput.writeByte (TC_CLASS); ! if (!osc.isProxyClass) ! { ! writeObject (osc); ! } ! else ! { ! realOutput.writeByte (TC_PROXYCLASSDESC); ! Class[] intfs = cl.getInterfaces(); ! realOutput.writeInt(intfs.length); ! for (int i = 0; i < intfs.length; i++) ! realOutput.writeUTF(intfs[i].getName()); ! ! boolean oldmode = setBlockDataMode (true); ! annotateProxyClass(cl); ! setBlockDataMode (oldmode); ! realOutput.writeByte(TC_ENDBLOCKDATA); ! ! writeObject (osc.getSuper()); ! } ! break; ! } ! if (obj instanceof ObjectStreamClass) ! { ! ObjectStreamClass osc = (ObjectStreamClass)obj; ! realOutput.writeByte (TC_CLASSDESC); ! realOutput.writeUTF (osc.getName ()); ! realOutput.writeLong (osc.getSerialVersionUID ()); ! assignNewHandle (obj); ! int flags = osc.getFlags (); ! if (protocolVersion == PROTOCOL_VERSION_2 ! && osc.isExternalizable ()) ! flags |= SC_BLOCK_DATA; ! realOutput.writeByte (flags); ! ObjectStreamField[] fields = osc.fields; ! realOutput.writeShort (fields.length); ! ObjectStreamField field; ! for (int i=0; i < fields.length; i++) ! { ! field = fields[i]; ! realOutput.writeByte (field.getTypeCode ()); ! realOutput.writeUTF (field.getName ()); ! if (! field.isPrimitive ()) ! writeObject (field.getTypeString ()); ! } ! boolean oldmode = setBlockDataMode (true); ! annotateClass (osc.forClass ()); ! setBlockDataMode (oldmode); ! realOutput.writeByte (TC_ENDBLOCKDATA); ! if (osc.isSerializable ()) ! writeObject (osc.getSuper ()); ! else ! writeObject (null); ! break; ! } + if ((replacementEnabled || obj instanceof Serializable) + && ! replaceDone) + { + replacedObject = obj; ! if (obj instanceof Serializable) ! { ! Method m = null; ! try ! { ! Class classArgs[] = {}; ! m = obj.getClass ().getDeclaredMethod ("writeReplace", ! classArgs); ! // m can't be null by definition since an exception would ! // have been thrown so a check for null is not needed. ! obj = m.invoke (obj, new Object[] {}); ! } ! catch (NoSuchMethodException ignore) ! { ! } ! catch (IllegalAccessException ignore) ! { ! } ! catch (InvocationTargetException ignore) ! { ! } ! } ! if (replacementEnabled) ! obj = replaceObject (obj); ! replaceDone = true; ! continue; } ! ! if (obj instanceof String) { + realOutput.writeByte (TC_STRING); + assignNewHandle (obj); + realOutput.writeUTF ((String)obj); + break; } ! ! Class clazz = obj.getClass (); ! ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject (clazz); ! if (osc == null) ! throw new NotSerializableException (clazz.getName ()); ! ! if (clazz.isArray ()) { + realOutput.writeByte (TC_ARRAY); + writeObject (osc); + assignNewHandle (obj); + writeArraySizeAndElements (obj, clazz.getComponentType ()); + break; } ! realOutput.writeByte (TC_OBJECT); ! writeObject (osc); ! if (replaceDone) ! assignNewHandle (replacedObject); ! else ! assignNewHandle (obj); ! if (obj instanceof Externalizable) ! { ! if (protocolVersion == PROTOCOL_VERSION_2) ! setBlockDataMode (true); ! ((Externalizable)obj).writeExternal (this); ! if (protocolVersion == PROTOCOL_VERSION_2) ! { ! setBlockDataMode (false); ! realOutput.writeByte (TC_ENDBLOCKDATA); ! } ! break; ! } ! if (obj instanceof Serializable) ! { ! currentObject = obj; ! ObjectStreamClass[] hierarchy = ! ObjectStreamClass.getObjectStreamClasses (clazz); ! for (int i=0; i < hierarchy.length; i++) ! { ! currentObjectStreamClass = hierarchy[i]; ! fieldsAlreadyWritten = false; ! if (currentObjectStreamClass.hasWriteMethod ()) ! { ! setBlockDataMode (true); ! callWriteMethod (obj, currentObjectStreamClass); ! setBlockDataMode (false); ! realOutput.writeByte (TC_ENDBLOCKDATA); ! } ! else ! writeFields (obj, currentObjectStreamClass); ! } ! currentObject = null; ! currentObjectStreamClass = null; ! currentPutField = null; ! break; ! } ! throw new NotSerializableException (clazz.getName ()); ! } // end pseudo-loop ! } ! catch (ObjectStreamException ose) ! { ! // Rethrow these are fatal. ! throw ose; ! } ! catch (IOException e) ! { ! realOutput.writeByte (TC_EXCEPTION); ! reset (true); ! setBlockDataMode (false); ! try { ! writeObject (e); ! } ! catch (IOException ioe) ! { ! throw new StreamCorruptedException ("Exception " + ioe + " thrown while exception was being written to stream."); } ! reset (true); } ! finally { ! isSerializing = was_serializing; ! setBlockDataMode (old_mode); } } /** Writes the current objects non-transient, non-static fields from the current class to the underlying output stream. *************** public class ObjectOutputStream extends *** 413,419 **** throws IOException, NotActiveException { markFieldsWritten (); ! writeFields (currentObject, currentObjectStreamClass.fields, false); } --- 428,434 ---- throws IOException, NotActiveException { markFieldsWritten (); ! writeFields (currentObject, currentObjectStreamClass); } *************** public class ObjectOutputStream extends *** 450,461 **** private void reset (boolean internal) throws IOException { if (!internal) ! { ! if (isSerializing) ! throw new IOException ("Reset called while serialization in progress"); ! realOutput.writeByte (TC_RESET); ! } clearHandles (); } --- 465,476 ---- private void reset (boolean internal) throws IOException { if (!internal) ! { ! if (isSerializing) ! throw new IOException ("Reset called while serialization in progress"); ! realOutput.writeByte (TC_RESET); ! } clearHandles (); } *************** public class ObjectOutputStream extends *** 466,473 **** according to the specified protocol. There are currently two different protocols, specified by PROTOCOL_VERSION_1 and PROTOCOL_VERSION_2. This implementation writes ! data using PROTOCOL_VERSION_1 by default, as is done ! by the JDK 1.1. A non-portable method, setDefaultProtocolVersion (int version) is provided to change the default protocol --- 481,488 ---- according to the specified protocol. There are currently two different protocols, specified by PROTOCOL_VERSION_1 and PROTOCOL_VERSION_2. This implementation writes ! data using PROTOCOL_VERSION_2 by default, as is done ! by the JDK 1.2. A non-portable method, setDefaultProtocolVersion (int version) is provided to change the default protocol *************** public class ObjectOutputStream extends *** 528,533 **** --- 543,550 ---- protected void annotateClass (Class cl) throws IOException {} + protected void annotateProxyClass(Class cl) throws IOException + {} /** Allows subclasses to replace objects that are written to the *************** public class ObjectOutputStream extends *** 633,644 **** public void write (int data) throws IOException { if (writeDataAsBlocks) ! { ! if (blockDataCount == BUFFER_SIZE) ! drain (); ! blockData[ blockDataCount++ ] = (byte)data; ! } else realOutput.write (data); } --- 650,661 ---- public void write (int data) throws IOException { if (writeDataAsBlocks) ! { ! if (blockDataCount == BUFFER_SIZE) ! drain (); ! blockData[ blockDataCount++ ] = (byte)data; ! } else realOutput.write (data); } *************** public class ObjectOutputStream extends *** 659,680 **** public void write (byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) - { - if (len < 0) - throw new IndexOutOfBoundsException (); - - if (blockDataCount + len < BUFFER_SIZE) { ! System.arraycopy (b, off, blockData, blockDataCount, len); ! blockDataCount += len; ! } ! else ! { ! drain (); ! writeBlockDataHeader (len); ! realOutput.write (b, off, len); } - } else realOutput.write (b, off, len); } --- 676,697 ---- public void write (byte[] b, int off, int len) throws IOException { if (writeDataAsBlocks) { ! if (len < 0) ! throw new IndexOutOfBoundsException (); ! ! if (blockDataCount + len < BUFFER_SIZE) ! { ! System.arraycopy (b, off, blockData, blockDataCount, len); ! blockDataCount += len; ! } ! else ! { ! drain (); ! writeBlockDataHeader (len); ! realOutput.write (b, off, len); ! } } else realOutput.write (b, off, len); } *************** public class ObjectOutputStream extends *** 702,708 **** if (blockDataCount == 0) return; ! writeBlockDataHeader (blockDataCount); realOutput.write (blockData, 0, blockDataCount); blockDataCount = 0; } --- 719,726 ---- if (blockDataCount == 0) return; ! if (writeDataAsBlocks) ! writeBlockDataHeader (blockDataCount); realOutput.write (blockData, 0, blockDataCount); blockDataCount = 0; } *************** public class ObjectOutputStream extends *** 713,719 **** */ public void close () throws IOException { ! drain (); realOutput.close (); } --- 731,737 ---- */ public void close () throws IOException { ! flush (); realOutput.close (); } *************** public class ObjectOutputStream extends *** 723,729 **** */ public void writeBoolean (boolean data) throws IOException { ! dataOutput.writeBoolean (data); } --- 741,747 ---- */ public void writeBoolean (boolean data) throws IOException { ! blockDataOutput.writeBoolean (data); } *************** public class ObjectOutputStream extends *** 732,738 **** */ public void writeByte (int data) throws IOException { ! dataOutput.writeByte (data); } --- 750,756 ---- */ public void writeByte (int data) throws IOException { ! blockDataOutput.writeByte (data); } *************** public class ObjectOutputStream extends *** 741,747 **** */ public void writeShort (int data) throws IOException { ! dataOutput.writeShort (data); } --- 759,765 ---- */ public void writeShort (int data) throws IOException { ! blockDataOutput.writeShort (data); } *************** public class ObjectOutputStream extends *** 750,756 **** */ public void writeChar (int data) throws IOException { ! dataOutput.writeChar (data); } --- 768,774 ---- */ public void writeChar (int data) throws IOException { ! blockDataOutput.writeChar (data); } *************** public class ObjectOutputStream extends *** 759,765 **** */ public void writeInt (int data) throws IOException { ! dataOutput.writeInt (data); } --- 777,783 ---- */ public void writeInt (int data) throws IOException { ! blockDataOutput.writeInt (data); } *************** public class ObjectOutputStream extends *** 768,774 **** */ public void writeLong (long data) throws IOException { ! dataOutput.writeLong (data); } --- 786,792 ---- */ public void writeLong (long data) throws IOException { ! blockDataOutput.writeLong (data); } *************** public class ObjectOutputStream extends *** 777,783 **** */ public void writeFloat (float data) throws IOException { ! dataOutput.writeFloat (data); } --- 795,801 ---- */ public void writeFloat (float data) throws IOException { ! blockDataOutput.writeFloat (data); } *************** public class ObjectOutputStream extends *** 786,792 **** */ public void writeDouble (double data) throws IOException { ! dataOutput.writeDouble (data); } --- 804,810 ---- */ public void writeDouble (double data) throws IOException { ! blockDataOutput.writeDouble (data); } *************** public class ObjectOutputStream extends *** 795,801 **** */ public void writeBytes (String data) throws IOException { ! dataOutput.writeBytes (data); } --- 813,819 ---- */ public void writeBytes (String data) throws IOException { ! blockDataOutput.writeBytes (data); } *************** public class ObjectOutputStream extends *** 854,994 **** currentPutField = new PutField () { private byte[] prim_field_data ! = new byte[currentObjectStreamClass.primFieldSize]; private Object[] objs ! = new Object[currentObjectStreamClass.objectFieldCount]; public void put (String name, boolean value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'Z'); ! prim_field_data[field.getOffset ()] = (byte)(value ? 1 : 0); ! } public void put (String name, byte value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'B'); ! prim_field_data[field.getOffset ()] = value; ! } public void put (String name, char value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'C'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, double value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'D'); ! int off = field.getOffset (); ! long l_value = Double.doubleToLongBits (value); ! prim_field_data[off++] = (byte)(l_value >>> 52); ! prim_field_data[off++] = (byte)(l_value >>> 48); ! prim_field_data[off++] = (byte)(l_value >>> 40); ! prim_field_data[off++] = (byte)(l_value >>> 32); ! prim_field_data[off++] = (byte)(l_value >>> 24); ! prim_field_data[off++] = (byte)(l_value >>> 16); ! prim_field_data[off++] = (byte)(l_value >>> 8); ! prim_field_data[off] = (byte)l_value; ! } public void put (String name, float value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'F'); ! int off = field.getOffset (); ! int i_value = Float.floatToIntBits (value); ! prim_field_data[off++] = (byte)(i_value >>> 24); ! prim_field_data[off++] = (byte)(i_value >>> 16); ! prim_field_data[off++] = (byte)(i_value >>> 8); ! prim_field_data[off] = (byte)i_value; ! } public void put (String name, int value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'I'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 24); ! prim_field_data[off++] = (byte)(value >>> 16); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, long value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'J'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 52); ! prim_field_data[off++] = (byte)(value >>> 48); ! prim_field_data[off++] = (byte)(value >>> 40); ! prim_field_data[off++] = (byte)(value >>> 32); ! prim_field_data[off++] = (byte)(value >>> 24); ! prim_field_data[off++] = (byte)(value >>> 16); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, short value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'S'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, Object value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! if (value != null && ! ! field.getType ().isAssignableFrom (value.getClass ())) ! throw new IllegalArgumentException (); ! objs[field.getOffset ()] = value; ! } public void write (ObjectOutput out) throws IOException ! { ! // Apparently Block data is not used with PutField as per ! // empirical evidence against JDK 1.2. Also see Mauve test ! // java.io.ObjectInputOutput.Test.GetPutField. ! setBlockDataMode (false); ! out.write (prim_field_data); ! for (int i = 0; i < objs.length; ++ i) ! out.writeObject (objs[i]); ! setBlockDataMode (true); ! } private void checkType (ObjectStreamField field, char type) throws IllegalArgumentException ! { ! if (TypeSignature.getEncodingOfClass (field.getType ()).charAt (0) != type) ! throw new IllegalArgumentException (); ! } }; // end PutFieldImpl --- 872,1014 ---- currentPutField = new PutField () { private byte[] prim_field_data ! = new byte[currentObjectStreamClass.primFieldSize]; private Object[] objs ! = new Object[currentObjectStreamClass.objectFieldCount]; public void put (String name, boolean value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'Z'); ! prim_field_data[field.getOffset ()] = (byte)(value ? 1 : 0); ! } public void put (String name, byte value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'B'); ! prim_field_data[field.getOffset ()] = value; ! } public void put (String name, char value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'C'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, double value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'D'); ! int off = field.getOffset (); ! long l_value = Double.doubleToLongBits (value); ! prim_field_data[off++] = (byte)(l_value >>> 52); ! prim_field_data[off++] = (byte)(l_value >>> 48); ! prim_field_data[off++] = (byte)(l_value >>> 40); ! prim_field_data[off++] = (byte)(l_value >>> 32); ! prim_field_data[off++] = (byte)(l_value >>> 24); ! prim_field_data[off++] = (byte)(l_value >>> 16); ! prim_field_data[off++] = (byte)(l_value >>> 8); ! prim_field_data[off] = (byte)l_value; ! } public void put (String name, float value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'F'); ! int off = field.getOffset (); ! int i_value = Float.floatToIntBits (value); ! prim_field_data[off++] = (byte)(i_value >>> 24); ! prim_field_data[off++] = (byte)(i_value >>> 16); ! prim_field_data[off++] = (byte)(i_value >>> 8); ! prim_field_data[off] = (byte)i_value; ! } public void put (String name, int value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'I'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 24); ! prim_field_data[off++] = (byte)(value >>> 16); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, long value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'J'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 52); ! prim_field_data[off++] = (byte)(value >>> 48); ! prim_field_data[off++] = (byte)(value >>> 40); ! prim_field_data[off++] = (byte)(value >>> 32); ! prim_field_data[off++] = (byte)(value >>> 24); ! prim_field_data[off++] = (byte)(value >>> 16); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, short value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! checkType (field, 'S'); ! int off = field.getOffset (); ! prim_field_data[off++] = (byte)(value >>> 8); ! prim_field_data[off] = (byte)value; ! } public void put (String name, Object value) throws IOException, IllegalArgumentException ! { ! ObjectStreamField field ! = currentObjectStreamClass.getField (name); ! if (field == null) ! throw new IllegalArgumentException (); ! if (value != null && ! ! field.getType ().isAssignableFrom (value.getClass ())) ! throw new IllegalArgumentException (); ! objs[field.getOffset ()] = value; ! } public void write (ObjectOutput out) throws IOException ! { ! // Apparently Block data is not used with PutField as per ! // empirical evidence against JDK 1.2. Also see Mauve test ! // java.io.ObjectInputOutput.Test.GetPutField. ! boolean oldmode = setBlockDataMode (false); ! out.write (prim_field_data); ! for (int i = 0; i < objs.length; ++ i) ! out.writeObject (objs[i]); ! setBlockDataMode (oldmode); ! } private void checkType (ObjectStreamField field, char type) throws IllegalArgumentException ! { ! if (TypeSignature.getEncodingOfClass (field.getType ()).charAt (0) != type) ! throw new IllegalArgumentException (); ! } }; // end PutFieldImpl *************** public class ObjectOutputStream extends *** 1010,1024 **** private void writeBlockDataHeader (int size) throws IOException { if (size < 256) ! { ! realOutput.writeByte (TC_BLOCKDATA); ! realOutput.write (size); ! } else ! { ! realOutput.writeByte (TC_BLOCKDATALONG); ! realOutput.writeInt (size); ! } } --- 1030,1044 ---- private void writeBlockDataHeader (int size) throws IOException { if (size < 256) ! { ! realOutput.writeByte (TC_BLOCKDATA); ! realOutput.write (size); ! } else ! { ! realOutput.writeByte (TC_BLOCKDATALONG); ! realOutput.writeInt (size); ! } } *************** public class ObjectOutputStream extends *** 1054,1195 **** int length = Array.getLength (array); if (clazz.isPrimitive ()) - { - if (clazz == Boolean.TYPE) - { - boolean[] cast_array = (boolean[])array; - realOutput.writeInt (length); - for (int i=0; i < length; i++) - realOutput.writeBoolean (cast_array[i]); - return; - } - if (clazz == Byte.TYPE) { ! byte[] cast_array = (byte[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeByte (cast_array[i]); ! return; ! } ! if (clazz == Character.TYPE) ! { ! char[] cast_array = (char[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeChar (cast_array[i]); ! return; ! } ! if (clazz == Double.TYPE) ! { ! double[] cast_array = (double[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeDouble (cast_array[i]); ! return; ! } ! if (clazz == Float.TYPE) ! { ! float[] cast_array = (float[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeFloat (cast_array[i]); ! return; ! } ! if (clazz == Integer.TYPE) ! { ! int[] cast_array = (int[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeInt (cast_array[i]); ! return; ! } ! if (clazz == Long.TYPE) ! { ! long[] cast_array = (long[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeLong (cast_array[i]); ! return; } ! if (clazz == Short.TYPE) { ! short[] cast_array = (short[])array; realOutput.writeInt (length); for (int i=0; i < length; i++) ! realOutput.writeShort (cast_array[i]); ! return; } - } - else - { - Object[] cast_array = (Object[])array; - realOutput.writeInt (length); - for (int i=0; i < length; i++) - writeObject (cast_array[i]); - } } ! // writes out FIELDS of OBJECT. If CALL_WRITE_METHOD is true, use ! // object's writeObject (ObjectOutputStream), otherwise use default ! // serialization. FIELDS are already in canonical order. ! private void writeFields (Object obj, ! ObjectStreamField[] fields, ! boolean call_write_method) throws IOException { ! if (call_write_method) ! { ! setBlockDataMode (true); ! callWriteMethod (obj); ! setBlockDataMode (false); ! return; ! } ! String field_name; Class type; for (int i=0; i < fields.length; i++) ! { ! field_name = fields[i].getName (); ! type = fields[i].getType (); ! if (type == Boolean.TYPE) ! realOutput.writeBoolean (getBooleanField (obj, field_name)); ! else if (type == Byte.TYPE) ! realOutput.writeByte (getByteField (obj, field_name)); ! else if (type == Character.TYPE) ! realOutput.writeChar (getCharField (obj, field_name)); ! else if (type == Double.TYPE) ! realOutput.writeDouble (getDoubleField (obj, field_name)); ! else if (type == Float.TYPE) ! realOutput.writeFloat (getFloatField (obj, field_name)); ! else if (type == Integer.TYPE) ! realOutput.writeInt (getIntField (obj, field_name)); ! else if (type == Long.TYPE) ! realOutput.writeLong (getLongField (obj, field_name)); ! else if (type == Short.TYPE) ! realOutput.writeShort (getShortField (obj, field_name)); ! else ! writeObject (getObjectField (obj, field_name, ! TypeSignature.getEncodingOfClass (type))); ! } } // Toggles writing primitive data to block-data buffer. ! private void setBlockDataMode (boolean on) { writeDataAsBlocks = on; if (on) dataOutput = blockDataOutput; else dataOutput = realOutput; } ! private void callWriteMethod (Object obj) throws IOException { ! Class klass = obj.getClass (); try { Class classArgs[] = {ObjectOutputStream.class}; --- 1074,1214 ---- int length = Array.getLength (array); if (clazz.isPrimitive ()) { ! if (clazz == Boolean.TYPE) ! { ! boolean[] cast_array = (boolean[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeBoolean (cast_array[i]); ! return; ! } ! if (clazz == Byte.TYPE) ! { ! byte[] cast_array = (byte[])array; ! realOutput.writeInt (length); ! realOutput.write(cast_array, 0, length); ! return; ! } ! if (clazz == Character.TYPE) ! { ! char[] cast_array = (char[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeChar (cast_array[i]); ! return; ! } ! if (clazz == Double.TYPE) ! { ! double[] cast_array = (double[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeDouble (cast_array[i]); ! return; ! } ! if (clazz == Float.TYPE) ! { ! float[] cast_array = (float[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeFloat (cast_array[i]); ! return; ! } ! if (clazz == Integer.TYPE) ! { ! int[] cast_array = (int[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeInt (cast_array[i]); ! return; ! } ! if (clazz == Long.TYPE) ! { ! long[] cast_array = (long[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeLong (cast_array[i]); ! return; ! } ! if (clazz == Short.TYPE) ! { ! short[] cast_array = (short[])array; ! realOutput.writeInt (length); ! for (int i=0; i < length; i++) ! realOutput.writeShort (cast_array[i]); ! return; ! } } ! else { ! Object[] cast_array = (Object[])array; realOutput.writeInt (length); for (int i=0; i < length; i++) ! writeObject (cast_array[i]); } } ! // writes out FIELDS of OBJECT for the specified ObjectStreamClass. ! // FIELDS are already in canonical order. ! private void writeFields (Object obj, ObjectStreamClass osc) ! throws IOException { ! ObjectStreamField[] fields = osc.fields; ! boolean oldmode = setBlockDataMode (false); String field_name; Class type; for (int i=0; i < fields.length; i++) ! { ! field_name = fields[i].getName (); ! type = fields[i].getType (); ! if (type == Boolean.TYPE) ! realOutput.writeBoolean (getBooleanField (obj, osc.forClass(), field_name)); ! else if (type == Byte.TYPE) ! realOutput.writeByte (getByteField (obj, osc.forClass(), field_name)); ! else if (type == Character.TYPE) ! realOutput.writeChar (getCharField (obj, osc.forClass(), field_name)); ! else if (type == Double.TYPE) ! realOutput.writeDouble (getDoubleField (obj, osc.forClass(), field_name)); ! else if (type == Float.TYPE) ! realOutput.writeFloat (getFloatField (obj, osc.forClass(), field_name)); ! else if (type == Integer.TYPE) ! realOutput.writeInt (getIntField (obj, osc.forClass(), field_name)); ! else if (type == Long.TYPE) ! realOutput.writeLong (getLongField (obj, osc.forClass(), field_name)); ! else if (type == Short.TYPE) ! realOutput.writeShort (getShortField (obj, osc.forClass(), field_name)); ! else ! writeObject (getObjectField (obj, osc.forClass(), field_name, ! fields[i].getTypeString ())); ! } ! setBlockDataMode (oldmode); } // Toggles writing primitive data to block-data buffer. ! private boolean setBlockDataMode (boolean on) throws IOException { + if (on == writeDataAsBlocks) + return on; + + drain(); + boolean oldmode = writeDataAsBlocks; writeDataAsBlocks = on; if (on) dataOutput = blockDataOutput; else dataOutput = realOutput; + + return oldmode; } ! private void callWriteMethod (Object obj, ObjectStreamClass osc) throws IOException { ! Class klass = osc.forClass(); try { Class classArgs[] = {ObjectOutputStream.class}; *************** public class ObjectOutputStream extends *** 1218,1228 **** } } ! private boolean getBooleanField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); boolean b = f.getBoolean (obj); return b; --- 1237,1247 ---- } } ! private boolean getBooleanField (Object obj, Class klass, String field_name) ! throws IOException { try { Field f = getField (klass, field_name); boolean b = f.getBoolean (obj); return b; *************** public class ObjectOutputStream extends *** 1233,1243 **** } } ! private byte getByteField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); byte b = f.getByte (obj); return b; --- 1252,1261 ---- } } ! private byte getByteField (Object obj, Class klass, String field_name) throws IOException { try { Field f = getField (klass, field_name); byte b = f.getByte (obj); return b; *************** public class ObjectOutputStream extends *** 1248,1258 **** } } ! private char getCharField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); char b = f.getChar (obj); return b; --- 1266,1275 ---- } } ! private char getCharField (Object obj, Class klass, String field_name) throws IOException { try { Field f = getField (klass, field_name); char b = f.getChar (obj); return b; *************** public class ObjectOutputStream extends *** 1263,1273 **** } } ! private double getDoubleField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); double b = f.getDouble (obj); return b; --- 1280,1290 ---- } } ! private double getDoubleField (Object obj, Class klass, String field_name) ! throws IOException { try { Field f = getField (klass, field_name); double b = f.getDouble (obj); return b; *************** public class ObjectOutputStream extends *** 1278,1288 **** } } ! private float getFloatField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); float b = f.getFloat (obj); return b; --- 1295,1305 ---- } } ! private float getFloatField (Object obj, Class klass, String field_name) ! throws IOException { try { Field f = getField (klass, field_name); float b = f.getFloat (obj); return b; *************** public class ObjectOutputStream extends *** 1293,1303 **** } } ! private int getIntField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); int b = f.getInt (obj); return b; --- 1310,1319 ---- } } ! private int getIntField (Object obj, Class klass, String field_name) throws IOException { try { Field f = getField (klass, field_name); int b = f.getInt (obj); return b; *************** public class ObjectOutputStream extends *** 1308,1318 **** } } ! private long getLongField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); long b = f.getLong (obj); return b; --- 1324,1333 ---- } } ! private long getLongField (Object obj, Class klass, String field_name) throws IOException { try { Field f = getField (klass, field_name); long b = f.getLong (obj); return b; *************** public class ObjectOutputStream extends *** 1323,1333 **** } } ! private short getShortField (Object obj, String field_name) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); short b = f.getShort (obj); return b; --- 1338,1348 ---- } } ! private short getShortField (Object obj, Class klass, String field_name) ! throws IOException { try { Field f = getField (klass, field_name); short b = f.getShort (obj); return b; *************** public class ObjectOutputStream extends *** 1338,1349 **** } } ! private Object getObjectField (Object obj, String field_name, String type_code) throws IOException { try { - Class klass = obj.getClass (); Field f = getField (klass, field_name); Object o = f.get (obj); // FIXME: We should check the type_code here --- 1353,1363 ---- } } ! private Object getObjectField (Object obj, Class klass, String field_name, String type_code) throws IOException { try { Field f = getField (klass, field_name); Object o = f.get (obj); // FIXME: We should check the type_code here *************** public class ObjectOutputStream extends *** 1355,1370 **** } } ! private static native Field getField (Class klass, String name) ! throws java.lang.NoSuchFieldException; ! private static native Method getMethod (Class klass, String name, Class[] args) ! throws java.lang.NoSuchMethodException; // this value comes from 1.2 spec, but is used in 1.1 as well private final static int BUFFER_SIZE = 1024; ! private static int defaultProtocolVersion = PROTOCOL_VERSION_1; private DataOutputStream dataOutput; private boolean writeDataAsBlocks; --- 1369,1390 ---- } } ! private static Field getField (Class klass, String name) ! throws java.lang.NoSuchFieldException ! { ! return klass.getDeclaredField(name); ! } ! private static Method getMethod (Class klass, String name, Class[] args) ! throws java.lang.NoSuchMethodException ! { ! return klass.getDeclaredMethod(name, args); ! } // this value comes from 1.2 spec, but is used in 1.1 as well private final static int BUFFER_SIZE = 1024; ! private static int defaultProtocolVersion = PROTOCOL_VERSION_2; private DataOutputStream dataOutput; private boolean writeDataAsBlocks; *************** public class ObjectOutputStream extends *** 1382,1385 **** --- 1402,1413 ---- private Hashtable OIDLookupTable; private int protocolVersion; private boolean useSubclassMethod; + + static + { + if (Configuration.INIT_LOAD_LIBRARY) + { + System.loadLibrary ("javaio"); + } + } } diff -Nrc3pad gcc-3.2.3/libjava/java/io/ObjectStreamClass.java gcc-3.3/libjava/java/io/ObjectStreamClass.java *** gcc-3.2.3/libjava/java/io/ObjectStreamClass.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/ObjectStreamClass.java 2003-03-14 12:06:41.000000000 +0000 *************** *** 1,6 **** /* ObjectStreamClass.java -- Class used to write class information about serialized objects. ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* ObjectStreamClass.java -- Class used to write class information about serialized objects. ! Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.lang.reflect.Field; *** 44,49 **** --- 44,50 ---- import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; + import java.lang.reflect.Proxy; import java.security.DigestOutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; *************** public class ObjectStreamClass implement *** 76,81 **** --- 77,95 ---- if (! (Serializable.class).isAssignableFrom (cl)) return null; + return lookupForClassObject (cl); + } + + /** + * This lookup for internal use by ObjectOutputStream. Suppose + * we have a java.lang.Class object C for class A, though A is not + * serializable, but it's okay to serialize C. + */ + static ObjectStreamClass lookupForClassObject (Class cl) + { + if (cl == null) + return null; + ObjectStreamClass osc = (ObjectStreamClass)classLookupTable.get (cl); if (osc != null) *************** public class ObjectStreamClass implement *** 180,185 **** --- 194,221 ---- // Returns true iff the class that this ObjectStreamClass represents + // has the following method: + // + // private void readObject (ObjectOutputStream) + // + // This method is used by the class to override default + // serialization behavior. + boolean hasReadMethod () + { + try + { + Class[] readObjectParams = { ObjectInputStream.class }; + forClass ().getDeclaredMethod ("readObject", readObjectParams); + return true; + } + catch (NoSuchMethodException e) + { + return false; + } + } + + + // Returns true iff the class that this ObjectStreamClass represents // implements Serializable but does *not* implement Externalizable. boolean isSerializable () { *************** public class ObjectStreamClass implement *** 260,281 **** void setClass (Class cl) throws InvalidClassException { this.clazz = cl; long class_uid = getClassUID (cl); if (uid == 0) { ! uid = class_uid; ! return; ! } ! ! // Check that the actual UID of the resolved class matches the UID from ! // the stream. ! if (uid != class_uid) ! { ! String msg = cl + ! ": Local class not compatible: stream serialVersionUID=" ! + uid + ", local serialVersionUID=" + class_uid; ! throw new InvalidClassException (msg); } } void setSuperclass (ObjectStreamClass osc) --- 296,324 ---- void setClass (Class cl) throws InvalidClassException { this.clazz = cl; + long class_uid = getClassUID (cl); if (uid == 0) + uid = class_uid; + else { ! // Check that the actual UID of the resolved class matches the UID from ! // the stream. ! if (uid != class_uid) ! { ! String msg = cl + ! ": Local class not compatible: stream serialVersionUID=" ! + uid + ", local serialVersionUID=" + class_uid; ! throw new InvalidClassException (msg); ! } } + + isProxyClass = clazz != null && Proxy.isProxyClass (clazz); + ObjectStreamClass osc = (ObjectStreamClass)classLookupTable.get (clazz); + if (osc == null) + classLookupTable.put (clazz, this); + superClass = lookupForClassObject (clazz.getSuperclass ()); + calculateOffsets (); } void setSuperclass (ObjectStreamClass osc) *************** public class ObjectStreamClass implement *** 328,339 **** { uid = 0; flags = 0; clazz = cl; name = cl.getName (); setFlags (cl); setFields (cl); ! uid = getClassUID (cl); superClass = lookup (cl.getSuperclass ()); } --- 371,385 ---- { uid = 0; flags = 0; + isProxyClass = Proxy.isProxyClass (cl); clazz = cl; name = cl.getName (); setFlags (cl); setFields (cl); ! // to those class nonserializable, its uid field is 0 ! if ( (Serializable.class).isAssignableFrom (cl) && !isProxyClass) ! uid = getClassUID (cl); superClass = lookup (cl.getSuperclass ()); } *************** public class ObjectStreamClass implement *** 377,382 **** --- 423,429 ---- { Field serialPersistentFields = cl.getDeclaredField ("serialPersistentFields"); + serialPersistentFields.setAccessible(true); int modifiers = serialPersistentFields.getModifiers (); if (Modifier.isStatic (modifiers) *************** public class ObjectStreamClass implement *** 427,452 **** { try { Field suid = cl.getDeclaredField ("serialVersionUID"); int modifiers = suid.getModifiers (); ! if (Modifier.isStatic (modifiers) && Modifier.isFinal (modifiers)) ! return suid.getLong (null); } catch (NoSuchFieldException ignore) ! { ! } catch (IllegalAccessException ignore) ! { ! } // cl didn't define serialVersionUID, so we have to compute it try { ! MessageDigest md = null; ! DigestOutputStream digest_out = null; ! DataOutputStream data_out = null; ! try { md = MessageDigest.getInstance ("SHA"); --- 474,500 ---- { try { + // Use getDeclaredField rather than getField, since serialVersionUID + // may not be public AND we only want the serialVersionUID of this + // class, not a superclass or interface. Field suid = cl.getDeclaredField ("serialVersionUID"); + suid.setAccessible(true); int modifiers = suid.getModifiers (); ! if (Modifier.isStatic (modifiers) ! && Modifier.isFinal (modifiers) ! && suid.getType() == Long.TYPE) ! return suid.getLong (null); } catch (NoSuchFieldException ignore) ! {} catch (IllegalAccessException ignore) ! {} // cl didn't define serialVersionUID, so we have to compute it try { ! MessageDigest md; try { md = MessageDigest.getInstance ("SHA"); *************** public class ObjectStreamClass implement *** 459,466 **** md = MessageDigest.getInstance ("SHA"); } ! digest_out = new DigestOutputStream (nullOutputStream, md); ! data_out = new DataOutputStream (digest_out); data_out.writeUTF (cl.getName ()); int modifiers = cl.getModifiers (); --- 507,516 ---- md = MessageDigest.getInstance ("SHA"); } ! DigestOutputStream digest_out = ! new DigestOutputStream (nullOutputStream, md); ! DataOutputStream data_out = new DataOutputStream (digest_out); ! data_out.writeUTF (cl.getName ()); int modifiers = cl.getModifiers (); *************** public class ObjectStreamClass implement *** 497,513 **** } // write class initializer method if present ! boolean has_init; ! try ! { ! has_init = hasClassInitializer (cl); ! } ! catch (NoSuchMethodError e) ! { ! has_init = false; ! } ! ! if (has_init) { data_out.writeUTF (""); data_out.writeInt (Modifier.STATIC); --- 547,553 ---- } // write class initializer method if present ! if (VMObjectStreamClass.hasClassInitializer (cl)) { data_out.writeUTF (""); data_out.writeInt (Modifier.STATIC); *************** public class ObjectStreamClass implement *** 564,574 **** catch (NoSuchAlgorithmException e) { throw new RuntimeException ("The SHA algorithm was not found to use in computing the Serial Version UID for class " ! + cl.getName ()); } catch (IOException ioe) { ! throw new RuntimeException (ioe.getMessage ()); } } --- 604,614 ---- catch (NoSuchAlgorithmException e) { throw new RuntimeException ("The SHA algorithm was not found to use in computing the Serial Version UID for class " ! + cl.getName (), e); } catch (IOException ioe) { ! throw new RuntimeException (ioe); } } *************** public class ObjectStreamClass implement *** 582,587 **** --- 622,628 ---- // Use getDeclaredField rather than getField for the same reason // as above in getDefinedSUID. Field f = clazz.getDeclaredField ("getSerialPersistentFields"); + f.setAccessible(true); o = (ObjectStreamField[])f.get (null); } catch (java.lang.NoSuchFieldException e) *************** public class ObjectStreamClass implement *** 594,622 **** return o; } - - // Returns true if CLAZZ has a static class initializer - // (a.k.a. ). - // - // A NoSuchMethodError is raised if CLAZZ has no such method. - private static boolean hasClassInitializer (Class clazz) - throws java.lang.NoSuchMethodError - { - Method m = null; - - try - { - Class classArgs[] = {}; - m = clazz.getDeclaredMethod ("", classArgs); - } - catch (java.lang.NoSuchMethodException e) - { - throw new java.lang.NoSuchMethodError (); - } - - return m != null; - } - public static final ObjectStreamField[] NO_FIELDS = {}; private static Hashtable classLookupTable = new Hashtable (); --- 635,640 ---- *************** public class ObjectStreamClass implement *** 640,648 **** --- 658,669 ---- int primFieldSize = -1; // -1 if not yet calculated int objectFieldCount; + boolean isProxyClass = false; + // This is probably not necessary because this class is special cased already // but it will avoid showing up as a discrepancy when comparing SUIDs. private static final long serialVersionUID = -6120832682080437368L; + } diff -Nrc3pad gcc-3.2.3/libjava/java/io/ObjectStreamConstants.java gcc-3.3/libjava/java/io/ObjectStreamConstants.java *** gcc-3.2.3/libjava/java/io/ObjectStreamConstants.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/ObjectStreamConstants.java 2002-11-10 22:06:48.000000000 +0000 *************** public interface ObjectStreamConstants *** 54,74 **** final static short STREAM_MAGIC = (short)0xaced; final static short STREAM_VERSION = 5; ! final static byte TC_NULL = (byte)112; ! final static byte TC_REFERENCE = (byte)113; ! final static byte TC_CLASSDESC = (byte)114; ! final static byte TC_OBJECT = (byte)115; ! final static byte TC_STRING = (byte)116; ! final static byte TC_ARRAY = (byte)117; ! final static byte TC_CLASS = (byte)118; ! final static byte TC_BLOCKDATA = (byte)119; ! final static byte TC_ENDBLOCKDATA = (byte)120; ! final static byte TC_RESET = (byte)121; ! final static byte TC_BLOCKDATALONG = (byte)122; ! final static byte TC_EXCEPTION = (byte)123; final static byte TC_BASE = TC_NULL; ! final static byte TC_MAX = TC_EXCEPTION; final static int baseWireHandle = 0x7e0000; --- 54,76 ---- final static short STREAM_MAGIC = (short)0xaced; final static short STREAM_VERSION = 5; ! final static byte TC_NULL = (byte)112; //0x70 ! final static byte TC_REFERENCE = (byte)113; //0x71 ! final static byte TC_CLASSDESC = (byte)114; //0x72 ! final static byte TC_OBJECT = (byte)115; //0x73 ! final static byte TC_STRING = (byte)116; //0x74 ! final static byte TC_ARRAY = (byte)117; //0x75 ! final static byte TC_CLASS = (byte)118; //0x76 ! final static byte TC_BLOCKDATA = (byte)119; //0x77 ! final static byte TC_ENDBLOCKDATA = (byte)120; //0x78 ! final static byte TC_RESET = (byte)121; //0x79 ! final static byte TC_BLOCKDATALONG = (byte)122; //0x7A ! final static byte TC_EXCEPTION = (byte)123; //0x7B ! final static byte TC_LONGSTRING = (byte)124; //0x7C ! final static byte TC_PROXYCLASSDESC = (byte)125; //0x7D final static byte TC_BASE = TC_NULL; ! final static byte TC_MAX = TC_PROXYCLASSDESC; final static int baseWireHandle = 0x7e0000; diff -Nrc3pad gcc-3.2.3/libjava/java/io/ObjectStreamException.java gcc-3.3/libjava/java/io/ObjectStreamException.java *** gcc-3.2.3/libjava/java/io/ObjectStreamException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/ObjectStreamException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* ObjectStreamException.java -- Superclass of all serialisation exceptions ! Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ObjectStreamException.java -- Superclass of all serialization exceptions ! Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,86 **** package java.io; - /* Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - /** ! * This exception is thrown when a problem occurs during serialization. ! * There are more specific subclasses than give more fine grained ! * indications of the precise failure. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @date February 7, 2000. ! */ ! public abstract class ObjectStreamException extends IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new ObjectStreamException without a descriptive error message ! */ ! protected ! ObjectStreamException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new ObjectStreamException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! protected ! ObjectStreamException(String message) ! { ! super(message); ! } } // class ObjectStreamException - --- 38,74 ---- package java.io; /** ! * This exception is thrown when a problem occurs during serialization. ! * There are more specific subclasses than give more fine grained ! * indications of the precise failure. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ ! public abstract class ObjectStreamException extends IOException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 7260898174833392607L; ! /** ! * Create an exception without a descriptive error message. ! */ ! protected ObjectStreamException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + protected ObjectStreamException(String message) + { + super(message); + } } // class ObjectStreamException diff -Nrc3pad gcc-3.2.3/libjava/java/io/ObjectStreamField.java gcc-3.3/libjava/java/io/ObjectStreamField.java *** gcc-3.2.3/libjava/java/io/ObjectStreamField.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/ObjectStreamField.java 2003-02-28 12:37:01.000000000 +0000 *************** public class ObjectStreamField implement *** 47,54 **** { this.name = name; this.type = type; } ! public String getName () { return name; --- 47,69 ---- { this.name = name; this.type = type; + this.typename = TypeSignature.getEncodingOfClass(type); } ! ! /** ! * There're many cases you can't get java.lang.Class from typename if your context ! * class loader can't load it, then use typename to construct the field ! */ ! ObjectStreamField (String name, String typename){ ! this.name = name; ! this.typename = typename; ! try{ ! type = TypeSignature.getClassForEncoding(typename); ! }catch(ClassNotFoundException e){ ! type = Object.class; //?? ! } ! } ! public String getName () { return name; *************** public class ObjectStreamField implement *** 61,72 **** public char getTypeCode () { ! return TypeSignature.getEncodingOfClass (type).charAt (0); } public String getTypeString () { ! return TypeSignature.getEncodingOfClass (type); } public int getOffset () --- 76,88 ---- public char getTypeCode () { ! return typename.charAt (0); } public String getTypeString () { ! // use intern() ! return typename.intern(); } public int getOffset () *************** public class ObjectStreamField implement *** 106,110 **** --- 122,127 ---- private String name; private Class type; + private String typename; private int offset = -1; // XXX make sure this is correct } diff -Nrc3pad gcc-3.2.3/libjava/java/io/OptionalDataException.java gcc-3.3/libjava/java/io/OptionalDataException.java *** gcc-3.2.3/libjava/java/io/OptionalDataException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/OptionalDataException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* OptionalDataException.java -- indicates unexpected data in serialised stream ! Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* OptionalDataException.java -- indicates unexpected data in serialized stream ! Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,98 **** package java.io; - /* Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - /** ! * This exception is thrown when unexpected data appears in the input ! * stream from which a serialized object is being read. The field ! * eof will always be set to true (***Why even have it?***) and ! * the count field will contain the number of valid bytes ! * available to be read. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @date February 7, 2000. ! */ public class OptionalDataException extends ObjectStreamException { ! private static final long serialVersionUID = -8011121865681257820L; ! ! /* ! * Instance Variables ! */ ! ! /** ! * Whether or not the end of the stream has been reached ! */ ! public boolean eof; ! ! /** ! * The number of valid bytes that can be read ! */ ! public int length; ! ! /*************************************************************************/ ! ! /* ! * Constructors ! */ ! /** ! * Create a new OptionalDataException with an eof parameter indicating ! * whether or not the end of stream is reached and the number of valid ! * bytes that may be read. ! * ! * @param eof 'true' if end of stream reached, 'false' otherwise ! * @param count The number of valid bytes to be read. ! */ ! OptionalDataException(boolean eof, int count) ! { ! this.eof = eof; ! this.length = count; ! } } // class OptionalDataException - --- 38,91 ---- package java.io; /** ! * This exception is thrown when unexpected data appears in the input ! * stream from which a serialized object is being read. There are two ! * cases:
          ! *
        • The next stream element is primitive data. eof will ! * be false, and count is the number of bytes of primitive ! * data available.
        • ! *
        • The data consumable by readObject or readExternal has been exhausted. ! * eof is true, and count is 0.
        • ! *
        ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 ! */ public class OptionalDataException extends ObjectStreamException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -8011121865681257820L; ! /** ! * Whether or not the end of the stream has been reached. ! * ! * @serial the end of the buffer was reached ! */ ! public boolean eof; ! /** ! * The number of valid bytes that can be read. ! * ! * @serial the bytes of the buffer remaining ! */ ! public int length; + /** + * Create a new OptionalDataException with an eof parameter indicating + * whether or not the end of stream is reached and the number of valid + * bytes that may be read. + * + * @param eof 'true' if end of stream reached, 'false' otherwise + * @param count The number of valid bytes to be read + */ + OptionalDataException(boolean eof, int count) + { + this.eof = eof; + this.length = count; + } } // class OptionalDataException diff -Nrc3pad gcc-3.2.3/libjava/java/io/OutputStreamWriter.java gcc-3.3/libjava/java/io/OutputStreamWriter.java *** gcc-3.2.3/libjava/java/io/OutputStreamWriter.java 2001-02-20 19:01:55.000000000 +0000 --- gcc-3.3/libjava/java/io/OutputStreamWriter.java 2003-02-13 23:30:00.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation This file is part of libgcj. *************** public class OutputStreamWriter extends *** 28,34 **** private char[] work; private int wcount; ! public String getEncoding() { return converter.getName(); } private OutputStreamWriter(OutputStream out, UnicodeToBytes encoder) { --- 28,37 ---- private char[] work; private int wcount; ! public String getEncoding() ! { ! return out != null ? converter.getName() : null; ! } private OutputStreamWriter(OutputStream out, UnicodeToBytes encoder) { diff -Nrc3pad gcc-3.2.3/libjava/java/io/PipedInputStream.java gcc-3.3/libjava/java/io/PipedInputStream.java *** gcc-3.2.3/libjava/java/io/PipedInputStream.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/PipedInputStream.java 2002-06-15 18:59:15.000000000 +0000 *************** public class PipedInputStream extends In *** 67,76 **** /** Set to true if close() has been called on this InputStream. */ boolean closed; /** ! * The size of the internal buffer used for input/output. ! */ ! protected static final int PIPE_SIZE = 2048; /** * This is the internal circular buffer used for storing bytes written --- 67,81 ---- /** Set to true if close() has been called on this InputStream. */ boolean closed; + /** ! * The size of the internal buffer used for input/output. ! */ ! /* The "Constant Field Values" Javadoc of the Sun J2SE 1.4 ! * specifies 1024. ! */ ! protected static final int PIPE_SIZE = 1024; ! /** * This is the internal circular buffer used for storing bytes written diff -Nrc3pad gcc-3.2.3/libjava/java/io/PipedOutputStream.java gcc-3.3/libjava/java/io/PipedOutputStream.java *** gcc-3.2.3/libjava/java/io/PipedOutputStream.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/PipedOutputStream.java 2003-02-04 21:08:26.000000000 +0000 *************** *** 1,5 **** /* PipedOutputStream.java -- Write portion of piped streams. ! Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* PipedOutputStream.java -- Write portion of piped streams. ! Copyright (C) 1998, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class PipedOutputStream extends O *** 97,103 **** */ public void connect(PipedInputStream sink) throws IOException { ! if (sink != null) throw new IOException ("Already connected"); sink.connect(this); } --- 97,103 ---- */ public void connect(PipedInputStream sink) throws IOException { ! if (this.sink != null || sink.source != null) throw new IOException ("Already connected"); sink.connect(this); } *************** public class PipedOutputStream extends O *** 154,160 **** * had read all available data. Thats not the case - this method * appears to be a no-op? */ ! public void flush() { } --- 154,160 ---- * had read all available data. Thats not the case - this method * appears to be a no-op? */ ! public void flush() throws IOException { } *************** public class PipedOutputStream extends O *** 165,171 **** * * @exception IOException If an error occurs */ ! public void close() { // A close call on an unconnected PipedOutputStream has no effect. if (sink != null) --- 165,171 ---- * * @exception IOException If an error occurs */ ! public void close() throws IOException { // A close call on an unconnected PipedOutputStream has no effect. if (sink != null) diff -Nrc3pad gcc-3.2.3/libjava/java/io/PipedWriter.java gcc-3.3/libjava/java/io/PipedWriter.java *** gcc-3.2.3/libjava/java/io/PipedWriter.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/PipedWriter.java 2003-02-04 21:08:26.000000000 +0000 *************** *** 1,5 **** /* PipedWriter.java -- Write portion of piped character streams. ! Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* PipedWriter.java -- Write portion of piped character streams. ! Copyright (C) 1998, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class PipedWriter extends Writer *** 100,106 **** */ public void connect(PipedReader sink) throws IOException { ! if (sink != null) throw new IOException ("Already connected"); sink.connect(this); } --- 100,106 ---- */ public void connect(PipedReader sink) throws IOException { ! if (this.sink != null || sink.source != null) throw new IOException ("Already connected"); sink.connect(this); } *************** public class PipedWriter extends Writer *** 166,172 **** * * @exception IOException If an error occurs */ ! public void close() { // A close call on an unconnected PipedWriter has no effect. if (sink != null) --- 166,172 ---- * * @exception IOException If an error occurs */ ! public void close() throws IOException { // A close call on an unconnected PipedWriter has no effect. if (sink != null) diff -Nrc3pad gcc-3.2.3/libjava/java/io/PushbackInputStream.java gcc-3.3/libjava/java/io/PushbackInputStream.java *** gcc-3.2.3/libjava/java/io/PushbackInputStream.java 2002-03-25 02:28:02.000000000 +0000 --- gcc-3.3/libjava/java/io/PushbackInputStream.java 2002-06-15 18:59:15.000000000 +0000 *************** public class PushbackInputStream extends *** 201,206 **** --- 201,207 ---- public synchronized int read(byte[] b, int off, int len) throws IOException { int numBytes = Math.min(buf.length - pos, len); + if (numBytes > 0) { System.arraycopy (buf, pos, b, off, numBytes); *************** public class PushbackInputStream extends *** 209,218 **** off += numBytes; } ! if (len > 0) { len = super.read(b, off, len); ! if (len == -1) // EOF return numBytes > 0 ? numBytes : -1; numBytes += len; } --- 210,219 ---- off += numBytes; } ! if (len > 0) { len = super.read(b, off, len); ! if (len == -1) //EOF return numBytes > 0 ? numBytes : -1; numBytes += len; } *************** public class PushbackInputStream extends *** 318,324 **** int numread = (int) Math.min((long) (buf.length - pos), n); pos += numread; n -= numread; ! n -= super.skip(n); } return origN - n; --- 319,326 ---- int numread = (int) Math.min((long) (buf.length - pos), n); pos += numread; n -= numread; ! if (n > 0) ! n -= super.skip(n); } return origN - n; diff -Nrc3pad gcc-3.2.3/libjava/java/io/RandomAccessFile.java gcc-3.3/libjava/java/io/RandomAccessFile.java *** gcc-3.2.3/libjava/java/io/RandomAccessFile.java 2001-08-02 23:46:39.000000000 +0000 --- gcc-3.3/libjava/java/io/RandomAccessFile.java 2002-08-13 23:10:11.000000000 +0000 *************** *** 1,6 **** // RandomAccessFile.java ! /* Copyright (C) 1998, 1999, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // RandomAccessFile.java ! /* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** public class RandomAccessFile implements *** 40,45 **** --- 40,50 ---- return fd.getFilePointer(); } + public void setLength (long pos) throws IOException + { + fd.setLength(pos); + } + public long length () throws IOException { return fd.length(); *************** public class RandomAccessFile implements *** 166,172 **** public int skipBytes (int count) throws IOException { ! return count <= 0 ? 0 : fd.seek(count, FileDescriptor.CUR, true); } public void write (int oneByte) throws IOException --- 171,181 ---- public int skipBytes (int count) throws IOException { ! if (count <= 0) ! return 0; ! long startPos = fd.getFilePointer(); ! long endPos = fd.seek(count, FileDescriptor.CUR, true); ! return (int) (endPos - startPos); } public void write (int oneByte) throws IOException diff -Nrc3pad gcc-3.2.3/libjava/java/io/Serializable.java gcc-3.3/libjava/java/io/Serializable.java *** gcc-3.2.3/libjava/java/io/Serializable.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/Serializable.java 2002-11-10 22:06:48.000000000 +0000 *************** package java.io; *** 51,54 **** --- 51,55 ---- */ public interface Serializable { + static final long serialVersionUID = 1196656838076753133L; } // interface Serializable diff -Nrc3pad gcc-3.2.3/libjava/java/io/SerializablePermission.java gcc-3.3/libjava/java/io/SerializablePermission.java *** gcc-3.2.3/libjava/java/io/SerializablePermission.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/SerializablePermission.java 2002-11-10 22:06:48.000000000 +0000 *************** import java.security.BasicPermission; *** 61,67 **** */ public final class SerializablePermission extends BasicPermission { ! /* * Class Variables */ --- 61,68 ---- */ public final class SerializablePermission extends BasicPermission { ! static final long serialVersionUID = 8537212141160296410L; ! /* * Class Variables */ diff -Nrc3pad gcc-3.2.3/libjava/java/io/StreamCorruptedException.java gcc-3.3/libjava/java/io/StreamCorruptedException.java *** gcc-3.2.3/libjava/java/io/StreamCorruptedException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/StreamCorruptedException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** /* StreamCorruptedException.java -- Error in stream during serialization ! Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* StreamCorruptedException.java -- Error in stream during serialization ! Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,85 **** package java.io; - /* Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - /** ! * This exception is thrown when there is an error in the data that is ! * read from a stream during de-serialization. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @date February 7, 2000. ! */ ! public class StreamCorruptedException extends ObjectStreamException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new StreamCorruptedException without a descriptive error message ! */ ! public ! StreamCorruptedException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new StreamCorruptedException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! StreamCorruptedException(String message) ! { ! super(message); ! } } // class StreamCorruptedException - --- 38,73 ---- package java.io; /** ! * This exception is thrown when there is an error in the data that is ! * read from a stream during de-serialization. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ ! public class StreamCorruptedException extends ObjectStreamException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 8983558202217591746L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public StreamCorruptedException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public StreamCorruptedException(String message) + { + super(message); + } } // class StreamCorruptedException diff -Nrc3pad gcc-3.2.3/libjava/java/io/StreamTokenizer.java gcc-3.3/libjava/java/io/StreamTokenizer.java *** gcc-3.2.3/libjava/java/io/StreamTokenizer.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/StreamTokenizer.java 2002-07-16 21:08:25.000000000 +0000 *************** *** 1,5 **** /* StreamTokenizer.java -- parses streams of characters into tokens ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- /* StreamTokenizer.java -- parses streams of characters into tokens ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of GNU Classpath. *************** public class StreamTokenizer *** 554,569 **** } /** ! * This method returns the current line number. Note that if the ! * pushBack() method is called, it has no effect on the ! * line number returned by this method. ! * ! * @return The current line number */ public void pushBack() { - // pushBack may cause the lineno method to return an incorrect value - // if lineno is called before the next call to nextToken. pushedBack = true; } --- 554,566 ---- } /** ! * Puts the current token back into the StreamTokenizer so ! * nextToken will return the same value on the next call. ! * May cause the lineno method to return an incorrect value ! * if lineno is called before the next call to nextToken. */ public void pushBack() { pushedBack = true; } *************** public class StreamTokenizer *** 670,676 **** if (hi > 255) hi = 255; for (int i = low; i <= hi; i++) ! whitespace[i] = true; } /** --- 667,676 ---- if (hi > 255) hi = 255; for (int i = low; i <= hi; i++) ! { ! resetChar(i); ! whitespace[i] = true; ! } } /** diff -Nrc3pad gcc-3.2.3/libjava/java/io/StringWriter.java gcc-3.3/libjava/java/io/StringWriter.java *** gcc-3.2.3/libjava/java/io/StringWriter.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/StringWriter.java 2003-02-04 21:08:26.000000000 +0000 *************** *** 1,5 **** /* StringWriter.java -- Writes bytes to a StringBuffer ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* StringWriter.java -- Writes bytes to a StringBuffer ! Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class StringWriter extends Writer *** 61,67 **** * This method closes the stream. The contents of the internal buffer * can still be retrieved, but future writes are not guaranteed to work. */ ! public void close () { // JCL says this does nothing. This seems to violate the Writer // contract, in that other methods should still throw an --- 61,67 ---- * This method closes the stream. The contents of the internal buffer * can still be retrieved, but future writes are not guaranteed to work. */ ! public void close () throws IOException { // JCL says this does nothing. This seems to violate the Writer // contract, in that other methods should still throw an diff -Nrc3pad gcc-3.2.3/libjava/java/io/SyncFailedException.java gcc-3.3/libjava/java/io/SyncFailedException.java *** gcc-3.2.3/libjava/java/io/SyncFailedException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/SyncFailedException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* SyncFailedException.java -- The sync failed (?) ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* SyncFailedException.java -- a file sync failed ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,86 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Complete to 1.1. - */ - /** ! * I really wish I knew what caused this exception to be thrown. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @date September 24, 1998 ! */ ! public class SyncFailedException extends IOException ! { ! ! private static final long serialVersionUID = -2353342684412443330L; ! ! /* ! * Constructors */ ! ! /** ! * Create a new SyncFailedException without a descriptive error message ! */ ! SyncFailedException() ! { ! super(); ! } ! ! /*************************************************************************/ ! ! /** ! * Create a new SyncFailedException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! SyncFailedException(String message) { ! super(message); ! } } // class SyncFailedException - --- 38,66 ---- package java.io; /** ! * Thrown when a file synchronization fails. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @see FileDescriptor#sync() ! * @since 1.1 ! * @status updated to 1.4 */ ! public class SyncFailedException extends IOException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -2353342684412443330L; + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public SyncFailedException(String message) + { + super(message); + } } // class SyncFailedException diff -Nrc3pad gcc-3.2.3/libjava/java/io/UnsupportedEncodingException.java gcc-3.3/libjava/java/io/UnsupportedEncodingException.java *** gcc-3.2.3/libjava/java/io/UnsupportedEncodingException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/UnsupportedEncodingException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* UnsupportedEncodingException.java -- The requested encoding isn't supported ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnsupportedEncodingException.java -- the requested encoding isn't supported ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,86 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, plus online - * API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * This exception is thrown when the requested character encoding is ! * not supported. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Per Bothner ! * @date April 17, 1998. ! */ ! public class UnsupportedEncodingException extends IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new UnsupportedEncodingException without a descriptive error message ! */ ! public ! UnsupportedEncodingException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new UnsupportedEncodingException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! UnsupportedEncodingException(String message) ! { ! super(message); ! } } // class UnsupportedEncodingException - --- 38,73 ---- package java.io; /** ! * This exception is thrown when the requested character encoding is ! * not supported. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Per Bothner ! * @since 1.1 ! * @status updated to 1.4 */ ! public class UnsupportedEncodingException extends IOException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -4274276298326136670L; ! /** ! * Create an exception without a descriptive error message. ! */ ! public UnsupportedEncodingException() ! { ! } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public UnsupportedEncodingException(String message) + { + super(message); + } } // class UnsupportedEncodingException diff -Nrc3pad gcc-3.2.3/libjava/java/io/UTFDataFormatException.java gcc-3.3/libjava/java/io/UTFDataFormatException.java *** gcc-3.2.3/libjava/java/io/UTFDataFormatException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/UTFDataFormatException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,5 **** ! /* UTFDataFormatException.java -- Bad format in UTF data ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UTFDataFormatException.java -- thrown on bad format in UTF data ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,86 **** package java.io; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Complete to 1.1. - */ - /** ! * When reading a UTF string from an input stream, this exception is thrown ! * to indicate that the data read is invalid. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @date September 24, 1998 ! */ ! public class UTFDataFormatException extends IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Create a new UTFDataFormatException without a descriptive error message ! */ ! public ! UTFDataFormatException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Create a new UTFDataFormatException with a descriptive error message String ! * ! * @param message The descriptive error message ! */ ! public ! UTFDataFormatException(String message) ! { ! super(message); ! } } // class UTFDataFormatException - --- 38,74 ---- package java.io; /** ! * When reading a UTF string from an input stream, this exception is thrown ! * to indicate that the data read is invalid. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Tom Tromey ! * @see DataInput ! * @see DataInputStream#readUTF(DataInput) ! * @status updated to 1.4 */ ! public class UTFDataFormatException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 420743449228280612L; ! /** ! * Create a new UTFDataFormatException without a descriptive error message. ! */ ! public UTFDataFormatException() ! { ! } + /** + * Create a new UTFDataFormatException with a descriptive error message. + * + * @param message the descriptive error message + */ + public UTFDataFormatException(String message) + { + super(message); + } } // class UTFDataFormatException diff -Nrc3pad gcc-3.2.3/libjava/java/io/VMObjectStreamClass.java gcc-3.3/libjava/java/io/VMObjectStreamClass.java *** gcc-3.2.3/libjava/java/io/VMObjectStreamClass.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/io/VMObjectStreamClass.java 2003-01-20 06:49:28.000000000 +0000 *************** *** 0 **** --- 1,50 ---- + /* VMObjectStreamClass.java -- VM helper functions for ObjectStreamClass + Copyright (C) 2003 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.io; + + import java.lang.reflect.Method; + + final class VMObjectStreamClass + { + /** + * Returns true if CLAZZ has a static class initializer + * (a.k.a. ). + */ + static native boolean hasClassInitializer (Class clazz); + } diff -Nrc3pad gcc-3.2.3/libjava/java/io/WriteAbortedException.java gcc-3.3/libjava/java/io/WriteAbortedException.java *** gcc-3.2.3/libjava/java/io/WriteAbortedException.java 2002-01-22 22:40:14.000000000 +0000 --- gcc-3.3/libjava/java/io/WriteAbortedException.java 2002-06-15 18:59:15.000000000 +0000 *************** *** 1,6 **** ! /* WriteAbortedException.java -- An exception occurred while writing a ! serialization stream ! Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* WriteAbortedException.java -- wraps an exception thrown while writing ! Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 40,100 **** package java.io; /** ! * This exception is thrown when one of the other ObjectStreamException ! * subclasses was thrown during a serialization write. ! * ! * @version 0.0 * * @author Aaron M. Renn (arenn@urbanophile.com) */ public class WriteAbortedException extends ObjectStreamException { ! /* ! * Instance Variables ! */ ! ! /** ! * The detailed exception that caused this exception to be thrown ! */ ! public Exception detail; ! private transient String message; ! ! /*************************************************************************/ ! ! /* ! * Constructors ! */ ! ! /** ! * Create a new WriteAbortedException with an eof parameter indicating ! * the detailed Exception that caused this exception to be thrown. ! * ! * @param detail The exception that caused this exception to be thrown ! */ ! public ! WriteAbortedException(String msg, Exception detail) ! { ! this.message = msg; ! this.detail = detail; ! } ! ! /*************************************************************************/ ! /* ! * Instance Variables ! */ ! /** ! * This method returns a message indicating what went wrong, including ! * the message text from the initial exception that caused this one to ! * be thrown ! */ ! public String ! getMessage() ! { ! return(message + ": " + detail.getMessage()); ! } } // class WriteAbortedException - --- 39,109 ---- package java.io; /** ! * This exception is thrown when another ObjectStreamException occurs during ! * a serialization read or write. The stream is reset, and deserialized ! * objects are discarded. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Eric Blake + * @since 1.1 + * @status updated to 1.4 */ public class WriteAbortedException extends ObjectStreamException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -3326426625597282442L; ! /** ! * The cause of this exception. This pre-dates the exception chaining ! * of Throwable; and although you can change this field, you are wiser ! * to leave it alone. ! * ! * @serial the exception cause ! */ ! public Exception detail; ! /** ! * Create a new WriteAbortedException with a specified message and ! * cause. ! * ! * @param msg the message ! * @param detail the cause ! */ ! public WriteAbortedException(String msg, Exception detail) ! { ! super(msg); ! initCause(detail); ! this.detail = detail; ! } ! /** ! * This method returns a message indicating what went wrong, in this ! * format: ! * super.getMessage() + (detail == null ? "" : "; " + detail). ! * ! * @return the chained message ! */ ! public String getMessage() ! { ! if (detail == this || detail == null) ! return super.getMessage(); ! return super.getMessage() + "; " + detail; ! } + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the detail field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if detail == this, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } // class WriteAbortedException diff -Nrc3pad gcc-3.2.3/libjava/java/lang/AbstractMethodError.java gcc-3.3/libjava/java/lang/AbstractMethodError.java *** gcc-3.2.3/libjava/java/lang/AbstractMethodError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/AbstractMethodError.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,5 **** ! /* AbstractMethodError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* AbstractMethodError.java -- thrown if an abstract method is invoked ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,78 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * An AbstractMethodError is thrown when an application ! * attempts to access an abstract method. Compilers typically detect ! * this error, but it can be thrown at run time if the definition of a ! * class has changed since the application was last compiled. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class AbstractMethodError extends IncompatibleClassChangeError { ! static final long serialVersionUID = -1654391082989018462L; /** * Create an error without a message. */ public AbstractMethodError() ! { ! super(); ! } /** * Create an error with a message. */ public AbstractMethodError(String s) ! { ! super(s); ! } } --- 38,75 ---- package java.lang; /** ! * An AbstractMethodError is thrown when an application attempts ! * to access an abstract method. Compilers typically detect this error, but ! * it can be thrown at run time if the definition of a class has changed ! * since the application was last compiled. This can also occur when ! * reflecting on methods. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class AbstractMethodError extends IncompatibleClassChangeError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -1654391082989018462L; /** * Create an error without a message. */ public AbstractMethodError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public AbstractMethodError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ArithmeticException.java gcc-3.3/libjava/java/lang/ArithmeticException.java *** gcc-3.2.3/libjava/java/lang/ArithmeticException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ArithmeticException.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,6 **** /* ArithmeticException.java -- exception thrown to indicate conditions like divide by zero. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* ArithmeticException.java -- exception thrown to indicate conditions like divide by zero. ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,79 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional circumstances. ! * In this case an ArithmeticException is thrown when things like trying ! * to divide a number by zero. ! * ! * @since JDK 1.0 * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class ArithmeticException extends RuntimeException { ! static final long serialVersionUID = 2256477558314496007L; /** * Create an exception without a message. */ public ArithmeticException() ! { ! super(); ! } /** * Create an exception with a message. */ public ArithmeticException(String s) ! { ! super(s); ! } } --- 39,77 ---- package java.lang; /** ! * Thrown when a math error has occured, such as trying to divide an ! * integer by zero. For example:
        ! *
        !  * int i = 0;
        !  * int j = 2 / i;
        !  * 
        * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class ArithmeticException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 2256477558314496007L; /** * Create an exception without a message. */ public ArithmeticException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public ArithmeticException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ArrayIndexOutOfBoundsException.java gcc-3.3/libjava/java/lang/ArrayIndexOutOfBoundsException.java *** gcc-3.2.3/libjava/java/lang/ArrayIndexOutOfBoundsException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ArrayIndexOutOfBoundsException.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,6 **** /* ArrayIndexOutOfBoundsException.java -- exception thrown when accessing an illegal index. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* ArrayIndexOutOfBoundsException.java -- exception thrown when accessing an illegal index. ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,87 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions, in this case ! * when trying to access an illegal index. This exception is thrown when ! * accessing an index which is either negative or greater than the size of ! * the array minus one. ! * ! * @since JDK 1.0 * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException { ! static final long serialVersionUID = -5116101128118950844L; /** * Create an exception without a message. */ ! public ArrayIndexOutOfBoundsException() { ! super(); } /** * Create an exception with a message. */ ! public ArrayIndexOutOfBoundsException(String s) { super(s); } /** * Create an exception indicating the illegal index. */ ! public ArrayIndexOutOfBoundsException(int index) { super("Array index out of range: " + index); } - } --- 39,87 ---- package java.lang; /** ! * Thrown when attempting to access a position outside the valid range of ! * an array. For example:
        ! *
        !  * int[] i = { 1 };
        !  * i[1] = 2;
        !  * 
        * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -5116101128118950844L; /** * Create an exception without a message. */ ! public ArrayIndexOutOfBoundsException() ! { } /** * Create an exception with a message. + * + * @param s the message */ ! public ArrayIndexOutOfBoundsException(String s) ! { super(s); } /** * Create an exception indicating the illegal index. + * + * @param index the invalid index */ ! public ArrayIndexOutOfBoundsException(int index) ! { super("Array index out of range: " + index); } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ArrayStoreException.java gcc-3.3/libjava/java/lang/ArrayStoreException.java *** gcc-3.2.3/libjava/java/lang/ArrayStoreException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ArrayStoreException.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,6 **** /* ArrayStoreException.java -- exception thrown to when trying to store an object into an array of a different type. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* ArrayStoreException.java -- exception thrown to when trying to store an object into an array of a different type. ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,78 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions, in this case ! * when trying to store an object into an array of a different type. ! * ! * @since JDK 1.0 * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class ArrayStoreException extends RuntimeException { ! static final long serialVersionUID = -4522193890499838241L; /** * Create an exception without a message. */ public ArrayStoreException() ! { ! super(); ! } /** * Create an exception with a message. */ public ArrayStoreException(String s) ! { ! super(s); ! } } --- 39,77 ---- package java.lang; /** ! * Thrown when trying to store an object of the wrong runtime type in an ! * array. For example:
        ! *
        !  * Object[] o = new Integer[1];
        !  * o[0] = "oops";
        !  * 
        * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class ArrayStoreException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4522193890499838241L; /** * Create an exception without a message. */ public ArrayStoreException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public ArrayStoreException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/AssertionError.java gcc-3.3/libjava/java/lang/AssertionError.java *** gcc-3.2.3/libjava/java/lang/AssertionError.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/AssertionError.java 2002-09-16 09:46:36.000000000 +0000 *************** *** 0 **** --- 1,148 ---- + /* AssertionError.java -- indication of a failed assertion + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.lang; + + /** + * An assertion error normally occurs as a result of the assert + * statement added in JDK 1.4, to indicate that an assertion failed. There + * are enough constructors to ensure that + * new AssertionError(expression) will work for all + * espressions, regardless of type, as if the error message were given by + * the string "" + expression. This extends Error, + * because you usually do not want to inadvertently trap an assertion failure. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public class AssertionError extends Error + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -5013299493970297370L; + + /** + * Construct an AssertionError with no detail message. + */ + public AssertionError() + { + } + + /** + * Construct an AssertionError with the string conversion of the given + * object as its error message. If the object is a Throwable, it is also + * set as the cause of this error. + * + * @param msg the source of the error message + * @see Throwable#getCause() + */ + public AssertionError(Object msg) + { + super("" + msg); + if (msg instanceof Throwable) + initCause((Throwable) msg); + } + + /** + * Construct an AssertionError with the string conversion of the given + * boolean as its error message. + * + * @param msg the source of the error message + */ + public AssertionError(boolean msg) + { + super(msg ? "true" : "false"); + } + + /** + * Construct an AssertionError with the string conversion of the given + * char as its error message. + * + * @param msg the source of the error message + */ + public AssertionError(char msg) + { + super(String.valueOf(msg)); + } + + /** + * Construct an AssertionError with the string conversion of the given + * int as its error message. + * + * @param msg the source of the error message + */ + public AssertionError(int msg) + { + super(Integer.toString(msg, 10)); + } + + /** + * Construct an AssertionError with the string conversion of the given + * long as its error message. + * + * @param msg the source of the error message + */ + public AssertionError(long msg) + { + super(Long.toString(msg)); + } + + /** + * Construct an AssertionError with the string conversion of the given + * float as its error message. + * + * @param msg the source of the error message + */ + public AssertionError(float msg) + { + super(Float.toString(msg)); + } + + /** + * Construct an AssertionError with the string conversion of the given + * double as its error message. + * + * @param msg the source of the error message + */ + public AssertionError(double msg) + { + super(Double.toString(msg)); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Boolean.java gcc-3.3/libjava/java/lang/Boolean.java *** gcc-3.2.3/libjava/java/lang/Boolean.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Boolean.java 2002-06-13 18:16:24.000000000 +0000 *************** *** 1,5 **** /* Boolean.java -- object wrapper for boolean ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Boolean.java -- object wrapper for boolean ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 41,188 **** import java.io.Serializable; /** ! * Instances of class Boolean represent primitive * boolean values. * * @author Paul Fisher ! * @since JDK1.0 ! */ public final class Boolean implements Serializable { ! static final long serialVersionUID = -3665804199014368530L; ! ! /** ! * This field is a Boolean object representing the ! * primitive value true. This instance is returned ! * by the static valueOf() methods if they return ! * a Boolean representing true. ! */ ! public static final Boolean TRUE = new Boolean(true); ! ! /** ! * This field is a Boolean object representing the ! * primitive value false. This instance is returned ! * by the static valueOf() methods if they return ! * a Boolean representing false. ! */ ! public static final Boolean FALSE = new Boolean(false); ! /** ! * The primitive type boolean is represented by this ! * Class object. ! */ ! public static final Class TYPE = VMClassLoader.getPrimitiveClass('Z'); ! ! /** ! * The immutable value of this Boolean. ! */ ! private final boolean value; ! ! /** ! * Create a Boolean object representing the value of the ! * argument value. In general the use of the static ! * method valueof(boolean) is more efficient since it will ! * not create a new object. ! * ! * @param value the primitive value of this Boolean ! */ ! public Boolean(boolean value) { ! this.value = value; ! } ! ! /** ! * Creates a Boolean object representing the primitive ! * true if and only if s matches ! * the string "true" ignoring case, otherwise the object will represent ! * the primitive false. In general the use of the static ! * method valueof(String) is more efficient since it will ! * not create a new object. ! * ! * @param s the String representation of true ! * or false ! */ ! public Boolean(String s) { ! value = "true".equalsIgnoreCase(s); ! } ! /** ! * Return the primitive boolean value of this ! * Boolean object. ! */ ! public boolean booleanValue() { ! return value; ! } ! /** ! * Returns the Boolean TRUE if the given boolean is ! * true, otherwise it will return the Boolean ! * FALSE. ! * ! * @since 1.4 ! */ ! public static Boolean valueOf(boolean b) { ! return b ? TRUE : FALSE; ! } ! /** ! * Returns the Boolean TRUE if and only if the given ! * String is equal, ignoring case, to the the String "true", otherwise ! * it will return the Boolean FALSE. ! */ ! public static Boolean valueOf(String s) { ! return "true".equalsIgnoreCase(s) ? TRUE : FALSE; ! } ! /** ! * Returns the integer 1231 if this object represents ! * the primitive true and the integer 1237 ! * otherwise. ! */ ! public int hashCode() { ! return (value) ? 1231 : 1237; ! } ! /** ! * If the obj is an instance of Boolean and ! * has the same primitive value as this object then true ! * is returned. In all other cases, including if the obj ! * is null, false is returned. ! * ! * @param obj possibly an instance of any Class ! * @return false is obj is an instance of ! * Boolean and has the same primitive value as this ! * object. ! */ ! public boolean equals(Object obj) { ! return (obj instanceof Boolean && value == ((Boolean)obj).value); ! } ! /** ! * If the value of the system property name matches ! * "true" ignoring case then the function returns true. ! */ ! public static boolean getBoolean(String name) { ! String val = System.getProperty(name); ! return ("true".equalsIgnoreCase(val)); ! } ! ! /** ! * Returns "true" if the value of the give boolean is true and ! * returns "false" if the value of the given boolean is false. ! * ! * @since 1.4 ! */ ! public static String toString(boolean b) ! { ! return b ? "true" : "false"; ! } ! /** ! * Returns "true" if the value of this object is true and ! * returns "false" if the value of this object is false. ! */ ! public String toString() ! { ! return (value) ? "true" : "false"; ! } } --- 41,224 ---- import java.io.Serializable; /** ! * Instances of class Boolean represent primitive * boolean values. * * @author Paul Fisher ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 ! */ public final class Boolean implements Serializable { ! /** ! * Compatible with JDK 1.0.2+. ! */ ! private static final long serialVersionUID = -3665804199014368530L; ! /** ! * This field is a Boolean object representing the ! * primitive value true. This instance is returned ! * by the static valueOf() methods if they return ! * a Boolean representing true. ! */ ! public static final Boolean TRUE = new Boolean(true); ! /** ! * This field is a Boolean object representing the ! * primitive value false. This instance is returned ! * by the static valueOf() methods if they return ! * a Boolean representing false. ! */ ! public static final Boolean FALSE = new Boolean(false); ! /** ! * The primitive type boolean is represented by this ! * Class object. ! * ! * @since 1.1 ! */ ! public static final Class TYPE = VMClassLoader.getPrimitiveClass('Z'); ! /** ! * The immutable value of this Boolean. ! * @serial the wrapped value ! */ ! private final boolean value; ! /** ! * Create a Boolean object representing the value of the ! * argument value. In general the use of the static ! * method valueof(boolean) is more efficient since it will ! * not create a new object. ! * ! * @param value the primitive value of this Boolean ! * @see #valueOf(boolean) ! */ ! public Boolean(boolean value) ! { ! this.value = value; ! } ! /** ! * Creates a Boolean object representing the primitive ! * true if and only if s matches ! * the string "true" ignoring case, otherwise the object will represent ! * the primitive false. In general the use of the static ! * method valueof(String) is more efficient since it will ! * not create a new object. ! * ! * @param s the String representation of true ! * or false ! */ ! public Boolean(String s) ! { ! value = "true".equalsIgnoreCase(s); ! } ! /** ! * Return the primitive boolean value of this ! * Boolean object. ! * ! * @return true or false, depending on the value of this Boolean ! */ ! public boolean booleanValue() ! { ! return value; ! } ! /** ! * Returns the Boolean TRUE if the given boolean is ! * true, otherwise it will return the Boolean ! * FALSE. ! * ! * @param b the boolean to wrap ! * @return the wrapper object ! * @see #TRUE ! * @see #FALSE ! * @since 1.4 ! */ ! public static Boolean valueOf(boolean b) ! { ! return b ? TRUE : FALSE; ! } ! ! /** ! * Returns the Boolean TRUE if and only if the given ! * String is equal, ignoring case, to the the String "true", otherwise ! * it will return the Boolean FALSE. ! * ! * @param s the string to convert ! * @return a wrapped boolean from the string ! */ ! public static Boolean valueOf(String s) ! { ! return "true".equalsIgnoreCase(s) ? TRUE : FALSE; ! } ! ! /** ! * Returns "true" if the value of the give boolean is true and ! * returns "false" if the value of the given boolean is false. ! * ! * @param b the boolean to convert ! * @return the string representation of the boolean ! * @since 1.4 ! */ ! public static String toString(boolean b) ! { ! return b ? "true" : "false"; ! } ! ! /** ! * Returns "true" if the value of this object is true and ! * returns "false" if the value of this object is false. ! * ! * @return the string representation of this ! */ ! public String toString() ! { ! return value ? "true" : "false"; ! } ! ! /** ! * Returns the integer 1231 if this object represents ! * the primitive true and the integer 1237 ! * otherwise. ! * ! * @return the hash code ! */ ! public int hashCode() ! { ! return value ? 1231 : 1237; ! } ! ! /** ! * If the obj is an instance of Boolean and ! * has the same primitive value as this object then true ! * is returned. In all other cases, including if the obj ! * is null, false is returned. ! * ! * @param obj possibly an instance of any Class ! * @return true if obj equals this ! */ ! public boolean equals(Object obj) ! { ! return obj instanceof Boolean && value == ((Boolean) obj).value; ! } ! ! /** ! * If the value of the system property name matches ! * "true" ignoring case then the function returns true. ! * ! * @param name the property name to look up ! * @return true if the property resulted in "true" ! * @throws SecurityException if accessing the system property is forbidden ! * @see System#getProperty(String) ! */ ! public static boolean getBoolean(String name) ! { ! if (name == null || "".equals(name)) ! return false; ! return "true".equalsIgnoreCase(System.getProperty(name)); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Byte.java gcc-3.3/libjava/java/lang/Byte.java *** gcc-3.2.3/libjava/java/lang/Byte.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Byte.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,5 **** /* Byte.java -- object wrapper for byte ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Byte.java -- object wrapper for byte ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 48,314 **** * @author Paul Fisher * @author John Keiser * @author Per Bothner ! * @since JDK 1.0 */ ! public final class Byte extends Number implements Comparable { ! static final long serialVersionUID = -7183698231559129828L; /** ! * The minimum value a byte can represent is -128. */ public static final byte MIN_VALUE = -128; /** ! * The maximum value a byte can represent is 127. */ public static final byte MAX_VALUE = 127; /** ! * The primitive type byte is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('B'); /** * The immutable value of this Byte. */ private final byte value; /** ! * Create a Byte object representing the value of the * byte argument. * * @param value the value to use ! */ ! public Byte(byte value) { this.value = value; } /** ! * Create a Byte object representing the value specified ! * by the String argument. * ! * @param s the string to convert. */ ! public Byte(String s) throws NumberFormatException { value = parseByte(s, 10); } /** ! * Return a hashcode representing this Object. ! * ! * Byte's hash code is calculated by simply returning its ! * value. * ! * @return this Object's hash code. */ ! public int hashCode() ! { ! return value; ! } ! ! /** ! * Returns true if obj is an instance of ! * Byte and represents the same byte value. ! * @return whether these Objects are semantically equal. ! */ ! public boolean equals(Object obj) { ! return ((obj instanceof Byte) && (value == ((Byte)obj).byteValue())); } /** ! * Converts the byte to a String and assumes ! * a radix of 10. ! * @param i the byte to convert to String ! * @return the String representation of the argument. ! */ ! public static String toString(byte i) { ! return Integer.toString ((int) i); } /** ! * Converts the Byte value to a String and ! * assumes a radix of 10. ! * @return the String representation of this Byte. ! */ ! public String toString() ! { ! return Integer.toString ((int) value); ! } ! ! /** ! * Creates a new Byte object using the String, ! * assuming a radix of 10. ! * @param s the String to convert. ! * @return the new Byte. ! * @see #Byte(java.lang.String) ! * @see #parseByte(java.lang.String) ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a byte. */ ! public static Byte valueOf(String s) throws NumberFormatException { ! return new Byte(parseByte(s)); } /** * Creates a new Byte object using the String * and specified radix (base). - * @param s the String to convert. - * @param radix the radix (base) to convert with. - * @return the new Byte. - * @see #parseByte(java.lang.String,int) - * @exception NumberFormatException thrown if the String - * cannot be parsed as a byte. - */ - public static Byte valueOf(String s, int radix) - throws NumberFormatException - { - return new Byte(parseByte(s, radix)); - } - - /** - * Converts the specified String into a byte. - * This function assumes a radix of 10. * * @param s the String to convert ! * @return the byte value of the String ! * argument. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a byte. */ ! public static byte parseByte(String s) throws NumberFormatException { ! return parseByte(s, 10); } /** ! * Converts the specified String into a byte ! * using the specified radix (base). * ! * @param str the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to
        byte
        . ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a byte. */ ! public static byte parseByte(String str, int radix) ! throws NumberFormatException { ! int i = Integer.parseInt(str, radix); ! if (i < MIN_VALUE || i > MAX_VALUE) ! throw new NumberFormatException(); ! return (byte) i; } /** * Convert the specified String into a Byte. ! * The String may represent decimal, hexadecimal, or * octal numbers. * ! * The String argument is interpreted based on the leading ! * characters. Depending on what the String begins with, the base will be ! * interpreted differently: ! * ! * ! * ! * ! * ! * ! * ! * ! *
        Leading
        Characters
        Base
        #16
        0x16
        0X16
        08
        Anything
        Else
        10
        * ! * @param str the String to interpret. ! * @return the value of the String as a Byte. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a byte. */ ! public static Byte decode(String str) throws NumberFormatException { ! int i = (Integer.decode(str)).intValue(); ! if (i < MIN_VALUE || i > MAX_VALUE) throw new NumberFormatException(); return new Byte((byte) i); } ! ! /** Return the value of this Byte as an short. ! ** @return the value of this Byte as an short. ! **/ public byte byteValue() { return value; } ! /** Return the value of this Byte as an short. ! ** @return the value of this Byte as an short. ! **/ public short shortValue() { return value; } ! /** Return the value of this Byte as an int. ! ** @return the value of this Byte as an int. ! **/ public int intValue() { return value; } ! /** Return the value of this Byte as a long. ! ** @return the value of this Byte as a long. ! **/ public long longValue() { return value; } ! /** Return the value of this Byte as a float. ! ** @return the value of this Byte as a float. ! **/ public float floatValue() { return value; } ! /** Return the value of this Byte as a double. ! ** @return the value of this Byte as a double. ! **/ public double doubleValue() { return value; } ! /** ! * Compare two Bytes numerically by comparing their ! * byte values. ! * @return a positive value if this Byte is greater ! * in value than the argument Byte; a negative value ! * if this Byte is smaller in value than the argument ! * Byte; and 0, zero, if this ! * Byte is equal in value to the argument ! * Byte. */ public int compareTo(Byte b) { ! return (int)(value - b.byteValue()); } ! /** ! * Behaves like compareTo(java.lang.Byte) unless the Object ! * is not a Byte. Then it throws a ! * ClassCastException. ! * @exception ClassCastException if the argument is not a ! * Byte. */ public int compareTo(Object o) { ! return compareTo((Byte)o); } } --- 48,357 ---- * @author Paul Fisher * @author John Keiser * @author Per Bothner ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 */ ! public final class Byte extends Number implements Comparable { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -7183698231559129828L; /** ! * The minimum value a byte can represent is -128 (or ! * -27). */ public static final byte MIN_VALUE = -128; /** ! * The maximum value a byte can represent is 127 (or ! * 27 - 1). */ public static final byte MAX_VALUE = 127; /** ! * The primitive type byte is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('B'); /** * The immutable value of this Byte. + * + * @serial the wrapped byte */ private final byte value; /** ! * Create a Byte object representing the value of the * byte argument. * * @param value the value to use ! */ ! public Byte(byte value) { this.value = value; } /** ! * Create a Byte object representing the value specified ! * by the String argument * ! * @param s the string to convert ! * @throws NumberFormatException if the String does not contain a byte ! * @see #valueOf(String) */ ! public Byte(String s) { value = parseByte(s, 10); } /** ! * Converts the byte to a String and assumes ! * a radix of 10. * ! * @param b the byte to convert to String ! * @return the String representation of the argument */ ! public static String toString(byte b) { ! return String.valueOf(b); } /** ! * Converts the specified String into a byte. ! * This function assumes a radix of 10. ! * ! * @param s the String to convert ! * @return the byte value of s ! * @throws NumberFormatException if s cannot be parsed as a ! * byte ! * @see #parseByte(String) ! */ ! public static byte parseByte(String s) { ! return parseByte(s, 10); } /** ! * Converts the specified String into an int ! * using the specified radix (base). The string must not be null ! * or empty. It may begin with an optional '-', which will negate the answer, ! * provided that there are also valid digits. Each digit is parsed as if by ! * Character.digit(d, radix), and must be in the range ! * 0 to radix - 1. Finally, the result must be ! * within MIN_VALUE to MAX_VALUE, inclusive. ! * Unlike Double.parseDouble, you may not have a leading '+'. ! * ! * @param s the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to byte ! * @throws NumberFormatException if s cannot be parsed as a ! * byte */ ! public static byte parseByte(String s, int radix) { ! int i = Integer.parseInt(s, radix, false); ! if ((byte) i != i) ! throw new NumberFormatException(); ! return (byte) i; } /** * Creates a new Byte object using the String * and specified radix (base). * * @param s the String to convert ! * @param radix the radix (base) to convert with ! * @return the new Byte ! * @throws NumberFormatException if s cannot be parsed as a ! * byte ! * @see #parseByte(String, int) */ ! public static Byte valueOf(String s, int radix) { ! return new Byte(parseByte(s, radix)); } /** ! * Creates a new Byte object using the String, ! * assuming a radix of 10. * ! * @param s the String to convert ! * @return the new Byte ! * @throws NumberFormatException if s cannot be parsed as a ! * byte ! * @see #Byte(String) ! * @see #parseByte(String) */ ! public static Byte valueOf(String s) { ! return new Byte(parseByte(s, 10)); } /** * Convert the specified String into a Byte. ! * The String may represent decimal, hexadecimal, or * octal numbers. * ! *

        The extended BNF grammar is as follows:
        ! *

        !    * DecodableString:
        !    *      ( [ - ] DecimalNumber )
        !    *    | ( [ - ] ( 0x | 0X
        !    *              | # ) { HexDigit }+ )
        !    *    | ( [ - ] 0 { OctalDigit } )
        !    * DecimalNumber:
        !    *        DecimalDigit except '0' { DecimalDigit }
        !    * DecimalDigit:
        !    *        Character.digit(d, 10) has value 0 to 9
        !    * OctalDigit:
        !    *        Character.digit(d, 8) has value 0 to 7
        !    * DecimalDigit:
        !    *        Character.digit(d, 16) has value 0 to 15
        !    * 
        ! * Finally, the value must be in the range MIN_VALUE to ! * MAX_VALUE, or an exception is thrown. * ! * @param s the String to interpret ! * @return the value of the String as a Byte ! * @throws NumberFormatException if s cannot be parsed as a ! * byte ! * @throws NullPointerException if s is null ! * @see Integer#decode(String) */ ! public static Byte decode(String s) { ! int i = Integer.parseInt(s, 10, true); ! if ((byte) i != i) throw new NumberFormatException(); return new Byte((byte) i); } ! ! /** ! * Return the value of this Byte. ! * ! * @return the byte value ! */ public byte byteValue() { return value; } ! /** ! * Return the value of this Byte as a short. ! * ! * @return the short value ! */ public short shortValue() { return value; } ! /** ! * Return the value of this Byte as an int. ! * ! * @return the int value ! */ public int intValue() { return value; } ! /** ! * Return the value of this Byte as a long. ! * ! * @return the long value ! */ public long longValue() { return value; } ! /** ! * Return the value of this Byte as a float. ! * ! * @return the float value ! */ public float floatValue() { return value; } ! /** ! * Return the value of this Byte as a double. ! * ! * @return the double value ! */ public double doubleValue() { return value; } ! /** ! * Converts the Byte value to a String and ! * assumes a radix of 10. ! * ! * @return the String representation of this Byte ! * @see Integer#toString() ! */ ! public String toString() ! { ! return String.valueOf(value); ! } ! ! /** ! * Return a hashcode representing this Object. Byte's hash ! * code is simply its value. ! * ! * @return this Object's hash code ! */ ! public int hashCode() ! { ! return value; ! } ! ! /** ! * Returns true if obj is an instance of ! * Byte and represents the same byte value. ! * ! * @param obj the object to compare ! * @return whether these Objects are semantically equal ! */ ! public boolean equals(Object obj) ! { ! return obj instanceof Byte && value == ((Byte) obj).value; ! } ! ! /** ! * Compare two Bytes numerically by comparing their byte values. ! * The result is positive if the first is greater, negative if the second ! * is greater, and 0 if the two are equal. ! * ! * @param b the Byte to compare ! * @return the comparison ! * @since 1.2 */ public int compareTo(Byte b) { ! return value - b.value; } ! /** ! * Behaves like compareTo(Byte) unless the Object ! * is not a Byte. ! * ! * @param o the object to compare ! * @return the comparison ! * @throws ClassCastException if the argument is not a Byte ! * @see #compareTo(Byte) ! * @see Comparable ! * @since 1.2 */ public int compareTo(Object o) { ! return compareTo((Byte) o); } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Character.java gcc-3.3/libjava/java/lang/Character.java *** gcc-3.2.3/libjava/java/lang/Character.java 2002-07-12 21:13:22.000000000 +0000 --- gcc-3.3/libjava/java/lang/Character.java 2002-12-03 20:13:43.000000000 +0000 *************** public final class Character implements *** 2079,2086 **** */ public static char forDigit(int digit, int radix) { ! if (radix < MIN_RADIX || radix > MAX_RADIX || ! digit < 0 || digit >= radix) return '\0'; return (char) (digit < 10 ? ('0' + digit) : ('a' - 10 + digit)); } --- 2079,2086 ---- */ public static char forDigit(int digit, int radix) { ! if (radix < MIN_RADIX || radix > MAX_RADIX ! || digit < 0 || digit >= radix) return '\0'; return (char) (digit < 10 ? ('0' + digit) : ('a' - 10 + digit)); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/CharSequence.java gcc-3.3/libjava/java/lang/CharSequence.java *** gcc-3.2.3/libjava/java/lang/CharSequence.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/CharSequence.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.CharSequence -- Anything that has an indexed sequence of chars ! Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CharSequence.java -- Anything that has an indexed sequence of chars ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 44,51 **** * CharBuffer to give a uniform way to get chars at a certain * index, the number of characters in the sequence and a subrange of the * chars. Indexes start at 0 and the last index is length()-1. ! *

        ! * Even when classes implement this interface they are not always * exchangeble because they might implement their compare, equals or hash * function differently. This means that in general one should not use a * CharSequence as keys in collections since two sequences --- 44,51 ---- * CharBuffer to give a uniform way to get chars at a certain * index, the number of characters in the sequence and a subrange of the * chars. Indexes start at 0 and the last index is length()-1. ! * ! *

        Even when classes implement this interface they are not always * exchangeble because they might implement their compare, equals or hash * function differently. This means that in general one should not use a * CharSequence as keys in collections since two sequences *************** package java.lang; *** 54,91 **** * represented by different classes. * * @author Mark Wielaard (mark@klomp.org) - * * @since 1.4 */ ! public interface CharSequence { ! ! /** ! * Returns the character at the given index. ! * ! * @exception IndexOutOfBoundsException when i < 0 or ! * i > length()-1. ! */ ! char charAt(int i); ! ! /** ! * Returns the length of the sequence. ! */ ! int length(); ! /** ! * Returns a new CharSequence of the indicated range. ! * ! * @exception IndexOutOfBoundsException when begin < 0, ! * end < 0, end > length() or ! * begin > end ! */ ! CharSequence subSequence(int begin, int end); ! /** ! * Returns the complete CharSequence as a String. ! * Classes that implement this interface should return a String ! * which contains only the characters in the sequence in the correct order. ! */ ! String toString(); } --- 54,99 ---- * represented by different classes. * * @author Mark Wielaard (mark@klomp.org) * @since 1.4 + * @status updated to 1.4 */ + public interface CharSequence + { + /** + * Returns the character at the given index. + * + * @param i the index to retrieve from + * @return the character at that location + * @throws IndexOutOfBoundsException if i < 0 || i >= length() - 1 + */ + char charAt(int i); ! /** ! * Returns the length of the sequence. This is the number of 16-bit ! * characters in the sequence, which may differ from the length of the ! * underlying encoding. ! * ! * @return the sequence length ! */ ! int length(); ! /** ! * Returns a new CharSequence of the indicated range. ! * ! * @param begin the start index (inclusive) ! * @param end the end index (exclusive) ! * @return a subsequence of this ! * @throws IndexOutOfBoundsException if begin > end || begin < 0 || ! * end > length() ! */ ! CharSequence subSequence(int begin, int end); ! /** ! * Returns the complete CharSequence as a String. ! * Classes that implement this interface should return a String ! * which contains only the characters in the sequence in the correct order. ! * ! * @return the character sequence as a String ! */ ! String toString(); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ClassCastException.java gcc-3.3/libjava/java/lang/ClassCastException.java *** gcc-3.2.3/libjava/java/lang/ClassCastException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ClassCastException.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,6 **** ! /* ClassCastException.java -- exception thrown when incorrectly trying to ! cast an object to a subclass it does not belong to. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ClassCastException.java -- exception thrown on bad cast ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,83 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. In this case ! * when incorrectly trying to cast an object to a subclass it does not ! * belong to. The following code generates a ClassCastException. *

           * Object o = new Vector();
        !  * String s = (String)o;
           * 
        * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class ClassCastException extends RuntimeException { ! static final long serialVersionUID = -9223365651070458532L; /** * Create an exception without a message. */ public ClassCastException() ! { ! super(); ! } /** * Create an exception with a message. */ public ClassCastException(String s) ! { ! super(s); ! } } --- 38,76 ---- package java.lang; /** ! * Thrown when an attempt is made to cast an object which is not of the ! * appropriate runtime type. For example:
        *
           * Object o = new Vector();
        !  * String s = (String) o;
           * 
        * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class ClassCastException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -9223365651070458532L; /** * Create an exception without a message. */ public ClassCastException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public ClassCastException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ClassCircularityError.java gcc-3.3/libjava/java/lang/ClassCircularityError.java *** gcc-3.2.3/libjava/java/lang/ClassCircularityError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ClassCircularityError.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,5 **** ! /* ClassCircularityError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ClassCircularityError.java -- thrown when linking circular classes ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,76 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * A ClassCircularityError is thrown when a circular dependency ! * has been detected while initializing a class. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class ClassCircularityError extends LinkageError { ! static final long serialVersionUID = 1054362542914539689L; /** * Create an error without a message. */ public ClassCircularityError() ! { ! super(); ! } /** * Create an error with a message. */ public ClassCircularityError(String s) ! { ! super(s); ! } } --- 38,73 ---- package java.lang; /** * A ClassCircularityError is thrown when a circular dependency ! * has been detected while initializing a class. This signals binary ! * incompatible versions of class files, as the compiler normally catches this. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class ClassCircularityError extends LinkageError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 1054362542914539689L; /** * Create an error without a message. */ public ClassCircularityError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public ClassCircularityError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ClassFormatError.java gcc-3.3/libjava/java/lang/ClassFormatError.java *** gcc-3.2.3/libjava/java/lang/ClassFormatError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ClassFormatError.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,5 **** ! /* ClassFormatError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ClassFormatError.java -- thrown if a class file is invalid ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,75 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * A ClassFormatError is thrown when a Java Virtual Machine * unable to read a class file because the file is corrupted or cannot be * interpreted as a class file. * - * @since JDK 1.0 - * * @author Brian Jones */ public class ClassFormatError extends LinkageError { ! static final long serialVersionUID = -8420114879011949195L; /** * Create an error without a message. */ public ClassFormatError() ! { ! super(); ! } /** * Create an error with a message. */ public ClassFormatError(String s) ! { ! super(s); ! } } --- 38,72 ---- package java.lang; /** ! * A ClassFormatError is thrown when a Java Virtual Machine * unable to read a class file because the file is corrupted or cannot be * interpreted as a class file. * * @author Brian Jones + * @status updated to 1.4 */ public class ClassFormatError extends LinkageError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -8420114879011949195L; /** * Create an error without a message. */ public ClassFormatError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public ClassFormatError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Class.h gcc-3.3/libjava/java/lang/Class.h *** gcc-3.2.3/libjava/java/lang/Class.h 2001-12-21 19:47:50.000000000 +0000 --- gcc-3.3/libjava/java/lang/Class.h 2003-01-20 06:49:28.000000000 +0000 *************** *** 1,6 **** // Class.h - Header file for java.lang.Class. -*- c++ -*- ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // Class.h - Header file for java.lang.Class. -*- c++ -*- ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 19,24 **** --- 19,26 ---- #include #include #include + #include + #include // We declare these here to avoid including gcj/cni.h. extern "C" void _Jv_InitClass (jclass klass); *************** enum *** 45,53 **** JV_STATE_LINKED = 9, // Strings interned. JV_STATE_IN_PROGRESS = 10, // running. - JV_STATE_DONE = 12, // ! JV_STATE_ERROR = 14 // must be last. }; struct _Jv_Field; --- 47,56 ---- JV_STATE_LINKED = 9, // Strings interned. JV_STATE_IN_PROGRESS = 10, // running. ! JV_STATE_ERROR = 12, ! ! JV_STATE_DONE = 14 // Must be last. }; struct _Jv_Field; *************** public: *** 136,141 **** --- 139,151 ---- java::lang::ClassLoader *getClassLoader (void); + // This is an internal method that circumvents the usual security + // checks when getting the class loader. + java::lang::ClassLoader *getClassLoaderInternal (void) + { + return loader; + } + java::lang::reflect::Constructor *getConstructor (JArray *); JArray *getConstructors (void); java::lang::reflect::Constructor *getDeclaredConstructor (JArray *); *************** private: *** 159,164 **** --- 169,177 ---- java::lang::reflect::Method *getPrivateMethod (jstring, JArray *); java::security::ProtectionDomain *getProtectionDomain0 (); + java::lang::reflect::Method *_getMethod (jstring, JArray *); + java::lang::reflect::Method *_getDeclaredMethod (jstring, JArray *); + public: JArray *getFields (void); *************** public: *** 166,178 **** void getSignature (java::lang::StringBuffer *buffer); static jstring getSignature (JArray *, jboolean is_constructor); - java::lang::reflect::Method *getMethod (jstring, JArray *); JArray *getMethods (void); inline jint getModifiers (void) ! { ! return accflags; ! } jstring getName (void); --- 179,190 ---- void getSignature (java::lang::StringBuffer *buffer); static jstring getSignature (JArray *, jboolean is_constructor); JArray *getMethods (void); inline jint getModifiers (void) ! { ! return accflags & java::lang::reflect::Modifier::ALL_FLAGS; ! } jstring getName (void); *************** public: *** 209,215 **** --- 221,230 ---- } jobject newInstance (void); + java::security::ProtectionDomain *getProtectionDomain (void); + java::lang::Package *getPackage (void); jstring toString (void); + jboolean desiredAssertionStatus (void); // FIXME: this probably shouldn't be public. jint size (void) *************** private: *** 232,237 **** --- 247,254 ---- void initializeClass (void); + static jstring getPackagePortion (jstring); + // Friend functions implemented in natClass.cc. friend _Jv_Method *_Jv_GetMethodLocal (jclass klass, _Jv_Utf8Const *name, _Jv_Utf8Const *signature); *************** private: *** 287,292 **** --- 304,311 ---- java::lang::ClassLoader *loader); friend jclass _Jv_FindClassInCache (_Jv_Utf8Const *name, java::lang::ClassLoader *loader); + friend jclass _Jv_PopClass (void); + friend void _Jv_PushClass (jclass k); friend void _Jv_NewArrayClass (jclass element, java::lang::ClassLoader *loader, _Jv_VTable *array_vtable = 0); *************** private: *** 306,312 **** friend jshort _Jv_FindIIndex (jclass *, jshort *, jshort); friend void _Jv_LinkOffsetTable (jclass); friend void _Jv_LayoutVTableMethods (jclass klass); ! friend void _Jv_SetVTableEntries (jclass, _Jv_VTable *); friend void _Jv_MakeVTable (jclass); // Return array class corresponding to element type KLASS, creating it if --- 325,331 ---- friend jshort _Jv_FindIIndex (jclass *, jshort *, jshort); friend void _Jv_LinkOffsetTable (jclass); friend void _Jv_LayoutVTableMethods (jclass klass); ! friend void _Jv_SetVTableEntries (jclass, _Jv_VTable *, jboolean *); friend void _Jv_MakeVTable (jclass); // Return array class corresponding to element type KLASS, creating it if *************** private: *** 322,329 **** #ifdef INTERPRETER friend jboolean _Jv_IsInterpretedClass (jclass); friend void _Jv_InitField (jobject, jclass, _Jv_Field*); - friend int _Jv_DetermineVTableIndex (jclass, _Jv_Utf8Const *, - _Jv_Utf8Const*); friend void _Jv_InitField (jobject, jclass, int); friend _Jv_word _Jv_ResolvePoolEntry (jclass, int); friend _Jv_Method *_Jv_SearchMethodInClass (jclass cls, jclass klass, --- 341,346 ---- *************** private: *** 331,341 **** _Jv_Utf8Const *method_signature); friend void _Jv_PrepareClass (jclass); friend class _Jv_ClassReader; friend class _Jv_InterpClass; friend class _Jv_InterpMethod; - friend class _Jv_InterpMethodInvocation; #endif #ifdef JV_MARKOBJ_DECL --- 348,358 ---- _Jv_Utf8Const *method_signature); friend void _Jv_PrepareClass (jclass); + friend void _Jv_PrepareMissingMethods (jclass base, jclass iface_class); friend class _Jv_ClassReader; friend class _Jv_InterpClass; friend class _Jv_InterpMethod; #endif #ifdef JV_MARKOBJ_DECL *************** private: *** 343,348 **** --- 360,367 ---- #endif friend class _Jv_BytecodeVerifier; + friend class gnu::gcj::runtime::StackTrace; + friend class java::io::VMObjectStreamClass; // Chain for class pool. jclass next; *************** private: *** 397,402 **** --- 416,423 ---- jclass arrayclass; // Security Domain to which this class belongs (or null). java::security::ProtectionDomain *protectionDomain; + // Used by Jv_PopClass and _Jv_PushClass to communicate with StackTrace. + jclass chain; }; #endif /* __JAVA_LANG_CLASS_H__ */ diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Class.java gcc-3.3/libjava/java/lang/Class.java *** gcc-3.2.3/libjava/java/lang/Class.java 2001-04-25 15:45:12.000000000 +0000 --- gcc-3.3/libjava/java/lang/Class.java 2002-09-03 21:33:46.000000000 +0000 *************** *** 1,6 **** // Class.java - Representation of a Java class. ! /* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // Class.java - Representation of a Java class. ! /* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation This file is part of libgcj. *************** public final class Class implements Seri *** 65,73 **** public native Field getDeclaredField (String fieldName) throws NoSuchFieldException, SecurityException; public native Field[] getDeclaredFields () throws SecurityException; ! public native Method getDeclaredMethod (String methodName, ! Class[] parameterTypes) ! throws NoSuchMethodException, SecurityException; public native Method[] getDeclaredMethods () throws SecurityException; // This is marked as unimplemented in the JCL book. --- 65,95 ---- public native Field getDeclaredField (String fieldName) throws NoSuchFieldException, SecurityException; public native Field[] getDeclaredFields () throws SecurityException; ! ! private native Method _getDeclaredMethod (String methodName, ! Class[] parameterTypes); ! ! public Method getDeclaredMethod (String methodName, Class[] parameterTypes) ! throws NoSuchMethodException, SecurityException ! { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! { ! sm.checkMemberAccess(this, Member.DECLARED); ! Package p = getPackage(); ! if (p != null) ! sm.checkPackageAccess(p.getName()); ! } ! ! if ("".equals(methodName) || "".equals(methodName)) ! throw new NoSuchMethodException(methodName); ! ! Method m = _getDeclaredMethod(methodName, parameterTypes); ! if (m == null) ! throw new NoSuchMethodException (methodName); ! return m; ! } ! public native Method[] getDeclaredMethods () throws SecurityException; // This is marked as unimplemented in the JCL book. *************** public final class Class implements Seri *** 121,128 **** private static final native String getSignature (Class[] parameterTypes, boolean is_construtor); ! public native Method getMethod (String methodName, Class[] parameterTypes) ! throws NoSuchMethodException, SecurityException; private native int _getMethods (Method[] result, int offset); public native Method[] getMethods () throws SecurityException; --- 143,171 ---- private static final native String getSignature (Class[] parameterTypes, boolean is_construtor); ! public native Method _getMethod (String methodName, Class[] parameterTypes); ! ! public Method getMethod (String methodName, Class[] parameterTypes) ! throws NoSuchMethodException, SecurityException ! { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! { ! sm.checkMemberAccess(this, Member.PUBLIC); ! Package p = getPackage(); ! if (p != null) ! sm.checkPackageAccess(p.getName()); ! } ! ! if ("".equals(methodName) || "".equals(methodName)) ! throw new NoSuchMethodException(methodName); ! ! Method m = _getMethod(methodName, parameterTypes); ! if (m == null) ! throw new NoSuchMethodException (methodName); ! return m; ! } ! private native int _getMethods (Method[] result, int offset); public native Method[] getMethods () throws SecurityException; *************** public final class Class implements Seri *** 217,222 **** --- 260,334 ---- return (isInterface () ? "interface " : "class ") + getName (); } + /** + * Returns the desired assertion status of this class, if it were to be + * initialized at this moment. The class assertion status, if set, is + * returned; the backup is the default package status; then if there is + * a class loader, that default is returned; and finally the system default + * is returned. This method seldom needs calling in user code, but exists + * for compilers to implement the assert statement. Note that there is no + * guarantee that the result of this method matches the class's actual + * assertion status. + * + * @return the desired assertion status + * @see ClassLoader#setClassAssertionStatus(String, boolean) + * @see ClassLoader#setPackageAssertionStatus(String, boolean) + * @see ClassLoader#setDefaultAssertionStatus(boolean) + * @since 1.4 + */ + public boolean desiredAssertionStatus() + { + ClassLoader c = getClassLoader(); + Object status; + if (c == null) + return VMClassLoader.defaultAssertionStatus(); + if (c.classAssertionStatus != null) + synchronized (c) + { + status = c.classAssertionStatus.get(getName()); + if (status != null) + return status.equals(Boolean.TRUE); + } + else + { + status = ClassLoader.systemClassAssertionStatus.get(getName()); + if (status != null) + return status.equals(Boolean.TRUE); + } + if (c.packageAssertionStatus != null) + synchronized (c) + { + String name = getPackagePortion(getName()); + if ("".equals(name)) + status = c.packageAssertionStatus.get(null); + else + do + { + status = c.packageAssertionStatus.get(name); + name = getPackagePortion(name); + } + while (! "".equals(name) && status == null); + if (status != null) + return status.equals(Boolean.TRUE); + } + else + { + String name = getPackagePortion(getName()); + if ("".equals(name)) + status = ClassLoader.systemPackageAssertionStatus.get(null); + else + do + { + status = ClassLoader.systemPackageAssertionStatus.get(name); + name = getPackagePortion(name); + } + while (! "".equals(name) && status == null); + if (status != null) + return status.equals(Boolean.TRUE); + } + return c.defaultAssertionStatus; + } + // Don't allow new classes to be made. private Class () { *************** public final class Class implements Seri *** 235,238 **** --- 347,364 ---- // finalization protected native void finalize (); + + /** + * Strip the last portion of the name (after the last dot). + * + * @param name the name to get package of + * @return the package name, or "" if no package + */ + private static String getPackagePortion(String name) + { + int lastInd = name.lastIndexOf('.'); + if (lastInd == -1) + return ""; + return name.substring(0, lastInd); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ClassLoader.java gcc-3.3/libjava/java/lang/ClassLoader.java *** gcc-3.2.3/libjava/java/lang/ClassLoader.java 2001-12-07 23:34:12.000000000 +0000 --- gcc-3.3/libjava/java/lang/ClassLoader.java 2003-01-24 19:38:24.000000000 +0000 *************** *** 1,6 **** // ClassLoader.java - Define policies for loading Java classes. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // ClassLoader.java - Define policies for loading Java classes. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** package java.lang; *** 13,48 **** import java.io.InputStream; import java.io.IOException; import java.net.URL; - import java.net.URLConnection; import java.security.AllPermission; import java.security.CodeSource; import java.security.Permission; import java.security.Permissions; import java.security.Policy; import java.security.ProtectionDomain; ! import java.util.Enumeration; ! import java.util.HashMap; ! import java.util.Stack; /** ! * The class ClassLoader is intended to be subclassed by ! * applications in order to describe new ways of loading classes, ! * such as over the network. * ! * @author Kresten Krab Thorup */ - public abstract class ClassLoader { ! private ClassLoader parent; private HashMap definedPackages = new HashMap(); public final ClassLoader getParent () { ! /* FIXME: security */ return parent; } public static ClassLoader getSystemClassLoader () { return gnu.gcj.runtime.VMClassLoader.instance; --- 13,202 ---- import java.io.InputStream; import java.io.IOException; import java.net.URL; import java.security.AllPermission; import java.security.CodeSource; import java.security.Permission; import java.security.Permissions; import java.security.Policy; import java.security.ProtectionDomain; ! import java.util.*; /** ! * The ClassLoader is a way of customizing the way Java gets its classes ! * and loads them into memory. The verifier and other standard Java things ! * still run, but the ClassLoader is allowed great flexibility in determining ! * where to get the classfiles and when to load and resolve them. For that ! * matter, a custom ClassLoader can perform on-the-fly code generation or ! * modification! * ! *

        Every classloader has a parent classloader that is consulted before ! * the 'child' classloader when classes or resources should be loaded. ! * This is done to make sure that classes can be loaded from an hierarchy of ! * multiple classloaders and classloaders do not accidentially redefine ! * already loaded classes by classloaders higher in the hierarchy. ! * ! *

        The grandparent of all classloaders is the bootstrap classloader, which ! * loads all the standard system classes as implemented by GNU Classpath. The ! * other special classloader is the system classloader (also called ! * application classloader) that loads all classes from the CLASSPATH ! * (java.class.path system property). The system classloader ! * is responsible for finding the application classes from the classpath, ! * and delegates all requests for the standard library classes to its parent ! * the bootstrap classloader. Most programs will load all their classes ! * through the system classloaders. ! * ! *

        The bootstrap classloader in GNU Classpath is implemented as a couple of ! * static (native) methods on the package private class ! * java.lang.VMClassLoader, the system classloader is an ! * instance of gnu.java.lang.SystemClassLoader ! * (which is a subclass of java.net.URLClassLoader). ! * ! *

        Users of a ClassLoader will normally just use the methods ! *

          ! *
        • loadClass() to load a class.
        • ! *
        • getResource() or getResourceAsStream() ! * to access a resource.
        • ! *
        • getResources() to get an Enumeration of URLs to all ! * the resources provided by the classloader and its parents with the ! * same name.
        • ! *
        ! * ! *

        Subclasses should implement the methods ! *

          ! *
        • findClass() which is called by loadClass() ! * when the parent classloader cannot provide a named class.
        • ! *
        • findResource() which is called by ! * getResource() when the parent classloader cannot provide ! * a named resource.
        • ! *
        • findResources() which is called by ! * getResource() to combine all the resources with the ! * same name from the classloader and its parents.
        • ! *
        • findLibrary() which is called by ! * Runtime.loadLibrary() when a class defined by the ! * classloader wants to load a native library.
        • ! *
        ! * ! * @author John Keiser ! * @author Mark Wielaard ! * @author Eric Blake ! * @author Kresten Krab Thorup ! * @see Class ! * @since 1.0 ! * @status still missing 1.4 functionality */ public abstract class ClassLoader { ! /** ! * All classes loaded by this classloader. VM's may choose to implement ! * this cache natively; but it is here available for use if necessary. It ! * is not private in order to allow native code (and trusted subclasses) ! * access to this field. ! */ ! final Map loadedClasses = new HashMap(); ! ! /** ! * The desired assertion status of classes loaded by this loader, if not ! * overridden by package or class instructions. ! */ ! // Package visible for use by Class. ! boolean defaultAssertionStatus = VMClassLoader.defaultAssertionStatus(); ! ! /** ! * The command-line state of the package assertion status overrides. This ! * map is never modified, so it does not need to be synchronized. ! */ ! // Package visible for use by Class. ! static final Map systemPackageAssertionStatus ! = VMClassLoader.packageAssertionStatus(); ! ! /** ! * The map of package assertion status overrides, or null if no package ! * overrides have been specified yet. The values of the map should be ! * Boolean.TRUE or Boolean.FALSE, and the unnamed package is represented ! * by the null key. This map must be synchronized on this instance. ! */ ! // Package visible for use by Class. ! Map packageAssertionStatus; ! ! /** ! * The command-line state of the class assertion status overrides. This ! * map is never modified, so it does not need to be synchronized. ! */ ! // Package visible for use by Class. ! static final Map systemClassAssertionStatus ! = VMClassLoader.classAssertionStatus(); ! ! /** ! * The map of class assertion status overrides, or null if no class ! * overrides have been specified yet. The values of the map should be ! * Boolean.TRUE or Boolean.FALSE. This map must be synchronized on this ! * instance. ! */ ! // Package visible for use by Class. ! Map classAssertionStatus; ! ! /** ! * The classloader that is consulted before this classloader. ! * If null then the parent is the bootstrap classloader. ! */ ! private final ClassLoader parent; ! ! /** ! * All packages defined by this classloader. It is not private in order to ! * allow native code (and trusted subclasses) access to this field. ! */ private HashMap definedPackages = new HashMap(); + /** + * Returns the parent of this classloader. If the parent of this + * classloader is the bootstrap classloader then this method returns + * null. A security check may be performed on + * RuntimePermission("getClassLoader"). + * + * @throws SecurityException if the security check fails + * @since 1.2 + */ public final ClassLoader getParent () { ! // Check if we may return the parent classloader ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! { ! /* FIXME: security, getClassContext() not implemented. ! Class c = VMSecurityManager.getClassContext()[1]; ! ClassLoader cl = c.getClassLoader(); ! if (cl != null && cl != this) ! sm.checkPermission(new RuntimePermission("getClassLoader")); ! */ ! } return parent; } + /** + * Returns the system classloader. The system classloader (also called + * the application classloader) is the classloader that was used to + * load the application classes on the classpath (given by the system + * property java.class.path. This is set as the context + * class loader for a thread. The system property + * java.system.class.loader, if defined, is taken to be the + * name of the class to use as the system class loader, which must have + * a public constructor which takes a ClassLoader as a parent; otherwise this + * uses gnu.java.lang.SystemClassLoader. + * + *

        Note that this is different from the bootstrap classloader that + * actually loads all the real "system" classes (the bootstrap classloader + * is the parent of the returned system classloader). + * + *

        A security check will be performed for + * RuntimePermission("getClassLoader") if the calling class + * is not a parent of the system class loader. + * + * @return the system class loader + * @throws SecurityException if the security check fails + * @throws IllegalStateException if this is called recursively + * @throws Error if java.system.class.loader fails to load + * @since 1.2 + */ public static ClassLoader getSystemClassLoader () { return gnu.gcj.runtime.VMClassLoader.instance; *************** public abstract class ClassLoader *** 113,126 **** if (c == null) { ! try { ! if (parent != null) ! return parent.loadClass (name, link); ! else ! c = gnu.gcj.runtime.VMClassLoader.instance.findClass (name); ! } catch (ClassNotFoundException ex) { ! /* ignore, we'll try findClass */; ! } } if (c == null) --- 267,284 ---- if (c == null) { ! try ! { ! ClassLoader cl = parent; ! if (parent == null) ! cl = gnu.gcj.runtime.VMClassLoader.instance; ! if (cl != this) ! c = cl.loadClass (name, link); ! } ! catch (ClassNotFoundException ex) ! { ! /* ignore, we'll try findClass */; ! } } if (c == null) *************** public abstract class ClassLoader *** 135,148 **** return c; } ! /** Find a class. This should be overridden by subclasses; the ! * default implementation throws ClassNotFoundException. * ! * @param name Name of the class to find. ! * @return The class found. ! * @exception java.lang.ClassNotFoundException * @since 1.2 ! */ protected Class findClass (String name) throws ClassNotFoundException { --- 293,340 ---- return c; } ! /** ! * Called for every class name that is needed but has not yet been ! * defined by this classloader or one of its parents. It is called by ! * loadClass() after both findLoadedClass() and ! * parent.loadClass() couldn't provide the requested class. * ! *

        The default implementation throws a ! * ClassNotFoundException. Subclasses should override this ! * method. An implementation of this method in a subclass should get the ! * class bytes of the class (if it can find them), if the package of the ! * requested class doesn't exist it should define the package and finally ! * it should call define the actual class. It does not have to resolve the ! * class. It should look something like the following:
        ! * ! *

        !    * // Get the bytes that describe the requested class
        !    * byte[] classBytes = classLoaderSpecificWayToFindClassBytes(name);
        !    * // Get the package name
        !    * int lastDot = name.lastIndexOf('.');
        !    * if (lastDot != -1)
        !    *   {
        !    *     String packageName = name.substring(0, lastDot);
        !    *     // Look if the package already exists
        !    *     if (getPackage(pkg) == null)
        !    *       {
        !    *         // define the package
        !    *         definePackage(packageName, ...);
        !    *       }
        !    *   }
        !    * // Define and return the class
        !    *  return defineClass(name, classBytes, 0, classBytes.length);
        !    * 
        ! * ! *

        loadClass() makes sure that the Class ! * returned by findClass() will later be returned by ! * findLoadedClass() when the same class name is requested. ! * ! * @param name class name to find (including the package name) ! * @return the requested Class ! * @throws ClassNotFoundException when the class can not be found * @since 1.2 ! */ protected Class findClass (String name) throws ClassNotFoundException { *************** public abstract class ClassLoader *** 195,200 **** --- 387,411 ---- return defineClass (null, data, off, len, defaultProtectionDomain); } + /** + * Helper to define a class using a string of bytes without a + * ProtectionDomain. Subclasses should call this method from their + * findClass() implementation. The name should use '.' + * separators, and discard the trailing ".class". The default protection + * domain has the permissions of + * Policy.getPolicy().getPermissions(new CodeSource(null, null)). + * + * @param name the name to give the class, or null if unknown + * @param data the data representing the classfile, in classfile format + * @param offset the offset into the data where the classfile starts + * @param len the length of the classfile data in the array + * @return the class that was defined + * @throws ClassFormatError if data is not in proper classfile format + * @throws IndexOutOfBoundsException if offset or len is negative, or + * offset + len exceeds data + * @throws SecurityException if name starts with "java." + * @since 1.1 + */ protected final Class defineClass(String name, byte[] data, int off, int len) throws ClassFormatError { *************** public abstract class ClassLoader *** 239,273 **** + "are meaningless"); // as per 5.3.5.1 ! if (name != null && findLoadedClass (name) != null) throw new java.lang.LinkageError ("class " + name + " already loaded"); ! if (protectionDomain == null) protectionDomain = defaultProtectionDomain; ! try { ! // Since we're calling into native code here, ! // we better make sure that any generated ! // exception is to spec! ! ! return defineClass0 (name, data, off, len, protectionDomain); ! ! } catch (LinkageError x) { ! throw x; // rethrow ! ! } catch (java.lang.VirtualMachineError x) { ! throw x; // rethrow ! ! } catch (java.lang.Throwable x) { ! // This should never happen, or we are beyond spec. ! ! throw new InternalError ("Unexpected exception " ! + "while defining class " ! + name + ": " ! + x.toString ()); ! } } /** This is the entry point of defineClass into the native code */ --- 450,486 ---- + "are meaningless"); // as per 5.3.5.1 ! if (name != null && findLoadedClass (name) != null) throw new java.lang.LinkageError ("class " + name + " already loaded"); ! if (protectionDomain == null) protectionDomain = defaultProtectionDomain; ! try ! { ! Class retval = defineClass0 (name, data, off, len, protectionDomain); ! loadedClasses.put(retval.getName(), retval); ! return retval; ! } ! catch (LinkageError x) ! { ! throw x; // rethrow ! } ! catch (VirtualMachineError x) ! { ! throw x; // rethrow ! } ! catch (Throwable x) ! { ! // This should never happen, or we are beyond spec. ! InternalError r = new InternalError ("Unexpected exception " ! + "while defining class " ! + name); ! r.initCause(x); ! throw r; ! } } /** This is the entry point of defineClass into the native code */ *************** public abstract class ClassLoader *** 315,331 **** { synchronized (clazz) { ! try { ! linkClass0 (clazz); ! } catch (Throwable x) { ! markClassErrorState0 (clazz); ! if (x instanceof Error) ! throw (Error)x; ! else ! throw new java.lang.InternalError ! ("unexpected exception during linking: " + x); ! } } } --- 528,558 ---- { synchronized (clazz) { ! try ! { ! linkClass0 (clazz); ! } ! catch (Throwable x) ! { ! markClassErrorState0 (clazz); ! LinkageError e; ! if (x instanceof LinkageError) ! e = (LinkageError)x; ! else if (x instanceof ClassNotFoundException) ! { ! e = new NoClassDefFoundError("while resolving class: " ! + clazz.getName()); ! e.initCause (x); ! } ! else ! { ! e = new LinkageError ("unexpected exception during linking: " ! + clazz.getName()); ! e.initCause (x); ! } ! throw e; ! } } } *************** public abstract class ClassLoader *** 393,398 **** --- 620,627 ---- * null when the package is not defined by this classloader or one of its * parents. * + * @param name the package name to find + * @return the package, if defined * @since 1.2 */ protected Package getPackage(String name) *************** public abstract class ClassLoader *** 418,423 **** --- 647,653 ---- /** * Returns all Package objects defined by this classloader and its parents. * + * @return an array of all defined packages * @since 1.2 */ protected Package[] getPackages() *************** public abstract class ClassLoader *** 449,454 **** --- 679,704 ---- return allPackages; } + /** + * Called by Runtime.loadLibrary() to get an absolute path + * to a (system specific) library that was requested by a class loaded + * by this classloader. The default implementation returns + * null. It should be implemented by subclasses when they + * have a way to find the absolute path to a library. If this method + * returns null the library is searched for in the default locations + * (the directories listed in the java.library.path system + * property). + * + * @param name the (system specific) name of the requested library + * @return the full pathname to the requested library, or null + * @see Runtime#loadLibrary() + * @since 1.2 + */ + protected String findLibrary(String name) + { + return null; + } + /** * Returns a class found in a system-specific way, typically * via the java.class.path system property. Loads the *************** public abstract class ClassLoader *** 465,496 **** return gnu.gcj.runtime.VMClassLoader.instance.loadClass (name); } ! /* ! * Does currently nothing. FIXME. ! */ ! protected final void setSigners(Class claz, Object[] signers) { ! /* claz.setSigners (signers); */ } /** * If a class named name was previously loaded using * this ClassLoader, then it is returned. Otherwise ! * it returns null. (Unlike the JDK this is native, ! * since we implement the class table internally.) * @param name class to find. * @return the class loaded, or null. */ ! protected final native Class findLoadedClass(String name); public static InputStream getSystemResourceAsStream(String name) { return getSystemClassLoader().getResourceAsStream (name); } public static URL getSystemResource(String name) { return getSystemClassLoader().getResource (name); } /** * Return an InputStream representing the resource name. * This is essentially like * getResource(name).openStream(), except --- 715,786 ---- return gnu.gcj.runtime.VMClassLoader.instance.loadClass (name); } ! /** ! * Helper to set the signers of a class. This should be called after ! * defining the class. ! * ! * @param c the Class to set signers of ! * @param signers the signers to set ! * @since 1.1 ! */ ! protected final void setSigners(Class c, Object[] signers) ! { ! /* ! * Does currently nothing. FIXME. ! */ } /** * If a class named name was previously loaded using * this ClassLoader, then it is returned. Otherwise ! * it returns null. * @param name class to find. * @return the class loaded, or null. */ ! protected final synchronized Class findLoadedClass(String name) ! { ! return (Class) loadedClasses.get(name); ! } + /** + * Get a resource using the system classloader. + * + * @param name the name of the resource relative to the system classloader + * @return an input stream for the resource, or null + * @since 1.1 + */ public static InputStream getSystemResourceAsStream(String name) { return getSystemClassLoader().getResourceAsStream (name); } + /** + * Get the URL to a resource using the system classloader. + * + * @param name the name of the resource relative to the system classloader + * @return the URL to the resource + * @since 1.1 + */ public static URL getSystemResource(String name) { return getSystemClassLoader().getResource (name); } /** + * Get an Enumeration of URLs to resources with a given name using the + * the system classloader. The enumeration firsts lists the resources with + * the given name that can be found by the bootstrap classloader followed + * by the resources with the given name that can be found on the classpath. + * + * @param name the name of the resource relative to the system classloader + * @return an Enumeration of URLs to the resources + * @throws IOException if I/O errors occur in the process + * @since 1.2 + */ + public static Enumeration getSystemResources(String name) throws IOException + { + return getSystemClassLoader().getResources(name); + } + + /** * Return an InputStream representing the resource name. * This is essentially like * getResource(name).openStream(), except *************** public abstract class ClassLoader *** 502,514 **** */ public InputStream getResourceAsStream(String name) { ! try { ! URL res = getResource (name); ! if (res == null) return null; ! return res.openStream (); ! } catch (java.io.IOException x) { ! return null; ! } } /** --- 792,808 ---- */ public InputStream getResourceAsStream(String name) { ! try ! { ! URL res = getResource (name); ! if (res == null) ! return null; ! return res.openStream (); ! } ! catch (java.io.IOException x) ! { ! return null; ! } } /** *************** public abstract class ClassLoader *** 543,555 **** return findResource (name); } protected URL findResource (String name) { // Default to returning null. Derived classes implement this. return null; } ! public final Enumeration getResources (String name) throws IOException { // The rules say search the parent class if non-null, // otherwise search the built-in class loader (assumed to be --- 837,883 ---- return findResource (name); } + /** + * Called whenever a resource is needed that could not be provided by + * one of the parents of this classloader. It is called by + * getResource() after parent.getResource() + * couldn't provide the requested resource. + * + *

        The default implementation always returns null. Subclasses should + * override this method when they can provide a way to return a URL + * to a named resource. + * + * @param name the name of the resource to be found + * @return a URL to the named resource or null when not found + * @since 1.2 + */ protected URL findResource (String name) { // Default to returning null. Derived classes implement this. return null; } ! /** ! * Returns an Enumeration of all resources with a given name that can ! * be found by this classloader and its parents. Certain classloaders ! * (such as the URLClassLoader when given multiple jar files) can have ! * multiple resources with the same name that come from multiple locations. ! * It can also occur that a parent classloader offers a resource with a ! * certain name and the child classloader also offers a resource with that ! * same name. getResource() only offers the first resource (of the ! * parent) with a given name. This method lists all resources with the ! * same name. The name should use '/' as path separators. ! * ! *

        The Enumeration is created by first calling getResources() ! * on the parent classloader and then calling findResources() ! * on this classloader. ! * ! * @param name the resource name ! * @return an enumaration of all resources found ! * @throws IOException if I/O errors occur in the process ! * @since 1.2 ! */ ! public final Enumeration getResources(String name) throws IOException { // The rules say search the parent class if non-null, // otherwise search the built-in class loader (assumed to be *************** public abstract class ClassLoader *** 572,580 **** return findResources (name); } ! protected Enumeration findResources (String name) throws IOException { ! // Default to returning null. Derived classes implement this. ! return null; } } --- 900,998 ---- return findResources (name); } ! /** ! * Called whenever all locations of a named resource are needed. ! * It is called by getResources() after it has called ! * parent.getResources(). The results are combined by ! * the getResources() method. ! * ! *

        The default implementation always returns an empty Enumeration. ! * Subclasses should override it when they can provide an Enumeration of ! * URLs (possibly just one element) to the named resource. ! * The first URL of the Enumeration should be the same as the one ! * returned by findResource. ! * ! * @param name the name of the resource to be found ! * @return a possibly empty Enumeration of URLs to the named resource ! * @throws IOException if I/O errors occur in the process ! * @since 1.2 ! */ ! protected Enumeration findResources(String name) throws IOException { ! return Collections.enumeration(Collections.EMPTY_LIST); ! } ! ! /** ! * Set the default assertion status for classes loaded by this classloader, ! * used unless overridden by a package or class request. ! * ! * @param enabled true to set the default to enabled ! * @see #setClassAssertionStatus(String, boolean) ! * @see #setPackageAssertionStatus(String, boolean) ! * @see #clearAssertionStatus() ! * @since 1.4 ! */ ! public void setDefaultAssertionStatus(boolean enabled) ! { ! defaultAssertionStatus = enabled; ! } ! ! /** ! * Set the default assertion status for packages, used unless overridden ! * by a class request. This default also covers subpackages, unless they ! * are also specified. The unnamed package should use null for the name. ! * ! * @param name the package (and subpackages) to affect ! * @param enabled true to set the default to enabled ! * @see #setDefaultAssertionStatus(String, boolean) ! * @see #setClassAssertionStatus(String, boolean) ! * @see #clearAssertionStatus() ! * @since 1.4 ! */ ! public synchronized void setPackageAssertionStatus(String name, ! boolean enabled) ! { ! if (packageAssertionStatus == null) ! packageAssertionStatus ! = new HashMap(systemPackageAssertionStatus); ! packageAssertionStatus.put(name, Boolean.valueOf(enabled)); ! } ! ! /** ! * Set the default assertion status for a class. This only affects the ! * status of top-level classes, any other string is harmless. ! * ! * @param name the class to affect ! * @param enabled true to set the default to enabled ! * @throws NullPointerException if name is null ! * @see #setDefaultAssertionStatus(String, boolean) ! * @see #setPackageAssertionStatus(String, boolean) ! * @see #clearAssertionStatus() ! * @since 1.4 ! */ ! public synchronized void setClassAssertionStatus(String name, ! boolean enabled) ! { ! if (classAssertionStatus == null) ! classAssertionStatus = new HashMap(systemClassAssertionStatus); ! // The toString() hack catches null, as required. ! classAssertionStatus.put(name.toString(), Boolean.valueOf(enabled)); ! } ! ! /** ! * Resets the default assertion status of this classloader, its packages ! * and classes, all to false. This allows overriding defaults inherited ! * from the command line. ! * ! * @see #setDefaultAssertionStatus(boolean) ! * @see #setClassAssertionStatus(String, boolean) ! * @see #setPackageAssertionStatus(String, boolean) ! * @since 1.4 ! */ ! public synchronized void clearAssertionStatus() ! { ! defaultAssertionStatus = false; ! packageAssertionStatus = new HashMap(); ! classAssertionStatus = new HashMap(); } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ClassNotFoundException.java gcc-3.3/libjava/java/lang/ClassNotFoundException.java *** gcc-3.2.3/libjava/java/lang/ClassNotFoundException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ClassNotFoundException.java 2002-06-17 19:15:22.000000000 +0000 *************** *** 1,6 **** ! /* ClassNotFoundException.java -- exception thrown when attempting to load ! a class when no definition for the class can be found. ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ClassNotFoundException.java -- thrown when class definition cannot be found ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,175 **** package java.lang; - import java.io.ObjectOutputStream; - import java.io.ObjectInputStream; - import java.io.IOException; - import java.io.PrintStream; - import java.io.PrintWriter; - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. This ! * exception can by thrown by specific methods of ClassLoader ! * and Class when attempting to load a class when no definition ! * for the specified class can be found. * - * @since JDK 1.0 - * * @author Brian Jones */ public class ClassNotFoundException extends Exception { - static final long serialVersionUID = 9176873029745254542L; - - private Throwable ex = null; - /** ! * Create an exception without a message. ! */ ! public ClassNotFoundException() ! { ! super(); ! } ! ! /** ! * Create an exception with a message. */ ! public ClassNotFoundException(String s) ! { ! super(s); ! } /** ! * Create an exception with a message and include the exception ! * which occurred while loading the class. ! * ! * @param ex the exception which occurred while loading the class * ! * @since JDK 1.2 */ ! public ClassNotFoundException(String s, Throwable ex) ! { ! super(s); ! this.ex = ex; ! } /** ! * Returns the exception which occurred while loading the class, ! * otherwise returns null. ! * ! * @since JDK 1.2 */ ! public Throwable getException() ! { ! return ex; ! } /** ! * Print a stack trace of the exception that occurred. */ ! public void printStackTrace() ! { ! if (ex == null) ! { ! super.printStackTrace(); ! } ! else ! { ! ex.printStackTrace(); ! } ! } /** ! * Print a stack trace of the exception that occurred to ! * the specified PrintStream. */ ! public void printStackTrace(PrintStream ps) ! { ! if (ex == null) ! { ! super.printStackTrace(ps); ! } ! else ! { ! ex.printStackTrace(ps); ! } ! } /** ! * Print a stack trace of the exception that occurred to ! * the specified PrintWriter. */ ! public void printStackTrace(PrintWriter pw) ! { ! if (ex == null) ! { ! super.printStackTrace(pw); ! } ! else ! { ! ex.printStackTrace(pw); ! } ! } /** ! * Serialize the object in a manner binary compatible with the JDK 1.2 */ ! private void writeObject(java.io.ObjectOutputStream s) ! throws IOException ! { ! ObjectOutputStream.PutField oFields; ! oFields = s.putFields(); ! oFields.put("ex", this.ex); ! s.writeFields(); ! } ! ! /** ! * Deserialize the object in a manner binary compatible with the JDK 1.2 ! */ ! private void readObject(java.io.ObjectInputStream s) ! throws IOException, ClassNotFoundException ! { ! ObjectInputStream.GetField oFields; ! oFields = s.readFields(); ! ex = (Throwable)oFields.get("ex", (Throwable)null); ! } } --- 38,125 ---- package java.lang; /** ! * Thrown when a class is requested by reflection, but the class definition ! * cannot be found. This exception is often chained from another Throwable. * * @author Brian Jones + * @author Eric Blake + * @see Class#forName(String) + * @see ClassLoader#findSystemClass(String) + * @see ClassLoader#loadClass(String, boolean) + * @status updated to 1.4 */ public class ClassNotFoundException extends Exception { /** ! * Compatible with JDK 1.0+. */ ! private static final long serialVersionUID = 9176873029745254542L; /** ! * The cause of this exception (duplicates the one stored in Throwable). * ! * @serial the exception cause ! * @since 1.2 */ ! private final Throwable ex; /** ! * Create an exception without a message. Note that this initializes the ! * cause to null. */ ! public ClassNotFoundException() ! { ! this(null, null); ! } /** ! * Create an exception with a message. Note that this initializes the ! * cause to null. ! * ! * @param s the message */ ! public ClassNotFoundException(String s) ! { ! this(s, null); ! } /** ! * Create an exception with a message and chain it to the exception ! * which occurred while loading the class. ! * ! * @param s the message ! * @param ex the chained exception ! * @since 1.2 */ ! public ClassNotFoundException(String s, Throwable ex) ! { ! super(s, ex); ! this.ex = ex; ! } /** ! * Returns the exception which occurred while loading the class, ! * otherwise returns null. This is a legacy method; the preferred choice ! * now is {@link Throwable#getCause()}. ! * ! * @return the cause of this exception ! * @since 1.2 */ ! public Throwable getException() ! { ! return ex; ! } /** ! * Returns the exception which occurred while loading the class, ! * otherwise returns null. ! * ! * @return the cause of this exception ! * @since 1.4 */ ! public Throwable getCause() ! { ! return ex; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Cloneable.java gcc-3.3/libjava/java/lang/Cloneable.java *** gcc-3.2.3/libjava/java/lang/Cloneable.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Cloneable.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** /* Cloneable.java -- Interface for marking objects cloneable by Object.clone() ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Cloneable.java -- Interface for marking objects cloneable by Object.clone() ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,49 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * This interface should be implemented by classes wishing to * support of override Object.clone(). The default --- 38,43 ---- *************** package java.lang; *** 53,85 **** * If clone() is called on an object which does not * implement this interface, a CloneNotSupportedException * will be thrown. - *

        * ! * This interface is simply a tagging interface; it carries no * requirements on methods to implement. However, it is typical for * a Cloneable class to implement at least equals, * hashCode, and clone, sometimes * increasing the accessibility of clone to be public. The typical * implementation of clone invokes super.clone() * rather than a constructor, but this is not a requirement. - *

        * ! * If an object that implement Cloneable should not be cloned, * simply override the clone method to throw a * CloneNotSupportedException. - *

        * ! * All array types implement Cloneable, and have a public * clone method that will never fail with a * CloneNotSupportedException. * - * @since 1.0 * @author Paul Fisher * @author Eric Blake * @author Warren Levy - * * @see Object#clone() * @see CloneNotSupportedException */ public interface Cloneable { --- 47,76 ---- * If clone() is called on an object which does not * implement this interface, a CloneNotSupportedException * will be thrown. * ! *

        This interface is simply a tagging interface; it carries no * requirements on methods to implement. However, it is typical for * a Cloneable class to implement at least equals, * hashCode, and clone, sometimes * increasing the accessibility of clone to be public. The typical * implementation of clone invokes super.clone() * rather than a constructor, but this is not a requirement. * ! *

        If an object that implement Cloneable should not be cloned, * simply override the clone method to throw a * CloneNotSupportedException. * ! *

        All array types implement Cloneable, and have a public * clone method that will never fail with a * CloneNotSupportedException. * * @author Paul Fisher * @author Eric Blake * @author Warren Levy * @see Object#clone() * @see CloneNotSupportedException + * @since 1.0 + * @status updated to 1.4 */ public interface Cloneable { diff -Nrc3pad gcc-3.2.3/libjava/java/lang/CloneNotSupportedException.java gcc-3.3/libjava/java/lang/CloneNotSupportedException.java *** gcc-3.2.3/libjava/java/lang/CloneNotSupportedException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/CloneNotSupportedException.java 2002-06-15 19:45:30.000000000 +0000 *************** *** 1,7 **** ! /* CloneNotSupportedException.java -- exception thrown to indicate that ! the object calling the clone method of Object does not implement the ! Cloneable interface. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CloneNotSupportedException.java -- thrown when an object cannot be cloned ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 9,15 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 40,72 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * Thrown to indicate an object should not or could not be cloned. This * includes the case when {@link Object#clone()} is called on an object ! * which does not implement the {@link Cloneable} interface. ! *

        * ! * Notice that calling clone() on an array will never produce * this exception, as the VM will always succeed in copying the array, or ! * cause an OutOfMemoryError first. * * @author Brian Jones * @author Warren Levy * @author Eric Blake - * @since 1.0 * @see Cloneable * @see Object#clone() */ public class CloneNotSupportedException extends Exception { /** ! * compatible with JDK 1.0+ */ private static final long serialVersionUID = 5195511250079656443L; --- 38,75 ---- package java.lang; /** * Thrown to indicate an object should not or could not be cloned. This * includes the case when {@link Object#clone()} is called on an object ! * which does not implement the {@link Cloneable} interface. For example:
        ! *

        !  * void m() throws CloneNotSupportedException
        !  * {
        !  *   clone();
        !  * }
        !  * 
        * ! *

        Notice that calling clone() on an array will never produce * this exception, as the VM will always succeed in copying the array, or ! * cause an OutOfMemoryError first. For example:
        ! *

        !  * void m(int[] array)
        !  * {
        !  *   int[] copy = (int[]) array.clone();
        !  * }
        !  * 
        * * @author Brian Jones * @author Warren Levy * @author Eric Blake * @see Cloneable * @see Object#clone() + * @status updated to 1.4 */ public class CloneNotSupportedException extends Exception { /** ! * Compatible with JDK 1.0+. */ private static final long serialVersionUID = 5195511250079656443L; *************** public class CloneNotSupportedException *** 79,84 **** --- 82,88 ---- /** * Create an exception with a message. + * * @param s the error message */ public CloneNotSupportedException(String s) diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Comparable.java gcc-3.3/libjava/java/lang/Comparable.java *** gcc-3.2.3/libjava/java/lang/Comparable.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Comparable.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** /* Comparable.java -- Interface for comparaing objects to obtain an ordering ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Comparable.java -- Interface for comparaing objects to obtain an ordering ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,69 **** package java.lang; ! /* Written using online API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: Believed complete and correct. ! */ ! ! /** ! * Interface for objects that can be ordering among other ! * objects. The ordering can be total, such that two objects ! * only compare equal if they are equal by the equals method, or ! * partial such that this is not necessarily true. For ! * example, a case-sensitive dictionary order comparison of Strings ! * is total, but if it is case-insensitive it is partial, because ! * "abc" and "ABC" compare as equal even though "abc".equals("ABC") ! * returns false. * * @author Geoff Berry * @author Warren Levy ! * ! * @since JDK1.2 ! * @see java.util.Comparator */ public interface Comparable { /** ! * @return a negative integer if this object is less than ! * o, zero if this object is equal to o, or ! * a positive integer if this object is greater than o */ ! int compareTo( Object o ); } --- 38,97 ---- package java.lang; ! /** ! * Interface for objects that can be ordering among other objects. The ! * ordering can be total, such that two objects only compare equal ! * if they are also equal by the equals method, or partial such ! * that this is not necessarily true. For example, a case-sensitive ! * dictionary order comparison of Strings is total, but if it is ! * case-insensitive it is partial, because "abc" and "ABC" compare as ! * equal even though "abc".equals("ABC") returns false. However, if you use ! * a partial ordering, it is a good idea to document your class as ! * "inconsistent with equals", because the behavior of your class in a ! * SortedMap will be different than in a HashMap. ! * ! *

        Lists, arrays, and sets of objects that implement this interface can ! * be sorted automatically, without the need for an explicit ! * {@link Comparator}. Note that e1.compareTo(null) should ! * throw an Exception; as should comparison between incompatible classes. * * @author Geoff Berry * @author Warren Levy ! * @see Comparator ! * @see Collections#sort(List) ! * @see Arrays#sort(Object[]) ! * @see SortedSet ! * @see SortedMap ! * @see TreeSet ! * @see TreeMap ! * @since 1.2 ! * @status updated to 1.4 */ public interface Comparable { /** ! * Compares this object with another, and returns a numerical result based ! * on the comparison. If the result is negative, this object sorts less ! * than the other; if 0, the two are equal, and if positive, this object ! * sorts greater than the other. To translate this into boolean, simply ! * perform o1.compareTo(o2) <op> 0, where op ! * is one of <, <=, =, !=, >, or >=. ! * ! *

        You must make sure that the comparison is mutual, ie. ! * sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) (where sgn() is ! * defined as -1, 0, or 1 based on the sign). This includes throwing an ! * exception in either direction if the two are not comparable; hence, ! * compareTo(null) should always throw an Exception. ! * ! *

        You should also ensure transitivity, in two forms: ! * x.compareTo(y) > 0 && y.compareTo(z) > 0 implies ! * x.compareTo(z) > 0; and x.compareTo(y) == 0 ! * implies x.compareTo(z) == y.compareTo(z). ! * ! * @param o the object to be compared ! * @return an integer describing the comparison ! * @throws NullPointerException if o is null ! * @throws ClassCastException if o cannot be compared */ ! int compareTo(Object o); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Compiler.java gcc-3.3/libjava/java/lang/Compiler.java *** gcc-3.2.3/libjava/java/lang/Compiler.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Compiler.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* Compiler.java -- Interface for implementing a method to override ! Object.clone()comparaing objects to obtain an ordering ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Compiler.java -- placeholder for Java-to-native runtime compilers ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,122 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - */ - /** ! * The Compiler class is a place holder for a JIT ! * compiler implementation does nothing unless there is such a ! * compiler by default. ! *

        ! * The system property java.compiler may contain the name * of a library to load with System.loadLibrary when the ! * virtual machine first starts. If so and loading the library succeeds, ! * then a function by the name of java_lang_Compiler_start() * in that library is called. * ! * Note that a VM might not have implemented any of this. * * @author Tom Tromey ! * * @since JDK 1.0 ! * @see System#getProperty(java.lang.String) ! * @see System#getProperty(java.lang.String,java.lang.String) ! * @see System#loadLibrary(java.lang.String) */ ! public final class Compiler { ! /** ! * Don't allow new `Compiler's to be made. ! */ ! private Compiler () ! { ! } ! /** ! * Compile the class named by oneClass. ! * ! * @param oneClass the class to compile ! * @return false if no compiler is available or ! * compilation failed and true if compilation succeeded. ! */ ! public static boolean compileClass (Class oneClass) ! { ! // Never succeed. ! return false; ! } ! ! /** ! * Compile the classes whose name matches classNames/code>. ! * ! * @param classNames the name of classes to compile ! * @return false if no compiler is available or ! * compilation failed and true if compilation succeeded. ! */ ! public static boolean compileClasses (String classNames) ! { ! // Note the incredibly lame interface. Always fail. ! return false; ! } ! /** ! * This method examines the argument and performs an operation ! * according to the compilers documentation. No specific operation ! * is required. ! */ ! public static Object command (Object arg) ! { ! // Our implementation defines this to a no-op. ! return null; ! } ! /** ! * Calling Compiler.enable() will cause the compiler ! * to resume operation if it was previously disabled. ! */ ! public static void enable () { } ! /** ! * Calling Compiler.disable() will cause the compiler ! * to be suspended. ! */ ! public static void disable () { } } --- 38,128 ---- package java.lang; /** ! * The Compiler class is a placeholder for a JIT compiler ! * implementation, and does nothing unless there is such a compiler. ! * ! *

        The system property java.compiler may contain the name * of a library to load with System.loadLibrary when the ! * virtual machine first starts. If so, and loading the library succeeds, ! * then a function by the name of java_lang_Compiler_start() * in that library is called. * ! *

        Note that a VM might not have implemented any of this. * * @author Tom Tromey ! * @see System#getProperty(String) ! * @see System#getProperty(String, String) ! * @see System#loadLibrary(String) * @since JDK 1.0 ! * @status updated to 1.4 */ ! public final class Compiler { ! /** ! * Don't allow new `Compiler's to be made. ! */ ! private Compiler() ! { ! } ! /** ! * Compile the class named by oneClass. ! * ! * @param oneClass the class to compile ! * @return false if no compiler is available or ! * compilation failed, true if compilation succeeded ! * @throws NullPointerException if oneClass is null ! */ ! public static boolean compileClass(Class oneClass) ! { ! // Never succeed. ! return false; ! } ! /** ! * Compile the classes whose name matches classNames/code>. ! * ! * @param classNames the name of classes to compile ! * @return false if no compiler is available or ! * compilation failed, true if compilation succeeded ! * @throws NullPointerException if classNames is null ! */ ! public static boolean compileClasses(String classNames) ! { ! // Note the incredibly lame interface. Always fail. ! return false; ! } ! /** ! * This method examines the argument and performs an operation ! * according to the compilers documentation. No specific operation ! * is required. ! * ! * @param arg a compiler-specific argument ! * @return a compiler-specific value, including null ! * @throws NullPointerException if the compiler doesn't like a null arg ! */ ! public static Object command(Object arg) ! { ! // Our implementation defines this to a no-op. ! return null; ! } ! /** ! * Calling Compiler.enable() will cause the compiler ! * to resume operation if it was previously disabled; provided that a ! * compiler even exists. ! */ ! public static void enable() ! { ! } ! ! /** ! * Calling Compiler.disable() will cause the compiler ! * to be suspended; provided that a compiler even exists. ! */ ! public static void disable() ! { ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Double.java gcc-3.3/libjava/java/lang/Double.java *** gcc-3.2.3/libjava/java/lang/Double.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Double.java 2002-11-03 20:27:30.000000000 +0000 *************** *** 1,4 **** ! /* Double.java -- object wrapper for double primitive Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,4 ---- ! /* Double.java -- object wrapper for double Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 40,51 **** import gnu.classpath.Configuration; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * Instances of class Double represent primitive * double values. --- 40,45 ---- *************** import gnu.classpath.Configuration; *** 55,69 **** * * @author Paul Fisher * @author Andrew Haley ! * @since JDK 1.0 */ public final class Double extends Number implements Comparable { /** ! * The minimum positive value a double may represent ! * is 5e-324. */ ! public static final double MIN_VALUE = 5e-324; /** * The maximum positive value a double may represent --- 49,64 ---- * * @author Paul Fisher * @author Andrew Haley ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ public final class Double extends Number implements Comparable { /** ! * Compatible with JDK 1.0+. */ ! private static final long serialVersionUID = -9172774392245257468L; /** * The maximum positive value a double may represent *************** public final class Double extends Number *** 72,114 **** public static final double MAX_VALUE = 1.7976931348623157e+308; /** * The value of a double representation -1.0/0.0, negative ! * infinity. */ ! public static final double NEGATIVE_INFINITY = -1.0d/0.0d; /** * The value of a double representing 1.0/0.0, positive infinity. */ ! public static final double POSITIVE_INFINITY = 1.0d/0.0d; /** * All IEEE 754 values of NaN have the same value in Java. */ ! public static final double NaN = 0.0d/0.0d; /** * The primitive type double is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('D'); /** * The immutable value of this Double. */ private final double value; - private static final long serialVersionUID = -9172774392245257468L; - /** ! * Load native routines necessary for this class. */ static { if (Configuration.INIT_LOAD_LIBRARY) { ! System.loadLibrary ("javalang"); ! initIDs (); } } --- 67,116 ---- public static final double MAX_VALUE = 1.7976931348623157e+308; /** + * The minimum positive value a double may represent + * is 5e-324. + */ + public static final double MIN_VALUE = 5e-324; + + /** * The value of a double representation -1.0/0.0, negative ! * infinity. */ ! public static final double NEGATIVE_INFINITY = -1.0 / 0.0; /** * The value of a double representing 1.0/0.0, positive infinity. */ ! public static final double POSITIVE_INFINITY = 1.0 / 0.0; /** * All IEEE 754 values of NaN have the same value in Java. */ ! public static final double NaN = 0.0 / 0.0; /** * The primitive type double is represented by this * Class object. + * @since 1.1 */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('D'); /** * The immutable value of this Double. + * + * @serial the wrapped double */ private final double value; /** ! * Load native routines necessary for this class. */ static { if (Configuration.INIT_LOAD_LIBRARY) { ! System.loadLibrary("javalang"); ! initIDs(); } } *************** public final class Double extends Number *** 118,528 **** * * @param value the double argument */ ! public Double (double value) { this.value = value; } /** ! * Create a Double from the specified ! * String. ! * * This method calls Double.parseDouble(). * - * @exception NumberFormatException when the String cannot - * be parsed into a Float. * @param s the String to convert ! * @see #parseDouble(java.lang.String) */ ! public Double (String s) throws NumberFormatException { ! value = parseDouble (s); } /** ! * Convert the double value of this Double ! * to a String. This method calls ! * Double.toString(double) to do its dirty work. * ! * @return the String representation of this Double. ! * @see #toString(double) */ ! public String toString () { ! return toString (value); } /** ! * If the Object is not null, is an ! * instanceof Double, and represents ! * the same primitive double value return ! * true. Otherwise false is returned. ! *

        ! * Note that there are two differences between == and ! * equals(). 0.0d == -0.0d returns true ! * but new Double(0.0d).equals(new Double(-0.0d)) returns ! * false. And Double.NaN == Double.NaN returns ! * false, but ! * new Double(Double.NaN).equals(new Double(Double.NaN)) returns ! * true. * ! * @param obj the object to compare to ! * @return whether the objects are semantically equal. */ ! public boolean equals (Object obj) { ! if (!(obj instanceof Double)) ! return false; ! ! double d = ((Double) obj).value; ! ! // GCJ LOCAL: this implementation is probably faster than ! // Classpath's, especially once we inline doubleToLongBits. ! return doubleToLongBits (value) == doubleToLongBits (d); ! // END GCJ LOCAL } /** ! * The hashcode is the value of the expression:
        ! *
        ! * (int)(v^(v>>>32))
        ! *
        ! * where v is defined by:
        ! * long v = Double.doubleToLongBits(this.longValue());
        */ ! public int hashCode () ! { ! long v = doubleToLongBits (value); ! return (int) (v ^ (v >>> 32)); ! } /** ! * Return the value of this Double when cast to an ! * int. */ ! public int intValue () { ! return (int) value; } /** ! * Return the value of this Double when cast to a ! * long. */ ! public long longValue () { ! return (long) value; } /** ! * Return the value of this Double when cast to a ! * float. */ ! public float floatValue () { ! return (float) value; } /** ! * Return the primitive double value represented by this ! * Double. */ ! public double doubleValue () { ! return value; } /** ! * Return the result of calling new Double(java.lang.String). ! * ! * @param s the String to convert to a Double. ! * @return a new Double representing the String's ! * numeric value. * ! * @exception NullPointerException thrown if String is ! * null. ! * @exception NumberFormatException thrown if String cannot ! * be parsed as a double. ! * @see #Double(java.lang.String) ! * @see #parseDouble(java.lang.String) */ ! public static Double valueOf (String s) throws NumberFormatException { ! return new Double (s); } /** ! * Return true if the value of this Double ! * is the same as NaN, otherwise return false. ! * @return whether this Double is NaN. */ ! public boolean isNaN () { ! return isNaN (value); } /** ! * Return true if the double has the same ! * value as NaN, otherwise return false. * ! * @param v the double to compare ! * @return whether the argument is NaN. */ ! public static boolean isNaN (double v) { ! // This works since NaN != NaN is the only reflexive inequality ! // comparison which returns true. ! return v != v; } /** ! * Return true if the value of this Double ! * is the same as NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. * ! * @return whether this Double is (-/+) infinity. */ ! public boolean isInfinite () { ! return isInfinite (value); } /** ! * Return true if the double has a value ! * equal to either NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. * ! * @param v the double to compare ! * @return whether the argument is (-/+) infinity. */ ! public static boolean isInfinite (double v) { ! return (v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY); } /** ! * Returns 0 if the double value of the argument is ! * equal to the value of this Double. Returns a number ! * less than zero if the value of this Double is less ! * than the double value of the argument, and returns a ! * number greater than zero if the value of this Double ! * is greater than the double value of the argument. ! *
        ! * Double.NaN is greater than any number other than itself, ! * even Double.POSITIVE_INFINITY. ! *
        ! * 0.0d is greater than -0.0d. * ! * @param d the Double to compare to. ! * @return 0 if the Doubles are the same, < 0 if this ! * Double is less than the Double in ! * in question, or > 0 if it is greater. ! * @since 1.2 */ ! public int compareTo (Double d) { ! return compare (value, d.value); } /** ! * Returns 0 if the first argument is equal to the second argument. ! * Returns a number less than zero if the first argument is less than the ! * second argument, and returns a number greater than zero if the first ! * argument is greater than the second argument. ! *
        ! * Double.NaN is greater than any number other than itself, ! * even Double.POSITIVE_INFINITY. ! *
        ! * 0.0d is greater than -0.0d. * ! * @param x the first double to compare. ! * @param y the second double to compare. ! * @return 0 if the arguments are the same, < 0 if the ! * first argument is less than the second argument in ! * in question, or > 0 if it is greater. ! * @since 1.4 */ ! public static int compare (double x, double y) { ! if (isNaN (x)) ! return isNaN (y) ? 0 : 1; ! if (isNaN (y)) ! return -1; ! // recall that 0.0 == -0.0, so we convert to infinites and try again ! if (x == 0 && y == 0) ! return (int) (1 / x - 1 / y); ! if (x == y) ! return 0; ! ! return x > y ? 1 : -1; } /** ! * Compares the specified Object to this Double ! * if and only if the Object is an instanceof ! * Double. * ! * @param o the Object to compare to. ! * @return 0 if the Doubles are the same, < 0 if this ! * Double is less than the Double in ! * in question, or > 0 if it is greater. ! * @throws ClassCastException if the argument is not a Double */ ! public int compareTo (Object o) { ! return compareTo ((Double) o); } /** ! * Convert the double to a String. ! *

        ! * ! * Floating-point string representation is fairly complex: here is a ! * rundown of the possible values. "[-]" indicates that a ! * negative sign will be printed if the value (or exponent) is negative. ! * "<number>" means a string of digits (0-9). ! * "<digit>" means a single digit (0-9). ! *

        ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *
        Value of FloatString Representation
        [+-] 0[-]0.0
        Between [+-] 10-3 and 107[-]number.number
        Other numeric value[-]<digit>.<number>E[-]<number>
        [+-] infinity[-]Infinity
        NaNNaN
        ! * ! * Yes, negative zero is a possible value. Note that there is ! * always a . and at least one digit printed after ! * it: even if the number is 3, it will be printed as 3.0. ! * After the ".", all digits will be printed except trailing zeros. No ! * truncation or rounding is done by this function. ! * * ! * @XXX specify where we are not in accord with the spec. * ! * @param d the double to convert ! * @return the String representing the double. */ ! public static String toString (double d) { ! return toString (d, false); ! } ! static native String toString (double d, boolean isFloat); /** ! * Return the long bits of the specified double. ! * The result of this function can be used as the argument to ! * Double.longBitsToDouble(long) to obtain the ! * original double value. * * @param value the double to convert ! * @return the bits of the double. */ ! public static native long doubleToLongBits (double value); /** ! * Return the long bits of the specified double. ! * The result of this function can be used as the argument to ! * Double.longBitsToDouble(long) to obtain the ! * original double value. This method differs from ! * doubleToLongBits in that it does not collapse ! * NaN values. * * @param value the double to convert ! * @return the bits of the double. */ ! public static native long doubleToRawLongBits (double value); /** ! * Return the double represented by the long ! * bits specified. * ! * @param bits the long bits representing a double ! * @return the double represented by the bits. */ ! public static native double longBitsToDouble (long bits); /** ! * Parse the specified String as a double. ! * ! * The number is really read as n * 10exponent. The ! * first number is n, and if there is an "E" ! * ("e" is also acceptable), then the integer after that is ! * the exponent. ! *

        ! * Here are the possible forms the number can take: ! *
        ! * ! * ! * ! * ! * ! * ! *
        FormExamples
        [+-]<number>[.]345., -10, 12
        [+-]<number>.<number>40.2, 80.00, -12.30
        [+-]<number>[.]E[+-]<number>80E12, -12e+7, 4.E-123
        [+-]<number>.<number>E[+-]<number>6.02e-22, -40.2E+6, 12.3e9
        * ! * "[+-]" means either a plus or minus sign may go there, or ! * neither, in which case + is assumed. ! *
        ! * "[.]" means a dot may be placed here, but is optional. ! *
        ! * "<number>" means a string of digits (0-9), basically ! * an integer. "<number>.<number>" is basically ! * a real number, a floating-point value. ! *

        * ! * Remember that a double has a limited range. If the ! * number you specify is greater than Double.MAX_VALUE or less ! * than -Double.MAX_VALUE, it will be set at ! * Double.POSITIVE_INFINITY or ! * Double.NEGATIVE_INFINITY, respectively. ! *

        ! * Note also that double does not have perfect precision. Many ! * numbers cannot be precisely represented. The number you specify ! * will be rounded to the nearest representable value. ! * Double.MIN_VALUE is the margin of error for ! * double values. ! *

        ! * If an unexpected character is found in the String, a ! * NumberFormatException will be thrown. Spaces are not ! * allowed, and will cause the same exception. * ! * @XXX specify where/how we are not in accord with the spec. * ! * @param str the String to convert ! * @return the value of the String as a double. ! * @exception NumberFormatException when the string cannot be parsed to a ! * double. ! * @exception NullPointerException when the string is null. ! * @see #MIN_VALUE ! * @see #MAX_VALUE ! * @see #POSITIVE_INFINITY ! * @see #NEGATIVE_INFINITY ! * @since 1.2 */ ! public static native double parseDouble (String s) ! throws NumberFormatException; /** ! * Initialize JNI cache. This method is called only by the * static initializer when using JNI. */ ! private static native void initIDs (); } --- 120,537 ---- * * @param value the double argument */ ! public Double(double value) { this.value = value; } /** ! * Create a Double from the specified String. * This method calls Double.parseDouble(). * * @param s the String to convert ! * @throws NumberFormatException if s cannot be parsed as a ! * double ! * @throws NullPointerException if s is null ! * @see #parseDouble(String) */ ! public Double(String s) { ! value = parseDouble(s); } /** ! * Convert the double to a String. ! * Floating-point string representation is fairly complex: here is a ! * rundown of the possible values. "[-]" indicates that a ! * negative sign will be printed if the value (or exponent) is negative. ! * "<number>" means a string of digits ('0' to '9'). ! * "<digit>" means a single digit ('0' to '9').
        * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *
        Value of DoubleString Representation
        [+-] 0 [-]0.0
        Between [+-] 10-3 and 107, exclusive[-]number.number
        Other numeric value[-]<digit>.<number> ! * E[-]<number>
        [+-] infinity [-]Infinity
        NaN NaN
        ! * ! * Yes, negative zero is a possible value. Note that there is ! * always a . and at least one digit printed after ! * it: even if the number is 3, it will be printed as 3.0. ! * After the ".", all digits will be printed except trailing zeros. The ! * result is rounded to the shortest decimal number which will parse back ! * to the same double. ! * ! *

        To create other output formats, use {@link java.text.NumberFormat}. ! * ! * @XXX specify where we are not in accord with the spec. ! * ! * @param d the double to convert ! * @return the String representing the double */ ! public static String toString(double d) { ! return toString(d, false); } /** ! * Create a new Double object using the String. * ! * @param s the String to convert ! * @return the new Double ! * @throws NumberFormatException if s cannot be parsed as a ! * double ! * @throws NullPointerException if s is null. ! * @see #parseDouble(String) */ ! public static Double valueOf(String s) { ! return new Double(parseDouble(s)); } /** ! * Parse the specified String as a double. The ! * extended BNF grammar is as follows:
        ! *

        !    * DecodableString:
        !    *      ( [ - | + ] NaN )
        !    *    | ( [ - | + ] Infinity )
        !    *    | ( [ - | + ] FloatingPoint
        !    *              [ f | F | d
        !    *                | D] )
        !    * FloatingPoint:
        !    *      ( { Digit }+ [ . { Digit } ]
        !    *              [ Exponent ] )
        !    *    | ( . { Digit }+ [ Exponent ] )
        !    * Exponent:
        !    *      ( ( e | E )
        !    *              [ - | + ] { Digit }+ )
        !    * Digit: '0' through '9'
        !    * 
        ! * ! *

        NaN and infinity are special cases, to allow parsing of the output ! * of toString. Otherwise, the result is determined by calculating ! * n * 10exponent to infinite precision, then rounding ! * to the nearest double. Remember that many numbers cannot be precisely ! * represented in floating point. In case of overflow, infinity is used, ! * and in case of underflow, signed zero is used. Unlike Integer.parseInt, ! * this does not accept Unicode digits outside the ASCII range. ! * ! *

        If an unexpected character is found in the String, a ! * NumberFormatException will be thrown. Leading and trailing ! * 'whitespace' is ignored via String.trim(), but spaces ! * internal to the actual number are not allowed. ! * ! *

        To parse numbers according to another format, consider using ! * {@link java.text.NumberFormat}. ! * ! * @XXX specify where/how we are not in accord with the spec. ! * ! * @param str the String to convert ! * @return the double value of s ! * @throws NumberFormatException if s cannot be parsed as a ! * double ! * @throws NullPointerException if s is null ! * @see #MIN_VALUE ! * @see #MAX_VALUE ! * @see #POSITIVE_INFINITY ! * @see #NEGATIVE_INFINITY ! * @since 1.2 */ ! public static native double parseDouble(String s); /** ! * Return true if the double has the same ! * value as NaN, otherwise return false. ! * ! * @param v the double to compare ! * @return whether the argument is NaN. */ ! public static boolean isNaN(double v) { ! // This works since NaN != NaN is the only reflexive inequality ! // comparison which returns true. ! return v != v; } /** ! * Return true if the double has a value ! * equal to either NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. ! * ! * @param v the double to compare ! * @return whether the argument is (-/+) infinity. */ ! public static boolean isInfinite(double v) { ! return v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY; } /** ! * Return true if the value of this Double ! * is the same as NaN, otherwise return false. ! * ! * @return whether this Double is NaN */ ! public boolean isNaN() { ! return isNaN(value); } /** ! * Return true if the value of this Double ! * is the same as NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. ! * ! * @return whether this Double is (-/+) infinity */ ! public boolean isInfinite() { ! return isInfinite(value); } /** ! * Convert the double value of this Double ! * to a String. This method calls ! * Double.toString(double) to do its dirty work. * ! * @return the String representation ! * @see #toString(double) */ ! public String toString() { ! return toString(value); } /** ! * Return the value of this Double as a byte. ! * ! * @return the byte value ! * @since 1.1 */ ! public byte byteValue() { ! return (byte) value; } /** ! * Return the value of this Double as a short. * ! * @return the short value ! * @since 1.1 */ ! public short shortValue() { ! return (short) value; } /** ! * Return the value of this Double as an int. * ! * @return the int value */ ! public int intValue() { ! return (int) value; } /** ! * Return the value of this Double as a long. * ! * @return the long value */ ! public long longValue() { ! return (long) value; } /** ! * Return the value of this Double as a float. * ! * @return the float value */ ! public float floatValue() { ! return (float) value; } /** ! * Return the value of this Double. * ! * @return the double value */ ! public double doubleValue() { ! return value; } /** ! * Return a hashcode representing this Object. Double's hash ! * code is calculated by:
        ! * long v = Double.doubleToLongBits(doubleValue());
        ! * int hash = (int)(v^(v>>32))
        . * ! * @return this Object's hash code ! * @see #doubleToLongBits(double) */ ! public int hashCode() { ! long v = doubleToLongBits(value); ! return (int) (v ^ (v >>> 32)); } /** ! * Returns true if obj is an instance of ! * Double and represents the same double value. Unlike comparing ! * two doubles with ==, this treats two instances of ! * Double.NaN as equal, but treats 0.0 and ! * -0.0 as unequal. * ! *

        Note that d1.equals(d2) is identical to ! * doubleToLongBits(d1.doubleValue()) == ! * doubleToLongBits(d2.doubleValue()). * ! * @param obj the object to compare ! * @return whether the objects are semantically equal */ ! public boolean equals(Object obj) { ! if (! (obj instanceof Double)) ! return false; ! double d = ((Double) obj).value; ! ! // Avoid call to native method. However, some implementations, like gcj, ! // are better off using floatToIntBits(value) == floatToIntBits(f). ! // Check common case first, then check NaN and 0. ! if (value == d) ! return (value != 0) || (1 / value == 1 / d); ! return isNaN(value) && isNaN(d); ! } /** ! * Convert the double to the IEEE 754 floating-point "double format" bit ! * layout. Bit 63 (the most significant) is the sign bit, bits 62-52 ! * (masked by 0x7ff0000000000000L) represent the exponent, and bits 51-0 ! * (masked by 0x000fffffffffffffL) are the mantissa. This function ! * collapses all versions of NaN to 0x7ff8000000000000L. The result of this ! * function can be used as the argument to ! * Double.longBitsToDouble(long) to obtain the original ! * double value. * * @param value the double to convert ! * @return the bits of the double ! * @see #longBitsToDouble(long) */ ! public static native long doubleToLongBits(double value); /** ! * Convert the double to the IEEE 754 floating-point "double format" bit ! * layout. Bit 63 (the most significant) is the sign bit, bits 62-52 ! * (masked by 0x7ff0000000000000L) represent the exponent, and bits 51-0 ! * (masked by 0x000fffffffffffffL) are the mantissa. This function ! * leaves NaN alone, rather than collapsing to a canonical value. The ! * result of this function can be used as the argument to ! * Double.longBitsToDouble(long) to obtain the original ! * double value. * * @param value the double to convert ! * @return the bits of the double ! * @see #longBitsToDouble(long) */ ! public static native long doubleToRawLongBits(double value); /** ! * Convert the argument in IEEE 754 floating-point "double format" bit ! * layout to the corresponding float. Bit 63 (the most significant) is the ! * sign bit, bits 62-52 (masked by 0x7ff0000000000000L) represent the ! * exponent, and bits 51-0 (masked by 0x000fffffffffffffL) are the mantissa. ! * This function leaves NaN alone, so that you can recover the bit pattern ! * with Double.doubleToRawLongBits(double). * ! * @param bits the bits to convert ! * @return the double represented by the bits ! * @see #doubleToLongBits(double) ! * @see #doubleToRawLongBits(double) */ ! public static native double longBitsToDouble(long bits); /** ! * Compare two Doubles numerically by comparing their double ! * values. The result is positive if the first is greater, negative if the ! * second is greater, and 0 if the two are equal. However, this special ! * cases NaN and signed zero as follows: NaN is considered greater than ! * all other doubles, including POSITIVE_INFINITY, and positive ! * zero is considered greater than negative zero. * ! * @param d the Double to compare ! * @return the comparison ! * @since 1.2 ! */ ! public int compareTo(Double d) ! { ! return compare(value, d.value); ! } ! ! /** ! * Behaves like compareTo(Double) unless the Object ! * is not an Double. * ! * @param o the object to compare ! * @return the comparison ! * @throws ClassCastException if the argument is not a Double ! * @see #compareTo(Double) ! * @see Comparable ! * @since 1.2 ! */ ! public int compareTo(Object o) ! { ! return compare(value, ((Double) o).value); ! } ! ! /** ! * Behaves like new Double(x).compareTo(new Double(y)); in ! * other words this compares two doubles, special casing NaN and zero, ! * without the overhead of objects. * ! * @param x the first double to compare ! * @param y the second double to compare ! * @return the comparison ! * @since 1.4 ! */ ! public static int compare(double x, double y) ! { ! if (isNaN(x)) ! return isNaN(y) ? 0 : 1; ! if (isNaN(y)) ! return -1; ! // recall that 0.0 == -0.0, so we convert to infinites and try again ! if (x == 0 && y == 0) ! return (int) (1 / x - 1 / y); ! if (x == y) ! return 0; ! ! return x > y ? 1 : -1; ! } ! ! /** ! * Helper method to convert to string. * ! * @param d the double to convert ! * @param isFloat true if the conversion is requested by Float (results in ! * fewer digits) */ ! // Package visible for use by Float. ! static native String toString(double d, boolean isFloat); /** ! * Initialize JNI cache. This method is called only by the * static initializer when using JNI. */ ! private static native void initIDs(); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/EcosProcess.java gcc-3.3/libjava/java/lang/EcosProcess.java *** gcc-3.2.3/libjava/java/lang/EcosProcess.java 2000-03-07 19:55:26.000000000 +0000 --- gcc-3.3/libjava/java/lang/EcosProcess.java 2002-08-14 01:07:59.000000000 +0000 *************** details. */ *** 10,15 **** --- 10,16 ---- package java.lang; + import java.io.File; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; *************** final class ConcreteProcess extends Proc *** 52,58 **** return 0; } ! public ConcreteProcess (String[] progarray, String[] envp) throws IOException { throw new IOException ("eCos processes unimplemented"); } --- 53,62 ---- return 0; } ! public ConcreteProcess (String[] progarray, ! String[] envp, ! File dir) ! throws IOException { throw new IOException ("eCos processes unimplemented"); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Error.java gcc-3.3/libjava/java/lang/Error.java *** gcc-3.2.3/libjava/java/lang/Error.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Error.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* Error.java - Indication of fatal abnormal conditions ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Error.java -- Indication of fatal abnormal conditions ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,82 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Applications should not try to catch errors since they indicate * abnormal conditions. An abnormal condition is something which should not ! * occur. A few errors, like ThreadDeath error do normally ! * occur, but most applications should not catch it. ! *

        ! * A method is not required to declare any subclass of Error in * its throws clause which might be thrown but not caught while ! * executing the method.. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class Error extends Throwable { ! static final long serialVersionUID = 4980196508277280342L; /** ! * Create an error without a message. */ public Error() ! { ! super(); ! } /** ! * Create an error with a message. */ public Error(String s) ! { ! super(s); ! } } --- 38,107 ---- package java.lang; /** ! * Applications should not try to catch errors since they indicate * abnormal conditions. An abnormal condition is something which should not ! * occur, or which should not be recovered from. This latter category ! * includes ThreadDeath and AssertionError. ! * ! *

        A method is not required to declare any subclass of Error in * its throws clause which might be thrown but not caught while ! * executing the method. * * @author Brian Jones * @author Tom Tromey ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ public class Error extends Throwable { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 4980196508277280342L; /** ! * Create an error without a message. The cause remains uninitialized. ! * ! * @see #initCause(Throwable) */ public Error() ! { ! } /** ! * Create an error with a message. The cause remains uninitialized. ! * ! * @param s the message string ! * @see #initCause(Throwable) */ public Error(String s) ! { ! super(s); ! } ! ! /** ! * Create an error with a message and a cause. ! * ! * @param s the message string ! * @param cause the cause of this error ! * @since 1.4 ! */ ! public Error(String s, Throwable cause) ! { ! super(s, cause); ! } ! ! /** ! * Create an error with a given cause, and a message of ! * cause == null ? null : cause.toString(). ! * ! * @param cause the cause of this error ! * @since 1.4 ! */ ! public Error(Throwable cause) ! { ! super(cause); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ExceptionInInitializerError.java gcc-3.3/libjava/java/lang/ExceptionInInitializerError.java *** gcc-3.2.3/libjava/java/lang/ExceptionInInitializerError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ExceptionInInitializerError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* ExceptionInInitializerError.java ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* ExceptionInInitializerError.java -- thrown when class initialization fails ! with an uncaught exception ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,155 **** package java.lang; - import java.io.PrintStream; - import java.io.PrintWriter; - - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * An ExceptionInInitializerError is thrown when an ! * unexpected exception has occurred in a static initializer or the ! * initializer for a static variable. * - * @since JDK 1.1 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class ExceptionInInitializerError extends LinkageError { static final long serialVersionUID = 1521711792217232256L; ! private Throwable exception = null; /** ! * Create an error without a message. */ public ExceptionInInitializerError() ! { ! super(); ! } /** ! * Create an error with a message. */ public ExceptionInInitializerError(String s) ! { ! super(s); ! } /** * Creates an error an saves a reference to the Throwable ! * object. * * @param t the exception thrown */ public ExceptionInInitializerError(Throwable t) ! { ! super(t.toString()); ! exception = t; ! } ! ! /** ! * Return the exception that caused this error to be created. ! * @return the stored Throwable object or null ! * if this ExceptionInInitializerError has no stored ! * Throwable object. ! */ ! public Throwable getException() ! { ! return exception; ! } ! ! /** ! * Print a stack trace of the exception that occurred. ! */ ! public void printStackTrace() ! { ! if (exception == null) ! { ! super.printStackTrace(); ! } ! else ! { ! System.err.print(this.getClass() + ": "); ! exception.printStackTrace(); ! } ! } /** ! * Print a stack trace of the exception that occurred to ! * the specified PrintStream. */ ! public void printStackTrace(PrintStream ps) ! { ! if (exception == null) ! { ! super.printStackTrace(ps); ! } ! else ! { ! ps.print(this.getClass() + ": "); ! exception.printStackTrace(ps); ! } ! } /** ! * Print a stack trace of the exception that occurred to ! * the specified PrintWriter. */ ! public void printStackTrace(PrintWriter pw) ! { ! if (exception == null) ! { ! super.printStackTrace(pw); ! } ! else ! { ! pw.print(this.getClass() + ": "); ! exception.printStackTrace(pw); ! } ! } } --- 39,123 ---- package java.lang; /** ! * An ExceptionInInitializerError is thrown when an uncaught ! * exception has occurred in a static initializer or the initializer for a ! * static variable. In general, this wraps only RuntimeExceptions, since the ! * compiler does not allow a checked exception to be uncaught in an ! * initializer. This exception only occurs during reflection, when a class ! * is initialized as part of another action. * * @author Brian Jones * @author Tom Tromey ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 */ public class ExceptionInInitializerError extends LinkageError { + /** + * Compatible with JDK 1.1+. + */ static final long serialVersionUID = 1521711792217232256L; ! /** ! * The cause of this exception (duplicates the one stored in Throwable). ! * ! * @serial the exception cause ! */ ! private final Throwable exception; /** ! * Create an error without a message. The cause is initialized as null. */ public ExceptionInInitializerError() ! { ! this((String) null); ! } /** ! * Create an error with a message. The cause is initialized as null. ! * ! * @param s the message */ public ExceptionInInitializerError(String s) ! { ! super(s); ! exception = null; ! } /** * Creates an error an saves a reference to the Throwable ! * object. The message string is null. * * @param t the exception thrown */ public ExceptionInInitializerError(Throwable t) ! { ! super(null); ! initCause(t); ! exception = t; ! } /** ! * Return the exception that caused this error to be created. This is a ! * legacy method; the preferred choice now is {@link Throwable#getCause()}. ! * ! * @return the cause, or null if unknown */ ! public Throwable getException() ! { ! return exception; ! } /** ! * Return the exception that cause this error to be created. ! * ! * @return the cause, or null if unknown ! * @since 1.4 */ ! public Throwable getCause() ! { ! return exception; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Exception.java gcc-3.3/libjava/java/lang/Exception.java *** gcc-3.2.3/libjava/java/lang/Exception.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Exception.java 2002-05-24 10:40:42.000000000 +0000 *************** *** 1,6 **** /* Exception.java -- generic exception thrown to indicate an exceptional condition has occurred. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* Exception.java -- generic exception thrown to indicate an exceptional condition has occurred. ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,78 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with the cause of the exception, such as * mouse movements, keyboard clicking, etc. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class Exception extends Throwable { ! static final long serialVersionUID = -3387516993124229948L; /** ! * Create an exception without a message. */ public Exception() ! { ! super(); ! } /** ! * Create an exception with a message. */ public Exception(String s) ! { ! super(s); ! } } --- 39,104 ---- package java.lang; /** ! * The root class of all exceptions worth catching in a program. This ! * includes the special category of RuntimeException, which ! * does not need to be declared in a throws clause. Exceptions can be used ! * to represent almost any exceptional behavior, such as programming errors, * mouse movements, keyboard clicking, etc. * * @author Brian Jones * @author Warren Levy ! * @author Eric Blake ! * @status updated to 1.4 */ public class Exception extends Throwable { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -3387516993124229948L; /** ! * Create an exception without a message. The cause remains uninitialized. ! * ! * @see #initCause(Throwable) */ public Exception() ! { ! } /** ! * Create an exception with a message. The cause remains uninitialized. ! * ! * @param s the message ! * @see #initCause(Throwable) */ public Exception(String s) ! { ! super(s); ! } ! ! /** ! * Create an exception with a message and a cause. ! * ! * @param s the message string ! * @param cause the cause of this error ! * @since 1.4 ! */ ! public Exception(String s, Throwable cause) ! { ! super(s, cause); ! } ! ! /** ! * Create an exception with a given cause, and a message of ! * cause == null ? null : cause.toString(). ! * ! * @param cause the cause of this exception ! * @since 1.4 ! */ ! public Exception(Throwable cause) ! { ! super(cause); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Float.java gcc-3.3/libjava/java/lang/Float.java *** gcc-3.2.3/libjava/java/lang/Float.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Float.java 2002-06-13 18:16:25.000000000 +0000 *************** *** 1,4 **** ! /* java.lang.Float Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,4 ---- ! /* Float.java -- object wrapper for float Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 40,51 **** import gnu.classpath.Configuration; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * Instances of class Float represent primitive * float values. --- 40,45 ---- *************** import gnu.classpath.Configuration; *** 55,65 **** * * @author Paul Fisher * @author Andrew Haley ! * @since JDK 1.0 */ public final class Float extends Number implements Comparable { /** * The maximum positive value a double may represent * is 3.4028235e+38f. */ --- 49,66 ---- * * @author Paul Fisher * @author Andrew Haley ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ public final class Float extends Number implements Comparable { /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -2671257302660747028L; + + /** * The maximum positive value a double may represent * is 3.4028235e+38f. */ *************** public final class Float extends Number *** 74,119 **** /** * The value of a float representation -1.0/0.0, negative infinity. */ ! public static final float NEGATIVE_INFINITY = -1.0f/0.0f; /** * The value of a float representation 1.0/0.0, positive infinity. */ ! public static final float POSITIVE_INFINITY = 1.0f/0.0f; /** * All IEEE 754 values of NaN have the same value in Java. */ ! public static final float NaN = 0.0f/0.0f; /** ! * The primitive type float is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('F'); /** * The immutable value of this Float. */ private final float value; ! private static final long serialVersionUID = -2671257302660747028L; ! static { if (Configuration.INIT_LOAD_LIBRARY) { ! System.loadLibrary ("javalang"); } } /** ! * Create a float from the primitive Float * specified. * ! * @param value the Float argument */ ! public Float (float value) { this.value = value; } --- 75,124 ---- /** * The value of a float representation -1.0/0.0, negative infinity. */ ! public static final float NEGATIVE_INFINITY = -1.0f / 0.0f; /** * The value of a float representation 1.0/0.0, positive infinity. */ ! public static final float POSITIVE_INFINITY = 1.0f / 0.0f; /** * All IEEE 754 values of NaN have the same value in Java. */ ! public static final float NaN = 0.0f / 0.0f; /** ! * The primitive type float is represented by this * Class object. + * @since 1.1 */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('F'); /** * The immutable value of this Float. + * + * @serial the wrapped float */ private final float value; ! /** ! * Load native routines necessary for this class. ! */ static { if (Configuration.INIT_LOAD_LIBRARY) { ! System.loadLibrary("javalang"); } } /** ! * Create a Float from the primitive float * specified. * ! * @param value the float argument */ ! public Float(float value) { this.value = value; } *************** public final class Float extends Number *** 124,502 **** * * @param value the double argument */ ! public Float (double value) { ! this.value = (float)value; } /** * Create a Float from the specified String. - * * This method calls Float.parseFloat(). * - * @exception NumberFormatException when the String cannot - * be parsed into a Float. * @param s the String to convert ! * @see #parseFloat(java.lang.String) */ ! public Float (String s) throws NumberFormatException { ! this.value = parseFloat (s); } /** ! * Parse the specified String as a float. * ! * The number is really read as n * 10exponent. The ! * first number is n, and if there is an "E" ! * ("e" is also acceptable), then the integer after that is ! * the exponent. ! *

        ! * Here are the possible forms the number can take: ! *
        ! * ! * ! * ! * ! * ! * ! *
        FormExamples
        [+-]<number>[.]345., -10, 12
        [+-]<number>.<number>40.2, 80.00, -12.30
        [+-]<number>[.]E[+-]<number>80E12, -12e+7, 4.E-123
        [+-]<number>.<number>E[+-]<number>6.02e-22, -40.2E+6, 12.3e9
        * ! * "[+-]" means either a plus or minus sign may go there, or ! * neither, in which case + is assumed. ! *
        ! * "[.]" means a dot may be placed here, but is optional. ! *
        ! * "<number>" means a string of digits (0-9), basically ! * an integer. "<number>.<number>" is basically ! * a real number, a floating-point value. ! *

        ! * Remember that a float has a limited range. If the ! * number you specify is greater than Float.MAX_VALUE or less ! * than -Float.MAX_VALUE, it will be set at ! * Float.POSITIVE_INFINITY or ! * Float.NEGATIVE_INFINITY, respectively. ! *

        * ! * Note also that float does not have perfect precision. Many ! * numbers cannot be precisely represented. The number you specify ! * will be rounded to the nearest representable value. ! * Float.MIN_VALUE is the margin of error for float ! * values. ! *

        ! * If an unexpected character is found in the String, a ! * NumberFormatException will be thrown. Spaces are not ! * allowed and will cause this exception to be thrown. * * @XXX specify where/how we are not in accord with the spec. * * @param str the String to convert ! * @return the value of the String as a float. ! * @exception NumberFormatException when the string cannot be parsed to a ! * float. ! * @since JDK 1.2 * @see #MIN_VALUE * @see #MAX_VALUE * @see #POSITIVE_INFINITY * @see #NEGATIVE_INFINITY */ ! public static float parseFloat (String s) throws NumberFormatException { ! // The spec says that parseFloat() should work like ! // Double.valueOf(). This is equivalent, in our implementation, ! // but more efficient. ! return (float) Double.parseDouble (s); } /** ! * Convert the float value of this Float ! * to a String. This method calls ! * Float.toString(float) to do its dirty work. * ! * @return the String representation of this Float. ! * @see #toString(float) */ ! public String toString () { ! return toString (value); } /** ! * If the Object is not null, is an ! * instanceof Float, and represents ! * the same primitive float value return ! * true. Otherwise false is returned. ! *

        ! * Note that there are two differences between == and ! * equals(). 0.0f == -0.0f returns true ! * but new Float(0.0f).equals(new Float(-0.0f)) returns ! * false. And Float.NaN == Float.NaN returns ! * false, but ! * new Float(Float.NaN).equals(new Float(Float.NaN)) returns ! * true. * ! * @param obj the object to compare to ! * @return whether the objects are semantically equal. */ ! public boolean equals (Object obj) { ! if (!(obj instanceof Float)) ! return false; ! ! float f = ((Float) obj).value; ! ! // GCJ LOCAL: this implementation is probably faster than ! // Classpath's, especially once we inline floatToIntBits. ! return floatToIntBits (value) == floatToIntBits (f); ! // END GCJ LOCAL } /** ! * Return a hashcode representing this Object. ! * Float's hash code is calculated by calling the ! * floatToIntBits() function. ! * @return this Object's hash code. ! * @see java.lang.Float.floatToIntBits(float) */ ! public int hashCode () { ! return floatToIntBits (value); } /** ! * Return the value of this Double when cast to an ! * int. */ ! public int intValue () { ! return (int) value; } /** ! * Return the value of this Double when cast to a ! * long. */ ! public long longValue () { ! return (long) value; } /** ! * Return the value of this Double when cast to a ! * float. */ ! public float floatValue () { ! return (float) value; } /** ! * Return the primitive double value represented by this ! * Double. */ ! public double doubleValue () { ! return (double) value; } /** ! * Convert the float to a String. ! *

        ! * ! * Floating-point string representation is fairly complex: here is a ! * rundown of the possible values. "[-]" indicates that a ! * negative sign will be printed if the value (or exponent) is negative. ! * "<number>" means a string of digits (0-9). ! * "<digit>" means a single digit (0-9). ! *

        ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *
        Value of FloatString Representation
        [+-] 0[-]0.0
        Between [+-] 10-3 and 107[-]number.number
        Other numeric value[-]<digit>.<number>E[-]<number>
        [+-] infinity[-]Infinity
        NaNNaN
        ! * ! * Yes, negative zero is a possible value. Note that there is ! * always a . and at least one digit printed after ! * it: even if the number is 3, it will be printed as 3.0. ! * After the ".", all digits will be printed except trailing zeros. No ! * truncation or rounding is done by this function. ! * ! * @XXX specify where we are not in accord with the spec. * ! * @param f the float to convert ! * @return the String representing the float. */ ! public static String toString (float f) { ! return Double.toString ((double) f, true); } /** ! * Return the result of calling new Float(java.lang.String). ! * ! * @param s the String to convert to a Float. ! * @return a new Float representing the String's ! * numeric value. * ! * @exception NumberFormatException thrown if String cannot ! * be parsed as a double. ! * @see #Float(java.lang.String) ! * @see #parseFloat(java.lang.String) */ ! public static Float valueOf (String s) throws NumberFormatException { ! return new Float (s); } /** ! * Return true if the value of this Float ! * is the same as NaN, otherwise return false. ! * @return whether this Float is NaN. */ ! public boolean isNaN () { ! return isNaN (value); } /** ! * Return true if the float has the same ! * value as NaN, otherwise return false. * ! * @param v the float to compare ! * @return whether the argument is NaN. */ ! public static boolean isNaN (float v) { ! // This works since NaN != NaN is the only reflexive inequality ! // comparison which returns true. ! return v != v; } /** ! * Return true if the value of this Float ! * is the same as NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. * ! * @return whether this Float is (-/+) infinity. */ ! public boolean isInfinite () { ! return isInfinite (value); } /** ! * Return true if the float has a value ! * equal to either NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. * ! * @param v the float to compare ! * @return whether the argument is (-/+) infinity. */ ! public static boolean isInfinite (float v) { ! return (v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY); } /** ! * Return the int bits of the specified float. ! * The result of this function can be used as the argument to ! * Float.intBitsToFloat(long) to obtain the * original float value. * * @param value the float to convert ! * @return the bits of the float. */ ! public static native int floatToIntBits (float value); /** ! * Return the int bits of the specified float. ! * The result of this function can be used as the argument to ! * Float.intBitsToFloat(long) to obtain the ! * original float value. The difference between ! * this function and floatToIntBits is that this ! * function does not collapse NaN values. * * @param value the float to convert ! * @return the bits of the float. */ ! public static native int floatToRawIntBits (float value); /** ! * Return the float represented by the long ! * bits specified. * ! * @param bits the long bits representing a double ! * @return the float represented by the bits. */ ! public static native float intBitsToFloat (int bits); /** ! * Returns 0 if the float value of the argument is ! * equal to the value of this Float. Returns a number ! * less than zero if the value of this Float is less ! * than the Float value of the argument, and returns a ! * number greater than zero if the value of this Float ! * is greater than the float value of the argument. ! *
        ! * Float.NaN is greater than any number other than itself, ! * even Float.POSITIVE_INFINITY. ! *
        ! * 0.0 is greater than -0.0. * ! * @param f the Float to compare to. ! * @return 0 if the Floats are the same, < 0 if this ! * Float is less than the Float in ! * in question, or > 0 if it is greater. * * @since 1.2 */ ! public int compareTo (Float f) { ! return compare (value, f.value); } /** ! * Returns 0 if the first argument is equal to the second argument. ! * Returns a number less than zero if the first argument is less than the ! * second argument, and returns a number greater than zero if the first ! * argument is greater than the second argument. ! *
        ! * Float.NaN is greater than any number other than itself, ! * even Float.POSITIVE_INFINITY. ! *
        ! * 0.0 is greater than -0.0. * ! * @param x the first float to compare. ! * @param y the second float to compare. ! * @return 0 if the arguments are the same, < 0 if the ! * first argument is less than the second argument in ! * in question, or > 0 if it is greater. * @since 1.4 */ ! public static int compare (float x, float y) { ! if (isNaN (x)) ! return isNaN (y) ? 0 : 1; ! if (isNaN (y)) return -1; // recall that 0.0 == -0.0, so we convert to infinities and try again if (x == 0 && y == 0) --- 129,523 ---- * * @param value the double argument */ ! public Float(double value) { ! this.value = (float) value; } /** * Create a Float from the specified String. * This method calls Float.parseFloat(). * * @param s the String to convert ! * @throws NumberFormatException if s cannot be parsed as a ! * float ! * @throws NullPointerException if s is null ! * @see #parseFloat(String) */ ! public Float(String s) { ! value = parseFloat(s); } /** ! * Convert the float to a String. ! * Floating-point string representation is fairly complex: here is a ! * rundown of the possible values. "[-]" indicates that a ! * negative sign will be printed if the value (or exponent) is negative. ! * "<number>" means a string of digits ('0' to '9'). ! * "<digit>" means a single digit ('0' to '9').
        * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *
        Value of FloatString Representation
        [+-] 0 [-]0.0
        Between [+-] 10-3 and 107, exclusive[-]number.number
        Other numeric value[-]<digit>.<number> ! * E[-]<number>
        [+-] infinity [-]Infinity
        NaN NaN
        * ! * Yes, negative zero is a possible value. Note that there is ! * always a . and at least one digit printed after ! * it: even if the number is 3, it will be printed as 3.0. ! * After the ".", all digits will be printed except trailing zeros. The ! * result is rounded to the shortest decimal number which will parse back ! * to the same float. * ! *

        To create other output formats, use {@link java.text.NumberFormat}. ! * ! * @XXX specify where we are not in accord with the spec. ! * ! * @param f the float to convert ! * @return the String representing the float ! */ ! public static String toString(float f) ! { ! return Double.toString(f, true); ! } ! ! /** ! * Creates a new Float object using the String. ! * ! * @param s the String to convert ! * @return the new Float ! * @throws NumberFormatException if s cannot be parsed as a ! * float ! * @throws NullPointerException if s is null ! * @see #parseFloat(String) ! */ ! public static Float valueOf(String s) ! { ! return new Float(parseFloat(s)); ! } ! ! /** ! * Parse the specified String as a float. The ! * extended BNF grammar is as follows:
        ! *

        !    * DecodableString:
        !    *      ( [ - | + ] NaN )
        !    *    | ( [ - | + ] Infinity )
        !    *    | ( [ - | + ] FloatingPoint
        !    *              [ f | F | d
        !    *                | D] )
        !    * FloatingPoint:
        !    *      ( { Digit }+ [ . { Digit } ]
        !    *              [ Exponent ] )
        !    *    | ( . { Digit }+ [ Exponent ] )
        !    * Exponent:
        !    *      ( ( e | E )
        !    *              [ - | + ] { Digit }+ )
        !    * Digit: '0' through '9'
        !    * 
        ! * ! *

        NaN and infinity are special cases, to allow parsing of the output ! * of toString. Otherwise, the result is determined by calculating ! * n * 10exponent to infinite precision, then rounding ! * to the nearest float. Remember that many numbers cannot be precisely ! * represented in floating point. In case of overflow, infinity is used, ! * and in case of underflow, signed zero is used. Unlike Integer.parseInt, ! * this does not accept Unicode digits outside the ASCII range. ! * ! *

        If an unexpected character is found in the String, a ! * NumberFormatException will be thrown. Leading and trailing ! * 'whitespace' is ignored via String.trim(), but spaces ! * internal to the actual number are not allowed. ! * ! *

        To parse numbers according to another format, consider using ! * {@link java.text.NumberFormat}. * * @XXX specify where/how we are not in accord with the spec. * * @param str the String to convert ! * @return the float value of s ! * @throws NumberFormatException if s cannot be parsed as a ! * float ! * @throws NullPointerException if s is null * @see #MIN_VALUE * @see #MAX_VALUE * @see #POSITIVE_INFINITY * @see #NEGATIVE_INFINITY + * @since 1.2 */ ! public static float parseFloat(String s) { ! // XXX Rounding parseDouble() causes some errors greater than 1 ulp from ! // the infinitely precise decimal. ! return (float) Double.parseDouble(s); } /** ! * Return true if the float has the same ! * value as NaN, otherwise return false. * ! * @param v the float to compare ! * @return whether the argument is NaN */ ! public static boolean isNaN(float v) { ! // This works since NaN != NaN is the only reflexive inequality ! // comparison which returns true. ! return v != v; } /** ! * Return true if the float has a value ! * equal to either NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. * ! * @param v the float to compare ! * @return whether the argument is (-/+) infinity */ ! public static boolean isInfinite(float v) { ! return v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY; } /** ! * Return true if the value of this Float ! * is the same as NaN, otherwise return false. ! * ! * @return whether this Float is NaN */ ! public boolean isNaN() { ! return isNaN(value); } /** ! * Return true if the value of this Float ! * is the same as NEGATIVE_INFINITY or ! * POSITIVE_INFINITY, otherwise return false. ! * ! * @return whether this Float is (-/+) infinity */ ! public boolean isInfinite() { ! return isInfinite(value); } /** ! * Convert the float value of this Float ! * to a String. This method calls ! * Float.toString(float) to do its dirty work. ! * ! * @return the String representation ! * @see #toString(float) */ ! public String toString() { ! return toString(value); } /** ! * Return the value of this Float as a byte. ! * ! * @return the byte value ! * @since 1.1 */ ! public byte byteValue() { ! return (byte) value; } /** ! * Return the value of this Float as a short. ! * ! * @return the short value ! * @since 1.1 */ ! public short shortValue() { ! return (short) value; } /** ! * Return the value of this Integer as an int. * ! * @return the int value */ ! public int intValue() { ! return (int) value; } /** ! * Return the value of this Integer as a long. * ! * @return the long value */ ! public long longValue() { ! return (long) value; } /** ! * Return the value of this Float. ! * ! * @return the float value */ ! public float floatValue() { ! return value; } /** ! * Return the value of this Float as a double * ! * @return the double value */ ! public double doubleValue() { ! return value; } /** ! * Return a hashcode representing this Object. Float's hash ! * code is calculated by calling floatToIntBits(floatValue()). * ! * @return this Object's hash code ! * @see #floatToIntBits(float) */ ! public int hashCode() { ! return floatToIntBits(value); } /** ! * Returns true if obj is an instance of ! * Float and represents the same float value. Unlike comparing ! * two floats with ==, this treats two instances of ! * Float.NaN as equal, but treats 0.0 and ! * -0.0 as unequal. * ! *

        Note that f1.equals(f2) is identical to ! * floatToIntBits(f1.floatValue()) == ! * floatToIntBits(f2.floatValue()). ! * ! * @param obj the object to compare ! * @return whether the objects are semantically equal */ ! public boolean equals(Object obj) { ! if (! (obj instanceof Float)) ! return false; ! ! float f = ((Float) obj).value; ! ! // Avoid call to native method. However, some implementations, like gcj, ! // are better off using floatToIntBits(value) == floatToIntBits(f). ! // Check common case first, then check NaN and 0. ! if (value == f) ! return (value != 0) || (1 / value == 1 / f); ! return isNaN(value) && isNaN(f); } /** ! * Convert the float to the IEEE 754 floating-point "single format" bit ! * layout. Bit 31 (the most significant) is the sign bit, bits 30-23 ! * (masked by 0x7f800000) represent the exponent, and bits 22-0 ! * (masked by 0x007fffff) are the mantissa. This function collapses all ! * versions of NaN to 0x7fc00000. The result of this function can be used ! * as the argument to Float.intBitsToFloat(int) to obtain the * original float value. * * @param value the float to convert ! * @return the bits of the float ! * @see #intBitsToFloat(int) */ ! public static native int floatToIntBits(float value); /** ! * Convert the float to the IEEE 754 floating-point "single format" bit ! * layout. Bit 31 (the most significant) is the sign bit, bits 30-23 ! * (masked by 0x7f800000) represent the exponent, and bits 22-0 ! * (masked by 0x007fffff) are the mantissa. This function leaves NaN alone, ! * rather than collapsing to a canonical value. The result of this function ! * can be used as the argument to Float.intBitsToFloat(int) to ! * obtain the original float value. * * @param value the float to convert ! * @return the bits of the float ! * @see #intBitsToFloat(int) */ ! public static native int floatToRawIntBits(float value); /** ! * Convert the argument in IEEE 754 floating-point "single format" bit ! * layout to the corresponding float. Bit 31 (the most significant) is the ! * sign bit, bits 30-23 (masked by 0x7f800000) represent the exponent, and ! * bits 22-0 (masked by 0x007fffff) are the mantissa. This function leaves ! * NaN alone, so that you can recover the bit pattern with ! * Float.floatToRawIntBits(float). * ! * @param bits the bits to convert ! * @return the float represented by the bits ! * @see #floatToIntBits(float) ! * @see #floatToRawIntBits(float) */ ! public static native float intBitsToFloat(int bits); /** ! * Compare two Floats numerically by comparing their float ! * values. The result is positive if the first is greater, negative if the ! * second is greater, and 0 if the two are equal. However, this special ! * cases NaN and signed zero as follows: NaN is considered greater than ! * all other floats, including POSITIVE_INFINITY, and positive ! * zero is considered greater than negative zero. * ! * @param f the Float to compare ! * @return the comparison ! * @since 1.2 ! */ ! public int compareTo(Float f) ! { ! return compare(value, f.value); ! } ! ! /** ! * Behaves like compareTo(Float) unless the Object ! * is not an Float. * + * @param o the object to compare + * @return the comparison + * @throws ClassCastException if the argument is not a Float + * @see #compareTo(Float) + * @see Comparable * @since 1.2 */ ! public int compareTo(Object o) { ! return compare(value, ((Float) o).value); } /** ! * Behaves like new Float(x).compareTo(new Float(y)); in ! * other words this compares two floats, special casing NaN and zero, ! * without the overhead of objects. * ! * @param x the first float to compare ! * @param y the second float to compare ! * @return the comparison * @since 1.4 */ ! public static int compare(float x, float y) { ! if (isNaN(x)) ! return isNaN(y) ? 0 : 1; ! if (isNaN(y)) return -1; // recall that 0.0 == -0.0, so we convert to infinities and try again if (x == 0 && y == 0) *************** public final class Float extends Number *** 506,528 **** return x > y ? 1 : -1; } - - /** - * Compares the specified Object to this Float - * if and only if the Object is an instanceof - * Float. - * Otherwise it throws a ClassCastException - * - * @param o the Object to compare to. - * @return 0 if the Floats are the same, < 0 if this - * Float is less than the Float in - * in question, or > 0 if it is greater. - * @throws ClassCastException if the argument is not a Float - * - * @since 1.2 - */ - public int compareTo (Object o) - { - return compareTo ((Float) o); - } } --- 527,530 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ieeefp.h gcc-3.3/libjava/java/lang/ieeefp.h *** gcc-3.2.3/libjava/java/lang/ieeefp.h 2002-03-17 16:16:58.000000000 +0000 --- gcc-3.3/libjava/java/lang/ieeefp.h 2002-07-19 14:41:14.000000000 +0000 *************** *** 58,63 **** --- 58,67 ---- #define __IEEE_LITTLE_ENDIAN #endif + #ifdef __x86_64__ + #define __IEEE_LITTLE_ENDIAN + #endif + #ifdef __i960__ #define __IEEE_LITTLE_ENDIAN #endif *************** *** 126,131 **** --- 130,139 ---- #endif #endif + #ifdef __s390__ + #define __IEEE_BIG_ENDIAN + #endif + #ifndef __IEEE_BIG_ENDIAN #ifndef __IEEE_LITTLE_ENDIAN #error Endianess not declared!! diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IllegalAccessError.java gcc-3.3/libjava/java/lang/IllegalAccessError.java *** gcc-3.2.3/libjava/java/lang/IllegalAccessError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IllegalAccessError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* IllegalAccessError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* IllegalAccessError.java -- thrown when linking to an inaccessible member ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,80 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * An IllegalAccessError is thrown when an attempt is made to * call a method, or access or modify a field that the application does not ! * have access to. Because this error is usually caught by a compiler, * the error only occurs at runtime when the definition of a class has ! * changed in a way that is incompatible with the previously compiled * application. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class IllegalAccessError extends IncompatibleClassChangeError { ! static final long serialVersionUID = -8988904074992417891L; /** * Create an error without a message. */ public IllegalAccessError() ! { ! super(); ! } /** * Create an error with a message. */ public IllegalAccessError(String s) ! { ! super(s); ! } } --- 38,76 ---- package java.lang; /** ! * An IllegalAccessError is thrown when an attempt is made to * call a method, or access or modify a field that the application does not ! * have access to. Because this error is usually caught by a compiler, * the error only occurs at runtime when the definition of a class has ! * changed in a way that is incompatible with the previously compiled * application. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class IllegalAccessError extends IncompatibleClassChangeError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -8988904074992417891L; /** * Create an error without a message. */ public IllegalAccessError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public IllegalAccessError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IllegalAccessException.java gcc-3.3/libjava/java/lang/IllegalAccessException.java *** gcc-3.2.3/libjava/java/lang/IllegalAccessException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IllegalAccessException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* IllegalAccessException.java -- exception thrown when trying to load a ! class that is not public and in another package. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* IllegalAccessException.java -- thrown on attempt to reflect on ! inaccessible data ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,83 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * Thrown in two cases. The first is when try to load a class that is ! * not public and in another package using specific methods from ! * ClassLoader and Class. The second case is ! * when trying to create a new instance of a class to which you do not have ! * access to the zero argument constructor as in using the ! * newsInstance method of class Class. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class IllegalAccessException extends Exception { ! static final long serialVersionUID = 6616958222490762034L; /** * Create an exception without a message. */ public IllegalAccessException() ! { ! super(); ! } /** * Create an exception with a message. */ public IllegalAccessException(String s) ! { ! super(s); ! } } --- 39,95 ---- package java.lang; /** ! * Thrown whenever a reflective method tries to do something that the ! * compiler would not allow. For example, using reflection to set a private ! * variable that belongs to a class in another package is bad. * * @author Brian Jones * @author Warren Levy ! * @see Class#newInstance() ! * @see Field#set(Object, Object) ! * @see Field#setBoolean(Object, boolean) ! * @see Field#setByte(Object, byte) ! * @see Field#setShort(Object, short) ! * @see Field#setChar(Object, char) ! * @see Field#setInt(Object, int) ! * @see Field#setLong(Object, long) ! * @see Field#setFloat(Object, float) ! * @see Field#setDouble(Object, double) ! * @see Field#get(Object) ! * @see Field#getBoolean(Object) ! * @see Field#getByte(Object) ! * @see Field#getShort(Object) ! * @see Field#getChar(Object) ! * @see Field#getInt(Object) ! * @see Field#getLong(Object) ! * @see Field#getFloat(Object) ! * @see Field#getDouble(Object) ! * @see Method#invoke(Object, Object[]) ! * @see Constructor#newInstance(Object[]) ! * @status updated to 1.4 */ public class IllegalAccessException extends Exception { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 6616958222490762034L; /** * Create an exception without a message. */ public IllegalAccessException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public IllegalAccessException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IllegalArgumentException.java gcc-3.3/libjava/java/lang/IllegalArgumentException.java *** gcc-3.2.3/libjava/java/lang/IllegalArgumentException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IllegalArgumentException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* IllegalArgumentException.java -- exception may be thrown when a method ! is passed an illegal or inappropriate argument. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* IllegalArgumentException.java -- thrown when a method is passed an ! illegal or inappropriate argument ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,78 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * When a method is passed an illegal or inappropriate argument ! * this exception may be thrown. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class IllegalArgumentException extends RuntimeException { ! static final long serialVersionUID = -5365630128856068164L; ! /** * Create an exception without a message. */ public IllegalArgumentException() ! { ! super(); ! } /** * Create an exception with a message. */ public IllegalArgumentException(String s) ! { ! super(s); ! } } --- 38,75 ---- package java.lang; /** ! * Thrown when a method is passed an illegal or inappropriate argument. For ! * example:
        ! *

        !  * wait(-1);
        !  * 
        * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class IllegalArgumentException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -5365630128856068164L; ! /** * Create an exception without a message. */ public IllegalArgumentException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public IllegalArgumentException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IllegalMonitorStateException.java gcc-3.3/libjava/java/lang/IllegalMonitorStateException.java *** gcc-3.2.3/libjava/java/lang/IllegalMonitorStateException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IllegalMonitorStateException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* IllegalMonitorStateException.java -- exception thrown when a thread ! attempts to wait on an object's monitor. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* IllegalMonitorStateException.java -- thrown when trying to wait or ! notify a monitor that is not owned ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,81 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * If a thread attempts to wait on an object's monitor then ! * IllegalMonitorStateException can be thrown. This ! * exception is also thrown to give a message to other threads also waiting ! * on an object's monitor without owning the monitor. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class IllegalMonitorStateException extends RuntimeException { ! static final long serialVersionUID = 3713306369498869069L; /** * Create an exception without a message. */ public IllegalMonitorStateException() ! { ! super(); ! } /** * Create an exception with a message. */ public IllegalMonitorStateException(String s) ! { ! super(s); ! } } --- 39,78 ---- package java.lang; /** ! * Thrown when a thread attempts to wait or notify on a monitor that it ! * does not own (ie. it has not synchronized on the object). For example:
        ! *
        !  * void m() {
        !  *   notify();
        !  * }
        !  * 
        * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class IllegalMonitorStateException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 3713306369498869069L; /** * Create an exception without a message. */ public IllegalMonitorStateException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public IllegalMonitorStateException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IllegalStateException.java gcc-3.3/libjava/java/lang/IllegalStateException.java *** gcc-3.2.3/libjava/java/lang/IllegalStateException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IllegalStateException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* IllegalStateException.java -- exception thrown when invoking a method at ! an illegal or inappropriate time. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* IllegalStateException.java -- thrown when invoking a method at ! an illegal or inappropriate time ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,79 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * Invoking a method at an illegal or inappropriate time can result ! * in an IllegalStateException. * - * @since JDK 1.1 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class IllegalStateException extends RuntimeException { ! static final long serialVersionUID = -1848914673093119416L; /** * Create an exception without a message. */ public IllegalStateException() ! { ! super(); ! } /** * Create an exception with a message. */ public IllegalStateException(String s) ! { ! super(s); ! } } --- 39,80 ---- package java.lang; /** ! * Thrown when a method is invoked at an illegal or inappropriate time. For ! * example:
        ! *
        !  * void m(Collecion c)
        !  * {
        !  *   c.iterator().remove();
        !  * }
        !  * 
        * * @author Brian Jones * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ public class IllegalStateException extends RuntimeException { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -1848914673093119416L; /** * Create an exception without a message. */ public IllegalStateException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public IllegalStateException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IllegalThreadStateException.java gcc-3.3/libjava/java/lang/IllegalThreadStateException.java *** gcc-3.2.3/libjava/java/lang/IllegalThreadStateException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IllegalThreadStateException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,7 **** ! /* IllegalThreadStateException.java -- exception thrown when trying to ! suspend or resume a Thread when it is not in an appropriate state ! for the operation. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* IllegalThreadStateException.java -- thrown when trying to manipulate a ! Thread when it is not in an appropriate state ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 9,15 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 40,80 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * When trying to suspend or resume an object ! * of class Thread when it is not in an appropriate state ! * for the operation. * - * @since JDK 1.0 * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class IllegalThreadStateException extends IllegalArgumentException { ! static final long serialVersionUID = -7626246362397460174L; /** * Create an exception without a message. */ public IllegalThreadStateException() ! { ! super(); ! } /** * Create an exception with a message. */ public IllegalThreadStateException(String s) ! { ! super(s); ! } } --- 39,75 ---- package java.lang; /** ! * Thrown When trying to manipulate a Thread which is in an inappropriate ! * state. Since the documentation suggests that this can happen with ! * Thread.suspend or Thread.resume, but these ! * two methods are deprecated, this exception is likely very rare. * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class IllegalThreadStateException extends IllegalArgumentException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -7626246362397460174L; /** * Create an exception without a message. */ public IllegalThreadStateException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public IllegalThreadStateException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IncompatibleClassChangeError.java gcc-3.3/libjava/java/lang/IncompatibleClassChangeError.java *** gcc-3.2.3/libjava/java/lang/IncompatibleClassChangeError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IncompatibleClassChangeError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* IncompatibleClassChangeError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* IncompatibleClassChangeError.java -- thrown for binary incompatible classes ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,77 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * An IncompatibleClassChangeError is thrown when the ! * definition of a class used by the currently executing method has ! * changed in an incompatible way. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class IncompatibleClassChangeError extends LinkageError { ! static final long serialVersionUID = -4914975503642802119L; /** * Create an error without a message. */ public IncompatibleClassChangeError() ! { ! super(); ! } /** * Create an error with a message. */ public IncompatibleClassChangeError(String s) ! { ! super(s); ! } } --- 38,73 ---- package java.lang; /** ! * An IncompatibleClassChangeError is thrown when the definition ! * of a class used by the currently executing method has changed in an ! * incompatible way. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class IncompatibleClassChangeError extends LinkageError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4914975503642802119L; /** * Create an error without a message. */ public IncompatibleClassChangeError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public IncompatibleClassChangeError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/IndexOutOfBoundsException.java gcc-3.3/libjava/java/lang/IndexOutOfBoundsException.java *** gcc-3.2.3/libjava/java/lang/IndexOutOfBoundsException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/IndexOutOfBoundsException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,7 **** ! /* IndexOutOfBoundsException.java -- exception thrown when attempting to ! access an index which is out of bounds on objects like String, Array, ! or Vector. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* IndexOutOfBoundsException.java -- thrown for an invalid index ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 9,15 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 40,83 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** - * Exceptions may be thrown by one part of a Java program and caught - * by another in order to deal with exceptional conditions. * This exception can be thrown to indicate an attempt to access an * index which is out of bounds on objects like String, Array, or Vector. * Usually any negative integer less than or equal to -1 and positive * integer greater than or equal to the size of the object is an index * which would be out of bounds. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class IndexOutOfBoundsException extends RuntimeException { ! static final long serialVersionUID = 234122996006267687L; /** * Create an exception without a message. */ public IndexOutOfBoundsException() ! { ! super(); ! } /** * Create an exception with a message. */ public IndexOutOfBoundsException(String s) ! { ! super(s); ! } } --- 38,75 ---- package java.lang; /** * This exception can be thrown to indicate an attempt to access an * index which is out of bounds on objects like String, Array, or Vector. * Usually any negative integer less than or equal to -1 and positive * integer greater than or equal to the size of the object is an index * which would be out of bounds. * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class IndexOutOfBoundsException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 234122996006267687L; /** * Create an exception without a message. */ public IndexOutOfBoundsException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public IndexOutOfBoundsException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/InheritableThreadLocal.java gcc-3.3/libjava/java/lang/InheritableThreadLocal.java *** gcc-3.2.3/libjava/java/lang/InheritableThreadLocal.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/InheritableThreadLocal.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.InheritableThreadLocal ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InheritableThreadLocal -- a ThreadLocal which inherits values across threads ! Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,178 **** package java.lang; import java.util.Iterator; ! import java.util.HashSet; ! import java.util.Map; ! import java.util.Set; import java.util.WeakHashMap; /** ! * ThreadLocal whose value is inherited by child Threads. ! * The value of the InheritableThreadLocal associated with the (parent) Thread ! * on the moment that it creates a new (child) Thread is set as the value that ! * is associated with the new (child) Thread. ! *

        ! * It is possible to make the value associated with the child Thread a function ! * of the value that is associated with the parent Thread by overriding the ! * childValue() method. * * @since 1.2 ! * @author Mark Wielaard (mark@klomp.org) */ ! public class InheritableThreadLocal extends ThreadLocal { ! ! /** ! * Maps Threads to a Set of InheritableThreadLocals ! * (the heritage of that Thread). ! * Uses a WeakHashMap so if the Thread is garbage collected the reference ! * to that Set disappears. ! * Both AddToHeritage access and modify it so they have to ! * synchronize on the threadMap when they do. ! */ ! private static Map threadMap = new WeakHashMap(); ! ! /** ! * Creates a new InheritableThreadLocal that has no values associated ! * with it yet. ! */ ! public InheritableThreadLocal() { ! super(); ! } ! ! /** ! * Determines the value associated with a newly created child Thread ! * as a function of the value associated with the currently executing ! * (parent) Thread. ! *

        ! * The default implementation just returns the parentValue. ! */ ! protected Object childValue(Object parentValue) { ! return parentValue; ! } ! ! /** ! * Adds this InheritableThreadLocal to the heritage of the ! * current Thread and returns the value of the ThreadLocal ! * for the Thread. The value will be either the last value that the ! * current Thread has set, or the childValue of the last value that the ! * parent Thread set before the current Thread was created, or the ! * initialValue of the ThreadLocal. ! * ! * @see ThreadLocal#get() ! */ ! public Object get() { ! addToHeritage(); ! return super.get(); ! } ! ! /** ! * Adds this InheritableThreadLocal to the heritage of the ! * current Thread and sets the value of the ThreadLocal ! * for the Thread. ! * ! * @see ThreadLocal#set(Object) ! */ ! public void set(Object value) { ! addToHeritage(); ! super.set(value); ! } ! ! /** ! * Adds this InheritableThreadLocal to the heritage ! * of the current Thread. ! */ ! private void addToHeritage() { ! Thread currentThread = Thread.currentThread(); ! Set heritage; ! synchronized(threadMap) { ! heritage = (Set)threadMap.get(currentThread); ! } ! // Note that we don't have to synchronize on the heritage Set ! // since only this Thread (or the parent Thread when creating ! // the heritage) ever modifies it. ! if (heritage == null) { ! heritage = new HashSet(); ! synchronized(threadMap) { ! threadMap.put(currentThread, heritage); ! } ! } ! if (!heritage.contains(this)) { ! heritage.add(this); ! } ! } ! ! /** ! * Generates the childValues of all InheritableThreadLocals ! * that are in the heritage of the current Thread for the newly created ! * childThread. ! * Should be called from the contructor of java.lang.Thread. ! */ ! static void newChildThread(Thread childThread) { ! // The currentThread is the parent of the new thread ! Thread parentThread = Thread.currentThread(); ! ! // Inherit all the InheritableThreadLocals of the parent thread ! Set heritage; ! synchronized(threadMap) { ! heritage = (Set)threadMap.get(parentThread); ! } ! // Note that we don't have to synchronize on the heritage Set ! // since only this Thread (or the parent Thread when creating ! // the heritage) ever modifies it. ! if (heritage != null) { ! synchronized(threadMap) { ! threadMap.put(childThread, new HashSet(heritage)); ! } ! // And constructs all the new child values ! // (has to be done now that we are executing in the parentThread) ! Iterator it = heritage.iterator(); ! while (it.hasNext()) { ! InheritableThreadLocal local = ! (InheritableThreadLocal) it.next(); ! // Note that the parentValue cannot be null ! // If it was it would not be in the heritage ! Object parentValue = local.get(parentThread).getValue(); ! Object childValue = local.childValue(parentValue); ! ThreadLocal.Value v = new ThreadLocal.Value(childValue); ! local.set(childThread, v); ! } ! } ! } } --- 38,139 ---- package java.lang; import java.util.Iterator; ! import java.util.List; ! import java.util.ArrayList; import java.util.WeakHashMap; /** ! * A ThreadLocal whose value is inherited by child Threads. The value of the ! * InheritableThreadLocal associated with the (parent) Thread is copied to ! * the new (child) Thread at the moment of creation. * + *

        It is possible to make the value associated with the child Thread a + * function of the value that is associated with the parent Thread by + * overriding the childValue() method. The utility of this class + * is in transferring items like User ID or Transaction ID across threads + * automatically. + * + * @author Mark Wielaard + * @author Eric Blake + * @see ThreadLocal * @since 1.2 ! * @status updated to 1.4 */ ! public class InheritableThreadLocal extends ThreadLocal ! { ! /** ! * Maps Threads to a List of InheritableThreadLocals (the heritage of that ! * Thread). Uses a WeakHashMap so if the Thread is garbage collected the ! * List can be collected, too. Maps to a list in case the user overrides ! * equals. ! */ ! private static final WeakHashMap threadMap = new WeakHashMap(); ! ! /** ! * Creates a new InheritableThreadLocal that has no values associated ! * with it yet. ! */ ! public InheritableThreadLocal() ! { ! Thread currentThread = Thread.currentThread(); ! // Note that we don't have to synchronize, as only this thread will ! // ever modify the returned heritage. ! List heritage = (List) threadMap.get(currentThread); ! if (heritage == null) ! { ! heritage = new ArrayList(); ! threadMap.put(currentThread, heritage); ! } ! heritage.add(this); ! } ! ! /** ! * Determines the value associated with a newly created child Thread as a ! * function of the value associated with the currently executing (parent) ! * Thread. The default implementation just returns the parentValue. ! * ! * @param parentValue the value of this object in the parent thread at ! * the moment of creation of the child ! * @return the initial value for the child thread ! */ ! protected Object childValue(Object parentValue) ! { ! return parentValue; ! } ! ! /** ! * Generates the childValues of all InheritableThreadLocals ! * that are in the heritage of the current Thread for the newly created ! * childThread. Should be called from the contructor Thread. ! * ! * @param childThread the newly created thread, to inherit from this thread ! * @see Thread#Thread(ThreadGroup, Runnable, String) ! */ ! static void newChildThread(Thread childThread) ! { ! // The currentThread is the parent of the new thread. ! Thread parentThread = Thread.currentThread(); ! // Note that we don't have to synchronize, as only this thread will ! // ever modify the returned heritage. ! ArrayList heritage = (ArrayList) threadMap.get(parentThread); ! if (heritage != null) ! { ! threadMap.put(childThread, heritage.clone()); ! // Perform the inheritance. ! Iterator it = heritage.iterator(); ! int i = heritage.size(); ! while (--i >= 0) ! { ! InheritableThreadLocal local = (InheritableThreadLocal) it.next(); ! Object parentValue = local.valueMap.get(parentThread); ! if (parentValue != null) ! { ! Object childValue = local.childValue(parentValue == NULL ! ? null : parentValue); ! local.valueMap.put(childThread, (childValue == null ! ? NULL : parentValue)); ! } ! } ! } ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/InstantiationError.java gcc-3.3/libjava/java/lang/InstantiationError.java *** gcc-3.2.3/libjava/java/lang/InstantiationError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/InstantiationError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* InstantiationError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InstantiationError.java -- thrown when the linker cannot create an instance ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,80 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * An InstantiationError is thrown when an attempt is made to ! * create an instance of an abstract class or an interface. Because this ! * error is usually caught by a compiler, ! * the error only occurs at runtime when the definition of a class has ! * changed in a way that is incompatible with the previously compiled ! * application. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class InstantiationError extends IncompatibleClassChangeError { ! static final long serialVersionUID = -4885810657349421204L; /** * Create an error without a message. */ public InstantiationError() ! { ! super(); ! } /** * Create an error with a message. */ public InstantiationError(String s) ! { ! super(s); ! } } --- 38,75 ---- package java.lang; /** ! * An InstantiationError is thrown when an attempt is made to ! * create an instance of an abstract class or an interface. Because this ! * error is usually caught by a compiler, the error only occurs at runtime ! * when the definition of a class has changed in a way that is incompatible ! * with the previously compiled application. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class InstantiationError extends IncompatibleClassChangeError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4885810657349421204L; /** * Create an error without a message. */ public InstantiationError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public InstantiationError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/InstantiationException.java gcc-3.3/libjava/java/lang/InstantiationException.java *** gcc-3.2.3/libjava/java/lang/InstantiationException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/InstantiationException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* InstantiationException.java -- exception thrown when trying to instantiate ! interfaces and abstract classes using Class.newInstance. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* InstantiationException.java -- thrown when reflection cannot create an ! instance ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,80 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * Interfaces and abstract classes cannot be instantiated using the ! * newInstance method of class Class. Trying ! * to do so results in this exception being thrown. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class InstantiationException extends Exception { ! static final long serialVersionUID = -8441929162975509110L; /** * Create an exception without a message. */ public InstantiationException() ! { ! super(); ! } /** * Create an exception with a message. */ public InstantiationException(String s) ! { ! super(s); ! } } --- 39,74 ---- package java.lang; /** ! * Thrown when an attempt is made to use reflection to build a ! * non-instantiable class (an interface or abstract class). * * @author Brian Jones * @author Warren Levy ! * @see Class#newInstance() ! * @status updated to 1.4 */ public class InstantiationException extends Exception { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -8441929162975509110L; /** * Create an exception without a message. */ public InstantiationException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public InstantiationException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Integer.java gcc-3.3/libjava/java/lang/Integer.java *** gcc-3.2.3/libjava/java/lang/Integer.java 2002-04-15 21:06:59.000000000 +0000 --- gcc-3.3/libjava/java/lang/Integer.java 2002-06-13 18:16:25.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.Integer ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Integer.java -- object wrapper for int ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 48,83 **** * @author Paul Fisher * @author John Keiser * @author Warren Levy ! * @since JDK 1.0 */ public final class Integer extends Number implements Comparable { ! // compatible with JDK 1.0.2+ private static final long serialVersionUID = 1360826667806852920L; /** ! * The minimum value an int can represent is -2147483648. */ public static final int MIN_VALUE = 0x80000000; /** ! * The maximum value an int can represent is 2147483647. */ public static final int MAX_VALUE = 0x7fffffff; /** ! * The primitive type int is represented by this * Class object. */ ! public static final Class TYPE = VMClassLoader.getPrimitiveClass ('I'); /** * The immutable value of this Integer. */ private final int value; /** ! * Create an Integer object representing the value of the * int argument. * * @param value the value to use --- 48,92 ---- * @author Paul Fisher * @author John Keiser * @author Warren Levy ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ public final class Integer extends Number implements Comparable { ! /** ! * Compatible with JDK 1.0.2+. ! */ private static final long serialVersionUID = 1360826667806852920L; /** ! * The minimum value an int can represent is -2147483648 (or ! * -231). */ public static final int MIN_VALUE = 0x80000000; /** ! * The maximum value an int can represent is 2147483647 (or ! * 231 - 1). */ public static final int MAX_VALUE = 0x7fffffff; /** ! * The primitive type int is represented by this * Class object. + * @since 1.1 */ ! public static final Class TYPE = VMClassLoader.getPrimitiveClass('I'); /** * The immutable value of this Integer. + * + * @serial the wrapped int */ private final int value; /** ! * Create an Integer object representing the value of the * int argument. * * @param value the value to use *************** public final class Integer extends Numbe *** 88,224 **** } /** ! * Create an Integer object representing the value of the * argument after conversion to an int. * ! * @param s the string to convert. ! */ ! public Integer(String s) throws NumberFormatException ! { ! value = parseInt(s, 10); ! } ! ! /** ! * Return a hashcode representing this Object. ! * ! * Integer's hash code is calculated by simply returning its ! * value. ! * ! * @return this Object's hash code. ! */ ! public int hashCode() ! { ! return value; ! } ! ! /** ! * If the Object is not null, is an ! * instanceof Integer, and represents ! * the same primitive int value return ! * true. Otherwise false is returned. ! */ ! public boolean equals(Object obj) ! { ! return obj instanceof Integer && value == ((Integer)obj).value; ! } ! ! /** ! * Get the specified system property as an Integer. ! * ! * The decode() method will be used to interpret the value of ! * the property. ! * @param nm the name of the system property ! * @return the system property as an Integer, or ! * null if the property is not found or cannot be ! * decoded as an Integer. ! * @see java.lang.System#getProperty(java.lang.String) ! * @see #decode(int) */ ! public static Integer getInteger(String nm) { ! return getInteger(nm, null); } /** ! * Get the specified system property as an Integer, or use a ! * default int value if the property is not found or is not ! * decodable. ! * ! * The decode() method will be used to interpret the value of ! * the property. * ! * @param nm the name of the system property ! * @param val the default value to use if the property is not found or not ! * a number. ! * @return the system property as an Integer, or the default ! * value if the property is not found or cannot be decoded as an ! * Integer. ! * @see java.lang.System#getProperty(java.lang.String) ! * @see #decode(int) ! * @see #getInteger(java.lang.String,java.lang.Integer) */ ! public static Integer getInteger(String nm, int val) { ! Integer result = getInteger(nm, null); ! return (result == null) ? new Integer(val) : result; ! } ! /** ! * Get the specified system property as an Integer, or use a ! * default Integer value if the property is not found or is ! * not decodable. ! * ! * The decode() method will be used to interpret the value of ! * the property. ! * ! * @param nm the name of the system property ! * @param val the default value to use if the property is not found or not ! * a number. ! * @return the system property as an Integer, or the default ! * value if the property is not found or cannot be decoded as an ! * Integer. ! * @see java.lang.System#getProperty(java.lang.String) ! * @see #decode(int) ! * @see #getInteger(java.lang.String,int) ! */ ! public static Integer getInteger(String nm, Integer def) ! { ! if (nm == null || "".equals(nm)) ! return def; ! nm = System.getProperty(nm); ! if (nm == null) return def; ! try ! { ! return decode(nm); ! } ! catch (NumberFormatException e) { ! return def; } - } - private static String toUnsignedString(int num, int exp) - { - // Use an array large enough for a binary number. - int radix = 1 << exp; - int mask = radix - 1; - char[] buffer = new char[32]; - int i = 32; do { ! buffer[--i] = Character.forDigit(num & mask, radix); ! num = num >>> exp; } ! while (num != 0); ! return String.valueOf(buffer, i, 32-i); } /** * Converts the int to a String assuming it is * unsigned in base 16. * @param i the int to convert to String ! * @return the String representation of the argument. */ public static String toHexString(int i) { --- 97,169 ---- } /** ! * Create an Integer object representing the value of the * argument after conversion to an int. * ! * @param s the string to convert ! * @throws NumberFormatException if the String does not contain an int ! * @see #valueOf(String) */ ! public Integer(String s) { ! value = parseInt(s, 10, false); } /** ! * Converts the int to a String using ! * the specified radix (base). If the radix exceeds ! * Character.MIN_RADIX or Character.MAX_RADIX, 10 ! * is used instead. If the result is negative, the leading character is ! * '-' ('\\u002D'). The remaining characters come from ! * Character.forDigit(digit, radix) ('0'-'9','a'-'z'). * ! * @param num the int to convert to String ! * @param radix the radix (base) to use in the conversion ! * @return the String representation of the argument */ ! public static String toString(int num, int radix) { ! if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) ! radix = 10; ! // For negative numbers, print out the absolute value w/ a leading '-'. ! // Use an array large enough for a binary number. ! char[] buffer = new char[33]; ! int i = 33; ! boolean isNeg = false; ! if (num < 0) { ! isNeg = true; ! num = -num; ! ! // When the value is MIN_VALUE, it overflows when made positive ! if (num < 0) ! { ! buffer[--i] = digits[(int) (-(num + radix) % radix)]; ! num = -(num / radix); ! } } do { ! buffer[--i] = digits[num % radix]; ! num /= radix; } ! while (num > 0); ! if (isNeg) ! buffer[--i] = '-'; ! ! // Package constructor avoids an array copy. ! return new String(buffer, i, 33 - i, true); } /** * Converts the int to a String assuming it is * unsigned in base 16. + * * @param i the int to convert to String ! * @return the String representation of the argument */ public static String toHexString(int i) { *************** public final class Integer extends Numbe *** 228,235 **** /** * Converts the int to a String assuming it is * unsigned in base 8. * @param i the int to convert to String ! * @return the String representation of the argument. */ public static String toOctalString(int i) { --- 173,181 ---- /** * Converts the int to a String assuming it is * unsigned in base 8. + * * @param i the int to convert to String ! * @return the String representation of the argument */ public static String toOctalString(int i) { *************** public final class Integer extends Numbe *** 239,246 **** /** * Converts the int to a String assuming it is * unsigned in base 2. * @param i the int to convert to String ! * @return the String representation of the argument. */ public static String toBinaryString(int i) { --- 185,193 ---- /** * Converts the int to a String assuming it is * unsigned in base 2. + * * @param i the int to convert to String ! * @return the String representation of the argument */ public static String toBinaryString(int i) { *************** public final class Integer extends Numbe *** 250,592 **** /** * Converts the int to a String and assumes * a radix of 10. * @param i the int to convert to String ! * @return the String representation of the argument. */ public static String toString(int i) { // This is tricky: in libgcj, String.valueOf(int) is a fast native // implementation. In Classpath it just calls back to ! // Integer.toString(int,int). ! return String.valueOf (i); ! } ! ! /** ! * Converts the Integer value to a String and ! * assumes a radix of 10. ! * @return the String representation of this Integer. ! */ ! public String toString() ! { ! return toString (value); } /** ! * Converts the int to a String using ! * the specified radix (base). ! * @param i the int to convert to String. ! * @param radix the radix (base) to use in the conversion. ! * @return the String representation of the argument. */ ! public static String toString(int num, int radix) { ! if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) ! radix = 10; ! ! // For negative numbers, print out the absolute value w/ a leading '-'. ! // Use an array large enough for a binary number. ! char[] buffer = new char[33]; ! int i = 33; ! boolean isNeg; ! if (num < 0) ! { ! isNeg = true; ! num = -(num); ! ! // When the value is MIN_VALUE, it overflows when made positive ! if (num < 0) ! { ! buffer[--i] = Character.forDigit(-(num + radix) % radix, radix); ! num = -(num / radix); ! } ! } ! else ! isNeg = false; ! ! do ! { ! buffer[--i] = Character.forDigit(num % radix, radix); ! num /= radix; ! } ! while (num > 0); ! ! if (isNeg) ! buffer[--i] = '-'; ! ! return String.valueOf(buffer, i, 33-i); } /** ! * Creates a new Integer object using the String, ! * assuming a radix of 10. ! * @param s the String to convert. ! * @return the new Integer. ! * @see #Integer(java.lang.String) ! * @see #parseInt(java.lang.String) ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as an int. */ ! public static Integer valueOf(String s) throws NumberFormatException { ! return new Integer(parseInt(s)); } /** * Creates a new Integer object using the String * and specified radix (base). ! * @param s the String to convert. ! * @param radix the radix (base) to convert with. ! * @return the new Integer. ! * @see #parseInt(java.lang.String,int) ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as an int. */ public static Integer valueOf(String s, int radix) - throws NumberFormatException { ! return new Integer(parseInt(s, radix)); } /** ! * Converts the specified String into an int. ! * This function assumes a radix of 10. * * @param s the String to convert ! * @return the int value of the String ! * argument. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as an int. */ ! public static int parseInt(String s) throws NumberFormatException { ! return parseInt(s, 10); } /** ! * Converts the specified String into an int ! * using the specified radix (base). * ! * @param s the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to int. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a int. */ ! public static int parseInt(String str, int radix) ! throws NumberFormatException { ! final int len; ! ! if (str == null) ! throw new NumberFormatException (); ! ! if ((len = str.length()) == 0 || ! radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) ! throw new NumberFormatException(); ! ! boolean isNeg = false; ! int index = 0; ! if (str.charAt(index) == '-') ! if (len > 1) ! { ! isNeg = true; ! index++; ! } ! else ! throw new NumberFormatException(); ! ! return parseInt(str, index, len, isNeg, radix); } ! private static int parseInt(String str, int index, int len, boolean isNeg, ! int radix) ! throws NumberFormatException { ! int val = 0; ! int digval; ! ! int max = MAX_VALUE / radix; ! // We can't directly write `max = (MAX_VALUE + 1) / radix'. ! // So instead we fake it. ! if (isNeg && MAX_VALUE % radix == radix - 1) ! ++max; ! ! for ( ; index < len; index++) ! { ! if (val < 0 || val > max) ! throw new NumberFormatException(); ! ! if ((digval = Character.digit(str.charAt(index), radix)) < 0) ! throw new NumberFormatException(); ! ! // Throw an exception for overflow if result is negative. ! // However, we special-case the most negative value. ! val = val * radix + digval; ! if (val < 0 && (! isNeg || val != MIN_VALUE)) ! throw new NumberFormatException(); ! } ! return isNeg ? -(val) : val; } /** ! * Convert the specified String into an Integer. ! * The String may represent decimal, hexadecimal, or ! * octal numbers. ! * ! * The String argument is interpreted based on the leading ! * characters. Depending on what the String begins with (after an optional ! * minus sign), the base will be interpreted differently: ! * ! * ! * ! * ! * ! * ! * ! * ! *
        Leading
        Characters
        Base
        #16
        0x16
        0X16
        08
        Anything
        Else
        10
        ! * ! * If the String starts with a minus sign the result is negated. * ! * @param str the String to interpret. ! * @return the value of the String as an Integer. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as an int. */ ! public static Integer decode(String str) throws NumberFormatException { ! boolean isNeg = false; ! int index = 0; ! int radix = 10; ! final int len; ! ! if ((len = str.length()) == 0) ! throw new NumberFormatException("empty string"); ! ! if (str.charAt(index) == '-') ! { ! // The minus sign should be followed by at least one more char ! if (len > 1) ! { ! isNeg = true; ! index++; ! } ! else ! throw new NumberFormatException(); ! } ! ! if (str.charAt(index) == '#') ! { ! radix = 16; ! index++; ! } ! else if (str.charAt(index) == '0') ! { ! index++; ! ! // Check if str is just "0" or "-0" ! if (len == index) ! return new Integer(0); ! if (str.charAt(index) == 'x' || str.charAt(index) == 'X') ! { ! radix = 16; ! index++; ! } ! else ! radix = 8; ! } ! if (index >= len) ! throw new NumberFormatException("empty value"); ! return new Integer(parseInt(str, index, len, isNeg, radix)); } ! /** Return the value of this Integer as a byte. ! ** @return the value of this Integer as a byte. ! **/ ! public byte byteValue() { ! return (byte) value; } ! /** Return the value of this Integer as a short. ! ** @return the value of this Integer as a short. ! **/ ! public short shortValue() { ! return (short) value; } ! /** Return the value of this Integer as an int. ! ** @return the value of this Integer as an int. ! **/ ! public int intValue() { ! return value; } ! /** Return the value of this Integer as a long. ! ** @return the value of this Integer as a long. ! **/ ! public long longValue() { ! return value; } ! /** Return the value of this Integer as a float. ! ** @return the value of this Integer as a float. ! **/ ! public float floatValue() { ! return value; } ! /** Return the value of this Integer as a double. ! ** @return the value of this Integer as a double. ! **/ ! public double doubleValue() { ! return value; } /** ! * Compare two Integers numerically by comparing their ! * int values. ! * @return a positive value if this Integer is greater ! * in value than the argument Integer; a negative value ! * if this Integer is smaller in value than the argument ! * Integer; and 0, zero, if this ! * Integer is equal in value to the argument ! * Integer. * * @since 1.2 */ public int compareTo(Integer i) { ! if (this.value == i.value) return 0; - // Returns just -1 or 1 on inequality; doing math might overflow. ! if (this.value > i.value) ! return 1; ! ! return -1; } /** ! * Behaves like compareTo(java.lang.Integer) unless the Object ! * is not a Integer. Then it throws a ! * ClassCastException. ! * @exception ClassCastException if the argument is not a ! * Integer. * * @since 1.2 */ public int compareTo(Object o) { ! return compareTo((Integer)o); } } --- 197,606 ---- /** * Converts the int to a String and assumes * a radix of 10. + * * @param i the int to convert to String ! * @return the String representation of the argument ! * @see #toString(int, int) */ public static String toString(int i) { // This is tricky: in libgcj, String.valueOf(int) is a fast native // implementation. In Classpath it just calls back to ! // Integer.toString(int, int). ! return String.valueOf(i); } /** ! * Converts the specified String into an int ! * using the specified radix (base). The string must not be null ! * or empty. It may begin with an optional '-', which will negate the answer, ! * provided that there are also valid digits. Each digit is parsed as if by ! * Character.digit(d, radix), and must be in the range ! * 0 to radix - 1. Finally, the result must be ! * within MIN_VALUE to MAX_VALUE, inclusive. ! * Unlike Double.parseDouble, you may not have a leading '+'. ! * ! * @param s the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to int ! * @throws NumberFormatException if s cannot be parsed as an ! * int */ ! public static int parseInt(String str, int radix) { ! return parseInt(str, radix, false); } /** ! * Converts the specified String into an int. ! * This function assumes a radix of 10. ! * ! * @param s the String to convert ! * @return the int value of s ! * @throws NumberFormatException if s cannot be parsed as an ! * int ! * @see #parseInt(String, int) */ ! public static int parseInt(String s) { ! return parseInt(s, 10, false); } /** * Creates a new Integer object using the String * and specified radix (base). ! * ! * @param s the String to convert ! * @param radix the radix (base) to convert with ! * @return the new Integer ! * @throws NumberFormatException if s cannot be parsed as an ! * int ! * @see #parseInt(String, int) */ public static Integer valueOf(String s, int radix) { ! return new Integer(parseInt(s, radix, false)); } /** ! * Creates a new Integer object using the String, ! * assuming a radix of 10. * * @param s the String to convert ! * @return the new Integer ! * @throws NumberFormatException if s cannot be parsed as an ! * int ! * @see #Integer(String) ! * @see #parseInt(String) */ ! public static Integer valueOf(String s) { ! return new Integer(parseInt(s, 10, false)); } /** ! * Return the value of this Integer as a byte. * ! * @return the byte value */ ! public byte byteValue() { ! return (byte) value; } ! /** ! * Return the value of this Integer as a short. ! * ! * @return the short value ! */ ! public short shortValue() { ! return (short) value; ! } ! /** ! * Return the value of this Integer. ! * @return the int value ! */ ! public int intValue() ! { ! return value; } /** ! * Return the value of this Integer as a long. * ! * @return the long value */ ! public long longValue() { ! return value; ! } ! /** ! * Return the value of this Integer as a float. ! * ! * @return the float value ! */ ! public float floatValue() ! { ! return value; ! } ! /** ! * Return the value of this Integer as a double. ! * ! * @return the double value ! */ ! public double doubleValue() ! { ! return value; ! } ! /** ! * Converts the Integer value to a String and ! * assumes a radix of 10. ! * ! * @return the String representation ! */ ! public String toString() ! { ! return String.valueOf(value); } ! /** ! * Return a hashcode representing this Object. Integer's hash ! * code is simply its value. ! * ! * @return this Object's hash code ! */ ! public int hashCode() { ! return value; } ! /** ! * Returns true if obj is an instance of ! * Integer and represents the same int value. ! * ! * @param obj the object to compare ! * @return whether these Objects are semantically equal ! */ ! public boolean equals(Object obj) { ! return obj instanceof Integer && value == ((Integer) obj).value; } ! /** ! * Get the specified system property as an Integer. The ! * decode() method will be used to interpret the value of ! * the property. ! * ! * @param nm the name of the system property ! * @return the system property as an Integer, or null if the ! * property is not found or cannot be decoded ! * @throws SecurityException if accessing the system property is forbidden ! * @see System#getProperty(String) ! * @see #decode(String) ! */ ! public static Integer getInteger(String nm) { ! return getInteger(nm, null); } ! /** ! * Get the specified system property as an Integer, or use a ! * default int value if the property is not found or is not ! * decodable. The decode() method will be used to interpret ! * the value of the property. ! * ! * @param nm the name of the system property ! * @param val the default value ! * @return the value of the system property, or the default ! * @throws SecurityException if accessing the system property is forbidden ! * @see System#getProperty(String) ! * @see #decode(String) ! */ ! public static Integer getInteger(String nm, int val) { ! Integer result = getInteger(nm, null); ! return result == null ? new Integer(val) : result; } ! /** ! * Get the specified system property as an Integer, or use a ! * default Integer value if the property is not found or is ! * not decodable. The decode() method will be used to ! * interpret the value of the property. ! * ! * @param nm the name of the system property ! * @param val the default value ! * @return the value of the system property, or the default ! * @throws SecurityException if accessing the system property is forbidden ! * @see System#getProperty(String) ! * @see #decode(String) ! */ ! public static Integer getInteger(String nm, Integer def) { ! if (nm == null || "".equals(nm)) ! return def; ! nm = System.getProperty(nm); ! if (nm == null) ! return def; ! try ! { ! return decode(nm); ! } ! catch (NumberFormatException e) ! { ! return def; ! } } ! /** ! * Convert the specified String into an Integer. ! * The String may represent decimal, hexadecimal, or ! * octal numbers. ! * ! *

        The extended BNF grammar is as follows:
        ! *

        !    * DecodableString:
        !    *      ( [ - ] DecimalNumber )
        !    *    | ( [ - ] ( 0x | 0X
        !    *              | # ) HexDigit { HexDigit } )
        !    *    | ( [ - ] 0 { OctalDigit } )
        !    * DecimalNumber:
        !    *        DecimalDigit except '0' { DecimalDigit }
        !    * DecimalDigit:
        !    *        Character.digit(d, 10) has value 0 to 9
        !    * OctalDigit:
        !    *        Character.digit(d, 8) has value 0 to 7
        !    * DecimalDigit:
        !    *        Character.digit(d, 16) has value 0 to 15
        !    * 
        ! * Finally, the value must be in the range MIN_VALUE to ! * MAX_VALUE, or an exception is thrown. ! * ! * @param s the String to interpret ! * @return the value of the String as an Integer ! * @throws NumberFormatException if s cannot be parsed as a ! * int ! * @throws NullPointerException if s is null ! * @since 1.2 ! */ ! public static Integer decode(String str) { ! return new Integer(parseInt(str, 10, true)); } /** ! * Compare two Integers numerically by comparing their int ! * values. The result is positive if the first is greater, negative if the ! * second is greater, and 0 if the two are equal. * + * @param i the Integer to compare + * @return the comparison * @since 1.2 */ public int compareTo(Integer i) { ! if (value == i.value) return 0; // Returns just -1 or 1 on inequality; doing math might overflow. ! return value > i.value ? 1 : -1; } /** ! * Behaves like compareTo(Integer) unless the Object ! * is not an Integer. * + * @param o the object to compare + * @return the comparison + * @throws ClassCastException if the argument is not an Integer + * @see #compareTo(Integer) + * @see Comparable * @since 1.2 */ public int compareTo(Object o) { ! return compareTo((Integer) o); ! } ! ! /** ! * Helper for converting unsigned numbers to String. ! * ! * @param num the number ! * @param exp log2(digit) (ie. 1, 3, or 4 for binary, oct, hex) ! */ ! // Package visible for use by Long. ! static String toUnsignedString(int num, int exp) ! { ! // Use an array large enough for a binary number. ! int mask = (1 << exp) - 1; ! char[] buffer = new char[32]; ! int i = 32; ! do ! { ! buffer[--i] = digits[num & mask]; ! num >>>= exp; ! } ! while (num != 0); ! ! // Package constructor avoids an array copy. ! return new String(buffer, i, 32 - i, true); ! } ! ! /** ! * Helper for parsing ints, used by Integer, Short, and Byte. ! * ! * @param str the string to parse ! * @param radix the radix to use, must be 10 if decode is true ! * @param decode if called from decode ! * @return the parsed int value ! * @throws NumberFormatException if there is an error ! * @throws NullPointerException if decode is true and str if null ! * @see #parseInt(String, int) ! * @see #decode(String) ! * @see Byte#parseInt(String, int) ! * @see Short#parseInt(String, int) ! */ ! static int parseInt(String str, int radix, boolean decode) ! { ! if (! decode && str == null) ! throw new NumberFormatException(); ! int index = 0; ! int len = str.length(); ! boolean isNeg = false; ! if (len == 0) ! throw new NumberFormatException(); ! int ch = str.charAt(index); ! if (ch == '-') ! { ! if (len == 1) ! throw new NumberFormatException(); ! isNeg = true; ! ch = str.charAt(++index); ! } ! if (decode) ! { ! if (ch == '0') ! { ! if (++index == len) ! return 0; ! if ((str.charAt(index) & ~('x' ^ 'X')) == 'X') ! { ! radix = 16; ! index++; ! } ! else ! radix = 8; ! } ! else if (ch == '#') ! { ! radix = 16; ! index++; ! } ! } ! if (index == len) ! throw new NumberFormatException(); ! ! int max = MAX_VALUE / radix; ! // We can't directly write `max = (MAX_VALUE + 1) / radix'. ! // So instead we fake it. ! if (isNeg && MAX_VALUE % radix == radix - 1) ! ++max; ! ! int val = 0; ! while (index < len) ! { ! if (val < 0 || val > max) ! throw new NumberFormatException(); ! ! ch = Character.digit(str.charAt(index++), radix); ! val = val * radix + ch; ! if (ch < 0 || (val < 0 && (! isNeg || val != MIN_VALUE))) ! throw new NumberFormatException(); ! } ! return isNeg ? -val : val; } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/InternalError.java gcc-3.3/libjava/java/lang/InternalError.java *** gcc-3.2.3/libjava/java/lang/InternalError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/InternalError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* InternalError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InternalError.java -- thrown when the VM encounters an internal error ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,76 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * An InternalError is thrown when a mystical error has * occurred in the Java Virtual Machine. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class InternalError extends VirtualMachineError { ! static final long serialVersionUID = -9062593416125562365L; /** * Create an error without a message. */ public InternalError() ! { ! super(); ! } /** * Create an error with a message. */ public InternalError(String s) ! { ! super(s); ! } } --- 38,72 ---- package java.lang; /** * An InternalError is thrown when a mystical error has * occurred in the Java Virtual Machine. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class InternalError extends VirtualMachineError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -9062593416125562365L; /** * Create an error without a message. */ public InternalError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public InternalError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/InterruptedException.java gcc-3.3/libjava/java/lang/InterruptedException.java *** gcc-3.2.3/libjava/java/lang/InterruptedException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/InterruptedException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,7 **** ! /* InterruptedException.java -- exception thrown when a thread interrupts ! another thread which was previously sleeping, waiting, or paused in some ! other way. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InterruptedException.java -- thrown when a thread is interrupted ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 9,15 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 40,81 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * Thrown when a thread interrupts another thread which was previously ! * sleeping, waiting, or paused in some other way. See the * interrupt method of class Thread. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class InterruptedException extends Exception { ! static final long serialVersionUID = 6700697376100628473L; /** * Create an exception without a message. */ public InterruptedException() ! { ! super(); ! } /** * Create an exception with a message. */ public InterruptedException(String s) ! { ! super(s); ! } } --- 38,80 ---- package java.lang; /** ! * Thrown when a thread interrupts another thread which was previously ! * sleeping, waiting, or paused in some other way. See the * interrupt method of class Thread. * * @author Brian Jones * @author Warren Levy ! * @see Object#wait() ! * @see Object#wait(long) ! * @see Object#wait(long, int) ! * @see Thread#sleep(long) ! * @see Thread#interrupt() ! * @see Thread#interrupted() ! * @status updated to 1.4 */ public class InterruptedException extends Exception { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 6700697376100628473L; /** * Create an exception without a message. */ public InterruptedException() ! { ! } /** * Create an exception with a message. + * + * + * @param s the message */ public InterruptedException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/LinkageError.java gcc-3.3/libjava/java/lang/LinkageError.java *** gcc-3.2.3/libjava/java/lang/LinkageError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/LinkageError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* LinkageError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* LinkageError.java -- thrown when classes valid at separate compile times ! cannot be linked to each other ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,77 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Subclasses of LinkageError are thrown to indicate ! * a class which is depended upon by another class has incompatibly ! * changed after the compilation of the latter class. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class LinkageError extends Error { ! static final long serialVersionUID = 3579600108157160122L; /** * Create an error without a message. */ public LinkageError() ! { ! super(); ! } /** * Create an error with a message. */ public LinkageError(String s) ! { ! super(s); ! } } --- 39,74 ---- package java.lang; /** ! * Subclasses of LinkageError are thrown to indicate that two ! * classes which were compatible at separate compilation times cannot be ! * linked to one another. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class LinkageError extends Error { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 3579600108157160122L; /** * Create an error without a message. */ public LinkageError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public LinkageError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Long.java gcc-3.3/libjava/java/lang/Long.java *** gcc-3.2.3/libjava/java/lang/Long.java 2002-04-03 08:23:48.000000000 +0000 --- gcc-3.3/libjava/java/lang/Long.java 2002-06-13 18:16:25.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.Long ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Long.java -- object wrapper for long ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,46 **** package java.lang; /** ! * Instances of class Double represent primitive ! * double values. * * Additionally, this class provides various helper functions and variables * related to longs. --- 39,46 ---- package java.lang; /** ! * Instances of class Long represent primitive ! * long values. * * Additionally, this class provides various helper functions and variables * related to longs. *************** package java.lang; *** 48,85 **** * @author Paul Fisher * @author John Keiser * @author Warren Levy ! * @since JDK 1.0 */ public final class Long extends Number implements Comparable { ! // compatible with JDK 1.0.2+ ! static final long serialVersionUID = 4290774380558885855L; /** * The minimum value a long can represent is ! * -9223372036854775808. */ public static final long MIN_VALUE = 0x8000000000000000L; /** * The maximum value a long can represent is ! * 9223372036854775807. */ public static final long MAX_VALUE = 0x7fffffffffffffffL; /** ! * The primitive type long is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass ('J'); /** * The immutable value of this Long. */ private final long value; /** ! * Create a Long object representing the value of the * long argument. * * @param value the value to use --- 48,92 ---- * @author Paul Fisher * @author John Keiser * @author Warren Levy ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ public final class Long extends Number implements Comparable { ! /** ! * Compatible with JDK 1.0.2+. ! */ ! private static final long serialVersionUID = 4290774380558885855L; /** * The minimum value a long can represent is ! * -9223372036854775808L (or -263). */ public static final long MIN_VALUE = 0x8000000000000000L; /** * The maximum value a long can represent is ! * 9223372036854775807 (or 263 - 1). */ public static final long MAX_VALUE = 0x7fffffffffffffffL; /** ! * The primitive type long is represented by this * Class object. + * @since 1.1 */ public static final Class TYPE = VMClassLoader.getPrimitiveClass ('J'); /** * The immutable value of this Long. + * + * @serial the wrapped long */ private final long value; /** ! * Create a Long object representing the value of the * long argument. * * @param value the value to use *************** public final class Long extends Number i *** 90,593 **** } /** ! * Create a Long object representing the value of the * argument after conversion to a long. * ! * @param s the string to convert. */ ! public Long(String s) throws NumberFormatException { ! value = parseLong(s, 10); } /** ! * If the Object is not null, is an ! * instanceof Long, and represents ! * the same primitive long value return ! * true. Otherwise false is returned. */ ! public boolean equals(Object obj) { ! return obj instanceof Long && ((Long)obj).value == value; } /** ! * Return a hashcode representing this Object. * ! * Long's hash code is calculated by simply returning its ! * value. * ! * @return this Object's hash code. */ ! public int hashCode() { ! return (int)(value^(value>>>32)); } /** ! * Get the specified system property as a Long. * ! * A method similar to Integer's decode() will be ! * used to interpret the value of the property. ! * ! * @param nm the name of the system property ! * @return the system property as an Long, or ! * null if the property is not found or cannot be ! * decoded as a Long. ! * @see java.lang.System#getProperty(java.lang.String) ! * @see java.lang.Integer#decode(int) */ ! public static Long getLong(String nm) { ! return getLong(nm, null); } /** ! * Get the specified system property as an Long, or use a ! * default long value if the property is not found or is not ! * decodable. ! * ! * A method similar to Integer's decode() will be ! * used to interpret the value of the property. ! * ! * @param nm the name of the system property ! * @param val the default value to use if the property is not found or not ! * a number. ! * @return the system property as a Long, or the default ! * value if the property is not found or cannot be decoded as a ! * Long. ! * @see java.lang.System#getProperty(java.lang.String) ! * @see java.lang.Integer#decode(int) ! * @see #getLong(java.lang.String,java.lang.Long) */ ! public static Long getLong(String nm, long val) { ! Long result = getLong(nm, null); ! return (result == null) ? new Long(val) : result; } /** ! * Get the specified system property as an Long, or use a ! * default Long value if the property is not found or is ! * not decodable. ! * ! * The decode() method will be used to interpret the value of ! * the property. * ! * @param nm the name of the system property ! * @param val the default value to use if the property is not found or not ! * a number. ! * @return the system property as an Long, or the default ! * value if the property is not found or cannot be decoded as an ! * Long. ! * @see java.lang.System#getProperty(java.lang.String) ! * @see java.lang.Integer#decode(int) ! * @see #getLong(java.lang.String,long) */ ! public static Long getLong(String nm, Long def) { ! nm = System.getProperty(nm); ! if (nm == null || "".equals(nm)) ! return def; ! try ! { ! return decode(nm); ! } ! catch (NumberFormatException e) ! { ! return def; ! } } ! private static String toUnsignedString(long num, int exp) { ! // Use an array large enough for a binary number. ! int radix = 1 << exp; ! int mask = radix - 1; ! char[] buffer = new char[64]; ! int i = 64; ! do ! { ! buffer[--i] = Character.forDigit((int) num & mask, radix); ! num = num >>> exp; ! } ! while (num != 0); ! return String.valueOf(buffer, i, 64-i); } /** ! * Converts the long to a String assuming it is ! * unsigned in base 16. ! * @param i the long to convert to String ! * @return the String representation of the argument. */ ! public static String toHexString(long i) { ! return toUnsignedString(i, 4); } /** ! * Converts the long to a String assuming it is ! * unsigned in base 8. ! * @param i the long to convert to String ! * @return the String representation of the argument. */ ! public static String toOctalString(long i) { ! return toUnsignedString(i, 3); } /** ! * Converts the long to a String assuming it is ! * unsigned in base 2. ! * @param i the long to convert to String ! * @return the String representation of the argument. */ ! public static String toBinaryString(long i) { ! return toUnsignedString(i, 1); } /** ! * Converts the long to a String and assumes ! * a radix of 10. ! * @param num the long to convert to String ! * @return the String representation of the argument. ! */ ! public static String toString(long num) { ! // Use the Integer toString for efficiency if possible. ! if (num <= Integer.MAX_VALUE && num >= Integer.MIN_VALUE) ! return Integer.toString((int) num); ! // Use an array large enough for "-9223372036854775808"; i.e. 20 chars. ! char[] buffer = new char[20]; ! int i = 20; ! boolean isNeg; ! if (num < 0) ! { ! isNeg = true; ! num = -(num); ! if (num < 0) ! { ! // Must be MIN_VALUE, so handle this special case. ! buffer[--i] = '8'; ! num = 922337203685477580L; ! } ! } ! else ! isNeg = false; ! do ! { ! buffer[--i] = (char) ((int) '0' + (num % 10)); ! num /= 10; ! } ! while (num > 0); ! if (isNeg) ! buffer[--i] = '-'; ! return String.valueOf(buffer, i, 20-i); } /** * Converts the Long value to a String and * assumes a radix of 10. ! * @return the String representation of this Long. ! */ public String toString() { ! return toString(value); } ! /** ! * Converts the long to a String using ! * the specified radix (base). ! * @param num the long to convert to String. ! * @param radix the radix (base) to use in the conversion. ! * @return the String representation of the argument. */ ! public static String toString(long num, int radix) { ! // Use optimized method for the typical case. ! if (radix == 10 || ! radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) ! return toString(num); ! ! // Use the Integer toString for efficiency if possible. ! if (num <= Integer.MAX_VALUE && num >= Integer.MIN_VALUE) ! return Integer.toString((int) num, radix); ! ! // For negative numbers, print out the absolute value w/ a leading '-'. ! // Use an array large enough for a binary number. ! char[] buffer = new char[65]; ! int i = 65; ! boolean isNeg; ! if (num < 0) ! { ! isNeg = true; ! num = -(num); ! ! // When the value is MIN_VALUE, it overflows when made positive ! if (num < 0) ! { ! buffer[--i] = Character.forDigit((int) (-(num + radix) % radix), ! radix); ! num = -(num / radix); ! } ! } ! else ! isNeg = false; ! ! do ! { ! buffer[--i] = Character.forDigit((int) (num % radix), radix); ! num /= radix; ! } ! while (num > 0); ! if (isNeg) ! buffer[--i] = '-'; ! return String.valueOf(buffer, i, 65-i); } ! /** ! * Creates a new Long object using the String, ! * assuming a radix of 10. ! * @param s the String to convert. ! * @return the new Long. ! * @see #Long(java.lang.String) ! * @see #parseLong(java.lang.String) ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a long. */ ! public static Long valueOf(String s) throws NumberFormatException { ! return new Long(parseLong(s)); } /** ! * Creates a new Long object using the String ! * and specified radix (base). ! * @param s the String to convert. ! * @param radix the radix (base) to convert with. ! * @return the new Long. ! * @see #parseLong(java.lang.String,int) ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a long. */ ! public static Long valueOf(String s, int radix) throws NumberFormatException { ! return new Long(parseLong(s, radix)); } /** ! * Converts the specified String into a long. ! * This function assumes a radix of 10. * ! * @param s the String to convert ! * @return the long value of the String ! * argument. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a long. */ ! public static long parseLong(String s) throws NumberFormatException { ! return parseLong(s, 10); } /** ! * Converts the specified String into a long ! * using the specified radix (base). * ! * @param s the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to long. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a long. */ ! public static long parseLong(String str, int radix) ! throws NumberFormatException { ! final int len; ! if ((len = str.length()) == 0 || radix < Character.MIN_RADIX ! || radix > Character.MAX_RADIX) ! throw new NumberFormatException(); ! boolean isNeg = false; ! int index = 0; ! if (str.charAt(index) == '-') ! if (len > 1) ! { ! isNeg = true; ! index++; ! } ! else ! throw new NumberFormatException(); ! return parseLong(str, index, len, isNeg, radix); } ! public static Long decode(String str) throws NumberFormatException { ! boolean isNeg = false; int index = 0; ! int radix = 10; ! final int len; ! ! if ((len = str.length()) == 0) throw new NumberFormatException(); ! ! // Negative numbers are always radix 10. ! if (str.charAt(0) == '-') { ! radix = 10; ! index++; isNeg = true; } ! else if (str.charAt(index) == '#') ! { ! radix = 16; ! index++; ! } ! else if (str.charAt(index) == '0') { ! // Check if str is just "0" ! if (len == 1) ! return new Long(0L); ! ! index++; ! if (str.charAt(index) == 'x') { radix = 16; index++; } - else - radix = 8; } ! ! if (index >= len) throw new NumberFormatException(); - return new Long(parseLong(str, index, len, isNeg, radix)); - } - - private static long parseLong(String str, int index, int len, boolean isNeg, - int radix) throws NumberFormatException - { - long val = 0; - int digval; - long max = MAX_VALUE / radix; // We can't directly write `max = (MAX_VALUE + 1) / radix'. // So instead we fake it. if (isNeg && MAX_VALUE % radix == radix - 1) ++max; ! for ( ; index < len; index++) { if (val < 0 || val > max) throw new NumberFormatException(); ! if ((digval = Character.digit(str.charAt(index), radix)) < 0) throw new NumberFormatException(); - - // Throw an exception for overflow if result is negative. - // However, we special-case the most negative value. - val = val * radix + digval; - if (val < 0 && (! isNeg || val != MIN_VALUE)) - throw new NumberFormatException(); } ! ! return isNeg ? -(val) : val; ! } ! ! /** Return the value of this Long as an short. ! ** @return the value of this Long as an short. ! **/ ! public byte byteValue() ! { ! return (byte) value; ! } ! ! /** Return the value of this Long as an short. ! ** @return the value of this Long as an short. ! **/ ! public short shortValue() ! { ! return (short) value; ! } ! ! /** Return the value of this Long as an int. ! ** @return the value of this Long as an int. ! **/ ! public int intValue() ! { ! return (int) value; ! } ! ! /** Return the value of this Long as a long. ! ** @return the value of this Long as a long. ! **/ ! public long longValue() ! { ! return value; ! } ! ! /** Return the value of this Long as a float. ! ** @return the value of this Long as a float. ! **/ ! public float floatValue() ! { ! return value; ! } ! ! /** Return the value of this Long as a double. ! ** @return the value of this Long as a double. ! **/ ! public double doubleValue() ! { ! return value; ! } ! ! /** ! * Compare two Longs numerically by comparing their ! * long values. ! * @return a positive value if this Long is greater ! * in value than the argument Long; a negative value ! * if this Long is smaller in value than the argument ! * Long; and 0, zero, if this ! * Long is equal in value to the argument ! * Long. ! * ! * @since 1.2 ! */ ! public int compareTo(Long l) ! { ! if (this.value == l.value) ! return 0; ! ! // Returns just -1 or 1 on inequality; doing math might overflow the long. ! if (this.value > l.value) ! return 1; ! ! return -1; ! } ! ! /** ! * Behaves like compareTo(java.lang.Long) unless the Object ! * is not a Long. Then it throws a ! * ClassCastException. ! * @exception ClassCastException if the argument is not a ! * Long. ! * ! * @since 1.2 ! */ ! public int compareTo(Object o) ! { ! return compareTo((Long)o); } } --- 97,614 ---- } /** ! * Create a Long object representing the value of the * argument after conversion to a long. * ! * @param s the string to convert ! * @throws NumberFormatException if the String does not contain a long ! * @see #valueOf(String) */ ! public Long(String s) { ! value = parseLong(s, 10, false); } /** ! * Converts the long to a String using ! * the specified radix (base). If the radix exceeds ! * Character.MIN_RADIX or Character.MAX_RADIX, 10 ! * is used instead. If the result is negative, the leading character is ! * '-' ('\\u002D'). The remaining characters come from ! * Character.forDigit(digit, radix) ('0'-'9','a'-'z'). ! * ! * @param num the long to convert to String ! * @param radix the radix (base) to use in the conversion ! * @return the String representation of the argument */ ! public static String toString(long num, int radix) { ! // Use the Integer toString for efficiency if possible. ! if ((int) num == num) ! return Integer.toString((int) num, radix); ! ! if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) ! radix = 10; ! ! // For negative numbers, print out the absolute value w/ a leading '-'. ! // Use an array large enough for a binary number. ! char[] buffer = new char[65]; ! int i = 65; ! boolean isNeg = false; ! if (num < 0) ! { ! isNeg = true; ! num = -num; ! ! // When the value is MIN_VALUE, it overflows when made positive ! if (num < 0) ! { ! buffer[--i] = digits[(int) (-(num + radix) % radix)]; ! num = -(num / radix); ! } ! } ! ! do ! { ! buffer[--i] = digits[(int) (num % radix)]; ! num /= radix; ! } ! while (num > 0); ! ! if (isNeg) ! buffer[--i] = '-'; ! ! // Package constructor avoids an array copy. ! return new String(buffer, i, 65 - i, true); } /** ! * Converts the long to a String assuming it is ! * unsigned in base 16. * ! * @param l the long to convert to String ! * @return the String representation of the argument ! */ ! public static String toHexString(long l) ! { ! return toUnsignedString(l, 4); ! } ! ! /** ! * Converts the long to a String assuming it is ! * unsigned in base 8. * ! * @param l the long to convert to String ! * @return the String representation of the argument */ ! public static String toOctalString(long l) { ! return toUnsignedString(l, 3); } /** ! * Converts the long to a String assuming it is ! * unsigned in base 2. * ! * @param l the long to convert to String ! * @return the String representation of the argument */ ! public static String toBinaryString(long l) { ! return toUnsignedString(l, 1); } /** ! * Converts the long to a String and assumes ! * a radix of 10. ! * ! * @param num the long to convert to String ! * @return the String representation of the argument ! * @see #toString(long, int) */ ! public static String toString(long num) { ! return toString(num, 10); } /** ! * Converts the specified String into an int ! * using the specified radix (base). The string must not be null ! * or empty. It may begin with an optional '-', which will negate the answer, ! * provided that there are also valid digits. Each digit is parsed as if by ! * Character.digit(d, radix), and must be in the range ! * 0 to radix - 1. Finally, the result must be ! * within MIN_VALUE to MAX_VALUE, inclusive. ! * Unlike Double.parseDouble, you may not have a leading '+'; and 'l' or ! * 'L' as the last character is only valid in radices 22 or greater, where ! * it is a digit and not a type indicator. * ! * @param s the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to long ! * @throws NumberFormatException if s cannot be parsed as a ! * long */ ! public static long parseLong(String str, int radix) { ! return parseLong(str, radix, false); } ! /** ! * Converts the specified String into a long. ! * This function assumes a radix of 10. ! * ! * @param s the String to convert ! * @return the int value of s ! * @throws NumberFormatException if s cannot be parsed as a ! * long ! * @see #parseLong(String, int) ! */ ! public static long parseLong(String s) { ! return parseLong(s, 10, false); ! } ! /** ! * Creates a new Long object using the String ! * and specified radix (base). ! * ! * @param s the String to convert ! * @param radix the radix (base) to convert with ! * @return the new Long ! * @throws NumberFormatException if s cannot be parsed as a ! * long ! * @see #parseLong(String, int) ! */ ! public static Long valueOf(String s, int radix) ! { ! return new Long(parseLong(s, radix, false)); } /** ! * Creates a new Long object using the String, ! * assuming a radix of 10. ! * ! * @param s the String to convert ! * @return the new Long ! * @throws NumberFormatException if s cannot be parsed as a ! * long ! * @see #Long(String) ! * @see #parseLong(String) */ ! public static Long valueOf(String s) { ! return new Long(parseLong(s, 10, false)); } /** ! * Convert the specified String into a Long. ! * The String may represent decimal, hexadecimal, or ! * octal numbers. ! * ! *

        The extended BNF grammar is as follows:
        ! *

        !    * DecodableString:
        !    *      ( [ - ] DecimalNumber )
        !    *    | ( [ - ] ( 0x | 0X
        !    *              | # ) HexDigit { HexDigit } )
        !    *    | ( [ - ] 0 { OctalDigit } )
        !    * DecimalNumber:
        !    *        DecimalDigit except '0' { DecimalDigit }
        !    * DecimalDigit:
        !    *        Character.digit(d, 10) has value 0 to 9
        !    * OctalDigit:
        !    *        Character.digit(d, 8) has value 0 to 7
        !    * DecimalDigit:
        !    *        Character.digit(d, 16) has value 0 to 15
        !    * 
        ! * Finally, the value must be in the range MIN_VALUE to ! * MAX_VALUE, or an exception is thrown. Note that you cannot ! * use a trailing 'l' or 'L', unlike in Java source code. ! * ! * @param s the String to interpret ! * @return the value of the String as a Long ! * @throws NumberFormatException if s cannot be parsed as a ! * long ! * @throws NullPointerException if s is null ! * @since 1.2 */ ! public static Long decode(String str) { ! return new Long(parseLong(str, 10, true)); } /** ! * Return the value of this Long as a byte. ! * ! * @return the byte value */ ! public byte byteValue() ! { ! return (byte) value; } /** ! * Return the value of this Long as a short. ! * ! * @return the short value ! */ ! public short shortValue() { ! return (short) value; ! } ! /** ! * Return the value of this Long as an int. ! * ! * @return the int value ! */ ! public int intValue() ! { ! return (int) value; ! } ! /** ! * Return the value of this Long. ! * ! * @return the long value ! */ ! public long longValue() ! { ! return value; ! } ! /** ! * Return the value of this Long as a float. ! * ! * @return the float value ! */ ! public float floatValue() ! { ! return value; ! } ! /** ! * Return the value of this Long as a double. ! * ! * @return the double value ! */ ! public double doubleValue() ! { ! return value; } /** * Converts the Long value to a String and * assumes a radix of 10. ! * ! * @return the String representation ! */ public String toString() { ! return toString(value, 10); } ! /** ! * Return a hashcode representing this Object. Long's hash ! * code is calculated by (int) (value ^ (value >> 32)). ! * ! * @return this Object's hash code */ ! public int hashCode() { ! return (int) (value ^ (value >>> 32)); ! } ! /** ! * Returns true if obj is an instance of ! * Long and represents the same long value. ! * ! * @param obj the object to compare ! * @return whether these Objects are semantically equal ! */ ! public boolean equals(Object obj) ! { ! return obj instanceof Long && value == ((Long) obj).value; ! } ! /** ! * Get the specified system property as a Long. The ! * decode() method will be used to interpret the value of ! * the property. ! * ! * @param nm the name of the system property ! * @return the system property as a Long, or null if the ! * property is not found or cannot be decoded ! * @throws SecurityException if accessing the system property is forbidden ! * @see System#getProperty(String) ! * @see #decode(String) ! */ ! public static Long getLong(String nm) ! { ! return getLong(nm, null); } ! /** ! * Get the specified system property as a Long, or use a ! * default long value if the property is not found or is not ! * decodable. The decode() method will be used to interpret ! * the value of the property. ! * ! * @param nm the name of the system property ! * @param val the default value ! * @return the value of the system property, or the default ! * @throws SecurityException if accessing the system property is forbidden ! * @see System#getProperty(String) ! * @see #decode(String) */ ! public static Long getLong(String nm, long val) { ! Long result = getLong(nm, null); ! return result == null ? new Long(val) : result; } /** ! * Get the specified system property as a Long, or use a ! * default Long value if the property is not found or is ! * not decodable. The decode() method will be used to ! * interpret the value of the property. ! * ! * @param nm the name of the system property ! * @param val the default value ! * @return the value of the system property, or the default ! * @throws SecurityException if accessing the system property is forbidden ! * @see System#getProperty(String) ! * @see #decode(String) */ ! public static Long getLong(String nm, Long def) { ! if (nm == null || "".equals(nm)) ! return def; ! nm = System.getProperty(nm); ! if (nm == null) ! return def; ! try ! { ! return decode(nm); ! } ! catch (NumberFormatException e) ! { ! return def; ! } } /** ! * Compare two Longs numerically by comparing their long ! * values. The result is positive if the first is greater, negative if the ! * second is greater, and 0 if the two are equal. * ! * @param l the Long to compare ! * @return the comparison ! * @since 1.2 */ ! public int compareTo(Long l) { ! if (value == l.value) ! return 0; ! // Returns just -1 or 1 on inequality; doing math might overflow the long. ! return value > l.value ? 1 : -1; } /** ! * Behaves like compareTo(Long) unless the Object ! * is not a Long. * ! * @param o the object to compare ! * @return the comparison ! * @throws ClassCastException if the argument is not a Long ! * @see #compareTo(Long) ! * @see Comparable ! * @since 1.2 */ ! public int compareTo(Object o) { ! return compareTo((Long) o); ! } ! /** ! * Helper for converting unsigned numbers to String. ! * ! * @param num the number ! * @param exp log2(digit) (ie. 1, 3, or 4 for binary, oct, hex) ! */ ! private static String toUnsignedString(long num, int exp) ! { ! // Use the Integer toUnsignedString for efficiency if possible. ! // If NUM<0 then this particular optimization doesn't work ! // properly. ! if (num >= 0 && (int) num == num) ! return Integer.toUnsignedString((int) num, exp); ! // Use an array large enough for a binary number. ! int mask = (1 << exp) - 1; ! char[] buffer = new char[64]; ! int i = 64; ! do ! { ! buffer[--i] = digits[(int) num & mask]; ! num >>>= exp; ! } ! while (num != 0); ! // Package constructor avoids an array copy. ! return new String(buffer, i, 64 - i, true); } ! /** ! * Helper for parsing longs. ! * ! * @param str the string to parse ! * @param radix the radix to use, must be 10 if decode is true ! * @param decode if called from decode ! * @return the parsed long value ! * @throws NumberFormatException if there is an error ! * @throws NullPointerException if decode is true and str is null ! * @see #parseLong(String, int) ! * @see #decode(String) ! */ ! private static long parseLong(String str, int radix, boolean decode) { ! if (! decode && str == null) ! throw new NumberFormatException(); int index = 0; ! int len = str.length(); ! boolean isNeg = false; ! if (len == 0) throw new NumberFormatException(); ! int ch = str.charAt(index); ! if (ch == '-') { ! if (len == 1) ! throw new NumberFormatException(); isNeg = true; + ch = str.charAt(++index); } ! if (decode) { ! if (ch == '0') ! { ! if (++index == len) ! return 0; ! if ((str.charAt(index) & ~('x' ^ 'X')) == 'X') ! { ! radix = 16; ! index++; ! } ! else ! radix = 8; ! } ! else if (ch == '#') { radix = 16; index++; } } ! if (index == len) throw new NumberFormatException(); long max = MAX_VALUE / radix; // We can't directly write `max = (MAX_VALUE + 1) / radix'. // So instead we fake it. if (isNeg && MAX_VALUE % radix == radix - 1) ++max; ! long val = 0; ! while (index < len) { if (val < 0 || val > max) throw new NumberFormatException(); ! ch = Character.digit(str.charAt(index++), radix); ! val = val * radix + ch; ! if (ch < 0 || (val < 0 && (! isNeg || val != MIN_VALUE))) throw new NumberFormatException(); } ! return isNeg ? -val : val; } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natClass.cc gcc-3.3/libjava/java/lang/natClass.cc *** gcc-3.2.3/libjava/java/lang/natClass.cc 2001-12-21 19:47:50.000000000 +0000 --- gcc-3.3/libjava/java/lang/natClass.cc 2003-05-01 21:52:35.000000000 +0000 *************** *** 1,6 **** // natClass.cc - Implementation of java.lang.Class native methods. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natClass.cc - Implementation of java.lang.Class native methods. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** details. */ *** 36,41 **** --- 36,42 ---- #include #include #include + #include #include #include #include *************** details. */ *** 47,69 **** #include #include #include #include #include - // FIXME: remove these. - #define CloneableClass java::lang::Cloneable::class$ - #define ObjectClass java::lang::Object::class$ - #define ErrorClass java::lang::Error::class$ - #define ClassClass java::lang::Class::class$ - #define MethodClass java::lang::reflect::Method::class$ - #define FieldClass java::lang::reflect::Field::class$ - #define ConstructorClass java::lang::reflect::Constructor::class$ - - - using namespace gcj; jclass --- 48,62 ---- #include #include #include + #include #include + #include + #include #include using namespace gcj; jclass *************** java::lang::Class::forName (jstring clas *** 82,88 **** if (! _Jv_VerifyClassName (name)) throw new java::lang::ClassNotFoundException (className); - // FIXME: should use bootstrap class loader if loader is null. jclass klass = (buffer[0] == '[' ? _Jv_FindClassFromSignature (name->data, loader) : _Jv_FindClass (name, loader)); --- 75,80 ---- *************** java::lang::Class::forName (jstring clas *** 99,106 **** jclass java::lang::Class::forName (jstring className) { ! // FIXME: should use class loader from calling method. ! return forName (className, true, NULL); } java::lang::ClassLoader * --- 91,113 ---- jclass java::lang::Class::forName (jstring className) { ! java::lang::ClassLoader *loader = NULL; ! gnu::gcj::runtime::StackTrace *t ! = new gnu::gcj::runtime::StackTrace(4); ! java::lang::Class *klass = NULL; ! try ! { ! for (int i = 1; !klass; i++) ! { ! klass = t->classAt (i); ! } ! loader = klass->getClassLoader(); ! } ! catch (::java::lang::ArrayIndexOutOfBoundsException *e) ! { ! } ! ! return forName (className, true, loader); } java::lang::ClassLoader * *************** java::lang::Class::_getConstructors (jbo *** 174,180 **** } JArray *result = (JArray *) ! JvNewObjectArray (numConstructors, &ConstructorClass, NULL); java::lang::reflect::Constructor** cptr = elements (result); for (i = 0; i < max; i++) { --- 181,189 ---- } JArray *result = (JArray *) ! JvNewObjectArray (numConstructors, ! &java::lang::reflect::Constructor::class$, ! NULL); java::lang::reflect::Constructor** cptr = elements (result); for (i = 0; i < max; i++) { *************** java::lang::Class::getDeclaredFields (vo *** 273,279 **** s->checkMemberAccess (this, java::lang::reflect::Member::DECLARED); JArray *result = (JArray *) ! JvNewObjectArray (field_count, &FieldClass, NULL); java::lang::reflect::Field** fptr = elements (result); for (int i = 0; i < field_count; i++) { --- 282,288 ---- s->checkMemberAccess (this, java::lang::reflect::Member::DECLARED); JArray *result = (JArray *) ! JvNewObjectArray (field_count, &java::lang::reflect::Field::class$, NULL); java::lang::reflect::Field** fptr = elements (result); for (int i = 0; i < field_count; i++) { *************** java::lang::Class::getSignature (JArray< *** 324,331 **** } java::lang::reflect::Method * ! java::lang::Class::getDeclaredMethod (jstring name, ! JArray *param_types) { jstring partial_sig = getSignature (param_types, false); jint p_len = partial_sig->length(); --- 333,340 ---- } java::lang::reflect::Method * ! java::lang::Class::_getDeclaredMethod (jstring name, ! JArray *param_types) { jstring partial_sig = getSignature (param_types, false); jint p_len = partial_sig->length(); *************** java::lang::Class::getDeclaredMethod (js *** 333,341 **** int i = isPrimitive () ? 0 : method_count; while (--i >= 0) { - // FIXME: access checks. if (_Jv_equalUtf8Consts (methods[i].name, utf_name) ! && _Jv_equaln (methods[i].signature, partial_sig, p_len)) { // Found it. using namespace java::lang::reflect; --- 342,351 ---- int i = isPrimitive () ? 0 : method_count; while (--i >= 0) { if (_Jv_equalUtf8Consts (methods[i].name, utf_name) ! && _Jv_equaln (methods[i].signature, partial_sig, p_len) ! && (methods[i].accflags ! & java::lang::reflect::Modifier::INVISIBLE) == 0) { // Found it. using namespace java::lang::reflect; *************** java::lang::Class::getDeclaredMethod (js *** 345,351 **** return rmethod; } } ! throw new java::lang::NoSuchMethodException; } JArray * --- 355,361 ---- return rmethod; } } ! return NULL; } JArray * *************** java::lang::Class::getDeclaredMethods (v *** 360,372 **** if (method->name == NULL || _Jv_equalUtf8Consts (method->name, clinit_name) || _Jv_equalUtf8Consts (method->name, init_name) ! || _Jv_equalUtf8Consts (method->name, finit_name)) continue; numMethods++; } JArray *result = (JArray *) ! JvNewObjectArray (numMethods, &MethodClass, NULL); java::lang::reflect::Method** mptr = elements (result); for (i = 0; i < max; i++) { --- 370,384 ---- if (method->name == NULL || _Jv_equalUtf8Consts (method->name, clinit_name) || _Jv_equalUtf8Consts (method->name, init_name) ! || _Jv_equalUtf8Consts (method->name, finit_name) ! || (methods[i].accflags ! & java::lang::reflect::Modifier::INVISIBLE) != 0) continue; numMethods++; } JArray *result = (JArray *) ! JvNewObjectArray (numMethods, &java::lang::reflect::Method::class$, NULL); java::lang::reflect::Method** mptr = elements (result); for (i = 0; i < max; i++) { *************** java::lang::Class::getDeclaredMethods (v *** 374,380 **** if (method->name == NULL || _Jv_equalUtf8Consts (method->name, clinit_name) || _Jv_equalUtf8Consts (method->name, init_name) ! || _Jv_equalUtf8Consts (method->name, finit_name)) continue; java::lang::reflect::Method* rmethod = new java::lang::reflect::Method (); --- 386,394 ---- if (method->name == NULL || _Jv_equalUtf8Consts (method->name, clinit_name) || _Jv_equalUtf8Consts (method->name, init_name) ! || _Jv_equalUtf8Consts (method->name, finit_name) ! || (methods[i].accflags ! & java::lang::reflect::Modifier::INVISIBLE) != 0) continue; java::lang::reflect::Method* rmethod = new java::lang::reflect::Method (); *************** java::lang::Class::getClasses (void) *** 402,408 **** // Until we have inner classes, it always makes sense to return an // empty array. JArray *result ! = (JArray *) JvNewObjectArray (0, &ClassClass, NULL); return result; } --- 416,423 ---- // Until we have inner classes, it always makes sense to return an // empty array. JArray *result ! = (JArray *) JvNewObjectArray (0, &java::lang::Class::class$, ! NULL); return result; } *************** java::lang::Class::getDeclaredClasses (v *** 413,419 **** // Until we have inner classes, it always makes sense to return an // empty array. JArray *result ! = (JArray *) JvNewObjectArray (0, &ClassClass, NULL); return result; } --- 428,435 ---- // Until we have inner classes, it always makes sense to return an // empty array. JArray *result ! = (JArray *) JvNewObjectArray (0, &java::lang::Class::class$, ! NULL); return result; } *************** java::lang::Class::getFields (void) *** 474,480 **** JArray *result = ((JArray *) ! JvNewObjectArray (count, &FieldClass, NULL)); _getFields (result, 0); --- 490,496 ---- JArray *result = ((JArray *) ! JvNewObjectArray (count, &java::lang::reflect::Field::class$, NULL)); _getFields (result, 0); *************** java::lang::Class::getInterfaces (void) *** 492,498 **** } java::lang::reflect::Method * ! java::lang::Class::getMethod (jstring name, JArray *param_types) { jstring partial_sig = getSignature (param_types, false); jint p_len = partial_sig->length(); --- 508,514 ---- } java::lang::reflect::Method * ! java::lang::Class::_getMethod (jstring name, JArray *param_types) { jstring partial_sig = getSignature (param_types, false); jint p_len = partial_sig->length(); *************** java::lang::Class::getMethod (jstring na *** 504,510 **** { // FIXME: access checks. if (_Jv_equalUtf8Consts (klass->methods[i].name, utf_name) ! && _Jv_equaln (klass->methods[i].signature, partial_sig, p_len)) { // Found it. using namespace java::lang::reflect; --- 520,528 ---- { // FIXME: access checks. if (_Jv_equalUtf8Consts (klass->methods[i].name, utf_name) ! && _Jv_equaln (klass->methods[i].signature, partial_sig, p_len) ! && (klass->methods[i].accflags ! & java::lang::reflect::Modifier::INVISIBLE) == 0) { // Found it. using namespace java::lang::reflect; *************** java::lang::Class::getMethod (jstring na *** 521,527 **** } } } ! throw new java::lang::NoSuchMethodException; } // This is a very slow implementation, since it re-scans all the --- 539,559 ---- } } } ! ! // If we haven't found a match, and this class is an interface, then ! // check all the superinterfaces. ! if (isInterface()) ! { ! for (int i = 0; i < interface_count; ++i) ! { ! using namespace java::lang::reflect; ! Method *rmethod = interfaces[i]->_getMethod (name, param_types); ! if (rmethod != NULL) ! return rmethod; ! } ! } ! ! return NULL; } // This is a very slow implementation, since it re-scans all the *************** java::lang::Class::_getMethods (JArrayname == NULL || _Jv_equalUtf8Consts (method->name, clinit_name) || _Jv_equalUtf8Consts (method->name, init_name) ! || _Jv_equalUtf8Consts (method->name, finit_name)) continue; // Only want public methods. if (! java::lang::reflect::Modifier::isPublic (method->accflags)) --- 573,581 ---- if (method->name == NULL || _Jv_equalUtf8Consts (method->name, clinit_name) || _Jv_equalUtf8Consts (method->name, init_name) ! || _Jv_equalUtf8Consts (method->name, finit_name) ! || (method->accflags ! & java::lang::reflect::Modifier::INVISIBLE) != 0) continue; // Only want public methods. if (! java::lang::reflect::Modifier::isPublic (method->accflags)) *************** java::lang::Class::getMethods (void) *** 614,620 **** jint count = _getMethods (NULL, 0); JArray *result ! = ((JArray *) JvNewObjectArray (count, &MethodClass, NULL)); // When filling the array for real, we get the actual count. Then // we resize the array. --- 648,656 ---- jint count = _getMethods (NULL, 0); JArray *result ! = ((JArray *) JvNewObjectArray (count, ! &Method::class$, ! NULL)); // When filling the array for real, we get the actual count. Then // we resize the array. *************** java::lang::Class::getMethods (void) *** 623,629 **** if (real_count != count) { JArray *r2 ! = ((JArray *) JvNewObjectArray (real_count, &MethodClass, NULL)); Method **destp = elements (r2); --- 659,666 ---- if (real_count != count) { JArray *r2 ! = ((JArray *) JvNewObjectArray (real_count, ! &Method::class$, NULL)); Method **destp = elements (r2); *************** java::lang::Class::newInstance (void) *** 663,669 **** // seem to be any way to do these. // FIXME: we special-case one check here just to pass a Plum Hall // test. Once access checking is implemented, remove this. ! if (this == &ClassClass) throw new java::lang::IllegalAccessException; if (isPrimitive () --- 700,706 ---- // seem to be any way to do these. // FIXME: we special-case one check here just to pass a Plum Hall // test. Once access checking is implemented, remove this. ! if (this == &java::lang::Class::class$) throw new java::lang::IllegalAccessException; if (isPrimitive () *************** java::lang::Class::initializeClass (void *** 732,740 **** wait (); // Steps 3 & 4. ! if (state == JV_STATE_DONE ! || state == JV_STATE_IN_PROGRESS ! || thread == self) { _Jv_MonitorExit (this); return; --- 769,775 ---- wait (); // Steps 3 & 4. ! if (state == JV_STATE_DONE || state == JV_STATE_IN_PROGRESS) { _Jv_MonitorExit (this); return; *************** java::lang::Class::initializeClass (void *** 744,750 **** if (state == JV_STATE_ERROR) { _Jv_MonitorExit (this); ! throw new java::lang::NoClassDefFoundError; } // Step 6. --- 779,785 ---- if (state == JV_STATE_ERROR) { _Jv_MonitorExit (this); ! throw new java::lang::NoClassDefFoundError (getName()); } // Step 6. *************** java::lang::Class::initializeClass (void *** 780,786 **** } catch (java::lang::Throwable *except) { ! if (! ErrorClass.isInstance(except)) { try { --- 815,821 ---- } catch (java::lang::Throwable *except) { ! if (! java::lang::Error::class$.isInstance(except)) { try { *************** static void *** 872,885 **** _Jv_AddMethodToCache (jclass klass, _Jv_Method *method) { ! _Jv_MonitorEnter (&ClassClass); int index = method->name->hash & MCACHE_SIZE; method_cache[index].method = method; method_cache[index].klass = klass; ! _Jv_MonitorExit (&ClassClass); } void * --- 907,920 ---- _Jv_AddMethodToCache (jclass klass, _Jv_Method *method) { ! _Jv_MonitorEnter (&java::lang::Class::class$); int index = method->name->hash & MCACHE_SIZE; method_cache[index].method = method; method_cache[index].klass = klass; ! _Jv_MonitorExit (&java::lang::Class::class$); } void * *************** _Jv_IsAssignableFrom (jclass target, jcl *** 929,942 **** { if (source == target) return true; ! // If target is array, so must source be. ! if (target->isArray ()) { if (! source->isArray()) return false; ! return _Jv_IsAssignableFrom(target->getComponentType(), ! source->getComponentType()); } if (target->isInterface()) --- 964,977 ---- { if (source == target) return true; ! // If target is array, so must source be. ! while (target->isArray ()) { if (! source->isArray()) return false; ! target = target->getComponentType(); ! source = source->getComponentType(); } if (target->isInterface()) *************** _Jv_IsAssignableFrom (jclass target, jcl *** 946,952 **** if (__builtin_expect (source->idt == NULL || source->isInterface(), false)) return _Jv_InterfaceAssignableFrom (target, source); ! _Jv_IDispatchTable *cl_idt = source->idt; _Jv_IDispatchTable *if_idt = target->idt; --- 981,987 ---- if (__builtin_expect (source->idt == NULL || source->isInterface(), false)) return _Jv_InterfaceAssignableFrom (target, source); ! _Jv_IDispatchTable *cl_idt = source->idt; _Jv_IDispatchTable *if_idt = target->idt; *************** _Jv_IsAssignableFrom (jclass target, jcl *** 962,984 **** } return false; } ! // Primitive TYPE classes are only assignable to themselves. ! if (__builtin_expect (target->isPrimitive(), false)) return false; ! ! if (target == &ObjectClass) { ! if (source->isPrimitive()) ! return false; ! return true; } ! else if (source->ancestors != NULL ! && target->ancestors != NULL ! && source->depth >= target->depth && source->ancestors[source->depth - target->depth] == target) return true; ! return false; } --- 997,1027 ---- } return false; } ! // Primitive TYPE classes are only assignable to themselves. ! if (__builtin_expect (target->isPrimitive() || source->isPrimitive(), false)) return false; ! ! if (target == &java::lang::Object::class$) ! return true; ! else if (source->ancestors == NULL || target->ancestors == NULL) { ! // We need this case when either SOURCE or TARGET has not has ! // its constant-time tables prepared. ! ! // At this point we know that TARGET can't be Object, so it is ! // safe to use that as the termination point. ! while (source && source != &java::lang::Object::class$) ! { ! if (source == target) ! return true; ! source = source->getSuperclass(); ! } } ! else if (source->depth >= target->depth && source->ancestors[source->depth - target->depth] == target) return true; ! return false; } *************** _Jv_CheckArrayStore (jobject arr, jobjec *** 1033,1042 **** { JvAssert (arr != NULL); jclass elt_class = (JV_CLASS (arr))->getComponentType(); jclass obj_class = JV_CLASS (obj); if (__builtin_expect (! _Jv_IsAssignableFrom (elt_class, obj_class), false)) ! throw new java::lang::ArrayStoreException; } } --- 1076,1092 ---- { JvAssert (arr != NULL); jclass elt_class = (JV_CLASS (arr))->getComponentType(); + if (elt_class == &java::lang::Object::class$) + return; jclass obj_class = JV_CLASS (obj); if (__builtin_expect (! _Jv_IsAssignableFrom (elt_class, obj_class), false)) ! throw new java::lang::ArrayStoreException ! ((new java::lang::StringBuffer ! (JvNewStringUTF("Cannot store ")))->append ! (obj_class->getName())->append ! (JvNewStringUTF(" in array of type "))->append ! (elt_class->getName())->toString()); } } *************** _Jv_PrepareConstantTimeTables (jclass kl *** 1067,1073 **** jclass klass0 = klass; jboolean has_interfaces = 0; ! while (klass0 != &ObjectClass) { has_interfaces += klass0->interface_count; klass0 = klass0->superclass; --- 1117,1123 ---- jclass klass0 = klass; jboolean has_interfaces = 0; ! while (klass0 != &java::lang::Object::class$) { has_interfaces += klass0->interface_count; klass0 = klass0->superclass; *************** _Jv_AppendPartialITable (jclass klass, j *** 1310,1316 **** } static _Jv_Mutex_t iindex_mutex; ! bool iindex_mutex_initialized = false; // We need to find the correct offset in the Class Interface Dispatch // Table for a given interface. Once we have that, invoking an interface --- 1360,1366 ---- } static _Jv_Mutex_t iindex_mutex; ! static bool iindex_mutex_initialized = false; // We need to find the correct offset in the Class Interface Dispatch // Table for a given interface. Once we have that, invoking an interface *************** _Jv_LinkOffsetTable(jclass klass) *** 1524,1530 **** } // Returns true if METH should get an entry in a VTable. ! static bool isVirtualMethod (_Jv_Method *meth) { using namespace java::lang::reflect; --- 1574,1580 ---- } // Returns true if METH should get an entry in a VTable. ! static jboolean isVirtualMethod (_Jv_Method *meth) { using namespace java::lang::reflect; *************** isVirtualMethod (_Jv_Method *meth) *** 1532,1537 **** --- 1582,1594 ---- && meth->name->data[0] != '<'); } + // This is put in empty vtable slots. + static void + _Jv_abstractMethodError (void) + { + throw new java::lang::AbstractMethodError(); + } + // Prepare virtual method declarations in KLASS, and any superclasses as // required, by determining their vtable index, setting method->index, and // finally setting the class's vtable_method_count. Must be called with the *************** _Jv_LayoutVTableMethods (jclass klass) *** 1542,1548 **** if (klass->vtable != NULL || klass->isInterface() || klass->vtable_method_count != -1) return; ! jclass superclass = klass->superclass; if (superclass != NULL && superclass->vtable_method_count == -1) --- 1599,1605 ---- if (klass->vtable != NULL || klass->isInterface() || klass->vtable_method_count != -1) return; ! jclass superclass = klass->superclass; if (superclass != NULL && superclass->vtable_method_count == -1) *************** _Jv_LayoutVTableMethods (jclass klass) *** 1550,1597 **** JvSynchronize sync (superclass); _Jv_LayoutVTableMethods (superclass); } ! int index = (superclass == NULL ? 0 : superclass->vtable_method_count); for (int i = 0; i < klass->method_count; ++i) { _Jv_Method *meth = &klass->methods[i]; _Jv_Method *super_meth = NULL; ! ! if (!isVirtualMethod(meth)) ! continue; ! if (superclass != NULL) ! super_meth = _Jv_LookupDeclaredMethod (superclass, meth->name, ! meth->signature); ! if (super_meth) meth->index = super_meth->index; ! else ! meth->index = index++; } ! klass->vtable_method_count = index; } ! // Set entries in VTABLE for virtual methods declared in KLASS. If KLASS has ! // an immediate abstract parent, recursivly do its methods first. void ! _Jv_SetVTableEntries (jclass klass, _Jv_VTable *vtable) { using namespace java::lang::reflect; jclass superclass = klass->getSuperclass(); if (superclass != NULL && (superclass->getModifiers() & Modifier::ABSTRACT)) ! _Jv_SetVTableEntries (superclass, vtable); ! for (int i = klass->method_count - 1; i >= 0; i--) { _Jv_Method *meth = &klass->methods[i]; ! if (!isVirtualMethod(meth)) continue; ! vtable->set_method(meth->index, meth->ncode); } } --- 1607,1667 ---- JvSynchronize sync (superclass); _Jv_LayoutVTableMethods (superclass); } ! int index = (superclass == NULL ? 0 : superclass->vtable_method_count); for (int i = 0; i < klass->method_count; ++i) { _Jv_Method *meth = &klass->methods[i]; _Jv_Method *super_meth = NULL; ! ! if (! isVirtualMethod (meth)) ! continue; ! if (superclass != NULL) ! { ! super_meth = _Jv_LookupDeclaredMethod (superclass, meth->name, ! meth->signature); ! } ! if (super_meth) meth->index = super_meth->index; ! else if (! (meth->accflags & java::lang::reflect::Modifier::FINAL) ! && ! (klass->accflags & java::lang::reflect::Modifier::FINAL)) ! meth->index = index++; } ! klass->vtable_method_count = index; } ! // Set entries in VTABLE for virtual methods declared in KLASS. If ! // KLASS has an immediate abstract parent, recursively do its methods ! // first. FLAGS is used to determine which slots we've actually set. void ! _Jv_SetVTableEntries (jclass klass, _Jv_VTable *vtable, jboolean *flags) { using namespace java::lang::reflect; jclass superclass = klass->getSuperclass(); if (superclass != NULL && (superclass->getModifiers() & Modifier::ABSTRACT)) ! _Jv_SetVTableEntries (superclass, vtable, flags); ! for (int i = klass->method_count - 1; i >= 0; i--) { _Jv_Method *meth = &klass->methods[i]; ! if (meth->index == (_Jv_ushort) -1) continue; ! if ((meth->accflags & Modifier::ABSTRACT)) ! { ! vtable->set_method(meth->index, (void *) &_Jv_abstractMethodError); ! flags[meth->index] = false; ! } ! else ! { ! vtable->set_method(meth->index, meth->ncode); ! flags[meth->index] = true; ! } } } *************** _Jv_MakeVTable (jclass klass) *** 1607,1613 **** if (klass->vtable != NULL || klass->isInterface() || (klass->accflags & Modifier::ABSTRACT)) return; ! // out before we can create a vtable. if (klass->vtable_method_count == -1) _Jv_LayoutVTableMethods (klass); --- 1677,1683 ---- if (klass->vtable != NULL || klass->isInterface() || (klass->accflags & Modifier::ABSTRACT)) return; ! // out before we can create a vtable. if (klass->vtable_method_count == -1) _Jv_LayoutVTableMethods (klass); *************** _Jv_MakeVTable (jclass klass) *** 1615,1621 **** // Allocate the new vtable. _Jv_VTable *vtable = _Jv_VTable::new_vtable (klass->vtable_method_count); klass->vtable = vtable; ! // Copy the vtable of the closest non-abstract superclass. jclass superclass = klass->superclass; if (superclass != NULL) --- 1685,1695 ---- // Allocate the new vtable. _Jv_VTable *vtable = _Jv_VTable::new_vtable (klass->vtable_method_count); klass->vtable = vtable; ! ! jboolean flags[klass->vtable_method_count]; ! for (int i = 0; i < klass->vtable_method_count; ++i) ! flags[i] = false; ! // Copy the vtable of the closest non-abstract superclass. jclass superclass = klass->superclass; if (superclass != NULL) *************** _Jv_MakeVTable (jclass klass) *** 1630,1636 **** } for (int i = 0; i < superclass->vtable_method_count; ++i) ! vtable->set_method (i, superclass->vtable->get_method (i)); } // Set the class pointer and GC descriptor. --- 1704,1713 ---- } for (int i = 0; i < superclass->vtable_method_count; ++i) ! { ! vtable->set_method (i, superclass->vtable->get_method (i)); ! flags[i] = true; ! } } // Set the class pointer and GC descriptor. *************** _Jv_MakeVTable (jclass klass) *** 1639,1643 **** // For each virtual declared in klass and any immediate abstract // superclasses, set new vtable entry or override an old one. ! _Jv_SetVTableEntries (klass, vtable); } --- 1716,1729 ---- // For each virtual declared in klass and any immediate abstract // superclasses, set new vtable entry or override an old one. ! _Jv_SetVTableEntries (klass, vtable, flags); ! ! // It is an error to have an abstract method in a concrete class. ! if (! (klass->accflags & Modifier::ABSTRACT)) ! { ! for (int i = 0; i < klass->vtable_method_count; ++i) ! if (! flags[i]) ! // FIXME: messsage. ! throw new java::lang::AbstractMethodError (); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natClassLoader.cc gcc-3.3/libjava/java/lang/natClassLoader.cc *** gcc-3.2.3/libjava/java/lang/natClassLoader.cc 2002-04-02 22:19:55.000000000 +0000 --- gcc-3.3/libjava/java/lang/natClassLoader.cc 2002-12-19 19:32:17.000000000 +0000 *************** details. */ *** 41,54 **** #include #include - // FIXME: remove these. - #define CloneableClass java::lang::Cloneable::class$ - #define ObjectClass java::lang::Object::class$ - #define ClassClass java::lang::Class::class$ - #define VMClassLoaderClass gnu::gcj::runtime::VMClassLoader::class$ - #define ClassLoaderClass java::lang::ClassLoader::class$ - #define SerializableClass java::io::Serializable::class$ - /////////// java.lang.ClassLoader native methods //////////// java::lang::Class * --- 41,46 ---- *************** java::lang::ClassLoader::defineClass0 (j *** 60,79 **** { #ifdef INTERPRETER jclass klass; ! klass = (jclass) JvAllocObject (&ClassClass, sizeof (_Jv_InterpClass)); _Jv_InitNewClassFields (klass); ! // synchronize on the class, so that it is not ! // attempted initialized until we're done loading. ! _Jv_MonitorEnter (klass); ! // record which is the defining loader ! klass->loader = this; - // register that we are the initiating loader... if (name != 0) { ! _Jv_Utf8Const * name2 = _Jv_makeUtf8Const (name); if (! _Jv_VerifyClassName (name2)) throw new java::lang::ClassFormatError --- 52,73 ---- { #ifdef INTERPRETER jclass klass; ! klass = (jclass) JvAllocObject (&java::lang::Class::class$, ! sizeof (_Jv_InterpClass)); _Jv_InitNewClassFields (klass); ! // Synchronize on the class, so that it is not attempted initialized ! // until we're done loading. ! JvSynchronize sync (klass); ! // Record the defining loader. For the system class loader, we ! // record NULL. ! if (this != java::lang::ClassLoader::getSystemClassLoader()) ! klass->loader = this; if (name != 0) { ! _Jv_Utf8Const *name2 = _Jv_makeUtf8Const (name); if (! _Jv_VerifyClassName (name2)) throw new java::lang::ClassFormatError *************** java::lang::ClassLoader::defineClass0 (j *** 93,108 **** _Jv_UnregisterClass (klass); ! _Jv_MonitorExit (klass); ! ! // FIXME: Here we may want to test that EX does ! // indeed represent a valid exception. That is, ! // anything but ClassNotFoundException, ! // or some kind of Error. ! ! // FIXME: Rewrite this as a cleanup instead of ! // as a catch handler. ! throw ex; } --- 87,94 ---- _Jv_UnregisterClass (klass); ! // If EX is not a ClassNotFoundException, that's ok, because we ! // account for the possibility in defineClass(). throw ex; } *************** java::lang::ClassLoader::defineClass0 (j *** 111,120 **** // if everything proceeded sucessfully, we're loaded. JvAssert (klass->state == JV_STATE_LOADED); - // if an exception is generated, this is initially missed. - // however, we come back here in handleException0 below... - _Jv_MonitorExit (klass); - return klass; #else // INTERPRETER --- 97,102 ---- *************** java::lang::ClassLoader::markClassErrorS *** 178,183 **** --- 160,175 ---- } jclass + java::lang::VMClassLoader::defineClass (java::lang::ClassLoader *cl, + jstring name, + jbyteArray data, + jint offset, + jint length) + { + return cl->defineClass (name, data, offset, length); + } + + jclass java::lang::VMClassLoader::getPrimitiveClass (jchar type) { char sig[2]; *************** java::lang::VMClassLoader::getPrimitiveC *** 186,241 **** return _Jv_FindClassFromSignature (sig, NULL); } - // This is the findClass() implementation for the System classloader. It is - // the only native method in VMClassLoader, so we define it here. - jclass - gnu::gcj::runtime::VMClassLoader::findClass (jstring name) - { - _Jv_Utf8Const *name_u = _Jv_makeUtf8Const (name); - jclass klass = _Jv_FindClassInCache (name_u, 0); - - if (! klass) - { - // Turn `gnu.pkg.quux' into `lib-gnu-pkg-quux'. Then search for - // a module named (eg, on Linux) `lib-gnu-pkg-quux.so', followed - // by `lib-gnu-pkg.so' and `lib-gnu.so'. If loading one of - // these causes the class to appear in the cache, then use it. - java::lang::StringBuffer *sb = new java::lang::StringBuffer (JvNewStringLatin1("lib-")); - jstring so_base_name = (sb->append (name)->toString ())->replace ('.', '-'); - - // Compare against `3' because that is the length of "lib". - while (! klass && so_base_name && so_base_name->length() > 3) - { - using namespace ::java::lang; - Runtime *rt = Runtime::getRuntime(); - jboolean loaded = rt->loadLibraryInternal (so_base_name); - - jint nd = so_base_name->lastIndexOf ('-'); - if (nd == -1) - so_base_name = NULL; - else - so_base_name = so_base_name->substring (0, nd); - - if (loaded) - klass = _Jv_FindClassInCache (name_u, 0); - } - } - - // Now try loading using the interpreter. - if (! klass) - { - klass = java::net::URLClassLoader::findClass (name); - } - - return klass; - } - - jclass - java::lang::ClassLoader::findLoadedClass (jstring name) - { - return _Jv_FindClassInCache (_Jv_makeUtf8Const (name), this); - } - /** This function does class-preparation for compiled classes. NOTE: It contains replicated functionality from _Jv_ResolvePoolEntry, and this is intentional, since that function --- 178,183 ---- *************** _Jv_PrepareCompiledClass (jclass klass) *** 267,273 **** if (! found) { jstring str = _Jv_NewStringUTF (name->data); ! throw new java::lang::ClassNotFoundException (str); } pool->data[index].clazz = found; --- 209,215 ---- if (! found) { jstring str = _Jv_NewStringUTF (name->data); ! throw new java::lang::NoClassDefFoundError (str); } pool->data[index].clazz = found; *************** _Jv_PrepareCompiledClass (jclass klass) *** 276,281 **** --- 218,224 ---- else if (pool->tags[index] == JV_CONSTANT_String) { jstring str; + str = _Jv_NewStringUtf8Const (pool->data[index].utf8); pool->data[index].o = str; pool->tags[index] |= JV_CONSTANT_ResolvedFlag; *************** _Jv_PrepareCompiledClass (jclass klass) *** 295,301 **** int mod = f->getModifiers (); // If we have a static String field with a non-null initial // value, we know it points to a Utf8Const. ! if (f->getClass () == &StringClass && java::lang::reflect::Modifier::isStatic (mod)) { jstring *strp = (jstring *) f->u.addr; --- 238,244 ---- int mod = f->getModifiers (); // If we have a static String field with a non-null initial // value, we know it points to a Utf8Const. ! if (f->getClass () == &java::lang::String::class$ && java::lang::reflect::Modifier::isStatic (mod)) { jstring *strp = (jstring *) f->u.addr; *************** _Jv_PrepareCompiledClass (jclass klass) *** 315,320 **** --- 258,265 ---- _Jv_LinkOffsetTable(klass); klass->notifyAll (); + + _Jv_PushClass (klass); } *************** _Jv_PrepareCompiledClass (jclass klass) *** 337,346 **** // Hash function for Utf8Consts. #define HASH_UTF(Utf) (((Utf)->hash) % HASH_LEN) ! struct _Jv_LoaderInfo { ! _Jv_LoaderInfo *next; ! java::lang::Class *klass; ! java::lang::ClassLoader *loader; }; static _Jv_LoaderInfo *initiated_classes[HASH_LEN]; --- 282,292 ---- // Hash function for Utf8Consts. #define HASH_UTF(Utf) (((Utf)->hash) % HASH_LEN) ! struct _Jv_LoaderInfo ! { ! _Jv_LoaderInfo *next; ! java::lang::Class *klass; ! java::lang::ClassLoader *loader; }; static _Jv_LoaderInfo *initiated_classes[HASH_LEN]; *************** static jclass loaded_classes[HASH_LEN]; *** 353,361 **** jclass _Jv_FindClassInCache (_Jv_Utf8Const *name, java::lang::ClassLoader *loader) { ! _Jv_MonitorEnter (&ClassClass); jint hash = HASH_UTF (name); // first, if LOADER is a defining loader, then it is also initiating jclass klass; for (klass = loaded_classes[hash]; klass; klass = klass->next) --- 299,310 ---- jclass _Jv_FindClassInCache (_Jv_Utf8Const *name, java::lang::ClassLoader *loader) { ! JvSynchronize sync (&java::lang::Class::class$); jint hash = HASH_UTF (name); + if (loader && loader == java::lang::ClassLoader::getSystemClassLoader()) + loader = NULL; + // first, if LOADER is a defining loader, then it is also initiating jclass klass; for (klass = loaded_classes[hash]; klass; klass = klass->next) *************** _Jv_FindClassInCache (_Jv_Utf8Const *nam *** 381,395 **** } } - _Jv_MonitorExit (&ClassClass); - return klass; } void _Jv_UnregisterClass (jclass the_class) { ! _Jv_MonitorEnter (&ClassClass); jint hash = HASH_UTF(the_class->name); jclass *klass = &(loaded_classes[hash]); --- 330,342 ---- } } return klass; } void _Jv_UnregisterClass (jclass the_class) { ! JvSynchronize sync (&java::lang::Class::class$); jint hash = HASH_UTF(the_class->name); jclass *klass = &(loaded_classes[hash]); *************** _Jv_UnregisterClass (jclass the_class) *** 407,435 **** { while (*info && (*info)->klass == the_class) { *info = (*info)->next; } if (*info == NULL) break; } - - _Jv_MonitorExit (&ClassClass); } void _Jv_RegisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader) { ! // non-gc alloc! ! _Jv_LoaderInfo *info = (_Jv_LoaderInfo *) _Jv_Malloc (sizeof(_Jv_LoaderInfo)); jint hash = HASH_UTF(klass->name); ! _Jv_MonitorEnter (&ClassClass); info->loader = loader; info->klass = klass; info->next = initiated_classes[hash]; initiated_classes[hash] = info; - _Jv_MonitorExit (&ClassClass); } // This function is called many times during startup, before main() is --- 354,385 ---- { while (*info && (*info)->klass == the_class) { + _Jv_LoaderInfo *old = *info; *info = (*info)->next; + _Jv_Free (old); } if (*info == NULL) break; } } void _Jv_RegisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader) { ! if (loader && loader == java::lang::ClassLoader::getSystemClassLoader()) ! loader = NULL; ! ! // This information can't be visible to the GC. ! _Jv_LoaderInfo *info ! = (_Jv_LoaderInfo *) _Jv_Malloc (sizeof(_Jv_LoaderInfo)); jint hash = HASH_UTF(klass->name); ! JvSynchronize sync (&java::lang::Class::class$); info->loader = loader; info->klass = klass; info->next = initiated_classes[hash]; initiated_classes[hash] = info; } // This function is called many times during startup, before main() is *************** _Jv_FindClass (_Jv_Utf8Const *name, java *** 515,520 **** --- 465,473 ---- { jstring sname = _Jv_NewStringUTF (name->data); + java::lang::ClassLoader *sys + = java::lang::ClassLoader::getSystemClassLoader (); + if (loader) { // Load using a user-defined loader, jvmspec 5.3.2 *************** _Jv_FindClass (_Jv_Utf8Const *name, java *** 523,536 **** // If "loader" delegated the loadClass operation to another // loader, explicitly register that it is also an initiating // loader of the given class. ! if (klass && (klass->getClassLoader () != loader)) _Jv_RegisterInitiatingLoader (klass, loader); } else { - java::lang::ClassLoader *sys - = java::lang::ClassLoader::getSystemClassLoader (); - // Load using the bootstrap loader jvmspec 5.3.1. klass = sys->loadClass (sname, false); --- 476,489 ---- // If "loader" delegated the loadClass operation to another // loader, explicitly register that it is also an initiating // loader of the given class. ! java::lang::ClassLoader *delegate = (loader == sys ! ? NULL ! : loader); ! if (klass && klass->getClassLoaderInternal () != delegate) _Jv_RegisterInitiatingLoader (klass, loader); } else { // Load using the bootstrap loader jvmspec 5.3.1. klass = sys->loadClass (sname, false); *************** _Jv_InitNewClassFields (jclass ret) *** 576,588 **** ret->ancestors = NULL; ret->idt = NULL; ret->arrayclass = NULL; } jclass _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass, java::lang::ClassLoader *loader) { ! jclass ret = (jclass) JvAllocObject (&ClassClass); _Jv_InitNewClassFields (ret); ret->name = name; ret->superclass = superclass; --- 529,543 ---- ret->ancestors = NULL; ret->idt = NULL; ret->arrayclass = NULL; + ret->protectionDomain = NULL; + ret->chain = NULL; } jclass _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass, java::lang::ClassLoader *loader) { ! jclass ret = (jclass) JvAllocObject (&java::lang::Class::class$); _Jv_InitNewClassFields (ret); ret->name = name; ret->superclass = superclass; *************** _Jv_NewArrayClass (jclass element, java: *** 646,658 **** } // Create new array class. ! jclass array_class = _Jv_NewClass (array_name, &ObjectClass, element->loader); // Note that `vtable_method_count' doesn't include the initial // gc_descr slot. ! JvAssert (ObjectClass.vtable_method_count == NUM_OBJECT_METHODS); ! int dm_count = ObjectClass.vtable_method_count; // Create a new vtable by copying Object's vtable. _Jv_VTable *vtable; --- 601,614 ---- } // Create new array class. ! jclass array_class = _Jv_NewClass (array_name, &java::lang::Object::class$, element->loader); // Note that `vtable_method_count' doesn't include the initial // gc_descr slot. ! JvAssert (java::lang::Object::class$.vtable_method_count ! == NUM_OBJECT_METHODS); ! int dm_count = java::lang::Object::class$.vtable_method_count; // Create a new vtable by copying Object's vtable. _Jv_VTable *vtable; *************** _Jv_NewArrayClass (jclass element, java: *** 661,678 **** else vtable = _Jv_VTable::new_vtable (dm_count); vtable->clas = array_class; ! vtable->gc_descr = ObjectClass.vtable->gc_descr; for (int i = 0; i < dm_count; ++i) ! vtable->set_method (i, ObjectClass.vtable->get_method (i)); array_class->vtable = vtable; ! array_class->vtable_method_count = ObjectClass.vtable_method_count; // Stash the pointer to the element type. array_class->methods = (_Jv_Method *) element; // Register our interfaces. ! static jclass interfaces[] = { &CloneableClass, &SerializableClass }; array_class->interfaces = interfaces; array_class->interface_count = sizeof interfaces / sizeof interfaces[0]; --- 617,639 ---- else vtable = _Jv_VTable::new_vtable (dm_count); vtable->clas = array_class; ! vtable->gc_descr = java::lang::Object::class$.vtable->gc_descr; for (int i = 0; i < dm_count; ++i) ! vtable->set_method (i, java::lang::Object::class$.vtable->get_method (i)); array_class->vtable = vtable; ! array_class->vtable_method_count ! = java::lang::Object::class$.vtable_method_count; // Stash the pointer to the element type. array_class->methods = (_Jv_Method *) element; // Register our interfaces. ! static jclass interfaces[] = ! { ! &java::lang::Cloneable::class$, ! &java::io::Serializable::class$ ! }; array_class->interfaces = interfaces; array_class->interface_count = sizeof interfaces / sizeof interfaces[0]; *************** _Jv_NewArrayClass (jclass element, java: *** 715,717 **** --- 676,706 ---- element->arrayclass = array_class; } + + static jclass stack_head; + + // These two functions form a stack of classes. When a class is loaded + // it is pushed onto the stack by the class loader; this is so that + // StackTrace can quickly determine which classes have been loaded. + + jclass + _Jv_PopClass (void) + { + JvSynchronize sync (&java::lang::Class::class$); + if (stack_head) + { + jclass tmp = stack_head; + stack_head = tmp->chain; + return tmp; + } + return NULL; + } + + void + _Jv_PushClass (jclass k) + { + JvSynchronize sync (&java::lang::Class::class$); + jclass tmp = stack_head; + stack_head = k; + k->chain = tmp; + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natObject.cc gcc-3.3/libjava/java/lang/natObject.cc *** gcc-3.2.3/libjava/java/lang/natObject.cc 2002-03-10 03:30:52.000000000 +0000 --- gcc-3.3/libjava/java/lang/natObject.cc 2003-02-19 16:27:22.000000000 +0000 *************** *** 1,6 **** // natObject.cc - Implementation of the Object class. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natObject.cc - Implementation of the Object class. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** Libgcj License. Please consult the file *** 9,14 **** --- 9,15 ---- details. */ #include + #include #include *************** _Jv_MonitorExit (jobject obj) *** 305,313 **** #include #include #include // for usleep, sysconf. - #include // for sched_yield. #include #include // Try to determine whether we are on a multiprocessor, i.e. whether // spinning may be profitable. --- 306,314 ---- #include #include #include // for usleep, sysconf. #include #include + #include // Try to determine whether we are on a multiprocessor, i.e. whether // spinning may be profitable. *************** spin(unsigned n) *** 525,538 **** } else if (n < yield_limit) { ! sched_yield(); } else { unsigned duration = MIN_SLEEP_USECS << (n - yield_limit); if (n >= 15 + yield_limit || duration > MAX_SLEEP_USECS) ! duration = MAX_SLEEP_USECS; ! usleep(duration); } } --- 526,539 ---- } else if (n < yield_limit) { ! _Jv_ThreadYield(); } else { unsigned duration = MIN_SLEEP_USECS << (n - yield_limit); if (n >= 15 + yield_limit || duration > MAX_SLEEP_USECS) ! duration = MAX_SLEEP_USECS; ! _Jv_platform_usleep(duration); } } *************** static void *** 574,580 **** --- 575,589 ---- heavy_lock_obj_finalization_proc (void *obj, void *cd) { heavy_lock *hl = (heavy_lock *)cd; + + // This only addresses misalignment of statics, not heap objects. It + // works only because registering statics for finalization is a noop, + // no matter what the least significant bits are. + #ifdef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS + obj_addr_t addr = (obj_addr_t)obj & ~((obj_addr_t)0x7); + #else obj_addr_t addr = (obj_addr_t)obj; + #endif hash_entry *he = light_locks + JV_SYNC_HASH(addr); obj_addr_t he_address = (he -> address & ~LOCKED); *************** get_heavy(obj_addr_t addr, hash_entry *h *** 753,759 **** --- 762,772 ---- void _Jv_MonitorEnter (jobject obj) { + #ifdef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS + obj_addr_t addr = (obj_addr_t)obj & ~((obj_addr_t)FLAGS); + #else obj_addr_t addr = (obj_addr_t)obj; + #endif obj_addr_t address; unsigned hash = JV_SYNC_HASH(addr); hash_entry * he = light_locks + hash; *************** retry: *** 898,904 **** --- 911,921 ---- void _Jv_MonitorExit (jobject obj) { + #ifdef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS + obj_addr_t addr = (obj_addr_t)obj & ~((obj_addr_t)FLAGS); + #else obj_addr_t addr = (obj_addr_t)obj; + #endif _Jv_ThreadId_t self = _Jv_ThreadSelf(); unsigned hash = JV_SYNC_HASH(addr); hash_entry * he = light_locks + hash; *************** retry: *** 1078,1084 **** --- 1095,1105 ---- void java::lang::Object::wait (jlong timeout, jint nanos) { + #ifdef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS + obj_addr_t addr = (obj_addr_t)this & ~((obj_addr_t)FLAGS); + #else obj_addr_t addr = (obj_addr_t)this; + #endif _Jv_ThreadId_t self = _Jv_ThreadSelf(); unsigned hash = JV_SYNC_HASH(addr); hash_entry * he = light_locks + hash; *************** retry: *** 1155,1161 **** --- 1176,1186 ---- void java::lang::Object::notify (void) { + #ifdef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS + obj_addr_t addr = (obj_addr_t)this & ~((obj_addr_t)FLAGS); + #else obj_addr_t addr = (obj_addr_t)this; + #endif _Jv_ThreadId_t self = _Jv_ThreadSelf(); unsigned hash = JV_SYNC_HASH(addr); hash_entry * he = light_locks + hash; *************** retry: *** 1200,1206 **** --- 1225,1235 ---- void java::lang::Object::notifyAll (void) { + #ifdef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS + obj_addr_t addr = (obj_addr_t)this & ~((obj_addr_t)FLAGS); + #else obj_addr_t addr = (obj_addr_t)this; + #endif _Jv_ThreadId_t self = _Jv_ThreadSelf(); unsigned hash = JV_SYNC_HASH(addr); hash_entry * he = light_locks + hash; diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natPosixProcess.cc gcc-3.3/libjava/java/lang/natPosixProcess.cc *** gcc-3.2.3/libjava/java/lang/natPosixProcess.cc 2002-03-06 05:14:38.000000000 +0000 --- gcc-3.3/libjava/java/lang/natPosixProcess.cc 2002-08-14 19:53:54.000000000 +0000 *************** details. */ *** 30,35 **** --- 30,36 ---- #include #include #include + #include #include #include #include *************** new_string (jstring string) *** 87,93 **** } static void ! cleanup (char **args, char **env) { if (args != NULL) { --- 88,94 ---- } static void ! cleanup (char **args, char **env, char *path) { if (args != NULL) { *************** cleanup (char **args, char **env) *** 101,106 **** --- 102,109 ---- _Jv_Free (env[i]); _Jv_Free (env); } + if (path != NULL) + _Jv_Free (path); } // This makes our error handling a bit simpler and it lets us avoid *************** myclose (int &fd) *** 116,122 **** void java::lang::ConcreteProcess::startProcess (jstringArray progarray, ! jstringArray envp) { using namespace java::io; --- 119,126 ---- void java::lang::ConcreteProcess::startProcess (jstringArray progarray, ! jstringArray envp, ! java::io::File *dir) { using namespace java::io; *************** java::lang::ConcreteProcess::startProces *** 125,130 **** --- 129,135 ---- // Initialize all locals here to make cleanup simpler. char **args = NULL; char **env = NULL; + char *path = NULL; int inp[2], outp[2], errp[2], msgp[2]; inp[0] = -1; inp[1] = -1; *************** java::lang::ConcreteProcess::startProces *** 168,173 **** --- 173,183 ---- env[envp->length] = NULL; } + // We allocate this here because we can't call malloc() after + // the fork. + if (dir != NULL) + path = new_string (dir->getPath ()); + // Create pipes for I/O. MSGP is for communicating exec() // status. if (pipe (inp) || pipe (outp) || pipe (errp) || pipe (msgp) *************** java::lang::ConcreteProcess::startProces *** 188,194 **** if (pid == 0) { ! // Child process, so remap descriptors and exec. if (envp) { --- 198,204 ---- if (pid == 0) { ! // Child process, so remap descriptors, chdir and exec. if (envp) { *************** java::lang::ConcreteProcess::startProces *** 229,234 **** --- 239,255 ---- close (outp[0]); close (outp[1]); close (msgp[0]); + + // Change directory. + if (path != NULL) + { + if (chdir (path) != 0) + { + char c = errno; + write (msgp[1], &c, 1); + _exit (127); + } + } execvp (args[0], args); *************** java::lang::ConcreteProcess::startProces *** 304,310 **** } myclose (msgp[0]); ! cleanup (args, env); if (exc != NULL) throw exc; --- 325,331 ---- } myclose (msgp[0]); ! cleanup (args, env, path); if (exc != NULL) throw exc; diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natRuntime.cc gcc-3.3/libjava/java/lang/natRuntime.cc *** gcc-3.2.3/libjava/java/lang/natRuntime.cc 2001-10-16 08:35:17.000000000 +0000 --- gcc-3.3/libjava/java/lang/natRuntime.cc 2003-04-25 16:02:23.000000000 +0000 *************** *** 1,6 **** // natRuntime.cc - Implementation of native side of Runtime class. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natRuntime.cc - Implementation of native side of Runtime class. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** Libgcj License. Please consult the file *** 9,27 **** --- 9,58 ---- details. */ #include + #include #include #include #include + #include + #include #include #include #include #include #include + #include + #include + #include + #include + #include + #include + #include + #include + #include #include + #ifdef HAVE_PWD_H + #include + #endif + #include + + #ifdef HAVE_UNAME + #include + #endif + + #ifdef HAVE_LOCALE_H + #include + #endif + + #ifdef HAVE_LANGINFO_H + #include + #endif + + + #ifdef USE_LTDL #include *************** _Jv_FindSymbolInExecutable (const char * *** 73,103 **** return NULL; } #else void * ! _Jv_FindSymbolInExecutable (const char *symname) { return NULL; } - #endif /* USE_LTDL */ - void ! java::lang::Runtime::exit (jint status) { ! checkExit (status); ! _exit (status); } void ! java::lang::Runtime::_exit (jint status) { // Make status right for Unix. This is perhaps strange. if (status < 0 || status > 255) status = 255; ! if (finalize_on_exit) _Jv_RunAllFinalizers (); // Delete all files registered with File.deleteOnExit() --- 104,141 ---- return NULL; } + void + _Jv_SetDLLSearchPath (const char *path) + { + lt_dlsetsearchpath (path); + } + #else void * ! _Jv_FindSymbolInExecutable (const char *) { return NULL; } void ! _Jv_SetDLLSearchPath (const char *) { ! // Nothing. } + #endif /* USE_LTDL */ + + + void ! java::lang::Runtime::exitInternal (jint status) { // Make status right for Unix. This is perhaps strange. if (status < 0 || status > 255) status = 255; ! if (finalizeOnExit) _Jv_RunAllFinalizers (); // Delete all files registered with File.deleteOnExit() *************** void *** 122,143 **** java::lang::Runtime::_load (jstring path, jboolean do_search) { JvSynchronize sync (this); - checkLink (path); using namespace java::lang; #ifdef USE_LTDL jint len = _Jv_GetStringUTFLength (path); ! char buf[len + 1 + 3]; int offset = 0; - #ifndef WIN32 - // On Unix boxes, prefix library name with `lib', for loadLibrary. if (do_search) { ! strcpy (buf, "lib"); ! offset = 3; } - #endif jsize total = JvGetStringUTFRegion (path, 0, path->length(), &buf[offset]); buf[offset + total] = '\0'; lt_dlhandle h; // FIXME: make sure path is absolute. { --- 160,225 ---- java::lang::Runtime::_load (jstring path, jboolean do_search) { JvSynchronize sync (this); using namespace java::lang; #ifdef USE_LTDL jint len = _Jv_GetStringUTFLength (path); ! char buf[len + 1 + strlen (_Jv_platform_solib_prefix) ! + strlen (_Jv_platform_solib_suffix)]; int offset = 0; if (do_search) { ! strcpy (buf, _Jv_platform_solib_prefix); ! offset = strlen (_Jv_platform_solib_prefix); } jsize total = JvGetStringUTFRegion (path, 0, path->length(), &buf[offset]); buf[offset + total] = '\0'; + + char *lib_name = buf; + + if (do_search) + { + ClassLoader *sys = ClassLoader::getSystemClassLoader(); + ClassLoader *look = NULL; + gnu::gcj::runtime::StackTrace *t = new gnu::gcj::runtime::StackTrace(10); + try + { + for (int i = 0; i < 10; ++i) + { + jclass klass = t->classAt(i); + if (klass != NULL) + { + ClassLoader *loader = klass->getClassLoaderInternal(); + if (loader != NULL && loader != sys) + { + look = loader; + break; + } + } + } + } + catch (::java::lang::ArrayIndexOutOfBoundsException *e) + { + } + + if (look != NULL) + { + // Don't include solib prefix in string passed to + // findLibrary. + jstring name = look->findLibrary(JvNewStringUTF(&buf[offset])); + if (name != NULL) + { + len = _Jv_GetStringUTFLength (name); + lib_name = (char *) _Jv_AllocBytes(len + 1); + total = JvGetStringUTFRegion (name, 0, + name->length(), lib_name); + lib_name[total] = '\0'; + // Don't append suffixes any more; we have the full file + // name. + do_search = false; + } + } + } + lt_dlhandle h; // FIXME: make sure path is absolute. { *************** java::lang::Runtime::_load (jstring path *** 145,151 **** // concurrent modification by class registration calls which may be run // during the dlopen(). JvSynchronize sync (&java::lang::Class::class$); ! h = do_search ? lt_dlopenext (buf) : lt_dlopen (buf); } if (h == NULL) { --- 227,233 ---- // concurrent modification by class registration calls which may be run // during the dlopen(). JvSynchronize sync (&java::lang::Class::class$); ! h = do_search ? lt_dlopenext (lib_name) : lt_dlopen (lib_name); } if (h == NULL) { *************** java::lang::Runtime::_load (jstring path *** 158,163 **** --- 240,258 ---- add_library (h); void *onload = lt_dlsym (h, "JNI_OnLoad"); + + #ifdef WIN32 + // On Win32, JNI_OnLoad is an "stdcall" function taking two pointers + // (8 bytes) as arguments. It could also have been exported as + // "JNI_OnLoad@8" (MinGW) or "_JNI_OnLoad@8" (MSVC). + if (onload == NULL) + { + onload = lt_dlsym (h, "JNI_OnLoad@8"); + if (onload == NULL) + onload = lt_dlsym (h, "_JNI_OnLoad@8"); + } + #endif /* WIN32 */ + if (onload != NULL) { JavaVM *vm = _Jv_GetJavaVM (); *************** java::lang::Runtime::_load (jstring path *** 166,173 **** // FIXME: what? return; } ! jint vers = ((jint (*) (JavaVM *, void *)) onload) (vm, NULL); ! if (vers != JNI_VERSION_1_1 && vers != JNI_VERSION_1_2) { // FIXME: unload the library. throw new UnsatisfiedLinkError (JvNewStringLatin1 ("unrecognized version from JNI_OnLoad")); --- 261,269 ---- // FIXME: what? return; } ! jint vers = ((jint (JNICALL *) (JavaVM *, void *)) onload) (vm, NULL); ! if (vers != JNI_VERSION_1_1 && vers != JNI_VERSION_1_2 ! && vers != JNI_VERSION_1_4) { // FIXME: unload the library. throw new UnsatisfiedLinkError (JvNewStringLatin1 ("unrecognized version from JNI_OnLoad")); *************** java::lang::Runtime::loadLibraryInternal *** 204,210 **** void java::lang::Runtime::init (void) { - finalize_on_exit = false; #ifdef USE_LTDL lt_dlinit (); lt_dlhandle self = lt_dlopen (NULL); --- 300,305 ---- *************** java::lang::Runtime::totalMemory (void) *** 225,230 **** --- 320,333 ---- return _Jv_GCTotalMemory (); } + jlong + java::lang::Runtime::maxMemory (void) + { + // We don't have a maximum. FIXME: we might if we ask the GC for + // one. + return Long::MAX_VALUE; + } + void java::lang::Runtime::traceInstructions (jboolean) { *************** java::lang::Runtime::traceMethodCalls (j *** 236,238 **** --- 339,670 ---- { // Do nothing. } + + #if ! defined (DEFAULT_FILE_ENCODING) && defined (HAVE_ICONV) \ + && defined (HAVE_NL_LANGINFO) + + static char * + file_encoding () + { + setlocale (LC_CTYPE, ""); + char *e = nl_langinfo (CODESET); + if (e == NULL || *e == '\0') + e = "8859_1"; + return e; + } + + #define DEFAULT_FILE_ENCODING file_encoding () + + #endif + + #ifndef DEFAULT_FILE_ENCODING + #define DEFAULT_FILE_ENCODING "8859_1" + #endif + + static char *default_file_encoding = DEFAULT_FILE_ENCODING; + + #if HAVE_GETPWUID_R + /* Use overload resolution to find out the signature of getpwuid_r. */ + + /* This is Posix getpwuid_r. */ + template + static inline int + getpwuid_adaptor(int (*getpwuid_r)(T_uid user_id, T_passwd *pwd_r, + T_buf *buf_r, T_len len_r, + T_passwd **pwd_entry_ptr), + uid_t user_id, struct passwd *pwd_r, + char *buf_r, size_t len_r, struct passwd **pwd_entry) + { + return getpwuid_r (user_id, pwd_r, buf_r, len_r, pwd_entry); + } + + /* This is used on HPUX 10.20 */ + template + static inline int + getpwuid_adaptor(int (*getpwuid_r)(T_uid user_id, T_passwd *pwd_r, + T_buf *buf_r, T_len len_r), + uid_t user_id, struct passwd *pwd_r, + char *buf_r, size_t len_r, struct passwd **pwd_entry) + { + return getpwuid_r (user_id, pwd_r, buf_r, len_r); + } + + /* This is used on IRIX 5.2. */ + template + static inline int + getpwuid_adaptor(T_passwd * (*getpwuid_r)(T_uid user_id, T_passwd *pwd_r, + T_buf *buf_r, T_len len_r), + uid_t user_id, struct passwd *pwd_r, + char *buf_r, size_t len_r, struct passwd **pwd_entry) + { + *pwd_entry = getpwuid_r (user_id, pwd_r, buf_r, len_r); + return (*pwd_entry == NULL) ? errno : 0; + } + #endif + + void + java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops) + { + // A convenience define. + #define SET(Prop,Val) \ + newprops->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val)) + + // A mixture of the Java Product Versioning Specification + // (introduced in 1.2), and earlier versioning properties. + SET ("java.version", GCJVERSION); + SET ("java.vendor", "Free Software Foundation, Inc."); + SET ("java.vendor.url", "http://gcc.gnu.org/java/"); + SET ("java.class.version", "46.0"); + SET ("java.vm.specification.version", "1.0"); + SET ("java.vm.specification.name", "Java(tm) Virtual Machine Specification"); + SET ("java.vm.specification.vendor", "Sun Microsystems Inc."); + SET ("java.vm.version", __VERSION__); + SET ("java.vm.vendor", "Free Software Foundation, Inc."); + SET ("java.vm.name", "GNU libgcj"); + SET ("java.specification.version", "1.3"); + SET ("java.specification.name", "Java(tm) Platform API Specification"); + SET ("java.specification.vendor", "Sun Microsystems Inc."); + + char value[100]; + #define NAME "GNU libgcj " + strcpy (value, NAME); + strncpy (value + sizeof (NAME) - 1, __VERSION__, + sizeof(value) - sizeof(NAME)); + value[sizeof (value) - 1] = '\0'; + jstring version = JvNewStringLatin1 (value); + newprops->put (JvNewStringLatin1 ("java.fullversion"), version); + newprops->put (JvNewStringLatin1 ("java.vm.info"), version); + + // This definition is rather arbitrary: we choose $(prefix). In + // part we do this because most people specify only --prefix and + // nothing else when installing gcj. Plus, people are free to + // redefine `java.home' with `-D' if necessary. + SET ("java.home", PREFIX); + SET ("gnu.classpath.home", PREFIX); + + SET ("file.encoding", default_file_encoding); + + #ifdef HAVE_UNAME + struct utsname u; + if (! uname (&u)) + { + SET ("os.name", u.sysname); + SET ("os.arch", u.machine); + SET ("os.version", u.release); + } + else + { + SET ("os.name", "unknown"); + SET ("os.arch", "unknown"); + SET ("os.version", "unknown"); + } + #endif /* HAVE_UNAME */ + + #ifndef NO_GETUID + #ifdef HAVE_PWD_H + uid_t user_id = getuid (); + struct passwd *pwd_entry; + + #ifdef HAVE_GETPWUID_R + struct passwd pwd_r; + size_t len_r = 200; + char *buf_r = (char *) _Jv_AllocBytes (len_r); + + while (buf_r != NULL) + { + int r = getpwuid_adaptor (getpwuid_r, user_id, &pwd_r, + buf_r, len_r, &pwd_entry); + if (r == 0) + break; + else if (r != ERANGE) + { + pwd_entry = NULL; + break; + } + len_r *= 2; + buf_r = (char *) _Jv_AllocBytes (len_r); + } + #else + pwd_entry = getpwuid (user_id); + #endif /* HAVE_GETPWUID_R */ + + if (pwd_entry != NULL) + { + SET ("user.name", pwd_entry->pw_name); + SET ("user.home", pwd_entry->pw_dir); + } + #endif /* HAVE_PWD_H */ + #endif /* NO_GETUID */ + + #ifdef HAVE_GETCWD + #ifdef HAVE_UNISTD_H + /* Use getcwd to set "user.dir". */ + int buflen = 250; + char *buffer = (char *) malloc (buflen); + while (buffer != NULL) + { + if (getcwd (buffer, buflen) != NULL) + { + SET ("user.dir", buffer); + break; + } + if (errno != ERANGE) + break; + buflen = 2 * buflen; + buffer = (char *) realloc (buffer, buflen); + } + if (buffer != NULL) + free (buffer); + #endif /* HAVE_UNISTD_H */ + #endif /* HAVE_GETCWD */ + + // Set user locale properties based on setlocale() + #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) + // We let the user choose the locale. However, since Java differs + // from POSIX, we arbitrarily pick LC_MESSAGES as determining the + // Java locale. We can't use LC_ALL because it might return a full + // list of all the settings. If we don't have LC_MESSAGES then we + // just default to `en_US'. + setlocale (LC_ALL, ""); + char *locale = setlocale (LC_MESSAGES, ""); + if (locale && strlen (locale) >= 2) + { + char buf[3]; + buf[2] = '\0'; + // copy the first two chars to user.language + strncpy (buf, locale, 2); + SET ("user.language", buf); + // if the next char is a '_', copy the two after that to user.region + locale += 2; + if (locale[0] == '_') + { + locale++; + strncpy (buf, locale, 2); + SET ("user.region", buf); + } + } + else + #endif /* HAVE_SETLOCALE and HAVE_LC_MESSAGES */ + { + SET ("user.language", "en"); + SET ("user.region", "US"); + } + + // Set some properties according to whatever was compiled in with + // `-D'. + for (int i = 0; _Jv_Compiler_Properties[i]; ++i) + { + const char *s, *p; + // Find the `='. + for (s = p = _Jv_Compiler_Properties[i]; *s && *s != '='; ++s) + ; + jstring name = JvNewStringLatin1 (p, s - p); + jstring val = JvNewStringLatin1 (*s == '=' ? s + 1 : s); + newprops->put (name, val); + } + + // Set the system properties from the user's environment. + #ifndef DISABLE_GETENV_PROPERTIES + if (_Jv_Environment_Properties) + { + size_t i = 0; + + while (_Jv_Environment_Properties[i].key) + { + SET (_Jv_Environment_Properties[i].key, + _Jv_Environment_Properties[i].value); + i++; + } + } + #endif + + if (_Jv_Jar_Class_Path) + newprops->put(JvNewStringLatin1 ("java.class.path"), + JvNewStringLatin1 (_Jv_Jar_Class_Path)); + else + { + // FIXME: find libgcj.zip and append its path? + char *classpath = ::getenv("CLASSPATH"); + jstring cp = newprops->getProperty (JvNewStringLatin1("java.class.path")); + java::lang::StringBuffer *sb = new java::lang::StringBuffer (); + + if (classpath) + { + sb->append (JvNewStringLatin1 (classpath)); + #ifdef WIN32 + sb->append ((jchar) ';'); + #else + sb->append ((jchar) ':'); + #endif + } + if (cp != NULL) + sb->append (cp); + else + sb->append ((jchar) '.'); + + newprops->put(JvNewStringLatin1 ("java.class.path"), + sb->toString ()); + } + + // The name used to invoke this process (argv[0] in C). + SET ("gnu.gcj.progname", _Jv_GetSafeArg (0)); + + // Allow platform specific settings and overrides. + _Jv_platform_initProperties (newprops); + + // If java.library.path is set, tell libltdl so we search the new + // directories as well. FIXME: does this work properly on Windows? + String *path = newprops->getProperty(JvNewStringLatin1("java.library.path")); + if (path) + { + char *val = (char *) _Jv_Malloc (JvGetStringUTFLength (path) + 1); + jsize total = JvGetStringUTFRegion (path, 0, path->length(), val); + val[total] = '\0'; + _Jv_SetDLLSearchPath (val); + _Jv_Free (val); + } + else + { + // Set a value for user code to see. + // FIXME: JDK sets this to the actual path used, including + // LD_LIBRARY_PATH, etc. + SET ("java.library.path", ""); + } + } + + java::lang::Process * + java::lang::Runtime::execInternal (jstringArray cmd, + jstringArray env, + java::io::File *dir) + { + return new java::lang::ConcreteProcess (cmd, env, dir); + } + + jint + java::lang::Runtime::availableProcessors (void) + { + // FIXME: find the real value. + return 1; + } + + jstring + java::lang::Runtime::nativeGetLibname (jstring pathname, jstring libname) + { + java::lang::StringBuffer *sb = new java::lang::StringBuffer (); + sb->append(pathname); + if (pathname->length() > 0) + { + // FIXME: use platform function here. + #ifdef WIN32 + sb->append ((jchar) '\\'); + #else + sb->append ((jchar) '/'); + #endif + } + + sb->append (JvNewStringLatin1 (_Jv_platform_solib_prefix)); + sb->append(libname); + sb->append (JvNewStringLatin1 (_Jv_platform_solib_suffix)); + + return sb->toString(); + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natString.cc gcc-3.3/libjava/java/lang/natString.cc *** gcc-3.2.3/libjava/java/lang/natString.cc 2001-11-15 02:22:52.000000000 +0000 --- gcc-3.3/libjava/java/lang/natString.cc 2002-06-13 18:16:26.000000000 +0000 *************** *** 1,6 **** // natString.cc - Implementation of java.lang.String native methods. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natString.cc - Implementation of java.lang.String native methods. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** unintern (jobject obj) *** 198,204 **** // interning the String. If we subsequently re-intern the same // String, then we set the bit. When finalizing, if the bit is set // then we clear it and re-register the finalizer. We know this is ! // a safe approach because both the intern() and unintern() acquire // the class lock; this bit can't be manipulated when the lock is // not held. So if we are finalizing and the bit is clear then we // know all references are gone and we can clear the entry in the --- 198,204 ---- // interning the String. If we subsequently re-intern the same // String, then we set the bit. When finalizing, if the bit is set // then we clear it and re-register the finalizer. We know this is ! // a safe approach because both intern() and unintern() acquire // the class lock; this bit can't be manipulated when the lock is // not held. So if we are finalizing and the bit is clear then we // know all references are gone and we can clear the entry in the *************** java::lang::String::init(jcharArray char *** 456,464 **** } else { - JvAssert (offset == 0); array = chars; ! pdst = elements (array); } data = array; --- 456,463 ---- } else { array = chars; ! pdst = &(elements(array)[offset]); } data = array; diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natSystem.cc gcc-3.3/libjava/java/lang/natSystem.cc *** gcc-3.2.3/libjava/java/lang/natSystem.cc 2002-04-07 11:30:08.000000000 +0000 --- gcc-3.3/libjava/java/lang/natSystem.cc 2003-02-19 16:27:22.000000000 +0000 *************** *** 1,6 **** // natSystem.cc - Native code implementing System class. ! /* Copyright (C) 1998, 1999, 2000, 2001 , 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natSystem.cc - Native code implementing System class. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** Libgcj License. Please consult the file *** 9,86 **** details. */ #include #include #include #include - #include "platform.h" - - #ifdef HAVE_PWD_H - #include - #endif - #include - - #ifdef HAVE_UNAME - #include - #endif - - #ifdef HAVE_LOCALE_H - #include - #endif - - #ifdef HAVE_LANGINFO_H - #include - #endif - - #if TIME_WITH_SYS_TIME - # include - # include - #else - # if HAVE_SYS_TIME_H - # include - # else - # include - # endif - #endif - #include #include - #include #include #include #include #include #include - #include - #include - #include #include #include void ! java::lang::System::setErr (java::io::PrintStream *newErr) { - checkSetIO (); - // This violates `final' semantics. Oh well. err = newErr; } void ! java::lang::System::setIn (java::io::InputStream *newIn) { - checkSetIO (); - // This violates `final' semantics. Oh well. in = newIn; } void ! java::lang::System::setOut (java::io::PrintStream *newOut) { - checkSetIO (); - // This violates `final' semantics. Oh well. out = newOut; } --- 9,47 ---- details. */ #include + #include #include #include #include #include #include #include #include #include #include #include #include #include void ! java::lang::System::setErr0 (java::io::PrintStream *newErr) { err = newErr; } void ! java::lang::System::setIn0 (java::io::InputStream *newIn) { in = newIn; } void ! java::lang::System::setOut0 (java::io::PrintStream *newOut) { out = newOut; } *************** java::lang::System::identityHashCode (jo *** 167,510 **** return _Jv_HashCode (obj); } ! #if ! defined (DEFAULT_FILE_ENCODING) && defined (HAVE_ICONV) \ ! && defined (HAVE_NL_LANGINFO) ! ! static char * ! file_encoding () ! { ! setlocale (LC_CTYPE, ""); ! char *e = nl_langinfo (CODESET); ! if (e == NULL || *e == '\0') ! e = "8859_1"; ! return e; ! } ! ! #define DEFAULT_FILE_ENCODING file_encoding () ! ! #endif ! ! #ifndef DEFAULT_FILE_ENCODING ! #define DEFAULT_FILE_ENCODING "8859_1" ! #endif ! ! static char *default_file_encoding = DEFAULT_FILE_ENCODING; ! ! #if HAVE_GETPWUID_R ! /* Use overload resolution to find out the signature of getpwuid_r. */ ! ! /* This is Posix getpwuid_r. */ ! template ! static inline int ! getpwuid_adaptor(int (*getpwuid_r)(T_uid user_id, T_passwd *pwd_r, ! T_buf *buf_r, T_len len_r, ! T_passwd **pwd_entry_ptr), ! uid_t user_id, struct passwd *pwd_r, ! char *buf_r, size_t len_r, struct passwd **pwd_entry) ! { ! return getpwuid_r (user_id, pwd_r, buf_r, len_r, pwd_entry); ! } ! ! /* This is used on HPUX 10.20 */ ! template ! static inline int ! getpwuid_adaptor(int (*getpwuid_r)(T_uid user_id, T_passwd *pwd_r, ! T_buf *buf_r, T_len len_r), ! uid_t user_id, struct passwd *pwd_r, ! char *buf_r, size_t len_r, struct passwd **pwd_entry) ! { ! return getpwuid_r (user_id, pwd_r, buf_r, len_r); ! } ! ! /* This is used on IRIX 5.2. */ ! template ! static inline int ! getpwuid_adaptor(T_passwd * (*getpwuid_r)(T_uid user_id, T_passwd *pwd_r, ! T_buf *buf_r, T_len len_r), ! uid_t user_id, struct passwd *pwd_r, ! char *buf_r, size_t len_r, struct passwd **pwd_entry) ! { ! *pwd_entry = getpwuid_r (user_id, pwd_r, buf_r, len_r); ! return (*pwd_entry == NULL) ? errno : 0; ! } ! #endif ! ! /* ! * This method returns a time zone string that is used by init_properties ! * to set the default timezone property 'user.timezone'. That value is ! * used by default as a key into the timezone table used by the ! * java::util::TimeZone class. ! */ ! jstring ! java::lang::System::getSystemTimeZone (void) ! { ! struct tm *tim; ! time_t current_time; ! long tzoffset; ! const char *tz1, *tz2; ! char *tzid; ! ! current_time = time(0); ! ! mktime(tim = localtime(¤t_time)); ! #ifdef STRUCT_TM_HAS_GMTOFF ! // tm_gmtoff is secs EAST of UTC. ! tzoffset = -(tim->tm_gmtoff) + tim->tm_isdst * 3600L; ! #elif HAVE_TIMEZONE ! // timezone is secs WEST of UTC. ! tzoffset = timezone; ! #else ! // FIXME: there must be another global if neither tm_gmtoff nor timezone ! // is available, esp. if tzname is valid. ! // Richard Earnshaw has suggested using difftime to ! // calculate between gmtime and localtime (and accounting for possible ! // daylight savings time) as an alternative. ! tzoffset = 0L; ! #endif ! ! #ifdef HAVE_TM_ZONE ! tz1 = tim->tm_zone; ! tz2 = ""; ! #elif defined (HAVE_TZNAME) ! tz1 = tzname[0]; ! tz2 = strcmp (tzname[0], tzname[1]) ? tzname[1] : ""; ! #else ! // Some targets have no concept of timezones. ! tz1 = "???"; ! tz2 = tz1; ! #endif ! ! if ((tzoffset % 3600) == 0) ! tzoffset = tzoffset / 3600; ! ! tzid = (char*) _Jv_Malloc (strlen(tz1) + strlen(tz2) + 6); ! sprintf(tzid, "%s%ld%s", tz1, tzoffset, tz2); ! jstring retval = JvNewStringUTF (tzid); ! _Jv_Free (tzid); ! ! return retval; ! } ! ! void ! java::lang::System::init_properties (void) { ! JvSynchronize sync (&java::lang::System::class$); ! ! if (properties != NULL) ! return; ! ! java::util::Properties* newprops = new java::util::Properties (); ! ! // A convenience define. ! #define SET(Prop,Val) \ ! newprops->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val)) ! ! // A mixture of the Java Product Versioning Specification ! // (introduced in 1.2), and earlier versioning properties. ! SET ("java.version", GCJVERSION); ! SET ("java.vendor", "Free Software Foundation, Inc."); ! SET ("java.vendor.url", "http://gcc.gnu.org/java/"); ! SET ("java.class.version", "46.0"); ! SET ("java.vm.specification.version", "1.0"); ! SET ("java.vm.specification.name", "Java(tm) Virtual Machine Specification"); ! SET ("java.vm.specification.vendor", "Sun Microsystems Inc."); ! SET ("java.vm.version", __VERSION__); ! SET ("java.vm.vendor", "Free Software Foundation, Inc."); ! SET ("java.vm.name", "GNU libgcj"); ! SET ("java.specification.version", "1.3"); ! SET ("java.specification.name", "Java(tm) Platform API Specification"); ! SET ("java.specification.vendor", "Sun Microsystems Inc."); ! ! char value[100]; ! #define NAME "GNU libgcj " ! strcpy (value, NAME); ! strncpy (value + sizeof (NAME) - 1, __VERSION__, ! sizeof(value) - sizeof(NAME)); ! value[sizeof (value) - 1] = '\0'; ! jstring version = JvNewStringLatin1 (value); ! newprops->put (JvNewStringLatin1 ("java.fullversion"), version); ! newprops->put (JvNewStringLatin1 ("java.vm.info"), version); ! ! // This definition is rather arbitrary: we choose $(prefix). In ! // part we do this because most people specify only --prefix and ! // nothing else when installing gcj. Plus, people are free to ! // redefine `java.home' with `-D' if necessary. ! SET ("java.home", PREFIX); ! ! SET ("file.encoding", default_file_encoding); ! ! #ifdef HAVE_UNAME ! struct utsname u; ! if (! uname (&u)) ! { ! SET ("os.name", u.sysname); ! SET ("os.arch", u.machine); ! SET ("os.version", u.release); ! } ! else ! { ! SET ("os.name", "unknown"); ! SET ("os.arch", "unknown"); ! SET ("os.version", "unknown"); ! } ! #endif /* HAVE_UNAME */ ! ! #ifndef NO_GETUID ! #ifdef HAVE_PWD_H ! uid_t user_id = getuid (); ! struct passwd *pwd_entry; ! ! #ifdef HAVE_GETPWUID_R ! struct passwd pwd_r; ! size_t len_r = 200; ! char *buf_r = (char *) _Jv_AllocBytes (len_r); ! ! while (buf_r != NULL) ! { ! int r = getpwuid_adaptor (getpwuid_r, user_id, &pwd_r, ! buf_r, len_r, &pwd_entry); ! if (r == 0) ! break; ! else if (r != ERANGE) ! { ! pwd_entry = NULL; ! break; ! } ! len_r *= 2; ! buf_r = (char *) _Jv_AllocBytes (len_r); ! } ! #else ! pwd_entry = getpwuid (user_id); ! #endif /* HAVE_GETPWUID_R */ ! ! if (pwd_entry != NULL) ! { ! SET ("user.name", pwd_entry->pw_name); ! SET ("user.home", pwd_entry->pw_dir); ! } ! #endif /* HAVE_PWD_H */ ! #endif /* NO_GETUID */ ! ! #ifdef HAVE_GETCWD ! #ifdef HAVE_UNISTD_H ! /* Use getcwd to set "user.dir". */ ! int buflen = 250; ! char *buffer = (char *) malloc (buflen); ! while (buffer != NULL) ! { ! if (getcwd (buffer, buflen) != NULL) ! { ! SET ("user.dir", buffer); ! break; ! } ! if (errno != ERANGE) ! break; ! buflen = 2 * buflen; ! buffer = (char *) realloc (buffer, buflen); ! } ! if (buffer != NULL) ! free (buffer); ! #endif /* HAVE_UNISTD_H */ ! #endif /* HAVE_GETCWD */ ! ! // Set user locale properties based on setlocale() ! #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) ! // We let the user choose the locale. However, since Java differs ! // from POSIX, we arbitrarily pick LC_MESSAGES as determining the ! // Java locale. We can't use LC_ALL because it might return a full ! // list of all the settings. If we don't have LC_MESSAGES then we ! // just default to `en_US'. ! setlocale (LC_ALL, ""); ! char *locale = setlocale (LC_MESSAGES, ""); ! if (locale && strlen (locale) >= 2) ! { ! char buf[3]; ! buf[2] = '\0'; ! // copy the first two chars to user.language ! strncpy (buf, locale, 2); ! SET ("user.language", buf); ! // if the next char is a '_', copy the two after that to user.region ! locale += 2; ! if (locale[0] == '_') ! { ! locale++; ! strncpy (buf, locale, 2); ! SET ("user.region", buf); ! } ! } ! else ! #endif /* HAVE_SETLOCALE and HAVE_LC_MESSAGES */ ! { ! SET ("user.language", "en"); ! SET ("user.region", "US"); ! } ! ! // Set the "user.timezone" property. ! jstring timezone = getDefaultTimeZoneId (); ! if (timezone != NULL) ! newprops->put (JvNewStringLatin1 ("user.timezone"), timezone); ! ! // Set some properties according to whatever was compiled in with ! // `-D'. ! for (int i = 0; _Jv_Compiler_Properties[i]; ++i) ! { ! const char *s, *p; ! // Find the `='. ! for (s = p = _Jv_Compiler_Properties[i]; *s && *s != '='; ++s) ! ; ! jstring name = JvNewStringLatin1 (p, s - p); ! jstring val = JvNewStringLatin1 (*s == '=' ? s + 1 : s); ! newprops->put (name, val); ! } ! ! // Set the system properties from the user's environment. ! #ifndef DISABLE_GETENV_PROPERTIES ! if (_Jv_Environment_Properties) ! { ! size_t i = 0; ! ! while (_Jv_Environment_Properties[i].key) ! { ! SET (_Jv_Environment_Properties[i].key, ! _Jv_Environment_Properties[i].value); ! i++; ! } ! } ! #endif ! ! if (_Jv_Jar_Class_Path) ! newprops->put(JvNewStringLatin1 ("java.class.path"), ! JvNewStringLatin1 (_Jv_Jar_Class_Path)); ! else ! { ! // FIXME: find libgcj.zip and append its path? ! char *classpath = ::getenv("CLASSPATH"); ! jstring cp = newprops->getProperty (JvNewStringLatin1("java.class.path")); ! java::lang::StringBuffer *sb = new java::lang::StringBuffer (); ! ! if (classpath) ! { ! sb->append (JvNewStringLatin1 (classpath)); ! #ifdef WIN32 ! sb->append ((jchar) ';'); ! #else ! sb->append ((jchar) ':'); ! #endif ! } ! if (cp != NULL) ! sb->append (cp); ! else ! sb->append ((jchar) '.'); ! ! newprops->put(JvNewStringLatin1 ("java.class.path"), ! sb->toString ()); ! } ! ! // Allow platform specific settings and overrides. ! _Jv_platform_initProperties (newprops); ! // Finally, set the field. This ensures that concurrent getProperty() ! // calls will return initialized values without requiring them to be ! // synchronized in the common case. ! properties = newprops; } --- 128,142 ---- return _Jv_HashCode (obj); } ! jboolean ! java::lang::System::isWordsBigEndian (void) { ! union ! { ! long lval; ! char cval; ! } u; ! u.lval = 1; ! return u.cval == 0; } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natThread.cc gcc-3.3/libjava/java/lang/natThread.cc *** gcc-3.2.3/libjava/java/lang/natThread.cc 2001-08-26 11:30:09.000000000 +0000 --- gcc-3.3/libjava/java/lang/natThread.cc 2002-04-10 20:36:04.000000000 +0000 *************** *** 1,6 **** // natThread.cc - Native part of Thread class. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natThread.cc - Native part of Thread class. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** _Jv_AttachCurrentThread(jstring name, ja *** 410,415 **** --- 410,430 ---- return thread; } + java::lang::Thread* + _Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group) + { + java::lang::Thread *thread = _Jv_ThreadCurrent (); + if (thread != NULL) + return thread; + if (name == NULL) + name = java::lang::Thread::gen_name (); + thread = new java::lang::Thread (NULL, group, NULL, name); + thread->setDaemon (true); + _Jv_AttachCurrentThread (thread); + _Jv_NotifyThreadStart (thread); + return thread; + } + jint _Jv_DetachCurrentThread (void) { diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natThrowable.cc gcc-3.3/libjava/java/lang/natThrowable.cc *** gcc-3.2.3/libjava/java/lang/natThrowable.cc 2002-02-07 19:26:06.000000000 +0000 --- gcc-3.3/libjava/java/lang/natThrowable.cc 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,104 **** - // natThrowable.cc - Superclass for all exceptions. - - /* Copyright (C) 2000 Free Software Foundation, Inc - - This file is part of libgcj. - - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - - /** - * @author Andrew Haley - * @date Jan 6 2000 - */ - - #include - - #include - - #include - #include - #include - #include - #include - #include - #include - #include - - #include - - #include - #include - - #include - - #ifdef HAVE_EXECINFO_H - #include - #endif - - #include - - /* FIXME: size of the stack trace is limited to 128 elements. It's - undoubtedly sensible to limit the stack trace, but 128 is rather - arbitrary. It may be better to configure this. */ - - java::lang::Throwable * - java::lang::Throwable::fillInStackTrace (void) - { - if (! trace_enabled) - return this; - #if defined (HAVE_BACKTRACE) - void *p[128]; - - // We subtract 1 from the number of elements because we don't want - // to include the call to fillInStackTrace in the trace. - int n = backtrace (p, 128) - 1; - - if (n > 0) - { - // We copy the array below to deal with alignment issues. - stackTrace = JvNewByteArray (n * sizeof p[0]); - memcpy (elements (stackTrace), p+1, (n * sizeof p[0])); - } - - #endif - - return this; - } - - void - java::lang::Throwable::printRawStackTrace (java::io::PrintWriter *wr) - { - wr->println (toString ()); - #ifdef HAVE_BACKTRACE - if (!stackTrace) - return; - - int depth = stackTrace->length / sizeof (void *); - void *p[depth]; - memcpy (p, elements (stackTrace), sizeof p); - - _Jv_name_finder finder (_Jv_ThisExecutable ()); - - for (int i = 0; i < depth; i++) - { - bool found = finder.lookup (p[i]); - wr->print (JvNewStringLatin1 (" at ")); - wr->print (JvNewStringLatin1 (finder.hex)); - if (found) - { - wr->print (JvNewStringLatin1 (": ")); - wr->print (JvNewStringLatin1 (finder.method_name)); - if (finder.file_name[0]) - { - wr->print (JvNewStringLatin1 (" (")); - wr->print (JvNewStringLatin1 (finder.file_name)); - wr->print (JvNewStringLatin1 (")")); - } - } - wr->println (); - } - #endif /* HAVE_BACKTRACE */ - wr->flush (); - } --- 0 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natVMSecurityManager.cc gcc-3.3/libjava/java/lang/natVMSecurityManager.cc *** gcc-3.2.3/libjava/java/lang/natVMSecurityManager.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/natVMSecurityManager.cc 2002-12-05 00:49:29.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + // Written by Tom Tromey + + #include + + #include + #include + #include + #include + #include + #include + #include + + JArray * + java::lang::VMSecurityManager::getClassContext () + { + JArray *result = NULL; + gnu::gcj::runtime::StackTrace *t = new gnu::gcj::runtime::StackTrace(); + if (t) + { + int maxlen = t->length(); + + int len = 0; + while (len < maxlen) + { + jclass klass = t->classAt(len); + if (klass != NULL && klass != &java::lang::VMSecurityManager::class$ + && klass != &java::lang::SecurityManager::class$) + ++len; + } + + result = + (JArray *) _Jv_NewObjectArray (len, &java::lang::Class::class$, + NULL); + + len = 0; + while (len < maxlen) + { + jclass klass = t->classAt(len); + if (klass != NULL && klass != &java::lang::VMSecurityManager::class$ + && klass != &java::lang::SecurityManager::class$) + elements(result)[len++] = klass; + } + } + + return result; + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/natWin32Process.cc gcc-3.3/libjava/java/lang/natWin32Process.cc *** gcc-3.2.3/libjava/java/lang/natWin32Process.cc 2002-02-02 04:19:24.000000000 +0000 --- gcc-3.3/libjava/java/lang/natWin32Process.cc 2003-03-01 23:01:56.000000000 +0000 *************** *** 0 **** --- 1,295 ---- + // natWin32Process.cc - Native side of Win32 process code. + + /* Copyright (C) 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + + #define WIN32_LEAN_AND_MEAN + #include + + // Conflicts with the definition in "java/lang/reflect/Modifier.h" + #undef STRICT + + #include + #include + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + void + java::lang::ConcreteProcess::cleanup (void) + { + if (inputStream != NULL) + { + inputStream->close (); + inputStream = NULL; + } + + if (outputStream != NULL) + { + outputStream->close (); + outputStream = NULL; + } + + if (errorStream != NULL) + { + errorStream->close (); + errorStream = NULL; + } + } + + void + java::lang::ConcreteProcess::destroy (void) + { + if (! hasExited ()) + { + // Kill it forcibly and assign an (arbitrary) exit code of 0. + TerminateProcess ((HANDLE) procHandle, 0); + exitCode = 0; + + cleanup (); + } + } + + jboolean + java::lang::ConcreteProcess::hasExited (void) + { + DWORD exitStatus; + + if (GetExitCodeProcess ((HANDLE) procHandle, &exitStatus) != 0) + { + // NOTE: STILL_ACTIVE is defined as "259" by Win32 - if the + // child actually exits with this return code, we have a + // problem here. See MSDN documentation on GetExitCodeProcess( ). + + if (exitStatus == STILL_ACTIVE) + return false; + else + { + cleanup (); + exitCode = exitStatus; + return true; + } + } + else + return true; + } + + jint + java::lang::ConcreteProcess::waitFor (void) + { + if (! hasExited ()) + { + DWORD exitStatus = 0UL; + + // FIXME: The wait should be interruptible. + WaitForSingleObject ((HANDLE) procHandle, INFINITE); + + GetExitCodeProcess ((HANDLE) procHandle, &exitStatus); + exitCode = exitStatus; + + cleanup (); + } + + return exitCode; + } + + static char * + new_string (jstring string) + { + jsize s = _Jv_GetStringUTFLength (string); + char *buf = (char *) _Jv_Malloc (s + 1); + _Jv_GetStringUTFRegion (string, 0, s, buf); + buf[s] = '\0'; + return buf; + } + + void + java::lang::ConcreteProcess::startProcess (jstringArray progarray, + jstringArray envp, + java::io::File *dir) + { + using namespace java::io; + + procHandle = (jint) INVALID_HANDLE_VALUE; + + // Reconstruct the command line. + jstring *elts = elements (progarray); + + int cmdLineLen = 0; + + for (int i = 0; i < progarray->length; ++i) + cmdLineLen += (_Jv_GetStringUTFLength (elts[i]) + 3); + + char *cmdLine = (char *) _Jv_Malloc (cmdLineLen + 1); + char *cmdLineCurPos = cmdLine; + + for (int i = 0; i < progarray->length; ++i) + { + if (i > 0) + *cmdLineCurPos++ = ' '; + *cmdLineCurPos++ = '\"'; + jsize s = _Jv_GetStringUTFLength (elts[i]); + _Jv_GetStringUTFRegion (elts[i], 0, s, cmdLineCurPos); + cmdLineCurPos += s; + *cmdLineCurPos++ = '\"'; + } + *cmdLineCurPos = '\0'; + + // Get the environment, if any. + char *env = NULL; + if (envp) + { + elts = elements (envp); + + int envLen = 0; + for (int i = 0; i < envp->length; ++i) + envLen += (_Jv_GetStringUTFLength (elts[i]) + 1); + + env = (char *) _Jv_Malloc (envLen + 1); + + int j = 0; + for (int i = 0; i < envp->length; ++i) + { + jsize s = _Jv_GetStringUTFLength (elts[i]); + _Jv_GetStringUTFRegion (elts[i], 0, s, (env + j)); + + j += s; + *(env + j) = '\0'; + j++; + } + *(env + j) = '\0'; + } + + // Get the working directory path, if specified. + char *wdir = NULL; + if (dir != NULL) + wdir = new_string (dir->getPath ()); + + errorStream = NULL; + inputStream = NULL; + outputStream = NULL; + + java::lang::Throwable *exc = NULL; + + try + { + // We create anonymous pipes to communicate with the child + // on each of standard streams. + + HANDLE cldStdInRd, cldStdInWr; + HANDLE cldStdOutRd, cldStdOutWr; + HANDLE cldStdErrRd, cldStdErrWr; + + SECURITY_ATTRIBUTES sAttrs; + + // Explicitly allow the handles to the pipes to be inherited. + sAttrs.nLength = sizeof (SECURITY_ATTRIBUTES); + sAttrs.bInheritHandle = 1; + sAttrs.lpSecurityDescriptor = NULL; + + + char tmpBuff[64]; + if (CreatePipe (&cldStdInRd, &cldStdInWr, &sAttrs, 0) == 0) + { + sprintf (tmpBuff, + "Error creating stdin pipe (Win32 Error Code: %lu)", + GetLastError ()); + throw new IOException (JvNewStringLatin1 (tmpBuff)); + } + + if (CreatePipe (&cldStdOutRd, &cldStdOutWr, &sAttrs, 0) == 0) + { + sprintf (tmpBuff, + "Error creating stdout pipe (Win32 Error Code: %lu)", + GetLastError ()); + throw new IOException (JvNewStringLatin1 (tmpBuff)); + } + + if (CreatePipe (&cldStdErrRd, &cldStdErrWr, &sAttrs, 0) == 0) + { + sprintf (tmpBuff, + "Error creating stderr pipe (Win32 Error Code: %lu)", + GetLastError ()); + throw new IOException (JvNewStringLatin1 (tmpBuff)); + } + + outputStream = new FileOutputStream + (new FileDescriptor ((jint) cldStdInWr)); + inputStream = new FileInputStream + (new FileDescriptor ((jint) cldStdOutRd)); + errorStream = new FileInputStream + (new FileDescriptor ((jint) cldStdErrRd)); + + // Now create the child process. + PROCESS_INFORMATION pi; + STARTUPINFO si; + + ZeroMemory (&pi, sizeof (PROCESS_INFORMATION)); + + ZeroMemory (&si, sizeof (STARTUPINFO)); + si.cb = sizeof (STARTUPINFO); + + // Explicitly specify the handles to the standard streams. + si.dwFlags |= STARTF_USESTDHANDLES; + + si.hStdInput = cldStdInRd; + si.hStdOutput = cldStdOutWr; + si.hStdError = cldStdErrWr; + + if (CreateProcess (NULL, + cmdLine, + NULL, + NULL, + 1, + 0, + env, + wdir, + &si, + &pi) == 0) + { + sprintf (tmpBuff, + "Error creating child process (Win32 Error Code: %lu)", + GetLastError ()); + throw new IOException (JvNewStringLatin1 (tmpBuff)); + } + + procHandle = (jint ) pi.hProcess; + + // Close the wrong ends (for the parent) of the pipes. + CloseHandle (cldStdInRd); + CloseHandle (cldStdOutWr); + CloseHandle (cldStdErrWr); + + _Jv_Free (cmdLine); + if (env != NULL) + _Jv_Free (env); + if (wdir != NULL) + _Jv_Free (wdir); + } + catch (java::lang::Throwable *thrown) + { + cleanup (); + exc = thrown; + } + + if (exc != NULL) + throw exc; + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NegativeArraySizeException.java gcc-3.3/libjava/java/lang/NegativeArraySizeException.java *** gcc-3.2.3/libjava/java/lang/NegativeArraySizeException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NegativeArraySizeException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* NegativeArraySizeException.java -- exception thrown when an attempt is ! made to create an array with a negative size. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* NegativeArraySizeException.java -- thrown on attempt to create array ! with a negative size ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,79 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** - * Exceptions may be thrown by one part of a Java program and caught - * by another in order to deal with exceptional conditions. * Thrown when an attempt is made to create an array with a negative ! * size. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class NegativeArraySizeException extends RuntimeException { ! static final long serialVersionUID = -8960118058596991861L; /** * Create an exception without a message. */ public NegativeArraySizeException() ! { ! super(); ! } /** * Create an exception with a message. */ public NegativeArraySizeException(String s) ! { ! super(s); ! } } --- 39,77 ---- package java.lang; /** * Thrown when an attempt is made to create an array with a negative ! * size. For example:
        ! *
        !  * int i = -1;
        !  * int[] array = new int[i];
        !  * 
        * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class NegativeArraySizeException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -8960118058596991861L; /** * Create an exception without a message. */ public NegativeArraySizeException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public NegativeArraySizeException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NoClassDefFoundError.java gcc-3.3/libjava/java/lang/NoClassDefFoundError.java *** gcc-3.2.3/libjava/java/lang/NoClassDefFoundError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NoClassDefFoundError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* NoClassDefFoundError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoClassDefFoundError.java -- thrown when a ClassLoader cannot find a class ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,80 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * A NoClassDefFoundError is thrown when a classloader or the * Java Virtual Machine tries to load a class and no definition of the class * can be found. This could happen when using the new expression ! * or during a normal method call. The reason this would occur at runtime is * because the missing class definition existed when the currently executing * class was compiled, but now that definition cannot be found. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class NoClassDefFoundError extends LinkageError { ! static final long serialVersionUID = 9095859863287012458L; /** * Create an error without a message. */ public NoClassDefFoundError() ! { ! super(); ! } /** * Create an error with a message. */ public NoClassDefFoundError(String s) ! { ! super(s); ! } } --- 38,76 ---- package java.lang; /** * A NoClassDefFoundError is thrown when a classloader or the * Java Virtual Machine tries to load a class and no definition of the class * can be found. This could happen when using the new expression ! * or during a normal method call. The reason this would occur at runtime is * because the missing class definition existed when the currently executing * class was compiled, but now that definition cannot be found. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class NoClassDefFoundError extends LinkageError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 9095859863287012458L; /** * Create an error without a message. */ public NoClassDefFoundError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public NoClassDefFoundError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NoSuchFieldError.java gcc-3.3/libjava/java/lang/NoSuchFieldError.java *** gcc-3.2.3/libjava/java/lang/NoSuchFieldError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NoSuchFieldError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* NoSuchFieldError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoSuchFieldError.java -- thrown when the linker does not find a field ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,77 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * A NoSuchFieldError is thrown if an application attempts ! * to access the field of an object and that object no longer has that ! * field. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class NoSuchFieldError extends IncompatibleClassChangeError { ! static final long serialVersionUID = -3456430195886129035L; /** * Create an error without a message. */ public NoSuchFieldError() ! { ! super(); ! } /** * Create an error with a message. */ public NoSuchFieldError(String s) ! { ! super(s); ! } } --- 38,74 ---- package java.lang; /** * A NoSuchFieldError is thrown if an application attempts ! * to access a field of a class, and that class no longer has that field. ! * This is normally detected by the compiler, so it signals that you are ! * using binary incompatible class versions. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class NoSuchFieldError extends IncompatibleClassChangeError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -3456430195886129035L; /** * Create an error without a message. */ public NoSuchFieldError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public NoSuchFieldError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NoSuchFieldException.java gcc-3.3/libjava/java/lang/NoSuchFieldException.java *** gcc-3.2.3/libjava/java/lang/NoSuchFieldException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NoSuchFieldException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* NoSuchFieldException.java -- exception thrown to indicate the class does ! not have the specified field. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoSuchFieldException.java -- thrown when reflecting a non-existant field ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,78 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * Thrown to indicate the class does not have the specified field. * - * @since JDK 1.1 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class NoSuchFieldException extends Exception { ! static final long serialVersionUID = -6143714805279938260L; /** * Create an exception without a message. */ public NoSuchFieldException() ! { ! super(); ! } /** * Create an exception with a message. */ public NoSuchFieldException(String s) ! { ! super(s); ! } } --- 38,73 ---- package java.lang; /** ! * Thrown to indicate the class does not have the specified field. This is ! * caused by a variety of reflection methods, when looking up a field by name. * * @author Brian Jones * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ public class NoSuchFieldException extends Exception { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -6143714805279938260L; /** * Create an exception without a message. */ public NoSuchFieldException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public NoSuchFieldException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NoSuchMethodError.java gcc-3.3/libjava/java/lang/NoSuchMethodError.java *** gcc-3.2.3/libjava/java/lang/NoSuchMethodError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NoSuchMethodError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* NoSuchMethodError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoSuchMethodError.java -- thrown when the linker does not find a method ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,77 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * A NoSuchMethodError is thrown if an application attempts ! * to access a method of a class, and that class no longer has that ! * method. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class NoSuchMethodError extends IncompatibleClassChangeError { static final long serialVersionUID = -3765521442372831335L; /** * Create an error without a message. */ public NoSuchMethodError() ! { ! super(); ! } /** * Create an error with a message. */ public NoSuchMethodError(String s) ! { ! super(s); ! } } --- 38,74 ---- package java.lang; /** * A NoSuchMethodError is thrown if an application attempts ! * to access a method of a class, and that class no longer has that method. ! * This is normally detected by the compiler, so it signals that you are ! * using binary incompatible class versions. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class NoSuchMethodError extends IncompatibleClassChangeError { + /** + * Compatible with JDK 1.0+. + */ static final long serialVersionUID = -3765521442372831335L; /** * Create an error without a message. */ public NoSuchMethodError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public NoSuchMethodError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NoSuchMethodException.java gcc-3.3/libjava/java/lang/NoSuchMethodException.java *** gcc-3.2.3/libjava/java/lang/NoSuchMethodException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NoSuchMethodException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* NoSuchMethodException.java -- exception thrown to indicate the class ! does not have the specified method. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoSuchMethodException.java -- thrown when reflecting a non-existant method ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,78 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * Thrown to indicate the class does not have the specified method. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class NoSuchMethodException extends Exception { ! static final long serialVersionUID = 5034388446362600923L; /** * Create an exception without a message. */ public NoSuchMethodException() ! { ! super(); ! } /** * Create an exception with a message. */ public NoSuchMethodException(String s) ! { ! super(s); ! } } --- 38,72 ---- package java.lang; /** ! * Thrown to indicate the class does not have the specified method. This is ! * caused by a variety of reflection methods, when looking up a method by name. * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class NoSuchMethodException extends Exception { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 5034388446362600923L; /** * Create an exception without a message. */ public NoSuchMethodException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public NoSuchMethodException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NullPointerException.java gcc-3.3/libjava/java/lang/NullPointerException.java *** gcc-3.2.3/libjava/java/lang/NullPointerException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NullPointerException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* NullPointerException.java -- exception thrown when attempting to use null ! where an object is required. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NullPointerException.java -- thrown when using null instead of an object ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,79 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** - * Exceptions may be thrown by one part of a Java program and caught - * by another in order to deal with exceptional conditions. * Thrown when attempting to use null where an object ! * is required, such as when accessing an instance method of a null object. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class NullPointerException extends RuntimeException { ! static final long serialVersionUID = 5162710183389028792L; /** * Create an exception without a message. */ public NullPointerException() ! { ! super(); ! } /** * Create an exception with a message. */ public NullPointerException(String s) ! { ! super(s); ! } } --- 38,82 ---- package java.lang; /** * Thrown when attempting to use null where an object ! * is required. The Virtual Machine automatically throws this exception ! * for the following:
          ! *
        • Calling an instance method on a null object
        • ! *
        • Accessing or modifying a field of a null object
        • ! *
        • Taking the array length of a null array
        • ! *
        • Accessing or modifying the slots of a null array
        • ! *
        • Throwing a null Throwable
        • ! *
        • Synchronizing on a null object
        • ! *
        ! *

        Applications should also throw NullPointerExceptions whenever ! * null is an inappropriate parameter to a method. * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class NullPointerException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 5162710183389028792L; /** * Create an exception without a message. */ public NullPointerException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public NullPointerException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/NumberFormatException.java gcc-3.3/libjava/java/lang/NumberFormatException.java *** gcc-3.2.3/libjava/java/lang/NumberFormatException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/NumberFormatException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* NumberFormatException.java -- exception may be thrown when attempting to ! convert a String to one of the numeric types, but the operation fails. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NumberFormatException.java -- thrown when parsing a bad string as a number ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,80 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * Can be thrown when attempting to convert a String to * one of the numeric types, but the operation fails because the string * has the wrong format. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class NumberFormatException extends IllegalArgumentException { ! static final long serialVersionUID = -2848938806368998894L; /** * Create an exception without a message. */ public NumberFormatException() ! { ! super(); ! } /** * Create an exception with a message. */ public NumberFormatException(String s) ! { ! super(s); ! } } --- 38,73 ---- package java.lang; /** ! * Can be thrown when attempting to convert a String to * one of the numeric types, but the operation fails because the string * has the wrong format. * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class NumberFormatException extends IllegalArgumentException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -2848938806368998894L; /** * Create an exception without a message. */ public NumberFormatException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public NumberFormatException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Number.java gcc-3.3/libjava/java/lang/Number.java *** gcc-3.2.3/libjava/java/lang/Number.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Number.java 2002-06-13 18:16:25.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.Number ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Number.java =- abstract superclass of numeric objects ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 41,94 **** import java.io.Serializable; /** ! ** Number is a generic superclass of all the numeric classes, namely ! ** Byte, Short, Integer, ! ** Long, Float, and Double. ! ** ! ** It provides ways to convert from any one value to any other. ! ** ! ** @author Paul Fisher ! ** @author John Keiser ! ** @author Warren Levy ! ** @since JDK1.0 ! **/ public abstract class Number implements Serializable { ! /** Return the value of this Number as a byte. ! ** @return the value of this Number as a byte. ! **/ ! public byte byteValue() ! { ! return (byte) intValue(); ! } ! /** Return the value of this Number as a short. ! ** @return the value of this Number as a short. ! **/ ! public short shortValue() { - return (short) intValue(); } ! /** Return the value of this Number as an int. ! ** @return the value of this Number as an int. ! **/ public abstract int intValue(); ! /** Return the value of this Number as a long. ! ** @return the value of this Number as a long. ! **/ public abstract long longValue(); ! /** Return the value of this Number as a float. ! ** @return the value of this Number as a float. ! **/ public abstract float floatValue(); ! /** Return the value of this Number as a float. ! ** @return the value of this Number as a float. ! **/ public abstract double doubleValue(); ! private static final long serialVersionUID = -8742448824652078965L; } --- 41,131 ---- import java.io.Serializable; /** ! * Number is a generic superclass of all the numeric classes, including ! * the wrapper classes {@link Byte}, {@link Short}, {@link Integer}, ! * {@link Long}, {@link Float}, and {@link Double}. Also worth mentioning ! * are the classes in {@link java.math}. ! * ! * It provides ways to convert numeric objects to any primitive. ! * ! * @author Paul Fisher ! * @author John Keiser ! * @author Warren Levy ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 ! */ public abstract class Number implements Serializable { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -8742448824652078965L; ! /** ! * Table for calculating digits, used in Character, Long, and Integer. ! */ ! static final char[] digits = { ! '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ! 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', ! 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', ! 'u', 'v', 'w', 'x', 'y', 'z' ! }; ! ! /** ! * The basic constructor (often called implicitly). ! */ ! public Number() { } ! /** ! * Return the value of this Number as an int. ! * ! * @return the int value ! */ public abstract int intValue(); ! /** ! * Return the value of this Number as a long. ! * ! * @return the long value ! */ public abstract long longValue(); ! /** ! * Return the value of this Number as a float. ! * ! * @return the float value ! */ public abstract float floatValue(); ! /** ! * Return the value of this Number as a float. ! * ! * @return the double value ! */ public abstract double doubleValue(); ! /** ! * Return the value of this Number as a byte. ! * ! * @return the byte value ! * @since 1.1 ! */ ! public byte byteValue() ! { ! return (byte) intValue(); ! } ! ! /** ! * Return the value of this Number as a short. ! * ! * @return the short value ! * @since 1.1 ! */ ! public short shortValue() ! { ! return (short) intValue(); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/OutOfMemoryError.java gcc-3.3/libjava/java/lang/OutOfMemoryError.java *** gcc-3.2.3/libjava/java/lang/OutOfMemoryError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/OutOfMemoryError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* OutOfMemoryError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* OutOfMemoryError.java -- thrown when a memory allocation fails ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,77 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * When the Java Virtual Machine is unable to allocate an object because it ! * is out of memory and no more memory could be made available by the ! * garbage collector an OutOfMemoryError is thrown. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class OutOfMemoryError extends VirtualMachineError { ! static final long serialVersionUID = 8228564086184010517L; /** * Create an error without a message. */ public OutOfMemoryError() ! { ! super(); ! } /** * Create an error with a message. */ public OutOfMemoryError(String s) ! { ! super(s); ! } } --- 38,73 ---- package java.lang; /** ! * Thrown when the Java Virtual Machine is unable to allocate an object ! * because it is out of memory and no more memory could be made available ! * by the garbage collector. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class OutOfMemoryError extends VirtualMachineError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 8228564086184010517L; /** * Create an error without a message. */ public OutOfMemoryError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public OutOfMemoryError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/PosixProcess.java gcc-3.3/libjava/java/lang/PosixProcess.java *** gcc-3.2.3/libjava/java/lang/PosixProcess.java 2001-09-24 04:51:50.000000000 +0000 --- gcc-3.3/libjava/java/lang/PosixProcess.java 2002-08-14 01:07:59.000000000 +0000 *************** details. */ *** 10,15 **** --- 10,16 ---- package java.lang; + import java.io.File; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; *************** final class ConcreteProcess extends Proc *** 53,67 **** // This is used for actual initialization, as we can't write a // native constructor. ! public native void startProcess (String[] progarray, String[] envp) throws IOException; // This file is copied to `ConcreteProcess.java' before // compilation. Hence the constructor name apparently does not // match the file name. ! public ConcreteProcess (String[] progarray, String[] envp) throws IOException { ! startProcess (progarray, envp); } // The process id. This is cast to a pid_t on the native side. --- 54,73 ---- // This is used for actual initialization, as we can't write a // native constructor. ! public native void startProcess (String[] progarray, ! String[] envp, ! File dir) throws IOException; // This file is copied to `ConcreteProcess.java' before // compilation. Hence the constructor name apparently does not // match the file name. ! public ConcreteProcess (String[] progarray, ! String[] envp, ! File dir) ! throws IOException { ! startProcess (progarray, envp, dir); } // The process id. This is cast to a pid_t on the native side. diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Process.java gcc-3.3/libjava/java/lang/Process.java *** gcc-3.2.3/libjava/java/lang/Process.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Process.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* Process.java - Represent spawned system process. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Process.java - Represent spawned system process ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 41,111 **** import java.io.OutputStream; import java.io.InputStream; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - */ - /** * An instance of a subclass of Process is created by the * Runtime.exec methods. Methods in Process ! * provide a means to send input to a process, obtain the output from a ! * subprocess, destroy a subprocess, obtain the exit value from a * subprocess, and wait for a subprocess to complete. ! * ! * @since JDK 1.0 ! * * @author Brian Jones * @author Tom Tromey */ public abstract class Process { /** * Empty constructor does nothing. */ ! public Process() { } /** ! * Obtain the output stream of the subprocess. It may help to ! * associate this stream as the redirected STDIN file descriptor of ! * the subprocess. */ public abstract OutputStream getOutputStream(); /** ! * Obtain the input stream of the subprocess. It may help to ! * associate this stream as the redirected STDOUT file descriptor of ! * the subprocess. */ public abstract InputStream getInputStream(); /** ! * Obtain the error input stream of the subprocess. It may help to ! * associate this stream as the redirected STDERR file descriptor of ! * the subprocess. */ public abstract InputStream getErrorStream(); /** * The thread calling waitFor will block until the subprocess ! * has terminated. If the process has already terminated then the method * immediately returns with the exit value of the subprocess. - * - * @returns the exit value of the subprocess. A return of 0 - * denotes normal process termination by convention. * ! * @throws InterruptedException is thrown if another thread interrupts ! * the waiting thread. The waiting thread stops waiting. */ ! public abstract int waitFor() ! throws InterruptedException; /** * When a process terminates there is associated with that termination ! * an exit value for the process to indicate why it terminated. A return * of 0 denotes normal process termination by convention. * ! * @returns the exit value of the subprocess. ! * @throws IllegalThreadStateException is thrown if the subprocess ! * represented by the subclass of this class has not yet terminated. */ public abstract int exitValue(); --- 41,123 ---- import java.io.OutputStream; import java.io.InputStream; /** * An instance of a subclass of Process is created by the * Runtime.exec methods. Methods in Process ! * provide a means to send input to a process, obtain the output from a ! * subprocess, destroy a subprocess, obtain the exit value from a * subprocess, and wait for a subprocess to complete. ! * ! *

        This is dependent on the platform, and some processes (like native ! * windowing processes, 16-bit processes in Windows, or shell scripts) may ! * be limited in functionality. Because some platforms have limited buffers ! * between processes, you may need to provide input and read output to prevent ! * the process from blocking, or even deadlocking. ! * ! *

        Even if all references to this object disapper, the process continues ! * to execute to completion. There are no guarantees that the ! * subprocess execute asynchronously or concurrently with the process which ! * owns this object. ! * * @author Brian Jones * @author Tom Tromey + * @see Runtime#exec(String[], String[], File) + * @since 1.0 + * @status updated to 1.4 */ public abstract class Process { /** * Empty constructor does nothing. */ ! public Process() ! { ! } /** ! * Obtain the output stream that sends data to the subprocess. This is ! * the STDIN of the subprocess. When implementing, you should probably ! * use a buffered stream. ! * ! * @return the output stream that pipes to the process input */ public abstract OutputStream getOutputStream(); /** ! * Obtain the input stream that receives data from the subprocess. This is ! * the STDOUT of the subprocess. When implementing, you should probably ! * use a buffered stream. ! * ! * @return the input stream that pipes data from the process output */ public abstract InputStream getInputStream(); /** ! * Obtain the input stream that receives data from the subprocess. This is ! * the STDERR of the subprocess. When implementing, you should probably ! * use a buffered stream. ! * ! * @return the input stream that pipes data from the process error output */ public abstract InputStream getErrorStream(); /** * The thread calling waitFor will block until the subprocess ! * has terminated. If the process has already terminated then the method * immediately returns with the exit value of the subprocess. * ! * @return the subprocess exit value; 0 conventionally denotes success ! * @throws InterruptedException if another thread interrups the blocked one */ ! public abstract int waitFor() throws InterruptedException; /** * When a process terminates there is associated with that termination ! * an exit value for the process to indicate why it terminated. A return * of 0 denotes normal process termination by convention. * ! * @return the exit value of the subprocess ! * @throws IllegalThreadStateException if the subprocess has not terminated */ public abstract int exitValue(); *************** public abstract class Process *** 113,117 **** * Kills the subprocess and all of its children forcibly. */ public abstract void destroy(); ! ! } --- 125,128 ---- * Kills the subprocess and all of its children forcibly. */ public abstract void destroy(); ! } // class Process diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ref/natReference.cc gcc-3.3/libjava/java/lang/ref/natReference.cc *** gcc-3.2.3/libjava/java/lang/ref/natReference.cc 2001-10-03 16:47:02.000000000 +0000 --- gcc-3.3/libjava/java/lang/ref/natReference.cc 2002-11-19 21:59:41.000000000 +0000 *************** *** 1,6 **** // natReference.cc - Native code for References ! /* Copyright (C) 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natReference.cc - Native code for References ! /* Copyright (C) 2001, 2002 Free Software Foundation This file is part of libgcj. *************** add_to_hash (java::lang::ref::Reference *** 165,171 **** if (3 * hash_count >= 2 * hash_size) rehash (); ! jobject referent = the_reference->referent; object_list *item = find_slot (referent); if (item->reference == NULL) { --- 165,172 ---- if (3 * hash_count >= 2 * hash_size) rehash (); ! // Use `copy' here because the `referent' field has been cleared. ! jobject referent = the_reference->copy; object_list *item = find_slot (referent); if (item->reference == NULL) { *************** add_to_hash (java::lang::ref::Reference *** 197,203 **** link = &iter->next; iter = *link; } ! n->next = (*link) ? (*link)->next : NULL; *link = n; } --- 198,204 ---- link = &iter->next; iter = *link; } ! n->next = *link; *link = n; } *************** finalize_referred_to_object (jobject obj *** 249,261 **** // If the copy is already NULL then the user must have // called Reference.clear(). if (ref->copy != NULL) ! { ! if (w == PHANTOM) ! ref->referent = ref->copy; ! else ! ref->copy = NULL; ! ref->enqueue (); ! } object_list *next = head->next; _Jv_Free (head); --- 250,256 ---- // If the copy is already NULL then the user must have // called Reference.clear(). if (ref->copy != NULL) ! ref->enqueue (); object_list *next = head->next; _Jv_Free (head); diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ref/Reference.java gcc-3.3/libjava/java/lang/ref/Reference.java *** gcc-3.2.3/libjava/java/lang/ref/Reference.java 2002-01-22 22:40:18.000000000 +0000 --- gcc-3.3/libjava/java/lang/ref/Reference.java 2002-11-19 21:59:40.000000000 +0000 *************** *** 1,5 **** /* java.lang.ref.Reference ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* java.lang.ref.Reference ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public abstract class Reference *** 185,191 **** */ public boolean enqueue() { ! if (queue != null) { queue.enqueue(this); queue = null; --- 185,191 ---- */ public boolean enqueue() { ! if (queue != null && nextOnQueue == null) { queue.enqueue(this); queue = null; diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/InvocationHandler.java gcc-3.3/libjava/java/lang/reflect/InvocationHandler.java *** gcc-3.2.3/libjava/java/lang/reflect/InvocationHandler.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/InvocationHandler.java 2002-09-30 05:19:09.000000000 +0000 *************** *** 0 **** --- 1,136 ---- + /* java.lang.reflect.InvocationHandler - dynamically executes methods in + proxy instances + Copyright (C) 2001 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.lang.reflect; + + /** + * This interface defines an invocation handler. Suppose you are using + * reflection, and found a method that requires that its parameter + * be an object of a given interface. You want to call this method, + * but have no idea what classes implement that interface. So, you can + * create a {@link Proxy} instance, a convenient way to dynamically + * generate a class that meets all the necessary properties of that + * interface. But in order for the proxy instance to do any good, it + * needs to know what to do when interface methods are invoked! So, + * this interface is basically a cool wrapper that provides runtime + * code generation needed by proxy instances.

        + * + * While this interface was designed for use by Proxy, it will also + * work on any object in general.

        + * + * Hints for implementing this class:
        + *

          + *
        • Don't forget that Object.equals, Object.hashCode, and + * Object.toString will call this handler. In particular, + * a naive call to proxy.equals, proxy.hashCode, or proxy.toString + * will put you in an infinite loop. And remember that string + * concatenation also invokes toString.
        • + *
        • Obey the contract of the Method object you are handling, or + * the proxy instance will be forced to throw a + * {@link NullPointerException}, {@link ClassCastException}, + * or {@link UndeclaredThrowableException}.
        • + *
        • Be prepared to wrap/unwrap primitives as necessary.
        • + *
        • The Method object may be owned by a different interface than + * what was actually used as the qualifying type of the method + * invocation in the Java source code. This means that it might + * not always be safe to throw an exception listed as belonging + * to the method's throws clause.
        • + *
        + * + *

        For a fun time, create an InvocationHandler that handles the + * methods of a proxy instance of the InvocationHandler interface! + * + * @see Proxy + * @see UndeclaredThrowableException + * + * @author Eric Blake + * @since 1.3 + * @status updated to 1.4 + */ + public interface InvocationHandler + { + /** + * When a method is invoked on a proxy instance, it is wrapped and + * this method is called instead, so that you may decide at runtime + * how the original method should behave. + * + * @param proxy the instance that the wrapped method should be + * invoked on. When this method is called by a Proxy object, + * `proxy' will be an instance of {@link Proxy}, and oddly enough, + * Proxy.getInvocationHandler(proxy) will return + * this! + * @param method the reflected method to invoke on the proxy. + * When this method is called by a Proxy object, 'method' + * will be the reflection object owned by the declaring + * class or interface, which may be a supertype of the + * interfaces the proxy directly implements. + * @param args the arguments passed to the original method, or + * null if the method takes no arguments. + * (But also be prepared to handle a 0-length array). + * Arguments of primitive type, such as boolean + * or int, are wrapped in the appropriate + * class such as {@link Boolean} or {@link Integer}. + * @return whatever is necessary to return from the wrapped method. + * If the wrapped method is void, the proxy + * instance will ignore it. If the wrapped method returns + * a primitive, this must be the correct wrapper type whose value + * is exactly assignable to the appropriate type (no widening + * will be performed); a null object in this case causes a + * {@link NullPointerException}. In all remaining cases, if + * the returned object is not assignment compatible to the + * declared type of the original method, the proxy instance + * will generate a {@link ClassCastException}. + * @throws Throwable this interface is listed as throwing anything, + * but the implementation should only throw unchecked + * exceptions and exceptions listed in the throws clause of + * all methods being overridden by the proxy instance. If + * something is thrown that is not compatible with the throws + * clause of all overridden methods, the proxy instance will + * wrap the exception in an UndeclaredThrowableException. + * Note that an exception listed in the throws clause of the + * `method' parameter might not be declared in additional + * interfaces also implemented by the proxy object. + * + * @see Proxy + * @see UndeclaredThrowableException + */ + Object invoke(Object proxy, Method method, Object[] args) + throws Throwable; + + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/InvocationTargetException.java gcc-3.3/libjava/java/lang/reflect/InvocationTargetException.java *** gcc-3.2.3/libjava/java/lang/reflect/InvocationTargetException.java 2002-01-22 22:40:20.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/InvocationTargetException.java 2002-06-15 19:45:33.000000000 +0000 *************** *** 1,5 **** ! /* InvocationTargetException.java - Wrapper exception for reflection ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InvocationTargetException.java -- Wrapper exception for reflection ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,139 **** package java.lang.reflect; - import java.io.PrintStream; - import java.io.PrintWriter; - - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Believed complete and correct. - */ - /** ! * InvocationTargetException is sort of a way to "wrap" whatever exception ! * comes up when a method or constructor is called via Reflection. * * @author John Keiser - * @version 1.1.0, 31 May 1998 * @author Tom Tromey ! * @date December 12, 1998 ! * * @see Method#invoke(Object,Object[]) * @see Constructor#newInstance(Object[]) */ ! ! public class InvocationTargetException extends Exception { ! static final long serialVersionUID = 4085088731926701167L; - private Throwable target = null; - - protected InvocationTargetException() - { - super(); - } - /** ! * Create an InvocationTargetException using another * exception. * @param targetException the exception to wrap */ ! public InvocationTargetException(Throwable targetException) ! { ! super(targetException.toString()); ! target = targetException; ! } ! ! /** ! * Create an InvocationTargetException using another * exception and an error message. * * @param targetException the exception to wrap * @param err an extra reason for the exception-throwing */ ! public InvocationTargetException(Throwable targetException, String err) ! { ! super(err); ! target = targetException; ! } ! /** * Get the wrapped (targeted) exception. ! * ! * @return the targeted exception. */ ! public Throwable getTargetException() ! { ! return target; ! } ! ! public void printStackTrace() ! { ! if (target == null) ! super.printStackTrace(); ! else ! { ! System.err.print(this.getClass() + ": "); ! target.printStackTrace(); ! } ! } ! ! public void printStackTrace(PrintStream ps) ! { ! if (target == null) ! super.printStackTrace(ps); ! else ! { ! ps.print(this.getClass() + ": "); ! target.printStackTrace(ps); ! } ! } ! public void printStackTrace(PrintWriter pw) ! { ! if (target == null) ! super.printStackTrace(pw); ! else ! { ! pw.print(this.getClass() + ": "); ! target.printStackTrace(pw); ! } ! } } --- 38,123 ---- package java.lang.reflect; /** ! * InvocationTargetException is sort of a way to "wrap" whatever exception ! * comes up when a method or constructor is called via Reflection. As of ! * JDK 1.4, it was retrofitted to match the exception chaining of all other ! * exceptions, but getTargetException() still works. * * @author John Keiser * @author Tom Tromey ! * @author Eric Blake * @see Method#invoke(Object,Object[]) * @see Constructor#newInstance(Object[]) + * @since 1.1 + * @status updated to 1.4 */ ! public class InvocationTargetException extends Exception { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 4085088731926701167L; /** ! * The chained exception. This field is only around for serial compatibility. ! * ! * @serial the chained exception ! */ ! private final Throwable target; ! ! /** ! * Construct an exception with null as the cause. The cause is initialized ! * to null. ! */ ! protected InvocationTargetException() ! { ! this(null, null); ! } ! ! /** ! * Create an InvocationTargetException using another * exception. + * * @param targetException the exception to wrap */ ! public InvocationTargetException(Throwable targetException) ! { ! this(targetException, null); ! } ! ! /** ! * Create an InvocationTargetException using another * exception and an error message. * * @param targetException the exception to wrap * @param err an extra reason for the exception-throwing */ ! public InvocationTargetException(Throwable targetException, String err) ! { ! super(err, targetException); ! target = targetException; ! } ! /** * Get the wrapped (targeted) exception. ! * ! * @return the targeted exception ! * @see #getCause() */ ! public Throwable getTargetException() ! { ! return target; ! } ! /** ! * Returns the cause of this exception (which may be null). ! * ! * @return the cause ! * @since 1.4 ! */ ! public Throwable getCause() ! { ! return target; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/Modifier.java gcc-3.3/libjava/java/lang/reflect/Modifier.java *** gcc-3.2.3/libjava/java/lang/reflect/Modifier.java 2002-04-04 08:32:33.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/Modifier.java 2002-12-19 19:32:18.000000000 +0000 *************** *** 1,5 **** /* java.lang.reflect.Modifier ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* java.lang.reflect.Modifier ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class Modifier *** 158,163 **** --- 158,174 ---- static final int ALL_FLAGS = 0xfff; /** + * GCJ-LOCAL: This access flag is set on methods we declare + * internally but which must not be visible to reflection. + */ + static final int INVISIBLE = 0x1000; + + /** + * GCJ-LOCAL: This access flag is set on interpreted classes. + */ + static final int INTERPRETED = 0x1000; + + /** * Check whether the given modifier is abstract. * @param mod the modifier. * @return true if abstract, false otherwise. diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/natConstructor.cc gcc-3.3/libjava/java/lang/reflect/natConstructor.cc *** gcc-3.2.3/libjava/java/lang/reflect/natConstructor.cc 2001-03-26 07:05:32.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/natConstructor.cc 2002-08-27 23:57:17.000000000 +0000 *************** *** 1,6 **** // natConstructor.cc - Native code for Constructor class. ! /* Copyright (C) 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natConstructor.cc - Native code for Constructor class. ! /* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** java::lang::reflect::Constructor::newIns *** 50,55 **** --- 50,57 ---- if (Modifier::isAbstract (declaringClass->getModifiers())) throw new InstantiationException; + _Jv_InitClass (declaringClass); + jmethodID meth = _Jv_FromReflectedConstructor (this); // In the constructor case the return type is the type of the // constructor. diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/natField.cc gcc-3.3/libjava/java/lang/reflect/natField.cc *** gcc-3.2.3/libjava/java/lang/reflect/natField.cc 2002-01-23 19:42:18.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/natField.cc 2002-11-07 17:57:09.000000000 +0000 *************** getDouble (jclass cls, void* addr) *** 168,248 **** jboolean java::lang::reflect::Field::getBoolean (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getBoolean (fld->type, getAddr (this, caller, obj)); } jchar java::lang::reflect::Field::getChar (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getChar (fld->type, getAddr (this, caller, obj)); } jbyte java::lang::reflect::Field::getByte (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getByte (fld->type, getAddr (this, caller, obj)); } jshort java::lang::reflect::Field::getShort (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getShort (fld->type, getAddr (this, caller, obj)); } jint java::lang::reflect::Field::getInt (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getInt (fld->type, getAddr (this, caller, obj)); } jlong java::lang::reflect::Field::getLong (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getLong (fld->type, getAddr (this, caller, obj)); } jfloat java::lang::reflect::Field::getFloat (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getFloat (fld->type, getAddr (this, caller, obj)); } jdouble java::lang::reflect::Field::getDouble (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); ! return ::getDouble (fld->type, getAddr (this, caller, obj)); } jobject java::lang::reflect::Field::get (jclass caller, jobject obj) { ! jfieldID fld = _Jv_FromReflectedField (this); void* addr = getAddr (this, caller, obj); ! if (! fld->type->isPrimitive ()) return * (jobject*) addr; ! if (fld->type == JvPrimClass (double)) return new java::lang::Double (* (jdouble*) addr); ! if (fld->type == JvPrimClass (float)) return new java::lang::Float (* (jfloat*) addr); ! if (fld->type == JvPrimClass (long)) return new java::lang::Long (* (jlong*) addr); ! if (fld->type == JvPrimClass (int)) return new java::lang::Integer (* (jint*) addr); ! if (fld->type == JvPrimClass (short)) return new java::lang::Short (* (jshort*) addr); ! if (fld->type == JvPrimClass (byte)) return new java::lang::Byte (* (jbyte*) addr); ! if (fld->type == JvPrimClass (char)) return new java::lang::Character (* (jchar*) addr); ! if (fld->type == JvPrimClass (boolean)) { _Jv_InitClass (&java::lang::Boolean::class$); if (* (jboolean*) addr) --- 168,240 ---- jboolean java::lang::reflect::Field::getBoolean (jclass caller, jobject obj) { ! return ::getBoolean (this->getType(), getAddr (this, caller, obj)); } jchar java::lang::reflect::Field::getChar (jclass caller, jobject obj) { ! return ::getChar (this->getType(), getAddr (this, caller, obj)); } jbyte java::lang::reflect::Field::getByte (jclass caller, jobject obj) { ! return ::getByte (this->getType(), getAddr (this, caller, obj)); } jshort java::lang::reflect::Field::getShort (jclass caller, jobject obj) { ! return ::getShort (this->getType(), getAddr (this, caller, obj)); } jint java::lang::reflect::Field::getInt (jclass caller, jobject obj) { ! return ::getInt (this->getType(), getAddr (this, caller, obj)); } jlong java::lang::reflect::Field::getLong (jclass caller, jobject obj) { ! return ::getLong (this->getType(), getAddr (this, caller, obj)); } jfloat java::lang::reflect::Field::getFloat (jclass caller, jobject obj) { ! return ::getFloat (this->getType(), getAddr (this, caller, obj)); } jdouble java::lang::reflect::Field::getDouble (jclass caller, jobject obj) { ! return ::getDouble (this->getType(), getAddr (this, caller, obj)); } jobject java::lang::reflect::Field::get (jclass caller, jobject obj) { ! jclass type = this->getType(); void* addr = getAddr (this, caller, obj); ! if (! type->isPrimitive ()) return * (jobject*) addr; ! if (type == JvPrimClass (double)) return new java::lang::Double (* (jdouble*) addr); ! if (type == JvPrimClass (float)) return new java::lang::Float (* (jfloat*) addr); ! if (type == JvPrimClass (long)) return new java::lang::Long (* (jlong*) addr); ! if (type == JvPrimClass (int)) return new java::lang::Integer (* (jint*) addr); ! if (type == JvPrimClass (short)) return new java::lang::Short (* (jshort*) addr); ! if (type == JvPrimClass (byte)) return new java::lang::Byte (* (jbyte*) addr); ! if (type == JvPrimClass (char)) return new java::lang::Character (* (jchar*) addr); ! if (type == JvPrimClass (boolean)) { _Jv_InitClass (&java::lang::Boolean::class$); if (* (jboolean*) addr) *************** static void* *** 257,263 **** setAddr (java::lang::reflect::Field* field, jclass caller, jobject obj) { void *addr = getAddr(field, caller, obj); ! if (field->getModifiers() & java::lang::reflect::Modifier::FINAL) throw new java::lang::IllegalAccessException(); return addr; } --- 249,256 ---- setAddr (java::lang::reflect::Field* field, jclass caller, jobject obj) { void *addr = getAddr(field, caller, obj); ! if (!field->isAccessible() ! && field->getModifiers() & java::lang::reflect::Modifier::FINAL) throw new java::lang::IllegalAccessException(); return addr; } *************** setDouble (jclass type, void *addr, jdou *** 375,430 **** void java::lang::reflect::Field::setBoolean (jclass caller, jobject obj, jboolean b) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setBoolean (fld->type, setAddr (this, caller, obj), b); } void java::lang::reflect::Field::setChar (jclass caller, jobject obj, jchar c) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setChar (fld->type, setAddr (this, caller, obj), c); } void java::lang::reflect::Field::setByte (jclass caller, jobject obj, jbyte b) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setByte (fld->type, setAddr (this, caller, obj), b); } void java::lang::reflect::Field::setShort (jclass caller, jobject obj, jshort s) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setShort (fld->type, setAddr (this, caller, obj), s); } void java::lang::reflect::Field::setInt (jclass caller, jobject obj, jint i) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setInt (fld->type, setAddr (this, caller, obj), i); } void java::lang::reflect::Field::setLong (jclass caller, jobject obj, jlong l) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setLong (fld->type, setAddr (this, caller, obj), l); } void java::lang::reflect::Field::setFloat (jclass caller, jobject obj, jfloat f) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setFloat (fld->type, setAddr (this, caller, obj), f); } void java::lang::reflect::Field::setDouble (jclass caller, jobject obj, jdouble d) { ! jfieldID fld = _Jv_FromReflectedField (this); ! ::setDouble (fld->type, setAddr (this, caller, obj), d); } void --- 368,415 ---- void java::lang::reflect::Field::setBoolean (jclass caller, jobject obj, jboolean b) { ! ::setBoolean (this->getType(), setAddr (this, caller, obj), b); } void java::lang::reflect::Field::setChar (jclass caller, jobject obj, jchar c) { ! ::setChar (this->getType(), setAddr (this, caller, obj), c); } void java::lang::reflect::Field::setByte (jclass caller, jobject obj, jbyte b) { ! ::setByte (this->getType(), setAddr (this, caller, obj), b); } void java::lang::reflect::Field::setShort (jclass caller, jobject obj, jshort s) { ! ::setShort (this->getType(), setAddr (this, caller, obj), s); } void java::lang::reflect::Field::setInt (jclass caller, jobject obj, jint i) { ! ::setInt (this->getType(), setAddr (this, caller, obj), i); } void java::lang::reflect::Field::setLong (jclass caller, jobject obj, jlong l) { ! ::setLong (this->getType(), setAddr (this, caller, obj), l); } void java::lang::reflect::Field::setFloat (jclass caller, jobject obj, jfloat f) { ! ::setFloat (this->getType(), setAddr (this, caller, obj), f); } void java::lang::reflect::Field::setDouble (jclass caller, jobject obj, jdouble d) { ! ::setDouble (this->getType(), setAddr (this, caller, obj), d); } void diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/natMethod.cc gcc-3.3/libjava/java/lang/reflect/natMethod.cc *** gcc-3.2.3/libjava/java/lang/reflect/natMethod.cc 2002-03-01 13:41:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/natMethod.cc 2003-02-28 17:57:58.000000000 +0000 *************** details. */ *** 42,58 **** #include #endif - // FIXME: remove these. - #define BooleanClass java::lang::Boolean::class$ - #define VoidClass java::lang::Void::class$ - #define ByteClass java::lang::Byte::class$ - #define ShortClass java::lang::Short::class$ - #define CharacterClass java::lang::Character::class$ - #define IntegerClass java::lang::Integer::class$ - #define LongClass java::lang::Long::class$ - #define FloatClass java::lang::Float::class$ - #define DoubleClass java::lang::Double::class$ - struct cpair { jclass prim; --- 42,47 ---- *************** struct cpair *** 64,79 **** static cpair primitives[] = { #define BOOLEAN 0 ! { JvPrimClass (boolean), &BooleanClass }, ! { JvPrimClass (byte), &ByteClass }, #define SHORT 2 ! { JvPrimClass (short), &ShortClass }, #define CHAR 3 ! { JvPrimClass (char), &CharacterClass }, ! { JvPrimClass (int), &IntegerClass }, ! { JvPrimClass (long), &LongClass }, ! { JvPrimClass (float), &FloatClass }, ! { JvPrimClass (double), &DoubleClass }, { NULL, NULL } }; --- 53,68 ---- static cpair primitives[] = { #define BOOLEAN 0 ! { JvPrimClass (boolean), &java::lang::Boolean::class$ }, ! { JvPrimClass (byte), &java::lang::Byte::class$ }, #define SHORT 2 ! { JvPrimClass (short), &java::lang::Short::class$ }, #define CHAR 3 ! { JvPrimClass (char), &java::lang::Character::class$ }, ! { JvPrimClass (int), &java::lang::Integer::class$ }, ! { JvPrimClass (long), &java::lang::Long::class$ }, ! { JvPrimClass (float), &java::lang::Float::class$ }, ! { JvPrimClass (double), &java::lang::Double::class$ }, { NULL, NULL } }; *************** java::lang::reflect::Method::invoke (job *** 167,172 **** --- 156,168 ---- // of the object. meth = _Jv_LookupDeclaredMethod (k, meth->name, meth->signature); } + else + { + // We have to initialize a static class. It is safe to do this + // here and not in _Jv_CallAnyMethodA because JNI initializes a + // class whenever a method lookup is done. + _Jv_InitClass (declaringClass); + } return _Jv_CallAnyMethodA (obj, return_type, meth, false, parameter_types, args); *************** java::lang::reflect::Method::getType () *** 206,218 **** } exception_types ! = (JArray *) JvNewObjectArray (count, ! &java::lang::Class::class$, NULL); jclass *elts = elements (exception_types); for (int i = 0; i < count; ++i) ! elts[i] = _Jv_FindClassFromSignature (method->throws[i]->data, ! declaringClass->getClassLoader ()); } void --- 202,213 ---- } exception_types ! = (JArray *) JvNewObjectArray (count, &java::lang::Class::class$, NULL); jclass *elts = elements (exception_types); for (int i = 0; i < count; ++i) ! elts[i] = _Jv_FindClass (method->throws[i], ! declaringClass->getClassLoader ()); } void *************** _Jv_CallAnyMethodA (jobject obj, *** 363,408 **** obj = JvAllocObject (return_type); } ! int i = 0; ! int size = 0; ! if (needs_this) ! { ! // The `NULL' type is `Object'. ! argtypes[i++] = get_ffi_type (NULL); ! size += sizeof (jobject); ! } ! ! for (int arg = 0; i < param_count; ++i, ++arg) ! { ! argtypes[i] = get_ffi_type (paramelts[arg]); ! if (paramelts[arg]->isPrimitive()) ! size += paramelts[arg]->size(); ! else ! size += sizeof (jobject); ! } ! ffi_cif cif; - if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, param_count, - rtype, argtypes) != FFI_OK) - { - // FIXME: throw some kind of VirtualMachineError here. - } ! char *p = (char *) __builtin_alloca (size); ! void **values = (void **) __builtin_alloca (param_count * sizeof (void *)); ! i = 0; if (needs_this) { values[i] = p; memcpy (p, &obj, sizeof (jobject)); ! p += sizeof (jobject); ++i; } for (int arg = 0; i < param_count; ++i, ++arg) { int tsize; if (paramelts[arg]->isPrimitive()) tsize = paramelts[arg]->size(); else --- 358,387 ---- obj = JvAllocObject (return_type); } ! const int size_per_arg = sizeof(jvalue); ffi_cif cif; ! char *p = (char *) __builtin_alloca (param_count * size_per_arg); ! // Overallocate to get correct alignment. ! void **values = (void **) ! __builtin_alloca (param_count * sizeof (void *)); ! int i = 0; if (needs_this) { + // The `NULL' type is `Object'. + argtypes[i] = get_ffi_type (NULL); values[i] = p; memcpy (p, &obj, sizeof (jobject)); ! p += size_per_arg; ++i; } for (int arg = 0; i < param_count; ++i, ++arg) { int tsize; + + argtypes[i] = get_ffi_type (paramelts[arg]); if (paramelts[arg]->isPrimitive()) tsize = paramelts[arg]->size(); else *************** _Jv_CallAnyMethodA (jobject obj, *** 411,422 **** // Copy appropriate bits from the jvalue into the ffi array. // FIXME: we could do this copying all in one loop, above, by // over-allocating a bit. values[i] = p; memcpy (p, &args[arg], tsize); ! p += tsize; } ! // FIXME: initialize class here. using namespace java::lang; using namespace java::lang::reflect; --- 390,406 ---- // Copy appropriate bits from the jvalue into the ffi array. // FIXME: we could do this copying all in one loop, above, by // over-allocating a bit. + // How do we do this without breaking big-endian platforms? values[i] = p; memcpy (p, &args[arg], tsize); ! p += size_per_arg; } ! if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, param_count, ! rtype, argtypes) != FFI_OK) ! { ! // FIXME: throw some kind of VirtualMachineError here. ! } using namespace java::lang; using namespace java::lang::reflect; diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/natProxy.cc gcc-3.3/libjava/java/lang/reflect/natProxy.cc *** gcc-3.2.3/libjava/java/lang/reflect/natProxy.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/natProxy.cc 2002-09-30 05:19:09.000000000 +0000 *************** *** 0 **** --- 1,38 ---- + // natProxy.cc - Native code for Proxy class. + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + + #include + #include + + #include + #include + #include + #include + + ::java::lang::Class * + java::lang::reflect::Proxy::getProxyClass0 (::java::lang::ClassLoader *, JArray< ::java::lang::Class *> *) + { + return 0; + } + + ::java::lang::reflect::Proxy$ProxyData * + java::lang::reflect::Proxy::getProxyData0 (::java::lang::ClassLoader *, JArray< ::java::lang::Class *> *) + { + return 0; + } + + ::java::lang::Class * + java::lang::reflect::Proxy::generateProxyClass0 (::java::lang::ClassLoader *, + ::java::lang::reflect::Proxy$ProxyData *) + { + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/Proxy.java gcc-3.3/libjava/java/lang/reflect/Proxy.java *** gcc-3.2.3/libjava/java/lang/reflect/Proxy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/Proxy.java 2002-11-03 20:27:30.000000000 +0000 *************** *** 0 **** --- 1,1624 ---- + /* Proxy.java -- build a proxy class that implements reflected interfaces + Copyright (C) 2001, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.lang.reflect; + + import java.io.Serializable; + import java.security.ProtectionDomain; + import java.util.Map; + import java.util.HashMap; + import java.util.Set; + import java.util.HashSet; + import java.util.Iterator; + import gnu.classpath.Configuration; + import gnu.java.lang.reflect.TypeSignature; + + /** + * This class allows you to dynamically create an instance of any (or + * even multiple) interfaces by reflection, and decide at runtime + * how that instance will behave by giving it an appropriate + * {@link InvocationHandler}. Proxy classes serialize specially, so + * that the proxy object can be reused between VMs, without requiring + * a persistent copy of the generated class code. + * + *

        Creation

        + * To create a proxy for some interface Foo: + * + *
        +  *   InvocationHandler handler = new MyInvocationHandler(...);
        +  *   Class proxyClass = Proxy.getProxyClass(
        +  *       Foo.class.getClassLoader(), new Class[] { Foo.class });
        +  *   Foo f = (Foo) proxyClass
        +  *       .getConstructor(new Class[] { InvocationHandler.class })
        +  *       .newInstance(new Object[] { handler });
        +  * 
        + * or more simply: + *
        +  *   Foo f = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(),
        +  *                                        new Class[] { Foo.class },
        +  *                                        handler);
        +  * 
        + * + *

        Dynamic Proxy Classes

        + * A dynamic proxy class is created at runtime, and has the following + * properties: + *
          + *
        • The class is public and final, + * and is neither abstract nor an inner class.
        • + *
        • The class has no canonical name (there is no formula you can use + * to determine or generate its name), but begins with the + * sequence "$Proxy". Abuse this knowledge at your own peril. + * (For now, '$' in user identifiers is legal, but it may not + * be that way forever. You weren't using '$' in your + * identifiers, were you?)
        • + *
        • The class extends Proxy, and explicitly implements all the + * interfaces specified at creation, in order (this is important + * for determining how method invocation is resolved). Note that + * a proxy class implements {@link Serializable}, at least + * implicitly, since Proxy does, but true serial behavior + * depends on using a serializable invocation handler as well.
        • + *
        • If at least one interface is non-public, the proxy class + * will be in the same package. Otherwise, the package is + * unspecified. This will work even if the package is sealed + * from user-generated classes, because Proxy classes are + * generated by a trusted source. Meanwhile, the proxy class + * belongs to the classloader you designated.
        • + *
        • Reflection works as expected: {@link Class#getInterfaces()} and + * {@link Class#getMethods()} work as they do on normal classes.
        • + *
        • The method {@link #isProxyClass()} will distinguish between + * true proxy classes and user extensions of this class. It only + * returns true for classes created by {@link #getProxyClass}.
        • + *
        • The {@link ProtectionDomain} of a proxy class is the same as for + * bootstrap classes, such as Object or Proxy, since it is created by + * a trusted source. This protection domain will typically be granted + * {@link java.security.AllPermission}. But this is not a security + * risk, since there are adequate permissions on reflection, which is + * the only way to create an instance of the proxy class.
        • + *
        • The proxy class contains a single constructor, which takes as + * its only argument an {@link InvocationHandler}. The method + * {@link #newInstance} is shorthand to do the necessary + * reflection.
        • + *
        + * + *

        Proxy Instances

        + * A proxy instance is an instance of a proxy class. It has the + * following properties, many of which follow from the properties of a + * proxy class listed above: + *
          + *
        • For a proxy class with Foo listed as one of its interfaces, the + * expression proxy instanceof Foo will return true, + * and the expression (Foo) proxy will succeed without + * a {@link ClassCastException}.
        • + *
        • Each proxy instance has an invocation handler, which can be + * accessed by {@link #getInvocationHandler(Object)}. Any call + * to an interface method, including {@link Object#hashcode()}, + * {@link Object#equals(Object)}, or {@link Object#toString()}, + * but excluding the public final methods of Object, will be + * encoded and passed to the {@link InvocationHandler#invoke} + * method of this handler.
        • + *
        + * + *

        Inheritance Issues

        + * A proxy class may inherit a method from more than one interface. + * The order in which interfaces are listed matters, because it determines + * which reflected {@link Method} object will be passed to the invocation + * handler. This means that the dynamically generated class cannot + * determine through which interface a method is being invoked.

        + * + * In short, if a method is declared in Object (namely, hashCode, + * equals, or toString), then Object will be used; otherwise, the + * leftmost interface that inherits or declares a method will be used, + * even if it has a more permissive throws clause than what the proxy + * class is allowed. Thus, in the invocation handler, it is not always + * safe to assume that every class listed in the throws clause of the + * passed Method object can safely be thrown; fortunately, the Proxy + * instance is robust enough to wrap all illegal checked exceptions in + * {@link UndeclaredThrowableException}. + * + * @see InvocationHandler + * @see UndeclaredThrowableException + * @see Class + * @author Eric Blake + * @since 1.3 + * @status updated to 1.4, except for the use of ProtectionDomain + */ + public class Proxy implements Serializable + { + /** + * Compatible with JDK 1.3+. + */ + private static final long serialVersionUID = -2222568056686623797L; + + /** + * Map of ProxyType to proxy class. + * + * @XXX This prevents proxy classes from being garbage collected. + * java.util.WeakHashSet is not appropriate, because that collects the + * keys, but we are interested in collecting the elements. + */ + private static final Map proxyClasses = new HashMap(); + + /** + * The invocation handler for this proxy instance. For Proxy, this + * field is unused, but it appears here in order to be serialized in all + * proxy classes. + * + * NOTE: This implementation is more secure for proxy classes + * than what Sun specifies. Sun does not require h to be immutable, but + * this means you could change h after the fact by reflection. However, + * by making h immutable, we may break non-proxy classes which extend + * Proxy. + * @serial invocation handler associated with this proxy instance + */ + protected final InvocationHandler h; + + /** + * Constructs a new Proxy from a subclass (usually a proxy class), + * with the specified invocation handler. + * + * NOTE: This throws a NullPointerException if you attempt + * to create a proxy instance with a null handler using reflection. + * This behavior is not yet specified by Sun; see Sun Bug 4487672. + * + * @param handler the invocation handler, may be null if the subclass + * is not a proxy class + * @throws NullPointerException if handler is null and this is a proxy + * instance + */ + protected Proxy(InvocationHandler handler) + { + if (handler == null && isProxyClass(getClass())) + throw new NullPointerException("invalid handler"); + h = handler; + } + + /** + * Returns the proxy {@link Class} for the given ClassLoader and array + * of interfaces, dynamically generating it if necessary. + * + * There are several restrictions on this method, the violation of + * which will result in an IllegalArgumentException or + * NullPointerException: + *

          + *
        • All objects in `interfaces' must represent distinct interfaces. + * Classes, primitive types, null, and duplicates are forbidden.
        • + *
        • The interfaces must be visible in the specified ClassLoader. + * In other words, for each interface i: + * Class.forName(i.getName(), false, loader) == i + * must be true.
        • + *
        • All non-public interfaces (if any) must reside in the same + * package, or the proxy class would be non-instantiable. If + * there are no non-public interfaces, the package of the proxy + * class is unspecified.
        • + *
        • All interfaces must be compatible - if two declare a method + * with the same name and parameters, the return type must be + * the same and the throws clause of the proxy class will be + * the maximal subset of subclasses of the throws clauses for + * each method that is overridden.
        • + *
        • VM constraints limit the number of interfaces a proxy class + * may directly implement (however, the indirect inheritance + * of {@link Serializable} does not count against this limit). + * Even though most VMs can theoretically have 65535 + * superinterfaces for a class, the actual limit is smaller + * because a class's constant pool is limited to 65535 entries, + * and not all entries can be interfaces.
        • + *

        + * + * Note that different orders of interfaces produce distinct classes. + * + * @param loader the class loader to define the proxy class in; null + * implies the bootstrap class loader + * @param interfaces the array of interfaces the proxy class implements, + * may be empty, but not null + * @return the Class object of the proxy class + * @throws IllegalArgumentException if the constraints above were + * violated, except for problems with null + * @throws NullPointerException if `interfaces' is null or contains + * a null entry + */ + // synchronized so that we aren't trying to build the same class + // simultaneously in two threads + public static synchronized Class getProxyClass(ClassLoader loader, + Class[] interfaces) + { + interfaces = (Class[]) interfaces.clone(); + ProxyType pt = new ProxyType(loader, interfaces); + Class clazz = (Class) proxyClasses.get(pt); + if (clazz == null) + { + if (Configuration.HAVE_NATIVE_GET_PROXY_CLASS) + clazz = getProxyClass0(loader, interfaces); + else + { + ProxyData data = (Configuration.HAVE_NATIVE_GET_PROXY_DATA + ? getProxyData0(loader, interfaces) + : ProxyData.getProxyData(pt)); + + // FIXME workaround for bug in gcj 3.0.x + // Not needed with the latest gcj from cvs + //clazz = (Configuration.HAVE_NATIVE_GENERATE_PROXY_CLASS + // ? generateProxyClass0(loader, data) + // : new ClassFactory(data).generate(loader)); + if (Configuration.HAVE_NATIVE_GENERATE_PROXY_CLASS) + clazz = generateProxyClass0(loader, data); + else + { + ClassFactory cf = new ClassFactory(data); + clazz = cf.generate(loader); + } + } + + Object check = proxyClasses.put(pt, clazz); + // assert check == null && clazz != null; + if (check != null || clazz == null) + throw new InternalError(/*"Fatal flaw in getProxyClass"*/); + } + return clazz; + } + + /** + * Combines several methods into one. This is equivalent to: + *

        +    *   Proxy.getProxyClass(loader, interfaces)
        +    *       .getConstructor(new Class[] {InvocationHandler.class})
        +    *       .newInstance(new Object[] {handler});
        +    * 
        + * except that it will not fail with the normal problems caused + * by reflection. It can still fail for the same reasons documented + * in getProxyClass, or if handler is null. + * + * @param loader the class loader to define the proxy class in; null + * implies the bootstrap class loader + * @param interfaces the array of interfaces the proxy class implements, + * may be empty, but not null + * @param handler the invocation handler, may not be null + * @return a proxy instance implementing the specified interfaces + * @throws IllegalArgumentException if the constraints for getProxyClass + * were violated, except for problems with null + * @throws NullPointerException if `interfaces' is null or contains + * a null entry, or if handler is null + * @see #getProxyClass(ClassLoader, Class[]) + * @see Class#getConstructor(Class[]) + * @see Constructor#newInstance(Object[]) + */ + public static Object newProxyInstance(ClassLoader loader, + Class[] interfaces, + InvocationHandler handler) + { + try + { + // getProxyClass() and Proxy() throw the necessary exceptions + return getProxyClass(loader, interfaces) + .getConstructor(new Class[] {InvocationHandler.class}) + .newInstance(new Object[] {handler}); + } + catch (RuntimeException e) + { + // Let IllegalArgumentException, NullPointerException escape. + // assert e instanceof IllegalArgumentException + // || e instanceof NullPointerException; + throw e; + } + catch (InvocationTargetException e) + { + // Let wrapped NullPointerException escape. + // assert e.getTargetException() instanceof NullPointerException + throw (NullPointerException) e.getCause(); + } + catch (Exception e) + { + // Covers InstantiationException, IllegalAccessException, + // NoSuchMethodException, none of which should be generated + // if the proxy class was generated correctly. + // assert false; + throw (Error) new InternalError("Unexpected: " + e).initCause(e); + } + } + + /** + * Returns true if and only if the Class object is a dynamically created + * proxy class (created by getProxyClass or by the + * syntactic sugar of newProxyInstance). + * + *

        This check is secure (in other words, it is not simply + * clazz.getSuperclass() == Proxy.class), it will not + * be spoofed by non-proxy classes that extend Proxy. + * + * @param clazz the class to check, must not be null + * @return true if the class represents a proxy class + * @throws NullPointerException if clazz is null + */ + // This is synchronized on the off chance that another thread is + // trying to add a class to the map at the same time we read it. + public static synchronized boolean isProxyClass(Class clazz) + { + if (! Proxy.class.isAssignableFrom(clazz)) + return false; + // This is a linear search, even though we could do an O(1) search + // using new ProxyType(clazz.getClassLoader(), clazz.getInterfaces()). + return proxyClasses.containsValue(clazz); + } + + /** + * Returns the invocation handler for the given proxy instance.

        + * + * NOTE: We guarantee a non-null result if successful, + * but Sun allows the creation of a proxy instance with a null + * handler. See the comments for {@link #Proxy(InvocationHandler)}. + * + * @param proxy the proxy instance, must not be null + * @return the invocation handler, guaranteed non-null. + * @throws IllegalArgumentException if + * Proxy.isProxyClass(proxy.getClass()) returns false. + * @throws NullPointerException if proxy is null + */ + public static InvocationHandler getInvocationHandler(Object proxy) + { + if (! isProxyClass(proxy.getClass())) + throw new IllegalArgumentException("not a proxy instance"); + return ((Proxy) proxy).h; + } + + /** + * Optional native method to replace (and speed up) the pure Java + * implementation of getProxyClass. Only needed if + * Configuration.HAVE_NATIVE_GET_PROXY_CLASS is true, this does the + * work of both getProxyData0 and generateProxyClass0 with no + * intermediate form in Java. The native code may safely assume that + * this class must be created, and does not already exist. + * + * @param loader the class loader to define the proxy class in; null + * implies the bootstrap class loader + * @param interfaces the interfaces the class will extend + * @return the generated proxy class + * @throws IllegalArgumentException if the constraints for getProxyClass + * were violated, except for problems with null + * @throws NullPointerException if `interfaces' is null or contains + * a null entry, or if handler is null + * @see Configuration#HAVE_NATIVE_GET_PROXY_CLASS + * @see #getProxyClass(ClassLoader, Class[]) + * @see #getProxyData0(ClassLoader, Class[]) + * @see #generateProxyClass0(ProxyData) + */ + private static native Class getProxyClass0(ClassLoader loader, + Class[] interfaces); + + /** + * Optional native method to replace (and speed up) the pure Java + * implementation of getProxyData. Only needed if + * Configuration.HAVE_NATIVE_GET_PROXY_DATA is true. The native code + * may safely assume that a new ProxyData object must be created which + * does not duplicate any existing ones. + * + * @param loader the class loader to define the proxy class in; null + * implies the bootstrap class loader + * @param interfaces the interfaces the class will extend + * @return all data that is required to make this proxy class + * @throws IllegalArgumentException if the constraints for getProxyClass + * were violated, except for problems with null + * @throws NullPointerException if `interfaces' is null or contains + * a null entry, or if handler is null + * @see Configuration.HAVE_NATIVE_GET_PROXY_DATA + * @see #getProxyClass(ClassLoader, Class[]) + * @see #getProxyClass0(ClassLoader, Class[]) + * @see ProxyType#getProxyData() + */ + private static native ProxyData getProxyData0(ClassLoader loader, + Class[] interfaces); + + /** + * Optional native method to replace (and speed up) the pure Java + * implementation of generateProxyClass. Only needed if + * Configuration.HAVE_NATIVE_GENERATE_PROXY_CLASS is true. The native + * code may safely assume that a new Class must be created, and that + * the ProxyData object does not describe any existing class. + * + * @param loader the class loader to define the proxy class in; null + * implies the bootstrap class loader + * @param data the struct of information to convert to a Class. This + * has already been verified for all problems except exceeding + * VM limitations + * @return the newly generated class + * @throws IllegalArgumentException if VM limitations are exceeded + * @see #getProxyClass(ClassLoader, Class[]) + * @see #getProxyClass0(ClassLoader, Class[]) + * @see ProxyData#generateProxyClass(ClassLoader) + */ + private static native Class generateProxyClass0(ClassLoader loader, + ProxyData data); + + /** + * Helper class for mapping unique ClassLoader and interface combinations + * to proxy classes. + * + * @author Eric Blake + */ + private static final class ProxyType + { + /** + * Store the class loader (may be null) + */ + final ClassLoader loader; + + /** + * Store the interfaces (never null, all elements are interfaces) + */ + final Class[] interfaces; + + /** + * Construct the helper object. + * + * @param loader the class loader to define the proxy class in; null + * implies the bootstrap class loader + * @param interfaces an array of interfaces + */ + ProxyType(ClassLoader loader, Class[] interfaces) + { + if (loader == null) + loader = ClassLoader.getSystemClassLoader(); + this.loader = loader; + this.interfaces = interfaces; + } + + /** + * Calculates the hash code. + * + * @return a combination of the classloader and interfaces hashcodes. + */ + public int hashCode() + { + //loader is always not null + int hash = loader.hashCode(); + for (int i = 0; i < interfaces.length; i++) + hash = hash * 31 + interfaces[i].hashCode(); + return hash; + } + + // A more comprehensive comparison of two arrays, + // ignore array element order, and + // ignore redundant elements + private static boolean sameTypes(Class arr1[], Class arr2[]) { + if (arr1.length == 1 && arr2.length == 1) { + return arr1[0] == arr2[0]; + } + + // total occurrance of elements of arr1 in arr2 + int total_occ_of_arr1_in_arr2 = 0; + each_type: + for (int i = arr1.length; --i >= 0; ) + { + Class t = arr1[i]; + for (int j = i; --j >= 0; ) + { + if (t == arr1[j]) + { //found duplicate type + continue each_type; + } + } + + // count c(a unique element of arr1)'s + // occurrences in arr2 + int occ_in_arr2 = 0; + for (int j = arr2.length; --j >= 0; ) + { + if (t == arr2[j]) + { + ++occ_in_arr2; + } + } + if (occ_in_arr2 == 0) + { // t does not occur in arr2 + return false; + } + + total_occ_of_arr1_in_arr2 += occ_in_arr2; + } + // now, each element of arr2 must have been visited + return total_occ_of_arr1_in_arr2 == arr2.length; + } + + /** + * Calculates equality. + * + * @param the object to compare to + * @return true if it is a ProxyType with same data + */ + public boolean equals(Object other) + { + ProxyType pt = (ProxyType) other; + if (loader != pt.loader || interfaces.length != pt.interfaces.length) + return false; + return sameTypes(interfaces, pt.interfaces); + } + } // class ProxyType + + /** + * Helper class which allows hashing of a method name and signature + * without worrying about return type, declaring class, or throws clause, + * and which reduces the maximally common throws clause between two methods + * + * @author Eric Blake + */ + private static final class ProxySignature + { + /** + * The core signatures which all Proxy instances handle. + */ + static final HashMap coreMethods = new HashMap(); + static + { + try + { + ProxySignature sig + = new ProxySignature(Object.class + .getMethod("equals", + new Class[] {Object.class})); + coreMethods.put(sig, sig); + sig = new ProxySignature(Object.class.getMethod("hashCode", null)); + coreMethods.put(sig, sig); + sig = new ProxySignature(Object.class.getMethod("toString", null)); + coreMethods.put(sig, sig); + } + catch (Exception e) + { + // assert false; + throw (Error) new InternalError("Unexpected: " + e).initCause(e); + } + } + + /** + * The underlying Method object, never null + */ + final Method method; + + /** + * The set of compatible thrown exceptions, may be empty + */ + final Set exceptions = new HashSet(); + + /** + * Construct a signature + * + * @param method the Method this signature is based on, never null + */ + ProxySignature(Method method) + { + this.method = method; + Class[] exc = method.getExceptionTypes(); + int i = exc.length; + while (--i >= 0) + { + // discard unchecked exceptions + if (Error.class.isAssignableFrom(exc[i]) + || RuntimeException.class.isAssignableFrom(exc[i])) + continue; + exceptions.add(exc[i]); + } + } + + /** + * Given a method, make sure it's return type is identical + * to this, and adjust this signature's throws clause appropriately + * + * @param other the signature to merge in + * @throws IllegalArgumentException if the return types conflict + */ + void checkCompatibility(ProxySignature other) + { + if (method.getReturnType() != other.method.getReturnType()) + throw new IllegalArgumentException("incompatible return types: " + + method + ", " + other.method); + + // if you can think of a more efficient way than this O(n^2) search, + // implement it! + int size1 = exceptions.size(); + int size2 = other.exceptions.size(); + boolean[] valid1 = new boolean[size1]; + boolean[] valid2 = new boolean[size2]; + Iterator itr = exceptions.iterator(); + int pos = size1; + while (--pos >= 0) + { + Class c1 = (Class) itr.next(); + Iterator itr2 = other.exceptions.iterator(); + int pos2 = size2; + while (--pos2 >= 0) + { + Class c2 = (Class) itr2.next(); + if (c2.isAssignableFrom(c1)) + valid1[pos] = true; + if (c1.isAssignableFrom(c2)) + valid2[pos2] = true; + } + } + pos = size1; + itr = exceptions.iterator(); + while (--pos >= 0) + { + itr.next(); + if (! valid1[pos]) + itr.remove(); + } + pos = size2; + itr = other.exceptions.iterator(); + while (--pos >= 0) + { + itr.next(); + if (! valid2[pos]) + itr.remove(); + } + exceptions.addAll(other.exceptions); + } + + /** + * Calculates the hash code. + * + * @return a combination of name and parameter types + */ + public int hashCode() + { + int hash = method.getName().hashCode(); + Class[] types = method.getParameterTypes(); + for (int i = 0; i < types.length; i++) + hash = hash * 31 + types[i].hashCode(); + return hash; + } + + /** + * Calculates equality. + * + * @param the object to compare to + * @return true if it is a ProxySignature with same data + */ + public boolean equals(Object other) + { + ProxySignature ps = (ProxySignature) other; + Class[] types1 = method.getParameterTypes(); + Class[] types2 = ps.method.getParameterTypes(); + if (! method.getName().equals(ps.method.getName()) + || types1.length != types2.length) + return false; + int i = types1.length; + while (--i >= 0) + if (types1[i] != types2[i]) + return false; + return true; + } + } // class ProxySignature + + /** + * A flat representation of all data needed to generate bytecode/instantiate + * a proxy class. This is basically a struct. + * + * @author Eric Blake + */ + private static final class ProxyData + { + /** + * The package this class is in. Possibly null, meaning the unnamed + * package. + */ + Package pack; + + /** + * The interfaces this class implements. Non-null, but possibly empty. + */ + Class[] interfaces; + + /** + * The Method objects this class must pass as the second argument to + * invoke (also useful for determining what methods this class has). + * Non-null, non-empty (includes at least Object.hashCode, Object.equals, + * and Object.toString). + */ + Method[] methods; + + /** + * The exceptions that do not need to be wrapped in + * UndeclaredThrowableException. exceptions[i] is the same as, or a + * subset of subclasses, of methods[i].getExceptionTypes(), depending on + * compatible throws clauses with multiple inheritance. It is unspecified + * if these lists include or exclude subclasses of Error and + * RuntimeException, but excluding them is harmless and generates a + * smaller class. + */ + Class[][] exceptions; + + /** + * For unique id's + */ + private static int count = 0; + + /** + * The id of this proxy class + */ + final int id = count++; + + /** + * Construct a ProxyData with uninitialized data members. + */ + ProxyData() + { + } + + /** + * Verifies that the arguments are legal, and sets up remaining data + * This should only be called when a class must be generated, as + * it is expensive. + * + * @param pt the ProxyType to convert to ProxyData + * @return the flattened, verified ProxyData structure for use in + * class generation + * @throws IllegalArgumentException if `interfaces' contains + * non-interfaces or incompatible combinations, and verify is true + * @throws NullPointerException if interfaces is null or contains null + */ + static ProxyData getProxyData(ProxyType pt) + { + Map method_set = (Map) ProxySignature.coreMethods.clone(); + boolean in_package = false; // true if we encounter non-public interface + + ProxyData data = new ProxyData(); + data.interfaces = pt.interfaces; + + // if interfaces is too large, we croak later on when the constant + // pool overflows + int i = data.interfaces.length; + while (--i >= 0) + { + Class inter = data.interfaces[i]; + if (! inter.isInterface()) + throw new IllegalArgumentException("not an interface: " + inter); + try + { + if (Class.forName(inter.getName(), false, pt.loader) != inter) + throw new IllegalArgumentException("not accessible in " + + "classloader: " + inter); + } + catch (ClassNotFoundException e) + { + throw new IllegalArgumentException("not accessible in " + + "classloader: " + inter); + } + if (! Modifier.isPublic(inter.getModifiers())) + if (in_package) + { + Package p = inter.getPackage(); + if (data.pack != inter.getPackage()) + throw new IllegalArgumentException("non-public interfaces " + + "from different " + + "packages"); + } + else + { + in_package = true; + data.pack = inter.getPackage(); + } + for (int j = i-1; j >= 0; j--) + if (data.interfaces[j] == inter) + throw new IllegalArgumentException("duplicate interface: " + + inter); + Method[] methods = inter.getMethods(); + int j = methods.length; + while (--j >= 0) + { + ProxySignature sig = new ProxySignature(methods[j]); + ProxySignature old = (ProxySignature) method_set.put(sig, sig); + if (old != null) + sig.checkCompatibility(old); + } + } + + i = method_set.size(); + data.methods = new Method[i]; + data.exceptions = new Class[i][]; + Iterator itr = method_set.values().iterator(); + while (--i >= 0) + { + ProxySignature sig = (ProxySignature) itr.next(); + data.methods[i] = sig.method; + data.exceptions[i] = (Class[]) sig.exceptions + .toArray(new Class[sig.exceptions.size()]); + } + return data; + } + } // class ProxyData + + /** + * Does all the work of building a class. By making this a nested class, + * this code is not loaded in memory if the VM has a native + * implementation instead. + * + * @author Eric Blake + */ + private static final class ClassFactory + { + /** Constants for assisting the compilation */ + private static final byte POOL = 0; + private static final byte FIELD = 1; + private static final byte METHOD = 2; + private static final byte INTERFACE = 3; + private static final String CTOR_SIG + = "(Ljava/lang/reflect/InvocationHandler;)V"; + private static final String INVOKE_SIG = "(Ljava/lang/Object;" + + "Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;"; + + /** Bytecodes for insertion in the class definition byte[] */ + private static final char ACONST_NULL = 1; + private static final char ICONST_0 = 3; + private static final char BIPUSH = 16; + private static final char SIPUSH = 17; + private static final char ILOAD = 21; + private static final char ILOAD_0 = 26; + private static final char ALOAD_0 = 42; + private static final char ALOAD_1 = 43; + private static final char AALOAD = 50; + private static final char AASTORE = 83; + private static final char DUP = 89; + private static final char DUP_X1 = 90; + private static final char SWAP = 95; + private static final char IRETURN = 172; + private static final char LRETURN = 173; + private static final char FRETURN = 174; + private static final char DRETURN = 175; + private static final char ARETURN = 176; + private static final char RETURN = 177; + private static final char GETSTATIC = 178; + private static final char GETFIELD = 180; + private static final char INVOKEVIRTUAL = 182; + private static final char INVOKESPECIAL = 183; + private static final char INVOKESTATIC = 184; + private static final char INVOKEINTERFACE = 185; + private static final char NEW = 187; + private static final char ANEWARRAY = 189; + private static final char ATHROW = 191; + private static final char CHECKCAST = 192; + + // Implementation note: we use StringBuffers to hold the byte data, since + // they automatically grow. However, we only use the low 8 bits of + // every char in the array, so we are using twice the necessary memory + // for the ease StringBuffer provides. + + /** The constant pool. */ + private final StringBuffer pool = new StringBuffer(); + /** The rest of the class data. */ + private final StringBuffer stream = new StringBuffer(); + + /** Map of strings to byte sequences, to minimize size of pool. */ + private final Map poolEntries = new HashMap(); + + /** The VM name of this proxy class. */ + private final String qualName; + + /** + * The Method objects the proxy class refers to when calling the + * invocation handler. + */ + private final Method[] methods; + + /** + * Initializes the buffers with the bytecode contents for a proxy class. + * + * @param data the remainder of the class data + * @throws IllegalArgumentException if anything else goes wrong this + * late in the game; as far as I can tell, this will only happen + * if the constant pool overflows, which is possible even when + * the user doesn't exceed the 65535 interface limit + */ + ClassFactory(ProxyData data) + { + methods = data.methods; + + // magic = 0xcafebabe + // minor_version = 0 + // major_version = 46 + // constant_pool_count: place-holder for now + pool.append("\u00ca\u00fe\u00ba\u00be\0\0\0\56\0\0"); + // constant_pool[], filled in as we go + + // access_flags + putU2(Modifier.SUPER | Modifier.FINAL | Modifier.PUBLIC); + // this_class + qualName = ((data.pack == null ? "" : data.pack.getName() + '.') + + "$Proxy" + data.id); + putU2(classInfo(TypeSignature.getEncodingOfClass(qualName, false))); + // super_class + putU2(classInfo("java/lang/reflect/Proxy")); + + // interfaces_count + putU2(data.interfaces.length); + // interfaces[] + for (int i = 0; i < data.interfaces.length; i++) + putU2(classInfo(data.interfaces[i])); + + // Recall that Proxy classes serialize specially, so we do not need + // to worry about a method for this field. Instead, we + // just assign it by reflection after the class is successfully loaded. + // fields_count - private static Method[] m; + putU2(1); + // fields[] + // m.access_flags + putU2(Modifier.PRIVATE | Modifier.STATIC); + // m.name_index + putU2(utf8Info("m")); + // m.descriptor_index + putU2(utf8Info("[Ljava/lang/reflect/Method;")); + // m.attributes_count + putU2(0); + // m.attributes[] + + // methods_count - # handler methods, plus + putU2(methods.length + 1); + // methods[] + // .access_flags + putU2(Modifier.PUBLIC); + // .name_index + putU2(utf8Info("")); + // .descriptor_index + putU2(utf8Info(CTOR_SIG)); + // .attributes_count - only Code is needed + putU2(1); + // .Code.attribute_name_index + putU2(utf8Info("Code")); + // .Code.attribute_length = 18 + // .Code.info: + // $Proxynn(InvocationHandler h) { super(h); } + // .Code.max_stack = 2 + // .Code.max_locals = 2 + // .Code.code_length = 6 + // .Code.code[] + stream.append("\0\0\0\22\0\2\0\2\0\0\0\6" + ALOAD_0 + ALOAD_1 + + INVOKESPECIAL); + putU2(refInfo(METHOD, "java/lang/reflect/Proxy", "", CTOR_SIG)); + // .Code.exception_table_length = 0 + // .Code.exception_table[] + // .Code.attributes_count = 0 + // .Code.attributes[] + stream.append(RETURN + "\0\0\0\0"); + + for (int i = methods.length - 1; i >= 0; i--) + emitMethod(i, data.exceptions[i]); + + // attributes_count + putU2(0); + // attributes[] - empty; omit SourceFile attribute + // XXX should we mark this with a Synthetic attribute? + } + + /** + * Produce the bytecode for a single method. + * + * @param i the index of the method we are building + * @param e the exceptions possible for the method + */ + private void emitMethod(int i, Class[] e) + { + // First, we precalculate the method length and other information. + + Method m = methods[i]; + Class[] paramtypes = m.getParameterTypes(); + int wrap_overhead = 0; // max words taken by wrapped primitive + int param_count = 1; // 1 for this + int code_length = 16; // aload_0, getfield, aload_0, getstatic, const, + // aaload, const/aconst_null, invokeinterface + if (i > 5) + { + if (i > Byte.MAX_VALUE) + code_length += 2; // sipush + else + code_length++; // bipush + } + if (paramtypes.length > 0) + { + code_length += 3; // anewarray + if (paramtypes.length > Byte.MAX_VALUE) + code_length += 2; // sipush + else if (paramtypes.length > 5) + code_length++; // bipush + for (int j = 0; j < paramtypes.length; j++) + { + code_length += 4; // dup, const, load, store + Class type = paramtypes[j]; + if (j > 5) + { + if (j > Byte.MAX_VALUE) + code_length += 2; // sipush + else + code_length++; // bipush + } + if (param_count >= 4) + code_length++; // 2-byte load + param_count++; + if (type.isPrimitive()) + { + code_length += 7; // new, dup, invokespecial + if (type == long.class || type == double.class) + { + wrap_overhead = 3; + param_count++; + } + else if (wrap_overhead < 2) + wrap_overhead = 2; + } + } + } + int end_pc = code_length; + Class ret_type = m.getReturnType(); + if (ret_type == void.class) + code_length++; // return + else if (ret_type.isPrimitive()) + code_length += 7; // cast, invokevirtual, return + else + code_length += 4; // cast, return + int exception_count = 0; + boolean throws_throwable = false; + for (int j = 0; j < e.length; j++) + if (e[j] == Throwable.class) + { + throws_throwable = true; + break; + } + if (! throws_throwable) + { + exception_count = e.length + 3; // Throwable, Error, RuntimeException + code_length += 9; // new, dup_x1, swap, invokespecial, athrow + } + int handler_pc = code_length - 1; + StringBuffer signature = new StringBuffer("("); + for (int j = 0; j < paramtypes.length; j++) + signature.append(TypeSignature.getEncodingOfClass(paramtypes[j])); + signature.append(")").append(TypeSignature.getEncodingOfClass(ret_type)); + + // Now we have enough information to emit the method. + + // handler.access_flags + putU2(Modifier.PUBLIC | Modifier.FINAL); + // handler.name_index + putU2(utf8Info(m.getName())); + // handler.descriptor_index + putU2(utf8Info(signature.toString())); + // handler.attributes_count - Code is necessary, Exceptions possible + putU2(e.length > 0 ? 2 : 1); + + // handler.Code.info: + // type name(args) { + // try { + // return (type) h.invoke(this, methods[i], new Object[] {args}); + // } catch ( e) { + // throw e; + // } catch (Throwable t) { + // throw new UndeclaredThrowableException(t); + // } + // } + // Special cases: + // if arg_n is primitive, wrap it + // if method throws Throwable, try-catch is not needed + // if method returns void, return statement not needed + // if method returns primitive, unwrap it + // save space by sharing code for all the declared handlers + + // handler.Code.attribute_name_index + putU2(utf8Info("Code")); + // handler.Code.attribute_length + putU4(12 + code_length + 8 * exception_count); + // handler.Code.max_stack + putU2(param_count == 1 ? 4 : 7 + wrap_overhead); + // handler.Code.max_locals + putU2(param_count); + // handler.Code.code_length + putU4(code_length); + // handler.Code.code[] + putU1(ALOAD_0); + putU1(GETFIELD); + putU2(refInfo(FIELD, "java/lang/reflect/Proxy", "h", + "Ljava/lang/reflect/InvocationHandler;")); + putU1(ALOAD_0); + putU1(GETSTATIC); + putU2(refInfo(FIELD, TypeSignature.getEncodingOfClass(qualName, false), + "m", "[Ljava/lang/reflect/Method;")); + putConst(i); + putU1(AALOAD); + if (paramtypes.length > 0) + { + putConst(paramtypes.length); + putU1(ANEWARRAY); + putU2(classInfo("java/lang/Object")); + param_count = 1; + for (int j = 0; j < paramtypes.length; j++, param_count++) + { + putU1(DUP); + putConst(j); + if (paramtypes[j].isPrimitive()) + { + putU1(NEW); + putU2(classInfo(wrapper(paramtypes[j]))); + putU1(DUP); + } + putLoad(param_count, paramtypes[j]); + if (paramtypes[j].isPrimitive()) + { + putU1(INVOKESPECIAL); + putU2(refInfo(METHOD, wrapper(paramtypes[j]), "", + '(' + (TypeSignature + .getEncodingOfClass(paramtypes[j]) + + ")V"))); + if (paramtypes[j] == long.class + || paramtypes[j] == double.class) + param_count++; + } + putU1(AASTORE); + } + } + else + putU1(ACONST_NULL); + putU1(INVOKEINTERFACE); + putU2(refInfo(INTERFACE, "java/lang/reflect/InvocationHandler", + "invoke", INVOKE_SIG)); + putU1(4); // InvocationHandler, this, Method, Object[] + putU1(0); + if (ret_type == void.class) + putU1(RETURN); + else if (ret_type.isPrimitive()) + { + putU1(CHECKCAST); + putU2(classInfo(wrapper(ret_type))); + putU1(INVOKEVIRTUAL); + putU2(refInfo(METHOD, wrapper(ret_type), + ret_type.getName() + "Value", + "()" + TypeSignature.getEncodingOfClass(ret_type))); + if (ret_type == long.class) + putU1(LRETURN); + else if (ret_type == float.class) + putU1(FRETURN); + else if (ret_type == double.class) + putU1(DRETURN); + else + putU1(IRETURN); + } + else + { + putU1(CHECKCAST); + putU2(classInfo(ret_type)); + putU1(ARETURN); + } + if (! throws_throwable) + { + putU1(NEW); + putU2(classInfo("java/lang/reflect/UndeclaredThrowableException")); + putU1(DUP_X1); + putU1(SWAP); + putU1(INVOKESPECIAL); + putU2(refInfo(METHOD, + "java/lang/reflect/UndeclaredThrowableException", + "", "(Ljava/lang/Throwable;)V")); + putU1(ATHROW); + } + + // handler.Code.exception_table_length + putU2(exception_count); + // handler.Code.exception_table[] + if (! throws_throwable) + { + // handler.Code.exception_table.start_pc + putU2(0); + // handler.Code.exception_table.end_pc + putU2(end_pc); + // handler.Code.exception_table.handler_pc + putU2(handler_pc); + // handler.Code.exception_table.catch_type + putU2(classInfo("java/lang/Error")); + // handler.Code.exception_table.start_pc + putU2(0); + // handler.Code.exception_table.end_pc + putU2(end_pc); + // handler.Code.exception_table.handler_pc + putU2(handler_pc); + // handler.Code.exception_table.catch_type + putU2(classInfo("java/lang/RuntimeException")); + for (int j = 0; j < e.length; j++) + { + // handler.Code.exception_table.start_pc + putU2(0); + // handler.Code.exception_table.end_pc + putU2(end_pc); + // handler.Code.exception_table.handler_pc + putU2(handler_pc); + // handler.Code.exception_table.catch_type + putU2(classInfo(e[j])); + } + // handler.Code.exception_table.start_pc + putU2(0); + // handler.Code.exception_table.end_pc + putU2(end_pc); + // handler.Code.exception_table.handler_pc - + // -8 for undeclared handler, which falls thru to normal one + putU2(handler_pc - 8); + // handler.Code.exception_table.catch_type + putU2(0); + } + // handler.Code.attributes_count + putU2(0); + // handler.Code.attributes[] + + if (e.length > 0) + { + // handler.Exceptions.attribute_name_index + putU2(utf8Info("Exceptions")); + // handler.Exceptions.attribute_length + putU4(2 * e.length + 2); + // handler.Exceptions.number_of_exceptions + putU2(e.length); + // handler.Exceptions.exception_index_table[] + for (int j = 0; j < e.length; j++) + putU2(classInfo(e[j])); + } + } + + /** + * Creates the Class object that corresponds to the bytecode buffers + * built when this object was constructed. + * + * @param loader the class loader to define the proxy class in; null + * implies the bootstrap class loader + * @return the proxy class Class object + */ + final Class generate(ClassLoader loader) + { + byte[] bytecode = new byte[pool.length() + stream.length()]; + // More efficient to bypass calling charAt() repetitively. + char[] c = pool.toString().toCharArray(); + int i = c.length; + while (--i >= 0) + bytecode[i] = (byte) c[i]; + c = stream.toString().toCharArray(); + i = c.length; + int j = bytecode.length; + while (i > 0) + bytecode[--j] = (byte) c[--i]; + + // Patch the constant pool size, which we left at 0 earlier. + int count = poolEntries.size() + 1; + bytecode[8] = (byte) (count >> 8); + bytecode[9] = (byte) count; + + try + { + // XXX Do we require more native support here? + + // XXX Security hole - it is possible for another thread to grab the + // VMClassLoader.defineClass Method object, and abuse it while we + // have temporarily made it accessible. Do we need to add some + // synchronization lock to prevent user reflection while we use it? + + // XXX This is waiting on VM support for protection domains. + + Class vmClassLoader = Class.forName("java.lang.VMClassLoader"); + Class[] types = {ClassLoader.class, String.class, + byte[].class, int.class, int.class, + /* ProtectionDomain.class */ }; + Method m = vmClassLoader.getDeclaredMethod("defineClass", types); + + // Bypass the security check of setAccessible(true), since this + // is trusted code. But note the comment above about the security + // risk of doing this outside a synchronized block. + m.flag = true; + Object[] args = {loader, qualName, bytecode, new Integer(0), + new Integer(bytecode.length), + /* Object.class.getProtectionDomain() */ }; + Class clazz = (Class) m.invoke(null, args); + m.flag = false; + + // Finally, initialize the m field of the proxy class, before + // returning it. + + // No security risk here, since clazz has not been exposed yet, + // so user code cannot grab the same reflection object. + Field f = clazz.getDeclaredField("m"); + f.flag = true; + // we can share the array, because it is not publicized + f.set(null, methods); + f.flag = false; + + return clazz; + } + catch (Throwable e) + { + // assert false; + throw (Error) new InternalError("Unexpected: " + e).initCause(e); + } + } + + /** + * Put a single byte on the stream. + * + * @param i the information to add (only lowest 8 bits are used) + */ + private void putU1(int i) + { + stream.append((char) i); + } + + /** + * Put two bytes on the stream. + * + * @param i the information to add (only lowest 16 bits are used) + */ + private void putU2(int i) + { + stream.append((char) (i >> 8)).append((char) i); + } + + /** + * Put four bytes on the stream. + * + * @param i the information to add (treated as unsigned) + */ + private void putU4(int i) + { + stream.append((char) (i >> 24)).append((char) (i >> 16)); + stream.append((char) (i >> 8)).append((char) i); + } + + /** + * Put bytecode to load a constant integer on the stream. This only + * needs to work for values less than Short.MAX_VALUE. + * + * @param i the int to add + */ + private void putConst(int i) + { + if (i >= -1 && i <= 5) + putU1(ICONST_0 + i); + else if (i >= Byte.MIN_VALUE && i <= Byte.MAX_VALUE) + { + putU1(BIPUSH); + putU1(i); + } + else + { + putU1(SIPUSH); + putU2(i); + } + } + + /** + * Put bytecode to load a given local variable on the stream. + * + * @param i the slot to load + * @param type the base type of the load + */ + private void putLoad(int i, Class type) + { + int offset = 0; + if (type == long.class) + offset = 1; + else if (type == float.class) + offset = 2; + else if (type == double.class) + offset = 3; + else if (! type.isPrimitive()) + offset = 4; + if (i < 4) + putU1(ILOAD_0 + 4 * offset + i); + else + { + putU1(ILOAD + offset); + putU1(i); + } + } + + /** + * Given a primitive type, return its wrapper class name. + * + * @param clazz the primitive type (but not void.class) + * @return the internal form of the wrapper class name + */ + private String wrapper(Class clazz) + { + if (clazz == boolean.class) + return "java/lang/Boolean"; + if (clazz == byte.class) + return "java/lang/Byte"; + if (clazz == short.class) + return "java/lang/Short"; + if (clazz == char.class) + return "java/lang/Character"; + if (clazz == int.class) + return "java/lang/Integer"; + if (clazz == long.class) + return "java/lang/Long"; + if (clazz == float.class) + return "java/lang/Float"; + if (clazz == double.class) + return "java/lang/Double"; + // assert false; + return null; + } + + /** + * Returns the entry of this String in the Constant pool, adding it + * if necessary. + * + * @param str the String to resolve + * @return the index of the String in the constant pool + */ + private char utf8Info(String str) + { + String utf8 = toUtf8(str); + int len = utf8.length(); + return poolIndex("\1" + (char) (len >> 8) + (char) (len & 0xff) + utf8); + } + + /** + * Returns the entry of the appropriate class info structure in the + * Constant pool, adding it if necessary. + * + * @param name the class name, in internal form + * @return the index of the ClassInfo in the constant pool + */ + private char classInfo(String name) + { + char index = utf8Info(name); + char[] c = {7, (char) (index >> 8), (char) (index & 0xff)}; + return poolIndex(new String(c)); + } + + /** + * Returns the entry of the appropriate class info structure in the + * Constant pool, adding it if necessary. + * + * @param clazz the class type + * @return the index of the ClassInfo in the constant pool + */ + private char classInfo(Class clazz) + { + return classInfo(TypeSignature.getEncodingOfClass(clazz.getName(), + false)); + } + + /** + * Returns the entry of the appropriate fieldref, methodref, or + * interfacemethodref info structure in the Constant pool, adding it + * if necessary. + * + * @param structure FIELD, METHOD, or INTERFACE + * @param clazz the class name, in internal form + * @param name the simple reference name + * @param type the type of the reference + * @return the index of the appropriate Info structure in the constant pool + */ + private char refInfo(byte structure, String clazz, String name, + String type) + { + char cindex = classInfo(clazz); + char ntindex = nameAndTypeInfo(name, type); + // relies on FIELD == 1, METHOD == 2, INTERFACE == 3 + char[] c = {(char) (structure + 8), + (char) (cindex >> 8), (char) (cindex & 0xff), + (char) (ntindex >> 8), (char) (ntindex & 0xff)}; + return poolIndex(new String(c)); + } + + /** + * Returns the entry of the appropriate nameAndTyperef info structure + * in the Constant pool, adding it if necessary. + * + * @param name the simple name + * @param type the reference type + * @return the index of the NameAndTypeInfo structure in the constant pool + */ + private char nameAndTypeInfo(String name, String type) + { + char nindex = utf8Info(name); + char tindex = utf8Info(type); + char[] c = {12, (char) (nindex >> 8), (char) (nindex & 0xff), + (char) (tindex >> 8), (char) (tindex & 0xff)}; + return poolIndex(new String(c)); + } + + /** + * Converts a regular string to a UTF8 string, where the upper byte + * of every char is 0, and '\\u0000' is not in the string. This is + * basically to use a String as a fancy byte[], and while it is less + * efficient in memory use, it is easier for hashing. + * + * @param str the original, in straight unicode + * @return a modified string, in UTF8 format in the low bytes + */ + private String toUtf8(String str) + { + final char[] ca = str.toCharArray(); + final int len = ca.length; + + // Avoid object creation, if str is already fits UTF8. + int i; + for (i = 0; i < len; i++) + if (ca[i] == 0 || ca[i] > '\u007f') + break; + if (i == len) + return str; + + final StringBuffer sb = new StringBuffer(str); + sb.setLength(i); + for ( ; i < len; i++) + { + final char c = ca[i]; + if (c > 0 && c <= '\u007f') + sb.append(c); + else if (c <= '\u07ff') // includes '\0' + { + sb.append((char) (0xc0 | (c >> 6))); + sb.append((char) (0x80 | (c & 0x6f))); + } + else + { + sb.append((char) (0xe0 | (c >> 12))); + sb.append((char) (0x80 | ((c >> 6) & 0x6f))); + sb.append((char) (0x80 | (c & 0x6f))); + } + } + return sb.toString(); + } + + /** + * Returns the location of a byte sequence (conveniently wrapped in + * a String with all characters between \u0001 and \u00ff inclusive) + * in the constant pool, adding it if necessary. + * + * @param sequence the byte sequence to look for + * @return the index of the sequence + * @throws IllegalArgumentException if this would make the constant + * pool overflow + */ + private char poolIndex(String sequence) + { + Integer i = (Integer) poolEntries.get(sequence); + if (i == null) + { + // pool starts at index 1 + int size = poolEntries.size() + 1; + if (size >= 65535) + throw new IllegalArgumentException("exceeds VM limitations"); + i = new Integer(size); + poolEntries.put(sequence, i); + pool.append(sequence); + } + return (char) i.intValue(); + } + } // class ClassFactory + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/reflect/UndeclaredThrowableException.java gcc-3.3/libjava/java/lang/reflect/UndeclaredThrowableException.java *** gcc-3.2.3/libjava/java/lang/reflect/UndeclaredThrowableException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/reflect/UndeclaredThrowableException.java 2002-09-30 05:19:09.000000000 +0000 *************** *** 0 **** --- 1,128 ---- + /* UndeclaredThrowableException.java -- wraps an undeclared checked exception + thrown by a Proxy invocation handler + Copyright (C) 2001, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.lang.reflect; + + /** + * This exception class is thrown by a {@link Proxy} instance if + * the {@link InvocationHandler#invoke(Object, Method, Object[]) invoke} + * method of that instance's InvocationHandler attempts to throw an + * exception that not declared by the throws clauses of all of the + * interface methods that the proxy instance is implementing. + * + *

        When thrown by Proxy, this class will always wrap a checked + * exception, never {@link Error} or {@link RuntimeException}, + * which are unchecked. + * + * @author Eric Blake + * @see Proxy + * @see InvocationHandler + * @since 1.3 + * @status updated to 1.4 + */ + public class UndeclaredThrowableException extends RuntimeException + { + /** + * Compatible with JDK 1.3+. + */ + private static final long serialVersionUID = 330127114055056639L; + + /** + * The immutable exception that this wraps. This field is redundant + * with {@link Throwable#cause}, but is necessary for serial compatibility. + * + * @serial the chained exception + */ + private final Throwable undeclaredThrowable; + + /** + * Wraps the given checked exception into a RuntimeException, with no + * detail message. {@link Throwable#initCause(Throwable)} will fail + * on this instance. + * + * @param cause the undeclared throwable that caused this exception, + * may be null + */ + public UndeclaredThrowableException(Throwable cause) + { + this(cause, null); + } + + /** + * Wraps the given checked exception into a RuntimeException, with the + * specified detail message. {@link Throwable#initCause(Throwable)} will + * fail on this instance. + * + * @param cause the undeclared throwable that caused this exception, + * may be null + * @param message the message, may be null + */ + public UndeclaredThrowableException(Throwable cause, String message) + { + super(message, cause); + undeclaredThrowable = cause; + } + + /** + * Returns the cause of this exception. If this exception was created + * by a {@link Proxy} instance, it will be a non-null checked + * exception. This method pre-dates exception chaining, and is now + * simply a longer way to call getCause(). + * + * @return the cause of this exception, may be null + * @see #getCause() + */ + public Throwable getUndeclaredThrowable() + { + return undeclaredThrowable; + } + + /** + * Returns the cause of this exception. If this exception was created + * by a {@link Proxy} instance, it will be a non-null checked + * exception. + * + * @return the cause of this exception, may be null + * @since 1.4 + */ + public Throwable getCause() + { + return undeclaredThrowable; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Runnable.java gcc-3.3/libjava/java/lang/Runnable.java *** gcc-3.2.3/libjava/java/lang/Runnable.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Runnable.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.Runnable ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Runnable -- interface for a method tied to an Object; often for Threads ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,49 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Complete. - */ - /** * Runnable is an interface you implement to indicate that your class can be * executed as the main part of a Thread, among other places. When you want --- 38,43 ---- *************** package java.lang; *** 52,65 **** * * @author Paul Fisher * @author Tom Tromey */ - public interface Runnable { /** * This method will be called by whoever wishes to run your class ! * implementing Runnable. ! * @since JDK1.0 */ void run(); } --- 46,62 ---- * * @author Paul Fisher * @author Tom Tromey + * @see Thread + * @since 1.0 + * @status updated to 1.4 */ public interface Runnable { /** * This method will be called by whoever wishes to run your class ! * implementing Runnable. Note that there are no restrictions on what ! * you are allowed to do in the run method, except that you cannot ! * throw a checked exception. */ void run(); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/RuntimeException.java gcc-3.3/libjava/java/lang/RuntimeException.java *** gcc-3.2.3/libjava/java/lang/RuntimeException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/RuntimeException.java 2002-06-16 21:15:35.000000000 +0000 *************** *** 1,6 **** ! /* RuntimeException.java -- all exceptions which are subclasses of this class ! can be thrown at any time during the execution of a Java virtual machine. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* RuntimeException.java -- root of all unchecked exceptions ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,81 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** - * Exceptions may be thrown by one part of a Java program and caught - * by another in order to deal with exceptional conditions. * All exceptions which are subclasses of RuntimeException * can be thrown at any time during the execution of a Java virtual machine. * Methods which throw these exceptions are not required to declare them * in their throws clause. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class RuntimeException extends Exception { ! static final long serialVersionUID = -7034897190745766939L; /** ! * Create an exception without a message. */ public RuntimeException() ! { ! super(); ! } /** ! * Create an exception with a message. */ public RuntimeException(String s) ! { ! super(s); ! } } --- 38,102 ---- package java.lang; /** * All exceptions which are subclasses of RuntimeException * can be thrown at any time during the execution of a Java virtual machine. * Methods which throw these exceptions are not required to declare them * in their throws clause. * * @author Brian Jones * @author Warren Levy ! * @author Eric Blake ! * @status updated to 1.4 */ public class RuntimeException extends Exception { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -7034897190745766939L; /** ! * Create an exception without a message. The cause remains uninitialized. ! * ! * @see #initCause(Throwable) */ public RuntimeException() ! { ! } /** ! * Create an exception with a message. The cause remains uninitialized. ! * ! * @param s the message string ! * @see #initCause(Throwable) */ public RuntimeException(String s) ! { ! super(s); ! } ! ! /** ! * Create an exception with a message and a cause. ! * ! * @param s the message string ! * @param cause the cause of this exception ! * @since 1.4 ! */ ! public RuntimeException(String s, Throwable cause) ! { ! super(s, cause); ! } ! ! /** ! * Create an exception with the given cause, and a message of ! * cause == null ? null : cause.toString(). ! * ! * @param cause the cause of this exception ! * @since 1.4 ! */ ! public RuntimeException(Throwable cause) ! { ! super(cause); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Runtime.java gcc-3.3/libjava/java/lang/Runtime.java *** gcc-3.2.3/libjava/java/lang/Runtime.java 2001-03-12 07:40:17.000000000 +0000 --- gcc-3.3/libjava/java/lang/Runtime.java 2002-08-14 01:07:59.000000000 +0000 *************** *** 1,147 **** ! // Runtime.java - Runtime class. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package java.lang; ! import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.StringTokenizer; /** ! * @author Tom Tromey ! * @date August 27, 1998 ! */ ! ! /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 ! * "The Java Language Specification", ISBN 0-201-63451-1 ! * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: All 1.1 methods exist. exec() is not fully implemented. */ ! public class Runtime { ! public Process exec (String prog) throws IOException { ! return exec (prog, null); } ! public Process exec (String prog, String[] envp) throws IOException { ! StringTokenizer st = new StringTokenizer(prog); ! String[] a = new String[st.countTokens ()]; ! for (int i = 0; i < a.length; i++) ! a[i] = st.nextToken (); ! return exec (a, envp); } ! public Process exec (String[] progarray) throws IOException { ! return exec (progarray, null); } ! public Process exec (String[] progarray, String[] envp) throws IOException { ! SecurityManager s = System.getSecurityManager(); ! if (s != null) ! s.checkExec(progarray[0]); ! return new ConcreteProcess (progarray, envp); } ! private final static void checkExit (int status) { ! SecurityManager s = System.getSecurityManager(); ! if (s != null) ! s.checkExit(status); } ! public native void exit (int status); ! ! // Shutdown the runtime without a SecurityManager check. libgcj uses this ! // exit function internally. ! final native void _exit (int status); ! public native long freeMemory (); ! public native void gc (); ! // Deprecated in 1.1. We implement what the JCL book says. ! public InputStream getLocalizedInputStream (InputStream in) { ! return in; } ! // Deprecated in 1.1. We implement what the JCL book says. ! public OutputStream getLocalizedOutputStream (OutputStream out) { ! return out; } ! public static Runtime getRuntime () { ! return self; } ! private final void checkLink (String lib) { ! if (lib == null) ! throw new NullPointerException (); ! SecurityManager s = System.getSecurityManager(); ! if (s != null) ! s.checkLink(lib); } ! private native void _load (String pathname, boolean do_search); ! public void load (String pathname) { ! _load (pathname, false); } ! public void loadLibrary (String libname) { ! _load (libname, true); } ! // This is a helper function for the ClassLoader which can load ! // compiled libraries. Returns true if library (which is just the ! // base name -- path searching is done by this function) was loaded, ! // false otherwise. ! native boolean loadLibraryInternal (String libname); ! public native void runFinalization (); ! // This method is static in JDK 1.1, but isn't listed as static in ! // the books. It is marked as static in the 1.2 docs. ! public static void runFinalizersOnExit (boolean run) { ! // The status we pass to the security check is unspecified. ! checkExit (0); ! self.finalize_on_exit = run; } ! public native long totalMemory (); ! public native void traceInstructions (boolean on); ! public native void traceMethodCalls (boolean on); ! // A helper for the constructor. ! private final native void init (); ! // The sole constructor. ! private Runtime () { ! init (); } ! // Private data. ! private static Runtime self = new Runtime (); ! // FIXME: for now this can't be static. If it is, our compiler will ! // mark it as local, and it will be inaccessible to natRuntime.cc. ! private boolean finalize_on_exit; ! } --- 1,779 ---- ! /* Runtime.java -- access to the VM process ! Copyright (C) 1998, 2002 Free Software Foundation ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.lang; ! import java.io.File; import java.io.InputStream; + import java.io.IOException; import java.io.OutputStream; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Properties; + import java.util.Set; import java.util.StringTokenizer; /** ! * Runtime represents the Virtual Machine. ! * ! * @author John Keiser ! * @author Eric Blake ! * @status still missing 1.4 functionality */ ! // No idea why this class isn't final, since you can't build a subclass! public class Runtime { ! /** ! * The library path, to search when loading libraries. We can also safely use ! * this as a lock for synchronization. ! */ ! private final String[] libpath; ! ! /** ! * The current security manager. This is located here instead of in ! * Runtime, to avoid security problems, as well as bootstrap issues. ! * Make sure to access it in a thread-safe manner; it is package visible ! * to avoid overhead in java.lang. ! */ ! static SecurityManager securityManager; ! ! /** ! * The default properties defined by the system. This is likewise located ! * here instead of in Runtime, to avoid bootstrap issues; it is package ! * visible to avoid overhead in java.lang. Note that System will add a ! * few more properties to this collection, but that after that, it is ! * treated as read-only. ! * ! * No matter what class you start initialization with, it defers to the ! * superclass, therefore Object. will be the first Java code ! * executed. From there, the bootstrap sequence, up to the point that ! * native libraries are loaded (as of March 24, when I traced this ! * manually) is as follows: ! * ! * Object. uses a String literal, possibly triggering initialization ! * String. calls WeakHashMap., triggering initialization ! * AbstractMap, WeakHashMap, WeakHashMap$1 have no dependencies ! * String. calls CaseInsensitiveComparator., triggering ! * initialization ! * CaseInsensitiveComparator has no dependencies ! * Object. calls System.loadLibrary, triggering initialization ! * System. calls System.loadLibrary ! * System.loadLibrary calls Runtime.getRuntime, triggering initialization ! * Runtime. calls Properties., triggering initialization ! * Dictionary, Hashtable, and Properties have no dependencies ! * Runtime. calls insertSystemProperties; the VM must make sure ! * that there are not any harmful dependencies ! * Runtime. calls Runtime. ! * Runtime. calls StringTokenizer., triggering initialization ! * StringTokenizer has no dependencies ! * System.loadLibrary calls Runtime.loadLibrary ! * Runtime.loadLibrary should be able to load the library, although it ! * will probably set off another string of initializations from ! * ClassLoader first ! */ ! static Properties defaultProperties = new Properties(); ! static { ! insertSystemProperties(defaultProperties); } ! /** ! * The thread that started the exit sequence. Access to this field must ! * be thread-safe; lock on libpath to avoid deadlock with user code. ! * runFinalization() may want to look at this to see if ALL ! * finalizers should be run, because the virtual machine is about to halt. ! */ ! private Thread exitSequence; ! ! /** ! * All shutdown hooks. This is initialized lazily, and set to null once all ! * shutdown hooks have run. Access to this field must be thread-safe; lock ! * on libpath to avoid deadlock with user code. ! */ ! private Set shutdownHooks; ! ! /** True if we should finalize on exit. */ ! private boolean finalizeOnExit; ! ! /** ! * The one and only runtime instance. This must appear after the default ! * properties have been initialized by the VM. ! */ ! private static final Runtime current = new Runtime(); ! ! /** ! * Not instantiable by a user, this should only create one instance. ! */ ! private Runtime() { ! if (current != null) ! throw new InternalError("Attempt to recreate Runtime"); ! ! // We don't use libpath in the libgcj implementation. We still ! // set it to something to allow the various synchronizations to ! // work. ! libpath = new String[0]; ! ! init (); } ! /** ! * Get the current Runtime object for this JVM. This is necessary to access ! * the many instance methods of this class. ! * ! * @return the current Runtime object ! */ ! public static Runtime getRuntime() { ! return current; } ! /** ! * Exit the Java runtime. This method will either throw a SecurityException ! * or it will never return. The status code is returned to the system; often ! * a non-zero status code indicates an abnormal exit. Of course, there is a ! * security check, checkExit(status). ! * ! *

        First, all shutdown hooks are run, in unspecified order, and ! * concurrently. Next, if finalization on exit has been enabled, all pending ! * finalizers are run. Finally, the system calls halt. ! * ! *

        If this is run a second time after shutdown has already started, there ! * are two actions. If shutdown hooks are still executing, it blocks ! * indefinitely. Otherwise, if the status is nonzero it halts immediately; ! * if it is zero, it blocks indefinitely. This is typically called by ! * System.exit. ! * ! * @param status the status to exit with ! * @throws SecurityException if permission is denied ! * @see #addShutdownHook(Thread) ! * @see #runFinalizersOnExit(boolean) ! * @see #runFinalization() ! * @see #halt(int) ! */ ! public void exit(int status) { ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkExit(status); ! boolean first = false; ! synchronized (libpath) // Synch on libpath, not this, to avoid deadlock. ! { ! if (exitSequence == null) ! { ! first = true; ! exitSequence = Thread.currentThread(); ! if (shutdownHooks != null) ! { ! Iterator i = shutdownHooks.iterator(); ! while (i.hasNext()) // Start all shutdown hooks. ! try ! { ! ((Thread) i.next()).start(); ! } ! catch (IllegalThreadStateException e) ! { ! i.remove(); ! } ! } ! } ! } ! if (first) ! { ! if (shutdownHooks != null) ! { ! // Check progress of all shutdown hooks. As a hook completes, ! // remove it from the set. If a hook calls exit, it removes ! // itself from the set, then waits indefinitely on the ! // exitSequence thread. Once the set is empty, set it to null to ! // signal all finalizer threads that halt may be called. ! while (! shutdownHooks.isEmpty()) ! { ! Thread[] hooks; ! synchronized (libpath) ! { ! hooks = new Thread[shutdownHooks.size()]; ! shutdownHooks.toArray(hooks); ! } ! for (int i = hooks.length; --i >= 0; ) ! if (! hooks[i].isAlive()) ! synchronized (libpath) ! { ! shutdownHooks.remove(hooks[i]); ! } ! try ! { ! exitSequence.sleep(1); // Give other threads a chance. ! } ! catch (InterruptedException e) ! { ! // Ignore, the next loop just starts sooner. ! } ! } ! synchronized (libpath) ! { ! shutdownHooks = null; ! } ! } ! // XXX Right now, it is the VM that knows whether runFinalizersOnExit ! // is true; so the VM must look at exitSequence to decide whether ! // this should be run on every object. ! runFinalization(); ! } ! else ! synchronized (libpath) ! { ! if (shutdownHooks != null) ! { ! shutdownHooks.remove(Thread.currentThread()); ! status = 0; // Change status to enter indefinite wait. ! } ! } ! ! if (first || status > 0) ! halt(status); ! while (true) ! try ! { ! exitSequence.join(); ! } ! catch (InterruptedException e) ! { ! // Ignore, we've suspended indefinitely to let all shutdown ! // hooks complete, and to let any non-zero exits through, because ! // this is a duplicate call to exit(0). ! } } ! /** ! * Register a new shutdown hook. This is invoked when the program exits ! * normally (because all non-daemon threads ended, or because ! * System.exit was invoked), or when the user terminates ! * the virtual machine (such as by typing ^C, or logging off). There is ! * a security check to add hooks, ! * RuntimePermission("shutdownHooks"). ! * ! *

        The hook must be an initialized, but unstarted Thread. The threads ! * are run concurrently, and started in an arbitrary order; and user ! * threads or daemons may still be running. Once shutdown hooks have ! * started, they must all complete, or else you must use halt, ! * to actually finish the shutdown sequence. Attempts to modify hooks ! * after shutdown has started result in IllegalStateExceptions. ! * ! *

        It is imperative that you code shutdown hooks defensively, as you ! * do not want to deadlock, and have no idea what other hooks will be ! * running concurrently. It is also a good idea to finish quickly, as the ! * virtual machine really wants to shut down! ! * ! *

        There are no guarantees that such hooks will run, as there are ways ! * to forcibly kill a process. But in such a drastic case, shutdown hooks ! * would do little for you in the first place. ! * ! * @param hook an initialized, unstarted Thread ! * @throws IllegalArgumentException if the hook is already registered or run ! * @throws IllegalStateException if the virtual machine is already in ! * the shutdown sequence ! * @throws SecurityException if permission is denied ! * @since 1.3 ! * @see #removeShutdownHook(Thread) ! * @see #exit(int) ! * @see #halt(int) ! */ ! public void addShutdownHook(Thread hook) { ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkPermission(new RuntimePermission("shutdownHooks")); ! if (hook.isAlive() || hook.getThreadGroup() == null) ! throw new IllegalArgumentException(); ! synchronized (libpath) ! { ! if (exitSequence != null) ! throw new IllegalStateException(); ! if (shutdownHooks == null) ! shutdownHooks = new HashSet(); // Lazy initialization. ! if (! shutdownHooks.add(hook)) ! throw new IllegalArgumentException(); ! } } ! /** ! * De-register a shutdown hook. As when you registered it, there is a ! * security check to remove hooks, ! * RuntimePermission("shutdownHooks"). ! * ! * @param hook the hook to remove ! * @return true if the hook was successfully removed, false if it was not ! * registered in the first place ! * @throws IllegalStateException if the virtual machine is already in ! * the shutdown sequence ! * @throws SecurityException if permission is denied ! * @since 1.3 ! * @see #addShutdownHook(Thread) ! * @see #exit(int) ! * @see #halt(int) ! */ ! public boolean removeShutdownHook(Thread hook) ! { ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkPermission(new RuntimePermission("shutdownHooks")); ! synchronized (libpath) ! { ! if (exitSequence != null) ! throw new IllegalStateException(); ! if (shutdownHooks != null) ! return shutdownHooks.remove(hook); ! } ! return false; ! } ! /** ! * Forcibly terminate the virtual machine. This call never returns. It is ! * much more severe than exit, as it bypasses all shutdown ! * hooks and initializers. Use caution in calling this! Of course, there is ! * a security check, checkExit(status). ! * ! * @param status the status to exit with ! * @throws SecurityException if permission is denied ! * @since 1.3 ! * @see #exit(int) ! * @see #addShutdownHook(Thread) ! */ ! public void halt(int status) ! { ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkExit(status); ! exitInternal(status); ! } ! /** ! * Tell the VM to run the finalize() method on every single Object before ! * it exits. Note that the JVM may still exit abnormally and not perform ! * this, so you still don't have a guarantee. And besides that, this is ! * inherently unsafe in multi-threaded code, as it may result in deadlock ! * as multiple threads compete to manipulate objects. This value defaults to ! * false. There is a security check, checkExit(0). ! * ! * @param finalizeOnExit whether to finalize all Objects on exit ! * @throws SecurityException if permission is denied ! * @see #exit(int) ! * @see #gc() ! * @since 1.1 ! * @deprecated never rely on finalizers to do a clean, thread-safe, ! * mop-up from your code ! */ ! public static void runFinalizersOnExit(boolean finalizeOnExit) { ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkExit(0); ! current.finalizeOnExit = finalizeOnExit; } ! /** ! * Create a new subprocess with the specified command line. Calls ! * exec(cmdline, null, null). A security check is performed, ! * checkExec. ! * ! * @param cmdline the command to call ! * @return the Process object ! * @throws SecurityException if permission is denied ! * @throws IOException if an I/O error occurs ! * @throws NullPointerException if cmdline is null ! * @throws IndexOutOfBoundsException if cmdline is "" ! */ ! public Process exec(String cmdline) throws IOException { ! return exec(cmdline, null, null); } ! /** ! * Create a new subprocess with the specified command line and environment. ! * If the environment is null, the process inherits the environment of ! * this process. Calls exec(cmdline, env, null). A security ! * check is performed, checkExec. ! * ! * @param cmdline the command to call ! * @param env the environment to use, in the format name=value ! * @return the Process object ! * @throws SecurityException if permission is denied ! * @throws IOException if an I/O error occurs ! * @throws NullPointerException if cmdline is null, or env has null entries ! * @throws IndexOutOfBoundsException if cmdline is "" ! */ ! public Process exec(String cmdline, String[] env) throws IOException { ! return exec(cmdline, env, null); } ! /** ! * Create a new subprocess with the specified command line, environment, and ! * working directory. If the environment is null, the process inherits the ! * environment of this process. If the directory is null, the process uses ! * the current working directory. This splits cmdline into an array, using ! * the default StringTokenizer, then calls ! * exec(cmdArray, env, dir). A security check is performed, ! * checkExec. ! * ! * @param cmdline the command to call ! * @param env the environment to use, in the format name=value ! * @param dir the working directory to use ! * @return the Process object ! * @throws SecurityException if permission is denied ! * @throws IOException if an I/O error occurs ! * @throws NullPointerException if cmdline is null, or env has null entries ! * @throws IndexOutOfBoundsException if cmdline is "" ! * @since 1.3 ! */ ! public Process exec(String cmdline, String[] env, File dir) ! throws IOException { ! StringTokenizer t = new StringTokenizer(cmdline); ! String[] cmd = new String[t.countTokens()]; ! for (int i = 0; i < cmd.length; i++) ! cmd[i] = t.nextToken(); ! return exec(cmd, env, dir); } ! /** ! * Create a new subprocess with the specified command line, already ! * tokenized. Calls exec(cmd, null, null). A security check ! * is performed, checkExec. ! * ! * @param cmd the command to call ! * @return the Process object ! * @throws SecurityException if permission is denied ! * @throws IOException if an I/O error occurs ! * @throws NullPointerException if cmd is null, or has null entries ! * @throws IndexOutOfBoundsException if cmd is length 0 ! */ ! public Process exec(String[] cmd) throws IOException ! { ! return exec(cmd, null, null); ! } ! /** ! * Create a new subprocess with the specified command line, already ! * tokenized, and specified environment. If the environment is null, the ! * process inherits the environment of this process. Calls ! * exec(cmd, env, null). A security check is performed, ! * checkExec. ! * ! * @param cmd the command to call ! * @param env the environment to use, in the format name=value ! * @return the Process object ! * @throws SecurityException if permission is denied ! * @throws IOException if an I/O error occurs ! * @throws NullPointerException if cmd is null, or cmd or env has null ! * entries ! * @throws IndexOutOfBoundsException if cmd is length 0 ! */ ! public Process exec(String[] cmd, String[] env) throws IOException { ! return exec(cmd, env, null); } ! /** ! * Create a new subprocess with the specified command line, already ! * tokenized, and the specified environment and working directory. If the ! * environment is null, the process inherits the environment of this ! * process. If the directory is null, the process uses the current working ! * directory. A security check is performed, checkExec. ! * ! * @param cmd the command to call ! * @param env the environment to use, in the format name=value ! * @param dir the working directory to use ! * @return the Process object ! * @throws SecurityException if permission is denied ! * @throws IOException if an I/O error occurs ! * @throws NullPointerException if cmd is null, or cmd or env has null ! * entries ! * @throws IndexOutOfBoundsException if cmd is length 0 ! * @since 1.3 ! */ ! public Process exec(String[] cmd, String[] env, File dir) ! throws IOException { ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkExec(cmd[0]); ! return execInternal(cmd, env, dir); } ! /** ! * Returns the number of available processors currently available to the ! * virtual machine. This number may change over time; so a multi-processor ! * program want to poll this to determine maximal resource usage. ! * ! * @return the number of processors available, at least 1 ! */ ! public native int availableProcessors(); ! /** ! * Find out how much memory is still free for allocating Objects on the heap. ! * ! * @return the number of bytes of free memory for more Objects ! */ ! public native long freeMemory(); ! /** ! * Find out how much memory total is available on the heap for allocating ! * Objects. ! * ! * @return the total number of bytes of memory for Objects ! */ ! public native long totalMemory(); ! ! /** ! * Returns the maximum amount of memory the virtual machine can attempt to ! * use. This may be Long.MAX_VALUE if there is no inherent ! * limit (or if you really do have a 8 exabyte memory!). ! * ! * @return the maximum number of bytes the virtual machine will attempt ! * to allocate ! */ ! public native long maxMemory(); ! ! /** ! * Run the garbage collector. This method is more of a suggestion than ! * anything. All this method guarantees is that the garbage collector will ! * have "done its best" by the time it returns. Notice that garbage ! * collection takes place even without calling this method. ! */ ! public native void gc(); ! ! /** ! * Run finalization on all Objects that are waiting to be finalized. Again, ! * a suggestion, though a stronger one than {@link #gc()}. This calls the ! * finalize method of all objects waiting to be collected. ! * ! * @see #finalize() ! */ ! public native void runFinalization(); ! ! /** ! * Tell the VM to trace every bytecode instruction that executes (print out ! * a trace of it). No guarantees are made as to where it will be printed, ! * and the VM is allowed to ignore this request. ! * ! * @param on whether to turn instruction tracing on ! */ ! public native void traceInstructions(boolean on); ! ! /** ! * Tell the VM to trace every method call that executes (print out a trace ! * of it). No guarantees are made as to where it will be printed, and the ! * VM is allowed to ignore this request. ! * ! * @param on whether to turn method tracing on ! */ ! public native void traceMethodCalls(boolean on); ! ! /** ! * Load a native library using the system-dependent filename. This is similar ! * to loadLibrary, except the only name mangling done is inserting "_g" ! * before the final ".so" if the VM was invoked by the name "java_g". There ! * may be a security check, of checkLink. ! * ! * @param filename the file to load ! * @throws SecurityException if permission is denied ! * @throws UnsatisfiedLinkError if the library is not found ! */ ! public void load(String filename) { ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkLink(filename); ! _load(filename, false); } ! /** ! * Load a native library using a system-independent "short name" for the ! * library. It will be transformed to a correct filename in a ! * system-dependent manner (for example, in Windows, "mylib" will be turned ! * into "mylib.dll"). This is done as follows: if the context that called ! * load has a ClassLoader cl, then cl.findLibrary(libpath) is ! * used to convert the name. If that result was null, or there was no class ! * loader, this searches each directory of the system property ! * java.library.path for a file named ! * System.mapLibraryName(libname). There may be a security ! * check, of checkLink. ! * ! * @param filename the file to load ! * @throws SecurityException if permission is denied ! * @throws UnsatisfiedLinkError if the library is not found ! * @see System#mapLibraryName(String) ! * @see ClassLoader#findLibrary(String) ! */ ! public void loadLibrary(String libname) ! { ! // This is different from the Classpath implementation, but I ! // believe it is more correct. ! SecurityManager sm = securityManager; // Be thread-safe! ! if (sm != null) ! sm.checkLink(libname); ! _load(libname, true); ! } ! /** ! * Return a localized version of this InputStream, meaning all characters ! * are localized before they come out the other end. ! * ! * @param in the stream to localize ! * @return the localized stream ! * @deprecated InputStreamReader is the preferred way to read ! * local encodings ! */ ! public InputStream getLocalizedInputStream(InputStream in) ! { ! return in; ! } ! /** ! * Return a localized version of this OutputStream, meaning all characters ! * are localized before they are sent to the other end. ! * ! * @param out the stream to localize ! * @return the localized stream ! * @deprecated OutputStreamWriter is the preferred way to write ! * local encodings ! */ ! public OutputStream getLocalizedOutputStream(OutputStream out) { ! return out; } ! /** ! * Native method that actually shuts down the virtual machine. ! * ! * @param status the status to end the process with ! */ ! native void exitInternal(int status); ! ! /** ! * Load a file. If it has already been loaded, do nothing. The name has ! * already been mapped to a true filename. ! * ! * @param filename the file to load ! * @param do_search True if we should search the load path for the file ! */ ! native void _load(String filename, boolean do_search); ! ! /** ! *This is a helper function for the ClassLoader which can load ! * compiled libraries. Returns true if library (which is just the ! * base name -- path searching is done by this function) was loaded, ! * false otherwise. ! */ ! native boolean loadLibraryInternal(String libname); ! ! /** ! * A helper for the constructor which does some internal native ! * initialization. ! */ ! private native void init (); ! ! /** ! * Map a system-independent "short name" to the full file name, and append ! * it to the path. ! * XXX This method is being replaced by System.mapLibraryName. ! * ! * @param pathname the path ! * @param libname the short version of the library name ! * @return the full filename ! */ ! static native String nativeGetLibname(String pathname, String libname); ! ! /** ! * Execute a process. The command line has already been tokenized, and ! * the environment should contain name=value mappings. If directory is null, ! * use the current working directory; otherwise start the process in that ! * directory. ! * ! * @param cmd the non-null command tokens ! * @param env the non-null environment setup ! * @param dir the directory to use, may be null ! * @return the newly created process ! * @throws NullPointerException if cmd or env have null elements ! */ ! native Process execInternal(String[] cmd, String[] env, File dir); ! ! /** ! * Get the system properties. This is done here, instead of in System, ! * because of the bootstrap sequence. Note that the native code should ! * not try to use the Java I/O classes yet, as they rely on the properties ! * already existing. The only safe method to use to insert these default ! * system properties is {@link Properties#setProperty(String, String)}. ! * ! *

        These properties MUST include: ! *

        ! *
        java.version
        Java version number ! *
        java.vendor
        Java vendor specific string ! *
        java.vendor.url
        Java vendor URL ! *
        java.home
        Java installation directory ! *
        java.vm.specification.version
        VM Spec version ! *
        java.vm.specification.vendor
        VM Spec vendor ! *
        java.vm.specification.name
        VM Spec name ! *
        java.vm.version
        VM implementation version ! *
        java.vm.vendor
        VM implementation vendor ! *
        java.vm.name
        VM implementation name ! *
        java.specification.version
        Java Runtime Environment version ! *
        java.specification.vendor
        Java Runtime Environment vendor ! *
        java.specification.name
        Java Runtime Environment name ! *
        java.class.version
        Java class version number ! *
        java.class.path
        Java classpath ! *
        java.library.path
        Path for finding Java libraries ! *
        java.io.tmpdir
        Default temp file path ! *
        java.compiler
        Name of JIT to use ! *
        java.ext.dirs
        Java extension path ! *
        os.name
        Operating System Name ! *
        os.arch
        Operating System Architecture ! *
        os.version
        Operating System Version ! *
        file.separator
        File separator ("/" on Unix) ! *
        path.separator
        Path separator (":" on Unix) ! *
        line.separator
        Line separator ("\n" on Unix) ! *
        user.name
        User account name ! *
        user.home
        User home directory ! *
        user.dir
        User's current working directory ! *
        ! * ! * @param p the Properties object to insert the system properties into ! */ ! static native void insertSystemProperties(Properties p); ! } // class Runtime diff -Nrc3pad gcc-3.2.3/libjava/java/lang/RuntimePermission.java gcc-3.3/libjava/java/lang/RuntimePermission.java *** gcc-3.2.3/libjava/java/lang/RuntimePermission.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/RuntimePermission.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* RuntimePermission.java ! Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* RuntimePermission.java -- permission for a secure runtime action ! Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,51 **** package java.lang; ! import java.security.*; /** * A RuntimePermission contains a permission name, but no * actions list. This means you either have the permission or you don't. * * Permission names have the follow the hierarchial property naming ! * convention. In addition, an asterisk may appear at the end of a * name if following a period or by itself. * * --- 38,51 ---- package java.lang; ! import java.security.BasicPermission; /** * A RuntimePermission contains a permission name, but no * actions list. This means you either have the permission or you don't. * * Permission names have the follow the hierarchial property naming ! * convention. In addition, an asterisk may appear at the end of a * name if following a period or by itself. * *
        *************** import java.security.*; *** 53,164 **** * * *
        "accessClassInPackage.*","*""**", "*x", "*.a"
        - *
        - * - * The following table provides a list of all the possible RuntimePermission - * permission names with a description of what that permission allows. *
        * ! * * * ! * * * ! * * * ! * * * ! * * * ! * * * ! * * * ! * * * ! * * * * * * * * * * * * ! * * * ! * * ! * * ! * ! * * ! * ! * * ! * ! * * * ! * * * ! * *
        Permission NamePermission Allows
        createClassLoadercreation of a class loader
        getClassLoaderretrieval of the class loader for the calling class
        setContextClassLoaderallows the setting of the context class loader used by a ! * thread including system threads
        setSecurityManagerallows the application to replace the security manager with ! * another, possibly less restrictive one.
        createSecurityManagerallows the application to create a new security manager
        exitVMallows the application to halt the virtual machine
        setFactoryallows the application to set the socket factory for socket, ! * server socket, stream handler, or RMI socket factory.
        setIOallows the application to set System.out, System.in, and ! * System.err
        modifyThreadallows the application to modify any thread in the virtual machine * using any of the methods stop, resume, ! * suspend, setPriority, and ! * setName of classs Thread
        stopThreadallows the application to stop any thread it has ! * access to in the system
        modifyThreadGroupallows the application to modify thread groups using any of the ! * methods destroy, resume, ! * setDaemon, setMaxPriority, * stop, and suspend of the class ! * ThreadGroup
        getProtectionDomain
        readFileDescriptor
        writeFileDescriptor ! *
        loadLibrary.{library name}
        accessClassInPackage.{package name}
        defineClassInPackage.{package name}
        accessDeclaredMembers
        queuePrintJob
        ! * ! * @since JDK 1.2 ! * * @author Brian Jones */ ! public final class RuntimePermission extends java.security.BasicPermission { /** ! * * @param permissionName the name of the granted permission ! * ! * @throws IllegalArgumentException thrown if the name contains an invalid ! * wildcard character */ public RuntimePermission(String permissionName) { ! this(permissionName, null); } /** * * @param permissionName the name of the granted permission ! * @param actions this should always be null ! * ! * @throws IllegalArgumentException throw if the name contains an invalid ! * wildcard character */ public RuntimePermission(String permissionName, String actions) ! { ! super(permissionName, actions); ! } } --- 53,208 ---- * "accessClassInPackage.*","*" * "**", "*x", "*.a" * *
        + * + * The following table provides a list of all the possible RuntimePermission + * permission names with a description of what that permission allows.
        * ! * * ! * ! * * * ! * ! * * * ! * ! * * * ! * ! * * * ! * ! * * * ! * ! * ! * ! * ! * ! * * * ! * ! * * * ! * ! * * * * ! * * * * ! * * * * ! * * * ! * ! * * * ! * ! * * ! * ! * ! * * ! * ! * ! * * ! * ! * ! * * ! * ! * ! * * * ! * ! * * * ! * ! * *
        Permission NamePermission AllowsRisks *
        createClassLoadercreation of a class loadera class loader can load rogue classes which bypass all security ! * permissions
        getClassLoaderretrieval of the class loader for the calling classrogue code could load classes not otherwise available
        setContextClassLoaderallows the setting of the context class loader used by a threadrogue code could change the context class loader needed by system ! * threads
        setSecurityManagerallows the application to replace the security managerthe new manager may be less restrictive, so that rogue code can ! * bypass existing security checks
        createSecurityManagerallows the application to create a new security managerrogue code can use the new security manager to discover information ! * about the execution stack
        exitVMallows the application to halt the virtual machinerogue code can mount a denial-of-service attack by killing the ! * virtual machine
        shutdownHooksallows registration and modification of shutdown hooksrogue code can add a hook that interferes with clean ! * virtual machine shutdown
        setFactoryallows the application to set the socket factory for socket, ! * server socket, stream handler, or RMI socket factory.rogue code can create a rogue network object which mangles or ! * intercepts data
        setIOallows the application to set System.out, System.in, and ! * System.errrogue code could sniff user input and intercept or mangle ! * output
        modifyThreadallows the application to modify any thread in the virtual machine * using any of the methods stop, resume, ! * suspend, setPriority, and ! * setName of classs Threadrogue code could adversely modify system or user threads
        stopThreadallows the application to stop any thread it has ! * access to in the systemrogue code can stop arbitrary threads
        modifyThreadGroupallows the application to modify thread groups using any of the ! * methods destroy, resume, ! * setDaemon, setMaxPriority, * stop, and suspend of the class ! * ThreadGrouprogue code can mount a denial-of-service attack by changing run ! * priorities
        getProtectionDomainretrieve a class's ProtectionDomainrogue code can gain information about the security policy, to ! * prepare a better attack
        readFileDescriptorread a file descriptorrogue code can read sensitive information
        writeFileDescriptorwrite a file descriptorrogue code can write files, including viruses, and can modify the ! * virtual machine binary; if not just fill up the disk
        loadLibrary.library namedynamic linking of the named librarynative code can bypass many security checks of pure Java
        accessClassInPackage.package nameaccess to a package via a ClassLoaderrogue code can access classes not normally available
        defineClassInPackage.package namedefine a class inside a given packagerogue code can install rogue classes, including in trusted packages ! * like java.security or java.lang
        accessDeclaredMembersaccess declared class members via reflectionrogue code can discover information, invoke methods, or modify fields ! * that are not otherwise available
        queuePrintJobinitiate a print jobrogue code could make a hard copy of sensitive information, or ! * simply waste paper
        ! * * @author Brian Jones + * @author Eric Blake + * @see BasicPermission + * @see Permission + * @see SecurityManager + * @since 1.2 + * @status updated to 1.4 */ ! public final class RuntimePermission extends BasicPermission { /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 7399184964622342223L; ! ! /** ! * Create a new permission with the specified name. ! * * @param permissionName the name of the granted permission ! * @throws NullPointerException if name is null ! * @throws IllegalArgumentException thrown if name is empty or invalid */ public RuntimePermission(String permissionName) { ! super(permissionName); } /** + * Create a new permission with the specified name. The actions argument + * is ignored, as runtime permissions have no actions. * * @param permissionName the name of the granted permission ! * @param actions ignored ! * @throws NullPointerException if name is null ! * @throws IllegalArgumentException thrown if name is empty or invalid */ public RuntimePermission(String permissionName, String actions) ! { ! super(permissionName); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/SecurityException.java gcc-3.3/libjava/java/lang/SecurityException.java *** gcc-3.2.3/libjava/java/lang/SecurityException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/SecurityException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* SecurityException.java -- exception thrown to indicate a security ! violation. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* SecurityException.java -- thrown to indicate a security violation ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,79 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** - * Exceptions may be thrown by one part of a Java program and caught - * by another in order to deal with exceptional conditions. * The security manager will throw this exception to indicate a security ! * violation. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class SecurityException extends RuntimeException { ! static final long serialVersionUID = 6878364983674394167L; /** * Create an exception without a message. */ public SecurityException() ! { ! super(); ! } /** * Create an exception with a message. */ public SecurityException(String s) ! { ! super(s); ! } } --- 38,74 ---- package java.lang; /** * The security manager will throw this exception to indicate a security ! * violation. This can occur any time an operation is attempted which is ! * deemed unsafe by the current security policies. * * @author Brian Jones * @author Warren Levy ! * @see SecurityManager ! * @status updated to 1.4 */ public class SecurityException extends RuntimeException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 6878364983674394167L; /** * Create an exception without a message. */ public SecurityException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public SecurityException(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/SecurityManager.java gcc-3.3/libjava/java/lang/SecurityManager.java *** gcc-3.2.3/libjava/java/lang/SecurityManager.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/SecurityManager.java 2002-12-01 16:16:19.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.SecurityManager ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* SecurityManager.java -- security checks for privileged actions ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,773 **** package java.lang; ! import java.net.*; ! import java.util.*; ! import java.io.*; /** ! ** SecurityManager is a class you can extend to create ! ** your own Java security policy. By default, there is ! ** no SecurityManager installed in 1.1, which means that ! ** all things are permitted to all people.

        ! ** ! ** The default methods in this class deny all ! ** things to all people. ! ** ! ** @author John Keiser ! ** @version 1.1.0, 31 May 1998 ! ** @since JDK1.0 ! **/ ! public class SecurityManager { ! /** Tells whether or not the SecurityManager is currently ! ** performing a security check. ! **/ ! protected boolean inCheck; ! /** Tells whether or not the SecurityManager is currently ! ** performing a security check. ! ** ! ** @return whether or not the SecurityManager is ! ** currently performing a security check. ! **/ ! public boolean getInCheck() { ! return inCheck; ! } ! /** Get a list of all the classes currently executing ! ** methods on the Java stack. getClassContext()[0] is ! ** the currently executing method ! ** Spec Note: does not say whether ! ** the stack will include the getClassContext() call or ! ** the one just before it. ! ** ! ** @return an array containing all the methods on classes ! ** on the Java execution stack. ! **/ ! protected Class[] getClassContext() { ! return VMSecurityManager.getClassContext(); ! } ! /** Find the ClassLoader for the most recent class on the ! ** stack that was loaded by an explicit ClassLoader. If ! ** everything on the stack was loaded by the system ! ** classloader, null is returned. ! ** ! ** @return the most recent ClassLoader on the execution ! ** stack. ! **/ ! protected ClassLoader currentClassLoader() { ! return VMSecurityManager.currentClassLoader(); ! } ! /** Find the most recent class on the stack that was ! ** loaded by an explicit ClassLoader. If everything on ! ** the stack was loaded by the system classloader, null ! ** is returned. ! ** ! ** @return the most recent loaded Class on the execution ! ** stack. ! **/ ! protected Class currentLoadedClass() { ! Class[] c = getClassContext(); ! for(int i=0;i ! ** ! ** Currently the only methods that use this are checkRead() ! ** and checkConnect(). ! ** ! ** @see checkConnect(java.lang.String,int,java.lang.Object) ! ** @see checkRead(java.lang.String,java.lang.Object) ! **/ ! public Object getSecurityContext() { ! return new SecurityContext(getClassContext()); ! } ! /** Check if the current thread is allowed to create a ! ** ClassLoader.

        ! ** ! ** This method is called from ClassLoader.ClassLoader(), ! ** in other words, whenever a ClassLoader is created.

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.ClassLoader#ClassLoader() ! **/ ! public void checkCreateClassLoader() { ! throw new SecurityException("Cannot create new ClassLoaders."); ! } ! /** Check if the current thread is allowed to modify this ! ** other Thread.

        ! ** ! ** Called by Thread.stop(), suspend(), resume(), and ! ** interrupt(), destroy(), setPriority(), setName() and ! ** setDaemon().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param g the Thread to check against ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.Thread#stop() ! ** @see java.lang.Thread#suspend() ! ** @see java.lang.Thread#resume() ! ** @see java.lang.Thread#interrupt() ! ** @see java.lang.Thread#destroy() ! ** @see java.lang.Thread#setPriority(int) ! ** @see java.lang.Thread#setName(java.lang.String) ! ** @see java.lang.Thread#setDaemon(boolean) ! **/ ! public void checkAccess(Thread t) { ! throw new SecurityException("Cannot modify Threads."); ! } ! /** Check if the current thread is allowed to modify this ! ** ThreadGroup.

        ! ** ! ** Called by Thread.Thread() (to add a thread to the ! ** ThreadGroup), ThreadGroup.ThreadGroup() (to add this ! ** ThreadGroup to a parent), ThreadGroup.stop(), ! ** suspend(), resume(), interrupt(), destroy(), ! ** setDaemon(), and setMaxPriority().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param g the ThreadGroup to check against ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.Thread#Thread() ! ** @see java.lang.ThreadGroup#ThreadGroup() ! ** @see java.lang.ThreadGroup#stop() ! ** @see java.lang.ThreadGroup#suspend() ! ** @see java.lang.ThreadGroup#resume() ! ** @see java.lang.ThreadGroup#interrupt() ! ** @see java.lang.ThreadGroup#setDaemon(boolean) ! ** @see java.lang.ThreadGroup#setMaxPriority(int) ! **/ ! public void checkAccess(ThreadGroup g) { ! throw new SecurityException("Cannot modify ThreadGroups."); ! } ! /** Check if the current thread is allowed to exit the ! ** JVM with the given status.

        ! ** ! ** This method is called from Runtime.exit().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param status the status to exit with ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.Runtime#exit() ! ** @see java.lang.Runtime#exit(int) ! **/ ! public void checkExit(int status) { ! throw new SecurityException("Cannot exit JVM."); ! } ! /** Check if the current thread is allowed to execute the ! ** given program.

        ! ** ! ** This method is called from Runtime.exec().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param program the name of the program to exec ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.Runtime#exec(java.lang.String[],java.lang.String[]) ! **/ ! public void checkExec(String program) { ! throw new SecurityException("Cannot execute programs."); ! } ! /** Check if the current thread is allowed to link in the ! ** given native library.

        ! ** ! ** This method is called from Runtime.load() (and hence, ! ** by loadLibrary() as well).

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param filename the full name of the library to load ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.Runtime#load(java.lang.String) ! **/ ! public void checkLink(String filename) { ! throw new SecurityException("Cannot link native libraries."); ! } ! /** Check if the current thread is allowed to read the ! ** given file using the FileDescriptor.

        ! ** ! ** This method is called from ! ** FileInputStream.FileInputStream().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param desc the FileDescriptor representing the file ! ** to access ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.io.FileInputStream#FileInputStream(java.io.FileDescriptor) ! **/ ! public void checkRead(FileDescriptor desc) { ! throw new SecurityException("Cannot read files via file descriptors."); ! } ! /** Check if the current thread is allowed to read the ! ** given file.

        ! ** ! ** This method is called from ! ** FileInputStream.FileInputStream(), ! ** RandomAccessFile.RandomAccessFile(), File.exists(), ! ** canRead(), isFile(), isDirectory(), lastModified(), ! ** length() and list().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param filename the full name of the file to access ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.io.File ! ** @see java.io.FileInputStream#FileInputStream(java.lang.String) ! ** @see java.io.RandomAccessFile#RandomAccessFile(java.lang.String) ! **/ ! public void checkRead(String filename) { ! throw new SecurityException("Cannot read files via file names."); ! } ! /** Check if the current thread is allowed to read the ! ** given file. using the given SecurityContext.

        ! ** ! ** I know of no core class that calls this method.

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param filename the full name of the file to access ! ** @param securityContext the Security Context to ! ** determine access for. ! ** @exception SecurityException if the operation is not ! ** permitted. ! **/ ! public void checkRead(String filename, Object securityContext) { ! throw new SecurityException("Cannot read files via file names."); ! } ! /** Check if the current thread is allowed to write to the ! ** given file using the FileDescriptor.

        ! ** ! ** This method is called from ! ** FileOutputStream.FileOutputStream().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param desc the FileDescriptor representing the file ! ** to access ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.io.FileOutputStream#FileOutputStream(java.io.FileDescriptor) ! **/ ! public void checkWrite(FileDescriptor desc) { ! throw new SecurityException("Cannot write files via file descriptors."); ! } ! /** Check if the current thread is allowed to write to the ! ** given file.

        ! ** ! ** This method is called from ! ** FileOutputStream.FileOutputStream(), ! ** RandomAccessFile.RandomAccessFile(), ! ** File.canWrite(), mkdir(), and renameTo().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param filename the full name of the file to access ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.io.File#canWrite() ! ** @see java.io.File#mkdir() ! ** @see java.io.File#renameTo() ! ** @see java.io.FileOutputStream#FileOutputStream(java.lang.String) ! ** @see java.io.RandomAccessFile#RandomAccessFile(java.lang.String) ! **/ ! public void checkWrite(String filename) { ! throw new SecurityException("Cannot write files via file names."); ! } ! /** Check if the current thread is allowed to delete the ! ** given file.

        ! ** ! ** This method is called from File.delete().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param filename the full name of the file to delete ! ** @exception SecurityException if th operation is not ! ** permitted. ! ** @see java.io.File#delete() ! **/ ! public void checkDelete(String filename) { ! throw new SecurityException("Cannot delete files."); ! } ! /** Check if the current thread is allowed to connect to a ! ** given host on a given port.

        ! ** ! ** This method is called from Socket.Socket(). ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param host the host to connect to ! ** @param port the port to connect on ! ** @exception SecurityException if the operation is not ! ** permitted ! ** @see java.net.Socket#Socket() ! **/ ! public void checkConnect(String host, int port) { ! throw new SecurityException("Cannot make network connections."); ! } ! /** Check if the current thread is allowed to connect to a ! ** given host on a given port using a specific security ! ** context to determine access.

        ! ** ! ** This method is not called in the 1.1 core classes.

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param host the host to connect to ! ** @param port the port to connect on ! ** @param securityContext the security context to ! ** determine access with ! ** @exception SecurityException if the operation is not ! ** permitted ! **/ ! public void checkConnect(String host, int port, Object securityContext) { ! throw new SecurityException("Cannot make network connections."); ! } ! /** Check if the current thread is allowed to listen to a ! ** specific port for data.

        ! ** ! ** This method is called by ServerSocket.ServerSocket().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param port the port to listen on ! ** @exception SecurityException if the operation is not ! ** permitted ! ** @see java.net.ServerSocket#ServerSocket(int) ! **/ ! public void checkListen(int port) { ! throw new SecurityException("Cannot listen for connections."); ! } ! /** Check if the current thread is allowed to accept a ! ** connection from a particular host on a particular ! ** port.

        ! ** ! ** This method is called by ServerSocket.implAccept().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param host the host which wishes to connect ! ** @param port the port the connection will be on ! ** @exception SecurityException if the operation is not ! ** permitted ! ** @see java.net.ServerSocket#accept() ! **/ ! public void checkAccept(String host, int port) { ! throw new SecurityException("Cannot accept connections."); ! } ! /** Check if the current thread is allowed to read and ! ** write multicast to a particular address.

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @XXX where is it called? ! ** ! ** @param addr the address to multicast to. ! ** @exception SecurityException if the operation is not ! ** permitted. ! **/ ! public void checkMulticast(InetAddress addr) { ! throw new SecurityException("Cannot read or write multicast."); ! } ! /** Check if the current thread is allowed to read and ! ** write multicast to a particular address with a ! ** particular ttl value.

        ! ** ! ** SecurityManager's implementation always denies access.

        ! ** ! ** @XXX where is it called? ! ** ! ** @XXX what the hell is ttl? Expand abbreviation. ! ** ! ** @param addr the address to multicast to. ! ** @param ttl the ttl value to use ! ** @exception SecurityException if the operation is not ! ** permitted. ! **/ ! public void checkMulticast(InetAddress addr, byte ttl) { ! throw new SecurityException("Cannot read or write multicast."); ! } ! /** ! ** Check if the current thread is allowed to perform an ! ** operation that requires the specified Permission. ! ** ! ** @param perm The Permission required. ! ** @exception SecurityException If the operation is not allowed. ! **/ ! public void checkPermission(java.security.Permission perm) { ! throw new SecurityException("Operation not allowed"); ! } ! /** ! ** Check if the current thread is allowed to perform an ! ** operation that requires the specified Permission. ! ** ! ** @param perm The Permission required. ! ** @param context A security context ! ** @exception SecurityException If the operation is not allowed. ! ** @since 1.2 ! **/ ! public void checkPermission(java.security.Permission perm, ! Object context) { ! throw new SecurityException("Operation not allowed"); ! } ! /** Check if the current thread is allowed to read or ! ** write all the system properties at once.

        ! ** ! ** This method is called by System.getProperties() ! ** and setProperties().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.System#getProperties() ! ** @see java.lang.System#setProperties(java.util.Properties) ! **/ ! public void checkPropertiesAccess() { ! throw new SecurityException("Cannot access all system properties at once."); ! } ! /** Check if the current thread is allowed to read or ! ** write a particular system property.

        ! ** ! ** This method is called by System.getProperty() and ! ** setProperty().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @exception SecurityException is the operation is not ! ** permitted. ! ** @see java.lang.System#getProperty(java.lang.String) ! ** @see java.lang.System#setProperty(java.lang.String,java.lang.String) ! **/ ! public void checkPropertyAccess(String name) { ! throw new SecurityException("Cannot access individual system properties."); ! } ! /** Check if the current thread is allowed to create a ! ** top-level window. If it is not, the operation should ! ** still go through, but some sort of nonremovable ! ** warning should be placed on the window to show that it ! ** is untrusted.

        ! ** ! ** This method is called by Window.Window().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param window the window to create ! ** @see java.awt.Window#Window(java.awt.Frame) ! **/ ! public boolean checkTopLevelWindow(Object window) { ! return false; ! } ! /** Check if the current thread is allowed to create a ! ** print job.

        ! ** ! ** This method is called by Toolkit.getPrintJob(). (I ! ** assume so, at least, it just don't say nothing about ! ** it in the spec.)

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.awt.Toolkit.getPrintJob(java.awt.Frame,java.lang.String,java.util.Properties) ! **/ ! public void checkPrintJobAccess() { ! throw new SecurityException("Cannot create print jobs."); ! } ! /** Check if the current thread is allowed to use the ! ** system clipboard.

        ! ** ! ** This method is called by Toolkit.getSystemClipboard(). ! ** (I assume.)

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.awt.Toolkit#getSystemClipboard() ! **/ ! public void checkSystemClipboardAccess() { ! throw new SecurityException("Cannot access the system clipboard."); ! } ! /** Check if the current thread is allowed to use the AWT ! ** event queue.

        ! ** ! ** This method is called by Toolkit.getSystemEventQueue().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.awt.Toolkit#getSystemEventQueue() ! **/ ! public void checkAwtEventQueueAccess() { ! throw new SecurityException("Cannot access the AWT event queue."); ! } ! /** Check if the current thread is allowed to access the ! ** specified package at all.

        ! ** ! ** This method is called by ClassLoader.loadClass() in ! ** user-created ClassLoaders.

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param packageName the package name to check access to ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.ClassLoader#loadClass(java.lang.String,boolean) ! **/ ! public void checkPackageAccess(String packageName) { ! throw new SecurityException("Cannot access packages via the ClassLoader."); ! } ! /** Check if the current thread is allowed to define ! ** classes the specified package. If the class already ! ** created, though, ClassLoader.loadClass() can still ! ** return the Class if checkPackageAccess() checks out.

        ! ** ! ** This method is called by ClassLoader.loadClass() in ! ** user-created ClassLoaders.

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param packageName the package name to check access to ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.ClassLoader#loadClass(java.lang.String,boolean) ! **/ ! public void checkPackageDefinition(String packageName) { ! throw new SecurityException("Cannot load classes into any packages via the ClassLoader."); ! } ! /** Check if the current thread is allowed to set the ! ** current socket factory.

        ! ** ! ** This method is called by Socket.setSocketImplFactory(), ! ** ServerSocket.setSocketFactory(), and ! ** URL.setURLStreamHandlerFactory().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory) ! ** @see java.net.ServerSocket#setSocketFactory(java.net.SocketImplFactory) ! ** @see java.net.URL#setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory) ! **/ ! public void checkSetFactory() { ! throw new SecurityException("Cannot set the socket factory."); ! } ! /** Check if the current thread is allowed to get certain ! ** types of Methods, Fields and Constructors from a Class ! ** object.

        ! ** ! ** This method is called by Class.getMethod[s](), ! ** Class.getField[s](), Class.getConstructor[s], ! ** Class.getDeclaredMethod[s](), ! ** Class.getDeclaredField[s](), and ! ** Class.getDeclaredConstructor[s]().

        ! ** ! ** SecurityManager's implementation always denies access. ! ** ! ** @param c the Class to check ! ** @param memberType the type of members to check ! ** against, either Member.DECLARED or ! ** Member.PUBLIC. ! ** @exception SecurityException if the operation is not ! ** permitted. ! ** @see java.lang.Class ! ** @see java.lang.reflect.Member#DECLARED ! ** @see java.lang.reflect.Member#PUBLIC ! **/ ! public void checkMemberAccess(Class c, int memberType) { ! throw new SecurityException("Cannot access members of classes."); ! } ! /** Test whether a particular security action may be ! ** taken. ! ** @param action the desired action to take ! ** @exception SecurityException if the action is denied. ! ** @XXX I have no idea what actions must be tested ! ** or where. ! **/ ! public void checkSecurityAccess(String action) { ! checkPermission (new java.security.SecurityPermission (action)); ! } ! /** Get the ThreadGroup that a new Thread should belong ! ** to by default.

        ! ** ! ** Called by Thread.Thread().

        ! ** ! ** SecurityManager's implementation just uses the ! ** ThreadGroup of the current Thread.

        ! ** ! ** Spec Note: it is not clear whether ! ** the new Thread is guaranteed to pass the ! ** checkAccessThreadGroup() test when using this ! ** ThreadGroup. I presume so. ! ** ! ** @return the ThreadGroup to put the new Thread into. ! **/ ! public ThreadGroup getThreadGroup() { ! return Thread.currentThread().getThreadGroup(); ! } ! public SecurityManager () { ! if (System.getSecurityManager () != null) ! throw new SecurityException (); ! } ! } class SecurityContext { Class[] classes; SecurityContext(Class[] classes) { --- 38,1036 ---- package java.lang; ! import java.awt.AWTPermission; ! import java.io.File; ! import java.io.FileDescriptor; ! import java.io.FilePermission; ! import java.lang.reflect.Member; ! import java.net.InetAddress; ! import java.net.SocketPermission; ! import java.security.AllPermission; ! import java.security.Permission; ! import java.security.Security; ! import java.security.SecurityPermission; ! import java.util.PropertyPermission; /** ! * SecurityManager is a class you can extend to create your own Java ! * security policy. By default, there is no SecurityManager installed in ! * 1.1, which means that all things are permitted to all people. The security ! * manager, if set, is consulted before doing anything with potentially ! * dangerous results, and throws a SecurityException if the ! * action is forbidden. ! * ! *

        A typical check is as follows, just before the dangerous operation:
        ! *

        !  * SecurityManager sm = System.getSecurityManager();
        !  * if (sm != null)
        !  *   sm.checkABC(argument, ...);
        !  * 
        ! * Note that this is thread-safe, by caching the security manager in a local ! * variable rather than risking a NullPointerException if the mangager is ! * changed between the check for null and before the permission check. ! * ! *

        The special method checkPermission is a catchall, and ! * the default implementation calls ! * AccessController.checkPermission. In fact, all the other ! * methods default to calling checkPermission. ! * ! *

        Sometimes, the security check needs to happen from a different context, ! * such as when called from a worker thread. In such cases, use ! * getSecurityContext to take a snapshot that can be passed ! * to the worker thread:
        ! *

        !  * Object context = null;
        !  * SecurityManager sm = System.getSecurityManager();
        !  * if (sm != null)
        !  *   context = sm.getSecurityContext(); // defaults to an AccessControlContext
        !  * // now, in worker thread
        !  * if (sm != null)
        !  *   sm.checkPermission(permission, context);
        !  * 
        !  *
        !  * 

        Permissions fall into these categories: File, Socket, Net, Security, ! * Runtime, Property, AWT, Reflect, and Serializable. Each of these ! * permissions have a property naming convention, that follows a hierarchical ! * naming convention, to make it easy to grant or deny several permissions ! * at once. Some permissions also take a list of permitted actions, such ! * as "read" or "write", to fine-tune control even more. The permission ! * java.security.AllPermission grants all permissions. ! * ! *

        The default methods in this class deny all things to all people. You ! * must explicitly grant permission for anything you want to be legal when ! * subclassing this class. ! * ! * @author John Keiser ! * @author Eric Blake ! * @see ClassLoader ! * @see SecurityException ! * @see #checkTopLevelWindow(Object) ! * @see System#getSecurityManager() ! * @see System#setSecurityManager(SecurityManager) ! * @see AccessController ! * @see AccessControlContext ! * @see AccessControlException ! * @see Permission ! * @see BasicPermission ! * @see java.io.FilePermission ! * @see java.net.SocketPermission ! * @see java.util.PropertyPermission ! * @see RuntimePermission ! * @see java.awt.AWTPermission ! * @see Policy ! * @see SecurityPermission ! * @see ProtectionDomain ! * @since 1.0 ! * @status still missing 1.4 functionality ! */ ! public class SecurityManager ! { ! /** ! * Tells whether or not the SecurityManager is currently performing a ! * security check. ! * @deprecated Use {@link #checkPermission(Permission)} instead. ! */ ! protected boolean inCheck; ! /** ! * Construct a new security manager. There may be a security check, of ! * RuntimePermission("createSecurityManager"). ! * ! * @throws SecurityException if permission is denied ! */ ! public SecurityManager() ! { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! sm.checkPermission(new RuntimePermission("createSecurityManager")); ! } ! /** ! * Tells whether or not the SecurityManager is currently performing a ! * security check. ! * ! * @return true if the SecurityManager is in a security check ! * @see #inCheck ! * @deprecated use {@link #checkPermission(Permission)} instead ! */ ! public boolean getInCheck() ! { ! return inCheck; ! } ! /** ! * Get a list of all the classes currently executing methods on the Java ! * stack. getClassContext()[0] is the currently executing method (ie. the ! * class that CALLED getClassContext, not SecurityManager). ! * ! * @return an array of classes on the Java execution stack ! */ ! protected Class[] getClassContext() ! { ! return VMSecurityManager.getClassContext(); ! } ! /** ! * Find the ClassLoader of the first non-system class on the execution ! * stack. A non-system class is one whose ClassLoader is not equal to ! * {@link ClassLoader#getSystemClassLoader()} or its ancestors. This ! * will return null in three cases:
        ! *

      1. All methods on the stack are from system classes
      2. ! *
      3. All methods on the stack up to the first "privileged" caller, as ! * created by {@link AccessController.doPrivileged(PrivilegedAction)}, ! * are from system classes
      4. ! *
      5. A check of java.security.AllPermission succeeds.
      6. ! * ! * ! * @return the most recent non-system ClassLoader on the execution stack ! * @deprecated use {@link #checkPermission(Permission)} instead ! */ ! protected ClassLoader currentClassLoader() ! { ! return VMSecurityManager.currentClassLoader(); ! } ! /** ! * Find the first non-system class on the execution stack. A non-system ! * class is one whose ClassLoader is not equal to ! * {@link ClassLoader#getSystemClassLoader()} or its ancestors. This ! * will return null in three cases:
        ! *
      7. All methods on the stack are from system classes
      8. ! *
      9. All methods on the stack up to the first "privileged" caller, as ! * created by {@link AccessController.doPrivileged(PrivilegedAction)}, ! * are from system classes
      10. ! *
      11. A check of java.security.AllPermission succeeds.
      12. ! *
        ! * ! * @return the most recent non-system Class on the execution stack ! * @deprecated use {@link #checkPermission(Permission)} instead ! */ ! protected Class currentLoadedClass() ! { ! Class[] c = getClassContext(); ! for (int i = 0; i < c.length; i++) ! if (c[i].getClassLoader() != null) ! return c[i]; ! return null; ! } ! /** ! * Get the depth of a particular class on the execution stack. ! * ! * @param className the fully-qualified name to search for ! * @return the index of the class on the stack, or -1 ! * @deprecated use {@link #checkPermission(Permission)} instead ! */ ! protected int classDepth(String className) ! { ! Class[] c = getClassContext(); ! for (int i = 0; i < c.length; i++) ! if (className.equals(c[i].getName())) ! return i; ! return -1; ! } + /** + * Get the depth on the execution stack of the most recent non-system class. + * A non-system class is one whose ClassLoader is not equal to + * {@link ClassLoader#getSystemClassLoader()} or its ancestors. This + * will return -1 in three cases:
        + *
      13. All methods on the stack are from system classes
      14. + *
      15. All methods on the stack up to the first "privileged" caller, as + * created by {@link AccessController.doPrivileged(PrivilegedAction)}, + * are from system classes
      16. + *
      17. A check of java.security.AllPermission succeeds.
      18. + *
        + * + * @return the index of the most recent non-system Class on the stack + * @deprecated use {@link #checkPermission(Permission)} instead + */ + protected int classLoaderDepth() + { + Class[] c = getClassContext(); + for (int i = 0; i < c.length; i++) + if (c[i].getClassLoader() != null) + return i; + return -1; + } ! /** ! * Tell whether the specified class is on the execution stack. ! * ! * @param className the fully-qualified name of the class to find ! * @return whether the specified class is on the execution stack ! * @deprecated use {@link #checkPermission(Permission)} instead ! */ ! protected boolean inClass(String className) ! { ! return classDepth(className) != -1; ! } ! /** ! * Tell whether there is a class loaded with an explicit ClassLoader on ! * the stack. ! * ! * @return whether a class with an explicit ClassLoader is on the stack ! * @deprecated use {@link #checkPermission(Permission)} instead ! */ ! protected boolean inClassLoader() ! { ! return classLoaderDepth() != -1; ! } ! /** ! * Get an implementation-dependent Object that contains enough information ! * about the current environment to be able to perform standard security ! * checks later. This is used by trusted methods that need to verify that ! * their callers have sufficient access to perform certain operations. ! * ! *

        Currently the only methods that use this are checkRead() and ! * checkConnect(). The default implementation returns an ! * AccessControlContext. ! * ! * @return a security context ! * @see #checkConnect(String, int, Object) ! * @see #checkRead(String, Object) ! * @see AccessControlContext ! * @see AccessController#getContext() ! */ ! public Object getSecurityContext() ! { ! // XXX Should be: return AccessController.getContext(); ! return new SecurityContext(getClassContext()); ! } ! /** ! * Check if the current thread is allowed to perform an operation that ! * requires the specified Permission. This defaults to ! * AccessController.checkPermission. ! * ! * @param perm the Permission required ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if perm is null ! * @since 1.2 ! */ ! public void checkPermission(Permission perm) ! { ! // XXX Should be: AccessController.checkPermission(perm); ! throw new SecurityException("Operation not allowed"); ! } ! /** ! * Check if the current thread is allowed to perform an operation that ! * requires the specified Permission. This is done in a ! * context previously returned by getSecurityContext(). The ! * default implementation expects context to be an AccessControlContext, ! * and it calls AccessControlContext.checkPermission(perm). ! * ! * @param perm the Permission required ! * @param context a security context ! * @throws SecurityException if permission is denied, or if context is ! * not an AccessControlContext ! * @throws NullPointerException if perm is null ! * @see #getSecurityContext() ! * @see AccessControlContext#checkPermission(Permission) ! * @since 1.2 ! */ ! public void checkPermission(Permission perm, Object context) ! { ! // XXX Should be: ! // if (! (context instanceof AccessControlContext)) ! // throw new SecurityException("Missing context"); ! // ((AccessControlContext) context).checkPermission(perm); ! throw new SecurityException("Operation not allowed"); ! } ! /** ! * Check if the current thread is allowed to create a ClassLoader. This ! * method is called from ClassLoader.ClassLoader(), and checks ! * RuntimePermission("createClassLoader"). If you override ! * this, you should call super.checkCreateClassLoader() rather ! * than throwing an exception. ! * ! * @throws SecurityException if permission is denied ! * @see ClassLoader#ClassLoader() ! */ ! public void checkCreateClassLoader() ! { ! checkPermission(new RuntimePermission("createClassLoader")); ! } ! /** ! * Check if the current thread is allowed to modify another Thread. This is ! * called by Thread.stop(), suspend(), resume(), interrupt(), destroy(), ! * setPriority(), setName(), and setDaemon(). The default implementation ! * checks RuntimePermission("modifyThread") on system threads (ie. ! * threads in ThreadGroup with a null parent), and returns silently on ! * other threads. ! * ! *

        If you override this, you must do two things. First, call ! * super.checkAccess(t), to make sure you are not relaxing ! * requirements. Second, if the calling thread has ! * RuntimePermission("modifyThread"), return silently, so that ! * core classes (the Classpath library!) can modify any thread. ! * ! * @param t the other Thread to check ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if t is null ! * @see Thread#stop() ! * @see Thread#suspend() ! * @see Thread#resume() ! * @see Thread#setPriority(int) ! * @see Thread#setName(String) ! * @see Thread#setDaemon(boolean) ! */ ! public void checkAccess(Thread t) ! { ! if (t.group != null && t.group.getParent() != null) ! checkPermission(new RuntimePermission("modifyThread")); ! } ! /** ! * Check if the current thread is allowed to modify a ThreadGroup. This is ! * called by Thread.Thread() (to add a thread to the ThreadGroup), ! * ThreadGroup.ThreadGroup() (to add this ThreadGroup to a parent), ! * ThreadGroup.stop(), suspend(), resume(), interrupt(), destroy(), ! * setDaemon(), and setMaxPriority(). The default implementation ! * checks RuntimePermission("modifyThread") on the system group (ie. ! * the one with a null parent), and returns silently on other groups. ! * ! *

        If you override this, you must do two things. First, call ! * super.checkAccess(t), to make sure you are not relaxing ! * requirements. Second, if the calling thread has ! * RuntimePermission("modifyThreadGroup"), return silently, ! * so that core classes (the Classpath library!) can modify any thread. ! * ! * @param g the ThreadGroup to check ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if g is null ! * @see Thread#Thread() ! * @see ThreadGroup#ThreadGroup() ! * @see ThreadGroup#stop() ! * @see ThreadGroup#suspend() ! * @see ThreadGroup#resume() ! * @see ThreadGroup#interrupt() ! * @see ThreadGroup#setDaemon(boolean) ! * @see ThreadGroup#setMaxPriority(int) ! */ ! public void checkAccess(ThreadGroup g) ! { ! if (g.getParent() != null) ! checkPermission(new RuntimePermission("modifyThreadGroup")); ! } ! /** ! * Check if the current thread is allowed to exit the JVM with the given ! * status. This method is called from Runtime.exit() and Runtime.halt(). ! * The default implementation checks ! * RuntimePermission("exitVM"). If you override this, call ! * super.checkExit rather than throwing an exception. ! * ! * @param status the status to exit with ! * @throws SecurityException if permission is denied ! * @see Runtime#exit(int) ! * @see Runtime#halt(int) ! */ ! public void checkExit(int status) ! { ! checkPermission(new RuntimePermission("exitVM")); ! } ! /** ! * Check if the current thread is allowed to execute the given program. This ! * method is called from Runtime.exec(). If the name is an absolute path, ! * the default implementation checks ! * FilePermission(program, "execute"), otherwise it checks ! * FilePermission("<<ALL FILES>>", "execute"). If ! * you override this, call super.checkExec rather than ! * throwing an exception. ! * ! * @param program the name of the program to exec ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if program is null ! * @see Runtime#exec(String[], String[], File) ! */ ! public void checkExec(String program) ! { ! if (! program.equals(new File(program).getAbsolutePath())) ! program = "<>"; ! checkPermission(new FilePermission(program, "execute")); ! } ! /** ! * Check if the current thread is allowed to link in the given native ! * library. This method is called from Runtime.load() (and hence, by ! * loadLibrary() as well). The default implementation checks ! * RuntimePermission("loadLibrary." + filename). If you ! * override this, call super.checkLink rather than throwing ! * an exception. ! * ! * @param filename the full name of the library to load ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if filename is null ! * @see Runtime#load(String) ! */ ! public void checkLink(String filename) ! { ! // Use the toString() hack to do the null check. ! checkPermission(new RuntimePermission("loadLibrary." ! + filename.toString())); ! } ! /** ! * Check if the current thread is allowed to read the given file using the ! * FileDescriptor. This method is called from ! * FileInputStream.FileInputStream(). The default implementation checks ! * RuntimePermission("readFileDescriptor"). If you override ! * this, call super.checkRead rather than throwing an ! * exception. ! * ! * @param desc the FileDescriptor representing the file to access ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if desc is null ! * @see FileInputStream#FileInputStream(FileDescriptor) ! */ ! public void checkRead(FileDescriptor desc) ! { ! if (desc == null) ! throw new NullPointerException(); ! checkPermission(new RuntimePermission("readFileDescriptor")); ! } ! /** ! * Check if the current thread is allowed to read the given file. This ! * method is called from FileInputStream.FileInputStream(), ! * RandomAccessFile.RandomAccessFile(), File.exists(), canRead(), isFile(), ! * isDirectory(), lastModified(), length() and list(). The default ! * implementation checks FilePermission(filename, "read"). If ! * you override this, call super.checkRead rather than ! * throwing an exception. ! * ! * @param filename the full name of the file to access ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if filename is null ! * @see File ! * @see FileInputStream#FileInputStream(String) ! * @see RandomAccessFile#RandomAccessFile(String) ! */ ! public void checkRead(String filename) ! { ! checkPermission(new FilePermission(filename, "read")); ! } ! /** ! * Check if the current thread is allowed to read the given file. using the ! * given security context. The context must be a result of a previous call ! * to getSecurityContext(). The default implementation checks ! * AccessControlContext.checkPermission(new FilePermission(filename, ! * "read")). If you override this, call super.checkRead ! * rather than throwing an exception. ! * ! * @param filename the full name of the file to access ! * @param context the context to determine access for ! * @throws SecurityException if permission is denied, or if context is ! * not an AccessControlContext ! * @throws NullPointerException if filename is null ! * @see #getSecurityContext() ! * @see AccessControlContext#checkPermission(Permission) ! */ ! public void checkRead(String filename, Object context) ! { ! // XXX Should be: ! // if (! (context instanceof AccessControlContext)) ! // throw new SecurityException("Missing context"); ! // AccessControlContext ac = (AccessControlContext) context; ! // ac.checkPermission(new FilePermission(filename, "read")); ! throw new SecurityException("Cannot read files via file names."); ! } ! /** ! * Check if the current thread is allowed to write the given file using the ! * FileDescriptor. This method is called from ! * FileOutputStream.FileOutputStream(). The default implementation checks ! * RuntimePermission("writeFileDescriptor"). If you override ! * this, call super.checkWrite rather than throwing an ! * exception. ! * ! * @param desc the FileDescriptor representing the file to access ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if desc is null ! * @see FileOutputStream#FileOutputStream(FileDescriptor) ! */ ! public void checkWrite(FileDescriptor desc) ! { ! if (desc == null) ! throw new NullPointerException(); ! checkPermission(new RuntimePermission("writeFileDescriptor")); ! } ! /** ! * Check if the current thread is allowed to write the given file. This ! * method is called from FileOutputStream.FileOutputStream(), ! * RandomAccessFile.RandomAccessFile(), File.canWrite(), mkdir(), and ! * renameTo(). The default implementation checks ! * FilePermission(filename, "write"). If you override this, ! * call super.checkWrite rather than throwing an exception. ! * ! * @param filename the full name of the file to access ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if filename is null ! * @see File ! * @see File#canWrite() ! * @see File#mkdir() ! * @see File#renameTo() ! * @see FileOutputStream#FileOutputStream(String) ! * @see RandomAccessFile#RandomAccessFile(String) ! */ ! public void checkWrite(String filename) ! { ! checkPermission(new FilePermission(filename, "write")); ! } ! /** ! * Check if the current thread is allowed to delete the given file. This ! * method is called from File.delete(). The default implementation checks ! * FilePermission(filename, "delete"). If you override this, ! * call super.checkDelete rather than throwing an exception. ! * ! * @param filename the full name of the file to delete ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if filename is null ! * @see File#delete() ! */ ! public void checkDelete(String filename) ! { ! checkPermission(new FilePermission(filename, "delete")); ! } ! /** ! * Check if the current thread is allowed to connect to a given host on a ! * given port. This method is called from Socket.Socket(). A port number ! * of -1 indicates the caller is attempting to determine an IP address, so ! * the default implementation checks ! * SocketPermission(host, "resolve"). Otherwise, the default ! * implementation checks ! * SocketPermission(host + ":" + port, "connect"). If you ! * override this, call super.checkConnect rather than throwing ! * an exception. ! * ! * @param host the host to connect to ! * @param port the port to connect on ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if host is null ! * @see Socket#Socket() ! */ ! public void checkConnect(String host, int port) ! { ! if (port == -1) ! checkPermission(new SocketPermission(host, "resolve")); ! else ! // Use the toString() hack to do the null check. ! checkPermission(new SocketPermission(host.toString() + ":" + port, ! "connect")); ! } ! /** ! * Check if the current thread is allowed to connect to a given host on a ! * given port, using the given security context. The context must be a ! * result of a previous call to getSecurityContext. A port ! * number of -1 indicates the caller is attempting to determine an IP ! * address, so the default implementation checks ! * AccessControlContext.checkPermission(new SocketPermission(host, ! * "resolve")). Otherwise, the default implementation checks ! * AccessControlContext.checkPermission(new SocketPermission(host ! * + ":" + port, "connect")). If you override this, call ! * super.checkConnect rather than throwing an exception. ! * ! * @param host the host to connect to ! * @param port the port to connect on ! * @param context the context to determine access for ! * @throws SecurityException if permission is denied, or if context is ! * not an AccessControlContext ! * @throws NullPointerException if host is null ! * @see #getSecurityContext() ! * @see AccessControlContext#checkPermission(Permission) ! */ ! public void checkConnect(String host, int port, Object securityContext) ! { ! // XXX Should be: ! // if (! (context instanceof AccessControlContext)) ! // throw new SecurityException("Missing context"); ! // AccessControlContext ac = (AccessControlContext) context; ! // if (port == -1) ! // ac.checkPermission(new SocketPermission(host, "resolve")); ! // else ! // // Use the toString() hack to do the null check. ! // ac.checkPermission(new SocketPermission(host.toString + ":" +port, ! // "connect")); ! throw new SecurityException("Cannot make network connections."); ! } ! /** ! * Check if the current thread is allowed to listen to a specific port for ! * data. This method is called by ServerSocket.ServerSocket(). The default ! * implementation checks ! * SocketPermission("localhost:" + (port == 0 ? "1024-" : "" + port), ! * "listen"). If you override this, call ! * super.checkListen rather than throwing an exception. ! * ! * @param port the port to listen on ! * @throws SecurityException if permission is denied ! * @see ServerSocket#ServerSocket(int) ! */ ! public void checkListen(int port) ! { ! checkPermission(new SocketPermission("localhost:" ! + (port == 0 ? "1024-" : "" +port), ! "listen")); ! } ! /** ! * Check if the current thread is allowed to accept a connection from a ! * particular host on a particular port. This method is called by ! * ServerSocket.implAccept(). The default implementation checks ! * SocketPermission(host + ":" + port, "accept"). If you ! * override this, call super.checkAccept rather than throwing ! * an exception. ! * ! * @param host the host which wishes to connect ! * @param port the port the connection will be on ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if host is null ! * @see ServerSocket#accept() ! */ ! public void checkAccept(String host, int port) ! { ! // Use the toString() hack to do the null check. ! checkPermission(new SocketPermission(host.toString() + ":" + port, ! "accept")); ! } ! /** ! * Check if the current thread is allowed to read and write multicast to ! * a particular address. The default implementation checks ! * SocketPermission(addr.getHostAddress(), "accept,connect"). ! * If you override this, call super.checkMulticast rather than ! * throwing an exception. ! * ! * @param addr the address to multicast to ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if host is null ! * @since 1.1 ! */ ! public void checkMulticast(InetAddress addr) ! { ! checkPermission(new SocketPermission(addr.getHostAddress(), ! "accept,connect")); ! } ! /** ! *Check if the current thread is allowed to read and write multicast to ! * a particular address with a particular ttl (time-to-live) value. The ! * default implementation ignores ttl, and checks ! * SocketPermission(addr.getHostAddress(), "accept,connect"). ! * If you override this, call super.checkMulticast rather than ! * throwing an exception. ! * ! * @param addr the address to multicast to ! * @param ttl value in use for multicast send ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if host is null ! * @since 1.1 ! * @deprecated use {@link #checkPermission(Permission)} instead ! */ ! public void checkMulticast(InetAddress addr, byte ttl) ! { ! checkPermission(new SocketPermission(addr.getHostAddress(), ! "accept,connect")); ! } ! /** ! * Check if the current thread is allowed to read or write all the system ! * properties at once. This method is called by System.getProperties() ! * and setProperties(). The default implementation checks ! * PropertyPermission("*", "read,write"). If you override ! * this, call super.checkPropertiesAccess rather than ! * throwing an exception. ! * ! * @throws SecurityException if permission is denied ! * @see System#getProperties() ! * @see System#setProperties(Properties) ! */ ! public void checkPropertiesAccess() ! { ! checkPermission(new PropertyPermission("*", "read,write")); ! } ! /** ! * Check if the current thread is allowed to read a particular system ! * property (writes are checked directly via checkPermission). This method ! * is called by System.getProperty() and setProperty(). The default ! * implementation checks PropertyPermission(key, "read"). If ! * you override this, call super.checkPropertyAccess rather ! * than throwing an exception. ! * ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if key is null ! * @throws IllegalArgumentException if key is "" ! * @see System#getProperty(String) ! */ ! public void checkPropertyAccess(String key) ! { ! checkPermission(new PropertyPermission(key, "read")); ! } ! /** ! * Check if the current thread is allowed to create a top-level window. If ! * it is not, the operation should still go through, but some sort of ! * nonremovable warning should be placed on the window to show that it ! * is untrusted. This method is called by Window.Window(). The default ! * implementation checks ! * AWTPermission("showWindowWithoutWarningBanner"), and returns ! * true if no exception was thrown. If you override this, use ! * return super.checkTopLevelWindow rather than returning ! * false. ! * ! * @param window the window to create ! * @return true if there is permission to show the window without warning ! * @throws NullPointerException if window is null ! * @see Window#Window(Frame) ! */ ! public boolean checkTopLevelWindow(Object window) ! { ! if (window == null) ! throw new NullPointerException(); ! try ! { ! checkPermission(new AWTPermission("showWindowWithoutWarningBanner")); ! return true; ! } ! catch (SecurityException e) ! { ! return false; ! } ! } ! /** ! * Check if the current thread is allowed to create a print job. This ! * method is called by Toolkit.getPrintJob(). The default implementation ! * checks RuntimePermission("queuePrintJob"). If you override ! * this, call super.checkPrintJobAccess rather than throwing ! * an exception. ! * ! * @throws SecurityException if permission is denied ! * @see Toolkit#getPrintJob(Frame, String, Properties) ! * @since 1.1 ! */ ! public void checkPrintJobAccess() ! { ! checkPermission(new RuntimePermission("queuePrintJob")); ! } ! /** ! * Check if the current thread is allowed to use the system clipboard. This ! * method is called by Toolkit.getSystemClipboard(). The default ! * implementation checks AWTPermission("accessClipboard"). If ! * you override this, call super.checkSystemClipboardAccess ! * rather than throwing an exception. ! * ! * @throws SecurityException if permission is denied ! * @see Toolkit#getSystemClipboard() ! * @since 1.1 ! */ ! public void checkSystemClipboardAccess() ! { ! checkPermission(new AWTPermission("accessClipboard")); ! } ! /** ! * Check if the current thread is allowed to use the AWT event queue. This ! * method is called by Toolkit.getSystemEventQueue(). The default ! * implementation checks AWTPermission("accessEventQueue"). ! * you override this, call super.checkAwtEventQueueAccess ! * rather than throwing an exception. ! * ! * @throws SecurityException if permission is denied ! * @see Toolkit#getSystemEventQueue() ! * @since 1.1 ! */ ! public void checkAwtEventQueueAccess() ! { ! // Should be: checkPermission(new AWTPermission("accessEventQueue")); ! throw new SecurityException("Cannot access the AWT event queue."); ! } ! /** ! * Check if the current thread is allowed to access the specified package ! * at all. This method is called by ClassLoader.loadClass() in user-created ! * ClassLoaders. The default implementation gets a list of all restricted ! * packages, via Security.getProperty("package.access"). Then, ! * if packageName starts with or equals any restricted package, it checks ! * RuntimePermission("accessClassInPackage." + packageName). ! * If you override this, you should call ! * super.checkPackageAccess before doing anything else. ! * ! * @param packageName the package name to check access to ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if packageName is null ! * @see ClassLoader#loadClass(String, boolean) ! * @see Security#getProperty(String) ! */ ! public void checkPackageAccess(String packageName) ! { ! checkPackageList(packageName, "access", "accessClassInPackage."); ! } ! /** ! * Check if the current thread is allowed to define a class into the ! * specified package. This method is called by ClassLoader.loadClass() in ! * user-created ClassLoaders. The default implementation gets a list of all ! * restricted packages, via ! * Security.getProperty("package.definition"). Then, if ! * packageName starts with or equals any restricted package, it checks ! * RuntimePermission("defineClassInPackage." + packageName). ! * If you override this, you should call ! * super.checkPackageDefinition before doing anything else. ! * ! * @param packageName the package name to check access to ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if packageName is null ! * @see ClassLoader#loadClass(String, boolean) ! * @see Security#getProperty(String) ! */ ! public void checkPackageDefinition(String packageName) ! { ! checkPackageList(packageName, "definition", "defineClassInPackage."); ! } ! /** ! * Check if the current thread is allowed to set the current socket factory. ! * This method is called by Socket.setSocketImplFactory(), ! * ServerSocket.setSocketFactory(), and URL.setURLStreamHandlerFactory(). ! * The default implementation checks ! * RuntimePermission("setFactory"). If you override this, call ! * super.checkSetFactory rather than throwing an exception. ! * ! * @throws SecurityException if permission is denied ! * @see Socket#setSocketImplFactory(SocketImplFactory) ! * @see ServerSocket#setSocketFactory(SocketImplFactory) ! * @see URL#setURLStreamHandlerFactory(URLStreamHandlerFactory) ! */ ! public void checkSetFactory() ! { ! checkPermission(new RuntimePermission("setFactory")); ! } ! /** ! * Check if the current thread is allowed to get certain types of Methods, ! * Fields and Constructors from a Class object. This method is called by ! * Class.getMethod[s](), Class.getField[s](), Class.getConstructor[s], ! * Class.getDeclaredMethod[s](), Class.getDeclaredField[s](), and ! * Class.getDeclaredConstructor[s](). The default implementation allows ! * PUBLIC access, and access to classes defined by the same classloader as ! * the code performing the reflection. Otherwise, it checks ! * RuntimePermission("accessDeclaredMembers"). If you override ! * this, do not call super.checkMemberAccess, as this would ! * mess up the stack depth check that determines the ClassLoader requesting ! * the access. ! * ! * @param c the Class to check ! * @param memberType either DECLARED or PUBLIC ! * @throws SecurityException if permission is denied, including when ! * memberType is not DECLARED or PUBLIC ! * @throws NullPointerException if c is null ! * @see Class ! * @see Member#DECLARED ! * @see Member#PUBLIC ! * @since 1.1 ! */ ! public void checkMemberAccess(Class c, int memberType) ! { ! if (c == null) ! throw new NullPointerException(); ! if (memberType == Member.PUBLIC) ! return; ! // XXX Allow access to classes created by same classloader before next ! // check. ! checkPermission(new RuntimePermission("accessDeclaredMembers")); ! } ! /** ! * Test whether a particular security action may be taken. The default ! * implementation checks SecurityPermission(action). If you ! * override this, call super.checkSecurityAccess rather than ! * throwing an exception. ! * ! * @param action the desired action to take ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if action is null ! * @throws IllegalArgumentException if action is "" ! * @since 1.1 ! */ ! public void checkSecurityAccess(String action) ! { ! checkPermission(new SecurityPermission(action)); ! } ! /** ! * Get the ThreadGroup that a new Thread should belong to by default. Called ! * by Thread.Thread(). The default implementation returns the current ! * ThreadGroup of the current Thread. Spec Note: it is not ! * clear whether the new Thread is guaranteed to pass the ! * checkAccessThreadGroup() test when using this ThreadGroup, but I presume ! * so. ! * ! * @return the ThreadGroup to put the new Thread into ! * @since 1.1 ! */ ! public ThreadGroup getThreadGroup() ! { ! return Thread.currentThread().getThreadGroup(); ! } ! /** ! * Helper that checks a comma-separated list of restricted packages, from ! * Security.getProperty("package.definition"), for the given ! * package access permission. If packageName starts with or equals any ! * restricted package, it checks ! * RuntimePermission(permission + packageName). ! * ! * @param packageName the package name to check access to ! * @param restriction the list of restrictions, after "package." ! * @param permission the base permission, including the '.' ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if packageName is null ! * @see #checkPackageAccess(String) ! * @see #checkPackageDefinition(String) ! */ ! void checkPackageList(String packageName, String restriction, ! String permission) ! { ! // Use the toString() hack to do the null check. ! Permission p = new RuntimePermission(permission + packageName.toString()); ! String list = Security.getProperty("package." + restriction); ! if (list == null) ! return; ! while (! "".equals(packageName)) ! { ! for (int index = list.indexOf(packageName); ! index != -1; index = list.indexOf(packageName, index + 1)) ! { ! int packageNameCount = packageName.length(); ! if (index + packageNameCount == list.length() ! || list.charAt(index + packageNameCount) == ',') ! { ! checkPermission(p); ! return; ! } ! } ! int index = packageName.lastIndexOf('.'); ! packageName = index < 0 ? "" : packageName.substring(0, index); ! } ! } ! } // class SecurityManager + // XXX This class is unnecessary. class SecurityContext { Class[] classes; SecurityContext(Class[] classes) { diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Short.java gcc-3.3/libjava/java/lang/Short.java *** gcc-3.2.3/libjava/java/lang/Short.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/Short.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.Short ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Short.java -- object wrapper for short ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 47,81 **** * * @author Paul Fisher * @author John Keiser ! * @since JDK 1.0 */ public final class Short extends Number implements Comparable { ! static final long serialVersionUID = 7515723908773894738L; /** ! * The minimum value a short can represent is -32768. */ public static final short MIN_VALUE = -32768; /** ! * The minimum value a short can represent is 32767. */ ! public static final short MAX_VALUE = 32767; /** ! * The primitive type short is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('S'); /** * The immutable value of this Short. */ private final short value; /** ! * Create a Short object representing the value of the * short argument. * * @param value the value to use --- 47,90 ---- * * @author Paul Fisher * @author John Keiser ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 */ public final class Short extends Number implements Comparable { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 7515723908773894738L; /** ! * The minimum value a short can represent is -32768 (or ! * -215short can represent is 32767 (or ! * 215short is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('S'); /** * The immutable value of this Short. + * + * @serial the wrapped short */ private final short value; /** ! * Create a Short object representing the value of the * short argument. * * @param value the value to use *************** public final class Short extends Number *** 86,314 **** } /** ! * Create a Short object representing the value of the * argument after conversion to a short. * ! * @param s the string to convert. */ ! public Short(String s) throws NumberFormatException { value = parseShort(s, 10); } /** ! * Return a hashcode representing this Object. ! * ! * Short's hash code is calculated by simply returning its ! * value. * ! * @return this Object's hash code. */ ! public int hashCode() { ! return value; } /** ! * If the Object is not null, is an ! * instanceof Short, and represents ! * the same primitive short value return ! * true. Otherwise false is returned. */ ! public boolean equals(Object obj) ! { ! return obj instanceof Short && ((Short)obj).value == value; ! } ! ! /** ! * Converts the short to a String and assumes ! * a radix of 10. ! * @param i the short to convert to String ! * @return the String representation of the argument. ! */ ! public static String toString(short i) ! { ! return Integer.toString((int) i); ! } ! ! /** ! * Converts the Short value to a String and ! * assumes a radix of 10. ! * @return the String representation of this Short. ! */ ! public String toString() { ! return Integer.toString ((int) value); } /** ! * Creates a new Short object using the String, ! * assuming a radix of 10. ! * @param s the String to convert. ! * @return the new Short. ! * @see #Short(java.lang.String) ! * @see #parseShort(java.lang.String) ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a short. */ ! public static Short valueOf(String s) throws NumberFormatException { ! return new Short(parseShort(s)); } /** * Creates a new Short object using the String * and specified radix (base). - * @param s the String to convert. - * @param radix the radix (base) to convert with. - * @return the new Short. - * @see #parseShort(java.lang.String,int) - * @exception NumberFormatException thrown if the String - * cannot be parsed as a short. - */ - public static Short valueOf(String s, int radix) - throws NumberFormatException - { - return new Short(parseShort(s, radix)); - } - - /** - * Converts the specified String into a short. - * This function assumes a radix of 10. * * @param s the String to convert ! * @return the short value of the String ! * argument. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a short. */ ! public static short parseShort(String s) throws NumberFormatException { ! return parseShort(s, 10); } /** ! * Converts the specified String into a short ! * using the specified radix (base). * * @param s the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to short. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a short. */ ! public static short parseShort(String s, int radix) ! throws NumberFormatException { ! int i = Integer.parseInt(s, radix); ! if (i < MIN_VALUE || i > MAX_VALUE) ! throw new NumberFormatException(); ! return (short) i; } /** * Convert the specified String into a Short. ! * The String may represent decimal, hexadecimal, or * octal numbers. * ! * The String argument is interpreted based on the leading ! * characters. Depending on what the String begins with, the base will be ! * interpreted differently: ! * ! * ! * ! * ! * ! * ! * ! * ! *
        Leading
        Characters
        Base
        #16
        0x16
        0X16
        08
        Anything
        Else
        10
        * ! * @param s the String to interpret. ! * @return the value of the String as a Short. ! * @exception NumberFormatException thrown if the String ! * cannot be parsed as a short. */ ! public static Short decode(String s) throws NumberFormatException { ! int i = (Integer.decode(s)).intValue(); ! if (i < MIN_VALUE || i > MAX_VALUE) throw new NumberFormatException(); return new Short((short) i); } ! /** Return the value of this Short as an short. ! ** @return the value of this Short as an short. ! **/ public byte byteValue() { return (byte) value; } ! /** Return the value of this Short as an short. ! ** @return the value of this Short as an short. ! **/ public short shortValue() { return value; } ! /** Return the value of this Short as an int. ! ** @return the value of this Short as an int. ! **/ public int intValue() { return value; } ! /** Return the value of this Short as a long. ! ** @return the value of this Short as a long. ! **/ public long longValue() { return value; } ! /** Return the value of this Short as a float. ! ** @return the value of this Short as a float. ! **/ public float floatValue() { return value; } ! /** Return the value of this Short as a double. ! ** @return the value of this Short as a double. ! **/ public double doubleValue() { return value; } /** ! * Compare two Shorts numerically by comparing their ! * short values. ! * @return a positive value if this Short is greater ! * in value than the argument Short; a negative value ! * if this Short is smaller in value than the argument ! * Short; and 0, zero, if this ! * Short is equal in value to the argument ! * Short. * * @since 1.2 */ public int compareTo(Short s) { return value - s.value; } ! /** ! * Behaves like compareTo(java.lang.Short) unless the Object ! * is not a Short. Then it throws a ! * ClassCastException. ! * @exception ClassCastException if the argument is not a ! * Short. * * @since 1.2 */ public int compareTo(Object o) --- 95,349 ---- } /** ! * Create a Short object representing the value of the * argument after conversion to a short. * ! * @param s the string to convert ! * @throws NumberFormatException if the String cannot be parsed */ ! public Short(String s) { value = parseShort(s, 10); } /** ! * Converts the short to a String and assumes ! * a radix of 10. * ! * @param s the short to convert to String ! * @return the String representation of the argument */ ! public static String toString(short s) { ! return String.valueOf(s); } /** ! * Converts the specified String into a short. ! * This function assumes a radix of 10. ! * ! * @param s the String to convert ! * @return the short value of s ! * @throws NumberFormatException if s cannot be parsed as a ! * short */ ! public static short parseShort(String s) { ! return parseShort(s, 10); } /** ! * Converts the specified String into a short ! * using the specified radix (base). The string must not be null ! * or empty. It may begin with an optional '-', which will negate the answer, ! * provided that there are also valid digits. Each digit is parsed as if by ! * Character.digit(d, radix), and must be in the range ! * 0 to radix - 1. Finally, the result must be ! * within MIN_VALUE to MAX_VALUE, inclusive. ! * Unlike Double.parseDouble, you may not have a leading '+'. ! * ! * @param s the String to convert ! * @param radix the radix (base) to use in the conversion ! * @return the String argument converted to short ! * @throws NumberFormatException if s cannot be parsed as a ! * short */ ! public static short parseShort(String s, int radix) { ! int i = Integer.parseInt(s, radix, false); ! if ((short) i != i) ! throw new NumberFormatException(); ! return (short) i; } /** * Creates a new Short object using the String * and specified radix (base). * * @param s the String to convert ! * @param radix the radix (base) to convert with ! * @return the new Short ! * @throws NumberFormatException if s cannot be parsed as a ! * short ! * @see #parseShort(String, int) */ ! public static Short valueOf(String s, int radix) { ! return new Short(parseShort(s, radix)); } /** ! * Creates a new Short object using the String, ! * assuming a radix of 10. * * @param s the String to convert ! * @return the new Short ! * @throws NumberFormatException if s cannot be parsed as a ! * short ! * @see #Short(String) ! * @see #parseShort(String) */ ! public static Short valueOf(String s) { ! return new Short(parseShort(s, 10)); } /** * Convert the specified String into a Short. ! * The String may represent decimal, hexadecimal, or * octal numbers. * ! *

        The extended BNF grammar is as follows:
        ! *

        !    * DecodableString:
        !    *      ( [ - ] DecimalNumber )
        !    *    | ( [ - ] ( 0x | 0X
        !    *              | # ) HexDigit { HexDigit } )
        !    *    | ( [ - ] 0 { OctalDigit } )
        !    * DecimalNumber:
        !    *        DecimalDigit except '0' { DecimalDigit }
        !    * DecimalDigit:
        !    *        Character.digit(d, 10) has value 0 to 9
        !    * OctalDigit:
        !    *        Character.digit(d, 8) has value 0 to 7
        !    * DecimalDigit:
        !    *        Character.digit(d, 16) has value 0 to 15
        !    * 
        ! * Finally, the value must be in the range MIN_VALUE to ! * MAX_VALUE, or an exception is thrown. * ! * @param s the String to interpret ! * @return the value of the String as a Short ! * @throws NumberFormatException if s cannot be parsed as a ! * short ! * @throws NullPointerException if s is null ! * @see Integer#decode(String) */ ! public static Short decode(String s) { ! int i = Integer.parseInt(s, 10, true); ! if ((short) i != i) throw new NumberFormatException(); return new Short((short) i); } ! /** ! * Return the value of this Short as a byte. ! * ! * @return the byte value ! */ public byte byteValue() { return (byte) value; } ! /** ! * Return the value of this Short. ! * ! * @return the short value ! */ public short shortValue() { return value; } ! /** ! * Return the value of this Short as an int. ! * ! * @return the int value ! */ public int intValue() { return value; } ! /** ! * Return the value of this Short as a long. ! * ! * @return the long value ! */ public long longValue() { return value; } ! /** ! * Return the value of this Short as a float. ! * ! * @return the float value ! */ public float floatValue() { return value; } ! /** ! * Return the value of this Short as a double. ! * ! * @return the double value ! */ public double doubleValue() { return value; } /** ! * Converts the Short value to a String and ! * assumes a radix of 10. ! * ! * @return the String representation of this Short ! */ ! public String toString() ! { ! return String.valueOf(value); ! } ! ! /** ! * Return a hashcode representing this Object. Short's hash ! * code is simply its value. * + * @return this Object's hash code + */ + public int hashCode() + { + return value; + } + + /** + * Returns true if obj is an instance of + * Short and represents the same short value. + * + * @param obj the object to compare + * @return whether these Objects are semantically equal + */ + public boolean equals(Object obj) + { + return obj instanceof Short && value == ((Short) obj).value; + } + + /** + * Compare two Shorts numerically by comparing their short + * values. The result is positive if the first is greater, negative if the + * second is greater, and 0 if the two are equal. + * + * @param s the Short to compare + * @return the comparison * @since 1.2 */ public int compareTo(Short s) { return value - s.value; } ! /** ! * Behaves like compareTo(Short) unless the Object ! * is not a Short. * + * @param o the object to compare + * @return the comparison + * @throws ClassCastException if the argument is not a Short + * @see #compareTo(Short) + * @see Comparable * @since 1.2 */ public int compareTo(Object o) diff -Nrc3pad gcc-3.2.3/libjava/java/lang/StackOverflowError.java gcc-3.3/libjava/java/lang/StackOverflowError.java *** gcc-3.2.3/libjava/java/lang/StackOverflowError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/StackOverflowError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* StackOverflowError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* StackOverflowError.java -- thrown when the stack depth is exceeded ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,76 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * A StackOverflowError is thrown when a stack overflow occurs. ! * This can occur because an application recurses too deeply. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class StackOverflowError extends VirtualMachineError { ! static final long serialVersionUID = 8609175038441759607L; /** * Create an error without a message. */ public StackOverflowError() ! { ! super(); ! } /** * Create an error with a message. */ public StackOverflowError(String s) ! { ! super(s); ! } } --- 38,72 ---- package java.lang; /** ! * A StackOverflowError is thrown when the execution stack ! * overflow occurs. This often occurs when a method enters infinit recursion. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class StackOverflowError extends VirtualMachineError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 8609175038441759607L; /** * Create an error without a message. */ public StackOverflowError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public StackOverflowError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/StackTraceElement.java gcc-3.3/libjava/java/lang/StackTraceElement.java *** gcc-3.2.3/libjava/java/lang/StackTraceElement.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/StackTraceElement.java 2002-07-12 12:52:44.000000000 +0000 *************** *** 0 **** --- 1,259 ---- + /* StackTraceElement.java -- One function call or call stack element + Copyright (C) 2001, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.lang; + + import java.io.Serializable; + + /** + * One function call or stack trace element. Gives information about + * the execution point such as the source file name, the line number, + * the fully qualified class name, the method name and whether this method + * is native, if this information is known. + * + * @author Mark Wielaard + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public class StackTraceElement implements Serializable + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 6992337162326171013L; + + /** + * The name of the file, null if unknown. + * + * @serial the source code filename, if known + */ + private final String fileName; + + /** + * The line number in the file, negative if unknown. + * + * @serial the source code line number, if known + */ + private final int lineNumber; + + /** + * The fully qualified class name, null if unknown. + * + * @serial the enclosing class, if known + */ + private final String className; + + /** + * The method name in the class, null if unknown. + * + * @serial the enclosing method, if known + */ + private final String methodName; + + /** Whether the method is native. */ + private final transient boolean isNative; + + /** + * A package local constructor for the StackTraceElement class, to be + * called by the Virtual Machine as part of Throwable.fillInStackTrace. + * There are no public constructors defined for this class. Creation + * of new elements is implementation specific. + * + * @param fileName the name of the file, null if unknown + * @param lineNumber the line in the file, negative if unknown + * @param className the fully qualified name of the class, null if unknown + * @param methodName the name of the method, null if unknown + * @param isNative true if native, false otherwise + */ + StackTraceElement(String fileName, int lineNumber, String className, + String methodName, boolean isNative) + { + this.fileName = fileName; + this.lineNumber = lineNumber; + this.className = className; + this.methodName = methodName; + this.isNative = isNative; + } + + /** + * Returns the name of the file, or null if unknown. This is usually + * obtained from the SourceFile attribute of the class file + * format, if present. + * + * @return the file name + */ + public String getFileName() + { + return fileName; + } + + /** + * Returns the line number in the file, or a negative number if unknown. + * This is usually obtained from the LineNumberTable attribute + * of the method in the class file format, if present. + * + * @return the line number + */ + public int getLineNumber() + { + return lineNumber; + } + + /** + * Returns the fully qualified class name, or null if unknown. + * + * @return the class name + */ + public String getClassName() + { + return className; + } + + /** + * Returns the method name in the class, or null if unknown. If the + * execution point is in a constructor, the name is + * <init>; if the execution point is in the class + * initializer, the name is <clinit>. + * + * @return the method name + */ + public String getMethodName() + { + return methodName; + } + + /** + * Returns true if the method is native, or false if it is not or unknown. + * + * @return whether the method is native + */ + public boolean isNativeMethod() + { + return isNative; + } + + /** + * Returns a string representation of this stack trace element. The + * returned String is implementation specific. This implementation + * returns the following String: "[class][.][method]([file][:line])". + * If the fully qualified class name or the method is unknown it is + * omitted including the point seperator. If the source file name is + * unknown it is replaced by "Unknown Source" if the method is not native + * or by "Native Method" if the method is native. If the line number + * is unknown it and the colon are omitted. + * + * @return a string representation of this execution point + */ + public String toString() + { + StringBuffer sb = new StringBuffer(); + if (className != null) + { + sb.append(className); + if (methodName != null) + sb.append('.'); + } + if (methodName != null) + sb.append(methodName); + sb.append(" ("); + if (fileName != null) + sb.append(fileName); + else + sb.append(isNative ? "Native Method" : "Unknown Source"); + if (lineNumber >= 0) + sb.append(':').append(lineNumber); + sb.append(')'); + return sb.toString(); + } + + /** + * Returns true if the given object is also a StackTraceElement and all + * attributes, except the native flag, are equal (either the same attribute + * between the two elments are null, or both satisfy Object.equals). + * + * @param o the object to compare + * @return true if the two are equal + */ + public boolean equals(Object o) + { + if (! (o instanceof StackTraceElement)) + return false; + StackTraceElement e = (StackTraceElement) o; + return equals(fileName, e.fileName) + && lineNumber == e.lineNumber + && equals(className, e.className) + && equals(methodName, e.methodName); + } + + /** + * Returns the hashCode of this StackTraceElement. This implementation + * computes the hashcode by xor-ing the hashcode of all attributes except + * the native flag. + * + * @return the hashcode + */ + public int hashCode() + { + return hashCode(fileName) ^ lineNumber ^ hashCode(className) + ^ hashCode(methodName); + } + + /** + * Compare two objects according to Collection semantics. + * + * @param o1 the first object + * @param o2 the second object + * @return o1 == null ? o2 == null : o1.equals(o2) + */ + private static final boolean equals(Object o1, Object o2) + { + return o1 == null ? o2 == null : o1.equals(o2); + } + + /** + * Hash an object according to Collection semantics. + * + * @param o the object to hash + * @return o1 == null ? 0 : o1.hashCode() + */ + private static final int hashCode(Object o) + { + return o == null ? 0 : o.hashCode(); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/StringBuffer.java gcc-3.3/libjava/java/lang/StringBuffer.java *** gcc-3.2.3/libjava/java/lang/StringBuffer.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/StringBuffer.java 2002-12-30 07:17:20.000000000 +0000 *************** public final class StringBuffer implemen *** 308,333 **** } } ! /** Get the specified array of characters. ! * The characters will be copied into the array you pass in. ! * @param srcOffset the index to start copying from in the ! * StringBuffer. ! * @param srcEnd the number of characters to copy. ! * @param dst the array to copy into. ! * @param dstOffset the index to start copying into dst. ! * @exception NullPointerException if dst is null. ! * @exception IndexOutOfBoundsException if any source or target ! * indices are out of range. ! * @see java.lang.System#arraycopy(java.lang.Object,int,java.lang.Object,int,int) */ ! public synchronized void getChars (int srcOffset, int srcEnd, ! char[] dst, int dstOffset) { - if (srcOffset < 0 || srcOffset > srcEnd) - throw new StringIndexOutOfBoundsException (srcOffset); int todo = srcEnd - srcOffset; ! if (srcEnd > count || dstOffset + todo > count) ! throw new StringIndexOutOfBoundsException (srcEnd); System.arraycopy(value, srcOffset, dst, dstOffset, todo); } --- 308,334 ---- } } ! /** ! * Get the specified array of characters. srcOffset - srcEnd ! * characters will be copied into the array you pass in. ! * ! * @param srcOffset the index to start copying from (inclusive) ! * @param srcEnd the index to stop copying from (exclusive) ! * @param dst the array to copy into ! * @param dstOffset the index to start copying into ! * @throws NullPointerException if dst is null ! * @throws IndexOutOfBoundsException if any source or target indices are ! * out of range (while unspecified, source problems cause a ! * StringIndexOutOfBoundsException, and dest problems cause an ! * ArrayIndexOutOfBoundsException) ! * @see System#arraycopy(Object, int, Object, int, int) */ ! public synchronized void getChars(int srcOffset, int srcEnd, ! char[] dst, int dstOffset) { int todo = srcEnd - srcOffset; ! if (srcOffset < 0 || srcEnd > count || todo < 0) ! throw new StringIndexOutOfBoundsException(); System.arraycopy(value, srcOffset, dst, dstOffset, todo); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/StringIndexOutOfBoundsException.java gcc-3.3/libjava/java/lang/StringIndexOutOfBoundsException.java *** gcc-3.2.3/libjava/java/lang/StringIndexOutOfBoundsException.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/StringIndexOutOfBoundsException.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,6 **** ! /* StringIndexOutOfBoundsException.java -- exception thrown to indicate ! an attempt to access an index which is out of bounds. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* StringIndexOutOfBoundsException.java -- thrown to indicate attempt to ! exceed string bounds ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,90 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * Exceptions may be thrown by one part of a Java program and caught ! * by another in order to deal with exceptional conditions. ! * This exception can be thrown to indicate an attempt to access an ! * index which is out of bounds. ! * Any negative integer less than or equal to -1 and positive ! * integer greater than or equal to the size of the string is an index * which would be out of bounds. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy ! * @date September 18, 1998. */ public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException { ! static final long serialVersionUID = -6762910422159637258L; /** * Create an exception without a message. */ public StringIndexOutOfBoundsException() ! { ! super(); ! } /** * Create an exception with a message. */ public StringIndexOutOfBoundsException(String s) ! { ! super(s); ! } /** * Create an exception noting the illegal index. */ public StringIndexOutOfBoundsException(int index) ! { ! super("String index out of range: " + index); ! } } --- 39,85 ---- package java.lang; /** ! * This exception can be thrown to indicate an attempt to access an index ! * which is out of bounds of a String. Any negative integer, and a positive ! * integer greater than or equal to the size of the string, is an index * which would be out of bounds. * * @author Brian Jones * @author Warren Levy ! * @status updated to 1.4 */ public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -6762910422159637258L; /** * Create an exception without a message. */ public StringIndexOutOfBoundsException() ! { ! } /** * Create an exception with a message. + * + * @param s the message */ public StringIndexOutOfBoundsException(String s) ! { ! super(s); ! } /** * Create an exception noting the illegal index. + * + * @param index the invalid index */ public StringIndexOutOfBoundsException(int index) ! { ! super("String index out of range: " + index); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/String.java gcc-3.3/libjava/java/lang/String.java *** gcc-3.2.3/libjava/java/lang/String.java 2001-12-11 18:01:40.000000000 +0000 --- gcc-3.3/libjava/java/lang/String.java 2002-06-13 18:16:26.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. *************** public final class String implements Ser *** 112,117 **** --- 112,123 ---- init(data, offset, count, false); } + // This is used by Integer.toString(int,int). + String (char[] data, int offset, int count, boolean dont_copy) + { + init(data, offset, count, dont_copy); + } + public String (byte[] byteArray) { this (byteArray, 0, byteArray.length); diff -Nrc3pad gcc-3.2.3/libjava/java/lang/System.java gcc-3.3/libjava/java/lang/System.java *** gcc-3.2.3/libjava/java/lang/System.java 2001-09-02 06:18:48.000000000 +0000 --- gcc-3.3/libjava/java/lang/System.java 2003-02-14 17:44:31.000000000 +0000 *************** *** 1,252 **** ! // System.java - System-specific info. ! /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package java.lang; ! import java.io.FileDescriptor; ! import java.io.FileInputStream; ! import java.io.FileOutputStream; ! import java.io.FilterInputStream; ! import java.io.InputStream; ! import java.io.PrintStream; ! import java.io.BufferedInputStream; ! import java.io.BufferedOutputStream; import java.util.Properties; import java.util.PropertyPermission; ! import java.util.TimeZone; /** ! * @author Tom Tromey ! * @date August 27, 1998 ! */ ! ! /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 ! * "The Java Language Specification", ISBN 0-201-63451-1 ! * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: 1.1. Some 1.2 methods missing. Properties code not fully ! * implemented. */ - public final class System { ! public static native void arraycopy (Object src, int srcOffset, ! Object dst, int dstOffset, ! int count); ! ! public static native long currentTimeMillis (); ! ! // FIXME: When merging with Classpath, remember to remove the call to ! // getDefaultTimeZoneId from java.util.Timezone. ! private static native String getSystemTimeZone (); ! // Get the System Timezone as reported by the OS. It should be in ! // the form PST8PDT so we'll need to parse it and check that it's valid. ! // The result is used to set the user.timezone property in init_properties. ! // FIXME: Using the code from Classpath for generating the System ! // Timezone IMO is suboptimal because it ignores whether the rules for ! // DST match up. ! private static String getDefaultTimeZoneId () { ! String sysTimeZoneId = getSystemTimeZone (); ! // Check if this is a valid timezone. Make sure the IDs match ! // since getTimeZone returns GMT if no match is found. ! TimeZone tz = TimeZone.getTimeZone (sysTimeZoneId); ! if (tz.getID ().equals (sysTimeZoneId)) ! return sysTimeZoneId; ! // Check if the base part of sysTimeZoneId is a valid timezone that ! // matches with daylight usage and rawOffset. Make sure the IDs match ! // since getTimeZone returns GMT if no match is found. ! // First find start of GMT offset info and any Daylight zone name. ! int startGMToffset = 0; ! int sysTimeZoneIdLength = sysTimeZoneId.length(); ! for (int i = 0; i < sysTimeZoneIdLength && startGMToffset == 0; i++) ! { ! if (Character.isDigit (sysTimeZoneId.charAt (i))) ! startGMToffset = i; ! } ! int startDaylightZoneName = 0; ! boolean usesDaylight = false; ! for (int i = sysTimeZoneIdLength - 1; ! i >= 0 && !Character.isDigit (sysTimeZoneId.charAt (i)); --i) { ! startDaylightZoneName = i; } - if (startDaylightZoneName > 0) - usesDaylight = true; ! int GMToffset = Integer.parseInt (startDaylightZoneName == 0 ? ! sysTimeZoneId.substring (startGMToffset) : ! sysTimeZoneId.substring (startGMToffset, startDaylightZoneName)); ! // Offset could be in hours or seconds. Convert to millis. ! if (GMToffset < 24) ! GMToffset *= 60 * 60; ! GMToffset *= -1000; ! String tzBasename = sysTimeZoneId.substring (0, startGMToffset); ! tz = TimeZone.getTimeZone (tzBasename); ! if (tz.getID ().equals (tzBasename) && tz.getRawOffset () == GMToffset) ! { ! boolean tzUsesDaylight = tz.useDaylightTime (); ! if (usesDaylight && tzUsesDaylight || !usesDaylight && !tzUsesDaylight) ! return tzBasename; ! } ! ! // If no match, see if a valid timezone has the same attributes as this ! // and then use it instead. ! String[] IDs = TimeZone.getAvailableIDs (GMToffset); ! for (int i = 0; i < IDs.length; ++i) ! { ! // FIXME: The daylight savings rules may not match the rules ! // for the desired zone. ! boolean IDusesDaylight = ! TimeZone.getTimeZone (IDs[i]).useDaylightTime (); ! if (usesDaylight && IDusesDaylight || !usesDaylight && !IDusesDaylight) ! return IDs[i]; ! } ! // If all else fails, return null. ! return null; } ! public static void exit (int status) { ! Runtime.getRuntime().exit(status); } ! public static void gc () { ! Runtime.getRuntime().gc(); } ! // Marked deprecated in 1.1. We implement what the JCL book says. ! public static String getenv (String name) { ! throw new Error (); } ! private static native void init_properties (); ! public static Properties getProperties () { ! if (secman != null) ! secman.checkPropertiesAccess(); ! if (properties == null) ! init_properties (); ! return properties; } ! public static String getProperty (String property) { ! if (secman != null) ! secman.checkPropertyAccess(property); ! if (properties == null) ! init_properties (); ! return properties.getProperty(property); } ! public static String getProperty (String property, String defval) { ! if (secman != null) ! secman.checkPropertyAccess(property); if (properties == null) ! init_properties (); ! return properties.getProperty(property, defval); } ! public static SecurityManager getSecurityManager () { ! return secman; } ! public static native int identityHashCode (Object obj); ! ! public static void load (String pathname) { ! Runtime.getRuntime().load(pathname); } ! public static void loadLibrary (String libname) { ! Runtime.getRuntime().loadLibrary(libname); } ! public static void runFinalization () { ! Runtime.getRuntime().runFinalization(); } ! // Marked as deprecated in 1.2. ! public static void runFinalizersOnExit (boolean run) { ! Runtime.getRuntime().runFinalizersOnExit(run); } ! private static void checkSetIO () { ! // In 1.1, we are supposed to call checkExec, but the argument is ! // not specified. In 1.2, we are supposed to use checkPermission, ! // which doesn't exist in 1.1. ! if (secman != null) ! secman.checkExec(""); } ! public static native void setErr (PrintStream newErr); ! public static native void setIn (InputStream newIn); ! public static native void setOut (PrintStream newOut); ! ! public static void setProperties (Properties props) { ! if (secman != null) ! secman.checkPropertiesAccess(); ! synchronized (System.class) ! { ! properties = props; ! } } ! public static String setProperty (String key, String value) { ! if (secman != null) ! secman.checkPermission (new PropertyPermission (key, "write")); ! if (properties == null) ! init_properties (); ! return (String) properties.setProperty (key, value); } ! // TODO 1.2. ! // public static String mapLibraryName (String libname); ! public static void setSecurityManager (SecurityManager s) { ! if (secman != null) ! secman.checkPermission(new RuntimePermission("setSecurityManager")); ! secman = s; } ! // Public data. ! public static final InputStream in = new BufferedInputStream (new FileInputStream (FileDescriptor.in)); ! public static final PrintStream out = new PrintStream (new BufferedOutputStream (new FileOutputStream (FileDescriptor.out)), true); ! public static final PrintStream err = new PrintStream (new BufferedOutputStream (new FileOutputStream (FileDescriptor.err)), true); ! // Don't allow System objects to be made. ! private System () ! { ! } ! // Private data. ! private static SecurityManager secman = null; ! private static Properties properties = null; ! } --- 1,590 ---- ! /* System.java -- useful methods to interface with the system ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.lang; ! import java.io.*; import java.util.Properties; import java.util.PropertyPermission; ! import gnu.classpath.Configuration; /** ! * System represents system-wide resources; things that represent the ! * general environment. As such, all methods are static. ! * ! * @author John Keiser ! * @author Eric Blake ! * @since 1.0 ! * @status still missing 1.4 functionality */ public final class System { ! // WARNING: System is a CORE class in the bootstrap cycle. See the comments ! // in vm/reference/java/lang/Runtime for implications of this fact. ! /** ! * Add to the default properties. The field is stored in Runtime, because ! * of the bootstrap sequence; but this adds several useful properties to ! * the defaults. Once the default is stabilized, it should not be modified; ! * instead it is passed as a parent properties for fast setup of the ! * defaults when calling setProperties(null). ! */ ! static { ! // Note that this loadLibrary() takes precedence over the one in Object, ! // since Object. is waiting for System. to complete ! // first; but loading a library twice is harmless. ! if (Configuration.INIT_LOAD_LIBRARY) ! loadLibrary("javalang"); ! Properties defaultProperties = Runtime.defaultProperties; ! // Set base URL if not already set. ! if (defaultProperties.get("gnu.classpath.home.url") == null) ! defaultProperties.put("gnu.classpath.home.url", ! "file://" ! + defaultProperties.get("gnu.classpath.home") ! + "/lib"); ! // Set short name if not already set. ! if (defaultProperties.get("gnu.classpath.vm.shortname") == null) { ! String value = defaultProperties.getProperty("java.vm.name"); ! int index = value.lastIndexOf(' '); ! if (index != -1) ! value = value.substring(index + 1); ! defaultProperties.put("gnu.classpath.vm.shortname", value); } ! defaultProperties.put("gnu.cpu.endian", ! isWordsBigEndian() ? "big" : "little"); ! // XXX FIXME - Temp hack for old systems that set the wrong property ! if (defaultProperties.get("java.io.tmpdir") == null) ! defaultProperties.put("java.io.tmpdir", ! defaultProperties.get("java.tmpdir")); ! } ! /** ! * Stores the current system properties. This can be modified by ! * {@link #setProperties(Properties)}, but will never be null, because ! * setProperties(null) sucks in the default properties. ! */ ! // Note that we use clone here and not new. Some programs assume ! // that the system properties do not have a parent. ! private static Properties properties ! = (Properties) Runtime.defaultProperties.clone(); ! /** ! * The standard InputStream. This is assigned at startup and starts its ! * life perfectly valid. Although it is marked final, you can change it ! * using {@link #setIn(InputStream)} through some hefty VM magic. ! * ! *

        This corresponds to the C stdin and C++ cin variables, which ! * typically input from the keyboard, but may be used to pipe input from ! * other processes or files. That should all be transparent to you, ! * however. ! */ ! public static final InputStream in ! = new BufferedInputStream(new FileInputStream(FileDescriptor.in)); ! /** ! * The standard output PrintStream. This is assigned at startup and ! * starts its life perfectly valid. Although it is marked final, you can ! * change it using {@link #setOut(PrintStream)} through some hefty VM magic. ! * ! *

        This corresponds to the C stdout and C++ cout variables, which ! * typically output normal messages to the screen, but may be used to pipe ! * output to other processes or files. That should all be transparent to ! * you, however. ! */ ! public static final PrintStream out ! = new PrintStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.out)), true); ! /** ! * The standard output PrintStream. This is assigned at startup and ! * starts its life perfectly valid. Although it is marked final, you can ! * change it using {@link #setOut(PrintStream)} through some hefty VM magic. ! * ! *

        This corresponds to the C stderr and C++ cerr variables, which ! * typically output error messages to the screen, but may be used to pipe ! * output to other processes or files. That should all be transparent to ! * you, however. ! */ ! public static final PrintStream err ! = new PrintStream(new BufferedOutputStream(new FileOutputStream(FileDescriptor.err)), true); ! /** ! * This class is uninstantiable. ! */ ! private System() ! { } ! /** ! * Set {@link #in} to a new InputStream. This uses some VM magic to change ! * a "final" variable, so naturally there is a security check, ! * RuntimePermission("setIO"). ! * ! * @param in the new InputStream ! * @throws SecurityException if permission is denied ! * @since 1.1 ! */ ! public static void setIn(InputStream in) { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPermission(new RuntimePermission("setIO")); ! setIn0(in); } ! /** ! * Set {@link #out} to a new PrintStream. This uses some VM magic to change ! * a "final" variable, so naturally there is a security check, ! * RuntimePermission("setIO"). ! * ! * @param out the new PrintStream ! * @throws SecurityException if permission is denied ! * @since 1.1 ! */ ! public static void setOut(PrintStream out) { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPermission(new RuntimePermission("setIO")); ! setOut0(out); } ! /** ! * Set {@link #err} to a new PrintStream. This uses some VM magic to change ! * a "final" variable, so naturally there is a security check, ! * RuntimePermission("setIO"). ! * ! * @param err the new PrintStream ! * @throws SecurityException if permission is denied ! * @since 1.1 ! */ ! public static void setErr(PrintStream err) { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPermission(new RuntimePermission("setIO")); ! setErr0(err); } ! /** ! * Set the current SecurityManager. If a security manager already exists, ! * then RuntimePermission("setSecurityManager") is checked ! * first. Since this permission is denied by the default security manager, ! * setting the security manager is often an irreversible action. ! * ! * Spec Note: Don't ask me, I didn't write it. It looks ! * pretty vulnerable; whoever gets to the gate first gets to set the policy. ! * There is probably some way to set the original security manager as a ! * command line argument to the VM, but I don't know it. ! * ! * @param sm the new SecurityManager ! * @throws SecurityException if permission is denied ! */ ! public synchronized static void setSecurityManager(SecurityManager sm) ! { ! // Implementation note: the field lives in Runtime because of bootstrap ! // initialization issues. This method is synchronized so that no other ! // thread changes it to null before this thread makes the change. ! if (Runtime.securityManager != null) ! Runtime.securityManager.checkPermission ! (new RuntimePermission("setSecurityManager")); ! Runtime.securityManager = sm; ! } ! /** ! * Get the current SecurityManager. If the SecurityManager has not been ! * set yet, then this method returns null. ! * ! * @return the current SecurityManager, or null ! */ ! public static SecurityManager getSecurityManager() { ! // Implementation note: the field lives in Runtime because of bootstrap ! // initialization issues. ! return Runtime.securityManager; } ! /** ! * Get the current time, measured in the number of milliseconds from the ! * beginning of Jan. 1, 1970. This is gathered from the system clock, with ! * any attendant incorrectness (it may be timezone dependent). ! * ! * @return the current time ! * @see java.util.Date ! */ ! public static native long currentTimeMillis(); ! ! /** ! * Copy one array onto another from src[srcStart] ... ! * src[srcStart+len-1] to dest[destStart] ... ! * dest[destStart+len-1]. First, the arguments are validated: ! * neither array may be null, they must be of compatible types, and the ! * start and length must fit within both arrays. Then the copying starts, ! * and proceeds through increasing slots. If src and dest are the same ! * array, this will appear to copy the data to a temporary location first. ! * An ArrayStoreException in the middle of copying will leave earlier ! * elements copied, but later elements unchanged. ! * ! * @param src the array to copy elements from ! * @param srcStart the starting position in src ! * @param dest the array to copy elements to ! * @param destStart the starting position in dest ! * @param len the number of elements to copy ! * @throws NullPointerException if src or dest is null ! * @throws ArrayStoreException if src or dest is not an array, if they are ! * not compatible array types, or if an incompatible runtime type ! * is stored in dest ! * @throws IndexOutOfBoundsException if len is negative, or if the start or ! * end copy position in either array is out of bounds ! */ ! public static native void arraycopy(Object src, int srcStart, ! Object dest, int destStart, int len); ! ! /** ! * Get a hash code computed by the VM for the Object. This hash code will ! * be the same as Object's hashCode() method. It is usually some ! * convolution of the pointer to the Object internal to the VM. It ! * follows standard hash code rules, in that it will remain the same for a ! * given Object for the lifetime of that Object. ! * ! * @param o the Object to get the hash code for ! * @return the VM-dependent hash code for this Object ! * @since 1.1 ! */ ! public static native int identityHashCode(Object o); ! ! /** ! * Get all the system properties at once. A security check may be performed, ! * checkPropertiesAccess. Note that a security manager may ! * allow getting a single property, but not the entire group. ! * ! *

        The required properties include: ! *

        ! *
        java.version
        Java version number ! *
        java.vendor
        Java vendor specific string ! *
        java.vendor.url
        Java vendor URL ! *
        java.home
        Java installation directory ! *
        java.vm.specification.version
        VM Spec version ! *
        java.vm.specification.vendor
        VM Spec vendor ! *
        java.vm.specification.name
        VM Spec name ! *
        java.vm.version
        VM implementation version ! *
        java.vm.vendor
        VM implementation vendor ! *
        java.vm.name
        VM implementation name ! *
        java.specification.version
        Java Runtime Environment version ! *
        java.specification.vendor
        Java Runtime Environment vendor ! *
        java.specification.name
        Java Runtime Environment name ! *
        java.class.version
        Java class version number ! *
        java.class.path
        Java classpath ! *
        java.library.path
        Path for finding Java libraries ! *
        java.io.tmpdir
        Default temp file path ! *
        java.compiler
        Name of JIT to use ! *
        java.ext.dirs
        Java extension path ! *
        os.name
        Operating System Name ! *
        os.arch
        Operating System Architecture ! *
        os.version
        Operating System Version ! *
        file.separator
        File separator ("/" on Unix) ! *
        path.separator
        Path separator (":" on Unix) ! *
        line.separator
        Line separator ("\n" on Unix) ! *
        user.name
        User account name ! *
        user.home
        User home directory ! *
        user.dir
        User's current working directory ! *
        ! * ! * In addition, gnu defines several other properties, where ? stands for ! * each character in '0' through '9': ! *
        ! *
        gnu.classpath.vm.shortname
        Succinct version of the VM name; ! * used for finding property files in file system ! *
        gnu.classpath.home.url
        Base URL; used for finding ! * property files in file system ! *
        gnu.cpu.endian
        big or little ! *
        gnu.java.io.encoding_scheme_alias.ISO-8859-?
        8859_? ! *
        gnu.java.io.encoding_scheme_alias.iso-8859-?
        8859_? ! *
        gnu.java.io.encoding_scheme_alias.iso8859_?
        8859_? ! *
        gnu.java.io.encoding_scheme_alias.iso-latin-_?
        8859_? ! *
        gnu.java.io.encoding_scheme_alias.latin?
        8859_? ! *
        gnu.java.io.encoding_scheme_alias.UTF-8
        UTF8 ! *
        gnu.java.io.encoding_scheme_alias.utf-8
        UTF8 ! *
        ! * ! * @return the system properties, will never be null ! * @throws SecurityException if permission is denied ! */ ! public static Properties getProperties() { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPropertiesAccess(); ! return properties; } ! /** ! * Set all the system properties at once. A security check may be performed, ! * checkPropertiesAccess. Note that a security manager may ! * allow setting a single property, but not the entire group. An argument ! * of null resets the properties to the startup default. ! * ! * @param properties the new set of system properties ! * @throws SecurityException if permission is denied ! */ ! public static void setProperties(Properties properties) { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPropertiesAccess(); if (properties == null) ! { ! // Note that we use clone here and not new. Some programs ! // assume that the system properties do not have a parent. ! properties = (Properties) Runtime.defaultProperties.clone(); ! } ! System.properties = properties; } ! /** ! * Get a single system property by name. A security check may be performed, ! * checkPropertyAccess(key). ! * ! * @param key the name of the system property to get ! * @return the property, or null if not found ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if key is null ! * @throws IllegalArgumentException if key is "" ! */ ! public static String getProperty(String key) { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPropertyAccess(key); ! else if (key.length() == 0) ! throw new IllegalArgumentException("key can't be empty"); ! return properties.getProperty(key); } ! /** ! * Get a single system property by name. A security check may be performed, ! * checkPropertyAccess(key). ! * ! * @param key the name of the system property to get ! * @param def the default ! * @return the property, or def if not found ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if key is null ! * @throws IllegalArgumentException if key is "" ! */ ! public static String getProperty(String key, String def) { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPropertyAccess(key); ! return properties.getProperty(key, def); } ! /** ! * Set a single system property by name. A security check may be performed, ! * checkPropertyAccess(key, "write"). ! * ! * @param key the name of the system property to set ! * @param value the new value ! * @return the previous value, or null ! * @throws SecurityException if permission is denied ! * @throws NullPointerException if key is null ! * @throws IllegalArgumentException if key is "" ! * @since 1.2 ! */ ! public static String setProperty(String key, String value) { ! SecurityManager sm = Runtime.securityManager; // Be thread-safe. ! if (sm != null) ! sm.checkPermission(new PropertyPermission(key, "write")); ! return (String) properties.setProperty(key, value); } ! /** ! * This used to get an environment variable, but following Sun's lead, ! * it now throws an Error. Use getProperty instead. ! * ! * @param name the name of the environment variable ! * @return this does not return ! * @throws Error this is not supported ! * @deprecated use {@link #getProperty(String)}; getenv is not supported ! */ ! public static String getenv(String name) { ! throw new Error("getenv no longer supported, use properties instead: " ! + name); } ! /** ! * Terminate the Virtual Machine. This just calls ! * Runtime.getRuntime().exit(status), and never returns. ! * Obviously, a security check is in order, checkExit. ! * ! * @param status the exit status; by convention non-zero is abnormal ! * @throws SecurityException if permission is denied ! * @see Runtime#exit(int) ! */ ! public static void exit(int status) { ! Runtime.getRuntime().exit(status); } ! /** ! * Calls the garbage collector. This is only a hint, and it is up to the ! * implementation what this hint suggests, but it usually causes a ! * best-effort attempt to reclaim unused memory from discarded objects. ! * This calls Runtime.getRuntime().gc(). ! * ! * @see Runtime#gc() ! */ ! public static void gc() { ! Runtime.getRuntime().gc(); } ! /** ! * Runs object finalization on pending objects. This is only a hint, and ! * it is up to the implementation what this hint suggests, but it usually ! * causes a best-effort attempt to run finalizers on all objects ready ! * to be reclaimed. This calls ! * Runtime.getRuntime().runFinalization(). ! * ! * @see Runtime#runFinalization() ! */ ! public static void runFinalization() { ! Runtime.getRuntime().runFinalization(); } ! /** ! * Tell the Runtime whether to run finalization before exiting the ! * JVM. This is inherently unsafe in multi-threaded applications, ! * since it can force initialization on objects which are still in use ! * by live threads, leading to deadlock; therefore this is disabled by ! * default. There may be a security check, checkExit(0). This ! * calls Runtime.getRuntime().runFinalizersOnExit(). ! * ! * @param finalizeOnExit whether to run finalizers on exit ! * @throws SecurityException if permission is denied ! * @see Runtime#runFinalizersOnExit() ! * @since 1.1 ! * @deprecated never rely on finalizers to do a clean, thread-safe, ! * mop-up from your code ! */ ! public static void runFinalizersOnExit(boolean finalizeOnExit) { ! Runtime.getRuntime().runFinalizersOnExit(finalizeOnExit); } ! /** ! * Load a code file using its explicit system-dependent filename. A security ! * check may be performed, checkLink. This just calls ! * Runtime.getRuntime().load(filename). ! * ! * @param filename the code file to load ! * @throws SecurityException if permission is denied ! * @throws UnsatisfiedLinkError if the file cannot be loaded ! * @see Runtime#load(String) ! */ ! public static void load(String filename) ! { ! Runtime.getRuntime().load(filename); ! } ! /** ! * Load a library using its explicit system-dependent filename. A security ! * check may be performed, checkLink. This just calls ! * Runtime.getRuntime().load(filename). ! * ! * @param libname the library file to load ! * @throws SecurityException if permission is denied ! * @throws UnsatisfiedLinkError if the file cannot be loaded ! * @see Runtime#load(String) ! */ ! public static void loadLibrary(String libname) { ! Runtime.getRuntime().loadLibrary(libname); } ! /** ! * Convert a library name to its platform-specific variant. ! * ! * @param libname the library name, as used in loadLibrary ! * @return the platform-specific mangling of the name ! * @since 1.2 ! */ ! public static String mapLibraryName(String libname) ! { ! // XXX Fix this!!!! ! return Runtime.nativeGetLibname("", libname); ! } ! /** ! * Detect big-endian systems. ! * ! * @return true if the system is big-endian. ! */ ! static native boolean isWordsBigEndian(); ! /** ! * Set {@link #in} to a new InputStream. ! * ! * @param in the new InputStream ! * @see #setIn(InputStream) ! */ ! private static native void setIn0(InputStream in); ! /** ! * Set {@link #out} to a new PrintStream. ! * ! * @param out the new PrintStream ! * @see #setOut(PrintStream) ! */ ! private static native void setOut0(PrintStream out); ! /** ! * Set {@link #err} to a new PrintStream. ! * ! * @param err the new PrintStream ! * @see #setErr(PrintStream) ! */ ! private static native void setErr0(PrintStream err); ! } // class System diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ThreadDeath.java gcc-3.3/libjava/java/lang/ThreadDeath.java *** gcc-3.2.3/libjava/java/lang/ThreadDeath.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ThreadDeath.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.ThreadDeath - Special exception registering Thread death. ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ThreadDeath.java - special exception registering Thread death ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,60 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Complete to version 1.1 - */ - /** ! ** ThreadDeath is thrown in a thread when someone calls stop() on that thread. ! ** ! ** Important: Make sure you rethrow this exception if you catch it. If you don't, the thread will not die. ! ** ! ** @author John Keiser ! ** @author Tom Tromey ! ** @version 1.1.0, 5 Feb 1998, August 26 1998 ! ** @since JDK1.0 ! ** @see java.lang.Thread#stop() ! **/ ! public class ThreadDeath extends Error { } --- 38,68 ---- package java.lang; /** ! * ThreadDeath is thrown in a thread when someone calls stop() ! * on that thread. Important: Make sure you rethrow this exception ! * if you catch it. If you don't, the thread will not die. ! * ! *

        This is an Error rather than an exception, so that normal code will ! * not catch it. It is intended for asynchronous cleanup when using the ! * deprecated Thread.stop() method. ! * ! * @author John Keiser ! * @author Tom Tromey ! * @see Thread#stop() ! * @status updated to 1.4 ! */ ! public class ThreadDeath extends Error ! { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4417128565033088268L; ! /** ! * Create an error without a message. ! */ ! public ThreadDeath() ! { ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ThreadGroup.java gcc-3.3/libjava/java/lang/ThreadGroup.java *** gcc-3.2.3/libjava/java/lang/ThreadGroup.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ThreadGroup.java 2002-06-18 15:39:39.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.ThreadGroup ! Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ThreadGroup -- a group of Threads ! Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** or based on this library. If you modify *** 34,199 **** this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ ! package java.lang; import java.util.Vector; - import java.util.Enumeration; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 from http://www.javasoft.com. - * Status: Complete for 1.2. Some parts from the JDK 1.0 spec only are - * not implemented. - */ - /** ! * ThreadGroup allows you to group Threads together. There is a ! * hierarchy of ThreadGroups, and only the initial ThreadGroup has ! * no parent. A Thread may access information about its own ! * ThreadGroup, but not its parents or others outside the tree. * * @author John Keiser * @author Tom Tromey * @author Bryce McKinlay ! * @version 1.2.0 ! * @since JDK1.0 */ - public class ThreadGroup { ! /* The Initial, top-level ThreadGroup. */ static ThreadGroup root = new ThreadGroup(); - /* This flag is set if an uncaught exception occurs. The runtime should - check this and exit with an error status if it is set. */ - static boolean had_uncaught_exception = false; ! private ThreadGroup parent; ! private String name; ! private Vector threads = new Vector(); private Vector groups = new Vector(); private boolean daemon_flag = false; - private int maxpri = Thread.MAX_PRIORITY; private ThreadGroup() { ! name = "main"; } ! /** Create a new ThreadGroup using the given name and the ! * current thread's ThreadGroup as a parent. ! * @param name the name to use for the ThreadGroup. */ public ThreadGroup(String name) { ! this (Thread.currentThread().getThreadGroup(), name); } ! /** Create a new ThreadGroup using the given name and ! * parent group. ! * @param name the name to use for the ThreadGroup. ! * @param parent the ThreadGroup to use as a parent. ! * @exception NullPointerException if parent is null. ! * @exception SecurityException if you cannot change ! * the intended parent group. */ public ThreadGroup(ThreadGroup parent, String name) { parent.checkAccess(); this.parent = parent; - if (parent.isDestroyed()) - throw new IllegalArgumentException (); this.name = name; maxpri = parent.maxpri; daemon_flag = parent.daemon_flag; ! parent.addGroup(this); } ! /** Get the name of this ThreadGroup. ! * @return the name of this ThreadGroup. */ public final String getName() { return name; } ! /** Get the parent of this ThreadGroup. ! * @return the parent of this ThreadGroup. */ public final ThreadGroup getParent() { return parent; } ! /** Set the maximum priority for Threads in this ThreadGroup. setMaxPriority ! * can only be used to reduce the current maximum. If maxpri ! * is greater than the current Maximum, the current value is not changed. ! * Calling this does not effect threads already in this ThreadGroup. ! * @param maxpri the new maximum priority for this ThreadGroup. ! * @exception SecurityException if you cannoy modify this ThreadGroup. */ ! public final synchronized void setMaxPriority(int maxpri) { ! checkAccess(); ! if (maxpri < this.maxpri ! && maxpri >= Thread.MIN_PRIORITY ! && maxpri <= Thread.MAX_PRIORITY) ! { ! this.maxpri = maxpri; ! } } ! /** Get the maximum priority of Threads in this ThreadGroup. ! * @return the maximum priority of Threads in this ThreadGroup. */ ! public final int getMaxPriority() { ! return maxpri; } ! /** Set whether this ThreadGroup is a daemon group. A daemon ! * group will be destroyed when its last thread is stopped and ! * its last thread group is destroyed. ! * @specnote The Java API docs indicate that the group is destroyed ! * when either of those happen, but that doesn't make ! * sense. ! * @param daemon whether this ThreadGroup should be a daemon group. ! * @exception SecurityException if you cannoy modify this ThreadGroup. */ ! public final void setDaemon (boolean daemon) { ! checkAccess(); ! daemon_flag = daemon; } ! ! /** Tell whether this ThreadGroup is a daemon group. A daemon ! * group will be destroyed when its last thread is stopped and ! * its last thread group is destroyed. ! * @specnote The Java API docs indicate that the group is destroyed ! * when either of those happen, but that doesn't make ! * sense. ! * @return whether this ThreadGroup is a daemon group. ! */ ! public final boolean isDaemon() { ! return daemon_flag; } ! /** Tell whether this ThreadGroup has been destroyed or not. ! * @return whether this ThreadGroup has been destroyed or not. ! */ ! public synchronized boolean isDestroyed() { ! return parent == null && this != root; } ! /** Check whether this ThreadGroup is an ancestor of the ! * specified ThreadGroup, or if they are the same. ! * ! * @param g the group to test on. ! * @return whether this ThreadGroup is a parent of the ! * specified group. ! */ public final boolean parentOf(ThreadGroup tg) { while (tg != null) --- 34,246 ---- this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ ! package java.lang; import java.util.Vector; /** ! * ThreadGroup allows you to group Threads together. There is a hierarchy ! * of ThreadGroups, and only the initial ThreadGroup has no parent. A Thread ! * may access information about its own ThreadGroup, but not its parents or ! * others outside the tree. * * @author John Keiser * @author Tom Tromey * @author Bryce McKinlay ! * @author Eric Blake ! * @see Thread ! * @since 1.0 ! * @status updated to 1.4 */ public class ThreadGroup { ! /** The Initial, top-level ThreadGroup. */ static ThreadGroup root = new ThreadGroup(); ! /** ! * This flag is set if an uncaught exception occurs. The runtime should ! * check this and exit with an error status if it is set. ! */ ! static boolean had_uncaught_exception; ! ! /** The parent thread group. */ ! private final ThreadGroup parent; ! ! /** The group name, non-null. */ ! final String name; ! ! /** The threads in the group. */ ! private final Vector threads = new Vector(); ! ! /** Child thread groups, or null when this group is destroyed. */ private Vector groups = new Vector(); + + /** If all threads in the group are daemons. */ private boolean daemon_flag = false; + /** The maximum group priority. */ + private int maxpri; + + /** + * Hidden constructor to build the root node. + */ private ThreadGroup() { ! name = "main"; ! parent = null; ! maxpri = Thread.MAX_PRIORITY; } ! /** ! * Create a new ThreadGroup using the given name and the current thread's ! * ThreadGroup as a parent. There may be a security check, ! * checkAccess. ! * ! * @param name the name to use for the ThreadGroup ! * @throws SecurityException if the current thread cannot create a group ! * @see #checkAccess() */ public ThreadGroup(String name) { ! this(Thread.currentThread().group, name); } ! /** ! * Create a new ThreadGroup using the given name and parent group. The new ! * group inherits the maximum priority and daemon status of its parent ! * group. There may be a security check, checkAccess. ! * ! * @param name the name to use for the ThreadGroup ! * @param parent the ThreadGroup to use as a parent ! * @throws NullPointerException if parent is null ! * @throws SecurityException if the current thread cannot create a group ! * @throws IllegalThreadStateException if the parent is destroyed ! * @see #checkAccess() */ public ThreadGroup(ThreadGroup parent, String name) { parent.checkAccess(); this.parent = parent; this.name = name; maxpri = parent.maxpri; daemon_flag = parent.daemon_flag; ! synchronized (parent) ! { ! if (parent.groups == null) ! throw new IllegalThreadStateException(); ! parent.groups.add(this); ! } } ! /** ! * Get the name of this ThreadGroup. ! * ! * @return the name of this ThreadGroup */ public final String getName() { return name; } ! /** ! * Get the parent of this ThreadGroup. If the parent is not null, there ! * may be a security check, checkAccess. ! * ! * @return the parent of this ThreadGroup ! * @throws SecurityException if permission is denied */ public final ThreadGroup getParent() { + if (parent != null) + parent.checkAccess(); return parent; } ! /** ! * Get the maximum priority of Threads in this ThreadGroup. Threads created ! * after this call in this group may not exceed this priority. ! * ! * @return the maximum priority of Threads in this ThreadGroup */ ! public final int getMaxPriority() { ! return maxpri; } ! /** ! * Tell whether this ThreadGroup is a daemon group. A daemon group will ! * be automatically destroyed when its last thread is stopped and ! * its last thread group is destroyed. ! * ! * @return whether this ThreadGroup is a daemon group */ ! public final boolean isDaemon() { ! return daemon_flag; } ! /** ! * Tell whether this ThreadGroup has been destroyed or not. ! * ! * @return whether this ThreadGroup has been destroyed or not ! * @since 1.1 */ ! public synchronized boolean isDestroyed() { ! return groups == null; } ! ! /** ! * Set whether this ThreadGroup is a daemon group. A daemon group will be ! * destroyed when its last thread is stopped and its last thread group is ! * destroyed. There may be a security check, checkAccess. ! * ! * @param daemon whether this ThreadGroup should be a daemon group ! * @throws SecurityException if you cannot modify this ThreadGroup ! * @see #checkAccess() ! */ ! public final void setDaemon(boolean daemon) { ! checkAccess(); ! daemon_flag = daemon; } ! /** ! * Set the maximum priority for Threads in this ThreadGroup. setMaxPriority ! * can only be used to reduce the current maximum. If maxpri is greater ! * than the current Maximum of the parent group, the current value is not ! * changed. Otherwise, all groups which belong to this have their priority ! * adjusted as well. Calling this does not affect threads already in this ! * ThreadGroup. There may be a security check, checkAccess. ! * ! * @param maxpri the new maximum priority for this ThreadGroup ! * @throws SecurityException if you cannot modify this ThreadGroup ! * @see #getMaxPriority() ! * @see #checkAccess() ! */ ! public final synchronized void setMaxPriority(int maxpri) { ! checkAccess(); ! if (maxpri < Thread.MIN_PRIORITY || maxpri > Thread.MAX_PRIORITY) ! return; ! if (parent != null && maxpri > parent.maxpri) ! maxpri = parent.maxpri; ! this.maxpri = maxpri; ! if (groups == null) ! return; ! int i = groups.size(); ! while (--i >= 0) ! ((ThreadGroup) groups.get(i)).setMaxPriority(maxpri); } ! /** ! * Check whether this ThreadGroup is an ancestor of the specified ! * ThreadGroup, or if they are the same. ! * ! * @param g the group to test on ! * @return whether this ThreadGroup is a parent of the specified group ! */ public final boolean parentOf(ThreadGroup tg) { while (tg != null) *************** public class ThreadGroup *** 205,627 **** return false; } ! /** Return the total number of active threads in this ThreadGroup ! * and all its descendants.

        ! * ! * This cannot return an exact number, since the status of threads ! * may change after they were counted. But it should be pretty ! * close.

        ! * ! * @return the number of active threads in this ThreadGroup and ! * its descendants. ! * @specnote it isn't clear what the definition of an "Active" thread is. ! * Current JDKs regard a thread as active if has been ! * started and not finished. We implement this behaviour. ! * There is a JDC bug, ! * 4089701, regarding this issue. ! * ! */ ! public synchronized int activeCount() { ! int total = 0; ! for (int i = 0; i < threads.size(); ++i) ! { ! if (((Thread) threads.elementAt(i)).isAlive ()) ! ++total; ! } ! ! for (int i=0; i < groups.size(); i++) ! { ! ThreadGroup g = (ThreadGroup) groups.elementAt(i); ! total += g.activeCount(); ! } ! return total; } ! /** Get the number of active groups in this ThreadGroup. This group ! * itself is not included in the count. ! * @specnote it is unclear what exactly constitutes an ! * active ThreadGroup. Currently we assume that ! * all sub-groups are active, per current JDKs. ! * @return the number of active groups in this ThreadGroup. ! */ ! public synchronized int activeGroupCount() { ! int total = groups.size(); ! for (int i=0; i < groups.size(); i++) ! { ! ThreadGroup g = (ThreadGroup) groups.elementAt(i); ! total += g.activeGroupCount(); ! } return total; } ! /** Copy all of the active Threads from this ThreadGroup and ! * its descendants into the specified array. If the array is ! * not big enough to hold all the Threads, extra Threads will ! * simply not be copied. ! * ! * @param threads the array to put the threads into. ! * @return the number of threads put into the array. ! */ ! public int enumerate(Thread[] threads) ! { ! return enumerate(threads, 0, true); ! } ! ! /** Copy all of the active Threads from this ThreadGroup and, ! * if desired, from its descendants, into the specified array. ! * If the array is not big enough to hold all the Threads, ! * extra Threads will simply not be copied. ! * ! * @param threads the array to put the threads into. ! * @param useDescendants whether to count Threads in this ! * ThreadGroup's descendants or not. ! * @return the number of threads put into the array. ! */ ! public int enumerate(Thread[] threads, boolean useDescendants) { ! return enumerate(threads, 0, useDescendants); } ! // This actually implements enumerate. ! private synchronized int enumerate(Thread[] list, int next_index, ! boolean recurse) { ! Enumeration e = threads.elements(); ! while (e.hasMoreElements() && next_index < list.length) ! { ! Thread t = (Thread) e.nextElement(); ! if (t.isAlive ()) ! list[next_index++] = t; ! } ! if (recurse && next_index != list.length) ! { ! e = groups.elements(); ! while (e.hasMoreElements() && next_index < list.length) ! { ! ThreadGroup g = (ThreadGroup) e.nextElement(); ! next_index = g.enumerate(list, next_index, true); ! } ! } ! return next_index; } ! /** Copy all active ThreadGroups that are descendants of this ! * ThreadGroup into the specified array. If the array is not ! * large enough to hold all active ThreadGroups, extra ! * ThreadGroups simply will not be copied. ! * ! * @param groups the array to put the ThreadGroups into. ! * @return the number of ThreadGroups copied into the array. ! */ ! public int enumerate(ThreadGroup[] groups) { ! return enumerate(groups, 0, true); } ! /** Copy all active ThreadGroups that are children of this ! * ThreadGroup into the specified array, and if desired, also ! * copy all active descendants into the array. If the array ! * is not large enough to hold all active ThreadGroups, extra ! * ThreadGroups simply will not be copied. ! * ! * @param groups the array to put the ThreadGroups into. ! * @param recurse whether to include all descendants ! * of this ThreadGroup's children in determining ! * activeness. ! * @return the number of ThreadGroups copied into the array. ! */ ! public int enumerate(ThreadGroup[] groups, boolean recurse) { ! return enumerate(groups, 0, recurse); } ! // This actually implements enumerate. ! private synchronized int enumerate (ThreadGroup[] list, int next_index, ! boolean recurse) { ! Enumeration e = groups.elements(); ! while (e.hasMoreElements() && next_index < list.length) ! { ! ThreadGroup g = (ThreadGroup) e.nextElement(); ! list[next_index++] = g; ! if (recurse && next_index != list.length) ! next_index = g.enumerate(list, next_index, true); ! } ! return next_index; } ! /** Interrupt all Threads in this ThreadGroup and its sub-groups. ! * @exception SecurityException if you cannot modify this ! * ThreadGroup or any of its Threads or children ! * ThreadGroups. ! * @since JDK1.2 ! */ ! public final synchronized void interrupt() { checkAccess(); ! for (int i=0; i < threads.size(); i++) ! { ! Thread t = (Thread) threads.elementAt(i); ! t.interrupt(); ! } ! for (int i=0; i < groups.size(); i++) ! { ! ThreadGroup tg = (ThreadGroup) groups.elementAt(i); ! tg.interrupt(); ! } } ! /** Stop all Threads in this ThreadGroup and its descendants. ! * @exception SecurityException if you cannot modify this ! * ThreadGroup or any of its Threads or children ! * ThreadGroups. ! * @deprecated This method calls Thread.stop(), which is dangerous. ! */ ! public final synchronized void stop() { checkAccess(); ! for (int i=0; i ! * ! * ThreadGroup's implementation does the following:
        ! *

          ! *
        1. If there is a parent ThreadGroup, call uncaughtException() ! * in the parent.
        2. ! *
        3. If the Throwable passed is a ThreadDeath, don't do ! * anything.
        4. ! *
        5. Otherwise, call exception.printStackTrace().
        6. ! *
        ! * ! * @param thread the thread that exited. ! * @param exception the uncaught exception. ! */ public void uncaughtException(Thread thread, Throwable t) { if (parent != null) ! parent.uncaughtException (thread, t); else if (! (t instanceof ThreadDeath)) { ! if (thread != null) ! System.err.print ("Exception in thread \"" ! + thread.getName() + "\" "); ! try ! { ! t.printStackTrace(System.err); ! } ! catch (Throwable x) ! { ! // This means that something is badly screwed up with the runtime, ! // or perhaps someone is messing with the SecurityManager. In any ! // case, try to deal with it gracefully. ! System.err.println(t); ! System.err.println("*** Got " + x.toString() + ! " while trying to print stack trace"); ! } ! had_uncaught_exception = true; } } ! /** Tell the VM whether it may suspend Threads in low memory ! * situations. ! * @deprecated This method is unimplemented, because it would rely on ! * suspend(), which is deprecated. There is no way for a Java ! * program to determine whether this has any effect whatsoever, ! * so we don't need it. ! * @return false ! */ public boolean allowThreadSuspension(boolean allow) { return false; } ! /** Get a human-readable representation of this ThreadGroup. ! * @return a String representing this ThreadGroup. ! * @specnote Language Spec and Class Libraries book disagree a bit here. ! * We follow the Spec, but add "ThreadGroup" per the book. We ! * include "java.lang" based on the list() example in the Class ! * Libraries book. ! */ ! public String toString () { ! return "java.lang.ThreadGroup[name=" + name + ! ",maxpri=" + maxpri + "]"; } ! /** Find out if the current Thread can modify this ThreadGroup. ! * Calls the current SecurityManager's checkAccess() method to ! * find out. If there is none, it assumes everything's OK. ! * @exception SecurityException if the current Thread cannot ! * modify this ThreadGroup. ! */ ! public final void checkAccess() { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! sm.checkAccess(this); } ! // This is called to add a Thread to our internal list. final synchronized void addThread(Thread t) { ! if (isDestroyed()) ! throw new IllegalThreadStateException ("ThreadGroup is destroyed"); ! ! threads.addElement(t); } ! // This is called to remove a Thread from our internal list. final synchronized void removeThread(Thread t) { ! if (isDestroyed()) ! throw new IllegalThreadStateException (); ! ! threads.removeElement(t); // Daemon groups are automatically destroyed when all their threads die. if (daemon_flag && groups.size() == 0 && threads.size() == 0) { ! // We inline destroy to avoid the access check. ! if (parent != null) ! parent.removeGroup(this); ! parent = null; } } ! // This is called to add a ThreadGroup to our internal list. ! final synchronized void addGroup(ThreadGroup g) ! { ! groups.addElement(g); ! } ! ! // This is called to remove a ThreadGroup from our internal list. final synchronized void removeGroup(ThreadGroup g) { ! groups.removeElement(g); // Daemon groups are automatically destroyed when all their threads die. if (daemon_flag && groups.size() == 0 && threads.size() == 0) { ! // We inline destroy to avoid the access check. ! if (parent != null) ! parent.removeGroup(this); ! parent = null; } } ! } --- 252,748 ---- return false; } ! /** ! * Find out if the current Thread can modify this ThreadGroup. This passes ! * the check on to SecurityManager.checkAccess(this). ! * ! * @throws SecurityException if the current Thread cannot modify this ! * ThreadGroup ! * @see SecurityManager#checkAccess(ThreadGroup) ! */ ! public final void checkAccess() { ! // Bypass System.getSecurityManager, for bootstrap efficiency. ! SecurityManager sm = Runtime.securityManager; ! if (sm != null) ! sm.checkAccess(this); } ! /** ! * Return an estimate of the total number of active threads in this ! * ThreadGroup and all its descendants. This cannot return an exact number, ! * since the status of threads may change after they were counted; but it ! * should be pretty close. Based on a JDC bug, ! * ! * 4089701, we take active to mean isAlive(). ! * ! * @return count of active threads in this ThreadGroup and its descendants ! */ ! public int activeCount() { ! int total = 0; ! if (groups == null) ! return total; ! int i = threads.size(); ! while (--i >= 0) ! if (((Thread) threads.get(i)).isAlive()) ! total++; ! i = groups.size(); ! while (--i >= 0) ! total += ((ThreadGroup) groups.get(i)).activeCount(); return total; } ! /** ! * Copy all of the active Threads from this ThreadGroup and its descendants ! * into the specified array. If the array is not big enough to hold all ! * the Threads, extra Threads will simply not be copied. There may be a ! * security check, checkAccess. ! * ! * @param array the array to put the threads into ! * @return the number of threads put into the array ! * @throws SecurityException if permission was denied ! * @throws NullPointerException if array is null ! * @throws ArrayStoreException if a thread does not fit in the array ! * @see #activeCount() ! * @see #checkAccess() ! * @see #enumerate(Thread[], boolean) ! */ ! public int enumerate(Thread[] array) { ! return enumerate(array, 0, true); } ! /** ! * Copy all of the active Threads from this ThreadGroup and, if desired, ! * from its descendants, into the specified array. If the array is not big ! * enough to hold all the Threads, extra Threads will simply not be copied. ! * There may be a security check, checkAccess. ! * ! * @param array the array to put the threads into ! * @param recurse whether to recurse into descendent ThreadGroups ! * @return the number of threads put into the array ! * @throws SecurityException if permission was denied ! * @throws NullPointerException if array is null ! * @throws ArrayStoreException if a thread does not fit in the array ! * @see #activeCount() ! * @see #checkAccess() ! */ ! public int enumerate(Thread[] array, boolean recurse) { ! return enumerate(array, 0, recurse); } ! /** ! * Get the number of active groups in this ThreadGroup. This group itself ! * is not included in the count. A sub-group is active if it has not been ! * destroyed. This cannot return an exact number, since the status of ! * threads may change after they were counted; but it should be pretty close. ! * ! * @return the number of active groups in this ThreadGroup ! */ ! public int activeGroupCount() { ! if (groups == null) ! return 0; ! int total = groups.size(); ! int i = total; ! while (--i >= 0) ! total += ((ThreadGroup) groups.get(i)).activeGroupCount(); ! return total; } ! /** ! * Copy all active ThreadGroups that are descendants of this ThreadGroup ! * into the specified array. If the array is not large enough to hold all ! * active ThreadGroups, extra ThreadGroups simply will not be copied. There ! * may be a security check, checkAccess. ! * ! * @param array the array to put the ThreadGroups into ! * @return the number of ThreadGroups copied into the array ! * @throws SecurityException if permission was denied ! * @throws NullPointerException if array is null ! * @throws ArrayStoreException if a group does not fit in the array ! * @see #activeCount() ! * @see #checkAccess() ! * @see #enumerate(ThreadGroup[], boolean) ! */ ! public int enumerate(ThreadGroup[] array) { ! return enumerate(array, 0, true); } ! /** ! * Copy all active ThreadGroups that are children of this ThreadGroup into ! * the specified array, and if desired, also all descendents. If the array ! * is not large enough to hold all active ThreadGroups, extra ThreadGroups ! * simply will not be copied. There may be a security check, ! * checkAccess. ! * ! * @param array the array to put the ThreadGroups into ! * @param recurse whether to recurse into descendent ThreadGroups ! * @return the number of ThreadGroups copied into the array ! * @throws SecurityException if permission was denied ! * @throws NullPointerException if array is null ! * @throws ArrayStoreException if a group does not fit in the array ! * @see #activeCount() ! * @see #checkAccess() ! */ ! public int enumerate(ThreadGroup[] array, boolean recurse) { ! return enumerate(array, 0, recurse); } ! /** ! * Stop all Threads in this ThreadGroup and its descendants. ! * ! *

        This is inherently unsafe, as it can interrupt synchronized blocks and ! * leave data in bad states. Hence, there is a security check: ! * checkAccess(), followed by further checks on each thread ! * being stopped. ! * ! * @throws SecurityException if permission is denied ! * @see #checkAccess() ! * @see Thread#stop(Throwable) ! * @deprecated unsafe operation, try not to use ! */ ! public final synchronized void stop() { checkAccess(); ! if (groups == null) ! return; ! int i = threads.size(); ! while (--i >= 0) ! ((Thread) threads.get(i)).stop(); ! i = groups.size(); ! while (--i >= 0) ! ((ThreadGroup) groups.get(i)).stop(); } ! /** ! * Interrupt all Threads in this ThreadGroup and its sub-groups. There may ! * be a security check, checkAccess. ! * ! * @throws SecurityException if permission is denied ! * @see #checkAccess() ! * @see Thread#interrupt() ! * @since 1.2 ! */ ! public final synchronized void interrupt() { checkAccess(); ! if (groups == null) ! return; ! int i = threads.size(); ! while (--i >= 0) ! ((Thread) threads.get(i)).interrupt(); ! i = groups.size(); ! while (--i >= 0) ! ((ThreadGroup) groups.get(i)).interrupt(); } ! /** ! * Suspend all Threads in this ThreadGroup and its descendants. ! * ! *

        This is inherently unsafe, as suspended threads still hold locks, ! * which can lead to deadlock. Hence, there is a security check: ! * checkAccess(), followed by further checks on each thread ! * being suspended. ! * ! * @throws SecurityException if permission is denied ! * @see #checkAccess() ! * @see Thread#suspend() ! * @deprecated unsafe operation, try not to use ! */ public final synchronized void suspend() { checkAccess(); ! if (groups == null) ! return; ! int i = threads.size(); ! while (--i >= 0) ! ((Thread) threads.get(i)).suspend(); ! i = groups.size(); ! while (--i >= 0) ! ((ThreadGroup) groups.get(i)).suspend(); } ! /** ! * Resume all suspended Threads in this ThreadGroup and its descendants. ! * To mirror suspend(), there is a security check: ! * checkAccess(), followed by further checks on each thread ! * being resumed. ! * ! * @throws SecurityException if permission is denied ! * @see #checkAccess() ! * @see Thread#suspend() ! * @deprecated pointless, since suspend is deprecated ! */ public final synchronized void resume() { checkAccess(); ! if (groups == null) ! return; ! int i = threads.size(); ! while (--i >= 0) ! ((Thread) threads.get(i)).resume(); ! i = groups.size(); ! while (--i >= 0) ! ((ThreadGroup) groups.get(i)).resume(); } ! /** ! * Destroy this ThreadGroup. The group must be empty, meaning that all ! * threads and sub-groups have completed execution. Daemon groups are ! * destroyed automatically. There may be a security check, ! * checkAccess. ! * ! * @throws IllegalThreadStateException if the ThreadGroup is not empty, or ! * was previously destroyed ! * @throws SecurityException if permission is denied ! * @see #checkAccess() ! */ public final synchronized void destroy() { checkAccess(); ! if (! threads.isEmpty() || groups == null) ! throw new IllegalThreadStateException(); ! int i = groups.size(); ! while (--i >= 0) ! ((ThreadGroup) groups.get(i)).destroy(); ! groups = null; if (parent != null) parent.removeGroup(this); } ! ! /** ! * Print out information about this ThreadGroup to System.out. This is ! * meant for debugging purposes. WARNING: This method is not secure, ! * and can print the name of threads to standard out even when you cannot ! * otherwise get at such threads. ! */ public void list() { list(""); } ! /** ! * When a Thread in this ThreadGroup does not catch an exception, the ! * virtual machine calls this method. The default implementation simply ! * passes the call to the parent; then in top ThreadGroup, it will ! * ignore ThreadDeath and print the stack trace of any other throwable. ! * Override this method if you want to handle the exception in a different ! * manner. ! * ! * @param thread the thread that exited ! * @param exception the uncaught exception ! * @throws NullPointerException if t is null ! * @see ThreadDeath ! * @see System#err ! * @see Throwable#printStackTrace() ! */ public void uncaughtException(Thread thread, Throwable t) { if (parent != null) ! parent.uncaughtException(thread, t); else if (! (t instanceof ThreadDeath)) { ! if (t == null) ! throw new NullPointerException(); ! had_uncaught_exception = true; ! try ! { ! if (thread != null) ! System.err.print("Exception in thread \"" + thread.name + "\" "); ! t.printStackTrace(System.err); ! } ! catch (Throwable x) ! { ! // This means that something is badly screwed up with the runtime, ! // or perhaps someone overloaded the Throwable.printStackTrace to ! // die. In any case, try to deal with it gracefully. ! try ! { ! System.err.println(t); ! System.err.println("*** Got " + x ! + " while trying to print stack trace."); ! } ! catch (Throwable x2) ! { ! // Here, someone may have overloaded t.toString() or ! // x.toString() to die. Give up all hope; we can't even chain ! // the exception, because the chain would likewise die. ! System.err.println("*** Catastrophic failure while handling " ! + "uncaught exception."); ! throw new InternalError(); ! } ! } } } ! /** ! * Originally intended to tell the VM whether it may suspend Threads in ! * low memory situations, this method was never implemented by Sun, and ! * is hence a no-op. ! * ! * @param allow whether to allow low-memory thread suspension; ignored ! * @return false ! * @since 1.1 ! * @deprecated pointless, since suspend is deprecated ! */ public boolean allowThreadSuspension(boolean allow) { return false; } ! /** ! * Return a human-readable String representing this ThreadGroup. The format ! * of the string is:
        ! * getClass().getName() + "[name=" + getName() + ",maxpri=" ! * + getMaxPriority() + ']'. ! * ! * @return a human-readable String representing this ThreadGroup ! */ ! public String toString() { ! return getClass().getName() + "[name=" + name + ",maxpri=" + maxpri + ']'; } ! /** ! * Implements enumerate. ! * ! * @param list the array to put the threads into ! * @param next the next open slot in the array ! * @param recurse whether to recurse into descendent ThreadGroups ! * @return the number of threads put into the array ! * @throws SecurityException if permission was denied ! * @throws NullPointerException if list is null ! * @throws ArrayStoreException if a thread does not fit in the array ! * @see #enumerate(Thread[]) ! * @see #enumerate(Thread[], boolean) ! */ ! private int enumerate(Thread[] list, int next, boolean recurse) { ! checkAccess(); ! if (groups == null) ! return next; ! int i = threads.size(); ! while (--i >= 0 && next < list.length) ! { ! Thread t = (Thread) threads.get(i); ! if (t.isAlive()) ! list[next++] = t; ! } ! if (recurse) ! { ! i = groups.size(); ! while (--i >= 0 && next < list.length) ! { ! ThreadGroup g = (ThreadGroup) groups.get(i); ! next = g.enumerate(list, next, true); ! } ! } ! return next; } ! /** ! * Implements enumerate. ! * ! * @param list the array to put the groups into ! * @param next the next open slot in the array ! * @param recurse whether to recurse into descendent ThreadGroups ! * @return the number of groups put into the array ! * @throws SecurityException if permission was denied ! * @throws NullPointerException if list is null ! * @throws ArrayStoreException if a group does not fit in the array ! * @see #enumerate(ThreadGroup[]) ! * @see #enumerate(ThreadGroup[], boolean) ! */ ! private int enumerate(ThreadGroup[] list, int next, boolean recurse) ! { ! checkAccess(); ! if (groups == null) ! return next; ! int i = groups.size(); ! while (--i >= 0 && next < list.length) ! { ! ThreadGroup g = (ThreadGroup) groups.get(i); ! list[next++] = g; ! if (recurse && next != list.length) ! next = g.enumerate(list, next, true); ! } ! return next; ! } ! ! /** ! * Implements list. ! * ! * @param indentation the current level of indentation ! * @see #list() ! */ ! private void list(String indentation) ! { ! if (groups == null) ! return; ! System.out.print(indentation + this); ! indentation += " "; ! int i = threads.size(); ! while (--i >= 0) ! System.out.println(indentation + threads.get(i)); ! i = groups.size(); ! while (--i >= 0) ! ((ThreadGroup) groups.get(i)).list(indentation); ! } ! ! /** ! * Add a thread to the group. Called by Thread constructors. ! * ! * @param t the thread to add, non-null ! * @throws IllegalThreadStateException if the group is destroyed ! */ final synchronized void addThread(Thread t) { ! if (groups == null) ! throw new IllegalThreadStateException("ThreadGroup is destroyed"); ! threads.add(t); } ! /** ! * Called by the VM to remove a thread that has died. ! * ! * @param t the thread to remove, non-null ! * @XXX A ThreadListener to call this might be nice. ! */ final synchronized void removeThread(Thread t) { ! if (groups == null) ! return; ! threads.remove(t); // Daemon groups are automatically destroyed when all their threads die. if (daemon_flag && groups.size() == 0 && threads.size() == 0) { ! // We inline destroy to avoid the access check. ! groups = null; ! if (parent != null) ! parent.removeGroup(this); } } ! /** ! * Called when a group is destroyed, to remove it from its parent. ! * ! * @param g the destroyed group, non-null ! */ final synchronized void removeGroup(ThreadGroup g) { ! groups.remove(g); // Daemon groups are automatically destroyed when all their threads die. if (daemon_flag && groups.size() == 0 && threads.size() == 0) { ! // We inline destroy to avoid the access check. ! groups = null; ! if (parent != null) ! parent.removeGroup(this); } } ! } // class ThreadGroup diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Thread.java gcc-3.3/libjava/java/lang/Thread.java *** gcc-3.2.3/libjava/java/lang/Thread.java 2002-01-04 20:38:20.000000000 +0000 --- gcc-3.3/libjava/java/lang/Thread.java 2002-10-07 21:02:38.000000000 +0000 *************** details. */ *** 10,15 **** --- 10,17 ---- package java.lang; + import gnu.gcj.RawData; + /** * @author Tom Tromey * @date August 24, 1998 *************** public class Thread implements Runnable *** 135,141 **** public final void setDaemon (boolean status) { checkAccess (); ! if (isAlive ()) throw new IllegalThreadStateException (); daemon_flag = status; } --- 137,143 ---- public final void setDaemon (boolean status) { checkAccess (); ! if (!startable_flag) throw new IllegalThreadStateException (); daemon_flag = status; } *************** public class Thread implements Runnable *** 301,308 **** public static native void yield (); // Private data. ! private ThreadGroup group; ! private String name; private Runnable runnable; private int priority; private boolean daemon_flag; --- 303,310 ---- public static native void yield (); // Private data. ! ThreadGroup group; ! String name; private Runnable runnable; private int priority; private boolean daemon_flag; *************** public class Thread implements Runnable *** 311,316 **** --- 313,321 ---- private boolean startable_flag; private ClassLoader context_class_loader; + // This describes the top-most interpreter frame for this thread. + RawData interp_frame; + // Our native data - points to an instance of struct natThread. private Object data; } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/ThreadLocal.java gcc-3.3/libjava/java/lang/ThreadLocal.java *** gcc-3.2.3/libjava/java/lang/ThreadLocal.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/ThreadLocal.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.ThreadLocal ! Copyright (C) 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ThreadLocal -- a variable with a unique value per thread ! Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** import java.util.WeakHashMap; *** 46,176 **** * (through the get() and set() methods) * only affects the state of the object as seen by the currently * executing Thread. ! *

        ! * The first time a ThreadLocal object is accessed on a particular ! * Thread (and no state is associated with that Thread yet) ! * the state for that Thread is set by executing the method ! * initialValue(). ! *

        ! * An example how you can use this: *

        !  * class Connection {
        !  *     private static ThreadLocal owner = new ThreadLocal() {
        !  *        public Object initialValue() {
        !  *            return("nobody");
        !  *        }
           *     };
           * ...
           * }
        !  * 
        * Now all instances of connection can see who the owner of the currently * executing Thread is by calling owner.get(). By default any * Thread would be associated with 'nobody'. But the Connection object could * offer a method that changes the owner associated with the Thread on * which the method was called by calling owner.put("somebody"). * (Such an owner changing method should then be guarded by security checks.) ! *

        ! * When a Thread is garbage collected all references to values of * the ThreadLocal objects associated with that Thread are removed. * * @since 1.2 ! * @author Mark Wielaard (mark@klomp.org) */ ! public class ThreadLocal { ! ! /** ! * Trivial container to wrap the stored values. ! * Needed to see if the value is null or not yet set. ! * If it is not yet set we must call intialValue() once. ! * Package local so InheritableThreadLocal can see it. ! */ ! final static class Value { ! final Object value; ! ! Value(Object value) { ! this.value = value; ! } ! ! Object getValue() { ! return value; ! } ! } ! ! /** ! * Maps Threads to Values. Uses a WeakHashMap so if a Thread is garbage ! * collected the reference to the Value will disappear. Only the ! * set(Thread, Value) and get(Thread) methods ! * access it. Since this can happen from multiple Threads simultaniously ! * those methods are synchronized. ! */ ! private final Map valueMap = new WeakHashMap(); ! ! /** ! * Creates a ThreadLocal object without associating any value to it ! * yet. ! */ ! public ThreadLocal() { ! } ! ! /** ! * Gets the value associated with the ThreadLocal object for the ! * currently executing Thread. If there is no value is associated ! * with this Thread yet then the valued returned by the ! * initialValue() method is assosiated with this Thread ! * and returned. ! */ ! public Object get() { ! Thread currentThread = Thread.currentThread(); ! Value v = get(currentThread); ! if (v == null) { ! v = new Value(initialValue()); ! set(currentThread, v); ! } ! return v.getValue(); ! } ! ! /** ! * Gets the Value of this ThreadLocal for a particular Thread. ! * It is synchronized so the set(Thread, Value) method cannot ! * simultaniously modify the valueMap from another thread. ! * Package local so InheritableThreadLocal can access it when a new child ! * Thread inherits values from its parent Thread. ! */ ! synchronized final Value get(Thread thread) { ! return (Value)valueMap.get(thread); ! } ! ! /** ! * Sets the value associated with the ThreadLocal object for the ! * currently executing Thread. This overrides any existing value ! * associated with the current Thread and does not call the ! * initialValue() method, even if this is the first ! * time this Thread accesses this ThreadLocal. ! */ ! public void set(Object value) { ! Thread currentThread = Thread.currentThread(); ! Value v = new Value(value); ! set(currentThread, v); ! } ! /** ! * Sets the Value for this ThreadLocal for a particular Thread. ! * It is synchronized so the get(Thread) method cannot ! * simultaniously read the valueMap from another thread. ! * Package local so InheritableThreadLocal can access it when a new child ! * Thread inherits values from its parent Thread. ! */ ! synchronized final void set(Thread thread, Value value) { ! valueMap.put(thread, value); ! } ! /** ! * Called when get() is called and no state is associated ! * with the currently executing Thread yet. ! *

        ! * The default implementation returns null. ! */ ! protected Object initialValue() { ! return null; ! } } --- 46,162 ---- * (through the get() and set() methods) * only affects the state of the object as seen by the currently * executing Thread. ! * ! *

        The first time a ThreadLocal object is accessed on a particular ! * Thread, the state for that Thread's copy of the local variable is set by ! * executing the method initialValue(). ! * ! *

        An example how you can use this: *

        !  * class Connection
        !  * {
        !  *   private static ThreadLocal owner = new ThreadLocal()
        !  *     {
        !  *       public Object initialValue()
        !  *       {
        !  *         return("nobody");
        !  *       }
           *     };
           * ...
           * }
        !  * 

        ! * * Now all instances of connection can see who the owner of the currently * executing Thread is by calling owner.get(). By default any * Thread would be associated with 'nobody'. But the Connection object could * offer a method that changes the owner associated with the Thread on * which the method was called by calling owner.put("somebody"). * (Such an owner changing method should then be guarded by security checks.) ! * ! *

        When a Thread is garbage collected all references to values of * the ThreadLocal objects associated with that Thread are removed. * + * @author Mark Wielaard + * @author Eric Blake * @since 1.2 ! * @status updated to 1.4 */ ! public class ThreadLocal ! { ! /** ! * Placeholder to distinguish between uninitialized and null set by the ! * user. Do not expose this to the public. Package visible for use by ! * InheritableThreadLocal ! */ ! static final Object NULL = new Object(); ! ! /** ! * The stored value. Package visible for use by InheritableThreadLocal. */ ! Object value; ! /** ! * Maps Threads to values. Uses a WeakHashMap so if a Thread is garbage ! * collected the reference to the Value will disappear. A null value means ! * uninitialized, while NULL means a user-specified null. Only the ! * set(Thread, Object) and get(Thread) methods ! * access it. Package visible for use by InheritableThreadLocal. ! */ ! final Map valueMap = new WeakHashMap(); ! /** ! * Creates a ThreadLocal object without associating any value to it yet. ! */ ! public ThreadLocal() ! { ! } ! ! /** ! * Called once per thread on the first invocation of get(), if set() was ! * not already called. The default implementation returns null. ! * Often, this method is overridden to create the appropriate initial object ! * for the current thread's view of the ThreadLocal. ! * ! * @return the initial value of the variable in this thread ! */ ! protected Object initialValue() ! { ! return null; ! } ! ! /** ! * Gets the value associated with the ThreadLocal object for the currently ! * executing Thread. If this is the first time the current thread has called ! * get(), and it has not already called set(), the value is obtained by ! * initialValue(). ! * ! * @return the value of the variable in this thread ! */ ! public Object get() ! { ! Thread currentThread = Thread.currentThread(); ! // Note that we don't have to synchronize, as only this thread will ! // ever modify the returned value. ! Object value = valueMap.get(currentThread); ! if (value == null) ! { ! value = initialValue(); ! valueMap.put(currentThread, value == null ? NULL : value); ! } ! return value == NULL ? null : value; ! } ! ! /** ! * Sets the value associated with the ThreadLocal object for the currently ! * executing Thread. This overrides any existing value associated with the ! * current Thread and prevents initialValue() from being ! * called if this is the first access to this ThreadLocal in this Thread. ! * ! * @param value the value to set this thread's view of the variable to ! */ ! public void set(Object value) ! { ! // Note that we don't have to synchronize, as only this thread will ! // ever modify the returned value. ! valueMap.put(Thread.currentThread(), value == null ? NULL : value); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Throwable.java gcc-3.3/libjava/java/lang/Throwable.java *** gcc-3.2.3/libjava/java/lang/Throwable.java 2001-02-24 03:52:49.000000000 +0000 --- gcc-3.3/libjava/java/lang/Throwable.java 2002-10-04 16:47:36.000000000 +0000 *************** *** 1,171 **** ! // Throwable.java - Superclass for all exceptions. ! /* Copyright (C) 1998, 1999 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package java.lang; ! import java.io.PrintStream; ! import java.io.PrintWriter; import java.io.Serializable; ! import java.io.OutputStreamWriter; ! import java.io.OutputStream; ! import java.io.FilterOutputStream; import java.io.IOException; /** ! * @author Tom Tromey ! * @date October 30, 1998 */ ! /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 ! * "The Java Language Specification", ISBN 0-201-63451-1 ! * Status: Sufficient for compiled code, but methods applicable to ! * bytecode not implemented. JDK 1.1. ! */ ! /* A CPlusPlusDemangler sits on top of a PrintWriter. All input is ! * passed through the "c++filt" program (part of GNU binutils) which ! * demangles internal symbols to their C++ source form. ! * ! * Closing a CPlusPlusDemangler doesn't close the underlying ! * PrintWriter; it does, however close underlying process and flush ! * all its buffers, so it's possible to guarantee that after a ! * CPlusPlusDemangler has been closed no more will ever be written to ! * the underlying PrintWriter. ! * ! * FIXME: This implictly converts data from the input stream, which is ! * a stream of characters, to a stream of bytes. We need a way of ! * handling Unicode characters in demangled identifiers. */ ! class CPlusPlusDemangler extends OutputStream ! { ! java.io.OutputStream procOut; ! java.io.InputStream procIn; ! java.lang.Process proc; ! PrintWriter p; ! /* The number of bytes written to the underlying PrintWriter. This ! provides a crude but fairly portable way to determine whether or ! not the attempt to exec c++filt worked. */ ! public int written = 0; ! CPlusPlusDemangler (PrintWriter writer) throws IOException { ! p = writer; ! proc = Runtime.getRuntime ().exec ("c++filt -s java"); ! procOut = proc.getOutputStream (); ! procIn = proc.getInputStream (); } ! public void write (int b) throws IOException { ! procOut.write (b); ! while (procIn.available () != 0) ! { ! int c = procIn.read (); ! if (c == -1) ! break; ! else ! { ! p.write (c); ! written++; ! } ! } } ! ! public void close () throws IOException { ! procOut.close (); ! int c; ! while ((c = procIn.read ()) != -1) ! { ! p.write (c); ! written++; ! } ! p.flush (); ! try ! { ! proc.waitFor (); ! } ! catch (InterruptedException _) ! { ! } ! } ! } ! public class Throwable implements Serializable ! { ! public native Throwable fillInStackTrace (); ! public String getLocalizedMessage () { ! return getMessage (); } ! public String getMessage () { ! return detailMessage; } ! public void printStackTrace () { ! printStackTrace (System.err); } ! public void printStackTrace (PrintStream ps) { ! PrintWriter writer = new PrintWriter (ps); ! printStackTrace (writer); } ! public void printStackTrace (PrintWriter wr) { ! try { ! CPlusPlusDemangler cPlusPlusFilter = new CPlusPlusDemangler (wr); ! PrintWriter writer = new PrintWriter (cPlusPlusFilter); ! printRawStackTrace (writer); ! writer.close (); ! if (cPlusPlusFilter.written == 0) // The demangler has failed... ! printRawStackTrace (wr); } ! catch (Exception e1) { ! printRawStackTrace (wr); } } ! public Throwable () { ! detailMessage = null; ! fillInStackTrace (); } ! public Throwable (String message) { ! detailMessage = message; ! fillInStackTrace (); } ! public String toString () { ! return ((detailMessage == null) ! ? getClass().getName() ! : getClass().getName() + ": " + getMessage ()); ! } ! private native final void printRawStackTrace (PrintWriter wr); ! ! // Name of this field comes from serialization spec. ! private String detailMessage; ! // Setting this flag to false prevents fillInStackTrace() from running. ! static boolean trace_enabled = true; ! private transient byte stackTrace[]; ! private static final long serialVersionUID = -3042686055658047285L; } --- 1,557 ---- ! /* java.lang.Throwable -- Root class for all Exceptions and Errors ! Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.lang; ! import java.io.Serializable; ! import java.io.PrintWriter; ! import java.io.PrintStream; ! import java.io.ObjectOutputStream; ! import java.io.ObjectInputStream; import java.io.IOException; + import java.io.OutputStream; /** ! * Throwable is the superclass of all exceptions that can be raised. ! * ! *

        There are two special cases: {@link Error} and {@link RuntimeException}: ! * these two classes (and their subclasses) are considered unchecked ! * exceptions, and are either frequent enough or catastrophic enough that you ! * do not need to declare them in throws clauses. Everything ! * else is a checked exception, and is ususally a subclass of ! * {@link Exception}; these exceptions have to be handled or declared. ! * ! *

        Instances of this class are usually created with knowledge of the ! * execution context, so that you can get a stack trace of the problem spot ! * in the code. Also, since JDK 1.4, Throwables participate in "exception ! * chaining." This means that one exception can be caused by another, and ! * preserve the information of the original. ! * ! *

        One reason this is useful is to wrap exceptions to conform to an ! * interface. For example, it would be bad design to require all levels ! * of a program interface to be aware of the low-level exceptions thrown ! * at one level of abstraction. Another example is wrapping a checked ! * exception in an unchecked one, to communicate that failure occured ! * while still obeying the method throws clause of a superclass. ! * ! *

        A cause is assigned in one of two ways; but can only be assigned once ! * in the lifetime of the Throwable. There are new constructors added to ! * several classes in the exception hierarchy that directly initialize the ! * cause, or you can use the initCause method. This second ! * method is especially useful if the superclass has not been retrofitted ! * with new constructors:
        ! *

        !  * try
        !  *   {
        !  *     lowLevelOp();
        !  *   }
        !  * catch (LowLevelException lle)
        !  *   {
        !  *     throw (HighLevelException) new HighLevelException().initCause(lle);
        !  *   }
        !  * 
        ! * Notice the cast in the above example; without it, your method would need ! * a throws clase that declared Throwable, defeating the purpose of chainig ! * your exceptions. ! * ! *

        By convention, exception classes have two constructors: one with no ! * arguments, and one that takes a String for a detail message. Further, ! * classes which are likely to be used in an exception chain also provide ! * a constructor that takes a Throwable, with or without a detail message ! * string. ! * ! *

        Another 1.4 feature is the StackTrace, a means of reflection that ! * allows the program to inspect the context of the exception, and which is ! * serialized, so that remote procedure calls can correctly pass exceptions. ! * ! * @author Brian Jones ! * @author John Keiser ! * @author Mark Wielaard ! * @author Tom Tromey ! * @author Eric Blake ! * @since 1.0 ! * @status updated to 1.4 */ + public class Throwable implements Serializable + { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -3042686055658047285L; ! /** ! * The detail message. ! * ! * @serial specific details about the exception, may be null ! */ ! private final String detailMessage; ! /** ! * The cause of the throwable, including null for an unknown or non-chained ! * cause. This may only be set once; so the field is set to ! * this until initialized. ! * ! * @serial the cause, or null if unknown, or this if not yet set ! * @since 1.4 ! */ ! private Throwable cause = this; ! /** ! * The stack trace, in a serialized form. ! * ! * @serial the elements of the stack trace; this is non-null, and has ! * no null entries ! * @since 1.4 ! */ ! private StackTraceElement[] stackTrace; ! /** ! * Instantiate this Throwable with an empty message. The cause remains ! * uninitialized. {@link #fillInStackTrace()} will be called to set ! * up the stack trace. ! */ ! public Throwable() ! { ! this((String) null); ! } ! /** ! * Instantiate this Throwable with the given message. The cause remains ! * uninitialized. {@link #fillInStackTrace()} will be called to set ! * up the stack trace. ! * ! * @param message the message to associate with the Throwable ! */ ! public Throwable(String message) { ! fillInStackTrace(); ! detailMessage = message; } ! /** ! * Instantiate this Throwable with the given message and cause. Note that ! * the message is unrelated to the message of the cause. ! * {@link #fillInStackTrace()} will be called to set up the stack trace. ! * ! * @param message the message to associate with the Throwable ! * @param cause the cause, may be null ! * @since 1.4 ! */ ! public Throwable(String message, Throwable cause) { ! this(message); ! initCause(cause); } ! ! /** ! * Instantiate this Throwable with the given cause. The message is then ! * built as cause == null ? null : cause.toString(). ! * {@link #fillInStackTrace()} will be called to set up the stack trace. ! * ! * @param cause the cause, may be null ! * @since 1.4 ! */ ! public Throwable(Throwable cause) { ! this(cause == null ? null : cause.toString(), cause); ! } ! /** ! * Get the message associated with this Throwable. ! * ! * @return the error message associated with this Throwable, may be null ! */ ! public String getMessage() ! { ! return detailMessage; ! } ! /** ! * Get a localized version of this Throwable's error message. ! * This method must be overridden in a subclass of Throwable ! * to actually produce locale-specific methods. The Throwable ! * implementation just returns getMessage(). ! * ! * @return a localized version of this error message ! * @see #getMessage() ! * @since 1.1 ! */ ! public String getLocalizedMessage() { ! return getMessage(); } ! /** ! * Returns the cause of this exception, or null if the cause is not known ! * or non-existant. This cause is initialized by the new constructors, ! * or by calling initCause. ! * ! * @return the cause of this Throwable ! * @since 1.4 ! */ ! public Throwable getCause() { ! return cause == this ? null : cause; } ! /** ! * Initialize the cause of this Throwable. This may only be called once ! * during the object lifetime, including implicitly by chaining ! * constructors. ! * ! * @param cause the cause of this Throwable, may be null ! * @return this ! * @throws IllegalArgumentException if cause is this (a Throwable can't be ! * its own cause!) ! * @throws IllegalStateException if the cause has already been set ! * @since 1.4 ! */ ! public Throwable initCause(Throwable cause) { ! if (cause == this) ! throw new IllegalArgumentException(); ! if (this.cause != this) ! throw new IllegalStateException(); ! this.cause = cause; ! return this; } ! /** ! * Get a human-readable representation of this Throwable. The detail message ! * is retrieved by getLocalizedMessage(). Then, with a null detail ! * message, this string is simply the object's class name; otherwise ! * the string is getClass().getName() + ": " + message. ! * ! * @return a human-readable String represting this Throwable ! */ ! public String toString() { ! String msg = getLocalizedMessage(); ! return getClass().getName() + (msg == null ? "" : ": " + msg); } ! /** ! * Print a stack trace to the standard error stream. This stream is the ! * current contents of System.err. The first line of output ! * is the result of {@link #toString()}, and the remaining lines represent ! * the data created by {@link #fillInStackTrace()}. While the format is ! * unspecified, this implementation uses the suggested format, demonstrated ! * by this example:
        ! *

        !    * public class Junk
        !    * {
        !    *   public static void main(String args[])
        !    *   {
        !    *     try
        !    *       {
        !    *         a();
        !    *       }
        !    *     catch(HighLevelException e)
        !    *       {
        !    *         e.printStackTrace();
        !    *       }
        !    *   }
        !    *   static void a() throws HighLevelException
        !    *   {
        !    *     try
        !    *       {
        !    *         b();
        !    *       }
        !    *     catch(MidLevelException e)
        !    *       {
        !    *         throw new HighLevelException(e);
        !    *       }
        !    *   }
        !    *   static void b() throws MidLevelException
        !    *   {
        !    *     c();
        !    *   }
        !    *   static void c() throws MidLevelException
        !    *   {
        !    *     try
        !    *       {
        !    *         d();
        !    *       }
        !    *     catch(LowLevelException e)
        !    *       {
        !    *         throw new MidLevelException(e);
        !    *       }
        !    *   }
        !    *   static void d() throws LowLevelException
        !    *   {
        !    *     e();
        !    *   }
        !    *   static void e() throws LowLevelException
        !    *   {
        !    *     throw new LowLevelException();
        !    *   }
        !    * }
        !    * class HighLevelException extends Exception
        !    * {
        !    *   HighLevelException(Throwable cause) { super(cause); }
        !    * }
        !    * class MidLevelException extends Exception
        !    * {
        !    *   MidLevelException(Throwable cause)  { super(cause); }
        !    * }
        !    * class LowLevelException extends Exception
        !    * {
        !    * }
        !    * 
        ! *

        ! *

        !    *  HighLevelException: MidLevelException: LowLevelException
        !    *          at Junk.a(Junk.java:13)
        !    *          at Junk.main(Junk.java:4)
        !    *  Caused by: MidLevelException: LowLevelException
        !    *          at Junk.c(Junk.java:23)
        !    *          at Junk.b(Junk.java:17)
        !    *          at Junk.a(Junk.java:11)
        !    *          ... 1 more
        !    *  Caused by: LowLevelException
        !    *          at Junk.e(Junk.java:30)
        !    *          at Junk.d(Junk.java:27)
        !    *          at Junk.c(Junk.java:21)
        !    *          ... 3 more
        !    * 
        ! */ ! public void printStackTrace() { ! printStackTrace(System.err); ! } ! ! /** ! * Print a stack trace to the specified PrintStream. See ! * {@link #printStackTrace()} for the sample format. ! * ! * @param s the PrintStream to write the trace to ! */ ! public void printStackTrace(PrintStream s) ! { ! s.print(stackTraceString()); ! } ! ! /** ! * Prints the exception, the detailed message and the stack trace ! * associated with this Throwable to the given PrintWriter. ! * The actual output written is implemention specific. Use the result of ! * getStackTrace() when more precise information is needed. ! * ! *

        This implementation first prints a line with the result of this ! * object's toString() method. ! *
        ! * Then for all elements given by getStackTrace it prints ! * a line containing three spaces, the string "at " and the result of calling ! * the toString() method on the StackTraceElement ! * object. If getStackTrace() returns an empty array it prints ! * a line containing three spaces and the string ! * "<<No stacktrace available>>". ! *
        ! * Then if getCause() doesn't return null it adds a line ! * starting with "Caused by: " and the result of calling ! * toString() on the cause. ! *
        ! * Then for every cause (of a cause, etc) the stacktrace is printed the ! * same as for the top level Throwable except that as soon ! * as all the remaining stack frames of the cause are the same as the ! * the last stack frames of the throwable that the cause is wrapped in ! * then a line starting with three spaces and the string "... X more" is ! * printed, where X is the number of remaining stackframes. ! * ! * @param w the PrintWriter to write the trace to ! * @since 1.1 ! */ ! public void printStackTrace (PrintWriter pw) ! { ! pw.print(stackTraceString()); ! } ! ! private static final String nl = System.getProperty("line.separator"); ! // Create whole stack trace in a stringbuffer so we don't have to print ! // it line by line. This prevents printing multiple stack traces from ! // different threads to get mixed up when written to the same PrintWriter. ! private String stackTraceString() ! { ! StringBuffer sb = new StringBuffer(); ! ! // Main stacktrace ! StackTraceElement[] stack = getStackTrace(); ! stackTraceStringBuffer(sb, this.toString(), stack, 0); ! ! // The cause(s) ! Throwable cause = getCause(); ! while (cause != null) { ! // Cause start first line ! sb.append("Caused by: "); ! ! // Cause stacktrace ! StackTraceElement[] parentStack = stack; ! stack = cause.getStackTrace(); ! if (parentStack == null || parentStack.length == 0) ! stackTraceStringBuffer(sb, cause.toString(), stack, 0); ! else ! { ! int equal = 0; // Count how many of the last stack frames are equal ! int frame = stack.length-1; ! int parentFrame = parentStack.length-1; ! while (frame > 0 && parentFrame > 0) ! { ! if (stack[frame].equals(parentStack[parentFrame])) ! { ! equal++; ! frame--; ! parentFrame--; ! } ! else ! break; ! } ! stackTraceStringBuffer(sb, cause.toString(), stack, equal); ! } ! cause = cause.getCause(); } ! ! return sb.toString(); ! } ! ! // Adds to the given StringBuffer a line containing the name and ! // all stacktrace elements minus the last equal ones. ! private static void stackTraceStringBuffer(StringBuffer sb, String name, ! StackTraceElement[] stack, int equal) ! { ! // (finish) first line ! sb.append(name); ! sb.append(nl); ! ! // The stacktrace ! if (stack == null || stack.length == 0) { ! sb.append(" <>"); ! sb.append(nl); ! } ! else ! { ! for (int i = 0; i < stack.length-equal; i++) ! { ! sb.append(" at "); ! sb.append(stack[i] == null ? "<>" : stack[i].toString()); ! sb.append(nl); ! } ! if (equal > 0) ! { ! sb.append(" ..."); ! sb.append(equal); ! sb.append(" more"); ! sb.append(nl); ! } } } ! /** ! * Fill in the stack trace with the current execution stack. ! * ! * @return this same throwable ! * @see #printStackTrace() ! */ ! public Throwable fillInStackTrace() { ! vmState = VMThrowable.fillInStackTrace(this); ! stackTrace = null; // Should be regenerated when used. ! ! return this; } ! /** ! * Provides access to the information printed in {@link #printStackTrace()}. ! * The array is non-null, with no null entries, although the virtual ! * machine is allowed to skip stack frames. If the array is not 0-length, ! * then slot 0 holds the information on the stack frame where the Throwable ! * was created (or at least where fillInStackTrace() was ! * called). ! * ! * @return an array of stack trace information, as available from the VM ! * @since 1.4 ! */ ! public StackTraceElement[] getStackTrace() { ! if (stackTrace == null) ! if (vmState == null) ! stackTrace = new StackTraceElement[0]; ! else ! { ! stackTrace = vmState.getStackTrace(this); ! vmState = null; // No longer needed ! } ! ! return stackTrace; } ! /** ! * Change the stack trace manually. This method is designed for remote ! * procedure calls, which intend to alter the stack trace before or after ! * serialization according to the context of the remote call. ! *

        ! * The contents of the given stacktrace is copied so changes to the ! * original array do not change the stack trace elements of this ! * throwable. ! * ! * @param stackTrace the new trace to use ! * @throws NullPointerException if stackTrace is null or has null elements ! * @since 1.4 ! */ ! public void setStackTrace(StackTraceElement[] stackTrace) { ! int i = stackTrace.length; ! StackTraceElement[] st = new StackTraceElement[i]; ! while (--i >= 0) ! { ! st[i] = stackTrace[i]; ! if (st[i] == null) ! throw new NullPointerException("Element " + i + " null"); ! } ! this.stackTrace = st; ! } ! ! /** ! * VM state when fillInStackTrace was called. ! * Used by getStackTrace() to get an array of StackTraceElements. ! * Cleared when no longer needed. ! */ ! private transient VMThrowable vmState; } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/UnknownError.java gcc-3.3/libjava/java/lang/UnknownError.java *** gcc-3.2.3/libjava/java/lang/UnknownError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/UnknownError.java 2002-06-15 19:45:31.000000000 +0000 *************** *** 1,5 **** ! /* UnknownError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* UnknownError.java -- thrown when the VM cannot provide more information ! about a catastrophic error ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,74 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * An UnknownError is thrown when a serious but unknown * problem has occurred in the Java Virtual Machine. * - * @since JDK 1.0 - * * @author Brian Jones */ public class UnknownError extends VirtualMachineError { ! static final long serialVersionUID = 2524784860676771849L; /** * Create an error without a message. */ public UnknownError() ! { ! super(); ! } /** * Create an error with a message. */ public UnknownError(String s) ! { ! super(s); ! } } --- 39,72 ---- package java.lang; /** ! * An UnknownError is thrown when a serious but unknown * problem has occurred in the Java Virtual Machine. * * @author Brian Jones + * @status updated to 1.4 */ public class UnknownError extends VirtualMachineError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 2524784860676771849L; /** * Create an error without a message. */ public UnknownError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public UnknownError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/UnsatisfiedLinkError.java gcc-3.3/libjava/java/lang/UnsatisfiedLinkError.java *** gcc-3.2.3/libjava/java/lang/UnsatisfiedLinkError.java 2002-01-22 22:40:16.000000000 +0000 --- gcc-3.3/libjava/java/lang/UnsatisfiedLinkError.java 2002-06-15 19:45:32.000000000 +0000 *************** *** 1,5 **** ! /* UnsatisfiedLinkError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnsatisfiedLinkError.java -- thrown when a native method cannot be loaded ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,77 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * A UnsatisfiedLinkError is thrown if an appropriate * native language definition of a method declared native * cannot be found by the Java Virtual Machine. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class UnsatisfiedLinkError extends LinkageError { ! static final long serialVersionUID = -4019343241616879428L; /** * Create an error without a message. */ public UnsatisfiedLinkError() ! { ! super(); ! } /** * Create an error with a message. */ public UnsatisfiedLinkError(String s) ! { ! super(s); ! } } --- 38,74 ---- package java.lang; /** * A UnsatisfiedLinkError is thrown if an appropriate * native language definition of a method declared native * cannot be found by the Java Virtual Machine. * * @author Brian Jones * @author Tom Tromey ! * @see Runtime ! * @status updated to 1.4 */ public class UnsatisfiedLinkError extends LinkageError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4019343241616879428L; /** * Create an error without a message. */ public UnsatisfiedLinkError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public UnsatisfiedLinkError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/UnsupportedClassVersionError.java gcc-3.3/libjava/java/lang/UnsupportedClassVersionError.java *** gcc-3.2.3/libjava/java/lang/UnsupportedClassVersionError.java 2002-01-22 22:40:17.000000000 +0000 --- gcc-3.3/libjava/java/lang/UnsupportedClassVersionError.java 2002-06-15 19:45:32.000000000 +0000 *************** *** 1,5 **** ! /* UnsupportedClassVersionError.java ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* UnsupportedClassVersionError.java -- thrown when a class file version ! exceeds the capability of the virtual machine ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.lang; *** 43,69 **** * Java Virtual Machine determines it does not support the major and minor * version numbers in the class file it is attempting to read. * - * @since JDK 1.2 - * * @author Brian Jones */ public class UnsupportedClassVersionError extends ClassFormatError { ! static final long serialVersionUID = -7123279212883497373L; /** * Create an error without a message. */ public UnsupportedClassVersionError() ! { ! super(); ! } /** * Create an error with a message. */ public UnsupportedClassVersionError(String s) ! { ! super(s); ! } } --- 44,74 ---- * Java Virtual Machine determines it does not support the major and minor * version numbers in the class file it is attempting to read. * * @author Brian Jones + * @since 1.2 + * @status updated to 1.4 */ public class UnsupportedClassVersionError extends ClassFormatError { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -7123279212883497373L; /** * Create an error without a message. */ public UnsupportedClassVersionError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public UnsupportedClassVersionError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/UnsupportedOperationException.java gcc-3.3/libjava/java/lang/UnsupportedOperationException.java *** gcc-3.2.3/libjava/java/lang/UnsupportedOperationException.java 2002-01-22 22:40:17.000000000 +0000 --- gcc-3.3/libjava/java/lang/UnsupportedOperationException.java 2002-06-15 19:45:32.000000000 +0000 *************** *** 1,6 **** ! /* UnsupportedOperationException.java -- Exception thrown when an ! unsupported operation is attempted on an object ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* UnsupportedOperationException.java -- thrown when an operation is not ! supported ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 8,14 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 8,14 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,75 **** package java.lang; ! /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 ! * "The Java Language Specification", ISBN 0-201-63451-1 ! * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. ! * Status: Believed complete and correct. ! */ ! ! /** * This exception is thrown by an object when an operation is * requested of it that it does not support. * - * @since JDK 1.2 - * * @author Warren Levy ! * @date September 18, 1998. */ public class UnsupportedOperationException extends RuntimeException { ! static final long serialVersionUID = -1242599979055084673L; /** * Create an exception without a message. */ ! public UnsupportedOperationException() { - super(); } /** * Create an exception with a message. */ ! public UnsupportedOperationException( String s ) { super(s); } --- 39,72 ---- package java.lang; ! /** * This exception is thrown by an object when an operation is * requested of it that it does not support. * * @author Warren Levy ! * @since 1.2 ! * @status updated to 1.4 */ public class UnsupportedOperationException extends RuntimeException { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -1242599979055084673L; /** * Create an exception without a message. */ ! public UnsupportedOperationException() { } /** * Create an exception with a message. + * + * @param s the message */ ! public UnsupportedOperationException(String s) { super(s); } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/VerifyError.java gcc-3.3/libjava/java/lang/VerifyError.java *** gcc-3.2.3/libjava/java/lang/VerifyError.java 2002-01-22 22:40:17.000000000 +0000 --- gcc-3.3/libjava/java/lang/VerifyError.java 2002-06-15 19:45:32.000000000 +0000 *************** *** 1,5 **** ! /* VerifyError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* VerifyError.java -- thrown when a class fails verification ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,76 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * A VerifyError is thrown if there is a security problem or ! * internal inconsistency in a class file as deteced by the "verifier." * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public class VerifyError extends LinkageError { ! static final long serialVersionUID = 7001962396098498785L; /** * Create an error without a message. */ public VerifyError() ! { ! super(); ! } /** * Create an error with a message. */ public VerifyError(String s) ! { ! super(s); ! } } --- 38,72 ---- package java.lang; /** * A VerifyError is thrown if there is a security problem or ! * internal inconsistency in a class file as detected by the "verifier." * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public class VerifyError extends LinkageError { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 7001962396098498785L; /** * Create an error without a message. */ public VerifyError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public VerifyError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/VirtualMachineError.java gcc-3.3/libjava/java/lang/VirtualMachineError.java *** gcc-3.2.3/libjava/java/lang/VirtualMachineError.java 2002-01-22 22:40:17.000000000 +0000 --- gcc-3.3/libjava/java/lang/VirtualMachineError.java 2002-06-15 19:45:32.000000000 +0000 *************** *** 1,5 **** ! /* VirtualMachineError.java ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* VirtualMachineError.java -- thrown when the Virtual Machine has a problem ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,77 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** ! * A VirtualMachineError or its subclasses are thrown to * indicate there is something wrong with the Java Virtual Machine or that * it does not have the resources needed for it to continue execution. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey ! * @date October 1, 1998 */ public abstract class VirtualMachineError extends Error { ! static final long serialVersionUID = 4161983926571568670L; /** * Create an error without a message. */ public VirtualMachineError() ! { ! super(); ! } /** * Create an error with a message. */ public VirtualMachineError(String s) ! { ! super(s); ! } } --- 38,73 ---- package java.lang; /** ! * A VirtualMachineError or its subclasses are thrown to * indicate there is something wrong with the Java Virtual Machine or that * it does not have the resources needed for it to continue execution. * * @author Brian Jones * @author Tom Tromey ! * @status updated to 1.4 */ public abstract class VirtualMachineError extends Error { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 4161983926571568670L; /** * Create an error without a message. */ public VirtualMachineError() ! { ! } /** * Create an error with a message. + * + * @param s the message */ public VirtualMachineError(String s) ! { ! super(s); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/VMClassLoader.java gcc-3.3/libjava/java/lang/VMClassLoader.java *** gcc-3.2.3/libjava/java/lang/VMClassLoader.java 2001-10-26 01:51:04.000000000 +0000 --- gcc-3.3/libjava/java/lang/VMClassLoader.java 2002-09-30 05:19:09.000000000 +0000 *************** *** 1,6 **** /* * java.lang.ClassLoader: part of the Java Class Libraries project. ! * Copyright (C) 1998, 2001 Free Software Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public --- 1,6 ---- /* * java.lang.ClassLoader: part of the Java Class Libraries project. ! * Copyright (C) 1998, 2001, 2002 Free Software Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public *************** *** 20,25 **** --- 20,27 ---- package java.lang; + import java.util.*; + /** * java.lang.VMClassLoader is a package-private helper for VMs to implement * on behalf of java.lang.ClassLoader. *************** class VMClassLoader { *** 41,50 **** * @return the class that was defined. * @exception ClassFormatError if the byte array is not in proper classfile format. */ ! // Not yet needed for libgcj. ! // final static native Class defineClass(ClassLoader cl, String name, ! // byte[] data, int offset, int len) throws ClassFormatError; ! /** * Helper to resolve all references to other classes from this class. * @param c the class to resolve. --- 43,52 ---- * @return the class that was defined. * @exception ClassFormatError if the byte array is not in proper classfile format. */ ! final static native Class defineClass(ClassLoader cl, String name, ! byte[] data, int offset, int len) ! throws ClassFormatError; ! /** * Helper to resolve all references to other classes from this class. * @param c the class to resolve. *************** class VMClassLoader { *** 59,62 **** --- 61,107 ---- * @param type code for the primitive type. */ static native Class getPrimitiveClass(char type); + + /** + * The system default for assertion status. This is used for all system + * classes (those with a null ClassLoader), as well as the initial value for + * every ClassLoader's default assertion status. + * + * XXX - Not implemented yet; this requires native help. + * + * @return the system-wide default assertion status + */ + static final boolean defaultAssertionStatus() + { + return true; + } + + /** + * The system default for package assertion status. This is used for all + * ClassLoader's packageAssertionStatus defaults. It must be a map of + * package names to Boolean.TRUE or Boolean.FALSE, with the unnamed package + * represented as a null key. + * + * XXX - Not implemented yet; this requires native help. + * + * @return a (read-only) map for the default packageAssertionStatus + */ + static final Map packageAssertionStatus() + { + return new HashMap(); + } + + /** + * The system default for class assertion status. This is used for all + * ClassLoader's classAssertionStatus defaults. It must be a map of + * class names to Boolean.TRUE or Boolean.FALSE + * + * XXX - Not implemented yet; this requires native help. + * + * @return a (read-only) map for the default classAssertionStatus + */ + static final Map classAssertionStatus() + { + return new HashMap(); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/VMSecurityManager.java gcc-3.3/libjava/java/lang/VMSecurityManager.java *** gcc-3.2.3/libjava/java/lang/VMSecurityManager.java 2001-09-02 06:18:48.000000000 +0000 --- gcc-3.3/libjava/java/lang/VMSecurityManager.java 2002-12-05 00:49:29.000000000 +0000 *************** *** 1,6 **** /* * java.lang.SecurityManager: part of the Java Class Libraries project. ! * Copyright (C) 1998, 2001 Free Software Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public --- 1,6 ---- /* * java.lang.SecurityManager: part of the Java Class Libraries project. ! * Copyright (C) 1998, 2001, 2002 Free Software Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public *************** class VMSecurityManager *** 43,53 **** ** @return an array containing all the methods on classes ** on the Java execution stack. **/ ! static Class[] getClassContext() ! { ! // FIXME: can't yet implement this for libgcj. ! return new Class[0]; ! } /** Get the current ClassLoader--the one nearest to the ** top of the stack. --- 43,49 ---- ** @return an array containing all the methods on classes ** on the Java execution stack. **/ ! static native Class[] getClassContext(); /** Get the current ClassLoader--the one nearest to the ** top of the stack. diff -Nrc3pad gcc-3.2.3/libjava/java/lang/VMThrowable.java gcc-3.3/libjava/java/lang/VMThrowable.java *** gcc-3.2.3/libjava/java/lang/VMThrowable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/lang/VMThrowable.java 2002-12-03 13:50:04.000000000 +0000 *************** *** 0 **** --- 1,111 ---- + /* java.lang.VMThrowable -- VM support methods for Throwable. + Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.lang; + + import gnu.gcj.runtime.NameFinder; + import gnu.gcj.runtime.StackTrace; + + /** + * VM dependent state and support methods Throwable. + * It is deliberately package local and final and should only be accessed + * by the Throwable class. + *

        + * This is the version used by libgcj (http://gcc.gnu.org/java/). + * + * @author Mark Wielaard (mark@klomp.org) + */ + final class VMThrowable + { + private gnu.gcj.runtime.StackTrace trace; + + /** + * Private contructor, create VMThrowables with fillInStackTrace(); + */ + private VMThrowable() { } + + /** + * Fill in the stack trace with the current execution stack. + * Called by Throwable.fillInStackTrace() to get the state of + * the VM. Can return null when the VM does not support caputing the VM + * execution state. + * + * @return a new VMThrowable containing the current execution stack trace. + * @see Throwable#fillInStackTrace() + */ + static VMThrowable fillInStackTrace(Throwable t) + { + VMThrowable state = null; + + /* FIXME: size of the stack trace is limited to 128 elements. + It's undoubtedly sensible to limit the stack trace, but 128 is + rather arbitrary. It may be better to configure this. */ + if (trace_enabled) + { + state = new VMThrowable (); + state.trace = new gnu.gcj.runtime.StackTrace(128); + } + return state; + } + + /** + * Returns an StackTraceElement array based on the execution + * state of the VM as captured by fillInStackTrace. + * Called by Throwable.getStackTrace(). + * + * @return a non-null but possible zero length array of StackTraceElement. + * @see Throwable#getStackTrace() + */ + StackTraceElement[] getStackTrace(Throwable t) + { + StackTraceElement[] result; + if (trace != null) + { + NameFinder nameFinder = new NameFinder(); + result = nameFinder.lookup(t, trace.stackTraceAddrs(), + trace.length()); + nameFinder.close(); + } + else + result = new StackTraceElement[0]; + + return result; + } + + // Setting this flag to false prevents fillInStackTrace() from running. + static boolean trace_enabled = true; + } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Void.java gcc-3.3/libjava/java/lang/Void.java *** gcc-3.2.3/libjava/java/lang/Void.java 2002-01-22 22:40:17.000000000 +0000 --- gcc-3.3/libjava/java/lang/Void.java 2002-06-13 18:16:26.000000000 +0000 *************** *** 1,5 **** ! /* java.lang.Void ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Void.class - defines void.class ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,67 **** package java.lang; - /* Written using "Java Class Libraries", 2nd edition, plus online - * API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Complete. - */ - /** ! * Void is a placeholder class so that the variable Void.TYPE can be ! * supported for reflection return types. * * @author Paul Fisher * @author John Keiser ! * @author Per Bothner ! * @since JDK1.1 */ public final class Void { /** ! * The return type void is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('V'); /** ! * Don't allow Void objects to be made. */ private Void() { } } --- 38,66 ---- package java.lang; /** ! * Void is a placeholder class so that the variable Void.TYPE ! * (also available as void.class) can be supported for ! * reflection return types. ! * ! *

        This class could be Serializable, but that is up to Sun. * * @author Paul Fisher * @author John Keiser ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 */ public final class Void { /** ! * The return type void is represented by this * Class object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('V'); /** ! * Void is non-instantiable. */ private Void() { } } diff -Nrc3pad gcc-3.2.3/libjava/java/lang/Win32Process.java gcc-3.3/libjava/java/lang/Win32Process.java *** gcc-3.2.3/libjava/java/lang/Win32Process.java 2002-03-10 18:00:05.000000000 +0000 --- gcc-3.3/libjava/java/lang/Win32Process.java 2003-02-10 23:53:28.000000000 +0000 *************** *** 1,6 **** // Win32Process.java - Subclass of Process for Win32 systems. ! /* Copyright (C) 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // Win32Process.java - Subclass of Process for Win32 systems. ! /* Copyright (C) 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 10,15 **** --- 10,16 ---- package java.lang; + import java.io.File; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; *************** import java.io.IOException; *** 21,68 **** // This is entirely internal to our implementation. - // NOTE: when this is implemented, we'll need to add - // HANDLE_FLAG_INHERIT in FileDescriptor and other places, to make - // sure that file descriptors aren't inherited by the child process. - // See _Jv_platform_close_on_exec. - // This file is copied to `ConcreteProcess.java' before compilation. // Hence the class name apparently does not match the file name. final class ConcreteProcess extends Process { ! public void destroy () ! { ! throw new Error("not implemented"); ! } ! public int exitValue () { ! throw new Error("not implemented"); } public InputStream getErrorStream () { ! throw new Error("not implemented"); } public InputStream getInputStream () { ! throw new Error("not implemented"); } public OutputStream getOutputStream () { ! throw new Error("not implemented"); } ! public int waitFor () throws InterruptedException ! { ! throw new Error("not implemented"); ! } ! public ConcreteProcess (String[] progarray, String[] envp) throws IOException { ! throw new IOException("not implemented"); } } --- 22,84 ---- // This is entirely internal to our implementation. // This file is copied to `ConcreteProcess.java' before compilation. // Hence the class name apparently does not match the file name. final class ConcreteProcess extends Process { ! public native void destroy (); ! ! public native boolean hasExited (); ! public int exitValue () { ! if (! hasExited ()) ! throw new IllegalThreadStateException ("Process has not exited"); ! ! return exitCode; } public InputStream getErrorStream () { ! return errorStream; } public InputStream getInputStream () { ! return inputStream; } public OutputStream getOutputStream () { ! return outputStream; } ! public native int waitFor () throws InterruptedException; ! public native void startProcess (String[] progarray, ! String[] envp, ! File dir) ! throws IOException; ! ! public native void cleanup (); ! ! public ConcreteProcess (String[] progarray, ! String[] envp, ! File dir) ! throws IOException { ! startProcess (progarray, envp, dir); } + // The standard streams (stdin, stdout and stderr, respectively) + // of the child as seen by the parent process. + private OutputStream outputStream; + private InputStream inputStream; + private InputStream errorStream; + + // Handle to the child process - cast to HANDLE before use. + private int procHandle; + + // Exit code of the child if it has exited. + private int exitCode; } diff -Nrc3pad gcc-3.2.3/libjava/java/math/BigDecimal.java gcc-3.3/libjava/java/math/BigDecimal.java *** gcc-3.2.3/libjava/java/math/BigDecimal.java 2002-01-22 22:40:22.000000000 +0000 --- gcc-3.3/libjava/java/math/BigDecimal.java 2003-04-19 19:28:42.000000000 +0000 *************** public class BigDecimal extends Number i *** 178,192 **** // Now parse exponent. if (point < len) { ! int exp = Integer.parseInt (num.substring (point + 1)); ! exp -= scale; ! if (exp > 0) { ! intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp)); ! scale = 0; } - else - scale = - exp; } } --- 178,208 ---- // Now parse exponent. if (point < len) { ! point++; ! if (num.charAt(point) == '+') ! point++; ! ! if (point >= len ) ! throw new NumberFormatException ("no exponent following e or E"); ! ! try { ! int exp = Integer.parseInt (num.substring (point)); ! exp -= scale; ! if (signum () == 0) ! scale = 0; ! else if (exp > 0) ! { ! intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp)); ! scale = 0; ! } ! else ! scale = - exp; ! } ! catch (NumberFormatException ex) ! { ! throw new NumberFormatException ("malformed exponent"); } } } *************** public class BigDecimal extends Number i *** 198,204 **** public static BigDecimal valueOf (long val, int scale) throws NumberFormatException { ! if (scale == 0) switch ((int) val) { case 0: --- 214,220 ---- public static BigDecimal valueOf (long val, int scale) throws NumberFormatException { ! if ((scale == 0) && ((int)val == val)) switch ((int) val) { case 0: *************** public class BigDecimal extends Number i *** 252,258 **** throw new ArithmeticException ("scale is negative: " + newScale); if (intVal.signum () == 0) // handle special case of 0.0/0.0 ! return ZERO; // Ensure that pow gets a non-negative value. int valScale = val.scale; --- 268,274 ---- throw new ArithmeticException ("scale is negative: " + newScale); if (intVal.signum () == 0) // handle special case of 0.0/0.0 ! return newScale == 0 ? ZERO : new BigDecimal (ZERO.intVal, newScale); // Ensure that pow gets a non-negative value. int valScale = val.scale; *************** public class BigDecimal extends Number i *** 415,420 **** --- 431,441 ---- return scale; } + public BigInteger unscaledValue() + { + return intVal; + } + public BigDecimal abs () { return new BigDecimal (intVal.abs (), scale); *************** public class BigDecimal extends Number i *** 431,449 **** if (scale == 0) return bigStr; - int point = bigStr.length() - scale; boolean negative = (bigStr.charAt(0) == '-'); ! StringBuffer sb = new StringBuffer(bigStr.length() + 1 + ! (point <= 0 ? -point+1 : 0)); ! if (negative) ! sb.append('-'); ! while (point <= 0) { ! sb.append('0'); ! point++; } - sb.append(bigStr.substring(negative ? 1 : 0)); - sb.insert(point, '.'); return sb.toString(); } --- 452,480 ---- if (scale == 0) return bigStr; boolean negative = (bigStr.charAt(0) == '-'); ! ! int point = bigStr.length() - scale - (negative ? 1 : 0); ! ! StringBuffer sb = new StringBuffer(bigStr.length() + 2 + ! (point <= 0 ? (-point + 1) : 0)); ! if (point <= 0) { ! if (negative) ! sb.append('-'); ! sb.append('0').append('.'); ! while (point < 0) ! { ! sb.append('0'); ! point++; ! } ! sb.append(bigStr.substring(negative ? 1 : 0)); ! } ! else ! { ! sb.append(bigStr); ! sb.insert(point + (negative ? 1 : 0), '.'); } return sb.toString(); } diff -Nrc3pad gcc-3.2.3/libjava/java/math/BigInteger.java gcc-3.3/libjava/java/math/BigInteger.java *** gcc-3.2.3/libjava/java/math/BigInteger.java 2002-02-14 23:16:05.000000000 +0000 --- gcc-3.3/libjava/java/math/BigInteger.java 2003-04-19 19:28:42.000000000 +0000 *************** *** 1,5 **** /* java.math.BigInteger -- Arbitary precision integers ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* java.math.BigInteger -- Arbitary precision integers ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class BigInteger extends Number i *** 110,115 **** --- 110,121 ---- 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251 }; + /** HAC (Handbook of Applied Cryptography), Alfred Menezes & al. Table 4.4. */ + private static final int[] k = + {100,150,200,250,300,350,400,500,600,800,1250, Integer.MAX_VALUE}; + private static final int[] t = + { 27, 18, 15, 12, 9, 8, 7, 6, 5, 4, 3, 2}; + private BigInteger() { } *************** public class BigInteger extends Number i *** 217,255 **** } } /** Return a (possibly-shared) BigInteger with a given long value. */ ! private static BigInteger make(long value) { ! if (value >= minFixNum && value <= maxFixNum) ! return smallFixNums[(int)value - minFixNum]; ! int i = (int) value; ! if ((long)i == value) return new BigInteger(i); BigInteger result = alloc(2); result.ival = 2; result.words[0] = i; ! result.words[1] = (int) (value >> 32); return result; } - // FIXME: Could simply rename 'make' method above as valueOf while - // changing all instances of 'make'. Don't do this until this class - // is done as the Kawa class this is based on has 'make' methods - // with other parameters; wait to see if they are used in BigInteger. - public static BigInteger valueOf(long val) - { - return make(val); - } - /** Make a canonicalized BigInteger from an array of words. * The array may be reused (without copying). */ private static BigInteger make(int[] words, int len) { if (words == null) ! return make(len); len = BigInteger.wordsNeeded(words, len); if (len <= 1) ! return len == 0 ? ZERO : make(words[0]); BigInteger num = new BigInteger(); num.words = words; num.ival = len; --- 223,269 ---- } } + /** + * Return a BigInteger that is bitLength bits long with a + * probability < 2^-100 of being composite. + * + * @param bitLength length in bits of resulting number + * @param rnd random number generator to use + * @throws ArithmeticException if bitLength < 2 + * @since 1.4 + */ + public static BigInteger probablePrime(int bitLength, Random rnd) + { + if (bitLength < 2) + throw new ArithmeticException(); + + return new BigInteger(bitLength, 100, rnd); + } + /** Return a (possibly-shared) BigInteger with a given long value. */ ! public static BigInteger valueOf(long val) { ! if (val >= minFixNum && val <= maxFixNum) ! return smallFixNums[(int) val - minFixNum]; ! int i = (int) val; ! if ((long) i == val) return new BigInteger(i); BigInteger result = alloc(2); result.ival = 2; result.words[0] = i; ! result.words[1] = (int)(val >> 32); return result; } /** Make a canonicalized BigInteger from an array of words. * The array may be reused (without copying). */ private static BigInteger make(int[] words, int len) { if (words == null) ! return valueOf(len); len = BigInteger.wordsNeeded(words, len); if (len <= 1) ! return len == 0 ? ZERO : valueOf(words[0]); BigInteger num = new BigInteger(); num.words = words; num.ival = len; *************** public class BigInteger extends Number i *** 267,281 **** int bptr = 0; int word = sign; for (int i = bytes.length % 4; i > 0; --i, bptr++) ! word = (word << 8) | (((int) bytes[bptr]) & 0xff); words[--nwords] = word; // Elements remaining in byte[] are a multiple of 4. while (nwords > 0) words[--nwords] = bytes[bptr++] << 24 | ! (((int) bytes[bptr++]) & 0xff) << 16 | ! (((int) bytes[bptr++]) & 0xff) << 8 | ! (((int) bytes[bptr++]) & 0xff); return words; } --- 281,295 ---- int bptr = 0; int word = sign; for (int i = bytes.length % 4; i > 0; --i, bptr++) ! word = (word << 8) | (bytes[bptr] & 0xff); words[--nwords] = word; // Elements remaining in byte[] are a multiple of 4. while (nwords > 0) words[--nwords] = bytes[bptr++] << 24 | ! (bytes[bptr++] & 0xff) << 16 | ! (bytes[bptr++] & 0xff) << 8 | ! (bytes[bptr++] & 0xff); return words; } *************** public class BigInteger extends Number i *** 284,292 **** */ private static BigInteger alloc(int nwords) { - if (nwords <= 1) - return new BigInteger(); BigInteger result = new BigInteger(); result.words = new int[nwords]; return result; } --- 298,305 ---- */ private static BigInteger alloc(int nwords) { BigInteger result = new BigInteger(); + if (nwords > 1) result.words = new int[nwords]; return result; } *************** public class BigInteger extends Number i *** 376,387 **** return compareTo(this, val) > 0 ? this : val; } - private final boolean isOdd() - { - int low = words == null ? ival : words[0]; - return (low & 1) != 0; - } - private final boolean isZero() { return words == null && ival == 0; --- 389,394 ---- *************** public class BigInteger extends Number i *** 392,402 **** return words == null && ival == 1; } - private final boolean isMinusOne() - { - return words == null && ival == -1; - } - /** Calculate how many words are significant in words[0:len-1]. * Returns the least value x such that x>0 && words[0:x-1]==words[0:len-1], * when words is viewed as a 2's complement integer. --- 399,404 ---- *************** public class BigInteger extends Number i *** 433,446 **** words = null; } if (words == null && ival >= minFixNum && ival <= maxFixNum) ! return smallFixNums[(int) ival - minFixNum]; return this; } /** Add two ints, yielding a BigInteger. */ private static final BigInteger add(int x, int y) { ! return BigInteger.make((long) x + (long) y); } /** Add a BigInteger and an int, yielding a new BigInteger. */ --- 435,448 ---- words = null; } if (words == null && ival >= minFixNum && ival <= maxFixNum) ! return smallFixNums[ival - minFixNum]; return this; } /** Add two ints, yielding a BigInteger. */ private static final BigInteger add(int x, int y) { ! return valueOf((long) x + (long) y); } /** Add a BigInteger and an int, yielding a new BigInteger. */ *************** public class BigInteger extends Number i *** 526,538 **** private static BigInteger add(BigInteger x, BigInteger y, int k) { if (x.words == null && y.words == null) ! return BigInteger.make((long) k * (long) y.ival + (long) x.ival); if (k != 1) { if (k == -1) y = BigInteger.neg(y); else ! y = BigInteger.times(y, BigInteger.make(k)); } if (x.words == null) return BigInteger.add(y, x.ival); --- 528,540 ---- private static BigInteger add(BigInteger x, BigInteger y, int k) { if (x.words == null && y.words == null) ! return valueOf((long) k * (long) y.ival + (long) x.ival); if (k != 1) { if (k == -1) y = BigInteger.neg(y); else ! y = BigInteger.times(y, valueOf(k)); } if (x.words == null) return BigInteger.add(y, x.ival); *************** public class BigInteger extends Number i *** 580,586 **** int[] xwords = x.words; int xlen = x.ival; if (xwords == null) ! return BigInteger.make((long) xlen * (long) y); boolean negative; BigInteger result = BigInteger.alloc(xlen + 1); if (xwords[xlen - 1] < 0) --- 582,588 ---- int[] xwords = x.words; int xlen = x.ival; if (xwords == null) ! return valueOf((long) xlen * (long) y); boolean negative; BigInteger result = BigInteger.alloc(xlen + 1); if (xwords[xlen - 1] < 0) *************** public class BigInteger extends Number i *** 662,668 **** xNegative = true; if (x == Long.MIN_VALUE) { ! divide(BigInteger.make(x), BigInteger.make(y), quotient, remainder, rounding_mode); return; } --- 664,670 ---- xNegative = true; if (x == Long.MIN_VALUE) { ! divide(valueOf(x), valueOf(y), quotient, remainder, rounding_mode); return; } *************** public class BigInteger extends Number i *** 684,690 **** remainder.set(x); } else ! divide(BigInteger.make(x), BigInteger.make(y), quotient, remainder, rounding_mode); return; } --- 686,692 ---- remainder.set(x); } else ! divide(valueOf(x), valueOf(y), quotient, remainder, rounding_mode); return; } *************** public class BigInteger extends Number i *** 966,1004 **** return rem.canonicalize(); } - /** Calculate power for BigInteger exponents. - * @param y exponent assumed to be non-negative. */ - private BigInteger pow(BigInteger y) - { - if (isOne()) - return this; - if (isMinusOne()) - return y.isOdd () ? this : ONE; - if (y.words == null && y.ival >= 0) - return pow(y.ival); - - // Assume exponent is non-negative. - if (isZero()) - return this; - - // Implemented by repeated squaring and multiplication. - BigInteger pow2 = this; - BigInteger r = null; - for (;;) // for (i = 0; ; i++) - { - // pow2 == x**(2**i) - // prod = x**(sum(j=0..i-1, (y>>j)&1)) - if (y.isOdd()) - r = r == null ? pow2 : times(r, pow2); // r *= pow2 - y = BigInteger.shift(y, -1); - if (y.isZero()) - break; - // pow2 *= pow2; - pow2 = times(pow2, pow2); - } - return r == null ? ONE : r; - } - /** Calculate the integral power of a BigInteger. * @param exponent the exponent (must be non-negative) */ --- 968,973 ---- *************** public class BigInteger extends Number i *** 1008,1014 **** { if (exponent == 0) return ONE; - else throw new ArithmeticException("negative exponent"); } if (isZero()) --- 977,982 ---- *************** public class BigInteger extends Number i *** 1051,1101 **** private static final int[] euclidInv(int a, int b, int prevDiv) { - // Storage for return values, plus one slot for a temp int (see below). - int[] xy; - if (b == 0) throw new ArithmeticException("not invertible"); ! else if (b == 1) ! { // Success: values are indeed invertible! // Bottom of the recursion reached; start unwinding. ! xy = new int[3]; ! xy[0] = -prevDiv; ! xy[1] = 1; ! return xy; ! } ! ! xy = euclidInv(b, a % b, a / b); // Recursion happens here. ! // xy[2] is just temp storage for intermediate results in the following ! // calculation. This saves us a bit of space over having an int ! // allocated at every level of this recursive method. ! xy[2] = xy[0]; ! xy[0] = xy[2] * -prevDiv + xy[1]; ! xy[1] = xy[2]; return xy; } ! private static final BigInteger[] ! euclidInv(BigInteger a, BigInteger b, BigInteger prevDiv) { - // FIXME: This method could be more efficient memory-wise and should be - // modified as such since it is recursive. - - // Storage for return values, plus one slot for a temp int (see below). - BigInteger[] xy; - if (b.isZero()) throw new ArithmeticException("not invertible"); ! else if (b.isOne()) { // Success: values are indeed invertible! // Bottom of the recursion reached; start unwinding. - xy = new BigInteger[3]; xy[0] = neg(prevDiv); ! xy[1] = ONE; ! return xy; } // Recursion happens in the following conditional! --- 1019,1052 ---- private static final int[] euclidInv(int a, int b, int prevDiv) { if (b == 0) throw new ArithmeticException("not invertible"); ! ! if (b == 1) // Success: values are indeed invertible! // Bottom of the recursion reached; start unwinding. ! return new int[] { -prevDiv, 1 }; ! int[] xy = euclidInv(b, a % b, a / b); // Recursion happens here. ! a = xy[0]; // use our local copy of 'a' as a work var ! xy[0] = a * -prevDiv + xy[1]; ! xy[1] = a; return xy; } ! private static final void euclidInv(BigInteger a, BigInteger b, ! BigInteger prevDiv, BigInteger[] xy) { if (b.isZero()) throw new ArithmeticException("not invertible"); ! ! if (b.isOne()) { // Success: values are indeed invertible! // Bottom of the recursion reached; start unwinding. xy[0] = neg(prevDiv); ! xy[1] = ONE; ! return; } // Recursion happens in the following conditional! *************** public class BigInteger extends Number i *** 1104,1128 **** if (a.words == null) { int[] xyInt = euclidInv(b.ival, a.ival % b.ival, a.ival / b.ival); - xy = new BigInteger[3]; xy[0] = new BigInteger(xyInt[0]); ! xy[1] = new BigInteger(xyInt[1]); } else { BigInteger rem = new BigInteger(); BigInteger quot = new BigInteger(); divide(a, b, quot, rem, FLOOR); ! xy = euclidInv(b, rem, quot); } ! // xy[2] is just temp storage for intermediate results in the following ! // calculation. This saves us a bit of space over having a BigInteger ! // allocated at every level of this recursive method. ! xy[2] = xy[0]; ! xy[0] = add(xy[1], times(xy[2], prevDiv), -1); ! xy[1] = xy[2]; ! return xy; } public BigInteger modInverse(BigInteger y) --- 1055,1077 ---- if (a.words == null) { int[] xyInt = euclidInv(b.ival, a.ival % b.ival, a.ival / b.ival); xy[0] = new BigInteger(xyInt[0]); ! xy[1] = new BigInteger(xyInt[1]); } else { BigInteger rem = new BigInteger(); BigInteger quot = new BigInteger(); divide(a, b, quot, rem, FLOOR); ! // quot and rem may not be in canonical form. ensure ! rem.canonicalize(); ! quot.canonicalize(); ! euclidInv(b, rem, quot, xy); } ! BigInteger t = xy[0]; ! xy[0] = add(xy[1], times(t, prevDiv), -1); ! xy[1] = t; } public BigInteger modInverse(BigInteger y) *************** public class BigInteger extends Number i *** 1133,1139 **** // Degenerate cases. if (y.isOne()) return ZERO; ! else if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively --- 1082,1088 ---- // Degenerate cases. if (y.isOne()) return ZERO; ! if (isOne()) return ONE; // Use Euclid's algorithm as in gcd() but do this recursively *************** public class BigInteger extends Number i *** 1141,1148 **** // unwind from the recursion. // Used http://www.math.nmsu.edu/~crypto/EuclideanAlgo.html as reference. BigInteger result = new BigInteger(); - int xval = ival; - int yval = y.ival; boolean swapped = false; if (y.words == null) --- 1090,1095 ---- *************** public class BigInteger extends Number i *** 1153,1160 **** // math. Note that BigInteger.mod() must be used even if this is // already an int as the % operator would provide a negative result if // this is negative, BigInteger.mod() never returns negative values. ! if (words != null || isNegative()) ! xval = mod(y).ival; // Swap values so x > y. if (yval > xval) --- 1100,1107 ---- // math. Note that BigInteger.mod() must be used even if this is // already an int as the % operator would provide a negative result if // this is negative, BigInteger.mod() never returns negative values. ! int xval = (words != null || isNegative()) ? mod(y).ival : ival; ! int yval = y.ival; // Swap values so x > y. if (yval > xval) *************** public class BigInteger extends Number i *** 1175,1190 **** } else { - BigInteger x = this; - // As above, force this to be a positive value via modulo math. ! if (isNegative()) ! x = mod(y); // Swap values so x > y. if (x.compareTo(y) < 0) { ! BigInteger tmp = x; x = y; y = tmp; swapped = true; } // As above (for ints), result will be in the 2nd element unless --- 1122,1134 ---- } else { // As above, force this to be a positive value via modulo math. ! BigInteger x = isNegative() ? this.mod(y) : this; // Swap values so x > y. if (x.compareTo(y) < 0) { ! result = x; x = y; y = result; // use 'result' as a work var swapped = true; } // As above (for ints), result will be in the 2nd element unless *************** public class BigInteger extends Number i *** 1192,1198 **** BigInteger rem = new BigInteger(); BigInteger quot = new BigInteger(); divide(x, y, quot, rem, FLOOR); ! result = euclidInv(y, rem, quot)[swapped ? 0 : 1]; // Result can't be negative, so make it positive by adding the // original modulus, y (which is now x if they were swapped). --- 1136,1147 ---- BigInteger rem = new BigInteger(); BigInteger quot = new BigInteger(); divide(x, y, quot, rem, FLOOR); ! // quot and rem may not be in canonical form. ensure ! rem.canonicalize(); ! quot.canonicalize(); ! BigInteger[] xy = new BigInteger[2]; ! euclidInv(y, rem, quot, xy); ! result = swapped ? xy[0] : xy[1]; // Result can't be negative, so make it positive by adding the // original modulus, y (which is now x if they were swapped). *************** public class BigInteger extends Number i *** 1216,1231 **** // To do this naively by first raising this to the power of exponent // and then performing modulo m would be extremely expensive, especially // for very large numbers. The solution is found in Number Theory ! // where a combination of partial powers and modulos can be done easily. // // We'll use the algorithm for Additive Chaining which can be found on // p. 244 of "Applied Cryptography, Second Edition" by Bruce Schneier. ! BigInteger s, t, u; ! int i; ! ! s = ONE; ! t = this; ! u = exponent; while (!u.isZero()) { --- 1165,1177 ---- // To do this naively by first raising this to the power of exponent // and then performing modulo m would be extremely expensive, especially // for very large numbers. The solution is found in Number Theory ! // where a combination of partial powers and moduli can be done easily. // // We'll use the algorithm for Additive Chaining which can be found on // p. 244 of "Applied Cryptography, Second Edition" by Bruce Schneier. ! BigInteger s = ONE; ! BigInteger t = this; ! BigInteger u = exponent; while (!u.isZero()) { *************** public class BigInteger extends Number i *** 1242,1265 **** private static final int gcd(int a, int b) { // Euclid's algorithm, copied from libg++. if (b > a) { ! int tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; ! else if (b == 1) return b; ! else ! { ! int tmp = b; b = a % b; a = tmp; } } - } public BigInteger gcd(BigInteger y) { --- 1188,1209 ---- private static final int gcd(int a, int b) { // Euclid's algorithm, copied from libg++. + int tmp; if (b > a) { ! tmp = a; a = b; b = tmp; } for(;;) { if (b == 0) return a; ! if (b == 1) return b; ! tmp = b; b = a % b; a = tmp; } } public BigInteger gcd(BigInteger y) { *************** public class BigInteger extends Number i *** 1268,1274 **** if (words == null) { if (xval == 0) ! return BigInteger.abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { --- 1212,1218 ---- if (words == null) { if (xval == 0) ! return abs(y); if (y.words == null && xval != Integer.MIN_VALUE && yval != Integer.MIN_VALUE) { *************** public class BigInteger extends Number i *** 1276,1289 **** xval = -xval; if (yval < 0) yval = -yval; ! return BigInteger.make(BigInteger.gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) ! return BigInteger.abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; --- 1220,1233 ---- xval = -xval; if (yval < 0) yval = -yval; ! return valueOf(gcd(xval, yval)); } xval = 1; } if (y.words == null) { if (yval == 0) ! return abs(this); yval = 1; } int len = (xval > yval ? xval : yval) + 1; *************** public class BigInteger extends Number i *** 1298,1305 **** --- 1242,1265 ---- return result.canonicalize(); } + /** + *

        Returns true if this BigInteger is probably prime, + * false if it's definitely composite. If certainty + * is <= 0, true is returned.

        + * + * @param certainty a measure of the uncertainty that the caller is willing + * to tolerate: if the call returns true the probability that + * this BigInteger is prime exceeds (1 - 1/2certainty). + * The execution time of this method is proportional to the value of this + * parameter. + * @return true if this BigInteger is probably prime, + * false if it's definitely composite. + */ public boolean isProbablePrime(int certainty) { + if (certainty < 1) + return true; + /** We'll use the Rabin-Miller algorithm for doing a probabilistic * primality test. It is fast, easy and has faster decreasing odds of a * composite passing than with other tests. This means that this *************** public class BigInteger extends Number i *** 1311,1329 **** * Cryptography, Second Edition" by Bruce Schneier. */ ! // First rule out small prime factors and assure the number is odd. ! for (int i = 0; i < primes.length; i++) { if (words == null && ival == primes[i]) return true; ! if (remainder(make(primes[i])).isZero()) return false; } // Now perform the Rabin-Miller test. - // NB: I know that this can be simplified programatically, but - // I have tried to keep it as close as possible to the algorithm - // as written in the Schneier book for reference purposes. // Set b to the number of times 2 evenly divides (this - 1). // I.e. 2^b is the largest power of 2 that divides (this - 1). --- 1271,1290 ---- * Cryptography, Second Edition" by Bruce Schneier. */ ! // First rule out small prime factors ! BigInteger rem = new BigInteger(); ! int i; ! for (i = 0; i < primes.length; i++) { if (words == null && ival == primes[i]) return true; ! ! divide(this, smallFixNums[primes[i] - minFixNum], null, rem, TRUNCATE); ! if (rem.canonicalize().isZero()) return false; } // Now perform the Rabin-Miller test. // Set b to the number of times 2 evenly divides (this - 1). // I.e. 2^b is the largest power of 2 that divides (this - 1). *************** public class BigInteger extends Number i *** 1331,1352 **** int b = pMinus1.getLowestSetBit(); // Set m such that this = 1 + 2^b * m. ! BigInteger m = pMinus1.divide(make(2L << b - 1)); ! Random rand = new Random(); ! while (certainty-- > 0) { ! // Pick a random number greater than 1 and less than this. ! // The algorithm says to pick a small number to make the calculations ! // go faster, but it doesn't say how small; we'll use 2 to 1024. ! int a = rand.nextInt(); ! a = (a < 0 ? -a : a) % 1023 + 2; ! ! BigInteger z = make(a).modPow(m, this); if (z.isOne() || z.equals(pMinus1)) continue; // Passes the test; may be prime. - int i; for (i = 0; i < b; ) { if (z.isOne()) --- 1292,1322 ---- int b = pMinus1.getLowestSetBit(); // Set m such that this = 1 + 2^b * m. ! BigInteger m = pMinus1.divide(valueOf(2L << b - 1)); ! // The HAC (Handbook of Applied Cryptography), Alfred Menezes & al. Note ! // 4.49 (controlling the error probability) gives the number of trials ! // for an error probability of 1/2**80, given the number of bits in the ! // number to test. we shall use these numbers as is if/when 'certainty' ! // is less or equal to 80, and twice as much if it's greater. ! int bits = this.bitLength(); ! for (i = 0; i < k.length; i++) ! if (bits <= k[i]) ! break; ! int trials = t[i]; ! if (certainty > 80) ! trials *= 2; ! BigInteger z; ! for (int t = 0; t < trials; t++) { ! // The HAC (Handbook of Applied Cryptography), Alfred Menezes & al. ! // Remark 4.28 states: "...A strategy that is sometimes employed ! // is to fix the bases a to be the first few primes instead of ! // choosing them at random. ! z = smallFixNums[primes[t] - minFixNum].modPow(m, this); if (z.isOne() || z.equals(pMinus1)) continue; // Passes the test; may be prime. for (i = 0; i < b; ) { if (z.isOne()) *************** public class BigInteger extends Number i *** 1355,1361 **** if (z.equals(pMinus1)) break; // Passes the test; may be prime. ! z = z.modPow(make(2), this); } if (i == b && !z.equals(pMinus1)) --- 1325,1331 ---- if (z.equals(pMinus1)) break; // Passes the test; may be prime. ! z = z.modPow(valueOf(2), this); } if (i == b && !z.equals(pMinus1)) *************** public class BigInteger extends Number i *** 1456,1464 **** if (x.words == null) { if (count <= 0) ! return make(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0); if (count < 32) ! return make((long) x.ival << count); } if (count == 0) return x; --- 1426,1434 ---- if (x.words == null) { if (count <= 0) ! return valueOf(count > -32 ? x.ival >> (-count) : x.ival < 0 ? -1 : 0); if (count < 32) ! return valueOf((long) x.ival << count); } if (count == 0) return x; *************** public class BigInteger extends Number i *** 1496,1502 **** work = words; int len = ival; - int buf_size = len * (MPN.chars_per_word(radix) + 1); if (radix == 16) { if (neg) --- 1466,1471 ---- *************** public class BigInteger extends Number i *** 1549,1555 **** { if (words == null) return Integer.toString(ival, radix); ! else if (ival <= 2) return Long.toString(longValue(), radix); int buf_size = ival * (MPN.chars_per_word(radix) + 1); StringBuffer buffer = new StringBuffer(buf_size); --- 1518,1524 ---- { if (words == null) return Integer.toString(ival, radix); ! if (ival <= 2) return Long.toString(longValue(), radix); int buf_size = ival * (MPN.chars_per_word(radix) + 1); StringBuffer buffer = new StringBuffer(buf_size); *************** public class BigInteger extends Number i *** 1599,1605 **** { if (obj == null || ! (obj instanceof BigInteger)) return false; ! return BigInteger.equals(this, (BigInteger) obj); } private static BigInteger valueOf(String s, int radix) --- 1568,1574 ---- { if (obj == null || ! (obj instanceof BigInteger)) return false; ! return equals(this, (BigInteger) obj); } private static BigInteger valueOf(String s, int radix) *************** public class BigInteger extends Number i *** 1609,1615 **** // Testing (len < MPN.chars_per_word(radix)) would be more accurate, // but slightly more expensive, for little practical gain. if (len <= 15 && radix <= 16) ! return BigInteger.make(Long.parseLong(s, radix)); int byte_len = 0; byte[] bytes = new byte[len]; --- 1578,1584 ---- // Testing (len < MPN.chars_per_word(radix)) would be more accurate, // but slightly more expensive, for little practical gain. if (len <= 15 && radix <= 16) ! return valueOf(Long.parseLong(s, radix)); int byte_len = 0; byte[] bytes = new byte[len]; *************** public class BigInteger extends Number i *** 1654,1661 **** if (ival <= 2) return (double) longValue(); if (isNegative()) ! return BigInteger.neg(this).roundToDouble(0, true, false); ! else return roundToDouble(0, false, false); } --- 1623,1629 ---- if (ival <= 2) return (double) longValue(); if (isNegative()) ! return neg(this).roundToDouble(0, true, false); return roundToDouble(0, false, false); } *************** public class BigInteger extends Number i *** 1763,1769 **** * Assumes words.length >= (this.words == null ? 1 : this.ival). * Result is zero-extended, but need not be a valid 2's complement number. */ - private void getAbsolute(int[] words) { int len; --- 1731,1736 ---- *************** public class BigInteger extends Number i *** 1814,1820 **** return; } realloc(len + 1); ! if (BigInteger.negate(words, x.words, len)) words[len++] = 0; ival = len; } --- 1781,1787 ---- return; } realloc(len + 1); ! if (negate(words, x.words, len)) words[len++] = 0; ival = len; } *************** public class BigInteger extends Number i *** 1838,1844 **** private static BigInteger neg(BigInteger x) { if (x.words == null && x.ival != Integer.MIN_VALUE) ! return make(- x.ival); BigInteger result = new BigInteger(0); result.setNegative(x); return result.canonicalize(); --- 1805,1811 ---- private static BigInteger neg(BigInteger x) { if (x.words == null && x.ival != Integer.MIN_VALUE) ! return valueOf(- x.ival); BigInteger result = new BigInteger(0); result.setNegative(x); return result.canonicalize(); *************** public class BigInteger extends Number i *** 1846,1852 **** public BigInteger negate() { ! return BigInteger.neg(this); } /** Calculates ceiling(log2(this < 0 ? -this : this+1)) --- 1813,1819 ---- public BigInteger negate() { ! return neg(this); } /** Calculates ceiling(log2(this < 0 ? -this : this+1)) *************** public class BigInteger extends Number i *** 1856,1862 **** { if (words == null) return MPN.intLength(ival); - else return MPN.intLength(words, ival); } --- 1823,1828 ---- *************** public class BigInteger extends Number i *** 1907,1913 **** case 1: return x.and(y); case 3: return x; case 5: return y; ! case 15: return make(-1); } BigInteger result = new BigInteger(); setBitOp(result, op, x, y); --- 1873,1879 ---- case 1: return x.and(y); case 3: return x; case 5: return y; ! case 15: return valueOf(-1); } BigInteger result = new BigInteger(); setBitOp(result, op, x, y); *************** public class BigInteger extends Number i *** 2105,2119 **** private static BigInteger and(BigInteger x, int y) { if (x.words == null) ! return BigInteger.make(x.ival & y); if (y >= 0) ! return BigInteger.make(x.words[0] & y); int len = x.ival; int[] words = new int[len]; words[0] = x.words[0] & y; while (--len > 0) words[len] = x.words[len]; ! return BigInteger.make(words, x.ival); } /** Return the logical (bit-wise) "and" of two BigIntegers. */ --- 2071,2085 ---- private static BigInteger and(BigInteger x, int y) { if (x.words == null) ! return valueOf(x.ival & y); if (y >= 0) ! return valueOf(x.words[0] & y); int len = x.ival; int[] words = new int[len]; words[0] = x.words[0] & y; while (--len > 0) words[len] = x.words[len]; ! return make(words, x.ival); } /** Return the logical (bit-wise) "and" of two BigIntegers. */ *************** public class BigInteger extends Number i *** 2136,2142 **** words[i] = x.words[i] & y.words[i]; for ( ; i < len; i++) words[i] = x.words[i]; ! return BigInteger.make(words, len); } /** Return the logical (bit-wise) "(inclusive) or" of two BigIntegers. */ --- 2102,2108 ---- words[i] = x.words[i] & y.words[i]; for ( ; i < len; i++) words[i] = x.words[i]; ! return make(words, len); } /** Return the logical (bit-wise) "(inclusive) or" of two BigIntegers. */ diff -Nrc3pad gcc-3.2.3/libjava/java/net/Authenticator.java gcc-3.3/libjava/java/net/Authenticator.java *** gcc-3.2.3/libjava/java/net/Authenticator.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/Authenticator.java 2002-08-28 05:24:10.000000000 +0000 *************** exception statement from your version. * *** 38,47 **** package java.net; /** ! * Sometimes a network operation (such as hitting a password protected ! * web site) will require authentication information in the form of a ! * username and password. This abstract class provides a model for ! * obtaining that information. *

        * To make use of this feature, a programmer must create a subclass of * Authenticator that knows how to obtain the necessary info. An example --- 38,47 ---- package java.net; /** ! * This abstract class provides a model for obtaining authentication ! * information (in the form of a username and password) required by ! * some network operations (such as hitting a password protected ! * web site). *

        * To make use of this feature, a programmer must create a subclass of * Authenticator that knows how to obtain the necessary info. An example *************** package java.net; *** 53,58 **** --- 53,59 ---- * @since 1.2 * * @author Aaron M. Renn (arenn@urbanophile.com) + * @status Believed to be JDK 1.4 complete */ public abstract class Authenticator { *************** private static Authenticator default_aut *** 75,80 **** --- 76,86 ---- */ /** + * The hostname of the site requesting authentication + */ + private String host; + + /** * InternetAddress of the site requesting authentication */ private InetAddress addr; *************** setDefault(Authenticator def_auth) *** 144,150 **** * @param port The port requesting authentication * @param protocol The protocol requesting authentication * @param prompt The prompt to display to the user when requesting ! authentication info * @param scheme The authentication scheme in use * * @return A PasswordAuthentication object with the user's --- 150,156 ---- * @param port The port requesting authentication * @param protocol The protocol requesting authentication * @param prompt The prompt to display to the user when requesting ! * authentication info * @param scheme The authentication scheme in use * * @return A PasswordAuthentication object with the user's *************** setDefault(Authenticator def_auth) *** 156,161 **** --- 162,205 ---- public static PasswordAuthentication requestPasswordAuthentication(InetAddress addr, int port, String protocol, String prompt, String scheme) + throws SecurityException + { + return(requestPasswordAuthentication (null, addr, port, protocol, + prompt, scheme)); + } + + /** + * This method is called whenever a username and password for a given + * network operation is required. First, a security check is made to see + * if the caller has the "requestPasswordAuthentication" + * permission. If not, the method thows an exception. If there is no + * default Authenticator object, the method then returns + * null. Otherwise, the default authenticators's instance + * variables are initialized and it's getPasswordAuthentication + * method is called to get the actual authentication information to return. + * This method is the preferred one as it can be used with hostname + * when addr is unknown. + * + * @param host The hostname requesting authentication + * @param addr The address requesting authentication + * @param port The port requesting authentication + * @param protocol The protocol requesting authentication + * @param prompt The prompt to display to the user when requesting + * authentication info + * @param scheme The authentication scheme in use + * + * @return A PasswordAuthentication object with the user's + * authentication info. + * + * @exception SecurityException If the caller does not have permission to + * perform this operation + * + * @since 1.4 + */ + public static PasswordAuthentication + requestPasswordAuthentication(String host, InetAddress addr, int port, + String protocol, String prompt, String scheme) + throws SecurityException { SecurityManager sm = System.getSecurityManager(); if (sm != null) *************** requestPasswordAuthentication(InetAddres *** 164,169 **** --- 208,214 ---- if (default_authenticator == null) return(null); + default_authenticator.host = host; default_authenticator.addr = addr; default_authenticator.port = port; default_authenticator.protocol = protocol; *************** requestPasswordAuthentication(InetAddres *** 173,178 **** --- 218,234 ---- return(default_authenticator.getPasswordAuthentication()); } + /** + * Returns the hostname of the host or proxy requesting authorization, + * or null if not available. + * + * @since 1.4 + */ + protected final String getRequestingHost() + { + return(host); + } + /*************************************************************************/ /* diff -Nrc3pad gcc-3.2.3/libjava/java/net/BindException.java gcc-3.3/libjava/java/net/BindException.java *** gcc-3.2.3/libjava/java/net/BindException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/BindException.java 2002-08-27 17:47:26.000000000 +0000 *************** *** 1,5 **** /* BindException.java -- An exception occurred while binding to a socket ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* BindException.java -- An exception occurred while binding to a socket ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,86 **** package java.net; /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. */ - - /** - * This exception indicates that an error occurred while attempting to bind - * socket to a particular port. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Warren Levy - * @date March 5, 1999. - */ public class BindException extends SocketException { ! /* ! * Constructors ! */ ! ! /** ! * Initializes a new instance of BindException without ! * a descriptive error message. ! */ ! public ! BindException() ! { ! super(); ! } ! ! /*************************************************************************/ ! ! /** ! * Initializes a new instance of BindException with ! * a descriptive error message, such as the text from strerror(3). ! * ! * @param message A message describing the error that occurred. ! */ ! public ! BindException(String message) ! { ! super(message); ! } } // class BindException - --- 38,73 ---- package java.net; /** ! * This exception indicates that an error occurred while attempting to bind ! * socket to a particular port. ! * ! * @author Aaron M. Renn ! * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ public class BindException extends SocketException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5945005768251722951L; ! /** ! * Create a new instance without a descriptive error message. ! */ ! public BindException() ! { ! } + /** + * Create a new instance with a descriptive error message, such as the + * text from strerror(3). + * + * @param message a message describing the error that occurred + */ + public BindException(String message) + { + super(message); + } } // class BindException diff -Nrc3pad gcc-3.2.3/libjava/java/net/ConnectException.java gcc-3.3/libjava/java/net/ConnectException.java *** gcc-3.2.3/libjava/java/net/ConnectException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/ConnectException.java 2002-06-15 19:45:34.000000000 +0000 *************** *** 1,5 **** /* ConnectException.java -- An exception occurred while connecting to a host ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ConnectException.java -- An exception occurred while connecting to a host ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,88 **** package java.net; /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. */ - - /** - * This exception indicates that an error occurred while attempting to - * connect to a remote host. Often this indicates that the remote host - * refused the connection (ie, is not listening on the target socket). - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Warren Levy - * @date March 5, 1999. - */ public class ConnectException extends SocketException { ! /* ! * Constructors ! */ ! ! /** ! * Initializes a new instance of ConnectException without ! * a descriptive error message. ! */ ! public ! ConnectException() ! { ! super(); ! } ! ! /*************************************************************************/ ! ! /** ! * Initializes a new instance of ConnectException with ! * a descriptive error message, such as the text from strerror(3). ! * ! * @param message A message describing the error that occurred. ! */ ! public ! ConnectException(String message) ! { ! super(message); ! } } // class ConnectException - --- 39,75 ---- package java.net; /** ! * This exception indicates that an error occurred while attempting to ! * connect to a remote host. Often this indicates that the remote host ! * refused the connection (ie, is not listening on the target socket). ! * ! * @author Aaron M. Renn ! * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ public class ConnectException extends SocketException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 3831404271622369215L; ! /** ! * Create a new instance without a descriptive error message. ! */ ! public ConnectException() ! { ! } + /** + * Create a new instance with a descriptive error message, such as the + * text from strerror(3). + * + * @param message a message describing the error that occurred + */ + public ConnectException(String message) + { + super(message); + } } // class ConnectException diff -Nrc3pad gcc-3.2.3/libjava/java/net/ContentHandler.java gcc-3.3/libjava/java/net/ContentHandler.java *** gcc-3.2.3/libjava/java/net/ContentHandler.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/ContentHandler.java 2002-08-21 05:34:45.000000000 +0000 *************** public ContentHandler() { } *** 88,91 **** --- 88,123 ---- */ public abstract Object getContent(URLConnection urlc) throws IOException; + /*************************************************************************/ + + /** + * This method reads from the InputStream of the passed in URL + * connection and uses the data downloaded to create an Object + * represening the content. For example, if the URL is pointing to a GIF + * file, this method might return an Image object. This method + * must be implemented by subclasses. If the object doesnt match any type in + * classes it returns null. + * + * @param urlc A URLConnection object to read data from. + * + * @return An object representing the data read + * + * @exception IOException If an error occurs + * + * @since 1.3 + */ + public Object getContent(URLConnection urlc, Class[] classes) + throws IOException + { + Object obj = getContent (urlc); + + for (int i = 0; i < classes.length; i++) + { + if (classes [i].isInstance (obj)) + return obj; + } + + return null; + } + } // class ContentHandler diff -Nrc3pad gcc-3.2.3/libjava/java/net/DatagramPacket.java gcc-3.3/libjava/java/net/DatagramPacket.java *** gcc-3.2.3/libjava/java/net/DatagramPacket.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/DatagramPacket.java 2002-10-03 14:30:48.000000000 +0000 *************** package java.net; *** 44,110 **** */ /** ! * This class models a packet of data that is to be sent across the network ! * using a connectionless protocol such as UDP. It contains the data ! * to be send, as well as the destination address and port. Note that ! * datagram packets can arrive in any order and are not guaranteed to be ! * delivered at all. ! *

        ! * This class can also be used for receiving data from the network. ! *

        ! * Note that for all method below where the buffer length passed by the ! * caller cannot exceed the actually length of the byte array passed as ! * the buffer, if this condition is not true, then the method silently ! * reduces the length value to maximum allowable value. ! * ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! * ! * @author Warren Levy ! * @author Aarom M. Renn (arenn@urbanophile.com) (Documentation comments) ! * @date April 28, 1999. ! */ ! public final class DatagramPacket { ! /** ! * The data buffer to send ! */ private byte[] buffer; ! /** ! * This is the offset into the buffer to start sending from or receiving to. ! */ private int offset; ! /** ! * The length of the data buffer to send ! */ private int length; ! /** ! * The address to which the packet should be sent or from which it ! * was received ! */ private InetAddress address; ! /** ! * The port to which the packet should be sent or from which it was ! * was received. ! */ private int port; ! /** ! * This method initializes a new instance of DatagramPacket ! * which has the specified buffer, offset, and length. ! * ! * @param buf The buffer for holding the incoming datagram. ! * @param offset The offset into the buffer to start writing. ! * @param length The maximum number of bytes to read. ! * ! * @since Java 1.2 ! */ public DatagramPacket(byte[] buf, int offset, int length) { if (buf == null) --- 44,109 ---- */ /** ! * This class models a packet of data that is to be sent across the network ! * using a connectionless protocol such as UDP. It contains the data ! * to be send, as well as the destination address and port. Note that ! * datagram packets can arrive in any order and are not guaranteed to be ! * delivered at all. ! *

        ! * This class can also be used for receiving data from the network. ! *

        ! * Note that for all method below where the buffer length passed by the ! * caller cannot exceed the actually length of the byte array passed as ! * the buffer, if this condition is not true, then the method silently ! * reduces the length value to maximum allowable value. ! * ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! * ! * @author Warren Levy ! * @author Aarom M. Renn (arenn@urbanophile.com) (Documentation comments) ! * @date April 28, 1999. ! */ public final class DatagramPacket { ! /** ! * The data buffer to send ! */ private byte[] buffer; ! /** ! * This is the offset into the buffer to start sending from or receiving to. ! */ private int offset; ! /** ! * The length of the data buffer to send ! */ private int length; ! /** ! * The address to which the packet should be sent or from which it ! * was received ! */ private InetAddress address; ! /** ! * The port to which the packet should be sent or from which it was ! * was received. ! */ private int port; ! /** ! * This method initializes a new instance of DatagramPacket ! * which has the specified buffer, offset, and length. ! * ! * @param buf The buffer for holding the incoming datagram. ! * @param offset The offset into the buffer to start writing. ! * @param length The maximum number of bytes to read. ! * ! * @since 1.2 ! */ public DatagramPacket(byte[] buf, int offset, int length) { if (buf == null) *************** public final class DatagramPacket *** 124,153 **** this.port = -1; } ! /** ! * Initializes a new instance of DatagramPacket for ! * receiving packets from the network. ! * ! * @param buf A buffer for storing the returned packet data ! * @param length The length of the buffer (must be <= buf.length) ! */ public DatagramPacket(byte[] buf, int length) { this(buf, 0, length); } ! /** ! * Initializes a new instance of DatagramPacket for ! * transmitting packets across the network. ! * ! * @param buf A buffer containing the data to send ! * @param offset The offset into the buffer to start writing from. ! * @param len The length of the buffer (must be <= buf.length) ! * @param addr The address to send to ! * @param port The port to send to ! * ! * @since Java 1.2 ! */ public DatagramPacket(byte[] buf, int offset, int length, InetAddress address, int port) { --- 123,152 ---- this.port = -1; } ! /** ! * Initializes a new instance of DatagramPacket for ! * receiving packets from the network. ! * ! * @param buf A buffer for storing the returned packet data ! * @param length The length of the buffer (must be <= buf.length) ! */ public DatagramPacket(byte[] buf, int length) { this(buf, 0, length); } ! /** ! * Initializes a new instance of DatagramPacket for ! * transmitting packets across the network. ! * ! * @param buf A buffer containing the data to send ! * @param offset The offset into the buffer to start writing from. ! * @param len The length of the buffer (must be <= buf.length) ! * @param addr The address to send to ! * @param port The port to send to ! * ! * @since 1.2 ! */ public DatagramPacket(byte[] buf, int offset, int length, InetAddress address, int port) { *************** public final class DatagramPacket *** 172,257 **** this.port = port; } ! /** ! * Initializes a new instance of DatagramPacket for ! * transmitting packets across the network. ! * ! * @param buf A buffer containing the data to send ! * @param length The length of the buffer (must be <= buf.length) ! * @param address The address to send to ! * @param port The port to send to ! */ public DatagramPacket(byte[] buf, int length, InetAddress address, int port) { this(buf, 0, length, address, port); } ! /** ! * Returns the address that this packet is being sent to or, if it was used ! * to receive a packet, the address that is was received from. If the ! * constructor that doesn not take an address was used to create this object ! * and no packet was actually read into this object, then this method ! * returns null. ! * ! * @return The address for this packet. ! */ public synchronized InetAddress getAddress() { return address; } ! /** ! * Returns the port number this packet is being sent to or, if it was used ! * to receive a packet, the port that it was received from. If the ! * constructor that doesn not take an address was used to create this object ! * and no packet was actually read into this object, then this method ! * will return 0. ! * ! * @return The port number for this packet ! */ public synchronized int getPort() { return port; } ! /** ! * Returns the data buffer for this packet ! * ! * @return This packet's data buffer ! */ public synchronized byte[] getData() { return buffer; } ! /** ! * This method returns the current offset value into the data buffer ! * where data will be sent from. ! * ! * @return The buffer offset. ! * ! * @since Java 1.2 ! */ public synchronized int getOffset() { return offset; } ! /** ! * Returns the length of the data in the buffer ! * ! * @return The length of the data ! */ public synchronized int getLength() { return length; } ! /** ! * This sets the address to which the data packet will be transmitted. ! * ! * @param addr The destination address ! */ public synchronized void setAddress(InetAddress iaddr) { if (iaddr == null) --- 171,300 ---- this.port = port; } ! /** ! * Initializes a new instance of DatagramPacket for ! * transmitting packets across the network. ! * ! * @param buf A buffer containing the data to send ! * @param length The length of the buffer (must be <= buf.length) ! * @param address The address to send to ! * @param port The port to send to ! */ public DatagramPacket(byte[] buf, int length, InetAddress address, int port) { this(buf, 0, length, address, port); } ! /** ! * Initializes a new instance of DatagramPacket for ! * transmitting packets across the network. ! * ! * @param buf A buffer containing the data to send ! * @param offset The offset into the buffer to start writing from. ! * @param length The length of the buffer (must be <= buf.length) ! * @param address The socket address to send to ! * ! * @exception SocketException If an error occurs ! * @exception IllegalArgumentException If address type is not supported ! * ! * @since 1.4 ! */ ! public DatagramPacket(byte[] buf, int offset, int length, ! SocketAddress address) ! throws SocketException ! { ! this(buf, offset, length, ((InetSocketAddress)address).getAddress(), ! ((InetSocketAddress)address).getPort()); ! } ! ! /** ! * Initializes a new instance of DatagramPacket for ! * transmitting packets across the network. ! * ! * @param buf A buffer containing the data to send ! * @param length The length of the buffer (must be <= buf.length) ! * @param address The socket address to send to ! * ! * @exception SocketException If an error occurs ! * @exception IllegalArgumentException If address type is not supported ! * ! * @since 1.4 ! */ ! public DatagramPacket(byte[] buf, int length, SocketAddress address) ! throws SocketException ! { ! this(buf, 0, length, ((InetSocketAddress)address).getAddress(), ! ((InetSocketAddress)address).getPort()); ! } ! ! /** ! * Returns the address that this packet is being sent to or, if it was used ! * to receive a packet, the address that is was received from. If the ! * constructor that doesn not take an address was used to create this object ! * and no packet was actually read into this object, then this method ! * returns null. ! * ! * @return The address for this packet. ! */ public synchronized InetAddress getAddress() { return address; } ! /** ! * Returns the port number this packet is being sent to or, if it was used ! * to receive a packet, the port that it was received from. If the ! * constructor that doesn not take an address was used to create this object ! * and no packet was actually read into this object, then this method ! * will return 0. ! * ! * @return The port number for this packet ! */ public synchronized int getPort() { return port; } ! /** ! * Returns the data buffer for this packet ! * ! * @return This packet's data buffer ! */ public synchronized byte[] getData() { return buffer; } ! /** ! * This method returns the current offset value into the data buffer ! * where data will be sent from. ! * ! * @return The buffer offset. ! * ! * @since 1.2 ! */ public synchronized int getOffset() { return offset; } ! /** ! * Returns the length of the data in the buffer ! * ! * @return The length of the data ! */ public synchronized int getLength() { return length; } ! /** ! * This sets the address to which the data packet will be transmitted. ! * ! * @param addr The destination address ! * ! * @since 1.1 ! */ public synchronized void setAddress(InetAddress iaddr) { if (iaddr == null) *************** public final class DatagramPacket *** 260,270 **** address = iaddr; } ! /** ! * This sets the port to which the data packet will be transmitted. ! * ! * @param port The destination port ! */ public synchronized void setPort(int iport) { if (iport < 0 || iport > 65535) --- 303,315 ---- address = iaddr; } ! /** ! * This sets the port to which the data packet will be transmitted. ! * ! * @param port The destination port ! * ! * @since 1.1 ! */ public synchronized void setPort(int iport) { if (iport < 0 || iport > 65535) *************** public final class DatagramPacket *** 273,283 **** port = iport; } ! /** ! * Sets the data buffer for this packet. ! * ! * @param buf The new buffer for this packet ! */ public synchronized void setData(byte[] buf) { // This form of setData requires setLength to be called separately --- 318,364 ---- port = iport; } ! /** ! * Sets the address of the remote host this package will be sent ! * ! * @param address The socket address of the remove host ! * ! * @exception IllegalArgumentException If address type is not supported ! * ! * @since 1.4 ! */ ! public void setSocketAddress(SocketAddress address) ! throws IllegalArgumentException ! { ! if (address == null) throw new IllegalArgumentException(); ! ! InetSocketAddress tmp = (InetSocketAddress)address; ! this.address = tmp.getAddress(); ! this.port = tmp.getPort(); ! } ! ! /** ! * Gets the socket address of the host this packet ! * will be sent to/is coming from ! * ! * @return The socket address of the remote host ! * ! * @since 1.4 ! */ ! public SocketAddress getSocketAddress() ! { ! return new InetSocketAddress (address, port); ! } ! ! /** ! * Sets the data buffer for this packet. ! * ! * @param buf The new buffer for this packet ! * ! * @exception NullPointerException If the argument is null ! * ! * @since 1.1 ! */ public synchronized void setData(byte[] buf) { // This form of setData requires setLength to be called separately *************** public final class DatagramPacket *** 288,302 **** buffer = buf; } ! /** ! * This method sets the data buffer for the packet. ! * ! * @param buf The byte array containing the data for this packet. ! * @param offset The offset into the buffer to start reading data from. ! * @param length The number of bytes of data in the buffer. ! * ! * @since Java 1.2 ! */ public synchronized void setData(byte[] buf, int offset, int length) { // This form of setData must be used if offset is to be changed. --- 369,385 ---- buffer = buf; } ! /** ! * This method sets the data buffer for the packet. ! * ! * @param buf The byte array containing the data for this packet. ! * @param offset The offset into the buffer to start reading data from. ! * @param length The number of bytes of data in the buffer. ! * ! * @exception NullPointerException If the argument is null ! * ! * @since 1.2 ! */ public synchronized void setData(byte[] buf, int offset, int length) { // This form of setData must be used if offset is to be changed. *************** public final class DatagramPacket *** 316,326 **** this.length = length; } ! /** ! * Sets the length of the data in the buffer. ! * ! * @param length The new length. (Where len <= buf.length) ! */ public synchronized void setLength(int length) { if (length < 0) --- 399,414 ---- this.length = length; } ! /** ! * Sets the length of the data in the buffer. ! * ! * @param length The new length. (Where len <= buf.length) ! * ! * @exception IllegalArgumentException If the length is negative or ! * if the length is greater than the packet's data buffer length ! * ! * @since 1.1 ! */ public synchronized void setLength(int length) { if (length < 0) diff -Nrc3pad gcc-3.2.3/libjava/java/net/DatagramSocketImplFactory.java gcc-3.3/libjava/java/net/DatagramSocketImplFactory.java *** gcc-3.2.3/libjava/java/net/DatagramSocketImplFactory.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/DatagramSocketImplFactory.java 2002-08-28 19:23:50.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* DatagramSocketImplFactory.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + /** Written using on-line Java Platform 1.4 API Specification. + * Status: Believed complete and correct. + */ + + /** + * This interface defines one method which returns a DatagramSocketImpl object. + * This should not be needed by ordinary applications. + * + * @author Michael Koch + * @since 1.3 + */ + public interface DatagramSocketImplFactory + { + /** + * This method returns an instance of the DatagramSocketImpl object + * + * @return A DatagramSocketImpl object + */ + DatagramSocketImpl createDatagramSocketImpl(); + } // interface DatagramSocketImplFactory diff -Nrc3pad gcc-3.2.3/libjava/java/net/DatagramSocketImpl.java gcc-3.3/libjava/java/net/DatagramSocketImpl.java *** gcc-3.2.3/libjava/java/net/DatagramSocketImpl.java 2002-02-14 23:16:06.000000000 +0000 --- gcc-3.3/libjava/java/net/DatagramSocketImpl.java 2002-09-25 05:05:06.000000000 +0000 *************** import java.io.IOException; *** 42,57 **** import java.io.FileDescriptor; /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. * - *

        This abstract class models a datagram socket implementation. An - * actual implementation class would implement these methods, probably - * via redirecting them to native code. - * * @author Aaron M. Renn (arenn@urbanophile.com) * @author Warren Levy */ public abstract class DatagramSocketImpl implements SocketOptions { --- 42,59 ---- import java.io.FileDescriptor; /** + * This abstract class models a datagram socket implementation. An + * actual implementation class would implement these methods, probably + * via redirecting them to native code. + *

        * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). + *

        * Status: Believed complete and correct. * * @author Aaron M. Renn (arenn@urbanophile.com) * @author Warren Levy + * @since 1.1 */ public abstract class DatagramSocketImpl implements SocketOptions { *************** public abstract class DatagramSocketImpl *** 106,121 **** --- 108,146 ---- * @return The port number of the sender of the packet * * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. */ protected abstract int peek(InetAddress i) throws IOException; /** + * Takes a peek at the next packet received. This packet is not consumed. + * With the next peekData/receive operation this packet will be read again. + * + * @param p The DatagramPacket to fill in with the data sent. + * + * @return The port number of the sender of the packet. + * + * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. + * + * @since 1.4 + */ + protected abstract int peekData (DatagramPacket p) throws IOException; + + /** * Transmits the specified packet of data to the network. The destination * host and port should be encoded in the packet. * * @param p The packet to send * * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. */ protected abstract void send(DatagramPacket p) throws IOException; *************** public abstract class DatagramSocketImpl *** 127,136 **** --- 152,189 ---- * @param p A place to store the incoming packet. * * @exception IOException If an error occurs + * @exception PortUnreachableException May be thrown if the socket is + * connected to a currently unreachable destination. Note, there is no + * guarantee that the exception will be thrown. */ protected abstract void receive(DatagramPacket p) throws IOException; /** + * Connects the socket to a host specified by address and port. + * + * @param address The InetAddress of the host to connect to + * @param port The port number of the host to connect to + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + protected void connect (InetAddress address, int port) throws SocketException + { + // This method has to be overwritten by real implementations + } + + /** + * Disconnects the socket. + * + * @since 1.4 + */ + protected void disconnect () + { + // This method has to be overwritten by real implementations + } + + /** * Sets the Time to Live (TTL) setting on this socket to the specified * value. Use setTimeToLive(int) instead. * *************** public abstract class DatagramSocketImpl *** 187,192 **** --- 240,274 ---- protected abstract void leave(InetAddress inetaddr) throws IOException; /** + * Causes this socket to join the specified multicast group on a specified + * device + * + * @param mcastaddr The address to leave + * @param netIf The specified network interface to join the group at + * + * @exception IOException If an error occurs + * + * @since 1.4 + */ + protected abstract void joinGroup (SocketAddress mcastaddr, + NetworkInterface netIf) + throws IOException; + + /** + * Leaves a multicast group + * + * @param mcastaddr The address to join + * @param netIf The specified network interface to leave the group at + * + * @exception IOException If an error occurs + * + * @since 1.4 + */ + protected abstract void leaveGroup (SocketAddress mcastaddr, + NetworkInterface netIf) + throws IOException; + + /** * Returns the FileDescriptor for this socket */ protected FileDescriptor getFileDescriptor() *************** public abstract class DatagramSocketImpl *** 206,212 **** * Sets the specified option on a socket to the passed in object. For * options that take an integer argument, the passed in object is an * Integer. For options that are set to on or off, the ! * value passed will be a Boolean. The option_id * parameter is one of the defined constants in the superinterface. * * @param option_id The identifier of the option --- 288,294 ---- * Sets the specified option on a socket to the passed in object. For * options that take an integer argument, the passed in object is an * Integer. For options that are set to on or off, the ! * value passed will be a Boolean. The option_id * parameter is one of the defined constants in the superinterface. * * @param option_id The identifier of the option *************** public abstract class DatagramSocketImpl *** 219,227 **** throws SocketException; /** ! * Returns the current setting of the specified option. The ! * Object returned will be an Integer for options ! * that have integer values. For options that are set to on or off, a * Boolean will be returned. The option_id * is one of the defined constants in the superinterface. * --- 301,309 ---- throws SocketException; /** ! * Returns the current setting of the specified option. The ! * Object returned will be an Integer for options ! * that have integer values. For options that are set to on or off, a * Boolean will be returned. The option_id * is one of the defined constants in the superinterface. * diff -Nrc3pad gcc-3.2.3/libjava/java/net/DatagramSocket.java gcc-3.3/libjava/java/net/DatagramSocket.java *** gcc-3.2.3/libjava/java/net/DatagramSocket.java 2002-01-13 11:59:37.000000000 +0000 --- gcc-3.3/libjava/java/net/DatagramSocket.java 2003-03-02 00:17:09.000000000 +0000 *************** *** 1,20 **** ! // DatagramSocket.java ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package java.net; - import java.io.IOException; ! /** ! * @author Warren Levy ! * @date May 3, 1999. ! */ /** * Written using on-line Java Platform 1.2 API Specification, as well --- 1,45 ---- ! /* DatagramSocket.java -- A class to model UDP sockets ! Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.net; ! import java.io.IOException; ! import java.nio.channels.DatagramChannel; ! import java.nio.channels.IllegalBlockingModeException; /** * Written using on-line Java Platform 1.2 API Specification, as well *************** import java.io.IOException; *** 22,41 **** --- 47,151 ---- * Status: Believed complete and correct. */ + /** + * This class models a connectionless datagram socket that sends + * individual packets of data across the network. In the TCP/IP world, + * this means UDP. Datagram packets do not have guaranteed delivery, + * or any guarantee about the order the data will be received on the + * remote host. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy (warrenl@cygnus.com) + * @date May 3, 1999. + */ + public class DatagramSocket { + /** + * This is the user DatagramSocketImplFactory for this class. If this + * variable is null, a default factory is used. + */ + static DatagramSocketImplFactory factory; + + /** + * This is the implementation object used by this socket. + */ DatagramSocketImpl impl; + /** + * The unique DatagramChannel object associated with this datagram socket, + * or null. + */ + DatagramChannel ch; + + /** + * This is the address we are "connected" to + */ + private InetAddress remoteAddress; + + /** + * This is the port we are "connected" to + */ + private int remotePort = -1; + + /** + * Indicates when the socket is closed. + */ + private boolean closed = false; + + /** + * Creates a DatagramSocket from a specified DatagramSocketImpl instance + * + * @param impl The DatagramSocketImpl the socket will be created from + * + * @since 1.4 + */ + protected DatagramSocket (DatagramSocketImpl impl) + { + this.impl = impl; + this.remoteAddress = null; + this.remotePort = -1; + } + + /** + * Initializes a new instance of DatagramSocket that binds to + * a random port and every address on the local machine. + * + * @exception SocketException If an error occurs. + * @exception SecurityException If a security manager exists and + * its checkListen method doesn't allow the operation. + */ public DatagramSocket() throws SocketException { this(0, null); } + /** + * Initializes a new instance of DatagramSocket that binds to + * the specified port and every address on the local machine. + * + * @param port The local port number to bind to. + * + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation. + * @exception SocketException If an error occurs. + */ public DatagramSocket(int port) throws SocketException { this(port, null); } + /** + * Initializes a new instance of DatagramSocket that binds to + * the specified local port and address. + * + * @param port The local port number to bind to. + * @param laddr The local address to bind to. + * + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation. + * @exception SocketException If an error occurs. + */ public DatagramSocket(int port, InetAddress laddr) throws SocketException { if (port < 0 || port > 65535) *************** public class DatagramSocket *** 51,58 **** else try { ! impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + ! "DatagramSocketImpl").newInstance(); } catch (Exception e) { --- 161,168 ---- else try { ! impl = (DatagramSocketImpl) Class.forName ! ("java.net." + propVal + "DatagramSocketImpl").newInstance(); } catch (Exception e) { *************** public class DatagramSocket *** 67,82 **** impl.setOption(SocketOptions.SO_REUSEADDR, new Boolean(true)); impl.bind(port, laddr == null ? InetAddress.ANY_IF : laddr); } public void close() { ! impl.close(); } public InetAddress getLocalAddress() { - SecurityManager s = System.getSecurityManager(); // FIXME: JCL p. 510 says this should call checkConnect. But what // string should be used as the hostname? Maybe this is just a side // effect of calling InetAddress.getLocalHost. --- 177,255 ---- impl.setOption(SocketOptions.SO_REUSEADDR, new Boolean(true)); impl.bind(port, laddr == null ? InetAddress.ANY_IF : laddr); + + remoteAddress = null; + remotePort = -1; } + /** + * Initializes a new instance of DatagramSocket that binds to + * the specified local port and address. + * + * @param port The local port number to bind to. + * @param laddr The local address to bind to. + * + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation. + * @exception SocketException If an error occurs. + * + * @since 1.4 + */ + public DatagramSocket (SocketAddress address) throws SocketException + { + this (((InetSocketAddress) address).getPort (), + ((InetSocketAddress) address).getAddress ()); + } + + /** + * Closes this datagram socket. + */ public void close() { ! if (!closed) ! { ! impl.close(); ! remoteAddress = null; ! remotePort = -1; ! closed = true; ! } } + /** + * This method returns the remote address to which this socket is + * connected. If this socket is not connected, then this method will + * return null. + * + * @return The remote address. + * + * @since 1.2 + */ + public InetAddress getInetAddress() + { + return remoteAddress; + } + + /** + * This method returns the remote port to which this socket is + * connected. If this socket is not connected, then this method will + * return -1. + * + * @return The remote port. + * + * @since 1.2 + */ + public int getPort() + { + return remotePort; + } + + /** + * Returns the local address this datagram socket is bound to. + * + * @since 1.1 + */ public InetAddress getLocalAddress() { // FIXME: JCL p. 510 says this should call checkConnect. But what // string should be used as the hostname? Maybe this is just a side // effect of calling InetAddress.getLocalHost. *************** public class DatagramSocket *** 95,101 **** // s.checkConnect("localhost", -1); try { ! return (InetAddress)impl.getOption(SocketOptions.SO_BINDADDR); } catch (SocketException ex) { --- 268,274 ---- // s.checkConnect("localhost", -1); try { ! return (InetAddress)impl.getOption(SocketOptions.SO_BINDADDR); } catch (SocketException ex) { *************** public class DatagramSocket *** 103,157 **** try { ! return InetAddress.getLocalHost(); } catch (UnknownHostException ex) { ! // FIXME: This should never happen, so how can we avoid this construct? ! return null; } } public int getLocalPort() { return impl.getLocalPort(); } public synchronized int getSoTimeout() throws SocketException { Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT); if (timeout instanceof Integer) return ((Integer)timeout).intValue(); else return 0; } ! public synchronized void receive(DatagramPacket p) throws IOException ! { ! SecurityManager s = System.getSecurityManager(); ! if (s != null) ! s.checkAccept(p.getAddress().getHostAddress(), p.getPort()); ! ! impl.receive(p); ! } ! ! public void send(DatagramPacket p) throws IOException ! { ! // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api. ! SecurityManager s = System.getSecurityManager(); ! if (s != null) ! { ! InetAddress addr = p.getAddress(); ! if (addr.isMulticastAddress()) ! s.checkMulticast(addr); ! else ! s.checkConnect(addr.getHostAddress(), p.getPort()); ! } ! ! // FIXME: if this is a subclass of MulticastSocket, use getTTL for TTL val. ! impl.send(p); ! } ! public synchronized void setSoTimeout(int timeout) throws SocketException { if (timeout < 0) --- 276,337 ---- try { ! return InetAddress.getLocalHost(); } catch (UnknownHostException ex) { ! // FIXME: This should never happen, so how can we avoid this construct? ! return null; } } + /** + * Returns the local port this socket is bound to. + * + * @return The local port number. + */ public int getLocalPort() { + if (!isBound ()) + return -1; + return impl.getLocalPort(); } + /** + * Returns the value of the socket's SO_TIMEOUT setting. If this method + * returns 0 then SO_TIMEOUT is disabled. + * + * @return The current timeout in milliseconds. + * + * @exception SocketException If an error occurs. + * + * @since 1.1 + */ public synchronized int getSoTimeout() throws SocketException { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT); + if (timeout instanceof Integer) return ((Integer)timeout).intValue(); else return 0; } ! /** ! * Sets the value of the socket's SO_TIMEOUT value. A value of 0 will ! * disable SO_TIMEOUT. Any other value is the number of milliseconds ! * a socket read/write will block before timing out. ! * ! * @param timeout The new SO_TIMEOUT value in milliseconds. ! * ! * @exception SocketException If an error occurs. ! * ! * @since 1.1 ! */ public synchronized void setSoTimeout(int timeout) throws SocketException { if (timeout < 0) *************** public class DatagramSocket *** 160,224 **** impl.setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout)); } - // JDK1.2 - // public void connect(InetAddress address, int port) - // { - // } - - // JDK1.2 - // public void disconnect() - // { - // } - - // JDK1.2 - // public InetAddress getInetAddress() - // { - // } - - // JDK1.2 - // public int getPort() - // { - // } - /** * This method returns the value of the system level socket option ! * SO_RCVBUF, which is used by the operating system to tune buffer * sizes for data transfers. * ! * @return The receive buffer size. * * @exception SocketException If an error occurs. * * @since 1.2 */ ! public int getReceiveBufferSize() throws SocketException { ! Object obj = impl.getOption(SocketOptions.SO_RCVBUF); ! if (obj instanceof Integer) return(((Integer)obj).intValue()); ! else throw new SocketException("Unexpected type"); } /** * This method returns the value of the system level socket option ! * SO_SNDBUF, which is used by the operating system to tune buffer * sizes for data transfers. * ! * @return The send buffer size. * * @exception SocketException If an error occurs. * * @since 1.2 */ ! public int getSendBufferSize() throws SocketException { ! Object obj = impl.getOption(SocketOptions.SO_SNDBUF); if (obj instanceof Integer) return(((Integer)obj).intValue()); ! else throw new SocketException("Unexpected type"); } --- 340,410 ---- impl.setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout)); } /** * This method returns the value of the system level socket option ! * SO_SNDBUF, which is used by the operating system to tune buffer * sizes for data transfers. * ! * @return The send buffer size. * * @exception SocketException If an error occurs. * * @since 1.2 */ ! public int getSendBufferSize() throws SocketException { ! if (impl == null) ! throw new SocketException ("Cannot initialize Socket implementation"); ! ! Object obj = impl.getOption(SocketOptions.SO_SNDBUF); ! if (obj instanceof Integer) return(((Integer)obj).intValue()); ! else throw new SocketException("Unexpected type"); } /** + * This method sets the value for the system level socket option + * SO_SNDBUF to the specified value. Note that valid values for this + * option are specific to a given operating system. + * + * @param size The new send buffer size. + * + * @exception SocketException If an error occurs. + * @exception IllegalArgumentException If size is 0 or negative. + * + * @since 1.2 + */ + public void setSendBufferSize(int size) throws SocketException + { + if (size < 0) + throw new IllegalArgumentException("Buffer size is less than 0"); + + impl.setOption(SocketOptions.SO_SNDBUF, new Integer(size)); + } + + /** * This method returns the value of the system level socket option ! * SO_RCVBUF, which is used by the operating system to tune buffer * sizes for data transfers. * ! * @return The receive buffer size. * * @exception SocketException If an error occurs. * * @since 1.2 */ ! public int getReceiveBufferSize() throws SocketException { ! if (impl == null) ! throw new SocketException ("Cannot initialize Socket implementation"); + Object obj = impl.getOption(SocketOptions.SO_RCVBUF); + if (obj instanceof Integer) return(((Integer)obj).intValue()); ! else throw new SocketException("Unexpected type"); } *************** public class DatagramSocket *** 230,240 **** * @param size The new receive buffer size. * * @exception SocketException If an error occurs. ! * * @since 1.2 */ public void setReceiveBufferSize(int size) throws SocketException { if (size < 0) throw new IllegalArgumentException("Buffer size is less than 0"); --- 416,430 ---- * @param size The new receive buffer size. * * @exception SocketException If an error occurs. ! * @exception IllegalArgumentException If size is 0 or negative. ! * * @since 1.2 */ public void setReceiveBufferSize(int size) throws SocketException { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + if (size < 0) throw new IllegalArgumentException("Buffer size is less than 0"); *************** public class DatagramSocket *** 242,262 **** } /** ! * This method sets the value for the system level socket option ! * SO_SNDBUF to the specified value. Note that valid values for this ! * option are specific to a given operating system. ! * ! * @param size The new send buffer size. * * @exception SocketException If an error occurs. * * @since 1.2 */ ! public void setSendBufferSize(int size) throws SocketException { ! if (size < 0) ! throw new IllegalArgumentException("Buffer size is less than 0"); ! impl.setOption(SocketOptions.SO_SNDBUF, new Integer(size)); } } --- 432,844 ---- } /** ! * This method connects this socket to the specified address and port. ! * When a datagram socket is connected, it will only send or receive ! * packets to and from the host to which it is connected. A multicast ! * socket that is connected may only send and not receive packets. ! * ! * @param address The address to connect this socket to. ! * @param port The port to connect this socket to. * * @exception SocketException If an error occurs. + * @exception IllegalArgumentException If address or port are invalid. + * @exception SecurityException If the caller is not allowed to send + * datagrams to or receive from this address and port. * * @since 1.2 */ ! public void connect(InetAddress address, int port) { ! if (address == null) ! throw new IllegalArgumentException ("Connect address may not be null"); ! ! if ((port < 1) || (port > 65535)) ! throw new IllegalArgumentException ("Port number is illegal: " + port); ! ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! sm.checkConnect(address.getHostName(), port); ! ! try ! { ! impl.connect (address, port); ! remoteAddress = address; ! remotePort = port; ! } ! catch (SocketException e) ! { ! } ! } ! ! /** ! * This method disconnects this socket from the address/port it was ! * connected to. If the socket was not connected in the first place, ! * this method does nothing. ! * ! * @since 1.2 ! */ ! public void disconnect() ! { ! impl.disconnect(); ! remoteAddress = null; ! remotePort = -1; ! } ! ! /** ! * Reads a datagram packet from the socket. Note that this method ! * will block until a packet is received from the network. On return, ! * the passed in DatagramPacket is populated with the data ! * received and all the other information about the packet. ! * ! * @param p The datagram packet to put the incoming data into. ! * ! * @exception IOException If an error occurs. ! * @exception SocketTimeoutException If setSoTimeout was previously called ! * and the timeout has expired. ! * @exception PortUnreachableException If the socket is connected to a ! * currently unreachable destination. Note, there is no guarantee that the ! * exception will be thrown. ! * @exception IllegalBlockingModeException If this socket has an associated ! * channel, and the channel is in non-blocking mode. ! * @exception SecurityException If a security manager exists and its ! * checkAccept ethod doesn't allow the receive. ! */ ! public synchronized void receive(DatagramPacket p) throws IOException ! { ! if (impl == null) ! throw new IOException ("Cannot initialize Socket implementation"); ! ! if (remoteAddress != null && remoteAddress.isMulticastAddress ()) ! throw new IOException ( ! "Socket connected to a multicast address my not receive"); ! ! if (ch != null && !ch.isBlocking ()) ! throw new IllegalBlockingModeException (); ! ! impl.receive(p); ! ! SecurityManager s = System.getSecurityManager(); ! if (s != null && isConnected ()) ! s.checkAccept (p.getAddress().getHostName (), p.getPort ()); ! } ! ! /** ! * Sends the specified packet. The host and port to which the packet ! * are to be sent should be set inside the packet. ! * ! * @param p The datagram packet to send. ! * ! * @exception IOException If an error occurs. ! * @exception SecurityException If a security manager exists and its ! * checkMulticast or checkConnect method doesn't allow the send. ! * @exception PortUnreachableException If the socket is connected to a ! * currently unreachable destination. Note, there is no guarantee that the ! * exception will be thrown. ! * @exception IllegalBlockingModeException If this socket has an associated ! * channel, and the channel is in non-blocking mode. ! */ ! public void send(DatagramPacket p) throws IOException ! { ! // JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api. ! SecurityManager s = System.getSecurityManager(); ! if (s != null && !isConnected ()) ! { ! InetAddress addr = p.getAddress(); ! if (addr.isMulticastAddress()) ! s.checkMulticast(addr); ! else ! s.checkConnect(addr.getHostAddress(), p.getPort()); ! } ! ! if (isConnected ()) ! { ! if (p.getAddress () != null && (remoteAddress != p.getAddress () || ! remotePort != p.getPort ())) ! throw new IllegalArgumentException ( ! "DatagramPacket address does not match remote address" ); ! } ! ! // FIXME: if this is a subclass of MulticastSocket, ! // use getTimeToLive for TTL val. ! ! if (ch != null && !ch.isBlocking ()) ! throw new IllegalBlockingModeException (); ! ! impl.send(p); ! } ! ! /** ! * Binds the socket to the given socket address. ! * ! * @param address The socket address to bind to. ! * ! * @exception SocketException If an error occurs. ! * @exception SecurityException If a security manager exists and ! * its checkListen method doesn't allow the operation. ! * @exception IllegalArgumentException If address type is not supported. ! * ! * @since 1.4 ! */ ! public void bind (SocketAddress address) ! throws SocketException ! { ! if (! (address instanceof InetSocketAddress)) ! throw new IllegalArgumentException (); ! ! InetSocketAddress tmp = (InetSocketAddress) address; ! ! SecurityManager s = System.getSecurityManager (); ! if (s != null) ! s.checkListen(tmp.getPort ()); ! ! impl.bind (tmp.getPort (), tmp.getAddress ()); ! } ! ! /** ! * Checks if the datagram socket is closed. ! * ! * @since 1.4 ! */ ! public boolean isClosed() ! { ! return closed; ! } ! ! /** ! * Returns the datagram channel assoziated with this datagram socket. ! * ! * @since 1.4 ! */ ! public DatagramChannel getChannel() ! { ! return ch; ! } ! ! /** ! * Connects the datagram socket to a specified socket address. ! * ! * @param address The socket address to connect to. ! * ! * @exception SocketException If an error occurs. ! * @exception IllegalArgumentException If address type is not supported. ! * ! * @since 1.4 ! */ ! public void connect (SocketAddress address) throws SocketException ! { ! if ( !(address instanceof InetSocketAddress) ) ! throw new IllegalArgumentException ( ! "SocketAddress is not InetSocketAddress"); ! ! InetSocketAddress tmp = (InetSocketAddress) address; ! connect( tmp.getAddress(), tmp.getPort()); ! } ! /** ! * Returns the binding state of the socket. ! * ! * @since 1.4 ! */ ! public boolean isBound() ! { ! try ! { ! Object bindaddr = impl.getOption (SocketOptions.SO_BINDADDR); ! } ! catch (SocketException e) ! { ! return false; ! } ! ! return true; ! } ! ! /** ! * Returns the connection state of the socket. ! * ! * @since 1.4 ! */ ! public boolean isConnected() ! { ! return remoteAddress != null; ! } ! ! /** ! * Returns the SocketAddress of the host this socket is conneted to ! * or null if this socket is not connected. ! * ! * @since 1.4 ! */ ! public SocketAddress getRemoteSocketAddress() ! { ! if (!isConnected ()) ! return null; ! ! return new InetSocketAddress (remoteAddress, remotePort); ! } ! ! /** ! * Returns the local SocketAddress this socket is bound to ! * or null if it is not bound. ! * ! * @since 1.4 ! */ ! public SocketAddress getLocalSocketAddress() ! { ! InetAddress addr; ! ! try ! { ! addr = (InetAddress) impl.getOption (SocketOptions.SO_BINDADDR); ! } ! catch (SocketException e) ! { ! return null; ! } ! ! return new InetSocketAddress (addr, impl.localPort); ! } ! ! /** ! * Enables/Disables SO_REUSEADDR. ! * ! * @param on Whether or not to have SO_REUSEADDR turned on. ! * ! * @exception SocketException If an error occurs. ! * ! * @since 1.4 ! */ ! public void setReuseAddress(boolean on) throws SocketException ! { ! if (impl == null) ! throw new SocketException ("Cannot initialize Socket implementation"); ! ! impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); ! } ! ! /** ! * Checks if SO_REUSEADDR is enabled. ! * ! * @exception SocketException If an error occurs. ! * ! * @since 1.4 ! */ ! public boolean getReuseAddress() throws SocketException ! { ! if (impl == null) ! throw new SocketException ("Cannot initialize Socket implementation"); ! ! Object obj = impl.getOption (SocketOptions.SO_REUSEADDR); ! ! if (obj instanceof Boolean) ! return(((Boolean) obj).booleanValue ()); ! else ! throw new SocketException ("Unexpected type"); ! } ! ! /** ! * Enables/Disables SO_BROADCAST ! * ! * @param on Whether or not to have SO_BROADCAST turned on ! * ! * @exception SocketException If an error occurs ! * ! * @since 1.4 ! */ ! public void setBroadcast(boolean on) throws SocketException ! { ! if (impl == null) ! throw new SocketException ("Cannot initialize Socket implementation"); ! ! impl.setOption (SocketOptions.SO_BROADCAST, new Boolean (on)); ! } ! ! /** ! * Checks if SO_BROADCAST is enabled ! * ! * @exception SocketException If an error occurs ! * ! * @since 1.4 ! */ ! public boolean getBroadcast() throws SocketException ! { ! if (impl == null) ! throw new SocketException ("Cannot initialize Socket implementation"); ! ! Object obj = impl.getOption (SocketOptions.SO_BROADCAST); ! ! if (obj instanceof Boolean) ! return ((Boolean) obj).booleanValue (); ! else ! throw new SocketException ("Unexpected type"); ! } ! ! /** ! * Sets the traffic class value ! * ! * @param tc The traffic class ! * ! * @exception SocketException If an error occurs ! * @exception IllegalArgumentException If tc value is illegal ! * ! * @see DatagramSocket:getTrafficClass ! * ! * @since 1.4 ! */ ! public void setTrafficClass(int tc) ! throws SocketException ! { ! if (impl == null) ! throw new SocketException ("Cannot initialize Socket implementation"); ! ! if (tc < 0 || tc > 255) ! throw new IllegalArgumentException(); ! ! impl.setOption (SocketOptions.IP_TOS, new Integer (tc)); ! } ! ! /** ! * Returns the current traffic class ! * ! * @see DatagramSocket:setTrafficClass ! * ! * @exception SocketException If an error occurs ! * ! * @since 1.4 ! */ ! public int getTrafficClass() throws SocketException ! { ! if (impl == null) ! throw new SocketException( "Cannot initialize Socket implementation"); ! ! Object obj = impl.getOption(SocketOptions.IP_TOS); ! ! if (obj instanceof Integer) ! return ((Integer) obj).intValue (); ! else ! throw new SocketException ("Unexpected type"); ! } ! ! /** ! * Sets the datagram socket implementation factory for the application ! * ! * @param fac The factory to set ! * ! * @exception IOException If an error occurs ! * @exception SocketException If the factory is already defined ! * @exception SecurityException If a security manager exists and its ! * checkSetFactory method doesn't allow the operation ! */ ! public static void setDatagramSocketImplFactory ! (DatagramSocketImplFactory fac) throws IOException ! { ! if (factory != null) ! throw new SocketException ("DatagramSocketImplFactory already defined"); ! ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! sm.checkSetFactory(); ! ! factory = fac; } } diff -Nrc3pad gcc-3.2.3/libjava/java/net/FileNameMap.java gcc-3.3/libjava/java/net/FileNameMap.java *** gcc-3.2.3/libjava/java/net/FileNameMap.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/FileNameMap.java 2002-08-27 17:47:26.000000000 +0000 *************** package java.net; *** 50,55 **** --- 50,56 ---- * * @author Aaron M. Renn (arenn@urbanophile.com) * @author Warren Levy + * @since 1.1 */ public interface FileNameMap { diff -Nrc3pad gcc-3.2.3/libjava/java/net/HttpURLConnection.java gcc-3.3/libjava/java/net/HttpURLConnection.java *** gcc-3.2.3/libjava/java/net/HttpURLConnection.java 2000-08-10 09:10:25.000000000 +0000 --- gcc-3.3/libjava/java/net/HttpURLConnection.java 2003-01-03 00:51:33.000000000 +0000 *************** *** 1,92 **** // HttpURLConnection.java - Subclass of communications links using // Hypertext Transfer Protocol. ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package java.net; import java.io.*; ! /** ! * @author Warren Levy ! * @date March 29, 1999. ! */ ! ! /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ public abstract class HttpURLConnection extends URLConnection { /* HTTP Success Response Codes */ public static final int HTTP_OK = 200; public static final int HTTP_CREATED = 201; public static final int HTTP_ACCEPTED = 202; public static final int HTTP_NOT_AUTHORITATIVE = 203; public static final int HTTP_NO_CONTENT = 204; public static final int HTTP_RESET = 205; public static final int HTTP_PARTIAL = 206; /* HTTP Redirection Response Codes */ - public static final int HTTP_MULT_CHOICE = 300; - public static final int HTTP_MOVED_PERM = 301; - public static final int HTTP_MOVED_TEMP = 302; - public static final int HTTP_SEE_OTHER = 303; - public static final int HTTP_NOT_MODIFIED = 304; - public static final int HTTP_USE_PROXY = 305; /* HTTP Client Error Response Codes */ ! public static final int HTTP_BAD_REQUEST = 400; ! public static final int HTTP_UNAUTHORIZED = 401; ! public static final int HTTP_PAYMENT_REQUIRED = 402; ! public static final int HTTP_FORBIDDEN = 403; ! public static final int HTTP_NOT_FOUND = 404; ! public static final int HTTP_BAD_METHOD = 405; ! public static final int HTTP_NOT_ACCEPTABLE = 406; ! public static final int HTTP_PROXY_AUTH = 407; ! public static final int HTTP_CLIENT_TIMEOUT = 408; ! public static final int HTTP_CONFLICT = 409; ! public static final int HTTP_GONE = 410; ! public static final int HTTP_LENGTH_REQUIRED = 411; ! public static final int HTTP_PRECON_FAILED = 412; ! public static final int HTTP_ENTITY_TOO_LARGE = 413; ! public static final int HTTP_REQ_TOO_LONG = 414; ! public static final int HTTP_UNSUPPORTED_TYPE = 415; /* HTTP Server Error Response Codes */ - public static final int HTTP_SERVER_ERROR = 500; - public static final int HTTP_INTERNAL_ERROR = 501; - public static final int HTTP_BAD_GATEWAY = 502; - public static final int HTTP_UNAVAILABLE = 503; - public static final int HTTP_GATEWAY_TIMEOUT = 504; - public static final int HTTP_VERSION = 505; ! static boolean followRedirects = true; protected String method = "GET"; protected int responseCode = -1; ! protected String responseMessage; protected boolean instanceFollowRedirects = followRedirects; private boolean gotResponseVals = false; protected HttpURLConnection(URL url) { super(url); } ! public abstract void disconnect(); public abstract boolean usingProxy(); public static void setFollowRedirects(boolean set) { // Throw an exception if an extant security mgr precludes --- 1,359 ---- // HttpURLConnection.java - Subclass of communications links using // Hypertext Transfer Protocol. ! /* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.net; import java.io.*; + import java.security.Permission; ! /* * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ + /** + * This class provides a common abstract implementation for those + * URL connection classes that will connect using the HTTP protocol. + * In addition to the functionality provided by the URLConnection + * class, it defines constants for HTTP return code values and + * methods for setting the HTTP request method and determining whether + * or not to follow redirects. + * + * @since 1.1 + * + * @author Warren Levy (warrenl@cygnus.com) + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public abstract class HttpURLConnection extends URLConnection { /* HTTP Success Response Codes */ + + /** + * Indicates that the client may continue with its request. This value + * is specified as part of RFC 2068 but was not included in Sun's JDK, so + * beware of using this value + */ + static final int HTTP_CONTINUE = 100; + + /** + * Indicates the request succeeded. + */ public static final int HTTP_OK = 200; + + /** + * The requested resource has been created. + */ public static final int HTTP_CREATED = 201; + + /** + * The request has been accepted for processing but has not completed. + * There is no guarantee that the requested action will actually ever + * be completed succesfully, but everything is ok so far. + */ public static final int HTTP_ACCEPTED = 202; + + /** + * The meta-information returned in the header is not the actual data + * from the original server, but may be from a local or other copy. + * Normally this still indicates a successful completion. + */ public static final int HTTP_NOT_AUTHORITATIVE = 203; + + /** + * The server performed the request, but there is no data to send + * back. This indicates that the user's display should not be changed. + */ public static final int HTTP_NO_CONTENT = 204; + + /** + * The server performed the request, but there is no data to sent back, + * however, the user's display should be "reset" to clear out any form + * fields entered. + */ public static final int HTTP_RESET = 205; + + /** + * The server completed the partial GET request for the resource. + */ public static final int HTTP_PARTIAL = 206; + /* HTTP Redirection Response Codes */ + /** + * There is a list of choices available for the requested resource. + */ + public static final int HTTP_MULT_CHOICE = 300; + + /** + * The resource has been permanently moved to a new location. + */ + public static final int HTTP_MOVED_PERM = 301; + + /** + * The resource requested has been temporarily moved to a new location. + */ + public static final int HTTP_MOVED_TEMP = 302; + + /** + * The response to the request issued is available at another location. + */ + public static final int HTTP_SEE_OTHER = 303; + + /** + * The document has not been modified since the criteria specified in + * a conditional GET. + */ + public static final int HTTP_NOT_MODIFIED = 304; + + /** + * The requested resource needs to be accessed through a proxy. + */ + public static final int HTTP_USE_PROXY = 305; + + /* HTTP Client Error Response Codes */ ! ! /** ! * The request was misformed or could not be understood. ! */ ! public static final int HTTP_BAD_REQUEST = 400; ! ! /** ! * The request made requires user authorization. Try again with ! * a correct authentication header. ! */ ! public static final int HTTP_UNAUTHORIZED = 401; ! ! /** ! * Code reserved for future use - I hope way in the future. ! */ ! public static final int HTTP_PAYMENT_REQUIRED = 402; ! ! /** ! * There is no permission to access the requested resource. ! */ ! public static final int HTTP_FORBIDDEN = 403; ! ! /** ! * The requested resource was not found. ! */ ! public static final int HTTP_NOT_FOUND = 404; ! ! /** ! * The specified request method is not allowed for this resource. ! */ ! public static final int HTTP_BAD_METHOD = 405; ! ! /** ! * Based on the input headers sent, the resource returned in response ! * to the request would not be acceptable to the client. ! */ ! public static final int HTTP_NOT_ACCEPTABLE = 406; ! ! /** ! * The client must authenticate with a proxy prior to attempting this ! * request. ! */ ! public static final int HTTP_PROXY_AUTH = 407; ! ! /** ! * The request timed out. ! */ ! public static final int HTTP_CLIENT_TIMEOUT = 408; ! ! /** ! * There is a conflict between the current state of the resource and the ! * requested action. ! */ ! public static final int HTTP_CONFLICT = 409; ! ! /** ! * The requested resource is no longer available. This ususally indicates ! * a permanent condition. ! */ ! public static final int HTTP_GONE = 410; ! ! /** ! * A Content-Length header is required for this request, but was not ! * supplied. ! */ ! public static final int HTTP_LENGTH_REQUIRED = 411; ! ! /** ! * A client specified pre-condition was not met on the server. ! */ ! public static final int HTTP_PRECON_FAILED = 412; ! ! /** ! * The request sent was too large for the server to handle. ! */ ! public static final int HTTP_ENTITY_TOO_LARGE = 413; ! ! /** ! * The name of the resource specified was too long. ! */ ! public static final int HTTP_REQ_TOO_LONG = 414; ! ! /** ! * The request is in a format not supported by the requested resource. ! */ ! public static final int HTTP_UNSUPPORTED_TYPE = 415; ! /* HTTP Server Error Response Codes */ ! /** ! * This error code indicates that some sort of server error occurred. ! */ ! public static final int HTTP_SERVER_ERROR = 500; ! ! /** ! * The server encountered an unexpected error (such as a CGI script crash) ! * that prevents the request from being fulfilled. ! */ ! public static final int HTTP_INTERNAL_ERROR = 500; ! ! /** ! * The server does not support the requested functionality. ! * @since 1.3 ! */ ! public static final int HTTP_NOT_IMPLEMENTED = 501; ! ! /** ! * The proxy encountered a bad response from the server it was proxy-ing for ! */ ! public static final int HTTP_BAD_GATEWAY = 502; ! ! /** ! * The HTTP service is not availalble, such as because it is overloaded ! * and does not want additional requests. ! */ ! public static final int HTTP_UNAVAILABLE = 503; ! ! /** ! * The proxy timed out getting a reply from the remote server it was ! * proxy-ing for. ! */ ! public static final int HTTP_GATEWAY_TIMEOUT = 504; ! ! /** ! * This server does not support the protocol version requested. ! */ ! public static final int HTTP_VERSION = 505; ! ! // Non-HTTP response static variables ! ! /** ! * Flag to indicate whether or not redirects should be automatically ! * followed by default. ! */ ! private static boolean followRedirects = true; ! ! /** ! * This is a list of valid request methods, separated by "|" characters. ! */ ! private static String valid_methods ! = "|GET|POST|HEAD|OPTIONS|PUT|DELETE|TRACE|"; ! ! // Instance Variables + /** + * The requested method in use for this connection. Default is GET. + */ protected String method = "GET"; + + /** + * The response code received from the server + */ protected int responseCode = -1; ! ! /** ! * The response message string received from the server. ! */ ! protected String responseMessage = null; ! ! /** ! * If this instance should follow redirect requests. ! */ protected boolean instanceFollowRedirects = followRedirects; + /** + * Whether we alreadt got a valid response code for this connection. + * Used by getResponceCode() and + * getResponseMessage(). + */ private boolean gotResponseVals = false; + /** + * Create an HttpURLConnection for the specified URL + * + * @param url The URL to create this connection for. + */ protected HttpURLConnection(URL url) { super(url); } ! ! /** ! * Closes the connection to the server. ! */ public abstract void disconnect(); + /** + * Returns a boolean indicating whether or not this connection is going + * through a proxy + * + * @return true if through a proxy, false otherwise + */ public abstract boolean usingProxy(); + /** + * Sets whether HTTP redirects (requests with response code 3xx) should be + * automatically followed by this class. True by default + * + * @param set true if redirects should be followed, false otherwis. + * + * @exception SecurityException If a security manager exists and its + * checkSetFactory method doesn't allow the operation + */ public static void setFollowRedirects(boolean set) { // Throw an exception if an extant security mgr precludes *************** public abstract class HttpURLConnection *** 98,127 **** followRedirects = set; } public static boolean getFollowRedirects() { return followRedirects; } public void setRequestMethod(String method) throws ProtocolException { if (connected) throw new ProtocolException("Already connected"); ! if (method.equals("GET") || method.equals("POST") || ! method.equals("HEAD") || method.equals("OPTIONS") || ! method.equals("PUT") || method.equals("DELETE") || ! method.equals("TRACE")) this.method = method; else ! throw new ProtocolException("Invalid HTTP request method"); } public String getRequestMethod() { return method; } public int getResponseCode() throws IOException { if (!gotResponseVals) --- 365,438 ---- followRedirects = set; } + /** + * Returns a boolean indicating whether or not HTTP redirects will + * automatically be followed or not. + * + * @return true if redirects will be followed, false otherwise + */ public static boolean getFollowRedirects() { return followRedirects; } + /** + * Returns the value of this HttpURLConnection's instanceFollowRedirects + * field + */ + public boolean getInstanceFollowRedirects () + { + return instanceFollowRedirects; + } + + /** + * Sets the value of this HttpURLConnection's instanceFollowRedirects field + */ + public void setInstanceFollowRedirects (boolean follow) + { + instanceFollowRedirects = follow; + } + + /** + * Set the method for the URL request, one of: + * GET POST HEAD OPTIONS PUT DELETE TRACE are legal + * + * @exception ProtocolException If the method cannot be reset or if the + * requested method isn't valid for HTTP + */ public void setRequestMethod(String method) throws ProtocolException { if (connected) throw new ProtocolException("Already connected"); ! method = method.toUpperCase(); ! if (valid_methods.indexOf("|" + method + "|") != -1) this.method = method; else ! throw new ProtocolException("Invalid HTTP request method: " + method); ! } + /** + * The request method currently in use for this connection. + * + * @return The request method + */ public String getRequestMethod() { return method; } + /** + * Gets the status code from an HTTP response message, or -1 if + * the response code could not be determined. + * Note that all valid response codes have class variables + * defined for them in this class. + * + * @return The response code + * + * @exception IOException If an error occurs + */ public int getResponseCode() throws IOException { if (!gotResponseVals) *************** public abstract class HttpURLConnection *** 129,134 **** --- 440,454 ---- return responseCode; } + /** + * Gets the HTTP response message, if any, returned along with the + * response code from a server. Null if no response message was set + * or an error occured while connecting. + * + * @return The response message + * + * @exception IOException If an error occurs + */ public String getResponseMessage() throws IOException { if (!gotResponseVals) *************** public abstract class HttpURLConnection *** 144,182 **** connect(); gotResponseVals = true; ! // Response is the first header received from the connection. ! String respField = getHeaderField(0); ! ! if (respField == null || ! respField.startsWith("HTTP/")) { ! // Set to default values on failure. ! responseCode = -1; ! responseMessage = null; ! return; } ! int firstSpc, nextSpc; ! firstSpc = respField.indexOf(' '); ! nextSpc = respField.indexOf(' ', firstSpc + 1); ! responseMessage = respField.substring(nextSpc + 1); ! String codeStr = respField.substring(firstSpc + 1, nextSpc); try { ! responseCode = Integer.parseInt(codeStr); } ! catch (NumberFormatException e) { ! // Set to default values on failure. ! responseCode = -1; ! responseMessage = null; } } ! // TODO12: public Permission getPermission() throws IOException ! // { ! // } ! ! // TODO12: public InputStream getErrorStream() ! // { ! // } } --- 464,576 ---- connect(); gotResponseVals = true; ! ! // If responseCode not yet explicitly set by subclass ! if (responseCode == -1) { ! // Response is the first header received from the connection. ! String respField = getHeaderField(0); ! ! if (respField == null || ! respField.startsWith("HTTP/")) ! { ! // Set to default values on failure. ! responseCode = -1; ! responseMessage = null; ! return; ! } ! ! int firstSpc, nextSpc; ! firstSpc = respField.indexOf(' '); ! nextSpc = respField.indexOf(' ', firstSpc + 1); ! responseMessage = respField.substring(nextSpc + 1); ! String codeStr = respField.substring(firstSpc + 1, nextSpc); ! try ! { ! responseCode = Integer.parseInt(codeStr); ! } ! catch (NumberFormatException e) ! { ! // Set to default values on failure. ! responseCode = -1; ! responseMessage = null; ! } } + } ! /** ! * Returns a permission object representing the permission necessary to make ! * the connection represented by this object ! * ! * @exception IOException If an error occurs ! */ ! public Permission getPermission() throws IOException ! { ! URL url = getURL(); ! String host = url.getHost(); ! int port = url.getPort(); ! if (port == -1) ! port = 80; ! ! host = host + ":" + port; ! ! return new SocketPermission(host, "connect"); ! } ! ! /** ! * This method allows the caller to retrieve any data that might have ! * been sent despite the fact that an error occurred. For example, the ! * HTML page sent along with a 404 File Not Found error. If the socket ! * is not connected, or if no error occurred or no data was returned, ! * this method returns null. ! * ! * @return An InputStream for reading error data. ! */ ! public InputStream getErrorStream () ! { ! if (!connected) ! return(null); ! ! int code; ! try ! { ! code = getResponseCode(); ! } ! catch(IOException e) ! { ! code = -1; ! } ! ! if (code == -1) ! return(null); ! ! if (((code/100) != 4) || ((code/100) != 5)) ! return(null); ! try { ! PushbackInputStream pbis = new PushbackInputStream(getInputStream()); ! ! int i = pbis.read(); ! if (i == -1) ! return(null); ! ! pbis.unread(i); ! return(pbis); } ! catch(IOException e) { ! return(null); } } ! /** ! * Returns the value of the named field parsed as date ! */ ! public long getHeaderFieldDate (String key, long value) ! { ! // FIXME: implement this correctly ! // http://www.w3.org/Protocols/HTTP-NG/ng-notes.txt ! ! return super.getHeaderFieldDate (key, value); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/net/Inet4Address.java gcc-3.3/libjava/java/net/Inet4Address.java *** gcc-3.2.3/libjava/java/net/Inet4Address.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/Inet4Address.java 2002-10-10 05:19:22.000000000 +0000 *************** *** 0 **** --- 1,275 ---- + /* Inet4Address.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + import java.io.IOException; + import java.io.ObjectStreamException; + + /** + * @author Michael Koch + * @date August 3, 2002. + */ + + /* + * Written using on-line Java Platform 1.4 API Specification and + * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt), + * RFC 1918 (http://www.ietf.org/rfc/rfc1918.txt), + * RFC 2365 (http://www.ietf.org/rfc/rfc2365.txt) + * Status: Believed complete and correct. + */ + + public final class Inet4Address extends InetAddress + { + static final long serialVersionUID = 7615067291688066509L; + + /** + * needed for serialization + */ + private Object writeReplace () throws ObjectStreamException + { + return new InetAddress (addr, hostName); + } + + /** + * Creates a Inet4Address + * + * @param addr The IP address + * @param host The Hostname + */ + protected Inet4Address(byte[] addr, String host) + { + super (addr, host); + } + + /** + * Checks if the address is a multicast address + * + * @since 1.1 + */ + public boolean isMulticastAddress () + { + return (addr [0] & 0xF0) == 0xE0; + } + + /** + * Checks if this address is a loopback address + */ + public boolean isLoopbackAddress () + { + return addr [0] == 0x7F; + } + + /** + * Checks if this address is a wildcard address + * + * @since 1.4 + */ + public boolean isAnyLocalAddress () + { + byte[] anylocal = { 0, 0, 0, 0 }; + + return addr == anylocal; + } + + /** + * Checks if this address is a link local address + * + * @since 1.4 + */ + public boolean isLinkLocalAddress () + { + // XXX: This seems to not exist with IPv4 addresses + return false; + } + + /** + * Checks if this address is a site local address + * + * @since 1.4 + */ + public boolean isSiteLocalAddress () + { + // 10.0.0.0/8 + if (addr [0] == 0x0A) + return true; + + // XXX: Suns JDK 1.4.1 (on Linux) seems to have a bug here: + // it says 172.16.0.0 - 172.255.255.255 are site local addresses + // + // 172.16.0.0/12 + if (addr [0] == 0xAC && (addr [1] & 0xF0) == 0x01) + return true; + + // 192.168.0.0/16 + if (addr [0] == 0xC0 && addr [1] == 0xA8) + return true; + + // XXX: Do we need to check more addresses here ? + return false; + } + + /** + * Checks if this multicast address has global scope + * + * @since 1.4 + */ + public boolean isMCGlobal () + { + // XXX: This seems to net exist with IPv4 addresses + return false; + } + + /** + * Checks if this multicast address has node scope + * + * @since 1.4 + */ + public boolean isMCNodeLocal () + { + // XXX: This seems to net exist with IPv4 addresses + return false; + } + + /** + * Checks if this multicast address has link scope + * + * @since 1.4 + */ + public boolean isMCLinkLocal () + { + if (!isMulticastAddress ()) + return false; + + return (addr [0] == 0xE0) + && (addr [1] == 0x00) + && (addr [2] == 0x00); + } + + /** + * Checks if this multicast address has site scope + * + * @since 1.4 + */ + public boolean isMCSiteLocal () + { + // XXX: This seems to net exist with IPv4 addresses + return false; + } + + /** + * Checks if this multicast address has organization scope + * + * @since 1.4 + */ + public boolean isMCOrgLocal () + { + // XXX: This seems to net exist with IPv4 addresses + return false; + } + + /** + * Returns the address of the current instance + */ + public byte[] getAddress () + { + return addr; + } + + /** + * Returns the address as string + * + * @since 1.0.2 + */ + public String getHostAddress () + { + StringBuffer sbuf = new StringBuffer (40); + int len = addr.length; + int i = 0; + + for ( ; ; ) + { + sbuf.append (addr [i] & 0xFF); + i++; + + if (i == len) + break; + + sbuf.append ('.'); + } + + return sbuf.toString (); + } + + /** + * Computes the hashcode of the instance + */ + public int hashCode () + { + int hash = 0; + int len = addr.length; + int i = len > 4 ? len - 4 : 0; + + for ( ; i < len; i++) + hash = (hash << 8) | (addr [i] & 0xFF); + + return hash; + } + + /** + * Compare the current Inet4Address instance with obj + * + * @param obj Object to compare with + */ + public boolean equals (Object obj) + { + if (obj == null || ! (obj instanceof InetAddress)) + return false; + + byte[] addr1 = addr; + byte[] addr2 = ((InetAddress) obj).addr; + + if (addr1.length != addr2.length) + return false; + + for (int i = addr1.length; --i >= 0; ) + if (addr1 [i] != addr2 [i]) + return false; + + return true; + } + } // class Inet4Address diff -Nrc3pad gcc-3.2.3/libjava/java/net/Inet6Address.java gcc-3.3/libjava/java/net/Inet6Address.java *** gcc-3.2.3/libjava/java/net/Inet6Address.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/Inet6Address.java 2002-11-01 06:35:14.000000000 +0000 *************** *** 0 **** --- 1,272 ---- + /* Inet6Address.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + import java.io.IOException; + + /** + * @author Michael Koch + * @date August 3, 2002. + */ + + /* + * Written using on-line Java Platform 1.4 API Specification and + * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt) + * Status: Believed complete and correct. + */ + + public final class Inet6Address extends InetAddress + { + static final long serialVersionUID = 6880410070516793377L; + + /** + * Needed for serialization + */ + byte[] ipaddress; + + /** + * Create an Inet6Address object + * + * @param addr The IP address + * @param host The hostname + */ + protected Inet6Address (byte[] addr, String host) + { + super (addr, host); + this.ipaddress = addr; + } + + /** + * Utility routine to check if the InetAddress is an IP multicast address + * + * @since 1.1 + */ + public boolean isMulticastAddress () + { + return ipaddress [0] == 0xFF; + } + + /** + * Utility routine to check if the InetAddress in a wildcard address + * + * @since 1.4 + */ + public boolean isAnyLocalAddress () + { + byte[] anylocal = { 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 }; + + return ipaddress == anylocal; + } + + /** + * Utility routine to check if the InetAddress is a loopback address + * + * @since 1.4 + */ + public boolean isLoopbackAddress () + { + byte[] loopback = { 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1 }; + + return ipaddress == loopback; + } + + /** + * Utility routine to check if the InetAddress is an link local address + * + * @since 1.4 + */ + public boolean isLinkLocalAddress () + { + return ipaddress [0] == 0xFA; + } + + /** + * Utility routine to check if the InetAddress is a site local address + * + * @since 1.4 + */ + public boolean isSiteLocalAddress () + { + return ipaddress [0] == 0xFB; + } + + /** + * Utility routine to check if the multicast address has global scope + * + * @since 1.4 + */ + public boolean isMCGlobal () + { + if (!isMulticastAddress ()) + return false; + + return (ipaddress [1] & 0x0F) == 0xE; + } + + /** + * Utility routine to check if the multicast address has node scope + * + * @since 1.4 + */ + public boolean isMCNodeLocal () + { + if (!isMulticastAddress ()) + return false; + + return (ipaddress [1] & 0x0F) == 0x1; + } + + /** + * Utility routine to check if the multicast address has link scope + * + * @since 1.4 + */ + public boolean isMCLinkLocal () + { + if (!isMulticastAddress ()) + return false; + + return (ipaddress [1] & 0x0F) == 0x2; + } + + /** + * Utility routine to check if the multicast address has site scope + * + * @since 1.4 + */ + public boolean isMCSiteLocal () + { + if (!isMulticastAddress ()) + return false; + + return (ipaddress [1] & 0x0F) == 0x5; + } + + /** + * Utility routine to check if the multicast address has organization scope + * + * @since 1.4 + */ + public boolean isMCOrgLocal () + { + if (!isMulticastAddress ()) + return false; + + return (ipaddress [1] & 0x0F) == 0x8; + } + + /** + * Returns the raw IP address of this InetAddress object. The result is in + * network byte order: the highest order byte of the address is i + * n getAddress()[0] + */ + public byte[] getAddress () + { + return ipaddress; + } + + /** + * Returns the IP address string in textual presentation + */ + public String getHostAddress () + { + StringBuffer sbuf = new StringBuffer (40); + + for (int i = 0; i < 16; i += 2) + { + int x = ((ipaddress [i] & 0xFF) << 8) | (ipaddress [i + 1] & 0xFF); + boolean empty = sbuf.length () == 0; + + if (empty) + { + if (i > 0) + sbuf.append ("::"); + } + else + sbuf.append (':'); + + if (x != 0 || i >= 14) + sbuf.append (Integer.toHexString (x)); + } + + return sbuf.toString (); + } + + /** + * Returns a hashcode for this IP address + */ + public int hashCode () + { + return super.hashCode (); + } + + /** + * Compares this object against the specified object + */ + public boolean equals (Object obj) + { + if (obj == null || ! (obj instanceof Inet6Address)) + return false; + + Inet6Address tmp = (Inet6Address) obj; + + return super.equals (tmp) + && this.ipaddress == tmp.ipaddress; + } + + /** + * Utility routine to check if the InetAddress is an + * IPv4 compatible IPv6 address + * + * @since 1.4 + */ + public boolean isIPv4CompatibleAddress () + { + if (ipaddress [0] != 0x00 || ipaddress [1] != 0x00 || + ipaddress [2] != 0x00 || ipaddress [3] != 0x00 || + ipaddress [4] != 0x00 || ipaddress [5] != 0x00 || + ipaddress [6] != 0x00 || ipaddress [7] != 0x00 || + ipaddress [8] != 0x00 || ipaddress [9] != 0x00 || + ipaddress [10] != 0x00 || ipaddress [11] != 0x00) + return false; + + return true; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/net/InetAddress.java gcc-3.3/libjava/java/net/InetAddress.java *** gcc-3.2.3/libjava/java/net/InetAddress.java 2002-01-12 10:11:13.000000000 +0000 --- gcc-3.3/libjava/java/net/InetAddress.java 2002-12-07 01:19:02.000000000 +0000 *************** *** 1,6 **** // INetAddress.java -- An Internet Protocol (IP) address. ! /* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // INetAddress.java -- An Internet Protocol (IP) address. ! /* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation This file is part of libgcj. *************** Libgcj License. Please consult the file *** 9,17 **** --- 9,20 ---- details. */ package java.net; + import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.IOException; + import java.io.Serializable; + import java.io.ObjectStreamException; /** * @author Per Bothner *************** import java.io.IOException; *** 23,31 **** * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * (The latter turns out to have some errors ...) * Status: Believed complete and correct. */ ! public final class InetAddress implements java.io.Serializable { // The Serialized Form specifies that an int 'address' is saved/restored. // This class uses a byte array internally so we'll just do the conversion --- 26,36 ---- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * (The latter turns out to have some errors ...) * Status: Believed complete and correct. + * + * @specnote This class is not final since JK 1.4 */ ! public class InetAddress implements Serializable { // The Serialized Form specifies that an int 'address' is saved/restored. // This class uses a byte array internally so we'll just do the conversion *************** public final class InetAddress implement *** 41,46 **** --- 46,59 ---- int family; private static final long serialVersionUID = 3286316764910316507L; + /** + * Needed for serialization + */ + private void readResolve () throws ObjectStreamException + { + // FIXME: implement this + } + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { *************** public final class InetAddress implement *** 78,83 **** --- 91,101 ---- family = getFamily (address); } + /** + * Utility routine to check if the InetAddress is an IP multicast address + * + * @since 1.1 + */ public boolean isMulticastAddress () { int len = addr.length; *************** public final class InetAddress implement *** 88,100 **** --- 106,293 ---- return false; } + /** + * Utility routine to check if the InetAddress in a wildcard address + * + * @since 1.4 + */ + public boolean isAnyLocalAddress () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + return addr == zeros; + } + + /** + * Utility routine to check if the InetAddress is a loopback address + * + * @since 1.4 + */ + public boolean isLoopbackAddress () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + return addr[0] == 0x7F; + } + + /** + * Utility routine to check if InetAddress is a link local address + * + * @since 1.4 + */ + public boolean isLinkLocalAddress () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + // XXX: This seems to not exist with IPv4 addresses + return false; + } + + /** + * Utility routine to check if InetAddress is a site local address + * + * @since 1.4 + */ + public boolean isSiteLocalAddress () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + // 10.0.0.0/8 + if (addr[0] == 0x0A) + return true; + + // XXX: Suns JDK 1.4.1 (on Linux) seems to have a bug here: + // it says 172.16.0.0 - 172.255.255.255 are site local addresses + + // 172.16.0.0/12 + if (addr[0] == 0xAC && (addr[1] & 0xF0) == 0x01) + return true; + + // 192.168.0.0/16 + if (addr[0] == 0xC0 && addr[1] == 0xA8) + return true; + + // XXX: Do we need to check more addresses here ? + return false; + } + + /** + * Utility routine to check if InetAddress is a global multicast address + * + * @since 1.4 + */ + public boolean isMCGlobal () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + // XXX: This seems to not exist with IPv4 addresses + return false; + } + + /** + * Utility reoutine to check if InetAddress is a node local multicast address + * + * @since 1.4 + */ + public boolean isMCNodeLocal () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + // XXX: This seems to not exist with IPv4 addresses + return false; + } + + /** + * Utility reoutine to check if InetAddress is a link local multicast address + * + * @since 1.4 + */ + public boolean isMCLinkLocal () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + if (!isMulticastAddress ()) + return false; + + return (addr[0] == 0xE0 + && addr[1] == 0x00 + && addr[2] == 0x00); + } + + /** + * Utility reoutine to check if InetAddress is a site local multicast address + * + * @since 1.4 + */ + public boolean isMCSiteLocal () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + // XXX: This seems to not exist with IPv4 addresses + return false; + } + + /** + * Utility reoutine to check if InetAddress is a organization local + * multicast address + * + * @since 1.4 + */ + public boolean isMCOrgLocal () + { + // This is the IPv4 implementation. + // Any class derived from InetAddress should override this. + + // XXX: This seems to not exist with IPv4 addresses + return false; + } + + /** + * Returns the hostname represented by this InetAddress + */ public String getHostName () { if (hostName == null) lookup (null, this, false); + return hostName; } + /** + * Returns the canonical hostname represented by this InetAddress + * + * @since 1.4 + */ + public String getCanonicalHostName () + { + SecurityManager sm = System.getSecurityManager (); + if (sm != null) + { + try + { + sm.checkConnect (hostName, -1); + } + catch (SecurityException e) + { + return getHostAddress (); + } + } + + // Try to find the FDQN now + InetAddress address = new InetAddress (getAddress (), null); + return address.getHostName (); + } + + /** + * Returns the IP address of this InetAddress as array of bytes + */ public byte[] getAddress () { // An experiment shows that JDK1.2 returns a different byte array each *************** public final class InetAddress implement *** 125,130 **** --- 318,328 ---- } } + /** + * Returns the IP address as string + * + * @since 1.0.2 + */ public String getHostAddress () { StringBuffer sbuf = new StringBuffer(40); *************** public final class InetAddress implement *** 167,175 **** --- 365,377 ---- break; sbuf.append('.'); } + return sbuf.toString(); } + /** + * Returns a hashcode of the InetAddress + */ public int hashCode() { // There hashing algorithm is not specified, but a simple experiment *************** public final class InetAddress implement *** 182,196 **** return hash; } public boolean equals (Object obj) { if (obj == null || ! (obj instanceof InetAddress)) return false; // "The Java Class Libraries" 2nd edition says "If a machine has // multiple names instances of InetAddress for different name of // that same machine are not equal. This is because they have // different host names." This violates the description in the ! // JDK 1.2 API documentation. A little experiementation // shows that the latter is correct. byte[] addr1 = addr; byte[] addr2 = ((InetAddress) obj).addr; --- 384,402 ---- return hash; } + /** + * Compares the InetAddress object with another one. + */ public boolean equals (Object obj) { if (obj == null || ! (obj instanceof InetAddress)) return false; + // "The Java Class Libraries" 2nd edition says "If a machine has // multiple names instances of InetAddress for different name of // that same machine are not equal. This is because they have // different host names." This violates the description in the ! // JDK 1.2 API documentation. A little experimentation // shows that the latter is correct. byte[] addr1 = addr; byte[] addr2 = ((InetAddress) obj).addr; *************** public final class InetAddress implement *** 202,246 **** return true; } public String toString() { ! return getHostName()+'/'+getHostAddress(); } /** If host is a valid numeric IP address, return the numeric address. * Otherwise, return null. */ private static native byte[] aton (String host); ! private static native InetAddress[] lookup ! (String hostname, InetAddress addr, boolean all); ! public static InetAddress getByName (String host) throws UnknownHostException { ! if (host == null) return getLocalHost(); ! byte[] address = aton(host); if (address != null) ! return new InetAddress(address, null); ! InetAddress iaddr = new InetAddress(null, host); ! lookup(host, iaddr, false); ! return iaddr; } ! public static InetAddress[] getAllByName (String host) throws UnknownHostException { ! byte[] address = aton(host); if (address != null) { InetAddress[] result = new InetAddress[1]; result[0] = new InetAddress(address, null); return result; } ! return lookup(host, null, true); } static final byte[] zeros = {0,0,0,0}; /* dummy InetAddress, used to bind socket to any (all) network interfaces */ static final InetAddress ANY_IF = new InetAddress(zeros, null); --- 408,559 ---- return true; } + /** + * Returns then InetAddress as string + */ public String toString() { ! String result; ! String address = getHostAddress(); ! if (hostName != null) ! result = hostName + "/" + address; ! else ! result = address; ! return result; ! } ! ! /** ! * Returns an InetAddress object given the raw IP address. ! * ! * The argument is in network byte order: the highest order byte of the ! * address is in getAddress()[0]. ! * ! * @param addr The IP address to create the InetAddress object from ! * ! * @exception UnknownHostException If IP address has illegal length ! * ! * @since 1.4 ! */ ! public static InetAddress getByAddress(byte[] addr) ! throws UnknownHostException ! { ! if (addr.length != 4 && addr.length != 16) ! throw new UnknownHostException ("IP address has illegal length"); ! ! if (addr.length == 4) ! return new Inet4Address (addr, null); ! ! return new Inet6Address (addr, null); } + /** + * Creates an InetAddress based on the provided host name and IP address. + * No name service is checked for the validity of the address. + * + * @param host The hostname of the InetAddress object to create + * @param addr The IP address to create the InetAddress object from + * + * @exception UnknownHostException If IP address is of illegal length + * + * @since 1.4 + */ + public static InetAddress getByAddress (String host, byte[] addr) + throws UnknownHostException + { + if (addr.length == 4) + return new Inet4Address (addr, host); + + if (addr.length == 16) + return new Inet6Address (addr, host); + + throw new UnknownHostException ("IP address has illegal length"); + } + /** If host is a valid numeric IP address, return the numeric address. * Otherwise, return null. */ private static native byte[] aton (String host); ! private static native InetAddress[] lookup (String hostname, ! InetAddress addr, boolean all); ! /** ! * Determines the IP address of a host, given the host's name. ! * ! * @exception UnknownHostException If no IP address for the host could ! * be found ! * @exception SecurityException If a security manager exists and its ! * checkConnect method doesn't allow the operation ! */ ! public static InetAddress getByName (String hostname) throws UnknownHostException { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! sm.checkConnect (hostname, -1); ! ! // Default to current host if necessary ! if (hostname == null) return getLocalHost(); ! ! // Assume that the host string is an IP address ! byte[] address = aton (hostname); if (address != null) ! { ! if (address.length == 4) ! return new Inet4Address (address, null); ! else if (address.length == 16) ! { ! if ((address[10] == 0xFF) && (address[11] == 0xFF)) ! { ! byte[] ip4addr = new byte[4]; ! ip4addr[0] = address[12]; ! ip4addr[1] = address[13]; ! ip4addr[2] = address[14]; ! ip4addr[3] = address[15]; ! return new Inet4Address (ip4addr, null); ! } ! return new Inet6Address (address, null); ! } ! else ! throw new UnknownHostException ("Address has invalid length"); ! } ! ! // Try to resolve the host by DNS ! InetAddress[] addresses = getAllByName (hostname); ! return addresses[0]; } ! /** ! * Given the name of a host, returns an array of its IP addresses, ! * based on the configured name service on the system. ! * ! * @exception UnknownHostException If no IP address for the host could ! * be found ! * @exception SecurityException If a security manager exists and its ! * checkConnect method doesn't allow the operation ! */ ! public static InetAddress[] getAllByName (String hostname) throws UnknownHostException { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) ! sm.checkConnect(hostname, -1); ! ! // Check if hostname is an IP address ! byte[] address = aton (hostname); if (address != null) { InetAddress[] result = new InetAddress[1]; result[0] = new InetAddress(address, null); return result; } ! ! // Try to resolve the hostname by DNS ! return lookup (hostname, null, true); } static final byte[] zeros = {0,0,0,0}; + /* dummy InetAddress, used to bind socket to any (all) network interfaces */ static final InetAddress ANY_IF = new InetAddress(zeros, null); *************** public final class InetAddress implement *** 250,255 **** --- 563,574 ---- private static InetAddress localhost = null; + /** + * Returns the local host + * + * @exception UnknownHostException If no IP address for the host could + * be found + */ public static InetAddress getLocalHost() throws UnknownHostException { SecurityManager s = System.getSecurityManager(); diff -Nrc3pad gcc-3.2.3/libjava/java/net/InetSocketAddress.java gcc-3.3/libjava/java/net/InetSocketAddress.java *** gcc-3.2.3/libjava/java/net/InetSocketAddress.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/InetSocketAddress.java 2003-01-14 22:27:29.000000000 +0000 *************** *** 0 **** --- 1,200 ---- + /* InetSocketAddress.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + /** + * InetSocketAddress instances represent socket addresses + * in the java.nio package. They encapsulate a InetAddress and + * a port number. + * + * @since 1.4 + */ + + public class InetSocketAddress extends SocketAddress + { + /** + * Compatible with JDK 1.4+ + */ + private static final long serialVersionUID = 5076001401234631237L; + + String hostname; + InetAddress addr; + int port; + + /** + * Constructs an InetSocketAddress instance. + * + * @param addr Address of the socket + * @param port Port if the socket + * + * @exception IllegalArgumentException If the port number is illegel + */ + public InetSocketAddress(InetAddress addr, int port) + throws IllegalArgumentException + { + if (port < 0 || port > 65535) + throw new IllegalArgumentException(); + + this.addr = addr; + this.port = port; + this.hostname = addr.getHostName (); + } + + /** + * Constructs an InetSocketAddress instance. + * + * @param port Port if the socket + * + * @exception IllegalArgumentException If the port number is illegal + */ + public InetSocketAddress(int port) + throws IllegalArgumentException + { + if (port < 0 || port > 65535) + throw new IllegalArgumentException(); + + this.port = port; + + try + { + byte[] any = { 0, 0, 0, 0 }; + this.addr = InetAddress.getByAddress (any); + this.hostname = "0.0.0.0"; + } + catch (UnknownHostException e) + { + this.addr = null; + this.hostname = ""; + } + } + + + /** + * Constructs an InetSocketAddress instance. + * + * @param addr Address of the socket + * @param port Port if the socket + * + * @exception IllegalArgumentException If the port number is illegal + */ + public InetSocketAddress(String hostname, int port) + throws IllegalArgumentException + { + if (port < 0 || port > 65535) + throw new IllegalArgumentException(); + + this.port = port; + this.hostname = hostname; + + try + { + this.addr = InetAddress.getByName(hostname); + } + catch (Exception e) // UnknownHostException, SecurityException + { + this.addr = null; + } + } + + /** + * Test if obj is a InetSocketAddress and + * has the same address and port + */ + public final boolean equals (Object obj) + { + // InetSocketAddress objects are equal when addr and port are equal. + // The hostname may differ. + + if (obj instanceof InetSocketAddress) + { + InetSocketAddress a = (InetSocketAddress) obj; + return addr.equals(a.addr) && a.port == port; + } + + return false; + } + + /** + * Returns the InetAddress or + * null if its unresolved + */ + public final InetAddress getAddress() + { + return addr; + } + + /** + * Returns hostname + */ + public final String getHostName() + { + return hostname; + } + + /** + * Returns the port + */ + public final int getPort() + { + return port; + } + + /** + * Returns the hashcode of the InetSocketAddress + */ + public final int hashCode() + { + return port + addr.hashCode(); + } + + /** + * Checks wether the address has been resolved or not + */ + public final boolean isUnresolved() + { + return addr == null; + } + + /** + * Returns the InetSocketAddress as string + */ + public String toString() + { + return addr + ":" + port; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/net/JarURLConnection.java gcc-3.3/libjava/java/net/JarURLConnection.java *** gcc-3.2.3/libjava/java/net/JarURLConnection.java 2000-08-20 17:49:11.000000000 +0000 --- gcc-3.3/libjava/java/net/JarURLConnection.java 2002-12-09 00:04:00.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation This file is part of libgcj. --- 1,4 ---- ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation This file is part of libgcj. *************** import java.net.*; *** 12,22 **** --- 12,25 ---- import java.io.*; import java.util.jar.*; import java.util.zip.*; + import java.util.Map; import java.util.Vector; import java.util.Hashtable; + import java.security.cert.Certificate; /** * @author Kresten Krab Thorup + * @since 1.2 * @date Aug 10, 1999. */ *************** public abstract class JarURLConnection e *** 31,37 **** * either case this describes just the jar file itself. */ protected URLConnection jarFileURLConnection; ! // If this is a connection to a jar file element this is set, otherwose null. private final String element; // Cached JarURLConnection's --- 34,40 ---- * either case this describes just the jar file itself. */ protected URLConnection jarFileURLConnection; ! // If this is a connection to a jar file element this is set, otherwise null. private final String element; // Cached JarURLConnection's *************** public abstract class JarURLConnection e *** 47,53 **** return element; } ! public JarURLConnection(URL url) throws MalformedURLException { super(url); --- 50,63 ---- return element; } ! /** ! * Creates a new JarURLConnection ! * ! * @exception MalformedURLException If url is invalid ! * ! * @specnote This constructor is protected since JDK 1.4 ! */ ! protected JarURLConnection(URL url) throws MalformedURLException { super(url); *************** public abstract class JarURLConnection e *** 103,109 **** { // This is a JarURLConnection for the entire jar file. ! InputStream jar_is = new BufferedInputStream(jarFileURLConnection.getInputStream ()); return new JarInputStream(jar_is); } --- 113,120 ---- { // This is a JarURLConnection for the entire jar file. ! InputStream jar_is = new BufferedInputStream( ! jarFileURLConnection.getInputStream ()); return new JarInputStream(jar_is); } *************** public abstract class JarURLConnection e *** 123,134 **** if (jarfile != null) { // this is the easy way... ! return jarfile.getInputStream (jarfile.getEntry (element)); } else { // If the jar file is not local, ... ! JarInputStream zis = new JarInputStream(jarFileURLConnection.getInputStream ()); // This is hideous, we're doing a linear search... for (ZipEntry ent = zis.getNextEntry (); --- 134,150 ---- if (jarfile != null) { // this is the easy way... ! ZipEntry entry = jarfile.getEntry(element); ! if (entry != null) ! return jarfile.getInputStream (entry); ! else ! return null; } else { // If the jar file is not local, ... ! JarInputStream zis = new JarInputStream( ! jarFileURLConnection.getInputStream ()); // This is hideous, we're doing a linear search... for (ZipEntry ent = zis.getNextEntry (); *************** public abstract class JarURLConnection e *** 148,154 **** return null; } ! public JarEntry getJarEntry () throws java.io.IOException { JarFile jarfile = null; --- 164,175 ---- return null; } ! /** ! * Return the JAR entry object for this connection, if any ! * ! * @exception IOException If an error occurs ! */ ! public JarEntry getJarEntry () throws IOException { JarFile jarfile = null; *************** public abstract class JarURLConnection e *** 162,175 **** { jarfile = getJarFile (); } ! catch (java.io.IOException x) { /* ignore */ } if (jarfile == null) { ! JarInputStream zis = new JarInputStream(jarFileURLConnection.getInputStream ()); // This is hideous, we're doing a linear search for the thing... for (ZipEntry ent = zis.getNextEntry (); --- 183,197 ---- { jarfile = getJarFile (); } ! catch (IOException x) { /* ignore */ } if (jarfile == null) { ! JarInputStream zis = new JarInputStream( ! jarFileURLConnection.getInputStream ()); // This is hideous, we're doing a linear search for the thing... for (ZipEntry ent = zis.getNextEntry (); *************** public abstract class JarURLConnection e *** 191,197 **** return null; } ! public abstract JarFile getJarFile() throws java.io.IOException; // Steal and borrow from protocol/file/Connection.java --- 213,224 ---- return null; } ! /** ! * Return the JAR file for this connection ! * ! * @exception IOException If an error occurs ! */ ! public abstract JarFile getJarFile() throws IOException; // Steal and borrow from protocol/file/Connection.java *************** public abstract class JarURLConnection e *** 215,220 **** --- 242,261 ---- } // Override default method in URLConnection. + public Map getHeaderFields() + { + try + { + getHeaders(); + } + catch (IOException x) + { + return null; + } + return hdrHash; + } + + // Override default method in URLConnection. public String getHeaderField(int n) { try *************** public abstract class JarURLConnection e *** 283,294 **** // to add others later and for consistency, we'll implement it this way. // Add the only header we know about right now: Content-length. ! long len; if (element == null) ! len = jarFileURLConnection.getContentLength (); else ! len = getJarEntry ().getSize (); String line = "Content-length: " + len; hdrVec.addElement(line); --- 324,340 ---- // to add others later and for consistency, we'll implement it this way. // Add the only header we know about right now: Content-length. ! long len = -1; if (element == null) ! if (jarFileURLConnection != null) ! len = jarFileURLConnection.getContentLength (); else ! { ! JarEntry entry = getJarEntry(); ! if (entry != null) ! len = entry.getSize (); ! } String line = "Content-length: " + len; hdrVec.addElement(line); *************** public abstract class JarURLConnection e *** 300,303 **** --- 346,395 ---- hdrHash.put(key.toLowerCase(), Long.toString(len)); } + /** + * Returns an array of Certificate objects for the jar file entry specified + * by this URL or null if there are none + * + * @return A Certificate array + * + * @exception IOException If an error occurs + */ + public Certificate[] getCertificates() throws IOException + { + return getJarEntry().getCertificates(); + } + + /** + * Returns the main Attributes for the JAR file for this connection + * + * @exception IOException If an error occurs + */ + public Attributes getMainAttributes () throws IOException + { + return getManifest ().getMainAttributes (); + } + + /** + * Return the Attributes object for this connection if the URL for it points + * to a JAR file entry, null otherwise + * + * @exception IOException If an error occurs + */ + public Attributes getAttributes () throws IOException + { + // FIXME: implement this + return null; + } + + /** + * Returns the Manifest for this connection, or null if none + * + * @exception IOException If an error occurs + */ + public Manifest getManifest () throws IOException + { + JarFile file = getJarFile (); + + return (file != null) ? file.getManifest() : null; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/net/MalformedURLException.java gcc-3.3/libjava/java/net/MalformedURLException.java *** gcc-3.2.3/libjava/java/net/MalformedURLException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/MalformedURLException.java 2002-06-15 19:45:34.000000000 +0000 *************** *** 1,5 **** /* MalformedURLException.java -- A URL was not in a valid format ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* MalformedURLException.java -- A URL was not in a valid format ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,86 **** package java.net; ! /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! */ /** ! * This exception indicates that a URL passed to an object was not in a ! * valid format. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @date March 5, 1999. ! */ ! public class MalformedURLException extends java.io.IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Initializes a new instance of MalformedURLException without ! * a descriptive error message. ! */ ! public ! MalformedURLException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Initializes a new instance of MalformedURLException without ! * a descriptive error message. ! * ! * @param message A message describing the error that occurred. ! */ ! public ! MalformedURLException(String message) ! { ! super(message); ! } } // class MalformedURLException - --- 37,73 ---- package java.net; ! import java.io.IOException; /** ! * This exception indicates that a URL passed to an object was not in a ! * valid format. ! * ! * @author Aaron M. Renn ! * @author Warren Levy ! * @status updated to 1.4 */ ! public class MalformedURLException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -182787522200415866L; ! /** ! * Create a new instance without a descriptive error message. ! */ ! public MalformedURLException() ! { ! } + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public MalformedURLException(String message) + { + super(message); + } } // class MalformedURLException diff -Nrc3pad gcc-3.2.3/libjava/java/net/MulticastSocket.java gcc-3.3/libjava/java/net/MulticastSocket.java *** gcc-3.2.3/libjava/java/net/MulticastSocket.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/MulticastSocket.java 2003-01-20 01:34:03.000000000 +0000 *************** *** 1,5 **** /* MulticastSocket.java -- Class for using multicast sockets ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* MulticastSocket.java -- Class for using multicast sockets ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ! Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,119 **** package java.net; import java.io.IOException; ! /* * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ /** ! * This class models a multicast UDP socket. A multicast address is a ! * class D internet address (one whose most significant bits are 1110). ! * A multicast group consists of a multicast address and a well known ! * port number. All members of the group listening on that address and ! * port will receive all the broadcasts to the group. ! *

        ! * Please note that applets are not allowed to use multicast sockets ! * ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! * ! * @author Warren Levy ! * @author Aaron M. Renn (arenn@urbanophile.com) (Documentation comments) ! * @date May 18, 1999. ! */ public class MulticastSocket extends DatagramSocket { // FIXME: the local addr bound to the multicast socket can be reused; // unlike unicast sockets. It binds to any available network interface. // See p.1159 JCL book. ! /** ! * Create a MulticastSocket that this not bound to any address ! * ! * @exception IOException If an error occurs ! */ public MulticastSocket() throws IOException { super(0, null); } ! /** ! * Create a multicast socket bound to the specified port ! * ! * @param The port to bind to ! * ! * @exception IOException If an error occurs ! */ public MulticastSocket(int port) throws IOException { super(port, null); } ! /** ! * Returns the interface being used for multicast packets ! * ! * @return The multicast interface ! * ! * @exception SocketException If an error occurs ! */ public InetAddress getInterface() throws SocketException { - // FIXME: Is it possible that an InetAddress wasn't returned from getOption? return (InetAddress) impl.getOption(SocketOptions.IP_MULTICAST_IF); } ! /** ! * Returns the current value of the "Time to Live" option. This is the ! * number of hops a packet can make before it "expires". This method id ! * deprecated. Use getTimeToLive instead. ! * ! * @return The TTL value ! * ! * @exception IOException If an error occurs ! * ! * @deprecated Replaced by getTimeToLive() in Java 1.2 ! */ public byte getTTL() throws IOException { // Use getTTL here rather than getTimeToLive in case we're using an impl --- 39,143 ---- package java.net; import java.io.IOException; + import java.util.Enumeration; ! /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ /** ! * This class models a multicast UDP socket. A multicast address is a ! * class D internet address (one whose most significant bits are 1110). ! * A multicast group consists of a multicast address and a well known ! * port number. All members of the group listening on that address and ! * port will receive all the broadcasts to the group. ! *

        ! * Please note that applets are not allowed to use multicast sockets ! * ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! * ! * @author Warren Levy ! * @author Aaron M. Renn (arenn@urbanophile.com) (Documentation comments) ! * @since 1.1 ! * @date May 18, 1999. ! */ public class MulticastSocket extends DatagramSocket { // FIXME: the local addr bound to the multicast socket can be reused; // unlike unicast sockets. It binds to any available network interface. // See p.1159 JCL book. ! /** ! * Create a MulticastSocket that this not bound to any address ! * ! * @exception IOException If an error occurs ! * @exception SecurityException If a security manager exists and its ! * checkListen method doesn't allow the operation ! */ public MulticastSocket() throws IOException { super(0, null); } ! /** ! * Create a multicast socket bound to the specified port ! * ! * @param port The port to bind to ! * ! * @exception IOException If an error occurs ! * @exception SecurityException If a security manager exists and its ! * checkListen method doesn't allow the operation ! */ public MulticastSocket(int port) throws IOException { super(port, null); } ! /** ! * Create a multicast socket bound to the specified SocketAddress. ! * ! * @param address The SocketAddress the multicast socket will be bound to ! * ! * @exception IOException If an error occurs ! * @exception SecurityException If a security manager exists and its ! * checkListen method doesn't allow the operation ! * ! * @since 1.4 ! */ ! public MulticastSocket(SocketAddress address) throws IOException ! { ! super(address); ! } ! ! /** ! * Returns the interface being used for multicast packets ! * ! * @return The multicast interface ! * ! * @exception SocketException If an error occurs ! */ public InetAddress getInterface() throws SocketException { return (InetAddress) impl.getOption(SocketOptions.IP_MULTICAST_IF); } ! /** ! * Returns the current value of the "Time to Live" option. This is the ! * number of hops a packet can make before it "expires". This method id ! * deprecated. Use getTimeToLive instead. ! * ! * @return The TTL value ! * ! * @exception IOException If an error occurs ! * ! * @deprecated 1.2 Replaced by getTimeToLive() ! * ! * @see Multicastsocket:getTimeToLive ! */ public byte getTTL() throws IOException { // Use getTTL here rather than getTimeToLive in case we're using an impl *************** public class MulticastSocket extends Dat *** 122,164 **** return impl.getTTL(); } ! /** ! * Returns the current value of the "Time to Live" option. This is the ! * number of hops a packet can make before it "expires". ! * ! * @return The TTL value ! * ! * @exception IOException If an error occurs ! * ! * @since Java 1.2 ! */ public int getTimeToLive() throws IOException { return impl.getTimeToLive(); } ! /** ! * Sets the interface to use for multicast packets. ! * ! * @param addr The new interface to use ! * ! * @exception SocketException If an error occurs ! */ ! public void setInterface(InetAddress inf) throws SocketException { ! impl.setOption(SocketOptions.IP_MULTICAST_IF, inf); } ! /** ! * Sets the "Time to Live" value for a socket. The value must be between ! * 1 and 255. ! * ! * @param ttl The new TTL value ! * ! * @exception IOException If an error occurs ! * ! * @deprecated Replaced by setTimeToLive in Java 1.2 ! */ public void setTTL(byte ttl) throws IOException { // Use setTTL here rather than setTimeToLive in case we're using an impl --- 146,284 ---- return impl.getTTL(); } ! /** ! * Returns the current value of the "Time to Live" option. This is the ! * number of hops a packet can make before it "expires". ! * ! * @return The TTL value ! * ! * @exception IOException If an error occurs ! * ! * @since 1.2 ! */ public int getTimeToLive() throws IOException { return impl.getTimeToLive(); } ! /** ! * Sets the interface to use for sending multicast packets. ! * ! * @param addr The new interface to use. ! * ! * @exception SocketException If an error occurs. ! * ! * @since 1.4 ! */ ! public void setInterface(InetAddress addr) throws SocketException { ! impl.setOption(SocketOptions.IP_MULTICAST_IF, addr); } ! /** ! * Sets the local network interface used to send multicast messages ! * ! * @param netIF The local network interface used to send multicast messages ! * ! * @exception SocketException If an error occurs ! * ! * @see MulticastSocket:getNetworkInterface ! * ! * @since 1.4 ! */ ! public void setNetworkInterface(NetworkInterface netIf) ! throws SocketException ! { ! if (impl == null) ! throw new SocketException ( ! "MulticastSocket: Cant access socket implementation"); ! ! Enumeration e = netIf.getInetAddresses (); ! ! if (!e.hasMoreElements ()) ! throw new SocketException ("MulticastSocket: Error"); ! ! InetAddress address = (InetAddress) e.nextElement (); ! impl.setOption (SocketOptions.IP_MULTICAST_IF, address); ! } ! ! /** ! * Gets the local network interface which is used to send multicast messages ! * ! * @return The local network interface to send multicast messages ! * ! * @exception SocketException If an error occurs ! * ! * @see MulticastSocket:setNetworkInterface ! * ! * @since 1.4 ! */ ! public NetworkInterface getNetworkInterface() ! throws SocketException ! { ! if (impl == null) ! throw new SocketException ( ! "MulticastSocket: Cant access socket implementation"); ! ! InetAddress address = ! (InetAddress) impl.getOption (SocketOptions.IP_MULTICAST_IF); ! NetworkInterface netIf = NetworkInterface.getByInetAddress (address); ! ! return netIf; ! } ! ! /** ! * Disable/Enable local loopback of multicast packets. The option is used by ! * the platform's networking code as a hint for setting whether multicast ! * data will be looped back to the local socket. ! * ! * Because this option is a hint, applications that want to verify what ! * loopback mode is set to should call #getLoopbackMode ! * ! * @param disable True to disable loopback mode ! * ! * @exception SocketException If an error occurs ! * ! * @since 1.4 ! */ ! public void setLoopbackMode(boolean disable) throws SocketException ! { ! if (impl == null) ! throw new SocketException ( ! "MulticastSocket: Cant access socket implementation"); ! ! impl.setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable)); ! } ! ! /** ! * Checks if local loopback mode is enabled or not ! * ! * @exception SocketException If an error occurs ! * ! * @since 1.4 ! */ ! public boolean getLoopbackMode() throws SocketException ! { ! Object obj = impl.getOption (SocketOptions.IP_MULTICAST_LOOP); ! ! if (obj instanceof Boolean) ! return ((Boolean) obj).booleanValue (); ! else ! throw new SocketException ("Unexpected type"); ! } ! ! /** ! * Sets the "Time to Live" value for a socket. The value must be between ! * 1 and 255. ! * ! * @param ttl The new TTL value ! * ! * @exception IOException If an error occurs ! * ! * @deprecated 1.2 Replaced by setTimeToLive ! * ! * @see MulticastSocket:setTimeToLive ! */ public void setTTL(byte ttl) throws IOException { // Use setTTL here rather than setTimeToLive in case we're using an impl *************** public class MulticastSocket extends Dat *** 167,182 **** impl.setTTL(ttl); } ! /** ! * Sets the "Time to Live" value for a socket. The value must be between ! * 1 and 255. ! * ! * @param ttl The new TTL value ! * ! * @exception IOException If an error occurs ! * ! * @since Java 1.2 ! */ public void setTimeToLive(int ttl) throws IOException { if (ttl <= 0 || ttl > 255) --- 287,302 ---- impl.setTTL(ttl); } ! /** ! * Sets the "Time to Live" value for a socket. The value must be between ! * 1 and 255. ! * ! * @param ttl The new TTL value ! * ! * @exception IOException If an error occurs ! * ! * @since 1.2 ! */ public void setTimeToLive(int ttl) throws IOException { if (ttl <= 0 || ttl > 255) *************** public class MulticastSocket extends Dat *** 185,197 **** impl.setTimeToLive(ttl); } ! /** ! * Joins the specified mulitcast group. ! * ! * @param addr The address of the group to join ! * ! * @exception IOException If an error occurs ! */ public void joinGroup(InetAddress mcastaddr) throws IOException { if (! mcastaddr.isMulticastAddress()) --- 305,319 ---- impl.setTimeToLive(ttl); } ! /** ! * Joins the specified mulitcast group. ! * ! * @param addr The address of the group to join ! * ! * @exception IOException If an error occurs ! * @exception SecurityException If a security manager exists and its ! * checkMulticast method doesn't allow the operation ! */ public void joinGroup(InetAddress mcastaddr) throws IOException { if (! mcastaddr.isMulticastAddress()) *************** public class MulticastSocket extends Dat *** 204,216 **** impl.join(mcastaddr); } ! /** ! * Leaves the specified multicast group ! * ! * @param addr The address of the group to leave ! * ! * @exception IOException If an error occurs ! */ public void leaveGroup(InetAddress mcastaddr) throws IOException { if (! mcastaddr.isMulticastAddress()) --- 326,340 ---- impl.join(mcastaddr); } ! /** ! * Leaves the specified multicast group ! * ! * @param addr The address of the group to leave ! * ! * @exception IOException If an error occurs ! * @exception SecurityException If a security manager exists and its ! * checkMulticast method doesn't allow the operation ! */ public void leaveGroup(InetAddress mcastaddr) throws IOException { if (! mcastaddr.isMulticastAddress()) *************** public class MulticastSocket extends Dat *** 223,238 **** impl.leave(mcastaddr); } ! /** ! * Sends a packet of data to a multicast address with a TTL that is ! * different from the default TTL on this socket. The default TTL for ! * the socket is not changed. ! * ! * @param packet The packet of data to send ! * @param ttl The TTL for this packet ! * ! * @exception IOException If an error occurs ! */ public synchronized void send(DatagramPacket p, byte ttl) throws IOException { SecurityManager s = System.getSecurityManager(); --- 347,432 ---- impl.leave(mcastaddr); } ! /** ! * Joins the specified mulitcast group on a specified interface. ! * ! * @param mcastaddr The multicast address to join ! * @param netIf The local network interface to receive the multicast ! * messages on or null to defer the interface set by #setInterface or ! * #setNetworkInterface ! * ! * @exception IOException If an error occurs ! * @exception IllegalArgumentException If address type is not supported ! * @exception SecurityException If a security manager exists and its ! * checkMulticast method doesn't allow the operation ! * ! * @see MulticastSocket:setInterface ! * @see MulticastSocket:setNetworkInterface ! * ! * @since 1.4 ! */ ! public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) ! throws IOException ! { ! if (! (mcastaddr instanceof InetSocketAddress)) ! throw new IllegalArgumentException ("SocketAddress type not supported"); ! ! InetSocketAddress tmp = (InetSocketAddress) mcastaddr; ! ! if (! tmp.getAddress ().isMulticastAddress ()) ! throw new IOException ("Not a Multicast address"); ! ! SecurityManager s = System.getSecurityManager (); ! if (s != null) ! s.checkMulticast (tmp.getAddress ()); ! ! impl.joinGroup (mcastaddr, netIf); ! } ! ! /** ! * Leaves the specified mulitcast group on a specified interface. ! * ! * @param mcastaddr The multicast address to leave ! * @param netIf The local networki interface or null to defer to the ! * interface set by setInterface or setNetworkInterface ! * ! * @exception IOException If an error occurs ! * @exception IllegalArgumentException If address type is not supported ! * @exception SecurityException If a security manager exists and its ! * checkMulticast method doesn't allow the operation ! * ! * @see MulticastSocket:setInterface ! * @see MulticastSocket:setNetworkInterface ! * ! * @since 1.4 ! */ ! public void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) ! throws IOException ! { ! InetSocketAddress tmp = (InetSocketAddress) mcastaddr; ! ! if (! tmp.getAddress ().isMulticastAddress ()) ! throw new IOException ("Not a Multicast address"); ! ! SecurityManager s = System.getSecurityManager (); ! if (s != null) ! s.checkMulticast (tmp.getAddress ()); ! ! impl.leaveGroup (mcastaddr, netIf); ! } ! ! /** ! * Sends a packet of data to a multicast address with a TTL that is ! * different from the default TTL on this socket. The default TTL for ! * the socket is not changed. ! * ! * @param packet The packet of data to send ! * @param ttl The TTL for this packet ! * ! * @exception IOException If an error occurs ! * @exception SecurityException If a security manager exists and its ! * checkConnect or checkMulticast method doesn't allow the operation ! */ public synchronized void send(DatagramPacket p, byte ttl) throws IOException { SecurityManager s = System.getSecurityManager(); diff -Nrc3pad gcc-3.2.3/libjava/java/net/natInetAddress.cc gcc-3.3/libjava/java/net/natInetAddress.cc *** gcc-3.2.3/libjava/java/net/natInetAddress.cc 2002-03-04 20:02:19.000000000 +0000 --- gcc-3.3/libjava/java/net/natInetAddress.cc 2002-11-01 06:35:14.000000000 +0000 *************** *** 1,6 **** // natInetAddress.cc ! /* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natInetAddress.cc ! /* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. *************** details. */ *** 20,26 **** #define MAXHOSTNAMELEN 64 #endif /* MAXHOSTNAMELEN */ ! #else #ifdef HAVE_UNISTD_H #include --- 20,26 ---- #define MAXHOSTNAMELEN 64 #endif /* MAXHOSTNAMELEN */ ! #else /* WIN32 */ #ifdef HAVE_UNISTD_H #include *************** java::net::InetAddress::aton (jstring ho *** 121,127 **** #endif #if defined (HAVE_INET_PTON) && defined (HAVE_INET6) char inet6_addr[16]; ! if (len == 0 && inet_pton (AF_INET6, hostname, inet6_addr) > 0) { bytes = inet6_addr; blen = 16; --- 121,127 ---- #endif #if defined (HAVE_INET_PTON) && defined (HAVE_INET6) char inet6_addr[16]; ! if (len != 0 && inet_pton (AF_INET6, hostname, inet6_addr) > 0) { bytes = inet6_addr; blen = 16; diff -Nrc3pad gcc-3.2.3/libjava/java/net/natNetworkInterface.cc gcc-3.3/libjava/java/net/natNetworkInterface.cc *** gcc-3.2.3/libjava/java/net/natNetworkInterface.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/natNetworkInterface.cc 2002-11-21 10:08:03.000000000 +0000 *************** *** 0 **** --- 1,144 ---- + // natNetworkInterface.cc + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + #include + + #ifdef WIN32 + + #include + #include + #undef STRICT + + #else /* WIN32 */ + + #ifdef HAVE_UNISTD_H + #include + #endif + #include + #include + #include + + #include + #include + #ifdef HAVE_NETINET_IN_H + #include + #endif + #ifdef HAVE_ARPA_INET_H + #include + #endif + #ifdef HAVE_NETDB_H + #include + #endif + #ifdef HAVE_SYS_IOCTL_H + #define BSD_COMP /* Get FIONREAD on Solaris2. */ + #include + #endif + #ifdef HAVE_NET_IF_H + #include + #endif + + #endif /* WIN32 */ + + #include + #include + #include + #include + #include + #include + + #ifdef DISABLE_JAVA_NET + + ::java::util::Vector* + java::net::NetworkInterface::getRealNetworkInterfaces () + { + ::java::util::Vector* ht = new ::java::util::Vector(); + return ht; + } + + #else /* DISABLE_JAVA_NET */ + + ::java::util::Vector* + java::net::NetworkInterface::getRealNetworkInterfaces () + { + #ifdef WIN32 + throw new ::java::net::SocketException; + #else + int fd; + int num_interfaces = 0; + struct ifconf if_data; + struct ifreq* if_record; + ::java::util::Vector* ht = new ::java::util::Vector (); + + if_data.ifc_len = 0; + if_data.ifc_buf = NULL; + + // Open a (random) socket to have a file descriptor for the ioctl calls. + fd = _Jv_socket (PF_INET, SOCK_DGRAM, htons (IPPROTO_IP)); + + if (fd < 0) + throw new ::java::net::SocketException; + + // Get all interfaces. If not enough buffers are available try it + // with a bigger buffer size. + do + { + num_interfaces += 16; + + if_data.ifc_len = sizeof (struct ifreq) * num_interfaces; + if_data.ifc_buf = + (char*) _Jv_Realloc (if_data.ifc_buf, if_data.ifc_len); + + // Try to get all local interfaces. + if (::ioctl (fd, SIOCGIFCONF, &if_data) < 0) + throw new java::net::SocketException; + } + while (if_data.ifc_len >= (sizeof (struct ifreq) * num_interfaces)); + + // Get addresses of all interfaces. + if_record = if_data.ifc_req; + + for (int n = 0; n < if_data.ifc_len; n += sizeof (struct ifreq)) + { + struct ifreq ifr; + + memset (&ifr, 0, sizeof (ifr)); + strcpy (ifr.ifr_name, if_record->ifr_name); + + // Try to get the IPv4-address of the local interface + if (::ioctl (fd, SIOCGIFADDR, &ifr) < 0) + throw new java::net::SocketException; + + int len = 4; + struct sockaddr_in sa = *((sockaddr_in*) &(ifr.ifr_addr)); + + jbyteArray baddr = JvNewByteArray (len); + memcpy (elements (baddr), &(sa.sin_addr), len); + jstring if_name = JvNewStringLatin1 (if_record->ifr_name); + Inet4Address* address = + new java::net::Inet4Address (baddr, JvNewStringLatin1 ("")); + ht->add (new NetworkInterface (if_name, address)); + if_record++; + } + + #ifdef HAVE_INET6 + // FIXME: read /proc/net/if_inet6 (on Linux 2.4) + #endif + + _Jv_Free (if_data.ifc_buf); + + if (fd >= 0) + _Jv_close (fd); + + return ht; + #endif /* WIN32 */ + } + + #endif // DISABLE_JAVA_NET // diff -Nrc3pad gcc-3.2.3/libjava/java/net/natPlainDatagramSocketImpl.cc gcc-3.3/libjava/java/net/natPlainDatagramSocketImpl.cc *** gcc-3.2.3/libjava/java/net/natPlainDatagramSocketImpl.cc 2002-04-15 03:21:58.000000000 +0000 --- gcc-3.3/libjava/java/net/natPlainDatagramSocketImpl.cc 2002-11-26 20:09:28.000000000 +0000 *************** Libgcj License. Please consult the file *** 7,32 **** details. */ #include - #include #ifdef WIN32 #include #include - #ifndef ENOPROTOOPT - #define ENOPROTOOPT 109 - #endif - - static inline int - close(int s) - { - return closesocket(s); - } #else /* WIN32 */ ! #ifdef HAVE_SYS_SOCKET_H ! #include ! #endif #ifdef HAVE_NETINET_IN_H #include #endif --- 7,21 ---- details. */ #include #include #ifdef WIN32 + #include #include #else /* WIN32 */ ! #ifdef HAVE_NETINET_IN_H #include #endif *************** close(int s) *** 35,40 **** --- 24,30 ---- #endif #include #include + #endif /* WIN32 */ #if HAVE_BSTRING_H *************** close(int s) *** 42,61 **** #include #endif - #ifndef DISABLE_JAVA_NET - // Avoid macro definitions of bind from system headers, e.g. on - // Solaris 7 with _XOPEN_SOURCE. FIXME - static inline int - _Jv_bind (int fd, struct sockaddr *addr, int addrlen) - { - return ::bind (fd, addr, addrlen); - } - #endif /* DISABLE_JAVA_NET */ - - #ifdef bind - #undef bind - #endif - #include #include #include --- 32,37 ---- *************** _Jv_bind (int fd, struct sockaddr *addr, *** 63,78 **** #include #include #include #include #include #include #include #include - // FIXME: remove these - #define BooleanClass java::lang::Boolean::class$ - #define IntegerClass java::lang::Integer::class$ - #ifdef DISABLE_JAVA_NET void --- 39,52 ---- #include #include #include + #include #include + #include #include #include #include #include #ifdef DISABLE_JAVA_NET void *************** java::net::PlainDatagramSocketImpl::bind *** 89,94 **** --- 63,82 ---- JvNewStringLatin1 ("DatagramSocketImpl.bind: unimplemented")); } + void + java::net::PlainDatagramSocketImpl::connect (java::net::InetAddress *, jint) + { + throw new SocketException ( + JvNewStringLatin1 ("DatagramSocketImpl.connect: unimplemented")); + } + + void + java::net::PlainDatagramSocketImpl::disconnect () + { + throw new SocketException ( + JvNewStringLatin1 ("DatagramSocketImpl.disconnect: unimplemented")); + } + jint java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *) { *************** java::net::PlainDatagramSocketImpl::peek *** 96,101 **** --- 84,96 ---- JvNewStringLatin1 ("DatagramSocketImpl.peek: unimplemented")); } + jint + java::net::PlainDatagramSocketImpl::peekData(java::net::DatagramPacket *) + { + throw new java::io::IOException ( + JvNewStringLatin1 ("DatagramSocketImpl.peekData: unimplemented")); + } + void java::net::PlainDatagramSocketImpl::close () { *************** java::net::PlainDatagramSocketImpl::getT *** 133,138 **** --- 128,134 ---- void java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *, + java::net::NetworkInterface *, jboolean) { throw new java::io::IOException ( *************** java::net::PlainDatagramSocketImpl::getO *** 155,163 **** #else /* DISABLE_JAVA_NET */ - #ifndef HAVE_SOCKLEN_T - typedef int socklen_t; - #endif union SockAddr { --- 151,156 ---- *************** union InAddr *** 192,198 **** void java::net::PlainDatagramSocketImpl::create () { ! int sock = ::socket (AF_INET, SOCK_DGRAM, 0); if (sock < 0) { char* strerr = strerror (errno); --- 185,192 ---- void java::net::PlainDatagramSocketImpl::create () { ! int sock = _Jv_socket (AF_INET, SOCK_DGRAM, 0); ! if (sock < 0) { char* strerr = strerror (errno); *************** java::net::PlainDatagramSocketImpl::bind *** 220,229 **** if (len == 4) { u.address.sin_family = AF_INET; if (host != NULL) ! memcpy (&u.address.sin_addr, bytes, len); else ! u.address.sin_addr.s_addr = htonl (INADDR_ANY); len = sizeof (struct sockaddr_in); u.address.sin_port = htons (lport); } --- 214,225 ---- if (len == 4) { u.address.sin_family = AF_INET; + if (host != NULL) ! memcpy (&u.address.sin_addr, bytes, len); else ! u.address.sin_addr.s_addr = htonl (INADDR_ANY); ! len = sizeof (struct sockaddr_in); u.address.sin_port = htons (lport); } *************** java::net::PlainDatagramSocketImpl::bind *** 242,265 **** --- 238,279 ---- if (_Jv_bind (fnum, ptr, len) == 0) { socklen_t addrlen = sizeof(u); + if (lport != 0) localPort = lport; else if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0) localPort = ntohs (u.address.sin_port); else goto error; + /* Allow broadcast by default. */ int broadcast = 1; if (::setsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &broadcast, sizeof (broadcast)) != 0) goto error; + return; } + error: char* strerr = strerror (errno); throw new java::net::BindException (JvNewStringUTF (strerr)); } + void + java::net::PlainDatagramSocketImpl::connect (java::net::InetAddress *, jint) + { + throw new ::java::lang::InternalError (JvNewStringLatin1 ( + "PlainDatagramSocketImpl::connect: not implemented yet")); + } + + void + java::net::PlainDatagramSocketImpl::disconnect () + { + throw new ::java::lang::InternalError (JvNewStringLatin1 ( + "PlainDatagramSocketImpl::disconnect: not implemented yet")); + } + jint java::net::PlainDatagramSocketImpl::peek (java::net::InetAddress *i) { *************** java::net::PlainDatagramSocketImpl::peek *** 295,300 **** --- 309,385 ---- return rport; error: char* strerr = strerror (errno); + + if (errno == ECONNREFUSED) + throw new PortUnreachableException (JvNewStringUTF (strerr)); + + throw new java::io::IOException (JvNewStringUTF (strerr)); + } + + jint + java::net::PlainDatagramSocketImpl::peekData(java::net::DatagramPacket *p) + { + // FIXME: Deal with Multicast and if the socket is connected. + union SockAddr u; + socklen_t addrlen = sizeof(u); + jbyte *dbytes = elements (p->getData()); + ssize_t retlen = 0; + + // FIXME: implement timeout support for Win32 + #ifndef WIN32 + // Do timeouts via select since SO_RCVTIMEO is not always available. + if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE) + { + fd_set rset; + struct timeval tv; + FD_ZERO(&rset); + FD_SET(fnum, &rset); + tv.tv_sec = timeout / 1000; + tv.tv_usec = (timeout % 1000) * 1000; + int retval; + if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0) + goto error; + else if (retval == 0) + throw new java::io::InterruptedIOException (); + } + #endif /* WIN32 */ + + retlen = + ::recvfrom (fnum, (char *) dbytes, p->getLength(), MSG_PEEK, (sockaddr*) &u, + &addrlen); + if (retlen < 0) + goto error; + // FIXME: Deal with Multicast addressing and if the socket is connected. + jbyteArray raddr; + jint rport; + if (u.address.sin_family == AF_INET) + { + raddr = JvNewByteArray (4); + memcpy (elements (raddr), &u.address.sin_addr, 4); + rport = ntohs (u.address.sin_port); + } + #ifdef HAVE_INET6 + else if (u.address.sin_family == AF_INET6) + { + raddr = JvNewByteArray (16); + memcpy (elements (raddr), &u.address6.sin6_addr, 16); + rport = ntohs (u.address6.sin6_port); + } + #endif + else + throw new java::net::SocketException (JvNewStringUTF ("invalid family")); + + p->setAddress (new InetAddress (raddr, NULL)); + p->setPort (rport); + p->setLength ((jint) retlen); + return rport; + + error: + char* strerr = strerror (errno); + + if (errno == ECONNREFUSED) + throw new PortUnreachableException (JvNewStringUTF (strerr)); + throw new java::io::IOException (JvNewStringUTF (strerr)); } *************** java::net::PlainDatagramSocketImpl::clos *** 307,313 **** // The method isn't declared to throw anything, so we disregard // the return value. ! ::close (fnum); fnum = -1; timeout = 0; } --- 392,398 ---- // The method isn't declared to throw anything, so we disregard // the return value. ! _Jv_close (fnum); fnum = -1; timeout = 0; } *************** java::net::PlainDatagramSocketImpl::send *** 346,351 **** --- 431,440 ---- return; char* strerr = strerror (errno); + + if (errno == ECONNREFUSED) + throw new PortUnreachableException (JvNewStringUTF (strerr)); + throw new java::io::IOException (JvNewStringUTF (strerr)); } *************** java::net::PlainDatagramSocketImpl::rece *** 361,367 **** // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select since SO_RCVTIMEO is not always available. ! if (timeout > 0) { fd_set rset; struct timeval tv; --- 450,456 ---- // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select since SO_RCVTIMEO is not always available. ! if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE) { fd_set rset; struct timeval tv; *************** java::net::PlainDatagramSocketImpl::rece *** 371,379 **** tv.tv_usec = (timeout % 1000) * 1000; int retval; if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0) ! goto error; else if (retval == 0) ! throw new java::io::InterruptedIOException (); } #endif /* WIN32 */ --- 460,468 ---- tv.tv_usec = (timeout % 1000) * 1000; int retval; if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0) ! goto error; else if (retval == 0) ! throw new java::io::InterruptedIOException (); } #endif /* WIN32 */ *************** java::net::PlainDatagramSocketImpl::rece *** 406,413 **** --- 495,507 ---- p->setPort (rport); p->setLength ((jint) retlen); return; + error: char* strerr = strerror (errno); + + if (errno == ECONNREFUSED) + throw new PortUnreachableException (JvNewStringUTF (strerr)); + throw new java::io::IOException (JvNewStringUTF (strerr)); } *************** java::net::PlainDatagramSocketImpl::setT *** 417,422 **** --- 511,517 ---- // Assumes IPPROTO_IP rather than IPPROTO_IPV6 since socket created is IPv4. char val = (char) ttl; socklen_t val_len = sizeof(val); + if (::setsockopt (fnum, IPPROTO_IP, IP_MULTICAST_TTL, &val, val_len) == 0) return; *************** java::net::PlainDatagramSocketImpl::getT *** 430,435 **** --- 525,531 ---- // Assumes IPPROTO_IP rather than IPPROTO_IPV6 since socket created is IPv4. char val; socklen_t val_len = sizeof(val); + if (::getsockopt (fnum, IPPROTO_IP, IP_MULTICAST_TTL, &val, &val_len) == 0) return ((int) val) & 0xFF; *************** java::net::PlainDatagramSocketImpl::getT *** 439,446 **** --- 535,545 ---- void java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr, + java::net::NetworkInterface *, jboolean join) { + // FIXME: implement use of NetworkInterface + union McastReq u; jbyteArray haddress = inetaddr->addr; jbyte *bytes = elements (haddress); *************** java::net::PlainDatagramSocketImpl::setO *** 501,513 **** int val; socklen_t val_len = sizeof (val); ! if (_Jv_IsInstanceOf (value, &BooleanClass)) { java::lang::Boolean *boolobj = static_cast (value); val = boolobj->booleanValue() ? 1 : 0; } ! else if (_Jv_IsInstanceOf (value, &IntegerClass)) { java::lang::Integer *intobj = static_cast (value); --- 600,615 ---- int val; socklen_t val_len = sizeof (val); ! if (fnum < 0) ! throw new java::net::SocketException (JvNewStringUTF ("Socket closed")); ! ! if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$)) { java::lang::Boolean *boolobj = static_cast (value); val = boolobj->booleanValue() ? 1 : 0; } ! else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$)) { java::lang::Integer *intobj = static_cast (value); *************** java::net::PlainDatagramSocketImpl::setO *** 525,530 **** --- 627,648 ---- throw new java::net::SocketException ( JvNewStringUTF ("SO_LINGER not valid for UDP")); return; + case _Jv_SO_KEEPALIVE_ : + throw new java::net::SocketException ( + JvNewStringUTF ("SO_KEEPALIVE not valid for UDP")); + return; + + case _Jv_SO_BROADCAST_ : + if (::setsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val, + val_len) != 0) + goto error; + break; + + case _Jv_SO_OOBINLINE_ : + throw new java::net::SocketException ( + JvNewStringUTF ("SO_OOBINLINE: not valid for UDP")); + break; + case _Jv_SO_SNDBUF_ : case _Jv_SO_RCVBUF_ : #if defined(SO_SNDBUF) && defined(SO_RCVBUF) *************** java::net::PlainDatagramSocketImpl::setO *** 588,593 **** --- 706,728 ---- if (::setsockopt (fnum, level, opname, ptr, len) != 0) goto error; return; + + case _Jv_IP_MULTICAST_IF2_ : + throw new java::net::SocketException ( + JvNewStringUTF ("IP_MULTICAST_IF2: not yet implemented")); + break; + + case _Jv_IP_MULTICAST_LOOP_ : + throw new java::net::SocketException ( + JvNewStringUTF ("IP_MULTICAST_LOOP: not yet implemented")); + break; + + case _Jv_IP_TOS_ : + if (::setsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val, + val_len) != 0) + goto error; + return; + case _Jv_SO_TIMEOUT_ : timeout = val; return; *************** java::net::PlainDatagramSocketImpl::getO *** 614,624 **** throw new java::net::SocketException ( JvNewStringUTF ("TCP_NODELAY not valid for UDP")); break; - case _Jv_SO_LINGER_ : throw new java::net::SocketException ( JvNewStringUTF ("SO_LINGER not valid for UDP")); break; case _Jv_SO_RCVBUF_ : case _Jv_SO_SNDBUF_ : #if defined(SO_SNDBUF) && defined(SO_RCVBUF) --- 749,774 ---- throw new java::net::SocketException ( JvNewStringUTF ("TCP_NODELAY not valid for UDP")); break; case _Jv_SO_LINGER_ : throw new java::net::SocketException ( JvNewStringUTF ("SO_LINGER not valid for UDP")); break; + case _Jv_SO_KEEPALIVE_ : + throw new java::net::SocketException ( + JvNewStringUTF ("SO_KEEPALIVE not valid for UDP")); + break; + + case _Jv_SO_BROADCAST_ : + if (::getsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val, + &val_len) != 0) + goto error; + return new java::lang::Boolean (val != 0); + + case _Jv_SO_OOBINLINE_ : + throw new java::net::SocketException ( + JvNewStringUTF ("SO_OOBINLINE not valid for UDP")); + break; + case _Jv_SO_RCVBUF_ : case _Jv_SO_SNDBUF_ : #if defined(SO_SNDBUF) && defined(SO_RCVBUF) *************** java::net::PlainDatagramSocketImpl::getO *** 653,659 **** } #endif else ! throw new java::net::SocketException (JvNewStringUTF ("invalid family")); localAddress = new java::net::InetAddress (laddr, NULL); } return localAddress; --- 803,810 ---- } #endif else ! throw new java::net::SocketException ( ! JvNewStringUTF ("invalid family")); localAddress = new java::net::InetAddress (laddr, NULL); } return localAddress; *************** java::net::PlainDatagramSocketImpl::getO *** 691,696 **** --- 842,865 ---- case _Jv_SO_TIMEOUT_ : return new java::lang::Integer (timeout); break; + + case _Jv_IP_MULTICAST_IF2_ : + throw new java::net::SocketException ( + JvNewStringUTF ("IP_MULTICAST_IF2: not yet implemented")); + break; + + case _Jv_IP_MULTICAST_LOOP_ : + if (::getsockopt (fnum, SOL_SOCKET, IP_MULTICAST_LOOP, (char *) &val, + &val_len) != 0) + goto error; + return new java::lang::Boolean (val != 0); + + case _Jv_IP_TOS_ : + if (::getsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val, + &val_len) != 0) + goto error; + return new java::lang::Integer (val); + default : errno = ENOPROTOOPT; } diff -Nrc3pad gcc-3.2.3/libjava/java/net/natPlainSocketImpl.cc gcc-3.3/libjava/java/net/natPlainSocketImpl.cc *** gcc-3.2.3/libjava/java/net/natPlainSocketImpl.cc 2002-04-15 03:21:58.000000000 +0000 --- gcc-3.3/libjava/java/net/natPlainSocketImpl.cc 2002-11-26 20:09:28.000000000 +0000 *************** details. */ *** 10,16 **** --- 10,18 ---- #include #ifndef DISABLE_JAVA_NET + #ifdef WIN32 + #include #include #include *************** details. */ *** 22,33 **** // These functions make the Win32 socket API look more POSIXy static inline int - close(int s) - { - return closesocket(s); - } - - static inline int write(int s, void *buf, int len) { return send(s, (char*)buf, len, 0); --- 24,29 ---- *************** read(int s, void *buf, int len) *** 40,56 **** } // these errors cannot occur on Win32 - #define ENOTCONN 0 - #define ECONNRESET 0 - #ifndef ENOPROTOOPT - #define ENOPROTOOPT 109 - #endif #else /* WIN32 */ ! #include #include #include #include #include #endif /* WIN32 */ #endif /* DISABLE_JAVA_NET */ --- 36,58 ---- } // these errors cannot occur on Win32 #else /* WIN32 */ ! ! #ifdef HAVE_SYS_IOCTL_H ! #define BSD_COMP /* Get FIONREAD on Solaris2. */ ! #include ! #endif ! ! // Pick up FIONREAD on Solaris 2.5. ! #ifdef HAVE_SYS_FILIO_H ! #include ! #endif ! #include #include #include #include + #endif /* WIN32 */ #endif /* DISABLE_JAVA_NET */ *************** read(int s, void *buf, int len) *** 59,104 **** #include #endif - #ifndef HAVE_SOCKLEN_T - typedef int socklen_t; - #endif - - #ifndef DISABLE_JAVA_NET - - // Avoid macro definitions of bind, connect from system headers, e.g. on - // Solaris 7 with _XOPEN_SOURCE. FIXME - static inline int - _Jv_bind (int fd, struct sockaddr *addr, int addrlen) - { - return ::bind (fd, addr, addrlen); - } - - #ifdef bind - #undef bind - #endif - - static inline int - _Jv_connect (int fd, struct sockaddr *addr, int addrlen) - { - return ::connect (fd, addr, addrlen); - } - - #ifdef connect - #undef connect - #endif - - // Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET - static inline int - _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen) - { - return ::accept (fd, addr, addrlen); - } - - #ifdef accept - #undef accept - #endif - - #endif /* DISABLE_JAVA_NET */ #include #include --- 61,66 ---- *************** _Jv_accept (int fd, struct sockaddr *add *** 108,114 **** --- 70,78 ---- #include #include #include + #include #include + #include #include #include #include *************** java::net::PlainSocketImpl::bind (java:: *** 136,142 **** } void ! java::net::PlainSocketImpl::connect (java::net::InetAddress *, jint) { throw new ConnectException ( JvNewStringLatin1 ("SocketImpl.connect: unimplemented")); --- 100,106 ---- } void ! java::net::PlainSocketImpl::connect (java::net::SocketAddress *, jint) { throw new ConnectException ( JvNewStringLatin1 ("SocketImpl.connect: unimplemented")); *************** java::net::PlainSocketImpl::write(jbyteA *** 198,203 **** --- 162,174 ---- JvNewStringLatin1 ("SocketImpl.write: unimplemented")); } + void + java::net::PlainSocketImpl::sendUrgentData(jint data) + { + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.sendUrgentData: unimplemented")); + } + jint java::net::PlainSocketImpl::available(void) { *************** java::net::PlainSocketImpl::close(void) *** 212,217 **** --- 183,202 ---- JvNewStringLatin1 ("SocketImpl.close: unimplemented")); } + void + java::net::PlainSocketImpl::shutdownInput (void) + { + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.shutdownInput: unimplemented")); + } + + void + java::net::PlainSocketImpl::shutdownOutput (void) + { + throw new SocketException ( + JvNewStringLatin1 ("SocketImpl.shutdownOutput: unimplemented")); + } + #else /* DISABLE_JAVA_NET */ union SockAddr *************** union SockAddr *** 225,231 **** void java::net::PlainSocketImpl::create (jboolean stream) { ! int sock = ::socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0); if (sock < 0) { char* strerr = strerror (errno); --- 210,217 ---- void java::net::PlainSocketImpl::create (jboolean stream) { ! int sock = _Jv_socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0); ! if (sock < 0) { char* strerr = strerror (errno); *************** java::net::PlainSocketImpl::bind (java:: *** 252,261 **** if (len == 4) { u.address.sin_family = AF_INET; if (host != NULL) memcpy (&u.address.sin_addr, bytes, len); else ! u.address.sin_addr.s_addr = htonl (INADDR_ANY); len = sizeof (struct sockaddr_in); u.address.sin_port = htons (lport); } --- 238,249 ---- if (len == 4) { u.address.sin_family = AF_INET; + if (host != NULL) memcpy (&u.address.sin_addr, bytes, len); else ! u.address.sin_addr.s_addr = htonl (INADDR_ANY); ! len = sizeof (struct sockaddr_in); u.address.sin_port = htons (lport); } *************** java::net::PlainSocketImpl::bind (java:: *** 278,299 **** { address = host; socklen_t addrlen = sizeof(u); if (lport != 0) localport = lport; else if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0) localport = ntohs (u.address.sin_port); else goto error; return; } error: char* strerr = strerror (errno); throw new java::net::BindException (JvNewStringUTF (strerr)); } void ! java::net::PlainSocketImpl::connect (java::net::InetAddress *host, jint rport) { union SockAddr u; socklen_t addrlen = sizeof(u); jbyteArray haddress = host->addr; --- 266,295 ---- { address = host; socklen_t addrlen = sizeof(u); + if (lport != 0) localport = lport; else if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0) localport = ntohs (u.address.sin_port); else goto error; + return; } + error: char* strerr = strerror (errno); throw new java::net::BindException (JvNewStringUTF (strerr)); } void ! java::net::PlainSocketImpl::connect (java::net::SocketAddress *addr, ! jint timeout) { + java::net::InetSocketAddress *tmp = (java::net::InetSocketAddress*) addr; + java::net::InetAddress *host = tmp->getAddress(); + jint rport = tmp->getPort(); + union SockAddr u; socklen_t addrlen = sizeof(u); jbyteArray haddress = host->addr; *************** java::net::PlainSocketImpl::connect (jav *** 319,337 **** else throw new java::net::SocketException (JvNewStringUTF ("invalid length")); ! if (_Jv_connect (fnum, ptr, len) != 0) ! goto error; address = host; port = rport; // A bind may not have been done on this socket; if so, set localport now. if (localport == 0) { if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0) ! localport = ntohs (u.address.sin_port); else ! goto error; } return; error: char* strerr = strerror (errno); throw new java::net::ConnectException (JvNewStringUTF (strerr)); --- 315,365 ---- else throw new java::net::SocketException (JvNewStringUTF ("invalid length")); ! // FIXME: implement timeout support for Win32 ! #ifndef WIN32 ! if (timeout > 0) ! { ! int flags = ::fcntl (fnum, F_GETFL); ! ::fcntl (fnum, F_SETFL, flags | O_NONBLOCK); ! ! if ((_Jv_connect (fnum, ptr, len) != 0) && (errno != EINPROGRESS)) ! goto error; ! ! fd_set rset; ! struct timeval tv; ! FD_ZERO(&rset); ! FD_SET(fnum, &rset); ! tv.tv_sec = timeout / 1000; ! tv.tv_usec = (timeout % 1000) * 1000; ! int retval; ! ! if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0) ! goto error; ! else if (retval == 0) ! throw new java::net::SocketTimeoutException ! (JvNewStringUTF ("Connect timed out")); ! } ! else ! #endif ! { ! if (_Jv_connect (fnum, ptr, len) != 0) ! goto error; ! } ! address = host; port = rport; + // A bind may not have been done on this socket; if so, set localport now. if (localport == 0) { if (::getsockname (fnum, (sockaddr*) &u, &addrlen) == 0) ! localport = ntohs (u.address.sin_port); else ! goto error; } + return; + error: char* strerr = strerror (errno); throw new java::net::ConnectException (JvNewStringUTF (strerr)); *************** java::net::PlainSocketImpl::accept (java *** 357,363 **** // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select since SO_RCVTIMEO is not always available. ! if (timeout > 0) { fd_set rset; struct timeval tv; --- 385,391 ---- // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select since SO_RCVTIMEO is not always available. ! if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE) { fd_set rset; struct timeval tv; *************** java::net::PlainSocketImpl::accept (java *** 367,380 **** tv.tv_usec = (timeout % 1000) * 1000; int retval; if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0) ! goto error; else if (retval == 0) ! throw new java::io::InterruptedIOException ( ! JvNewStringUTF("Accept timed out")); } #endif /* WIN32 */ new_socket = _Jv_accept (fnum, (sockaddr*) &u, &addrlen); if (new_socket < 0) goto error; --- 395,409 ---- tv.tv_usec = (timeout % 1000) * 1000; int retval; if ((retval = _Jv_select (fnum + 1, &rset, NULL, NULL, &tv)) < 0) ! goto error; else if (retval == 0) ! throw new java::io::InterruptedIOException ( ! JvNewStringUTF("Accept timed out")); } #endif /* WIN32 */ new_socket = _Jv_accept (fnum, (sockaddr*) &u, &addrlen); + if (new_socket < 0) goto error; *************** java::net::PlainSocketImpl::accept (java *** 404,409 **** --- 433,439 ---- s->address = new InetAddress (raddr, NULL); s->port = rport; return; + error: char* strerr = strerror (errno); throw new java::io::IOException (JvNewStringUTF (strerr)); *************** java::net::PlainSocketImpl::close() *** 417,430 **** JvSynchronize sync (this); // should we use shutdown here? how would that effect so_linger? ! int res = ::close (fnum); if (res == -1) { // These three errors are not errors according to tests performed // on the reference implementation. if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF) ! throw new java::io::IOException (JvNewStringUTF (strerror (errno))); } // Safe place to reset the file pointer. fnum = -1; --- 447,460 ---- JvSynchronize sync (this); // should we use shutdown here? how would that effect so_linger? ! int res = _Jv_close (fnum); if (res == -1) { // These three errors are not errors according to tests performed // on the reference implementation. if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF) ! throw new java::io::IOException (JvNewStringUTF (strerror (errno))); } // Safe place to reset the file pointer. fnum = -1; *************** java::net::PlainSocketImpl::write(jint b *** 440,461 **** while (r != 1) { ! r = ::write (fnum, &d, 1); if (r == -1) ! { ! if (java::lang::Thread::interrupted()) ! { ! java::io::InterruptedIOException *iioe ! = new java::io::InterruptedIOException ! (JvNewStringLatin1 (strerror (errno))); ! iioe->bytesTransferred = 0; ! throw iioe; ! } ! // Some errors should not cause exceptions. ! if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF) ! throw new java::io::IOException (JvNewStringUTF (strerror (errno))); ! break; ! } } } --- 470,491 ---- while (r != 1) { ! r = _Jv_write (fnum, &d, 1); if (r == -1) ! { ! if (java::lang::Thread::interrupted()) ! { ! java::io::InterruptedIOException *iioe ! = new java::io::InterruptedIOException ! (JvNewStringLatin1 (strerror (errno))); ! iioe->bytesTransferred = 0; ! throw iioe; ! } ! // Some errors should not cause exceptions. ! if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF) ! throw new java::io::IOException (JvNewStringUTF (strerror (errno))); ! break; ! } } } *************** java::net::PlainSocketImpl::write(jbyteA *** 470,499 **** jbyte *bytes = elements (b) + offset; int written = 0; while (len > 0) { ! int r = ::write (fnum, bytes, len); if (r == -1) { ! if (java::lang::Thread::interrupted()) ! { ! java::io::InterruptedIOException *iioe ! = new java::io::InterruptedIOException ! (JvNewStringLatin1 (strerror (errno))); ! iioe->bytesTransferred = written; ! throw iioe; ! } ! // Some errors should not cause exceptions. ! if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF) ! throw new java::io::IOException (JvNewStringUTF (strerror (errno))); ! break; ! } written += r; len -= r; bytes += r; } } // Read a single byte from the socket. jint --- 500,538 ---- jbyte *bytes = elements (b) + offset; int written = 0; + while (len > 0) { ! int r = _Jv_write (fnum, bytes, len); ! if (r == -1) { ! if (java::lang::Thread::interrupted()) ! { ! java::io::InterruptedIOException *iioe ! = new java::io::InterruptedIOException ! (JvNewStringLatin1 (strerror (errno))); ! iioe->bytesTransferred = written; ! throw iioe; ! } ! // Some errors should not cause exceptions. ! if (errno != ENOTCONN && errno != ECONNRESET && errno != EBADF) ! throw new java::io::IOException (JvNewStringUTF (strerror (errno))); ! break; ! } ! written += r; len -= r; bytes += r; } } + void + java::net::PlainSocketImpl::sendUrgentData (jint) + { + throw new SocketException (JvNewStringLatin1 ( + "PlainSocketImpl: sending of urgent data not supported by this socket")); + } // Read a single byte from the socket. jint *************** java::net::PlainSocketImpl::read(void) *** 504,540 **** // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select. ! if (timeout > 0) ! { ! // Create the file descriptor set. ! fd_set read_fds; ! FD_ZERO (&read_fds); ! FD_SET (fnum,&read_fds); ! // Create the timeout struct based on our internal timeout value. ! struct timeval timeout_value; ! timeout_value.tv_sec = timeout / 1000; ! timeout_value.tv_usec = (timeout % 1000) * 1000; ! // Select on the fds. ! int sel_retval = _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value); ! // If select returns 0 we've waited without getting data... ! // that means we've timed out. ! if (sel_retval == 0) ! throw new java::io::InterruptedIOException ! (JvNewStringUTF ("read timed out") ); ! // If select returns ok we know we either got signalled or read some data... ! // either way we need to try to read. ! } #endif /* WIN32 */ ! int r = ::read (fnum, &b, 1); if (r == 0) return -1; if (java::lang::Thread::interrupted()) { java::io::InterruptedIOException *iioe = ! new java::io::InterruptedIOException ! (JvNewStringUTF("read interrupted")); iioe->bytesTransferred = r == -1 ? 0 : r; throw iioe; } --- 543,581 ---- // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select. ! if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE) ! { ! // Create the file descriptor set. ! fd_set read_fds; ! FD_ZERO (&read_fds); ! FD_SET (fnum,&read_fds); ! // Create the timeout struct based on our internal timeout value. ! struct timeval timeout_value; ! timeout_value.tv_sec = timeout / 1000; ! timeout_value.tv_usec = (timeout % 1000) * 1000; ! // Select on the fds. ! int sel_retval = ! _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value); ! // If select returns 0 we've waited without getting data... ! // that means we've timed out. ! if (sel_retval == 0) ! throw new java::io::InterruptedIOException ! (JvNewStringUTF ("read timed out") ); ! // If select returns ok we know we either got signalled or read some data... ! // either way we need to try to read. ! } #endif /* WIN32 */ ! int r = _Jv_read (fnum, &b, 1); if (r == 0) return -1; + if (java::lang::Thread::interrupted()) { java::io::InterruptedIOException *iioe = ! new java::io::InterruptedIOException ! (JvNewStringUTF("read interrupted")); iioe->bytesTransferred = r == -1 ? 0 : r; throw iioe; } *************** java::net::PlainSocketImpl::read(void) *** 542,551 **** { // Some errors cause us to return end of stream... if (errno == ENOTCONN) ! return -1; // Other errors need to be signalled. throw new java::io::IOException (JvNewStringUTF (strerror (errno))); } return b & 0xFF; } --- 583,594 ---- { // Some errors cause us to return end of stream... if (errno == ENOTCONN) ! return -1; ! // Other errors need to be signalled. throw new java::io::IOException (JvNewStringUTF (strerror (errno))); } + return b & 0xFF; } *************** java::net::PlainSocketImpl::read(jbyteAr *** 555,603 **** { if (! buffer) throw new java::lang::NullPointerException; jsize bsize = JvGetArrayLength (buffer); if (offset < 0 || count < 0 || offset + count > bsize) throw new java::lang::ArrayIndexOutOfBoundsException; jbyte *bytes = elements (buffer) + offset; // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select. ! if (timeout > 0) ! { ! // Create the file descriptor set. ! fd_set read_fds; ! FD_ZERO (&read_fds); ! FD_SET (fnum, &read_fds); ! // Create the timeout struct based on our internal timeout value. ! struct timeval timeout_value; ! timeout_value.tv_sec = timeout / 1000; ! timeout_value.tv_usec =(timeout % 1000) * 1000; ! // Select on the fds. ! int sel_retval = _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value); ! // We're only interested in the 0 return. ! // error returns still require us to try to read ! // the socket to see what happened. ! if (sel_retval == 0) ! { ! java::io::InterruptedIOException *iioe = ! new java::io::InterruptedIOException ! (JvNewStringUTF ("read interrupted")); ! iioe->bytesTransferred = 0; ! throw iioe; ! } ! } #endif // Read the socket. int r = ::recv (fnum, (char *) bytes, count, 0); if (r == 0) return -1; if (java::lang::Thread::interrupted()) { java::io::InterruptedIOException *iioe = ! new java::io::InterruptedIOException ! (JvNewStringUTF ("read interrupted")); iioe->bytesTransferred = r == -1 ? 0 : r; throw iioe; } --- 598,652 ---- { if (! buffer) throw new java::lang::NullPointerException; + jsize bsize = JvGetArrayLength (buffer); + if (offset < 0 || count < 0 || offset + count > bsize) throw new java::lang::ArrayIndexOutOfBoundsException; + jbyte *bytes = elements (buffer) + offset; // FIXME: implement timeout support for Win32 #ifndef WIN32 // Do timeouts via select. ! if (timeout > 0 && fnum >= 0 && fnum < FD_SETSIZE) ! { ! // Create the file descriptor set. ! fd_set read_fds; ! FD_ZERO (&read_fds); ! FD_SET (fnum, &read_fds); ! // Create the timeout struct based on our internal timeout value. ! struct timeval timeout_value; ! timeout_value.tv_sec = timeout / 1000; ! timeout_value.tv_usec =(timeout % 1000) * 1000; ! // Select on the fds. ! int sel_retval = ! _Jv_select (fnum + 1, &read_fds, NULL, NULL, &timeout_value); ! // We're only interested in the 0 return. ! // error returns still require us to try to read ! // the socket to see what happened. ! if (sel_retval == 0) ! { ! java::io::InterruptedIOException *iioe = ! new java::io::InterruptedIOException ! (JvNewStringUTF ("read interrupted")); ! iioe->bytesTransferred = 0; ! throw iioe; ! } ! } #endif // Read the socket. int r = ::recv (fnum, (char *) bytes, count, 0); + if (r == 0) return -1; + if (java::lang::Thread::interrupted()) { java::io::InterruptedIOException *iioe = ! new java::io::InterruptedIOException ! (JvNewStringUTF ("read interrupted")); iioe->bytesTransferred = r == -1 ? 0 : r; throw iioe; } *************** java::net::PlainSocketImpl::read(jbyteAr *** 605,614 **** { // Some errors cause us to return end of stream... if (errno == ENOTCONN) ! return -1; // Other errors need to be signalled. throw new java::io::IOException (JvNewStringUTF (strerror (errno))); } return r; } --- 654,665 ---- { // Some errors cause us to return end of stream... if (errno == ENOTCONN) ! return -1; ! // Other errors need to be signalled. throw new java::io::IOException (JvNewStringUTF (strerror (errno))); } + return r; } *************** java::net::PlainSocketImpl::available(vo *** 623,628 **** --- 674,680 ---- #if defined(FIONREAD) r = ::ioctl (fnum, FIONREAD, &num); + if (r == -1 && errno == ENOTTY) { // If the ioctl doesn't work, we don't care. *************** java::net::PlainSocketImpl::available(vo *** 643,675 **** { posix_error: throw new java::io::IOException(JvNewStringUTF(strerror(errno))); - } // If we didn't get anything we can use select. #if defined(HAVE_SELECT) if (! num_set) ! { ! fd_set rd; ! FD_ZERO (&rd); ! FD_SET (fnum, &rd); ! struct timeval tv; ! tv.tv_sec = 0; ! tv.tv_usec = 0; ! r = _Jv_select (fnum + 1, &rd, NULL, NULL, &tv); ! if(r == -1) ! goto posix_error; ! num = r == 0 ? 0 : 1; ! } #endif /* HAVE_SELECT */ return (jint) num; #else throw new java::io::IOException (JvNewStringUTF ("unimplemented")); #endif ! } ! void java::net::PlainSocketImpl::setOption (jint optID, java::lang::Object *value) --- 695,726 ---- { posix_error: throw new java::io::IOException(JvNewStringUTF(strerror(errno))); } // If we didn't get anything we can use select. #if defined(HAVE_SELECT) if (! num_set) ! if (! num_set && fnum >= 0 && fnum < FD_SETSIZE) ! { ! fd_set rd; ! FD_ZERO (&rd); ! FD_SET (fnum, &rd); ! struct timeval tv; ! tv.tv_sec = 0; ! tv.tv_usec = 0; ! r = _Jv_select (fnum + 1, &rd, NULL, NULL, &tv); ! if(r == -1) ! goto posix_error; ! num = r == 0 ? 0 : 1; ! } #endif /* HAVE_SELECT */ return (jint) num; #else throw new java::io::IOException (JvNewStringUTF ("unimplemented")); #endif ! } void java::net::PlainSocketImpl::setOption (jint optID, java::lang::Object *value) *************** java::net::PlainSocketImpl::setOption (j *** 677,682 **** --- 728,736 ---- int val; socklen_t val_len = sizeof (val); + if (fnum < 0) + throw new java::net::SocketException (JvNewStringUTF ("Socket closed")); + if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$)) { java::lang::Boolean *boolobj = *************** java::net::PlainSocketImpl::setOption (j *** 685,694 **** val = 1; else { ! if (optID == _Jv_SO_LINGER_) ! val = -1; ! else ! val = 0; } } else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$)) --- 739,748 ---- val = 1; else { ! if (optID == _Jv_SO_LINGER_) ! val = -1; ! else ! val = 0; } } else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$)) *************** java::net::PlainSocketImpl::setOption (j *** 699,705 **** } else { ! throw new java::lang::IllegalArgumentException (JvNewStringLatin1 ("`value' must be Boolean or Integer")); } switch (optID) --- 753,760 ---- } else { ! throw new java::lang::IllegalArgumentException ( ! JvNewStringLatin1 ("`value' must be Boolean or Integer")); } switch (optID) *************** java::net::PlainSocketImpl::setOption (j *** 707,759 **** case _Jv_TCP_NODELAY_ : #ifdef TCP_NODELAY if (::setsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val, ! val_len) != 0) ! goto error; #else ! throw new java::lang::InternalError ( ! JvNewStringUTF ("TCP_NODELAY not supported")); #endif /* TCP_NODELAY */ return; case _Jv_SO_LINGER_ : #ifdef SO_LINGER struct linger l_val; l_val.l_onoff = (val != -1); l_val.l_linger = val; if (::setsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val, ! sizeof(l_val)) != 0) ! goto error; #else throw new java::lang::InternalError ( JvNewStringUTF ("SO_LINGER not supported")); #endif /* SO_LINGER */ return; case _Jv_SO_SNDBUF_ : case _Jv_SO_RCVBUF_ : #if defined(SO_SNDBUF) && defined(SO_RCVBUF) int opt; optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF; if (::setsockopt (fnum, SOL_SOCKET, opt, (char *) &val, val_len) != 0) ! goto error; #else throw new java::lang::InternalError ( JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported")); #endif return; case _Jv_SO_BINDADDR_ : throw new java::net::SocketException ( JvNewStringUTF ("SO_BINDADDR: read only option")); return; case _Jv_IP_MULTICAST_IF_ : throw new java::net::SocketException ( JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP")); return; case _Jv_SO_REUSEADDR_ : throw new java::net::SocketException ( JvNewStringUTF ("SO_REUSEADDR: not valid for TCP")); return; case _Jv_SO_TIMEOUT_ : ! timeout = val; return; default : errno = ENOPROTOOPT; } --- 762,855 ---- case _Jv_TCP_NODELAY_ : #ifdef TCP_NODELAY if (::setsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val, ! val_len) != 0) ! goto error; #else ! throw new java::lang::InternalError ! (JvNewStringUTF ("TCP_NODELAY not supported")); #endif /* TCP_NODELAY */ return; + + case _Jv_SO_KEEPALIVE_ : + if (::setsockopt (fnum, SOL_SOCKET, SO_KEEPALIVE, (char *) &val, + val_len) != 0) + goto error; + break; + + case _Jv_SO_BROADCAST_ : + throw new java::net::SocketException + (JvNewStringUTF ("SO_BROADCAST not valid for TCP")); + break; + + case _Jv_SO_OOBINLINE_ : + if (::setsockopt (fnum, SOL_SOCKET, SO_OOBINLINE, (char *) &val, + val_len) != 0) + goto error; + break; + case _Jv_SO_LINGER_ : #ifdef SO_LINGER struct linger l_val; l_val.l_onoff = (val != -1); l_val.l_linger = val; + if (::setsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val, ! sizeof(l_val)) != 0) ! goto error; #else throw new java::lang::InternalError ( JvNewStringUTF ("SO_LINGER not supported")); #endif /* SO_LINGER */ return; + case _Jv_SO_SNDBUF_ : case _Jv_SO_RCVBUF_ : #if defined(SO_SNDBUF) && defined(SO_RCVBUF) int opt; optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF; if (::setsockopt (fnum, SOL_SOCKET, opt, (char *) &val, val_len) != 0) ! goto error; #else throw new java::lang::InternalError ( JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported")); #endif return; + case _Jv_SO_BINDADDR_ : throw new java::net::SocketException ( JvNewStringUTF ("SO_BINDADDR: read only option")); return; + case _Jv_IP_MULTICAST_IF_ : throw new java::net::SocketException ( JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP")); return; + + case _Jv_IP_MULTICAST_IF2_ : + throw new java::net::SocketException ( + JvNewStringUTF ("IP_MULTICAST_IF2: not valid for TCP")); + break; + + case _Jv_IP_MULTICAST_LOOP_ : + throw new java::net::SocketException ( + JvNewStringUTF ("IP_MULTICAST_LOOP: not valid for TCP")); + break; + + case _Jv_IP_TOS_ : + if (::setsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val, + val_len) != 0) + goto error; + break; + case _Jv_SO_REUSEADDR_ : throw new java::net::SocketException ( JvNewStringUTF ("SO_REUSEADDR: not valid for TCP")); return; + case _Jv_SO_TIMEOUT_ : ! timeout = val; return; + default : errno = ENOPROTOOPT; } *************** java::net::PlainSocketImpl::getOption (j *** 776,860 **** switch (optID) { #ifdef TCP_NODELAY ! case _Jv_TCP_NODELAY_ : ! if (::getsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val, ! &val_len) != 0) ! goto error; ! else ! return new java::lang::Boolean (val != 0); #else ! throw new java::lang::InternalError ( ! JvNewStringUTF ("TCP_NODELAY not supported")); #endif ! break; ! ! case _Jv_SO_LINGER_ : #ifdef SO_LINGER ! if (::getsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val, ! &l_val_len) != 0) ! goto error; ! if (l_val.l_onoff) ! return new java::lang::Integer (l_val.l_linger); ! else ! return new java::lang::Boolean ((__java_boolean)false); #else ! throw new java::lang::InternalError ( ! JvNewStringUTF ("SO_LINGER not supported")); #endif ! break; ! case _Jv_SO_RCVBUF_ : ! case _Jv_SO_SNDBUF_ : #if defined(SO_SNDBUF) && defined(SO_RCVBUF) ! int opt; ! optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF; ! if (::getsockopt (fnum, SOL_SOCKET, opt, (char *) &val, &val_len) != 0) ! goto error; ! else ! return new java::lang::Integer (val); #else ! throw new java::lang::InternalError ( ! JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported")); #endif ! break; ! case _Jv_SO_BINDADDR_: ! // cache the local address ! if (localAddress == NULL) ! { ! jbyteArray laddr; ! if (::getsockname (fnum, (sockaddr*) &u, &addrlen) != 0) ! goto error; ! if (u.address.sin_family == AF_INET) ! { ! laddr = JvNewByteArray (4); ! memcpy (elements (laddr), &u.address.sin_addr, 4); ! } #ifdef HAVE_INET6 ! else if (u.address.sin_family == AF_INET6) ! { ! laddr = JvNewByteArray (16); ! memcpy (elements (laddr), &u.address6.sin6_addr, 16); ! } #endif ! else ! throw ! new java::net::SocketException (JvNewStringUTF ("invalid family")); ! localAddress = new java::net::InetAddress (laddr, NULL); ! } ! return localAddress; ! break; ! case _Jv_IP_MULTICAST_IF_ : ! throw new java::net::SocketException ( ! JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP")); ! break; ! case _Jv_SO_REUSEADDR_ : ! throw new java::net::SocketException ( ! JvNewStringUTF ("SO_REUSEADDR: not valid for TCP")); ! break; ! case _Jv_SO_TIMEOUT_ : ! return new java::lang::Integer (timeout); ! break; ! default : ! errno = ENOPROTOOPT; } error: --- 872,1000 ---- switch (optID) { #ifdef TCP_NODELAY ! case _Jv_TCP_NODELAY_ : ! if (::getsockopt (fnum, IPPROTO_TCP, TCP_NODELAY, (char *) &val, ! &val_len) != 0) ! goto error; ! else ! return new java::lang::Boolean (val != 0); #else ! throw new java::lang::InternalError ! (JvNewStringUTF ("TCP_NODELAY not supported")); #endif ! break; ! ! case _Jv_SO_LINGER_ : #ifdef SO_LINGER ! if (::getsockopt (fnum, SOL_SOCKET, SO_LINGER, (char *) &l_val, ! &l_val_len) != 0) ! goto error; ! ! if (l_val.l_onoff) ! return new java::lang::Integer (l_val.l_linger); ! else ! return new java::lang::Boolean ((jboolean)false); #else ! throw new java::lang::InternalError ! (JvNewStringUTF ("SO_LINGER not supported")); #endif ! break; ! ! case _Jv_SO_KEEPALIVE_ : ! if (::getsockopt (fnum, SOL_SOCKET, SO_KEEPALIVE, (char *) &val, ! &val_len) != 0) ! goto error; ! else ! return new java::lang::Boolean (val != 0); ! ! case _Jv_SO_BROADCAST_ : ! if (::getsockopt (fnum, SOL_SOCKET, SO_BROADCAST, (char *) &val, ! &val_len) != 0) ! goto error; ! return new java::lang::Boolean ((jboolean)val); ! ! case _Jv_SO_OOBINLINE_ : ! if (::getsockopt (fnum, SOL_SOCKET, SO_OOBINLINE, (char *) &val, ! &val_len) != 0) ! goto error; ! return new java::lang::Boolean ((jboolean)val); ! ! case _Jv_SO_RCVBUF_ : ! case _Jv_SO_SNDBUF_ : #if defined(SO_SNDBUF) && defined(SO_RCVBUF) ! int opt; ! optID == _Jv_SO_SNDBUF_ ? opt = SO_SNDBUF : opt = SO_RCVBUF; ! if (::getsockopt (fnum, SOL_SOCKET, opt, (char *) &val, &val_len) != 0) ! goto error; ! else ! return new java::lang::Integer (val); #else ! throw new java::lang::InternalError ! (JvNewStringUTF ("SO_RCVBUF/SO_SNDBUF not supported")); #endif ! break; ! case _Jv_SO_BINDADDR_: ! // cache the local address ! if (localAddress == NULL) ! { ! jbyteArray laddr; ! ! if (::getsockname (fnum, (sockaddr*) &u, &addrlen) != 0) ! goto error; ! ! if (u.address.sin_family == AF_INET) ! { ! laddr = JvNewByteArray (4); ! memcpy (elements (laddr), &u.address.sin_addr, 4); ! } #ifdef HAVE_INET6 ! else if (u.address.sin_family == AF_INET6) ! { ! laddr = JvNewByteArray (16); ! memcpy (elements (laddr), &u.address6.sin6_addr, 16); ! } #endif ! else ! throw new java::net::SocketException ! (JvNewStringUTF ("invalid family")); ! localAddress = new java::net::InetAddress (laddr, NULL); ! } ! ! return localAddress; ! break; ! case _Jv_IP_MULTICAST_IF_ : ! throw new java::net::SocketException ! (JvNewStringUTF ("IP_MULTICAST_IF: not valid for TCP")); ! break; ! ! case _Jv_IP_MULTICAST_IF2_ : ! throw new java::net::SocketException ! (JvNewStringUTF ("IP_MULTICAST_IF2: not valid for TCP")); ! break; ! ! case _Jv_IP_MULTICAST_LOOP_ : ! throw new java::net::SocketException ! (JvNewStringUTF ("IP_MULTICAST_LOOP: not valid for TCP")); ! break; ! ! case _Jv_IP_TOS_ : ! if (::getsockopt (fnum, SOL_SOCKET, IP_TOS, (char *) &val, ! &val_len) != 0) ! goto error; ! return new java::lang::Integer (val); ! break; ! ! case _Jv_SO_REUSEADDR_ : ! throw new java::net::SocketException ! (JvNewStringUTF ("SO_REUSEADDR: not valid for TCP")); ! break; ! ! case _Jv_SO_TIMEOUT_ : ! return new java::lang::Integer (timeout); ! break; ! ! default : ! errno = ENOPROTOOPT; } error: *************** java::net::PlainSocketImpl::getOption (j *** 862,865 **** --- 1002,1019 ---- throw new java::net::SocketException (JvNewStringUTF (strerr)); } + void + java::net::PlainSocketImpl::shutdownInput (void) + { + if (::shutdown (fnum, 0)) + throw new SocketException (JvNewStringUTF (strerror (errno))); + } + + void + java::net::PlainSocketImpl::shutdownOutput (void) + { + if (::shutdown (fnum, 1)) + throw new SocketException (JvNewStringUTF (strerror (errno))); + } + #endif /* DISABLE_JAVA_NET */ diff -Nrc3pad gcc-3.2.3/libjava/java/net/NetPermission.java gcc-3.3/libjava/java/net/NetPermission.java *** gcc-3.2.3/libjava/java/net/NetPermission.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/NetPermission.java 2003-02-12 22:44:38.000000000 +0000 *************** import java.security.BasicPermission; *** 48,55 **** * @author Aaron M. Renn (arenn@urbanophile.com) */ public final class NetPermission extends BasicPermission - implements java.io.Serializable { /** * Initializes a new instance of NetPermission with the * specified name. --- 48,56 ---- * @author Aaron M. Renn (arenn@urbanophile.com) */ public final class NetPermission extends BasicPermission { + static final long serialVersionUID = -8343910153355041693L; + /** * Initializes a new instance of NetPermission with the * specified name. *************** public final class NetPermission extends *** 63,69 **** /** * Initializes a new instance of NetPermission with the ! * specified name and value. Note that the value field is irrelevant and is * ignored. This constructor should never need to be used. * * @param name The name of this permission --- 64,70 ---- /** * Initializes a new instance of NetPermission with the ! * specified name and perms. Note that the perms field is irrelevant and is * ignored. This constructor should never need to be used. * * @param name The name of this permission diff -Nrc3pad gcc-3.2.3/libjava/java/net/NetworkInterface.java gcc-3.3/libjava/java/net/NetworkInterface.java *** gcc-3.2.3/libjava/java/net/NetworkInterface.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/NetworkInterface.java 2003-02-12 22:44:38.000000000 +0000 *************** *** 0 **** --- 1,238 ---- + /* NetworkInterface.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + import java.util.Enumeration; + import java.util.Vector; + + /** + * @author Michael Koch + * @since 1.4 + */ + public final class NetworkInterface + { + private static Vector networkInterfaces; + + private String name; + + private Vector inetAddresses; + + private NetworkInterface (String name, InetAddress address) + { + this.name = name; + this.inetAddresses = new Vector (1, 1); + this.inetAddresses.add (address); + } + + private native static Vector getRealNetworkInterfaces () + throws SocketException; + + /** + * Returns the name of the network interface + */ + public String getName () + { + return name; + } + + /** + * Returns all available addresses of the network interface + * + * If a @see SecurityManager is available all addresses are checked + * with @see SecurityManager::checkConnect() if they are available. + * Only InetAddresses are returned where the security manager doesn't + * thrown an exception. + * + * @return An enumeration of all addresses. + */ + public Enumeration getInetAddresses () + { + SecurityManager s = System.getSecurityManager (); + + if (s == null) + return inetAddresses.elements (); + + Vector tmpInetAddresses = new Vector (1, 1); + + for (Enumeration addresses = inetAddresses.elements (); + addresses.hasMoreElements (); ) + { + InetAddress addr = (InetAddress) addresses.nextElement (); + try + { + s.checkConnect (addr.getHostAddress (), 58000); + tmpInetAddresses.add (addr); + } + catch (SecurityException e) + { + } + } + + return tmpInetAddresses.elements (); + } + + /** + * Returns the display name of the interface + */ + public String getDisplayName () + { + return name; + } + + /** + * Returns an network interface by name + * + * @param name The name of the interface to return + * + * @exception SocketException If an error occurs + * @exception NullPointerException If the specified name is null + */ + public static NetworkInterface getByName (String name) + throws SocketException + { + if (networkInterfaces == null) + networkInterfaces = getRealNetworkInterfaces (); + + for (Enumeration e = networkInterfaces.elements (); + e.hasMoreElements (); ) + { + NetworkInterface tmp = (NetworkInterface) e.nextElement (); + + if (name.equals (tmp.getName ())) + return tmp; + } + + throw new SocketException ("no network interface with this name exists"); + } + + /** + * Return a network interface by its address + * + * @param addr The address of the interface to return + * + * @exception SocketException If an error occurs + * @exception NullPointerException If the specified addess is null + */ + public static NetworkInterface getByInetAddress (InetAddress addr) + throws SocketException + { + if (networkInterfaces == null) + networkInterfaces = getRealNetworkInterfaces (); + + for (Enumeration interfaces = networkInterfaces.elements (); + interfaces.hasMoreElements (); ) + { + NetworkInterface tmp = (NetworkInterface) interfaces.nextElement (); + + for (Enumeration addresses = tmp.inetAddresses.elements (); + addresses.hasMoreElements (); ) + { + if (addr.equals ((InetAddress) addresses.nextElement ())) + return tmp; + } + } + + throw new SocketException ( + "no network interface is bound to such an IP address"); + } + + /** + * Return an Enumeration of all available network interfaces + * + * @exception SocketException If an error occurs + */ + public static Enumeration getNetworkInterfaces () + throws SocketException + { + if (networkInterfaces == null) + networkInterfaces = getRealNetworkInterfaces (); + + Enumeration tmp = networkInterfaces.elements (); + if (tmp.hasMoreElements ()) + return tmp; + + return null; + } + + /** + * Checks if the current instance is equal to obj + * + * @param obj The object to compare with + */ + public boolean equals (Object obj) + { + if (!(obj instanceof NetworkInterface)) + return false; + + NetworkInterface tmp = (NetworkInterface) obj; + + return (name.equals (tmp.name) + && inetAddresses.equals (tmp.inetAddresses)); + } + + /** + * Returns the hashcode of the current instance + */ + public int hashCode () + { + // FIXME: hash correctly + return name.hashCode () + inetAddresses.hashCode (); + } + + /** + * Returns a string representation of the interface + */ + public String toString () + { + // FIXME: check if this is correct + String result; + String separator = System.getProperty ("line.separator"); + + result = "name: " + getDisplayName () + " (" + getName () + + ") addresses:" + separator; + + for (Enumeration e = inetAddresses.elements (); + e.hasMoreElements (); ) + { + InetAddress address = (InetAddress) e.nextElement (); + result += address.toString () + separator; + } + + return result; + } + } // class NetworkInterface diff -Nrc3pad gcc-3.2.3/libjava/java/net/NoRouteToHostException.java gcc-3.3/libjava/java/net/NoRouteToHostException.java *** gcc-3.2.3/libjava/java/net/NoRouteToHostException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/NoRouteToHostException.java 2002-06-15 19:45:34.000000000 +0000 *************** *** 1,5 **** /* NoRouteToHostException.java -- Cannot connect to a host ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* NoRouteToHostException.java -- Cannot connect to a host ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,87 **** package java.net; /** - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * Status: Believed complete and correct. - */ - - /** * This exception indicates that there is no TCP/IP route to the requested * host. This is often due to a misconfigured routing table. * ! * @author Aaron M. Renn (arenn@urbanophile.com) * @author Warren Levy ! * @date March 5, 1999. */ public class NoRouteToHostException extends SocketException { ! /* ! * Constructors ! */ ! ! /** ! * Initializes an instance of NoRouteToHostException ! * without a descriptive error message. ! */ ! public ! NoRouteToHostException() ! { ! super(); ! } ! ! /*************************************************************************/ ! ! /** ! * Initializes an instance of NoRouteToHostException ! * witha descriptive error message, such as the text from strerror(3). ! * ! * @param message A message describing the error that occurred. ! */ ! public ! NoRouteToHostException(String message) ! { ! super(message); ! } } // class NoRouteToHostException - --- 39,74 ---- package java.net; /** * This exception indicates that there is no TCP/IP route to the requested * host. This is often due to a misconfigured routing table. * ! * @author Aaron M. Renn * @author Warren Levy ! * @since 1.1 ! * @status updated to 1.4 */ public class NoRouteToHostException extends SocketException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -1897550894873493790L; ! /** ! * Create an instance without a descriptive error message. ! */ ! public NoRouteToHostException() ! { ! } + /** + * Create an instance with a descriptive error message, such as the text + * from strerror(3). + * + * @param message a message describing the error that occurred + */ + public NoRouteToHostException(String message) + { + super(message); + } } // class NoRouteToHostException diff -Nrc3pad gcc-3.2.3/libjava/java/net/PasswordAuthentication.java gcc-3.3/libjava/java/net/PasswordAuthentication.java *** gcc-3.2.3/libjava/java/net/PasswordAuthentication.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/PasswordAuthentication.java 2002-08-27 17:47:27.000000000 +0000 *************** package java.net; *** 41,46 **** --- 41,47 ---- * This class serves a container for username/password pairs. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.2 */ public final class PasswordAuthentication { diff -Nrc3pad gcc-3.2.3/libjava/java/net/PlainDatagramSocketImpl.java gcc-3.3/libjava/java/net/PlainDatagramSocketImpl.java *** gcc-3.2.3/libjava/java/net/PlainDatagramSocketImpl.java 2002-03-28 02:36:51.000000000 +0000 --- gcc-3.3/libjava/java/net/PlainDatagramSocketImpl.java 2002-09-25 05:05:06.000000000 +0000 *************** *** 1,6 **** // PlainDatagramSocketImpl.java - Implementation of DatagramSocketImpl. ! /* Copyright (C) 1999 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // PlainDatagramSocketImpl.java - Implementation of DatagramSocketImpl. ! /* Copyright (C) 1999, 2002 Free Software Foundation This file is part of libgcj. *************** class PlainDatagramSocketImpl extends Da *** 29,39 **** static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY, _Jv_SO_BINDADDR_ = SocketOptions.SO_BINDADDR, _Jv_SO_REUSEADDR_ = SocketOptions.SO_REUSEADDR, ! _Jv_IP_MULTICAST_IF_ = SocketOptions.IP_MULTICAST_IF, _Jv_SO_LINGER_ = SocketOptions.SO_LINGER, _Jv_SO_TIMEOUT_ = SocketOptions.SO_TIMEOUT, _Jv_SO_SNDBUF_ = SocketOptions.SO_SNDBUF, ! _Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF; int fnum = -1; --- 29,45 ---- static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY, _Jv_SO_BINDADDR_ = SocketOptions.SO_BINDADDR, _Jv_SO_REUSEADDR_ = SocketOptions.SO_REUSEADDR, ! _Jv_SO_BROADCAST_ = SocketOptions.SO_BROADCAST, ! _Jv_SO_OOBINLINE_ = SocketOptions.SO_OOBINLINE, ! _Jv_IP_MULTICAST_IF_ = SocketOptions.IP_MULTICAST_IF, ! _Jv_IP_MULTICAST_IF2_ = SocketOptions.IP_MULTICAST_IF2, ! _Jv_IP_MULTICAST_LOOP_ = SocketOptions.IP_MULTICAST_LOOP, ! _Jv_IP_TOS_ = SocketOptions.IP_TOS, _Jv_SO_LINGER_ = SocketOptions.SO_LINGER, _Jv_SO_TIMEOUT_ = SocketOptions.SO_TIMEOUT, _Jv_SO_SNDBUF_ = SocketOptions.SO_SNDBUF, ! _Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF, ! _Jv_SO_KEEPALIVE_ = SocketOptions.SO_KEEPALIVE; int fnum = -1; *************** class PlainDatagramSocketImpl extends Da *** 57,72 **** protected native void bind(int lport, InetAddress laddr) throws SocketException; protected native void create() throws SocketException; protected native int peek(InetAddress i) throws IOException; protected native void setTimeToLive(int ttl) throws IOException; protected native int getTimeToLive() throws IOException; protected native void send(DatagramPacket p) throws IOException; protected native void receive(DatagramPacket p) throws IOException; public native void setOption(int optID, Object value) throws SocketException; public native Object getOption(int optID) throws SocketException; ! private native void mcastGrp(InetAddress inetaddr, boolean join) ! throws IOException; protected native void close(); // Deprecated in JDK 1.2. --- 63,82 ---- protected native void bind(int lport, InetAddress laddr) throws SocketException; + protected native void connect (InetAddress i, int port) + throws SocketException; + protected native void disconnect (); protected native void create() throws SocketException; protected native int peek(InetAddress i) throws IOException; + protected native int peekData (DatagramPacket dp) throws IOException; protected native void setTimeToLive(int ttl) throws IOException; protected native int getTimeToLive() throws IOException; protected native void send(DatagramPacket p) throws IOException; protected native void receive(DatagramPacket p) throws IOException; public native void setOption(int optID, Object value) throws SocketException; public native Object getOption(int optID) throws SocketException; ! private native void mcastGrp(InetAddress inetaddr, NetworkInterface netIf, ! boolean join) throws IOException; protected native void close(); // Deprecated in JDK 1.2. *************** class PlainDatagramSocketImpl extends Da *** 83,94 **** protected void join(InetAddress inetaddr) throws IOException { ! mcastGrp(inetaddr, true); } protected void leave(InetAddress inetaddr) throws IOException { ! mcastGrp(inetaddr, false); } protected void finalize() throws Throwable --- 93,116 ---- protected void join(InetAddress inetaddr) throws IOException { ! mcastGrp(inetaddr, null, true); } protected void leave(InetAddress inetaddr) throws IOException { ! mcastGrp(inetaddr, null, false); ! } ! ! protected void joinGroup (SocketAddress mcastaddr, NetworkInterface netIf) ! throws IOException ! { ! mcastGrp(((InetSocketAddress)mcastaddr).getAddress(), netIf, true); ! } ! ! protected void leaveGroup (SocketAddress mcastaddr, NetworkInterface netIf) ! throws IOException ! { ! mcastGrp(((InetSocketAddress)mcastaddr).getAddress(), netIf, false); } protected void finalize() throws Throwable diff -Nrc3pad gcc-3.2.3/libjava/java/net/PlainSocketImpl.java gcc-3.3/libjava/java/net/PlainSocketImpl.java *** gcc-3.2.3/libjava/java/net/PlainSocketImpl.java 2002-03-28 02:36:51.000000000 +0000 --- gcc-3.3/libjava/java/net/PlainSocketImpl.java 2002-11-18 14:55:54.000000000 +0000 *************** Libgcj License. Please consult the file *** 9,16 **** details. */ package java.net; - import java.io.*; /** * The standard GCJ socket implementation. --- 9,18 ---- details. */ package java.net; + import java.io.InputStream; + import java.io.IOException; + import java.io.OutputStream; /** * The standard GCJ socket implementation. *************** class PlainSocketImpl extends SocketImpl *** 28,38 **** static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY, _Jv_SO_BINDADDR_ = SocketOptions.SO_BINDADDR, _Jv_SO_REUSEADDR_ = SocketOptions.SO_REUSEADDR, ! _Jv_IP_MULTICAST_IF_ = SocketOptions.IP_MULTICAST_IF, _Jv_SO_LINGER_ = SocketOptions.SO_LINGER, _Jv_SO_TIMEOUT_ = SocketOptions.SO_TIMEOUT, _Jv_SO_SNDBUF_ = SocketOptions.SO_SNDBUF, ! _Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF; /** * The OS file handle representing the socket. --- 30,46 ---- static final int _Jv_TCP_NODELAY_ = SocketOptions.TCP_NODELAY, _Jv_SO_BINDADDR_ = SocketOptions.SO_BINDADDR, _Jv_SO_REUSEADDR_ = SocketOptions.SO_REUSEADDR, ! _Jv_SO_BROADCAST_ = SocketOptions.SO_BROADCAST, ! _Jv_SO_OOBINLINE_ = SocketOptions.SO_OOBINLINE, ! _Jv_IP_MULTICAST_IF_ = SocketOptions.IP_MULTICAST_IF, ! _Jv_IP_MULTICAST_IF2_ = SocketOptions.IP_MULTICAST_IF2, ! _Jv_IP_MULTICAST_LOOP_ = SocketOptions.IP_MULTICAST_LOOP, ! _Jv_IP_TOS_ = SocketOptions.IP_TOS, _Jv_SO_LINGER_ = SocketOptions.SO_LINGER, _Jv_SO_TIMEOUT_ = SocketOptions.SO_TIMEOUT, _Jv_SO_SNDBUF_ = SocketOptions.SO_SNDBUF, ! _Jv_SO_RCVBUF_ = SocketOptions.SO_RCVBUF, ! _Jv_SO_KEEPALIVE_ = SocketOptions.SO_KEEPALIVE; /** * The OS file handle representing the socket. *************** class PlainSocketImpl extends SocketImpl *** 53,66 **** public native Object getOption(int optID) throws SocketException; protected native void create (boolean stream) throws IOException; protected void connect (String host, int port) throws IOException { ! connect(InetAddress.getByName(host), port); } ! protected native void connect (InetAddress host, int port) throws IOException; protected native void bind (InetAddress host, int port) throws IOException; --- 61,83 ---- public native Object getOption(int optID) throws SocketException; + public native void shutdownInput () throws IOException; + + public native void shutdownOutput () throws IOException; + protected native void create (boolean stream) throws IOException; protected void connect (String host, int port) throws IOException { ! connect (new InetSocketAddress (InetAddress.getByName(host), port), 0); } ! protected void connect (InetAddress host, int port) throws IOException ! { ! connect (new InetSocketAddress (host, port), 0); ! } ! ! protected native void connect (SocketAddress addr, int timeout) throws IOException; protected native void bind (InetAddress host, int port) throws IOException; *************** class PlainSocketImpl extends SocketImpl *** 78,83 **** --- 95,102 ---- protected native void close () throws IOException; + protected native void sendUrgentData(int data) + throws IOException; // Stream handling. diff -Nrc3pad gcc-3.2.3/libjava/java/net/PortUnreachableException.java gcc-3.3/libjava/java/net/PortUnreachableException.java *** gcc-3.2.3/libjava/java/net/PortUnreachableException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/PortUnreachableException.java 2002-08-21 18:54:07.000000000 +0000 *************** *** 0 **** --- 1,72 ---- + /* PortUnreachableException.java -- received an ICMP port unreachable datagram + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + /** + * This exception signals that an ICMP port unreachable datagram has been + * received. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public class PortUnreachableException extends SocketException + { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 8462541992376507323L; + + /** + * Create a new instance without a descriptive error message. + */ + public PortUnreachableException() + { + } + + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public PortUnreachableException(String message) + { + super(message); + } + } // class PortUnreachableException + diff -Nrc3pad gcc-3.2.3/libjava/java/net/ProtocolException.java gcc-3.3/libjava/java/net/ProtocolException.java *** gcc-3.2.3/libjava/java/net/ProtocolException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/ProtocolException.java 2002-06-15 19:45:34.000000000 +0000 *************** *** 1,5 **** ! /* ProtocolException.java -- A low level protocol error occurred ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ProtocolException.java -- a low level protocol error occurred ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,87 **** package java.net; ! /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! */ /** ! * This exception indicates that some sort of low level protocol ! * exception occurred. Look in the descriptive message (if any) for ! * details on what went wrong ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @date March 5, 1999. ! */ ! public class ProtocolException extends java.io.IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Initializes a new instance of ProtocolException ! * without a descriptive error message. ! */ ! public ! ProtocolException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Initializes a new instance of ProtocolException ! * with a descriptive error message. ! * ! * @param message A message describing the error that occurred. ! */ ! public ! ProtocolException(String message) ! { ! super(message); ! } } // class ProtocolException - --- 37,74 ---- package java.net; ! import java.io.IOException; /** ! * This exception indicates that some sort of low level protocol ! * exception occurred. Look in the descriptive message (if any) for ! * details on what went wrong. ! * ! * @author Aaron M. Renn ! * @author Warren Levy ! * @status updated to 1.4 */ ! public class ProtocolException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -6098449442062388080L; ! /** ! * Create a new instance without a descriptive error message. ! */ ! public ProtocolException() ! { ! } + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public ProtocolException(String message) + { + super(message); + } } // class ProtocolException diff -Nrc3pad gcc-3.2.3/libjava/java/net/ServerSocket.java gcc-3.3/libjava/java/net/ServerSocket.java *** gcc-3.2.3/libjava/java/net/ServerSocket.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/ServerSocket.java 2003-02-12 22:44:38.000000000 +0000 *************** exception statement from your version. * *** 38,43 **** --- 38,45 ---- package java.net; import java.io.IOException; + import java.nio.channels.IllegalBlockingModeException; + import java.nio.channels.ServerSocketChannel; /* Written using on-line Java Platform 1.2 API Specification. * Status: I believe all methods are implemented. *************** import java.io.IOException; *** 49,55 **** * listens for and accepts connections. At that point the client and * server sockets are ready to communicate with one another utilizing * whatever application layer protocol they desire. ! *

        * As with the Socket class, most instance methods of this class * simply redirect their calls to an implementation class. * --- 51,57 ---- * listens for and accepts connections. At that point the client and * server sockets are ready to communicate with one another utilizing * whatever application layer protocol they desire. ! * * As with the Socket class, most instance methods of this class * simply redirect their calls to an implementation class. * *************** import java.io.IOException; *** 58,73 **** */ public class ServerSocket { - - // Class Variables - /** * This is the user defined SocketImplFactory, if one is supplied */ private static SocketImplFactory factory; - // Instance Variables - /** * This is the SocketImp object to which most instance methods in this * class are redirected --- 60,70 ---- *************** public class ServerSocket *** 75,88 **** private SocketImpl impl; /** ! * Private constructor that simply sets the implementation. */ ! private ServerSocket() { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); } /** --- 72,99 ---- private SocketImpl impl; /** ! * ServerSocketChannel of this ServerSocket. This channel only exists ! * when the socket is created by ServerSocketChannel.open(). */ ! private ServerSocketChannel ch; ! ! private boolean closed = false; ! ! /** ! * Constructor that simply sets the implementation. ! * ! * @exception IOException If an error occurs ! * ! * @specnote This constructor is public since JDK 1.4 ! */ ! public ServerSocket() throws IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); + + impl.create(true); } /** *************** public class ServerSocket *** 93,101 **** * @param port The port number to bind to * * @exception IOException If an error occurs */ public ServerSocket (int port) ! throws java.io.IOException { this(port, 50); } --- 104,114 ---- * @param port The port number to bind to * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation */ public ServerSocket (int port) ! throws IOException { this(port, 50); } *************** public class ServerSocket *** 110,118 **** * @param backlog The length of the pending connection queue * * @exception IOException If an error occurs */ public ServerSocket (int port, int backlog) ! throws java.io.IOException { this(port, backlog, null); } --- 123,133 ---- * @param backlog The length of the pending connection queue * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation */ public ServerSocket (int port, int backlog) ! throws IOException { this(port, backlog, null); } *************** public class ServerSocket *** 129,139 **** * @param bindAddr The address to bind to, or null to bind to all addresses * * @exception IOException If an error occurs */ public ServerSocket (int port, int backlog, InetAddress bindAddr) ! throws java.io.IOException { this(); if (impl == null) throw new IOException("Cannot initialize Socket implementation"); --- 144,159 ---- * @param bindAddr The address to bind to, or null to bind to all addresses * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation + * + * @since 1.1 */ public ServerSocket (int port, int backlog, InetAddress bindAddr) ! throws IOException { this(); + if (impl == null) throw new IOException("Cannot initialize Socket implementation"); *************** public class ServerSocket *** 150,162 **** } /** * This method returns the local address to which this socket is bound * * @return The socket's local address */ public InetAddress getInetAddress() { ! return impl.getInetAddress(); } /** --- 170,241 ---- } /** + * Binds the server socket to a specified socket address + * + * @param endpoint The socket address to bind to + * + * @exception IOException If an error occurs + * @exception IllegalArgumentException If address type is not supported + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation + * + * @since 1.4 + */ + public void bind (SocketAddress endpoint) + throws IOException + { + bind (endpoint, 50); + } + + /** + * Binds the server socket to a specified socket address + * + * @param endpoint The socket address to bind to + * @param backlog The length of the pending connection queue + * + * @exception IOException If an error occurs + * @exception IllegalArgumentException If address type is not supported + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation + * + * @since 1.4 + */ + public void bind (SocketAddress endpoint, int backlog) throws IOException + { + if (closed) + throw new SocketException ("ServerSocket is closed"); + + if (impl == null) + throw new IOException ("Cannot initialize Socket implementation"); + + if (! (endpoint instanceof InetSocketAddress)) + throw new IllegalArgumentException ("Address type not supported"); + + InetSocketAddress tmp = (InetSocketAddress) endpoint; + + SecurityManager s = System.getSecurityManager (); + if (s != null) + s.checkListen (tmp.getPort ()); + + impl.bind (tmp.getAddress (), tmp.getPort ()); + impl.listen(backlog); + } + + /** * This method returns the local address to which this socket is bound * * @return The socket's local address */ public InetAddress getInetAddress() { ! try ! { ! return (InetAddress) impl.getOption (SocketOptions.SO_BINDADDR); ! } ! catch (SocketException e) ! { ! return null; ! } } /** *************** public class ServerSocket *** 170,183 **** } /** * Accepts a new connection and returns a connected Socket * instance representing that connection. This method will block until a * connection is available. * * @exception IOException If an error occurs */ ! public Socket accept () throws IOException { Socket s = new Socket(); implAccept (s); --- 249,290 ---- } /** + * Returns the local socket address + * + * @since 1.4 + */ + public SocketAddress getLocalSocketAddress() + { + InetAddress addr = getInetAddress(); + + if (addr != null) + return new InetSocketAddress (getInetAddress(), getLocalPort()); + + return null; + } + + /** * Accepts a new connection and returns a connected Socket * instance representing that connection. This method will block until a * connection is available. * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkListen method doesn't allow the operation + * @exception IllegalBlockingModeException If this socket has an associated + * channel, and the channel is in non-blocking mode + * @exception SocketTimeoutException If a timeout was previously set with + * setSoTimeout and the timeout has been reached */ ! public Socket accept () throws IOException { + if (impl == null) + throw new IOException ("Cannot initialize Socket implementation"); + + SecurityManager sm = System.getSecurityManager (); + if (sm != null) + sm.checkListen (impl.getLocalPort ()); + Socket s = new Socket(); implAccept (s); *************** public class ServerSocket *** 192,200 **** * @param socket The socket that is used for the accepted connection * * @exception IOException If an error occurs */ ! protected final void implAccept (Socket s) throws IOException { impl.accept(s.impl); } --- 299,315 ---- * @param socket The socket that is used for the accepted connection * * @exception IOException If an error occurs + * @exception IllegalBlockingModeException If this socket has an associated + * channel, and the channel is in non-blocking mode + * + * @since 1.1 */ ! protected final void implAccept (Socket s) ! throws IOException { + if (ch != null && !ch.isBlocking()) + throw new IllegalBlockingModeException(); + impl.accept(s.impl); } *************** public class ServerSocket *** 205,211 **** */ public void close () throws IOException { ! impl.close(); } /** --- 320,375 ---- */ public void close () throws IOException { ! if (impl != null) ! impl.close (); ! ! if (ch != null) ! ch.close (); ! ! closed = true; ! } ! ! /** ! * Returns the unique ServerSocketChannel object ! * associated with this socket, if any. ! * ! * The socket only has a ServerSocketChannel if its created ! * by ServerSocketChannel.open. ! * ! * @since 1.4 ! */ ! public ServerSocketChannel getChannel() ! { ! return ch; ! } ! ! /** ! * Returns true then the socket is bound, otherwise false ! * ! * @since 1.4 ! */ ! public boolean isBound() ! { ! try ! { ! Object bindaddr = impl.getOption (SocketOptions.SO_BINDADDR); ! } ! catch (SocketException e) ! { ! return false; ! } ! ! return true; ! } ! ! /** ! * Returns true if the socket is closed, otherwise false ! * ! * @since 1.4 ! */ ! public boolean isClosed() ! { ! return closed; } /** *************** public class ServerSocket *** 216,222 **** * * @param timeout The new SO_TIMEOUT value * ! * @exception IOException If an error occurs */ public void setSoTimeout (int timeout) throws SocketException { --- 380,388 ---- * * @param timeout The new SO_TIMEOUT value * ! * @exception SocketException If an error occurs ! * ! * @since 1.1 */ public void setSoTimeout (int timeout) throws SocketException { *************** public class ServerSocket *** 235,240 **** --- 401,408 ---- * @return The value of SO_TIMEOUT * * @exception IOException If an error occurs + * + * @since 1.1 */ public int getSoTimeout () throws IOException { *************** public class ServerSocket *** 247,259 **** } /** * Returns the value of this socket as a String. * * @return This socket represented as a String. */ public String toString () { ! return "ServerSocket " + impl.toString(); } // Class methods --- 415,513 ---- } /** + * Enables/Disables the SO_REUSEADDR option + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + public void setReuseAddress (boolean on) + throws SocketException + { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + + impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); + } + + /** + * Checks if the SO_REUSEADDR option is enabled + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + public boolean getReuseAddress() + throws SocketException + { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + + Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR); + + if (!(reuseaddr instanceof Boolean)) + throw new SocketException ("Internal Error"); + + return ((Boolean) reuseaddr).booleanValue (); + } + + /** + * This method sets the value for the system level socket option + * SO_RCVBUF to the specified value. Note that valid values for this + * option are specific to a given operating system. + * + * @param size The new receive buffer size. + * + * @exception SocketException If an error occurs or Socket is not connected + * @exception IllegalArgumentException If size is 0 or negative + * + * @since 1.4 + */ + public void setReceiveBufferSize (int size) + throws SocketException + { + if (impl == null) + throw new SocketException ("Not connected"); + + if (size <= 0) + throw new IllegalArgumentException ("SO_RCVBUF value must be > 0"); + + impl.setOption (SocketOptions.SO_RCVBUF, new Integer (size)); + } + + /** + * This method returns the value of the system level socket option + * SO_RCVBUF, which is used by the operating system to tune buffer + * sizes for data transfers. + * + * @return The receive buffer size. + * + * @exception SocketException If an error occurs or Socket is not connected + * + * @since 1.4 + */ + public int getReceiveBufferSize () + throws SocketException + { + if (impl == null) + throw new SocketException ("Not connected"); + + Object buf = impl.getOption (SocketOptions.SO_RCVBUF); + + if (!(buf instanceof Integer)) + throw new SocketException ("Internal Error: Unexpected type"); + + return ((Integer) buf).intValue (); + } + + /** * Returns the value of this socket as a String. * * @return This socket represented as a String. */ public String toString () { ! return "ServerSocket" + impl.toString(); } // Class methods diff -Nrc3pad gcc-3.2.3/libjava/java/net/SocketAddress.java gcc-3.3/libjava/java/net/SocketAddress.java *** gcc-3.2.3/libjava/java/net/SocketAddress.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/SocketAddress.java 2003-01-14 22:27:29.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* SocketAddress.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + import java.io.Serializable; + + /** + * Abstract base class for InetSocketAddress. + * InetSocketAddress is to my knowledge the only derived + * class. [Ronald] + * + * @since 1.4 + */ + public abstract class SocketAddress implements Serializable + { + /** + * Compatible with JDK 1.4+ + */ + static final long serialVersionUID = 5215720748342549866L; + + /** + * Initializes the socket address. + */ + public SocketAddress() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/net/SocketException.java gcc-3.3/libjava/java/net/SocketException.java *** gcc-3.2.3/libjava/java/net/SocketException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/SocketException.java 2002-06-15 19:45:34.000000000 +0000 *************** *** 1,5 **** /* SocketException.java -- An exception occurred while performing a socket op ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SocketException.java -- An exception occurred while performing a socket op ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,85 **** package java.net; ! /* Written using on-line Java Platform 1.2 API Specification. ! * Believed complete and correct. ! */ /** ! * This exception indicates that a generic error occurred related to an ! * operation on a socket. Check the descriptive message (if any) for ! * details on the nature of this error ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Per Bothner ! * @date January 6, 1999. ! */ ! public class SocketException extends java.io.IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Initializes a new instance of SocketException without ! * a descriptive error message. ! */ ! public ! SocketException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Initializes a new instance of SocketException without ! * a descriptive error message. ! * ! * @param message A message describing the error that occurred. ! */ ! public ! SocketException(String message) ! { ! super(message); ! } } // class SocketException - --- 37,74 ---- package java.net; ! import java.io.IOException; /** ! * This exception indicates that a generic error occurred related to an ! * operation on a socket. Check the descriptive message (if any) for ! * details on the nature of this error ! * ! * @author Aaron M. Renn ! * @author Per Bothner ! * @status updated to 1.4 */ ! public class SocketException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -5935874303556886934L; ! /** ! * Create a new instance without a descriptive error message. ! */ ! public SocketException() ! { ! } + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public SocketException(String message) + { + super(message); + } } // class SocketException diff -Nrc3pad gcc-3.2.3/libjava/java/net/SocketImpl.java gcc-3.3/libjava/java/net/SocketImpl.java *** gcc-3.2.3/libjava/java/net/SocketImpl.java 2002-02-14 23:16:06.000000000 +0000 --- gcc-3.3/libjava/java/net/SocketImpl.java 2003-02-12 22:44:38.000000000 +0000 *************** public abstract class SocketImpl impleme *** 74,80 **** /** * The port number the socket is bound to locally */ ! protected int localport; /** * The port number of the remote end of the socket connection --- 74,80 ---- /** * The port number the socket is bound to locally */ ! protected int localport = -1; /** * The port number of the remote end of the socket connection *************** public abstract class SocketImpl impleme *** 95,100 **** --- 95,102 ---- * if the stream parameter is false. * * @param stream true for a stream socket, false for a datagram socket + * + * @exception IOException If an error occurs */ protected abstract void create(boolean stream) throws IOException; *************** public abstract class SocketImpl impleme *** 120,125 **** --- 122,142 ---- throws IOException; /** + * Connects to the socket to the host specified in address. This + * method blocks until successful connected or the timeout occurs. + * A timeout of zero means no timout. + * + * @param address Data of remote host + * @param timeout time to wait to stop connecting + * + * @exception IOException If an error occurs + * + * @since 1.4 + */ + protected abstract void connect(SocketAddress address, int timeout) + throws IOException; + + /** * Binds to the specified port on the specified addr. Note that this addr * must represent a local IP address. *

        *************** public abstract class SocketImpl impleme *** 215,220 **** --- 232,262 ---- protected int getPort() { return port; } /** + * Returns true or false when this socket supports sending urgent data + * or not. + * + * @since 1.4 + */ + protected boolean supportsUrgentData() + { + // This method has to be overwritten by socket classes that support + // sending urgend data. + return false; + } + + /** + * Sends one byte of urgent data to the socket. + * + * @param data The byte to send, the low eight bits of it + * + * @exception IOException If an error occurs + * + * @since 1.4 + */ + protected abstract void sendUrgentData(int data) + throws IOException; + + /** * Returns the local port this socket is bound to * * @return The local port *************** public abstract class SocketImpl impleme *** 229,236 **** */ public String toString() { ! return "[addr=" + address.toString() + ",port=" + Integer.toString(port) ! + ",localport=" + Integer.toString(localport) + "]"; } /** --- 271,279 ---- */ public String toString() { ! return "[addr=" + address ! + ",port=" + port ! + ",localport=" + localport + "]"; } /** *************** public abstract class SocketImpl impleme *** 264,267 **** --- 307,326 ---- * @XXX This redeclaration from SocketOptions is a workaround to a gcj bug. */ public abstract Object getOption(int option_id) throws SocketException; + + /** + * Shut down the input side of this socket. Subsequent reads will + * return end-of-file. + * + * @exception IOException if an error occurs + */ + protected abstract void shutdownInput () throws IOException; + + /** + * Shut down the output side of this socket. Subsequent writes will + * fail with an IOException. + * + * @exception IOException if an error occurs + */ + protected abstract void shutdownOutput () throws IOException; } diff -Nrc3pad gcc-3.2.3/libjava/java/net/Socket.java gcc-3.3/libjava/java/net/Socket.java *** gcc-3.2.3/libjava/java/net/Socket.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/Socket.java 2003-02-12 22:44:38.000000000 +0000 *************** exception statement from your version. * *** 38,43 **** --- 38,45 ---- package java.net; import java.io.*; + import java.nio.channels.SocketChannel; + import java.nio.channels.IllegalBlockingModeException; /* Written using on-line Java Platform 1.2 API Specification. * Status: I believe all methods are implemented. *************** public class Socket *** 78,96 **** */ SocketImpl impl; // Constructors /** * Initializes a new instance of Socket object without * connecting to a remote host. This useful for subclasses of socket that * might want this behavior. */ ! protected Socket () { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); } /** --- 80,111 ---- */ SocketImpl impl; + private boolean inputShutdown; + private boolean outputShutdown; + + SocketChannel ch; // this field must have been set if created by SocketChannel + + private boolean closed = false; + // Constructors /** * Initializes a new instance of Socket object without * connecting to a remote host. This useful for subclasses of socket that * might want this behavior. + * + * @specnote This constructor is public since JDK 1.4 + * @since 1.1 */ ! public Socket () { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); + + inputShutdown = false; + outputShutdown = false; } /** *************** public class Socket *** 108,117 **** --- 123,136 ---- * Socket * * @exception SocketException If an error occurs + * + * @since 1.1 */ protected Socket (SocketImpl impl) throws SocketException { this.impl = impl; + this.inputShutdown = false; + this.outputShutdown = false; } /** *************** public class Socket *** 124,129 **** --- 143,150 ---- * @exception UnknownHostException If the hostname cannot be resolved to a * network address. * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkConnect method doesn't allow the operation */ public Socket (String host, int port) throws UnknownHostException, IOException *************** public class Socket *** 139,144 **** --- 160,167 ---- * @param port The port number to connect to * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkConnect method doesn't allow the operation */ public Socket (InetAddress address, int port) throws IOException *************** public class Socket *** 160,165 **** --- 183,190 ---- * exists and does not allow a connection to the specified host/port or * binding to the specified local host/port. * @exception IOException If a connection error occurs. + * + * @since 1.1 */ public Socket (String host, int port, InetAddress localAddr, int localPort) throws IOException *************** public class Socket *** 178,183 **** --- 203,212 ---- * @param localPort The local port to connect to * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkConnect method doesn't allow the operation + * + * @since 1.1 */ public Socket (InetAddress address, int port, InetAddress localAddr, int localPort) throws IOException *************** public class Socket *** 197,202 **** --- 226,233 ---- * for a datagram socket * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkConnect method doesn't allow the operation * * @deprecated Use the DatagramSocket class to create * datagram oriented sockets. *************** public class Socket *** 218,223 **** --- 249,256 ---- * false to create a datagram socket. * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkConnect method doesn't allow the operation * * @deprecated Use the DatagramSocket class to create * datagram oriented sockets. *************** public class Socket *** 241,251 **** --- 274,289 ---- * @param stream true for a stream socket, false for a datagram socket * * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkConnect method doesn't allow the operation */ private Socket(InetAddress raddr, int rport, InetAddress laddr, int lport, boolean stream) throws IOException { this(); + this.inputShutdown = false; + this.outputShutdown = false; + if (impl == null) throw new IOException("Cannot initialize Socket implementation"); *************** public class Socket *** 266,271 **** --- 304,390 ---- } /** + * Binds the socket to the givent local address/port + * + * @param bindpoint The address/port to bind to + * + * @exception IOException If an error occurs + * @exception SecurityException If a security manager exists and its + * checkConnect method doesn't allow the operation + * @exception IllegalArgumentException If the address type is not supported + * + * @since 1.4 + */ + public void bind (SocketAddress bindpoint) throws IOException + { + if (closed) + throw new SocketException ("Socket is closed"); + + if ( !(bindpoint instanceof InetSocketAddress)) + throw new IllegalArgumentException (); + + InetSocketAddress tmp = (InetSocketAddress) bindpoint; + impl.bind (tmp.getAddress(), tmp.getPort()); + } + + /** + * Connects the socket with a remote address. + * + * @param endpoint The address to connect to + * + * @exception IOException If an error occurs + * @exception IllegalArgumentException If the addess type is not supported + * @exception IllegalBlockingModeException If this socket has an associated + * channel, and the channel is in non-blocking mode + * + * @since 1.4 + */ + public void connect (SocketAddress endpoint) + throws IOException + { + if (closed) + throw new SocketException ("Socket is closed"); + + if (! (endpoint instanceof InetSocketAddress)) + throw new IllegalArgumentException ("Address type not supported"); + + if (ch != null && !ch.isBlocking ()) + throw new IllegalBlockingModeException (); + + impl.connect (endpoint, 0); + } + + /** + * Connects the socket with a remote address. A timeout of zero is + * interpreted as an infinite timeout. The connection will then block + * until established or an error occurs. + * + * @param endpoint The address to connect to + * + * @exception IOException If an error occurs + * @exception IllegalArgumentException If the address type is not supported + * @exception IllegalBlockingModeException If this socket has an associated + * channel, and the channel is in non-blocking mode + * @exception SocketTimeoutException If the timeout is reached + * + * @since 1.4 + */ + public void connect (SocketAddress endpoint, int timeout) + throws IOException + { + if (closed) + throw new SocketException ("Socket is closed"); + + if (! (endpoint instanceof InetSocketAddress)) + throw new IllegalArgumentException ("Address type not supported"); + + if (ch != null && !ch.isBlocking ()) + throw new IllegalBlockingModeException (); + + impl.connect (endpoint, timeout); + } + + /** * Returns the address of the remote end of the socket. If this socket * is not connected, then null is returned. * *************** public class Socket *** 284,289 **** --- 403,410 ---- * is not connected, then null is returned. * * @return The local address + * + * @since 1.1 */ public InetAddress getLocalAddress () { *************** public class Socket *** 344,349 **** --- 465,500 ---- } /** + * If the socket is already bound this returns the local SocketAddress, + * otherwise null + * + * @since 1.4 + */ + public SocketAddress getLocalSocketAddress() + { + InetAddress addr = getLocalAddress (); + + if (addr == null) + return null; + + return new InetSocketAddress (addr, impl.getLocalPort()); + } + + /** + * If the socket is already connected this returns the remote SocketAddress, + * otherwise null + * + * @since 1.4 + */ + public SocketAddress getRemoteSocketAddress() + { + if (!isConnected ()) + return null; + + return new InetSocketAddress (impl.getInetAddress (), impl.getPort ()); + } + + /** * Returns an InputStream for reading from this socket. * * @return The InputStream object *************** public class Socket *** 379,384 **** --- 530,537 ---- * @param on true to enable, false to disable * * @exception SocketException If an error occurs or Socket is not connected + * + * @since 1.1 */ public void setTcpNoDelay (boolean on) throws SocketException { *************** public class Socket *** 397,402 **** --- 550,557 ---- * @return Whether or not TCP_NODELAY is set * * @exception SocketException If an error occurs or Socket not connected + * + * @since 1.1 */ public boolean getTcpNoDelay() throws SocketException { *************** public class Socket *** 424,429 **** --- 579,587 ---- * SO_LINGER not set. * * @exception SocketException If an error occurs or Socket not connected + * @exception IllegalArgumentException If linger is negative + * + * @since 1.1 */ public void setSoLinger(boolean on, int linger) throws SocketException { *************** public class Socket *** 459,464 **** --- 617,624 ---- * if SO_LINGER not set * * @exception SocketException If an error occurs or Socket is not connected + * + * @since 1.1 */ public int getSoLinger() throws SocketException { *************** public class Socket *** 473,478 **** --- 633,690 ---- } /** + * Sends urgent data through the socket + * + * @param data The data to send. + * Only the lowest eight bits of data are sent + * + * @exception IOException If an error occurs + * + * @since 1.4 + */ + public void sendUrgentData (int data) throws IOException + { + impl.sendUrgentData (data); + } + + /** + * Enables/disables the SO_OOBINLINE option + * + * @param on True if SO_OOBLINE should be enabled + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + public void setOOBInline (boolean on) throws SocketException + { + if (impl == null) + throw new SocketException("Not connected"); + + impl.setOption(SocketOptions.SO_OOBINLINE, new Boolean(on)); + } + + /** + * Returns the current setting of the SO_OOBINLINE option for this socket + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + public boolean getOOBInline () throws SocketException + { + if (impl == null) + throw new SocketException("Not connected"); + + Object buf = impl.getOption(SocketOptions.SO_OOBINLINE); + + if (buf instanceof Boolean) + return(((Boolean)buf).booleanValue()); + else + throw new SocketException("Internal Error: Unexpected type"); + } + + /** * Sets the value of the SO_TIMEOUT option on the socket. If this value * is set, and an read/write is performed that does not complete within * the timeout period, a short count is returned (or an EWOULDBLOCK signal *************** public class Socket *** 486,491 **** --- 698,705 ---- * 0 if not set * * @exception SocketException If an error occurs or Socket not connected + * + * @since 1.1 */ public synchronized void setSoTimeout (int timeout) throws SocketException { *************** public class Socket *** 512,517 **** --- 726,733 ---- * if not set * * @exception SocketException If an error occurs or Socket not connected + * + * @since 1.1 */ public synchronized int getSoTimeout () throws SocketException { *************** public class Socket *** 533,540 **** * @param size The new send buffer size. * * @exception SocketException If an error occurs or Socket not connected * ! * @since Java 1.2 */ public void setSendBufferSize (int size) throws SocketException { --- 749,757 ---- * @param size The new send buffer size. * * @exception SocketException If an error occurs or Socket not connected + * @exception IllegalArgumentException If size is 0 or negative * ! * @since 1.2 */ public void setSendBufferSize (int size) throws SocketException { *************** public class Socket *** 556,562 **** * * @exception SocketException If an error occurs or socket not connected * ! * @since Java 1.2 */ public int getSendBufferSize () throws SocketException { --- 773,779 ---- * * @exception SocketException If an error occurs or socket not connected * ! * @since 1.2 */ public int getSendBufferSize () throws SocketException { *************** public class Socket *** 579,586 **** * @param size The new receive buffer size. * * @exception SocketException If an error occurs or Socket is not connected * ! * @since Java 1.2 */ public void setReceiveBufferSize (int size) throws SocketException { --- 796,804 ---- * @param size The new receive buffer size. * * @exception SocketException If an error occurs or Socket is not connected + * @exception IllegalArgumentException If size is 0 or negative * ! * @since 1.2 */ public void setReceiveBufferSize (int size) throws SocketException { *************** public class Socket *** 602,608 **** * * @exception SocketException If an error occurs or Socket is not connected * ! * @since Java 1.2 */ public int getReceiveBufferSize () throws SocketException { --- 820,826 ---- * * @exception SocketException If an error occurs or Socket is not connected * ! * @since 1.2 */ public int getReceiveBufferSize () throws SocketException { *************** public class Socket *** 618,623 **** --- 836,882 ---- } /** + * This method sets the value for the socket level socket option + * SO_KEEPALIVE. + * + * @param on True if SO_KEEPALIVE should be enabled + * + * @exception SocketException If an error occurs or Socket is not connected + * + * @since 1.3 + */ + public void setKeepAlive (boolean on) throws SocketException + { + if (impl == null) + throw new SocketException("Not connected"); + + impl.setOption(SocketOptions.SO_KEEPALIVE, new Boolean(on)); + } + + /** + * This method returns the value of the socket level socket option + * SO_KEEPALIVE. + * + * @return The setting + * + * @exception SocketException If an error occurs or Socket is not connected + * + * @since 1.3 + */ + public boolean getKeepAlive () throws SocketException + { + if (impl == null) + throw new SocketException("Not connected"); + + Object buf = impl.getOption(SocketOptions.SO_KEEPALIVE); + + if (buf instanceof Boolean) + return(((Boolean)buf).booleanValue()); + else + throw new SocketException("Internal Error: Unexpected type"); + } + + /** * Closes the socket. * * @exception IOException If an error occurs *************** public class Socket *** 626,631 **** --- 885,895 ---- { if (impl != null) impl.close(); + + if (ch != null) + ch.close(); + + closed = true; } /** *************** public class Socket *** 665,670 **** --- 929,1109 ---- if (sm != null) sm.checkSetFactory(); + if (fac == null) + throw new SocketException("SocketImplFactory cannot be null"); + factory = fac; } + + /** + * Closes the input side of the socket stream. + * + * @exception IOException If an error occurs. + * + * @since 1.3 + */ + public void shutdownInput() throws IOException + { + if (impl != null) + impl.shutdownInput(); + + inputShutdown = true; + } + + /** + * Closes the output side of the socket stream. + * + * @exception IOException If an error occurs. + * + * @since 1.3 + */ + public void shutdownOutput() throws IOException + { + if (impl != null) + impl.shutdownOutput(); + + outputShutdown = true; + } + + /** + * Returns the socket channel associated with this socket. + * + * It returns null if no associated socket exists. + * + * @since 1.4 + */ + public SocketChannel getChannel() + { + return ch; + } + + /** + * Checks if the SO_REUSEADDR option is enabled + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + public boolean getReuseAddress () throws SocketException + { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + + Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR); + + if (!(reuseaddr instanceof Boolean)) + throw new SocketException ("Internal Error"); + + return ((Boolean) reuseaddr).booleanValue (); + } + + /** + * Enables/Disables the SO_REUSEADDR option + * + * @exception SocketException If an error occurs + * + * @since 1.4 + */ + public void setReuseAddress (boolean on) throws SocketException + { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + + impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on)); + } + + /** + * Returns the current traffic class + * + * @exception SocketException If an error occurs + * + * @see Socket:setTrafficClass + * + * @since 1.4 + */ + public int getTrafficClass () throws SocketException + { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + + Object obj = impl.getOption(SocketOptions.IP_TOS); + + if (obj instanceof Integer) + return ((Integer) obj).intValue (); + else + throw new SocketException ("Unexpected type"); + } + + /** + * Sets the traffic class value + * + * @param tc The traffic class + * + * @exception SocketException If an error occurs + * @exception IllegalArgumentException If tc value is illegal + * + * @see Socket:getTrafficClass + * + * @since 1.4 + */ + public void setTrafficClass (int tc) throws SocketException + { + if (impl == null) + throw new SocketException ("Cannot initialize Socket implementation"); + + if (tc < 0 || tc > 255) + throw new IllegalArgumentException(); + + impl.setOption (SocketOptions.IP_TOS, new Integer (tc)); + } + + /** + * Checks if the socket is connected + * + * @since 1.4 + */ + public boolean isConnected () + { + return impl.getInetAddress () != null; + } + + /** + * Checks if the socket is already bound. + * + * @since 1.4 + */ + public boolean isBound () + { + return getLocalAddress () != null; + } + + /** + * Checks if the socket is closed. + * + * @since 1.4 + */ + public boolean isClosed () + { + return closed; + } + + /** + * Checks if the socket's input stream is shutdown + * + * @since 1.4 + */ + public boolean isInputShutdown () + { + return inputShutdown; + } + + /** + * Checks if the socket's output stream is shutdown + * + * @since 1.4 + */ + public boolean isOutputShutdown () + { + return outputShutdown; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/net/SocketOptions.java gcc-3.3/libjava/java/net/SocketOptions.java *** gcc-3.2.3/libjava/java/net/SocketOptions.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/SocketOptions.java 2002-10-03 14:30:48.000000000 +0000 *************** *** 1,5 **** /* SocketOptions.java -- Implements options for sockets (duh!) ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SocketOptions.java -- Implements options for sockets (duh!) ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.net; *** 43,146 **** */ /** ! * This interface is used by SocketImpl and ! * DatagramSocketImpl to implement options ! * on sockets. ! * ! * @since 1.2 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! */ public interface SocketOptions { ! /*************************************************************************/ ! /* ! * Static Variables ! */ ! /** ! * Option id for the SO_LINGER value ! */ ! static final int SO_LINGER = 0x80; // 128 ! /** ! * Option id for the SO_TIMEOUT value ! */ ! static final int SO_TIMEOUT = 0x1006; // 4102 ! /** ! * Retrieve the local address to which the socket is bound. ! */ ! static final int SO_BINDADDR = 0x0F; // 15 ! /** ! * Option id for the send buffer size ! * @since 1.2 ! */ ! static final int SO_SNDBUF = 0x1001; // 4097 ! /** ! * Option id for the receive buffer size ! * @since 1.2 ! */ ! static final int SO_RCVBUF = 0x1002; // 4098 ! /** ! * Sets the SO_REUSEADDR parameter on a socket ! */ ! static final int SO_REUSEADDR = 0x04; // 4 ! /** ! * Option id for the TCP_NODELAY value ! */ ! static final int TCP_NODELAY = 0x01; // 1 ! /** ! * Options id for the IP_MULTICAST_IF value ! */ ! static final int IP_MULTICAST_IF = 0x10; // 16 ! /*************************************************************************/ ! /* ! * Interface Methods ! */ ! /** ! * Sets the specified option on a socket to the passed in object. For ! * options that take an integer argument, the passed in object is an ! * Integer. For options that are set to on or off, the ! * value passed will be a Boolean. The option_id ! * parameter is one of the defined constants in this interface. ! * ! * @param option_id The identifier of the option ! * @param val The value to set the option to ! * ! * @exception SocketException If an error occurs ! */ ! void ! setOption(int option_id, Object val) throws SocketException; ! /*************************************************************************/ ! /** ! * Returns the current setting of the specified option. The ! * Object returned will be an Integer for options ! * that have integer values. For options that are set to on or off, a ! * Boolean will be returned. The option_id ! * is one of the defined constants in this interface. ! * ! * @param option_id The option identifier ! * ! * @return The current value of the option ! * ! * @exception SocketException If an error occurs ! */ ! Object ! getOption(int option_id) throws SocketException; } // interface SocketOptions --- 43,167 ---- */ /** ! * This interface is used by SocketImpl and ! * DatagramSocketImpl to implement options ! * on sockets. ! * ! * @since 1.2 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @status should be completely JDK 1.4 compatible ! */ public interface SocketOptions { + /** + * Option id for the SO_KEEPALIVE value + * @since 1.3 + */ + static final int SO_KEEPALIVE = 0x8; ! /** ! * Option id for the SO_LINGER value ! */ ! static final int SO_LINGER = 0x80; // 128 ! /** ! * Option id for the SO_TIMEOUT value ! */ ! static final int SO_TIMEOUT = 0x1006; // 4102 ! /** ! * Retrieve the local address to which the socket is bound. ! */ ! static final int SO_BINDADDR = 0x0F; // 15 ! /** ! * Option id for the send buffer size ! * @since 1.2 ! */ ! static final int SO_SNDBUF = 0x1001; // 4097 ! /** ! * Option id for the receive buffer size ! * @since 1.2 ! */ ! static final int SO_RCVBUF = 0x1002; // 4098 ! /** ! * Sets the SO_REUSEADDR parameter on a socket ! */ ! static final int SO_REUSEADDR = 0x04; // 4 ! /** ! * Sets SO_BROADCAST for a socket ! * @since 1.4 ! */ ! static final int SO_BROADCAST = 0x20; // 32 ! /** ! * Sets SO_OOBINLINE for a socket ! * @since 1.4 ! */ ! static final int SO_OOBINLINE = 0x1003; // 4099 ! /** ! * Option id for the TCP_NODELAY value ! */ ! static final int TCP_NODELAY = 0x01; // 1 ! /** ! * Options id for the IP_MULTICAST_IF value ! */ ! static final int IP_MULTICAST_IF = 0x10; // 16 ! /** ! * same as above ! * @since 1.4 ! */ ! static final int IP_MULTICAST_IF2 = 0x1F; // 31 ! /** ! * This option enables or disables local loopback of multicast datagrams. ! * @since 1.4 ! */ ! static final int IP_MULTICAST_LOOP = 0x12; // 18 ! /** ! * This option sets the type-of-service or traffic class field in the ! * IP header for a TCP or UDP socket. ! * @since 1.4 ! */ ! static final int IP_TOS = 0x03; // 3 ! /** ! * Sets the specified option on a socket to the passed in object. For ! * options that take an integer argument, the passed in object is an ! * Integer. For options that are set to on or off, the ! * value passed will be a Boolean. The option_id ! * parameter is one of the defined constants in this interface. ! * ! * @param option_id The identifier of the option ! * @param val The value to set the option to ! * ! * @exception SocketException If an error occurs ! */ ! void setOption(int option_id, Object val) throws SocketException; ! /** ! * Returns the current setting of the specified option. The ! * Object returned will be an Integer for options ! * that have integer values. For options that are set to on or off, a ! * Boolean will be returned. The option_id ! * is one of the defined constants in this interface. ! * ! * @param option_id The option identifier ! * ! * @return The current value of the option ! * ! * @exception SocketException If an error occurs ! */ ! Object getOption(int option_id) throws SocketException; } // interface SocketOptions diff -Nrc3pad gcc-3.2.3/libjava/java/net/SocketPermission.java gcc-3.3/libjava/java/net/SocketPermission.java *** gcc-3.2.3/libjava/java/net/SocketPermission.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/SocketPermission.java 2003-02-12 22:44:38.000000000 +0000 *************** *** 1,5 **** /* SocketPermission.java -- Class modeling permissions for socket operations ! Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SocketPermission.java -- Class modeling permissions for socket operations ! Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,42 **** --- 37,43 ---- package java.net; + import java.io.Serializable; import java.security.Permission; import java.security.PermissionCollection; *************** import java.security.PermissionCollectio *** 87,93 **** * SocketPermission("www.urbanophile.com:80", "connect,accept"); * Can connect to or accept connections from www.urbanophile.com on port 80 * SocketPermission("localhost:1024-", "listen,accept,connect"); ! * Can connect to, accept from, an listen on any local port number 1024 and up. * SocketPermission("*.edu", "connect"); * Can connect to any host in the edu domain * SocketPermission("197.197.20.1", "accept"); --- 88,95 ---- * SocketPermission("www.urbanophile.com:80", "connect,accept"); * Can connect to or accept connections from www.urbanophile.com on port 80 * SocketPermission("localhost:1024-", "listen,accept,connect"); ! * Can connect to, accept from, an listen on any local port number 1024 ! * and up. * SocketPermission("*.edu", "connect"); * Can connect to any host in the edu domain * SocketPermission("197.197.20.1", "accept"); *************** import java.security.PermissionCollectio *** 99,106 **** * @author Aaron M. Renn (arenn@urbanophile.com) */ public final class SocketPermission extends Permission ! implements java.io.Serializable { // FIXME: Needs serialization work, including readObject/writeObject methods. /** --- 101,109 ---- * @author Aaron M. Renn (arenn@urbanophile.com) */ public final class SocketPermission extends Permission ! implements Serializable { + static final long serialVersionUID = -7204263841984476862L; // FIXME: Needs serialization work, including readObject/writeObject methods. /** *************** public final class SocketPermission exte *** 118,124 **** * specified host/port combination and actions string. * * @param hostport The hostname/port number combination ! * @param perms The actions string */ public SocketPermission(String hostport, String actions) { --- 121,127 ---- * specified host/port combination and actions string. * * @param hostport The hostname/port number combination ! * @param actions The actions string */ public SocketPermission(String hostport, String actions) { *************** public final class SocketPermission exte *** 163,174 **** public int hashCode() { int hash = 100; ! ! // FIXME: Get a real hash function ! for (int i = 0; i < hostport.length(); i++) ! hash = hash + (int) hostport.charAt(i) * 7; ! ! return (hash); } /** --- 166,176 ---- public int hashCode() { int hash = 100; ! if (hostport != null) ! hash += hostport.hashCode(); ! if (actions != null) ! hash += actions.hashCode(); ! return hash; } /** *************** public final class SocketPermission exte *** 241,247 **** *

          *
        • The argument's hostname or IP address is equal to this object's. *
        • The argument's canonical hostname is equal to this object's. ! *
        • The argument's canonical name matches this domains hostname with wildcards *
        * * @param perm The Permission to check against --- 243,250 ---- *

          *
        • The argument's hostname or IP address is equal to this object's. *
        • The argument's canonical hostname is equal to this object's. ! *
        • The argument's canonical name matches this domains hostname with ! * wildcards *
        * * @param perm The Permission to check against *************** public final class SocketPermission exte *** 273,334 **** // Get ours if (hostport.indexOf(":") == -1) { ! ourfirstport = 0; ! ourlastport = 65535; } else { ! // FIXME: Needs bulletproofing. ! // This will dump if hostport if all sorts of bad data was passed to ! // the constructor ! String range = hostport.substring(hostport.indexOf(":") + 1); ! if (range.startsWith("-")) ! ourfirstport = 0; ! else if (range.indexOf("-") == -1) ! ourfirstport = Integer.parseInt(range); ! else ! ourfirstport = ! Integer.parseInt(range.substring(0, range.indexOf("-"))); ! if (range.endsWith("-")) ! ourlastport = 65535; ! else if (range.indexOf("-") == -1) ! ourlastport = Integer.parseInt(range); ! else ! ourlastport = ! Integer.parseInt(range. ! substring(range.indexOf("-") + 1, ! range.length())); } // Get theirs if (p.hostport.indexOf(":") == -1) { ! theirfirstport = 0; ! ourlastport = 65535; } else { ! // This will dump if hostport if all sorts of bad data was passed to ! // the constructor ! String range = p.hostport.substring(hostport.indexOf(":") + 1); ! if (range.startsWith("-")) ! theirfirstport = 0; ! else if (range.indexOf("-") == -1) ! theirfirstport = Integer.parseInt(range); ! else ! theirfirstport = ! Integer.parseInt(range.substring(0, range.indexOf("-"))); ! if (range.endsWith("-")) ! theirlastport = 65535; ! else if (range.indexOf("-") == -1) ! theirlastport = Integer.parseInt(range); ! else ! theirlastport = ! Integer.parseInt(range. ! substring(range.indexOf("-") + 1, ! range.length())); } // Now check them --- 276,337 ---- // Get ours if (hostport.indexOf(":") == -1) { ! ourfirstport = 0; ! ourlastport = 65535; } else { ! // FIXME: Needs bulletproofing. ! // This will dump if hostport if all sorts of bad data was passed to ! // the constructor ! String range = hostport.substring(hostport.indexOf(":") + 1); ! if (range.startsWith("-")) ! ourfirstport = 0; ! else if (range.indexOf("-") == -1) ! ourfirstport = Integer.parseInt(range); ! else ! ourfirstport = ! Integer.parseInt(range.substring(0, range.indexOf("-"))); ! if (range.endsWith("-")) ! ourlastport = 65535; ! else if (range.indexOf("-") == -1) ! ourlastport = Integer.parseInt(range); ! else ! ourlastport = ! Integer.parseInt(range. ! substring(range.indexOf("-") + 1, ! range.length())); } // Get theirs if (p.hostport.indexOf(":") == -1) { ! theirfirstport = 0; ! ourlastport = 65535; } else { ! // This will dump if hostport if all sorts of bad data was passed to ! // the constructor ! String range = p.hostport.substring(hostport.indexOf(":") + 1); ! if (range.startsWith("-")) ! theirfirstport = 0; ! else if (range.indexOf("-") == -1) ! theirfirstport = Integer.parseInt(range); ! else ! theirfirstport = ! Integer.parseInt(range.substring(0, range.indexOf("-"))); ! if (range.endsWith("-")) ! theirlastport = 65535; ! else if (range.indexOf("-") == -1) ! theirlastport = Integer.parseInt(range); ! else ! theirlastport = ! Integer.parseInt(range. ! substring(range.indexOf("-") + 1, ! range.length())); } // Now check them *************** public final class SocketPermission exte *** 358,374 **** String ourcanonical = null, theircanonical = null; try { ! ourcanonical = InetAddress.getByName(ourhost).getHostName(); ! theircanonical = InetAddress.getByName(theirhost).getHostName(); } catch (UnknownHostException e) { ! // Who didn't resolve? Just assume current address is canonical enough ! // Is this ok to do? ! if (ourcanonical == null) ! ourcanonical = ourhost; ! if (theircanonical == null) ! theircanonical = theirhost; } if (ourcanonical.equals(theircanonical)) --- 361,377 ---- String ourcanonical = null, theircanonical = null; try { ! ourcanonical = InetAddress.getByName(ourhost).getHostName(); ! theircanonical = InetAddress.getByName(theirhost).getHostName(); } catch (UnknownHostException e) { ! // Who didn't resolve? Just assume current address is canonical enough ! // Is this ok to do? ! if (ourcanonical == null) ! ourcanonical = ourhost; ! if (theircanonical == null) ! theircanonical = theirhost; } if (ourcanonical.equals(theircanonical)) *************** public final class SocketPermission exte *** 377,385 **** // Well, last chance. Try for a wildcard if (ourhost.indexOf("*.") != -1) { ! String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1)); ! if (theircanonical.endsWith(wild_domain)) ! return (true); } // Didn't make it --- 380,388 ---- // Well, last chance. Try for a wildcard if (ourhost.indexOf("*.") != -1) { ! String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1)); ! if (theircanonical.endsWith(wild_domain)) ! return (true); } // Didn't make it diff -Nrc3pad gcc-3.2.3/libjava/java/net/SocketTimeoutException.java gcc-3.3/libjava/java/net/SocketTimeoutException.java *** gcc-3.2.3/libjava/java/net/SocketTimeoutException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/SocketTimeoutException.java 2002-08-21 18:54:07.000000000 +0000 *************** *** 0 **** --- 1,72 ---- + /* SocketTimeoutException.java -- the socket timed out + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + import java.io.InterruptedIOException; + + /** + * This exception signals that a socket read or accept timed out. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public class SocketTimeoutException extends InterruptedIOException + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -8846654841826352300L; + + /** + * Create a new instance without a descriptive error message. + */ + public SocketTimeoutException() + { + } + + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public SocketTimeoutException(String message) + { + super(message); + } + } // class SocketTimeoutException diff -Nrc3pad gcc-3.2.3/libjava/java/net/UnknownHostException.java gcc-3.3/libjava/java/net/UnknownHostException.java *** gcc-3.2.3/libjava/java/net/UnknownHostException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/UnknownHostException.java 2002-06-15 19:45:34.000000000 +0000 *************** *** 1,5 **** ! /* UnknownHostException.java -- The hostname is not unknown ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnknownHostException.java -- The hostname is unknown ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,88 **** package java.net; ! /* ! * Written using on-line Java Platform 1.2 API Specification. ! * Status: Believed complete and correct. ! */ /** ! * This exception indicates that an attempt was made to reference a hostname ! * or IP address that is not valid. This could possibly indicate that a ! * DNS problem has occurred, but most often means that the host was not ! * correctly specified. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Per Bothner ! * @date January 6, 1999. ! */ ! public class UnknownHostException extends java.io.IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Initializes a new instance of UnknownHostException ! * without a descriptive error message. ! */ ! public ! UnknownHostException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Initializes a new instance of UnknownHostException ! * with a descriptive error message, such as the name of the host ! * that could not be resolved. ! * ! * @param message A message describing the error that occurrred. ! */ ! public ! UnknownHostException(String message) ! { ! super(message); ! } } // class UnknownHostException - --- 37,76 ---- package java.net; ! import java.io.IOException; /** ! * This exception indicates that an attempt was made to reference a hostname ! * or IP address that is not valid. This could possibly indicate that a ! * DNS problem has occurred, but most often means that the host was not ! * correctly specified. ! * ! * @author Aaron M. Renn ! * @author Per Bothner ! * @status updated to 1.4 */ ! public class UnknownHostException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4639126076052875403L; ! /** ! * Create a new instance without a descriptive error message. ! */ ! public UnknownHostException() ! { ! } + /** + * Create a new instance with a descriptive error message, such as the + * name of the host that could not be resolved. + * + * @param message a message describing the error that occurred + */ + public UnknownHostException(String message) + { + super(message); + } } // class UnknownHostException diff -Nrc3pad gcc-3.2.3/libjava/java/net/UnknownServiceException.java gcc-3.3/libjava/java/net/UnknownServiceException.java *** gcc-3.2.3/libjava/java/net/UnknownServiceException.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/UnknownServiceException.java 2002-06-15 19:45:34.000000000 +0000 *************** *** 1,5 **** /* UnknownServiceException.java -- A service error occurred ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* UnknownServiceException.java -- A service error occurred ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,88 **** package java.net; ! /** ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! */ /** ! * Contrary to what you might think, this does not indicate that the ! * TCP/IP service name specified was invalid. Instead it indicates that ! * the MIME type returned from a URL could not be determined or that an ! * attempt was made to write to a read-only URL. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Warren Levy ! * @date March 5, 1999. ! */ ! public class UnknownServiceException extends java.io.IOException ! { ! ! /* ! * Constructors */ ! ! /** ! * Initializes a new instance of UnknownServiceException ! * without a descriptive error message. ! */ ! public ! UnknownServiceException() { ! super(); ! } ! ! /*************************************************************************/ ! /** ! * Initializes a new instance of UnknownServiceException ! * without a descriptive error message. ! * ! * @param message A message describing the error that occurred. ! */ ! public ! UnknownServiceException(String message) ! { ! super(message); ! } } // class UnknownServiceException - --- 37,75 ---- package java.net; ! import java.io.IOException; /** ! * Contrary to what you might think, this does not indicate that the ! * TCP/IP service name specified was invalid. Instead it indicates that ! * the MIME type returned from a URL could not be determined or that an ! * attempt was made to write to a read-only URL. ! * ! * @author Aaron M. Renn ! * @author Warren Levy ! * @status updated to 1.4 */ ! public class UnknownServiceException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = -4169033248853639508L; ! /** ! * Create a new instance without a descriptive error message. ! */ ! public UnknownServiceException() ! { ! } + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public UnknownServiceException(String message) + { + super(message); + } } // class UnknownServiceException diff -Nrc3pad gcc-3.2.3/libjava/java/net/URI.java gcc-3.3/libjava/java/net/URI.java *** gcc-3.2.3/libjava/java/net/URI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/URI.java 2002-10-05 07:49:08.000000000 +0000 *************** *** 0 **** --- 1,433 ---- + /* URI.java - An URI class + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; + import java.io.Serializable; + + /** + * @author Michael Koch + * @since 1.4 + */ + public final class URI + implements Comparable, Serializable + { + static final long serialVersionUID = -6052424284110960213L; + + String string; + private String scheme; + private String schemeSpecificPart; + private String authority; + private String userInfo; + private String host; + private int port; + private String path; + private String query; + private String fragment; + + private void readObject (ObjectInputStream is) + throws ClassNotFoundException, IOException + { + } + + private void writeObject (ObjectOutputStream is) + throws IOException + { + } + + private void parseURI (String str) + throws URISyntaxException + { + } + + /** + * Creates an URI from the given string + * + * @param str The string to create the URI from + * + * @exception URISyntaxException If the given string violates RFC 2396 + * @exception NullPointerException If str is null + */ + public URI (String str) + throws URISyntaxException + { + } + + /** + * Create an URI from the given components + * + * @param scheme The scheme name + * @param userInfo The username and authorization info + * @param host The hostname + * @param port The port number + * @param path The path + * @param query The query + * @param fragment The fragment + * + * @exception URISyntaxException If the given string violates RFC 2396 + */ + public URI (String scheme, String userInfo, String host, int port, + String path, String query, String fragment) + throws URISyntaxException + { + } + + /** + * Create an URI from the given components + * + * @param scheme The scheme name + * @param authority The authority + * @param path The apth + * @param query The query + * @param fragment The fragmen + * + * @exception URISyntaxException If the given string violates RFC 2396 + */ + public URI (String scheme, String authority, String path, String query, + String fragment) + throws URISyntaxException + { + } + + /** + * Create an URI from the given components + * + * @param scheme The scheme name + * @param host The hostname + * @param path The path + * @param fragment The fragment + * + * @exception URISyntaxException If the given string violates RFC 2396 + */ + public URI (String scheme, String host, String path, String fragment) + throws URISyntaxException + { + } + + /** + * Create an URI from the given components + * + * @param scheme The scheme name + * @param ssp The scheme specific part + * @param fragment The fragment + * + * @exception URISyntaxException If the given string violates RFC 2396 + */ + public URI (String scheme, String ssp, String fragment) + throws URISyntaxException + { + } + + /** + * Create an URI from the given string + * + * @param str The string to create the URI from + * + * @exception IllegalArgumentException If the given string violates RFC 2396 + * @exception NullPointerException If str is null + */ + public static URI create (String str) + throws IllegalArgumentException, URISyntaxException + { + return null; + } + + /** + * Attempts to parse this URI's authority component, if defined, + * into user-information, host, and port components + * + * @exception URISyntaxException If the given string violates RFC 2396 + */ + public URI parseServerAuthority () + throws URISyntaxException + { + return null; + } + + /** + * Returns a normalizes versions of the URI + */ + public URI normalize () + { + return null; + } + + /** + * Resolves the given URI against this URI + * + * @param uri The URI to resolve against this URI + * + * @return The resulting URI + * + * @exception NullPointerException If uri is null + */ + public URI resolve (URI uri) + { + return null; + } + + /** + * Resolves the given URI string against this URI + * + * @param str The URI as string to resolve against this URI + * + * @return The resulting URI + * + * @exception IllegalArgumentException If the given URI string + * violates RFC 2396 + * @exception NullPointerException If uri is null + */ + public URI resolve (String str) + throws IllegalArgumentException + { + return null; + } + + /** + * Relativizes the given URI against this URI + * + * @param uri The URI to relativize this URI + * + * @return The resulting URI + * + * @exception NullPointerException If uri is null + */ + public URI relativize (URI uri) + { + return null; + } + + /** + * Creates an URL from an URI + * + * @exception MalformedURLException If a protocol handler for the URL could + * not be found, or if some other error occurred while constructing the URL + * @exception IllegalArgumentException If the URI is not absolute + */ + public URL toURL () + throws IllegalArgumentException, MalformedURLException + { + return null; + } + + /** + * Returns the scheme of the URI + */ + public String getScheme () + { + return scheme; + } + + /** + * Tells whether this URI is absolute or not + */ + public boolean isAbsolute () + { + return false; + } + + /** + * Tell whether this URI is opaque or not + */ + public boolean isOpaque () + { + return false; + } + + /** + * Returns the raw scheme specific part of this URI. + * The scheme-specific part is never undefined, though it may be empty + */ + public String getRawSchemeSpecificPart () + { + return null; + } + + /** + * Returns the decoded scheme specific part of this URI. + */ + public String getSchemeSpecificPart () + { + return null; + } + + /** + * Returns the rae authority part of this URI + */ + public String getRawAuthority () + { + return authority; + } + + /** + * Returns the decoded authority part of this URI + */ + public String getAuthority () + { + return null; + } + + /** + * Returns the raw user info part of this URI + */ + public String getRawUserInfo () + { + return userInfo; + } + + /** + * Returns the decoded user info part of this URI + */ + public String getUserInfo () + { + return null; + } + + /** + * Returns the hostname of the URI + */ + public String getHost () + { + return host; + } + + /** + * Returns the port number of the URI + */ + public int getPort () + { + return port; + } + + /** + * Returns the raw path part of this URI + */ + public String getRawPath () + { + return path; + } + + /** + * Returns the path of the URI + */ + public String getPath () + { + return null; + } + + /** + * Returns the raw query part of this URI + */ + public String getRawQuery () + { + return query; + } + + /** + * Returns the query of the URI + */ + public String getQuery () + { + return null; + } + + /** + * Return the raw fragment part of this URI + */ + public String getRawFragment () + { + return fragment; + } + + /** + * Returns the fragment of the URI + */ + public String getFragment () + { + return null; + } + + /** + * Compares the URI with a given object + * + * @param obj The obj to compare the URI with + */ + public boolean equals(Object obj) + { + return false; + } + + /** + * Computes the hascode of the URI + */ + public int hashCode () + { + return 0; + } + + /** + * Compare the URI with another object that must be an URI too + * + * @param obj This object to compare this URI with + * + * @exception ClassCastException If given object ist not an URI + */ + public int compareTo (Object obj) + throws ClassCastException + { + return 0; + } + + /** + * Returns the URI as string + */ + public String toString () + { + return ""; + } + + /** + * Returns the URI as US-ASCII string + */ + public String toASCIIString () + { + return ""; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/net/URISyntaxException.java gcc-3.3/libjava/java/net/URISyntaxException.java *** gcc-3.2.3/libjava/java/net/URISyntaxException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/net/URISyntaxException.java 2002-08-21 18:54:07.000000000 +0000 *************** *** 0 **** --- 1,143 ---- + /* URISyntaxException.java -- a string could not be parsed as a URI + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.net; + + /** + * This exception is thrown when a String cannot be parsed as a URI. + * + * @author Eric Blake + * @see URI + * @since 1.4 + * @status updated to 1.4 + */ + public class URISyntaxException extends Exception + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 2137979680897488891L; + + /** + * The failed input. + * + * @serial the bad URI + */ + private final String input; + + /** + * The index of failure. + * + * @serial the location of the problem + */ + private final int index; + + /** + * Create an exception from the invalid string, with the index set to -1. + * + * @param input the bad URI + * @param msg the descriptive error message + * @throws NullPointerException if input or msg are null + */ + public URISyntaxException(String input, String msg) + { + this(input, msg, -1); + } + + /** + * Create an exception from the invalid string, with the index of the + * point of failure. + * + * @param input the bad URI + * @param msg the descriptive error message + * @param index the index of the parse error, or -1 + * @throws NullPointerException if input or msg are null + * @throws IllegalArgumentException if index < -1 + */ + public URISyntaxException(String input, String msg, int index) + { + // The toString() hack checks for null. + super(msg.toString()); + this.input = input.toString(); + this.index = index; + if (index < -1) + throw new IllegalArgumentException(); + } + + /** + * Returns the bad input string. + * + * @return the bad URI, guaranteed non-null + */ + public String getInput() + { + return input; + } + + /** + * Returns the reason for the failure. + * + * @return the message, guaranteed non-null + */ + public String getReason() + { + return super.getMessage(); + } + + /** + * Returns the index of the failure, or -1. + * + * @return the index of failure + */ + public int getIndex() + { + return index; + } + + /** + * Returns a message describing the parse error, as if by + * getReason() + (getIndex() >= 0 ? " at index " + getIndex() : "") + * + ": " + getInput(). + * + * @return the message string + */ + public String getMessage() + { + return super.getMessage() + (index >= 0 ? " at index " + index : "") + + ": " + input; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/net/URLClassLoader.java gcc-3.3/libjava/java/net/URLClassLoader.java *** gcc-3.2.3/libjava/java/net/URLClassLoader.java 2000-11-26 03:58:56.000000000 +0000 --- gcc-3.3/libjava/java/net/URLClassLoader.java 2003-01-02 09:36:05.000000000 +0000 *************** *** 1,258 **** ! /* Copyright (C) 1999, 2000 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package java.net; ! import java.io.*; ! import java.util.jar.*; import java.util.Enumeration; import java.util.Vector; ! public class URLClassLoader extends ClassLoader { ! // The URLStreamHandlerFactory ! URLStreamHandlerFactory factory = null; ! // `path' contains simply the URL's we're using for the searching. ! private Vector path; ! // If path[n] is a zip/jar, then this holds a JarURLConnection for ! // that thing, otherwise, path[n] is null. ! private Vector info; ! private URLStreamHandler getHandler0 (String protocol) { ! if (factory != null) ! return factory.createURLStreamHandler(protocol); ! else return null; } ! public URLClassLoader (URL[] urls) ! { ! this (urls, null, null); } ! ! public URLClassLoader (URL[] urls, ClassLoader parent) ! { ! this (urls, parent, null); } ! // A File URL may actually be a Jar URL. Convert if possible. ! private URL jarFileize (URL url) { ! if (! url.getProtocol ().equals ("jar")) ! { ! String f = url.getFile (); ! // If it ends with '/' we'll take it for a directory, ! // otherwise it's a jar file. This is how JDK 1.2 defines ! // it, so we will not try to be smart here. ! if (f.charAt (f.length ()-1) != '/') ! { ! try ! { ! url = new URL ("jar", "", -1, (url.toExternalForm ())+"!/", ! getHandler0 ("jar")); ! } ! catch (MalformedURLException x) ! { ! /* ignore */ ! } ! } ! } ! return url; } ! protected void addURL (URL url) { ! JarURLConnection conn = null; ! // Convert a Jar File URL into Jar URL if possible. ! url = jarFileize (url); ! path.addElement (url); ! if (url.getProtocol ().equals ("jar")) ! { ! try ! { ! conn = (JarURLConnection) url.openConnection (); ! } ! catch (java.io.IOException x) ! { ! /* ignore */ ! } ! } ! info.addElement (conn); } ! public URLClassLoader (URL[] urls, ClassLoader parent, ! URLStreamHandlerFactory fac) ! { ! super (parent); ! factory = fac; ! if (urls == null || urls.length == 0) { ! path = new Vector (1); ! info = new Vector (1); ! return; } ! path = new Vector (urls.length); ! info = new Vector (urls.length); ! for (int i = 0; i < urls.length; i++) { ! // Convert a Jar File URL into a Jar URL is possible. ! URL u = jarFileize(urls[i]); ! path.addElement (u); ! if (u.getProtocol ().equals ("jar")) { ! JarURLConnection conn = null; ! try { ! conn = (JarURLConnection) u.openConnection (); } ! catch (java.io.IOException x) { ! /* ignore */ } ! info.addElement (conn); } ! else { ! info.addElement (null); } } ! } ! ! public URL[] getURLs () ! { ! URL[] urls = new URL[path.size()]; ! path.copyInto (urls); ! return urls; ! } ! ! public Enumeration findResources (String name) ! { ! Vector results = new Vector (); ! ! for (int i = 0; i < path.size(); i++) { ! URL u = (URL)path.elementAt (i); ! ! try { ! JarURLConnection conn = (JarURLConnection) info.elementAt (i); ! ! if (conn != null) ! { ! if (conn.getJarFile().getJarEntry (name) != null) ! results.addElement (new URL(u, name, getHandler0 (u.getProtocol()))); ! } ! else ! { ! URL p = new URL (u, name, getHandler0 (u.getProtocol())); ! ! InputStream is = p.openStream(); ! if (is != null) ! { ! is.close(); ! results.addElement (p); ! } ! } ! ! // if we get an exception ... try the next path element ! } catch (IOException x) { ! continue; ! } } - - return results.elements (); } ! public URL findResource (String name) { ! for (int i = 0; i < path.size(); i++) { ! URL u = (URL)path.elementAt (i); ! ! try { ! JarURLConnection conn = (JarURLConnection) info.elementAt (i); ! ! if (conn != null) ! { ! if (conn.getJarFile().getJarEntry (name) != null) ! return new URL(u, name, getHandler0 (u.getProtocol())); ! } ! else ! { ! URL p = new URL (u, name, getHandler0 (u.getProtocol())); ! ! InputStream is = p.openStream(); ! if (is != null) ! { ! is.close(); ! return p; ! } ! } ! ! // if we get an exception ... try the next path element ! } catch (IOException x) { continue; ! } } return null; } ! // and finally, we can implement our class loader functionality. ! protected Class findClass (String name) ! throws ClassNotFoundException { ! if (name == null) ! throw new ClassNotFoundException ("null"); ! try { ! URL u = getResource (name.replace ('.', '/') + ".class"); ! ! if (u == null) ! throw new ClassNotFoundException (name); ! URLConnection connection = u.openConnection (); ! InputStream is = connection.getInputStream (); ! int len = connection.getContentLength (); ! byte[] data = new byte[len]; ! int left = len; ! int off = 0; ! while (left > 0) { ! int c = is.read (data, off, len-off); ! if (c == -1 || c == 0) ! throw new InternalError ("premature end of file"); ! left -= c; ! off += c; } ! return defineClass (name, data, 0, len); ! } ! catch (java.io.IOException x) { ! throw new ClassNotFoundException(name); } } } - --- 1,1068 ---- ! /* URLClassLoader.java -- ClassLoader that loads classes from one or more URLs ! Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.net; ! import java.io.ByteArrayOutputStream; ! import java.io.EOFException; ! import java.io.File; ! import java.io.FileInputStream; ! import java.io.FileNotFoundException; ! import java.io.FilterInputStream; ! import java.io.FilePermission; ! import java.io.InputStream; ! import java.io.IOException; ! import java.security.AccessController; ! import java.security.AccessControlContext; ! import java.security.CodeSource; ! import java.security.SecureClassLoader; ! import java.security.PrivilegedAction; ! import java.security.PermissionCollection; ! import java.security.cert.Certificate; import java.util.Enumeration; import java.util.Vector; + import java.util.HashMap; + import java.util.jar.Attributes; + import java.util.jar.JarEntry; + import java.util.jar.JarFile; + import java.util.jar.Manifest; + import java.util.zip.ZipException; ! /** ! * A secure class loader that can load classes and resources from ! * multiple locations. Given an array of URLs this class ! * loader will retrieve classes and resources by fetching them from ! * possible remote locations. Each URL is searched in ! * order in which it was added. If the file portion of the ! * URL ends with a '/' character then it is interpreted ! * as a base directory, otherwise it is interpreted as a jar file from ! * which the classes/resources are resolved. ! * ! *

        New instances can be created by two static ! * newInstance() methods or by three public ! * contructors. Both ways give the option to supply an initial array ! * of URLs and (optionally) a parent classloader (that is ! * different from the standard system class loader).

        ! * ! *

        Normally creating a URLClassLoader throws a ! * SecurityException if a SecurityManager is ! * installed and the checkCreateClassLoader() method does ! * not return true. But the newInstance() methods may be ! * used by any code as long as it has permission to acces the given ! * URLs. URLClassLoaders created by the ! * newInstance() methods also explicitly call the ! * checkPackageAccess() method of ! * SecurityManager if one is installed before trying to ! * load a class. Note that only subclasses of ! * URLClassLoader can add new URLs after the ! * URLClassLoader had been created. But it is always possible to get ! * an array of all URLs that the class loader uses to resolve classes ! * and resources by way of the getURLs() method.

        ! * ! *

        Open issues: ! *

          ! * ! *
        • Should the URLClassLoader actually add the locations found in ! * the manifest or is this the responsibility of some other ! * loader/(sub)class? (see ! * Extension Mechanism Architecture - Bundles Extensions)
        • ! * ! *
        • How does definePackage() and sealing work ! * precisely?
        • ! * ! *
        • We save and use the security context (when a created by ! * newInstance() but do we have to use it in more ! * places?
        • ! * ! *
        • The use of URLStreamHandlers has not been tested.
        • ! * ! *
        ! *

        ! * ! * @since 1.2 ! * ! * @author Mark Wielaard (mark@klomp.org) ! * @author Wu Gansha (gansha.wu@intel.com) ! */ ! ! public class URLClassLoader extends SecureClassLoader { ! // Class Variables ! /** ! * A global cache to store mappings between URLLoader and URL, ! * so we can avoid do all the homework each time the same URL ! * comes. ! * XXX - Keeps these loaders forever which prevents garbage collection. ! */ ! private static HashMap urlloaders = new HashMap(); ! ! /** ! * A cache to store mappings between handler factory and its ! * private protocol handler cache (also a HashMap), so we can avoid ! * create handlers each time the same protocol comes. ! */ ! private static HashMap factoryCache = new HashMap(5); ! // Instance variables ! /** Locations to load classes from */ ! private final Vector urls = new Vector(); ! ! /** ! * Store pre-parsed information for each url into this vector ! * each element is a URL loader, corresponding to the URL of ! * the same index in "urls" ! */ ! private final Vector urlinfos = new Vector(); ! ! /** Factory used to get the protocol handlers of the URLs */ ! private final URLStreamHandlerFactory factory; ! ! /** ! * The security context when created from newInstance() ! * or null when created through a normal constructor or when no ! * SecurityManager was installed. ! */ ! private final AccessControlContext securityContext; ! ! // Helper classes ! ! /** ! * A URLLoader contains all logic to load resources from a ! * given base URL. ! */ ! static abstract class URLLoader { ! /** ! * Our classloader to get info from if needed. ! */ ! final URLClassLoader classloader; ! ! /** ! * The base URL from which all resources are loaded. ! */ ! final URL baseURL; ! ! /** ! * A CodeSource without any associated certificates. ! * It is common for classes to not have certificates associated ! * with them. If they come from the same URLLoader ! * then it is safe to share the associated CodeSource ! * between them since CodeSource is immutable. ! */ ! final CodeSource noCertCodeSource; ! ! URLLoader(URLClassLoader classloader, URL baseURL) ! { ! this.classloader = classloader; ! this.baseURL = baseURL; ! this.noCertCodeSource = new CodeSource(baseURL, null); ! } ! ! /** ! * Returns a Resource loaded by this ! * URLLoader, or null when no ! * Resource with the given name exists. ! */ ! abstract Resource getResource(String s); ! ! /** ! * Returns the Manifest associated with the ! * Resources loaded by this URLLoader or ! * null there is no such Manifest. ! */ ! Manifest getManifest() ! { return null; + } } ! /** ! * A Resource represents a resource in some ! * URLLoader. It also contains all information (e.g., ! * URL, CodeSource, Manifest and ! * InputStream) that is necessary for loading resources ! * and creating classes from a URL. ! */ ! static abstract class Resource ! { ! final URLLoader loader; ! final String name; ! ! Resource(URLLoader loader, String name) ! { ! this.loader = loader; ! this.name = name; ! } ! ! /** ! * Returns the non-null CodeSource associated with ! * this resource. ! */ ! CodeSource getCodeSource() ! { ! Certificate[] certs = getCertificates(); ! if (certs == null) ! return loader.noCertCodeSource; ! else ! return new CodeSource(loader.baseURL, certs); ! } ! ! /** ! * Returns Certificates associated with this ! * resource, or null when there are none. ! */ ! Certificate[] getCertificates() ! { ! return null; ! } ! ! /** ! * Return a URL that can be used to access this resource. ! */ ! abstract URL getURL(); ! ! /** ! * Returns the size of this Resource in bytes or ! * -1 when unknown. ! */ ! abstract int getLength(); ! ! /** ! * Returns the non-null InputStream through which ! * this resource can be loaded. ! */ ! abstract InputStream getInputStream() throws IOException; } ! ! /** ! * A JarURLLoader is a type of URLLoader ! * only loading from jar url. ! */ ! final static class JarURLLoader extends URLLoader ! { ! final JarFile jarfile; // The jar file for this url ! final URL baseJarURL; // Base jar: url for all resources loaded from jar ! ! public JarURLLoader(URLClassLoader classloader, URL baseURL) ! { ! super(classloader, baseURL); ! ! // cache url prefix for all resources in this jar url ! String external = baseURL.toExternalForm(); ! StringBuffer sb = new StringBuffer(external.length() + 6); ! sb.append("jar:"); ! sb.append(external); ! sb.append("!/"); ! String jarURL = sb.toString(); ! ! URL baseJarURL = null; ! JarFile jarfile = null; ! try ! { ! baseJarURL ! = new URL(null, jarURL, classloader.getURLStreamHandler("jar")); ! jarfile ! = ((JarURLConnection) baseJarURL.openConnection()).getJarFile(); ! } ! catch (IOException ioe) { /* ignored */ } ! ! this.baseJarURL = baseJarURL; ! this.jarfile = jarfile; ! } ! ! /** get resource with the name "name" in the jar url */ ! Resource getResource(String name) ! { ! if (jarfile == null) ! return null; ! ! JarEntry je = jarfile.getJarEntry(name); ! if(je != null) ! return new JarURLResource(this, name, je); ! else ! return null; ! } ! ! Manifest getManifest() ! { ! try ! { ! return (jarfile == null) ? null : jarfile.getManifest(); ! } ! catch (IOException ioe) ! { ! return null; ! } ! } } ! final static class JarURLResource extends Resource { ! private final JarEntry entry; ! JarURLResource(JarURLLoader loader, String name, JarEntry entry) ! { ! super(loader, name); ! this.entry = entry; ! } ! ! InputStream getInputStream() throws IOException ! { ! return ((JarURLLoader)loader).jarfile.getInputStream(entry); ! } ! ! int getLength() ! { ! return (int)entry.getSize(); ! } ! ! Certificate[] getCertificates() ! { ! return entry.getCertificates(); ! } ! ! URL getURL() ! { ! try ! { ! return new URL(((JarURLLoader)loader).baseJarURL, name, ! loader.classloader.getURLStreamHandler("jar")); ! } ! catch(MalformedURLException e) ! { ! InternalError ie = new InternalError(); ! ie.initCause(e); ! throw ie; ! } ! } } ! /** ! * Loader for remote directories. ! */ ! final static class RemoteURLLoader extends URLLoader { ! final private String protocol; ! ! RemoteURLLoader(URLClassLoader classloader, URL url) ! { ! super(classloader, url); ! protocol = url.getProtocol(); ! } ! ! /** ! * Get a remote resource. ! * Returns null if no such resource exists. ! */ ! Resource getResource(String name) ! { ! try ! { ! URL url = new URL(baseURL, name, ! classloader.getURLStreamHandler(protocol)); ! URLConnection connection = url.openConnection(); ! ! // Open the connection and check the stream ! // just to be sure it exists. ! int length = connection.getContentLength(); ! InputStream stream = connection.getInputStream(); ! ! // We can do some extra checking if it is a http request ! if (connection instanceof HttpURLConnection) ! { ! int response ! = ((HttpURLConnection)connection).getResponseCode(); ! if (response/100 != 2) ! return null; ! } ! ! if (stream != null) ! return new RemoteResource(this, name, url, stream, length); ! else ! return null; ! } ! catch (IOException ioe) ! { ! return null; ! } ! } ! } ! ! /** ! * A resource from some remote location. ! */ ! final static class RemoteResource extends Resource ! { ! final private URL url; ! final private InputStream stream; ! final private int length; ! ! RemoteResource(RemoteURLLoader loader, String name, URL url, ! InputStream stream, int length) ! { ! super(loader, name); ! this.url = url; ! this.stream = stream; ! this.length = length; ! } ! ! InputStream getInputStream() throws IOException ! { ! return stream; ! } ! ! public int getLength() ! { ! return length; ! } ! ! public URL getURL() ! { ! return url; ! } ! } ! ! /** ! * A FileURLLoader is a type of URLLoader ! * only loading from file url. ! */ ! final static class FileURLLoader extends URLLoader ! { ! File dir; //the file for this file url ! ! FileURLLoader(URLClassLoader classloader, URL url) ! { ! super(classloader, url); ! dir = new File(baseURL.getFile()); ! } ! ! /** get resource with the name "name" in the file url */ ! Resource getResource(String name) ! { ! File file = new File(dir, name); ! if (file.exists() && !file.isDirectory()) ! return new FileResource(this, name, file); ! return null; ! } ! } ! ! final static class FileResource extends Resource ! { ! final File file; ! ! FileResource(FileURLLoader loader, String name, File file) ! { ! super(loader, name); ! this.file = file; ! } ! ! InputStream getInputStream() throws IOException ! { ! return new FileInputStream(file); ! } ! ! public int getLength() ! { ! return (int)file.length(); ! } ! ! public URL getURL() ! { ! try ! { ! return new URL(loader.baseURL, name, ! loader.classloader.getURLStreamHandler("file")); ! } ! catch(MalformedURLException e) ! { ! InternalError ie = new InternalError(); ! ie.initCause(e); ! throw ie; ! } ! } ! } ! // Constructors ! /** ! * Creates a URLClassLoader that gets classes from the supplied URLs. ! * To determine if this classloader may be created the constructor of ! * the super class (SecureClassLoader) is called first, which ! * can throw a SecurityException. Then the supplied URLs are added ! * in the order given to the URLClassLoader which uses these URLs to ! * load classes and resources (after using the default parent ClassLoader). ! * ! * @exception SecurityException if the SecurityManager disallows the ! * creation of a ClassLoader. ! * @param urls Locations that should be searched by this ClassLoader when ! * resolving Classes or Resources. ! * @see SecureClassLoader ! */ ! public URLClassLoader(URL[] urls) throws SecurityException ! { ! super(); ! this.factory = null; ! this.securityContext = null; ! addURLs(urls); ! } ! /** ! * Private constructor used by the static ! * newInstance(URL[]) method. Creates an ! * URLClassLoader without any URLs ! * yet. This is used to bypass the normal security check for ! * creating classloaders, but remembers the security context which ! * will be used when defining classes. The URLs to ! * load from must be added by the newInstance() method ! * in the security context of the caller. ! * ! * @param securityContext the security context of the unprivileged code. ! */ ! private URLClassLoader(AccessControlContext securityContext) ! { ! super(); ! this.factory = null; ! this.securityContext = securityContext; ! } ! /** ! * Creates a URLClassLoader that gets classes from the supplied ! * URLs. ! * To determine if this classloader may be created the constructor of ! * the super class (SecureClassLoader) is called first, which ! * can throw a SecurityException. Then the supplied URLs are added ! * in the order given to the URLClassLoader which uses these URLs to ! * load classes and resources (after using the supplied parent ClassLoader). ! * @exception SecurityException if the SecurityManager disallows the ! * creation of a ClassLoader. ! * @exception SecurityException ! * @param urls Locations that should be searched by this ClassLoader when ! * resolving Classes or Resources. ! * @param parent The parent class loader used before trying this class ! * loader. ! * @see SecureClassLoader ! */ ! public URLClassLoader(URL[] urls, ClassLoader parent) ! throws SecurityException ! { ! super(parent); ! this.factory = null; ! this.securityContext = null; ! addURLs(urls); } ! /** ! * Private constructor used by the static ! * newInstance(URL[]) method. Creates an ! * URLClassLoader with the given parent but without any ! * URLs yet. This is used to bypass the normal security ! * check for creating classloaders, but remembers the security ! * context which will be used when defining classes. The ! * URLs to load from must be added by the ! * newInstance() method in the security context of the ! * caller. ! * ! * @param securityContext the security context of the unprivileged code. ! */ ! private URLClassLoader(ClassLoader parent, ! AccessControlContext securityContext) ! { ! super(parent); ! this.factory = null; ! this.securityContext = securityContext; ! } ! /** ! * Creates a URLClassLoader that gets classes from the supplied URLs. ! * To determine if this classloader may be created the constructor of ! * the super class (SecureClassLoader) is called first, which ! * can throw a SecurityException. Then the supplied URLs are added ! * in the order given to the URLClassLoader which uses these URLs to ! * load classes and resources (after using the supplied parent ClassLoader). ! * It will use the supplied URLStreamHandlerFactory to get the ! * protocol handlers of the supplied URLs. ! * @exception SecurityException if the SecurityManager disallows the ! * creation of a ClassLoader. ! * @exception SecurityException ! * @param urls Locations that should be searched by this ClassLoader when ! * resolving Classes or Resources. ! * @param parent The parent class loader used before trying this class ! * loader. ! * @param factory Used to get the protocol handler for the URLs. ! * @see SecureClassLoader ! */ ! public URLClassLoader(URL[] urls, ! ClassLoader parent, ! URLStreamHandlerFactory factory) ! throws SecurityException ! { ! super(parent); ! this.securityContext = null; ! this.factory = factory; ! addURLs(urls); ! // If this factory is still not in factoryCache, add it, ! // since we only support three protocols so far, 5 is enough ! // for cache initial size ! synchronized(factoryCache) { ! if(factory != null && factoryCache.get(factory) == null) ! factoryCache.put(factory, new HashMap(5)); } + } ! // Methods ! /** ! * Adds a new location to the end of the internal URL store. ! * @param newUrl the location to add ! */ ! protected void addURL(URL newUrl) ! { ! synchronized(urlloaders) { ! if (newUrl == null) ! return; // Silently ignore... ! ! // check global cache to see if there're already url loader ! // for this url ! URLLoader loader = (URLLoader)urlloaders.get(newUrl); ! if (loader == null) ! { ! String file = newUrl.getFile(); ! // Check that it is not a directory ! if (! (file.endsWith("/") || file.endsWith(File.separator))) ! loader = new JarURLLoader(this, newUrl); ! else if ("file".equals(newUrl.getProtocol())) ! loader = new FileURLLoader(this, newUrl); ! else ! loader = new RemoteURLLoader(this, newUrl); ! // cache it ! urlloaders.put(newUrl, loader); ! } ! urls.add(newUrl); ! urlinfos.add(loader); ! } ! } ! ! /** ! * Adds an array of new locations to the end of the internal URL store. ! * @param newUrls the locations to add ! */ ! private void addURLs(URL[] newUrls) ! { ! for (int i = 0; i < newUrls.length; i++) ! { ! addURL(newUrls[i]); ! } ! } ! ! /** ! * Defines a Package based on the given name and the supplied manifest ! * information. The manifest indicates the tile, version and ! * vendor information of the specification and implementation and wheter the ! * package is sealed. If the Manifest indicates that the package is sealed ! * then the Package will be sealed with respect to the supplied URL. ! * ! * @exception IllegalArgumentException If this package name already exists ! * in this class loader ! * @param name The name of the package ! * @param manifest The manifest describing the specification, ! * implementation and sealing details of the package ! * @param url the code source url to seal the package ! * @return the defined Package ! */ ! protected Package definePackage(String name, Manifest manifest, URL url) ! throws IllegalArgumentException ! { ! Attributes attr = manifest.getMainAttributes(); ! String specTitle = ! attr.getValue(Attributes.Name.SPECIFICATION_TITLE); ! String specVersion = ! attr.getValue(Attributes.Name.SPECIFICATION_VERSION); ! String specVendor = ! attr.getValue(Attributes.Name.SPECIFICATION_VENDOR); ! String implTitle = ! attr.getValue(Attributes.Name.IMPLEMENTATION_TITLE); ! String implVersion = ! attr.getValue(Attributes.Name.IMPLEMENTATION_VERSION); ! String implVendor = ! attr.getValue(Attributes.Name.IMPLEMENTATION_VENDOR); ! ! // Look if the Manifest indicates that this package is sealed ! // XXX - most likely not completely correct! ! // Shouldn't we also check the sealed attribute of the complete jar? ! // http://java.sun.com/products/jdk/1.4/docs/guide/extensions/spec.html#bundled ! // But how do we get that jar manifest here? ! String sealed = attr.getValue(Attributes.Name.SEALED); ! if ("false".equals(sealed)) ! { ! // make sure that the URL is null so the package is not sealed ! url = null; ! } ! ! return definePackage(name, specTitle, specVersion, specVendor, ! implTitle, implVersion, implVendor, url); ! } ! ! /** ! * Finds (the first) class by name from one of the locations. The locations ! * are searched in the order they were added to the URLClassLoader. ! * ! * @param className the classname to find ! * @exception ClassNotFoundException when the class could not be found or ! * loaded ! * @return a Class object representing the found class ! */ ! protected Class findClass(final String className) ! throws ClassNotFoundException ! { ! // Just try to find the resource by the (almost) same name ! String resourceName = className.replace('.', '/') + ".class"; ! Resource resource = findURLResource(resourceName); ! if (resource == null) ! throw new ClassNotFoundException(className + " not found in " + urls); ! ! // Try to read the class data, create the CodeSource, Package and ! // construct the class (and watch out for those nasty IOExceptions) ! try ! { ! byte [] data; ! InputStream in = resource.getInputStream(); ! int length = resource.getLength(); ! if (length != -1) { ! // We know the length of the data. ! // Just try to read it in all at once ! data = new byte[length]; ! int pos = 0; ! while(length - pos > 0) { ! int len = in.read(data, pos, length - pos); ! if (len == -1) ! throw new EOFException("Not enough data reading from: " ! + in); ! pos += len; } ! } ! else ! { ! // We don't know the data length. ! // Have to read it in chunks. ! ByteArrayOutputStream out = new ByteArrayOutputStream(4096); ! byte b[] = new byte[4096]; ! int l = 0; ! while (l != -1) { ! l = in.read(b); ! if (l != -1) ! out.write(b, 0, l); } ! data = out.toByteArray(); } ! final byte[] classData = data; ! ! // Now get the CodeSource ! final CodeSource source = resource.getCodeSource(); ! ! // Find out package name ! String packageName = null; ! int lastDot = className.lastIndexOf('.'); ! if (lastDot != -1) ! packageName = className.substring(0, lastDot); ! ! if (packageName != null && getPackage(packageName) == null) { ! // define the package ! Manifest manifest = resource.loader.getManifest(); ! if (manifest == null) ! definePackage(packageName, ! null, null, null, null, null, null, null); ! else ! definePackage(packageName, manifest, resource.loader.baseURL); ! } ! ! // And finally construct the class! ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null && securityContext != null) ! { ! return (Class)AccessController.doPrivileged ! (new PrivilegedAction() ! { ! public Object run() ! { ! return defineClass(className, classData, ! 0, classData.length, ! source); ! } ! }, securityContext); } + else + return defineClass(className, classData, + 0, classData.length, + source); } ! catch (IOException ioe) { ! throw new ClassNotFoundException(className, ioe); } } ! /** ! * Finds the first occurrence of a resource that can be found. The locations ! * are searched in the order they were added to the URLClassLoader. ! * ! * @param resourceName the resource name to look for ! * @return the URLResource for the resource if found, null otherwise ! */ ! private Resource findURLResource(String resourceName) { ! int max = urls.size(); ! for (int i = 0; i < max; i++) { ! URLLoader loader = (URLLoader)urlinfos.elementAt(i); ! if (loader == null) continue; ! ! Resource resource = loader.getResource(resourceName); ! if (resource != null) ! return resource; } + return null; + } + /** + * Finds the first occurrence of a resource that can be found. + * + * @param resourceName the resource name to look for + * @return the URL if found, null otherwise + */ + public URL findResource(String resourceName) + { + Resource resource = findURLResource(resourceName); + if (resource != null) + return resource.getURL(); + + // Resource not found return null; } ! /** ! * If the URLStreamHandlerFactory has been set this return the appropriate ! * URLStreamHandler for the given protocol, if not set returns null. ! * ! * @param protocol the protocol for which we need a URLStreamHandler ! * @return the appropriate URLStreamHandler or null ! */ ! URLStreamHandler getURLStreamHandler(String protocol) { ! if (factory == null) ! return null; ! URLStreamHandler handler; ! synchronized (factoryCache) { ! // check if there're handler for the same protocol in cache ! HashMap cache = (HashMap)factoryCache.get(factory); ! handler = (URLStreamHandler)cache.get(protocol); ! if(handler == null) ! { ! // add it to cache ! handler = factory.createURLStreamHandler(protocol); ! cache.put(protocol, handler); ! } ! } ! return handler; ! } ! /** ! * Finds all the resources with a particular name from all the locations. ! * ! * @exception IOException when an error occurs accessing one of the ! * locations ! * @param resourceName the name of the resource to lookup ! * @return a (possible empty) enumeration of URLs where the resource can be ! * found ! */ ! public Enumeration findResources(String resourceName) throws IOException ! { ! Vector resources = new Vector(); ! int max = urls.size(); ! for (int i = 0; i < max; i++) ! { ! URLLoader loader = (URLLoader)urlinfos.elementAt(i); ! Resource resource = loader.getResource(resourceName); ! if (resource != null) ! resources.add(resource.getURL()); ! } ! return resources.elements(); ! } ! /** ! * Returns the permissions needed to access a particular code ! * source. These permissions includes those returned by ! * SecureClassLoader.getPermissions() and the actual ! * permissions to access the objects referenced by the URL of the ! * code source. The extra permissions added depend on the protocol ! * and file portion of the URL in the code source. If the URL has ! * the "file" protocol ends with a '/' character then it must be a ! * directory and a file Permission to read everything in that ! * directory and all subdirectories is added. If the URL had the ! * "file" protocol and doesn't end with a '/' character then it must ! * be a normal file and a file permission to read that file is ! * added. If the URL has any other protocol then a ! * socket permission to connect and accept connections from the host ! * portion of the URL is added. ! * ! * @param source The codesource that needs the permissions to be accessed ! * @return the collection of permissions needed to access the code resource ! * @see java.security.SecureClassLoader#getPermissions() ! */ ! protected PermissionCollection getPermissions(CodeSource source) ! { ! // XXX - This implementation does exactly as the Javadoc describes. ! // But maybe we should/could use URLConnection.getPermissions()? ! // First get the permissions that would normally be granted ! PermissionCollection permissions = super.getPermissions(source); ! ! // Now add the any extra permissions depending on the URL location ! URL url = source.getLocation(); ! String protocol = url.getProtocol(); ! if (protocol.equals("file")) ! { ! String file = url.getFile(); ! // If the file end in / it must be an directory ! if (file.endsWith("/") || file.endsWith(File.separator)) { ! // Grant permission to read everything in that directory and ! // all subdirectories ! permissions.add(new FilePermission(file + "-", "read")); ! } ! else ! { ! // It is a 'normal' file ! // Grant permission to access that file ! permissions.add(new FilePermission(file, "read")); } + } + else + { + // Grant permission to connect to and accept connections from host + String host = url.getHost(); + if (host != null) + permissions.add(new SocketPermission(host, "connect,accept")); + } ! return permissions; ! } ! ! /** ! * Returns all the locations that this class loader currently uses the ! * resolve classes and resource. This includes both the initially supplied ! * URLs as any URLs added later by the loader. ! * @return All the currently used URLs ! */ ! public URL[] getURLs() ! { ! return (URL[]) urls.toArray(new URL[urls.size()]); ! } ! ! /** ! * Creates a new instance of a URLClassLoader that gets ! * classes from the supplied URLs. This class loader ! * will have as parent the standard system class loader. ! * ! * @param urls the initial URLs used to resolve classes and ! * resources ! * ! * @exception SecurityException when the calling code does not have ! * permission to access the given URLs ! */ ! public static URLClassLoader newInstance(URL urls[]) ! throws SecurityException ! { ! return newInstance(urls, null); ! } ! ! /** ! * Creates a new instance of a URLClassLoader that gets ! * classes from the supplied URLs and with the supplied ! * loader as parent class loader. ! * ! * @param urls the initial URLs used to resolve classes and ! * resources ! * @param parent the parent class loader ! * ! * @exception SecurityException when the calling code does not have ! * permission to access the given URLs ! */ ! public static URLClassLoader newInstance(URL urls[], ! final ClassLoader parent) ! throws SecurityException ! { ! SecurityManager sm = System.getSecurityManager(); ! if (sm == null) ! return new URLClassLoader(urls, parent); ! else { ! final Object securityContext = sm.getSecurityContext(); ! // XXX - What to do with anything else then an AccessControlContext? ! if (!(securityContext instanceof AccessControlContext)) ! throw new SecurityException ! ("securityContext must be AccessControlContext: " ! + securityContext); ! ! URLClassLoader loader = ! (URLClassLoader)AccessController.doPrivileged(new PrivilegedAction() ! { ! public Object run() ! { ! return new URLClassLoader ! (parent, (AccessControlContext)securityContext); ! } ! }); ! loader.addURLs(urls); ! return loader; } } } diff -Nrc3pad gcc-3.2.3/libjava/java/net/URLConnection.java gcc-3.3/libjava/java/net/URLConnection.java *** gcc-3.2.3/libjava/java/net/URLConnection.java 2001-01-07 20:01:46.000000000 +0000 --- gcc-3.3/libjava/java/net/URLConnection.java 2002-10-10 05:19:22.000000000 +0000 *************** import java.text.SimpleDateFormat; *** 17,23 **** --- 17,26 ---- import java.util.Date; import java.util.Locale; import java.util.Hashtable; + import java.util.Map; import java.util.StringTokenizer; + import java.security.Permission; + import java.security.AllPermission; import gnu.gcj.io.MimeTypes; /** *************** import gnu.gcj.io.MimeTypes; *** 29,35 **** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: One guessContentTypeFrom... methods not implemented. ! * getContent method assumes content type from response; see comment there. */ public abstract class URLConnection --- 32,38 ---- * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: One guessContentTypeFrom... methods not implemented. ! * getContent method assumes content type from response; see comment there. */ public abstract class URLConnection *************** public abstract class URLConnection *** 51,56 **** --- 54,67 ---- private static SimpleDateFormat dateFormat1, dateFormat2, dateFormat3; private static boolean dateformats_initialized = false; + /** + * Creates a URL connection to a given URL. A real connection is not made. + * Use #connect to do this. + * + * @param url The Object to create the URL connection to + * + * @see URLConnection:connect + */ protected URLConnection(URL url) { this.url = url; *************** public abstract class URLConnection *** 58,112 **** useCaches = defaultUseCaches; } public abstract void connect() throws IOException; public URL getURL() { return url; } public int getContentLength() { return getHeaderFieldInt("content-length", -1); } public String getContentType() { return getHeaderField("content-type"); } public String getContentEncoding() { return getHeaderField("content-encoding"); } public long getExpiration() { return getHeaderFieldDate("expiration", 0L); } public long getDate() { return getHeaderFieldDate("date", 0L); } public long getLastModified() { return getHeaderFieldDate("last-modified", 0L); } ! public String getHeaderField(int n) { // Subclasses for specific protocols override this. return null; } public String getHeaderField(String name) { // Subclasses for specific protocols override this. return null; } public int getHeaderFieldInt(String name, int val) { String str = getHeaderField(name); --- 69,180 ---- useCaches = defaultUseCaches; } + /** + * Creates a real connection to the object references by the URL given + * to the constructor + * + * @exception IOException If an error occurs + */ public abstract void connect() throws IOException; + /** + * Returns ths URL to the object. + */ public URL getURL() { return url; } + /** + * Returns the value of the content-length header field + */ public int getContentLength() { return getHeaderFieldInt("content-length", -1); } + /** + * Returns the value of the content-type header field + */ public String getContentType() { return getHeaderField("content-type"); } + /** + * Returns the value of the content-encoding header field + */ public String getContentEncoding() { return getHeaderField("content-encoding"); } + /** + * Returns the value of the expires header field + */ public long getExpiration() { return getHeaderFieldDate("expiration", 0L); } + /** + * Returns the value of the date header field + */ public long getDate() { return getHeaderFieldDate("date", 0L); } + /** + * Returns the value of the last-modified header field + */ public long getLastModified() { return getHeaderFieldDate("last-modified", 0L); } ! /** ! * Returns the value of the n-th header field ! * ! * @param num The number of the header field ! */ ! public String getHeaderField(int num) { // Subclasses for specific protocols override this. return null; } + /** + * Returns the value of the header filed specified by name + * + * @param name The name of the header field + */ public String getHeaderField(String name) { // Subclasses for specific protocols override this. return null; } + /** + * Returns a map of all sent header fields + * + * @since 1.4 + */ + public Map getHeaderFields() + { + // Subclasses for specific protocols override this. + return null; + } + + /** + * Returns the value of the header filed name as int. + * + * @param name The name of the header field + * @param val The default value + * + * @return Returns the value of the header filed or the default value + * if the field is missing or malformed + */ public int getHeaderFieldInt(String name, int val) { String str = getHeaderField(name); *************** public abstract class URLConnection *** 122,127 **** --- 190,205 ---- return val; } + /** + * Returns the value of a header field parsed as date. The result is then + * number of milliseconds since January 1st, 1970 GMT. + * + * @param name The name of the header field + * @param val The dafault date + * + * @return Returns the date value of the header filed or the default value + * if the field is missing or malformed + */ public long getHeaderFieldDate(String name, long val) { if (! dateformats_initialized) *************** public abstract class URLConnection *** 140,151 **** return val; } ! public String getHeaderFieldKey(int n) { // Subclasses for specific protocols override this. return null; } public Object getContent() throws IOException { // FIXME: Doc indicates that other criteria should be applied as --- 218,241 ---- return val; } ! /** ! * Returns the key of the n-th header field ! * ! * @param num The number of the header field ! */ ! public String getHeaderFieldKey(int num) { // Subclasses for specific protocols override this. return null; } + /** + * Retrieves the content of this URLConnection + * + * @exception IOException If an error occurs + * @exception UnknownServiceException If the protocol does not support the + * content type + */ public Object getContent() throws IOException { // FIXME: Doc indicates that other criteria should be applied as *************** public abstract class URLConnection *** 160,171 **** return contentHandler.getContent(this); } ! // TODO12: public Permission getPermission() throws IOException ! // { ! // // Subclasses may override this. ! // return java.security.AllPermission; ! // } public InputStream getInputStream() throws IOException { // Subclasses for specific protocols override this. --- 250,288 ---- return contentHandler.getContent(this); } ! /** ! * Retrieves the content of this URLConnection ! * ! * @exception IOException If an error occurs ! * @exception UnknownServiceException If the protocol does not support the ! * content type ! */ ! public Object getContent(Class[] classes) throws IOException ! { ! // FIXME: implement this ! return getContent (); ! } + /** + * Returns a permission object representing the permission necessary to make + * the connection represented by this object. This method returns null if no + * permission is required to make the connection. + * + * @exception IOException If the computation of the permission requires + * network or file I/O and an exception occurs while computing it + */ + public Permission getPermission() throws IOException + { + // Subclasses may override this. + return new java.security.AllPermission(); + } + + /** + * Returns the input stream of the URL connection + * + * @exception IOException If an error occurs + * @exception UnknownServiceException If the protocol does not support input + */ public InputStream getInputStream() throws IOException { // Subclasses for specific protocols override this. *************** public abstract class URLConnection *** 173,178 **** --- 290,301 ---- " does not support input."); } + /** + * Returns the output stream of the URL connection + * + * @exception IOException If an error occurs + * @exception UnknownServiceException If the protocol does not support output + */ public OutputStream getOutputStream() throws IOException { // Subclasses for specific protocols override this. *************** public abstract class URLConnection *** 180,301 **** " does not support output."); } public String toString() { return this.getClass().getName() + ":" + url.toString(); } public void setDoInput(boolean doinput) { if (connected) ! throw new IllegalAccessError("Already connected"); doInput = doinput; } public boolean getDoInput() { return doInput; } public void setDoOutput(boolean dooutput) { if (connected) ! throw new IllegalAccessError("Already connected"); doOutput = dooutput; } public boolean getDoOutput() { return doOutput; } ! public void setAllowUserInteraction(boolean allowuserinteraction) { if (connected) ! throw new IllegalAccessError("Already connected"); ! allowUserInteraction = allowuserinteraction; } public boolean getAllowUserInteraction() { return allowUserInteraction; } ! public static void ! setDefaultAllowUserInteraction(boolean defaultallowuserinteraction) { ! defaultAllowUserInteraction = defaultallowuserinteraction; } public static boolean getDefaultAllowUserInteraction() { return defaultAllowUserInteraction; } public void setUseCaches(boolean usecaches) { if (connected) ! throw new IllegalAccessError("Already connected"); useCaches = usecaches; } public boolean getUseCaches() { return useCaches; } public void setIfModifiedSince(long ifmodifiedsince) { if (connected) ! throw new IllegalAccessError("Already connected"); ifModifiedSince = ifmodifiedsince; } public long getIfModifiedSince() { return ifModifiedSince; } public boolean getDefaultUseCaches() { return defaultUseCaches; } public void setDefaultUseCaches(boolean defaultusecaches) { defaultUseCaches = defaultusecaches; } public void setRequestProperty(String key, String value) { // Do nothing unless overridden by subclasses that support setting // header fields in the request. } public String getRequestProperty(String key) { // Overridden by subclasses that support reading header fields from the // request. return null; } public static void setDefaultRequestProperty(String key, String value) { // Do nothing unless overridden by subclasses that support setting // default request properties. } public static String getDefaultRequestProperty(String key) { // Overridden by subclasses that support default request properties. return null; } public static void setContentHandlerFactory(ContentHandlerFactory fac) { if (factory != null) --- 303,593 ---- " does not support output."); } + /** + * Returns a string representation of the URL connection object + */ public String toString() { return this.getClass().getName() + ":" + url.toString(); } + /** + * Sets tha value of the doInput field. + * + * @param doinput The new value of the doInput field + * + * @exception IllegalStateException If already connected + */ public void setDoInput(boolean doinput) { if (connected) ! throw new IllegalStateException ("Already connected"); doInput = doinput; } + /** + * Returns the current value of the doInput field + */ public boolean getDoInput() { return doInput; } + /** + * Sets the value of the doOutput field + * + * @param dooutput The new value of the doOutput field + * + * @exception IllegalStateException If already connected + */ public void setDoOutput(boolean dooutput) { if (connected) ! throw new IllegalStateException ("Already connected"); doOutput = dooutput; } + /** + * Returns the current value of the doOutput field + */ public boolean getDoOutput() { return doOutput; } ! /** ! * Sets a new value to the allowUserInteraction field ! * ! * @param allowed The new value ! * ! * @exception IllegalStateException If already connected ! */ ! public void setAllowUserInteraction(boolean allowed) { if (connected) ! throw new IllegalStateException ("Already connected"); ! allowUserInteraction = allowed; } + /** + * Returns the current value of the allowUserInteraction field + */ public boolean getAllowUserInteraction() { return allowUserInteraction; } ! /** ! * Sets the default value if the allowUserInteraction field ! * ! * @param allowed The new default value ! */ ! public static void setDefaultAllowUserInteraction(boolean allowed) { ! defaultAllowUserInteraction = allowed; } + /** + * Returns the default value of the allowUserInteraction field + */ public static boolean getDefaultAllowUserInteraction() { return defaultAllowUserInteraction; } + /** + * Sets a new value to the useCaches field + * + * @param usecaches The new value + * + * @exception IllegalStateException If already connected + */ public void setUseCaches(boolean usecaches) { if (connected) ! throw new IllegalStateException ("Already connected"); useCaches = usecaches; } + /** + * The current value of the useCaches field + */ public boolean getUseCaches() { return useCaches; } + /** + * Sets the value of the ifModifiedSince field + * + * @param ifmodifiedsince The new value in milliseconds + * since January 1, 1970 GMT + * + * @exception IllegalStateException If already connected + */ public void setIfModifiedSince(long ifmodifiedsince) { if (connected) ! throw new IllegalStateException ("Already connected"); ifModifiedSince = ifmodifiedsince; } + /** + * Returns the current value of the ifModifiedSince field + */ public long getIfModifiedSince() { return ifModifiedSince; } + /** + * Returns the default value of the useCaches field + */ public boolean getDefaultUseCaches() { return defaultUseCaches; } + /** + * Sets the default value of the useCaches field + * + * @param defaultusecaches The new default value + */ public void setDefaultUseCaches(boolean defaultusecaches) { defaultUseCaches = defaultusecaches; } + /** + * Sets a property specified by key to value. + * + * @param key Key of the property to set + * @param value Value of the Property to set + * + * @exception IllegalStateException If already connected + * @exception NullPointerException If key is null + * + * @see URLConnection:getRequestProperty(String key) + * @see URLConnection:addRequestProperty(String key, String value) + */ public void setRequestProperty(String key, String value) { + if (connected) + throw new IllegalStateException ("Already connected"); + // Do nothing unless overridden by subclasses that support setting // header fields in the request. } + /** + * Sets a property specified by key to value. If the property key already + * is assigned to a value it does nothing. + * + * @param key Key of the property to add + * @param value Value of the Property to add + * + * @exception IllegalStateException If already connected + * @exception NullPointerException If key is null + * + * @see URLConnection:getRequestProperty(String key) + * @see URLConnection:setRequestProperty(String key, String value) + * + * @since 1.4 + */ + public void addRequestProperty(String key, String value) + { + if (connected) + throw new IllegalStateException ("Already connected"); + + if (getRequestProperty (key) == null) + { + setRequestProperty (key, value); + } + } + + /** + * Returns a property value specified by key. + * + * @param key Key of the property to return + * + * @exception IllegalStateException If already connected + * + * @see URLConnection:setRequestProperty(String key, String value) + * @see URLConnection:addRequestProperty(String key, String value) + * + * @return Value of the property. + */ public String getRequestProperty(String key) { + if (connected) + throw new IllegalStateException ("Already connected"); + + // Overridden by subclasses that support reading header fields from the + // request. + return null; + } + + /** + * Returns a map that contains all properties of the request + * + * @exception IllegalStateException If already connected + * + * @return The map of properties + */ + public Map getRequestProperties() + { // Overridden by subclasses that support reading header fields from the // request. return null; } + /** + * Defines a default request property + * + * @param key The key of the property + * @param value The value of the property + * + * @deprecated 1.3 The method setRequestProperty should be used instead + * + * @see URLConnection:setRequestProperty + */ public static void setDefaultRequestProperty(String key, String value) { // Do nothing unless overridden by subclasses that support setting // default request properties. } + /** + * Returns the value of a default request property + * + * @param key The key of the default property + * + * @return The value of the default property or null if not available + * + * @deprecated 1.3 The method getRequestProperty should be used instead + * + * @see URLConnection:getRequestProperty + */ public static String getDefaultRequestProperty(String key) { // Overridden by subclasses that support default request properties. return null; } + /** + * Sets a ContentHandlerFactory + * + * @param fac The ContentHandlerFactory + * + * @exception Error If the factory has already been defined + * @exception SecurityException If a security manager exists and its + * checkSetFactory method doesn't allow the operation + */ public static void setContentHandlerFactory(ContentHandlerFactory fac) { if (factory != null) *************** public abstract class URLConnection *** 309,315 **** factory = fac; } ! protected static String guessContentTypeFromName(String fname) { int dot = fname.lastIndexOf ("."); --- 601,615 ---- factory = fac; } ! /** ! * Tries to determine the content type of an object, based on the ! * specified file name ! * ! * @param fname The filename to guess the content type from ! * ! * @specnote public since JDK 1.4 ! */ ! public static String guessContentTypeFromName(String fname) { int dot = fname.lastIndexOf ("."); *************** public abstract class URLConnection *** 329,348 **** return(type); } ! // TODO: public static String guessContentTypeFromStream(InputStream is) ! // throws IOException ! // { ! // } ! ! // TODO12: protected void parseURL(URL u, String spec, int start, int limit) ! // JDK1.2 public static FileNameMap getFileNameMap() { return fileNameMap; } ! // JDK1.2 public static void setFileNameMap(FileNameMap map) { // Throw an exception if an extant security mgr precludes --- 629,671 ---- return(type); } ! /** ! * Tries to guess the content type of an object, based on the characters ! * at the beginning of then input stream ! * ! * @param is The input stream to guess from ! * ! * @exception IOException If an error occurs ! */ ! public static String guessContentTypeFromStream(InputStream is) ! throws IOException ! { ! is.mark(1024); ! // FIXME: Implement this. Use system mimetype informations (like "file"). ! is.reset(); ! return null; ! } ! /** ! * Returns a filename map (a mimetable) ! * ! * @since 1.2 ! */ public static FileNameMap getFileNameMap() { return fileNameMap; } ! /** ! * Sets a FileNameMap ! * ! * @param map The new FileNameMap ! * ! * @exception SecurityException If a security manager exists and its ! * checkSetFactory method doesn't allow the operation ! * ! * @since 1.2 ! */ public static void setFileNameMap(FileNameMap map) { // Throw an exception if an extant security mgr precludes diff -Nrc3pad gcc-3.2.3/libjava/java/net/URLDecoder.java gcc-3.3/libjava/java/net/URLDecoder.java *** gcc-3.2.3/libjava/java/net/URLDecoder.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/URLDecoder.java 2003-02-12 22:44:39.000000000 +0000 *************** package java.net; *** 39,113 **** import java.io.UnsupportedEncodingException; ! /** ! * This utility class contains static methods that converts a ! * string encoded in the x-www-form-urlencoded format to the original ! * text. The x-www-form-urlencoded format replaces certain disallowed ! * characters with encoded equivalents. All upper case and lower case ! * letters in the US alphabet remain as is, the space character (' ') ! * is replaced with '+' sign, and all other characters are converted to a ! * "%XX" format where XX is the hexadecimal representation of that character ! * in a given character encoding (default is "UTF-8"). ! *

        ! * This method is very useful for decoding strings sent to CGI scripts ! * ! * Written using on-line Java Platform 1.2/1.4 API Specification. ! * Status: Believed complete and correct. ! * ! * @since 1.2 ! * ! * @author Warren Levy ! * @author Aaron M. Renn (arenn@urbanophile.com) (documentation comments) ! * @author Mark Wielaard (mark@klomp.org) ! */ public class URLDecoder { ! /** ! * This method translates the passed in string from x-www-form-urlencoded ! * format using the default encoding "UTF-8" to decode the hex encoded ! * unsafe characters. ! * ! * @param s the String to convert ! * ! * @return the converted String ! */ public static String decode(String s) { try { ! return decode(s, "UTF-8"); } catch (UnsupportedEncodingException uee) { ! // Should never happen since UTF-8 encoding should always be supported ! return s; } } ! /** ! * This method translates the passed in string from x-www-form-urlencoded ! * format using the given character encoding to decode the hex encoded ! * unsafe characters. ! *

        ! * This implementation will decode the string even if it contains ! * unsafe characters (characters that should have been encoded) or if the ! * two characters following a % do not represent a hex encoded byte. ! * In those cases the unsafe character or the % character will be added ! * verbatim to the decoded result. ! * ! * @param s the String to convert ! * @param encoding the character encoding to use the decode the hex encoded ! * unsafe characters ! * ! * @return the converted String ! * ! * @since 1.4 ! */ public static String decode(String s, String encoding) throws UnsupportedEncodingException { - StringBuffer result = new StringBuffer(); - // First convert all '+' characters to spaces. String str = s.replace('+', ' '); --- 39,121 ---- import java.io.UnsupportedEncodingException; ! /** ! * This utility class contains static methods that converts a ! * string encoded in the x-www-form-urlencoded format to the original ! * text. The x-www-form-urlencoded format replaces certain disallowed ! * characters with encoded equivalents. All upper case and lower case ! * letters in the US alphabet remain as is, the space character (' ') ! * is replaced with '+' sign, and all other characters are converted to a ! * "%XX" format where XX is the hexadecimal representation of that character ! * in a given character encoding (default is "UTF-8"). ! *

        ! * This method is very useful for decoding strings sent to CGI scripts ! * ! * Written using on-line Java Platform 1.2/1.4 API Specification. ! * Status: Believed complete and correct. ! * ! * @since 1.2 ! * ! * @author Warren Levy ! * @author Aaron M. Renn (arenn@urbanophile.com) (documentation comments) ! * @author Mark Wielaard (mark@klomp.org) ! */ public class URLDecoder { ! /** ! * Public contructor. Note that this class has only static methods. ! */ ! public URLDecoder () ! { ! } ! ! /** ! * This method translates the passed in string from x-www-form-urlencoded ! * format using the default encoding "UTF-8" to decode the hex encoded ! * unsafe characters. ! * ! * @param s the String to convert ! * ! * @return the converted String ! */ public static String decode(String s) { try { ! return decode(s, "UTF-8"); } catch (UnsupportedEncodingException uee) { ! // Should never happen since UTF-8 encoding should always be supported ! return s; } } ! /** ! * This method translates the passed in string from x-www-form-urlencoded ! * format using the given character encoding to decode the hex encoded ! * unsafe characters. ! * ! * This implementation will decode the string even if it contains ! * unsafe characters (characters that should have been encoded) or if the ! * two characters following a % do not represent a hex encoded byte. ! * In those cases the unsafe character or the % character will be added ! * verbatim to the decoded result. ! * ! * @param s the String to convert ! * @param encoding the character encoding to use the decode the hex encoded ! * unsafe characters ! * ! * @return the converted String ! * ! * @exception UnsupportedEncodingException If the named encoding is not ! * supported ! * ! * @since 1.4 ! */ public static String decode(String s, String encoding) throws UnsupportedEncodingException { // First convert all '+' characters to spaces. String str = s.replace('+', ' '); *************** public class URLDecoder *** 116,121 **** --- 124,130 ---- int start = 0; byte[] bytes = null; int length = str.length(); + StringBuffer result = new StringBuffer(length); while ((i = str.indexOf('%', start)) >= 0) { // Add all non-encoded characters to the result buffer diff -Nrc3pad gcc-3.2.3/libjava/java/net/URLEncoder.java gcc-3.3/libjava/java/net/URLEncoder.java *** gcc-3.2.3/libjava/java/net/URLEncoder.java 2002-01-22 22:40:23.000000000 +0000 --- gcc-3.3/libjava/java/net/URLEncoder.java 2002-11-03 20:27:31.000000000 +0000 *************** *** 1,5 **** /* URLEncoder.java -- Class to convert strings to a properly encoded URL ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* URLEncoder.java -- Class to convert strings to a properly encoded URL ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.net; *** 39,45 **** import java.io.UnsupportedEncodingException; ! /** * Written using on-line Java Platform 1.2/1.4 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. --- 39,45 ---- import java.io.UnsupportedEncodingException; ! /* * Written using on-line Java Platform 1.2/1.4 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. *************** public class URLEncoder *** 94,109 **** * * @return The converted String * * @since 1.4 */ public static String encode(String s, String encoding) throws UnsupportedEncodingException { - StringBuffer result = new StringBuffer(); int length = s.length(); int start = 0; int i = 0; while (true) { while ( i < length && isSafe(s.charAt(i)) ) --- 94,112 ---- * * @return The converted String * + * @exception UnsupportedEncodingException If the named encoding is not + * supported + * * @since 1.4 */ public static String encode(String s, String encoding) throws UnsupportedEncodingException { int length = s.length(); int start = 0; int i = 0; + StringBuffer result = new StringBuffer(length); while (true) { while ( i < length && isSafe(s.charAt(i)) ) diff -Nrc3pad gcc-3.2.3/libjava/java/net/URL.java gcc-3.3/libjava/java/net/URL.java *** gcc-3.2.3/libjava/java/net/URL.java 2002-02-23 00:15:48.000000000 +0000 --- gcc-3.3/libjava/java/net/URL.java 2002-11-22 16:48:52.000000000 +0000 *************** *** 1,86 **** ! // URL.java - A Uniform Resource Locator. ! /* Copyright (C) 1999, 2000, 2002 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package java.net; ! import java.io.*; import java.util.Hashtable; import java.util.StringTokenizer; - /** - * @author Warren Levy - * @date March 4, 1999. - */ ! /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ public final class URL implements Serializable { private String protocol; private String host; private int port = -1; // Initialize for constructor using context. private String file; private String ref; private int hashCode = 0; transient private URLStreamHandler handler; private static Hashtable handlers = new Hashtable(); private static URLStreamHandlerFactory factory; private static final long serialVersionUID = -7627629688361524110L; public URL(String protocol, String host, int port, String file) throws MalformedURLException { this(protocol, host, port, file, null); } public URL(String protocol, String host, String file) throws MalformedURLException { this(protocol, host, -1, file, null); } ! // JDK1.2 public URL(String protocol, String host, int port, String file, URLStreamHandler handler) throws MalformedURLException { if (protocol == null) throw new MalformedURLException("null protocol"); ! this.protocol = protocol; if (handler != null) { ! // TODO12: Need SecurityManager.checkPermission and ! // TODO12: java.net.NetPermission from JDK 1.2 to be implemented. ! // Throw an exception if an extant security mgr precludes ! // specifying a StreamHandler. ! // ! // SecurityManager s = System.getSecurityManager(); ! // if (s != null) ! // s.checkPermission(NetPermission("specifyStreamHandler")); this.handler = handler; } else ! this.handler = setURLStreamHandler(protocol); if (this.handler == null) ! throw new MalformedURLException("Protocol handler not found: " + protocol); this.host = host; - this.port = port; int hashAt = file.indexOf('#'); if (hashAt < 0) --- 1,252 ---- ! /* URL.java -- Uniform Resource Locator Class ! Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.net; ! import java.io.InputStream; ! import java.io.IOException; ! import java.io.Serializable; ! import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; import java.util.Hashtable; import java.util.StringTokenizer; ! /* * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ + /** + * This final class represents an Internet Uniform Resource Locator (URL). + * For details on the syntax of URL's and what they can be used for, + * refer to RFC 1738, available from http://ds.internic.net/rfcs/rfc1738.txt + *

        + * There are a great many protocols supported by URL's such as "http", + * "ftp", and "file". This object can handle any arbitrary URL for which + * a URLStreamHandler object can be written. Default protocol handlers + * are provided for the "http" and "ftp" protocols. Additional protocols + * handler implementations may be provided in the future. In any case, + * an application or applet can install its own protocol handlers that + * can be "chained" with other protocol hanlders in the system to extend + * the base functionality provided with this class. (Note, however, that + * unsigned applets cannot access properties by default or install their + * own protocol handlers). + *

        + * This chaining is done via the system property java.protocol.handler.pkgs + * If this property is set, it is assumed to be a "|" separated list of + * package names in which to attempt locating protocol handlers. The + * protocol handler is searched for by appending the string + * "..Handler" to each packed in the list until a hander is found. + * If a protocol handler is not found in this list of packages, or if the + * property does not exist, then the default protocol handler of + * "gnu.java.net..Handler" is tried. If this is + * unsuccessful, a MalformedURLException is thrown. + *

        + * All of the constructor methods of URL attempt to load a protocol + * handler and so any needed protocol handlers must be installed when + * the URL is constructed. + *

        + * Here is an example of how URL searches for protocol handlers. Assume + * the value of java.protocol.handler.pkgs is "com.foo|com.bar" and the + * URL is "news://comp.lang.java.programmer". URL would looking the + * following places for protocol handlers: + *

        +   * com.foo.news.Handler
        +   * com.bar.news.Handler
        +   * gnu.java.net.news.Handler
        +   * 

        + * If the protocol handler is not found in any of those locations, a + * MalformedURLException would be thrown. + *

        + * Please note that a protocol handler must be a subclass of + * URLStreamHandler. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * + * @see URLStreamHandler + */ public final class URL implements Serializable { + /** + * The name of the protocol for this URL. + * The protocol is always stored in lower case. + */ private String protocol; + + /** + * The "authority" portion of the URL. + */ + private String authority; + + /** + * The hostname or IP address of this protocol. + * This includes a possible user. For example joe@some.host.net. + */ private String host; + + /** + * The port number of this protocol or -1 if the port number used is + * the default for this protocol. + */ private int port = -1; // Initialize for constructor using context. + + /** + * The "file" portion of the URL. It is defined as path[?query]. + */ private String file; + + /** + * The anchor portion of the URL. + */ private String ref; + + /** + * This is the hashCode for this URL + */ private int hashCode = 0; + + /** + * The protocol handler in use for this URL + */ transient private URLStreamHandler handler; + + /** + * This a table where we cache protocol handlers to avoid the overhead + * of looking them up each time. + */ private static Hashtable handlers = new Hashtable(); + + /** + * If an application installs its own protocol handler factory, this is + * where we keep track of it. + */ private static URLStreamHandlerFactory factory; private static final long serialVersionUID = -7627629688361524110L; + /** + * Constructs a URL and loads a protocol handler for the values passed as + * arguments. + * + * @param protocol The protocol for this URL ("http", "ftp", etc) + * @param host The hostname or IP address to connect to + * @param port The port number to use, or -1 to use the protocol's + * default port + * @param file The "file" portion of the URL. + * + * @exception MalformedURLException If a protocol handler cannot be loaded or + * a parse error occurs. + */ public URL(String protocol, String host, int port, String file) throws MalformedURLException { this(protocol, host, port, file, null); } + /** + * Constructs a URL and loads a protocol handler for the values passed in + * as arugments. Uses the default port for the protocol. + * + * @param protocol The protocol for this URL ("http", "ftp", etc) + * @param host The hostname or IP address for this URL + * @param file The "file" portion of this URL. + * + * @exception MalformedURLException If a protocol handler cannot be loaded or + * a parse error occurs. + */ public URL(String protocol, String host, String file) throws MalformedURLException { this(protocol, host, -1, file, null); } ! ! /** ! * This method initializes a new instance of URL with the ! * specified protocol, host, port, and file. Additionally, this method ! * allows the caller to specify a protocol handler to use instead of ! * the default. If this handler is specified, the caller must have ! * the "specifyStreamHandler" permission (see NetPermission) ! * or a SecurityException will be thrown. ! * ! * @param protocol The protocol for this URL ("http", "ftp", etc) ! * @param host The hostname or IP address to connect to ! * @param port The port number to use, or -1 to use the protocol's default ! * port ! * @param file The "file" portion of the URL. ! * @param handler The protocol handler to use with this URL. ! * ! * @exception MalformedURLException If no protocol handler can be loaded ! * for the specified protocol. ! * @exception SecurityException If the SecurityManager exists ! * and does not allow the caller to specify its own protocol handler. ! * ! * @since 1.2 ! */ public URL(String protocol, String host, int port, String file, URLStreamHandler handler) throws MalformedURLException { if (protocol == null) throw new MalformedURLException("null protocol"); ! this.protocol = protocol.toLowerCase(); if (handler != null) { ! SecurityManager s = System.getSecurityManager(); ! if (s != null) ! s.checkPermission (new NetPermission ("specifyStreamHandler")); this.handler = handler; } else ! this.handler = getURLStreamHandler(protocol); if (this.handler == null) ! throw new MalformedURLException ( ! "Protocol handler not found: " + protocol); this.host = host; this.port = port; + this.authority = null; int hashAt = file.indexOf('#'); if (hashAt < 0) *************** public final class URL implements Serial *** 96,112 **** hashCode = hashCode(); // Used for serialization. } public URL(String spec) throws MalformedURLException { this((URL) null, spec, (URLStreamHandler) null); } public URL(URL context, String spec) throws MalformedURLException { this(context, spec, (URLStreamHandler) null); } ! // JDK1.2 public URL(URL context, String spec, URLStreamHandler handler) throws MalformedURLException { --- 262,333 ---- hashCode = hashCode(); // Used for serialization. } + /** + * Initializes a URL from a complete string specification such as + * "http://www.urbanophile.com/arenn/". First the protocol name is parsed + * out of the string. Then a handler is located for that protocol and + * the parseURL() method of that protocol handler is used to parse the + * remaining fields. + * + * @param spec The complete String representation of a URL + * + * @exception MalformedURLException If a protocol handler cannot be found + * or the URL cannot be parsed + */ public URL(String spec) throws MalformedURLException { this((URL) null, spec, (URLStreamHandler) null); } + /* + * This method parses a String representation of a URL within the + * context of an existing URL. Principally this means that any + * fields not present the URL are inheritied from the context URL. + * This allows relative URL's to be easily constructed. If the + * context argument is null, then a complete URL must be specified + * in the URL string. If the protocol parsed out of the URL is + * different from the context URL's protocol, then then URL String + * is also expected to be a complete URL. + * + * @param context The context on which to parse the specification + * @param spec The string to parse an URL + * + * @exception MalformedURLException If a protocol handler cannot be found + * for the URL cannot be parsed + */ public URL(URL context, String spec) throws MalformedURLException { this(context, spec, (URLStreamHandler) null); } ! /** ! * Creates an URL from given arguments ! * This method parses a String representation of a URL within the ! * context of an existing URL. Principally this means that any fields ! * not present the URL are inheritied from the context URL. This allows ! * relative URL's to be easily constructed. If the context argument is ! * null, then a complete URL must be specified in the URL string. ! * If the protocol parsed out of the URL is different ! * from the context URL's protocol, then then URL String is also ! * expected to be a complete URL. ! *

        ! * Additionally, this method allows the caller to specify a protocol handler ! * to use instead of the default. If this handler is specified, the caller ! * must have the "specifyStreamHandler" permission ! * (see NetPermission) or a SecurityException ! * will be thrown. ! * ! * @param context The context in which to parse the specification ! * @param spec The string to parse as an URL ! * @param handler The stream handler for the URL ! * ! * @exception MalformedURLException If a protocol handler cannot be found ! * or the URL cannot be parsed ! * @exception SecurityException If the SecurityManager exists ! * and does not allow the caller to specify its own protocol handler. ! * ! * @since 1.2 ! */ public URL(URL context, String spec, URLStreamHandler handler) throws MalformedURLException { *************** public final class URL implements Serial *** 135,147 **** (colon < (slash = spec.indexOf('/')) || slash < 0)) { // Protocol specified in spec string. ! protocol = spec.substring(0, colon); if (context != null && context.protocol.equals(protocol)) { // The 1.2 doc specifically says these are copied to the new URL. host = context.host; port = context.port; file = context.file; } } else if (context != null) --- 356,369 ---- (colon < (slash = spec.indexOf('/')) || slash < 0)) { // Protocol specified in spec string. ! protocol = spec.substring(0, colon).toLowerCase(); if (context != null && context.protocol.equals(protocol)) { // The 1.2 doc specifically says these are copied to the new URL. host = context.host; port = context.port; file = context.file; + authority = context.authority; } } else if (context != null) *************** public final class URL implements Serial *** 153,158 **** --- 375,381 ---- host = context.host; port = context.port; file = context.file; + authority = context.authority; } else // Protocol NOT specified in spec. and no context available. throw new *************** public final class URL implements Serial *** 160,181 **** if (handler != null) { ! // TODO12: Need SecurityManager.checkPermission and ! // TODO12: java.net.NetPermission from JDK 1.2 to be implemented. ! // Throw an exception if an extant security mgr precludes ! // specifying a StreamHandler. ! // ! // SecurityManager s = System.getSecurityManager(); ! // if (s != null) ! // s.checkPermission(NetPermission("specifyStreamHandler")); this.handler = handler; } else ! this.handler = setURLStreamHandler(protocol); if (this.handler == null) ! throw new MalformedURLException("Protocol handler not found: " + protocol); // JDK 1.2 doc for parseURL specifically states that any '#' ref // is to be excluded by passing the 'limit' as the indexOf the '#' --- 383,400 ---- if (handler != null) { ! SecurityManager s = System.getSecurityManager (); ! if (s != null) ! s.checkPermission (new NetPermission ("specifyStreamHandler")); this.handler = handler; } else ! this.handler = getURLStreamHandler(protocol); if (this.handler == null) ! throw new MalformedURLException("Protocol handler not found: " ! + protocol); // JDK 1.2 doc for parseURL specifically states that any '#' ref // is to be excluded by passing the 'limit' as the indexOf the '#' *************** public final class URL implements Serial *** 189,288 **** hashCode = hashCode(); // Used for serialization. } public boolean equals(Object obj) { if (obj == null || ! (obj instanceof URL)) return false; URL uObj = (URL) obj; ! ! // This comparison is very conservative. It assumes that any ! // field can be null. ! return (port == uObj.port ! && ((protocol == null && uObj.protocol == null) ! || (protocol != null && protocol.equals(uObj.protocol))) ! && ((host == null && uObj.host == null) ! || (host != null && host.equals(uObj.host))) ! && ((file == null && uObj.file == null) ! || (file != null && file.equals(uObj.file))) ! && ((ref == null && uObj.ref == null) ! || (ref != null && ref.equals(uObj.ref)))); } public final Object getContent() throws IOException { return openConnection().getContent(); } public String getFile() { ! return file; } public String getPath() { int quest = file.indexOf('?'); return quest < 0 ? file : file.substring(0, quest); } public String getHost() { ! return host; } public int getPort() { return port; } public String getProtocol() { return protocol; } public String getRef() { return ref; } ! public int hashCode() { ! // JCL book says this is computed using (only) the hashcodes of the ! // protocol, host and file fields. Empirical evidence indicates this ! // is probably XOR in JDK 1.1. In JDK 1.2 it seems to be a sum including ! // the port. ! // ! // JDK 1.2 online doc infers that host could be null because it ! // explicitly states that file cannot be null but is silent on host. ! // A simple example with protocol "http" (hashcode 3213448), host null, ! // file "/" (hashcode 47) produced a hashcode (3213494) which appeared ! // to be the sum of the two hashcodes plus the port. Another example ! // using "/index.html" for file bore this out; as well as "#" for file ! // (which was reduced to "" with a hashcode of zero). A "" host also ! // causes the port number and the two hashcodes to be summed. if (hashCode != 0) return hashCode; // Use cached value if available. else ! return (protocol.hashCode() + ((host == null) ? 0 : host.hashCode()) + ! port + file.hashCode()); } public URLConnection openConnection() throws IOException { return handler.openConnection(this); } public final InputStream openStream() throws IOException { return openConnection().getInputStream(); } public boolean sameFile(URL other) { return handler.sameFile(this, other); } protected void set(String protocol, String host, int port, String file, String ref) { --- 408,627 ---- hashCode = hashCode(); // Used for serialization. } + /** + * Test another URL for equality with this one. This will be true only if + * the argument is non-null and all of the fields in the URL's match + * exactly (ie, protocol, host, port, file, and ref). Overrides + * Object.equals(), implemented by calling the equals method of the handler. + * + * @param url The URL to compare with + * + * @return true if the URL is equal, false otherwise + */ public boolean equals(Object obj) { if (obj == null || ! (obj instanceof URL)) return false; URL uObj = (URL) obj; ! ! return handler.equals (this, uObj); } + /** + * Returns the contents of this URL as an object by first opening a + * connection, then calling the getContent() method against the connection + * + * @return A content object for this URL + * @exception IOException If opening the connection or getting the + * content fails. + * + * @since 1.3 + */ public final Object getContent() throws IOException { return openConnection().getContent(); } + /** + * Gets the contents of this URL + * + * @exception IOException If an error occurs + */ + public final Object getContent (Class[] classes) throws IOException + { + // FIXME: implement this + return getContent(); + } + + /** + * Returns the file portion of the URL. + * Defined as path[?query]. + * Returns the empty string if there is no file portion. + */ public String getFile() { ! return file == null ? "" : file; } + /** + * Returns the path of the URL. This is the part of the file before any '?' + * character. + * + * @since 1.3 + */ public String getPath() { int quest = file.indexOf('?'); return quest < 0 ? file : file.substring(0, quest); } + /** + * Returns the authority of the URL + * + * @since 1.3 + */ + public String getAuthority() + { + return authority; + } + + /** + * Returns the host of the URL + */ public String getHost() { ! int at = (host == null) ? -1 : host.indexOf('@'); ! return at < 0 ? host : host.substring(at + 1, host.length()); } + /** + * Returns the port number of this URL or -1 if the default port number is + * being used. + * + * @return The port number + * + * @see #getDefaultPort() + */ public int getPort() { return port; } + /** + * Returns the default port of the URL. If the StreamHandler for the URL + * protocol does not define a default port it returns -1. + */ + public int getDefaultPort() + { + return handler.getDefaultPort(); + } + + /** + * Returns the protocol of the URL + */ public String getProtocol() { return protocol; } + /** + * Returns the ref (sometimes called the "# reference" or "anchor") portion + * of the URL. + * + * @return The ref + */ public String getRef() { return ref; } ! /** ! * Returns the user information of the URL. This is the part of the host ! * name before the '@'. ! * ! * @return the user at a particular host or null when no user defined. ! */ ! public String getUserInfo () { ! int at = host.indexOf('@'); ! return at < 0 ? null : host.substring(0, at); ! } ! ! /** ! * Returns the query of the URL. This is the part of the file before the ! * '?'. ! * ! * @ return the query part of the file, or null when there is no query part. ! */ ! public String getQuery () ! { ! int quest = file.indexOf('?'); ! return quest < 0 ? null : file.substring(quest + 1, file.length()); ! } + /** + * Returns a hashcode computed by the URLStreamHandler of this URL + */ + public int hashCode() + { if (hashCode != 0) return hashCode; // Use cached value if available. else ! return handler.hashCode (this); } + /** + * Returns a URLConnection object that represents a connection to the remote + * object referred to by the URL. The URLConnection is created by calling the + * openConnection() method of the protocol handler + * + * @return A URLConnection for this URL + * @exception IOException If an error occurs + */ public URLConnection openConnection() throws IOException { return handler.openConnection(this); } + /** + * Opens a connection to this URL and returns an InputStream for reading + * from that connection + * + * @exception IOException If an error occurs + */ public final InputStream openStream() throws IOException { return openConnection().getInputStream(); } + /** + * Tests whether or not another URL refers to the same "file" as this one. + * This will be true if and only if the passed object is not null, is a + * URL, and matches all fields but the ref (ie, protocol, host, port, + * and file); + * + * @param url The URL object to test with + * + * @return true if URL matches this URL's file, false otherwise + */ public boolean sameFile(URL other) { return handler.sameFile(this, other); } + /** + * Sets the specified fields of the URL. This is not a public method so + * that only URLStreamHandlers can modify URL fields. This might be called + * by the parseURL() method in that class. URLs are otherwise + * constant. + * + * @param protocol The protocol name for this URL + * @param host The hostname or IP address for this URL + * @param port The port number of this URL + * @param file The "file" portion of this URL. + * @param ref The anchor portion of this URL. + */ protected void set(String protocol, String host, int port, String file, String ref) { *************** public final class URL implements Serial *** 290,297 **** // invalid protocol. It will cause the handler to be set to null // thus overriding a valid handler. Callers of this method should // be aware of this. ! this.handler = setURLStreamHandler(protocol); ! this.protocol = protocol; this.port = port; this.host = host; this.file = file; --- 629,637 ---- // invalid protocol. It will cause the handler to be set to null // thus overriding a valid handler. Callers of this method should // be aware of this. ! this.handler = getURLStreamHandler(protocol); ! this.protocol = protocol.toLowerCase(); ! this.authority = null; this.port = port; this.host = host; this.file = file; *************** public final class URL implements Serial *** 299,304 **** --- 639,685 ---- hashCode = hashCode(); // Used for serialization. } + /** + * Sets the specified fields of the URL. This is not a public method so + * that only URLStreamHandlers can modify URL fields. URLs are otherwise + * constant. + * + * @since 1.3 + */ + protected void set(String protocol, String host, int port, + String authority, String userInfo, + String path, String query, String ref) + { + // TBD: Theoretically, a poorly written StreamHandler could pass an + // invalid protocol. It will cause the handler to be set to null + // thus overriding a valid handler. Callers of this method should + // be aware of this. + this.handler = getURLStreamHandler(protocol); + this.protocol = protocol.toLowerCase(); + if (userInfo == null) + this.host = host; + else + this.host = userInfo + "@" + host; + this.port = port; + if (query == null) + this.file = path; + else + this.file = path + "?" + query; + this.ref = ref; + hashCode = hashCode(); // Used for serialization. + } + + /** + * Sets the URLStreamHandlerFactory for this class. This factory is + * responsible for returning the appropriate protocol handler for + * a given URL. + * + * @param fac The URLStreamHandlerFactory class to use + * + * @exception Error If the factory is alread set. + * @exception SecurityException If a security manager exists and its + * checkSetFactory method doesn't allow the operation + */ public static synchronized void setURLStreamHandlerFactory(URLStreamHandlerFactory fac) { *************** public final class URL implements Serial *** 313,331 **** factory = fac; } public String toExternalForm() { // Identical to toString(). return handler.toExternalForm(this); } public String toString() { // Identical to toExternalForm(). return handler.toExternalForm(this); } ! private URLStreamHandler setURLStreamHandler(String protocol) { URLStreamHandler handler; --- 694,726 ---- factory = fac; } + /** + * Returns a String representing this URL. The String returned is + * created by calling the protocol handler's toExternalForm() method. + * + * @return A string for this URL + */ public String toExternalForm() { // Identical to toString(). return handler.toExternalForm(this); } + /** + * Returns a String representing this URL. Identical to toExternalForm(). + * The value returned is created by the protocol handler's + * toExternalForm method. Overrides Object.toString() + * + * @return A string for this URL + */ public String toString() { // Identical to toExternalForm(). return handler.toExternalForm(this); } ! private static synchronized URLStreamHandler ! getURLStreamHandler(String protocol) { URLStreamHandler handler; *************** public final class URL implements Serial *** 345,351 **** // This is an interesting case. It's tempting to think that we // could call Class.forName ("gnu.gcj.protocol.file.Handler") to // get the appropriate class. Unfortunately, if we do that the ! // program will never terminate, because setURLStreamHandler is // eventually called by Class.forName. // // Treating "file" as a special case is the minimum that will --- 740,746 ---- // This is an interesting case. It's tempting to think that we // could call Class.forName ("gnu.gcj.protocol.file.Handler") to // get the appropriate class. Unfortunately, if we do that the ! // program will never terminate, because getURLStreamHandler is // eventually called by Class.forName. // // Treating "file" as a special case is the minimum that will *************** public final class URL implements Serial *** 400,406 **** throws IOException, ClassNotFoundException { ois.defaultReadObject(); ! this.handler = setURLStreamHandler(protocol); if (this.handler == null) throw new IOException("Handler for protocol " + protocol + " not found"); } --- 795,801 ---- throws IOException, ClassNotFoundException { ois.defaultReadObject(); ! this.handler = getURLStreamHandler(protocol); if (this.handler == null) throw new IOException("Handler for protocol " + protocol + " not found"); } diff -Nrc3pad gcc-3.2.3/libjava/java/net/URLStreamHandler.java gcc-3.3/libjava/java/net/URLStreamHandler.java *** gcc-3.2.3/libjava/java/net/URLStreamHandler.java 2002-02-23 00:15:48.000000000 +0000 --- gcc-3.3/libjava/java/net/URLStreamHandler.java 2003-03-01 23:37:51.000000000 +0000 *************** *** 1,42 **** ! // URLStreamHandler.java - Superclass of all stream protocol handlers. ! /* Copyright (C) 1999, 2002 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package java.net; ! /** ! * @author Warren Levy ! * @date March 4, 1999. ! */ ! /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ public abstract class URLStreamHandler { protected abstract URLConnection openConnection(URL u) ! throws java.io.IOException; ! protected void parseURL(URL u, String spec, int start, int limit) { ! String host = u.getHost(); ! int port = u.getPort(); ! String file = u.getFile(); - /* TBD: The JDK 1.2 doc specifically says that limit is the position - * to stop parsing at and that it will be either the end of the string - * or the position of '#'; thus the doc infers that this method does - * not set the ref. - */ if (spec.regionMatches (start, "//", 0, 2)) { int hostEnd; --- 1,132 ---- ! /* URLStreamHandler.java -- Abstract superclass for all protocol handlers ! Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package java.net; ! import java.io.IOException; ! import java.io.File; ! /* * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ + /** + * This class is the superclass of all URL protocol handlers. The URL + * class loads the appropriate protocol handler to establish a connection + * to a (possibly) remote service (eg, "http", "ftp") and to do protocol + * specific parsing of URL's. Refer to the URL class documentation for + * details on how that class locates and loads protocol handlers. + *

        + * A protocol handler implementation should override the openConnection() + * method, and optionally override the parseURL() and toExternalForm() + * methods if necessary. (The default implementations will parse/write all + * URL's in the same form as http URL's). A protocol specific subclass + * of URLConnection will most likely need to be created as well. + *

        + * Note that the instance methods in this class are called as if they + * were static methods. That is, a URL object to act on is passed with + * every call rather than the caller assuming the URL is stored in an + * instance variable of the "this" object. + *

        + * The methods in this class are protected and accessible only to subclasses. + * URLStreamConnection objects are intended for use by the URL class only, + * not by other classes (unless those classes are implementing protocols). + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy (warrenl@cygnus.com) + * + * @see URL + */ public abstract class URLStreamHandler { + /** + * Creates a URLStreamHander + */ + public URLStreamHandler () + { + } + + /** + * Returns a URLConnection for the passed in URL. Note that this should + * not actually create the connection to the (possibly) remote host, but + * rather simply return a URLConnection object. The connect() method of + * URL connection is used to establish the actual connection, possibly + * after the caller sets up various connection options. + * + * @param url The URL to get a connection object for + * + * @return A URLConnection object for the given URL + * + * @exception IOException If an error occurs + */ protected abstract URLConnection openConnection(URL u) ! throws IOException; ! /** ! * This method parses the string passed in as a URL and set's the ! * instance data fields in the URL object passed in to the various values ! * parsed out of the string. The start parameter is the position to start ! * scanning the string. This is usually the position after the ":" which ! * terminates the protocol name. The end parameter is the position to ! * stop scanning. This will be either the end of the String, or the ! * position of the "#" character, which separates the "file" portion of ! * the URL from the "anchor" portion. ! *

        ! * This method assumes URL's are formatted like http protocol URL's, so ! * subclasses that implement protocols with URL's the follow a different ! * syntax should override this method. The lone exception is that if ! * the protocol name set in the URL is "file", this method will accept ! * an empty hostname (i.e., "file:///"), which is legal for that protocol ! * ! * @param url The URL object in which to store the results ! * @param spec The String-ized URL to parse ! * @param start The position in the string to start scanning from ! * @param end The position in the string to stop scanning ! */ ! protected void parseURL(URL url, String spec, int start, int end) { ! String host = url.getHost(); ! int port = url.getPort(); ! String file = url.getFile(); ! String ref = url.getRef(); if (spec.regionMatches (start, "//", 0, 2)) { int hostEnd; *************** public abstract class URLStreamHandler *** 47,53 **** if (slash >= 0) hostEnd = slash; else ! hostEnd = limit; host = spec.substring (start, hostEnd); --- 137,143 ---- if (slash >= 0) hostEnd = slash; else ! hostEnd = end; host = spec.substring (start, hostEnd); *************** public abstract class URLStreamHandler *** 76,103 **** else if (host == null) host = ""; ! if (start < limit && spec.charAt(start) == '/') { ! // This is an absolute path name; ignore any file context. ! file = spec.substring(start, limit); } ! else if (file == null || file.length() <= 0) { ! // No file context available; just spec for file. ! file = spec.substring(start, limit); } ! else if (start < limit) { ! // Context is available, but only override it if there is a new file. ! file = file.substring(0, file.lastIndexOf('/')) ! + '/' + spec.substring(start, limit); } ! u.set(u.getProtocol(), host, port, file, u.getRef()); } private static String canonicalizeFilename(String file) { int index; // Replace "/./" with "/". This probably isn't very efficient in --- 166,235 ---- else if (host == null) host = ""; ! if (file == null || file.length() == 0 ! || (start < end && spec.charAt(start) == '/')) { ! // No file context available; just spec for file. ! // Or this is an absolute path name; ignore any file context. ! file = spec.substring(start, end); ! ref = null; } ! else if (start < end) { ! // Context is available, but only override it if there is a new file. ! char sepChar = '/'; ! int lastSlash = file.lastIndexOf (sepChar); ! if (lastSlash < 0 && File.separatorChar != sepChar ! && url.getProtocol ().equals ("file")) ! { ! // On Windows, even '\' is allowed in a "file" URL. ! sepChar = File.separatorChar; ! lastSlash = file.lastIndexOf (sepChar); ! } ! ! file = file.substring(0, lastSlash) ! + sepChar + spec.substring (start, end); ! ! if (url.getProtocol ().equals ("file")) ! { ! // For "file" URLs constructed relative to a context, we ! // need to canonicalise the file path. ! try ! { ! file = new File (file).getCanonicalPath (); ! } ! catch (IOException e) ! { ! } ! } ! ! ref = null; } ! ! if (ref == null) { ! // Normally there should be no '#' in the file part, ! // but we are nice. ! int hash = file.indexOf('#'); ! if (hash != -1) ! { ! ref = file.substring(hash + 1, file.length()); ! file = file.substring(0, hash); ! } } ! // XXX - Classpath used to call PlatformHelper.toCanonicalForm() on ! // the file part. It seems like overhead, but supposedly there is some ! // benefit in windows based systems (it also lowercased the string). ! ! setURL(url, url.getProtocol(), host, port, file, ref); } private static String canonicalizeFilename(String file) { + // XXX - GNU Classpath has an implementation that might be more appropriate + // for Windows based systems (gnu.java.io.PlatformHelper.toCanonicalForm) + int index; // Replace "/./" with "/". This probably isn't very efficient in *************** public abstract class URLStreamHandler *** 119,125 **** return file; } ! public boolean sameFile(URL url1, URL url2) { if (url1 == url2) return true; --- 251,265 ---- return file; } ! /** ! * Compares two URLs, excluding the fragment component ! * ! * @param url1 The first url ! * @param url2 The second url to compare with the first ! * ! * @specnote Now protected ! */ ! protected boolean sameFile(URL url1, URL url2) { if (url1 == url2) return true; *************** public abstract class URLStreamHandler *** 143,182 **** return true; } protected void setURL(URL u, String protocol, String host, int port, String file, String ref) { u.set(protocol, host, port, file, ref); } protected String toExternalForm(URL u) { ! String resStr, host, file, ref; int port; ! resStr = u.getProtocol() + ":"; host = u.getHost(); port = u.getPort(); file = u.getFile(); ref = u.getRef(); ! // JDK 1.2 online doc infers that host could be null because it ! // explicitly states that file cannot be null, but is silent on host. ! // // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. ! if (host == null) ! host = ""; ! if (port >= 0 || ! (host.length() == 0)) ! resStr = resStr + "//" + host + (port < 0 ? "" : ":" + port); ! resStr = resStr + file; if (ref != null) ! resStr = resStr + "#" + ref; ! return resStr; } } --- 283,475 ---- return true; } + /** + * This methods sets the instance variables representing the various fields + * of the URL to the values passed in. + * + * @param u The URL to modify + * @param protocol The protocol to set + * @param host The host name to et + * @param port The port number to set + * @param file The filename to set + * @param ref The reference + * + * @exception SecurityException If the protocol handler of the URL is + * different from this one + * + * @deprecated 1.2 Please use + * #setURL(URL,String,String,int,String,String,String,String); + */ protected void setURL(URL u, String protocol, String host, int port, String file, String ref) { u.set(protocol, host, port, file, ref); } + /** + * Sets the fields of the URL argument to the indicated values + * + * @param u The URL to modify + * @param protocol The protocol to set + * @param host The host name to set + * @param port The port number to set + * @param authority The authority to set + * @param userInfo The user information to set + * @param path The path/filename to set + * @param query The query part to set + * @param ref The reference + * + * @exception SecurityException If the protocol handler of the URL is + * different from this one + */ + protected void setURL(URL u, String protocol, String host, int port, + String authority, String userInfo, String path, + String query, String ref) + { + u.set(protocol, host, port, authority, userInfo, path, query, ref); + } + + /** + * Provides the default equals calculation. May be overidden by handlers for + * other protocols that have different requirements for equals(). This method + * requires that none of its arguments is null. This is guaranteed by the + * fact that it is only called by java.net.URL class. + * + * @param url1 An URL object + * @param url2 An URL object + */ + protected boolean equals (URL url1, URL url2) + { + // This comparison is very conservative. It assumes that any + // field can be null. + return (url1.getPort () == url2.getPort () + && ((url1.getProtocol () == null && url2.getProtocol () == null) + || (url1.getProtocol () != null + && url1.getProtocol ().equals (url2.getProtocol ()))) + && ((url1.getUserInfo () == null && url2.getUserInfo () == null) + || (url1.getUserInfo () != null + && url1.getUserInfo ().equals(url2.getUserInfo ()))) + && ((url1.getAuthority () == null && url2.getAuthority () == null) + || (url1.getAuthority () != null + && url1.getAuthority ().equals(url2.getAuthority ()))) + && ((url1.getHost () == null && url2.getHost () == null) + || (url1.getHost () != null + && url1.getHost ().equals(url2.getHost ()))) + && ((url1.getPath () == null && url2.getPath () == null) + || (url1.getPath () != null + && url1.getPath ().equals (url2.getPath ()))) + && ((url1.getQuery () == null && url2.getQuery () == null) + || (url1.getQuery () != null + && url1.getQuery ().equals(url2.getQuery ()))) + && ((url1.getRef () == null && url2.getRef () == null) + || (url1.getRef () != null + && url1.getRef ().equals(url2.getRef ())))); + } + + /** + * Compares the host components of two URLs. + * + * @exception UnknownHostException If an unknown host is found + */ + protected boolean hostsEqual (URL url1, URL url2) + throws UnknownHostException + { + InetAddress addr1 = InetAddress.getByName (url1.getHost ()); + InetAddress addr2 = InetAddress.getByName (url2.getHost ()); + + return addr1.equals (addr2); + } + + /** + * Get the IP address of our host. An empty host field or a DNS failure will + * result in a null return. + */ + protected InetAddress getHostAddress (URL url) + { + String hostname = url.getHost (); + + if (hostname == "") + return null; + + try + { + return InetAddress.getByName (hostname); + } + catch (UnknownHostException e) + { + return null; + } + } + + /** + * Returns the default port for a URL parsed by this handler. This method is + * meant to be overidden by handlers with default port numbers. + */ + protected int getDefaultPort () + { + return -1; + } + + /** + * Provides the default hash calculation. May be overidden by handlers for + * other protocols that have different requirements for hashCode calculation. + */ + protected int hashCode (URL url) + { + return url.getProtocol ().hashCode () + + ((url.getHost () == null) ? 0 : url.getHost ().hashCode ()) + + url.getFile ().hashCode() + + url.getPort (); + } + + /** + * This method converts a URL object into a String. This method creates + * Strings in the mold of http URL's, so protocol handlers which use URL's + * that have a different syntax should override this method + * + * @param url The URL object to convert + */ protected String toExternalForm(URL u) { ! String protocol, host, file, ref; int port; ! protocol = u.getProtocol(); ! ! // JDK 1.2 online doc infers that host could be null because it ! // explicitly states that file cannot be null, but is silent on host. host = u.getHost(); + if (host == null) + host = ""; + port = u.getPort(); file = u.getFile(); ref = u.getRef(); ! // Guess a reasonable size for the string buffer so we have to resize ! // at most once. ! int size = protocol.length() + host.length() + file.length() + 24; ! StringBuffer sb = new StringBuffer(size); ! ! sb.append(protocol); ! sb.append(':'); ! ! if (host.length() != 0) ! sb.append("//").append(host); ! // Note that this produces different results from JDK 1.2 as JDK 1.2 // ignores a non-default port if host is null or "". That is inconsistent // with the spec since the result of this method is spec'ed so it can be // used to construct a new URL that is equivalent to the original. ! boolean port_needed = port > 0 && port != getDefaultPort(); ! if (port_needed) ! sb.append(':').append(port); ! sb.append(file); if (ref != null) ! sb.append('#').append(ref); ! return sb.toString(); } } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/Buffer.java gcc-3.3/libjava/java/nio/Buffer.java *** gcc-3.2.3/libjava/java/nio/Buffer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/Buffer.java 2003-02-11 21:08:49.000000000 +0000 *************** *** 0 **** --- 1,215 ---- + /* Buffer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio; + + public abstract class Buffer + { + private int cap = 0; + private int limit = 0; + private int pos = 0; + private int mark = -1; + + // Creates a new Buffer. + // + // Should be package private. + // + Buffer (int capacity, int limit, int position, int mark) + { + if (capacity < 0) + throw new IllegalArgumentException (); + + cap = capacity; + limit (limit); + position (position); + + if (mark > 0) + { + if (mark > pos) + throw new IllegalArgumentException (); + + this.mark = mark; + } + } + + /** + * Retrieves the capacity of the buffer. + */ + public final int capacity () + { + return cap; + } + + /** + * Clears the buffer. + */ + public final Buffer clear () + { + limit = cap; + pos = 0; + mark = -1; + return this; + } + + /** + * Flips the buffer. + */ + public final Buffer flip () + { + limit = pos; + pos = 0; + mark = -1; + return this; + } + + /** + * Tells whether the buffer has remaining data to read or not. + */ + public final boolean hasRemaining () + { + return limit > pos; + } + + /** + * Tells whether this buffer is read only or not. + */ + public abstract boolean isReadOnly (); + + /** + * Retrieves the current limit of the buffer. + */ + public final int limit () + { + return limit; + } + + /** + * Sets this buffer's limit. + * + * @param newLimit The new limit value; must be non-negative and no larger + * than this buffer's capacity. + * + * @exception IllegalArgumentException If the preconditions on newLimit + * do not hold. + */ + public final Buffer limit (int newLimit) + { + if ((newLimit < 0) || (newLimit > cap)) + throw new IllegalArgumentException (); + + if (newLimit <= mark) + mark = -1; + + if (pos > newLimit) + pos = newLimit - 1; + + limit = newLimit; + return this; + } + + /** + * Sets this buffer's mark at its position. + */ + public final Buffer mark () + { + mark = pos; + return this; + } + + /** + * Retrieves the current position of this buffer. + */ + public final int position () + { + return pos; + } + + /** + * Sets this buffer's position. If the mark is defined and larger than the + * new position then it is discarded. + * + * @param newPosition The new position value; must be non-negative and no + * larger than the current limit. + * + * @exception IllegalArgumentException If the preconditions on newPosition + * do not hold + */ + public final Buffer position (int newPosition) + { + if ((newPosition < 0) || (newPosition > limit)) + throw new IllegalArgumentException (); + + if (newPosition <= mark) + mark = -1; + + pos = newPosition; + return this; + } + + /** + * Returns the number of elements between the current position and the limit. + */ + public final int remaining() + { + return limit - pos; + } + + /** + * Resets this buffer's position to the previously-marked position. + * + * @exception InvalidMarkException If the mark has not been set. + */ + public final Buffer reset() + { + if (mark == -1) + throw new InvalidMarkException (); + + pos = mark; + return this; + } + + /** + * Rewinds this buffer. The position is set to zero and the mark + * is discarded. + */ + public final Buffer rewind() + { + pos = 0; + mark = -1; + return this; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/BufferOverflowException.java gcc-3.3/libjava/java/nio/BufferOverflowException.java *** gcc-3.2.3/libjava/java/nio/BufferOverflowException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/BufferOverflowException.java 2002-11-11 07:00:29.000000000 +0000 *************** *** 0 **** --- 1,51 ---- + /* BufferOverflowException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio; + + /** + * @since 1.4 + */ + public class BufferOverflowException extends RuntimeException + { + /** + * Creates the exception + */ + public BufferOverflowException () + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/BufferUnderflowException.java gcc-3.3/libjava/java/nio/BufferUnderflowException.java *** gcc-3.2.3/libjava/java/nio/BufferUnderflowException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/BufferUnderflowException.java 2002-11-11 07:00:29.000000000 +0000 *************** *** 0 **** --- 1,51 ---- + /* BufferUnderflowException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio; + + /** + * @since 1.4 + */ + public class BufferUnderflowException extends RuntimeException + { + /** + * Creates the exception + */ + public BufferUnderflowException () + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/ByteBuffer.java gcc-3.3/libjava/java/nio/ByteBuffer.java *** gcc-3.2.3/libjava/java/nio/ByteBuffer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/ByteBuffer.java 2003-02-13 16:49:03.000000000 +0000 *************** *** 0 **** --- 1,610 ---- + /* ByteBuffer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio; + + import gnu.java.nio.ByteBufferImpl; + + /** + * @since 1.4 + */ + public abstract class ByteBuffer extends Buffer implements Comparable + { + private ByteOrder endian = ByteOrder.BIG_ENDIAN; + + int offset; + byte[] backing_buffer; + + /** + * Allocates a new direct byte buffer. + */ + public static ByteBuffer allocateDirect (int capacity) + { + throw new Error ("direct buffers are not implemented"); + } + + /** + * Allocates a new byte buffer. + */ + public static ByteBuffer allocate (int capacity) + { + return new ByteBufferImpl (capacity, 0, capacity); + } + + /** + * Wraps a byte array into a buffer. + * + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold + */ + final public static ByteBuffer wrap (byte[] array, int offset, int length) + { + return new ByteBufferImpl (array, offset, length); + } + + /** + * Wraps a byte array into a buffer. + */ + final public static ByteBuffer wrap (byte[] array) + { + return wrap (array, 0, array.length); + } + + ByteBuffer (int capacity, int limit, int position, int mark) + { + super (capacity, limit, position, mark); + } + + /** + * This method transfers bytes from this buffer into + * the given destination array. + * + * @param dst The destination array + * @param offset The offset within the array of the first byte to be written; + * must be non-negative and no larger than dst.length. + * @param length The maximum number of bytes to be written to the given array; + * must be non-negative and no larger than dst.length - offset. + * + * @exception BufferUnderflowException If there are fewer than length bytes + * remaining in this buffer. + * @exception IndexOutOfBoundsException - If the preconditions on the offset + * and length parameters do not hold. + */ + public ByteBuffer get (byte[] dst, int offset, int length) + { + if ((offset < 0) + || (offset > dst.length) + || (length < 0) + || (length > (dst.length - offset))) + throw new IndexOutOfBoundsException (); + + for (int i = offset; i < offset + length; i++) + { + dst [i] = get(); + } + + return this; + } + + /** + * This method transfers bytes from this buffer into the given + * destination array. + * + * @param dst The byte array to write into. + * + * @exception BufferUnderflowException If there are fewer than dst.length + * bytes remaining in this buffer. + */ + public ByteBuffer get (byte[] dst) + { + return get (dst, 0, dst.length); + } + + /** + * Writes the content of src into the buffer. + * + * @param src The source data. + * + * @exception BufferOverflowException If there is insufficient space in this + * buffer for the remaining bytes in the source buffer. + * @exception IllegalArgumentException If the source buffer is this buffer. + * @exception ReadOnlyBufferException If this buffer is read only. + */ + public ByteBuffer put (ByteBuffer src) + { + if (src == this) + throw new IllegalArgumentException (); + + while (src.hasRemaining ()) + put (src.get ()); + + return this; + } + + /** + * Writes the content of the the array src into the buffer. + * + * @param src The array to copy into the buffer. + * @param offset The offset within the array of the first byte to be read; + * must be non-negative and no larger than src.length. + * @param length The number of bytes to be read from the given array; + * must be non-negative and no larger than src.length - offset. + * + * @exception BufferOverflowException If there is insufficient space in this + * buffer for the remaining bytes in the source buffer. + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold. + * @exception ReadOnlyBufferException If this buffer is read only. + */ + public ByteBuffer put (byte[] src, int offset, int length) + { + if ((offset < 0) || + (offset > src.length) || + (length < 0) || + (length > src.length - offset)) + throw new IndexOutOfBoundsException (); + + for (int i = offset; i < offset + length; i++) + put (src [i]); + + return this; + } + + /** + * Writes the content of the the array src into the buffer. + * + * @param src The array to copy into the buffer. + * + * @exception BufferOverflowException If there is insufficient space in this + * buffer for the remaining bytes in the source buffer. + * @exception ReadOnlyBufferException If this buffer is read only. + */ + public final ByteBuffer put (byte[] src) + { + return put (src, 0, src.length); + } + + /** + * Tells whether or not this buffer is backed by an accessible byte array. + */ + public final boolean hasArray () + { + return (backing_buffer != null + && !isReadOnly ()); + } + + /** + * Returns the byte array that backs this buffer. + * + * @exception ReadOnlyBufferException If this buffer is backed by an array + * but is read-only. + * @exception UnsupportedOperationException If this buffer is not backed + * by an accessible array. + */ + public final byte[] array () + { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + + return backing_buffer; + } + + /** + * Returns the offset within this buffer's backing array of the first element + * of the buffer + * + * @exception ReadOnlyBufferException If this buffer is backed by an array + * but is read-only. + * @exception UnsupportedOperationException If this buffer is not backed + * by an accessible array. + */ + public final int arrayOffset () + { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + + return offset; + } + + /** + * Tells whether or not this buffer is equal to another object. + */ + public boolean equals (Object obj) + { + if (obj != null && + obj instanceof ByteBuffer) + { + return compareTo (obj) == 0; + } + + return false; + } + + /** + * Compares this buffer to another object. + * + * @exception ClassCastException If the argument is not a byte buffer + */ + public int compareTo (Object obj) + { + ByteBuffer a = (ByteBuffer) obj; + + if (a.remaining() != remaining()) + { + return 1; + } + + if (! hasArray() || + ! a.hasArray()) + { + return 1; + } + + int r = remaining(); + int i1 = position (); + int i2 = a.position (); + + for (int i = 0; i < r; i++) + { + int t = (int) (get (i1) - a.get (i2)); + + if (t != 0) + { + return (int) t; + } + } + + return 0; + } + + /** + * Retrieves this buffer's byte order. + */ + public final ByteOrder order() + { + return endian; + } + + /** + * Modifies this buffer's byte order. + */ + public final ByteBuffer order (ByteOrder endian) + { + this.endian = endian; + return this; + } + + /** + * Reads the byte at this buffer's current position, + * and then increments the position. + * + * @exception BufferUnderflowException If the buffer's current position + * is not smaller than its limit. + */ + public abstract byte get (); + + /** + * Relative put method. + * + * @exception BufferOverflowException If this buffer's current position is + * not smaller than its limit. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public abstract ByteBuffer put (byte b); + + /** + * Absolute get method. + * + * @exception IndexOutOfBoundsException FIXME + */ + public abstract byte get (int index); + + /** + * Absolute put method. + * + * @exception ReadOnlyBufferException If this buffer is read-only + * @exception IndexOutOfBoundsException FIXME + */ + public abstract ByteBuffer put (int index, byte b); + + /** + * Compacts this buffer. + * + * @exception ReadOnlyBufferException If this buffer is read-only + */ + public abstract ByteBuffer compact(); + + /** + * Tells whether or not this buffer is direct. + */ + public abstract boolean isDirect(); + + /** + * Creates a new byte buffer whose content is a shared subsequence of this + * buffer's content. + */ + public abstract ByteBuffer slice(); + + /** + * Creates a new byte buffer that shares this buffer's content. + */ + public abstract ByteBuffer duplicate(); + + /** + * Creates a new, read-only byte buffer that shares this buffer's content. + */ + public abstract ByteBuffer asReadOnlyBuffer(); + + /** + * Creates a view of this byte buffer as a short buffer. + */ + public abstract ShortBuffer asShortBuffer(); + + /** + * Creates a view of this byte buffer as a char buffer. + */ + public abstract CharBuffer asCharBuffer(); + + /** + * Creates a view of this byte buffer as an integer buffer. + */ + public abstract IntBuffer asIntBuffer(); + + /** + * Creates a view of this byte buffer as a long buffer. + */ + public abstract LongBuffer asLongBuffer(); + + /** + * Creates a view of this byte buffer as a float buffer. + */ + public abstract FloatBuffer asFloatBuffer(); + + /** + * Creates a view of this byte buffer as a double buffer. + */ + public abstract DoubleBuffer asDoubleBuffer(); + + /** + * Relative get method for reading a character value. + * + * @exception BufferUnderflowException If there are fewer than two bytes + * remaining in this buffer. + */ + public abstract char getChar(); + + /** + * Relative put method for writing a character value. + * + * @exception BufferOverflowException If this buffer's current position is + * not smaller than its limit. + */ + public abstract ByteBuffer putChar(char value); + + /** + * Absolute get method for reading a character value. + * + * @exception IndexOutOfBoundsException If there are fewer than two bytes + * remaining in this buffer + */ + public abstract char getChar(int index); + + /** + * Absolute put method for writing a character value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus one. + */ + public abstract ByteBuffer putChar(int index, char value); + + /** + * Relative get method for reading a short value. + * + * @exception BufferUnderflowException If index is negative or not smaller + * than the buffer's limit, minus one. + */ + public abstract short getShort(); + + /** + * Relative put method for writing a short value. + * + * @exception BufferOverflowException If this buffer's current position is + * not smaller than its limit. + */ + public abstract ByteBuffer putShort(short value); + + /** + * Absolute get method for reading a short value. + * + * @exception IndexOutOfBoundsException If there are fewer than two bytes + * remaining in this buffer + */ + public abstract short getShort(int index); + + /** + * Absolute put method for writing a short value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus one. + */ + public abstract ByteBuffer putShort(int index, short value); + + /** + * Relative get method for reading an integer value. + * + * @exception BufferUnderflowException If there are fewer than four bytes + * remaining in this buffer. + */ + public abstract int getInt(); + + /** + * Relative put method for writing an integer value. + * + * @exception BufferOverflowException If this buffer's current position is + * not smaller than its limit. + */ + public abstract ByteBuffer putInt(int value); + + /** + * Absolute get method for reading an integer value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus three. + */ + public abstract int getInt(int index); + + /** + * Absolute put method for writing an integer value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus three. + */ + public abstract ByteBuffer putInt(int index, int value); + + /** + * Relative get method for reading a long value. + * + * @exception BufferUnderflowException If there are fewer than eight bytes + * remaining in this buffer. + */ + public abstract long getLong(); + + /** + * Relative put method for writing a long value. + * + * @exception BufferOverflowException If this buffer's current position is + * not smaller than its limit. + */ + public abstract ByteBuffer putLong(long value); + + /** + * Absolute get method for reading a long value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus seven. + */ + public abstract long getLong(int index); + + /** + * Absolute put method for writing a float value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus seven. + */ + public abstract ByteBuffer putLong(int index, long value); + + /** + * Relative get method for reading a float value. + * + * @exception BufferUnderflowException If there are fewer than four bytes + * remaining in this buffer. + */ + public abstract float getFloat(); + + /** + * Relative put method for writing a float value. + * + * @exception BufferOverflowException If there are fewer than four bytes + * remaining in this buffer. + */ + public abstract ByteBuffer putFloat(float value); + + /** + * Absolute get method for reading a float value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus three. + */ + public abstract float getFloat(int index); + + /** + * Relative put method for writing a float value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus three. + */ + public abstract ByteBuffer putFloat(int index, float value); + + /** + * Relative get method for reading a double value. + * + * @exception BufferUnderflowException If there are fewer than eight bytes + * remaining in this buffer. + */ + public abstract double getDouble(); + + /** + * Relative put method for writing a double value. + * + * @exception BufferOverflowException If this buffer's current position is + * not smaller than its limit. + */ + public abstract ByteBuffer putDouble(double value); + + /** + * Absolute get method for reading a double value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus seven. + */ + public abstract double getDouble(int index); + + /** + * Absolute put method for writing a double value. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit, minus seven. + */ + public abstract ByteBuffer putDouble(int index, double value); + + /** + * Returns a string summarizing the state of this buffer. + */ + public String toString () + { + return getClass ().getName () + + "[pos=" + position () + + " lim=" + limit () + + " cap=" + capacity () + "]"; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/ByteOrder.java gcc-3.3/libjava/java/nio/ByteOrder.java *** gcc-3.2.3/libjava/java/nio/ByteOrder.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/ByteOrder.java 2002-11-01 12:03:38.000000000 +0000 *************** *** 0 **** --- 1,60 ---- + /* ByteOrder.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio; + + + public final class ByteOrder + { + public static final ByteOrder BIG_ENDIAN = new ByteOrder(); + public static final ByteOrder LITTLE_ENDIAN = new ByteOrder(); + + public static ByteOrder nativeOrder() + { + return BIG_ENDIAN; + } + + public String toString() + { + return this == BIG_ENDIAN ? "BIG_ENDIAN" : "LITTLE_ENDIAN"; + } + + // This class can only be instantiated here. + private ByteOrder () + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/AlreadyConnectedException.java gcc-3.3/libjava/java/nio/channels/AlreadyConnectedException.java *** gcc-3.2.3/libjava/java/nio/channels/AlreadyConnectedException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/AlreadyConnectedException.java 2002-11-13 13:52:47.000000000 +0000 *************** *** 0 **** --- 1,48 ---- + /* AlreadyConnectedException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + public class AlreadyConnectedException extends IllegalStateException + { + /** + * Creates the exception + */ + public AlreadyConnectedException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/AsynchronousCloseException.java gcc-3.3/libjava/java/nio/channels/AsynchronousCloseException.java *** gcc-3.2.3/libjava/java/nio/channels/AsynchronousCloseException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/AsynchronousCloseException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* AsynchronousCloseException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class AsynchronousCloseException extends ClosedChannelException + { + /** + * Creates the exception + */ + public AsynchronousCloseException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ByteChannel.java gcc-3.3/libjava/java/nio/channels/ByteChannel.java *** gcc-3.2.3/libjava/java/nio/channels/ByteChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ByteChannel.java 2002-10-07 07:59:12.000000000 +0000 *************** *** 0 **** --- 1,43 ---- + /* ByteChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + public interface ByteChannel + extends ReadableByteChannel, WritableByteChannel + { + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/CancelledKeyException.java gcc-3.3/libjava/java/nio/channels/CancelledKeyException.java *** gcc-3.2.3/libjava/java/nio/channels/CancelledKeyException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/CancelledKeyException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* CancelledKeyException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class CancelledKeyException extends IllegalStateException + { + /** + * Creates the exception + */ + public CancelledKeyException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/Channel.java gcc-3.3/libjava/java/nio/channels/Channel.java *** gcc-3.2.3/libjava/java/nio/channels/Channel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/Channel.java 2002-10-07 07:59:12.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* Channel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + + public interface Channel + { + /** + * Tells whether this channel is open or not + */ + public boolean isOpen(); + + /** + * Closes this channel + * + * @exception IOException If an error occurs + */ + public void close() throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/Channels.java gcc-3.3/libjava/java/nio/channels/Channels.java *** gcc-3.2.3/libjava/java/nio/channels/Channels.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/Channels.java 2003-02-12 20:00:03.000000000 +0000 *************** *** 0 **** --- 1,130 ---- + /* Channels.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.InputStream; + import java.io.OutputStream; + import java.io.Reader; + import java.io.Writer; + import java.nio.channels.WritableByteChannel; + import java.nio.charset.Charset; + import java.nio.charset.CharsetDecoder; + import java.nio.charset.CharsetEncoder; + + /** + * @since 1.4 + */ + public final class Channels + { + /** + * Constructs a stream that reads bytes from the given channel. + */ + public static InputStream newInputStream (ReadableByteChannel ch) + { + throw new Error ("not implemented"); + } + + /** + * Constructs a stream that writes bytes to the given channel. + */ + public static OutputStream newOutputStream (WritableByteChannel ch) + { + throw new Error ("not implemented"); + } + + /** + * Constructs a channel that reads bytes from the given stream. + */ + public static ReadableByteChannel newChannel (InputStream in) + { + throw new Error ("not implemented"); + } + + /** + * Constructs a channel that writes bytes to the given stream. + */ + public static WritableByteChannel newChannel (OutputStream out) + { + throw new Error ("not implemented"); + } + + /** + * Constructs a reader that decodes bytes from the given channel using the + * given decoder. + */ + public static Reader newReader (ReadableByteChannel ch, CharsetDecoder dec, + int minBufferCap) + { + throw new Error ("not implemented"); + } + + /** + * Constructs a reader that decodes bytes from the given channel according to + * the named charset. + * + * @exception UnsupportedCharsetException If no support for the named charset + * is available in this instance of the Java virtual machine. + */ + public static Reader newReader (ReadableByteChannel ch, String csName) + { + return newReader (ch, Charset.forName (csName).newDecoder (), -1); + } + + /** + * Constructs a writer that encodes characters using the given encoder and + * writes the resulting bytes to the given channel. + */ + public static Writer newWriter (WritableByteChannel ch, CharsetEncoder enc, + int minBufferCap) + { + throw new Error ("not implemented"); + } + + /** + * Constructs a writer that encodes characters according to the named charset + * and writes the resulting bytes to the given channel. + * + * @exception UnsupportedCharsetException If no support for the named charset + * is available in this instance of the Java virtual machine. + */ + public static Writer newWriter (WritableByteChannel ch, + String csName) + { + return newWriter (ch, Charset.forName (csName).newEncoder (), -1); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ClosedByInterruptException.java gcc-3.3/libjava/java/nio/channels/ClosedByInterruptException.java *** gcc-3.2.3/libjava/java/nio/channels/ClosedByInterruptException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ClosedByInterruptException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* ClosedByInterruptException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class ClosedByInterruptException extends AsynchronousCloseException + { + /** + * Creates the exception + */ + public ClosedByInterruptException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ClosedChannelException.java gcc-3.3/libjava/java/nio/channels/ClosedChannelException.java *** gcc-3.2.3/libjava/java/nio/channels/ClosedChannelException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ClosedChannelException.java 2002-11-18 13:22:55.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* ClosedChannelException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class ClosedChannelException extends IOException + { + /** + * Creates the exception + */ + public ClosedChannelException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ClosedSelectorException.java gcc-3.3/libjava/java/nio/channels/ClosedSelectorException.java *** gcc-3.2.3/libjava/java/nio/channels/ClosedSelectorException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ClosedSelectorException.java 2002-11-18 13:22:55.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* ClosedSelectorException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class ClosedSelectorException extends IllegalStateException + { + /** + * Creates the exception + */ + public ClosedSelectorException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ConnectionPendingException.java gcc-3.3/libjava/java/nio/channels/ConnectionPendingException.java *** gcc-3.2.3/libjava/java/nio/channels/ConnectionPendingException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ConnectionPendingException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* ConnectionPendingException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class ConnectionPendingException extends IllegalStateException + { + /** + * Creates the exception + */ + public ConnectionPendingException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/DatagramChannel.java gcc-3.3/libjava/java/nio/channels/DatagramChannel.java *** gcc-3.2.3/libjava/java/nio/channels/DatagramChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/DatagramChannel.java 2003-02-11 03:59:37.000000000 +0000 *************** *** 0 **** --- 1,209 ---- + /* DatagramChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + import java.net.DatagramSocket; + import java.net.SocketAddress; + import java.nio.ByteBuffer; + import java.nio.channels.spi.AbstractSelectableChannel; + import java.nio.channels.spi.SelectorProvider; + + /** + * @since 1.4 + */ + public abstract class DatagramChannel + extends AbstractSelectableChannel + implements ByteChannel, ScatteringByteChannel, GatheringByteChannel + { + /** + * Initializes the channel. + */ + protected DatagramChannel (SelectorProvider provider) + { + super (provider); + } + + /** + * Opens a datagram channel. + * + * @exception IOException If an error occurs + */ + public static DatagramChannel open () throws IOException + { + return SelectorProvider.provider ().openDatagramChannel (); + } + + /** + * Reads data from this channel. + */ + public final long read (ByteBuffer[] dsts) throws IOException + { + long b = 0; + + for (int i = 0; i < dsts.length; i++) + b += read (dsts[i]); + + return b; + } + + /** + * Writes data to this channel. + * + * @exception IOException If an error occurs + * @exception NotYetConnectedException The channel's socket is not connected. + */ + public final long write (ByteBuffer[] srcs) throws IOException + { + long b = 0; + + for (int i = 0;i < srcs.length; i++) + b += write (srcs[i]); + + return b; + } + + /** + * Connects this channel's socket. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the connect operation is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the read operation is in progress, thereby closing the + * channel and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IOException If an error occurs. + * @exception SecurityException If a security manager has been installed and + * it does not permit datagrams to be sent to the given address. + */ + public abstract DatagramChannel connect (SocketAddress remote) + throws IOException; + + /** + * Disonnects this channel's socket. + * + * @exception IOException If an error occurs + */ + public abstract DatagramChannel disconnect () throws IOException; + + /** + * Tells whether or not this channel's socket is connected. + * + * @exception IOException If an error occurs. + * @exception NotYetConnectedException The channel's socket is not connected. + */ + public abstract boolean isConnected (); + + /** + * Reads data from this channel. + */ + public abstract int read (ByteBuffer dst) throws IOException; + + /** + * Reads data from this channel. + * + * @exception IOException If an error occurs. + * @exception NotYetConnectedException The channel's socket is not connected. + */ + public abstract long read (ByteBuffer[] dsts, int offset, int length) + throws IOException; + + /** + * Receives a datagram via this channel. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the connect operation is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the read operation is in progress, thereby closing the + * channel and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IOException If an error occurs + * @exception SecurityException If a security manager has been installed and + * it does not permit datagrams to be sent to the given address. + */ + public abstract SocketAddress receive (ByteBuffer dst) throws IOException; + + /** + * Sends a datagram via this channel. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the connect operation is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the read operation is in progress, thereby closing the + * channel and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IOException If an error occurs + * @exception SecurityException If a security manager has been installed and + * it does not permit datagrams to be sent to the given address. + */ + public abstract int send (ByteBuffer src, SocketAddress target) + throws IOException; + + /** + * Retrieves the channel's socket. + */ + public abstract DatagramSocket socket (); + + /** + * Writes data to this channel. + * + * @exception IOException If an error occurs. + * @exception NotYetConnectedException The channel's socket is not connected. + */ + public abstract int write (ByteBuffer src) throws IOException; + + /** + * Writes data to this channel. + * + * @exception IOException If an error occurs. + * @exception NotYetConnectedException The channel's socket is not connected. + */ + public abstract long write (ByteBuffer[] srcs, int offset, int length) + throws IOException; + + /** + * Retrieves the valid operations for this channel. + * + * @exception IOException If an error occurs. + * @exception NotYetConnectedException The channel's socket is not connected. + */ + public final int validOps () + { + return SelectionKey.OP_READ | SelectionKey.OP_WRITE; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/FileChannel.java gcc-3.3/libjava/java/nio/channels/FileChannel.java *** gcc-3.2.3/libjava/java/nio/channels/FileChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/FileChannel.java 2003-03-01 22:57:53.000000000 +0000 *************** *** 0 **** --- 1,368 ---- + /* FileChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + import java.nio.ByteBuffer; + import java.nio.MappedByteBuffer; + import java.nio.channels.spi.AbstractInterruptibleChannel; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class FileChannel extends AbstractInterruptibleChannel + implements ByteChannel, GatheringByteChannel, ScatteringByteChannel + { + public static class MapMode + { + public int m; + + public static MapMode READ_ONLY = new MapMode(0); + public static MapMode READ_WRITE = new MapMode(1); + public static MapMode PRIVATE = new MapMode(2); + + /** + * Initializes the MapMode. + */ + MapMode(int a) + { + m = a; + } + + /** + * Returns a string representation of the MapMode object. + */ + public String toString() + { + if (this == READ_ONLY) + return "READ_ONLY"; + else if (this == READ_WRITE) + return "READ_WRITE"; + + return "PRIVATE"; + } + } + + /** + * Initializes the channel. + */ + protected FileChannel () + { + } + + /** + * Maps the file into the memory. + * + * @exception IllegalArgumentException If the preconditions on the parameters + * do not hold. + * @exception IOException If an I/O error occurs. + * @exception NonReadableChannelException If mode is READ_ONLY but this channel was + * not opened for reading. + * @exception NonWritableChannelException If mode is READ_WRITE or PRIVATE but this + * channel was not opened for writing. + */ + public abstract MappedByteBuffer map(MapMode mode, long position, long size) + throws IOException; + + /** + * Return the size of the file thus far + * + * @exception ClosedChannelException If this channel is closed. + */ + public abstract long size() throws IOException; + + /** + * Writes data to the channel. + * + * @exception IOException If an I/O error occurs. + */ + public long write (ByteBuffer[] srcs) throws IOException + { + long result = 0; + + for (int i = 0; i < srcs.length; i++) + { + result += write (srcs[i]); + } + + return result; + } + + /** + * Writes data to the channel. + * + * @exception IOException If an I/O error occurs. + */ + public abstract int write (ByteBuffer src) throws IOException; + + /** + * Writes data to the channel. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the transfer is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the transfer is in progress, thereby closing both + * channels and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If position is negative. + * @exception IOException If an I/O error occurs. + * @exception NonWritableChannelException If this channel was not opened for + * writing. + */ + public abstract int write (ByteBuffer srcs, long position) throws IOException; + + /** + * Writes data to the channel. + * + * @exception IOException If an I/O error occurs. + */ + public abstract long write(ByteBuffer[] srcs, int offset, int length) + throws IOException; + + /** + * Reads data from the channel. + * + * @exception IOException If an I/O error occurs. + */ + public abstract long read (ByteBuffer[] dsts, int offset, int length) + throws IOException; + + /** + * Reads data from the channel. + * + * @exception IOException If an I/O error occurs. + */ + public final long read (ByteBuffer[] dsts) throws IOException + { + long result = 0; + + for (int i = 0; i < dsts.length; i++) + { + read (dsts [i]); + } + + return result; + } + + /** + * Reads data from the channel. + * + * @exception IOException If an I/O error occurs. + */ + public abstract int read(ByteBuffer dst) throws IOException; + + /** + * Reads data from the channel. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the transfer is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the transfer is in progress, thereby closing both + * channels and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If position is negative. + * @exception IOException If an I/O error occurs. + * @exception NonReadableChannelException If this channel was not opened for + * reading. + */ + public abstract int read(ByteBuffer dst, long position) throws IOException; + + /** + * Closes the channel. + * + * This is called from @see close. + * + * @exception IOException If an I/O error occurs. + */ + protected abstract void implCloseChannel() throws IOException; + + /** + * msync with the disk + * + * @exception ClosedChannelException If this channel is closed. + * @exception IOException If an I/O error occurs. + */ + public abstract void force(boolean metaData) throws IOException; + + /** + * Creates a file lock for the whole assoziated file. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the transfer is in progress. + * @exception ClosedChannelException If this channel is closed. + * @exception FileLockInterruptionException If the invoking thread is + * interrupted while blocked in this method. + * @exception IOException If an I/O error occurs. + * @exception NonReadableChannelException If shared is true and this channel + * was not opened for reading. + * @exception NonWritableChannelException If shared is false and this channel + * was not opened for writing. + * @exception OverlappingFileLockException If a lock that overlaps the + * requested region is already held by this Java virtual machine, or if + * another thread is already blocked in this method and is attempting to lock + * an overlapping region. + */ + public final FileLock lock () throws IOException + { + return lock (0, Long.MAX_VALUE, false); + } + + /** + * Creates a file lock for a region of the assoziated file. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the transfer is in progress. + * @exception ClosedChannelException If this channel is closed. + * @exception FileLockInterruptionException If the invoking thread is + * interrupted while blocked in this method. + * @exception IllegalArgumentException If the preconditions on the parameters + * do not hold. + * @exception IOException If an I/O error occurs. + * @exception OverlappingFileLockException If a lock that overlaps the + * requested region is already held by this Java virtual machine, or if + * another thread is already blocked in this method and is attempting to lock + * an overlapping region. + * @exception NonReadableChannelException If shared is true and this channel + * was not opened for reading. + * @exception NonWritableChannelException If shared is false and this channel + * was not opened for writing. + */ + public abstract FileLock lock (long position, long size, boolean shared) + throws IOException; + + /** + * Tries to aqquire alock on the whole assoziated file. + * + * @exception ClosedChannelException If this channel is closed. + * @exception IOException If an I/O error occurs. + * @exception OverlappingFileLockException If a lock that overlaps the + * requested region is already held by this Java virtual machine, or if + * another thread is already blocked in this method and is attempting to lock + * an overlapping region. + */ + public final FileLock tryLock () throws IOException + { + return tryLock (0, Long.MAX_VALUE, false); + } + + /** + * Tries to aqquire a lock on a region of the assoziated file. + * + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If the preconditions on the parameters + * do not hold. + * @exception IOException If an I/O error occurs. + * @exception OverlappingFileLockException If a lock that overlaps the + * requested region is already held by this Java virtual machine, or if + * another thread is already blocked in this method and is attempting to lock + * an overlapping region. + */ + public abstract FileLock tryLock (long position, long size, boolean shared) + throws IOException; + + /** + * Returns the current position on the file. + * + * @exception ClosedChannelException If this channel is closed. + * @exception IOException If an I/O error occurs. + */ + public abstract long position () throws IOException; + + /** + * Sets the position of the channel on the assoziated file. + * + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If newPosition is negative. + * @exception IOException If an I/O error occurs. + */ + public abstract FileChannel position (long newPosition) throws IOException; + + /** + * Transfers bytes from this channel's file to the given writable byte + * channel. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the transfer is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the transfer is in progress, thereby closing both + * channels and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If the preconditions on the parameters + * do not hold. + * @exception IOException If an I/O error occurs. + * @exception NonReadableChannelException If this channel was not opened for + * reading. + * @exception NonWritableChannelException If the target channel was not + * opened for writing. + */ + public abstract long transferTo (long position, long count, + WritableByteChannel target) + throws IOException; + + /** + * Transfers bytes from the given readable channel into this channel. + * + * @exception AsynchronousCloseException If another thread closes this channel + * while the transfer is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the transfer is in progress, thereby closing both + * channels and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If the preconditions on the parameters + * do not hold. + * @exception IOException If an I/O error occurs. + * @exception NonReadableChannelException If the source channel was not + * opened for reading. + * @exception NonWritableChannelException If this channel was not opened for + * writing. + */ + public abstract long transferFrom (ReadableByteChannel src, long position, + long count) throws IOException; + + /** + * Truncates the channel's file at size. + * + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If size is negative. + * @exception IOException If an I/O error occurs. + * @exception NonWritableChannelException If this channel was not opened for + * writing. + */ + public abstract FileChannel truncate (long size) throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/FileLockInterruptionException.java gcc-3.3/libjava/java/nio/channels/FileLockInterruptionException.java *** gcc-3.2.3/libjava/java/nio/channels/FileLockInterruptionException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/FileLockInterruptionException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* FileLockInterruptionException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class FileLockInterruptionException extends IOException + { + /** + * Creates the exception + */ + public FileLockInterruptionException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/FileLock.java gcc-3.3/libjava/java/nio/channels/FileLock.java *** gcc-3.2.3/libjava/java/nio/channels/FileLock.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/FileLock.java 2003-02-11 04:13:47.000000000 +0000 *************** *** 0 **** --- 1,137 ---- + /* FileLock.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + + /** + * @since 1.4 + */ + public abstract class FileLock + { + FileChannel channel; + long position; + long size; + boolean shared; + + /** + * Initializes the file lock. + * + * @exception IllegalArgumentException If the preconditions on the parameters do not hold + */ + protected FileLock (FileChannel channel, long position, long size, + boolean shared) + { + if (position < 0 || + size < 0) + throw new IllegalArgumentException (); + + this.channel = channel; + this.position = position; + this.size = size; + this.shared = shared; + } + + /** + * Tells whether or not this lock is valid. + */ + public abstract boolean isValid(); + + /** + * Releases this lock. + * + * @exception IOException If an error occurs + * @exception ClosedChannelException If the locked channel is no longer open. + */ + public abstract void release () throws IOException; + + /** + * Returns the file channel upon whose file this lock is held. + */ + public final FileChannel channel () + { + return channel; + } + + /** + * Tells whether this lock is shared. + */ + public final boolean isShared () + { + return shared; + } + + /** + * Tells whether or not this lock overlaps the given lock range. + */ + public final boolean overlaps (long position, long size) + { + if (position > this.position +this.size) + return false; + + if (position + size < this.position) + return false; + + return true; + } + + /** + * Returns the position within the file of the first byte of the + * locked region. + */ + public final long position () + { + return position; + } + + /** + * Returns the size of the locked region in bytes. + */ + public final long size () + { + return size; + } + + /** + * Returns a string describing the range, type, and validity of this lock. + */ + public final String toString () + { + return "file-lock:pos=" + position + "size=" + size; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/GatheringByteChannel.java gcc-3.3/libjava/java/nio/channels/GatheringByteChannel.java *** gcc-3.2.3/libjava/java/nio/channels/GatheringByteChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/GatheringByteChannel.java 2002-10-07 07:59:12.000000000 +0000 *************** *** 0 **** --- 1,79 ---- + /* GatheringByteChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.nio.ByteBuffer; + import java.io.IOException; + + public interface GatheringByteChannel + extends WritableByteChannel + { + /** + * Writes a sequence of bytes to this channel from a subsequence of + * the given buffers + * + * @exception AsynchronousCloseException If another thread closes this + * channel while the write operation is in progress + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the write operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status + * @exception ClosedChannelException If this channel is closed + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold + * @exception IOException If an error occurs + * @exception NonWritableChannelException If this channel was not opened for + * writing + */ + public long write(ByteBuffer[] srcs, int offset, int length) + throws IOException; + + /** + * Writes a sequence of bytes to this channel from the given buffers + * + * @exception AsynchronousCloseException If another thread closes this + * channel while the write operation is in progress + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the write operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status + * @exception ClosedChannelException If this channel is closed + * @exception IOException If an error occurs + * @exception NonWritableChannelException If this channel was not opened for + * writing + */ + public long write(ByteBuffer[] srcs) throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/IllegalBlockingModeException.java gcc-3.3/libjava/java/nio/channels/IllegalBlockingModeException.java *** gcc-3.2.3/libjava/java/nio/channels/IllegalBlockingModeException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/IllegalBlockingModeException.java 2002-09-25 09:05:53.000000000 +0000 *************** *** 0 **** --- 1,56 ---- + /* IllegalBlockingModeException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + * + * Written using JDK 1.4.1 Online API from Sun + * Status: JDK 1.4 complete + */ + public class IllegalBlockingModeException extends IllegalStateException + { + /** + * Creates the exception + */ + public IllegalBlockingModeException() + { + super(); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/IllegalSelectorException.java gcc-3.3/libjava/java/nio/channels/IllegalSelectorException.java *** gcc-3.2.3/libjava/java/nio/channels/IllegalSelectorException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/IllegalSelectorException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* IllegalSelectorException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class IllegalSelectorException extends IllegalArgumentException + { + /** + * Creates the exception + */ + public IllegalSelectorException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/InterruptibleChannel.java gcc-3.3/libjava/java/nio/channels/InterruptibleChannel.java *** gcc-3.2.3/libjava/java/nio/channels/InterruptibleChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/InterruptibleChannel.java 2002-10-07 07:59:12.000000000 +0000 *************** *** 0 **** --- 1,50 ---- + /* InterruptibleChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + + public interface InterruptibleChannel extends Channel + { + /** + * Closes this channel + * + * @exception IOException If an error occurs + */ + void close() throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/NoConnectionPendingException.java gcc-3.3/libjava/java/nio/channels/NoConnectionPendingException.java *** gcc-3.2.3/libjava/java/nio/channels/NoConnectionPendingException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/NoConnectionPendingException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* NoConnectionPendingException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class NoConnectionPendingException extends IllegalStateException + { + /** + * Creates the exception + */ + public NoConnectionPendingException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/NonReadableChannelException.java gcc-3.3/libjava/java/nio/channels/NonReadableChannelException.java *** gcc-3.2.3/libjava/java/nio/channels/NonReadableChannelException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/NonReadableChannelException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* NonReadableChannelException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class NonReadableChannelException extends IllegalStateException + { + /** + * Creates the exception + */ + public NonReadableChannelException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/NonWritableChannelException.java gcc-3.3/libjava/java/nio/channels/NonWritableChannelException.java *** gcc-3.2.3/libjava/java/nio/channels/NonWritableChannelException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/NonWritableChannelException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* NonWritableChannelException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class NonWritableChannelException extends IllegalStateException + { + /** + * Creates the exception + */ + public NonWritableChannelException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/NotYetBoundException.java gcc-3.3/libjava/java/nio/channels/NotYetBoundException.java *** gcc-3.2.3/libjava/java/nio/channels/NotYetBoundException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/NotYetBoundException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* NotYetBoundException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class NotYetBoundException extends IllegalStateException + { + /** + * Creates the exception + */ + public NotYetBoundException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/NotYetConnectedException.java gcc-3.3/libjava/java/nio/channels/NotYetConnectedException.java *** gcc-3.2.3/libjava/java/nio/channels/NotYetConnectedException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/NotYetConnectedException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* NotYetConnectedException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class NotYetConnectedException extends IllegalStateException + { + /** + * Creates the exception + */ + public NotYetConnectedException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/OverlappingFileLockException.java gcc-3.3/libjava/java/nio/channels/OverlappingFileLockException.java *** gcc-3.2.3/libjava/java/nio/channels/OverlappingFileLockException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/OverlappingFileLockException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* OverlappingFileLockException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class OverlappingFileLockException extends IllegalStateException + { + /** + * Creates the exception + */ + public OverlappingFileLockException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/Pipe.java gcc-3.3/libjava/java/nio/channels/Pipe.java *** gcc-3.2.3/libjava/java/nio/channels/Pipe.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/Pipe.java 2003-02-11 03:59:37.000000000 +0000 *************** *** 0 **** --- 1,122 ---- + /* Pipe.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + import java.nio.channels.spi.AbstractSelectableChannel; + import java.nio.channels.spi.SelectorProvider; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class Pipe + { + public abstract static class SinkChannel + extends AbstractSelectableChannel + implements WritableByteChannel, GatheringByteChannel + { + /** + * Initializes the channel. + */ + protected SinkChannel (SelectorProvider provider) + { + super (provider); + } + + /** + * Returns an operation set that is valid on this channel. + * + * The only valid operation on this channel is @see SelectionKey.OP_WRITE. + */ + public final int validOps () + { + return SelectionKey.OP_WRITE; + } + } + + public abstract static class SourceChannel + extends AbstractSelectableChannel + implements ReadableByteChannel, ScatteringByteChannel + { + /** + * Initializes the channel. + */ + protected SourceChannel (SelectorProvider provider) + { + super (provider); + } + + /** + * Returns an operation set that is valid on this channel. + * + * The only valid operation on this channel is @see SelectionKey.OP_READ. + */ + public final int validOps () + { + return SelectionKey.OP_READ; + } + } + + /** + * Initializes the pipe. + */ + protected Pipe() + { + } + + /** + * Opens a pipe. + * + * @exception IOException If an error occurs + */ + public static Pipe open() throws IOException + { + return SelectorProvider.provider ().openPipe(); + } + + /** + * Returns a pipe's sink channel. + */ + public abstract Pipe.SinkChannel sink(); + + /** + * Returns a pipe's source channel + */ + public abstract Pipe.SourceChannel source(); + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ReadableByteChannel.java gcc-3.3/libjava/java/nio/channels/ReadableByteChannel.java *** gcc-3.2.3/libjava/java/nio/channels/ReadableByteChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ReadableByteChannel.java 2002-10-07 07:59:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ReadableByteChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + import java.nio.ByteBuffer; + + public interface ReadableByteChannel extends Channel + { + /** + * Reads a sequence of bytes from this channel into the given buffer + * + * @exception AsynchronousCloseException If another thread closes this + * channel while the read operation is in progress + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the read operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status + * @exception ClosedChannelException If this channel is closed + * @exception IOException If an error occurs + * @exception NonReadableChannelException If this channel was not opened for + * reading + */ + public int read (ByteBuffer dst) throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ScatteringByteChannel.java gcc-3.3/libjava/java/nio/channels/ScatteringByteChannel.java *** gcc-3.2.3/libjava/java/nio/channels/ScatteringByteChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ScatteringByteChannel.java 2002-10-07 07:59:12.000000000 +0000 *************** *** 0 **** --- 1,79 ---- + /* ScatteringByteChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.nio.ByteBuffer; + import java.io.IOException; + + public interface ScatteringByteChannel + extends ReadableByteChannel + { + /** + * Reads a sequence of bytes from this channel into a subsequence of the + * given buffers + * + * @exception AsynchronousCloseException If another thread closes this + * channel while the write operation is in progress + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the write operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status + * @exception ClosedChannelException If this channel is closed + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold + * @exception IOException If an error occurs + * @exception NonReadableChannelException If this channel was not opened for + * reading + */ + public long read(ByteBuffer[] srcs, int offset, int length) + throws IOException; + + /** + * Reads a sequence of bytes from this channel into the given buffers + * + * @exception AsynchronousCloseException If another thread closes this + * channel while the write operation is in progress + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the write operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status + * @exception ClosedChannelException If this channel is closed + * @exception IOException If an error occurs + * @exception NonReadableChannelException If this channel was not opened for + * reading + */ + public long read(ByteBuffer[] srcs) throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/SelectableChannel.java gcc-3.3/libjava/java/nio/channels/SelectableChannel.java *** gcc-3.2.3/libjava/java/nio/channels/SelectableChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/SelectableChannel.java 2003-02-11 03:59:37.000000000 +0000 *************** *** 0 **** --- 1,140 ---- + /* SelectableChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + import java.nio.channels.spi.AbstractInterruptibleChannel; + import java.nio.channels.spi.SelectorProvider; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class SelectableChannel + extends AbstractInterruptibleChannel + { + /** + * Initializes the channel. + */ + protected SelectableChannel () + { + } + + /** + * Returns the lock of this channel. + */ + public abstract Object blockingLock (); + + /** + * Adjusts this channel's blocking mode. + * + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalBlockingModeException If block is true and this channel + * is registered with one or more selectors. + * @exception IOException If an error occurs. + */ + public abstract SelectableChannel configureBlocking (boolean block) + throws IOException; + + /** + * Tells whether this channel is blocking or not. + */ + public abstract boolean isBlocking (); + + /** + * Tells whether or not this channel is currently registered with + * any selectors. + */ + public abstract boolean isRegistered (); + + /** + * Retrieves the key representing the channel's registration with + * the given selector. + */ + public abstract SelectionKey keyFor (Selector sel); + + /** + * Returns the provider that created this channel. + */ + public abstract SelectorProvider provider (); + + /** + * Registers this channel with the given selector, + * returning a selection key. + * + * @exception CancelledKeyException If this channel is currently registered + * with the given selector but the corresponding key has already been cancelled + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If a bit in ops does not correspond + * to an operation that is supported by this channel, that is, if + * set & ~validOps() != 0. + * @exception IllegalBlockingModeException If block is true and this channel + * is registered with one or more selectors. + * @exception IllegalSelectorException If this channel was not created by + * the same provider as the given selector. + */ + public final SelectionKey register (Selector sel, int ops) + throws ClosedChannelException + { + return register (sel, ops, null); + } + + /** + * Registers this channel with the given selector, + * returning a selection key. + * + * @exception CancelledKeyException If this channel is currently registered + * with the given selector but the corresponding key has already been + * cancelled. + * @exception ClosedChannelException If this channel is closed. + * @exception IllegalArgumentException If a bit in ops does not correspond + * to an operation that is supported by this channel, that is, if + * set & ~validOps() != 0. + * @exception IllegalBlockingModeException If block is true and this channel + * is registered with one or more selectors. + * @exception IllegalSelectorException If this channel was not created by + * the same provider as the given selector. + */ + public abstract SelectionKey register (Selector sel, int ops, Object att) + throws ClosedChannelException; + + /** + * Returns a set of valid operations on this channel. + */ + public abstract int validOps(); + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/SelectionKey.java gcc-3.3/libjava/java/nio/channels/SelectionKey.java *** gcc-3.2.3/libjava/java/nio/channels/SelectionKey.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/SelectionKey.java 2003-02-10 23:58:20.000000000 +0000 *************** *** 0 **** --- 1,164 ---- + /* SelectionKey.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class SelectionKey + { + public static final int OP_ACCEPT = 16; + public static final int OP_CONNECT = 8; + public static final int OP_READ = 1; + public static final int OP_WRITE = 4; + + Object attached; + + /** + * Initializes the selection key. + */ + protected SelectionKey () + { + } + + /** + * Attaches obj to the key and returns the old attached object. + */ + public final Object attach (Object obj) + { + Object old = attached; + attached = obj; + return old; + } + + /** + * Returns the object attached to the key. + */ + public final Object attachment () + { + return attached; + } + + /** + * Tests if the channel attached to this key is ready to accept + * a new socket connection. + * + * @exception CancelledKeyException If this key has been cancelled + */ + public final boolean isAcceptable () + { + return (readyOps () & OP_ACCEPT) != 0; + } + + /** + * Tests whether this key's channel has either finished, + * or failed to finish, its socket-connection operation. + * + * @exception CancelledKeyException If this key has been cancelled + */ + public final boolean isConnectable () + { + return (readyOps () & OP_CONNECT) != 0; + } + + /** + * Tests if the channel attached to the key is readable. + * + * @exception CancelledKeyException If this key has been cancelled + */ + public final boolean isReadable () + { + return (readyOps () & OP_READ) != 0; + } + + /** + * Tests if the channel attached to the key is writable. + * + * @exception CancelledKeyException If this key has been cancelled + */ + public final boolean isWritable () + { + return (readyOps () & OP_WRITE) != 0; + } + + /** + * Requests that the registration of this key's channel with + * its selector be cancelled. + */ + public abstract void cancel (); + + /** + * return the channel attached to the key. + */ + public abstract SelectableChannel channel (); + + /** + * Returns the key's interest set. + * + * @exception CancelledKeyException If this key has been cancelled + */ + public abstract int interestOps (); + + /** + * Sets this key's interest set to the given value. + * + * @exception CancelledKeyException If this key has been cancelled + * @exception IllegalArgumentException If a bit in the set does not + * correspond to an operation that is supported by this key's channel, + * that is, if set & ~(channel().validOps()) != 0 + */ + public abstract SelectionKey interestOps (int ops); + + /** + * Tells whether or not this key is valid. + */ + public abstract boolean isValid (); + + /** + * Retrieves this key's ready-operation set. + * + * @exception CancelledKeyException If this key has been cancelled + */ + public abstract int readyOps (); + + /** + * Returns the selector for which this key was created. + */ + public abstract Selector selector (); + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/Selector.java gcc-3.3/libjava/java/nio/channels/Selector.java *** gcc-3.2.3/libjava/java/nio/channels/Selector.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/Selector.java 2002-11-18 14:31:39.000000000 +0000 *************** *** 0 **** --- 1,133 ---- + /* Selector.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + import java.nio.channels.spi.SelectorProvider; + import java.util.Set; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class Selector + { + /** + * Initializes the selector. + */ + protected Selector() + { + } + + /** + * Opens a selector. + * + * @exception IOException If an error occurs + */ + public static Selector open () throws IOException + { + return SelectorProvider.provider ().openSelector (); + } + + /** + * Closes the selector. + * + * @exception IOException If an error occurs + */ + public abstract void close () throws IOException; + + /** + * Tells whether the selector is open or not. + */ + public abstract boolean isOpen (); + + /** + * Returns this selector's key set. + * + * @exception ClosedSelectorException If this selector is closed. + */ + public abstract Set keys (); + + /** + * Returns the SelectorProvider that created the selector. + */ + public abstract SelectorProvider provider (); + + /** + * Selects a set of keys whose corresponding channels are ready + * for I/O operations. + * + * @exception ClosedSelectorException If this selector is closed. + * @exception IOException If an error occurs + */ + public abstract int select () throws IOException; + + /** + * Selects a set of keys whose corresponding channels are ready + * for I/O operations. + * + * @param timeout The timeout to use. + * + * @exception ClosedSelectorException If this selector is closed. + * @exception IllegalArgumentException If the timeout value is negative. + * @exception IOException If an error occurs + */ + public abstract int select (long timeout) throws IOException; + + /** + * Returns this selector's selected-key set. + * + * @exception ClosedSelectorException If this selector is closed. + */ + public abstract Set selectedKeys (); + + /** + * Selects a set of keys whose corresponding channels are ready + * for I/O operations. + * + * @exception ClosedSelectorException If this selector is closed. + * @exception IOException If an error occurs + */ + public abstract int selectNow () throws IOException; + + /** + * Causes the first selection operation that has not yet returned to + * return immediately. + */ + public abstract Selector wakeup (); + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/ServerSocketChannel.java gcc-3.3/libjava/java/nio/channels/ServerSocketChannel.java *** gcc-3.2.3/libjava/java/nio/channels/ServerSocketChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/ServerSocketChannel.java 2003-02-11 03:59:37.000000000 +0000 *************** *** 0 **** --- 1,100 ---- + /* ServerSocketChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.nio.channels.spi.AbstractSelectableChannel; + import java.nio.channels.spi.SelectorProvider; + import java.nio.ByteOrder; + import java.nio.ByteBuffer; + import java.io.IOException; + import java.net.ServerSocket; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class ServerSocketChannel + extends AbstractSelectableChannel + { + /** + * Initializes this channel. + */ + public ServerSocketChannel (SelectorProvider provider) + { + super (provider); + } + + /** + * Accepts a connection made to this channel's socket. + * + * @exception IOException If an error occurs + * @exception AsynchronousCloseException If another thread closes this + * channel while the accept operation is in progress. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the accept operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status. + * @exception ClosedChannelException If the channel is closed. + * @exception NotYetBoundException If the channel's socket is not yet bound. + * @exception SecurityException If a security manager has been installed and + * it does not permit access to the remote endpoint of the new connection. + */ + public abstract SocketChannel accept () throws IOException; + + /** + * Retrieves the channels socket. + */ + public abstract ServerSocket socket (); + + /** + * Opens a server socket channel. + * + * @exception IOException If an error occurs + */ + public static ServerSocketChannel open () throws IOException + { + return SelectorProvider.provider ().openServerSocketChannel (); + } + + /** + * Retrieves the valid operations for this channel. + */ + public final int validOps () + { + return SelectionKey.OP_ACCEPT; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/SocketChannel.java gcc-3.3/libjava/java/nio/channels/SocketChannel.java *** gcc-3.2.3/libjava/java/nio/channels/SocketChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/SocketChannel.java 2003-02-11 03:59:37.000000000 +0000 *************** *** 0 **** --- 1,225 ---- + /* SocketChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.nio.channels.spi.AbstractSelectableChannel; + import java.nio.channels.spi.SelectorProvider; + import java.nio.ByteBuffer; + import java.io.IOException; + import java.net.Socket; + import java.net.SocketAddress; + + /** + * @author Michael Koch + * @since 1.4 + */ + abstract public class SocketChannel extends AbstractSelectableChannel + implements ByteChannel, ScatteringByteChannel, GatheringByteChannel + { + /** + * Initializes this socket. + */ + protected SocketChannel (SelectorProvider provider) + { + super (provider); + } + + /** + * Opens a socket channel. + * + * @exception IOException If an error occurs + */ + public static SocketChannel open () throws IOException + { + return SelectorProvider.provider ().openSocketChannel (); + } + + /** + * Opens a channel and connects it to a remote address. + * + * @exception AsynchronousCloseException If this channel is already connected. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the connect operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status. + * @exception IOException If an error occurs + * @exception SecurityException If a security manager has been installed and + * it does not permit access to the given remote endpoint. + * @exception UnresolvedAddressException If the given remote address is not + * fully resolved. + * @exception UnsupportedAddressTypeException If the type of the given remote + * address is not supported. + */ + public static SocketChannel open (SocketAddress remote) throws IOException + { + SocketChannel ch = open (); + + if (ch.connect (remote)) + { + } + + return ch; + } + + /** + * Reads data from the channel. + * + * @exception IOException If an error occurs + * @exception NotYetConnectedException If this channel is not yet connected. + */ + public final long read (ByteBuffer[] dsts) throws IOException + { + long b = 0; + + for (int i = 0; i < dsts.length; i++) + { + b += read (dsts [i]); + } + + return b; + } + + /** + * Writes data to the channel. + * + * @exception IOException If an error occurs + * @exception NotYetConnectedException If this channel is not yet connected. + */ + public final long write (ByteBuffer[] dsts) throws IOException + { + long b = 0; + + for (int i= 0; i < dsts.length; i++) + { + b += write (dsts [i]); + } + + return b; + } + + /** + * Retrieves the valid operations for this channel. + */ + public final int validOps () + { + return SelectionKey.OP_CONNECT | SelectionKey.OP_READ | SelectionKey.OP_WRITE; + } + + /** + * Reads data from the channel. + * + * @exception IOException If an error occurs + * @exception NotYetConnectedException If this channel is not yet connected. + */ + public abstract int read (ByteBuffer dst) throws IOException; + + /** + * Connects the channel's socket to the remote address. + * + * @exception AlreadyConnectedException If this channel is already connected. + * @exception AsynchronousCloseException If this channel is already connected. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the connect operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception ConnectionPendingException If a non-blocking connection + * operation is already in progress on this channel. + * @exception IOException If an error occurs + * @exception SecurityException If a security manager has been installed and + * it does not permit access to the given remote endpoint. + * @exception UnresolvedAddressException If the given remote address is not + * fully resolved. + * @exception UnsupportedAddressTypeException If the type of the given remote + * address is not supported. + */ + public abstract boolean connect (SocketAddress remote) throws IOException; + + /** + * Finishes the process of connecting a socket channel. + * + * @exception AsynchronousCloseException If this channel is already connected. + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the connect operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status. + * @exception ClosedChannelException If this channel is closed. + * @exception IOException If an error occurs + * @exception NoConnectionPendingException If this channel is not connected + * and a connection operation has not been initiated. + */ + public abstract boolean finishConnect () throws IOException; + + /** + * Tells whether or not the channel's socket is connected. + */ + public abstract boolean isConnected (); + + /** + * Tells whether or not a connection operation is in progress on this channel. + */ + public abstract boolean isConnectionPending (); + + /** + * Reads data from the channel. + * + * @exception IOException If an error occurs + * @exception NotYetConnectedException If this channel is not yet connected. + */ + public abstract long read (ByteBuffer[] dsts, int offset, int length) + throws IOException; + + /** + * Retrieves the channel's socket. + */ + public abstract Socket socket (); + + /** + * Writes data to the channel. + * + * @exception IOException If an error occurs + * @exception NotYetConnectedException If this channel is not yet connected. + */ + public abstract int write (ByteBuffer src) throws IOException; + + /** + * Writes data to the channel. + * + * @exception IOException If an error occurs + * @exception NotYetConnectedException If this channel is not yet connected. + */ + public abstract long write (ByteBuffer[] srcs, int offset, int length) + throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java gcc-3.3/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java *** gcc-3.2.3/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java 2003-02-11 03:59:37.000000000 +0000 *************** *** 0 **** --- 1,106 ---- + /* AbstractInterruptibleChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels.spi; + + import java.io.IOException; + import java.nio.channels.AsynchronousCloseException; + import java.nio.channels.Channel; + import java.nio.channels.InterruptibleChannel; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class AbstractInterruptibleChannel + implements Channel, InterruptibleChannel + { + boolean opened = true; + + /** + * Initializes the channel. + */ + protected AbstractInterruptibleChannel () + { + } + + /** + * Marks the beginning of an I/O operation that might block indefinitely. + */ + protected final void begin () + { + } + + /** + * Closes the channel. + * + * @exception IOException If an error occurs + */ + public final void close () throws IOException + { + opened = false; + implCloseChannel (); + } + + /** + * Marks the end of an I/O operation that might block indefinitely. + * + * @exception AsynchronousCloseException If the channel was asynchronously + * closed. + * @exception ClosedByInterruptException If the thread blocked in the + * I/O operation was interrupted. + */ + protected final void end (boolean completed) + throws AsynchronousCloseException + { + } + + /** + * Closes the channel. + * + * @exception IOException If an error occurs + */ + protected abstract void implCloseChannel () throws IOException; + + /** + * Tells whether or not this channel is open. + */ + public final boolean isOpen () + { + return opened; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/spi/AbstractSelectableChannel.java gcc-3.3/libjava/java/nio/channels/spi/AbstractSelectableChannel.java *** gcc-3.2.3/libjava/java/nio/channels/spi/AbstractSelectableChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/spi/AbstractSelectableChannel.java 2003-02-11 03:59:37.000000000 +0000 *************** *** 0 **** --- 1,215 ---- + /* AbstractSelectableChannel.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels.spi; + + import java.io.IOException; + import java.nio.channels.ClosedChannelException; + import java.nio.channels.SelectableChannel; + import java.nio.channels.SelectionKey; + import java.nio.channels.Selector; + import java.util.LinkedList; + import java.util.List; + import java.util.ListIterator; + + public abstract class AbstractSelectableChannel extends SelectableChannel + { + int registered; + boolean blocking = true; + Object LOCK = new Object (); + SelectorProvider provider; + List keys; + + /** + * Initializes the channel + */ + protected AbstractSelectableChannel (SelectorProvider provider) + { + this.provider = provider; + } + + /** + * Retrieves the object upon which the configureBlocking and register + * methods synchronize. + */ + public final Object blockingLock () + { + return LOCK; + } + + /** + * Adjusts this channel's blocking mode. + */ + public final SelectableChannel configureBlocking (boolean block) + throws IOException + { + synchronized (LOCK) + { + blocking = true; + implConfigureBlocking (block); + } + + return this; + } + + /** + * Closes this channel. + * + * @exception IOException If an error occurs + */ + protected final void implCloseChannel () throws IOException + { + implCloseSelectableChannel (); + } + + /** + * Closes this selectable channel. + */ + protected abstract void implCloseSelectableChannel () throws IOException; + + /** + * Adjusts this channel's blocking mode. + */ + protected abstract void implConfigureBlocking (boolean block) + throws IOException; + + /** + * Tells whether or not every I/O operation on this channel will block + * until it completes. + */ + public final boolean isBlocking() + { + return blocking; + } + + /** + * Tells whether or not this channel is currently registered with + * any selectors. + */ + public final boolean isRegistered() + { + return registered > 0; + } + + /** + * Retrieves the key representing the channel's registration with the + * given selector. + */ + public final SelectionKey keyFor(Selector selector) + { + try + { + return register (selector, 0, null); + } + catch (Exception e) + { + return null; + } + } + + /** + * Returns the provider that created this channel. + */ + public final SelectorProvider provider () + { + return provider; + } + + private SelectionKey locate (Selector selector) + { + if (keys == null) + return null; + + SelectionKey k = null; + ListIterator it = keys.listIterator (); + + while (it.hasNext ()) + { + k = (SelectionKey) it.next (); + if (k.selector () == selector) + { + return k; + } + } + + return k; + } + + private void add (SelectionKey key) + { + if (keys == null) + { + keys = new LinkedList (); + } + + keys.add (key); + } + + /** + * Registers this channel with the given selector, returning a selection key. + * + * @exception ClosedChannelException If the channel is already closed. + */ + public final SelectionKey register (Selector selin, int ops, Object att) + throws ClosedChannelException + { + if (!isOpen ()) + throw new ClosedChannelException(); + + SelectionKey k = null; + AbstractSelector selector = (AbstractSelector) selin; + + synchronized (LOCK) + { + k = locate (selector); + + if (k != null) + { + k.attach (att); + } + else + { + k = selector.register (this, ops, att); + + if (k != null) + add (k); + } + } + + return k; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/spi/AbstractSelectionKey.java gcc-3.3/libjava/java/nio/channels/spi/AbstractSelectionKey.java *** gcc-3.2.3/libjava/java/nio/channels/spi/AbstractSelectionKey.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/spi/AbstractSelectionKey.java 2002-11-13 13:52:47.000000000 +0000 *************** *** 0 **** --- 1,75 ---- + /* AbstractSelectionKey.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels.spi; + + import java.nio.channels.SelectionKey; + + /** + * @since 1.4 + */ + public abstract class AbstractSelectionKey + extends SelectionKey + { + boolean ok = true; + + /** + * Initializes the key. + */ + protected AbstractSelectionKey () + { + } + + /** + * Cancels this key. + */ + public final void cancel () + { + if (ok) + selector ().selectedKeys ().add (this); + + ok = false; + } + + /** + * Tells whether this key is valid or not. + */ + public final boolean isValid () + { + return ok; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/spi/AbstractSelector.java gcc-3.3/libjava/java/nio/channels/spi/AbstractSelector.java *** gcc-3.2.3/libjava/java/nio/channels/spi/AbstractSelector.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/spi/AbstractSelector.java 2002-11-13 13:52:47.000000000 +0000 *************** *** 0 **** --- 1,114 ---- + /* AbstractSelector.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels.spi; + + import java.io.IOException; + import java.nio.channels.SelectionKey; + import java.nio.channels.Selector; + import java.util.List; + import java.util.Set; + + public abstract class AbstractSelector extends Selector + { + boolean closed = false; + SelectorProvider provider; + + /** + * Initializes the slector. + */ + protected AbstractSelector (SelectorProvider provider) + { + this.provider = provider; + } + + /** + * Marks the beginning of an I/O operation that might block indefinitely. + */ + protected final void begin () + { + } + + /** + * Closes the channel. + * + * @exception IOException If an error occurs + */ + public final void close () throws IOException + { + if (closed) + return; + + closed = true; + implCloseSelector (); + } + + /** + * Tells whether this channel is open or not. + */ + public final boolean isOpen () + { + return ! closed; + } + + protected final void deregister (AbstractSelectionKey key) + { + cancelledKeys ().remove (key); + } + + protected final void end() + { + } + + public final SelectorProvider provider () + { + return provider; + } + + protected final Set cancelledKeys() + { + return null; + } + + /** + * Closes the channel. + */ + protected abstract void implCloseSelector () throws IOException; + + protected abstract SelectionKey register (AbstractSelectableChannel ch, + int ops, Object att); + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/spi/SelectorProvider.java gcc-3.3/libjava/java/nio/channels/spi/SelectorProvider.java *** gcc-3.2.3/libjava/java/nio/channels/spi/SelectorProvider.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/spi/SelectorProvider.java 2003-03-01 22:57:53.000000000 +0000 *************** *** 0 **** --- 1,107 ---- + /* SelectorProvider.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels.spi; + + import gnu.java.nio.SelectorProviderImpl; + import java.io.IOException; + import java.nio.channels.DatagramChannel; + import java.nio.channels.Pipe; + import java.nio.channels.ServerSocketChannel; + import java.nio.channels.SocketChannel; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class SelectorProvider + { + static SelectorProvider pr; + + /** + * Initializes the selector provider. + * + * @exception SecurityException If a security manager has been installed and + * it denies @see RuntimePermission ("selectorProvider"). + */ + protected SelectorProvider () + { + SecurityManager sm = System.getSecurityManager (); + if (sm != null) + sm.checkPermission (new RuntimePermission ("selectorProvider")); + } + + /** + * Opens a datagram channel. + */ + public abstract DatagramChannel openDatagramChannel () throws IOException; + + /** + * Opens a pipe. + */ + public abstract Pipe openPipe () throws IOException; + + /** + * Opens a selector. + */ + public abstract AbstractSelector openSelector () throws IOException; + + /** + * Opens a server socket channel. + */ + public abstract ServerSocketChannel openServerSocketChannel () + throws IOException; + + /** + * Opens a socket channel. + */ + public abstract SocketChannel openSocketChannel () throws IOException; + + /** + * Returns the system-wide default selector provider for this invocation + * of the Java virtual machine. + */ + public static SelectorProvider provider () + { + if (pr == null) + { + pr = new SelectorProviderImpl (); + } + + return pr; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/UnresolvedAddressException.java gcc-3.3/libjava/java/nio/channels/UnresolvedAddressException.java *** gcc-3.2.3/libjava/java/nio/channels/UnresolvedAddressException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/UnresolvedAddressException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* UnresolvedAddressException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class UnresolvedAddressException extends IllegalArgumentException + { + /** + * Creates the exception + */ + public UnresolvedAddressException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/UnsupportedAddressTypeException.java gcc-3.3/libjava/java/nio/channels/UnsupportedAddressTypeException.java *** gcc-3.2.3/libjava/java/nio/channels/UnsupportedAddressTypeException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/UnsupportedAddressTypeException.java 2002-11-21 10:45:14.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* UnsupportedAddressTypeException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class UnsupportedAddressTypeException extends IllegalArgumentException + { + /** + * Creates the exception + */ + public UnsupportedAddressTypeException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/channels/WritableByteChannel.java gcc-3.3/libjava/java/nio/channels/WritableByteChannel.java *** gcc-3.2.3/libjava/java/nio/channels/WritableByteChannel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/channels/WritableByteChannel.java 2002-10-07 07:59:12.000000000 +0000 *************** *** 0 **** --- 1,60 ---- + /* WritableByteChannel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.channels; + + import java.io.IOException; + import java.nio.ByteBuffer; + + public interface WritableByteChannel + extends Channel + { + /** + * Writes a sequence of bytes to this channel from the given buffer + * + * @exception AsynchronousCloseException If another thread closes this + * channel while the write operation is in progress + * @exception ClosedByInterruptException If another thread interrupts the + * current thread while the write operation is in progress, thereby closing + * the channel and setting the current thread's interrupt status + * @exception ClosedChannelException If this channel is closed + * @exception IOException If an error occurs + * @exception NonWritableChannelException If this channel was not opened for + * writing + */ + public int write(ByteBuffer src) throws IOException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/CharBuffer.java gcc-3.3/libjava/java/nio/CharBuffer.java *** gcc-3.2.3/libjava/java/nio/CharBuffer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/CharBuffer.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,425 ---- + /* CharBuffer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio; + + import gnu.java.nio.CharBufferImpl; + + /** + * @since 1.4 + */ + public abstract class CharBuffer extends Buffer + implements Comparable, CharSequence + { + protected char [] backing_buffer; + + /** + * Allocates a new CharBuffer object with a given capacity. + */ + public static CharBuffer allocate (int capacity) + { + return new CharBufferImpl (capacity, 0, capacity); + } + + /** + * Wraps a character array into a CharBuffer object. + * + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold + */ + final public static CharBuffer wrap (char[] array, int offset, int length) + { + return new CharBufferImpl (array, offset, length); + } + + /** + * Wraps a character sequence into a CharBuffer object. + */ + final public static CharBuffer wrap (CharSequence a) + { + return wrap (a, 0, a.length ()); + } + + /** + * Wraps a character sequence into a CharBuffer object. + * + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold + */ + final public static CharBuffer wrap (CharSequence a, int offset, int length) + { + if ((offset < 0) + || (offset > a.length ()) + || (length < 0) + || (length > (a.length () - offset))) + throw new IndexOutOfBoundsException (); + + char [] buffer = new char [a.length ()]; + + for (int i = offset; i < length; i++) + { + buffer [i] = a.charAt (i); + } + + return wrap (buffer, offset, length); + } + + /** + * Wraps a character array into a CharBuffer object. + */ + final public static CharBuffer wrap (char[] array) + { + return wrap (array, 0, array.length); + } + + CharBuffer (int cap, int lim, int pos, int mark) + { + super (cap, lim, pos, mark); + } + + /** + * Relative get method. + * + * @exception BufferUnderflowException If the buffer's current position is + * not smaller than its limit. + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold + */ + public CharBuffer get (char[] dst, int offset, int length) + { + for (int i = offset; i < offset + length; i++) + { + dst [i] = get (); + } + + return this; + } + + /** + * Relative get method. + * + * @exception BufferUnderflowException If there are fewer than length + * characters remaining in this buffer. + */ + public CharBuffer get (char[] dst) + { + return get (dst, 0, dst.length); + } + + /** + * @exception BufferOverflowException If there are fewer than length of + * source buffer characters remaining in this buffer. + * @exception IllegalArgumentException If the source buffer is this buffer. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public CharBuffer put (CharBuffer src) + { + if (src == this) + throw new IllegalArgumentException (); + + if (src.length () > 0) + { + char [] toPut = new char [src.length ()]; + src.get (toPut); + src.put (toPut); + } + + return this; + } + + /** + * @exception BufferOverflowException If there are fewer then length + * characters remaining in this buffer. + * @exception IndexOutOfBoundsException If the preconditions on the offset + * and length parameters do not hold + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public CharBuffer put (char[] src, int offset, int length) + { + if (offset < 0 + || offset >= src.length + || length < 0 + || length >= (src.length - offset)) + throw new IndexOutOfBoundsException (); + + // Put nothing into this buffer when not enough space left. + if (length > remaining ()) + throw new BufferOverflowException (); + + for (int i = offset; i < offset + length; i++) + { + put (src [i]); + } + + return this; + } + + /** + * Relative put method. + * + * @exception BufferOverflowException If there are fewer then length of the + * array characters remaining in this buffer. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public final CharBuffer put (char[] src) + { + return put (src, 0, src.length); + } + + /** + * Tells wether this is buffer is backed by an array or not. + */ + public final boolean hasArray () + { + return (backing_buffer != null + && ! isReadOnly ()); + } + + /** + * Returns the array that backs this buffer. + * + * @exception ReadOnlyBufferException If this buffer is read-only. + * @exception UnsupportedOperationException If this buffer is not backed + * by an accessible array. + */ + public final char[] array () + { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + + return backing_buffer; + } + + /** + * Returns the offset to the position of a character in this buffer. + * + * @exception ReadOnlyBufferException If this buffer is read-only. + * @exception UnsupportedOperationException If this buffer is not backed + * by an accessible array. + */ + public final int arrayOffset () + { + if (backing_buffer == null) + throw new UnsupportedOperationException (); + + if (isReadOnly ()) + throw new ReadOnlyBufferException (); + + return 0; + } + + /** + * Calculates a hash code for this buffer- + */ + public int hashCode () + { + // FIXME: Check what SUN calculates here. + return super.hashCode (); + } + + /** + * Checks if this buffer is equal to obj. + */ + public boolean equals (Object obj) + { + if (obj instanceof CharBuffer) + return compareTo (obj) == 0; + + return false; + } + + /** + * Compares two character buffer objects. + * + * @exception ClassCastException If obj is not an object derived from + * CharBuffer. + */ + public int compareTo(Object obj) + { + CharBuffer a = (CharBuffer) obj; + + if (a.remaining () != remaining ()) + return 1; + + if (! hasArray () || ! a.hasArray ()) + return 1; + + int r = remaining (); + int i1 = position (); + int i2 = a.position (); + + for (int i = 0; i < r; i++) + { + int t = (int) (get (i1)- a.get (i2)); + + if (t != 0) + return (int) t; + } + + return 0; + } + + /** + * Relative get method. + * + * @exception BufferUnderflowException If there are no remaining characters + * in this buffer. + */ + public abstract char get (); + + /** + * Relative put method. + * + * @exception BufferOverflowException If there no remaining characters in + * this buffer. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public abstract CharBuffer put (char b); + + /** + * Absolute get method. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit. + */ + public abstract char get (int index); + + /** + * Absolute put method. + * + * @exception IndexOutOfBoundsException If index is negative or not smaller + * than the buffer's limit. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public abstract CharBuffer put (int index, char b); + + /** + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public abstract CharBuffer compact (); + + /** + * Tells wether this buffer is direct or not. + */ + public abstract boolean isDirect (); + + public abstract CharBuffer slice (); + + /** + * Duplicates this buffer. + */ + public abstract CharBuffer duplicate (); + + /** + * Returns this buffer made read-only. + */ + public abstract CharBuffer asReadOnlyBuffer (); + + /** + * Returns the remaining content of the buffer as a string. + */ + public String toString () + { + return new String (array (), position (), length ()); + } + + /** + * Returns the length of the remaining chars in this buffer. + */ + public final int length () + { + return remaining (); + } + + /** + * Returns the byte order of this buffer. + */ + public abstract ByteOrder order (); + + /** + * Creates a new character buffer that represents the specified subsequence + * of this buffer, relative to the current position. + * + * @exception IndexOutOfBoundsException If the preconditions on start and + * end do not hold. + */ + public abstract CharSequence subSequence (int start, int length); + + /** + * Relative put method. + * + * @exception BufferOverflowException If there is insufficient space in this + * buffer. + * @exception IndexOutOfBoundsException If the preconditions on the start + * and end parameters do not hold. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public CharBuffer put (String str, int start, int length) + { + return put (str.toCharArray (), start, length); + } + + /** + * Relative put method. + * + * @exception BufferOverflowException If there is insufficient space in this + * buffer. + * @exception ReadOnlyBufferException If this buffer is read-only. + */ + public final CharBuffer put (String str) + { + return put (str, 0, str.length ()); + } + + /** + * Returns the character at position() + index. + * + * @exception IndexOutOfBoundsException If index is negative not smaller than + * remaining(). + */ + public final char charAt (int index) + { + if (index < 0 + || index >= remaining ()) + throw new IndexOutOfBoundsException (); + + return get (position () + index); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/CharacterCodingException.java gcc-3.3/libjava/java/nio/charset/CharacterCodingException.java *** gcc-3.2.3/libjava/java/nio/charset/CharacterCodingException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/CharacterCodingException.java 2002-11-11 07:12:07.000000000 +0000 *************** *** 0 **** --- 1,53 ---- + /* CharacterCodingException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + import java.io.IOException; + + /** + * @since 1.4 + */ + public class CharacterCodingException extends IOException + { + /** + * Creates the exception + */ + public CharacterCodingException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/CharsetDecoder.java gcc-3.3/libjava/java/nio/charset/CharsetDecoder.java *** gcc-3.2.3/libjava/java/nio/charset/CharsetDecoder.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/CharsetDecoder.java 2002-11-13 12:21:26.000000000 +0000 *************** *** 0 **** --- 1,312 ---- + /* CharsetDecoder.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + + /** + * @author Jesse Rosenstock + * @since 1.4 + */ + public abstract class CharsetDecoder + { + private static final int STATE_RESET = 0; + private static final int STATE_CODING = 1; + private static final int STATE_END = 2; + private static final int STATE_FLUSHED = 3; + + private static final String DEFAULT_REPLACEMENT = "\uFFFD"; + + private final Charset charset; + private final float averageCharsPerByte; + private final float maxCharsPerByte; + private String replacement; + + private int state = STATE_RESET; + + private CodingErrorAction malformedInputAction + = CodingErrorAction.REPORT; + private CodingErrorAction unmappableCharacterAction + = CodingErrorAction.REPORT; + + private CharsetDecoder (Charset cs, float averageCharsPerByte, + float maxCharsPerByte, String replacement) + { + if (averageCharsPerByte <= 0.0f) + throw new IllegalArgumentException ("Non-positive averageCharsPerByte"); + if (maxCharsPerByte <= 0.0f) + throw new IllegalArgumentException ("Non-positive maxCharsPerByte"); + + this.charset = cs; + this.averageCharsPerByte + = averageCharsPerByte; + this.maxCharsPerByte + = maxCharsPerByte; + this.replacement = replacement; + implReplaceWith (replacement); + } + + protected CharsetDecoder (Charset cs, float averageCharsPerByte, + float maxCharsPerByte) + { + this (cs, averageCharsPerByte, maxCharsPerByte, DEFAULT_REPLACEMENT); + } + + public final float averageCharsPerByte () + { + return averageCharsPerByte; + } + + public final Charset charset () + { + return charset; + } + + public final CharBuffer decode (ByteBuffer in) + throws CharacterCodingException + { + // XXX: Sun's Javadoc seems to contradict itself saying an + // IllegalStateException is thrown "if a decoding operation is already + // in progress" and also that "it resets this Decoder". + // Should we check to see that the state is reset, or should we + // call reset()? + if (state != STATE_RESET) + throw new IllegalStateException (); + + // REVIEW: Using max instead of average may allocate a very large + // buffer. Maybe we should do something more efficient? + int remaining = in.remaining (); + int n = (int) (remaining * maxCharsPerByte ()); + CharBuffer out = CharBuffer.allocate (n); + + if (remaining == 0) + { + state = STATE_FLUSHED; + return out; + } + + CoderResult cr = decode (in, out, true); + if (cr.isError ()) + cr.throwException (); + + cr = flush (out); + if (cr.isError ()) + cr.throwException (); + + out.flip (); + return out; + } + + public final CoderResult decode (ByteBuffer in, CharBuffer out, + boolean endOfInput) + { + int newState = endOfInput ? STATE_END : STATE_CODING; + // XXX: Need to check for "previous step was an invocation [not] of + // this method with a value of true for the endOfInput parameter but + // a return value indicating an incomplete decoding operation" + // XXX: We will not check the previous return value, just + // that the previous call passed true for endOfInput + if (state != STATE_RESET && state != STATE_CODING + && !(endOfInput && state == STATE_END)) + throw new IllegalStateException (); + state = newState; + + for (;;) + { + CoderResult cr; + try + { + cr = decodeLoop (in, out); + } + catch (RuntimeException e) + { + throw new CoderMalfunctionError (e); + } + + if (cr.isOverflow ()) + return cr; + + if (cr.isUnderflow ()) + { + if (endOfInput && in.hasRemaining ()) + cr = CoderResult.malformedForLength (in.remaining ()); + else + return cr; + } + + CodingErrorAction action = cr.isMalformed () + ? malformedInputAction + : unmappableCharacterAction; + + if (action == CodingErrorAction.REPORT) + return cr; + + if (action == CodingErrorAction.REPLACE) + { + if (out.remaining () < replacement.length ()) + return CoderResult.OVERFLOW; + out.put (replacement); + } + + in.position (in.position () + cr.length ()); + } + } + + protected abstract CoderResult decodeLoop (ByteBuffer in, CharBuffer out); + + public Charset detectedCharset () + { + throw new UnsupportedOperationException (); + } + + public final CoderResult flush (CharBuffer out) + { + // It seems weird that you can flush after reset, but Sun's javadoc + // says an IllegalStateException is thrown "If the previous step of the + // current decoding operation was an invocation neither of the reset + // method nor ... of the three-argument decode method with a value of + // true for the endOfInput parameter." + // Further note that flush() only requires that there not be + // an IllegalStateException if the previous step was a call to + // decode with true as the last argument. It does not require + // that the call succeeded. decode() does require that it succeeded. + // XXX: test this to see if reality matches javadoc + if (state != STATE_RESET && state != STATE_END) + throw new IllegalStateException (); + + state = STATE_FLUSHED; + return implFlush (out); + } + + protected CoderResult implFlush (CharBuffer out) + { + return CoderResult.UNDERFLOW; + } + + public final CharsetDecoder onMalformedInput (CodingErrorAction newAction) + { + if (newAction == null) + throw new IllegalArgumentException ("Null action"); + + malformedInputAction = newAction; + implOnMalformedInput (newAction); + return this; + } + + protected void implOnMalformedInput (CodingErrorAction newAction) + { + // default implementation does nothing + } + + protected void implOnUnmappableCharacter (CodingErrorAction newAction) + { + // default implementation does nothing + } + + protected void implReplaceWith (String newReplacement) + { + // default implementation does nothing + } + + protected void implReset () + { + // default implementation does nothing + } + + public boolean isAutoDetecting () + { + return false; + } + + public boolean isCharsetDetected () + { + throw new UnsupportedOperationException (); + } + + public CodingErrorAction malformedInputAction () + { + return malformedInputAction; + } + + public final float maxCharsPerByte () + { + return maxCharsPerByte; + } + + public final CharsetDecoder onUnmappableCharacter + (CodingErrorAction newAction) + { + if (newAction == null) + throw new IllegalArgumentException ("Null action"); + + unmappableCharacterAction = newAction; + implOnUnmappableCharacter (newAction); + return this; + } + + public final String replacement () + { + return replacement; + } + + public final CharsetDecoder replaceWith (String newReplacement) + { + if (newReplacement == null) + throw new IllegalArgumentException ("Null replacement"); + if (newReplacement.length () == 0) + throw new IllegalArgumentException ("Empty replacement"); + // XXX: what about maxCharsPerByte? + + this.replacement = newReplacement; + implReplaceWith (newReplacement); + return this; + } + + public final CharsetDecoder reset () + { + state = STATE_RESET; + implReset (); + return this; + } + + public CodingErrorAction unmappableCharacterAction () + { + return unmappableCharacterAction; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/CharsetEncoder.java gcc-3.3/libjava/java/nio/charset/CharsetEncoder.java *** gcc-3.2.3/libjava/java/nio/charset/CharsetEncoder.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/CharsetEncoder.java 2003-02-18 00:04:00.000000000 +0000 *************** *** 0 **** --- 1,365 ---- + /* CharsetEncoder.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + + /** + * @author Jesse Rosenstock + * @since 1.4 + */ + public abstract class CharsetEncoder + { + private static final int STATE_RESET = 0; + private static final int STATE_CODING = 1; + private static final int STATE_END = 2; + private static final int STATE_FLUSHED = 3; + + private static final byte[] DEFAULT_REPLACEMENT = {(byte)'?'}; + + private final Charset charset; + private final float averageBytesPerChar; + private final float maxBytesPerChar; + private byte[] replacement; + + private int state = STATE_RESET; + + private CodingErrorAction malformedInputAction + = CodingErrorAction.REPORT; + private CodingErrorAction unmappableCharacterAction + = CodingErrorAction.REPORT; + + protected CharsetEncoder (Charset cs, float averageBytesPerChar, + float maxBytesPerChar) + { + this (cs, averageBytesPerChar, maxBytesPerChar, DEFAULT_REPLACEMENT); + } + + protected CharsetEncoder (Charset cs, float averageBytesPerChar, + float maxBytesPerChar, byte[] replacement) + { + if (averageBytesPerChar <= 0.0f) + throw new IllegalArgumentException ("Non-positive averageBytesPerChar"); + if (maxBytesPerChar <= 0.0f) + throw new IllegalArgumentException ("Non-positive maxBytesPerChar"); + + this.charset = cs; + this.averageBytesPerChar + = averageBytesPerChar; + this.maxBytesPerChar + = maxBytesPerChar; + this.replacement = replacement; + implReplaceWith (replacement); + } + + public final float averageBytesPerChar () + { + return averageBytesPerChar; + } + + public boolean canEncode (char c) + { + CharBuffer cb = CharBuffer.allocate (1).put (c); + cb.flip (); + return canEncode (cb); + } + + public boolean canEncode (CharSequence cs) + { + CharBuffer cb; + if (cs instanceof CharBuffer) + cb = ((CharBuffer) cs).duplicate (); + else + cb = CharBuffer.wrap (cs); + return canEncode (cb); + } + + private boolean canEncode (CharBuffer cb) + { + // It is an error if a coding operation is "in progress" + // I take that to mean the state is not reset or flushed. + // XXX: check "in progress" everywhere + if (state == STATE_FLUSHED) + reset (); + else if (state != STATE_RESET) + throw new IllegalStateException (); + + CodingErrorAction oldMalformedInputAction = malformedInputAction; + CodingErrorAction oldUnmappableCharacterAction + = unmappableCharacterAction; + + try + { + if (oldMalformedInputAction != CodingErrorAction.REPORT) + onMalformedInput (CodingErrorAction.REPORT); + if (oldUnmappableCharacterAction != CodingErrorAction.REPORT) + onUnmappableCharacter (CodingErrorAction.REPORT); + } + catch (Exception e) + { + return false; + } + finally + { + if (oldMalformedInputAction != CodingErrorAction.REPORT) + onMalformedInput (oldMalformedInputAction); + if (oldUnmappableCharacterAction != CodingErrorAction.REPORT) + onUnmappableCharacter (oldUnmappableCharacterAction); + } + + return true; + } + + public final Charset charset () + { + return charset; + } + + public final ByteBuffer encode (CharBuffer in) + throws CharacterCodingException + { + // XXX: Sun's Javadoc seems to contradict itself saying an + // IllegalStateException is thrown "if a decoding operation is already + // in progress" and also that "it resets this Encoder". + // Should we check to see that the state is reset, or should we + // call reset()? + if (state != STATE_RESET) + throw new IllegalStateException (); + + // REVIEW: Using max instead of average may allocate a very large + // buffer. Maybe we should do something more efficient? + int remaining = in.remaining (); + int n = (int) (remaining * maxBytesPerChar ()); + ByteBuffer out = ByteBuffer.allocate (n); + + if (remaining == 0) + { + state = STATE_FLUSHED; + return out; + } + + CoderResult cr = encode (in, out, true); + if (cr.isError ()) + cr.throwException (); + + cr = flush (out); + if (cr.isError ()) + cr.throwException (); + + out.flip (); + return out; + } + + public final CoderResult encode (CharBuffer in, ByteBuffer out, + boolean endOfInput) + { + int newState = endOfInput ? STATE_END : STATE_CODING; + // XXX: Need to check for "previous step was an invocation [not] of + // this method with a value of true for the endOfInput parameter but + // a return value indicating an incomplete decoding operation" + // XXX: We will not check the previous return value, just + // that the previous call passed true for endOfInput + if (state != STATE_RESET && state != STATE_CODING + && !(endOfInput && state == STATE_END)) + throw new IllegalStateException (); + state = newState; + + for (;;) + { + CoderResult cr; + try + { + cr = encodeLoop (in, out); + } + catch (RuntimeException e) + { + throw new CoderMalfunctionError (e); + } + + if (cr.isOverflow ()) + return cr; + + if (cr.isUnderflow ()) + { + if (endOfInput && in.hasRemaining ()) + cr = CoderResult.malformedForLength (in.remaining ()); + else + return cr; + } + + CodingErrorAction action = cr.isMalformed () + ? malformedInputAction + : unmappableCharacterAction; + + if (action == CodingErrorAction.REPORT) + return cr; + + if (action == CodingErrorAction.REPLACE) + { + if (out.remaining () < replacement.length) + return CoderResult.OVERFLOW; + out.put (replacement); + } + + in.position (in.position () + cr.length ()); + } + } + + protected abstract CoderResult encodeLoop (CharBuffer in, ByteBuffer out); + + public final CoderResult flush (ByteBuffer out) + { + // It seems weird that you can flush after reset, but Sun's javadoc + // says an IllegalStateException is thrown "If the previous step of the + // current decoding operation was an invocation neither of the reset + // method nor ... of the three-argument encode method with a value of + // true for the endOfInput parameter." + // Further note that flush() only requires that there not be + // an IllegalStateException if the previous step was a call to + // encode with true as the last argument. It does not require + // that the call succeeded. encode() does require that it succeeded. + // XXX: test this to see if reality matches javadoc + if (state != STATE_RESET && state != STATE_END) + throw new IllegalStateException (); + + state = STATE_FLUSHED; + return implFlush (out); + } + + protected CoderResult implFlush (ByteBuffer out) + { + return CoderResult.UNDERFLOW; + } + + protected void implOnMalformedInput (CodingErrorAction newAction) + { + // default implementation does nothing + } + + protected void implOnUnmappableCharacter (CodingErrorAction newAction) + { + // default implementation does nothing + } + + protected void implReplaceWith (byte[] newReplacement) + { + // default implementation does nothing + } + + protected void implReset () + { + // default implementation does nothing + } + + public boolean isLegalReplacement (byte[] replacement) + { + // TODO: cache the decoder + // error actions will be REPORT after construction + CharsetDecoder decoder = charset.newDecoder (); + ByteBuffer bb = ByteBuffer.wrap (replacement); + CharBuffer cb + = CharBuffer.allocate ((int) (replacement.length + * decoder.maxCharsPerByte ())); + return !decoder.decode (bb, cb, true).isError (); + } + + public CodingErrorAction malformedInputAction () + { + return malformedInputAction; + } + + public final float maxBytesPerChar () + { + return maxBytesPerChar; + } + + public final CharsetEncoder onMalformedInput (CodingErrorAction newAction) + { + if (newAction == null) + throw new IllegalArgumentException ("Null action"); + + malformedInputAction = newAction; + implOnMalformedInput (newAction); + return this; + } + + public CodingErrorAction unmappableCharacterAction () + { + return unmappableCharacterAction; + } + + public final CharsetEncoder onUnmappableCharacter + (CodingErrorAction newAction) + { + if (newAction == null) + throw new IllegalArgumentException ("Null action"); + + unmappableCharacterAction = newAction; + implOnUnmappableCharacter (newAction); + return this; + } + + public final byte[] replacement () + { + return replacement; + } + + public final CharsetEncoder replaceWith (byte[] newReplacement) + { + if (newReplacement == null) + throw new IllegalArgumentException ("Null replacement"); + if (newReplacement.length == 0) + throw new IllegalArgumentException ("Empty replacement"); + // XXX: what about maxBytesPerChar? + + if (!isLegalReplacement (newReplacement)) + throw new IllegalArgumentException ("Illegal replacement"); + + this.replacement = newReplacement; + implReplaceWith (newReplacement); + return this; + } + + public final CharsetEncoder reset () + { + state = STATE_RESET; + implReset (); + return this; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/Charset.java gcc-3.3/libjava/java/nio/charset/Charset.java *** gcc-3.2.3/libjava/java/nio/charset/Charset.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/Charset.java 2003-02-18 00:04:00.000000000 +0000 *************** *** 0 **** --- 1,286 ---- + /* Charset.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + import java.nio.ByteBuffer; + import java.nio.CharBuffer; + import java.nio.charset.spi.CharsetProvider; + import java.util.Collections; + import java.util.HashSet; + import java.util.Iterator; + import java.util.Locale; + import java.util.Set; + import java.util.SortedMap; + import java.util.TreeMap; + import gnu.java.nio.charset.Provider; + + /** + * @author Jesse Rosenstock + * @since 1.4 + */ + public abstract class Charset implements Comparable + { + private static CharsetEncoder cachedEncoder; + private static CharsetDecoder cachedDecoder; + + static + { + synchronized (Charset.class) + { + cachedEncoder = null; + cachedDecoder = null; + } + } + + private final String canonicalName; + private final String[] aliases; + + protected Charset (String canonicalName, String[] aliases) + { + checkName (canonicalName); + if (aliases != null) + { + int n = aliases.length; + for (int i = 0; i < n; ++i) + checkName (aliases[i]); + } + + this.canonicalName = canonicalName; + this.aliases = aliases; + } + + /** + * @throws IllegalCharsetNameException if the name is illegal + */ + private static void checkName (String name) + { + int n = name.length (); + + if (n == 0) + throw new IllegalCharsetNameException (name); + + char ch = name.charAt (0); + if (!(('A' <= ch && ch <= 'Z') + || ('a' <= ch && ch <= 'z') + || ('0' <= ch && ch <= '9'))) + throw new IllegalCharsetNameException (name); + + for (int i = 1; i < n; ++i) + { + ch = name.charAt (i); + if (!(('A' <= ch && ch <= 'Z') + || ('a' <= ch && ch <= 'z') + || ('0' <= ch && ch <= '9') + || ch == '-' || ch == '.' || ch == ':' || ch == '_')) + throw new IllegalCharsetNameException (name); + } + } + + public static boolean isSupported (String charsetName) + { + return charsetForName (charsetName) != null; + } + + public static Charset forName (String charsetName) + { + Charset cs = charsetForName (charsetName); + if (cs == null) + throw new UnsupportedCharsetException (charsetName); + return cs; + } + + /** + * Retrieves a charset for the given charset name. + * + * @return A charset object for the charset with the specified name, or + * null if no such charset exists. + * + * @throws IllegalCharsetNameException if the name is illegal + */ + private static Charset charsetForName (String charsetName) + { + checkName (charsetName); + return provider ().charsetForName (charsetName); + } + + public static SortedMap availableCharsets () + { + TreeMap charsets = new TreeMap (String.CASE_INSENSITIVE_ORDER); + + for (Iterator i = provider ().charsets (); i.hasNext (); ) + { + Charset cs = (Charset) i.next (); + charsets.put (cs.name (), cs); + } + + return Collections.unmodifiableSortedMap (charsets); + } + + // XXX: we need to support multiple providers, reading them from + // java.nio.charset.spi.CharsetProvider in the resource directory + // META-INF/services + private static final CharsetProvider provider () + { + return Provider.provider (); + } + + public final String name () + { + return canonicalName; + } + + public final Set aliases () + { + if (aliases == null) + return Collections.EMPTY_SET; + + // should we cache the aliasSet instead? + int n = aliases.length; + HashSet aliasSet = new HashSet (n); + for (int i = 0; i < n; ++i) + aliasSet.add (aliases[i]); + return Collections.unmodifiableSet (aliasSet); + } + + public String displayName () + { + return canonicalName; + } + + public String displayName (Locale locale) + { + return canonicalName; + } + + public final boolean isRegistered () + { + return (!canonicalName.startsWith ("x-") + && !canonicalName.startsWith ("X-")); + } + + public abstract boolean contains (Charset cs); + + public abstract CharsetDecoder newDecoder (); + + public abstract CharsetEncoder newEncoder (); + + public boolean canEncode () + { + return true; + } + + public final ByteBuffer encode (CharBuffer cb) + { + try + { + // NB: This implementation serializes different threads calling + // Charset.encode(), a potential performance problem. It might + // be better to remove the cache, or use ThreadLocal to cache on + // a per-thread basis. + synchronized (Charset.class) + { + if (cachedEncoder == null) + { + cachedEncoder = newEncoder () + .onMalformedInput (CodingErrorAction.REPLACE) + .onUnmappableCharacter (CodingErrorAction.REPLACE); + } + + return cachedEncoder.encode (cb); + } + } + catch (CharacterCodingException e) + { + throw new AssertionError (e); + } + } + + public final ByteBuffer encode (String str) + { + return encode (CharBuffer.wrap (str)); + } + + public CharBuffer decode (ByteBuffer bb) + { + try + { + // NB: This implementation serializes different threads calling + // Charset.decode(), a potential performance problem. It might + // be better to remove the cache, or use ThreadLocal to cache on + // a per-thread basis. + synchronized (Charset.class) + { + if (cachedDecoder == null) + { + cachedDecoder = newDecoder () + .onMalformedInput (CodingErrorAction.REPLACE) + .onUnmappableCharacter (CodingErrorAction.REPLACE); + } + + return cachedDecoder.decode (bb); + } + } + catch (CharacterCodingException e) + { + throw new AssertionError (e); + } + } + + public final int compareTo (Object ob) + { + return canonicalName.compareToIgnoreCase (((Charset) ob).canonicalName); + } + + public final int hashCode () + { + return canonicalName.hashCode (); + } + + public final boolean equals (Object ob) + { + if (ob instanceof Charset) + return canonicalName.equalsIgnoreCase (((Charset) ob).canonicalName); + else + return false; + } + + public final String toString () + { + return canonicalName; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/CoderMalfunctionError.java gcc-3.3/libjava/java/nio/charset/CoderMalfunctionError.java *** gcc-3.2.3/libjava/java/nio/charset/CoderMalfunctionError.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/CoderMalfunctionError.java 2002-11-11 07:12:07.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* CoderMalfunctionError.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + /** + * @since 1.4 + */ + public class CoderMalfunctionError extends Error + { + /** + * Creates the error + */ + public CoderMalfunctionError(Exception cause) + { + super (cause); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/CoderResult.java gcc-3.3/libjava/java/nio/charset/CoderResult.java *** gcc-3.2.3/libjava/java/nio/charset/CoderResult.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/CoderResult.java 2002-11-18 21:31:12.000000000 +0000 *************** *** 0 **** --- 1,193 ---- + /* CoderResult.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + import java.lang.ref.WeakReference; + import java.nio.BufferOverflowException; + import java.nio.BufferUnderflowException; + import java.util.HashMap; + + /** + * @author Jesse Rosenstock + * @since 1.4 + */ + public class CoderResult + { + private static final int TYPE_MALFORMED = 0; + private static final int TYPE_OVERFLOW = 1; + private static final int TYPE_UNDERFLOW = 2; + private static final int TYPE_UNMAPPABLE = 3; + + public static final CoderResult OVERFLOW + = new CoderResult (TYPE_OVERFLOW, 0); + public static final CoderResult UNDERFLOW + = new CoderResult (TYPE_UNDERFLOW, 0); + + private static final String[] names + = { "MALFORMED", "OVERFLOW", "UNDERFLOW", "UNMAPPABLE" }; + + private static final Cache malformedCache + = new Cache () + { + protected CoderResult make (int length) + { + return new CoderResult (TYPE_MALFORMED, length); + } + }; + + private static final Cache unmappableCache + = new Cache () + { + protected CoderResult make (int length) + { + return new CoderResult (TYPE_UNMAPPABLE, length); + } + }; + + private final int type; + private final int length; + + private CoderResult (int type, int length) + { + this.type = type; + this.length = length; + } + + public boolean isError () + { + return length > 0; + } + + public boolean isMalformed () + { + return type == TYPE_MALFORMED; + } + + public boolean isOverflow () + { + return type == TYPE_OVERFLOW; + } + + public boolean isUnderflow () + { + return type == TYPE_UNDERFLOW; + } + + public boolean isUnmappable () + { + return type == TYPE_UNMAPPABLE; + } + + public int length () + { + if (length <= 0) + throw new UnsupportedOperationException (); + else + return length; + } + + public static CoderResult malformedForLength (int length) + { + return malformedCache.get (length); + } + + public void throwException () + throws CharacterCodingException + { + switch (type) + { + case TYPE_MALFORMED: + throw new MalformedInputException (length); + case TYPE_OVERFLOW: + throw new BufferOverflowException (); + case TYPE_UNDERFLOW: + throw new BufferUnderflowException (); + case TYPE_UNMAPPABLE: + throw new UnmappableCharacterException (length); + } + } + + public String toString () + { + String name = names[type]; + return (length > 0) ? name + '[' + length + ']' : name; + } + + public static CoderResult unmappableForLength (int length) + { + return unmappableCache.get (length); + } + + private abstract static class Cache + { + private final HashMap cache; + + private Cache () + { + // If we didn't synchronize on this, then cache would be initialized + // without holding a lock. Undefined behavior would occur if the + // first thread to call get(int) was not the same as the one that + // called the constructor. + synchronized (this) + { + cache = new HashMap (); + } + } + + private synchronized CoderResult get (int length) + { + if (length <= 0) + throw new IllegalArgumentException ("Non-positive length"); + + Integer len = new Integer (length); + CoderResult cr = null; + Object o; + if ((o = cache.get (len)) != null) + cr = (CoderResult) ((WeakReference) o).get (); + if (cr == null) + { + cr = make (length); + cache.put (len, new WeakReference (cr)); + } + + return cr; + } + + protected abstract CoderResult make (int length); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/CodingErrorAction.java gcc-3.3/libjava/java/nio/charset/CodingErrorAction.java *** gcc-3.2.3/libjava/java/nio/charset/CodingErrorAction.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/CodingErrorAction.java 2002-11-11 07:12:07.000000000 +0000 *************** *** 0 **** --- 1,66 ---- + /* CodingErrorAction.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + public class CodingErrorAction + { + public static final CodingErrorAction IGNORE + = new CodingErrorAction("ignore"); + public static final CodingErrorAction REPLACE + = new CodingErrorAction("replace"); + public static final CodingErrorAction REPORT + = new CodingErrorAction("report"); + + private final String name; + + /** + * Private constructor only used to create the constant CodingErrorActions. + */ + private CodingErrorAction(String name) + { + this.name = name; + } + + /** + * Returns the name of the CodingErrorAction. + */ + public String toString () + { + return name; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/IllegalCharsetNameException.java gcc-3.3/libjava/java/nio/charset/IllegalCharsetNameException.java *** gcc-3.2.3/libjava/java/nio/charset/IllegalCharsetNameException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/IllegalCharsetNameException.java 2003-02-11 04:07:05.000000000 +0000 *************** *** 0 **** --- 1,69 ---- + /* IllegalCharsetNameException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class IllegalCharsetNameException extends IllegalArgumentException + { + /** + * Compatible with JDK 1.4+ + */ + private static final long serialVersionUID = 1457525358470002989L; + + String charsetName; + + /** + * Creates the exception + */ + public IllegalCharsetNameException (String charsetName) + { + super (); + this.charsetName = charsetName; + } + + /** + * Retrieves the illegal charset name + */ + public String getCharsetName () + { + return charsetName; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/MalformedInputException.java gcc-3.3/libjava/java/nio/charset/MalformedInputException.java *** gcc-3.2.3/libjava/java/nio/charset/MalformedInputException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/MalformedInputException.java 2002-11-11 07:12:07.000000000 +0000 *************** *** 0 **** --- 1,71 ---- + /* MalformedInputException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + /** + * @since 1.4 + */ + public class MalformedInputException extends CharacterCodingException + { + private int inputLength; + + /** + * Creates the exception + */ + public MalformedInputException (int inputLength) + { + super (); + this.inputLength = inputLength; + } + + /** + * Retrieves the illegal charset name + */ + public int getInputLength () + { + return inputLength; + } + + /** + * Returns the detail message string of this throwable + */ + public String getMessage () + { + return "Input length = " + inputLength; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/spi/CharsetProvider.java gcc-3.3/libjava/java/nio/charset/spi/CharsetProvider.java *** gcc-3.2.3/libjava/java/nio/charset/spi/CharsetProvider.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/spi/CharsetProvider.java 2002-11-01 12:03:40.000000000 +0000 *************** *** 0 **** --- 1,88 ---- + /* CharsetProvider.java -- charset service provider interface + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset.spi; + + import java.nio.charset.Charset; + import java.util.Iterator; + + /** + * This class allows an implementor to provide additional character sets. The + * subclass must have a nullary constructor, and be attached to charset + * implementation classes. These extensions are loaded via the context class + * loader. To provide the charset extension, all files named + * META-INF/services/java.nio.charset.spi.CharsetProvider are + * read from the classpath. Each one should be a UTF-8 encoded list of + * fully-qualified names of concrete subclasses of this class; whitespace is + * ignored, and '#' starts comments. Duplicates are ignored. The + * implementations must be accessible to the classloader that requests them. + * + * @author Eric Blake + * @see Charset + * @since 1.4 + * @status updated to 1.4 + */ + public abstract class CharsetProvider + { + /** + * Initialize a new charset provider. This performs a security check on + * RuntimePermission("charsetProvider"). + * + * @throws SecurityException if building a new set is not allowed + */ + protected CharsetProvider() + { + SecurityManager s = System.getSecurityManager(); + if (s != null) + s.checkPermission(new RuntimePermission("charsetProvider")); + } + + /** + * Returns an iterator over the charsets defined by this provider. + * + * @return the iterator + * @see Charset#availableCharsets() + */ + public abstract Iterator charsets(); + + /** + * Returns the named charset, by canonical name or alias. + * + * @return the charset, or null if not supported + */ + public abstract Charset charsetForName(String name); + } // class CharsetProvider diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/UnmappableCharacterException.java gcc-3.3/libjava/java/nio/charset/UnmappableCharacterException.java *** gcc-3.2.3/libjava/java/nio/charset/UnmappableCharacterException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/UnmappableCharacterException.java 2002-11-11 07:12:07.000000000 +0000 *************** *** 0 **** --- 1,71 ---- + /* UnmappableCharacterException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + /** + * @since 1.4 + */ + public class UnmappableCharacterException extends CharacterCodingException + { + private int inputLength; + + /** + * Creates the exception + */ + public UnmappableCharacterException (int inputLength) + { + super (); + this.inputLength = inputLength; + } + + /** + * Retrieves the illegal charset name + */ + public int getInputLength () + { + return inputLength; + } + + /** + * Returns the detail message string of this throwable + */ + public String getMessage () + { + return "Input length = " + inputLength; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/charset/UnsupportedCharsetException.java gcc-3.3/libjava/java/nio/charset/UnsupportedCharsetException.java *** gcc-3.2.3/libjava/java/nio/charset/UnsupportedCharsetException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/charset/UnsupportedCharsetException.java 2003-02-11 04:07:05.000000000 +0000 *************** *** 0 **** --- 1,69 ---- + /* UnsupportedCharsetException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio.charset; + + /** + * @author Michael Koch + * @since 1.4 + */ + public class UnsupportedCharsetException extends IllegalArgumentException + { + /** + * Compatible with JDK 1.4+ + */ + private static final long serialVersionUID = 1490765524727386367L; + + String charsetName; + + /** + * Creates the exception + */ + public UnsupportedCharsetException (String charsetName) + { + super (); + this.charsetName = charsetName; + } + + /** + * Retrieves the illegal charset name + */ + public String getCharsetName () + { + return charsetName; + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/nio/DoubleBuffer.java gcc-3.3/libjava/java/nio/DoubleBuffer.java *** gcc-3.2.3/libjava/java/nio/DoubleBuffer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/nio/DoubleBuffer.java 2003-03-01 21:06:22.000000000 +0000 *************** *** 0 **** --- 1,203 ---- + /* DoubleBuffer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.nio; + + import gnu.java.nio.DoubleBufferImpl; + + public abstract class DoubleBuffer extends Buffer implements Comparable + { + protected double [] backing_buffer; + protected int array_offset; + + public static DoubleBuffer allocateDirect(int capacity) + { + throw new Error ("direct buffers are not implemented"); + } + + public static DoubleBuffer allocate(int capacity) + { + return new DoubleBufferImpl(capacity, 0, capacity); + } + + final public static DoubleBuffer wrap (double[] array, int offset, int length) + { + return new DoubleBufferImpl(array, offset, length); + } + + final public static DoubleBuffer wrap(String a) + { + int len = a.length(); + double[] buffer = new double[len]; + + for (int i=0;ibind in an ActivationSystem. ! * ! * @author unknown ! * @see Naming ! * @see ActivationSystem ! * @since 1.1 ! */ ! public class AccessException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 6314925228044966088l; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public AccessException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public AccessException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/ActivateFailedException.java gcc-3.3/libjava/java/rmi/activation/ActivateFailedException.java *** gcc-3.2.3/libjava/java/rmi/activation/ActivateFailedException.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/ActivateFailedException.java 2002-06-17 19:11:34.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ActivateFailedException.java -- thrown when activation fails ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.rmi.activation; *** 39,53 **** import java.rmi.RemoteException; ! public class ActivateFailedException ! extends RemoteException { ! ! public ActivateFailedException(String s) { ! super(s); ! } ! public ActivateFailedException(String s, Exception ex) { ! super(s, ex); ! } } --- 39,76 ---- import java.rmi.RemoteException; ! /** ! * Thrown when activation fails on a remote call to an activatable object. ! * ! * @author unknown ! * @since 1.2 ! * @status updated to 1.4 ! */ ! public class ActivateFailedException extends RemoteException ! { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 4863550261346652506L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public ActivateFailedException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param ex the cause + */ + public ActivateFailedException(String s, Exception ex) + { + super(s, ex); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/ActivationDesc.java gcc-3.3/libjava/java/rmi/activation/ActivationDesc.java *** gcc-3.2.3/libjava/java/rmi/activation/ActivationDesc.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/ActivationDesc.java 2002-10-02 21:21:37.000000000 +0000 *************** package java.rmi.activation; *** 40,47 **** import java.io.Serializable; import java.rmi.MarshalledObject; ! public final class ActivationDesc ! implements Serializable { private ActivationGroupID groupid; private String classname; --- 40,48 ---- import java.io.Serializable; import java.rmi.MarshalledObject; ! public final class ActivationDesc implements Serializable ! { ! static final long serialVersionUID = 7455834104417690957L; private ActivationGroupID groupid; private String classname; diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/ActivationException.java gcc-3.3/libjava/java/rmi/activation/ActivationException.java *** gcc-3.2.3/libjava/java/rmi/activation/ActivationException.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/ActivationException.java 2002-06-17 19:11:34.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ActivationException.java -- general Activation exception ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,88 **** package java.rmi.activation; ! import java.io.PrintStream; ! import java.io.PrintWriter; ! ! public class ActivationException ! extends Exception { ! ! public Throwable detail; ! ! public ActivationException() { ! super(); ! } ! ! public ActivationException(String s) { ! super(s); ! } ! public ActivationException(String s, Throwable ex) { ! super(s); ! detail = ex; ! } ! public String getMessage() { ! if (detail == null) { ! return (super.getMessage()); ! } ! else { ! return (super.getMessage() + ":" + detail.getMessage()); ! } ! } ! public void printStackTrace(PrintStream s) { ! if (detail != null) { ! detail.printStackTrace(s); ! } ! super.printStackTrace(s); ! } ! public void printStackTrace() { ! printStackTrace(System.err); ! } ! public void printStackTrace(PrintWriter s) { ! if (detail != null) { ! detail.printStackTrace(s); ! } ! super.printStackTrace(s); ! } } --- 37,122 ---- package java.rmi.activation; ! /** ! * General exception class for java.rmi.activation. ! * ! * @author unknown ! * @since 1.2 ! * @status updated to 1.4 ! */ ! public class ActivationException extends Exception ! { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -4320118837291406071L; ! /** ! * The cause of this exception. This pre-dates the exception chaining ! * of Throwable; and although you can change this field, you are wiser ! * to leave it alone. ! * ! * @serial the exception cause ! */ ! public Throwable detail; ! /** ! * Create an exception with no message, and cause initialized to null. ! */ ! public ActivationException() ! { ! this(null, null); ! } ! /** ! * Create an exception with the given message, and cause initialized to null. ! * ! * @param s the message ! */ ! public ActivationException(String s) ! { ! this(s, null); ! } ! /** ! * Create an exception with the given message and cause. ! * ! * @param s the message ! * @param ex the cause ! */ ! public ActivationException(String s, Throwable ex) ! { ! super(s, ex); ! detail = ex; ! } ! /** ! * This method returns a message indicating what went wrong, in this ! * format: ! * super.getMessage() + (detail == null ? "" ! * : "; nested exception is:\n\t" + detail). ! * ! * @return the chained message ! */ ! public String getMessage() ! { ! if (detail == this || detail == null) ! return super.getMessage(); ! return super.getMessage() + "; nested exception is:\n\t" + detail; ! } + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the detail field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if detail == this, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/ActivationGroupDesc.java gcc-3.3/libjava/java/rmi/activation/ActivationGroupDesc.java *** gcc-3.2.3/libjava/java/rmi/activation/ActivationGroupDesc.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/ActivationGroupDesc.java 2002-10-02 21:21:37.000000000 +0000 *************** import java.io.Serializable; *** 41,48 **** import java.util.Properties; import java.rmi.MarshalledObject; ! public final class ActivationGroupDesc ! implements Serializable { public static class CommandEnvironment implements Serializable { --- 41,49 ---- import java.util.Properties; import java.rmi.MarshalledObject; ! public final class ActivationGroupDesc implements Serializable ! { ! static final long serialVersionUID = -4936225423168276595L; public static class CommandEnvironment implements Serializable { diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/ActivationGroupID.java gcc-3.3/libjava/java/rmi/activation/ActivationGroupID.java *** gcc-3.2.3/libjava/java/rmi/activation/ActivationGroupID.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/ActivationGroupID.java 2002-10-02 21:21:37.000000000 +0000 *************** package java.rmi.activation; *** 39,46 **** import java.io.Serializable; ! public class ActivationGroupID ! implements Serializable { private ActivationSystem system; --- 39,47 ---- import java.io.Serializable; ! public class ActivationGroupID implements Serializable ! { ! static final long serialVersionUID = -1648432278909740833L; private ActivationSystem system; diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/ActivationID.java gcc-3.3/libjava/java/rmi/activation/ActivationID.java *** gcc-3.2.3/libjava/java/rmi/activation/ActivationID.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/ActivationID.java 2002-10-02 21:21:37.000000000 +0000 *************** import java.io.Serializable; *** 41,48 **** import java.rmi.Remote; import java.rmi.RemoteException; ! public class ActivationID ! implements Serializable { private Activator activator; --- 41,49 ---- import java.rmi.Remote; import java.rmi.RemoteException; ! public class ActivationID implements Serializable ! { ! static final long serialVersionUID = -4608673054848209235L; private Activator activator; diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/UnknownGroupException.java gcc-3.3/libjava/java/rmi/activation/UnknownGroupException.java *** gcc-3.2.3/libjava/java/rmi/activation/UnknownGroupException.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/UnknownGroupException.java 2002-06-17 19:11:34.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnknownGroupException.java -- thrown on an invalid ActivationGroupID ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,47 **** package java.rmi.activation; ! public class UnknownGroupException ! extends ActivationException { ! ! public UnknownGroupException(String s) { ! super(s); ! } } --- 37,69 ---- package java.rmi.activation; ! /** ! * Thrown when an ActivationGroupID parameter is invalid or ! * unknown. ! * ! * @author unknown ! * @see Activatable ! * @see ActivationGroup ! * @see ActivationID ! * @see ActivationMonitor ! * @see ActivationSystem ! * @since 1.2 ! * @status updated to 1.4 ! */ ! public class UnknownGroupException extends ActivationException ! { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 7056094974750002460L; + /** + * Create an exception with a message. + * + * @param s the message + */ + public UnknownGroupException(String s) + { + super(s); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/activation/UnknownObjectException.java gcc-3.3/libjava/java/rmi/activation/UnknownObjectException.java *** gcc-3.2.3/libjava/java/rmi/activation/UnknownObjectException.java 2002-01-22 22:40:25.000000000 +0000 --- gcc-3.3/libjava/java/rmi/activation/UnknownObjectException.java 2002-06-17 19:11:34.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnknownObjectException.java -- thrown on an invalid ActivationID ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,47 **** package java.rmi.activation; ! public class UnknownObjectException ! extends ActivationException { ! ! public UnknownObjectException(String s) { ! super(s); ! } } --- 37,69 ---- package java.rmi.activation; ! /** ! * Thrown when an ActivationID parameter is invalid or unknown. ! * ! * @author unknown ! * @see Activatable ! * @see ActivationGroup ! * @see ActivationID ! * @see ActivationMonitor ! * @see ActivationSystem ! * @see Activator ! * @since 1.2 ! * @status updated to 1.4 ! */ ! public class UnknownObjectException extends ActivationException ! { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 3425547551622251430L; + /** + * Create an exception with an error message. + * + * @param s the message + */ + public UnknownObjectException(String s) + { + super(s); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/AlreadyBoundException.java gcc-3.3/libjava/java/rmi/AlreadyBoundException.java *** gcc-3.2.3/libjava/java/rmi/AlreadyBoundException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/AlreadyBoundException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* AlreadyBoundException.java -- thrown if a binding is already bound ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,51 **** package java.rmi; ! public class AlreadyBoundException ! extends Exception { ! ! public AlreadyBoundException() { ! super(); ! } ! public AlreadyBoundException(String s) { ! super (s); ! } } --- 37,73 ---- package java.rmi; ! /** ! * Thrown on an attempt to bind an object in the registry that is already ! * bound. ! * ! * @author unknown ! * @see Naming#bind(String, Remote) ! * @see Registry#bind(String, Remote) ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class AlreadyBoundException extends Exception ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 9218657361741657110L; ! /** ! * Create an exception with no message. ! */ ! public AlreadyBoundException() ! { ! } + /** + * Create an exception with a message. + * + * @param s the message + */ + public AlreadyBoundException(String s) + { + super(s); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/ConnectException.java gcc-3.3/libjava/java/rmi/ConnectException.java *** gcc-3.2.3/libjava/java/rmi/ConnectException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/ConnectException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ConnectException.java -- thrown if a connection is refused ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,52 **** package java.rmi; ! public class ConnectException ! extends RemoteException { ! ! ! public ConnectException(String s) { ! super(s); ! } ! public ConnectException(String s, Exception e) { ! super (s, e); ! } } --- 37,74 ---- package java.rmi; ! /** ! * Thrown if a connection is refused for a remote call. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class ConnectException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 4863550261346652506L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public ConnectException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ConnectException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/ConnectIOException.java gcc-3.3/libjava/java/rmi/ConnectIOException.java *** gcc-3.2.3/libjava/java/rmi/ConnectIOException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/ConnectIOException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ConnectIOException.java -- thrown if an IO exception occurs during connect ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,52 **** package java.rmi; ! public class ConnectIOException ! extends RemoteException { ! ! ! public ConnectIOException(String s) { ! super(s); ! } ! public ConnectIOException(String s, Exception e) { ! super (s, e); ! } } --- 37,74 ---- package java.rmi; ! /** ! * Wraps an I/O Exception thrown while connecting for a remote call. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class ConnectIOException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -8087809532704668744L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public ConnectIOException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ConnectIOException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/MarshalException.java gcc-3.3/libjava/java/rmi/MarshalException.java *** gcc-3.2.3/libjava/java/rmi/MarshalException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/MarshalException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* MarshalException.java -- wraps error while marshalling parameters ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,52 **** package java.rmi; ! public class MarshalException ! extends RemoteException { ! ! ! public MarshalException(String s) { ! super(s); ! } ! public MarshalException(String s, Exception e) { ! super (s, e); ! } } --- 37,76 ---- package java.rmi; ! /** ! * Thrown if an exception occurs while marshalling data to send in a remote ! * call. The call may not be retransmitted, if the "at most once" semantics ! * are to be preserved. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class MarshalException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 6223554758134037936L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public MarshalException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public MarshalException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/MarshalledObject.java gcc-3.3/libjava/java/rmi/MarshalledObject.java *** gcc-3.2.3/libjava/java/rmi/MarshalledObject.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/MarshalledObject.java 2002-11-07 18:01:03.000000000 +0000 *************** exception statement from your version. * *** 38,61 **** package java.rmi; import java.io.Serializable; public final class MarshalledObject ! extends Object implements Serializable { ! ! public MarshalledObject(Object obj) { ! throw new Error("Not implemented"); ! } ! ! public boolean equals(Object obj) { ! throw new Error("Not implemented"); ! } ! ! public Object get() { ! throw new Error("Not implemented"); ! } ! public int hashCode() { ! throw new Error("Not implemented"); } ! } --- 38,114 ---- package java.rmi; import java.io.Serializable; + import java.io.ByteArrayOutputStream; + import java.io.IOException; + import gnu.java.rmi.RMIMarshalledObjectInputStream; + import gnu.java.rmi.RMIMarshalledObjectOutputStream; + /** + * FIXME - doc missing + */ public final class MarshalledObject ! extends Object implements Serializable ! { ! ! //The following fields are from Java API Documentation "Serialized form" ! private static final long serialVersionUID = 8988374069173025854L; ! byte[] objBytes; ! byte[] locBytes; ! int hash; ! ! public MarshalledObject(Object obj) throws java.io.IOException ! { ! ByteArrayOutputStream objStream = new ByteArrayOutputStream(); ! RMIMarshalledObjectOutputStream stream = new RMIMarshalledObjectOutputStream(objStream); ! stream.writeObject(obj); ! stream.flush(); ! objBytes = objStream.toByteArray(); ! locBytes = stream.getLocBytes(); ! ! //The following algorithm of calculating hashCode is similar to String ! hash = 0; ! for (int i = 0; i < objBytes.length; i++) ! hash = hash * 31 + objBytes[i]; ! if(locBytes != null) ! for (int i = 0; i < locBytes.length; i++) ! hash = hash * 31 + locBytes[i]; ! } ! ! public boolean equals(Object obj) ! { ! if(obj == null || !(obj instanceof MarshalledObject) ) ! return false; ! // hashCode even differs, don't do the time-consuming comparisons ! if (obj.hashCode() != hash) ! return false; ! ! MarshalledObject aobj = (MarshalledObject)obj; ! if (objBytes == null || aobj.objBytes == null) ! return objBytes == aobj.objBytes; ! if (objBytes.length != aobj.objBytes.length) ! return false; ! for (int i = 0; i < objBytes.length; i++) ! { ! if (objBytes[i] != aobj.objBytes[i]) ! return false; ! } ! // Ignore comparison of locBytes(annotation) ! return true; ! } ! ! public Object get() ! throws java.io.IOException, java.lang.ClassNotFoundException ! { ! if(objBytes == null) ! return null; ! RMIMarshalledObjectInputStream stream = ! new RMIMarshalledObjectInputStream(objBytes, locBytes); ! return stream.readObject(); } ! ! public int hashCode() { ! return hash; ! } ! } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/NoSuchObjectException.java gcc-3.3/libjava/java/rmi/NoSuchObjectException.java *** gcc-3.2.3/libjava/java/rmi/NoSuchObjectException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/NoSuchObjectException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoSuchObjectException.java -- thrown if the remote object no longer exists ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,49 **** package java.rmi; ! public class NoSuchObjectException ! extends RemoteException { ! ! public static final long serialVersionUID = 6619395951570472985L; ! ! public NoSuchObjectException(String s) { ! super(s); ! } } --- 37,68 ---- package java.rmi; ! /** ! * Thrown on an attempt to invoke a call on an object that no longer exists ! * in the remote Virtual Machine. The call may be retransmitted and still ! * obey the semantics of "at most once". ! * ! * @author unknown ! * @see RemoteObject#toStub(Remote) ! * @see UnicastRemoteObject#unexportObject(Remote, boolean) ! * @see Activatable#unexportObject(Remote, boolean) ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class NoSuchObjectException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 6619395951570472985L; + /** + * Create an exception with a message. + * + * @param s the message + */ + public NoSuchObjectException(String s) + { + super(s); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/NotBoundException.java gcc-3.3/libjava/java/rmi/NotBoundException.java *** gcc-3.2.3/libjava/java/rmi/NotBoundException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/NotBoundException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NotBoundException.java -- attempt to use a registry name with no binding ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,53 **** package java.rmi; ! public class NotBoundException ! extends Exception { ! ! public static final long serialVersionUID = -1857741824849069317l; ! ! public NotBoundException() { ! super(); ! } ! public NotBoundException(String s) { ! super (s); ! } } --- 37,75 ---- package java.rmi; ! /** ! * Thrown on an attempt to lookup or unbind a registry name that has no ! * associated binding. ! * ! * @author unknown ! * @see Naming#lookup(String) ! * @see Naming#unbind(String) ! * @see Registry#lookup(String) ! * @see Registry#unbind(String) ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class NotBoundException extends Exception ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -1857741824849069317l; ! /** ! * Create an exception with no message. ! */ ! public NotBoundException() ! { ! } + /** + * Create an exception with a message. + * + * @param s the message + */ + public NotBoundException(String s) + { + super(s); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/RemoteException.java gcc-3.3/libjava/java/rmi/RemoteException.java *** gcc-3.2.3/libjava/java/rmi/RemoteException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/RemoteException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* RemoteException.java -- common superclass for exceptions in java.rmi ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,95 **** package java.rmi; - import java.lang.Throwable; import java.io.IOException; - import java.io.PrintStream; - import java.io.PrintWriter; - - - public class RemoteException - extends IOException { - - public static final long serialVersionUID = -5148567311918794206l; - - public Throwable detail; ! public RemoteException() { ! super(); ! detail = null; ! } ! ! public RemoteException(String s) { ! super(s); ! detail = null; ! } ! public RemoteException(String s, Throwable e) { ! super(s); ! detail = e; ! } ! public String getMessage() { ! if (detail == null) { ! return (super.getMessage()); ! } ! else { ! return (super.getMessage() + "; nested exception is: " + detail.getMessage()); ! } ! } ! public void printStackTrace(PrintStream s) { ! if (detail != null) { ! detail.printStackTrace(s); ! } ! super.printStackTrace(s); ! } ! public void printStackTrace(PrintWriter s) { ! if (detail != null) { ! detail.printStackTrace(s); ! } ! super.printStackTrace(s); ! } ! public void printStackTrace() { ! printStackTrace(System.err); ! } } --- 37,127 ---- package java.rmi; import java.io.IOException; ! /** ! * The superclass of exceptions related to RMI (remote method invocation). ! * Classes that implement java.rmi.Remote should list this ! * exception in their throws clause. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class RemoteException extends IOException ! { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -5148567311918794206l; ! /** ! * The cause of this exception. This pre-dates the exception chaining ! * of Throwable; and although you can change this field, you are wiser ! * to leave it alone. ! * ! * @serial the exception cause ! */ ! public Throwable detail; ! /** ! * Create an exception with no message, and cause initialized to null. ! */ ! public RemoteException() ! { ! this(null, null); ! } ! /** ! * Create an exception with the given message, and cause initialized to null. ! * ! * @param s the message ! */ ! public RemoteException(String s) ! { ! this(s, null); ! } ! /** ! * Create an exception with the given message and cause. ! * ! * @param s the message ! * @param ex the cause ! */ ! public RemoteException(String s, Throwable e) ! { ! super(s); ! initCause(e); ! detail = e; ! } ! /** ! * This method returns a message indicating what went wrong, in this ! * format: ! * super.getMessage() + (detail == null ? "" ! * : "; nested exception is:\n\t" + detail). ! * ! * @return the chained message ! */ ! public String getMessage() ! { ! if (detail == this || detail == null) ! return super.getMessage(); ! return super.getMessage() + "; nested exception is:\n\t" + detail; ! } + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the detail field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if detail == this, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/RMISecurityException.java gcc-3.3/libjava/java/rmi/RMISecurityException.java *** gcc-3.2.3/libjava/java/rmi/RMISecurityException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/RMISecurityException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* RMISecurityException.java -- deprecated version of SecurityException ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,53 **** package java.rmi; ! import java.lang.SecurityException; ! ! public class RMISecurityException ! extends SecurityException { ! ! public RMISecurityException(String n) { ! super(n); ! } ! public RMISecurityException(String n, String a) { ! super(n); ! } } --- 37,77 ---- package java.rmi; ! /** ! * Never thrown, but originally intended to wrap a java.lang.SecurityException. ! * ! * @author unknown ! * @since 1.1 ! * @deprecated use {@link SecurityException} instead ! * @status updated to 1.4 ! */ ! public class RMISecurityException extends SecurityException ! { ! /** ! * Compatible with JDK 1.1. ! */ ! private static final long serialVersionUID = -8433406075740433514L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! * @deprecated no longer needed ! */ ! public RMISecurityException(String n) ! { ! super(n); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + * @deprecated no longer needed + */ + public RMISecurityException(String n, String a) + { + super(n); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/ExportException.java gcc-3.3/libjava/java/rmi/server/ExportException.java *** gcc-3.2.3/libjava/java/rmi/server/ExportException.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/ExportException.java 2002-06-17 19:11:38.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ExportException.java -- an export attempt failed ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.rmi.server; *** 39,53 **** import java.rmi.RemoteException; ! public class ExportException ! extends RemoteException { ! ! public ExportException(String s) { ! super(s); ! } ! public ExportException(String s, Exception e) { ! super(s, e); ! } } --- 39,78 ---- import java.rmi.RemoteException; ! /** ! * Thrown if an attempt to export a remote object fails. ! * ! * @author unknown ! * @see UnicastRemoteObject ! * @see Activatable ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class ExportException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -9155485338494060170L; ! /** ! * Create an exception with the specified message. ! * ! * @param s the message ! */ ! public ExportException(String s) ! { ! super(s); ! } + /** + * Create an exception with the specified message and cause. + * + * @param s the message + * @param e the cause + */ + public ExportException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/LogStream.java gcc-3.3/libjava/java/rmi/server/LogStream.java *** gcc-3.2.3/libjava/java/rmi/server/LogStream.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/LogStream.java 2002-09-16 09:46:36.000000000 +0000 *************** public class LogStream *** 45,52 **** extends PrintStream { public static final int SILENT = 0; ! public static final int BRIEF = 1; ! public static final int VERBOSE = 2; private static PrintStream defStream; --- 45,52 ---- extends PrintStream { public static final int SILENT = 0; ! public static final int BRIEF = 10; ! public static final int VERBOSE = 20; private static PrintStream defStream; diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/RemoteObject.java gcc-3.3/libjava/java/rmi/server/RemoteObject.java *** gcc-3.2.3/libjava/java/rmi/server/RemoteObject.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/RemoteObject.java 2002-11-07 18:01:04.000000000 +0000 *************** import java.io.IOException; *** 48,53 **** --- 48,54 ---- import java.lang.ClassNotFoundException; import java.lang.InstantiationException; import java.lang.IllegalAccessException; + import java.lang.reflect.Constructor; public abstract class RemoteObject implements Remote, Serializable { *************** public RemoteRef getRef() { *** 68,76 **** return (ref); } ! public static Remote toStub(Remote obj) throws NoSuchObjectException { ! throw new Error("Not implemented"); ! } public int hashCode() { if (ref == null) { --- 69,90 ---- return (ref); } ! public static Remote toStub(Remote obj) throws NoSuchObjectException ! { ! Class cls = obj.getClass(); ! String classname = cls.getName(); ! ClassLoader cl = cls.getClassLoader(); ! try ! { ! Class scls = cl.loadClass(classname + "_Stub"); ! // JDK 1.2 stubs ! Class[] stubprototype = new Class[] { RemoteRef.class }; ! Constructor con = scls.getConstructor(stubprototype); ! return (Remote)(con.newInstance(new Object[]{obj})); ! } ! catch (Exception e) {} ! throw new NoSuchObjectException(obj.getClass().getName()); ! } public int hashCode() { if (ref == null) { *************** public boolean equals(Object obj) { *** 86,115 **** return (this == obj); } ! public String toString() { ! return (ref.toString()); ! } ! private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { ! String cname = in.readUTF(); ! if (!cname.equals("")) { ! cname = RemoteRef.packagePrefix + '.' + cname; ! try { ! Class cls = Class.forName(cname); ! ref = (RemoteRef)cls.newInstance(); ! } ! catch (InstantiationException e1) { ! throw new UnmarshalException("failed to create ref"); ! } ! catch (IllegalAccessException e2) { ! throw new UnmarshalException("failed to create ref"); ! } ! ref.readExternal(in); ! } ! else { ! ref = (RemoteRef)in.readObject(); ! } ! } private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { if (ref == null) { --- 100,145 ---- return (this == obj); } ! public String toString() ! { ! if (ref == null) ! return getClass ().toString (); ! return (ref.toString ()); ! } ! ! private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException ! { ! String cname = in.readUTF(); ! if (!cname.equals("")) ! { ! if (cname.equals ("UnicastRef2")) ! { ! // hack for interoperating with JDK ! cname = "UnicastRef"; ! in.read (); //some unknown UnicastRef2 field ! } ! cname = RemoteRef.packagePrefix + '.' + cname; ! try ! { ! Class cls = Class.forName(cname); ! ref = (RemoteRef)cls.newInstance(); ! } ! catch (InstantiationException e1) ! { ! throw new UnmarshalException("failed to create ref", e1); ! } ! catch (IllegalAccessException e2) ! { ! throw new UnmarshalException("failed to create ref", e2); ! } ! ref.readExternal(in); ! } ! else ! { ! ref = (RemoteRef)in.readObject(); ! } ! } private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { if (ref == null) { diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/RemoteServer.java gcc-3.3/libjava/java/rmi/server/RemoteServer.java *** gcc-3.2.3/libjava/java/rmi/server/RemoteServer.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/RemoteServer.java 2002-09-16 09:46:36.000000000 +0000 *************** import java.io.PrintStream; *** 43,48 **** --- 43,50 ---- public abstract class RemoteServer extends RemoteObject { + private static final long serialVersionUID = -4100238210092549637L; + protected RemoteServer() { super(); } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/RMIClassLoader.java gcc-3.3/libjava/java/rmi/server/RMIClassLoader.java *** gcc-3.2.3/libjava/java/rmi/server/RMIClassLoader.java 2002-02-14 23:16:07.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/RMIClassLoader.java 2003-01-02 00:14:10.000000000 +0000 *************** package java.rmi.server; *** 39,119 **** import java.net.URL; import java.net.URLConnection; import java.io.IOException; import java.io.DataInputStream; import java.net.MalformedURLException; import java.util.StringTokenizer; public class RMIClassLoader { ! static private class MyClassLoader extends ClassLoader { ! /** ! * Non-private constructor to reduce bytecode emitted. ! */ ! MyClassLoader() { } ! Class defineClass(String name, byte[] data) { ! return defineClass(name, data, 0, data.length); } } ! static private MyClassLoader loader = new MyClassLoader(); /** * @deprecated */ public static Class loadClass(String name) throws MalformedURLException, ClassNotFoundException { ! return loadClass(System.getProperty("java.rmi.server.codebase"), name); } ! public static Class loadClass(URL codebase, String name) ! throws MalformedURLException, ClassNotFoundException { ! URL u = new URL(codebase, name + ".class"); ! try { ! URLConnection conn = u.openConnection(); ! DataInputStream strm = new DataInputStream(conn.getInputStream()); ! byte data[] = new byte[conn.getContentLength()]; ! strm.readFully(data); ! return loader.defineClass(name, data); } ! catch (IOException _) { ! throw new ClassNotFoundException(name); } - } ! public static Class loadClass(String codebase, String name) ! throws MalformedURLException, ClassNotFoundException { ! StringTokenizer tok = new StringTokenizer(codebase, ":"); ! while (tok.hasMoreTokens()) { ! try ! { ! return loadClass(new URL(tok.nextToken()), name); ! } ! catch (ClassNotFoundException _) ! { ! // Ignore - try the next one. ! } } ! throw new ClassNotFoundException(name); ! } ! public static String getClassAnnotation(Class cl) ! { ! return null; // We don't yet do this. } ! /** * @deprecated */ --- 39,215 ---- import java.net.URL; import java.net.URLConnection; + import java.net.URLClassLoader; import java.io.IOException; import java.io.DataInputStream; import java.net.MalformedURLException; + import java.util.ArrayList; + import java.util.Collection; + import java.util.Collections; + import java.util.Hashtable; + import java.util.Map; import java.util.StringTokenizer; + import java.util.WeakHashMap; public class RMIClassLoader { ! static private class MyClassLoader extends URLClassLoader { ! ! private MyClassLoader(URL[] urls, ClassLoader parent, String annotation) { + super(urls, parent); + this.annotation = annotation; } ! private MyClassLoader(URL[] urls, ClassLoader parent) { ! super (urls, parent); ! this.annotation = urlToAnnotation(urls); } + + public static String urlToAnnotation(URL[] urls) + { + if (urls.length == 0) + return null; + + StringBuffer annotation = new StringBuffer(64*urls.length); + for(int i = 0; i < urls.length; i++) + { + annotation.append(urls[i].toExternalForm()); + annotation.append(' '); + } + + return annotation.toString(); + } + + public final String getClassAnnotation(){ + return annotation; + } + + private final String annotation; + } ! private static Map cacheLoaders; //map annotations to loaders ! private static Map cacheAnnotations; //map loaders to annotations + //defaultAnnotation is got from system property + // "java.rmi.server.defaultAnnotation" + private static String defaultAnnotation; + //URL object for defaultAnnotation + private static URL defaultCodebase; + //class loader for defaultAnnotation + private static MyClassLoader defaultLoader; + + static + { + // 89 is a nice prime number for Hashtable initial capacity + cacheLoaders = new Hashtable(89); + cacheAnnotations = new Hashtable(89); + + defaultAnnotation = System.getProperty("java.rmi.server.defaultAnnotation"); + try + { + if (defaultAnnotation != null) + defaultCodebase = new URL(defaultAnnotation); + } + catch(Exception _) + { + defaultCodebase = null; + } + if (defaultCodebase != null) + { + defaultLoader = new MyClassLoader(new URL[]{ defaultCodebase }, + null, defaultAnnotation); + cacheLoaders.put(defaultAnnotation, defaultLoader); + } + } + /** * @deprecated */ public static Class loadClass(String name) throws MalformedURLException, ClassNotFoundException { ! return (loadClass("", name)); } ! public static Class loadClass(String codebases, String name) ! throws MalformedURLException, ClassNotFoundException { ! Class c = null; ! ClassLoader loader = Thread.currentThread().getContextClassLoader(); ! //try context class loader first ! try { ! c = loader.loadClass(name); } ! catch(ClassNotFoundException e) {} ! ! if (c != null) ! return c; ! ! if (codebases.length() == 0) //=="" ! loader = defaultLoader; ! else { ! loader = (ClassLoader)cacheLoaders.get(codebases); ! if (loader == null) ! { ! //create an entry in cacheLoaders mapping a loader to codebases. ! ! // codebases are separated by " " ! StringTokenizer tok = new StringTokenizer(codebases, " "); ! ArrayList urls = new ArrayList(); ! while (tok.hasMoreTokens()) ! urls.add(new URL(tok.nextToken())); ! ! loader = new MyClassLoader((URL[])urls.toArray(new URL[urls.size()]), ! null, codebases); ! cacheLoaders.put(codebases, loader); ! } } ! return loader.loadClass(name); ! } ! ! public static String getClassAnnotation(Class cl) { ! ClassLoader loader = cl.getClassLoader(); ! if (loader == null || loader == ClassLoader.getSystemClassLoader()) { ! return null; //?? } ! ! if (loader instanceof MyClassLoader) ! { ! return ((MyClassLoader)loader).getClassAnnotation(); ! } ! ! String s = (String)cacheAnnotations.get(loader); ! if (s != null) ! return s; ! ! if (loader instanceof URLClassLoader) ! { ! URL[] urls = ((URLClassLoader)loader).getURLs(); ! if(urls.length == 0) ! return null; ! StringBuffer annotation = new StringBuffer(64*urls.length); ! for(int i = 0; i < urls.length; i++) ! { ! annotation.append(urls[i].toExternalForm()); ! annotation.append(' '); ! } ! s = annotation.toString(); ! cacheAnnotations.put(loader, s); ! } ! return null; } ! /** * @deprecated */ diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/RMIClassLoaderSpi.java gcc-3.3/libjava/java/rmi/server/RMIClassLoaderSpi.java *** gcc-3.2.3/libjava/java/rmi/server/RMIClassLoaderSpi.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/RMIClassLoaderSpi.java 2003-01-02 00:14:10.000000000 +0000 *************** *** 0 **** --- 1,64 ---- + /* RMIClassLoaderSpi.java + Copyright (c) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.rmi.server; + + import java.net.MalformedURLException; + + /** + * @author Michael Koch + * @since 1.4 + */ + public abstract class RMIClassLoaderSpi + { + public RMIClassLoaderSpi() + { + } + + public abstract Class loadClass (String codeBase, String name, + ClassLoader defaultLoader) + throws MalformedURLException, ClassNotFoundException; + + public abstract Class loadProxyClass (String codeBase, String[] interfaces, + ClassLoader defaultLoader) + throws MalformedURLException, ClassNotFoundException; + + public abstract ClassLoader getClassLoader (String codebase) + throws MalformedURLException; + + public abstract String getClassAnnotation (Class cl); + } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/ServerCloneException.java gcc-3.3/libjava/java/rmi/server/ServerCloneException.java *** gcc-3.2.3/libjava/java/rmi/server/ServerCloneException.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/ServerCloneException.java 2002-06-17 19:11:39.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ServerCloneException.java -- a UnicastRemoteObject could not be cloned ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,86 **** package java.rmi.server; ! import java.lang.CloneNotSupportedException; ! import java.io.PrintStream; ! import java.io.PrintWriter; ! ! public class ServerCloneException ! extends CloneNotSupportedException { ! ! public Exception detail; ! ! public ServerCloneException(String s) { ! super(s); ! detail = null; ! } ! ! public ServerCloneException(String s, Exception e) { ! super(s); ! detail = e; ! } ! public String getMessage() { ! if (detail != null) { ! return (super.getMessage() + ":" + detail.getMessage()); ! } ! else { ! return (super.getMessage()); ! } ! } ! public void printStackTrace(PrintStream s) { ! if (detail != null) { ! detail.printStackTrace(s); ! } ! super.printStackTrace(s); ! } ! public void printStackTrace() { ! printStackTrace(System.err); ! } ! public void printStackTrace(PrintWriter s) { ! if (detail != null) { ! detail.printStackTrace(s); ! } ! super.printStackTrace(s); ! } } --- 37,117 ---- package java.rmi.server; ! /** ! * Thrown if a remote exception occurs during the cloning process of a ! * UnicastRemoteObject. ! * ! * @author unknown ! * @see UnicastRemoteObject#clone() ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class ServerCloneException extends CloneNotSupportedException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 6617456357664815945L; ! /** ! * The cause of this exception. This pre-dates the exception chaining ! * of Throwable; and although you can change this field, you are wiser ! * to leave it alone. ! * ! * @serial the exception cause ! */ ! public Exception detail; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public ServerCloneException(String s) ! { ! this(s, null); ! } ! /** ! * Create an exception with a message and a cause. ! * ! * @param s the message ! * @param e the cause ! */ ! public ServerCloneException(String s, Exception e) ! { ! super(s); ! initCause(e); ! detail = e; ! } ! /** ! * This method returns a message indicating what went wrong, in this ! * format: ! * super.getMessage() + (detail == null ? "" ! * : "; nested exception is:\n\t" + detail). ! * ! * @return the chained message ! */ ! public String getMessage() ! { ! if (detail == this || detail == null) ! return super.getMessage(); ! return super.getMessage() + "; nested exception is:\n\t" + detail; ! } + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the detail field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if detail == this, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/ServerNotActiveException.java gcc-3.3/libjava/java/rmi/server/ServerNotActiveException.java *** gcc-3.2.3/libjava/java/rmi/server/ServerNotActiveException.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/ServerNotActiveException.java 2002-06-17 19:11:40.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ServerNotActiveException.java -- the method is not servicing a remote call ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,53 **** package java.rmi.server; ! import java.lang.Exception; ! ! public class ServerNotActiveException ! extends Exception { ! ! public ServerNotActiveException() { ! super(); ! } ! public ServerNotActiveException(String s) { ! super(s); ! } } --- 37,72 ---- package java.rmi.server; ! /** ! * Thrown during RemoteServer.getClientHost if the host is ! * not servicing a remote method call. ! * ! * @author unknown ! * @see RemoteServer#getClientHost() ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class ServerNotActiveException extends Exception ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 4687940720827538231L; ! /** ! * Create an exception with no message. ! */ ! public ServerNotActiveException() ! { ! } + /** + * Create an exception with a message. + * + * @param s the message + */ + public ServerNotActiveException(String s) + { + super(s); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/SkeletonMismatchException.java gcc-3.3/libjava/java/rmi/server/SkeletonMismatchException.java *** gcc-3.2.3/libjava/java/rmi/server/SkeletonMismatchException.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/SkeletonMismatchException.java 2002-06-17 19:11:40.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* SkeletonMismatchException.java -- thrown when stub class versions mismatch ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.rmi.server; *** 39,51 **** import java.rmi.RemoteException; ! public class SkeletonMismatchException ! extends RemoteException { ! ! public static final long serialVersionUID = -7780460454818859281l; ! ! public SkeletonMismatchException(String s) { ! super(s); ! } } --- 39,68 ---- import java.rmi.RemoteException; ! /** ! * Thrown if a call is received that does not match a Skeleton. Note that ! * Skeletons are no longer required. ! * ! * @author unknown ! * @since 1.1 ! * @deprecated no replacement. Skeletons are no longer required. ! * @status updated to 1.4 ! */ ! public class SkeletonMismatchException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1. ! */ ! private static final long serialVersionUID = -7780460454818859281l; + /** + * Create an exception with the specified message. + * + * @param s the message + * @deprecated no longer needed + */ + public SkeletonMismatchException(String s) + { + super(s); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/SkeletonNotFoundException.java gcc-3.3/libjava/java/rmi/server/SkeletonNotFoundException.java *** gcc-3.2.3/libjava/java/rmi/server/SkeletonNotFoundException.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/SkeletonNotFoundException.java 2002-06-17 19:11:40.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* SkeletonNotFoundException.java -- thrown if a Skeleton is not found ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** package java.rmi.server; *** 39,53 **** import java.rmi.RemoteException; ! public class SkeletonNotFoundException ! extends RemoteException { ! ! public SkeletonNotFoundException(String s) { ! super(s); ! } ! public SkeletonNotFoundException(String s, Exception e) { ! super(s, e); ! } } --- 39,80 ---- import java.rmi.RemoteException; ! /** ! * Thrown if a Skeleton corresponding to the remote object is not found. ! * Note that Skeletons are no longer required. ! * ! * @author unknown ! * @since 1.1 ! * @deprecated no replacement. Skeletons are no longer required. ! * @status updated to 1.4 ! */ ! public class SkeletonNotFoundException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1. ! */ ! private static final long serialVersionUID = -7860299673822761231L; ! /** ! * Create an exception with the specified message. ! * ! * @param s the message ! * @deprecated no longer needed ! */ ! public SkeletonNotFoundException(String s) ! { ! super(s); ! } + /** + * Create an exception with the specified message and cause. + * + * @param s the message + * @param e the cause + * @deprecated no longer needed + */ + public SkeletonNotFoundException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/SocketSecurityException.java gcc-3.3/libjava/java/rmi/server/SocketSecurityException.java *** gcc-3.2.3/libjava/java/rmi/server/SocketSecurityException.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/SocketSecurityException.java 2002-06-17 19:11:40.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* SocketSecurityException.java -- the socket could not be created ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,53 **** package java.rmi.server; ! import java.rmi.server.ExportException; ! ! public class SocketSecurityException ! extends ExportException { ! ! public SocketSecurityException(String s) { ! super(s); ! } ! public SocketSecurityException(String s, Exception e) { ! super(s, e); ! } } --- 37,75 ---- package java.rmi.server; ! /** ! * Thrown during remote object export if the code does not have permission ! * to create a java.net.ServerSocket on the specified port. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class SocketSecurityException extends ExportException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -7622072999407781979L; ! /** ! * Create an exception with the specified message. ! * ! * @param s the message ! */ ! public SocketSecurityException(String s) ! { ! super(s); ! } + /** + * Create an exception with the specified message and cause. + * + * @param s the message + * @param e the cause + */ + public SocketSecurityException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/server/UnicastRemoteObject.java gcc-3.3/libjava/java/rmi/server/UnicastRemoteObject.java *** gcc-3.2.3/libjava/java/rmi/server/UnicastRemoteObject.java 2002-01-22 22:40:29.000000000 +0000 --- gcc-3.3/libjava/java/rmi/server/UnicastRemoteObject.java 2003-01-03 22:56:56.000000000 +0000 *************** *** 1,5 **** /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ! Copyright (c) 1996, 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.rmi.Remote; *** 42,51 **** --- 42,58 ---- import java.rmi.server.RemoteRef; import java.rmi.NoSuchObjectException; import gnu.java.rmi.server.UnicastServerRef; + import gnu.java.rmi.server.UnicastServer; public class UnicastRemoteObject extends RemoteServer { + private static final long serialVersionUID = 4974527148936298033L; + //The following serialized fields are from Java API Documentation "Serialized form" + private int port = 0; + private RMIClientSocketFactory csf = null; + private RMIServerSocketFactory ssf = null; + protected UnicastRemoteObject() throws RemoteException { this(0); } *************** protected UnicastRemoteObject(int port) *** 55,65 **** } protected UnicastRemoteObject(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException { ! super(new UnicastServerRef(new ObjID(), port, ssf)); } protected UnicastRemoteObject(RemoteRef ref) throws RemoteException { super((UnicastServerRef)ref); } public Object clone() throws CloneNotSupportedException { --- 62,78 ---- } protected UnicastRemoteObject(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException { ! this.port = port; ! //Is RMIXXXSocketFactory serializable ! //this.csf = csf; ! //this.ssf = ssf; ! this.ref = new UnicastServerRef(new ObjID(), port, ssf); ! exportObject(this); } protected UnicastRemoteObject(RemoteRef ref) throws RemoteException { super((UnicastServerRef)ref); + exportObject(this); } public Object clone() throws CloneNotSupportedException { *************** public static RemoteStub exportObject(Re *** 71,86 **** return (sref.exportObject(obj)); } ! public static Remote exportObject(Remote obj, int port) throws RemoteException { ! return (exportObject(obj)); ! } ! public static Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException { ! return (exportObject(obj)); ! } ! public static boolean unexportObject(Remote obj, boolean force) throws NoSuchObjectException { ! throw new Error("Not implemented"); ! } } --- 84,129 ---- return (sref.exportObject(obj)); } ! public static Remote exportObject(Remote obj, int port) throws RemoteException ! { ! return exportObject(obj, port, null); ! } ! ! protected static Remote exportObject(Remote obj, int port, RMIServerSocketFactory ssf) ! throws RemoteException ! { ! UnicastServerRef sref = null; ! if (obj instanceof RemoteObject) ! sref = (UnicastServerRef)((RemoteObject)obj).getRef (); ! if(sref == null) ! { ! sref = new UnicastServerRef(new ObjID (), port, ssf); ! } ! return (sref.exportObject (obj)); ! } ! /** ! * FIX ME ! */ ! public static Remote exportObject(Remote obj, int port, RMIClientSocketFactory csf, ! RMIServerSocketFactory ssf) ! throws RemoteException ! { ! return (exportObject(obj, port, ssf)); ! } ! public static boolean unexportObject(Remote obj, boolean force) ! throws NoSuchObjectException ! { ! if (obj instanceof RemoteObject) ! { ! UnicastServerRef sref = (UnicastServerRef)((RemoteObject)obj).getRef(); ! return sref.unexportObject(obj, force); ! } ! else ! //FIX ME ! ; ! return true; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/ServerError.java gcc-3.3/libjava/java/rmi/ServerError.java *** gcc-3.2.3/libjava/java/rmi/ServerError.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/ServerError.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ServerError.java -- wraps an error while creating the server ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,47 **** package java.rmi; ! public class ServerError ! extends RemoteException { ! ! public ServerError(String s, Error e) { ! super(s, e); ! } } --- 37,64 ---- package java.rmi; ! /** ! * Wraps any error thrown while processing the server of a remote call. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class ServerError extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 8455284893909696482L; + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ServerError(String s, Error e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/ServerException.java gcc-3.3/libjava/java/rmi/ServerException.java *** gcc-3.2.3/libjava/java/rmi/ServerException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/ServerException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ServerException.java -- wraps an exception while creating the server ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,53 **** package java.rmi; ! public class ServerException ! extends RemoteException { ! ! public static final long serialVersionUID = -4775845313121906682l; ! ! public ServerException(String s) { ! super(s); ! } ! public ServerException(String s, Exception e) { ! super(s, e); ! } } --- 37,74 ---- package java.rmi; ! /** ! * Wraps any exception thrown while processing the server of a remote call. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class ServerException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -4775845313121906682l; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public ServerException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ServerException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/ServerRuntimeException.java gcc-3.3/libjava/java/rmi/ServerRuntimeException.java *** gcc-3.2.3/libjava/java/rmi/ServerRuntimeException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/ServerRuntimeException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ServerRuntimeException.java -- wraps an exception while creating the server ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,47 **** package java.rmi; ! public class ServerRuntimeException ! extends RemoteException { ! ! public ServerRuntimeException(String s, Exception e) { ! super(s, e); ! } } --- 37,67 ---- package java.rmi; ! /** ! * Wraps any runtime exception thrown while processing the server of a ! * remote call. Note, this exception is no longer used. ! * ! * @author unknown ! * @since 1.1 ! * @deprecated no replacement ! * @status updated to 1.4 ! */ ! public class ServerRuntimeException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1. ! */ ! private static final long serialVersionUID = 7054464920481467219L; + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + * @deprecated no longer needed + */ + public ServerRuntimeException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/StubNotFoundException.java gcc-3.3/libjava/java/rmi/StubNotFoundException.java *** gcc-3.2.3/libjava/java/rmi/StubNotFoundException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/StubNotFoundException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* StubNotFoundException.java -- thrown if a valid stub is not found ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,51 **** package java.rmi; ! public class StubNotFoundException ! extends RemoteException { - public StubNotFoundException(String s) { - super(s); - } ! public StubNotFoundException(String s, Exception e) { ! super(s, e); ! } } --- 37,77 ---- package java.rmi; ! /** ! * Thrown if a valid stub class is not found for an object when it is exported. ! * ! * @author unknown ! * @see UnicastRemoteObject ! * @see Activatable ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class StubNotFoundException extends RemoteException ! { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -7088199405468872373L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public StubNotFoundException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public StubNotFoundException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/UnexpectedException.java gcc-3.3/libjava/java/rmi/UnexpectedException.java *** gcc-3.2.3/libjava/java/rmi/UnexpectedException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/UnexpectedException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnexpectedException.java -- an unexpected checked exception was received ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,51 **** package java.rmi; ! public class UnexpectedException ! extends RemoteException { ! ! public UnexpectedException(String s) { ! super(s); ! } ! public UnexpectedException(String s, Exception e) { ! super(s, e); ! } } --- 37,75 ---- package java.rmi; ! /** ! * Thrown if an unexpected checked exception was received in a remote ! * procedure call. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class UnexpectedException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 1800467484195073863L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public UnexpectedException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public UnexpectedException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/UnknownHostException.java gcc-3.3/libjava/java/rmi/UnknownHostException.java *** gcc-3.2.3/libjava/java/rmi/UnknownHostException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/UnknownHostException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnknownHostException.java -- wraps java.net.UnknownHostException in RMI ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,51 **** package java.rmi; ! public class UnknownHostException ! extends RemoteException { ! ! public UnknownHostException(String s) { ! super(s); ! } ! public UnknownHostException(String s, Exception e) { ! super(s, e); ! } } --- 37,75 ---- package java.rmi; ! /** ! * Thrown if a java.net.UnknownHostException occurs during a remote ! * procedure call. ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class UnknownHostException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -8152710247442114228L; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public UnknownHostException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public UnknownHostException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/rmi/UnmarshalException.java gcc-3.3/libjava/java/rmi/UnmarshalException.java *** gcc-3.2.3/libjava/java/rmi/UnmarshalException.java 2002-01-22 22:40:24.000000000 +0000 --- gcc-3.3/libjava/java/rmi/UnmarshalException.java 2002-06-16 20:55:56.000000000 +0000 *************** *** 1,5 **** ! /* ! Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnmarshalException.java -- wraps error while unmarshalling parameters ! Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,53 **** package java.rmi; ! public class UnmarshalException ! extends RemoteException { ! ! public static final long serialVersionUID = 594380845140740218l; ! ! public UnmarshalException(String s) { ! super(s); ! } ! public UnmarshalException(String s, Exception e) { ! super(s, e); ! } } --- 37,88 ---- package java.rmi; ! /** ! * Thrown if an exception occurs while unmarshalling parameters or results ! * of a remote method call. This includes:

          ! *
        • if an exception occurs while unmarshalling the call header
        • ! *
        • if the protocol for the return value is invalid
        • ! *
        • if a java.io.IOException occurs unmarshalling parameters (on the ! * server side) or the return value (on the client side).
        • ! *
        • if a java.lang.ClassNotFoundException occurs during unmarshalling ! * parameters or return values
        • ! *
        • if no skeleton can be loaded on the server-side; note that skeletons ! * are required in the 1.1 stub protocol, but not in the 1.2 stub ! * protocol.
        • ! *
        • if the method hash is invalid (i.e., missing method).
        • ! *
        • if there is a failure to create a remote reference object for a remote ! * object's stub when it is unmarshalled.
        • ! *
        ! * ! * @author unknown ! * @since 1.1 ! * @status updated to 1.4 ! */ ! public class UnmarshalException extends RemoteException ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 594380845140740218l; ! /** ! * Create an exception with a message. ! * ! * @param s the message ! */ ! public UnmarshalException(String s) ! { ! super(s); ! } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public UnmarshalException(String s, Exception e) + { + super(s, e); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/AccessControlException.java gcc-3.3/libjava/java/security/AccessControlException.java *** gcc-3.2.3/libjava/java/security/AccessControlException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/AccessControlException.java 2002-05-24 11:57:08.000000000 +0000 *************** *** 1,5 **** /* AccessControlException.java -- Permission is denied ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* AccessControlException.java -- Permission is denied ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 39,76 **** /** * This exception is thrown when the AccessController denies ! * an attempt to perform an operation. ! * ! * @version 0.0 * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class AccessControlException extends SecurityException { /** ! * The Permission associated with this exception */ ! private Permission perm; /** ! * This method initializes a new instance of AccessControlException ! * with a descriptive error message. There will be no Permission ! * object associated with this exception. * ! * @param msg The descriptive error message */ public AccessControlException(String msg) { ! super(msg); } /** ! * This method initializes a new instance of AccessControlException ! * with a descriptive error message and an instance of Permission ! * that is the permission that caused the exception to be thrown. * ! * @param msg The descriptive error message ! * @param perm The Permission object that caused this exception. */ public AccessControlException(String msg, Permission perm) { --- 39,82 ---- /** * This exception is thrown when the AccessController denies ! * an attempt to perform an operation. This often keeps track of the ! * permission that was not granted. * ! * @author Aaron M. Renn ! * @see AccessController ! * @status updated to 1.4 */ public class AccessControlException extends SecurityException { /** ! * Compatible with JDK 1.1+. */ ! private static final long serialVersionUID = 5138225684096988535L; /** ! * The Permission associated with this exception. * ! * @serial the permission ! */ ! private final Permission perm; ! ! /** ! * Create a new instance with a descriptive error message, and a null ! * Permission object. ! * ! * @param msg the descriptive error message */ public AccessControlException(String msg) { ! this(msg, null); } /** ! * Create a new instance with a descriptive error message and an associated ! * Permission object. * ! * @param msg the descriptive error message ! * @param perm the permission that caused this */ public AccessControlException(String msg, Permission perm) { *************** public class AccessControlException exte *** 82,91 **** * This method returns the Permission object that caused * this exception to be thrown. * ! * @return The requested Permission object, or null if none is available. */ public Permission getPermission() { ! return (perm); } } --- 88,97 ---- * This method returns the Permission object that caused * this exception to be thrown. * ! * @return the denied permission, or null */ public Permission getPermission() { ! return perm; } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/AccessController.java gcc-3.3/libjava/java/security/AccessController.java *** gcc-3.2.3/libjava/java/security/AccessController.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/AccessController.java 2002-05-24 11:57:10.000000000 +0000 *************** package java.security; *** 43,49 **** * through the checkPermission() method. * Manipulates the access control context for code that needs to be executed * the protection domain of the calling class (by explicitly ignoring the ! * context of the calling code) in the doPriviliged() methods. * And provides a getContext() method which gives the access * control context of the current thread that can be used for checking * permissions at a later time and/or in another thread. --- 43,49 ---- * through the checkPermission() method. * Manipulates the access control context for code that needs to be executed * the protection domain of the calling class (by explicitly ignoring the ! * context of the calling code) in the doPrivileged() methods. * And provides a getContext() method which gives the access * control context of the current thread that can be used for checking * permissions at a later time and/or in another thread. *************** public final class AccessController *** 131,137 **** * @param action the PrivilegedExceptionAction whose * run() should be be called. * @returns the result of the action.run() method. ! * @exception PriviligedActionException wrapped around any exception that * is thrown in the run() method. */ public static Object doPrivileged(PrivilegedExceptionAction action) --- 131,137 ---- * @param action the PrivilegedExceptionAction whose * run() should be be called. * @returns the result of the action.run() method. ! * @exception PrivilegedActionException wrapped around any exception that * is thrown in the run() method. */ public static Object doPrivileged(PrivilegedExceptionAction action) *************** public final class AccessController *** 163,169 **** * @param context the AccessControlContext whose protection * domains should be added to the protection domain of the calling class. * @returns the result of the action.run() method. ! * @exception PriviligedActionException wrapped around any exception that * is thrown in the run() method. */ public static Object doPrivileged(PrivilegedExceptionAction action, --- 163,169 ---- * @param context the AccessControlContext whose protection * domains should be added to the protection domain of the calling class. * @returns the result of the action.run() method. ! * @exception PrivilegedActionException wrapped around any exception that * is thrown in the run() method. */ public static Object doPrivileged(PrivilegedExceptionAction action, diff -Nrc3pad gcc-3.2.3/libjava/java/security/acl/AclNotFoundException.java gcc-3.3/libjava/java/security/acl/AclNotFoundException.java *** gcc-3.2.3/libjava/java/security/acl/AclNotFoundException.java 2002-01-22 22:40:32.000000000 +0000 --- gcc-3.3/libjava/java/security/acl/AclNotFoundException.java 2002-05-24 11:57:27.000000000 +0000 *************** *** 1,5 **** ! /* AclNotFoundException.java -- What it says ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* AclNotFoundException.java -- thrown when an ACL is not found ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security.acl; *** 41,57 **** * This exception is thrown when a requested access control list (ACL) is * not found. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class AclNotFoundException extends Exception { /** * Initializes a new instance of this class with no descriptive message */ public AclNotFoundException() { - super(); } } --- 41,60 ---- * This exception is thrown when a requested access control list (ACL) is * not found. * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ public class AclNotFoundException extends Exception { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5684295034092681791L; + + /** * Initializes a new instance of this class with no descriptive message */ public AclNotFoundException() { } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/acl/LastOwnerException.java gcc-3.3/libjava/java/security/acl/LastOwnerException.java *** gcc-3.2.3/libjava/java/security/acl/LastOwnerException.java 2002-01-22 22:40:32.000000000 +0000 --- gcc-3.3/libjava/java/security/acl/LastOwnerException.java 2002-05-24 11:57:28.000000000 +0000 *************** *** 1,5 **** /* LastOwnerException.java -- User attempted to delete last ACL owner ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* LastOwnerException.java -- User attempted to delete last ACL owner ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security.acl; *** 41,58 **** * This exception is thrown when an attempt is made to delete the last owner * of an access control list (ACL) * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class LastOwnerException extends java.lang.Exception { /** * Initialize a new instance of LastOwnerException that does * not have a log message. */ public LastOwnerException() { - super(); } } --- 41,62 ---- * This exception is thrown when an attempt is made to delete the last owner * of an access control list (ACL) * ! * @author Aaron M. Renn ! * @see Owner#deleteOwner(java.security.Principal, java.security.Principal) ! * @status updated to 1.4 */ ! public class LastOwnerException extends Exception { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5141997548211140359L; + + /** * Initialize a new instance of LastOwnerException that does * not have a log message. */ public LastOwnerException() { } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/acl/NotOwnerException.java gcc-3.3/libjava/java/security/acl/NotOwnerException.java *** gcc-3.2.3/libjava/java/security/acl/NotOwnerException.java 2002-01-22 22:40:32.000000000 +0000 --- gcc-3.3/libjava/java/security/acl/NotOwnerException.java 2002-05-24 11:57:29.000000000 +0000 *************** *** 1,5 **** /* NotOwnerException.java -- Attempt to modify an unowned ACL ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* NotOwnerException.java -- Attempt to modify an unowned ACL ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security.acl; *** 42,53 **** * the caller to be the owner of the access control list (ACL) when the caller * is in fact not the owner of the ACL. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class NotOwnerException extends java.lang.Exception { /** * Initializes a new instance of NotOwnerException that does --- 42,56 ---- * the caller to be the owner of the access control list (ACL) when the caller * is in fact not the owner of the ACL. * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ ! public class NotOwnerException extends Exception { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5555597911163362399L; /** * Initializes a new instance of NotOwnerException that does *************** public class NotOwnerException extends j *** 55,60 **** */ public NotOwnerException() { - super(); } } --- 58,62 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/security/AllPermission.java gcc-3.3/libjava/java/security/AllPermission.java *** gcc-3.2.3/libjava/java/security/AllPermission.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/AllPermission.java 2002-05-24 11:57:11.000000000 +0000 *************** *** 1,5 **** /* AllPermission.java -- Permission to do anything ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* AllPermission.java -- Permission to do anything ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,134 **** package java.security; /** * This class is a permission that implies all other permissions. Granting * this permission effectively grants all others. Extreme caution should * be exercised in granting this permission. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public final class AllPermission extends Permission { /** ! * This method initializes a new instance of AllPermission. It ! * performs no actions. */ public AllPermission() { ! super("all"); } /** ! * This method initializes a new instance of AllPermission. The ! * arguments passed to this method are used to set internal field for the ! * permission name. However, these are not used in ! * determining the actual permissions granted. This class always will ! * return true in its implies method. * ! * @param name The name of this permission. ! * @param actions The action list for this permission - ignored in this class. */ public AllPermission(String name, String actions) { ! super(name); } /** * This method always returns true to indicate that this * permission always implies that any other permission is also granted. * ! * @param perm The Permission to test against - ignored in this class. ! * ! * @return Always returns true */ public boolean implies(Permission perm) { ! return (true); } /** ! * This method tests this class for equality against another Object. ! * This will return true if and only if the specified ! * Object is an instance of AllPermission. * ! * @param obj The Object to test for equality to this object */ public boolean equals(Object obj) { ! if (obj instanceof AllPermission) ! return (true); ! ! return (false); } /** ! * This method returns a hash code for this object. * ! * @return A hash value for this object. */ public int hashCode() { ! return (System.identityHashCode(this)); } /** * This method returns the list of actions associated with this object. * This will always be the empty string ("") for this class. * ! * @return The action list. */ public String getActions() { ! return (""); } /** ! * This method returns a new instance of PermissionCollection ! * suitable for holding instance of AllPermission. * ! * @return A new PermissionCollection. */ public PermissionCollection newPermissionCollection() { ! return (null); } ! } --- 37,196 ---- package java.security; + import java.util.Enumeration; + import java.util.Collections; + import gnu.java.util.EmptyEnumeration; + /** * This class is a permission that implies all other permissions. Granting * this permission effectively grants all others. Extreme caution should * be exercised in granting this permission. * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @see AccessController ! * @see Permissions ! * @see SecurityManager ! * @since 1.1 ! * @status updated to 1.4 */ public final class AllPermission extends Permission { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -2916474571451318075L; ! ! /** ! * Create a new AllPermission object. */ public AllPermission() { ! super("*"); } /** ! * Create a new AllPermission object. The parameters are ignored, as all ! * permission implies ALL PERMISSION. * ! * @param name ignored ! * @param actions ignored */ public AllPermission(String name, String actions) { ! super("*"); } /** * This method always returns true to indicate that this * permission always implies that any other permission is also granted. * ! * @param perm ignored ! * @return true, the permission is implied */ public boolean implies(Permission perm) { ! return true; } /** ! * Checks an object for equality. All AllPermissions are equal. * ! * @param obj the Object to test for equality */ public boolean equals(Object obj) { ! return obj instanceof AllPermission; } /** ! * This method returns a hash code for this object. This returns 1. * ! * @return a hash value for this object */ public int hashCode() { ! return 1; } /** * This method returns the list of actions associated with this object. * This will always be the empty string ("") for this class. * ! * @return the action list */ public String getActions() { ! return ""; } /** ! * Returns a PermissionCollection which can hold AllPermission. * ! * @return a permission collection */ public PermissionCollection newPermissionCollection() { ! return new AllPermissionCollection(); } ! } // class AllPermission ! ! /** ! * Implements AllPermission.newPermissionCollection, and obeys serialization ! * of JDK. ! * ! * @author Eric Blake ! */ ! final class AllPermissionCollection extends PermissionCollection ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -4023755556366636806L; ! ! /** ! * Whether an AllPermission has been added to the collection. ! * ! * @serial if all permission is in the collection yet ! */ ! private boolean all_allowed; ! ! /** ! * Add an AllPermission. ! * ! * @param perm the permission to add ! * @throws IllegalArgumentException if perm is not an AllPermission ! * @throws SecurityException if the collection is read-only ! */ ! public void add(Permission perm) ! { ! if (isReadOnly()) ! throw new SecurityException(); ! if (! (perm instanceof AllPermission)) ! throw new IllegalArgumentException(); ! all_allowed = true; ! } ! ! /** ! * Returns true if this collection implies a permission. ! * ! * @param perm the permission to check ! * @return true if this collection contains an AllPermission ! */ ! public boolean implies(Permission perm) ! { ! return all_allowed; ! } ! ! /** ! * Returns an enumeration of the elements in the collection. ! * ! * @return the elements in the collection ! */ ! public Enumeration elements() ! { ! return all_allowed ! ? Collections.enumeration(Collections.singleton(new AllPermission())) ! : EmptyEnumeration.getInstance(); ! } ! } // class AllPermissionCollection diff -Nrc3pad gcc-3.2.3/libjava/java/security/BasicPermission.java gcc-3.3/libjava/java/security/BasicPermission.java *** gcc-3.2.3/libjava/java/security/BasicPermission.java 2002-02-14 23:16:08.000000000 +0000 --- gcc-3.3/libjava/java/security/BasicPermission.java 2002-05-24 11:57:11.000000000 +0000 *************** *** 1,5 **** ! /* BasicPermission.java -- Implements a simple named permission. ! Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* BasicPermission.java -- implements a simple named permission ! Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.util.Enumeration; *** 44,133 **** /** * This class implements a simple model for named permissions without an * associated action list. That is, either the named permission is granted ! * or it is not. ! *

        ! * It also supports trailing wildcards to allow the ! * easy granting of permissions in a hierarchical fashion. (For example, ! * the name "org.gnu.*" might grant all permissions under the "org.gnu" ! * permissions hierarchy). The only valid wildcard character is a '*' ! * which matches anything. It must be the rightmost element in the ! * permission name and must follow a '.' or else the Permission name must ! * consist of only a '*'. Any other occurrence of a '*' is not valid. ! *

        ! * This class ignores the action list. Subclasses can choose to implement ! * actions on top of this class if desired. * ! * @version 0.1 * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public abstract class BasicPermission extends java.security.Permission implements Serializable ! // FIXME extends with fully qualified classname as workaround for gcj 3.0.4 { /** ! * This method initializes a new instance of BasicPermission ! * with the specified name. If the name contains an illegal wildcard ! * character, an exception is thrown. ! * ! * @param name The name of this permission. * ! * @exception IllegalArgumentException If the name contains an invalid wildcard character ! * @exception NullPointerException If the name is null */ ! public BasicPermission(String name) ! throws IllegalArgumentException, NullPointerException { super(name); - if (name.indexOf("*") != -1) { ! if (!name.endsWith(".*") && !name.equals("*")) ! throw new IllegalArgumentException("Bad wildcard: " + name); ! ! if (name.indexOf("*") != name.lastIndexOf("*")) ! throw new IllegalArgumentException("Bad wildcard: " + name); } } /** ! * This method initializes a new instance of BasicPermission ! * with the specified name. If the name contains an illegal wildcard ! * character, an exception is thrown. The action list passed to this ! * form of the constructor is ignored. ! * ! * @param name The name of this permission. ! * @param actions The list of actions for this permission - ignored in this class. * ! * @exception IllegalArgumentException If the name contains an invalid wildcard character ! * @exception NullPointerException If the name is null */ ! public BasicPermission(String name, String actions) ! throws IllegalArgumentException, NullPointerException { - // ignore actions this(name); } /** ! * This method tests to see if the specified permission is implied by ! * this permission. This will be true if the following conditions are met: ! *

        ! *

          ! *
        • The specified object is an instance of BasicPermission, ! * or a subclass. ! *
        • The name of the specified permission is identical to this permission's ! * name or the name of the specified permission satisfies a wildcard match ! * on this permission. *
        * ! * @param perm The Permission object to test against. ! * ! * @return true if the specified permission is implied by this one or false otherwise. */ public boolean implies(Permission perm) { ! if (!(perm instanceof BasicPermission)) return false; String otherName = perm.getName(); --- 44,137 ---- /** * This class implements a simple model for named permissions without an * associated action list. That is, either the named permission is granted ! * or it is not. * ! *

        It also supports trailing wildcards to allow the easy granting of ! * permissions in a hierarchical fashion. (For example, the name "org.gnu.*" ! * might grant all permissions under the "org.gnu" permissions hierarchy). ! * The only valid wildcard character is a '*' which matches anything. It ! * must be the rightmost element in the permission name and must follow a ! * '.' or else the Permission name must consist of only a '*'. Any other ! * occurrence of a '*' is not valid. * ! *

        This class ignores the action list. Subclasses can choose to implement ! * actions on top of this class if desired. ! * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @see Permission ! * @see Permissions ! * @see PermissionCollection ! * @see RuntimePermission ! * @see SecurityPermission ! * @see PropertyPermission ! * @see AWTPermission ! * @see NetPermission ! * @see SecurityManager ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class BasicPermission extends java.security.Permission implements Serializable ! // FIXME extends with fully qualified classname is workaround for gcj 3.0.4. { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 6279438298436773498L; ! ! /** ! * Create a new instance with the specified permission name. If the name ! * is empty, or contains an illegal wildcard character, an exception is ! * thrown. * ! * @param name the name of this permission ! * @throws NullPointerException if name is null ! * @throws IllegalArgumentException if name is invalid */ ! public BasicPermission(String name) { super(name); if (name.indexOf("*") != -1) { ! if ((! name.endsWith(".*") && ! name.equals("*")) ! || name.indexOf("*") != name.lastIndexOf("*")) ! throw new IllegalArgumentException("Bad wildcard: " + name); } + if ("".equals(name)) + throw new IllegalArgumentException("Empty name"); } /** ! * Create a new instance with the specified permission name. If the name ! * is empty, or contains an illegal wildcard character, an exception is ! * thrown. The actions parameter is ignored. * ! * @param name the name of this permission ! * @param actions ignored ! * @throws NullPointerException if name is null ! * @throws IllegalArgumentException if name is invalid */ ! public BasicPermission(String name, String actions) { this(name); } /** ! * This method tests to see if the specified permission is implied by this ! * permission. This will be true if the following conditions are met:

          ! *
        • The specified object is an instance of the same class as this ! * object.
        • ! *
        • The name of the specified permission is implied by this permission's ! * name based on wildcard matching. For example, "a.*" implies "a.b".
        • *
        * ! * @param perm the Permission object to test against ! * @return true if the specified permission is implied */ public boolean implies(Permission perm) { ! if (! getClass().isInstance(perm)) return false; String otherName = perm.getName(); *************** public abstract class BasicPermission ex *** 137,172 **** return true; int last = name.length() - 1; ! if (name.charAt(last) == '*' ! && otherName.startsWith(name.substring(0, last))) ! return true; ! ! return false; } /** * This method tests to see if this object is equal to the specified * Object. This will be true if and only if the specified ! * object meets the following conditions: ! *

        ! *

          ! *
        • It is an instance of BasicPermission, or a subclass. ! *
        • It has the same name as this permission. *
        * ! * @param obj The Object to test for equality against this object ! * ! * @return true if the specified Object is equal to this object or false otherwise. */ public boolean equals(Object obj) { ! if (!(obj instanceof BasicPermission)) ! return (false); ! ! if (!getName().equals(((BasicPermission) obj).getName())) ! return (false); ! ! return (true); } /** --- 141,165 ---- return true; int last = name.length() - 1; ! return name.charAt(last) == '*' ! && otherName.startsWith(name.substring(0, last)); } /** * This method tests to see if this object is equal to the specified * Object. This will be true if and only if the specified ! * object meets the following conditions:
          ! *
        • It is an instance of the same class as this.
        • ! *
        • It has the same name as this permission.
        • *
        * ! * @param obj the Object to test for equality ! * @return true if obj is semantically equal to this */ public boolean equals(Object obj) { ! return getClass().isInstance(obj) ! && getName().equals(((BasicPermission) obj).getName()); } /** *************** public abstract class BasicPermission ex *** 174,260 **** * code returned is the value returned by calling the hashCode * method on the String that is the name of this permission. * ! * @return A hash value for this object */ public int hashCode() { ! return (getName().hashCode()); } /** ! * This method returns a list of the actions associated with this * permission. This method always returns the empty string ("") since * this class ignores actions. * ! * @return The action list. */ public String getActions() { ! return (""); } /** * This method returns an instance of PermissionCollection ! * suitable for storing BasicPermission objects. This returns ! * be a sub class of PermissionCollection ! * that allows for an efficient and consistent implementation of ! * the implies method. The collection doesn't handle subclasses ! * of BasicPermission correctly; they must override this method. * ! * @return A new empty PermissionCollection object. */ public PermissionCollection newPermissionCollection() { ! return new PermissionCollection() ! { ! Hashtable permissions = new Hashtable(); ! boolean allAllowed = false; ! ! public void add(Permission permission) ! { ! if (isReadOnly()) ! throw new IllegalStateException("readonly"); ! BasicPermission bp = (BasicPermission) permission; ! String name = bp.getName(); ! if (name.equals("*")) ! allAllowed = true; ! permissions.put(name, bp); ! } ! public boolean implies(Permission permission) ! { ! if (!(permission instanceof BasicPermission)) ! return false; ! if (allAllowed) ! return true; ! BasicPermission toImply = (BasicPermission) permission; ! String name = toImply.getName(); ! if (name.equals("*")) ! return false; ! int prefixLength = name.length(); ! if (name.endsWith("*")) ! prefixLength -= 2; ! while (true) ! { ! if (permissions.get(name) != null) ! return true; ! prefixLength = name.lastIndexOf('.', prefixLength); ! if (prefixLength < 0) ! return false; ! name = name.substring(0, prefixLength + 1) + '*'; ! } ! } ! public Enumeration elements() { ! return permissions.elements(); } - }; } ! } --- 167,309 ---- * code returned is the value returned by calling the hashCode * method on the String that is the name of this permission. * ! * @return a hash value for this object */ public int hashCode() { ! return getName().hashCode(); } /** ! * This method returns a list of the actions associated with this * permission. This method always returns the empty string ("") since * this class ignores actions. * ! * @return the action list */ public String getActions() { ! return ""; } /** * This method returns an instance of PermissionCollection ! * suitable for storing BasicPermission objects. The ! * collection returned can only store objects of the same type as this. ! * Subclasses which use actions must override this method; but a class with ! * no actions will work fine with this. * ! * @return a new empty PermissionCollection object */ public PermissionCollection newPermissionCollection() { ! return new BasicPermissionCollection(getClass()); ! } ! } // class BasicPermission ! /** ! * Implements AllPermission.newPermissionCollection, and obeys serialization ! * of JDK. ! * ! * @author Eric Blake ! */ ! final class BasicPermissionCollection extends PermissionCollection ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 739301742472979399L; ! /** ! * The permissions in the collection. ! * ! * @serial a hash mapping name to permissions, all of type permClass ! */ ! private final Hashtable permissions = new Hashtable(); ! /** ! * If "*" is in the collection. ! * ! * @serial true if a permission named "*" is in the collection ! */ ! private boolean all_allowed; ! /** ! * The runtime class which all entries in the table must belong to. ! * ! * @serial the limiting subclass of this collection ! */ ! private final Class permClass; ! /** ! * Construct a collection over the given runtime class. ! * ! * @param c the class ! */ ! BasicPermissionCollection(Class c) ! { ! permClass = c; ! } ! /** ! * Add a Permission. It must be of the same type as the permission which ! * created this collection. ! * ! * @param perm the permission to add ! * @throws IllegalArgumentException if perm is not the correct type ! * @throws SecurityException if the collection is read-only ! */ ! public void add(Permission perm) ! { ! if (isReadOnly()) ! throw new SecurityException("readonly"); ! if (! permClass.isInstance(perm)) ! throw new IllegalArgumentException("Expecting instance of " + permClass); ! BasicPermission bp = (BasicPermission) perm; ! String name = bp.getName(); ! if (name.equals("*")) ! all_allowed = true; ! permissions.put(name, bp); ! } ! /** ! * Returns true if this collection implies the given permission. ! * ! * @param permission the permission to check ! * @return true if it is implied by this ! */ ! public boolean implies(Permission permission) ! { ! if (! permClass.isInstance(permission)) ! return false; ! if (all_allowed) ! return true; ! BasicPermission toImply = (BasicPermission) permission; ! String name = toImply.getName(); ! if (name.equals("*")) ! return false; ! int prefixLength = name.length(); ! if (name.endsWith("*")) ! prefixLength -= 2; ! while (true) { ! if (permissions.get(name) != null) ! return true; ! prefixLength = name.lastIndexOf('.', prefixLength); ! if (prefixLength < 0) ! return false; ! name = name.substring(0, prefixLength + 1) + '*'; } } ! ! /** ! * Enumerate over the collection. ! * ! * @return an enumeration of the collection contents ! */ ! public Enumeration elements() ! { ! return permissions.elements(); ! } ! } // class BasicPermissionCollection diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertificateEncodingException.java gcc-3.3/libjava/java/security/cert/CertificateEncodingException.java *** gcc-3.2.3/libjava/java/security/cert/CertificateEncodingException.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertificateEncodingException.java 2002-05-24 11:57:32.000000000 +0000 *************** *** 1,5 **** ! /* CertificateEncodingException.java --- Certificate Encoding Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CertificateEncodingException.java -- Certificate Encoding Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,69 **** package java.security.cert; /** ! Exception for a Certificate Encoding. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto ! */ public class CertificateEncodingException extends CertificateException { /** ! Constructs an CertificateEncodingException without a message string. ! */ public CertificateEncodingException() { - super(); } /** ! Constructs an CertificateEncodingException with a message string. ! ! @param msg A message to display with exception ! */ public CertificateEncodingException(String msg) { ! super( msg ); } - } --- 39,71 ---- package java.security.cert; /** ! * Exception for a Certificate Encoding. ! * ! * @author Mark Benvenuto ! * @since 1.2 ! * @status updated to 1.4 ! */ public class CertificateEncodingException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 6219492851589449162L; /** ! * Constructs an exception without a message string. ! */ public CertificateEncodingException() { } /** ! * Constructs an exception with a message string. ! * ! * @param msg A message to display with exception ! */ public CertificateEncodingException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertificateException.java gcc-3.3/libjava/java/security/cert/CertificateException.java *** gcc-3.2.3/libjava/java/security/cert/CertificateException.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertificateException.java 2002-05-24 11:57:33.000000000 +0000 *************** *** 1,5 **** ! /* CertificateException.java --- Certificate Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CertificateException.java -- Certificate Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,70 **** package java.security.cert; import java.security.GeneralSecurityException; /** ! Exception for a Certificate. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto ! */ public class CertificateException extends GeneralSecurityException { /** ! Constructs an CertificateException without a message string. ! */ public CertificateException() { - super(); } /** ! Constructs an CertificateException with a message string. ! ! @param msg A message to display with exception ! */ public CertificateException(String msg) { ! super( msg ); } - } --- 37,74 ---- package java.security.cert; + import java.security.GeneralSecurityException; /** ! * Exception for a Certificate. ! * ! * @author Mark Benvenuto ! * @see Certificate ! * @since 1.2 ! * @status updated to 1.4 ! */ public class CertificateException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 3192535253797119798L; /** ! * Constructs an exception without a message string. ! */ public CertificateException() { } /** ! * Constructs an exception with a message string. ! * ! * @param msg a message to display with exception ! */ public CertificateException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertificateExpiredException.java gcc-3.3/libjava/java/security/cert/CertificateExpiredException.java *** gcc-3.2.3/libjava/java/security/cert/CertificateExpiredException.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertificateExpiredException.java 2002-05-24 11:57:33.000000000 +0000 *************** *** 1,5 **** /* CertificateExpiredException.java --- Certificate Expired Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* CertificateExpiredException.java --- Certificate Expired Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,69 **** package java.security.cert; /** ! Exception for a Certificate Expiring. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto ! */ public class CertificateExpiredException extends CertificateException { /** ! Constructs an CertificateExpiredException without a message string. ! */ public CertificateExpiredException() { - super(); } /** ! Constructs an CertificateExpiredException with a message string. ! ! @param msg A message to display with exception ! */ public CertificateExpiredException(String msg) { ! super( msg ); } - } --- 39,71 ---- package java.security.cert; /** ! * Exception for a Certificate Expiring. ! * ! * @author Mark Benvenuto ! * @since 1.2 ! * @status updated to 1.4 ! */ public class CertificateExpiredException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 9071001339691533771L; /** ! * Constructs an exception without a message string. ! */ public CertificateExpiredException() { } /** ! * Constructs an exception with a message string. ! * ! * @param msg a message to display with exception ! */ public CertificateExpiredException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertificateFactory.java gcc-3.3/libjava/java/security/cert/CertificateFactory.java *** gcc-3.2.3/libjava/java/security/cert/CertificateFactory.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertificateFactory.java 2002-05-24 11:57:34.000000000 +0000 *************** *** 1,5 **** ! /* CertificateFactory.java --- Certificate Factory Class ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CertificateFactory.java -- Certificate Factory Class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.util.Collection; *** 52,60 **** java.security.cert.X509Certificate class, and CRLs of the java.security.cert.X509CRL class. - @since JDK 1.2 - @author Mark Benvenuto */ public class CertificateFactory { --- 52,60 ---- java.security.cert.X509Certificate class, and CRLs of the java.security.cert.X509CRL class. @author Mark Benvenuto + @since JDK 1.2 + @status still missing full 1.4 support */ public class CertificateFactory { *************** public class CertificateFactory *** 267,270 **** return certFacSpi.engineGenerateCRLs( inStream ); } ! } --- 267,275 ---- return certFacSpi.engineGenerateCRLs( inStream ); } ! public final CertPath generateCertPath(InputStream inStream) ! throws CertificateException ! { ! throw new CertificateException("not implemented"); ! } ! } // class CertificateFactory diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/Certificate.java gcc-3.3/libjava/java/security/cert/Certificate.java *** gcc-3.2.3/libjava/java/security/cert/Certificate.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/Certificate.java 2002-10-04 20:15:08.000000000 +0000 *************** import java.io.ObjectStreamException; *** 69,75 **** */ public abstract class Certificate { ! private String type; /** Constructs a new certificate of the specified type. An example --- 69,76 ---- */ public abstract class Certificate { ! static final long serialVersionUID = -6751606818319535583L; ! private String type; /** Constructs a new certificate of the specified type. An example diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertificateNotYetValidException.java gcc-3.3/libjava/java/security/cert/CertificateNotYetValidException.java *** gcc-3.2.3/libjava/java/security/cert/CertificateNotYetValidException.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertificateNotYetValidException.java 2002-05-24 11:57:34.000000000 +0000 *************** *** 1,5 **** ! /* CertificateNotYetValidException.java --- Certificate Not Yet Valid Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CertificateNotYetValidException.java -- Certificate Not Yet Valid Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,69 **** package java.security.cert; /** ! Exception for a Certificate being not yet valid. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto */ public class CertificateNotYetValidException extends CertificateException { /** ! Constructs an CertificateNotYetValidException without a message string. ! */ public CertificateNotYetValidException() { - super(); } /** ! Constructs an CertificateNotYetValidException with a message string. ! ! @param msg A message to display with exception ! */ public CertificateNotYetValidException(String msg) { ! super( msg ); } - } --- 39,71 ---- package java.security.cert; /** ! * Exception for a Certificate that is not yet valid. ! * ! * @author Mark Benvenuto ! * @since 1.2 ! * @status updated to 1.4 */ public class CertificateNotYetValidException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 4355919900041064702L; /** ! * Constructs an exception without a message string. ! */ public CertificateNotYetValidException() { } /** ! * Constructs an exception with a message string. ! * ! * @param msg A message to display with exception ! */ public CertificateNotYetValidException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertificateParsingException.java gcc-3.3/libjava/java/security/cert/CertificateParsingException.java *** gcc-3.2.3/libjava/java/security/cert/CertificateParsingException.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertificateParsingException.java 2002-05-24 11:57:35.000000000 +0000 *************** *** 1,5 **** ! /* CertificateParsingException.java --- Certificate Parsing Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CertificateParsingException.java -- Certificate Parsing Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 39,69 **** package java.security.cert; /** ! Exception for a Certificate Parsing. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto */ public class CertificateParsingException extends CertificateException { /** ! Constructs an CertificateParsingException without a message string. ! */ public CertificateParsingException() { - super(); } /** ! Constructs an CertificateParsingException with a message string. ! ! @param msg A message to display with exception ! */ public CertificateParsingException(String msg) { ! super( msg ); } - } --- 39,71 ---- package java.security.cert; /** ! * Exception for parsing a DER-encoded Certificate. ! * ! * @author Mark Benvenuto ! * @since 1.2 ! * @status updated to 1.4 */ public class CertificateParsingException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -7989222416793322029L; /** ! * Constructs an exception without a message string. ! */ public CertificateParsingException() { } /** ! * Constructs an exception with a message string. ! * ! * @param msg a message to display with exception ! */ public CertificateParsingException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertPathBuilderException.java gcc-3.3/libjava/java/security/cert/CertPathBuilderException.java *** gcc-3.2.3/libjava/java/security/cert/CertPathBuilderException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertPathBuilderException.java 2002-05-24 11:57:32.000000000 +0000 *************** *** 0 **** --- 1,159 ---- + /* CertPathBuilderException.java -- wraps an exception during certificate + path building + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.security.cert; + + import java.io.PrintStream; + import java.io.PrintWriter; + import java.security.GeneralSecurityException; + + /** + * Indicates a problem while using a CertPathBuilder, wrapping + * the lower exception. This class is not thread-safe. + * + * @author Eric Blake + * @see CertPathBuilder + * @since 1.4 + * @status updated to 1.4 + */ + public class CertPathBuilderException extends GeneralSecurityException + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 5316471420178794402L; + + /** + * Create an exception without a message. The cause may be initialized. + */ + public CertPathBuilderException() + { + } + + /** + * Create an exception with a message. The cause may be initialized. + * + * @param msg a message to display with exception + */ + public CertPathBuilderException(String msg) + { + super(msg); + } + + /** + * Create an exception with a cause. The message will be + * cause == null ? null : cause.toString(). + * + * @param cause the cause + */ + public CertPathBuilderException(Throwable cause) + { + this(cause == null ? null : cause.toString(), cause); + } + + /** + * Create an exception with a cause and a message. + * + * @param msg the message + * @param cause the cause + */ + public CertPathBuilderException(String msg, Throwable cause) + { + super(msg); + initCause(cause); + } + + /** + * Get the detail message. + * + * @return the detail message + */ + public String getMessage() + { + return super.getMessage(); + } + + /** + * Get the cause, null if unknown. + * + * @return the cause + */ + public Throwable getCause() + { + return super.getCause(); + } + + /** + * Convert this to a string, including its cause. + * + * @return the string conversion + */ + public String toString() + { + return super.toString(); + } + + /** + * Print the stack trace to System.err. + */ + public void printStackTrace() + { + super.printStackTrace(); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintWriter stream) + { + super.printStackTrace(stream); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertPath.java gcc-3.3/libjava/java/security/cert/CertPath.java *** gcc-3.2.3/libjava/java/security/cert/CertPath.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertPath.java 2002-05-24 11:57:31.000000000 +0000 *************** *** 0 **** --- 1,252 ---- + /* CertPath.java -- a sequence of certificates + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.security.cert; + + import java.io.ByteArrayInputStream; + import java.io.NotSerializableException; + import java.io.ObjectStreamException; + import java.io.Serializable; + import java.util.Iterator; + import java.util.List; + + /** + * This class represents an immutable sequence, or path, of security + * certificates. The path type must match the type of each certificate in the + * path, or in other words, for all instances of cert in a certpath object, + * cert.getType().equals(certpath.getType()) will return true. + * + *

        Since this class is immutable, it is thread-safe. During serialization, + * the path is consolidated into a {@link CertPathRep}, which preserves the + * data regardless of the underlying implementation of the path. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public abstract class CertPath implements Serializable + { + /** + * The serialized representation of a path. + * + * @author Eric Blake + */ + protected static class CertPathRep implements Serializable + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 3015633072427920915L; + + /** + * The certificate type. + * + * @serial the type of the certificate path + */ + private final String type; + + /** + * The encoded form of the path. + * + * @serial the encoded form + */ + private final byte[] data; + + /** + * Create the new serial representation. + * + * @param type the path type + * @param data the encoded path data + */ + protected CertPathRep(String type, byte[] data) + { + this.type = type; + this.data = data; + } + + /** + * Decode the data into an actual {@link CertPath} upon deserialization. + * + * @return the replacement object + * @throws ObjectStreamException if replacement fails + */ + protected Object readResolve() throws ObjectStreamException + { + try + { + return CertificateFactory.getInstance(type) + .generateCertPath(new ByteArrayInputStream(data)); + } + catch (CertificateException e) + { + throw (ObjectStreamException) + new NotSerializableException("java.security.cert.CertPath: " + + type).initCause(e); + } + } + } // class CertPathRep + + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 6068470306649138683L; + + /** + * The path type. + * + * @serial the type of all certificates in this path + */ + private final String type; + + /** + * Create a certificate path with the given type. Most code should use + * {@link CertificateFactory} to create CertPaths. + * + * @param type the type of the path + */ + protected CertPath(String type) + { + this.type = type; + } + + /** + * Get the (non-null) type of all certificates in the path. + * + * @return the path certificate type + */ + public String getType() + { + return type; + } + + /** + * Get an immutable iterator over the path encodings (all String names), + * starting with the default encoding. The iterator will throw an + * UnsupportedOperationException if an attempt is made to + * remove items from the list. + * + * @return the iterator of supported encodings in the path + */ + public abstract Iterator getEncodings(); + + /** + * Compares this path to another for semantic equality. To be equal, both + * must be instances of CertPath, with the same type, and identical + * certificate lists. Overriding classes must not change this behavior. + * + * @param o the object to compare to + * @return true if the two are equal + */ + public boolean equals(Object o) + { + if (! (o instanceof CertPath)) + return false; + CertPath cp = (CertPath) o; + return type.equals(cp.type) + && getCertificates().equals(cp.getCertificates()); + } + + /** + * Returns the hashcode of this certificate path. This is defined as:
        + * 31 * getType().hashCode() + getCertificates().hashCode(). + * + * @return the hashcode + */ + public int hashCode() + { + return 31 * type.hashCode() + getCertificates().hashCode(); + } + + public String toString() + { + List l = getCertificates(); + int size = l.size(); + int i = 0; + StringBuffer result = new StringBuffer(type); + result.append(" Cert Path: length = ").append(size).append(".\n[\n"); + while (--size >= 0) + result.append(l.get(i++)).append('\n'); + return result.append("\n]").toString(); + } + + /** + * Returns the encoded form of this path, via the default encoding. + * + * @return the encoded form + * @throws CertificateEncodingException if encoding fails + */ + public abstract byte[] getEncoded() throws CertificateEncodingException; + + /** + * Returns the encoded form of this path, via the specified encoding. + * + * @param encoding the encoding to use + * @return the encoded form + * @throws CertificateEncodingException if encoding fails or does not exist + */ + public abstract byte[] getEncoded(String encoding) + throws CertificateEncodingException; + + /** + * Returns the immutable, thread-safe list of certificates in this path. + * + * @return the list of certificates, non-null but possibly empty + */ + public abstract List getCertificates(); + + /** + * Serializes the path in its encoded form, to ensure reserialization with + * the appropriate factory object without worrying about list implementation. + * The result will always be an instance of {@link CertPathRep}. + * + * @return the replacement object + * @throws ObjectStreamException if the replacement creation fails + */ + protected Object writeReplace() throws ObjectStreamException + { + try + { + return new CertPathRep(type, getEncoded()); + } + catch (CertificateEncodingException e) + { + throw (ObjectStreamException) + new NotSerializableException("java.security.cert.CertPath: " + + type).initCause(e); + } + } + } // class CertPath diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertPathValidatorException.java gcc-3.3/libjava/java/security/cert/CertPathValidatorException.java *** gcc-3.2.3/libjava/java/security/cert/CertPathValidatorException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertPathValidatorException.java 2002-05-24 11:57:32.000000000 +0000 *************** *** 0 **** --- 1,226 ---- + /* CertPathValidatorException.java -- wraps an exception during validation + of a CertPath + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.security.cert; + + import java.io.PrintStream; + import java.io.PrintWriter; + import java.security.GeneralSecurityException; + + /** + * Indicates a problem while validating a certification path. In addition, + * it can store the path an index in that path that caused the problem. This + * class is not thread-safe. + * + * @author Eric Blake + * @see CertPathValidator + * @since 1.4 + * @status updated to 1.4 + */ + public class CertPathValidatorException extends GeneralSecurityException + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -3083180014971893139L; + + /** + * The index of the certificate path that failed, or -1. + * + * @serial the failed index + */ + private final int index; + + /** + * The CertPath that failed. + * + * @serial the object being validated at time of failure + */ + private final CertPath certPath; + + /** + * Create an exception without a message. The cause may be initialized. The + * index is set to -1 and the failed CertPath object to null. + */ + public CertPathValidatorException() + { + this((String) null); + } + + /** + * Create an exception with a message. The cause may be initialized. The + * index is set to -1 and the failed CertPath object to null. + * + * @param msg a message to display with exception + */ + public CertPathValidatorException(String msg) + { + super(msg); + index = -1; + certPath = null; + } + + /** + * Create an exception with a cause. The message will be + * cause == null ? null : cause.toString(). The index is set + * to -1 and the failed CertPath object to null. + * + * @param cause the cause + */ + public CertPathValidatorException(Throwable cause) + { + this(cause == null ? null : cause.toString(), cause, null, -1); + } + + /** + * Create an exception with a cause and a message. The index is set to -1 + * and the failed CertPath object to null. + * + * @param msg the message + * @param cause the cause + */ + public CertPathValidatorException(String msg, Throwable cause) + { + this(msg, cause, null, -1); + } + + /** + * Create an exception with a cause, message, failed object, and index of + * failure in that CertPath. + * + * @param msg the message + * @param cause the cause + * @param certPath the path that was being validated, or null + * @param index the index of the path, or -1 + * @throws IndexOutOfBoundsException if index is < -1 or + * > certPath.getCertificates().size() + * @throws IllegalArgumentException if certPath is null but index != -1 + */ + public CertPathValidatorException(String msg, Throwable cause, + CertPath certPath, int index) + { + super(msg); + initCause(cause); + if (index < -1 || (certPath != null + && index >= certPath.getCertificates().size())) + throw new IndexOutOfBoundsException(); + if ((certPath == null) != (index == -1)) + throw new IllegalArgumentException(); + this.certPath = certPath; + this.index = index; + } + + /** + * Get the detail message. + * + * @return the detail message + */ + public String getMessage() + { + return super.getMessage(); + } + + /** + * Get the certificate path that had the failure, or null. + * + * @return the culprit path + */ + public CertPath getCertPath() + { + return certPath; + } + + /** + * Get the index that failed, or -1. + * + * @return the colprit index + */ + public int getIndex() + { + return index; + } + + /** + * Get the cause, null if unknown. + * + * @return the cause + */ + public Throwable getCause() + { + return super.getCause(); + } + + /** + * Convert this to a string, including its cause. + * + * @return the string conversion + */ + public String toString() + { + return super.toString(); + } + + /** + * Print the stack trace to System.err. + */ + public void printStackTrace() + { + super.printStackTrace(); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintWriter stream) + { + super.printStackTrace(stream); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CertStoreException.java gcc-3.3/libjava/java/security/cert/CertStoreException.java *** gcc-3.2.3/libjava/java/security/cert/CertStoreException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CertStoreException.java 2002-05-24 11:57:32.000000000 +0000 *************** *** 0 **** --- 1,159 ---- + /* CertStoreException.java -- wraps an exception during certificate storage + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.security.cert; + + import java.io.PrintStream; + import java.io.PrintWriter; + import java.security.GeneralSecurityException; + + /** + * Indicates a problem while retrieving certificates and CRLs from + * CertStore, wrapping the lower exception. This class is not + * thread-safe. + * + * @author Eric Blake + * @see CertStore + * @since 1.4 + * @status updated to 1.4 + */ + public class CertStoreException extends GeneralSecurityException + { + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 2395296107471573245L; + + /** + * Create an exception without a message. The cause may be initialized. + */ + public CertStoreException() + { + } + + /** + * Create an exception with a message. The cause may be initialized. + * + * @param msg a message to display with exception + */ + public CertStoreException(String msg) + { + super(msg); + } + + /** + * Create an exception with a cause. The message will be + * cause == null ? null : cause.toString(). + * + * @param cause the cause + */ + public CertStoreException(Throwable cause) + { + this(cause == null ? null : cause.toString(), cause); + } + + /** + * Create an exception with a cause and a message. + * + * @param msg the message + * @param cause the cause + */ + public CertStoreException(String msg, Throwable cause) + { + super(msg); + initCause(cause); + } + + /** + * Get the detail message. + * + * @return the detail message + */ + public String getMessage() + { + return super.getMessage(); + } + + /** + * Get the cause, null if unknown. + * + * @return the cause + */ + public Throwable getCause() + { + return super.getCause(); + } + + /** + * Convert this to a string, including its cause. + * + * @return the string conversion + */ + public String toString() + { + return super.toString(); + } + + /** + * Print the stack trace to System.err. + */ + public void printStackTrace() + { + super.printStackTrace(); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintWriter stream) + { + super.printStackTrace(stream); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/security/cert/CRLException.java gcc-3.3/libjava/java/security/cert/CRLException.java *** gcc-3.2.3/libjava/java/security/cert/CRLException.java 2002-01-22 22:40:33.000000000 +0000 --- gcc-3.3/libjava/java/security/cert/CRLException.java 2002-05-24 11:57:31.000000000 +0000 *************** *** 1,5 **** ! /* CRLException.java --- Certificate Revocation List Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* CRLException.java -- Certificate Revocation List Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,70 **** package java.security.cert; import java.security.GeneralSecurityException; /** ! Exception for a Certificate Revocation List. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto */ public class CRLException extends GeneralSecurityException { /** ! Constructs an CRLExceptionwithout a message string. ! */ public CRLException() { - super(); } /** ! Constructs an CRLException with a message string. ! ! @param msg A message to display with exception ! */ public CRLException(String msg) { ! super( msg ); } - } --- 37,73 ---- package java.security.cert; + import java.security.GeneralSecurityException; /** ! * Exception for a Certificate Revocation List. ! * ! * @author Mark Benvenuto ! * @since 1.2 ! * @status updated to 1.4 */ public class CRLException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -6694728944094197147L; /** ! * Constructs an CRLExceptionwithout a message string. ! */ public CRLException() { } /** ! * Constructs an CRLException with a message string. ! * ! * @param msg a message to display with exception ! */ public CRLException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/Certificate.java gcc-3.3/libjava/java/security/Certificate.java *** gcc-3.2.3/libjava/java/security/Certificate.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Certificate.java 2002-05-24 11:57:12.000000000 +0000 *************** *** 1,5 **** ! /* Certificate.java -- Interface for modeling digital certificates ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Certificate.java -- deprecated interface for modeling digital certificates ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.OutputStream; *** 42,125 **** import java.io.IOException; /** ! * This interface models a digital certificate which verifies the * authenticity of a party. This class simply allows certificate * information to be queried, it does not guarantee that the certificate * is valid. - *

        - * This class is deprecated in favor of the new java.security.cert package. - * It exists for backward compatibility only. - * - * @deprecated * ! * @version 0.0 * * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface Certificate { - /** * This method returns the Principal that is guaranteeing * this certificate. * ! * @return The Principal guaranteeing the certificate */ ! public abstract Principal getGuarantor(); /** * This method returns the Principal being guaranteed by * this certificate. * ! * @return The Principal guaranteed by this certificate. */ ! public abstract Principal getPrincipal(); /** * This method returns the public key for the Principal that * is being guaranteed. * ! * @return The PublicKey of the Principal being guaranteed ! */ ! public abstract PublicKey getPublicKey(); ! ! /** ! * This method returns the encoding format of the certificate (e.g., "PGP", ! * "X.509"). This format is used by the encodedecode methods. ! * ! * @return The encoding format being used */ ! public abstract String getFormat(); /** * This method writes the certificate to an OutputStream in * a format that can be understood by the decode method. * ! * @param out The OutputStream to write to. ! * ! * @exception KeyException If there is a problem with the internals of this certificate ! * @exception IOException If an error occurs writing to the stream. */ ! public abstract void ! encode(OutputStream out) throws KeyException, IOException; /** * This method reads an encoded certificate from an InputStream. * ! * @param in The InputStream to read from. * ! * @param KeyException If there is a problem with the certificate data ! * @param IOException If an error occurs reading from the stream. */ ! public abstract void ! decode(InputStream in) throws KeyException, IOException; /** * This method returns a String representation of the contents * of this certificate. * ! * @param detail true to provided detailed information about this certificate, false otherwise */ ! public abstract String toString(boolean detail); ! } --- 42,131 ---- import java.io.IOException; /** ! * This interface models a digital certificate which verifies the * authenticity of a party. This class simply allows certificate * information to be queried, it does not guarantee that the certificate * is valid. * ! *

        This class is deprecated in favor of the new java.security.cert package. ! * It exists for backward compatibility only. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.1 + * @deprecated use {@link java.security.cert} instead + * @status updated to 1.4 */ public interface Certificate { /** * This method returns the Principal that is guaranteeing * this certificate. * ! * @return the Principal guaranteeing the certificate ! * @deprecated this entire interface is deprecated */ ! Principal getGuarantor(); /** * This method returns the Principal being guaranteed by * this certificate. * ! * @return the Principal guaranteed by this certificate ! * @deprecated this entire interface is deprecated */ ! Principal getPrincipal(); /** * This method returns the public key for the Principal that * is being guaranteed. * ! * @return the PublicKey of the Principal being guaranteed ! * @deprecated this entire interface is deprecated */ ! PublicKey getPublicKey(); /** * This method writes the certificate to an OutputStream in * a format that can be understood by the decode method. * ! * @param out the OutputStream to write to ! * @throws KeyException if there is a problem with the certificate ! * @throws IOException if an error occurs writing to the stream ! * @see #decode(InputStream) ! * @see #getFormat() ! * @deprecated this entire interface is deprecated */ ! void encode(OutputStream out) throws KeyException, IOException; /** * This method reads an encoded certificate from an InputStream. * ! * @param in the InputStream to read from ! * @throws KeyException if there is a problem with the certificate data ! * @throws IOException if an error occurs reading from the stream ! * @see #encode(OutputStream) ! * @see #getFormat() ! * @deprecated this entire interface is deprecated ! */ ! void decode(InputStream in) throws KeyException, IOException; ! ! /** ! * This method returns the encoding format of the certificate (e.g., "PGP", ! * "X.509"). This format is used by the encode and ! * decode methods. * ! * @return the encoding format being used ! * @deprecated this entire interface is deprecated */ ! String getFormat(); /** * This method returns a String representation of the contents * of this certificate. * ! * @param detail true to provided more detailed information ! * @return the string representation ! * @deprecated this entire interface is deprecated */ ! String toString(boolean detail); ! } // interface Certificate diff -Nrc3pad gcc-3.2.3/libjava/java/security/CodeSource.java gcc-3.3/libjava/java/security/CodeSource.java *** gcc-3.2.3/libjava/java/security/CodeSource.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/CodeSource.java 2002-05-24 11:57:12.000000000 +0000 *************** *** 1,5 **** /* CodeSource.java -- Code location and certifcates ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* CodeSource.java -- Code location and certifcates ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,90 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.security; import java.io.Serializable; import java.net.URL; import java.net.SocketPermission; /** * This class represents a location from which code is loaded (as ! * represented by a URL) and the list of certificates that are used to * check the signatures of signed code loaded from this source. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class CodeSource implements Serializable { ! private static final String linesep = System.getProperty("line.separator"); /** * This is the URL that represents the code base from which code will * be loaded. */ ! private URL location; /** ! * This is the list of certificates for this code base */ ! // What is the serialized form of this? ! private java.security.cert.Certificate[] certs; /** ! * This method initializes a new instance of CodeSource that ! * loads code from the specified URL location and which uses the ! * specified certificates for verifying signatures. * ! * @param location The location from which code will be loaded ! * @param certs The list of certificates used for verifying signatures on code from this source */ ! public CodeSource(URL location, java.security.cert.Certificate[] certs) { ! this.location = location; ! this.certs = certs; } /** * This method returns the URL specifying the location from which code * will be loaded under this CodeSource. * ! * @return The code location for this CodeSource. */ public final URL getLocation() { --- 35,136 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.security; + import java.io.ByteArrayInputStream; + import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; import java.io.Serializable; import java.net.URL; import java.net.SocketPermission; + // Note that this overrides Certificate in this package. + import java.security.cert.Certificate; + import java.security.cert.CertificateFactory; + import java.security.cert.CertificateEncodingException; + import java.security.cert.CertificateException; + import java.util.Arrays; + import java.util.HashSet; + import java.util.Iterator; /** * This class represents a location from which code is loaded (as ! * represented by a URL), and the list of certificates that are used to * check the signatures of signed code loaded from this source. * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.1 ! * @status updated to 1.4 */ public class CodeSource implements Serializable { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 4977541819976013951L; /** * This is the URL that represents the code base from which code will * be loaded. + * + * @serial the code location */ ! private final URL location; ! ! /** The set of certificates for this code base. */ ! private transient HashSet certs; /** ! * This creates a new instance of CodeSource that loads code ! * from the specified URL location and which uses the specified certificates ! * for verifying signatures. ! * ! * @param location the location from which code will be loaded ! * @param certs the list of certificates */ ! public CodeSource(URL location, Certificate[] certs) ! { ! this.location = location; ! if (certs != null) ! this.certs = new HashSet(Arrays.asList(certs)); ! } /** ! * This method returns a hash value for this object. * ! * @return a hash value for this object */ ! public int hashCode() { ! return (location == null ? 0 : location.hashCode()) ! ^ (certs == null ? 0 : certs.hashCode()); ! } ! ! /** ! * This method tests the specified Object for equality with ! * this object. This will be true if and only if the locations are equal ! * and the certificate sets are identical (ignoring order). ! * ! * @param obj the Object to test against ! * @return true if the specified object is equal to this one ! */ ! public boolean equals(Object obj) ! { ! if (! (obj instanceof CodeSource)) ! return false; ! CodeSource cs = (CodeSource) obj; ! return (certs == null ? cs.certs == null : certs.equals(cs.certs)) ! && (location == null ? cs.location == null ! : location.equals(cs.location)); } /** * This method returns the URL specifying the location from which code * will be loaded under this CodeSource. * ! * @return the code location for this CodeSource */ public final URL getLocation() { *************** public class CodeSource implements Seria *** 93,327 **** /** * This method returns the list of digital certificates that can be used ! * to verify the signatures of code loaded under this CodeSource. * ! * @return The certifcate list for this CodeSource. */ ! public final java.security.cert.Certificate[] getCertificates() { ! return certs; } /** ! * This method tests to see if a specified CodeSource is * implied by this object. Effectively, to meet this test, the specified ! * object must have all the certifcates this object has (but may have ! * more) and must have a location that is a subset of this object's. In order * for this object to imply the specified object, the following must be ! * true: ! *

        ! *

          ! *
        1. The specified CodeSource must not be null. ! *
        2. If the specified CodeSource has a certificate list, ! * all of that object's certificates must be present in the certificate ! * list of this object. *
        3. If this object does not have a null location, then ! * the following addtional tests must be passed. ! *
            ! *
          1. The specified CodeSource must not have a null location. ! *
          2. The specified CodeSource's location must be equal to ! * this object's location, or
            ! *
              ! *
            • The specifiec CodeSource's location protocol, port, ! * and ref (aka, anchor) must equal this objects, and ! *
            • The specified CodeSource's location host must imply this ! * object's location host, as determined by contructing ! * SocketPermission objects from each with no action list and ! * using that classes's implies method. And, ! *
            • If this object's location file ends with a '/', then the specified ! * object's location file must start with this object's location file. ! * Otherwise, the specified object's location file must start with this ! * object's location file with the '/' character appended to it. ! *
            ! *
          *
        * ! * @param cs The CodeSource to test against this object * ! * @return true if this specified CodeSource is specified by this object, false otherwise. */ public boolean implies(CodeSource cs) { if (cs == null) return false; ! ! // First check the certificate list ! java.security.cert.Certificate[] their_certs = cs.getCertificates(); ! java.security.cert.Certificate[] our_certs = getCertificates(); ! ! if (our_certs != null) ! { ! if (their_certs == null) ! return false; ! ! for (int i = 0; i < our_certs.length; i++) ! { ! int j; ! for (j = 0; j < their_certs.length; j++) ! if (our_certs[i].equals(their_certs[j])) ! break; ! ! if (j == their_certs.length) ! return false; ! } ! } ! ! // Next check the location ! URL their_loc = getLocation(); ! URL our_loc = getLocation(); ! ! if (our_loc == null) ! return true; ! else if (their_loc == null) return false; ! ! if (!our_loc.getProtocol().equals(their_loc.getProtocol())) return false; ! ! if (our_loc.getPort() != -1) ! if (our_loc.getPort() != their_loc.getPort()) ! return false; ! ! if (our_loc.getRef() != null) ! if (!our_loc.getRef().equals(their_loc.getRef())) ! return false; ! ! // See javadoc comments for what we are doing here. ! if (our_loc.getHost() != null) { ! String their_host = their_loc.getHost(); ! if (their_host == null) ! return false; ! ! SocketPermission our_sockperm = ! new SocketPermission(our_loc.getHost(), "accept"); ! SocketPermission their_sockperm = ! new SocketPermission(their_host, "accept"); ! ! if (!our_sockperm.implies(their_sockperm)) ! return false; } ! ! String our_file = our_loc.getFile(); if (our_file != null) { ! if (!our_file.endsWith("/")) ! our_file = our_file + "/"; ! ! String their_file = their_loc.getFile(); ! if (their_file == null) ! return false; ! ! if (!their_file.startsWith(our_file)) ! return false; } - return true; } /** ! * This method tests the specified Object for equality with ! * this object. This will be true if and only if: ! *

        ! *

          ! *
        • The specified object is not null. ! *
        • The specified object is an instance of CodeSource. ! *
        • The specified object's location is the same as this object's. ! *
        • The specified object's certificate list contains the exact same ! * entries as the object's. Note that the order of the certificate lists ! * is not significant. ! *
        ! * ! * @param obj The Object to test against. * ! * @return true if the specified object is equal to this one, false otherwise. */ ! public boolean equals(Object obj) { ! if (obj == null) ! return false; ! ! if (!(obj instanceof CodeSource)) ! return false; ! ! CodeSource cs = (CodeSource) obj; ! ! // First check the certificate list ! java.security.cert.Certificate[] their_certs = cs.getCertificates(); ! java.security.cert.Certificate[] our_certs = getCertificates(); ! ! if ((our_certs == null) && (their_certs != null)) ! return false; ! else if ((our_certs != null) && (their_certs == null)) ! return false; ! ! if (our_certs != null) { ! if (our_certs.length != their_certs.length) ! return false; ! ! for (int i = 0; i < our_certs.length; i++) ! { ! int j; ! for (j = 0; j < their_certs.length; j++) ! if (our_certs[i].equals(their_certs[j])) ! break; ! ! if (j == their_certs.length) ! return false; ! } } ! ! // Now the location ! URL their_loc = cs.getLocation(); ! URL our_loc = getLocation(); ! ! if ((our_loc == null) && (their_loc != null)) ! return false; ! ! if (!our_loc.equals(their_loc)) ! return false; ! ! return true; } /** ! * This method returns a hash value for this object. * ! * @return A hash value for this object. */ ! public int hashCode() { ! URL location = getLocation(); ! if (location == null) ! return System.identityHashCode(this); ! ! return location.hashCode(); } /** ! * This method returns a String that represents this object. ! * This String will contain the object's hash code, location, ! * and certificate list. * ! * @return A String for this object */ ! public String toString() { ! StringBuffer sb = new StringBuffer(""); ! ! sb.append(super.toString() + " (" + linesep); ! sb.append("Location: " + getLocation() + linesep); ! ! java.security.cert.Certificate[] certs = getCertificates(); if (certs == null) ! sb.append("" + linesep); else ! for (int i = 0; i < certs.length; i++) ! sb.append(certs[i] + linesep); ! ! sb.append(")" + linesep); ! ! return sb.toString(); } ! } --- 139,347 ---- /** * This method returns the list of digital certificates that can be used ! * to verify the signatures of code loaded under this ! * CodeSource. * ! * @return the certifcate list for this CodeSource */ ! public final Certificate[] getCertificates() { ! if (certs == null) ! return null; ! Certificate[] c = new Certificate[certs.size()]; ! certs.toArray(c); ! return c; } /** ! * This method tests to see if a specified CodeSource is * implied by this object. Effectively, to meet this test, the specified ! * object must have all the certifcates this object has (but may have more), ! * and must have a location that is a subset of this object's. In order * for this object to imply the specified object, the following must be ! * true:
          ! *
        1. codesource must not be null.
        2. ! *
        3. If codesource has a certificate list, all of it's ! * certificates must be present in the certificate list of this ! * code source.
        4. *
        5. If this object does not have a null location, then ! * the following addtional tests must be passed.
            ! *
          1. codesource must not have a null ! * location.
          2. ! *
          3. codesource's location must be equal to this object's ! * location, or
              ! *
            • codesource's location protocol, port, and ref (aka, ! * anchor) must equal this objects
            • ! *
            • codesource's location host must imply this object's ! * location host, as determined by contructing ! * SocketPermission objects from each with no ! * action list and using that classes's implies ! * method
            • ! *
            • If this object's location file ends with a '/', then the ! * specified object's location file must start with this ! * object's location file. Otherwise, the specified object's ! * location file must start with this object's location file ! * with the '/' character appended to it.
            • ! *
          4. ! *
          *
        * ! *

        For example, each of these locations imply the location ! * "http://java.sun.com/classes/foo.jar":

          ! *
          !    * http:
          !    * http://*.sun.com/classes/*
          !    * http://java.sun.com/classes/-
          !    * http://java.sun.com/classes/foo.jar
          !    * 
          ! * Note that the code source with null location and null certificates implies ! * all other code sources. * ! * @param cs the CodeSource to test against this object ! * @return true if this specified CodeSource is implied */ public boolean implies(CodeSource cs) { if (cs == null) return false; ! // First check the certificate list. ! if (certs != null && (cs.certs == null || ! certs.containsAll(cs.certs))) return false; ! // Next check the location. ! if (location == null) ! return true; ! if (cs.location == null ! || ! location.getProtocol().equals(cs.location.getProtocol()) ! || (location.getPort() != -1 ! && location.getPort() != cs.location.getPort()) ! || (location.getRef() != null ! && ! location.getRef().equals(cs.location.getRef()))) return false; ! if (location.getHost() != null) { ! String their_host = cs.location.getHost(); ! if (their_host == null) ! return false; ! SocketPermission our_sockperm = ! new SocketPermission(location.getHost(), "accept"); ! SocketPermission their_sockperm = ! new SocketPermission(their_host, "accept"); ! if (! our_sockperm.implies(their_sockperm)) ! return false; } ! String our_file = location.getFile(); if (our_file != null) { ! if (! our_file.endsWith("/")) ! our_file += "/"; ! String their_file = cs.location.getFile(); ! if (their_file == null ! || ! their_file.startsWith(our_file)) ! return false; } return true; } /** ! * This method returns a String that represents this object. ! * The result is in the format "(" + getLocation() followed ! * by a space separated list of certificates (or ""), ! * followed by ")". * ! * @return a String for this object */ ! public String toString() { ! StringBuffer sb = new StringBuffer("(").append(location); ! if (certs == null || certs.isEmpty()) ! sb.append(" "); ! else { ! Iterator iter = certs.iterator(); ! for (int i = certs.size(); --i >= 0; ) ! sb.append(' ').append(iter.next()); } ! return sb.append(")").toString(); } /** ! * Reads this object from a serialization stream. * ! * @param s the input stream ! * @throws IOException if reading fails ! * @throws ClassNotFoundException if deserialization fails ! * @serialData this reads the location, then expects an int indicating the ! * number of certificates. Each certificate is a String type ! * followed by an int encoding length, then a byte[] encoding */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException { ! s.defaultReadObject(); ! int count = s.readInt(); ! certs = new HashSet(); ! while (--count >= 0) ! { ! String type = (String) s.readObject(); ! int bytes = s.readInt(); ! byte[] encoded = new byte[bytes]; ! for (int i = 0; i < bytes; i++) ! encoded[i] = s.readByte(); ! ByteArrayInputStream stream = new ByteArrayInputStream(encoded); ! try ! { ! CertificateFactory factory = CertificateFactory.getInstance(type); ! certs.add(factory.generateCertificate(stream)); ! } ! catch (CertificateException e) ! { ! // XXX Should we ignore this certificate? ! } ! } } /** ! * Writes this object to a serialization stream. * ! * @param s the output stream ! * @throws IOException if writing fails ! * @serialData this writes the location, then writes an int indicating the ! * number of certificates. Each certificate is a String type ! * followed by an int encoding length, then a byte[] encoding */ ! private void writeObject(ObjectOutputStream s) throws IOException { ! s.defaultWriteObject(); if (certs == null) ! s.writeInt(0); else ! { ! int count = certs.size(); ! s.writeInt(count); ! Iterator iter = certs.iterator(); ! while (--count >= 0) ! { ! Certificate c = (Certificate) iter.next(); ! s.writeObject(c.getType()); ! byte[] encoded; ! try ! { ! encoded = c.getEncoded(); ! } ! catch (CertificateEncodingException e) ! { ! // XXX Should we ignore this certificate? ! encoded = null; ! } ! if (encoded == null) ! s.writeInt(0); ! else ! { ! s.writeInt(encoded.length); ! for (int i = 0; i < encoded.length; i++) ! s.writeByte(encoded[i]); ! } ! } ! } } ! } // class CodeSource diff -Nrc3pad gcc-3.2.3/libjava/java/security/DigestException.java gcc-3.3/libjava/java/security/DigestException.java *** gcc-3.2.3/libjava/java/security/DigestException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/DigestException.java 2002-05-24 11:57:12.000000000 +0000 *************** *** 1,5 **** /* DigestException.java -- A generic message digest exception ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* DigestException.java -- A generic message digest exception ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,66 **** package java.security; /** ! * This exception indicates that a generic message digest exception has * occurred. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class DigestException extends GeneralSecurityException { /** ! * This method initializes a new DigestException with no ! * descriptive message. */ public DigestException() { - super(); } /** ! * This method initializes a new instance of DigestException ! * with a descriptive error message. * ! * @param msg The descriptive message */ public DigestException(String msg) { --- 38,67 ---- package java.security; /** ! * This exception indicates that a generic message digest exception has * occurred. * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ public class DigestException extends GeneralSecurityException { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 5821450303093652515L; ! ! /** ! * Create a new instance with no descriptive message. */ public DigestException() { } /** ! * Create a new instance with a descriptive error message. * ! * @param msg the descriptive message */ public DigestException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/DigestOutputStream.java gcc-3.3/libjava/java/security/DigestOutputStream.java *** gcc-3.2.3/libjava/java/security/DigestOutputStream.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/DigestOutputStream.java 2002-05-24 11:57:13.000000000 +0000 *************** public class DigestOutputStream extends *** 112,118 **** if (state) digest.update((byte) b); ! super.write(b); } /** --- 112,118 ---- if (state) digest.update((byte) b); ! out.write(b); } /** *************** public class DigestOutputStream extends *** 131,137 **** if (state) digest.update(b, off, len); ! super.write(b, off, len); } /** --- 131,137 ---- if (state) digest.update(b, off, len); ! out.write(b, off, len); } /** diff -Nrc3pad gcc-3.2.3/libjava/java/security/DomainCombiner.java gcc-3.3/libjava/java/security/DomainCombiner.java *** gcc-3.2.3/libjava/java/security/DomainCombiner.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/DomainCombiner.java 2002-05-24 11:57:13.000000000 +0000 *************** *** 1,5 **** ! /* DomainCombiner.java - Combines ProtectionDomains ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* DomainCombiner.java -- Combines ProtectionDomains ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,64 **** package java.security; /** ! A public interface used to combine two ProtectionDomains in a new ! ProtectionDomain and update the current Protection Domains ! associated with the current AccessControllerContext. ! ! It can add, subtract, or update ProtectionDomains or possibly ! remove duplicates or any possible complex action but just not add ! ones that do not already exist in either array. ! ! @since JDK 1.3 ! @author Mark Benvenuto */ public interface DomainCombiner { /** ! Combines the current ProtectionDomains of the Thread with new ! ProtectionDomains. ! ! @param currentDomains - the ProtectionDomains for the current thread. ! @param assignedDomains - ProtectionsDomains to add ! @returns a new array of all the ProtectionDomains */ ! public ProtectionDomain[] combine(ProtectionDomain[]currentDomains, ! ProtectionDomain[]assignedDomains); ! } --- 38,67 ---- package java.security; /** ! * A public interface used to combine two ProtectionDomains in a new ! * ProtectionDomain and update the current Protection Domains ! * associated with the current AccessControlContext. ! * ! * It can add, subtract, or update ProtectionDomains or possibly ! * remove duplicates or any possible complex action but just not add ! * ones that do not already exist in either array. ! * ! * @author Mark Benvenuto ! * @see AccessControlContext ! * @see AccessController ! * @since 1.3 ! * @status updated to 1.4 */ public interface DomainCombiner { /** ! * Combines the current ProtectionDomains of the Thread with new ! * ProtectionDomains. ! * ! * @param currentDomains - the ProtectionDomains for the current thread. ! * @param assignedDomains - ProtectionsDomains to add ! * @return a new array of all the ProtectionDomains */ ! ProtectionDomain[] combine(ProtectionDomain[] currentDomains, ! ProtectionDomain[] assignedDomains); ! } // interface DomainCombiner diff -Nrc3pad gcc-3.2.3/libjava/java/security/DummyKeyPairGenerator.java gcc-3.3/libjava/java/security/DummyKeyPairGenerator.java *** gcc-3.2.3/libjava/java/security/DummyKeyPairGenerator.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/DummyKeyPairGenerator.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** ! /* DummyKeyPairGenerator.java ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* DummyKeyPairGenerator.java - Wrapper for KeyPairGeneratorSpi ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** obligated to do so. If you do not wish *** 36,41 **** --- 36,42 ---- exception statement from your version. */ package java.security; + import java.security.spec.AlgorithmParameterSpec; final class DummyKeyPairGenerator extends KeyPairGenerator *************** final class DummyKeyPairGenerator extend *** 48,53 **** --- 49,65 ---- this.kpgSpi = kpgSpi; } + public Object clone() throws CloneNotSupportedException + { + if (!(kpgSpi instanceof Cloneable)) + throw new CloneNotSupportedException(); + + KeyPairGenerator result = new DummyKeyPairGenerator + ((KeyPairGeneratorSpi) kpgSpi.clone(), this.getAlgorithm()); + result.provider = this.getProvider(); + return result; + } + public void initialize(int keysize, SecureRandom random) { kpgSpi.initialize(keysize, random); diff -Nrc3pad gcc-3.2.3/libjava/java/security/DummyMessageDigest.java gcc-3.3/libjava/java/security/DummyMessageDigest.java *** gcc-3.2.3/libjava/java/security/DummyMessageDigest.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/DummyMessageDigest.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** ! /* DummyMessageDigest.java ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* DummyMessageDigest.java - Wrapper for MessageDigestSpi ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,46 **** package java.security; - import java.security.MessageDigest; - import java.security.MessageDigestSpi; - import java.security.DigestException; - final class DummyMessageDigest extends MessageDigest { private MessageDigestSpi mdSpi = null; --- 37,42 ---- *************** final class DummyMessageDigest extends M *** 51,73 **** this.mdSpi = mdSpi; } ! protected void engineUpdate(byte input) { ! mdSpi.engineUpdate(input); } ! protected void engineUpdate(byte[]input, int offset, int len) { ! mdSpi.engineUpdate(input, offset, len); } ! protected byte[] engineDigest() { ! return mdSpi.engineDigest(); } ! protected void engineReset() { mdSpi.engineReset(); } } --- 47,93 ---- this.mdSpi = mdSpi; } ! public Object clone() throws CloneNotSupportedException { ! if (!(mdSpi instanceof Cloneable)) ! throw new CloneNotSupportedException(); ! ! MessageDigest result = new DummyMessageDigest ! ((MessageDigestSpi) mdSpi.clone(), this.getAlgorithm()); ! result.provider = this.getProvider(); ! return result; } ! // java.security.MessageDigestSpi abstract methods implementation --------- ! ! public byte[] engineDigest() { ! return mdSpi.engineDigest(); } ! public int engineDigest(byte[] buf, int offset, int len) ! throws DigestException { ! return mdSpi.engineDigest(buf, offset, len); } ! public int engineGetDigestLength() ! { ! return mdSpi.engineGetDigestLength(); ! } ! ! public void engineReset() { mdSpi.engineReset(); } + + public void engineUpdate(byte input) + { + mdSpi.engineUpdate(input); + } + + public void engineUpdate(byte[] input, int offset, int len) + { + mdSpi.engineUpdate(input, offset, len); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/DummySignature.java gcc-3.3/libjava/java/security/DummySignature.java *** gcc-3.2.3/libjava/java/security/DummySignature.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/DummySignature.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** ! /* DummySignature.java ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* DummySignature.java - Signature wrapper for SignatureSpi. ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** final class DummySignature extends Signa *** 47,52 **** --- 47,63 ---- this.sigSpi = sigSpi; } + public Object clone() throws CloneNotSupportedException + { + if (!(sigSpi instanceof Cloneable)) + throw new CloneNotSupportedException(); + + Signature result = new DummySignature + ((SignatureSpi) sigSpi.clone(), this.getAlgorithm()); + result.provider = this.getProvider(); + return result; + } + protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException { diff -Nrc3pad gcc-3.2.3/libjava/java/security/GeneralSecurityException.java gcc-3.3/libjava/java/security/GeneralSecurityException.java *** gcc-3.2.3/libjava/java/security/GeneralSecurityException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/GeneralSecurityException.java 2002-05-24 11:57:13.000000000 +0000 *************** *** 1,5 **** /* GeneralSecurityException.java -- Common superclass of security exceptions ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* GeneralSecurityException.java -- Common superclass of security exceptions ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,71 **** * This class is the common superclass of all security exceptions. All * exceptions in java.security extend this class with the exception (no * pun intended) of AccessControlException and ! * CertificateException which extend SecurityException ! * and ProviderException which extens RuntimeException. ! * and InvalidParamterException which extends ! * IllegalArgumentException. ! * ! * @version 0.0 * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class GeneralSecurityException extends Exception { /** ! * This method initializes a new instance of GeneralSecurityException ! * with no descriptive error message. */ public GeneralSecurityException() { - super(); } /** ! * This method initializes a new instance of GeneralSecurityException ! * with a descriptive error message. * ! * @param msg The descriptive error message. */ public GeneralSecurityException(String msg) { --- 41,72 ---- * This class is the common superclass of all security exceptions. All * exceptions in java.security extend this class with the exception (no * pun intended) of AccessControlException and ! * CertificateException (which extend ! * SecurityException), ProviderException ! * (RuntimeException), and InvalidParamterException ! * (IllegalArgumentException). * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ public class GeneralSecurityException extends Exception { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 894798122053539237L; ! ! /** ! * Create a new instance with no descriptive error message. */ public GeneralSecurityException() { } /** ! * Create a new instance with a descriptive error message. * ! * @param msg the descriptive error message */ public GeneralSecurityException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/GuardedObject.java gcc-3.3/libjava/java/security/GuardedObject.java *** gcc-3.2.3/libjava/java/security/GuardedObject.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/GuardedObject.java 2002-05-24 11:57:14.000000000 +0000 *************** *** 1,5 **** /* GuardedObject.java -- An object protected by a Guard ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* GuardedObject.java -- An object protected by a Guard ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,75 **** package java.security; import java.io.Serializable; /** * This class is an object that is guarded by a Guard object. ! * The object that is being guarded is retrieved by a call to the only * method in this class - getObject. That method returns the ! * guarded Object after first checking with the * Guard. If the Guard disallows access, an * exception will be thrown. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class GuardedObject implements Serializable { /** * This is the Guard that is protecting the object. */ ! private Guard guard; /** * This is the object that is being guarded. */ ! private Object object; /** * This method initializes a new instance of GuardedObject * that protects the specified Object using the specified ! * Guard * ! * @param object The Object to guard ! * @param guard The Guard that is protecting the object. */ public GuardedObject(Object object, Guard guard) { --- 38,87 ---- package java.security; import java.io.Serializable; + import java.io.IOException; + import java.io.ObjectOutputStream; /** * This class is an object that is guarded by a Guard object. ! * The object that is being guarded is retrieved by a call to the only * method in this class - getObject. That method returns the ! * guarded Object after first checking with the * Guard. If the Guard disallows access, an * exception will be thrown. * ! * @author Aaron M. Renn ! * @since 1.1 ! * @status updated to 1.4 */ public class GuardedObject implements Serializable { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5240450096227834308L; + + /** * This is the Guard that is protecting the object. + * + * @serial the guard */ ! private final Guard guard; /** * This is the object that is being guarded. + * + * @serial the protected object */ ! private final Object object; /** * This method initializes a new instance of GuardedObject * that protects the specified Object using the specified ! * Guard. A null guard means there are no restrictions on ! * accessing the object. * ! * @param object the Object to guard ! * @param guard the Guard that is protecting the object */ public GuardedObject(Object object, Guard guard) { *************** public class GuardedObject implements Se *** 78,95 **** } /** ! * This method first call the checkGuard method on the ! * Guard object protecting the guarded object. If the * Guard disallows access, an exception is thrown, otherwise * the Object is returned. * * @return The object being guarded * ! * @exception SecurityException If the Guard disallows access to the object. */ ! public Object getObject() throws SecurityException { ! guard.checkGuard(object); ! return (object); } ! } --- 90,120 ---- } /** ! * This method first call the checkGuard method on the ! * Guard object protecting the guarded object. If the * Guard disallows access, an exception is thrown, otherwise * the Object is returned. * * @return The object being guarded + * @throws SecurityException if access is denied + */ + public Object getObject() + { + if (guard != null) + guard.checkGuard(object); + return object; + } + + /** + * Ensures that serialization is legal, by checking the guard. * ! * @param s the stream to write to ! * @throws IOException if the underlying stream fails */ ! private void writeObject(ObjectOutputStream s) throws IOException { ! if (guard != null) ! guard.checkGuard(object); ! s.defaultWriteObject(); } ! } // class GuardedObject diff -Nrc3pad gcc-3.2.3/libjava/java/security/Guard.java gcc-3.3/libjava/java/security/Guard.java *** gcc-3.2.3/libjava/java/security/Guard.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Guard.java 2002-05-24 11:57:14.000000000 +0000 *************** *** 1,5 **** /* Guard.java -- Check access to a guarded object ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Guard.java -- Check access to a guarded object ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,61 **** * This interface specifies a mechanism for querying whether or not * access is allowed to a guarded object. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface Guard { /** * This method tests whether or not access is allowed to the specified ! * guarded object. Access is allowed if this method returns silently. If * access is denied, an exception is generated. * ! * @param obj The Object to test ! * ! * @exception SecurityException If access to the object is denied. */ ! public abstract void checkGuard(Object obj) throws SecurityException; ! ! } --- 41,60 ---- * This interface specifies a mechanism for querying whether or not * access is allowed to a guarded object. * ! * @author Aaron M. Renn ! * @see GuardedObject ! * @since 1.1 ! * @status updated to 1.4 */ public interface Guard { /** * This method tests whether or not access is allowed to the specified ! * guarded object. Access is allowed if this method returns silently. If * access is denied, an exception is generated. * ! * @param obj the Object to test ! * @throws SecurityException if access to the object is denied */ ! void checkGuard(Object obj); ! } // interface Guard diff -Nrc3pad gcc-3.2.3/libjava/java/security/Identity.java gcc-3.3/libjava/java/security/Identity.java *** gcc-3.2.3/libjava/java/security/Identity.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Identity.java 2002-10-04 20:15:07.000000000 +0000 *************** import java.util.Vector; *** 64,69 **** --- 64,71 ---- */ public abstract class Identity implements Principal, Serializable { + static final long serialVersionUID = 3609922007826600659L; + private String name; private IdentityScope scope; private PublicKey publicKey; diff -Nrc3pad gcc-3.2.3/libjava/java/security/InvalidAlgorithmParameterException.java gcc-3.3/libjava/java/security/InvalidAlgorithmParameterException.java *** gcc-3.2.3/libjava/java/security/InvalidAlgorithmParameterException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/InvalidAlgorithmParameterException.java 2002-05-24 11:57:14.000000000 +0000 *************** *** 1,5 **** ! /* InvalidAlgorithmParameterException.java ! Copyright (C) 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* InvalidAlgorithmParameterException.java -- an invalid parameter to a ! security algorithm ! Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,60 **** package java.security; /** * @author Warren Levy ! * @date February 2, 2000. ! */ ! ! /** ! * Written using on-line Java Platform 1.2 API Specification. ! * Status: Believed complete and correct. */ ! ! // JDK1.2 ! public class InvalidAlgorithmParameterException extends GeneralSecurityException { public InvalidAlgorithmParameterException() { super(); } public InvalidAlgorithmParameterException(String msg) { super(msg); --- 39,71 ---- package java.security; /** + * Thrown for an invalid security algorithm parameter. + * * @author Warren Levy ! * @since 1.2 ! * @status updated to 1.4 */ ! public class InvalidAlgorithmParameterException ! extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 2864672297499471472L; + + /** + * Construct an exception with no message. + */ public InvalidAlgorithmParameterException() { super(); } + /** + * Construct an exception with a message. + * + * @param msg the message + */ public InvalidAlgorithmParameterException(String msg) { super(msg); diff -Nrc3pad gcc-3.2.3/libjava/java/security/InvalidKeyException.java gcc-3.3/libjava/java/security/InvalidKeyException.java *** gcc-3.2.3/libjava/java/security/InvalidKeyException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/InvalidKeyException.java 2002-05-24 11:57:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* InvalidKeyException -- thrown for an invalid key ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,58 **** package java.security; /** * @author Warren Levy ! * @date February 1, 2000. ! */ ! ! /** ! * Written using on-line Java Platform 1.2 API Specification. ! * Status: Believed complete and correct. */ - public class InvalidKeyException extends KeyException { public InvalidKeyException() { - super(); } public InvalidKeyException(String msg) { super(msg); --- 38,67 ---- package java.security; /** + * Thrown for an invalid key. + * * @author Warren Levy ! * @status updated to 1.4 */ public class InvalidKeyException extends KeyException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5698479920593359816L; + + /** + * Construct an exception with no message. + */ public InvalidKeyException() { } + /** + * Construct an exception with a message. + * + * @param msg the message + */ public InvalidKeyException(String msg) { super(msg); diff -Nrc3pad gcc-3.2.3/libjava/java/security/InvalidParameterException.java gcc-3.3/libjava/java/security/InvalidParameterException.java *** gcc-3.2.3/libjava/java/security/InvalidParameterException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/InvalidParameterException.java 2002-05-24 11:57:15.000000000 +0000 *************** *** 1,4 **** ! /* Copyright (C) 2000 Free Software Foundation This file is part of GNU Classpath. --- 1,5 ---- ! /* InvalidParameterException.java -- an invalid parameter in the JCA/JCE engine ! Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,58 **** package java.security; /** * @author Warren Levy ! * @date February 1, 2000. ! */ ! ! /** ! * Written using on-line Java Platform 1.2 API Specification. ! * Status: Believed complete and correct. */ - public class InvalidParameterException extends IllegalArgumentException { public InvalidParameterException() { - super(); } public InvalidParameterException(String msg) { super(msg); --- 38,68 ---- package java.security; /** + * Thrown when an invalid parameter is passed to a method of the JCA/JCE + * engine classes. + * * @author Warren Levy ! * @status updated to 1.4 */ public class InvalidParameterException extends IllegalArgumentException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -857968536935667808L; + + /** + * Construct an exception with no message. + */ public InvalidParameterException() { } + /** + * Construct an exception with a message. + * + * @param msg the message + */ public InvalidParameterException(String msg) { super(msg); diff -Nrc3pad gcc-3.2.3/libjava/java/security/KeyException.java gcc-3.3/libjava/java/security/KeyException.java *** gcc-3.2.3/libjava/java/security/KeyException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/KeyException.java 2002-05-24 11:57:16.000000000 +0000 *************** *** 1,5 **** /* KeyException.java -- Thrown when there is a problem with a key ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* KeyException.java -- Thrown when there is a problem with a key ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 40,65 **** /** * This exception is thrown when there is a problem with a key. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class KeyException extends GeneralSecurityException { /** * This method initializes a new instance of KeyException * with no descriptive message. */ public KeyException() { - super(); } /** * This method initializes a new instance of KeyException * with a descriptive message. * ! * @param msg The descriptive message. */ public KeyException(String msg) { --- 40,69 ---- /** * This exception is thrown when there is a problem with a key. * ! * @author Aaron M. Renn ! * @see Key ! * @status updated to 1.4 */ public class KeyException extends GeneralSecurityException { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -7483676942812432108L; + + /** * This method initializes a new instance of KeyException * with no descriptive message. */ public KeyException() { } /** * This method initializes a new instance of KeyException * with a descriptive message. * ! * @param msg the descriptive message */ public KeyException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/Key.java gcc-3.3/libjava/java/security/Key.java *** gcc-3.2.3/libjava/java/security/Key.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Key.java 2002-05-24 11:57:16.000000000 +0000 *************** *** 1,5 **** /* Key.java -- A abstract representation of a digital key ! Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Key.java -- A abstract representation of a digital key ! Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.Serializable; *** 43,70 **** * This interfaces models the base characteristics that all keys must * have. These are: a key algorithm, an encoded form, and a format used * to encode the key. Specific key types inherit from this interface. - *

          * Note that since this interface extends Serializable, all ! * keys may be serialized. ! * ! * @version 0.0 * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface Key extends Serializable { ! /** * The verion identifier used for serialization. */ ! public static final long serialVersionUID = 6603384152749567654L; /** * This method returns the name of the algorithm for this key. This is a * String such as "RSA". * ! * @return The name of the algorithm in use */ ! public abstract String getAlgorithm(); /** * This method returns the name of the encoding format for this key. This --- 43,78 ---- * This interfaces models the base characteristics that all keys must * have. These are: a key algorithm, an encoded form, and a format used * to encode the key. Specific key types inherit from this interface. * Note that since this interface extends Serializable, all ! * keys may be serialized. Keys are generally obtained through key generators, ! * including {@link KeyFactory}. * ! * @author Aaron M. Renn ! * @see PublicKey ! * @see PrivateKey ! * @see KeyPair ! * @see KeyPairGenerator ! * @see KeyFactory ! * @see KeySpec ! * @see Identity ! * @see Signer ! * @since 1.1 ! * @status updated to 1.4 */ public interface Key extends Serializable { ! /** * The verion identifier used for serialization. */ ! long serialVersionUID = 6603384152749567654L; /** * This method returns the name of the algorithm for this key. This is a * String such as "RSA". * ! * @return the name of the algorithm in use */ ! String getAlgorithm(); /** * This method returns the name of the encoding format for this key. This *************** public interface Key extends Serializabl *** 72,86 **** * "X.509" or "PKCS#8". This method returns null if this key * does not have an encoding format. * ! * @return The name of the encoding format for this key, or null if there is no such format. */ ! public abstract String getFormat(); /** * This method returns the encoded form of the key. If this key does not ! * support encoding, this method returns null * ! * @return The encoded form of the key, or null if no encoded form is available. */ ! public abstract byte[] getEncoded(); ! } --- 80,94 ---- * "X.509" or "PKCS#8". This method returns null if this key * does not have an encoding format. * ! * @return the name of the encoding format for this key, or null */ ! String getFormat(); /** * This method returns the encoded form of the key. If this key does not ! * support encoding, this method returns null. * ! * @return the encoded form of the key, or null */ ! byte[] getEncoded(); ! } // interface Key diff -Nrc3pad gcc-3.2.3/libjava/java/security/KeyManagementException.java gcc-3.3/libjava/java/security/KeyManagementException.java *** gcc-3.2.3/libjava/java/security/KeyManagementException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/KeyManagementException.java 2002-05-24 11:57:17.000000000 +0000 *************** *** 1,5 **** ! /* KeyManagementException.java -- What it says ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* KeyManagementException.java -- an exception in key management ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,66 **** package java.security; /** ! * This exception is thrown whenever a problem related to the management of ! * security keys is encountered. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class KeyManagementException extends KeyException { /** ! * This method initializes a new instance of KeyManagementException ! * with no descriptive error message. */ public KeyManagementException() { - super(); } /** ! * This method initializes a new instance of KeyManagementException ! * with a descriptive error message. * ! * @param msg The descriptive error message */ public KeyManagementException(String msg) { --- 38,68 ---- package java.security; /** ! * This exception is thrown whenever a problem related to the management of ! * security keys is encountered. ! * ! * @author Aaron M. Renn ! * @see Key ! * @status updated to 1.4 */ public class KeyManagementException extends KeyException { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 947674216157062695L; ! ! /** ! * Create a new instance with no descriptive error message. */ public KeyManagementException() { } /** ! * Create a new instance with a descriptive error message. * ! * @param msg the descriptive error message */ public KeyManagementException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/KeyPairGenerator.java gcc-3.3/libjava/java/security/KeyPairGenerator.java *** gcc-3.2.3/libjava/java/security/KeyPairGenerator.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/KeyPairGenerator.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** /* KeyPairGenerator.java --- Key Pair Generator Class ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* KeyPairGenerator.java --- Key Pair Generator Class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** obligated to do so. If you do not wish *** 36,41 **** --- 36,42 ---- exception statement from your version. */ package java.security; + import java.security.spec.AlgorithmParameterSpec; /** *************** import java.security.spec.AlgorithmParam *** 51,57 **** */ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { ! private Provider provider; private String algorithm; /** --- 52,58 ---- */ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { ! Provider provider; private String algorithm; /** *************** public abstract class KeyPairGenerator e *** 83,101 **** @param algorithm the name of algorithm to choose @return a AlgorithmParameterGenerator repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by providers */ public static KeyPairGenerator getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); - String name = "KeyPairGenerator." + algorithm; for (int i = 0; i < p.length; i++) { ! String classname = p[i].getProperty(name); ! if (classname != null) ! return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); --- 84,104 ---- @param algorithm the name of algorithm to choose @return a AlgorithmParameterGenerator repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by ! providers */ public static KeyPairGenerator getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { ! try ! { ! return getInstance(algorithm, p[i]); ! } ! catch (NoSuchAlgorithmException ignored) {} } throw new NoSuchAlgorithmException(algorithm); *************** public abstract class KeyPairGenerator e *** 110,116 **** @param provider the name of the provider to find the algorithm in @return a AlgorithmParameterGenerator repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by the provider @throws NoSuchProviderException if the provider is not found */ public static KeyPairGenerator getInstance(String algorithm, String provider) --- 113,120 ---- @param provider the name of the provider to find the algorithm in @return a AlgorithmParameterGenerator repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by ! the provider @throws NoSuchProviderException if the provider is not found */ public static KeyPairGenerator getInstance(String algorithm, String provider) *************** public abstract class KeyPairGenerator e *** 118,127 **** { Provider p = Security.getProvider(provider); if (p == null) ! throw new NoSuchProviderException(); ! return getInstance(p.getProperty("KeyPairGenerator." + algorithm), ! algorithm, p); } private static KeyPairGenerator getInstance(String classname, --- 122,155 ---- { Provider p = Security.getProvider(provider); if (p == null) ! throw new NoSuchProviderException(provider); ! return getInstance(algorithm, p); ! } ! ! private static KeyPairGenerator getInstance(String algorithm, Provider p) ! throws NoSuchAlgorithmException ! { ! // try the name as is ! String className = p.getProperty("KeyPairGenerator." + algorithm); ! if (className == null) { // try all uppercase ! String upper = algorithm.toUpperCase(); ! className = p.getProperty("KeyPairGenerator." + upper); ! if (className == null) { // try if it's an alias ! String alias = p.getProperty("Alg.Alias.KeyPairGenerator." + algorithm); ! if (alias == null) { // try all-uppercase alias name ! alias = p.getProperty("Alg.Alias.KeyPairGenerator." + upper); ! if (alias == null) { // spit the dummy ! throw new NoSuchAlgorithmException(algorithm); ! } ! } ! className = p.getProperty("KeyPairGenerator." + alias); ! if (className == null) { ! throw new NoSuchAlgorithmException(algorithm); ! } ! } ! } ! return getInstance(className, algorithm, p); } private static KeyPairGenerator getInstance(String classname, *************** public abstract class KeyPairGenerator e *** 134,143 **** Object o = Class.forName(classname).newInstance(); KeyPairGenerator kpg; if (o instanceof KeyPairGeneratorSpi) ! kpg = ! (KeyPairGenerator) (new ! DummyKeyPairGenerator((KeyPairGeneratorSpi) o, ! algorithm)); else { kpg = (KeyPairGenerator) o; --- 162,168 ---- Object o = Class.forName(classname).newInstance(); KeyPairGenerator kpg; if (o instanceof KeyPairGeneratorSpi) ! kpg = new DummyKeyPairGenerator((KeyPairGeneratorSpi) o, algorithm); else { kpg = (KeyPairGenerator) o; diff -Nrc3pad gcc-3.2.3/libjava/java/security/KeyPairGeneratorSpi.java gcc-3.3/libjava/java/security/KeyPairGeneratorSpi.java *** gcc-3.2.3/libjava/java/security/KeyPairGeneratorSpi.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/KeyPairGeneratorSpi.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** /* KeyPairGeneratorSpi.java --- Key Pair Generator SPI Class ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* KeyPairGeneratorSpi.java --- Key Pair Generator SPI Class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public abstract class KeyPairGeneratorSp *** 90,93 **** --- 90,109 ---- @return a key pair */ public abstract KeyPair generateKeyPair(); + + /** + Returns a clone of this class. + + If cloning is not supported, then by default the class throws a + CloneNotSupportedException. The MessageDigestSpi provider + implementation has to overload this class in order to be + cloneable. + */ + public Object clone() throws CloneNotSupportedException + { + if (this instanceof Cloneable) + return super.clone(); + else + throw new CloneNotSupportedException(); + } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/KeyPair.java gcc-3.3/libjava/java/security/KeyPair.java *** gcc-3.2.3/libjava/java/security/KeyPair.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/KeyPair.java 2002-10-04 20:15:07.000000000 +0000 *************** import java.io.Serializable; *** 48,53 **** --- 48,55 ---- */ public final class KeyPair implements Serializable { + static final long serialVersionUID = -7565189502268009837L; + private PublicKey publicKey; private PrivateKey privateKey; diff -Nrc3pad gcc-3.2.3/libjava/java/security/KeyStoreException.java gcc-3.3/libjava/java/security/KeyStoreException.java *** gcc-3.2.3/libjava/java/security/KeyStoreException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/KeyStoreException.java 2002-05-24 11:57:17.000000000 +0000 *************** *** 1,5 **** /* KeyStoreException.java -- Indicates a problem with the key store ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* KeyStoreException.java -- Indicates a problem with the key store ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 40,65 **** /** * Indicates a problem with the key store. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class KeyStoreException extends GeneralSecurityException { /** ! * This method initializes a new KeyStoreException with no ! * detailed error message. */ public KeyStoreException() { - super(); } /** ! * This method initializes a new KeyStoreException with a ! * detailed error message. * ! * @param msg The descriptive error message. */ public KeyStoreException(String msg) { --- 40,67 ---- /** * Indicates a problem with the key store. * ! * @author Aaron M. Renn ! * @since 1.2 ! * @status updated to 1.4 */ public class KeyStoreException extends GeneralSecurityException { /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = -1119353179322377262L; ! ! /** ! * Create a new instance detailed error message. */ public KeyStoreException() { } /** ! * Create a new instance with a detailed error message. * ! * @param msg the descriptive error message */ public KeyStoreException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/KeyStore.java gcc-3.3/libjava/java/security/KeyStore.java *** gcc-3.2.3/libjava/java/security/KeyStore.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/KeyStore.java 2002-11-18 18:09:35.000000000 +0000 *************** *** 1,5 **** /* KeyStore.java --- Key Store Class ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* KeyStore.java --- Key Store Class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class KeyStore *** 92,100 **** /** Gets an instance of the KeyStore class representing the specified keystore. If the type is not ! found then, it throws CertificateException. ! @param type the type of certificate to choose @return a KeyStore repesenting the desired type --- 92,100 ---- /** Gets an instance of the KeyStore class representing the specified keystore. If the type is not ! found then, it throws KeyStoreException. ! @param type the type of keystore to choose @return a KeyStore repesenting the desired type *************** public class KeyStore *** 117,136 **** /** Gets an instance of the KeyStore class representing the specified key store from the specified provider. ! If the type is not found then, it throws CertificateException. If the provider is not found, then it throws NoSuchProviderException. ! @param type the type of certificate to choose @return a KeyStore repesenting the desired type ! @throws KeyStoreException if the type of keystore is not implemented by providers @throws NoSuchProviderException if the provider is not found */ public static KeyStore getInstance(String type, String provider) throws KeyStoreException, NoSuchProviderException { Provider p = Security.getProvider(provider); if (p == null) throw new NoSuchProviderException(); --- 117,142 ---- /** Gets an instance of the KeyStore class representing the specified key store from the specified provider. ! If the type is not found then, it throws KeyStoreException. If the provider is not found, then it throws NoSuchProviderException. ! @param type the type of keystore to choose ! @param provider the provider name @return a KeyStore repesenting the desired type ! @throws KeyStoreException if the type of keystore is not ! implemented by the given provider @throws NoSuchProviderException if the provider is not found + @throws IllegalArgumentException if the provider string is + null or empty */ public static KeyStore getInstance(String type, String provider) throws KeyStoreException, NoSuchProviderException { + if (provider == null || provider.length() == 0) + throw new IllegalArgumentException("Illegal provider"); Provider p = Security.getProvider(provider); if (p == null) throw new NoSuchProviderException(); *************** public class KeyStore *** 138,143 **** --- 144,176 ---- return getInstance(p.getProperty("KeyStore." + type), type, p); } + /** + Gets an instance of the KeyStore class representing + the specified key store from the specified provider. + If the type is not found then, it throws KeyStoreException. + If the provider is not found, then it throws + NoSuchProviderException. + + @param type the type of keystore to choose + @param provider the keystore provider + + @return a KeyStore repesenting the desired type + + @throws KeyStoreException if the type of keystore is not + implemented by the given provider + @throws IllegalArgumentException if the provider object is null + @since 1.4 + */ + public static KeyStore getInstance(String type, Provider provider) + throws KeyStoreException + { + if (provider == null) + throw new IllegalArgumentException("Illegal provider"); + + return getInstance(provider.getProperty("KeyStore." + type), + type, provider); + } + private static KeyStore getInstance(String classname, String type, Provider provider) diff -Nrc3pad gcc-3.2.3/libjava/java/security/MessageDigest.java gcc-3.3/libjava/java/security/MessageDigest.java *** gcc-3.2.3/libjava/java/security/MessageDigest.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/MessageDigest.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** /* MessageDigest.java --- The message digest interface. ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- + /* MessageDigest.java --- The message digest interface. ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 40,46 **** public abstract class MessageDigest extends MessageDigestSpi { private String algorithm; ! private Provider provider; private byte[] lastDigest; /** --- 41,47 ---- public abstract class MessageDigest extends MessageDigestSpi { private String algorithm; ! Provider provider; private byte[] lastDigest; /** *************** public abstract class MessageDigest exte *** 63,81 **** @param algorithm the name of digest algorithm to choose @return a MessageDigest representing the desired algorithm ! @exception NoSuchAlgorithmException if the algorithm is not implemented by providers */ public static MessageDigest getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); - String name = "MessageDigest." + algorithm; - for (int i = 0; i < p.length; i++) { ! String classname = p[i].getProperty(name); ! if (classname != null) ! return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); --- 64,83 ---- @param algorithm the name of digest algorithm to choose @return a MessageDigest representing the desired algorithm ! @exception NoSuchAlgorithmException if the algorithm is not implemented by ! providers */ public static MessageDigest getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { ! try ! { ! return getInstance(algorithm, p[i]); ! } ! catch (NoSuchAlgorithmException ignored) {} } throw new NoSuchAlgorithmException(algorithm); *************** public abstract class MessageDigest exte *** 92,98 **** @param provider the name of the provider to find the algorithm in @return a MessageDigest representing the desired algorithm ! @exception NoSuchAlgorithmException if the algorithm is not implemented by the provider @exception NoSuchProviderException if the provider is not found */ --- 94,101 ---- @param provider the name of the provider to find the algorithm in @return a MessageDigest representing the desired algorithm ! @exception NoSuchAlgorithmException if the algorithm is not implemented by ! the provider @exception NoSuchProviderException if the provider is not found */ *************** public abstract class MessageDigest exte *** 104,111 **** if (p == null) throw new NoSuchProviderException(provider); ! return getInstance(p.getProperty("MessageDigest." + algorithm), ! algorithm, p); } private static MessageDigest getInstance(String classname, --- 107,138 ---- if (p == null) throw new NoSuchProviderException(provider); ! return getInstance(algorithm, p); ! } ! ! private static MessageDigest getInstance(String algorithm, Provider p) ! throws NoSuchAlgorithmException ! { ! // try the name as is ! String className = p.getProperty("MessageDigest." + algorithm); ! if (className == null) { // try all uppercase ! String upper = algorithm.toUpperCase(); ! className = p.getProperty("MessageDigest." + upper); ! if (className == null) { // try if it's an alias ! String alias = p.getProperty("Alg.Alias.MessageDigest." +algorithm); ! if (alias == null) { // try all-uppercase alias name ! alias = p.getProperty("Alg.Alias.MessageDigest." +upper); ! if (alias == null) { // spit the dummy ! throw new NoSuchAlgorithmException(algorithm); ! } ! } ! className = p.getProperty("MessageDigest." + alias); ! if (className == null) { ! throw new NoSuchAlgorithmException(algorithm); ! } ! } ! } ! return getInstance(className, algorithm, p); } private static MessageDigest getInstance(String classname, *************** public abstract class MessageDigest exte *** 116,128 **** if (classname == null) throw new NoSuchAlgorithmException(algorithm); try { ! MessageDigest m = ! (MessageDigest) Class.forName(classname).newInstance(); ! m.algorithm = algorithm; ! m.provider = provider; ! return m; } catch (ClassNotFoundException cnfe) { --- 143,164 ---- if (classname == null) throw new NoSuchAlgorithmException(algorithm); + MessageDigest result = null; try { ! Object obj = Class.forName(classname).newInstance(); ! if (obj instanceof MessageDigest) { ! result = (MessageDigest) obj; ! result.algorithm = algorithm; ! } else if (obj instanceof MessageDigestSpi) { ! result = new DummyMessageDigest((MessageDigestSpi) obj, algorithm); ! } else { ! throw new ClassCastException("Class "+classname+" from Provider " ! +provider.getName() ! +" does not extend java.security.MessageDigestSpi"); ! } ! result.provider = provider; ! return result; } catch (ClassNotFoundException cnfe) { *************** public abstract class MessageDigest exte *** 170,176 **** */ public void update(byte[]input, int offset, int len) { ! engineUpdate(input, 0, input.length); } /** --- 206,212 ---- */ public void update(byte[]input, int offset, int len) { ! engineUpdate(input, offset, len); } /** *************** public abstract class MessageDigest exte *** 212,218 **** then computes a final digest and returns it. It calls update(input) and then digest(); ! @param buf An array of bytes to perform final update with @return a byte array representing the message digest */ public byte[] digest(byte[]input) --- 248,254 ---- then computes a final digest and returns it. It calls update(input) and then digest(); ! @param input An array of bytes to perform final update with @return a byte array representing the message digest */ public byte[] digest(byte[]input) diff -Nrc3pad gcc-3.2.3/libjava/java/security/NoSuchAlgorithmException.java gcc-3.3/libjava/java/security/NoSuchAlgorithmException.java *** gcc-3.2.3/libjava/java/security/NoSuchAlgorithmException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/NoSuchAlgorithmException.java 2002-05-24 11:57:19.000000000 +0000 *************** *** 1,5 **** ! /* NoSuchAlgorithmException.java -- What it says ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoSuchAlgorithmException.java -- an algorithm was not available ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,66 **** * This exception is thrown when the requested security algorithm is * not available * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class NoSuchAlgorithmException extends GeneralSecurityException { /** ! * This method initializes a new instance of NoSuchAlgorithmException ! * with no descriptive error message. */ public NoSuchAlgorithmException() { - super(); } /** ! * This method initializes a new instance of NoSuchAlgorithmException ! * with a descriptive error message. * ! * @param msg The descriptive error message */ public NoSuchAlgorithmException(String msg) { --- 41,67 ---- * This exception is thrown when the requested security algorithm is * not available * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ public class NoSuchAlgorithmException extends GeneralSecurityException { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -7443947487218346562L; ! ! /** ! * Create a new instance with no descriptive error message. */ public NoSuchAlgorithmException() { } /** ! * Create a new instance with a descriptive error message. * ! * @param msg the descriptive error message */ public NoSuchAlgorithmException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/NoSuchProviderException.java gcc-3.3/libjava/java/security/NoSuchProviderException.java *** gcc-3.2.3/libjava/java/security/NoSuchProviderException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/NoSuchProviderException.java 2002-05-24 11:57:19.000000000 +0000 *************** *** 1,5 **** ! /* NoSuchProviderException.java -- What it says ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* NoSuchProviderException.java -- thrown when a provider is not found ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,66 **** * This exception is thrown when the requested security provider is * not available. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class NoSuchProviderException extends GeneralSecurityException { /** ! * This method initializes a new instance of NoSuchProviderException ! * with no descriptive error message. */ public NoSuchProviderException() { - super(); } /** ! * This method initializes a new instance of NoSuchProviderException ! * with a descriptive error message. * ! * @param msg The descriptive error message. */ public NoSuchProviderException(String msg) { --- 41,67 ---- * This exception is thrown when the requested security provider is * not available. * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ public class NoSuchProviderException extends GeneralSecurityException { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 8488111756688534474L; ! ! /** ! * Create a new instance with no descriptive error message. */ public NoSuchProviderException() { } /** ! * Create a new instance with a descriptive error message. * ! * @param msg the descriptive error message */ public NoSuchProviderException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/PermissionCollection.java gcc-3.3/libjava/java/security/PermissionCollection.java *** gcc-3.2.3/libjava/java/security/PermissionCollection.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/PermissionCollection.java 2002-05-24 11:57:19.000000000 +0000 *************** *** 1,5 **** /* PermissionCollection.java -- A collection of permission objects ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* PermissionCollection.java -- A collection of permission objects ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 40,175 **** import java.io.Serializable; import java.util.Enumeration; /** ! * This class models a group of Java permissions. It has convenient ! * methods for determining whether or not a given permission is implied ! * by any of the permissions in this collection. ! *

          ! * Some care must be taken in storing permissions. First, a collection of ! * the appropriate type must be created. This is done by calling the ! * newPermissionCollection method on an object of the ! * permission class you wish to add to the collection. If this method ! * returns null, any type of PermissionCollection ! * can be used to store permissions of that type. However, if a ! * PermissionCollection collection object is returned, that ! * type must be used. ! *

          ! * The PermissionCollection's returned ! * by the newPermissionCollection instance in a subclass of ! * Permission is a homogeneous collection. It only will ! * hold permissions of one specified type - instances of the class that ! * created it. Not all PermissionCollection subclasses ! * have to hold permissions of only one type however. For example, ! * the Permissions class holds permissions of many types. ! *

          ! * Since the newPermissionCollection in Permission ! * itself returns null, by default a permission can be stored ! * in any type of collection unless it overrides that method to create its ! * own collection type. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public abstract class PermissionCollection ! extends Object ! implements Serializable ! { ! private static final String linesep = null; ! ! static ! { ! String linesep = System.getProperty("line.separator"); ! if (linesep == null); ! linesep = "\n"; ! } /** * Indicates whether or not this collection is read only. */ private boolean readOnly; /** ! * This method initializes a new instance of PermissionCollection. ! * This is provided only as a default constructor and does nothing in this ! * class. */ public PermissionCollection() { } /** ! * This method tests whether or not this PermissionCollection ! * object is read only. * ! * @return true if this collection is read only, false otherwise */ ! public boolean isReadOnly() ! { ! return (readOnly); ! } /** ! * This method sets this PermissionCollection object to be ! * read only. No further permissions can be added to it after calling this ! * method. ! */ ! public void setReadOnly() ! { ! readOnly = true; ! } ! ! /** ! * This method adds a new Permission object to the collection. ! * ! * @param perm The Permission to add. * ! * @exception SecurityException If the collection is marked read only. ! * @exception IllegalArgumentException If a permission of the specified type cannot be added */ ! public abstract void ! add(Permission perm) throws SecurityException, IllegalArgumentException; /** * This method returns an Enumeration of all the objects in * this collection. * ! * @return An Enumeration of this collection's objects. */ public abstract Enumeration elements(); /** ! * This method tests whether the specified Permission object is ! * implied by this collection of Permission objects. ! * ! * @param perm The Permission object to test. * ! * @return true if the specified Permission is implied by this collection, false otherwise. */ ! public abstract boolean implies(Permission perm); /** * This method returns a String representation of this ! * collection. It will print the class name and has code in the same ! * manner as Object.toString() then print a listing of all ! * the Permission objects contained. * ! * @return A String representing this object. */ public String toString() { ! StringBuffer sb = new StringBuffer(""); ! sb.append(super.toString() + " (" + linesep); Enumeration e = elements(); while (e.hasMoreElements()) ! { ! Object obj = e.nextElement(); ! if (obj instanceof Permission) ! sb.append(((Permission) obj).toString() + linesep); ! } ! ! sb.append(")" + linesep); ! return (sb.toString()); } ! } --- 40,167 ---- import java.io.Serializable; import java.util.Enumeration; + /** + * This class models a group of Java permissions. It has convenient + * methods for determining whether or not a given permission is implied + * by any of the permissions in this collection. + * + *

          Some care must be taken in storing permissions. First, a collection of + * the appropriate type must be created. This is done by calling the + * newPermissionCollection method on an object of the + * permission class you wish to add to the collection. If this method + * returns null, any type of PermissionCollection + * can be used to store permissions of that type. However, if a + * PermissionCollection collection object is returned, that + * type must be used. + * + *

          A PermissionCollection returned by the + * newPermissionCollection method in a subclass of + * Permission is a homogeneous collection. It only will + * hold permissions of one specified type - instances of the class that + * created it. Not all PermissionCollection subclasses + * have to hold permissions of only one type however. For example, + * the Permissions class holds permissions of many types. + * + *

          Since the newPermissionCollection in Permission + * itself returns null, by default a permission can be stored + * in any type of collection unless it overrides that method to create its + * own collection type. + * + * @author Aaron M. Renn + * @author Eric Blake + * @see Permission + * @see Permissions + * @since 1.1 + * @status updated to 1.4 + */ + public abstract class PermissionCollection implements Serializable + { /** ! * Compatible with JDK 1.1+. */ ! private static final long serialVersionUID = -6727011328946861783L; /** * Indicates whether or not this collection is read only. + * + * @serial if the collection is read-only */ private boolean readOnly; /** ! * Create a new collection. */ public PermissionCollection() { } /** ! * This method adds a new Permission object to the collection. * ! * @param perm the Permission to add ! * ! * @throws SecurityException if the collection is marked read only ! * @throws IllegalArgumentException if perm is of the wrong type */ ! public abstract void add(Permission perm); /** ! * This method tests whether the specified Permission object is ! * implied by this collection of Permission objects. * ! * @param perm the Permission object to test ! * @return true if the collection implies perm */ ! public abstract boolean implies(Permission perm); /** * This method returns an Enumeration of all the objects in * this collection. * ! * @return an Enumeration of this collection's objects */ public abstract Enumeration elements(); /** ! * This method sets this PermissionCollection object to be ! * read only. No further permissions can be added to it after calling this ! * method. ! */ ! public void setReadOnly() ! { ! readOnly = true; ! } ! ! /** ! * This method tests whether or not this PermissionCollection ! * object is read only. * ! * @return true if this collection is read only */ ! public boolean isReadOnly() ! { ! return readOnly; ! } /** * This method returns a String representation of this ! * collection. It is formed by: ! *

          !    * super.toString()" (\n"
          !    *   // enumerate all permissions, one per line
          !    * ")\n"
          !    * 
          * ! * @return a String representing this object */ public String toString() { ! StringBuffer sb = new StringBuffer(super.toString()); ! sb.append(" (\n"); Enumeration e = elements(); while (e.hasMoreElements()) ! sb.append(' ').append(e.nextElement()).append('\n'); ! return sb.append(")\n").toString(); } ! } // class PermissionCollection diff -Nrc3pad gcc-3.2.3/libjava/java/security/Permission.java gcc-3.3/libjava/java/security/Permission.java *** gcc-3.2.3/libjava/java/security/Permission.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Permission.java 2002-05-24 11:57:19.000000000 +0000 *************** *** 1,5 **** /* Permission.java -- The superclass for all permission objects ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Permission.java -- The superclass for all permission objects ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.Serializable; *** 41,47 **** /** * This class is the abstract superclass of all classes that implement ! * the concept of a permission. A permission consists of a permission name * and optionally a list of actions that relate to the permission. The * actual meaning of the name of the permission is defined only in the * context of a subclass. It may name a resource to which access permissions --- 41,47 ---- /** * This class is the abstract superclass of all classes that implement ! * the concept of a permission. A permission consists of a permission name * and optionally a list of actions that relate to the permission. The * actual meaning of the name of the permission is defined only in the * context of a subclass. It may name a resource to which access permissions *************** import java.io.Serializable; *** 51,116 **** * actions associated with them. That is, you either have the permission * or you don't. * ! * The most important method in this class is implies. This * checks whether if one has this permission, then the specified * permission is also implied. As a conceptual example, consider the * permissions "Read All Files" and "Read File foo". The permission * "Read All Files" implies that the caller has permission to read the * file foo. * ! * Permission's are not dynamic objects. Once created, a ! * Permission's name and action list cannot be changed. ! * ! * @version 0.0 * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public abstract class Permission implements Guard, Serializable { /** ! * This is the name assigned to this permission object. */ ! private String name; // Taken from the serializable form information /** ! * This method initializes a new instance of Permission to ! * have the specified name. */ ! public Permission(String name) ! { ! this.name = name; ! } /** ! * This method returns the name of this Permission * ! * @return The name of this Permission */ ! public final String getName() { ! return (name); } /** - * This method returns the list of actions for this Permission - * as a String. - * - * @return The action list for this Permission. - */ - public abstract String getActions(); - - /** * This method implements the Guard interface for this class. ! * It calls the checkPermission method in * SecurityManager with this Permission as its * argument. This method returns silently if the security check succeeds * or throws an exception if it fails. * ! * @param obj The Object being guarded - ignored by this class ! * ! * @exception SecurityException If the security check fails */ ! public void checkGuard(Object obj) throws SecurityException { SecurityManager sm = System.getSecurityManager(); if (sm != null) --- 51,109 ---- * actions associated with them. That is, you either have the permission * or you don't. * ! *

          The most important method in this class is implies. This * checks whether if one has this permission, then the specified * permission is also implied. As a conceptual example, consider the * permissions "Read All Files" and "Read File foo". The permission * "Read All Files" implies that the caller has permission to read the * file foo. * ! *

          Permission's must be immutable - do not change their ! * state after creation. * ! * @author Aaron M. Renn ! * @see Permissions ! * @see PermissionCollection ! * @since 1.1 ! * @status updated to 1.4 */ public abstract class Permission implements Guard, Serializable { /** ! * Compatible with JDK 1.1+. */ ! private static final long serialVersionUID = -5636570222231596674L; /** ! * This is the name assigned to this permission object. ! * ! * @serial the name of the permission */ ! private String name; /** ! * Create an instance with the specified name. * ! * @param name the permission name */ ! public Permission(String name) { ! this.name = name; } /** * This method implements the Guard interface for this class. ! * It calls the checkPermission method in * SecurityManager with this Permission as its * argument. This method returns silently if the security check succeeds * or throws an exception if it fails. * ! * @param obj the Object being guarded - ignored by this class ! * @throws SecurityException if the security check fails ! * @see GuardedObject ! * @see SecurityManager#checkPermission(Permission) */ ! public void checkGuard(Object obj) { SecurityManager sm = System.getSecurityManager(); if (sm != null) *************** public abstract class Permission impleme *** 118,165 **** } /** - * Check to see if this object equals OBJ. - */ - public abstract boolean equals (Object obj); - - /** * This method tests whether this Permission implies that the * specified Permission is also granted. * ! * @param perm The Permission to test against ! * ! * @return true if the specified Permission is implied by this one, false otherwise. */ public abstract boolean implies(Permission perm); /** ! * This method returns a hash code for this Permission. * ! * @return A hash value. */ public abstract int hashCode(); /** ! * This method returns a String representation of this ! * Permission object. * ! * @return This object as a String. */ ! public String toString() { ! return ("'\"" + getClass().getName() + "\" \"" + getName() + ! "\"" + " \"" + getActions() + "\")'"); } /** * This method returns an empty PermissionCollection object * that can store permissions of this type, or null if no ! * such collection is defined. * ! * @return A new PermissionCollection */ public PermissionCollection newPermissionCollection() { return null; } ! } --- 111,187 ---- } /** * This method tests whether this Permission implies that the * specified Permission is also granted. * ! * @param perm the Permission to test against ! * @return true if perm is implied by this */ public abstract boolean implies(Permission perm); /** ! * Check to see if this object equals obj. Use implies, rather ! * than equals, when making access control decisions. * ! * @param obj the object to compare to ! */ ! public abstract boolean equals(Object obj); ! ! /** ! * This method returns a hash code for this Permission. It ! * must satisfy the contract of Object.hashCode: it must be ! * the same for all objects that equals considers to be the same. ! * ! * @return a hash value */ public abstract int hashCode(); /** ! * Get the name of this Permission. * ! * @return the name */ ! public final String getName() { ! return name; } /** + * This method returns the list of actions for this Permission + * as a String. The string should be in canonical order, for + * example, both new FilePermission(f, "write,read") and + * new FilePermission(f, "read,write") have the action list + * "read,write". + * + * @return the action list for this Permission + */ + public abstract String getActions(); + + /** * This method returns an empty PermissionCollection object * that can store permissions of this type, or null if no ! * such collection is defined. Subclasses must override this to provide ! * an appropriate collection when one is needed to accurately calculate ! * implies. * ! * @return a new PermissionCollection */ public PermissionCollection newPermissionCollection() { return null; } ! ! /** ! * This method returns a String representation of this ! * Permission object. This is in the format: ! * '(' + getClass().getName() + ' ' + getName() + ' ' + getActions ! * + ')'. ! * ! * @return this object as a String ! */ ! public String toString() ! { ! return '(' + getClass().getName() + ' ' + getName() + ' ' ! + getActions() + ')'; ! } ! } // class Permission diff -Nrc3pad gcc-3.2.3/libjava/java/security/Permissions.java gcc-3.3/libjava/java/security/Permissions.java *** gcc-3.2.3/libjava/java/security/Permissions.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Permissions.java 2002-05-24 11:57:20.000000000 +0000 *************** *** 1,5 **** ! /* Permissions.java -- A collection of permission collections ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Permissions.java -- a collection of permission collections ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.util.Enumeration; *** 43,74 **** import java.util.NoSuchElementException; /** ! * This class is a heterogeneous collection of permissions. It is * organized as a collection of PermissionCollection's stored * in a hashtable. Each individual PermissionCollection ! * contains permissions of a single type. If a specific type of * Permission does not provide a collection type to use * via its newPermissionCollection method, then a default * collection type which stores its permissions in a hash table will be * used. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public final class Permissions ! extends PermissionCollection implements Serializable { /** * Holds instances of AllPermission. */ private PermissionCollection allPermission; /** * This is the Hashtable that contains our collections. */ ! Hashtable perms = new Hashtable(); /** * This method initializes a new instance of Permissions. --- 43,82 ---- import java.util.NoSuchElementException; /** ! * This class is a heterogeneous collection of permissions. It is * organized as a collection of PermissionCollection's stored * in a hashtable. Each individual PermissionCollection ! * contains permissions of a single type. If a specific type of * Permission does not provide a collection type to use * via its newPermissionCollection method, then a default * collection type which stores its permissions in a hash table will be * used. * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @since 1.1 */ ! public final class Permissions extends PermissionCollection implements Serializable { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 4858622370623524688L; + + /** * Holds instances of AllPermission. + * + * @serial the permission collection for AllPermission */ private PermissionCollection allPermission; /** * This is the Hashtable that contains our collections. + * + * @serial maps Class to PermissionCollection */ ! private final Hashtable perms = new Hashtable(); /** * This method initializes a new instance of Permissions. *************** public final class Permissions *** 82,132 **** * will be stored in a PermissionCollection of the appropriate * type, as determined by calling newPermissionCollection on * the specified permission (if an appropriate collection does not already ! * exist). If this object does not specify a particular type of collection, ! * a default collection which stores in permissions in a hash table will * be used. * ! * @param perm The Permission object to be added to this collection. ! * ! * @exception SecurityException If this collection is marked as read only. ! * @exception IllegalArgumentException If the specified Permission cannot be added to this collection */ public void add(Permission perm) - throws SecurityException, IllegalArgumentException { if (isReadOnly()) throw new SecurityException("PermissionCollection is read only"); - if (perm instanceof AllPermission) { ! if (allPermission == null) ! { ! allPermission = new ! DefaultPermissionCollection("java.security.AllPermission"); ! ! perms.put("java.security.AllPermission", allPermission); ! } } else { ! Object obj = perms.get(perm.getClass().getName()); ! if (obj != null) ! { ! if (!(obj instanceof PermissionCollection)) ! throw new RuntimeException("Internal error in Permissions"); ! ! ((PermissionCollection) obj).add(perm); ! } ! else ! { ! PermissionCollection pc = perm.newPermissionCollection(); ! if (pc == null) ! pc = new DefaultPermissionCollection(perm.getClass().getName()); ! ! pc.add(perm); ! ! perms.put(perm.getClass().getName(), pc); ! } } } --- 90,127 ---- * will be stored in a PermissionCollection of the appropriate * type, as determined by calling newPermissionCollection on * the specified permission (if an appropriate collection does not already ! * exist). If this object does not specify a particular type of collection, ! * a default collection, which stores in permissions in a hash table, will * be used. * ! * @param perm the Permission to add ! * @throws SecurityException if this collection is marked as read only */ public void add(Permission perm) { if (isReadOnly()) throw new SecurityException("PermissionCollection is read only"); if (perm instanceof AllPermission) { ! if (allPermission == null) ! { ! allPermission = perm.newPermissionCollection(); ! allPermission.add(perm); ! perms.put(perm.getClass(), allPermission); ! } } else { ! PermissionCollection pc ! = (PermissionCollection) perms.get(perm.getClass()); ! if (pc == null) ! { ! pc = perm.newPermissionCollection(); ! if (pc == null) ! pc = new PermissionsHash(); ! perms.put(perm.getClass(), pc); ! } ! pc.add(perm); } } *************** public final class Permissions *** 134,156 **** * This method tests whether or not the specified Permission * is implied by this PermissionCollection. * ! * @param perm The Permission to test. ! * ! * @return true if the specified permission is implied by this PermissionCollection, or false otherwise. */ public boolean implies(Permission perm) { if (allPermission != null) ! return (true); ! ! Object obj = perms.get(perm.getClass().getName()); ! if (obj == null) ! return (false); ! ! if (!(obj instanceof PermissionCollection)) ! return (false); ! ! return (((PermissionCollection) obj).implies(perm)); } /** --- 129,144 ---- * This method tests whether or not the specified Permission * is implied by this PermissionCollection. * ! * @param perm the Permission to test ! * @return true if the specified permission is implied by this */ public boolean implies(Permission perm) { if (allPermission != null) ! return true; ! PermissionCollection pc ! = (PermissionCollection) perms.get(perm.getClass()); ! return pc == null ? false : pc.implies(perm); } /** *************** public final class Permissions *** 158,164 **** * list of all Permission objects contained in this * collection. * ! * @return An Enumeration of this collection's elements. */ public Enumeration elements() { --- 146,152 ---- * list of all Permission objects contained in this * collection. * ! * @return an Enumeration of this collection's elements */ public Enumeration elements() { *************** public final class Permissions *** 169,270 **** public boolean hasMoreElements() { ! if (sub_enum == null) ! if (main_enum == null) ! return (false); ! else ! { ! if (!main_enum.hasMoreElements()) ! return (false); ! else ! { ! try ! { ! PermissionCollection pc = ! (PermissionCollection) main_enum.nextElement(); ! sub_enum = pc.elements(); ! } ! catch (NoSuchElementException e) ! { ! return (false); ! } ! } ! } ! else if (!sub_enum.hasMoreElements()) ! { ! sub_enum = null; ! return (hasMoreElements()); ! } ! ! return (true); } ! public Object nextElement() throws NoSuchElementException { ! if (!hasMoreElements()) ! throw new NoSuchElementException(); ! ! return (sub_enum.nextElement()); } }; } ! ! static class DefaultPermissionCollection extends PermissionCollection ! implements Serializable ! { ! ! // Type of Permission we can store ! private Class permcls; ! ! // Hashtable where we store permissions. ! private Hashtable perms = new Hashtable(); ! ! DefaultPermissionCollection(String permtype) throws IllegalArgumentException ! { ! try ! { ! permcls = Class.forName(permtype); ! } ! catch(ClassNotFoundException e) ! { ! throw new IllegalArgumentException(e.getMessage()); ! } ! } ! ! public void add(Permission perm) ! throws SecurityException, IllegalArgumentException ! { ! if (isReadOnly()) ! throw new SecurityException("PermissionCollection is read only"); ! ! if (!permcls.isInstance(perm)) ! throw new IllegalArgumentException("Wrong permission type: " + ! perm.getClass().getName()); ! ! if (perms.get(perm.getName()) != null) ! throw new IllegalArgumentException("Duplicate permission: " + ! perm.getName()); ! ! perms.put(perm.getName(), perm); ! } ! public boolean implies(Permission perm) ! { ! Object obj = perms.get(perm.getName()); ! if (obj == null) ! return(false); ! if (!(obj instanceof Permission)) ! return(false); ! Permission p = (Permission)obj; ! return(p.implies(perm)); ! } ! public Enumeration elements() ! { ! return(perms.elements()); ! } } ! } --- 157,243 ---- public boolean hasMoreElements() { ! if (sub_enum == null) ! { ! if (main_enum == null) ! return false; ! if (! main_enum.hasMoreElements()) ! { ! main_enum = null; ! return false; ! } ! PermissionCollection pc = ! (PermissionCollection) main_enum.nextElement(); ! sub_enum = pc.elements(); ! } ! if (! sub_enum.hasMoreElements()) ! { ! sub_enum = null; ! return hasMoreElements(); ! } ! return true; } ! public Object nextElement() { ! if (! hasMoreElements()) ! throw new NoSuchElementException(); ! return sub_enum.nextElement(); } }; } ! } // class Permissions ! /** ! * Implements the permission collection for all permissions without one of ! * their own, and obeys serialization of JDK. ! * ! * @author Eric Blake ! */ ! class PermissionsHash extends PermissionCollection ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -8491988220802933440L; ! /** ! * Hashtable where we store permissions. ! * ! * @serial the stored permissions, both as key and value ! */ ! private final Hashtable perms = new Hashtable(); ! /** ! * Add a permission. We don't need to check for read-only, as this ! * collection is never exposed outside of Permissions, which has already ! * done that check. ! * ! * @param perm the permission to add ! */ ! public void add(Permission perm) ! { ! perms.put(perm, perm); ! } ! /** ! * Returns true if perm is in the collection. ! * ! * @param perm the permission to check ! * @return true if it is implied ! */ ! public boolean implies(Permission perm) ! { ! return perms.get(perm) != null; ! } ! /** ! * Return the elements. ! * ! * @return the elements ! */ ! public Enumeration elements() ! { ! return perms.elements(); } ! } // class Permissions diff -Nrc3pad gcc-3.2.3/libjava/java/security/Policy.java gcc-3.3/libjava/java/security/Policy.java *** gcc-3.2.3/libjava/java/security/Policy.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Policy.java 2002-05-24 11:57:20.000000000 +0000 *************** public abstract class Policy *** 85,93 **** // FIXME: The class name of the Policy provider should really be sourced // from the "java.security" configuration file. For now, just hard-code // a stub implementation. ! static private Policy currentPolicy ! = new gnu.java.security.provider.DefaultPolicy(); ! /** Constructs a new Policy class. */ --- 85,107 ---- // FIXME: The class name of the Policy provider should really be sourced // from the "java.security" configuration file. For now, just hard-code // a stub implementation. ! static private Policy currentPolicy = null; ! static ! { ! String pp = System.getProperty ("policy.provider"); ! if (pp != null) ! try ! { ! currentPolicy = (Policy)Class.forName(pp).newInstance(); ! } ! catch (Exception _) ! { ! currentPolicy = null; ! } ! if (currentPolicy == null) ! currentPolicy = new gnu.java.security.provider.DefaultPolicy(); ! } ! /** Constructs a new Policy class. */ diff -Nrc3pad gcc-3.2.3/libjava/java/security/Principal.java gcc-3.3/libjava/java/security/Principal.java *** gcc-3.2.3/libjava/java/security/Principal.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Principal.java 2002-05-24 11:57:21.000000000 +0000 *************** *** 1,5 **** /* Principal.java -- A security entity ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Principal.java -- A security entity ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,82 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.security; /** ! * This interface models an entity (such as a user or a certificate authority) ! * for the purposes of applying the Java security model. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface Principal { /** ! * This method returns a String that names this ! * Principal. * ! * @return The name of this Principal. */ ! public abstract String getName(); /** ! * This method tests another Principal object for equality ! * with this one. ! * ! * @param obj The Object (which is a Principal) to test for equality against. * ! * @return true if the specified Principal is equal to this one, false otherwise. */ ! public abstract boolean equals(Object obj); /** * This method returns a hash code value for this Principal. * ! * @return A hash value */ ! public abstract int hashCode(); /** ! * This method returns a String representation of this * Principal. * ! * @return This Principal represented as a String. */ ! public abstract String toString(); ! } --- 35,85 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package java.security; /** ! * This interface models an entity (such as a user or a certificate authority) ! * for the purposes of applying the Java security model. ! * ! * @author Aaron M. Renn ! * @see X509Certificate ! * @since 1.1 ! * @status updated to 1.4 */ public interface Principal { /** ! * This method tests another Principal object for equality ! * with this one. * ! * @param obj the Object to test for equality ! * @return true if the specified Principal is equal */ ! boolean equals(Object obj); /** ! * This method returns a String representation of this ! * Principal. * ! * @return this Principal represented as a String */ ! String toString(); /** * This method returns a hash code value for this Principal. + * Remember the contract of hashCode - two objects which compare as + * equals() must have the same hashCode(). * ! * @return a hash value */ ! int hashCode(); /** ! * This method returns a String that names this * Principal. * ! * @return the name of this Principal */ ! String getName(); ! } // interface Principal diff -Nrc3pad gcc-3.2.3/libjava/java/security/PrivateKey.java gcc-3.3/libjava/java/security/PrivateKey.java *** gcc-3.2.3/libjava/java/security/PrivateKey.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/PrivateKey.java 2002-05-24 11:57:21.000000000 +0000 *************** *** 1,5 **** ! /* PrivateKey.java -- "Super-interface" for all private keys ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PrivateKey.java -- tagging interface for all private keys ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,51 **** package java.security; /** ! * This interface specified no methods. In simply provides a common ! * super-interface for all algorithm specific private key values. ! * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface PrivateKey extends Key { ! } --- 39,62 ---- package java.security; /** ! * This interface specified no methods. In simply provides a common ! * super-interface for all algorithm specific private key values. ! * ! * @author Aaron M. Renn ! * @see Key ! * @see PublicKey ! * @see Certificate ! * @see Signature#initVerify(PublicKey) ! * @see DSAPrivateKey ! * @see RSAPrivateKey ! * @see RSAPrivateCrtKey ! * @since 1.1 ! * @status updated to 1.4 */ public interface PrivateKey extends Key { ! /** ! * The verion identifier used for serialization. ! */ ! long serialVersionUID = 6034044314589513430L; ! } // interface PrivateKey diff -Nrc3pad gcc-3.2.3/libjava/java/security/PrivilegedActionException.java gcc-3.3/libjava/java/security/PrivilegedActionException.java *** gcc-3.2.3/libjava/java/security/PrivilegedActionException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/PrivilegedActionException.java 2002-05-24 11:57:21.000000000 +0000 *************** *** 1,6 **** ! /* PrivilegedActionException.java -- An exception occurred in a ! privileged action. ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PrivilegedActionException.java -- wrap an exception in a privileged action ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,113 **** package java.security; - import java.io.PrintStream; - import java.io.PrintWriter; - /** * This exception is thrown when an exception is thrown during a ! * privileged action being performed with the ! * AccessController.doPrivileged() method. It wrappers the * actual exception thrown in the privileged code. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class PrivilegedActionException extends Exception { - /** ! * This is the actual exception that occurred */ ! private Exception e; /** ! * This method initializes a new instance of PrivilegedActionException ! * that wrappers the specified Exception. * ! * @param e The Exception to wrapper */ ! public PrivilegedActionException(Exception e) ! { ! this.e = e; ! } /** ! * This method returns the underlying Exception that caused ! * this exception to be raised. * ! * @return The wrappered Exception. */ ! public Exception getException() { ! return (e); } /** ! * This method prints the stack trace of the wrappered exception. */ ! public void printStackTrace() { ! e.printStackTrace(); } /** ! * This method prints the stack trace of the wrappered exception to the ! * specified PrintStream. * ! * @param ps The PrintStream to print the stack trace to. */ ! public void printStackTrace(PrintStream ps) { ! e.printStackTrace(ps); } /** ! * This method prints the stack trace of the wrappered exception to the ! * specified PrintWriter. * ! * @param pw The PrintWriter to print the stack trace to. */ ! public void printStackTrace(PrintWriter pw) { ! e.printStackTrace(pw); } } --- 37,109 ---- package java.security; /** * This exception is thrown when an exception is thrown during a ! * privileged action being performed with the ! * AccessController.doPrivileged() method. It wraps the * actual exception thrown in the privileged code. * ! * @author Aaron M. Renn ! * @author Eric Blake ! * @see PrivilegedExceptionAction ! * @see AccessController#doPrivileged(PrivilegedExceptionAction) ! * @see AccessController#doPrivileged(PrivilegedExceptionAction, AccessControlContext) ! * @status updated to 1.4 */ public class PrivilegedActionException extends Exception { /** ! * Compatible with JDK 1.1+. */ ! private static final long serialVersionUID = 4724086851538908602L; /** ! * This is the actual exception that occurred. * ! * @serial the wrapped exception */ ! private Exception exception; /** ! * Create a new instance that wraps the specified Exception. * ! * @param e the Exception to wrap */ ! public PrivilegedActionException(Exception e) { ! super(e); ! exception = e; } /** ! * Get the underlying Exception that caused this one. This ! * is a legacy method, the preferred way is {@link #getCause()}. ! * ! * @return the cause */ ! public Exception getException() { ! return exception; } /** ! * Gets the cause of this exception. * ! * @return the cause ! * @since 1.4 */ ! public Throwable getCause() { ! return exception; } /** ! * Convert this to a String. * ! * @return the string representation */ ! public String toString() { ! return super.toString(); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/PrivilegedAction.java gcc-3.3/libjava/java/security/PrivilegedAction.java *** gcc-3.2.3/libjava/java/security/PrivilegedAction.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/PrivilegedAction.java 2002-05-24 11:57:21.000000000 +0000 *************** *** 1,5 **** /* PrivilegedAction.java -- Perform a privileged action ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* PrivilegedAction.java -- Perform a privileged action ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,51 **** package java.security; /** ! * This interface specifes a single run method that ! * executes a privileged operation. This method is called by * AccessController.doPrivileged() after that method * activiates the required privileges. * - * @version 0.0 - * * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface PrivilegedAction { --- 38,53 ---- package java.security; /** ! * This interface specifes a single run method that ! * executes a privileged operation. This method is called by * AccessController.doPrivileged() after that method * activiates the required privileges. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @see AccessController + * @see PrivilegedExceptionAction + * @since 1.1 + * @status updated to 1.4 */ public interface PrivilegedAction { *************** public interface PrivilegedAction *** 55,60 **** * AccessController.doPrivileged(). * * @return obj An implementation dependent return value */ ! public abstract Object run(); ! } --- 57,64 ---- * AccessController.doPrivileged(). * * @return obj An implementation dependent return value + * @see AccessController#doPrivileged(PrivilegedAction) + * @see AccessController#doPrivileged(PrivilegedAction, AccessControlContext) */ ! Object run(); ! } // interface PrivilegedAction diff -Nrc3pad gcc-3.2.3/libjava/java/security/PrivilegedExceptionAction.java gcc-3.3/libjava/java/security/PrivilegedExceptionAction.java *** gcc-3.2.3/libjava/java/security/PrivilegedExceptionAction.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/PrivilegedExceptionAction.java 2002-05-24 11:57:22.000000000 +0000 *************** *** 1,5 **** /* PrivilegedExceptionAction.java -- Perform a privileged operation ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* PrivilegedExceptionAction.java -- Perform a privileged operation ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,52 **** package java.security; /** ! * This interface defines a method that is called by * AccessController.doPrivileged() in order to perform a * privileged operation with higher privileges enabled. This interface * differs from PrivilegedAction in that the run * method in this interface may throw a checked exception. * - * @version 0.0 - * * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface PrivilegedExceptionAction { --- 38,52 ---- package java.security; /** ! * This interface defines a method that is called by * AccessController.doPrivileged() in order to perform a * privileged operation with higher privileges enabled. This interface * differs from PrivilegedAction in that the run * method in this interface may throw a checked exception. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.1 + * @status updated to 1.4 */ public interface PrivilegedExceptionAction { *************** public interface PrivilegedExceptionActi *** 55,63 **** * successfully complete. It is called when a section of code invokes * AccessController.doPrivileged(). * ! * @return obj An implementation defined return value. ! * ! * @exception Exception An implementation specific exception. */ ! public abstract Object run() throws Exception; ! } --- 55,65 ---- * successfully complete. It is called when a section of code invokes * AccessController.doPrivileged(). * ! * @return obj An implementation defined return value ! * @throws Exception An implementation specific exception ! * @see AccessController#doPrivileged(PrivilegedExceptionAction) ! * @see AccessController#doPrivileged(PrivilegedExceptionAction, ! * AccessControlContext) */ ! Object run() throws Exception; ! } // interface PrivilegedExceptionAction diff -Nrc3pad gcc-3.2.3/libjava/java/security/ProtectionDomain.java gcc-3.3/libjava/java/security/ProtectionDomain.java *** gcc-3.2.3/libjava/java/security/ProtectionDomain.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/ProtectionDomain.java 2002-10-04 20:15:07.000000000 +0000 *************** package java.security; *** 53,60 **** */ public class ProtectionDomain { - private static final String linesep = System.getProperty("line.separator"); - /** * This is the CodeSource for this protection domain */ --- 53,58 ---- *************** public class ProtectionDomain *** 131,143 **** */ public String toString() { StringBuffer sb = new StringBuffer(""); ! ! sb.append(super.toString() + " (" + linesep); ! sb.append(code_source.toString()); ! sb.append(perms.toString()); ! sb.append(")" + linesep); ! return sb.toString(); } } --- 129,144 ---- */ public String toString() { + String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); ! sb.append("ProtectionDomain (" + linesep); ! if (code_source == null) ! sb.append("CodeSource:null" + linesep); ! else ! sb.append(code_source + linesep); ! sb.append(perms); ! sb.append(linesep + ")" + linesep); ! return sb.toString(); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/ProviderException.java gcc-3.3/libjava/java/security/ProviderException.java *** gcc-3.2.3/libjava/java/security/ProviderException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/ProviderException.java 2002-05-24 11:57:22.000000000 +0000 *************** *** 1,5 **** /* ProviderException.java -- Generic security provider runtime exception ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ProviderException.java -- Generic security provider runtime exception ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,66 **** * This exception indicates that a runtime problem was encounterd with * a security provider. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class ProviderException extends RuntimeException { /** ! * This method initializes a new instance of ProviderException ! * with no descriptive error message. */ public ProviderException() { - super(); } /** ! * This method initializes a new instance of ProviderException ! * with a descriptive error message. * ! * @param msg The descriptive error message. */ public ProviderException(String msg) { --- 41,67 ---- * This exception indicates that a runtime problem was encounterd with * a security provider. * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ public class ProviderException extends RuntimeException { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 5256023526693665674L; ! ! /** ! * Create an instance with no descriptive error message. */ public ProviderException() { } /** ! * Create an instance with a descriptive error message. * ! * @param msg the descriptive error message */ public ProviderException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/Provider.java gcc-3.3/libjava/java/security/Provider.java *** gcc-3.2.3/libjava/java/security/Provider.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Provider.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** /* Provider.java -- Security provider information ! Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Provider.java -- Security provider information ! Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.util.Properties; *** 56,61 **** --- 56,63 ---- */ public abstract class Provider extends Properties implements Serializable { + static final long serialVersionUID = -4298000515446427739L; + /** * This is a textual description of the provider */ *************** public abstract class Provider extends P *** 117,132 **** } /** ! * This method sets the specified key to have the specified value. * ! * @param key The property key ! * @param value The property value * ! * @return The previous value for this key, or null if no previous value. */ public Object put(Object key, Object value) { ! return (super.put(key, value)); } /** --- 119,158 ---- } /** ! * Sets the key property to have the specified value. ! *

          ! * NOT IMPLEMENTED YET[ ! * First, if there is a security manager, its checkSecurityAccess ! * method is called with the string "putProviderProperty."+name, where name is ! * the provider name, to see if it's ok to set this provider's property ! * values. ! * If the default implementation of checkSecurityAccess is used ! * (that is, that method is not overriden), then this results in a call to the ! * security manager's checkPermission method with a ! * SecurityPermission("putProviderProperty."+name) ! * permission.
          ] * ! * @param key The property key. ! * @param value The property value. * ! * @return The previous value of the specified property (key), ! * or null if it did not have one. ! * @throws SecurityException If a security manager exists and its ! * {@link java.lang.SecurityManager.checkSecurityAccess(java.lang.String)} ! * method denies access to set property values. ! * @since Classpath 0.4+cvs, JDK 1.2 ! * @see java.lang.Object.equals(Object) ! * @see java.util.Hashtable.get(Object) */ public Object put(Object key, Object value) { ! return super.put(toCanonicalKey(key), value); ! } ! ! // overrides same in java.util.Hashtable ! public Object get(Object key) ! { ! return super.get(toCanonicalKey(key)); } /** *************** public abstract class Provider extends P *** 135,145 **** * * @param key The key to remove * ! * @return The previous value for this key, or null if no previous value. */ public Object remove(Object key) { ! return (super.remove(key)); } /** --- 161,172 ---- * * @param key The key to remove * ! * @return The previous value for this key, or null if no ! * previous value. */ public Object remove(Object key) { ! return super.remove(toCanonicalKey(key)); } /** *************** public abstract class Provider extends P *** 164,167 **** --- 191,202 ---- return (getClass().getName() + ": name=" + getName() + " version=" + version); } + + private Object toCanonicalKey(Object key) + { + if (key.getClass().isAssignableFrom(String.class)) // is it ours? + return ((String) key).toUpperCase(); // use default locale + else + return key; + } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/PublicKey.java gcc-3.3/libjava/java/security/PublicKey.java *** gcc-3.2.3/libjava/java/security/PublicKey.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/PublicKey.java 2002-05-24 11:57:23.000000000 +0000 *************** *** 1,5 **** ! /* PublicKey.java -- "Super-interface" for all public keys ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PublicKey.java -- tagging interface for all public keys ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,50 **** * This interface specified no methods. In simply provides a common * super-interface for all algorithm specific public key values. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public interface PublicKey extends Key { ! } --- 41,60 ---- * This interface specified no methods. In simply provides a common * super-interface for all algorithm specific public key values. * ! * @author Aaron M. Renn ! * @see Key ! * @see PrivateKey ! * @see Certificate ! * @see Signature#initVerify(PublicKey) ! * @see DSAPublicKey ! * @see RSAPublicKey ! * @since 1.1 ! * @status updated to 1.4 */ public interface PublicKey extends Key { ! /** ! * The verion identifier used for serialization. ! */ ! long serialVersionUID = 7187392471159151072L; ! } // interface PublicKey diff -Nrc3pad gcc-3.2.3/libjava/java/security/SecureClassLoader.java gcc-3.3/libjava/java/security/SecureClassLoader.java *** gcc-3.2.3/libjava/java/security/SecureClassLoader.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/SecureClassLoader.java 2002-10-01 03:46:43.000000000 +0000 *************** public class SecureClassLoader extends C *** 51,62 **** protected SecureClassLoader(ClassLoader parent) { super(parent); ! // FIXME: What else? } protected SecureClassLoader() { ! // FIXME: What do we need to do here? } /** --- 51,66 ---- protected SecureClassLoader(ClassLoader parent) { super(parent); ! SecurityManager sm = System.getSecurityManager(); ! if(sm != null) ! sm.checkCreateClassLoader(); } protected SecureClassLoader() { ! SecurityManager sm = System.getSecurityManager(); ! if(sm != null) ! sm.checkCreateClassLoader(); } /** *************** public class SecureClassLoader extends C *** 67,73 **** @param b the data representing the classfile, in classfile format. @param off the offset into the data where the classfile starts. @param len the length of the classfile data in the array. ! @param cs the CodeSource for the class @return the class that was defined and optional CodeSource. --- 71,77 ---- @param b the data representing the classfile, in classfile format. @param off the offset into the data where the classfile starts. @param len the length of the classfile data in the array. ! @param cs the CodeSource for the class or null when unknown. @return the class that was defined and optional CodeSource. *************** public class SecureClassLoader extends C *** 77,92 **** CodeSource cs) { // FIXME: Need to cache ProtectionDomains according to 1.3 docs. ! ProtectionDomain protectionDomain = ! new ProtectionDomain(cs, getPermissions(cs)); ! try { return super.defineClass(name, b, off, len, protectionDomain); ! } ! catch (ClassFormatError cfe) ! { ! return null; ! } } /** --- 81,94 ---- CodeSource cs) { // FIXME: Need to cache ProtectionDomains according to 1.3 docs. ! if (cs != null) { + ProtectionDomain protectionDomain + = new ProtectionDomain(cs, getPermissions(cs)); return super.defineClass(name, b, off, len, protectionDomain); ! } ! else ! return super.defineClass(name, b, off, len); } /** diff -Nrc3pad gcc-3.2.3/libjava/java/security/SecureRandom.java gcc-3.3/libjava/java/security/SecureRandom.java *** gcc-3.2.3/libjava/java/security/SecureRandom.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/SecureRandom.java 2003-02-13 16:58:43.000000000 +0000 *************** *** 1,5 **** /* SecureRandom.java --- Secure Random class implmentation ! Copyright (C) 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SecureRandom.java --- Secure Random class implmentation ! Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** obligated to do so. If you do not wish *** 36,41 **** --- 36,42 ---- exception statement from your version. */ package java.security; + import java.io.Serializable; import java.util.Random; import java.util.Enumeration; *************** import java.util.Enumeration; *** 49,57 **** */ public class SecureRandom extends Random { //Serialized Field long counter = 0; //Serialized - MessageDigest digest = null; Provider provider = null; byte[] randomBytes = null; //Always null int randomBytesUsed = 0; --- 50,59 ---- */ public class SecureRandom extends Random { + static final long serialVersionUID = 4940670005562187L; + //Serialized Field long counter = 0; //Serialized Provider provider = null; byte[] randomBytes = null; //Always null int randomBytesUsed = 0; *************** public class SecureRandom extends Random *** 81,121 **** Enumeration e; for (i = 0; i < p.length; i++) { ! e = p[i].propertyNames(); ! while (e.hasMoreElements()) ! { ! key = (String) e.nextElement(); ! if (key.startsWith("SecureRandom.")) ! if ((classname = p[i].getProperty(key)) != null) ! break; } - if (classname != null) - break; } ! //if( classname == null) ! // throw new NoSuchAlgorithmException(); ! ! try ! { ! this.secureRandomSpi = ! (SecureRandomSpi) Class.forName(classname).newInstance(); ! ! //s.algorithm = algorithm; ! this.provider = p[i]; ! } ! catch (ClassNotFoundException cnfe) ! { ! //throw new NoSuchAlgorithmException("Class not found"); ! } ! catch (InstantiationException ie) ! { ! //throw new NoSuchAlgorithmException("Class instantiation failed"); ! } ! catch (IllegalAccessException iae) ! { ! //throw new NoSuchAlgorithmException("Illegal Access"); ! } } /** --- 83,111 ---- Enumeration e; for (i = 0; i < p.length; i++) { ! e = p[i].propertyNames(); ! while (e.hasMoreElements()) ! { ! key = (String) e.nextElement(); ! if (key.startsWith("SECURERANDOM.")) ! { ! if ((classname = p[i].getProperty(key)) != null) ! { ! try ! { ! secureRandomSpi = (SecureRandomSpi) Class. ! forName(classname).newInstance(); ! provider = p[i]; ! return; ! } ! catch (Throwable ignore) { } ! } ! } } } ! // Nothing found. Fall back to SHA1PRNG ! secureRandomSpi = new gnu.java.security.provider.SHA1PRNG(); } /** *************** public class SecureRandom extends Random *** 165,204 **** NoSuchAlgorithmException { Provider p[] = Security.getProviders(); ! ! //Format of Key: SecureRandom.algname ! StringBuffer key = new StringBuffer("SecureRandom."); ! key.append(algorithm); ! ! String classname = null; ! int i; ! for (i = 0; i < p.length; i++) ! { ! if ((classname = p[i].getProperty(key.toString())) != null) ! break; ! } ! ! if (classname == null) ! throw new NoSuchAlgorithmException(); ! ! try ! { ! return new SecureRandom((SecureRandomSpi) Class.forName(classname). ! newInstance(), p[i]); ! } ! catch (ClassNotFoundException cnfe) ! { ! throw new NoSuchAlgorithmException("Class not found"); ! } ! catch (InstantiationException ie) ! { ! throw new NoSuchAlgorithmException("Class instantiation failed"); ! } ! catch (IllegalAccessException iae) { ! throw new NoSuchAlgorithmException("Illegal Access"); } } /** --- 155,171 ---- NoSuchAlgorithmException { Provider p[] = Security.getProviders(); ! for (int i = 0; i < p.length; i++) { ! try ! { ! return getInstance(algorithm, p[i]); ! } ! catch (NoSuchAlgorithmException ignored) { } } + // None found. + throw new NoSuchAlgorithmException(algorithm); } /** *************** public class SecureRandom extends Random *** 220,252 **** Provider p = Security.getProvider(provider); if (p == null) throw new NoSuchProviderException(); ! //Format of Key: SecureRandom.algName ! StringBuffer key = new StringBuffer("SecureRandom."); ! key.append(algorithm); ! String classname = p.getProperty(key.toString()); ! if (classname == null) ! throw new NoSuchAlgorithmException(); ! try ! { ! return new SecureRandom((SecureRandomSpi) Class.forName(classname). ! newInstance(), p); ! } ! catch (ClassNotFoundException cnfe) ! { ! throw new NoSuchAlgorithmException("Class not found"); ! } ! catch (InstantiationException ie) ! { ! throw new NoSuchAlgorithmException("Class instantiation failed"); ! } ! catch (IllegalAccessException iae) { ! throw new NoSuchAlgorithmException("Illegal Access"); } ! } /** --- 187,277 ---- Provider p = Security.getProvider(provider); if (p == null) throw new NoSuchProviderException(); + + return getInstance(algorithm, p); + } ! /** ! Returns an instance of a SecureRandom. It creates the class for ! the specified algorithm from the given provider. ! @param algorithm The SecureRandom algorithm to create. ! @param provider The provider to get the instance from. ! @throws NoSuchAlgorithmException If the algorithm cannot be found, or ! if the class cannot be instantiated. ! */ ! public static SecureRandom getInstance(String algorithm, ! Provider provider) throws ! NoSuchAlgorithmException ! { ! return getInstance(algorithm, provider, true); ! } ! ! /** ! Creates the instance of SecureRandom, recursing to resolve aliases. ! ! @param algorithm The SecureRandom algorithm to create. ! @param provider The provider to get the implementation from. ! @param recurse Whether or not to recurse to resolve aliases. ! ! @throws NoSuchAlgorithmException If the algorithm cannot be found, ! if there are too many aliases, or if the class cannot be ! instantiated. ! */ ! private static SecureRandom getInstance(String algorithm, ! Provider provider, ! boolean recurse) ! throws NoSuchAlgorithmException ! { ! String msg = algorithm; ! for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { ! // We could replace the boolean with an integer, incrementing it ! // every ! String key = (String) e.nextElement(); ! if (key.startsWith("SECURERANDOM.") ! && key.substring(13).equalsIgnoreCase(algorithm)) ! { ! try ! { ! Class c = Class.forName(provider.getProperty(key)); ! return new SecureRandom((SecureRandomSpi) c.newInstance(), ! provider); ! } ! catch (Throwable ignored) { } ! } ! else if (key.startsWith("ALG.ALIAS.SECURERANDOM.") ! && key.substring(23).equalsIgnoreCase(algorithm) && recurse) ! { ! try ! { ! // First see if this alias refers to a class in this ! // provider. ! return getInstance(provider.getProperty(key), provider, false); ! } ! catch (NoSuchAlgorithmException nsae) ! { ! Provider[] provs = Security.getProviders(); ! for (int i = 0; i < provs.length; i++) ! { ! if (provs[i] == provider) ! continue; ! // Now try other providers for the implementation ! try ! { ! return getInstance(provider.getProperty(key), ! provs[i], false); ! } ! catch (NoSuchAlgorithmException nsae2) ! { ! msg = nsae2.getMessage(); ! } ! } ! } ! } } ! throw new NoSuchAlgorithmException(algorithm); } /** *************** public class SecureRandom extends Random *** 334,342 **** int ret = 0; for (int i = 0; i < tmp.length; i++) ! ret |= tmp[i] << (8 * i); ! return ret; } /** --- 359,368 ---- int ret = 0; for (int i = 0; i < tmp.length; i++) ! ret |= (tmp[i] & 0xFF) << (8 * i); ! long mask = (1L << numBits) - 1; ! return (int) (ret & mask); } /** diff -Nrc3pad gcc-3.2.3/libjava/java/security/SecureRandomSpi.java gcc-3.3/libjava/java/security/SecureRandomSpi.java *** gcc-3.2.3/libjava/java/security/SecureRandomSpi.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/SecureRandomSpi.java 2002-10-04 20:15:07.000000000 +0000 *************** import java.io.Serializable; *** 50,55 **** --- 50,57 ---- */ public abstract class SecureRandomSpi implements Serializable { + static final long serialVersionUID = -2991854161009191830L; + /** Default Constructor for SecureRandomSpi */ diff -Nrc3pad gcc-3.2.3/libjava/java/security/Security.java gcc-3.3/libjava/java/security/Security.java *** gcc-3.2.3/libjava/java/security/Security.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Security.java 2002-12-31 22:49:37.000000000 +0000 *************** *** 1,5 **** /* Security.java --- Java base security class implmentation ! Copyright (C) 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Security.java --- Java base security class implmentation ! Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,45 **** package java.security; import java.io.File; ! import java.io.FileInputStream; import java.io.IOException; import java.io.FileNotFoundException; import java.security.Provider; import java.util.Vector; import java.util.Enumeration; --- 37,46 ---- package java.security; import java.io.File; ! import java.io.InputStream; import java.io.IOException; import java.io.FileNotFoundException; + import java.net.URL; import java.security.Provider; import java.util.Vector; import java.util.Enumeration; *************** public final class Security extends Obje *** 59,66 **** static { ! loadProviders(System.getProperty("java.vm.name")); ! loadProviders("classpath"); } // This class can't be instantiated. --- 60,68 ---- static { ! String base = System.getProperty("gnu.classpath.home.url"); ! loadProviders(base, System.getProperty("gnu.classpath.vm.shortname")); ! loadProviders(base, "classpath"); } // This class can't be instantiated. *************** public final class Security extends Obje *** 68,94 **** { } ! private static void loadProviders(String vendor) { ! if (vendor == null) return; ! String separator = System.getProperty("file.separator"); ! String secfilestr = (System.getProperty("java.home") + ! separator + "lib" + ! separator + "security" + ! separator + vendor + ".security"); try { ! FileInputStream fin = new FileInputStream(secfilestr); secprops = new Properties(); secprops.load(fin); int i = 1; String name; ! while ((name = secprops.getProperty("security.provider." + i++)) != null) { Exception exception = null; --- 70,92 ---- { } ! private static void loadProviders(String baseUrl, String vendor) { ! if (baseUrl == null || vendor == null) return; ! String secfilestr = baseUrl + "/security/" + vendor + ".security"; try { ! InputStream fin = new URL(secfilestr).openStream(); secprops = new Properties(); secprops.load(fin); int i = 1; String name; ! while ((name = secprops.getProperty("security.provider." + i)) != null) { Exception exception = null; *************** public final class Security extends Obje *** 96,102 **** try { providers.addElement(Class.forName(name).newInstance()); - i++; } catch (ClassNotFoundException x) { --- 94,99 ---- *************** public final class Security extends Obje *** 113,118 **** --- 110,116 ---- if (exception != null) System.err.println ("Error loading security provider " + name + ": " + exception); + i++; } } catch (FileNotFoundException ignored) *************** public final class Security extends Obje *** 126,133 **** } /** ! Gets a specific property for an algorithm. This is used to produce specialized ! algorithm parsers. @deprecated it used to a return the value of a propietary property for the "SUN" Cryptographic Service Provider to obtain --- 124,131 ---- } /** ! Gets a specific property for an algorithm. This is used to produce ! specialized algorithm parsers. @deprecated it used to a return the value of a propietary property for the "SUN" Cryptographic Service Provider to obtain *************** public final class Security extends Obje *** 146,166 **** } /** ! Adds a new provider at the specified position. This allows dynamic loading ! of providers. It will check for duplication of providers. ! ! This class checks the security manager with the call checkSecurityAccess ! with "insertProvider."+provider.getName() to see if the user can add this ! provider. ! ! @param provider the provider to add ! @param position position to add the provider at ! ! @return the position the provider was added at, or -1 if a duplicate provider ! was found ! @throws SecurityException - if the security manager denies access to add a ! new provider */ public static int insertProviderAt(Provider provider, int position) { --- 144,180 ---- } /** ! Adds a new provider, at a specified position. The position is the ! preference order in which providers are searched for requested algorithms. ! Note that it is not guaranteed that this preference will be respected. The ! position is 1-based, that is, 1 is most preferred, followed by 2, and so ! on. !

          ! If the given provider is installed at the requested position, the ! provider that used to be at that position, and all providers with a ! position greater than position, are shifted up one position (towards the ! end of the list of installed providers). !

          ! A provider cannot be added if it is already installed. !

          ! NOT IMPLEMENTED YET:[ ! First, if there is a security manager, its checkSecurityAccess ! method is called with the string ! "insertProvider."+provider.getName() ! to see if it's ok to add a new provider. If the default implementation of ! checkSecurityAccess is used (i.e., that method is not ! overriden), then this will result in a call to the security manager's ! checkPermission method with a SecurityPermission( ! "insertProvider."+provider.getName()) permission.] ! @param provider the provider to be added. ! @param position the preference position that the caller would like for ! this provider. ! @return the actual preference position (1-based) in which the provider was ! added, or -1 if the provider was not added because it is already installed. ! @throws SecurityException if a security manager exists and its ! SecurityManager.checkSecurityAccess(java.lang.String) method denies ! access to add a new provider. */ public static int insertProviderAt(Provider provider, int position) { *************** public final class Security extends Obje *** 168,173 **** --- 182,188 ---- if (sm != null) sm.checkSecurityAccess("insertProvider." + provider.getName()); + position--; int max = providers.size (); for (int i = 0; i < max; i++) { *************** public final class Security extends Obje *** 183,211 **** providers.insertElementAt(provider, position); ! return position; } /** ! Adds a new provider. This allows dynamic loading ! of providers. It will check for duplication of providers. ! ! This method checks the security manager with the call checkSecurityAccess ! with "insertProvider."+provider.getName() to see if the user can add this ! provider. ! ! @param provider the provider to add ! ! @return the position the provider was added at, or -1 if a duplicate provider ! was found ! @throws SecurityException - if the security manager denies access to add a ! new provider */ public static int addProvider(Provider provider) { ! return insertProviderAt (provider, providers.size ()); } /** --- 198,230 ---- providers.insertElementAt(provider, position); ! return position + 1; } /** ! Adds a provider to the next position available. !

          ! NOT IMPLEMENTED YET: [ ! First, if there is a security manager, its checkSecurityAccess ! method is called with the string ! "insertProvider."+provider.getName() ! to see if it's ok to add a new provider. If the default implementation of ! checkSecurityAccess is used (i.e., that method is not ! overriden), then this will result in a call to the security manager's ! checkPermission method with a SecurityPermission( ! "insertProvider."+provider.getName()) permission.] ! @param provider the provider to be added. ! @return the preference position in which the provider was added, or ! -1 if the provider was not added because it is already installed. ! @throws SecurityException if a security manager exists and its ! SecurityManager.checkSecurityAccess(java.lang.String) method denies ! access to add a new provider. */ public static int addProvider(Provider provider) { ! return insertProviderAt (provider, providers.size () + 1); } /** *************** public final class Security extends Obje *** 214,226 **** ranking. If the provider is not installed, it fails silently. This method checks the security manager with the call checkSecurityAccess ! with "removeProvider."+provider.getName() to see if the user can remove this ! provider. @param name name of the provider to add ! @throws SecurityException - if the security manager denies access to remove a ! new provider */ public static void removeProvider(String name) { --- 233,245 ---- ranking. If the provider is not installed, it fails silently. This method checks the security manager with the call checkSecurityAccess ! with "removeProvider."+provider.getName() to see if the user can remove ! this provider. @param name name of the provider to add ! @throws SecurityException - if the security manager denies access to ! remove a new provider */ public static void removeProvider(String name) { *************** public final class Security extends Obje *** 263,277 **** */ public static Provider getProvider(String name) { ! Provider p = null; int max = providers.size (); for (int i = 0; i < max; i++) { p = (Provider) providers.elementAt(i); if (p.getName() == name) ! break; } ! return p; } /** --- 282,296 ---- */ public static Provider getProvider(String name) { ! Provider p; int max = providers.size (); for (int i = 0; i < max; i++) { p = (Provider) providers.elementAt(i); if (p.getName() == name) ! return p; } ! return null; } /** diff -Nrc3pad gcc-3.2.3/libjava/java/security/SecurityPermission.java gcc-3.3/libjava/java/security/SecurityPermission.java *** gcc-3.2.3/libjava/java/security/SecurityPermission.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/SecurityPermission.java 2002-05-24 11:57:23.000000000 +0000 *************** *** 1,5 **** /* SecurityPermission.java -- Class for named security permissions ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SecurityPermission.java -- Class for named security permissions ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,93 **** package java.security; /** ! * This class provides a mechanism for specified named permissions * related to the Java security framework. These permissions have no ! * associated actions list. They are either granted or no granted. ! *

          ! * The list of valid permission names is: ! *

            ! *
          • getPolicy - Allows retrieval of the system security policy. ! *
          • setPolicy - Allows the security policy to be changed. ! *
          • getProperty.<key> - Allows retrieval of the value of the named ! * property or all properties if <key> is a '*'. ! *
          • setProperty.<key> - Allows changing of the value of the named ! * property or all properties if <key> is a '*'. ! *
          • insertProvider.<key> - Allows the named provider to be added, ! * or any provide if the key is '*'. ! *
          • removeProvider.<key> - Allows the named provider to be removed, ! * or any provide if the key is '*'. ! *
          • setSystemScope - Allows the system identity scope to be set. ! *
          • setIdentityPublicKey - Allows the public key of an Identity to be set. ! *
          • SetIdentityInfo - Allows the description of an Identity to be set. ! *
          • addIdentityCertificate - Allows a certificate to be set for the public ! * key of an identity. ! *
          • removeIdentityCertificate - Allows a certificate to be removed from the ! * public key of an identity. ! *
          • clearProviderProperties.<key%gt; - Allows the properties of the ! * named provider to be cleared, or all providers if key is '*'. ! *
          • putProviderProperty.<key%gt; - Allows the properties of the ! * named provider to be changed, or all providers if key is '*'. ! *
          • removeProviderProperty.<key%gt; - Allows the properties of the ! * named provider to be deleted, or all providers if key is '*'. ! *
          • getSignerPrivateKey - Allows the retrieval of the private key for ! * a signer. ! *
          • setSignerKeyPair - Allows the public and private key of a Signer to ! * be changed. ! *
          ! *

          ! * There is some degree of security risk in granting any of these permissions. ! * Some of them can completely compromise system security. Please exercise ! * extreme caution in granting these permissions. * ! * @version 0.0 * * @author Aaron M. Renn (arenn@urbanophile.com) */ public final class SecurityPermission extends BasicPermission { /** ! * This method initializes a new instance of SecurityPermission ! * to have the specified name. * ! * @param name The name to assign to this permission. */ public SecurityPermission(String name) { --- 38,163 ---- package java.security; /** ! * This class provides a mechanism for specified named permissions * related to the Java security framework. These permissions have no ! * associated actions list. They are either granted or not granted. * ! *

          The list of valid permission names is:
          ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *
          Permission NamePermission AllowsRisks ! *
          createAccessControlContextAllows creation of an AccessControlContextThe new control context can have a rogue DomainCombiner, leading ! * to a privacy leak
          getDomainCombinerGet a DomainCombiner from an AccessControlContextAccess to a DomainCombiner can lead to a privacy leak
          getPolicyAllows retrieval of the system security policyMalicious code can use information from the policy to better plan ! * an attack
          setPolicyAllows the security policy to be changedMalicious code can give itself any permission it wants
          getProperty.keyRetrieve the property specified by the keyMalicious code can use information from the property to better plan ! * an attack
          setProperty.keyAllows changing of the value of all properties implied by keyMalicious code can insert rogue classes to steal keys or recreate ! * the security policy with whatever permissions it desires
          insertProvider.keyAllows the named provider to be addedMalicious code can insert rogue providers that steal data
          removeProvider.keyAllows the named provider to be removedA missing provider can cripple code that relies on it
          setSystemScopeAllows the system identity scope to be setMalicious code can add certificates not available in the original ! * identity scope, to gain more permissions
          setIdentityPublicKeyAllows the public key of an Identity to be setMalicious code can install its own key to gain permissions not ! * allowed by the original identity scope
          SetIdentityInfoAllows the description of an Identity to be setMalicious code can spoof users into trusting a fake identity
          addIdentityCertificateAllows a certificate to be set for the public key of an identityThe public key can become trusted to a wider audience than originally ! * intended
          removeIdentityCertificateAllows removal of a certificate from an identity's public keyThe public key can become less trusted than it should be
          printIdentityView the name of the identity and scope, and whether they are ! * trustedThe scope may include a filename, which provides an entry point for ! * further security breaches
          clearProviderProperties.keyAllows the properties of the named provider to be clearedThis can disable parts of the program which depend on finding the ! * provider
          putProviderProperty.keyAllows the properties of the named provider to be changedMalicious code can replace the implementation of a provider
          removeProviderProperty.keyAllows the properties of the named provider to be deletedThis can disable parts of the program which depend on finding the ! * provider
          getSignerPrivateKeyAllows the retrieval of the private key for a signerAnyone that can access the private key can claim to be the ! * Signer
          setSignerKeyPairAllows the public and private key of a Signer to be changedThe replacement might be a weaker encryption, or the attacker ! * can use knowledge of the replaced key to decrypt an entire ! * communication session
          ! * ! *

          There is some degree of security risk in granting any of these ! * permissions. Some of them can completely compromise system security. ! * Please exercise extreme caution in granting these permissions. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @see Permission + * @see SecurityManager + * @since 1.1 + * @status updated to 1.4 */ public final class SecurityPermission extends BasicPermission { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 5236109936224050470L; ! ! /** ! * Create a new instance with the specified name. * ! * @param name the name to assign to this permission */ public SecurityPermission(String name) { *************** public final class SecurityPermission ex *** 95,109 **** } /** ! * This method initializes a new instance of SecurityPermission ! * to have the specified name. The actions parameter is ignored in this ! * class. * ! * @param name The name to assign to this permission. ! * @param actions The action list for this permission - ignored. */ public SecurityPermission(String name, String actions) { ! super(name, actions); } ! } --- 165,178 ---- } /** ! * Create a new instance with the specified name. As SecurityPermission ! * carries no actions, the second parameter is ignored. * ! * @param name the name to assign to this permission ! * @param actions ignored */ public SecurityPermission(String name, String actions) { ! super(name); } ! } // class SecurityPermission diff -Nrc3pad gcc-3.2.3/libjava/java/security/SignatureException.java gcc-3.3/libjava/java/security/SignatureException.java *** gcc-3.2.3/libjava/java/security/SignatureException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/SignatureException.java 2002-05-24 11:57:24.000000000 +0000 *************** *** 1,5 **** /* SignatureException.java -- Generic error in signature ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SignatureException.java -- Generic error in signature ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,64 **** * This exception is thrown when a problem is encountered with a * digital signature. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class SignatureException extends GeneralSecurityException { /** ! * This method initializes a new instance of SignatureException ! * with no descriptive error message. */ public SignatureException() { - super(); } /** ! * This method initializes a new instance of SignatureException ! * with a descriptive error message. */ public SignatureException(String msg) { --- 41,67 ---- * This exception is thrown when a problem is encountered with a * digital signature. * ! * @author Aaron M. Renn ! * @status updated to 1.4 */ public class SignatureException extends GeneralSecurityException { /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 7509989324975124438L; ! ! /** ! * Create an instance with no descriptive error message. */ public SignatureException() { } /** ! * Create an instance with a descriptive error message. ! * ! * @param msg the message */ public SignatureException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/Signature.java gcc-3.3/libjava/java/security/Signature.java *** gcc-3.2.3/libjava/java/security/Signature.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/Signature.java 2002-11-17 00:10:24.000000000 +0000 *************** *** 1,5 **** /* Signature.java --- Signature Class ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Signature.java --- Signature Class ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.security.spec.AlgorithmParam *** 58,72 **** 1. Initialing ! * It must be initialized with a private key for ! signing. ! * It must be initialized with a public key for ! verifying. 2. Updating ! Update the bytes for signing or verifying with calls ! to update. 3. Signing or Verify the signature on the currently stored bytes by calling sign or verify. --- 58,69 ---- 1. Initialing ! * It must be initialized with a private key for signing. ! * It must be initialized with a public key for verifying. 2. Updating ! Update the bytes for signing or verifying with calls to update. 3. Signing or Verify the signature on the currently stored bytes by calling sign or verify. *************** public abstract class Signature extends *** 100,106 **** protected int state = UNINITIALIZED; private String algorithm; ! private Provider provider; /** Creates a new signature for this algorithm. --- 97,103 ---- protected int state = UNINITIALIZED; private String algorithm; ! Provider provider; /** Creates a new signature for this algorithm. *************** public abstract class Signature extends *** 113,119 **** state = UNINITIALIZED; } ! /** Gets an instance of the Signature class representing the specified signature. If the algorithm is not found then, it throws NoSuchAlgorithmException. --- 110,116 ---- state = UNINITIALIZED; } ! /** Gets an instance of the Signature class representing the specified signature. If the algorithm is not found then, it throws NoSuchAlgorithmException. *************** public abstract class Signature extends *** 121,139 **** @param algorithm the name of signature algorithm to choose @return a Signature repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by providers */ public static Signature getInstance(String algorithm) throws NoSuchAlgorithmException { - String name = "Signature." + algorithm; Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { ! String classname = p[i].getProperty(name); ! if (classname != null) ! return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); --- 118,138 ---- @param algorithm the name of signature algorithm to choose @return a Signature repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by ! providers */ public static Signature getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { ! try ! { ! return getInstance(algorithm, p[i]); ! } ! catch (NoSuchAlgorithmException ignored) {} } throw new NoSuchAlgorithmException(algorithm); *************** public abstract class Signature extends *** 150,156 **** @param provider the name of the provider to find the algorithm in @return a Signature repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by the provider @throws NoSuchProviderException if the provider is not found */ public static Signature getInstance(String algorithm, String provider) --- 149,156 ---- @param provider the name of the provider to find the algorithm in @return a Signature repesenting the desired algorithm ! @throws NoSuchAlgorithmException if the algorithm is not implemented by ! the provider @throws NoSuchProviderException if the provider is not found */ public static Signature getInstance(String algorithm, String provider) *************** public abstract class Signature extends *** 158,166 **** { Provider p = Security.getProvider(provider); if (p == null) ! throw new NoSuchProviderException(); ! return getInstance(p.getProperty("Signature." + algorithm), algorithm, p); } private static Signature getInstance(String classname, --- 158,191 ---- { Provider p = Security.getProvider(provider); if (p == null) ! throw new NoSuchProviderException(provider); ! return getInstance(algorithm, p); ! } ! ! private static Signature getInstance(String algorithm, Provider p) ! throws NoSuchAlgorithmException ! { ! // try the name as is ! String className = p.getProperty("Signature." + algorithm); ! if (className == null) { // try all uppercase ! String upper = algorithm.toUpperCase(); ! className = p.getProperty("Signature." + upper); ! if (className == null) { // try if it's an alias ! String alias = p.getProperty("Alg.Alias.Signature." + algorithm); ! if (alias == null) { ! alias = p.getProperty("Alg.Alias.Signature." + upper); ! if (alias == null) { // spit the dummy ! throw new NoSuchAlgorithmException(algorithm); ! } ! } ! className = p.getProperty("Signature." + alias); ! if (className == null) { ! throw new NoSuchAlgorithmException(algorithm); ! } ! } ! } ! return getInstance(className, algorithm, p); } private static Signature getInstance(String classname, *************** public abstract class Signature extends *** 173,179 **** Object o = Class.forName(classname).newInstance(); Signature sig; if (o instanceof SignatureSpi) ! sig = (Signature) (new DummySignature((SignatureSpi) o, algorithm)); else { sig = (Signature) o; --- 198,204 ---- Object o = Class.forName(classname).newInstance(); Signature sig; if (o instanceof SignatureSpi) ! sig = new DummySignature((SignatureSpi) o, algorithm); else { sig = (Signature) o; *************** public abstract class Signature extends *** 200,206 **** /** Gets the provider that the Signature is from. ! @return the provider the this Signature */ public final Provider getProvider() { --- 225,231 ---- /** Gets the provider that the Signature is from. ! @return the provider of this Signature */ public final Provider getProvider() { *************** public abstract class Signature extends *** 310,316 **** initial state and can be used to generate additional signatures. ! @param outbuff array of bytes @param offset the offset to start at in the array @param len the length of the bytes to put into the array. Neither this method or the GNU provider will --- 335,341 ---- initial state and can be used to generate additional signatures. ! @param outbuf array of bytes @param offset the offset to start at in the array @param len the length of the bytes to put into the array. Neither this method or the GNU provider will *************** public abstract class Signature extends *** 325,331 **** @since JDK 1.2 */ ! public final int sign(byte[]outbuf, int offset, int len) throws SignatureException { if (state == SIGN) --- 350,356 ---- @since JDK 1.2 */ ! public final int sign(byte[] outbuf, int offset, int len) throws SignatureException { if (state == SIGN) diff -Nrc3pad gcc-3.2.3/libjava/java/security/SignedObject.java gcc-3.3/libjava/java/security/SignedObject.java *** gcc-3.2.3/libjava/java/security/SignedObject.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/SignedObject.java 2002-10-04 20:15:07.000000000 +0000 *************** import java.io.Serializable; *** 79,84 **** --- 79,86 ---- */ public final class SignedObject implements Serializable { + static final long serialVersionUID = 720502720485447167L; + private byte[] content; private byte[] signature; private String thealgorithm; diff -Nrc3pad gcc-3.2.3/libjava/java/security/spec/DSAParameterSpec.java gcc-3.3/libjava/java/security/spec/DSAParameterSpec.java *** gcc-3.2.3/libjava/java/security/spec/DSAParameterSpec.java 2002-01-22 22:40:35.000000000 +0000 --- gcc-3.3/libjava/java/security/spec/DSAParameterSpec.java 2002-12-03 18:46:59.000000000 +0000 *************** public class DSAParameterSpec extends Ob *** 74,80 **** */ public BigInteger getP() { ! return this.q; } /** --- 74,80 ---- */ public BigInteger getP() { ! return this.p; } /** diff -Nrc3pad gcc-3.2.3/libjava/java/security/spec/DSAPrivateKeySpec.java gcc-3.3/libjava/java/security/spec/DSAPrivateKeySpec.java *** gcc-3.2.3/libjava/java/security/spec/DSAPrivateKeySpec.java 2002-01-22 22:40:35.000000000 +0000 --- gcc-3.3/libjava/java/security/spec/DSAPrivateKeySpec.java 2002-12-03 18:46:59.000000000 +0000 *************** public class DSAPrivateKeySpec extends O *** 87,93 **** */ public BigInteger getP() { ! return this.q; } /** --- 87,93 ---- */ public BigInteger getP() { ! return this.p; } /** diff -Nrc3pad gcc-3.2.3/libjava/java/security/spec/DSAPublicKeySpec.java gcc-3.3/libjava/java/security/spec/DSAPublicKeySpec.java *** gcc-3.2.3/libjava/java/security/spec/DSAPublicKeySpec.java 2002-01-22 22:40:35.000000000 +0000 --- gcc-3.3/libjava/java/security/spec/DSAPublicKeySpec.java 2002-12-03 18:46:59.000000000 +0000 *************** public class DSAPublicKeySpec extends Ob *** 87,93 **** */ public BigInteger getP() { ! return this.q; } /** --- 87,93 ---- */ public BigInteger getP() { ! return this.p; } /** diff -Nrc3pad gcc-3.2.3/libjava/java/security/spec/InvalidKeySpecException.java gcc-3.3/libjava/java/security/spec/InvalidKeySpecException.java *** gcc-3.2.3/libjava/java/security/spec/InvalidKeySpecException.java 2002-01-22 22:40:35.000000000 +0000 --- gcc-3.3/libjava/java/security/spec/InvalidKeySpecException.java 2002-05-24 11:57:39.000000000 +0000 *************** *** 1,5 **** ! /* InvalidKeySpecException.java --- Invalid KeySpec Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InvalidKeySpecException.java -- invalid KeySpec Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,70 **** package java.security.spec; import java.security.GeneralSecurityException; /** ! Exception for an invalid key specification. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto ! */ ! public class InvalidKeySpecException extends GeneralSecurityException { /** ! Constructs an InvalidKeySpecException without a message string. ! */ ! public InvalidKeySpecException() { - super(); } /** ! Constructs an InvalidKeySpecException with a message string. ! ! @param msg A message to display with exception ! */ public InvalidKeySpecException(String msg) { ! super( msg ); } - } --- 37,74 ---- package java.security.spec; + import java.security.GeneralSecurityException; /** ! * Exception for an invalid key specification. ! * ! * @author Mark Benvenuto ! * @see KeySpec ! * @since 1.2 ! * @status updated to 1.4 ! */ ! public class InvalidKeySpecException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 3546139293998810778L; /** ! * Constructs an InvalidKeySpecException without a message string. ! */ ! public InvalidKeySpecException() { } /** ! * Constructs an InvalidKeySpecException with a message string. ! * ! * @param msg a message to display with exception ! */ public InvalidKeySpecException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/spec/InvalidParameterSpecException.java gcc-3.3/libjava/java/security/spec/InvalidParameterSpecException.java *** gcc-3.2.3/libjava/java/security/spec/InvalidParameterSpecException.java 2002-01-22 22:40:35.000000000 +0000 --- gcc-3.3/libjava/java/security/spec/InvalidParameterSpecException.java 2002-05-24 11:57:40.000000000 +0000 *************** *** 1,5 **** ! /* InvalidParameterSpecException.java --- Invalid ParameterSpec Exception ! Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* InvalidParameterSpecException.java --- invalid ParameterSpec Exception ! Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,70 **** package java.security.spec; import java.security.GeneralSecurityException; /** ! Exception for an invalid algorithm specification. ! ! @since JDK 1.2 ! ! @author Mark Benvenuto */ public class InvalidParameterSpecException extends GeneralSecurityException { /** ! Constructs an InvalidParameterSpecException without a message string. ! */ public InvalidParameterSpecException() { - super(); } /** ! Constructs an InvalidParameterSpecException with a message string. ! ! @param msg A message to display with exception ! */ ! public InvalidParameterSpecException(String msg) { ! super( msg ); } - } --- 37,76 ---- package java.security.spec; + import java.security.GeneralSecurityException; /** ! * Exception for an invalid algorithm specification. ! * ! * @author Mark Benvenuto ! * @see AlogorithmParameters ! * @see AlogorithmParameterSpec ! * @see DSAParameterSpec ! * @since 1.2 ! * @status updated to 1.4 */ public class InvalidParameterSpecException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -970468769593399342L; /** ! * Constructs an InvalidParameterSpecException without a message string. ! */ public InvalidParameterSpecException() { } /** ! * Constructs an InvalidParameterSpecException with a message string. ! * ! * @param msg a message to display with exception ! */ ! public InvalidParameterSpecException(String msg) { ! super(msg); } } diff -Nrc3pad gcc-3.2.3/libjava/java/security/UnrecoverableKeyException.java gcc-3.3/libjava/java/security/UnrecoverableKeyException.java *** gcc-3.2.3/libjava/java/security/UnrecoverableKeyException.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/UnrecoverableKeyException.java 2002-05-24 11:57:24.000000000 +0000 *************** *** 1,5 **** /* UnrecoverableKeyException.java -- Cannot recover a key from the key store ! Copyright (C) 1998 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* UnrecoverableKeyException.java -- Cannot recover a key from the key store ! Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.security; *** 41,66 **** * This exception is thrown when a key cannot be recovered from the key * store. * ! * @version 0.0 ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ public class UnrecoverableKeyException extends GeneralSecurityException { /** ! * This method initializes a new instance of UnrecoverableKeyException ! * with no descriptive error message. */ public UnrecoverableKeyException() { - super(); } /** ! * This method initializes a new instance of UnrecoverableKeyException ! * with a descriptive error message. * ! * @param msg The descriptive error message. */ public UnrecoverableKeyException(String msg) { --- 41,68 ---- * This exception is thrown when a key cannot be recovered from the key * store. * ! * @author Aaron M. Renn ! * @since 1.2 ! * @status updated to 1.4 */ public class UnrecoverableKeyException extends GeneralSecurityException { /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 7275063078190151277L; ! ! /** ! * Create an instance with no descriptive error message. */ public UnrecoverableKeyException() { } /** ! * Create an instance with a descriptive error message. * ! * @param msg the descriptive error message */ public UnrecoverableKeyException(String msg) { diff -Nrc3pad gcc-3.2.3/libjava/java/security/UnresolvedPermission.java gcc-3.3/libjava/java/security/UnresolvedPermission.java *** gcc-3.2.3/libjava/java/security/UnresolvedPermission.java 2002-01-22 22:40:30.000000000 +0000 --- gcc-3.3/libjava/java/security/UnresolvedPermission.java 2002-05-24 11:57:25.000000000 +0000 *************** *** 1,5 **** ! /* UnresolvedPermission.java -- Placeholder for unresolved permissions. ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* UnresolvedPermission.java -- Placeholder for unresolved permissions ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,199 **** package java.security; import java.io.Serializable; ! // All uses of Certificate in this file refer to this class. import java.security.cert.Certificate; /** * This class is used to hold instances of all permissions that cannot ! * be resolved to available permission classes when the security * Policy object is instantiated. This may happen when the * necessary security class has not yet been downloaded from the network. - *

          - * Instances of this class are re-resolved when AccessController - * check is done. At that time, a scan is made of all existing - * UnresolvedPermission objects and they are converted to - * objects of the appropriate permission type if the class for that type - * is then available. * ! * @version 0.0 * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public final class UnresolvedPermission ! extends Permission ! implements Serializable { /** ! * The list of actions associated with this permission object */ ! private String actions; /** ! * The list of Certificates associated with this object */ ! private Certificate[] certs; /** * The name of the class this object should be resolved to. */ ! private String type; /** ! * This method initializes a new instance of UnresolvedPermission ! * with all the information necessary to resolve it to an instance of the ! * proper class at a future time. * ! * @param type The name of the desired class this permission should be resolved to ! * @param name The name of this permission ! * @param actions The action list for this permission ! * @param certs The list of certificates this permission's class was signed with */ public UnresolvedPermission(String type, String name, String actions, ! Certificate[] certs) { super(name); ! this.type = type; this.actions = actions; this.certs = certs; } /** - * This method returns the list of actions associated with this - * permission. - * - * @return The action list - */ - public String getActions() - { - return (actions); - } - - /** * This method returns false always to indicate that this ! * permission does not imply the specified permission. An * UnresolvedPermission never grants any permissions. * ! * @param perm The Permission object to test against - ignored by this class ! * ! * @return false to indicate this permission does not imply the specified permission. */ public boolean implies(Permission perm) { ! return (false); } /** * This method tests this permission for equality against the specified ! * Object. This will be true if and only if the following ! * conditions are met: ! *

          ! *

            ! *
          • The specified Object is an instance of ! * UnresolvedPermission, or a subclass. *
          • The specified permission has the same type (i.e., desired class name) ! * as this permission. ! *
          • The specified permission has the same name as this one. ! *
          • The specified permissoin has the same action list as this one. ! *
          • The specified permission has the same certificate list as this one. *
          * ! * @param obj The Object to test for equality ! * ! * @return true if the specified object is equal to this one, false otherwise. */ public boolean equals(Object obj) { ! if (!(obj instanceof UnresolvedPermission)) return (false); - UnresolvedPermission up = (UnresolvedPermission) obj; ! ! if (!getName().equals(up.getName())) ! return (false); ! ! if (!getActions().equals(up.getActions())) ! return (false); ! ! if (!type.equals(up.type)) ! return (false); ! ! if (!certs.equals(up.certs)) ! return (false); ! ! return (true); } /** ! * Returns a hash code value for this object. * * @return A hash value */ public int hashCode() { ! return (System.identityHashCode(this)); } /** * This method returns a String representation of this * class. The format is: '(unresolved "ClassName "name" "actions")' * ! * @return A String representation of this object */ public String toString() { ! return "(unresolved " + type + " " + getName() + " " + getActions() + ")"; } /** * This class returns a PermissionCollection object that can ! * be used to store instances of UnresolvedPermission. If ! * null is returned, the caller is free to use any desired ! * PermissionCollection. * ! * @return A new PermissionCollection. */ public PermissionCollection newPermissionCollection() { ! return (null); } ! } --- 38,303 ---- package java.security; import java.io.Serializable; ! // All uses of Certificate in this file refer to the one in the listed ! // package, not this one. import java.security.cert.Certificate; + import java.util.Arrays; + import java.util.Hashtable; + import java.util.Vector; + import java.util.Enumeration; + import java.util.NoSuchElementException; /** * This class is used to hold instances of all permissions that cannot ! * be resolved to available permission classes when the security * Policy object is instantiated. This may happen when the * necessary security class has not yet been downloaded from the network. * ! *

          Instances of this class are re-resolved when ! * AccessController check is done. At that time, a scan is ! * made of all existing UnresolvedPermission objects and they ! * are converted to objects of the appropriate permission type if the class ! * for that type is then available. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @see Permission + * @see Permissions + * @see PermissionCollection + * @see Policy + * @since 1.1 + * @status updated to 1.4 */ ! public final class UnresolvedPermission extends Permission { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -4821973115467008846L; /** ! * The list of actions associated with this permission object. ! * ! * @serial the permission actions */ ! private final String actions; /** ! * The list of Certificates associated with this object. */ ! private final transient Certificate[] certs; /** * The name of the class this object should be resolved to. + * + * @serial the fully-qualified classname of the resolved type */ ! // Package visible for use by UnresolvedPermissionCollection. ! final String type; /** ! * The name of the permission. * ! * @serial the permission name ! */ ! private final String name; ! ! /** ! * Create a new instance with all the information necessary to resolve it ! * to an instance of the proper class at a future time. ! * ! * @param type the fully-qualified name of the class of this permission ! * @param name the name of this permission ! * @param actions the action list for this permission ! * @param certs the list of certificates that sign this permission */ public UnresolvedPermission(String type, String name, String actions, ! Certificate[] certs) { super(name); ! this.name = name; this.type = type; this.actions = actions; this.certs = certs; } /** * This method returns false always to indicate that this ! * permission does not imply the specified permission. An * UnresolvedPermission never grants any permissions. * ! * @param perm the Permission object to test ! * @return false; until a permission is resolved, it implies nothing */ public boolean implies(Permission perm) { ! return false; } /** * This method tests this permission for equality against the specified ! * Object. This will be true if and only if the following ! * conditions are met:

            ! *
          • The specified Object is an UnresolvedPermission
          • *
          • The specified permission has the same type (i.e., desired class name) ! * as this permission.
          • ! *
          • The specified permission has the same name as this one.
          • ! *
          • The specified permissoin has the same action list as this one.
          • ! *
          • The specified permission has the same certificate list as this ! * one.
          • *
          * ! * @param obj the Object to test for equality ! * @return true if the specified object is equal to this one */ public boolean equals(Object obj) { ! if (! (obj instanceof UnresolvedPermission)) return (false); UnresolvedPermission up = (UnresolvedPermission) obj; ! return up.name.equals(name) && up.actions.equals(actions) ! && up.type.equals(type) && Arrays.equals(up.certs, certs); } /** ! * Returns a hash code value for this object. Following the lead of ! * Permission, this returns the hashcode of the permission name. * * @return A hash value */ public int hashCode() { ! return name.hashCode(); ! } ! ! /** ! * This method returns the list of actions associated with this ! * permission. ! * ! * @return the action list ! */ ! public String getActions() ! { ! return actions; } /** * This method returns a String representation of this * class. The format is: '(unresolved "ClassName "name" "actions")' * ! * @return String representation of this object */ public String toString() { ! return "(unresolved " + type + ' ' + name + ' ' + actions + ')'; } /** * This class returns a PermissionCollection object that can ! * be used to store instances of UnresolvedPermission. * ! * @return a new PermissionCollection */ public PermissionCollection newPermissionCollection() { ! return new UnresolvedPermissionCollection(); } ! } // class UnresolvedPermission ! ! /** ! * Implements the permission collection for unresolved permissions, and ! * obeys serialization of JDK. ! * ! * @author Eric Blake ! */ ! class UnresolvedPermissionCollection extends PermissionCollection ! { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = -7176153071733132400L; ! ! /** ! * Hashtable where we store permissions. ! * ! * @serial map of typename to a Vector of permissions (you'd think Sun ! * would document this better!) ! */ ! private final Hashtable permissions = new Hashtable(); ! ! /** ! * Add a permission. ! * ! * @param perm the permission to add ! * @throws IllegalArgumentException if perm is not an UnresolvedPermission ! * @throws SecurityException if the collection is read-only ! */ ! public void add(Permission perm) ! { ! if (isReadOnly()) ! throw new SecurityException(); ! if (! (perm instanceof UnresolvedPermission)) ! throw new IllegalArgumentException(); ! UnresolvedPermission up = (UnresolvedPermission) perm; ! Vector v = (Vector) permissions.get(up.type); ! if (v == null) ! { ! v = new Vector(); ! permissions.put(up.type, v); ! } ! v.add(up); ! } ! ! /** ! * Returns true if perm is implied by the collection. ! * ! * @param perm the permission to check ! * @return false; unresolved permissions imply nothing ! */ ! public boolean implies(Permission perm) ! { ! return false; ! } ! ! /** ! * Return the elements. ! * ! * @return the elements ! */ ! public Enumeration elements() ! { ! return new Enumeration() ! { ! Enumeration main_enum = permissions.elements(); ! Enumeration sub_enum; ! ! public boolean hasMoreElements() ! { ! if (sub_enum == null) ! { ! if (main_enum == null) ! return false; ! if (! main_enum.hasMoreElements()) ! { ! main_enum = null; ! return false; ! } ! Vector v = (Vector) main_enum.nextElement(); ! sub_enum = v.elements(); ! } ! if (! sub_enum.hasMoreElements()) ! { ! sub_enum = null; ! return hasMoreElements(); ! } ! return true; ! } ! ! public Object nextElement() ! { ! if (! hasMoreElements()) ! throw new NoSuchElementException(); ! return sub_enum.nextElement(); ! } ! }; ! } ! } // class UnresolvedPermissionCollection diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Array.java gcc-3.3/libjava/java/sql/Array.java *** gcc-3.2.3/libjava/java/sql/Array.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Array.java 2002-06-21 05:39:20.000000000 +0000 *************** *** 1,5 **** /* Array.java -- Interface for accessing SQL array object ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Array.java -- Interface for accessing SQL array object ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,237 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.util.Map; /** ! * This interface provides methods for accessing SQL array types ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Array { ! /** ! * This method returns the name of the SQL type of the elements in this ! * array. This name is database specific. ! * ! * @param The name of the SQL type of the elements in this array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getBaseTypeName() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the JDBC type identifier of the elements in this ! * array. This will be one of the values defined in the Types ! * class. ! * ! * @return The JDBC type of the elements in this array. ! * ! * @exception SQLException If an error occurs. ! * ! * @see Types ! */ ! public abstract int ! getBaseType() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the contents of this array. This object returned ! * will be an array of Java objects of the appropriate types. ! * ! * @return The contents of the array as an array of Java objects. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getArray() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the contents of this array. The specified ! * Map will be used to override selected mappings between ! * SQL types and Java classes. ! * ! * @param map A mapping of SQL types to Java classes. ! * ! * @return The contents of the array as an array of Java objects. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getArray(Map map) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a portion of this array starting at index ! * offset into the array and continuing for length ! * elements. Fewer than the requested number of elements will be ! * returned if the array does not contain the requested number of elements. ! * The object returned will be an array of Java objects of ! * the appropriate types. ! * ! * @param offset The offset into this array to start returning elements from. ! * @param count The requested number of elements to return. ! * ! * @return The requested portion of the array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getArray(long offset, int count) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a portion of this array starting at index ! * offset into the array and continuing for length ! * elements. Fewer than the requested number of elements will be ! * returned if the array does not contain the requested number of elements. ! * The object returned will be an array of Java objects. The specified ! * Map will be used for overriding selected SQL type to ! * Java class mappings. ! * ! * @param offset The offset into this array to start returning elements from. ! * @param count The requested number of elements to return. ! * @param map A mapping of SQL types to Java classes. ! * ! * @return The requested portion of the array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getArray(long index, int count, Map map) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the elements in the array as a ResultSet. ! * Each row of the result set will have two columns. The first will be ! * the index into the array of that row's contents. The second will be ! * the actual value of that array element. ! * ! * @return The elements of this array as a ResultSet. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract ResultSet ! getResultSet() throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method returns the elements in the array as a ResultSet. ! * Each row of the result set will have two columns. The first will be ! * the index into the array of that row's contents. The second will be ! * the actual value of that array element. The specified Map ! * will be used to override selected default mappings of SQL types to ! * Java classes. ! * ! * @param map A mapping of SQL types to Java classes. ! * ! * @return The elements of this array as a ResultSet. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract ResultSet ! getResultSet(Map map) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a portion of the array as a ResultSet. ! * The returned portion will start at index offset into the ! * array and up to length elements will be returned. ! *

          ! * Each row of the result set will have two columns. The first will be ! * the index into the array of that row's contents. The second will be ! * the actual value of that array element. ! * ! * @param offset The index into the array to start returning elements from. ! * @param length The requested number of elements to return. ! * ! * @return The requested elements of this array as a ResultSet. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract ResultSet ! getResultSet(long index, int count) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a portion of the array as a ResultSet. ! * The returned portion will start at index offset into the ! * array and up to length elements will be returned. ! *

          ! * Each row of the result set will have two columns. The first will be ! * the index into the array of that row's contents. The second will be ! * the actual value of that array element. The specified Map ! * will be used to override selected default mappings of SQL types to ! * Java classes. ! * ! * @param offset The index into the array to start returning elements from. ! * @param length The requested number of elements to return. ! * @param map A mapping of SQL types to Java classes. ! * ! * @return The requested elements of this array as a ResultSet. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract ResultSet ! getResultSet(long index, int count, Map map) throws SQLException; ! } // interface Array --- 35,185 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; import java.util.Map; /** ! * This interface provides methods for accessing SQL array types. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Array { + /** + * Returns the name of the SQL type of the elements in this + * array. This name is database specific. + * + * @param The name of the SQL type of the elements in this array. + * @exception SQLException If an error occurs. + */ + public String getBaseTypeName() throws SQLException; ! /** ! * Returns the JDBC type identifier of the elements in this ! * array. This will be one of the values defined in the ! * Types class. ! * ! * @return The JDBC type of the elements in this array. ! * @exception SQLException If an error occurs. ! * @see Types ! */ ! public int getBaseType() throws SQLException; ! /** ! * Returns the contents of this array. This object returned ! * will be an array of Java objects of the appropriate types. ! * ! * @return The contents of the array as an array of Java objects. ! * @exception SQLException If an error occurs. ! */ ! public Object getArray() throws SQLException; ! /** ! * Returns the contents of this array. The specified ! * Map will be used to override selected mappings ! * between SQL types and Java classes. ! * ! * @param map A mapping of SQL types to Java classes. ! * @return The contents of the array as an array of Java objects. ! * @exception SQLException If an error occurs. ! */ ! public Object getArray(Map map) throws SQLException; ! /** ! * Returns a portion of this array starting at index ! * into the array and continuing for count ! * elements. Fewer than the requested number of elements will be ! * returned if the array does not contain the requested number of elements. ! * The object returned will be an array of Java objects of ! * the appropriate types. ! * ! * @param offset The offset into this array to start returning elements from. ! * @param count The requested number of elements to return. ! * @return The requested portion of the array. ! * @exception SQLException If an error occurs. ! */ ! public Object getArray(long index, int count) throws SQLException; ! /** ! * This method returns a portion of this array starting at index ! * into the array and continuing for count ! * elements. Fewer than the requested number of elements will be ! * returned if the array does not contain the requested number of elements. ! * The object returned will be an array of Java objects. The specified ! * Map will be used for overriding selected SQL type to ! * Java class mappings. ! * ! * @param offset The offset into this array to start returning elements from. ! * @param count The requested number of elements to return. ! * @param map A mapping of SQL types to Java classes. ! * @return The requested portion of the array. ! * @exception SQLException If an error occurs. ! */ ! public Object getArray(long index, int count, Map map) throws SQLException; ! /** ! * Returns the elements in the array as a ResultSet. ! * Each row of the result set will have two columns. The first will be ! * the index into the array of that row's contents. The second will be ! * the actual value of that array element. ! * ! * @return The elements of this array as a ResultSet. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public ResultSet getResultSet() throws SQLException; ! /** ! * This method returns the elements in the array as a ResultSet. ! * Each row of the result set will have two columns. The first will be ! * the index into the array of that row's contents. The second will be ! * the actual value of that array element. The specified Map ! * will be used to override selected default mappings of SQL types to ! * Java classes. ! * ! * @param map A mapping of SQL types to Java classes. ! * @return The elements of this array as a ResultSet. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public ResultSet getResultSet(Map map) throws SQLException; + /** + * This method returns a portion of the array as a ResultSet. + * The returned portion will start at index into the + * array and up to count elements will be returned. + *

          + * Each row of the result set will have two columns. The first will be + * the index into the array of that row's contents. The second will be + * the actual value of that array element. + * + * @param offset The index into the array to start returning elements from. + * @param length The requested number of elements to return. + * @return The requested elements of this array as a ResultSet. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public ResultSet getResultSet(long index, int count) throws SQLException; + + /** + * This method returns a portion of the array as a ResultSet. + * The returned portion will start at index into the + * array and up to count elements will be returned. + *

          + * Each row of the result set will have two columns. The first will be + * the index into the array of that row's contents. The second will be + * the actual value of that array element. The specified Map + * will be used to override selected default mappings of SQL types to + * Java classes. + * + * @param offset The index into the array to start returning elements from. + * @param length The requested number of elements to return. + * @param map A mapping of SQL types to Java classes. + * @return The requested elements of this array as a ResultSet. + * @exception SQLException If an error occurs. + * @see ResultSet + */ + public ResultSet getResultSet(long index, int count, Map map) + throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/BatchUpdateException.java gcc-3.3/libjava/java/sql/BatchUpdateException.java *** gcc-3.2.3/libjava/java/sql/BatchUpdateException.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/BatchUpdateException.java 2002-06-21 05:39:21.000000000 +0000 *************** *** 1,5 **** /* BatchUpdateException.java -- Exception for batch oriented SQL errors ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* BatchUpdateException.java -- Exception for batch oriented SQL errors ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,180 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; /** ! * This class extends SQLException to count the successful ! * updates in each statement in a batch that was successfully updated prior ! * to the error. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class BatchUpdateException extends SQLException ! { ! ! /*************************************************************************/ ! ! /* ! * Instance Variables ! */ ! ! /** ! * This is the array of update counts for the commands which completed ! * successfully prior to the error. ! * @serialized ! */ ! private int[] updateCounts; ! ! /*************************************************************************/ ! ! /* ! * Constructors */ ! ! /** ! * This method initializes a new instance of BatchUpdateException ! * with no descriptive error message. The SQL state and update count will ! * be initialized to null and the vendor specific error code will ! * initialized to 0. ! */ ! public ! BatchUpdateException() ! { ! super(); ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of BatchUpdateException ! * with the specified update count information and no descriptive error ! * message. This SQL state will be initialized to null and ! * the vendor specific error code will be initialized to 0. ! * ! * @param updateCounts The update count array. ! */ ! public ! BatchUpdateException(int[] updateCounts) ! { ! super(); ! ! this.updateCounts = updateCounts; ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of BatchUpdateException ! * with the specified descriptive error message and update count information. ! * The SQL state will be initialized to null and the vendor ! * specific error code will be initialized to 0. ! * ! * @param message The descriptive error message. ! * @param updateCounts The update count information for this error. ! */ ! public ! BatchUpdateException(String message, int[] updateCounts) ! { ! super(message); ! ! this.updateCounts = updateCounts; ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of BatchUpdateException ! * with the specified descriptive error message, SQL state, and update count ! * information. The vendor specific error code will be initialized to 0. ! * ! * @param message The descriptive error message. ! * @param SQLState The SQL state information for this error. ! * @param updateCounts The update count information for this error. ! */ ! public ! BatchUpdateException(String message, String SQLState, int[] updateCounts) { ! super(message, SQLState); ! this.updateCounts = updateCounts; ! } ! /*************************************************************************/ ! /** ! * This method initializes a new instance of BatchUpdateException ! * with the specified descriptive error message, SQL state, vendor ! * specific error code and update count information. ! * ! * @param message The descriptive error message. ! * @param SQLState The SQL state information for this error. ! * @param vendorCode The vendor specific error code for this error. ! * @param updateCounts The update count information for this error. ! */ ! public ! BatchUpdateException(String message, String SQLState, int vendorCode, ! int[] updateCounts) ! { ! super(message, SQLState, vendorCode); ! this.updateCounts = updateCounts; ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * This method returns the update count information for this error. If ! * not null this is an array of int's that are ! * the update accounts for each command that was successfully executed. ! * The array elements are in the order that the commands were executed. ! * ! * @return The update count information, which may be null. ! */ ! public int[] ! getUpdateCounts() ! { ! return(updateCounts); } - - } // class BatchUpdateException - --- 35,141 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; /** ! * This class extends SQLException to count the successful ! * updates in each statement in a batch that was successfully updated prior ! * to the error. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class BatchUpdateException extends SQLException { ! static final long serialVersionUID = 5977529877145521757L; ! /** ! * This is the array of update counts for the commands which completed ! * successfully prior to the error. ! */ ! private int[] updateCounts; ! /** ! * This method initializes a new instance of BatchUpdateException ! * with the specified descriptive error message, SQL state, and update count ! * information. The vendor specific error code will be initialized to 0. ! * ! * @param message The descriptive error message. ! * @param SQLState The SQL state information for this error. ! * @param vendorCode ! * @param updateCounts The update count information for this error. ! */ ! public BatchUpdateException(String message, String SQLState, int vendorCode, ! int[] updateCounts) ! { ! super(message, SQLState, vendorCode); ! this.updateCounts = updateCounts; ! } ! /** ! * This method initializes a new instance of BatchUpdateException ! * with the specified descriptive error message, SQL state, and update count ! * information. The vendor specific error code will be initialized to 0. ! * ! * @param message The descriptive error message. ! * @param SQLState The SQL state information for this error. ! * @param updateCounts The update count information for this error. ! */ ! public BatchUpdateException(String message, String SQLState, ! int[] updateCounts) ! { ! super(message, SQLState); ! this.updateCounts = updateCounts; ! } ! /** ! * This method initializes a new instance of BatchUpdateException ! * with the specified descriptive error message and update count information. ! * The SQL state will be initialized to null and the vendor ! * specific error code will be initialized to 0. ! * ! * @param message The descriptive error message. ! * @param updateCounts The update count information for this error. ! */ ! public BatchUpdateException(String message, int[] updateCounts) ! { ! super(message); ! this.updateCounts = updateCounts; ! } ! /** ! * Initializes a new instance of BatchUpdateException ! * with the specified update count information and no descriptive error ! * message. This SQL state will be initialized to null and ! * the vendor specific error code will be initialized to 0. ! * ! * @param updateCounts The update count array. ! */ ! public BatchUpdateException(int[] updateCounts) ! { ! this.updateCounts = updateCounts; ! } ! /** ! * Initializes a new instance of BatchUpdateException ! * with no descriptive error message. The SQL state and update count will ! * be initialized to null and the vendor specific error code will ! * initialized to 0. ! */ ! public BatchUpdateException() ! { ! super(); ! } ! /** ! * This method returns the update count information for this error. If ! * not null this is an array of int's that are ! * the update accounts for each command that was successfully executed. ! * The array elements are in the order that the commands were executed. ! * ! * @return The update count information, which may be null. ! */ ! public int[] getUpdateCounts() ! { ! return updateCounts; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Blob.java gcc-3.3/libjava/java/sql/Blob.java *** gcc-3.2.3/libjava/java/sql/Blob.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Blob.java 2002-06-21 05:39:21.000000000 +0000 *************** *** 1,5 **** /* Blob.java -- Access a SQL Binary Large OBject. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Blob.java -- Access a SQL Binary Large OBject. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,131 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; /** ! * This interface specified methods for accessing a SQL BLOB (Binary ! * Large OBject) type. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Blob { ! /*************************************************************************/ ! ! /** ! * This method returns the number of bytes in the BLOB. ! * ! * @return The number of bytes in the BLOB. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! length() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns up to the requested bytes of this BLOB as a ! * byte array. ! * ! * @param offset The index into the BLOB to start returning bytes from. ! * @param length The requested number of bytes to return. ! * ! * @return The requested bytes from the BLOB. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte[] ! getBytes(long offset, int length) throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method returns a stream that will read the bytes of the BLOB. ! * ! * @return A stream that will read the bytes of the BLOB. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getBinaryStream() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the index into the BLOB at which the first instance ! * of the specified bytes occur. The searching starts at the specified ! * index into the BLOB. ! * ! * @param pattern The byte pattern to search for. ! * @param offset The index into the BLOB to starting searching for the pattern. ! * ! * @return The offset at which the pattern is first found, or -1 if the ! * pattern is not found. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! position(byte[] pattern, long offset) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the index into the BLOB at which the first instance ! * of the specified pattern occurs. The searching starts at the specified ! * index into this BLOB. The bytes in the specified Blob are ! * used as the search pattern. ! * ! * @param pattern The Blob containing the byte pattern to ! * search for. ! * @param offset The index into the BLOB to starting searching for the pattern. ! * ! * @return The offset at which the pattern is first found, or -1 if the ! * pattern is not found. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! position(Blob pattern, long offset) throws SQLException; ! } // interface Blob --- 35,131 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; import java.io.InputStream; + import java.io.OutputStream; /** ! * This interface specified methods for accessing a SQL BLOB (Binary ! * Large OBject) type. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.2 ! */ ! public interface Blob { + /** + * This method returns the number of bytes in the BLOB. + * + * @return The number of bytes in the BLOB. + * @exception SQLException If an error occurs. + */ + public long length() throws SQLException; ! /** ! * This method returns up to the requested bytes of this BLOB as a ! * byte array. ! * ! * @param pos The index into the BLOB to start returning bytes from. ! * @param length The requested number of bytes to return. ! * @return The requested bytes from the BLOB. ! * @exception SQLException If an error occurs. ! */ ! public byte[] getBytes(long pos, int length) throws SQLException; ! /** ! * This method returns a stream that will read the bytes of the BLOB. ! * ! * @return A stream that will read the bytes of the BLOB. ! * @exception SQLException If an error occurs. ! */ ! public InputStream getBinaryStream() throws SQLException; ! /** ! * This method returns the index into the BLOB at which the first instance ! * of the specified bytes occur. The searching starts at the specified ! * index into the BLOB. ! * ! * @param pattern The byte pattern to search for. ! * @param offset The index into the BLOB to starting searching for the pattern. ! * @return The offset at which the pattern is first found, or -1 if the ! * pattern is not found. ! * @exception SQLException If an error occurs. ! */ ! public long position(byte[] pattern, long start) throws SQLException; ! /** ! * This method returns the index into the BLOB at which the first instance ! * of the specified pattern occurs. The searching starts at the specified ! * index into this BLOB. The bytes in the specified Blob are ! * used as the search pattern. ! * ! * @param pattern The Blob containing the byte pattern to ! * search for. ! * @param offset The index into the BLOB to starting searching for the pattern. ! * @return The offset at which the pattern is first found, or -1 if the ! * pattern is not found. ! * @exception SQLException If an error occurs. ! */ ! public long position(Blob pattern, long start) throws SQLException; ! /** ! * @exception SQLException If an error occurs. ! * @since 1.4 ! */ ! public int setBytes(long pos, byte[] bytes) throws SQLException; ! /** ! * @exception SQLException If an error occurs. ! * @since 1.4 ! */ ! public int setBytes(long pos, byte[] bytes, int offset, int len) ! throws SQLException; ! /** ! * @exception SQLException If an error occurs. ! * @since 1.4 ! */ ! public OutputStream setBinaryStream(long pos) throws SQLException; + /** + * @exception SQLException If an error occurs. + * @since 1.4 + */ + public void truncate(long len) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/CallableStatement.java gcc-3.3/libjava/java/sql/CallableStatement.java *** gcc-3.2.3/libjava/java/sql/CallableStatement.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/CallableStatement.java 2002-06-21 05:39:21.000000000 +0000 *************** *** 1,5 **** /* CallableStatement.java -- A statement for calling stored procedures. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* CallableStatement.java -- A statement for calling stored procedures. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,465 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.util.Calendar; import java.util.Map; /** ! * This interface provides a mechanism for calling stored procedures. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface CallableStatement extends PreparedStatement { ! /*************************************************************************/ ! /** ! * This method tests whether the value of the last parameter that was fetched ! * was actually a SQL NULL value. ! * ! * @return true if the last parameter fetched was a NULL, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! wasNull() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * String. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a String. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getString(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * Object. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as an Object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getObject(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * Object. ! * ! * @param index The index of the parameter to return. ! * @param map The mapping to use for conversion from SQL to Java types. ! * ! * @return The parameter value as an Object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getObject(int index, Map map) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * boolean. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a boolean. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! getBoolean(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * byte. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a byte. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte ! getByte(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * short. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a short. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract short ! getShort(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * int. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a int. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getInt(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * long. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a long. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! getLong(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * float. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a float. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract float ! getFloat(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * double. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a double. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract double ! getDouble(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * BigDecimal. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a BigDecimal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract BigDecimal ! getBigDecimal(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * BigDecimal. ! * ! * @param index The index of the parameter to return. ! * @param scale The number of digits to the right of the decimal to return. ! * ! * @return The parameter value as a BigDecimal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract BigDecimal ! getBigDecimal(int index, int scale) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * byte array. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a byte array ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte[] ! getBytes(int index) throws SQLException; - /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Date. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a java.sql.Date. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Date ! getDate(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Date. ! * ! * @param index The index of the parameter to return. ! * @param calendar The Calendar to use for timezone and locale. ! * ! * @return The parameter value as a java.sql.Date. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Date ! getDate(int index, Calendar calendar) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Time. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a java.sql.Time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Time ! getTime(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Time. ! * ! * @param index The index of the parameter to return. ! * @param calendar The Calendar to use for timezone and locale. ! * ! * @return The parameter value as a java.sql.Time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Time ! getTime(int index, Calendar calendar) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Timestamp. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Timestamp ! getTimestamp(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Timestamp. ! * ! * @param index The index of the parameter to return. ! * @param calendar The Calendar to use for timezone and locale. ! * ! * @return The parameter value as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Timestamp ! getTimestamp(int index, Calendar calendar) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * Ref. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a Ref. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Ref ! getRef(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * Blob. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a Blob. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Blob ! getBlob(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * Clob. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a Clob. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Clob ! getClob(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified parameter as a Java ! * Array. ! * ! * @param index The index of the parameter to return. ! * ! * @return The parameter value as a Array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Array ! getArray(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type. ! * ! * @param index The index of the parameter to register as output. ! * @param type The SQL type value from Types. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! registerOutParameter(int index, int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type. ! * ! * @param index The index of the parameter to register as output. ! * @param type The SQL type value from Types. ! * @param name The user defined data type name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! registerOutParameter(int index, int type, String name) throws SQLException; ! /*************************************************************************/ ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type and scale. ! * ! * @param index The index of the parameter to register as output. ! * @param type The SQL type value from Types. ! * @param scale The scale of the value that will be returned. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! registerOutParameter(int index, int type, int scale) throws SQLException; ! } // interface CallableStatement --- 35,651 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; + import java.net.URL; import java.util.Calendar; import java.util.Map; /** ! * This interface provides a mechanism for calling stored procedures. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface CallableStatement extends PreparedStatement { + /** + * This method registers the specified parameter as an output parameter + * of the specified SQL type. + * + * @param index The index of the parameter to register as output. + * @param type The SQL type value from Types. + * @exception SQLException If an error occurs. + */ + public void registerOutParameter(int parameterIndex, int sqlType) + throws SQLException; ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type and scale. ! * ! * @param index The index of the parameter to register as output. ! * @param type The SQL type value from Types. ! * @param scale The scale of the value that will be returned. ! * @exception SQLException If an error occurs. ! */ ! public void registerOutParameter(int parameterIndex, int sqlType, int scale) ! throws SQLException; ! /** ! * This method tests whether the value of the last parameter that was fetched ! * was actually a SQL NULL value. ! * ! * @return true if the last parameter fetched was a NULL, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean wasNull() throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * String. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a String. ! * @exception SQLException If an error occurs. ! */ ! public String getString(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * boolean. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a boolean. ! * @exception SQLException If an error occurs. ! */ ! public boolean getBoolean(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * byte. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a byte. ! * @exception SQLException If an error occurs. ! */ ! public byte getByte(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * short. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a short. ! * @exception SQLException If an error occurs. ! */ ! public short getShort(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * int. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a int. ! * @exception SQLException If an error occurs. ! */ ! public int getInt(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * long. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a long. ! * @exception SQLException If an error occurs. ! */ ! public long getLong(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * float. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a float. ! * @exception SQLException If an error occurs. ! */ ! public float getFloat(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * double. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a double. ! * @exception SQLException If an error occurs. ! */ ! public double getDouble(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * BigDecimal. ! * ! * @param parameterIndex The index of the parameter to return. ! * @param scale The number of digits to the right of the decimal to return. ! * @return The parameter value as a BigDecimal. ! * @exception SQLException If an error occurs. ! * @deprecated Use getBigDecimal(int parameterIndex) ! * or getBigDecimal(String parameterName) instead. ! */ ! public BigDecimal getBigDecimal(int parameterIndex, int scale) ! throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * byte array. ! * ! * @param parameterIndex The index of the parameter to return. ! * @return The parameter value as a byte array ! * @exception SQLException If an error occurs. ! */ ! public byte[] getBytes(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Date. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a java.sql.Date. ! * @exception SQLException If an error occurs. ! */ ! public Date getDate(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Time. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a java.sql.Time. ! * @exception SQLException If an error occurs. ! */ ! public Time getTime(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Timestamp. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a java.sql.Timestamp. ! * @exception SQLException If an error occurs. ! */ ! public Timestamp getTimestamp(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * Object. ! * ! * @param parameterIndex The index of the parameter to return. ! * @return The parameter value as an Object. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Object getObject(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * BigDecimal. ! * ! * @param parameterIndex The index of the parameter to return. ! * @return The parameter value as a BigDecimal. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public BigDecimal getBigDecimal(int parameterIndex) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * Object. ! * ! * @param index The index of the parameter to return. ! * @param map The mapping to use for conversion from SQL to Java types. ! * @return The parameter value as an Object. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Object getObject(int index, Map map) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * Ref. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a Ref. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Ref getRef(int index) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * Blob. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a Blob. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Blob getBlob(int index) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * Clob. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a Clob. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Clob getClob(int index) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * Array. ! * ! * @param parameterIndex The index of the parameter to return. ! * @return The parameter value as a Array. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Array getArray(int index) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Date. ! * ! * @param parameterIndex The index of the parameter to return. ! * @param cal The Calendar to use for timezone and locale. ! * @return The parameter value as a java.sql.Date. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Date getDate(int parameterIndex, Calendar cal) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Time. ! * ! * @param parameterIndex The index of the parameter to return. ! * @param cal The Calendar to use for timezone and locale. ! * @return The parameter value as a java.sql.Time. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Time getTime(int parameterIndex, Calendar cal) throws SQLException; ! /** ! * This method returns the value of the specified parameter as a Java ! * java.sql.Timestamp. ! * ! * @param index The index of the parameter to return. ! * @return The parameter value as a java.sql.Timestamp. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Timestamp getTimestamp(int parameterIndex, Calendar cal) ! throws SQLException; ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type. ! * ! * @param index The index of the parameter to register as output. ! * @param type The SQL type value from Types. ! * @param name The user defined data type name. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public void registerOutParameter(int paramIndex, int sqlType, ! String typeName) ! throws SQLException; ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type. ! * ! * @param parameterName The name of the parameter to register as output. ! * @param sqlType The SQL type value from Types. ! * @exception SQLException If an error occurs. ! * @since 1.4 ! */ ! public void registerOutParameter(String parameterName, int sqlType) ! throws SQLException; ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type. This version of registerOutParameter is used ! * for NUMERIC or DECIMAL types. ! * ! * @param parameterName The name of the parameter to register as output. ! * @param sqlType The SQL type value from Types. ! * @param scale Number of digits to the right of the decimal point. ! * @exception SQLException If an error occurs. ! * @since 1.4 ! */ ! public void registerOutParameter(String parameterName, int sqlType, ! int scale) ! throws SQLException; ! /** ! * This method registers the specified parameter as an output parameter ! * of the specified SQL type. This version of registerOutParameter is used ! * for user-named or REF types. If the type of the output parameter does ! * not have such a type, the typeName argument is ignored. ! * ! * @param parameterName The name of the parameter to register as output. ! * @param sqlType The SQL type value from Types. ! * @param typeName The SQL structured type name. ! * @exception SQLException If an error occurs. ! * @since 1.4 ! */ ! public void registerOutParameter(String parameterName, int sqlType, ! String typeName) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public URL getURL(int parameterIndex) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setURL(String parameterName, URL val) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setNull(String parameterName, int sqlType) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setBoolean(String parameterName, boolean x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setByte(String parameterName, byte x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setShort(String parameterName, short x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setInt(String parameterName, int x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setLong(String parameterName, long x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setFloat(String parameterName, float x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setDouble(String parameterName, double x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setBigDecimal(String parameterName, BigDecimal x) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setString(String parameterName, String x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setBytes(String parameterName, byte[] x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setDate(String parameterName, Date x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setTime(String parameterName, Time x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setTimestamp(String parameterName, Timestamp x) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setAsciiStream(String parameterName, InputStream x, int length) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setBinaryStream(String parameterName, InputStream x, int length) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setObject(String parameterName, Object x, int targetSqlType, ! int scale) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setObject(String parameterName, Object x, int targetSqlType) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setObject(String parameterName, Object x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setCharacterStream(String parameterName, Reader reader, ! int length) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setDate(String parameterName, Date x, Calendar cal) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setTime(String parameterName, Time x, Calendar cal) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setTimestamp(String parameterName, Timestamp x, Calendar cal) ! throws SQLException; + /** + * @since 1.4 + */ + public void setNull(String parameterName, int sqlType, String typeName) + throws SQLException; + /** + * @since 1.4 + */ + public String getString(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public boolean getBoolean(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public byte getByte(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public short getShort(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public int getInt(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public long getLong(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public float getFloat(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public double getDouble(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public byte[] getBytes(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Date getDate(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Time getTime(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Timestamp getTimestamp(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Object getObject(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public BigDecimal getBigDecimal(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Object getObject(String parameterName, Map map) throws SQLException; + + /** + * @since 1.4 + */ + public Ref getRef(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Blob getBlob(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Clob getClob(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Array getArray(String parameterName) throws SQLException; + + /** + * @since 1.4 + */ + public Date getDate(String parameterName, Calendar cal) throws SQLException; + + /** + * @since 1.4 + */ + public Time getTime(String parameterName, Calendar cal) throws SQLException; + + /** + * @since 1.4 + */ + public Timestamp getTimestamp(String parameterName, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public URL getURL(String parameterName) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Clob.java gcc-3.3/libjava/java/sql/Clob.java *** gcc-3.2.3/libjava/java/sql/Clob.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Clob.java 2002-06-21 05:39:21.000000000 +0000 *************** *** 1,5 **** /* Clob.java -- Access Character Large OBjects ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Clob.java -- Access Character Large OBjects ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,147 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; import java.io.Reader; /** ! * This interface contains methods for accessing a SQL CLOB (Character ! * Large OBject) type. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Clob { ! ! /** * This method returns the number of characters in the CLOB. * * @return The number of characters in the CLOB. - * - * @exception SQLException If an error occurs. - */ - public abstract long - length() throws SQLException; - - /*************************************************************************/ - - /** - * This method returns the specified portion of the CLOB as a - * String. - * - * @param offset The index into the CLOB (index values start at 1) to - * start returning characters from. - * @param length The requested number of characters to return. - * - * @return The requested CLOB section, as a String. - * * @exception SQLException If an error occurs. */ ! public abstract String ! getSubString(long offset, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a byte stream that reads the contents of the ! * CLOB as a series of ASCII bytes. ! * ! * @return A stream to read the CLOB's contents. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getAsciiStream() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a character stream that reads the contents of the ! * CLOB. ! * ! * @return A character stream to read the CLOB's contents. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Reader ! getCharacterStream() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the index into the CLOB of the first occurrence of ! * the specified character pattern (supplied by the caller as a ! * String). The search begins at the specified index. ! * ! * @param pattern The character pattern to search for, passed as a ! * String. ! * @param offset. The index into the CLOB to start search (indexes start ! * at 1). ! * ! * @return The index at which the pattern was found (indexes start at 1), ! * or -1 if the pattern was not found. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! position(String pattern, long offset) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the index into the CLOB of the first occurrence of ! * the specified character pattern (supplied by the caller as a ! * Clob). The search begins at the specified index. ! * ! * @param pattern The character pattern to search for, passed as a ! * Clob. ! * @param offset. The index into the CLOB to start search (indexes start ! * at 1). ! * ! * @return The index at which the pattern was found (indexes start at 1), ! * or -1 if the pattern was not found. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! position(Clob pattern, long offset) throws SQLException; ! } // interface Clob --- 35,152 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; import java.io.InputStream; + import java.io.OutputStream; import java.io.Reader; + import java.io.Writer; /** ! * This interface contains methods for accessing a SQL CLOB (Character ! * Large OBject) type. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Clob { ! /** * This method returns the number of characters in the CLOB. * * @return The number of characters in the CLOB. * @exception SQLException If an error occurs. + * @since 1.2 */ ! public long length() throws SQLException; ! /** ! * This method returns the specified portion of the CLOB as a ! * String. ! * ! * @param offset The index into the CLOB (index values start at 1) to ! * start returning characters from. ! * @param length The requested number of characters to return. ! * @return The requested CLOB section, as a String. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public String getSubString(long pos, int length) throws SQLException; ! /** ! * This method returns a character stream that reads the contents of the ! * CLOB. ! * ! * @return A character stream to read the CLOB's contents. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public Reader getCharacterStream() throws SQLException; ! /** ! * This method returns a byte stream that reads the contents of the ! * CLOB as a series of ASCII bytes. ! * ! * @return A stream to read the CLOB's contents. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public InputStream getAsciiStream() throws SQLException; ! /** ! * This method returns the index into the CLOB of the first occurrence of ! * the specified character pattern (supplied by the caller as a ! * String). The search begins at the specified index. ! * ! * @param searchstr The character pattern to search for, passed as a ! * String. ! * @param start. The index into the CLOB to start search (indexes start ! * at 1). ! * @return The index at which the pattern was found (indexes start at 1), ! * or -1 if the pattern was not found. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public long position(String searchstr, long start) throws SQLException; ! /** ! * This method returns the index into the CLOB of the first occurrence of ! * the specified character pattern (supplied by the caller as a ! * Clob). The search begins at the specified index. ! * ! * @param searchstr The character pattern to search for, passed as a ! * Clob. ! * @param start. The index into the CLOB to start search (indexes start ! * at 1). ! * @return The index at which the pattern was found (indexes start at 1), ! * or -1 if the pattern was not found. ! * @exception SQLException If an error occurs. ! * @since 1.2 ! */ ! public long position(Clob searchstr, long start) throws SQLException; ! /** ! * @since 1.4 ! */ ! public int setString(long pos, String str) throws SQLException; ! /** ! * @since 1.4 ! */ ! public int setString(long pos, String str, int offset, int len) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public OutputStream setAsciiStream(long pos) throws SQLException; ! /** ! * @since 1.4 ! */ ! public Writer setCharacterStream(long pos) throws SQLException; + /** + * @since 1.4 + */ + public void truncate(long len) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Connection.java gcc-3.3/libjava/java/sql/Connection.java *** gcc-3.2.3/libjava/java/sql/Connection.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Connection.java 2002-06-21 05:39:21.000000000 +0000 *************** *** 1,5 **** /* Connection.java -- Manage a database connection. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Connection.java -- Manage a database connection. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.sql; *** 41,462 **** import java.util.Map; /** ! * This interface provides methods for managing a connection to a database. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Connection { ! /** ! * This transaction isolation level indicates that transactions are not ! * supported. ! */ ! public static final int TRANSACTION_NONE = 0; ! ! /** ! * This transaction isolation level indicates that one transaction can ! * read modifications by other transactions before the other transactions ! * have committed their changes. This could result in invalid reads. ! */ ! public static final int TRANSACTION_READ_UNCOMMITTED = 1; ! ! /** ! * This transaction isolation leve indicates that only committed data from ! * other transactions will be read. If a transaction reads a row, then ! * another transaction commits a change to that row, the first transaction ! * would retrieve the changed row on subsequent reads of the same row. ! */ ! public static final int TRANSACTION_READ_COMMITTED = 2; ! ! /** ! * This transaction isolation level indicates that only committed data from ! * other transactions will be read. It also ensures that data read from ! * a row will not be different on a subsequent read even if another ! * transaction commits a change. ! */ ! public static final int TRANSACTION_REPEATABLE_READ = 4; ! ! /** ! * This transaction isolation level indicates that only committed data from ! * other transactions will be read. It also ensures that data read from ! * a row will not be different on a subsequent read even if another ! * transaction commits a change. Additionally, rows modified by other ! * transactions will not affect the result set returned during subsequent ! * executions of the same WHERE clause in this transaction. ! */ ! public static final int TRANSACTION_SERIALIZABLE = 8; ! ! /*************************************************************************/ ! ! /** ! * This method creates a new SQL statement. The default result set type ! * and concurrency will be used. ! * ! * @return A new Statement object. ! * ! * @exception SQLException If an error occurs. ! * ! * @see Statement ! */ ! public abstract Statement ! createStatement() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method creates a new SQL statement with the specified type and ! * concurrency. Valid values for these parameters are specified in the ! * ResultSet class. ! * ! * @param resultSetType The type of result set to use for this statement. ! * @param resultSetConcurrency. The type of concurrency to be used in ! * the result set for this statement. ! * ! * @return A new Statement object. ! * ! * @exception SQLException If an error occurs. ! * ! * @see Statement ! * @see ResultSet ! */ ! public abstract Statement ! createStatement(int resultSetType, int resultSetConcurrency) ! throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method creates a new PreparedStatement for the specified ! * SQL string. This method is designed for use with parameterized ! * statements. The default result set type and concurrency will be used. ! * ! * @param The SQL statement to use in creating this ! * PreparedStatement. ! * ! * @return A new PreparedStatement. ! * ! * @exception SQLException If an error occurs. ! * ! * @see PreparedStatement ! */ ! public abstract PreparedStatement ! prepareStatement(String sql) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method creates a new PreparedStatement for the specified ! * SQL string. This method is designed for use with parameterized ! * statements. The specified result set type and concurrency will be used. ! * Valid values for these parameters are specified in the ! * ResultSet class. ! * ! * @param The SQL statement to use in creating this ! * PreparedStatement. ! * @param resultSetType The type of result set to use for this statement. ! * @param resultSetConcurrency. The type of concurrency to be used in ! * the result set for this statement. ! * ! * @return A new PreparedStatement. ! * ! * @exception SQLException If an error occurs. ! * ! * @see PreparedStatement ! * @see ResultSet ! */ ! public abstract PreparedStatement ! prepareStatement(String sql, int resultSetType, int resultSetConcurrency) ! throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method creates a new CallableStatement for the ! * specified SQL string. Thie method is designed to be used with ! * stored procedures. The default result set type and concurrency ! * will be used. ! * ! * @param The SQL statement to use in creating this ! * CallableStatement. ! * ! * @return A new CallableStatement. ! * ! * @exception SQLException If an error occurs. ! * ! * @see CallableStatement ! */ ! public abstract CallableStatement ! prepareCall(String sql) throws SQLException; ! /*************************************************************************/ ! /** ! * This method creates a new CallableStatement for the ! * specified SQL string. Thie method is designed to be used with ! * stored procedures. The specified result set type and concurrency ! * will be used. Valid values for these parameters are specified in the ! * ResultSet class. ! * ! * @param The SQL statement to use in creating this ! * PreparedStatement. ! * @param resultSetType The type of result set to use for this statement. ! * @param resultSetConcurrency. The type of concurrency to be used in ! * the result set for this statement. ! * ! * @return A new CallableStatement. ! * ! * @exception SQLException If an error occurs. ! * ! * @see CallableStatement ! * @see ResultSet ! */ ! public abstract CallableStatement ! prepareCall(String sql, int resultSetType, int resultSetConcurrency) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method converts the specified generic SQL statement into the ! * native grammer of the database this object is connected to. ! * ! * @param The JDBC generic SQL statement. ! * ! * @return The native SQL statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! nativeSQL(String sql) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not auto commit mode is currently enabled. ! * In auto commit mode, every SQL statement is committed its own transaction. ! * Otherwise a transaction must be explicitly committed or rolled back. ! * ! * @return true if auto commit mode is enabled, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see commit ! * @see rollback ! */ ! public abstract boolean ! getAutoCommit() throws SQLException; ! /*************************************************************************/ ! /** ! * This method turns auto commit mode on or off. In auto commit mode, ! * every SQL statement is committed its own transaction. Otherwise a ! * transaction must be explicitly committed or rolled back. ! * ! * @param autoCommit true to enable auto commit mode, ! * false to disable it. ! * ! * @exception SQLException If an error occurs. ! * ! * @see commit ! * @see rollback ! */ ! public abstract void ! setAutoCommit(boolean autoCommit) throws SQLException; ! /*************************************************************************/ ! /** * This method commits any SQL statements executed on this connection since * the last commit or rollback. * * @exception SQLException If an error occurs. */ ! public abstract void ! commit() throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method rolls back any SQL statements executed on this connection ! * since the last commit or rollback. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! rollback() throws SQLException; ! /*************************************************************************/ ! /** ! * This method immediately closes this database connection. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! close() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not this connection has been closed. ! * ! * @return true if the connection is closed, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isClosed() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the meta data for this database connection. ! * ! * @return The meta data for this database. ! * ! * @exception SQLException If an error occurs. ! * ! * @see DatabaseMetaData ! */ ! public abstract DatabaseMetaData ! getMetaData() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not this connection is in read only mode. ! * ! * @return true if the connection is read only false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isReadOnly() throws SQLException; ! /*************************************************************************/ ! /** ! * This method turns read only mode on or off. It may not be called while ! * a transaction is in progress. ! * ! * @param readOnly true if this connection is read only, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setReadOnly(boolean readOnly) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the name of the catalog in use by this connection, ! * if any. ! * ! * @return The name of the catalog, or null if one does not ! * exist or catalogs are not supported by this database. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getCatalog() throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the name of the catalog in use by this connection. ! * Note that this method does nothing if catalogs are not supported by ! * this database. ! * ! * @param catalog The name of the catalog to use for this connection. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setCatalog(String catalog) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the current transaction isolation mode. This will ! * be one of the constants defined in this interface. ! * ! * @return The transaction isolation level. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getTransactionIsolation() throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the current transaction isolation mode. This must ! * be one of the constants defined in this interface. ! * ! * @param level The transaction isolation level. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setTransactionIsolation(int level) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the first warning that occurred on this connection, ! * if any. If there were any subsequence warnings, they will be chained ! * to the first one. ! * ! * @return The first SQLWarning that occurred, or ! * null if there have been no warnings. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract SQLWarning ! getWarnings() throws SQLException; ! /*************************************************************************/ ! /** ! * This method clears all warnings that have occurred on this connection. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! clearWarnings() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the mapping of SQL types to Java classes ! * currently in use by this connection. This mapping will have no ! * entries unless they have been manually added. ! * ! * @return The SQL type to Java class mapping. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Map ! getTypeMap() throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the mapping table for SQL types to Java classes. ! * Any entries in this map override the defaults. ! * ! * @param map The new SQL mapping table. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setTypeMap(Map map) throws SQLException; ! } // interface Connection --- 41,420 ---- import java.util.Map; /** ! * This interface provides methods for managing a connection to a database. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Connection { + /** + * This transaction isolation level indicates that transactions are not + * supported. + */ + public static final int TRANSACTION_NONE = 0; ! /** ! * This transaction isolation level indicates that one transaction can ! * read modifications by other transactions before the other transactions ! * have committed their changes. This could result in invalid reads. ! */ ! public static final int TRANSACTION_READ_UNCOMMITTED = 1; ! /** ! * This transaction isolation leve indicates that only committed data from ! * other transactions will be read. If a transaction reads a row, then ! * another transaction commits a change to that row, the first transaction ! * would retrieve the changed row on subsequent reads of the same row. ! */ ! public static final int TRANSACTION_READ_COMMITTED = 2; ! /** ! * This transaction isolation level indicates that only committed data from ! * other transactions will be read. It also ensures that data read from ! * a row will not be different on a subsequent read even if another ! * transaction commits a change. ! */ ! public static final int TRANSACTION_REPEATABLE_READ = 4; ! /** ! * This transaction isolation level indicates that only committed data from ! * other transactions will be read. It also ensures that data read from ! * a row will not be different on a subsequent read even if another ! * transaction commits a change. Additionally, rows modified by other ! * transactions will not affect the result set returned during subsequent ! * executions of the same WHERE clause in this transaction. ! */ ! public static final int TRANSACTION_SERIALIZABLE = 8; ! /** ! * This method creates a new SQL statement. The default result set type ! * and concurrency will be used. ! * ! * @return A new Statement object. ! * @exception SQLException If an error occurs. ! * @see Statement ! */ ! public Statement createStatement() throws SQLException; ! /** ! * This method creates a new PreparedStatement for the specified ! * SQL string. This method is designed for use with parameterized ! * statements. The default result set type and concurrency will be used. ! * ! * @param The SQL statement to use in creating this ! * PreparedStatement. ! * @return A new PreparedStatement. ! * @exception SQLException If an error occurs. ! * @see PreparedStatement ! */ ! public PreparedStatement prepareStatement(String sql) throws SQLException; ! /** ! * This method creates a new CallableStatement for the ! * specified SQL string. Thie method is designed to be used with ! * stored procedures. The default result set type and concurrency ! * will be used. ! * ! * @param The SQL statement to use in creating this ! * CallableStatement. ! * @return A new CallableStatement. ! * @exception SQLException If an error occurs. ! * @see CallableStatement ! */ ! public CallableStatement prepareCall(String sql) throws SQLException; ! /** ! * This method converts the specified generic SQL statement into the ! * native grammer of the database this object is connected to. ! * ! * @param The JDBC generic SQL statement. ! * @return The native SQL statement. ! * @exception SQLException If an error occurs. ! */ ! public String nativeSQL(String sql) throws SQLException; ! /** ! * This method turns auto commit mode on or off. In auto commit mode, ! * every SQL statement is committed its own transaction. Otherwise a ! * transaction must be explicitly committed or rolled back. ! * ! * @param autoCommit true to enable auto commit mode, ! * false to disable it. ! * @exception SQLException If an error occurs. ! * @see commit ! * @see rollback ! */ ! public void setAutoCommit(boolean autoCommit) throws SQLException; ! /** ! * This method tests whether or not auto commit mode is currently enabled. ! * In auto commit mode, every SQL statement is committed its own transaction. ! * Otherwise a transaction must be explicitly committed or rolled back. ! * ! * @return true if auto commit mode is enabled, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see commit ! * @see rollback ! */ ! public boolean getAutoCommit() throws SQLException; ! /** * This method commits any SQL statements executed on this connection since * the last commit or rollback. * * @exception SQLException If an error occurs. */ ! public void commit() throws SQLException; ! /** ! * This method rolls back any SQL statements executed on this connection ! * since the last commit or rollback. ! * ! * @exception SQLException If an error occurs. ! */ ! public void rollback() throws SQLException; ! /** ! * This method immediately closes this database connection. ! * ! * @exception SQLException If an error occurs. ! */ ! public void close() throws SQLException; ! /** ! * This method tests whether or not this connection has been closed. ! * ! * @return true if the connection is closed, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isClosed() throws SQLException; ! /** ! * This method returns the meta data for this database connection. ! * ! * @return The meta data for this database. ! * @exception SQLException If an error occurs. ! * @see DatabaseMetaData ! */ ! public DatabaseMetaData getMetaData() throws SQLException; ! /** ! * This method turns read only mode on or off. It may not be called while ! * a transaction is in progress. ! * ! * @param readOnly true if this connection is read only, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public void setReadOnly(boolean readOnly) throws SQLException; ! /** ! * This method tests whether or not this connection is in read only mode. ! * ! * @return true if the connection is read only false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isReadOnly() throws SQLException; ! /** ! * This method sets the name of the catalog in use by this connection. ! * Note that this method does nothing if catalogs are not supported by ! * this database. ! * ! * @param catalog The name of the catalog to use for this connection. ! * @exception SQLException If an error occurs. ! */ ! public void setCatalog(String catalog) throws SQLException; ! /** ! * This method returns the name of the catalog in use by this connection, ! * if any. ! * ! * @return The name of the catalog, or null if one does not ! * exist or catalogs are not supported by this database. ! * @exception SQLException If an error occurs. ! */ ! public String getCatalog() throws SQLException; ! /** ! * This method sets the current transaction isolation mode. This must ! * be one of the constants defined in this interface. ! * ! * @param level The transaction isolation level. ! * @exception SQLException If an error occurs. ! */ ! public void setTransactionIsolation(int level) throws SQLException; ! /** ! * This method returns the current transaction isolation mode. This will ! * be one of the constants defined in this interface. ! * ! * @return The transaction isolation level. ! * @exception SQLException If an error occurs. ! */ ! public int getTransactionIsolation() throws SQLException; ! /** ! * This method returns the first warning that occurred on this connection, ! * if any. If there were any subsequence warnings, they will be chained ! * to the first one. ! * ! * @return The first SQLWarning that occurred, or ! * null if there have been no warnings. ! * @exception SQLException If an error occurs. ! */ ! public SQLWarning getWarnings() throws SQLException; ! /** ! * This method clears all warnings that have occurred on this connection. ! * ! * @exception SQLException If an error occurs. ! */ ! public void clearWarnings() throws SQLException; ! /** ! * This method creates a new SQL statement with the specified type and ! * concurrency. Valid values for these parameters are specified in the ! * ResultSet class. ! * ! * @param resultSetType The type of result set to use for this statement. ! * @param resultSetConcurrency. The type of concurrency to be used in ! * the result set for this statement. ! * @return A new Statement object. ! * @exception SQLException If an error occurs. ! * @see Statement ! * @see ResultSet ! */ ! public Statement createStatement(int resultSetType, int resultSetConcurrency) ! throws SQLException; ! /** ! * This method creates a new PreparedStatement for the specified ! * SQL string. This method is designed for use with parameterized ! * statements. The specified result set type and concurrency will be used. ! * Valid values for these parameters are specified in the ! * ResultSet class. ! * ! * @param The SQL statement to use in creating this ! * PreparedStatement. ! * @param resultSetType The type of result set to use for this statement. ! * @param resultSetConcurrency. The type of concurrency to be used in ! * the result set for this statement. ! * @return A new PreparedStatement. ! * @exception SQLException If an error occurs. ! * @see PreparedStatement ! * @see ResultSet ! */ ! public PreparedStatement prepareStatement(String sql, int resultSetType, ! int resultSetConcurrency) throws SQLException; ! /** ! * This method creates a new CallableStatement for the ! * specified SQL string. Thie method is designed to be used with ! * stored procedures. The specified result set type and concurrency ! * will be used. Valid values for these parameters are specified in the ! * ResultSet class. ! * ! * @param The SQL statement to use in creating this ! * PreparedStatement. ! * @param resultSetType The type of result set to use for this statement. ! * @param resultSetConcurrency. The type of concurrency to be used in ! * the result set for this statement. ! * @return A new CallableStatement. ! * @exception SQLException If an error occurs. ! * @see CallableStatement ! * @see ResultSet ! */ ! public CallableStatement prepareCall(String sql, int resultSetType, int ! resultSetConcurrency) throws SQLException; ! /** ! * This method returns the mapping of SQL types to Java classes ! * currently in use by this connection. This mapping will have no ! * entries unless they have been manually added. ! * ! * @return The SQL type to Java class mapping. ! * @exception SQLException If an error occurs. ! */ ! public Map getTypeMap() throws SQLException; ! /** ! * This method sets the mapping table for SQL types to Java classes. ! * Any entries in this map override the defaults. ! * ! * @param map The new SQL mapping table. ! * @exception SQLException If an error occurs. ! */ ! public void setTypeMap(Map map) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setHoldability(int holdability) throws SQLException; ! /** ! * @since 1.4 ! */ ! public int getHoldability() throws SQLException; ! /** ! * @since 1.4 ! */ ! public Savepoint setSavepoint() throws SQLException; ! /** ! * @since 1.4 ! */ ! public Savepoint setSavepoint(String name) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void rollback(Savepoint savepoint) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void releaseSavepoint(Savepoint savepoint) throws SQLException; ! /** ! * @since 1.4 ! */ ! public Statement createStatement(int resultSetType, int ! resultSetConcurrency, int resultSetHoldability) throws SQLException; ! /** ! * @since 1.4 ! */ ! public PreparedStatement prepareStatement(String sql, int resultSetType, int ! resultSetConcurrency, int resultSetHoldability) throws SQLException; ! /** ! * @since 1.4 ! */ ! public CallableStatement prepareCall(String sql, int resultSetType, int ! resultSetConcurrency, int resultSetHoldability) throws SQLException; ! /** ! * @since 1.4 ! */ ! public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public PreparedStatement prepareStatement(String sql, int[] columnIndexes) ! throws SQLException; + /** + * @since 1.4 + */ + public PreparedStatement prepareStatement(String sql, String[] columnNames) + throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/DatabaseMetaData.java gcc-3.3/libjava/java/sql/DatabaseMetaData.java *** gcc-3.2.3/libjava/java/sql/DatabaseMetaData.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/DatabaseMetaData.java 2002-06-21 05:39:22.000000000 +0000 *************** *** 1,5 **** /* DatabaseMetaData.java -- Information about the database itself. ! Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* DatabaseMetaData.java -- Information about the database itself. ! Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,2747 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; ! /** ! * This interface provides a mechanism for obtaining information about ! * the database itself, as opposed to data in it. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface DatabaseMetaData { ! /** ! * The best row may or may not be a pseudo-column. ! */ ! public static final int bestRowUnknown = 0; ! ! /** ! * The best row identifier is not a pseudo-column. ! */ ! public static final int bestRowNotPseudo = 1; ! ! /** ! * The best row identifier is a pseudo-column. ! */ ! public static final int bestRowPseudo = 2; ! ! /** ! * The best row's scope is only guaranteed to be valid so long as the ! * row is actually being used. ! */ ! public static final int bestRowTemporary = 0; ! ! /** ! * The best row identifier is valid to the end of the transaction. ! */ ! public static final int bestRowTransaction = 1; ! ! /** ! * The best row identifier is valid to the end of the session. ! */ ! public static final int bestRowSession = 2; ! ! /** ! * It is unknown whether or not the procedure returns a result. ! */ ! public static final int procedureResultUnknown = 0; ! ! /** ! * The procedure does not return a result. ! */ ! public static final int procedureNoResult = 1; ! ! /** ! * The procedure returns a result. ! */ ! public static final int procedureReturnsResult = 2; ! ! /** ! * The column type is unknown. ! */ ! public static final int procedureColumnUnknown = 0; ! ! /** ! * The column type is input. ! */ ! public static final int procedureColumnIn = 1; ! ! /** ! * The column type is input/output. ! */ ! public static final int procedureColumnInOut = 2; ! ! /** ! * The column type is output ! */ ! public static final int procedureColumnOut = 4; ! ! /** ! * The column is used for return values. ! */ ! public static final int procedureColumnReturn = 5; ! ! /** ! * The column is used for storing results ! */ ! public static final int procedureColumnResult = 3; ! ! /** ! * NULL values are not allowed. ! */ ! public static final int procedureNoNulls = 0; ! ! /** ! * NULL values are allowed. ! */ ! public static final int procedureNullable = 1; ! ! /** ! * It is unknown whether or not NULL values are allowed. ! */ ! public static final int procedureNullableUnknown = 2; ! ! /** ! * The column does not allow NULL ! */ ! public static final int columnNoNulls = 0; ! ! /** ! * The column does allow NULL ! */ ! public static final int columnNullable = 1; ! ! /** ! * It is unknown whether or not the column allows NULL ! */ ! public static final int columnNullableUnknown = 2; ! ! /** ! * It is unknown whether or not the version column is a pseudo-column. ! */ ! public static final int versionColumnUnknown = 0; ! ! /** ! * The version column is not a pseudo-column ! */ ! public static final int versionColumnNotPseudo = 1; ! ! /** ! * The version column is a pseudo-column ! */ ! public static final int versionColumnPseudo = 2; ! ! /** ! * Foreign key changes are cascaded in updates or deletes. ! */ ! public static final int importedKeyCascade = 0; ! ! /** ! * Column may not be updated or deleted in use as a foreign key. ! */ ! public static final int importedKeyRestrict = 1; ! ! /** ! * When primary key is updated or deleted, the foreign key is set to NULL. ! */ ! public static final int importedKeySetNull = 2; ! ! /** ! * If the primary key is a foreign key, it cannot be udpated or deleted. ! */ ! public static final int importedKeyNoAction = 3; ! ! /** ! * If the primary key is updated or deleted, the foreign key is set to ! * a default value. ! */ ! public static final int importedKeySetDefault = 4; ! ! /** ! * Wish I knew what this meant. ! */ ! public static final int importedKeyInitiallyDeferred = 5; ! ! /** ! * Wish I knew what this meant. ! */ ! public static final int importedKeyInitiallyImmediate = 6; ! ! /** ! * Wish I knew what this meant. ! */ ! public static final int importedKeyNotDeferrable = 7; ! ! /** ! * A NULL value is not allowed for this data type. ! */ ! public static final int typeNoNulls = 0; ! ! /** ! * A NULL value is allowed for this data type. ! */ ! public static final int typeNullable = 1; ! ! /** ! * It is unknown whether or not NULL values are allowed for this data type. ! */ ! public static final int typeNullableUnknown = 2; ! ! /** ! * Where clauses are not supported for this type. ! */ ! public static final int typePredNone = 0; ! ! /** ! * Only "WHERE..LIKE" style WHERE clauses are allowed on this data type. ! */ ! public static final int typePredChar = 1; ! ! /** ! * All WHERE clauses except "WHERE..LIKE" style are allowed on this data type. ! */ ! public static final int typePredBasic = 2; ! ! /** ! * Any type of WHERE clause is allowed for this data type. ! */ ! public static final int typeSearchable = 3; ! ! /** ! * This column contains table statistics. ! */ ! public static final short tableIndexStatistic = 0; ! ! /** ! * This table index is clustered. ! */ ! public static final short tableIndexClustered = 1; ! ! /** ! * This table index is hashed. ! */ ! public static final short tableIndexHashed = 2; ! ! /** ! * This table index is of another type. ! */ ! public static final short tableIndexOther = 3; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not all the procedures returned by ! * the getProcedures method can be called by this user. ! * ! * @return true if all the procedures can be called, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! allProceduresAreCallable() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not all the table returned by the ! * getTables method can be selected by this user. ! * ! * @return true if all the procedures can be called, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! allTablesAreSelectable() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the URL for this database. ! * ! * @return The URL string for this database, or null if it ! * is not known. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getURL() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the database username for this connection. ! * ! * @return The database username. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getUserName() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database is in read only mode. ! * ! * @return true if the database is in read only mode, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isReadOnly() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not NULL's sort as high values. ! * ! * @return true if NULL's sort as high values, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! nullsAreSortedHigh() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not NULL's sort as low values. ! * ! * @return true if NULL's sort as low values, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! nullsAreSortedLow() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method test whether or not NULL's are sorted to the beginning ! * of the list regardless of ascending or descending sort order. ! * ! * @return true if NULL's always sort to the beginning, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! nullsAreSortedAtStart() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method test whether or not NULL's are sorted to the end ! * of the list regardless of ascending or descending sort order. ! * ! * @return true if NULL's always sort to the end, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! nullsAreSortedAtEnd() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the name of the database product. ! * ! * @return The database product. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getDatabaseProductName() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the version of the database product. ! * ! * @return The version of the database product. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getDatabaseProductVersion() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the name of the JDBC driver. ! * ! * @return The name of the JDBC driver. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getDriverName() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the version of the JDBC driver. ! * ! * @return The version of the JDBC driver. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getDriverVersion() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the major version number of the JDBC driver. ! * ! * @return The major version number of the JDBC driver. ! */ ! public abstract int ! getDriverMajorVersion(); ! ! /*************************************************************************/ ! ! /** ! * This method returns the minor version number of the JDBC driver. ! * ! * @return The minor version number of the JDBC driver. ! */ ! public abstract int ! getDriverMinorVersion(); ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database uses local files to ! * store tables. ! * ! * @return true if the database uses local files, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! usesLocalFiles() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database uses a separate file for ! * each table. ! * ! * @return true if the database uses a separate file for each ! * table false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! usesLocalFilePerTable() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database supports identifiers ! * with mixed case. ! * ! * @return true if the database supports mixed case identifiers, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsMixedCaseIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database treats mixed case ! * identifiers as all upper case. ! * ! * @exception true if the database treats all identifiers as ! * upper case, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! storesUpperCaseIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database treats mixed case ! * identifiers as all lower case. ! * ! * @exception true if the database treats all identifiers as ! * lower case, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! storesLowerCaseIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database stores mixed case ! * identifers even if it treats them as case insensitive. ! * ! * @return true if the database stores mixed case identifiers, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! storesMixedCaseIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database supports quoted identifiers ! * with mixed case. ! * ! * @return true if the database supports mixed case quoted ! * identifiers, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsMixedCaseQuotedIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database treats mixed case ! * quoted identifiers as all upper case. ! * ! * @exception true if the database treats all quoted identifiers ! * as upper case, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! storesUpperCaseQuotedIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database treats mixed case ! * quoted identifiers as all lower case. ! * ! * @exception true if the database treats all quoted identifiers ! * as lower case, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! storesLowerCaseQuotedIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database stores mixed case ! * quoted identifers even if it treats them as case insensitive. ! * ! * @return true if the database stores mixed case quoted ! * identifiers, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! storesMixedCaseQuotedIdentifiers() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This metohd returns the quote string for SQL identifiers. ! * ! * @return The quote string for SQL identifers, or a space if quoting ! * is not supported. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getIdentifierQuoteString() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a comma separated list of all the SQL keywords in ! * the database that are not in SQL92. ! * ! * @return The list of SQL keywords not in SQL92. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getSQLKeywords() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a comma separated list of math functions. ! * ! * @return The list of math functions. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getNumericFunctions() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a comma separated list of string functions. ! * ! * @return The list of string functions. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getStringFunctions() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a comma separated list of of system functions. ! * ! * @return A comma separated list of system functions. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getSystemFunctions() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns comma separated list of time/date functions. ! * ! * @return The list of time/date functions. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getTimeDateFunctions() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the string used to escape wildcards in search strings. ! * ! * @return The string used to escape wildcards in search strings. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getSearchStringEscape() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This methods returns non-standard characters that can appear in ! * unquoted identifiers. ! * ! * @return Non-standard characters that can appear in unquoted identifiers. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getExtraNameCharacters() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database supports ! * "ALTER TABLE ADD COLUMN" ! * ! * @return true if column add supported, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsAlterTableWithAddColumn() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the database supports ! * "ALTER TABLE DROP COLUMN" ! * ! * @return true if column drop supported, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsAlterTableWithDropColumn() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not column aliasing is supported. ! * ! * @return true if column aliasing is supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsColumnAliasing() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether the concatenation of a NULL and non-NULL ! * value results in a NULL. This will always be true in fully JDBC compliant ! * drivers. ! * ! * @return true if concatenating NULL and a non-NULL value ! * returns a NULL, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! nullPlusNonNullIsNull() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * Tests whether or not CONVERT is supported. ! * ! * @return true if CONVERT is supported, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsConvert() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not CONVERT can be performed between the ! * specified types. The types are contants from Types. ! * ! * @param fromType The SQL type to convert from. ! * @param toType The SQL type to convert to. ! * ! * @return true if the conversion can be performed, ! * false otherwise. ! * ! * @see Types ! */ ! public abstract boolean ! supportsConvert(int fromType, int toType) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not table correlation names are ! * supported. This will be always be true in a fully JDBC ! * compliant driver. ! * ! * @return true if table correlation names are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsTableCorrelationNames() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether correlation names must be different from the ! * name of the table. ! * ! * @return true if the correlation name must be different from ! * the table name, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsDifferentTableCorrelationNames() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not expressions are allowed in an ! * ORDER BY lists. ! * ! * @return true if expressions are allowed in ORDER BY ! * lists, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsExpressionsInOrderBy() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or ORDER BY on a non-selected column is ! * allowed. ! * ! * @return true if a non-selected column can be used in an ! * ORDER BY, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsOrderByUnrelated() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not GROUP BY is supported. ! * ! * @return true if GROUP BY is supported, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsGroupBy() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether GROUP BY on a non-selected column is ! * allowed. ! * ! * @return true if a non-selected column can be used in a ! * GROUP BY, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsGroupByUnrelated() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not a GROUP BY can add columns not in the ! * select if it includes all the columns in the select. ! * ! * @return true if GROUP BY an add columns provided it includes ! * all columns in the select, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsGroupByBeyondSelect() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the escape character is supported in ! * LIKE expressions. A fully JDBC compliant driver will always return ! * true. ! * ! * @return true if escapes are supported in LIKE expressions, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean supportsLikeEscapeClause() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether multiple result sets for a single statement are ! * supported. ! * ! * @return true if multiple result sets are supported for a ! * single statement, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsMultipleResultSets() throws SQLException; ! /*************************************************************************/ ! /** ! * This method test whether or not multiple transactions may be open ! * at once, as long as they are on different connections. ! * ! * @return true if multiple transactions on different ! * connections are supported, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsMultipleTransactions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not columns can be defined as NOT NULL. A ! * fully JDBC compliant driver always returns true. ! * ! * @return true if NOT NULL columns are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsNonNullableColumns() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the minimum grammer for ODBC is supported. ! * A fully JDBC compliant driver will always return true. ! * ! * @return true if the ODBC minimum grammar is supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsMinimumSQLGrammar() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the core grammer for ODBC is supported. ! * ! * @return true if the ODBC core grammar is supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsCoreSQLGrammar() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the extended grammer for ODBC is supported. ! * ! * @return true if the ODBC extended grammar is supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsExtendedSQLGrammar() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the ANSI92 entry level SQL ! * grammar is supported. A fully JDBC compliant drivers must return ! * true. ! * ! * @return true if the ANSI92 entry level SQL grammar is ! * supported, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsANSI92EntryLevelSQL() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the ANSI92 intermediate SQL ! * grammar is supported. ! * ! * @return true if the ANSI92 intermediate SQL grammar is ! * supported, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsANSI92IntermediateSQL() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the ANSI92 full SQL ! * grammar is supported. ! * ! * @return true if the ANSI92 full SQL grammar is ! * supported, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsANSI92FullSQL() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the SQL integrity enhancement ! * facility is supported. ! * ! * @return true if the integrity enhancement facility is ! * supported, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsIntegrityEnhancementFacility() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports outer joins. ! * ! * @return true if outer joins are supported, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsOuterJoins() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports full outer joins. ! * ! * @return true if full outer joins are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsFullOuterJoins() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports limited outer joins. ! * ! * @return true if limited outer joins are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsLimitedOuterJoins() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the vendor's term for "schema". ! * ! * @return The vendor's term for schema. ! * ! * @exception SQLException if an error occurs. ! */ ! public abstract String ! getSchemaTerm() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the vendor's term for "procedure". ! * ! * @return The vendor's term for procedure. ! * ! * @exception SQLException if an error occurs. ! */ ! public abstract String ! getProcedureTerm() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the vendor's term for "catalog". ! * ! * @return The vendor's term for catalog. ! * ! * @exception SQLException if an error occurs. ! */ ! public abstract String ! getCatalogTerm() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name appears at the beginning of ! * a fully qualified table name. ! * ! * @return true if the catalog name appears at the beginning, ! * false if it appears at the end. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isCatalogAtStart() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the separator between the catalog name and the ! * table name. ! * ! * @return The separator between the catalog name and the table name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getCatalogSeparator() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in a data ! * manipulation statement. ! * ! * @return true if a catalog name can appear in a data ! * manipulation statement, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSchemasInDataManipulation() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in a procedure ! * call ! * ! * @return true if a catalog name can appear in a procedure ! * call, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSchemasInProcedureCalls() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in a table definition. ! * ! * @return true if a catalog name can appear in a table ! * definition, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSchemasInTableDefinitions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in an index definition. ! * ! * @return true if a catalog name can appear in an index ! * definition, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSchemasInIndexDefinitions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in privilege definitions. ! * ! * @return true if a catalog name can appear in privilege ! * definition, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSchemasInPrivilegeDefinitions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in a data ! * manipulation statement. ! * ! * @return true if a catalog name can appear in a data ! * manipulation statement, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsCatalogsInDataManipulation() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in a procedure ! * call ! * ! * @return true if a catalog name can appear in a procedure ! * call, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsCatalogsInProcedureCalls() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in a table definition. ! * ! * @return true if a catalog name can appear in a table ! * definition, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsCatalogsInTableDefinitions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in an index definition. ! * ! * @return true if a catalog name can appear in an index ! * definition, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsCatalogsInIndexDefinitions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether a catalog name can appear in privilege definitions. ! * ! * @return true if a catalog name can appear in privilege ! * definition, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsCatalogsInPrivilegeDefinitions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not that database supports positioned ! * deletes. ! * ! * @return true if positioned deletes are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsPositionedDelete() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not that database supports positioned ! * updates. ! * ! * @return true if positioned updates are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsPositionedUpdate() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not SELECT FOR UPDATE is supported by the ! * database. ! * ! * @return true if SELECT FOR UPDATE is supported ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSelectForUpdate() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not stored procedures are supported on ! * this database. ! * ! * @return true if stored procedures are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsStoredProcedures() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not subqueries are allowed in comparisons. ! * A fully JDBC compliant driver will always return true. ! * ! * @return true if subqueries are allowed in comparisons, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSubqueriesInComparisons() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not subqueries are allowed in exists ! * expressions. A fully JDBC compliant driver will always return ! * true. ! * ! * @return true if subqueries are allowed in exists ! * expressions, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSubqueriesInExists() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether subqueries are allowed in IN statements. ! * A fully JDBC compliant driver will always return true. ! * ! * @return true if the driver supports subqueries in IN ! * statements, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSubqueriesInIns() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not subqueries are allowed in quantified ! * expressions. A fully JDBC compliant driver will always return ! * true. ! * ! * @return true if subqueries are allowed in quantified ! * expressions, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsSubqueriesInQuantifieds() throws SQLException; ! /*************************************************************************/ ! /** ! * This method test whether or not correlated subqueries are allowed. A ! * fully JDBC compliant driver will always return true. ! * ! * @return true if correlated subqueries are allowed, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsCorrelatedSubqueries() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the UNION statement is supported. ! * ! * @return true if UNION is supported, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsUnion() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the UNION ALL statement is supported. ! * ! * @return true if UNION ALL is supported, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsUnionAll() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports cursors ! * remaining open across commits. ! * ! * @return true if cursors can remain open across commits, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsOpenCursorsAcrossCommit() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports cursors ! * remaining open across rollbacks. ! * ! * @return true if cursors can remain open across rollbacks, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsOpenCursorsAcrossRollback() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports statements ! * remaining open across commits. ! * ! * @return true if statements can remain open across commits, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsOpenStatementsAcrossCommit() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports statements ! * remaining open across rollbacks. ! * ! * @return true if statements can remain open across rollbacks, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsOpenStatementsAcrossRollback() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the number of hex characters allowed in an inline ! * binary literal. ! * ! * @return The number of hex characters allowed in a binary literal, 0 meaning ! * either an unknown or unlimited number. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxBinaryLiteralLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a character literal. ! * ! * @return The maximum length of a character literal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxCharLiteralLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a column name. ! * ! * @return The maximum length of a column name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxColumnNameLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of columns in a GROUP BY statement. ! * ! * @return The maximum number of columns in a GROUP BY statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxColumnsInGroupBy() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of columns in an index. ! * ! * @return The maximum number of columns in an index. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxColumnsInIndex() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of columns in an ORDER BY statement. ! * ! * @return The maximum number of columns in an ORDER BY statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxColumnsInOrderBy() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of columns in a SELECT statement. ! * ! * @return The maximum number of columns in a SELECT statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxColumnsInSelect() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of columns in a table. ! * ! * @return The maximum number of columns in a table. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxColumnsInTable() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of connections this client ! * can have to the database. ! * ! * @return The maximum number of database connections. ! * ! * @SQLException If an error occurs. ! */ ! public abstract int ! getMaxConnections() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a cursor name. ! * ! * @return The maximum length of a cursor name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxCursorNameLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of an index. ! * ! * @return The maximum length of an index. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxIndexLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a schema name. ! * ! * @return The maximum length of a schema name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxSchemaNameLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a procedure name. ! * ! * @return The maximum length of a procedure name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxProcedureNameLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a catalog name. ! * ! * @return The maximum length of a catalog name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxCatalogNameLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum size of a row in bytes. ! * ! * @return The maximum size of a row. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxRowSize() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the maximum row size includes BLOB's ! * ! * @return true if the maximum row size includes BLOB's, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! doesMaxRowSizeIncludeBlobs() throws SQLException; ! /*************************************************************************/ ! /** ! * This method includes the maximum length of a SQL statement. ! * ! * @return The maximum length of a SQL statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxStatementLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of statements that can be ! * active at any time. ! * ! * @return The maximum number of statements that can be active at any time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxStatements() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a table name. ! * ! * @return The maximum length of a table name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxTableNameLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum number of tables that may be referenced ! * in a SELECT statement. ! * ! * @return The maximum number of tables allowed in a SELECT statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxTablesInSelect() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the maximum length of a user name. ! * ! * @return The maximum length of a user name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxUserNameLength() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the default transaction isolation level of the ! * database. ! * ! * @return The default transaction isolation level of the database. ! * ! * @exception SQLException If an error occurs. ! * ! * @see Connection ! */ ! public abstract int ! getDefaultTransactionIsolation() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports transactions. ! * ! * @return true if the database supports transactions, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsTransactions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports the specified ! * transaction isolation level. ! * ! * @param level The transaction isolation level. ! * ! * @return true if the specified transaction isolation level ! * is supported, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsTransactionIsolationLevel(int level) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not DDL and DML statements allowed within ! * the same transaction. ! * ! * @return true if DDL and DML statements are allowed in the ! * same transaction, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsDataDefinitionAndDataManipulationTransactions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not only DML statement are allowed ! * inside a transaction. ! * ! * @return true if only DML statements are allowed in ! * transactions, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsDataManipulationTransactionsOnly() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not a DDL statement will cause the ! * current transaction to be automatically committed. ! * ! * @return true if DDL causes an immediate transaction commit, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! dataDefinitionCausesTransactionCommit() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not DDL statements are ignored in ! * transactions. ! * ! * @return true if DDL statements are ignored in transactions, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! dataDefinitionIgnoredInTransactions() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of all the stored procedures matching the ! * specified pattern in the given schema and catalog. This is returned ! * a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PROCEDURE_CAT - The catalog the procedure is in, which may be ! * null. ! *
          2. PROCEDURE_SCHEM - The schema the procedures is in, which may be ! * null. ! *
          3. PROCEDURE_NAME - The name of the procedure. ! *
          4. Unused ! *
          5. Unused ! *
          6. Unused ! *
          7. REMARKS - A description of the procedure ! *
          8. PROCEDURE_TYPE - Indicates the return type of the procedure, which ! * is one of the contstants defined in this class ! * (procedureResultUnknown, procedureNoResult, or ! * procedureReturnsResult). ! *
          ! * ! * @param catalog The name of the catalog to return stored procedured from, ! * or "" to return procedures from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return stored ! * procedures from, or "" to return procedures from all schemas. ! * @param namePattern The pattern of procedures names to return. ! * ! * @returns A ResultSet with all the requested procedures. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getProcedures(String catalog, String schemaPattern, String namePattern) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of the parameter and result columns for ! * the requested stored procedures. This is returned in the form of a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. PROCEDURE_CAT - The catalog the procedure is in, which may be ! * null. ! *
          2. PROCEDURE_SCHEM - The schema the procedures is in, which may be ! * null. ! *
          3. PROCEDURE_NAME - The name of the procedure. ! *
          4. COLUMN_NAME - The name of the column ! *
          5. COLUMN_TYPE - The type of the column, which will be one of the ! * contants defined in this class (procedureColumnUnknown, ! * procedureColumnIn, procedureColumnInOut, ! * procedureColumnOut, procedureColumnReturn, ! * or procedureColumnResult). ! *
          6. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          7. TYPE_NAME - The string name of the data type for this column. ! *
          8. PRECISION - The precision of the column. ! *
          9. LENGTH - The length of the column in bytes ! *
          10. SCALE - The scale of the column. ! *
          11. RADIX - The radix of the column. ! *
          12. NULLABLE - Whether or not the column is NULLABLE. This is one of ! * the constants defined in this class (procedureNoNulls, ! * procedureNullable, or procedureNullableUnknown) ! *
          13. REMARKS - A description of the column. ! *
          ! * ! * @param catalog The name of the catalog to return stored procedured from, ! * or "" to return procedures from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return stored ! * procedures from, or "" to return procedures from all schemas. ! * @param namePattern The pattern of procedures names to return. ! * @param columnPattern The pattern of column names to return. ! * ! * @returns A ResultSet with all the requested procedures. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getProcedureColumns(String catalog, String schemaPattern, String namePattern, ! String columnPattern) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of the requested table as a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be null. ! *
          2. TABLE_SCHEM - The schema the table is in, which may be null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. TABLE_TYPE - A string describing the table type. This will be one ! * of the values returned by the getTableTypes() method. ! *
          5. REMARKS - Comments about the table. ! *
          ! * ! * @param catalog The name of the catalog to return tables from, ! * or "" to return tables from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return tables ! * from, or "" to return tables from all schemas. ! * @param namePattern The pattern of table names to return. ! * @param types The list of table types to include; null returns all types. ! * ! * @returns A ResultSet with all the requested tables. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getTables(String catalog, String schemaPattern, String namePattern, ! String types[]) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the list of database schemas as a ! * ResultSet, with one column - TABLE_SCHEM - that is the ! * name of the schema. ! * ! * @return A ResultSet with all the requested schemas. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getSchemas() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the list of database catalogs as a ! * ResultSet with one column - TABLE_CAT - that is the ! * name of the catalog. ! * ! * @return A ResultSet with all the requested catalogs. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getCatalogs() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the list of database table types as a ! * ResultSet with one column - TABLE_TYPE - that is the ! * name of the table type. ! * ! * @return A ResultSet with all the requested table types. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getTableTypes() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of the tables columns for ! * the requested tables. This is returned in the form of a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be ! * null. ! *
          2. TABLE_SCHEM - The schema the tables is in, which may be ! * null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. COLUMN_NAME - The name of the column ! *
          5. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          6. TYPE_NAME - The string name of the data type for this column. ! *
          7. COLUMN_SIZE - The size of the column. ! *
          8. Unused ! *
          9. NUM_PREC_RADIX - The radix of the column. ! *
          10. NULLABLE - Whether or not the column is NULLABLE. This is one of ! * the constants defined in this class (tableNoNulls, ! * tableNullable, or tableNullableUnknown) ! *
          11. REMARKS - A description of the column. ! *
          12. COLUMN_DEF - The default value for the column, may be null. ! *
          13. SQL_DATA_TYPE - Unused ! *
          14. SQL_DATETIME_SUB - Unused ! *
          15. CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes ! * in the column. ! *
          16. ORDINAL_POSITION - The index of the column in the table. ! *
          17. IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string ! * means unknown. ! *
          ! * ! * @param catalog The name of the catalog to return table from, ! * or "" to return tables from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return ! * tables from, or "" to return tables from all schemas. ! * @param namePattern The pattern of tables names to return. ! * @param columnPattern The pattern of column names to return. ! * ! * @returns A ResultSet with all the requested tables. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getColumns(String catalog, String schemaPattern, String namePattern, ! String columnPattern) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the access rights that have been granted to the ! * requested columns. This information is returned as a ResultSet ! * with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be ! * null. ! *
          2. TABLE_SCHEM - The schema the tables is in, which may be ! * null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. COLUMN_NAME - The name of the column. ! *
          5. GRANTOR - The entity that granted the access. ! *
          6. GRANTEE - The entity granted the access. ! *
          7. PRIVILEGE - The name of the privilege granted. ! *
          8. IS_GRANTABLE - "YES" if the grantee can grant the privilege to ! * others, "NO" if not, and null if unknown. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * ! * @return A ResultSet with all the requested privileges. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getColumnPrivileges(String catalog, String schema, String table, ! String columnPattern) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the access rights that have been granted to the ! * requested tables. This information is returned as a ResultSet ! * with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be ! * null. ! *
          2. TABLE_SCHEM - The schema the tables is in, which may be ! * null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. GRANTOR - The entity that granted the access. ! *
          5. GRANTEE - The entity granted the access. ! *
          6. PRIVILEGE - The name of the privilege granted. ! *
          7. IS_GRANTABLE - "YES" if the grantee can grant the privilege to ! * others, "NO" if not, and null if unknown. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param tablePattern The table name pattern of tables to return ! * information for. ! * ! * @return A ResultSet with all the requested privileges. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getTablePrivileges(String catalog, String schema, String table) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the best set of columns for uniquely identifying ! * a row. It returns this information as a ResultSet with ! * the following columns: ! *

          ! *

            ! *
          1. SCOPE - The scope of the results returned. This is one of the ! * constants defined in this class (bestRowTemporary, ! * bestRowTransaction, or bestRowSession). ! *
          2. COLUMN_NAME - The name of the column. ! *
          3. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          4. TYPE_NAME - The string name of the data type for this column. ! *
          5. COLUMN_SIZE - The precision of the columns ! *
          6. BUFFER_LENGTH - Unused ! *
          7. DECIMAL_DIGITS - The scale of the column. ! *
          8. PSEUDO_COLUMN - Whether or not the best row identifier is a ! * pseudo_column. This is one of the constants defined in this class ! * (bestRowUnknown, bestRowNotPseudo, or ! * bestRowPseudo). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * @param scope One of the best row id scope constants from this class. ! * @param nullable true to include columns that are nullable, ! * false otherwise. ! * ! * @return A ResultSet with the best row identifier. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getBestRowIdentifier(String catalog, String schema, String table, ! int scope, boolean nullable) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the set of columns that are automatically updated ! * when the row is update. It returns this information as a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. SCOPE - Unused ! *
          2. COLUMN_NAME - The name of the column. ! *
          3. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          4. TYPE_NAME - The string name of the data type for this column. ! *
          5. COLUMN_SIZE - The precision of the columns ! *
          6. BUFFER_LENGTH - Unused ! *
          7. DECIMAL_DIGITS - The scale of the column. ! *
          8. PSEUDO_COLUMN - Whether or not the best row identifier is a ! * pseudo_column. This is one of the constants defined in this class ! * (versionRowUnknown, versionRowNotPseudo, or ! * versionRowPseudo). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * ! * @return A ResultSet with the version columns. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getVersionColumns(String catalog, String schema, String table) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of a table's primary key columns. These ! * are returned as a ResultSet with the following columns. ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog of the table, which may be null. ! *
          2. TABLE_SCHEM - The schema of the table, which may be null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. COLUMN_NAME - The name of the column. ! *
          5. KEY_SEQ - The sequence number of the column within the primary key. ! *
          6. PK_NAME - The name of the primary key, which may be null. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * ! * @return A ResultSet with the primary key columns. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getPrimaryKeys(String catalog, String schema, String table) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of the table's foreign keys. These are ! * returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PKTABLE_CAT - The catalog of the table the key was imported from. ! *
          2. PKTABLE_SCHEM - The schema of the table the key was imported from. ! *
          3. PKTABLE_NAME - The name of the table the key was imported from. ! *
          4. PKCOLUMN_NAME - The name of the column that was imported. ! *
          5. FKTABLE_CAT - The foreign key catalog name. ! *
          6. FKTABLE_SCHEM - The foreign key schema name. ! *
          7. FKTABLE_NAME - The foreign key table name. ! *
          8. FKCOLUMN_NAME - The foreign key column name. ! *
          9. KEY_SEQ - The sequence number of the column within the foreign key. ! *
          10. UPDATE_RULE - How the foreign key behaves when the primary key is ! * updated. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, importedKeySetDefault, or ! * importedKeyRestrict). ! *
          11. DELETE_RULE - How the foreign key behaves when the primary key is ! * deleted. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, or importedKeySetDefault) ! *
          12. FK_NAME - The name of the foreign key. ! *
          13. PK_NAME - The name of the primary key. ! *
          14. DEFERRABILITY - The deferrability value. This is one of the ! * constants defined in this table (importedKeyInitiallyDeferred, ! * importedKeyInitiallyImmediate, or ! * importedKeyNotDeferrable). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * ! * @return A ResultSet with the foreign key columns. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getImportedKeys(String catalog, String schema, String table) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of the table's which use this table's ! * primary key as a foreign key. The information is ! * returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PKTABLE_CAT - The catalog of the table the key was imported from. ! *
          2. PKTABLE_SCHEM - The schema of the table the key was imported from. ! *
          3. PKTABLE_NAME - The name of the table the key was imported from. ! *
          4. PKCOLUMN_NAME - The name of the column that was imported. ! *
          5. FKTABLE_CAT - The foreign key catalog name. ! *
          6. FKTABLE_SCHEM - The foreign key schema name. ! *
          7. FKTABLE_NAME - The foreign key table name. ! *
          8. FKCOLUMN_NAME - The foreign key column name. ! *
          9. KEY_SEQ - The sequence number of the column within the foreign key. ! *
          10. UPDATE_RULE - How the foreign key behaves when the primary key is ! * updated. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, importedKeySetDefault, or ! * importedKeyRestrict). ! *
          11. DELETE_RULE - How the foreign key behaves when the primary key is ! * deleted. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, or importedKeySetDefault) ! *
          12. FK_NAME - The name of the foreign key. ! *
          13. PK_NAME - The name of the primary key. ! *
          14. DEFERRABILITY - The deferrability value. This is one of the ! * constants defined in this table (importedKeyInitiallyDeferred, ! * importedKeyInitiallyImmediate, or ! * importedKeyNotDeferrable). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * ! * @return A ResultSet with the requested information ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getExportedKeys(String catalog, String schema, String table) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a description of how one table imports another ! * table's primary key as a foreign key. The information is ! * returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PKTABLE_CAT - The catalog of the table the key was imported from. ! *
          2. PKTABLE_SCHEM - The schema of the table the key was imported from. ! *
          3. PKTABLE_NAME - The name of the table the key was imported from. ! *
          4. PKCOLUMN_NAME - The name of the column that was imported. ! *
          5. FKTABLE_CAT - The foreign key catalog name. ! *
          6. FKTABLE_SCHEM - The foreign key schema name. ! *
          7. FKTABLE_NAME - The foreign key table name. ! *
          8. FKCOLUMN_NAME - The foreign key column name. ! *
          9. KEY_SEQ - The sequence number of the column within the foreign key. ! *
          10. UPDATE_RULE - How the foreign key behaves when the primary key is ! * updated. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, importedKeySetDefault, or ! * importedKeyRestrict). ! *
          11. DELETE_RULE - How the foreign key behaves when the primary key is ! * deleted. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, or importedKeySetDefault) ! *
          12. FK_NAME - The name of the foreign key. ! *
          13. PK_NAME - The name of the primary key. ! *
          14. DEFERRABILITY - The deferrability value. This is one of the ! * constants defined in this table (importedKeyInitiallyDeferred, ! * importedKeyInitiallyImmediate, or ! * importedKeyNotDeferrable). ! *
          ! * ! * @param primCatalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs, on the exporting side. ! * @param primSchema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema, on the exporting side. ! * @param primTable The table name to return information for, on the exporting ! * side. ! * @param forCatalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs, on the importing side. ! * @param forSchema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema on the importing side. ! * @param forTable The table name to return information for on the importing ! * side. ! * ! * @return A ResultSet with the requested information ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getCrossReference(String primCatalog, String primSchema, String primTable, ! String forCatalog, String forSchema, String forTable) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a list of the SQL types supported by this ! * database. The information is returned as a ResultSet ! * with the following columns: ! *

          ! *

            ! *
          1. TYPE_NAME - The name of the data type. ! *
          2. DATA_TYPE - A data type constant from Types for this ! * type. ! *
          3. PRECISION - The maximum precision of this type. ! *
          4. LITERAL_PREFIX - Prefix value used to quote a literal, which may be ! * null. ! *
          5. LITERAL_SUFFIX - Suffix value used to quote a literal, which may be ! * null. ! *
          6. CREATE_PARAMS - The parameters used to create the type, which may be ! * null. ! *
          7. NULLABLE - Whether or not this type supports NULL values. This will ! * be one of the constants defined in this interface ! * (typeNoNulls, typeNullable, or ! * typeNullableUnknown). ! *
          8. CASE_SENSITIVE - Whether or not the value is case sensitive. ! *
          9. SEARCHABLE - Whether or not "LIKE" expressions are supported in ! * WHERE clauses for this type. This will be one of the constants defined ! * in this interface (typePredNone, typePredChar, ! * typePredBasic, or typeSearchable). ! *
          10. UNSIGNED_ATTRIBUTE - Is the value of this type unsigned. ! *
          11. FIXED_PREC_SCALE - Whether or not this type can be used for money. ! *
          12. AUTO_INCREMENT - Whether or not this type supports auto-incrementing. ! *
          13. LOCAL_TYPE_NAME - A localized name for this data type. ! *
          14. MINIMUM_SCALE - The minimum scale supported by this type. ! *
          15. MAXIMUM_SCALE - The maximum scale supported by this type. ! *
          16. SQL_DATA_TYPE - Unused. ! *
          17. SQL_DATETIME_SUB - Unused. ! *
          18. NUM_PREC_RADIX - The radix of this data type. ! *
          ! * ! * @return A ResultSet with the list of available data types. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getTypeInfo() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns information about a tables indices and statistics. ! * It is returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog of the table, which may be null. ! *
          2. TABLE_SCHEM - The schema of the table, which may be null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. NON_UNIQUE - Are index values non-unique? ! *
          5. INDEX_QUALIFIER The index catalog, which may be null ! *
          6. INDEX_NAME - The name of the index. ! *
          7. TYPE - The type of index, which will be one of the constants defined ! * in this interface (tableIndexStatistic, ! * tableIndexClustered, tableIndexHashed, or ! * tableIndexOther). ! *
          8. ORDINAL_POSITION - The sequence number of this column in the index. ! * This will be 0 when the index type is tableIndexStatistic. ! *
          9. COLUMN_NAME - The name of this column in the index. ! *
          10. ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a ! * descending sort sequence or null if a sort sequence is not ! * supported. ! *
          11. CARDINALITY - The number of unique rows in the index, or the number ! * of rows in the table if the index type is tableIndexStatistic. ! *
          12. PAGES - The number of pages used for the index, or the number of pages ! * in the table if the index type is tableIndexStatistic. ! *
          13. FILTER_CONDITION - The filter condition for this index, which may be ! * null. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param unique true to return only unique indexes, ! * false otherwise. ! * @param approx true if data values can be approximations, ! * false otherwise. ! * ! * @return A ResultSet with the requested index information ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getIndexInfo(String catalog, String schema, String table, boolean unique, ! boolean approx) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the datbase supports the specified ! * result type. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type is supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! supportsResultSetType(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether the specified result set type and result set ! * concurrency type are supported by the database. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @param concur The desired concurrency type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type is supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! supportsResultSetConcurrency(int type, int concur) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type sees its ! * own updates. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type sees its own updates, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! ownUpdatesAreVisible(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type sees its ! * own deletes. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type sees its own deletes, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! ownDeletesAreVisible(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type sees its ! * own inserts. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type sees its own inserts, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! ownInsertsAreVisible(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type sees ! * updates committed by others. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type sees other updates, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! othersUpdatesAreVisible(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type sees ! * deletes committed by others. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type sees other deletes, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! othersDeletesAreVisible(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type sees ! * inserts committed by others. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type sees other inserts, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! othersInsertsAreVisible(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type can detect ! * a visible update by calling the rowUpdated method. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type can detect visible updates ! * using rowUpdated, false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! updatesAreDetected(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type can detect ! * a visible delete by calling the rowUpdated method. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type can detect visible deletes ! * using rowUpdated, false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! deletesAreDetected(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified result set type can detect ! * a visible insert by calling the rowUpdated method. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type can detect visible inserts ! * using rowUpdated, false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract boolean ! insertsAreDetected(int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the database supports batch updates. ! * ! * @return true if batch updates are supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! supportsBatchUpdates() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the list of user defined data types in use. These ! * are returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. TYPE_CAT - The catalog name, which may be null. ! *
          2. TYPE_SCEHM - The schema name, which may be null. ! *
          3. TYPE_NAME - The user defined data type name. ! *
          4. CLASS_NAME - The Java class name this type maps to. ! *
          5. DATA_TYPE - A type identifier from Types for this type. ! * This will be one of JAVA_OBJECT, STRUCT, or ! * DISTINCT. ! *
          6. REMARKS - Comments about this data type. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param typePattern The type name pattern to match. ! * @param types The type identifier patterns (from Types) to ! * match. ! * ! * @return A ResultSet with the requested type information ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! getUDTs(String catalog, String schema, String typePattern, int[] types) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the Connection object that was used ! * to generate the metadata in this object. ! * ! * @return The connection for this object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Connection ! getConnection() throws SQLException; ! } // interface DatabaseMetaData --- 35,2214 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; ! public interface DatabaseMetaData { + /** + * It is unknown whether or not the procedure returns a result. + */ + public static final int procedureResultUnknown = 0; ! /** ! * The procedure does not return a result. ! */ ! public static final int procedureNoResult = 1; ! /** ! * The procedure returns a result. ! */ ! public static final int procedureReturnsResult = 2; ! /** ! * The column type is unknown. ! */ ! public static final int procedureColumnUnknown = 0; ! /** ! * The column type is input. ! */ ! public static final int procedureColumnIn = 1; ! /** ! * The column type is input/output. ! */ ! public static final int procedureColumnInOut = 2; ! /** ! * The column type is output ! */ ! public static final int procedureColumnOut = 4; ! /** ! * The column is used for return values. ! */ ! public static final int procedureColumnReturn = 5; ! /** ! * The column is used for storing results ! */ ! public static final int procedureColumnResult = 3; ! /** ! * NULL values are not allowed. ! */ ! public static final int procedureNoNulls = 0; ! /** ! * NULL values are allowed. ! */ ! public static final int procedureNullable = 1; ! /** ! * It is unknown whether or not NULL values are allowed. ! */ ! public static final int procedureNullableUnknown = 2; ! /** ! * The column does not allow NULL ! */ ! public static final int columnNoNulls = 0; ! /** ! * The column does allow NULL ! */ ! public static final int columnNullable = 1; ! /** ! * It is unknown whether or not the column allows NULL ! */ ! public static final int columnNullableUnknown = 2; ! /** ! * The best row's scope is only guaranteed to be valid so long as the ! * row is actually being used. ! */ ! public static final int bestRowTemporary = 0; ! /** ! * The best row identifier is valid to the end of the transaction. ! */ ! public static final int bestRowTransaction = 1; ! /** ! * The best row identifier is valid to the end of the session. ! */ ! public static final int bestRowSession = 2; ! /** ! * The best row may or may not be a pseudo-column. ! */ ! public static final int bestRowUnknown = 0; ! /** ! * The best row identifier is not a pseudo-column. ! */ ! public static final int bestRowNotPseudo = 1; ! /** ! * The best row identifier is a pseudo-column. ! */ ! public static final int bestRowPseudo = 2; ! /** ! * It is unknown whether or not the version column is a pseudo-column. ! */ ! public static final int versionColumnUnknown = 0; ! /** ! * The version column is not a pseudo-column ! */ ! public static final int versionColumnNotPseudo = 1; ! /** ! * The version column is a pseudo-column ! */ ! public static final int versionColumnPseudo = 2; ! /** ! * Foreign key changes are cascaded in updates or deletes. ! */ ! public static final int importedKeyCascade = 0; ! /** ! * Column may not be updated or deleted in use as a foreign key. ! */ ! public static final int importedKeyRestrict = 1; ! /** ! * When primary key is updated or deleted, the foreign key is set to NULL. ! */ ! public static final int importedKeySetNull = 2; ! /** ! * If the primary key is a foreign key, it cannot be udpated or deleted. ! */ ! public static final int importedKeyNoAction = 3; ! /** ! * If the primary key is updated or deleted, the foreign key is set to ! * a default value. ! */ ! public static final int importedKeySetDefault = 4; ! /** ! * Wish I knew what this meant. ! */ ! public static final int importedKeyInitiallyDeferred = 5; ! /** ! * Wish I knew what this meant. ! */ ! public static final int importedKeyInitiallyImmediate = 6; ! /** ! * Wish I knew what this meant. ! */ ! public static final int importedKeyNotDeferrable = 7; ! /** ! * A NULL value is not allowed for this data type. ! */ ! public static final int typeNoNulls = 0; ! /** ! * A NULL value is allowed for this data type. ! */ ! public static final int typeNullable = 1; ! /** ! * It is unknown whether or not NULL values are allowed for this data type. ! */ ! public static final int typeNullableUnknown = 2; ! /** ! * Where clauses are not supported for this type. ! */ ! public static final int typePredNone = 0; ! /** ! * Only "WHERE..LIKE" style WHERE clauses are allowed on this data type. ! */ ! public static final int typePredChar = 1; ! /** ! * All WHERE clauses except "WHERE..LIKE" style are allowed on this data type. ! */ ! public static final int typePredBasic = 2; ! /** ! * Any type of WHERE clause is allowed for this data type. ! */ ! public static final int typeSearchable = 3; ! /** ! * This column contains table statistics. ! */ ! public static final short tableIndexStatistic = 0; ! /** ! * This table index is clustered. ! */ ! public static final short tableIndexClustered = 1; ! /** ! * This table index is hashed. ! */ ! public static final short tableIndexHashed = 2; ! /** ! * This table index is of another type. ! */ ! public static final short tableIndexOther = 3; ! public static final short attributeNoNulls = 0; ! public static final short attributeNullable = 1; ! public static final short attributeNullableUnknown = 2; ! public static final int sqlStateXOpen = 1; ! public static final int sqlStateSQL99 = 2; ! /** ! * This method tests whether or not all the procedures returned by ! * the getProcedures method can be called by this user. ! * ! * @return true if all the procedures can be called, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean allProceduresAreCallable() throws SQLException; ! /** ! * This method tests whether or not all the table returned by the ! * getTables method can be selected by this user. ! * ! * @return true if all the procedures can be called, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public boolean allTablesAreSelectable() throws SQLException; ! /** ! * This method returns the URL for this database. ! * ! * @return The URL string for this database, or null if it ! * is not known. ! * @exception SQLException If an error occurs. ! */ ! public String getURL() throws SQLException; ! /** ! * This method returns the database username for this connection. ! * ! * @return The database username. ! * @exception SQLException If an error occurs. ! */ ! public String getUserName() throws SQLException; ! /** ! * This method tests whether or not the database is in read only mode. ! * ! * @return true if the database is in read only mode, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isReadOnly() throws SQLException; ! /** ! * This method tests whether or not NULL's sort as high values. ! * ! * @return true if NULL's sort as high values, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean nullsAreSortedHigh() throws SQLException; ! /** ! * This method tests whether or not NULL's sort as low values. ! * ! * @return true if NULL's sort as low values, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean nullsAreSortedLow() throws SQLException; ! /** ! * This method tests whether or not NULL's sort as high values. ! * ! * @return true if NULL's sort as high values, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean nullsAreSortedAtStart() throws SQLException; ! /** ! * This method test whether or not NULL's are sorted to the end ! * of the list regardless of ascending or descending sort order. ! * ! * @return true if NULL's always sort to the end, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean nullsAreSortedAtEnd() throws SQLException; ! /** ! * This method returns the name of the database product. ! * ! * @return The database product. ! * @exception SQLException If an error occurs. ! */ ! public String getDatabaseProductName() throws SQLException; ! /** ! * This method returns the version of the database product. ! * ! * @return The version of the database product. ! * @exception SQLException If an error occurs. ! */ ! public String getDatabaseProductVersion() throws SQLException; ! /** ! * This method returns the name of the JDBC driver. ! * ! * @return The name of the JDBC driver. ! * @exception SQLException If an error occurs. ! */ ! public String getDriverName() throws SQLException; ! /** ! * This method returns the version of the JDBC driver. ! * ! * @return The version of the JDBC driver. ! * @exception SQLException If an error occurs. ! */ ! public String getDriverVersion() throws SQLException; ! /** ! * This method returns the major version number of the JDBC driver. ! * ! * @return The major version number of the JDBC driver. ! */ ! public int getDriverMajorVersion(); ! /** ! * This method returns the minor version number of the JDBC driver. ! * ! * @return The minor version number of the JDBC driver. ! */ ! public int getDriverMinorVersion(); ! /** ! * This method tests whether or not the database uses local files to ! * store tables. ! * ! * @return true if the database uses local files, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public boolean usesLocalFiles() throws SQLException; ! /** ! * This method tests whether or not the database uses a separate file for ! * each table. ! * ! * @return true if the database uses a separate file for each ! * table false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public boolean usesLocalFilePerTable() throws SQLException; ! /** ! * This method tests whether or not the database supports identifiers ! * with mixed case. ! * ! * @return true if the database supports mixed case identifiers, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsMixedCaseIdentifiers() throws SQLException; ! /** ! * This method tests whether or not the database treats mixed case ! * identifiers as all upper case. ! * ! * @exception true if the database treats all identifiers as ! * upper case, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean storesUpperCaseIdentifiers() throws SQLException; ! /** ! * This method tests whether or not the database treats mixed case ! * identifiers as all lower case. ! * ! * @exception true if the database treats all identifiers as ! * lower case, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean storesLowerCaseIdentifiers() throws SQLException; ! /** ! * This method tests whether or not the database stores mixed case ! * identifers even if it treats them as case insensitive. ! * ! * @return true if the database stores mixed case identifiers, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean storesMixedCaseIdentifiers() throws SQLException; ! /** ! * This method tests whether or not the database supports quoted identifiers ! * with mixed case. ! * ! * @return true if the database supports mixed case quoted ! * identifiers, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException; ! /** ! * This method tests whether or not the database treats mixed case ! * quoted identifiers as all upper case. ! * ! * @exception true if the database treats all quoted identifiers ! * as upper case, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean storesUpperCaseQuotedIdentifiers() throws SQLException; ! /** ! * This method tests whether or not the database treats mixed case ! * quoted identifiers as all lower case. ! * ! * @exception true if the database treats all quoted identifiers ! * as lower case, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean storesLowerCaseQuotedIdentifiers() throws SQLException; ! /** ! * This method tests whether or not the database stores mixed case ! * quoted identifers even if it treats them as case insensitive. ! * ! * @return true if the database stores mixed case quoted ! * identifiers, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean storesMixedCaseQuotedIdentifiers() throws SQLException; ! /** ! * This metohd returns the quote string for SQL identifiers. ! * ! * @return The quote string for SQL identifers, or a space if quoting ! * is not supported. ! * @exception SQLException If an error occurs. ! */ ! public String getIdentifierQuoteString() throws SQLException; ! /** ! * This method returns a comma separated list of all the SQL keywords in ! * the database that are not in SQL92. ! * ! * @return The list of SQL keywords not in SQL92. ! * @exception SQLException If an error occurs. ! */ ! public String getSQLKeywords() throws SQLException; ! /** ! * This method returns a comma separated list of math functions. ! * ! * @return The list of math functions. ! * @exception SQLException If an error occurs. ! */ ! public String getNumericFunctions() throws SQLException; ! /** ! * This method returns a comma separated list of string functions. ! * ! * @return The list of string functions. ! * @exception SQLException If an error occurs. ! */ ! public String getStringFunctions() throws SQLException; ! /** ! * This method returns a comma separated list of of system functions. ! * ! * @return A comma separated list of system functions. ! * @exception SQLException If an error occurs. ! */ ! public String getSystemFunctions() throws SQLException; ! /** ! * This method returns comma separated list of time/date functions. ! * ! * @return The list of time/date functions. ! * @exception SQLException If an error occurs. ! */ ! public String getTimeDateFunctions() throws SQLException; ! /** ! * This method returns the string used to escape wildcards in search strings. ! * ! * @return The string used to escape wildcards in search strings. ! * @exception SQLException If an error occurs. ! */ ! public String getSearchStringEscape() throws SQLException; ! /** ! * This methods returns non-standard characters that can appear in ! * unquoted identifiers. ! * ! * @return Non-standard characters that can appear in unquoted identifiers. ! * @exception SQLException If an error occurs. ! */ ! public String getExtraNameCharacters() throws SQLException; ! /** ! * This method tests whether or not the database supports ! * "ALTER TABLE ADD COLUMN" ! * ! * @return true if column add supported, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsAlterTableWithAddColumn() throws SQLException; ! /** ! * This method tests whether or not the database supports ! * "ALTER TABLE DROP COLUMN" ! * ! * @return true if column drop supported, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsAlterTableWithDropColumn() throws SQLException; ! /** ! * This method tests whether or not column aliasing is supported. ! * ! * @return true if column aliasing is supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsColumnAliasing() throws SQLException; ! /** ! * This method tests whether the concatenation of a NULL and non-NULL ! * value results in a NULL. This will always be true in fully JDBC compliant ! * drivers. ! * ! * @return true if concatenating NULL and a non-NULL value ! * returns a NULL, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean nullPlusNonNullIsNull() throws SQLException; ! /** ! * Tests whether or not CONVERT is supported. ! * ! * @return true if CONVERT is supported, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsConvert() throws SQLException; ! /** ! * This method tests whether or not CONVERT can be performed between the ! * specified types. The types are contants from Types. ! * ! * @param fromType The SQL type to convert from. ! * @param toType The SQL type to convert to. ! * @return true if the conversion can be performed, ! * false otherwise. ! * @see Types ! */ ! public boolean supportsConvert(int fromType, int toType) throws ! SQLException; ! /** ! * This method tests whether or not table correlation names are ! * supported. This will be always be true in a fully JDBC ! * compliant driver. ! * ! * @return true if table correlation names are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsTableCorrelationNames() throws SQLException; ! /** ! * This method tests whether correlation names must be different from the ! * name of the table. ! * ! * @return true if the correlation name must be different from ! * the table name, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsDifferentTableCorrelationNames() throws SQLException; ! /** ! * This method tests whether or not expressions are allowed in an ! * ORDER BY lists. ! * ! * @return true if expressions are allowed in ORDER BY ! * lists, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsExpressionsInOrderBy() throws SQLException; ! /** ! * This method tests whether or ORDER BY on a non-selected column is ! * allowed. ! * ! * @return true if a non-selected column can be used in an ! * ORDER BY, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsOrderByUnrelated() throws SQLException; ! /** ! * This method tests whether or not GROUP BY is supported. ! * ! * @return true if GROUP BY is supported, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsGroupBy() throws SQLException; ! /** ! * This method tests whether GROUP BY on a non-selected column is ! * allowed. ! * ! * @return true if a non-selected column can be used in a ! * GROUP BY, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsGroupByUnrelated() throws SQLException; ! /** ! * This method tests whether or not a GROUP BY can add columns not in the ! * select if it includes all the columns in the select. ! * ! * @return true if GROUP BY an add columns provided it includes ! * all columns in the select, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsGroupByBeyondSelect() throws SQLException; ! /** ! * This method tests whether or not the escape character is supported in ! * LIKE expressions. A fully JDBC compliant driver will always return ! * true. ! * ! * @return true if escapes are supported in LIKE expressions, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsLikeEscapeClause() throws SQLException; ! /** ! * This method tests whether multiple result sets for a single statement are ! * supported. ! * ! * @return true if multiple result sets are supported for a ! * single statement, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsMultipleResultSets() throws SQLException; ! /** ! * This method test whether or not multiple transactions may be open ! * at once, as long as they are on different connections. ! * ! * @return true if multiple transactions on different ! * connections are supported, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsMultipleTransactions() throws SQLException; ! /** ! * This method tests whether or not columns can be defined as NOT NULL. A ! * fully JDBC compliant driver always returns true. ! * ! * @return true if NOT NULL columns are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsNonNullableColumns() throws SQLException; ! /** ! * This method tests whether or not the minimum grammer for ODBC is supported. ! * A fully JDBC compliant driver will always return true. ! * ! * @return true if the ODBC minimum grammar is supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsMinimumSQLGrammar() throws SQLException; ! /** ! * This method tests whether or not the core grammer for ODBC is supported. ! * ! * @return true if the ODBC core grammar is supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsCoreSQLGrammar() throws SQLException; ! /** ! * This method tests whether or not the extended grammer for ODBC is supported. ! * ! * @return true if the ODBC extended grammar is supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsExtendedSQLGrammar() throws SQLException; ! /** ! * This method tests whether or not the ANSI92 entry level SQL ! * grammar is supported. A fully JDBC compliant drivers must return ! * true. ! * ! * @return true if the ANSI92 entry level SQL grammar is ! * supported, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsANSI92EntryLevelSQL() throws SQLException; ! /** ! * This method tests whether or not the ANSI92 intermediate SQL ! * grammar is supported. ! * ! * @return true if the ANSI92 intermediate SQL grammar is ! * supported, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsANSI92IntermediateSQL() throws SQLException; ! /** ! * This method tests whether or not the ANSI92 full SQL ! * grammar is supported. ! * ! * @return true if the ANSI92 full SQL grammar is ! * supported, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsANSI92FullSQL() throws SQLException; ! /** ! * This method tests whether or not the SQL integrity enhancement ! * facility is supported. ! * ! * @return true if the integrity enhancement facility is ! * supported, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsIntegrityEnhancementFacility() throws SQLException; ! /** ! * This method tests whether or not the database supports outer joins. ! * ! * @return true if outer joins are supported, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsOuterJoins() throws SQLException; ! /** ! * This method tests whether or not the database supports full outer joins. ! * ! * @return true if full outer joins are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsFullOuterJoins() throws SQLException; ! /** ! * This method tests whether or not the database supports limited outer joins. ! * ! * @return true if limited outer joins are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsLimitedOuterJoins() throws SQLException; ! /** ! * This method returns the vendor's term for "schema". ! * ! * @return The vendor's term for schema. ! * @exception SQLException if an error occurs. ! */ ! public String getSchemaTerm() throws SQLException; ! /** ! * This method returns the vendor's term for "procedure". ! * ! * @return The vendor's term for procedure. ! * @exception SQLException if an error occurs. ! */ ! public String getProcedureTerm() throws SQLException; ! /** ! * This method returns the vendor's term for "catalog". ! * ! * @return The vendor's term for catalog. ! * @exception SQLException if an error occurs. ! */ ! public String getCatalogTerm() throws SQLException; ! /** ! * This method tests whether a catalog name appears at the beginning of ! * a fully qualified table name. ! * ! * @return true if the catalog name appears at the beginning, ! * false if it appears at the end. ! * @exception SQLException If an error occurs. ! */ ! public boolean isCatalogAtStart() throws SQLException; ! /** ! * This method returns the separator between the catalog name and the ! * table name. ! * ! * @return The separator between the catalog name and the table name. ! * @exception SQLException If an error occurs. ! */ ! public String getCatalogSeparator() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in a data ! * manipulation statement. ! * ! * @return true if a catalog name can appear in a data ! * manipulation statement, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSchemasInDataManipulation() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in a procedure ! * call ! * ! * @return true if a catalog name can appear in a procedure ! * call, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSchemasInProcedureCalls() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in a table definition. ! * ! * @return true if a catalog name can appear in a table ! * definition, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSchemasInTableDefinitions() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in an index definition. ! * ! * @return true if a catalog name can appear in an index ! * definition, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSchemasInIndexDefinitions() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in privilege definitions. ! * ! * @return true if a catalog name can appear in privilege ! * definition, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in a data ! * manipulation statement. ! * ! * @return true if a catalog name can appear in a data ! * manipulation statement, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsCatalogsInDataManipulation() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in a procedure ! * call ! * ! * @return true if a catalog name can appear in a procedure ! * call, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsCatalogsInProcedureCalls() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in a table definition. ! * ! * @return true if a catalog name can appear in a table ! * definition, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsCatalogsInTableDefinitions() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in an index definition. ! * ! * @return true if a catalog name can appear in an index ! * definition, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsCatalogsInIndexDefinitions() throws SQLException; ! /** ! * This method tests whether a catalog name can appear in privilege definitions. ! * ! * @return true if a catalog name can appear in privilege ! * definition, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException; ! /** ! * This method tests whether or not that database supports positioned ! * deletes. ! * ! * @return true if positioned deletes are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsPositionedDelete() throws SQLException; ! /** ! * This method tests whether or not that database supports positioned ! * updates. ! * ! * @return true if positioned updates are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsPositionedUpdate() throws SQLException; ! /** ! * This method tests whether or not SELECT FOR UPDATE is supported by the ! * database. ! * ! * @return true if SELECT FOR UPDATE is supported ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSelectForUpdate() throws SQLException; ! /** ! * This method tests whether or not stored procedures are supported on ! * this database. ! * ! * @return true if stored procedures are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsStoredProcedures() throws SQLException; ! /** ! * This method tests whether or not subqueries are allowed in comparisons. ! * A fully JDBC compliant driver will always return true. ! * ! * @return true if subqueries are allowed in comparisons, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSubqueriesInComparisons() throws SQLException; ! /** ! * This method tests whether or not subqueries are allowed in exists ! * expressions. A fully JDBC compliant driver will always return ! * true. ! * ! * @return true if subqueries are allowed in exists ! * expressions, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSubqueriesInExists() throws SQLException; ! /** ! * This method tests whether subqueries are allowed in IN statements. ! * A fully JDBC compliant driver will always return true. ! * ! * @return true if the driver supports subqueries in IN ! * statements, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSubqueriesInIns() throws SQLException; ! /** ! * This method tests whether or not subqueries are allowed in quantified ! * expressions. A fully JDBC compliant driver will always return ! * true. ! * ! * @return true if subqueries are allowed in quantified ! * expressions, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsSubqueriesInQuantifieds() throws SQLException; ! /** ! * This method test whether or not correlated subqueries are allowed. A ! * fully JDBC compliant driver will always return true. ! * ! * @return true if correlated subqueries are allowed, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsCorrelatedSubqueries() throws SQLException; ! /** ! * This method tests whether or not the UNION statement is supported. ! * ! * @return true if UNION is supported, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsUnion() throws SQLException; ! /** ! * This method tests whether or not the UNION ALL statement is supported. ! * ! * @return true if UNION ALL is supported, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsUnionAll() throws SQLException; ! /** ! * This method tests whether or not the database supports cursors ! * remaining open across commits. ! * ! * @return true if cursors can remain open across commits, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsOpenCursorsAcrossCommit() throws SQLException; ! /** ! * This method tests whether or not the database supports cursors ! * remaining open across rollbacks. ! * ! * @return true if cursors can remain open across rollbacks, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsOpenCursorsAcrossRollback() throws SQLException; ! /** ! * This method tests whether or not the database supports statements ! * remaining open across commits. ! * ! * @return true if statements can remain open across commits, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsOpenStatementsAcrossCommit() throws SQLException; ! /** ! * This method tests whether or not the database supports statements ! * remaining open across rollbacks. ! * ! * @return true if statements can remain open across rollbacks, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsOpenStatementsAcrossRollback() throws SQLException; ! /** ! * This method returns the number of hex characters allowed in an inline ! * binary literal. ! * ! * @return The number of hex characters allowed in a binary literal, 0 meaning ! * either an unknown or unlimited number. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxBinaryLiteralLength() throws SQLException; ! /** ! * This method returns the maximum length of a character literal. ! * ! * @return The maximum length of a character literal. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxCharLiteralLength() throws SQLException; ! /** ! * This method returns the maximum length of a column name. ! * ! * @return The maximum length of a column name. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxColumnNameLength() throws SQLException; ! /** ! * This method returns the maximum number of columns in a GROUP BY statement. ! * ! * @return The maximum number of columns in a GROUP BY statement. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxColumnsInGroupBy() throws SQLException; ! /** ! * This method returns the maximum number of columns in an index. ! * ! * @return The maximum number of columns in an index. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxColumnsInIndex() throws SQLException; ! /** ! * This method returns the maximum number of columns in an ORDER BY statement. ! * ! * @return The maximum number of columns in an ORDER BY statement. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxColumnsInOrderBy() throws SQLException; ! /** ! * This method returns the maximum number of columns in a SELECT statement. ! * ! * @return The maximum number of columns in a SELECT statement. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxColumnsInSelect() throws SQLException; ! /** ! * This method returns the maximum number of columns in a table. ! * ! * @return The maximum number of columns in a table. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxColumnsInTable() throws SQLException; ! /** ! * This method returns the maximum number of connections this client ! * can have to the database. ! * ! * @return The maximum number of database connections. ! * @SQLException If an error occurs. ! */ ! public int getMaxConnections() throws SQLException; ! /** ! * This method returns the maximum length of a cursor name. ! * ! * @return The maximum length of a cursor name. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxCursorNameLength() throws SQLException; ! /** ! * This method returns the maximum length of an index. ! * ! * @return The maximum length of an index. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxIndexLength() throws SQLException; ! /** ! * This method returns the maximum length of a schema name. ! * ! * @return The maximum length of a schema name. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxSchemaNameLength() throws SQLException; ! /** ! * This method returns the maximum length of a procedure name. ! * ! * @return The maximum length of a procedure name. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxProcedureNameLength() throws SQLException; ! /** ! * This method returns the maximum length of a catalog name. ! * ! * @return The maximum length of a catalog name. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxCatalogNameLength() throws SQLException; ! /** ! * This method returns the maximum size of a row in bytes. ! * ! * @return The maximum size of a row. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxRowSize() throws SQLException; ! /** ! * This method tests whether or not the maximum row size includes BLOB's ! * ! * @return true if the maximum row size includes BLOB's, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean doesMaxRowSizeIncludeBlobs() throws SQLException; ! /** ! * This method includes the maximum length of a SQL statement. ! * ! * @return The maximum length of a SQL statement. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxStatementLength() throws SQLException; ! /** ! * This method returns the maximum number of statements that can be ! * active at any time. ! * ! * @return The maximum number of statements that can be active at any time. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxStatements() throws SQLException; ! /** ! * This method returns the maximum length of a table name. ! * ! * @return The maximum length of a table name. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxTableNameLength() throws SQLException; ! /** ! * This method returns the maximum number of tables that may be referenced ! * in a SELECT statement. ! * ! * @return The maximum number of tables allowed in a SELECT statement. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxTablesInSelect() throws SQLException; ! /** ! * This method returns the maximum length of a user name. ! * ! * @return The maximum length of a user name. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxUserNameLength() throws SQLException; ! /** ! * This method returns the default transaction isolation level of the ! * database. ! * ! * @return The default transaction isolation level of the database. ! * @exception SQLException If an error occurs. ! * @see Connection ! */ ! public int getDefaultTransactionIsolation() throws SQLException; ! /** ! * This method tests whether or not the database supports transactions. ! * ! * @return true if the database supports transactions, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsTransactions() throws SQLException; ! /** ! * This method tests whether or not the database supports the specified ! * transaction isolation level. ! * ! * @param level The transaction isolation level. ! * ! * @return true if the specified transaction isolation level ! * is supported, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsTransactionIsolationLevel(int level) throws ! SQLException; ! /** ! * This method tests whether or not DDL and DML statements allowed within ! * the same transaction. ! * ! * @return true if DDL and DML statements are allowed in the ! * same transaction, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsDataDefinitionAndDataManipulationTransactions() ! throws SQLException; ! /** ! * This method tests whether or not only DML statement are allowed ! * inside a transaction. ! * ! * @return true if only DML statements are allowed in ! * transactions, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsDataManipulationTransactionsOnly() throws ! SQLException; ! /** ! * This method tests whether or not a DDL statement will cause the ! * current transaction to be automatically committed. ! * ! * @return true if DDL causes an immediate transaction commit, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean dataDefinitionCausesTransactionCommit() throws SQLException; ! /** ! * This method tests whether or not DDL statements are ignored in ! * transactions. ! * ! * @return true if DDL statements are ignored in transactions, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean dataDefinitionIgnoredInTransactions() throws SQLException; ! /** ! * This method returns a list of all the stored procedures matching the ! * specified pattern in the given schema and catalog. This is returned ! * a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PROCEDURE_CAT - The catalog the procedure is in, which may be ! * null. ! *
          2. PROCEDURE_SCHEM - The schema the procedures is in, which may be ! * null. ! *
          3. PROCEDURE_NAME - The name of the procedure. ! *
          4. Unused ! *
          5. Unused ! *
          6. Unused ! *
          7. REMARKS - A description of the procedure ! *
          8. PROCEDURE_TYPE - Indicates the return type of the procedure, which ! * is one of the contstants defined in this class ! * (procedureResultUnknown, procedureNoResult, or ! * procedureReturnsResult). ! *
          ! * ! * @param catalog The name of the catalog to return stored procedured from, ! * or "" to return procedures from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return stored ! * procedures from, or "" to return procedures from all schemas. ! * @param namePattern The pattern of procedures names to return. ! * @returns A ResultSet with all the requested procedures. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getProcedures(String catalog, String schemaPattern, String ! procedureNamePattern) throws SQLException; ! /** ! * This method returns a list of the parameter and result columns for ! * the requested stored procedures. This is returned in the form of a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. PROCEDURE_CAT - The catalog the procedure is in, which may be ! * null. ! *
          2. PROCEDURE_SCHEM - The schema the procedures is in, which may be ! * null. ! *
          3. PROCEDURE_NAME - The name of the procedure. ! *
          4. COLUMN_NAME - The name of the column ! *
          5. COLUMN_TYPE - The type of the column, which will be one of the ! * contants defined in this class (procedureColumnUnknown, ! * procedureColumnIn, procedureColumnInOut, ! * procedureColumnOut, procedureColumnReturn, ! * or procedureColumnResult). ! *
          6. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          7. TYPE_NAME - The string name of the data type for this column. ! *
          8. PRECISION - The precision of the column. ! *
          9. LENGTH - The length of the column in bytes ! *
          10. SCALE - The scale of the column. ! *
          11. RADIX - The radix of the column. ! *
          12. NULLABLE - Whether or not the column is NULLABLE. This is one of ! * the constants defined in this class (procedureNoNulls, ! * procedureNullable, or procedureNullableUnknown) ! *
          13. REMARKS - A description of the column. ! *
          ! * ! * @param catalog The name of the catalog to return stored procedured from, ! * or "" to return procedures from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return stored ! * procedures from, or "" to return procedures from all schemas. ! * @param namePattern The pattern of procedures names to return. ! * @param columnPattern The pattern of column names to return. ! * @returns A ResultSet with all the requested procedures. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getProcedureColumns(String catalog, String schemaPattern, ! String procedureNamePattern, String columnNamePattern) throws ! SQLException; ! /** ! * This method returns a list of the requested table as a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be null. ! *
          2. TABLE_SCHEM - The schema the table is in, which may be null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. TABLE_TYPE - A string describing the table type. This will be one ! * of the values returned by the getTableTypes() method. ! *
          5. REMARKS - Comments about the table. ! *
          ! * ! * @param catalog The name of the catalog to return tables from, ! * or "" to return tables from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return tables ! * from, or "" to return tables from all schemas. ! * @param namePattern The pattern of table names to return. ! * @param types The list of table types to include; null returns all types. ! * @returns A ResultSet with all the requested tables. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getTables(String catalog, String schemaPattern, String ! tableNamePattern, String[] types) throws SQLException; ! /** ! * This method returns the list of database schemas as a ! * ResultSet, with one column - TABLE_SCHEM - that is the ! * name of the schema. ! * ! * @return A ResultSet with all the requested schemas. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getSchemas() throws SQLException; ! /** ! * This method returns the list of database catalogs as a ! * ResultSet with one column - TABLE_CAT - that is the ! * name of the catalog. ! * ! * @return A ResultSet with all the requested catalogs. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getCatalogs() throws SQLException; ! /** ! * This method returns the list of database table types as a ! * ResultSet with one column - TABLE_TYPE - that is the ! * name of the table type. ! * ! * @return A ResultSet with all the requested table types. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getTableTypes() throws SQLException; ! /** ! * This method returns a list of the tables columns for ! * the requested tables. This is returned in the form of a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be ! * null. ! *
          2. TABLE_SCHEM - The schema the tables is in, which may be ! * null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. COLUMN_NAME - The name of the column ! *
          5. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          6. TYPE_NAME - The string name of the data type for this column. ! *
          7. COLUMN_SIZE - The size of the column. ! *
          8. Unused ! *
          9. NUM_PREC_RADIX - The radix of the column. ! *
          10. NULLABLE - Whether or not the column is NULLABLE. This is one of ! * the constants defined in this class (tableNoNulls, ! * tableNullable, or tableNullableUnknown) ! *
          11. REMARKS - A description of the column. ! *
          12. COLUMN_DEF - The default value for the column, may be null. ! *
          13. SQL_DATA_TYPE - Unused ! *
          14. SQL_DATETIME_SUB - Unused ! *
          15. CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes ! * in the column. ! *
          16. ORDINAL_POSITION - The index of the column in the table. ! *
          17. IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string ! * means unknown. ! *
          ! * ! * @param catalog The name of the catalog to return table from, ! * or "" to return tables from all catalogs. ! * @param schemaPattern A schema pattern for the schemas to return ! * tables from, or "" to return tables from all schemas. ! * @param namePattern The pattern of tables names to return. ! * @param columnPattern The pattern of column names to return. ! * @returns A ResultSet with all the requested tables. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getColumns(String catalog, String schemaPattern, String ! tableNamePattern, String columnNamePattern) throws SQLException; ! /** ! * This method returns the access rights that have been granted to the ! * requested columns. This information is returned as a ResultSet ! * with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be ! * null. ! *
          2. TABLE_SCHEM - The schema the tables is in, which may be ! * null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. COLUMN_NAME - The name of the column. ! *
          5. GRANTOR - The entity that granted the access. ! *
          6. GRANTEE - The entity granted the access. ! *
          7. PRIVILEGE - The name of the privilege granted. ! *
          8. IS_GRANTABLE - "YES" if the grantee can grant the privilege to ! * others, "NO" if not, and null if unknown. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * @return A ResultSet with all the requested privileges. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getColumnPrivileges(String catalog, String schema, String ! table, String columnNamePattern) throws SQLException; ! /** ! * This method returns the access rights that have been granted to the ! * requested tables. This information is returned as a ResultSet ! * with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog the table is in, which may be ! * null. ! *
          2. TABLE_SCHEM - The schema the tables is in, which may be ! * null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. GRANTOR - The entity that granted the access. ! *
          5. GRANTEE - The entity granted the access. ! *
          6. PRIVILEGE - The name of the privilege granted. ! *
          7. IS_GRANTABLE - "YES" if the grantee can grant the privilege to ! * others, "NO" if not, and null if unknown. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param tablePattern The table name pattern of tables to return ! * information for. ! * @return A ResultSet with all the requested privileges. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getTablePrivileges(String catalog, String schemaPattern, ! String tableNamePattern) throws SQLException; ! /** ! * This method returns the best set of columns for uniquely identifying ! * a row. It returns this information as a ResultSet with ! * the following columns: ! *

          ! *

            ! *
          1. SCOPE - The scope of the results returned. This is one of the ! * constants defined in this class (bestRowTemporary, ! * bestRowTransaction, or bestRowSession). ! *
          2. COLUMN_NAME - The name of the column. ! *
          3. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          4. TYPE_NAME - The string name of the data type for this column. ! *
          5. COLUMN_SIZE - The precision of the columns ! *
          6. BUFFER_LENGTH - Unused ! *
          7. DECIMAL_DIGITS - The scale of the column. ! *
          8. PSEUDO_COLUMN - Whether or not the best row identifier is a ! * pseudo_column. This is one of the constants defined in this class ! * (bestRowUnknown, bestRowNotPseudo, or ! * bestRowPseudo). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * @param scope One of the best row id scope constants from this class. ! * @param nullable true to include columns that are nullable, ! * false otherwise. ! * @return A ResultSet with the best row identifier. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getBestRowIdentifier(String catalog, String schema, ! String table, int scope, boolean nullable) throws SQLException; ! /** ! * This method returns the set of columns that are automatically updated ! * when the row is update. It returns this information as a ! * ResultSet with the following columns: ! *

          ! *

            ! *
          1. SCOPE - Unused ! *
          2. COLUMN_NAME - The name of the column. ! *
          3. DATA_TYPE - The SQL type of the column. This is one of the constants ! * defined in Types. ! *
          4. TYPE_NAME - The string name of the data type for this column. ! *
          5. COLUMN_SIZE - The precision of the columns ! *
          6. BUFFER_LENGTH - Unused ! *
          7. DECIMAL_DIGITS - The scale of the column. ! *
          8. PSEUDO_COLUMN - Whether or not the best row identifier is a ! * pseudo_column. This is one of the constants defined in this class ! * (versionRowUnknown, versionRowNotPseudo, or ! * versionRowPseudo). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * @return A ResultSet with the version columns. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getVersionColumns(String catalog, String schema, ! String table) throws SQLException; ! /** ! * This method returns a list of a table's primary key columns. These ! * are returned as a ResultSet with the following columns. ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog of the table, which may be null. ! *
          2. TABLE_SCHEM - The schema of the table, which may be null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. COLUMN_NAME - The name of the column. ! *
          5. KEY_SEQ - The sequence number of the column within the primary key. ! *
          6. PK_NAME - The name of the primary key, which may be null. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param columnPattern A pattern of column names to return information for. ! * @return A ResultSet with the primary key columns. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getPrimaryKeys(String catalog, String schema, String table) ! throws SQLException; ! /** ! * This method returns a list of the table's foreign keys. These are ! * returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PKTABLE_CAT - The catalog of the table the key was imported from. ! *
          2. PKTABLE_SCHEM - The schema of the table the key was imported from. ! *
          3. PKTABLE_NAME - The name of the table the key was imported from. ! *
          4. PKCOLUMN_NAME - The name of the column that was imported. ! *
          5. FKTABLE_CAT - The foreign key catalog name. ! *
          6. FKTABLE_SCHEM - The foreign key schema name. ! *
          7. FKTABLE_NAME - The foreign key table name. ! *
          8. FKCOLUMN_NAME - The foreign key column name. ! *
          9. KEY_SEQ - The sequence number of the column within the foreign key. ! *
          10. UPDATE_RULE - How the foreign key behaves when the primary key is ! * updated. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, importedKeySetDefault, or ! * importedKeyRestrict). ! *
          11. DELETE_RULE - How the foreign key behaves when the primary key is ! * deleted. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, or importedKeySetDefault) ! *
          12. FK_NAME - The name of the foreign key. ! *
          13. PK_NAME - The name of the primary key. ! *
          14. DEFERRABILITY - The deferrability value. This is one of the ! * constants defined in this table (importedKeyInitiallyDeferred, ! * importedKeyInitiallyImmediate, or ! * importedKeyNotDeferrable). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * ! * @return A ResultSet with the foreign key columns. ! * ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getImportedKeys(String catalog, String schema, ! String table) throws SQLException; ! /** ! * This method returns a list of the table's which use this table's ! * primary key as a foreign key. The information is ! * returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PKTABLE_CAT - The catalog of the table the key was imported from. ! *
          2. PKTABLE_SCHEM - The schema of the table the key was imported from. ! *
          3. PKTABLE_NAME - The name of the table the key was imported from. ! *
          4. PKCOLUMN_NAME - The name of the column that was imported. ! *
          5. FKTABLE_CAT - The foreign key catalog name. ! *
          6. FKTABLE_SCHEM - The foreign key schema name. ! *
          7. FKTABLE_NAME - The foreign key table name. ! *
          8. FKCOLUMN_NAME - The foreign key column name. ! *
          9. KEY_SEQ - The sequence number of the column within the foreign key. ! *
          10. UPDATE_RULE - How the foreign key behaves when the primary key is ! * updated. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, importedKeySetDefault, or ! * importedKeyRestrict). ! *
          11. DELETE_RULE - How the foreign key behaves when the primary key is ! * deleted. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, or importedKeySetDefault) ! *
          12. FK_NAME - The name of the foreign key. ! *
          13. PK_NAME - The name of the primary key. ! *
          14. DEFERRABILITY - The deferrability value. This is one of the ! * constants defined in this table (importedKeyInitiallyDeferred, ! * importedKeyInitiallyImmediate, or ! * importedKeyNotDeferrable). ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @return A ResultSet with the requested information ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getExportedKeys(String catalog, String schema, ! String table) throws SQLException; ! /** ! * This method returns a description of how one table imports another ! * table's primary key as a foreign key. The information is ! * returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. PKTABLE_CAT - The catalog of the table the key was imported from. ! *
          2. PKTABLE_SCHEM - The schema of the table the key was imported from. ! *
          3. PKTABLE_NAME - The name of the table the key was imported from. ! *
          4. PKCOLUMN_NAME - The name of the column that was imported. ! *
          5. FKTABLE_CAT - The foreign key catalog name. ! *
          6. FKTABLE_SCHEM - The foreign key schema name. ! *
          7. FKTABLE_NAME - The foreign key table name. ! *
          8. FKCOLUMN_NAME - The foreign key column name. ! *
          9. KEY_SEQ - The sequence number of the column within the foreign key. ! *
          10. UPDATE_RULE - How the foreign key behaves when the primary key is ! * updated. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, importedKeySetDefault, or ! * importedKeyRestrict). ! *
          11. DELETE_RULE - How the foreign key behaves when the primary key is ! * deleted. This is one of the constants defined in this class ! * (importedNoAction, importedKeyCascade, ! * importedKeySetNull, or importedKeySetDefault) ! *
          12. FK_NAME - The name of the foreign key. ! *
          13. PK_NAME - The name of the primary key. ! *
          14. DEFERRABILITY - The deferrability value. This is one of the ! * constants defined in this table (importedKeyInitiallyDeferred, ! * importedKeyInitiallyImmediate, or ! * importedKeyNotDeferrable). ! *
          ! * ! * @param primCatalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs, on the exporting side. ! * @param primSchema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema, on the exporting side. ! * @param primTable The table name to return information for, on the exporting ! * side. ! * @param forCatalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs, on the importing side. ! * @param forSchema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema on the importing side. ! * @param forTable The table name to return information for on the importing ! * side. ! * @return A ResultSet with the requested information ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getCrossReference(String primaryCatalog, String ! primarySchema, String primaryTable, String foreignCatalog, String ! foreignSchema, String foreignTable) throws SQLException; ! /** ! * This method returns a list of the SQL types supported by this ! * database. The information is returned as a ResultSet ! * with the following columns: ! *

          ! *

            ! *
          1. TYPE_NAME - The name of the data type. ! *
          2. DATA_TYPE - A data type constant from Types for this ! * type. ! *
          3. PRECISION - The maximum precision of this type. ! *
          4. LITERAL_PREFIX - Prefix value used to quote a literal, which may be ! * null. ! *
          5. LITERAL_SUFFIX - Suffix value used to quote a literal, which may be ! * null. ! *
          6. CREATE_PARAMS - The parameters used to create the type, which may be ! * null. ! *
          7. NULLABLE - Whether or not this type supports NULL values. This will ! * be one of the constants defined in this interface ! * (typeNoNulls, typeNullable, or ! * typeNullableUnknown). ! *
          8. CASE_SENSITIVE - Whether or not the value is case sensitive. ! *
          9. SEARCHABLE - Whether or not "LIKE" expressions are supported in ! * WHERE clauses for this type. This will be one of the constants defined ! * in this interface (typePredNone, typePredChar, ! * typePredBasic, or typeSearchable). ! *
          10. UNSIGNED_ATTRIBUTE - Is the value of this type unsigned. ! *
          11. FIXED_PREC_SCALE - Whether or not this type can be used for money. ! *
          12. AUTO_INCREMENT - Whether or not this type supports auto-incrementing. ! *
          13. LOCAL_TYPE_NAME - A localized name for this data type. ! *
          14. MINIMUM_SCALE - The minimum scale supported by this type. ! *
          15. MAXIMUM_SCALE - The maximum scale supported by this type. ! *
          16. SQL_DATA_TYPE - Unused. ! *
          17. SQL_DATETIME_SUB - Unused. ! *
          18. NUM_PREC_RADIX - The radix of this data type. ! *
          ! * ! * @return A ResultSet with the list of available data types. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getTypeInfo() throws SQLException; ! /** ! * This method returns information about a tables indices and statistics. ! * It is returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. TABLE_CAT - The catalog of the table, which may be null. ! *
          2. TABLE_SCHEM - The schema of the table, which may be null. ! *
          3. TABLE_NAME - The name of the table. ! *
          4. NON_UNIQUE - Are index values non-unique? ! *
          5. INDEX_QUALIFIER The index catalog, which may be null ! *
          6. INDEX_NAME - The name of the index. ! *
          7. TYPE - The type of index, which will be one of the constants defined ! * in this interface (tableIndexStatistic, ! * tableIndexClustered, tableIndexHashed, or ! * tableIndexOther). ! *
          8. ORDINAL_POSITION - The sequence number of this column in the index. ! * This will be 0 when the index type is tableIndexStatistic. ! *
          9. COLUMN_NAME - The name of this column in the index. ! *
          10. ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a ! * descending sort sequence or null if a sort sequence is not ! * supported. ! *
          11. CARDINALITY - The number of unique rows in the index, or the number ! * of rows in the table if the index type is tableIndexStatistic. ! *
          12. PAGES - The number of pages used for the index, or the number of pages ! * in the table if the index type is tableIndexStatistic. ! *
          13. FILTER_CONDITION - The filter condition for this index, which may be ! * null. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or ! * null to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param table The table name to return information for. ! * @param unique true to return only unique indexes, ! * false otherwise. ! * @param approx true if data values can be approximations, ! * false otherwise. ! * @return A ResultSet with the requested index information ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getIndexInfo(String catalog, String schema, String table, ! boolean unique, boolean approximate) throws SQLException; ! /** ! * This method tests whether or not the datbase supports the specified ! * result type. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * ! * @return true if the result set type is supported, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public boolean supportsResultSetType(int type) throws SQLException; ! /** ! * This method tests whether the specified result set type and result set ! * concurrency type are supported by the database. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @param concur The desired concurrency type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type is supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean supportsResultSetConcurrency(int type, int concurrency) ! throws SQLException; ! /** ! * This method tests whether or not the specified result set type sees its ! * own updates. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type sees its own updates, ! * false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean ownUpdatesAreVisible(int type) throws SQLException; ! /** ! * This method tests whether or not the specified result set type sees its ! * own deletes. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type sees its own deletes, ! * false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean ownDeletesAreVisible(int type) throws SQLException; ! /** ! * This method tests whether or not the specified result set type sees its ! * own inserts. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type sees its own inserts, ! * false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean ownInsertsAreVisible(int type) throws SQLException; ! /** ! * This method tests whether or not the specified result set type sees ! * updates committed by others. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type sees other updates, ! * false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean othersUpdatesAreVisible(int type) throws SQLException; ! /** ! * This method tests whether or not the specified result set type sees ! * deletes committed by others. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type sees other deletes, ! * false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean othersDeletesAreVisible(int type) throws SQLException; ! /** ! * This method tests whether or not the specified result set type sees ! * inserts committed by others. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type sees other inserts, ! * false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean othersInsertsAreVisible(int type) throws SQLException; ! /** ! * This method tests whether or not the specified result set type can detect ! * a visible update by calling the rowUpdated method. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type can detect visible updates ! * using rowUpdated, false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean updatesAreDetected(int type) throws SQLException; ! /** ! * This method tests whether or not the specified result set type can detect ! * a visible delete by calling the rowUpdated method. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type can detect visible deletes ! * using rowUpdated, false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean deletesAreDetected(int type) throws SQLException; ! ! /** ! * This method tests whether or not the specified result set type can detect ! * a visible insert by calling the rowUpdated method. ! * ! * @param type The desired result type, which is one of the constants ! * defined in ResultSet. ! * @return true if the result set type can detect visible inserts ! * using rowUpdated, false otherwise. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public boolean insertsAreDetected(int type) throws SQLException; ! /** ! * This method tests whether or not the database supports batch updates. ! * ! * @return true if batch updates are supported, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean supportsBatchUpdates() throws SQLException; ! /** ! * This method returns the list of user defined data types in use. These ! * are returned as a ResultSet with the following columns: ! *

          ! *

            ! *
          1. TYPE_CAT - The catalog name, which may be null. ! *
          2. TYPE_SCEHM - The schema name, which may be null. ! *
          3. TYPE_NAME - The user defined data type name. ! *
          4. CLASS_NAME - The Java class name this type maps to. ! *
          5. DATA_TYPE - A type identifier from Types for this type. ! * This will be one of JAVA_OBJECT, STRUCT, or ! * DISTINCT. ! *
          6. REMARKS - Comments about this data type. ! *
          ! * ! * @param catalog The catalog to retrieve information from, or the empty string ! * to return entities not associated with a catalog, or null ! * to return information from all catalogs. ! * @param schema The schema to retrieve information from, or the empty string ! * to return entities not associated with a schema. ! * @param typePattern The type name pattern to match. ! * @param types The type identifier patterns (from Types) to ! * match. ! * @return A ResultSet with the requested type information ! * @exception SQLException If an error occurs. ! */ ! public ResultSet getUDTs(String catalog, String schemaPattern, String ! typeNamePattern, int[] types) throws SQLException; ! /** ! * This method returns the Connection object that was used ! * to generate the metadata in this object. ! * ! * @return The connection for this object. ! * @exception SQLException If an error occurs. ! */ ! public Connection getConnection() throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean supportsSavepoints() throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean supportsNamedParameters() throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean supportsMultipleOpenResults() throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean supportsGetGeneratedKeys() throws SQLException; ! /** ! * @since 1.4 ! */ ! public ResultSet getSuperTypes(String catalog, String schemaPattern, ! String typeNamePattern) throws SQLException; ! /** ! * @since 1.4 ! */ ! public ResultSet getSuperTables(String catalog, String schemaPattern, ! String tableNamePattern) throws SQLException; ! /** ! * @since 1.4 ! */ ! public ResultSet getAttributes(String catalog, String schemaPattern, String ! typeNamePattern, String attributeNamePattern) throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean supportsResultSetHoldability(int holdability) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public int getResultSetHoldability() throws SQLException; ! /** ! * @since 1.4 ! */ ! public int getDatabaseMajorVersion() throws SQLException; ! /** ! * @since 1.4 ! */ ! public int getDatabaseMinorVersion() throws SQLException; ! /** ! * @since 1.4 ! */ ! public int getJDBCMajorVersion() throws SQLException; ! /** ! * @since 1.4 ! */ ! public int getJDBCMinorVersion() throws SQLException; ! /** ! * @since 1.4 ! */ ! public int getSQLStateType() throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean locatorsUpdateCopy() throws SQLException; + /** + * @since 1.4 + */ + public boolean supportsStatementPooling() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/DataTruncation.java gcc-3.3/libjava/java/sql/DataTruncation.java *** gcc-3.2.3/libjava/java/sql/DataTruncation.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/DataTruncation.java 2002-06-21 05:39:21.000000000 +0000 *************** *** 1,5 **** /* DataTruncation.java -- Warning when data has been truncated. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* DataTruncation.java -- Warning when data has been truncated. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** this exception to your version of the li *** 35,41 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; /** --- 35,40 ---- *************** package java.sql; *** 44,207 **** * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class DataTruncation extends SQLWarning ! { ! ! /*************************************************************************/ ! ! /* ! * Instance Variables ! */ ! ! /** ! * The original size of the data. ! * @serialized ! */ ! private int dataSize; ! ! /** ! * The index of the parameter or column whose value was truncated. ! * @serialized ! */ ! private int index; ! ! /** ! * Indicates whether or not a parameter value was truncated. ! * @serialized ! */ ! private boolean parameter; ! ! /** ! * Indicates whether or not a data column value was truncated. ! * @serialized ! */ ! private boolean read; ! ! /** ! * This is the size of the data after truncation. ! * @serialized ! */ ! private int transferSize; ! ! /*************************************************************************/ ! ! /** ! * Static Variables ! */ ! ! /** ! * This is the serialization UID for this class ! */ ! private static final long serialVersionUID = 6464298989504059473L; ! ! /*************************************************************************/ ! ! /* ! * Constructors ! */ ! ! /** ! * This method initializes a new instance of DataTruncation ! * with the specified values. The descriptive error message for this ! * exception will be "Data truncation", the SQL state will be "01004" ! * and the vendor specific error code will be set to 0. ! * ! * @param index The index of the parameter or column that was truncated. ! * @param parameter true if a parameter was truncated, ! * false otherwise. ! * @param read true if a data column was truncated, ! * false otherwise. ! * @param dataSize The original size of the data. ! * @param transferSize The size of the data after truncation. ! */ ! public ! DataTruncation(int index, boolean parameter, boolean read, int dataSize, ! int transferSize) { ! super("Data truncation", "01004"); ! this.index = index; ! this.parameter = parameter; ! this.read = read; ! this.dataSize = dataSize; ! this.transferSize = transferSize; ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * This method returns the index of the column or parameter that was ! * truncated. ! * ! * @return The index of the column or parameter that was truncated. ! */ ! public int ! getIndex() ! { ! return(index); ! } ! /*************************************************************************/ ! /** ! * This method determines whether or not it was a parameter that was ! * truncated. ! * ! * @return true if a parameter was truncated, false ! * otherwise. ! */ ! public boolean ! getParameter() ! { ! return(parameter); ! } ! /*************************************************************************/ ! /** ! * This method determines whether or not it was a column that was ! * truncated. ! * ! * @return true if a column was truncated, false ! * otherwise. ! */ ! public boolean ! getRead() ! { ! return(read); ! } ! /*************************************************************************/ ! /** ! * This method returns the original size of the parameter or column that ! * was truncated. ! * ! * @return The original size of the parameter or column that was truncated. ! */ ! public int ! getDataSize() ! { ! return(dataSize); ! } ! /*************************************************************************/ ! /** ! * This method returns the size of the parameter or column after it was ! * truncated. ! * ! * @return The size of the parameter or column after it was truncated. ! */ ! public int ! getTransferSize() ! { ! return(transferSize); } - - } // class DataTruncation - --- 43,157 ---- * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class DataTruncation extends SQLWarning { ! static final long serialVersionUID = 6464298989504059473L; ! /** ! * The original size of the data. ! */ ! private int dataSize; ! /** ! * The index of the parameter or column whose value was truncated. ! */ ! private int index; ! /** ! * Indicates whether or not a parameter value was truncated. ! */ ! private boolean parameter; ! /** ! * Indicates whether or not a data column value was truncated. ! */ ! private boolean read; ! /** ! * This is the size of the data after truncation. ! */ ! private int transferSize; ! /** ! * This method initializes a new instance of DataTruncation ! * with the specified values. The descriptive error message for this ! * exception will be "Data truncation", the SQL state will be "01004" ! * and the vendor specific error code will be set to 0. ! * ! * @param index The index of the parameter or column that was truncated. ! * @param parameter true if a parameter was truncated, ! * false otherwise. ! * @param read true if a data column was truncated, ! * false otherwise. ! * @param dataSize The original size of the data. ! * @param transferSize The size of the data after truncation. ! */ ! public DataTruncation(int index, boolean parameter, boolean read, int ! dataSize, int transferSize) ! { ! super("Data truncation", "01004"); ! this.index = index; ! this.parameter = parameter; ! this.read = read; ! this.dataSize = dataSize; ! this.transferSize = transferSize; ! } ! /** ! * This method returns the index of the column or parameter that was ! * truncated. ! * ! * @return The index of the column or parameter that was truncated. ! */ ! public int getIndex() ! { ! return index; ! } ! /** ! * This method determines whether or not it was a parameter that was ! * truncated. ! * ! * @return true if a parameter was truncated, false ! * otherwise. ! */ ! public boolean getParameter() ! { ! return parameter; ! } ! /** ! * This method determines whether or not it was a column that was ! * truncated. ! * ! * @return true if a column was truncated, false ! * otherwise. ! */ ! public boolean getRead() ! { ! return read; ! } ! /** ! * This method returns the original size of the parameter or column that ! * was truncated. ! * ! * @return The original size of the parameter or column that was truncated. ! */ ! public int getDataSize() ! { ! return dataSize; ! } ! /** ! * This method returns the size of the parameter or column after it was ! * truncated. ! * ! * @return The size of the parameter or column after it was truncated. ! */ ! public int getTransferSize() ! { ! return transferSize; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Date.java gcc-3.3/libjava/java/sql/Date.java *** gcc-3.2.3/libjava/java/sql/Date.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Date.java 2002-06-21 05:39:23.000000000 +0000 *************** this exception to your version of the li *** 35,41 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.text.SimpleDateFormat; --- 35,40 ---- *************** import java.text.SimpleDateFormat; *** 46,149 **** * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class Date extends java.util.Date ! { ! ! /* ! * Class Variables ! */ ! ! /** ! * Used for parsing and formatting this date. ! */ ! private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); ! ! /** ! * This is the serialization UID for this class. ! */ ! private static final long serialVersionUID = 1511598038487230103L; ! ! /*************************************************************************/ ! ! /* ! * Class Methods ! */ ! ! /** ! * This method returns a new instance of this class by parsing a ! * date in JDBC format into a Java date. ! * ! * @param str The string to parse. ! * ! * @return The resulting java.sql.Date value. ! */ ! public static Date ! valueOf(String str) ! { ! try ! { ! java.util.Date d = (java.util.Date)sdf.parseObject(str); ! return(new Date(d.getTime())); ! } ! catch(Exception e) ! { ! return(null); ! } ! } ! ! /*************************************************************************/ ! ! /* ! * Constructors ! */ ! ! /** ! * This method initializes a new instance of this class with the ! * specified year, month, and day. ! * ! * @param year The year of this date minue 1900. ! * @param month The month of this date (0-11). ! * @param day The day of this date (1-31). ! * ! * @deprecated ! */ ! public ! Date(int year, int month, int day) { ! super(year, month, day); ! } ! /*************************************************************************/ ! /** ! * This method initializes a new instance of this class with the ! * specified time value representing the number of seconds since ! * Jan 1, 1970 at 12:00 midnight GMT. ! * ! * @param time The time value to intialize this date to. ! */ ! public ! Date(long date) ! { ! super(date); ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * This method returns this date in JDBC format. ! * ! * @return This date as a string. ! */ ! public String ! toString() ! { ! return(sdf.format(this)); } - - } // class Date - --- 45,113 ---- * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class Date extends java.util.Date { ! static final long serialVersionUID = 1511598038487230103L; ! /** ! * Used for parsing and formatting this date. ! */ ! private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); ! /** ! * This method initializes a new instance of this class with the ! * specified year, month, and day. ! * ! * @param year The year of this date minue 1900. ! * @param month The month of this date (0-11). ! * @param day The day of this date (1-31). ! * ! * @deprecated ! */ ! public Date(int year, int month, int day) ! { ! super(year, month, day); ! } ! /** ! * This method initializes a new instance of this class with the ! * specified time value representing the number of seconds since ! * Jan 1, 1970 at 12:00 midnight GMT. ! * ! * @param time The time value to intialize this date to. ! */ ! public Date(long date) ! { ! super(date); ! } ! /** ! * This method returns a new instance of this class by parsing a ! * date in JDBC format into a Java date. ! * ! * @param str The string to parse. ! * @return The resulting java.sql.Date value. ! */ ! public static Date valueOf(String str) ! { ! try ! { ! java.util.Date d = (java.util.Date) sdf.parseObject(str); ! return(new Date(d.getTime())); ! } ! catch(Exception e) ! { ! return(null); ! } ! } ! /** ! * This method returns this date in JDBC format. ! * ! * @return This date as a string. ! */ ! public String toString() ! { ! return(sdf.format(this)); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Driver.java gcc-3.3/libjava/java/sql/Driver.java *** gcc-3.2.3/libjava/java/sql/Driver.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Driver.java 2002-06-21 05:39:23.000000000 +0000 *************** this exception to your version of the li *** 35,41 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.util.Properties; --- 35,40 ---- *************** import java.util.Properties; *** 54,148 **** * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public interface Driver { ! /** ! * This method returns the major version number of the driver. ! * ! * @return The major version number of the driver. ! */ ! public abstract int ! getMajorVersion(); ! ! /*************************************************************************/ ! ! /** ! * This method returns the minor version number of the driver. ! * ! * @return The minor version number of the driver. ! */ ! public abstract int ! getMinorVersion(); ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the driver is JDBC compliant. This ! * method should only return true if the driver has been ! * certified as JDBC compliant. ! * ! * @return true if the driver has been certified JDBC compliant, ! * false otherwise. ! */ ! public abstract boolean ! jdbcCompliant(); ! ! /*************************************************************************/ ! ! /** ! * This method returns an array of possible properties that could be ! * used to connect to the specified database. ! * ! * @param url The URL string of the database to connect to. ! * @param properties The list of properties the caller is planning to use ! * to connect to the database. ! * ! * @return A list of possible additional properties for a connection to this ! * database. This list may be empty. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract DriverPropertyInfo[] ! getPropertyInfo(String url, Properties properties) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the driver believes it can connect to ! * the specified database. The driver should only test whether it ! * understands and accepts the URL. It should not necessarily attempt to ! * probe the database for a connection. ! * ! * @param The database URL string. ! * ! * @return true if the drivers can connect to the database, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! acceptsURL(String url) throws SQLException; ! /*************************************************************************/ ! /** ! * This method connects to the specified database using the connection ! * properties supplied. If the driver does not understand the database ! * URL, it should return null instead of throwing an ! * exception since the DriverManager will probe a driver ! * in this manner. ! * ! * @param url The URL string for this connection. ! * @param properties The list of database connection properties. ! * ! * @return A Connection object for the newly established ! * connection, or null if the URL is not understood. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Connection ! connect(String url, Properties properties) throws SQLException; ! } // interface Driver --- 53,123 ---- * * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public interface Driver { + /** + * This method connects to the specified database using the connection + * properties supplied. If the driver does not understand the database + * URL, it should return null instead of throwing an + * exception since the DriverManager will probe a driver + * in this manner. + * + * @param url The URL string for this connection. + * @param properties The list of database connection properties. + * @return A Connection object for the newly established + * connection, or null if the URL is not understood. + * @exception SQLException If an error occurs. + */ + public Connection connect(String url, Properties info) throws SQLException; ! /** ! * This method tests whether or not the driver believes it can connect to ! * the specified database. The driver should only test whether it ! * understands and accepts the URL. It should not necessarily attempt to ! * probe the database for a connection. ! * ! * @param The database URL string. ! * @return true if the drivers can connect to the database, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean acceptsURL(String url) throws SQLException; ! /** ! * This method returns an array of possible properties that could be ! * used to connect to the specified database. ! * ! * @param url The URL string of the database to connect to. ! * @param properties The list of properties the caller is planning to use ! * to connect to the database. ! * @return A list of possible additional properties for a connection to this ! * database. This list may be empty. ! * @exception SQLException If an error occurs. ! */ ! public DriverPropertyInfo[] getPropertyInfo(String url, Properties properties) ! throws SQLException; ! /** ! * This method returns the major version number of the driver. ! * ! * @return The major version number of the driver. ! */ ! public int getMajorVersion(); ! /** ! * This method returns the minor version number of the driver. ! * ! * @return The minor version number of the driver. ! */ ! public int getMinorVersion(); + /** + * This method tests whether or not the driver is JDBC compliant. This + * method should only return true if the driver has been + * certified as JDBC compliant. + * + * @return true if the driver has been certified JDBC compliant, + * false otherwise. + */ + public boolean jdbcCompliant(); + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/DriverManager.java gcc-3.3/libjava/java/sql/DriverManager.java *** gcc-3.2.3/libjava/java/sql/DriverManager.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/DriverManager.java 2002-06-21 05:39:23.000000000 +0000 *************** this exception to your version of the li *** 35,49 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.PrintStream; import java.io.PrintWriter; import java.util.Enumeration; import java.util.Properties; - import java.util.StringTokenizer; import java.util.Vector; /** * This class manages the JDBC drivers in the system. It maintains a --- 35,48 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; import java.io.PrintStream; import java.io.PrintWriter; import java.util.Enumeration; import java.util.Properties; import java.util.Vector; + import java.util.StringTokenizer; /** * This class manages the JDBC drivers in the system. It maintains a *************** import java.util.Vector; *** 65,245 **** */ public class DriverManager { ! /* ! * Class Variables ! */ ! /** ! * This is the log stream for JDBC drivers. ! */ ! private static PrintStream log_stream; ! /** ! * This is the log writer for JDBC drivers. ! */ ! private static PrintWriter log_writer; ! /** ! * This is the login timeout used by JDBC drivers. ! */ ! private static int login_timeout; ! /** ! * This is the list of JDBC drivers that are loaded. ! */ ! private static Vector drivers; ! // Hmm, seems like we might want to do a Hashtable and lookup by something, ! // but what would it be? ! // Load all drivers on startup ! static ! { ! drivers = new Vector(); ! String driver_string = System.getProperty("jdbc.drivers"); ! if (driver_string != null) ! { ! StringTokenizer st = new StringTokenizer(driver_string); ! while (st.hasMoreTokens()) ! { ! String driver_classname = st.nextToken(); ! try ! { ! Class.forName(driver_classname); // The driver registers itself ! } ! catch (Exception e) { ; } // Ignore not founds ! } ! } ! } ! /*************************************************************************/ ! ! /* ! * Class Methods ! */ ! ! /** ! * This method returns the login timeout in use by JDBC drivers systemwide. ! * ! * @return The login timeout. ! */ ! public static int ! getLoginTimeout() ! { ! return(login_timeout); ! } ! ! /*************************************************************************/ /** ! * This method set the login timeout used by JDBC drivers. This is a ! * system-wide parameter that applies to all drivers. * ! * @param login_timeout The new login timeout value. ! */ ! public static void ! setLoginTimeout(int login_timeout) ! { ! DriverManager.login_timeout = login_timeout; ! } ! ! /*************************************************************************/ ! ! /** ! * This method returns the log writer being used by all JDBC drivers. ! * This method should be used in place of the deprecated ! * getLogStream method. * ! * @return The log writer in use by JDBC drivers. ! */ ! public static PrintWriter ! getLogWriter() ! { ! return(log_writer); ! } ! ! /*************************************************************************/ ! ! /** ! * This method sets the log writer being used by JDBC drivers. This is a ! * system-wide parameter that affects all drivers. Note that since there ! * is no way to retrieve a PrintStream from a ! * PrintWriter, this method cannot set the log stream in ! * use by JDBC. Thus any older drivers may not see this setting. * ! * @param log_writer The new log writer for JDBC. */ ! public static void ! setLogWriter(PrintWriter log_writer) ! { ! DriverManager.log_writer = log_writer; ! } ! /*************************************************************************/ - /** - * This method returns the log stream in use by JDBC. - * - * @return The log stream in use by JDBC. - * - * @deprecated Use getLogWriter() instead. - */ - public static PrintStream - getLogStream() - { - return(log_stream); - } ! /*************************************************************************/ ! /** ! * This method sets the log stream in use by JDBC. ! * ! * @param log_stream The log stream in use by JDBC. ! * ! * @deprecated Use setLogWriter instead. ! */ ! public static void ! setLogStream(PrintStream log_stream) ! { ! DriverManager.log_stream = log_stream; ! } ! /*************************************************************************/ ! /** ! * This method prints the specified line to the log stream. ! * ! * @param str The string to write to the log stream. ! */ ! public static void ! println(String str) ! { ! if (log_stream != null) // Watch for user not using logging ! log_stream.println(str); ! } ! /*************************************************************************/ ! /** ! * This method registers a new driver with the manager. This is normally ! * called by the driver itself in a static initializer. ! * ! * @param driver The new Driver to add. ! * ! * @exception SQLException If an error occurs. ! */ ! public static void ! registerDriver(Driver driver) throws SQLException ! { ! if (!drivers.contains(driver)) ! drivers.addElement(driver); ! } ! /*************************************************************************/ /** * This method de-registers a driver from the manager. --- 64,245 ---- */ public class DriverManager { + /** + * This is the log stream for JDBC drivers. + */ + private static PrintStream log_stream; ! /** ! * This is the log writer for JDBC drivers. ! */ ! private static PrintWriter log_writer; ! /** ! * This is the login timeout used by JDBC drivers. ! */ ! private static int login_timeout; ! /** ! * This is the list of JDBC drivers that are loaded. ! */ ! private static Vector drivers; ! // Hmm, seems like we might want to do a Hashtable and lookup by something, ! // but what would it be? ! // Load all drivers on startup ! static ! { ! drivers = new Vector(); ! String driver_string = System.getProperty("jdbc.drivers"); ! if (driver_string != null) ! { ! StringTokenizer st = new StringTokenizer(driver_string); ! while (st.hasMoreTokens()) ! { ! String driver_classname = st.nextToken(); ! try ! { ! Class.forName(driver_classname); // The driver registers itself ! } ! catch (Exception e) { ; } // Ignore not founds ! } ! } ! } ! /** Can't be instantiated. */ ! private DriverManager() ! { ! } ! /** ! * This method returns the log writer being used by all JDBC drivers. ! * This method should be used in place of the deprecated ! * getLogStream method. ! * ! * @return The log writer in use by JDBC drivers. ! */ ! public static PrintWriter getLogWriter() ! { ! return log_writer; ! } ! /** ! * This method sets the log writer being used by JDBC drivers. This is a ! * system-wide parameter that affects all drivers. Note that since there ! * is no way to retrieve a PrintStream from a ! * PrintWriter, this method cannot set the log stream in ! * use by JDBC. Thus any older drivers may not see this setting. ! * ! * @param out The new log writer for JDBC. ! */ ! public static void setLogWriter(PrintWriter out) ! { ! DriverManager.log_writer = out; ! } /** ! * This method attempts to return a connection to the specified ! * JDBC URL string using the specified connection properties. * ! * @param url The JDBC URL string to connect to. ! * @param properties The connection properties. * ! * @return A Connection to that URL. * ! * @exception SQLException If an error occurs. */ ! public static Connection getConnection(String url, Properties properties) ! throws SQLException ! { ! Driver d = getDriver(url); ! if (d == null) ! throw new SQLException("Driver not found for URL: " + url); ! return d.connect(url, properties); ! } ! /** ! * This method attempts to return a connection to the specified ! * JDBC URL string using the specified username and password. ! * ! * @param url The JDBC URL string to connect to. ! * @param user The username to connect with. ! * @param password The password to connect with. ! * @return A Connection to that URL. ! * @exception SQLException If an error occurs. ! */ ! public static Connection getConnection(String url, String user, ! String password) throws SQLException ! { ! Properties p = new Properties(); ! if (user != null) ! p.setProperty("user", user); ! if (password != null) ! p.setProperty("password", password); ! return getConnection(url, p); ! } ! /** ! * This method attempts to return a connection to the specified ! * JDBC URL string. ! * ! * @param url The JDBC URL string to connect to. ! * ! * @return A Connection to that URL. ! * ! * @exception SQLException If an error occurs. ! */ ! public static Connection getConnection(String url) throws SQLException ! { ! return getConnection(url, new Properties()); ! } ! /** ! * This method returns a driver that can connect to the specified ! * JDBC URL string. This will be selected from among drivers loaded ! * at initialization time and those drivers manually loaded by the ! * same class loader as the caller. ! * ! * @param url The JDBC URL string to find a driver for. ! * ! * @return A Driver that can connect to the specified ! * URL, or null if a suitable driver cannot be found. ! * ! * @exception SQLException If an error occurs. ! */ ! public static Driver getDriver(String url) throws SQLException ! { ! // FIXME: Limit driver search to the appropriate subset of loaded drivers. ! Enumeration e = drivers.elements(); ! while(e.hasMoreElements()) ! { ! Driver d = (Driver)e.nextElement(); ! if (d.acceptsURL(url)) ! return d; ! } ! return null; ! } ! /** ! * This method registers a new driver with the manager. This is normally ! * called by the driver itself in a static initializer. ! * ! * @param driver The new Driver to add. ! * ! * @exception SQLException If an error occurs. ! */ ! public static void registerDriver(Driver driver) throws SQLException ! { ! if (! drivers.contains(driver)) ! drivers.addElement(driver); ! } /** * This method de-registers a driver from the manager. *************** registerDriver(Driver driver) throws SQL *** 248,405 **** * * @exception SQLException If an error occurs. */ ! public static void ! deregisterDriver(Driver driver) throws SQLException ! { ! if (drivers.contains(driver)) ! drivers.removeElement(driver); ! } ! ! /*************************************************************************/ ! ! /** ! * This method returns a list of all the currently registered JDBC drivers ! * that were loaded by the current ClassLoader. ! * ! * @return An Enumeration of all currently loaded JDBC drivers. ! */ ! public static Enumeration ! getDrivers() ! { ! Vector v = new Vector(); ! Enumeration e = drivers.elements(); ! ! // Is this right? ! ClassLoader cl = Thread.currentThread().getContextClassLoader(); ! ! while(e.hasMoreElements()) ! { ! Object obj = e.nextElement(); ! ! ClassLoader loader = obj.getClass().getClassLoader(); ! ! if (loader == null) ! loader = ClassLoader.getSystemClassLoader(); ! if (!loader.equals(cl)) ! continue; ! ! v.addElement(obj); ! } ! ! return(v.elements()); ! } ! ! /*************************************************************************/ ! ! /** ! * This method returns a driver that can connect to the specified ! * JDBC URL string. This will be selected from among drivers loaded ! * at initialization time and those drivers manually loaded by the ! * same class loader as the caller. ! * ! * @param url The JDBC URL string to find a driver for. ! * ! * @return A Driver that can connect to the specified ! * URL, or null if a suitable driver cannot be found. ! * ! * @exception SQLException If an error occurs. ! */ ! public static Driver ! getDriver(String url) throws SQLException ! { ! // FIXME: Limit driver search to the appropriate subset of loaded drivers. ! ! Enumeration e = drivers.elements(); ! while(e.hasMoreElements()) ! { ! Driver d = (Driver)e.nextElement(); ! if (d.acceptsURL(url)) ! return(d); ! } ! ! return(null); ! } ! /*************************************************************************/ ! /** ! * This method attempts to return a connection to the specified ! * JDBC URL string. ! * ! * @param url The JDBC URL string to connect to. ! * ! * @return A Connection to that URL. ! * ! * @exception SQLException If an error occurs. ! */ ! public static Connection ! getConnection(String url) throws SQLException ! { ! return(getConnection(url, new Properties())); ! } ! /*************************************************************************/ ! /** ! * This method attempts to return a connection to the specified ! * JDBC URL string using the specified username and password. ! * ! * @param url The JDBC URL string to connect to. ! * @param user The username to connect with. ! * @param password The password to connect with. ! * ! * @return A Connection to that URL. ! * ! * @exception SQLException If an error occurs. ! */ ! public static Connection ! getConnection(String url, String user, String password) throws SQLException ! { ! Properties p = new Properties(); ! if (user != null) ! p.setProperty("user", user); ! if (password != null) ! p.setProperty("password", password); ! return(getConnection(url, p)); ! } ! /*************************************************************************/ ! /** ! * This method attempts to return a connection to the specified ! * JDBC URL string using the specified connection properties. ! * ! * @param url The JDBC URL string to connect to. ! * @param properties The connection properties. ! * ! * @return A Connection to that URL. ! * ! * @exception SQLException If an error occurs. ! */ ! public static Connection ! getConnection(String url, Properties properties) throws SQLException ! { ! Driver d = getDriver(url); ! if (d == null) ! throw new SQLException("Driver not found for URL: " + url); ! return(d.connect(url, properties)); ! } ! /*************************************************************************/ ! /* ! * Constructors ! */ ! // Keep bozos from trying to instantiate us. ! private ! DriverManager() ! { ! ; } - - } // class DriverManager - --- 248,343 ---- * * @exception SQLException If an error occurs. */ ! public static void deregisterDriver(Driver driver) throws SQLException ! { ! if (drivers.contains(driver)) ! drivers.removeElement(driver); ! } ! /** ! * This method returns a list of all the currently registered JDBC drivers ! * that were loaded by the current ClassLoader. ! * ! * @return An Enumeration of all currently loaded JDBC drivers. ! */ ! public static Enumeration getDrivers() ! { ! Vector v = new Vector(); ! Enumeration e = drivers.elements(); ! // Is this right? ! ClassLoader cl = Thread.currentThread().getContextClassLoader(); ! while(e.hasMoreElements()) ! { ! Object obj = e.nextElement(); ! ClassLoader loader = obj.getClass().getClassLoader(); ! if (loader == null) ! loader = ClassLoader.getSystemClassLoader(); ! if (! loader.equals(cl)) ! continue; ! v.addElement(obj); ! } ! return v.elements(); ! } ! /** ! * This method set the login timeout used by JDBC drivers. This is a ! * system-wide parameter that applies to all drivers. ! * ! * @param login_timeout The new login timeout value. ! */ ! public static void setLoginTimeout(int seconds) ! { ! DriverManager.login_timeout = login_timeout; ! } ! /** ! * This method returns the login timeout in use by JDBC drivers systemwide. ! * ! * @return The login timeout. ! */ ! public static int getLoginTimeout() ! { ! return login_timeout; ! } ! /** ! * This method sets the log stream in use by JDBC. ! * ! * @param log_stream The log stream in use by JDBC. ! * ! * @deprecated Use setLogWriter instead. ! */ ! public static void setLogStream(PrintStream out) ! { ! DriverManager.log_stream = log_stream; ! } ! /** ! * This method returns the log stream in use by JDBC. ! * ! * @return The log stream in use by JDBC. ! * ! * @deprecated Use getLogWriter() instead. ! */ ! public static PrintStream getLogStream() ! { ! return log_stream; ! } ! /** ! * This method prints the specified line to the log stream. ! * ! * @param str The string to write to the log stream. ! */ ! public static void println(String message) ! { ! if (log_stream != null) // Watch for user not using logging ! log_stream.println(message); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/DriverPropertyInfo.java gcc-3.3/libjava/java/sql/DriverPropertyInfo.java *** gcc-3.2.3/libjava/java/sql/DriverPropertyInfo.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/DriverPropertyInfo.java 2002-06-21 05:39:23.000000000 +0000 *************** exception statement from your version. * *** 39,102 **** package java.sql; /** ! * This class holds a driver property that can be used for querying or ! * setting driver configuration parameters. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class DriverPropertyInfo ! { ! ! /* ! * Instance Variables */ ! /** ! * The name of the property. ! */ ! public String name; ! ! /** ! * This is the value of the property. ! */ ! public String value; ! ! /** ! * A description of the property, possibly null. ! */ ! public String description; ! ! /** ! * A flag indicating whether or not a value for this property is required ! * in order to connect to the database. ! */ ! public boolean required; ! /** ! * If values are restricted to certain choices, this is the list of valid ! * ones. Otherwise it is null. ! */ ! public String[] choices; ! /*************************************************************************/ ! /* ! * Constructors ! */ ! /** ! * This method initializes a new instance of DriverPropertyInfo ! * with the specified name and value. All other fields are defaulted. ! * ! * @param name The name of the property. ! * @param value The value to assign to the property. ! */ ! public ! DriverPropertyInfo(String name, String value) ! { ! this.name = name; ! this.value = value; } - - } // DriverPropertyInfo - --- 39,88 ---- package java.sql; /** ! * This class holds a driver property that can be used for querying or ! * setting driver configuration parameters. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ + public class DriverPropertyInfo + { + /** + * The name of the property. + */ + public String name; ! /** ! * A description of the property, possibly null. ! */ ! public String description; ! /** ! * A flag indicating whether or not a value for this property is required ! * in order to connect to the database. ! */ ! public boolean required; ! /** ! * This is the value of the property. ! */ ! public String value; ! /** ! * If values are restricted to certain choices, this is the list of valid ! * ones. Otherwise it is null. ! */ ! public String[] choices; ! /** ! * This method initializes a new instance of DriverPropertyInfo ! * with the specified name and value. All other fields are defaulted. ! * ! * @param name The name of the property. ! * @param value The value to assign to the property. ! */ ! public DriverPropertyInfo(String name, String value) ! { ! this.name = name; ! this.value = value; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/ParameterMetaData.java gcc-3.3/libjava/java/sql/ParameterMetaData.java *** gcc-3.2.3/libjava/java/sql/ParameterMetaData.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/sql/ParameterMetaData.java 2002-06-21 05:39:23.000000000 +0000 *************** *** 0 **** --- 1,103 ---- + /* ParameterMetaData.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.sql; + + /** + * @since 1.4 + */ + public interface ParameterMetaData + { + public static final int parameterNoNulls = 0; + + public static final int parameterNullable = 1; + + public static final int parameterNullableUnknown = 2; + + public static final int parameterModeUnknown = 0; + + public static final int parameterModeIn = 1; + + public static final int parameterModeInOut = 2; + + public static final int parameterModeOut = 4; + + /** + * @since 1.4 + */ + public int getParameterCount() throws SQLException; + + /** + * @since 1.4 + */ + public int isNullable(int param) throws SQLException; + + /** + * @since 1.4 + */ + public boolean isSigned(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getPrecision(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getScale(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getParameterType(int param) throws SQLException; + + /** + * @since 1.4 + */ + public String getParameterTypeName(int param) throws SQLException; + + /** + * @since 1.4 + */ + public String getParameterClassName(int param) throws SQLException; + + /** + * @since 1.4 + */ + public int getParameterMode(int param) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/PreparedStatement.java gcc-3.3/libjava/java/sql/PreparedStatement.java *** gcc-3.2.3/libjava/java/sql/PreparedStatement.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/PreparedStatement.java 2002-06-21 05:39:23.000000000 +0000 *************** this exception to your version of the li *** 35,557 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.util.Calendar; /** ! * This interface provides a mechanism for executing pre-compiled ! * statements. This provides greater efficiency when calling the same ! * statement multiple times. Parameters are allowed in a statement, ! * providings for maximum reusability. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface PreparedStatement extends Statement { ! /** ! * This method populates the specified parameter with a SQL NULL value ! * for the specified type. ! * ! * @param index The index of the parameter to set. ! * @param type The SQL type identifier of the parameter from Types ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setNull(int index, int type) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method populates the specified parameter with a SQL NULL value ! * for the specified type. ! * ! * @param index The index of the parameter to set. ! * @param type The SQL type identifier of the parameter from Types ! * @param name The name of the data type, for user defined types. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setNull(int index, int type, String name) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * boolean value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setBoolean(int index, boolean value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * byte value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setByte(int index, byte value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * short value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setShort(int index, short value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * int value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setInt(int index, int value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * long value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setLong(int index, long value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * float value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setFloat(int index, float value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * double value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setDouble(int index, double value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * String value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setString(int index, String value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * byte array value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setBytes(int index, byte[] value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * java.math.BigDecimal value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setBigDecimal(int index, java.math.BigDecimal value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Date value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setDate(int index, java.sql.Date value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Date value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param calendar The Calendar to use for timezone and locale. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setDate(int index, java.sql.Date value, Calendar calendar) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Time value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setTime(int index, java.sql.Time value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Time value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param calendar The Calendar to use for timezone and locale. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setTime(int index, java.sql.Time value, Calendar calendar) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Timestamp value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setTimestamp(int index, java.sql.Timestamp value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Timestamp value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param calendar The Calendar to use for timezone and locale. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setTimestamp(int index, java.sql.Timestamp value, Calendar calendar) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * ASCII InputStream value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setAsciiStream(int index, InputStream value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Unicode UTF-8 InputStream value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setUnicodeStream(int index, InputStream value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * binary InputStream value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setBinaryStream(int index, InputStream value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * character Reader value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setCharacterStream(int index, Reader value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Ref value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setRef(int index, Ref value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Blob value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setBlob(int index, Blob value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Clob value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setClob(int index, Clob value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Array value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setArray(int index, Array value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Object value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setObject(int index, Object value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Object value. The specified SQL object type will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param type The SQL type to use for the parameter, from Types ! * ! * @exception SQLException If an error occurs. ! * ! * @see Types ! */ ! public abstract void ! setObject(int index, Object value, int type) throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the specified parameter from the given Java ! * Object value. The specified SQL object type will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param type The SQL type to use for the parameter, from Types ! * @param scale The scale of the value, for numeric values only. ! * ! * @exception SQLException If an error occurs. ! * ! * @see Types ! */ ! public abstract void ! setObject(int index, Object value, int type, int scale) throws SQLException; ! /*************************************************************************/ ! /** ! * This method adds a set of parameters to the batch for JDBC 2.0. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! addBatch() throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method clears all of the input parameter that have been ! * set on this statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! clearParameters() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns meta data for the result set from this statement. ! * ! * @return Meta data for the result set from this statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSetMetaData ! getMetaData() throws SQLException; ! /*************************************************************************/ ! /** ! * This method executes a prepared SQL query. ! * Some prepared statements return multiple results; the execute method ! * handles these complex statements as well as the simpler form of ! * statements handled by executeQuery and executeUpdate. ! * ! * @return The result of the SQL statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! execute() throws SQLException; ! /*************************************************************************/ ! /** ! * This method executes a prepared SQL query and returns its ResultSet. ! * ! * @return The ResultSet of the SQL statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! executeQuery() throws SQLException; ! /*************************************************************************/ ! /** ! * This method executes an SQL INSERT, UPDATE or DELETE statement. SQL ! * statements that return nothing such as SQL DDL statements can be executed. ! * ! * @return The result is either the row count for INSERT, UPDATE or DELETE ! * statements; or 0 for SQL statements that return nothing. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! executeUpdate() throws SQLException; ! } // interface PreparedStatement --- 35,438 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; + import java.net.URL; import java.util.Calendar; /** ! * This interface provides a mechanism for executing pre-compiled ! * statements. This provides greater efficiency when calling the same ! * statement multiple times. Parameters are allowed in a statement, ! * providings for maximum reusability. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface PreparedStatement extends Statement { + /** + * This method executes a prepared SQL query and returns its ResultSet. + * + * @return The ResultSet of the SQL statement. + * @exception SQLException If an error occurs. + */ + public ResultSet executeQuery() throws SQLException; ! /** ! * This method executes an SQL INSERT, UPDATE or DELETE statement. SQL ! * statements that return nothing such as SQL DDL statements can be executed. ! * ! * @return The result is either the row count for INSERT, UPDATE or DELETE ! * statements; or 0 for SQL statements that return nothing. ! * @exception SQLException If an error occurs. ! */ ! public int executeUpdate() throws SQLException; ! /** ! * This method populates the specified parameter with a SQL NULL value ! * for the specified type. ! * ! * @param index The index of the parameter to set. ! * @param type The SQL type identifier of the parameter from Types ! * ! * @exception SQLException If an error occurs. ! */ ! public void setNull(int parameterIndex, int sqlType) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * boolean value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setBoolean(int parameterIndex, boolean x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * byte value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setByte(int parameterIndex, byte x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * short value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setShort(int parameterIndex, short x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * int value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setInt(int parameterIndex, int x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * long value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setLong(int parameterIndex, long x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * float value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setFloat(int parameterIndex, float x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * double value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setDouble(int parameterIndex, double x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * java.math.BigDecimal value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setBigDecimal(int parameterIndex, BigDecimal x) throws ! SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * String value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setString(int parameterIndex, String x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * byte array value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setBytes(int parameterIndex, byte[] x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Date value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setDate(int parameterIndex, Date x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Time value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setTime(int parameterIndex, Time x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Timestamp value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setTimestamp(int parameterIndex, Timestamp x) ! throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * ASCII InputStream value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * @exception SQLException If an error occurs. ! */ ! public void setAsciiStream(int parameterIndex, InputStream x, int length) ! throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Unicode UTF-8 InputStream value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * @exception SQLException If an error occurs. ! * @deprecated ! */ ! public void setUnicodeStream(int parameterIndex, InputStream x, int length) ! throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * binary InputStream value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * @exception SQLException If an error occurs. ! */ ! public void setBinaryStream(int parameterIndex, InputStream x, int length) ! throws SQLException; ! /** ! * This method clears all of the input parameter that have been ! * set on this statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public void clearParameters() throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Object value. The specified SQL object type will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param type The SQL type to use for the parameter, from Types ! * @param scale The scale of the value, for numeric values only. ! * @exception SQLException If an error occurs. ! * @see Types ! */ ! public void setObject(int parameterIndex, Object x, int targetSqlType, ! int scale) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Object value. The specified SQL object type will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param type The SQL type to use for the parameter, from Types ! * @exception SQLException If an error occurs. ! * @see Types ! */ ! public void setObject(int parameterIndex, Object x, int targetSqlType) ! throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Object value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setObject(int parameterIndex, Object x) throws SQLException; ! /** ! * This method executes a prepared SQL query. ! * Some prepared statements return multiple results; the execute method ! * handles these complex statements as well as the simpler form of ! * statements handled by executeQuery and executeUpdate. ! * ! * @return The result of the SQL statement. ! * @exception SQLException If an error occurs. ! */ ! public boolean execute() throws SQLException; ! /** ! * This method adds a set of parameters to the batch for JDBC 2.0. ! * @exception SQLException If an error occurs. ! */ ! public void addBatch() throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * character Reader value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param length The number of bytes in the stream. ! * @exception SQLException If an error occurs. ! */ ! public void setCharacterStream(int parameterIndex, Reader reader, ! int length) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Ref value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setRef(int i, Ref x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Blob value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setBlob(int i, Blob x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Clob value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setClob(int i, Clob x) throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * Array value. The default object type to SQL type mapping ! * will be used. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @exception SQLException If an error occurs. ! */ ! public void setArray(int i, Array x) throws SQLException; ! /** ! * This method returns meta data for the result set from this statement. ! * ! * @return Meta data for the result set from this statement. ! * @exception SQLException If an error occurs. ! */ ! public ResultSetMetaData getMetaData() throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Date value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param calendar The Calendar to use for timezone and locale. ! * @exception SQLException If an error occurs. ! */ ! public void setDate(int parameterIndex, Date x, Calendar cal) ! throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Time value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param calendar The Calendar to use for timezone and locale. ! * @exception SQLException If an error occurs. ! */ ! public void setTime(int parameterIndex, Time x, Calendar cal) ! throws SQLException; ! /** ! * This method sets the specified parameter from the given Java ! * java.sql.Timestamp value. ! * ! * @param index The index of the parameter value to set. ! * @param value The value of the parameter. ! * @param calendar The Calendar to use for timezone and locale. ! * @exception SQLException If an error occurs. ! */ ! public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) ! throws SQLException; ! /** ! * This method populates the specified parameter with a SQL NULL value ! * for the specified type. ! * ! * @param index The index of the parameter to set. ! * @param type The SQL type identifier of the parameter from Types ! * @param name The name of the data type, for user defined types. ! * @exception SQLException If an error occurs. ! */ ! public void setNull(int paramIndex, int sqlType, String typeName) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public void setURL(int parameterIndex, URL x) throws SQLException; + /** + * @since 1.4 + */ + public ParameterMetaData getParameterMetaData() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Ref.java gcc-3.3/libjava/java/sql/Ref.java *** gcc-3.2.3/libjava/java/sql/Ref.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Ref.java 2002-06-21 05:39:23.000000000 +0000 *************** this exception to your version of the li *** 35,62 **** obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ - package java.sql; /** ! * This interface provides a mechanism for obtaining information about ! * a SQL structured type ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Ref { ! /** ! * This method returns the fully qualified name of the SQL structured ! * type of the referenced item. ! * ! * @return The fully qualified name of the SQL structured type. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getBaseTypeName() throws SQLException; ! } // interface Ref --- 35,75 ---- obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.sql; + import java.util.Map; + /** ! * This interface provides a mechanism for obtaining information about ! * a SQL structured type ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @since 1.2 ! */ ! public interface Ref { + /** + * This method returns the fully qualified name of the SQL structured + * type of the referenced item. + * + * @return The fully qualified name of the SQL structured type. + * @exception SQLException If an error occurs. + * @since 1.2 + */ + public String getBaseTypeName() throws SQLException; ! /** ! * @since 1.4 ! */ ! public Object getObject(Map map) throws SQLException; ! /** ! * @since 1.4 ! */ ! public Object getObject() throws SQLException; + /** + * @since 1.4 + */ + public void setObject(Object value) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/ResultSet.java gcc-3.3/libjava/java/sql/ResultSet.java *** gcc-3.2.3/libjava/java/sql/ResultSet.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/ResultSet.java 2002-06-21 05:39:23.000000000 +0000 *************** *** 1,5 **** /* ResultSet.java -- A SQL statement result set. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ResultSet.java -- A SQL statement result set. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.sql; *** 41,2017 **** import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.util.Calendar; import java.util.Map; /** ! * This interface provides access to the data set returned by a SQL ! * statement. An instance of this interface is returned by the various ! * execution methods in the Statement ! * This class models a cursor, which can be stepped through one row at a ! * time. Methods are provided for accessing columns by column name or by ! * index. ! *

          ! * Note that a result set is invalidated if the statement that returned ! * it is closed. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface ResultSet { ! /** ! * The rows will be processed in order from first to last. ! */ ! public static final int FETCH_FORWARD = 0; ! ! /** ! * The rows will be processed in order from last to first. ! */ ! public static final int FETCH_REVERSE = 1; ! ! /** ! * The rows will be processed in an unknown order ! */ ! public static final int FETCH_UNKNOWN = 2; ! ! /** ! * This type of result set may only step forward through the rows returned. ! */ ! public static final int TYPE_FORWARD_ONLY = 0; ! ! /** ! * This type of result set is scrollable and is not sensitive to changes ! * made by other statements. ! */ ! public static final int TYPE_SCROLL_INSENSITIVE = 1; ! ! /** ! * This type of result set is scrollable and is also sensitive to changes ! * made by other statements. ! */ ! public static final int TYPE_SCROLL_SENSITIVE = 1; ! ! /** ! * The concurrency mode of for the result set may not be modified. ! */ ! public static final int CONCUR_READ_ONLY = 0; ! ! /** ! * The concurrency mode of for the result set may be modified. ! */ ! public static final int CONCUR_UPDATABLE = 1; ! ! /*************************************************************************/ ! ! /** ! * This method advances to the next row in the result set. Any streams ! * open on the current row are closed automatically. ! * ! * @return true if the next row exists, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! next() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method moves the current position to the previous row in the ! * result set. ! * ! * @return true if the previous row exists, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! previous() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method closes the result set and frees any associated resources. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! close() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether the value of the last column that was fetched ! * was actually a SQL NULL value. ! * ! * @return true if the last column fetched was a NULL, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! wasNull() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * String. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a String. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getString(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * Object. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as an Object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getObject(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * boolean. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a boolean. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! getBoolean(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * byte. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a byte. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte ! getByte(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * short. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a short. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract short ! getShort(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * int. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a int. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getInt(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * long. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a long. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! getLong(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * float. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a float. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract float ! getFloat(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * double. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a double. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract double ! getDouble(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a BigDecimal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract BigDecimal ! getBigDecimal(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param index The index of the column to return. ! * @param scale The number of digits to the right of the decimal to return. ! * ! * @return The column value as a BigDecimal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract BigDecimal ! getBigDecimal(int index, int scale) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * byte array. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a byte array ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte[] ! getBytes(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Date. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a java.sql.Date. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Date ! getDate(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Time. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a java.sql.Time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Time ! getTime(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Timestamp. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Timestamp ! getTimestamp(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as an ASCII ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as an ASCII InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getAsciiStream(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Unicode UTF-8 ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a Unicode UTF-8 InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getUnicodeStream(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a raw byte ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as a raw byte InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getBinaryStream(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a character ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * ! * @return The column value as an character Reader. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Reader ! getCharacterStream(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * String. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a String. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getString(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * Object. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as an Object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getObject(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * boolean. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a boolean. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! getBoolean(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * byte. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a byte. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte ! getByte(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * short. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a short. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract short ! getShort(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * int. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a int. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getInt(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * long. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a long. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! getLong(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * float. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a float. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract float ! getFloat(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * double. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a double. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract double ! getDouble(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a BigDecimal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract BigDecimal ! getBigDecimal(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param column The name of the column to return. ! * @param scale The number of digits to the right of the decimal to return. ! * ! * @return The column value as a BigDecimal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract BigDecimal ! getBigDecimal(String column, int scale) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * byte array. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a byte array ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte[] ! getBytes(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Date. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a java.sql.Date. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Date ! getDate(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Time. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a java.sql.Time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Time ! getTime(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Timestamp. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Timestamp ! getTimestamp(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as an ASCII ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as an ASCII InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getAsciiStream(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a Unicode UTF-8 ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a Unicode UTF-8 InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getUnicodeStream(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a raw byte ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as a raw byte InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! getBinaryStream(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the value of the specified column as a character ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * ! * @return The column value as an character Reader. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Reader ! getCharacterStream(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the first SQL warning associated with this result ! * set. Any additional warnings will be chained to this one. ! * ! * @return The first SQLWarning for this result set, or null if ! * there are no warnings. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract SQLWarning ! getWarnings() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method clears all warnings associated with this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! clearWarnings() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the name of the database cursor used by this ! * result set. ! * ! * @return The name of the database cursor used by this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getCursorName() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns data about the columns returned as part of the ! * result set as a ResultSetMetaData instance. ! * ! * @return The ResultSetMetaData instance for this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSetMetaData ! getMetaData() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the column index of the specified named column. ! * ! * @param column The name of the column. ! * ! * @return The index of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! findColumn(String column) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the cursor is before the first row ! * in the result set. ! * ! * @return true if the cursor is positioned before the first ! * row, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isBeforeFirst() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the cursor is after the last row ! * in the result set. ! * ! * @return true if the cursor is positioned after the last ! * row, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isAfterLast() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the cursor is positioned on the first ! * row in the result set. ! * ! * @return true if the cursor is positioned on the first ! * row, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isFirst() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the cursor is on the last row ! * in the result set. ! * ! * @return true if the cursor is positioned on the last ! * row, false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isLast() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method repositions the cursor to before the first row in the ! * result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! beforeFirst() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method repositions the cursor to after the last row in the result ! * set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! afterLast() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method repositions the cursor on the first row in the ! * result set. ! * ! * @return true if the cursor is on a valid row; ! * false if there are no rows in the result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! first() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method repositions the cursor on the last row in the result ! * set. ! * ! * @return true if the cursor is on a valid row; ! * false if there are no rows in the result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! last() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the current row number in the cursor. Numbering ! * begins at index 1. ! * ! * @return The current row number, or 0 if there is not current row. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getRow() throws SQLException; ! /*************************************************************************/ ! /** ! * This method positions the result set to the specified absolute row. ! * Positive numbers are row offsets from the beginning of the result ! * set (numbering starts from row 1) and negative numbers are row offsets ! * from the end of the result set (numbering starts from -1). ! * ! * @param row The row to position the result set to. ! * ! * @return true if the current position was changed, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! absolute(int row) throws SQLException; ! /*************************************************************************/ ! /** ! * This method moves the result set position relative to the current row. ! * The offset can be positive or negative. ! * ! * @param row The relative row position to move to. ! * ! * @return true if the current position was changed, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! relative(int row) throws SQLException; ! /*************************************************************************/ ! /** ! * This method provides a hint to the driver about which direction the ! * result set will be processed in. ! * ! * @param direction The direction in which rows will be processed. (Values?) ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setFetchDirection(int direction) throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method returns the current fetch direction for this result set. ! * ! * @return The fetch direction for this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getFetchDirection() throws SQLException; ! /*************************************************************************/ ! /** ! * This method provides a hint to the driver about how many rows at a ! * time it should fetch from the database. ! * ! * @param rows The number of rows the driver should fetch per call. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setFetchSize(int rows) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the current number of rows that will be fetched ! * from the database at a time. ! * ! * @return The current fetch size for this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getFetchSize() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the result set type of this result set. This will ! * be one of the TYPE_* constants defined in this interface. ! * ! * @return The result set type. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getType() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the concurrency type of this result set. This will ! * be one of the CONCUR_* constants defined in this interface. ! * ! * @return The result set concurrency type. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getConcurrency() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the current row in the result set ! * has been updated. Updates must be visible in order of this method to ! * detect the update. ! * ! * @return true if the row has been updated, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! rowUpdated() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the current row in the result set ! * has been inserted. Inserts must be visible in order of this method to ! * detect the insert. ! * ! * @return true if the row has been inserted, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! rowInserted() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the current row in the result set ! * has been deleted. Deletes must be visible in order of this method to ! * detect the deletion. ! * ! * @return true if the row has been deleted, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! rowDeleted() throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a NULL value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @return index The index of the column to update. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateNull(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a boolean value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBoolean(int index, boolean value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a byte value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateByte(int index, byte value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a short value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateShort(int index, short value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have an int value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateInt(int index, int value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a long value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateLong(int index, long value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a float value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateFloat(int index, float value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a double value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateDouble(int index, double value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a BigDecimal value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBigDecimal(int index, BigDecimal value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a String value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateString(int index, String value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a byte array value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBytes(int index, byte[] value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a java.sql.Date value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateDate(int index, java.sql.Date value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a java.sql.Time value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateTime(int index, java.sql.Time value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a java.sql.Timestamp value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateTimestamp(int index, java.sql.Timestamp value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column from an ASCII text stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateAsciiStream(int index, InputStream value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column from a binary stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBinaryStream(int index, InputStream value, int length) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column from a character stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateCharacterStream(int index, Reader value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateObject(int index, Object value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param scale The scale of the object in question, which is used only ! * for numeric type objects. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateObject(int index, Object value, int scale) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a NULL value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @return name The name of the column to update. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateNull(String name) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a boolean value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBoolean(String name, boolean value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a byte value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateByte(String name, byte value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a short value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateShort(String name, short value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have an int value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateInt(String name, int value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a long value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateLong(String name, long value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a float value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateFloat(String name, float value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a double value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateDouble(String name, double value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a BigDecimal value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBigDecimal(String name, BigDecimal value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a String value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateString(String name, String value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a byte array value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBytes(String name, byte[] value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a java.sql.Date value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateDate(String name, java.sql.Date value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a java.sql.Time value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateTime(String name, java.sql.Time value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have a java.sql.Timestamp value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateTimestamp(String name, java.sql.Timestamp value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column from an ASCII text stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateAsciiStream(String name, InputStream value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column from a binary stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateBinaryStream(String name, InputStream value, int length) ! throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column from a character stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateCharacterStream(String name, Reader value, int length) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateObject(String name, Object value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param scale The scale of the object in question, which is used only ! * for numeric type objects. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateObject(String name, Object value, int scale) throws SQLException; ! /*************************************************************************/ ! /** ! * This method inserts the current row into the database. The result set ! * must be positioned on the insert row in order to call this method ! * successfully. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! insertRow() throws SQLException; ! /*************************************************************************/ ! /** ! * This method updates the current row in the database. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! updateRow() throws SQLException; ! /*************************************************************************/ ! /** ! * This method deletes the current row in the database. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! deleteRow() throws SQLException; ! /*************************************************************************/ ! /** ! * This method refreshes the contents of the current row from the database. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! refreshRow() throws SQLException; ! /*************************************************************************/ ! /** ! * This method cancels any changes that have been made to a row. If ! * the rowUpdate method has been called, then the changes ! * cannot be undone. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! cancelRowUpdates() throws SQLException; ! /*************************************************************************/ ! /** ! * This method positions the result set to the "insert row", which allows ! * a new row to be inserted into the database from the result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! moveToInsertRow() throws SQLException; ! /*************************************************************************/ ! /** ! * This method moves the result set position from the insert row back to ! * the current row that was selected prior to moving to the insert row. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! moveToCurrentRow() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a the Statement that was used to ! * produce this result set. ! * ! * @return The Statement used to produce this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Statement ! getStatement() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified column as a Java ! * Object using the specified SQL type to Java type map. ! * ! * @param index The index of the column to return. ! * @param map The SQL type to Java type map to use. ! * ! * @return The value of the column as an Object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getObject(int index, Map map) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a Ref for the specified column which ! * represents the structured type for the column. ! * ! * @param index The index of the column to return. ! * ! * @return A Ref object for the column ! * ! * @exception SQLException If an error occurs. ! */ ! public Ref ! getRef(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a BLOB. ! * ! * @param index The index of the column value to return. ! * ! * @return The value of the column as a BLOB. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Blob ! getBlob(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a CLOB. ! * ! * @param index The index of the column value to return. ! * ! * @return The value of the column as a CLOB. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Clob ! getClob(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as an Array. ! * ! * @param index The index of the column value to return. ! * ! * @return The value of the column as an Array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Array ! getArray(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the value of the specified column as a Java ! * Object using the specified SQL type to Java type map. ! * ! * @param name The name of the column to return. ! * @param map The SQL type to Java type map to use. ! * ! * @return The value of the column as an Object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! getObject(String name, Map map) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns a Ref for the specified column which ! * represents the structured type for the column. ! * ! * @param index The index of the column to return. ! * ! * @return A Ref object for the column ! * ! * @exception SQLException If an error occurs. ! */ ! public Ref ! getRef(String name) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a BLOB. ! * ! * @param name The name of the column value to return. ! * ! * @return The value of the column as a BLOB. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Blob ! getBlob(String name) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a CLOB. ! * ! * @param name The name of the column value to return. ! * ! * @return The value of the column as a CLOB. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Clob ! getClob(String name) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as an Array. ! * ! * @param name The name of the column value to return. ! * ! * @return The value of the column as an Array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Array ! getArray(String name) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a ! * java.sql.Date. The specified Calendar is used ! * to generate a value for the date if the database does not support ! * timezones. ! * ! * @param index The index of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * ! * @return The value of the column as a java.sql.Date. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Date ! getDate(int index, Calendar cal) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a ! * java.sql.Time. The specified Calendar is used ! * to generate a value for the time if the database does not support ! * timezones. ! * ! * @param index The index of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * ! * @return The value of the column as a java.sql.Time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Time ! getTime(int index, Calendar cal) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a ! * java.sql.Timestamp. The specified Calendar is used ! * to generate a value for the timestamp if the database does not support ! * timezones. ! * ! * @param index The index of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * ! * @return The value of the column as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Timestamp ! getTimestamp(int index, Calendar cal) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a ! * java.sql.Date. The specified Calendar is used ! * to generate a value for the date if the database does not support ! * timezones. ! * ! * @param name The name of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * ! * @return The value of the column as a java.sql.Date. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Date ! getDate(String name, Calendar cal) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a ! * java.sql.Time. The specified Calendar is used ! * to generate a value for the time if the database does not support ! * timezones. ! * ! * @param name The name of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * ! * @return The value of the column as a java.sql.Time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Time ! getTime(String name, Calendar cal) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the specified column value as a ! * java.sql.Timestamp. The specified Calendar is used ! * to generate a value for the timestamp if the database does not support ! * timezones. ! * ! * @param name The name of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * ! * @return The value of the column as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Timestamp ! getTimestamp(String name, Calendar cal) throws SQLException; ! } // interface ResultSet --- 41,1530 ---- import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; + import java.net.URL; import java.util.Calendar; import java.util.Map; /** ! * This interface provides access to the data set returned by a SQL ! * statement. An instance of this interface is returned by the various ! * execution methods in the Statement ! * This class models a cursor, which can be stepped through one row at a ! * time. Methods are provided for accessing columns by column name or by ! * index. ! *

          ! * Note that a result set is invalidated if the statement that returned ! * it is closed. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface ResultSet { + /** + * The rows will be processed in order from first to last. + */ + public static final int FETCH_FORWARD = 1000; ! /** ! * The rows will be processed in order from last to first. ! */ ! public static final int FETCH_REVERSE = 1001; ! /** ! * The rows will be processed in an unknown order ! */ ! public static final int FETCH_UNKNOWN = 1002; ! /** ! * This type of result set may only step forward through the rows returned. ! */ ! public static final int TYPE_FORWARD_ONLY = 1003; ! /** ! * This type of result set is scrollable and is not sensitive to changes ! * made by other statements. ! */ ! public static final int TYPE_SCROLL_INSENSITIVE = 1004; ! /** ! * This type of result set is scrollable and is also sensitive to changes ! * made by other statements. ! */ ! public static final int TYPE_SCROLL_SENSITIVE = 1005; ! /** ! * The concurrency mode of for the result set may not be modified. ! */ ! public static final int CONCUR_READ_ONLY = 1007; ! /** ! * The concurrency mode of for the result set may be modified. ! */ ! public static final int CONCUR_UPDATABLE = 1008; ! public static final int HOLD_CURSORS_OVER_COMMIT = 1; ! public static final int CLOSE_CURSORS_AT_COMMIT = 2; ! /** ! * This method advances to the next row in the result set. Any streams ! * open on the current row are closed automatically. ! * ! * @return true if the next row exists, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean next() throws SQLException; ! /** ! * This method closes the result set and frees any associated resources. ! * ! * @exception SQLException If an error occurs. ! */ ! public void close() throws SQLException; ! /** ! * This method tests whether the value of the last column that was fetched ! * was actually a SQL NULL value. ! * ! * @return true if the last column fetched was a NULL, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean wasNull() throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * String. ! * ! * @param index The index of the column to return. ! * @return The column value as a String. ! * @exception SQLException If an error occurs. ! */ ! public String getString(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * boolean. ! * ! * @param index The index of the column to return. ! * @return The column value as a boolean. ! * @exception SQLException If an error occurs. ! */ ! public boolean getBoolean(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * byte. ! * ! * @param index The index of the column to return. ! * @return The column value as a byte. ! * @exception SQLException If an error occurs. ! */ ! public byte getByte(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * short. ! * ! * @param index The index of the column to return. ! * @return The column value as a short. ! * @exception SQLException If an error occurs. ! */ ! public short getShort(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * int. ! * ! * @param index The index of the column to return. ! * @return The column value as a int. ! * @exception SQLException If an error occurs. ! */ ! public int getInt(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * long. ! * ! * @param index The index of the column to return. ! * @return The column value as a long. ! * @exception SQLException If an error occurs. ! */ ! public long getLong(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * float. ! * ! * @param index The index of the column to return. ! * @return The column value as a float. ! * @exception SQLException If an error occurs. ! */ ! public float getFloat(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * double. ! * ! * @param index The index of the column to return. ! * @return The column value as a double. ! * @exception SQLException If an error occurs. ! */ ! public double getDouble(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param index The index of the column to return. ! * @param scale The number of digits to the right of the decimal to return. ! * @return The column value as a BigDecimal. ! * @exception SQLException If an error occurs. ! * @deprecated ! */ ! public BigDecimal getBigDecimal(int columnIndex, int scale) ! throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * byte array. ! * ! * @param index The index of the column to return. ! * @return The column value as a byte array ! * @exception SQLException If an error occurs. ! */ ! public byte[] getBytes(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Date. ! * ! * @param index The index of the column to return. ! * @return The column value as a java.sql.Date. ! * @exception SQLException If an error occurs. ! */ ! public Date getDate(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Time. ! * ! * @param index The index of the column to return. ! * @return The column value as a java.sql.Time. ! * @exception SQLException If an error occurs. ! */ ! public Time getTime(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Timestamp. ! * ! * @param index The index of the column to return. ! * @return The column value as a java.sql.Timestamp. ! * @exception SQLException If an error occurs. ! */ ! public Timestamp getTimestamp(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as an ASCII ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * @return The column value as an ASCII InputStream. ! * @exception SQLException If an error occurs. ! */ ! public InputStream getAsciiStream(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Unicode UTF-8 ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * @return The column value as a Unicode UTF-8 InputStream. ! * @exception SQLException If an error occurs. ! * @deprecated Use getCharacterStream instead. ! */ ! public InputStream getUnicodeStream(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a raw byte ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * @return The column value as a raw byte InputStream. ! * @exception SQLException If an error occurs. ! */ ! public InputStream getBinaryStream(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * String. ! * ! * @param column The name of the column to return. ! * @return The column value as a String. ! * @exception SQLException If an error occurs. ! */ ! public String getString(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * boolean. ! * ! * @param column The name of the column to return. ! * @return The column value as a boolean. ! * @exception SQLException If an error occurs. ! */ ! public boolean getBoolean(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * byte. ! * ! * @param column The name of the column to return. ! * @return The column value as a byte. ! * @exception SQLException If an error occurs. ! */ ! public byte getByte(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * short. ! * ! * @param column The name of the column to return. ! * @return The column value as a short. ! * @exception SQLException If an error occurs. ! */ ! public short getShort(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * int. ! * ! * @param column The name of the column to return. ! * @return The column value as a int. ! * @exception SQLException If an error occurs. ! */ ! public int getInt(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * long. ! * ! * @param column The name of the column to return. ! * @return The column value as a long. ! * @exception SQLException If an error occurs. ! */ ! public long getLong(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * float. ! * ! * @param column The name of the column to return. ! * @return The column value as a float. ! * @exception SQLException If an error occurs. ! */ ! public float getFloat(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * double. ! * ! * @param column The name of the column to return. ! * @return The column value as a double. ! * @exception SQLException If an error occurs. ! */ ! public double getDouble(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param index The index of the column to return. ! * @return The column value as a BigDecimal. ! * @exception SQLException If an error occurs. ! * @deprecated ! */ ! public BigDecimal getBigDecimal(String columnName, int scale) ! throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * byte array. ! * ! * @param column The name of the column to return. ! * @return The column value as a byte array ! * @exception SQLException If an error occurs. ! */ ! public byte[] getBytes(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Date. ! * ! * @param column The name of the column to return. ! * @return The column value as a java.sql.Date. ! * @exception SQLException If an error occurs. ! */ ! public Date getDate(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Time. ! * ! * @param column The name of the column to return. ! * @return The column value as a java.sql.Time. ! * @exception SQLException If an error occurs. ! */ ! public Time getTime(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * java.sql.Timestamp. ! * ! * @param column The name of the column to return. ! * @return The column value as a java.sql.Timestamp. ! * @exception SQLException If an error occurs. ! */ ! public Timestamp getTimestamp(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as an ASCII ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * @return The column value as an ASCII InputStream. ! * @exception SQLException If an error occurs. ! */ ! public InputStream getAsciiStream(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Unicode UTF-8 ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * @return The column value as a Unicode UTF-8 InputStream. ! * @exception SQLException If an error occurs. ! * @deprecated Use getCharacterStream instead. ! */ ! public InputStream getUnicodeStream(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a raw byte ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * @return The column value as a raw byte InputStream. ! * @exception SQLException If an error occurs. ! */ ! public InputStream getBinaryStream(String columnName) throws SQLException; ! /** ! * This method returns the first SQL warning associated with this result ! * set. Any additional warnings will be chained to this one. ! * ! * @return The first SQLWarning for this result set, or null if ! * there are no warnings. ! * @exception SQLException If an error occurs. ! */ ! public SQLWarning getWarnings() throws SQLException; ! /** ! * This method clears all warnings associated with this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public void clearWarnings() throws SQLException; ! /** ! * This method returns the name of the database cursor used by this ! * result set. ! * ! * @return The name of the database cursor used by this result set. ! * @exception SQLException If an error occurs. ! */ ! public String getCursorName() throws SQLException; ! /** ! * This method returns data about the columns returned as part of the ! * result set as a ResultSetMetaData instance. ! * ! * @return The ResultSetMetaData instance for this result set. ! * @exception SQLException If an error occurs. ! */ ! public ResultSetMetaData getMetaData() throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * Object. ! * ! * @param index The index of the column to return. ! * @return The column value as an Object. ! * @exception SQLException If an error occurs. ! */ ! public Object getObject(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * Object. ! * ! * @param column The name of the column to return. ! * @return The column value as an Object. ! * @exception SQLException If an error occurs. ! */ ! public Object getObject(String columnName) throws SQLException; ! /** ! * This method returns the column index of the specified named column. ! * ! * @param column The name of the column. ! * @return The index of the column. ! * @exception SQLException If an error occurs. ! */ ! public int findColumn(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a character ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param index The index of the column to return. ! * @return The column value as an character Reader. ! * @exception SQLException If an error occurs. ! */ ! public Reader getCharacterStream(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a character ! * stream. Note that all the data from this stream must be read before ! * fetching the value of any other column. Please also be aware that ! * calling next() or close() on this result set ! * will close this stream as well. ! * ! * @param column The name of the column to return. ! * @return The column value as an character Reader. ! * @exception SQLException If an error occurs. ! */ ! public Reader getCharacterStream(String columnName) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param index The index of the column to return. ! * @return The column value as a BigDecimal. ! * @exception SQLException If an error occurs. ! */ ! public BigDecimal getBigDecimal(int columnIndex) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * BigDecimal. ! * ! * @param column The name of the column to return. ! * @return The column value as a BigDecimal. ! * @exception SQLException If an error occurs. ! */ ! public BigDecimal getBigDecimal(String columnName) throws SQLException; ! /** ! * This method tests whether or not the cursor is before the first row ! * in the result set. ! * ! * @return true if the cursor is positioned before the first ! * row, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isBeforeFirst() throws SQLException; ! /** ! * This method tests whether or not the cursor is after the last row ! * in the result set. ! * ! * @return true if the cursor is positioned after the last ! * row, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isAfterLast() throws SQLException; ! /** ! * This method tests whether or not the cursor is positioned on the first ! * row in the result set. ! * ! * @return true if the cursor is positioned on the first ! * row, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isFirst() throws SQLException; ! /** ! * This method tests whether or not the cursor is on the last row ! * in the result set. ! * ! * @return true if the cursor is positioned on the last ! * row, false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isLast() throws SQLException; ! /** ! * This method repositions the cursor to before the first row in the ! * result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public void beforeFirst() throws SQLException; ! /** ! * This method repositions the cursor to after the last row in the result ! * set. ! * ! * @exception SQLException If an error occurs. ! */ ! public void afterLast() throws SQLException; ! /** ! * This method repositions the cursor on the first row in the ! * result set. ! * ! * @return true if the cursor is on a valid row; ! * false if there are no rows in the result set. ! * @exception SQLException If an error occurs. ! */ ! public boolean first() throws SQLException; ! /** ! * This method repositions the cursor on the last row in the result ! * set. ! * ! * @return true if the cursor is on a valid row; ! * false if there are no rows in the result set. ! * @exception SQLException If an error occurs. ! */ ! public boolean last() throws SQLException; ! /** ! * This method returns the current row number in the cursor. Numbering ! * begins at index 1. ! * ! * @return The current row number, or 0 if there is not current row. ! * @exception SQLException If an error occurs. ! */ ! public int getRow() throws SQLException; ! /** ! * This method positions the result set to the specified absolute row. ! * Positive numbers are row offsets from the beginning of the result ! * set (numbering starts from row 1) and negative numbers are row offsets ! * from the end of the result set (numbering starts from -1). ! * ! * @param row The row to position the result set to. ! * ! * @return true if the current position was changed, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean absolute(int row) throws SQLException; ! /** ! * This method moves the result set position relative to the current row. ! * The offset can be positive or negative. ! * ! * @param row The relative row position to move to. ! * @return true if the current position was changed, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean relative(int rows) throws SQLException; ! /** ! * This method moves the current position to the previous row in the ! * result set. ! * ! * @return true if the previous row exists, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean previous() throws SQLException; ! /** ! * This method provides a hint to the driver about which direction the ! * result set will be processed in. ! * ! * @param direction The direction in which rows will be processed. (Values?) ! * @exception SQLException If an error occurs. ! */ ! public void setFetchDirection(int direction) throws SQLException; ! /** ! * This method returns the current fetch direction for this result set. ! * ! * @return The fetch direction for this result set. ! * @exception SQLException If an error occurs. ! */ ! public int getFetchDirection() throws SQLException; ! /** ! * This method provides a hint to the driver about how many rows at a ! * time it should fetch from the database. ! * ! * @param rows The number of rows the driver should fetch per call. ! * @exception SQLException If an error occurs. ! */ ! public void setFetchSize(int rows) throws SQLException; ! /** ! * This method returns the current number of rows that will be fetched ! * from the database at a time. ! * ! * @return The current fetch size for this result set. ! * @exception SQLException If an error occurs. ! */ ! public int getFetchSize() throws SQLException; ! /** ! * This method returns the result set type of this result set. This will ! * be one of the TYPE_* constants defined in this interface. ! * ! * @return The result set type. ! * @exception SQLException If an error occurs. ! */ ! public int getType() throws SQLException; ! /** ! * This method returns the concurrency type of this result set. This will ! * be one of the CONCUR_* constants defined in this interface. ! * ! * @return The result set concurrency type. ! * @exception SQLException If an error occurs. ! */ ! public int getConcurrency() throws SQLException; ! /** ! * This method tests whether or not the current row in the result set ! * has been updated. Updates must be visible in order of this method to ! * detect the update. ! * ! * @return true if the row has been updated, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean rowUpdated() throws SQLException; ! /** ! * This method tests whether or not the current row in the result set ! * has been inserted. Inserts must be visible in order of this method to ! * detect the insert. ! * ! * @return true if the row has been inserted, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean rowInserted() throws SQLException; ! /** ! * This method tests whether or not the current row in the result set ! * has been deleted. Deletes must be visible in order of this method to ! * detect the deletion. ! * ! * @return true if the row has been deleted, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean rowDeleted() throws SQLException; ! /** ! * This method updates the specified column to have a NULL value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @return index The index of the column to update. ! * @exception SQLException If an error occurs. ! */ ! public void updateNull(int columnIndex) throws SQLException; ! /** ! * This method updates the specified column to have a boolean value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateBoolean(int columnIndex, boolean x) throws SQLException; ! /** ! * This method updates the specified column to have a byte value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateByte(int columnIndex, byte x) throws SQLException; ! /** ! * This method updates the specified column to have a short value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateShort(int columnIndex, short x) throws SQLException; ! /** ! * This method updates the specified column to have an int value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateInt(int columnIndex, int x) throws SQLException; ! /** ! * This method updates the specified column to have a long value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateLong(int columnIndex, long x) throws SQLException; ! /** ! * This method updates the specified column to have a float value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateFloat(int columnIndex, float x) throws SQLException; ! /** ! * This method updates the specified column to have a double value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateDouble(int columnIndex, double x) throws SQLException; ! /** ! * This method updates the specified column to have a BigDecimal value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateBigDecimal(int columnIndex, BigDecimal x) ! throws SQLException; ! /** ! * This method updates the specified column to have a String value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateString(int columnIndex, String x) throws SQLException; ! /** ! * This method updates the specified column to have a byte array value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateBytes(int columnIndex, byte[] x) throws SQLException; ! /** ! * This method updates the specified column to have a java.sql.Date value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateDate(int columnIndex, Date x) throws SQLException; ! /** ! * This method updates the specified column to have a java.sql.Time value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateTime(int columnIndex, Time x) throws SQLException; ! /** ! * This method updates the specified column to have a java.sql.Timestamp value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateTimestamp(int columnIndex, Timestamp x) ! throws SQLException; ! /** ! * This method updates the specified column from an ASCII text stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * @exception SQLException If an error occurs. ! */ ! public void updateAsciiStream(int columnIndex, InputStream x, int length) ! throws SQLException; ! /** ! * This method updates the specified column from a binary stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * @exception SQLException If an error occurs. ! */ ! public void updateBinaryStream(int columnIndex, InputStream x, int length) ! throws SQLException; ! /** ! * This method updates the specified column from a character stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * @exception SQLException If an error occurs. ! */ ! public void updateCharacterStream(int columnIndex, Reader x, int length) ! throws SQLException; ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public void updateObject(int columnIndex, Object x, int scale) ! throws SQLException; ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param index The index of the column to update. ! * @param value The new value of the column. ! * @param scale The scale of the object in question, which is used only ! * for numeric type objects. ! * @exception SQLException If an error occurs. ! */ ! public void updateObject(int columnIndex, Object x) throws SQLException; ! /** ! * This method updates the specified column to have a NULL value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @return name The name of the column to update. ! * @exception SQLException If an error occurs. ! */ ! public void updateNull(String columnName) throws SQLException; ! /** ! * This method updates the specified column to have a boolean value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateBoolean(String columnName, boolean x) throws SQLException; ! /** ! * This method updates the specified column to have a byte value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateByte(String columnName, byte x) throws SQLException; ! /** ! * This method updates the specified column to have a short value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateShort(String columnName, short x) throws SQLException; ! /** ! * This method updates the specified column to have an int value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateInt(String columnName, int x) throws SQLException; ! /** ! * This method updates the specified column to have a long value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateLong(String columnName, long x) throws SQLException; ! /** ! * This method updates the specified column to have a float value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateFloat(String columnName, float x) throws SQLException; ! /** ! * This method updates the specified column to have a double value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateDouble(String columnName, double x) throws SQLException; ! /** ! * This method updates the specified column to have a BigDecimal value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateBigDecimal(String columnName, BigDecimal x) ! throws SQLException; ! /** ! * This method updates the specified column to have a String value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateString(String columnName, String x) throws SQLException; ! /** ! * This method updates the specified column to have a byte array value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateBytes(String columnName, byte[] x) throws SQLException; ! /** ! * This method updates the specified column to have a java.sql.Date value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateDate(String columnName, Date x) throws SQLException; ! /** ! * This method updates the specified column to have a java.sql.Time value. This ! * does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateTime(String columnName, Time x) throws SQLException; ! /** ! * This method updates the specified column to have a java.sql.Timestamp value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateTimestamp(String columnName, Timestamp x) ! throws SQLException; ! /** ! * This method updates the specified column from an ASCII text stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * @exception SQLException If an error occurs. ! */ ! public void updateAsciiStream(String columnName, InputStream x, int length) ! throws SQLException; ! /** ! * This method updates the specified column from a binary stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * @exception SQLException If an error occurs. ! */ ! public void updateBinaryStream(String columnName, InputStream x, int length) ! throws SQLException; ! /** ! * This method updates the specified column from a character stream. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param length The length of the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public void updateCharacterStream(String columnName, Reader reader, ! int length) throws SQLException; ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @exception SQLException If an error occurs. ! */ ! public void updateObject(String columnName, Object x, int scale) ! throws SQLException; ! /** ! * This method updates the specified column to have an Object value. ! * This does not update the actual database. updateRow must be ! * called in order to do that. ! * ! * @param name The name of the column to update. ! * @param value The new value of the column. ! * @param scale The scale of the object in question, which is used only ! * for numeric type objects. ! * @exception SQLException If an error occurs. ! */ ! public void updateObject(String columnName, Object x) throws SQLException; ! /** ! * This method inserts the current row into the database. The result set ! * must be positioned on the insert row in order to call this method ! * successfully. ! * ! * @exception SQLException If an error occurs. ! */ ! public void insertRow() throws SQLException; ! /** ! * This method updates the current row in the database. ! * ! * @exception SQLException If an error occurs. ! */ ! public void updateRow() throws SQLException; ! /** ! * This method deletes the current row in the database. ! * ! * @exception SQLException If an error occurs. ! */ ! public void deleteRow() throws SQLException; ! /** ! * This method refreshes the contents of the current row from the database. ! * ! * @exception SQLException If an error occurs. ! */ ! public void refreshRow() throws SQLException; ! /** ! * This method cancels any changes that have been made to a row. If ! * the rowUpdate method has been called, then the changes ! * cannot be undone. ! * ! * @exception SQLException If an error occurs. ! */ ! public void cancelRowUpdates() throws SQLException; ! /** ! * This method positions the result set to the "insert row", which allows ! * a new row to be inserted into the database from the result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public void moveToInsertRow() throws SQLException; ! /** ! * This method moves the result set position from the insert row back to ! * the current row that was selected prior to moving to the insert row. ! * ! * @exception SQLException If an error occurs. ! */ ! public void moveToCurrentRow() throws SQLException; ! /** ! * This method returns a the Statement that was used to ! * produce this result set. ! * ! * @return The Statement used to produce this result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public Statement getStatement() throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * Object using the specified SQL type to Java type map. ! * ! * @param index The index of the column to return. ! * @param map The SQL type to Java type map to use. ! * @return The value of the column as an Object. ! * @exception SQLException If an error occurs. ! */ ! public Object getObject(int i, Map map) throws SQLException; ! /** ! * This method returns a Ref for the specified column which ! * represents the structured type for the column. ! * ! * @param index The index of the column to return. ! * @return A Ref object for the column ! * @exception SQLException If an error occurs. ! */ ! public Ref getRef(int i) throws SQLException; ! /** ! * This method returns the specified column value as a BLOB. ! * ! * @param index The index of the column value to return. ! * @return The value of the column as a BLOB. ! * @exception SQLException If an error occurs. ! */ ! public Blob getBlob(int i) throws SQLException; ! /** ! * This method returns the specified column value as a CLOB. ! * ! * @param index The index of the column value to return. ! * @return The value of the column as a CLOB. ! * @exception SQLException If an error occurs. ! */ ! public Clob getClob(int i) throws SQLException; ! /** ! * This method returns the specified column value as an Array. ! * ! * @param index The index of the column value to return. ! * @return The value of the column as an Array. ! * @exception SQLException If an error occurs. ! */ ! public Array getArray(int i) throws SQLException; ! /** ! * This method returns the value of the specified column as a Java ! * Object using the specified SQL type to Java type map. ! * ! * @param name The name of the column to return. ! * @param map The SQL type to Java type map to use. ! * @return The value of the column as an Object. ! * @exception SQLException If an error occurs. ! */ ! public Object getObject(String colName, Map map) throws SQLException; ! /** ! * This method returns a Ref for the specified column which ! * represents the structured type for the column. ! * ! * @param index The index of the column to return. ! * @return A Ref object for the column ! * @exception SQLException If an error occurs. ! */ ! public Ref getRef(String colName) throws SQLException; ! /** ! * This method returns the specified column value as a BLOB. ! * ! * @param name The name of the column value to return. ! * @return The value of the column as a BLOB. ! * @exception SQLException If an error occurs. ! */ ! public Blob getBlob(String colName) throws SQLException; ! /** ! * This method returns the specified column value as a CLOB. ! * ! * @param name The name of the column value to return. ! * @return The value of the column as a CLOB. ! * @exception SQLException If an error occurs. ! */ ! public Clob getClob(String colName) throws SQLException; ! /** ! * This method returns the specified column value as an Array. ! * ! * @param name The name of the column value to return. ! * @return The value of the column as an Array. ! * @exception SQLException If an error occurs. ! */ ! public Array getArray(String colName) throws SQLException; ! /** ! * This method returns the specified column value as a ! * java.sql.Date. The specified Calendar is used ! * to generate a value for the date if the database does not support ! * timezones. ! * ! * @param index The index of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * @return The value of the column as a java.sql.Date. ! * @exception SQLException If an error occurs. ! */ ! public Date getDate(int columnIndex, Calendar cal) throws SQLException; ! /** ! * This method returns the specified column value as a ! * java.sql.Date. The specified Calendar is used ! * to generate a value for the date if the database does not support ! * timezones. ! * ! * @param name The name of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * @return The value of the column as a java.sql.Date. ! * @exception SQLException If an error occurs. ! */ ! public Date getDate(String columnName, Calendar cal) throws SQLException; ! /** ! * This method returns the specified column value as a ! * java.sql.Time. The specified Calendar is used ! * to generate a value for the time if the database does not support ! * timezones. ! * ! * @param index The index of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * @return The value of the column as a java.sql.Time. ! * @exception SQLException If an error occurs. ! */ ! public Time getTime(int columnIndex, Calendar cal) throws SQLException; ! /** ! * This method returns the specified column value as a ! * java.sql.Time. The specified Calendar is used ! * to generate a value for the time if the database does not support ! * timezones. ! * ! * @param name The name of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * @return The value of the column as a java.sql.Time. ! * @exception SQLException If an error occurs. ! */ ! public Time getTime(String columnName, Calendar cal) throws SQLException; ! /** ! * This method returns the specified column value as a ! * java.sql.Timestamp. The specified Calendar is used ! * to generate a value for the timestamp if the database does not support ! * timezones. ! * ! * @param index The index of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * @return The value of the column as a java.sql.Timestamp. ! * @exception SQLException If an error occurs. ! */ ! public Timestamp getTimestamp(int columnIndex, Calendar cal) ! throws SQLException; ! /** ! * This method returns the specified column value as a ! * java.sql.Timestamp. The specified Calendar is used ! * to generate a value for the timestamp if the database does not support ! * timezones. ! * ! * @param name The name of the column value to return. ! * @param cal The Calendar to use for calculating timezones. ! * ! * @return The value of the column as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public Timestamp getTimestamp(String columnName, Calendar cal) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public URL getURL(int columnIndex) throws SQLException; ! /** ! * @since 1.4 ! */ ! public URL getURL(String columnName) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void updateRef(int columnIndex, Ref x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void updateRef(String columnName, Ref x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void updateBlob(int columnIndex, Blob x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void updateBlob(String columnName, Blob x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void updateClob(int columnIndex, Clob x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void updateClob(String columnName, Clob x) throws SQLException; ! /** ! * @since 1.4 ! */ ! public void updateArray(int columnIndex, Array x) throws SQLException; + /** + * @since 1.4 + */ + public void updateArray(String columnName, Array x) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/ResultSetMetaData.java gcc-3.3/libjava/java/sql/ResultSetMetaData.java *** gcc-3.2.3/libjava/java/sql/ResultSetMetaData.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/ResultSetMetaData.java 2002-06-21 05:39:23.000000000 +0000 *************** *** 1,5 **** /* ResultSetMetaData.java -- Returns information about the ResultSet ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ResultSetMetaData.java -- Returns information about the ResultSet ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,389 **** package java.sql; /** ! * This interface provides a mechanism for obtaining information about ! * the columns that are present in a ResultSet. ! *

          ! * Note that in this class column indexes start at 1, not 0. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface ResultSetMetaData { ! /** ! * The column does not allow NULL's. ! */ ! public static final int columnNoNulls = 0; ! ! /** ! * The column allows NULL's. ! */ ! public static final int columnNullable = 1; ! ! /** ! * It is unknown whether or not the column allows NULL's. ! */ ! public static final int columnNullableUnknown = 2; ! ! /*************************************************************************/ ! ! /** ! * This method returns the number of columns in the result set. ! * ! * @return The number of columns in the result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getColumnCount() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method test whether or not the column is an auto-increment column. ! * Auto-increment columns are read-only. ! * ! * @param index The index of the column to test. ! * ! * @return true if the column is auto-increment, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isAutoIncrement(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not a column is case sensitive in its values. ! * ! * @param index The index of the column to test. ! * ! * @return true if the column value is case sensitive, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isCaseSensitive(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether not the specified column can be used in ! * a WHERE clause. ! * ! * @param index The index of the column to test. ! * ! * @return true if the column may be used in a WHERE clause, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isSearchable(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the column stores a monetary value. ! * ! * @param index The index of the column to test. ! * ! * @return true if the column contains a monetary value, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isCurrency(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a value indicating whether or not the specified ! * column may contain a NULL value. ! * ! * @param index The index of the column to test. ! * ! * @return A constant indicating whether or not the column can contain NULL, ! * which will be one of columnNoNulls, ! * columnNullable, or columnNullableUnknown. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! isNullable(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method tests whether or not the value of the specified column ! * is signed or unsigned. ! * ! * @param index The index of the column to test. ! * ! * @return true if the column value is signed, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isSigned(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the maximum number of characters that can be used ! * to display a value in this column. ! * ! * @param index The index of the column to check. ! * ! * @return The maximum number of characters that can be used to display a ! * value for this column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getColumnDisplaySize(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns a string that should be used as a caption for this ! * column for user display purposes. ! * ! * @param index The index of the column to check. ! * ! * @return A display string for the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getColumnLabel(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the name of the specified column. ! * ! * @param index The index of the column to return the name of. ! * ! * @return The name of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getColumnName(int index) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the name of the schema that contains the specified ! * column. ! * ! * @param index The index of the column to check the schema name for. ! * ! * @return The name of the schema that contains the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getSchemaName(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the precision of the specified column, which is the ! * number of decimal digits it contains. ! * ! * @param index The index of the column to check the precision on. ! * ! * @return The precision of the specified column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getPrecision(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the scale of the specified column, which is the ! * number of digits to the right of the decimal point. ! * ! * @param index The index column to check the scale of. ! * ! * @return The scale of the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getScale(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the name of the table containing the specified ! * column. ! * ! * @param index The index of the column to check the table name for. ! * ! * @return The name of the table containing the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getTableName(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the name of the catalog containing the specified ! * column. ! * ! * @param index The index of the column to check the catalog name for. ! * ! * @return The name of the catalog containing the column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getCatalogName(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the SQL type of the specified column. This will ! * be one of the constants from Types. ! * ! * @param index The index of the column to check the SQL type of. ! * ! * @return The SQL type for this column. ! * ! * @exception SQLException If an error occurs. ! * ! * @see Types ! */ ! public abstract int ! getColumnType(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the name of the SQL type for this column. ! * ! * @param index The index of the column to check the SQL type name for. ! * ! * @return The name of the SQL type for this column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getColumnTypeName(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the specified column is read only. ! * ! * @param index The index of the column to check. ! * ! * @return true if the column is read only, false ! * otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isReadOnly(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the column may be writable. This ! * does not guarantee that a write will be successful. ! * ! * @param index The index of the column to check for writability. ! * ! * @return true if the column may be writable, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isWritable(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the column is writable. This ! * does guarantee that a write will be successful. ! * ! * @param index The index of the column to check for writability. ! * ! * @return true if the column is writable, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! isDefinitelyWritable(int index) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the name of the Java class which will be used to ! * create objects representing the data in this column. ! * ! * @param index The index of the column to check. ! * ! * @return The name of the Java class that will be used for values in ! * this column. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getColumnClassName(int index) throws SQLException; ! } // interface ResultSetMetaData --- 39,281 ---- package java.sql; /** ! * This interface provides a mechanism for obtaining information about ! * the columns that are present in a ResultSet. ! *

          ! * Note that in this class column indexes start at 1, not 0. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface ResultSetMetaData { + /** + * The column does not allow NULL's. + */ + public static final int columnNoNulls = 0; ! /** ! * The column allows NULL's. ! */ ! public static final int columnNullable = 1; ! /** ! * It is unknown whether or not the column allows NULL's. ! */ ! public static final int columnNullableUnknown = 2; ! /** ! * This method returns the number of columns in the result set. ! * ! * @return The number of columns in the result set. ! * @exception SQLException If an error occurs. ! */ ! public int getColumnCount() throws SQLException; ! /** ! * This method test whether or not the column is an auto-increment column. ! * Auto-increment columns are read-only. ! * ! * @param index The index of the column to test. ! * @return true if the column is auto-increment, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isAutoIncrement(int column) throws SQLException; ! /** ! * This method tests whether or not a column is case sensitive in its values. ! * ! * @param index The index of the column to test. ! * @return true if the column value is case sensitive, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isCaseSensitive(int column) throws SQLException; ! /** ! * This method tests whether not the specified column can be used in ! * a WHERE clause. ! * ! * @param index The index of the column to test. ! * @return true if the column may be used in a WHERE clause, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isSearchable(int column) throws SQLException; ! /** ! * This method tests whether or not the column stores a monetary value. ! * ! * @param index The index of the column to test. ! * @return true if the column contains a monetary value, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isCurrency(int column) throws SQLException; ! /** ! * This method returns a value indicating whether or not the specified ! * column may contain a NULL value. ! * ! * @param index The index of the column to test. ! * @return A constant indicating whether or not the column can contain NULL, ! * which will be one of columnNoNulls, ! * columnNullable, or columnNullableUnknown. ! * @exception SQLException If an error occurs. ! */ ! public int isNullable(int column) throws SQLException; ! /** ! * This method tests whether or not the value of the specified column ! * is signed or unsigned. ! * ! * @param index The index of the column to test. ! * @return true if the column value is signed, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isSigned(int column) throws SQLException; ! /** ! * This method returns the maximum number of characters that can be used ! * to display a value in this column. ! * ! * @param index The index of the column to check. ! * @return The maximum number of characters that can be used to display a ! * value for this column. ! * @exception SQLException If an error occurs. ! */ ! public int getColumnDisplaySize(int column) throws SQLException; ! /** ! * This method returns a string that should be used as a caption for this ! * column for user display purposes. ! * ! * @param index The index of the column to check. ! * @return A display string for the column. ! * @exception SQLException If an error occurs. ! */ ! public String getColumnLabel(int column) throws SQLException; ! /** ! * This method returns the name of the specified column. ! * ! * @param index The index of the column to return the name of. ! * @return The name of the column. ! * @exception SQLException If an error occurs. ! */ ! public String getColumnName(int column) throws SQLException; ! /** ! * This method returns the name of the schema that contains the specified ! * column. ! * ! * @param index The index of the column to check the schema name for. ! * @return The name of the schema that contains the column. ! * @exception SQLException If an error occurs. ! */ ! public String getSchemaName(int column) throws SQLException; ! /** ! * This method returns the precision of the specified column, which is the ! * number of decimal digits it contains. ! * ! * @param index The index of the column to check the precision on. ! * @return The precision of the specified column. ! * @exception SQLException If an error occurs. ! */ ! public int getPrecision(int column) throws SQLException; ! /** ! * This method returns the scale of the specified column, which is the ! * number of digits to the right of the decimal point. ! * ! * @param index The index column to check the scale of. ! * @return The scale of the column. ! * @exception SQLException If an error occurs. ! */ ! public int getScale(int column) throws SQLException; ! /** ! * This method returns the name of the table containing the specified ! * column. ! * ! * @param index The index of the column to check the table name for. ! * @return The name of the table containing the column. ! * @exception SQLException If an error occurs. ! */ ! public String getTableName(int column) throws SQLException; ! /** ! * This method returns the name of the catalog containing the specified ! * column. ! * ! * @param index The index of the column to check the catalog name for. ! * @return The name of the catalog containing the column. ! * @exception SQLException If an error occurs. ! */ ! public String getCatalogName(int column) throws SQLException; ! /** ! * This method returns the SQL type of the specified column. This will ! * be one of the constants from Types. ! * ! * @param index The index of the column to check the SQL type of. ! * @return The SQL type for this column. ! * @exception SQLException If an error occurs. ! * @see Types ! */ ! public int getColumnType(int column) throws SQLException; ! /** ! * This method returns the name of the SQL type for this column. ! * ! * @param index The index of the column to check the SQL type name for. ! * @return The name of the SQL type for this column. ! * @exception SQLException If an error occurs. ! */ ! public String getColumnTypeName(int column) throws SQLException; ! /** ! * This method tests whether or not the specified column is read only. ! * ! * @param index The index of the column to check. ! * @return true if the column is read only, false ! * otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isReadOnly(int column) throws SQLException; ! /** ! * This method tests whether or not the column may be writable. This ! * does not guarantee that a write will be successful. ! * ! * @param index The index of the column to check for writability. ! * @return true if the column may be writable, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isWritable(int column) throws SQLException; ! /** ! * This method tests whether or not the column is writable. This ! * does guarantee that a write will be successful. ! * ! * @param index The index of the column to check for writability. ! * @return true if the column is writable, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean isDefinitelyWritable(int column) throws SQLException; + /** + * This method returns the name of the Java class which will be used to + * create objects representing the data in this column. + * + * @param index The index of the column to check. + * @return The name of the Java class that will be used for values in + * this column. + * @exception SQLException If an error occurs. + */ + public String getColumnClassName(int column) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Savepoint.java gcc-3.3/libjava/java/sql/Savepoint.java *** gcc-3.2.3/libjava/java/sql/Savepoint.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/sql/Savepoint.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* SavePoint.java -- Returns information about the ResultSet + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.sql; + + /** + * @since 1.4 + */ + public interface Savepoint + { + /** + * @since 1.4 + */ + public int getSavepointId() throws SQLException; + + /** + * @since 1.4 + */ + public String getSavepointName() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/SQLData.java gcc-3.3/libjava/java/sql/SQLData.java *** gcc-3.2.3/libjava/java/sql/SQLData.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/SQLData.java 2002-06-21 05:39:23.000000000 +0000 *************** exception statement from your version. * *** 39,85 **** package java.sql; /** ! * This interface is used for mapping SQL data to user defined datatypes. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface SQLData { ! /** ! * This method returns the user defined datatype name for this object. ! * ! * @return The user defined data type name for this object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getSQLTypeName() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method populates the data in the object from the specified stream. ! * ! * @param stream The stream to read the data from. ! * @param name The data type name of the data on the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! readSQL(SQLInput stream, String name) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the data in this object to the specified stream. ! * ! * @param stream The stream to write the data to. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeSQL(SQLOutput stream) throws SQLException; ! ! } // interface SQLData --- 39,72 ---- package java.sql; /** ! * This interface is used for mapping SQL data to user defined datatypes. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface SQLData { + /** + * This method returns the user defined datatype name for this object. + * + * @return The user defined data type name for this object. + * @exception SQLException If an error occurs. + */ + public String getSQLTypeName() throws SQLException; ! /** ! * This method populates the data in the object from the specified stream. ! * ! * @param stream The stream to read the data from. ! * @param name The data type name of the data on the stream. ! * @exception SQLException If an error occurs. ! */ ! public void readSQL(SQLInput stream, String typeName) throws SQLException; + /** + * This method writes the data in this object to the specified stream. + * + * @param stream The stream to write the data to. + * @exception SQLException If an error occurs. + */ + public void writeSQL(SQLOutput stream) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/SQLException.java gcc-3.3/libjava/java/sql/SQLException.java *** gcc-3.2.3/libjava/java/sql/SQLException.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/SQLException.java 2002-06-21 05:39:23.000000000 +0000 *************** exception statement from your version. * *** 39,221 **** package java.sql; /** ! * This exception is thrown when a database error occurs. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class SQLException extends Exception ! { ! ! /*************************************************************************/ ! ! /* ! * Instance Variables ! */ ! ! /** ! * This is the next exception in the chain ! * @serialized ! */ ! private SQLException next; ! ! /** ! * This is the state of the SQL statement at the time of the error. ! * @serialized ! */ ! private String SQLState; ! ! /** ! * The vendor error code for this error ! * @serialized ! */ ! private int vendorCode; ! ! /*************************************************************************/ ! ! /** ! * Static Variables ! */ ! ! /** ! * This is the serialization UID for this class ! */ ! private static final long serialVersionUID = 2135244094396331484L; ! ! /*************************************************************************/ ! ! /* ! * Constructors */ ! ! /** ! * This method initializes a new instance of SQLException ! * that does not have a descriptive messages and SQL state, and which ! * has a vendor error code of 0. ! */ ! public ! SQLException() ! { ! this(null, null, 0); ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of SQLException ! * with the specified descriptive error message. The SQL state of this ! * instance will be null and the vendor error code will be 0. ! * ! * @param message A string describing the nature of the error. ! */ ! public ! SQLException(String message) ! { ! this(message, null, 0); ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of SQLException ! * with the specified descriptive error message and SQL state string. ! * The vendor error code of this instance will be 0. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! */ ! public ! SQLException(String message, String SQLState) { ! this(message, SQLState, 0); ! } ! ! /*************************************************************************/ ! /** ! * This method initializes a nwe instance of SQLException ! * with the specified descriptive error message, SQL state string, and ! * vendor code. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! * @param vendorCode The vendor error code associated with this error. ! */ ! public ! SQLException(String message, String SQLState, int vendorCode) ! { ! super(message); ! this.SQLState = SQLState; ! this.vendorCode = vendorCode; ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * This method returns the SQLState information associated with this ! * error. The value returned is a String which is formatted ! * using the XOPEN SQL state conventions. ! * ! * @return The SQL state, which may be null. ! */ ! public String ! getSQLState() ! { ! return(SQLState); ! } ! /*************************************************************************/ ! /** ! * This method returns the vendor specific error code associated with ! * this error. ! * ! * @return The vendor specific error code associated with this error. ! */ ! public int ! getErrorCode() ! { ! return(vendorCode); ! } ! /*************************************************************************/ ! /** ! * This method returns the exception that is chained to this object. ! * ! * @return The exception chained to this object, which may be ! * null. ! */ ! public SQLException ! getNextException() ! { ! return(next); ! } ! /*************************************************************************/ ! /** ! * This method adds a new exception to the end of the chain of exceptions ! * that are chained to this object. ! * ! * @param e The exception to add to the end of the chain. ! */ ! public void ! setNextException(SQLException e) ! { ! if (e == null) ! return; ! SQLException list_entry = this; ! while (list_entry.getNextException() != null) ! list_entry = list_entry.getNextException(); ! list_entry.next = e; } - - } // class SQLException - --- 39,167 ---- package java.sql; /** ! * This exception is thrown when a database error occurs. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class SQLException extends Exception { ! static final long serialVersionUID = 2135244094396331484L; ! /** ! * This is the next exception in the chain ! */ ! private SQLException next; ! /** ! * This is the state of the SQL statement at the time of the error. ! */ ! private String SQLState; ! /** ! * The vendor error code for this error ! */ ! private int vendorCode; ! /** ! * This method initializes a nwe instance of SQLException ! * with the specified descriptive error message, SQL state string, and ! * vendor code. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! * @param vendorCode The vendor error code associated with this error. ! */ ! public SQLException(String message, String SQLState, int vendorCode) ! { ! super(message); ! this.SQLState = SQLState; ! this.vendorCode = vendorCode; ! } ! /** ! * This method initializes a new instance of SQLException ! * with the specified descriptive error message and SQL state string. ! * The vendor error code of this instance will be 0. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! */ ! public SQLException(String message, String SQLState) ! { ! this(message, SQLState, 0); ! } ! /** ! * This method initializes a new instance of SQLException ! * with the specified descriptive error message. The SQL state of this ! * instance will be null and the vendor error code will be 0. ! * ! * @param message A string describing the nature of the error. ! */ ! public SQLException(String message) ! { ! this(message, null, 0); ! } ! /** ! * This method initializes a new instance of SQLException ! * that does not have a descriptive messages and SQL state, and which ! * has a vendor error code of 0. ! */ ! public SQLException() ! { ! this(null, null, 0); ! } ! /** ! * This method returns the SQLState information associated with this ! * error. The value returned is a String which is formatted ! * using the XOPEN SQL state conventions. ! * ! * @return The SQL state, which may be null. ! */ ! public String getSQLState() ! { ! return SQLState; ! } ! /** ! * This method returns the vendor specific error code associated with ! * this error. ! * ! * @return The vendor specific error code associated with this error. ! */ ! public int getErrorCode() ! { ! return vendorCode; ! } ! /** ! * This method returns the exception that is chained to this object. ! * ! * @return The exception chained to this object, which may be ! * null. ! */ ! public SQLException getNextException() ! { ! return next; ! } ! /** ! * This method adds a new exception to the end of the chain of exceptions ! * that are chained to this object. ! * ! * @param e The exception to add to the end of the chain. ! */ ! public void setNextException(SQLException e) ! { ! if (e == null) ! return; ! SQLException list_entry = this; ! while (list_entry.getNextException() != null) ! list_entry = list_entry.getNextException(); ! list_entry.next = e; ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/SQLInput.java gcc-3.3/libjava/java/sql/SQLInput.java *** gcc-3.2.3/libjava/java/sql/SQLInput.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/SQLInput.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 1,5 **** /* SQLInput.java -- Read SQL values from a stream ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SQLInput.java -- Read SQL values from a stream ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.sql; *** 41,343 **** import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; /** ! * This interface provides methods for reading values from a stream ! * that is connected to a SQL structured or distinct type. It is used ! * for custom mapping of user defined data types. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface SQLInput { ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * String. ! * ! * @return The value read from the stream as a String. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! readString() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * boolean. ! * ! * @return The value read from the stream as a boolean. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! readBoolean() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * byte. ! * ! * @return The value read from the stream as a byte. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte ! readByte() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * short. ! * ! * @return The value read from the stream as a short. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract short ! readShort() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * int. ! * ! * @return The value read from the stream as an int. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! readInt() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * long. ! * ! * @return The value read from the stream as a long. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract long ! readLong() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * float. ! * ! * @return The value read from the stream as a float. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract float ! readFloat() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * double. ! * ! * @return The value read from the stream as a double. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract double ! readDouble() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * BigDecimal. ! * ! * @return The value read from the stream as a BigDecimal. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract BigDecimal ! readBigDecimal() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * byte array ! * ! * @return The value read from the stream as a byte array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract byte[] ! readBytes() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * java.sql.Date. ! * ! * @return The value read from the stream as a java.sql.Date. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Date ! readDate() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method reads the next item from the stream a Java ! * java.sql.Time. ! * ! * @return The value read from the stream as a java.sql.Time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Time ! readTime() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a Java ! * java.sql.Timestamp. ! * ! * @return The value read from the stream as a java.sql.Timestamp. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract java.sql.Timestamp ! readTimestamp() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a ASCII text ! * InputStream. ! * ! * @return The value read from the stream as an InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! readAsciiStream() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a binary ! * InputStream. ! * ! * @return The value read from the stream as an InputStream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract InputStream ! readBinaryStream() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a character ! * Reader. ! * ! * @return The value read from the stream as a Reader. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Reader ! readCharacterStream() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a Java ! * Object. ! * ! * @return The value read from the stream as an Object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object ! readObject() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a Java SQL ! * Ref. ! * ! * @return The value read from the stream as an Ref. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Ref ! readRef() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a Java SQL ! * Blob. ! * ! * @return The value read from the stream as a Blob. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Blob ! readBlob() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a Java SQL ! * Clob. ! * ! * @return The value read from the stream as a Clob. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Clob ! readClob() throws SQLException; ! /*************************************************************************/ ! /** ! * This method reads the next item from the stream a Java SQL ! * Array. ! * ! * @return The value read from the stream as an Array. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Array ! readArray() throws SQLException; ! /*************************************************************************/ ! /** ! * This method tests whether or not the last value read was a SQL ! * NULL value. ! * ! * @return true if the last value read was a NULL, ! * false otherwise. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! wasNull() throws SQLException; ! } // interface SQLInput --- 41,259 ---- import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; + import java.net.URL; /** ! * This interface provides methods for reading values from a stream ! * that is connected to a SQL structured or distinct type. It is used ! * for custom mapping of user defined data types. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface SQLInput { + /** + * This method reads the next item from the stream a Java + * String. + * + * @return The value read from the stream as a String. + * @exception SQLException If an error occurs. + */ + public String readString() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * boolean. ! * ! * @return The value read from the stream as a boolean. ! * @exception SQLException If an error occurs. ! */ ! public boolean readBoolean() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * byte. ! * ! * @return The value read from the stream as a byte. ! * @exception SQLException If an error occurs. ! */ ! public byte readByte() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * short. ! * ! * @return The value read from the stream as a short. ! * @exception SQLException If an error occurs. ! */ ! public short readShort() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * int. ! * ! * @return The value read from the stream as an int. ! * @exception SQLException If an error occurs. ! */ ! public int readInt() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * long. ! * ! * @return The value read from the stream as a long. ! * @exception SQLException If an error occurs. ! */ ! public long readLong() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * float. ! * ! * @return The value read from the stream as a float. ! * @exception SQLException If an error occurs. ! */ ! public float readFloat() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * double. ! * ! * @return The value read from the stream as a double. ! * @exception SQLException If an error occurs. ! */ ! public double readDouble() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * BigDecimal. ! * ! * @return The value read from the stream as a BigDecimal. ! * @exception SQLException If an error occurs. ! */ ! public BigDecimal readBigDecimal() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * byte array ! * ! * @return The value read from the stream as a byte array. ! * @exception SQLException If an error occurs. ! */ ! public byte[] readBytes() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * java.sql.Date. ! * ! * @return The value read from the stream as a java.sql.Date. ! * @exception SQLException If an error occurs. ! */ ! public Date readDate() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * java.sql.Time. ! * ! * @return The value read from the stream as a java.sql.Time. ! * @exception SQLException If an error occurs. ! */ ! public Time readTime() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * java.sql.Timestamp. ! * ! * @return The value read from the stream as a java.sql.Timestamp. ! * @exception SQLException If an error occurs. ! */ ! public Timestamp readTimestamp() throws SQLException; ! /** ! * This method reads the next item from the stream a character ! * Reader. ! * ! * @return The value read from the stream as a Reader. ! * @exception SQLException If an error occurs. ! */ ! public Reader readCharacterStream() throws SQLException; ! /** ! * This method reads the next item from the stream a ASCII text ! * InputStream. ! * ! * @return The value read from the stream as an InputStream. ! * @exception SQLException If an error occurs. ! */ ! public InputStream readAsciiStream() throws SQLException; ! /** ! * This method reads the next item from the stream a binary ! * InputStream. ! * ! * @return The value read from the stream as an InputStream. ! * @exception SQLException If an error occurs. ! */ ! public InputStream readBinaryStream() throws SQLException; ! /** ! * This method reads the next item from the stream a Java ! * Object. ! * ! * @return The value read from the stream as an Object. ! * @exception SQLException If an error occurs. ! */ ! public Object readObject() throws SQLException; ! /** ! * This method reads the next item from the stream a Java SQL ! * Ref. ! * ! * @return The value read from the stream as an Ref. ! * @exception SQLException If an error occurs. ! */ ! public Ref readRef() throws SQLException; ! /** ! * This method reads the next item from the stream a Java SQL ! * Blob. ! * ! * @return The value read from the stream as a Blob. ! * @exception SQLException If an error occurs. ! */ ! public Blob readBlob() throws SQLException; ! /** ! * This method reads the next item from the stream a Java SQL ! * Clob. ! * ! * @return The value read from the stream as a Clob. ! * @exception SQLException If an error occurs. ! */ ! public Clob readClob() throws SQLException; ! /** ! * This method reads the next item from the stream a Java SQL ! * Array. ! * ! * @return The value read from the stream as an Array. ! * @exception SQLException If an error occurs. ! */ ! public Array readArray() throws SQLException; ! /** ! * This method tests whether or not the last value read was a SQL ! * NULL value. ! * ! * @return true if the last value read was a NULL, ! * false otherwise. ! * @exception SQLException If an error occurs. ! */ ! public boolean wasNull() throws SQLException; ! /** ! * @since 1.4 ! */ ! public URL readURL() throws SQLException; ! } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/SQLOutput.java gcc-3.3/libjava/java/sql/SQLOutput.java *** gcc-3.2.3/libjava/java/sql/SQLOutput.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/SQLOutput.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 1,5 **** /* SQLOutput.java -- Write SQL values to a stream ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SQLOutput.java -- Write SQL values to a stream ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.sql; *** 41,342 **** import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; /** ! * This interface provides methods for writing Java types to a SQL stream. ! * It is used for implemented custom type mappings for user defined data ! * types. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface SQLOutput { ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java String ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeString(String value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java boolean ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeBoolean(boolean value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java byte ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeByte(byte value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java short ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeShort(short value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java int ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeInt(int value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java long ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeLong(long value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java float ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeFloat(float value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java double ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeDouble(double value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java BigDecimal ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeBigDecimal(BigDecimal value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java byte array ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeBytes(byte[] value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java java.sql.Date ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeDate(java.sql.Date value) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method writes the specified Java java.sql.Time ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeTime(java.sql.Time value) throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method writes the specified Java java.sql.Timestamp ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeTimestamp(java.sql.Timestamp value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified Java character stream ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeCharacterStream(Reader value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified uninterpreted binary byte stream ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeBinaryStream(InputStream value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified ASCII text stream ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeAsciiStream(InputStream value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified Java SQLData object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeObject(SQLData value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified Java SQL Ref object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeRef(Ref value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified Java SQL Blob object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeBlob(Blob value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified Java SQL Clob object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeClob(Clob value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified Java SQL Struct object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeStruct(Struct value) throws SQLException; ! /*************************************************************************/ ! /** ! * This method writes the specified Java SQL Array object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! writeArray(Array value) throws SQLException; ! } // interface SQLOutput --- 41,257 ---- import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; + import java.net.URL; /** ! * This interface provides methods for writing Java types to a SQL stream. ! * It is used for implemented custom type mappings for user defined data ! * types. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface SQLOutput { + /** + * This method writes the specified Java String + * to the SQL stream. + * + * @param value The value to write to the stream. + * @exception SQLException If an error occurs. + */ + public void writeString(String x) throws SQLException; ! /** ! * This method writes the specified Java boolean ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeBoolean(boolean x) throws SQLException; ! /** ! * This method writes the specified Java byte ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeByte(byte x) throws SQLException; ! /** ! * This method writes the specified Java short ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeShort(short x) throws SQLException; ! /** ! * This method writes the specified Java int ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeInt(int x) throws SQLException; ! /** ! * This method writes the specified Java long ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeLong(long x) throws SQLException; ! /** ! * This method writes the specified Java float ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeFloat(float x) throws SQLException; ! /** ! * This method writes the specified Java double ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeDouble(double x) throws SQLException; ! /** ! * This method writes the specified Java BigDecimal ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeBigDecimal(BigDecimal x) throws SQLException; ! /** ! * This method writes the specified Java byte array ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeBytes(byte[] x) throws SQLException; ! /** ! * This method writes the specified Java java.sql.Date ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeDate(Date x) throws SQLException; ! /** ! * This method writes the specified Java java.sql.Time ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeTime(Time x) throws SQLException; ! /** ! * This method writes the specified Java java.sql.Timestamp ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeTimestamp(Timestamp x) throws SQLException; ! /** ! * This method writes the specified Java character stream ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeCharacterStream(Reader x) throws SQLException; ! /** ! * This method writes the specified ASCII text stream ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeAsciiStream(InputStream x) throws SQLException; ! /** ! * This method writes the specified uninterpreted binary byte stream ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeBinaryStream(InputStream x) throws SQLException; ! /** ! * This method writes the specified Java SQLData object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeObject(SQLData x) throws SQLException; ! /** ! * This method writes the specified Java SQL Ref object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeRef(Ref x) throws SQLException; ! /** ! * This method writes the specified Java SQL Blob object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeBlob(Blob x) throws SQLException; ! /** ! * This method writes the specified Java SQL Clob object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeClob(Clob x) throws SQLException; ! /** ! * This method writes the specified Java SQL Struct object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeStruct(Struct x) throws SQLException; ! /** ! * This method writes the specified Java SQL Array object ! * to the SQL stream. ! * ! * @param value The value to write to the stream. ! * @exception SQLException If an error occurs. ! */ ! public void writeArray(Array x) throws SQLException; + /** + * @since 1.4 + */ + public void writeURL(URL x) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/SQLPermission.java gcc-3.3/libjava/java/sql/SQLPermission.java *** gcc-3.2.3/libjava/java/sql/SQLPermission.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/sql/SQLPermission.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* SQLPermission.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.sql; + + import java.security.BasicPermission; + + /** + * @since 1.3 + */ + public final class SQLPermission extends BasicPermission + { + public SQLPermission(String name) + { + super(name); + } + + public SQLPermission(String name, String actions) + { + super(name, actions); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/SQLWarning.java gcc-3.3/libjava/java/sql/SQLWarning.java *** gcc-3.2.3/libjava/java/sql/SQLWarning.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/SQLWarning.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 1,5 **** /* SQLWarning.java -- Database access warnings. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* SQLWarning.java -- Database access warnings. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,158 **** package java.sql; /** ! * This exception is thrown when a database warning occurs. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class SQLWarning extends SQLException ! { ! ! /*************************************************************************/ ! ! /** ! * Static Variables ! */ ! ! /** ! * This is the serialization UID for this class ! */ ! private static final long serialVersionUID = 3917336774604784856L; ! ! /*************************************************************************/ ! ! /* ! * Constructors */ ! ! /** ! * This method initializes a new instance of SQLWarning ! * that does not have a descriptive messages and SQL state, and which ! * has a vendor error code of 0. ! */ ! public ! SQLWarning() ! { ! this(null, null, 0); ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of SQLWarning ! * with the specified descriptive error message. The SQL state of this ! * instance will be null and the vendor error code will be 0. ! * ! * @param message A string describing the nature of the error. ! */ ! public ! SQLWarning(String message) ! { ! this(message, null, 0); ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of SQLWarning ! * with the specified descriptive error message and SQL state string. ! * The vendor error code of this instance will be 0. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! */ ! public ! SQLWarning(String message, String SQLState) { ! this(message, SQLState, 0); ! } ! ! /*************************************************************************/ ! /** ! * This method initializes a nwe instance of SQLWarning ! * with the specified descriptive error message, SQL state string, and ! * vendor code. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! * @param vendorCode The vendor error code associated with this error. ! */ ! public ! SQLWarning(String message, String SQLState, int vendorCode) ! { ! super(message, SQLState, vendorCode); ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * This method returns the exception that is chained to this object. ! * ! * @return The exception chained to this object, which may be ! * null. ! */ ! public SQLWarning ! getNextWarning() ! { ! return((SQLWarning)super.getNextException()); ! } ! /*************************************************************************/ ! /** ! * This method adds a new exception to the end of the chain of exceptions ! * that are chained to this object. ! * ! * @param e The exception to add to the end of the chain. ! */ ! public void ! setNextWarning(SQLWarning e) ! { ! super.setNextException(e); } - - } // class SQLWarning - --- 39,120 ---- package java.sql; /** ! * This exception is thrown when a database warning occurs. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class SQLWarning extends SQLException { ! static final long serialVersionUID = 3917336774604784856L; ! /** ! * This method initializes a nwe instance of SQLWarning ! * with the specified descriptive error message, SQL state string, and ! * vendor code. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! * @param vendorCode The vendor error code associated with this error. ! */ ! public SQLWarning(String reason, String SQLState, int vendorCode) ! { ! super(reason, SQLState, vendorCode); ! } ! /** ! * This method initializes a new instance of SQLWarning ! * with the specified descriptive error message and SQL state string. ! * The vendor error code of this instance will be 0. ! * ! * @param message A string describing the nature of the error. ! * @param SQLState A string containing the SQL state of the error. ! */ ! public SQLWarning(String message, String SQLState) ! { ! super(message, SQLState); ! } ! /** ! * This method initializes a new instance of SQLWarning ! * with the specified descriptive error message. The SQL state of this ! * instance will be null and the vendor error code will be 0. ! * ! * @param message A string describing the nature of the error. ! */ ! public SQLWarning(String message) ! { ! super(message); ! } ! /** ! * This method initializes a new instance of SQLWarning ! * that does not have a descriptive messages and SQL state, and which ! * has a vendor error code of 0. ! */ ! public SQLWarning() ! { ! super(); ! } ! /** ! * This method returns the exception that is chained to this object. ! * ! * @return The exception chained to this object, which may be ! * null. ! */ ! public SQLWarning getNextWarning() ! { ! return (SQLWarning) super.getNextException(); ! } ! /** ! * This method adds a new exception to the end of the chain of exceptions ! * that are chained to this object. ! * ! * @param w The exception to add to the end of the chain. ! */ ! public void setNextWarning(SQLWarning w) ! { ! super.setNextException(w); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Statement.java gcc-3.3/libjava/java/sql/Statement.java *** gcc-3.2.3/libjava/java/sql/Statement.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Statement.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 1,5 **** /* Statement.java -- Interface for executing SQL statements. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Statement.java -- Interface for executing SQL statements. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,424 **** package java.sql; /** ! * This interface provides a mechanism for executing SQL statements. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Statement { ! /** ! * This method executes the specified SQL SELECT statement and returns a ! * (possibly empty) ResultSet with the results of the query. ! * ! * @param sql The SQL statement to execute. ! * ! * @return The result set of the SQL statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract ResultSet ! executeQuery(String sql) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method executes the specified SQL INSERT, UPDATE, or DELETE statement ! * and returns the number of rows affected, which may be 0. ! * ! * @param sql The SQL statement to execute. ! * ! * @return The number of rows affected by the SQL statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! executeUpdate(String sql) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method closes the statement and frees any associated resources. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! close() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the maximum length of any column value in bytes. ! * ! * @return The maximum length of any column value in bytes. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxFieldSize() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the limit for the maximum length of any column in bytes. ! * ! * @param maxsize The new maximum length of any column in bytes. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setMaxFieldSize(int maxsize) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the maximum possible number of rows in a result set. ! * ! * @return The maximum possible number of rows in a result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getMaxRows() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the maximum number of rows that can be present in a ! * result set. ! * ! * @param maxrows The maximum possible number of rows in a result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setMaxRows(int maxrows) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the local escape processing mode on or off. The ! * default value is on. ! * ! * @param escape true to enable local escape processing, ! * false to disable it. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setEscapeProcessing(boolean esacpe) throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * The method returns the number of seconds a statement may be in process ! * before timing out. A value of 0 means there is no timeout. ! * ! * @return The SQL statement timeout in seconds. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getQueryTimeout() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method sets the number of seconds a statement may be in process ! * before timing out. A value of 0 means there is no timeout. ! * ! * @param timeout The new SQL statement timeout value. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setQueryTimeout(int timeout) throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method cancels an outstanding statement, if the database supports ! * that operation. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! cancel() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the first SQL warning attached to this statement. ! * Subsequent warnings will be chained to this one. ! * ! * @return The first SQL warning for this statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract SQLWarning ! getWarnings() throws SQLException; ! /*************************************************************************/ ! /** ! * This method clears any SQL warnings that have been attached to this ! * statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! clearWarnings() throws SQLException; ! /*************************************************************************/ ! /** ! * This method sets the cursor name that will be used by the result set. ! * ! * @param name The cursor name to use for this statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setCursorName(String name) throws SQLException; ! /*************************************************************************/ ! /** ! * This method executes an arbitrary SQL statement of any time. The ! * methods getResultSet, getMoreResults and ! * getUpdateCount retrieve the results. ! * ! * @return true if a result set was returned, false ! * if an update count was returned. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract boolean ! execute(String sql) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the result set of the SQL statement that was ! * executed. This should be called only once per result set returned. ! * ! * @return The result set of the query, or null if there was ! * no result set (for example, if the statement was an UPDATE). ! * ! * @exception SQLException If an error occurs. ! * ! * @see execute ! */ ! public abstract ResultSet ! getResultSet() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the update count of the SQL statement that was ! * executed. This should be called only once per executed SQL statement. ! * ! * @return The update count of the query, or -1 if there was no update ! * count (for example, if the statement was a SELECT). ! * ! * @exception SQLException If an error occurs. ! * ! * @see execute ! */ ! public abstract int ! getUpdateCount() throws SQLException; ! /*************************************************************************/ ! /** ! * This method advances the result set pointer to the next result set, ! * which can then be retrieved using getResultSet ! * ! * @return true if there is another result set, ! * false otherwise (for example, the next result is an ! * update count). ! * ! * @exception SQLException If an error occurs. ! * ! * @see execute ! */ ! public abstract boolean ! getMoreResults() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the current direction that the driver thinks the ! * result set will be accessed int. ! * ! * @return The direction the result set will be accessed in (????) ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getFetchDirection() throws SQLException; ! /*************************************************************************/ ! /** ! * This method informs the driver which direction the result set will ! * be accessed in. ! * ! * @param direction The direction the result set will be accessed in (?????) ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setFetchDirection(int direction) throws SQLException; ! ! /*************************************************************************/ ! /** ! * This method returns the number of rows the driver believes should be ! * fetched from the database at a time. ! * ! * @return The number of rows that will be fetched from the database at a time. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int ! getFetchSize() throws SQLException; ! /*************************************************************************/ ! /** ! * This method informs the driver how many rows it should fetch from the ! * database at a time. ! * ! * @param numrows The number of rows the driver should fetch at a time ! * to populate the result set. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! setFetchSize(int numrows) throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the concurrency type of the result set for this ! * statement. This will be one of the concurrency types defined in ! * ResultSet. ! * ! * @return The concurrency type of the result set for this statement. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract int ! getResultSetConcurrency() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the result set type for this statement. This will ! * be one of the result set types defined in ResultSet. ! * ! * @return The result set type for this statement. ! * ! * @exception SQLException If an error occurs. ! * ! * @see ResultSet ! */ ! public abstract int ! getResultSetType() throws SQLException; ! /*************************************************************************/ ! /** ! * This method adds a SQL statement to a SQL batch. A driver is not ! * required to implement this method. ! * ! * @param sql The sql statement to add to the batch. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! addBatch(String sql) throws SQLException; ! /*************************************************************************/ ! /** ! * This method clears out any SQL statements that have been populated in ! * the current batch. A driver is not required to implement this method. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract void ! clearBatch() throws SQLException; ! /*************************************************************************/ ! /** ! * This method executes the SQL batch and returns an array of update ! * counts - one for each SQL statement in the batch - ordered in the same ! * order the statements were added to the batch. A driver is not required ! * to implement this method. ! * ! * @return An array of update counts for this batch. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract int[] ! executeBatch() throws SQLException; ! /*************************************************************************/ ! /** ! * This method returns the Connection instance that was ! * used to create this object. ! * ! * @return The connection used to create this object. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Connection ! getConnection() throws SQLException; ! } // interface Statement --- 39,366 ---- package java.sql; /** ! * This interface provides a mechanism for executing SQL statements. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Statement { + public static final int CLOSE_CURRENT_RESULT = 1; + public static final int KEEP_CURRENT_RESULT = 2; + public static final int CLOSE_ALL_RESULTS = 3; + public static final int SUCCESS_NO_INFO = -2; + public static final int EXECUTE_FAILED = -3; + public static final int RETURN_GENERATED_KEYS = 1; + public static final int NO_GENERATED_KEYS = 2; ! /** ! * This method executes the specified SQL SELECT statement and returns a ! * (possibly empty) ResultSet with the results of the query. ! * ! * @param sql The SQL statement to execute. ! * @return The result set of the SQL statement. ! * @exception SQLException If an error occurs. ! */ ! public ResultSet executeQuery(String sql) throws SQLException; ! /** ! * This method executes the specified SQL INSERT, UPDATE, or DELETE statement ! * and returns the number of rows affected, which may be 0. ! * ! * @param sql The SQL statement to execute. ! * @return The number of rows affected by the SQL statement. ! * @exception SQLException If an error occurs. ! */ ! public int executeUpdate(String sql) throws SQLException; ! /** ! * This method closes the statement and frees any associated resources. ! * ! * @exception SQLException If an error occurs. ! */ ! public void close() throws SQLException; ! /** ! * This method returns the maximum length of any column value in bytes. ! * ! * @return The maximum length of any column value in bytes. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxFieldSize() throws SQLException; ! /** ! * This method sets the limit for the maximum length of any column in bytes. ! * ! * @param maxsize The new maximum length of any column in bytes. ! * @exception SQLException If an error occurs. ! */ ! public void setMaxFieldSize(int max) throws SQLException; ! /** ! * This method returns the maximum possible number of rows in a result set. ! * ! * @return The maximum possible number of rows in a result set. ! * @exception SQLException If an error occurs. ! */ ! public int getMaxRows() throws SQLException; ! /** ! * This method sets the maximum number of rows that can be present in a ! * result set. ! * ! * @param maxrows The maximum possible number of rows in a result set. ! * @exception SQLException If an error occurs. ! */ ! public void setMaxRows(int max) throws SQLException; ! /** ! * This method sets the local escape processing mode on or off. The ! * default value is on. ! * ! * @param escape true to enable local escape processing, ! * false to disable it. ! * @exception SQLException If an error occurs. ! */ ! public void setEscapeProcessing(boolean enable) throws SQLException; ! /** ! * The method returns the number of seconds a statement may be in process ! * before timing out. A value of 0 means there is no timeout. ! * ! * @return The SQL statement timeout in seconds. ! * @exception SQLException If an error occurs. ! */ ! public int getQueryTimeout() throws SQLException; ! /** ! * This method sets the number of seconds a statement may be in process ! * before timing out. A value of 0 means there is no timeout. ! * ! * @param timeout The new SQL statement timeout value. ! * @exception SQLException If an error occurs. ! */ ! public void setQueryTimeout(int seconds) throws SQLException; ! /** ! * This method cancels an outstanding statement, if the database supports ! * that operation. ! * ! * @exception SQLException If an error occurs. ! */ ! public void cancel() throws SQLException; ! /** ! * This method returns the first SQL warning attached to this statement. ! * Subsequent warnings will be chained to this one. ! * ! * @return The first SQL warning for this statement. ! * @exception SQLException If an error occurs. ! */ ! public SQLWarning getWarnings() throws SQLException; ! /** ! * This method clears any SQL warnings that have been attached to this ! * statement. ! * ! * @exception SQLException If an error occurs. ! */ ! public void clearWarnings() throws SQLException; ! /** ! * This method sets the cursor name that will be used by the result set. ! * ! * @param name The cursor name to use for this statement. ! * @exception SQLException If an error occurs. ! */ ! public void setCursorName(String name) throws SQLException; ! /** ! * This method executes an arbitrary SQL statement of any time. The ! * methods getResultSet, getMoreResults and ! * getUpdateCount retrieve the results. ! * ! * @return true if a result set was returned, false ! * if an update count was returned. ! * @exception SQLException If an error occurs. ! */ ! public boolean execute(String sql) throws SQLException; ! /** ! * This method returns the result set of the SQL statement that was ! * executed. This should be called only once per result set returned. ! * ! * @return The result set of the query, or null if there was ! * no result set (for example, if the statement was an UPDATE). ! * @exception SQLException If an error occurs. ! * @see execute ! */ ! public ResultSet getResultSet() throws SQLException; ! /** ! * This method returns the update count of the SQL statement that was ! * executed. This should be called only once per executed SQL statement. ! * ! * @return The update count of the query, or -1 if there was no update ! * count (for example, if the statement was a SELECT). ! * @exception SQLException If an error occurs. ! * @see execute ! */ ! public int getUpdateCount() throws SQLException; ! /** ! * This method advances the result set pointer to the next result set, ! * which can then be retrieved using getResultSet ! * ! * @return true if there is another result set, ! * false otherwise (for example, the next result is an ! * update count). ! * @exception SQLException If an error occurs. ! * @see execute ! */ ! public boolean getMoreResults() throws SQLException; ! /** ! * This method informs the driver which direction the result set will ! * be accessed in. ! * ! * @param direction The direction the result set will be accessed in (?????) ! * @exception SQLException If an error occurs. ! */ ! public void setFetchDirection(int direction) throws SQLException; ! /** ! * This method returns the current direction that the driver thinks the ! * result set will be accessed int. ! * ! * @return The direction the result set will be accessed in (????) ! * @exception SQLException If an error occurs. ! */ ! public int getFetchDirection() throws SQLException; ! /** ! * This method informs the driver how many rows it should fetch from the ! * database at a time. ! * ! * @param numrows The number of rows the driver should fetch at a time ! * to populate the result set. ! * @exception SQLException If an error occurs. ! */ ! public void setFetchSize(int rows) throws SQLException; ! /** ! * This method returns the number of rows the driver believes should be ! * fetched from the database at a time. ! * ! * @return The number of rows that will be fetched from the database at a time. ! * @exception SQLException If an error occurs. ! */ ! public int getFetchSize() throws SQLException; ! /** ! * This method returns the concurrency type of the result set for this ! * statement. This will be one of the concurrency types defined in ! * ResultSet. ! * ! * @return The concurrency type of the result set for this statement. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public int getResultSetConcurrency() throws SQLException; ! /** ! * This method returns the result set type for this statement. This will ! * be one of the result set types defined in ResultSet. ! * ! * @return The result set type for this statement. ! * @exception SQLException If an error occurs. ! * @see ResultSet ! */ ! public int getResultSetType() throws SQLException; ! /** ! * This method adds a SQL statement to a SQL batch. A driver is not ! * required to implement this method. ! * ! * @param sql The sql statement to add to the batch. ! * @exception SQLException If an error occurs. ! */ ! public void addBatch(String sql) throws SQLException; ! /** ! * This method clears out any SQL statements that have been populated in ! * the current batch. A driver is not required to implement this method. ! * ! * @exception SQLException If an error occurs. ! */ ! public void clearBatch() throws SQLException; ! /** ! * This method executes the SQL batch and returns an array of update ! * counts - one for each SQL statement in the batch - ordered in the same ! * order the statements were added to the batch. A driver is not required ! * to implement this method. ! * ! * @return An array of update counts for this batch. ! * @exception SQLException If an error occurs. ! */ ! public int[] executeBatch() throws SQLException; ! /** ! * This method returns the Connection instance that was ! * used to create this object. ! * ! * @return The connection used to create this object. ! * @exception SQLException If an error occurs. ! */ ! public Connection getConnection() throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean getMoreResults(int current) throws SQLException; ! /** ! * @since 1.4 ! */ ! public ResultSet getGeneratedKeys() throws SQLException; ! /** ! * @since 1.4 ! */ ! public int executeUpdate(String sql, int autoGeneratedKeys) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public int executeUpdate(String sql, int[] columnIndexes) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public int executeUpdate(String sql, String[] columnNames) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean execute(String sql, int autoGeneratedKeys) ! throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean execute(String sql, int[] columnIndexes) throws SQLException; ! /** ! * @since 1.4 ! */ ! public boolean execute(String sql, String[] columnNames) ! throws SQLException; + /** + * @since 1.4 + */ + public int getResultSetHoldability() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Struct.java gcc-3.3/libjava/java/sql/Struct.java *** gcc-3.2.3/libjava/java/sql/Struct.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Struct.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 1,5 **** /* Struct.java -- Mapping for a SQL structured type. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Struct.java -- Mapping for a SQL structured type. ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.sql; *** 41,91 **** import java.util.Map; /** ! * This interface implements the standard type mapping for a SQL ! * structured type. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Struct { ! /** ! * This method returns the name of the SQL structured type for this ! * object. ! * ! * @return The SQL structured type name. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract String ! getSQLTypeName() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the attributes of this SQL structured type. ! * ! * @return The attributes of this structure type. ! * ! * @exception SQLException If an error occurs. ! */ ! public abstract Object[] ! getAttributes() throws SQLException; ! ! /*************************************************************************/ ! ! /** ! * This method returns the attributes of this SQL structured type. ! * The specified map of type mappings overrides the default mappings. ! * ! * @param map The map of SQL type mappings. ! * ! * @return The attributes of this structure type. ! * ! * @exception SQLException If a error occurs. ! */ ! public abstract Object[] ! getAttributes(Map map) throws SQLException; ! ! } // interface Struct --- 41,77 ---- import java.util.Map; /** ! * This interface implements the standard type mapping for a SQL ! * structured type. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public interface Struct { + /** + * This method returns the name of the SQL structured type for this + * object. + * + * @return The SQL structured type name. + * @exception SQLException If an error occurs. + */ + public String getSQLTypeName() throws SQLException; ! /** ! * This method returns the attributes of this SQL structured type. ! * ! * @return The attributes of this structure type. ! * @exception SQLException If an error occurs. ! */ ! public Object[] getAttributes() throws SQLException; + /** + * This method returns the attributes of this SQL structured type. + * The specified map of type mappings overrides the default mappings. + * + * @param map The map of SQL type mappings. + * @return The attributes of this structure type. + * @exception SQLException If a error occurs. + */ + public Object[] getAttributes(Map map) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Time.java gcc-3.3/libjava/java/sql/Time.java *** gcc-3.2.3/libjava/java/sql/Time.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Time.java 2002-06-21 05:39:24.000000000 +0000 *************** *** 1,5 **** /* Time.java -- Wrapper around java.util.Date ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Time.java -- Wrapper around java.util.Date ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.sql; *** 41,153 **** import java.text.SimpleDateFormat; /** ! * This class is a wrapper around java.util.Date to allow the JDBC ! * driver to identify the value as a SQL Time. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ ! public class Time extends java.util.Date ! { ! ! /* ! * Class Variables ! */ ! ! /** ! * Used for parsing and formatting this date. ! */ ! private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); ! ! /** ! * This is the serialization UID for this class. ! */ ! private static final long serialVersionUID = 8397324403548013681L; ! ! /*************************************************************************/ ! ! /* ! * Class Methods */ ! ! /** ! * This method returns a new instance of this class by parsing a ! * date in JDBC format into a Java date. ! * ! * @param str The string to parse. ! * ! * @return The resulting java.sql.Time value. ! */ ! public static Time ! valueOf(String str) { ! try ! { ! java.util.Date d = (java.util.Date)sdf.parseObject(str); ! return(new Time(d.getTime())); ! } ! catch(Exception e) ! { ! return(null); ! } ! } ! ! /*************************************************************************/ ! /* ! * Constructors ! */ - /** - * This method initializes a new instance of this class with the - * specified year, month, and day. - * - * @param hour The hour for this Time (0-23) - * @param minute The minute for this time (0-59) - * @param second The second for this time (0-59) - * - * @deprecated - */ - public - Time(int hour, int minute, int second) - { - super(System.currentTimeMillis()); ! setHours(hour); ! setMinutes(minute); ! setSeconds(second); ! } ! /*************************************************************************/ ! /** ! * This method initializes a new instance of this class with the ! * specified time value representing the number of seconds since ! * Jan 1, 1970 at 12:00 midnight GMT. ! * ! * @param time The time value to intialize this Time to. ! */ ! public ! Time(long date) ! { ! super(date); ! } ! /*************************************************************************/ ! /* ! * Instance Methods ! */ - /** - * This method returns this date in JDBC format. - * - * @return This date as a string. - */ - public String - toString() - { - return(sdf.format(this)); } - } // class Time - --- 41,121 ---- import java.text.SimpleDateFormat; /** ! * This class is a wrapper around java.util.Date to allow the JDBC ! * driver to identify the value as a SQL Time. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) */ ! public class Time extends java.util.Date { ! static final long serialVersionUID = 8397324403548013681L; ! /** ! * Used for parsing and formatting this date. ! */ ! private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); ! /** ! * This method returns a new instance of this class by parsing a ! * date in JDBC format into a Java date. ! * ! * @param str The string to parse. ! * @return The resulting java.sql.Time value. ! */ ! public static Time valueOf(String str) ! { ! try ! { ! java.util.Date d = (java.util.Date) sdf.parseObject(str); ! return new Time(d.getTime()); ! } ! catch (Exception e) ! { ! return null; ! } ! } ! /** ! * This method initializes a new instance of this class with the ! * specified year, month, and day. ! * ! * @param hour The hour for this Time (0-23) ! * @param minute The minute for this time (0-59) ! * @param second The second for this time (0-59) ! * @deprecated ! */ ! public Time(int hour, int minute, int second) ! { ! super(System.currentTimeMillis()); ! setHours(hour); ! setMinutes(minute); ! setSeconds(second); ! } ! /** ! * This method initializes a new instance of this class with the ! * specified time value representing the number of seconds since ! * Jan 1, 1970 at 12:00 midnight GMT. ! * ! * @param time The time value to intialize this Time to. ! */ ! public Time(long date) ! { ! super(date); ! } ! /** ! * This method returns this date in JDBC format. ! * ! * @return This date as a string. ! */ ! public String ! toString() ! { ! return sdf.format(this); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Timestamp.java gcc-3.3/libjava/java/sql/Timestamp.java *** gcc-3.2.3/libjava/java/sql/Timestamp.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Timestamp.java 2003-02-10 19:55:44.000000000 +0000 *************** *** 1,5 **** /* Time.java -- Wrapper around java.util.Date ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Time.java -- Wrapper around java.util.Date ! Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.sql; *** 41,301 **** import java.text.SimpleDateFormat; /** ! * This class is a wrapper around java.util.Date to allow the JDBC ! * driver to identify the value as a SQL Timestamp. Note that this ! * class also adds an additional field for nano-seconds, and so ! * is not completely identical to java.util.Date as ! * the java.sql.Date and java.sql.Time ! * classes are. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class Timestamp extends java.util.Date { ! /* ! * Class Variables ! */ ! ! /** ! * Used for parsing and formatting this date. ! */ // Millisecond will have to be close enough for now. ! private static SimpleDateFormat parse_sdf = ! new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS"); ! ! private static SimpleDateFormat format_sdf = ! new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); ! ! /** ! * This is the serialization UID for this class. ! */ ! private static final long serialVersionUID = 3581463369166924961L; ! ! /*************************************************************************/ ! ! /* ! * Instance Variables ! */ ! ! /** ! * @serial The nanosecond value for this object ! */ ! private int nanos; ! ! /*************************************************************************/ ! ! /* ! * Class Methods ! */ ! ! /** ! * This method returns a new instance of this class by parsing a ! * date in JDBC format into a Java date. ! * ! * @param str The string to parse. ! * ! * @return The resulting java.sql.Timestamp value. ! */ ! public static Timestamp ! valueOf(String str) ! { ! try ! { ! Date d = (Date)parse_sdf.parseObject(str); ! return(new Timestamp(d.getTime())); ! } ! catch(Exception e) ! { ! return(null); ! } ! } ! ! /*************************************************************************/ ! ! /* ! * Constructors ! */ ! ! /** ! * This method initializes a new instance of this class with the ! * specified year, month, and day. ! * ! * @param year The year for this Timestamp (year - 1900) ! * @param month The month for this Timestamp (0-11) ! * @param day The day for this Timestamp (1-31) ! * @param hour The hour for this Timestamp (0-23) ! * @param minute The minute for this Timestamp (0-59) ! * @param second The second for this Timestamp (0-59) ! * @param nanos The nanosecond value for this Timestamp (0 to 999,999,9999) ! * ! * @deprecated ! */ ! public ! Timestamp(int year, int month, int day, int hour, int minute, int second, ! int nanos) ! { ! super(year, month, day, hour, minute, second); ! ! this.nanos = nanos; ! } ! ! /*************************************************************************/ ! ! /** ! * This method initializes a new instance of this class with the ! * specified time value representing the number of seconds since ! * Jan 1, 1970 at 12:00 midnight GMT. ! * ! * @param time The time value to intialize this Time to. ! */ ! public ! Timestamp(long date) ! { ! super(date); ! } ! ! /*************************************************************************/ ! /* ! * Instance Methods ! */ ! /** ! * This method returns this date in JDBC format. ! * ! * @return This date as a string. ! */ ! public String ! toString() ! { ! return(format_sdf.format(this) + "." + getNanos()); ! } ! /*************************************************************************/ ! /** ! * This method returns the nanosecond value for this object. ! * ! * @return The nanosecond value for this object. ! */ ! public int ! getNanos() ! { ! return(nanos); ! } ! /*************************************************************************/ ! /** ! * This method sets the nanosecond value for this object. ! * ! * @param nanos The nanosecond value for this object. ! */ ! public void ! setNanos(int nanos) ! { ! this.nanos = nanos; ! } ! /*************************************************************************/ ! /** ! * This methods tests whether this object is earlier than the specified ! * object. ! * ! * @param ts The other Timestamp to test against. ! * ! * @return true if this object is earlier than the other object, ! * false otherwise. ! */ ! public boolean ! before(Timestamp ts) ! { ! if (ts.getTime() > getTime()) ! return(true); ! if (ts.getNanos() > getNanos()) ! return(true); ! return(false); ! } ! /*************************************************************************/ ! /** ! * This methods tests whether this object is later than the specified ! * object. ! * ! * @param ts The other Timestamp to test against. ! * ! * @return true if this object is later than the other object, ! * false otherwise. ! */ ! public boolean ! after(Timestamp ts) ! { ! if (ts.getTime() < getTime()) ! return(true); ! if (ts.getNanos() < getNanos()) ! return(true); ! return(false); ! } ! /*************************************************************************/ ! /** ! * This method these the specified Object for equality ! * against this object. This will be true if an only if the specified ! * object is an instance of Timestamp and has the same ! * time value fields. ! * ! * @param obj The object to test against for equality. ! * ! * @return true if the specified object is equal to this ! * object, false otherwise. ! */ ! public boolean ! equals(Object obj) ! { ! if (obj == null) ! return(false); ! if (!(obj instanceof Timestamp)) ! return(false); ! return(equals((Timestamp)obj)); ! } ! /*************************************************************************/ ! /** ! * This method tests the specified timestamp for equality against this ! * object. This will be true if and only if the specified object is ! * not null and contains all the same time value fields ! * as this object. ! * ! * @param ts The Timestamp to test against for equality. ! * ! * @return true if the specified object is equal to this ! * object, false otherwise. ! */ ! public boolean ! equals(Timestamp ts) ! { ! if (ts == null) ! return(false); ! if (ts.getTime() != getTime()) ! return(false); ! if (ts.getNanos() != getNanos()) ! return(false); ! return(true); } - - } // class Timestamp - --- 41,273 ---- import java.text.SimpleDateFormat; /** ! * This class is a wrapper around java.util.Date to allow the JDBC ! * driver to identify the value as a SQL Timestamp. Note that this ! * class also adds an additional field for nano-seconds, and so ! * is not completely identical to java.util.Date as ! * the java.sql.Date and java.sql.Time ! * classes are. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class Timestamp extends java.util.Date { + static final long serialVersionUID = 2745179027874758501L; ! /** ! * Used for parsing and formatting this date. ! */ // Millisecond will have to be close enough for now. ! private static SimpleDateFormat parse_sdf = ! new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS"); ! private static SimpleDateFormat format_sdf = ! new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); ! /** ! * The nanosecond value for this object ! */ ! private int nanos; ! /** ! * This method returns a new instance of this class by parsing a ! * date in JDBC format into a Java date. ! * ! * @param str The string to parse. ! * @return The resulting java.sql.Timestamp value. ! */ ! public static Timestamp valueOf(String str) ! { ! try ! { ! Date d = (Date) parse_sdf.parseObject(str); ! return new Timestamp(d.getTime()); ! } ! catch (Exception e) ! { ! return null; ! } ! } ! /** ! * This method initializes a new instance of this class with the ! * specified year, month, and day. ! * ! * @param year The year for this Timestamp (year - 1900) ! * @param month The month for this Timestamp (0-11) ! * @param day The day for this Timestamp (1-31) ! * @param hour The hour for this Timestamp (0-23) ! * @param minute The minute for this Timestamp (0-59) ! * @param second The second for this Timestamp (0-59) ! * @param nanos The nanosecond value for this Timestamp (0 to 999,999,9999) ! * @deprecated ! */ ! public Timestamp(int year, int month, int day, int hour, int minute, ! int second, int nanos) ! { ! super(year, month, day, hour, minute, second); ! this.nanos = nanos; ! } ! /** ! * This method initializes a new instance of this class with the ! * specified time value representing the number of seconds since ! * Jan 1, 1970 at 12:00 midnight GMT. ! * ! * @param time The time value to intialize this Time to. ! */ ! public Timestamp(long date) ! { ! super(date); ! } ! /** ! * This method returns this date in JDBC format. ! * ! * @return This date as a string. ! */ ! public String toString() ! { ! return format_sdf.format(this) + "." + getNanos(); ! } ! /** ! * This method returns the nanosecond value for this object. ! * @return The nanosecond value for this object. ! */ ! public int getNanos() ! { ! return nanos; ! } ! /** ! * This method sets the nanosecond value for this object. ! * ! * @param nanos The nanosecond value for this object. ! */ ! public void setNanos(int nanos) ! { ! this.nanos = nanos; ! } ! /** ! * This methods tests whether this object is earlier than the specified ! * object. ! * ! * @param ts The other Timestamp to test against. ! * @return true if this object is earlier than the other object, ! * false otherwise. ! */ ! public boolean before(Timestamp ts) ! { ! if (ts.getTime() > getTime()) ! return true; ! if (ts.getNanos() > getNanos()) ! return true; ! return false; ! } ! /** ! * This methods tests whether this object is later than the specified ! * object. ! * ! * @param ts The other Timestamp to test against. ! * ! * @return true if this object is later than the other object, ! * false otherwise. ! */ ! public boolean after(Timestamp ts) ! { ! if (ts.getTime() < getTime()) ! return true; ! if (ts.getNanos() < getNanos()) ! return true; ! return false; ! } ! /** ! * This method these the specified Object for equality ! * against this object. This will be true if an only if the specified ! * object is an instance of Timestamp and has the same ! * time value fields. ! * ! * @param obj The object to test against for equality. ! * ! * @return true if the specified object is equal to this ! * object, false otherwise. ! */ ! public boolean equals(Object obj) ! { ! if (obj == null) ! return false; ! if (!(obj instanceof Timestamp)) ! return false; ! return equals((Timestamp) obj); ! } ! /** ! * This method tests the specified timestamp for equality against this ! * object. This will be true if and only if the specified object is ! * not null and contains all the same time value fields ! * as this object. ! * ! * @param ts The Timestamp to test against for equality. ! * ! * @return true if the specified object is equal to this ! * object, false otherwise. ! */ ! public boolean equals(Timestamp ts) ! { ! if (ts == null) ! return false; ! if (ts.getTime() != getTime()) ! return false; ! if (ts.getNanos() != getNanos()) ! return false; ! return true; ! } ! /** ! * Compare two Timestamp ! * @param when the other Timestamp. ! * @return 0, if the date represented ! * by obj is exactly the same as the time represented by this ! * object, a negative if this Timestamp is before the other Timestamp, and ! * a positive value otherwise. ! * @since 1.2 ! */ ! public int compareTo(Timestamp ts) ! { ! int s = super.compareTo((java.util.Date) ts); ! if (s != 0) ! return s; ! // If Date components were equal, then we check the nanoseconds. ! return nanos - ts.nanos; ! } ! /** ! * Compares this Timestamp to another. This behaves like ! * compareTo(Timestamp), but it may throw a ! * ClassCastException ! * @param obj the other Timestamp. ! * @return 0, if the Timestamp represented ! * by obj is exactly the same as the time represented by this ! * object, a negative if this Timestamp is before the other Timestamp, and ! * a positive value otherwise. ! * @exception ClassCastException if obj is not of type Timestamp. ! * @since 1.2 ! */ ! public int compareTo(Object obj) ! { ! return compareTo((Timestamp) obj); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/sql/Types.java gcc-3.3/libjava/java/sql/Types.java *** gcc-3.2.3/libjava/java/sql/Types.java 2002-01-22 22:40:36.000000000 +0000 --- gcc-3.3/libjava/java/sql/Types.java 2002-06-21 05:39:24.000000000 +0000 *************** exception statement from your version. * *** 39,87 **** package java.sql; /** ! * This class contains constants that are used to identify SQL data types. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class Types { ! ! // These should be self explanatory. People need a SQL book, not ! // Javadoc comments for these. ! ! public static final int BIT = -7; ! public static final int TINYINT = -6; ! public static final int SMALLINT = 5; ! public static final int INTEGER = 4; ! public static final int BIGINT = -5; ! public static final int FLOAT = 6; ! public static final int REAL = 7; ! public static final int DOUBLE = 8; ! public static final int NUMERIC = 2; ! public static final int DECIMAL = 3; ! public static final int CHAR = 1; ! public static final int VARCHAR = 12; ! public static final int LONGVARCHAR = -1; ! public static final int DATE = 91; ! public static final int TIME = 92; ! public static final int TIMESTAMP = 93; ! public static final int BINARY = -2; ! public static final int VARBINARY = -3; ! public static final int LONGVARBINARY = -4; ! public static final int NULL = 0; ! public static final int OTHER = 1111; ! public static final int JAVA_OBJECT = 2000; ! public static final int DISTINCT = 2001; ! public static final int STRUCT = 2002; ! public static final int ARRAY = 2003; ! public static final int BLOB = 2004; ! public static final int CLOB = 2005; ! public static final int REF = 2006; // This class can't be instantiated. ! private Types () { } ! ! } // class Types ! --- 39,85 ---- package java.sql; /** ! * This class contains constants that are used to identify SQL data types. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! */ public class Types { ! // These should be self explanatory. People need a SQL book, not ! // Javadoc comments for these. ! public static final int BIT = -7; ! public static final int TINYINT = -6; ! public static final int SMALLINT = 5; ! public static final int INTEGER = 4; ! public static final int BIGINT = -5; ! public static final int FLOAT = 6; ! public static final int REAL = 7; ! public static final int DOUBLE = 8; ! public static final int NUMERIC = 2; ! public static final int DECIMAL = 3; ! public static final int CHAR = 1; ! public static final int VARCHAR = 12; ! public static final int LONGVARCHAR = -1; ! public static final int DATE = 91; ! public static final int TIME = 92; ! public static final int TIMESTAMP = 93; ! public static final int BINARY = -2; ! public static final int VARBINARY = -3; ! public static final int LONGVARBINARY = -4; ! public static final int NULL = 0; ! public static final int OTHER = 1111; ! public static final int JAVA_OBJECT = 2000; ! public static final int DISTINCT = 2001; ! public static final int STRUCT = 2002; ! public static final int ARRAY = 2003; ! public static final int BLOB = 2004; ! public static final int CLOB = 2005; ! public static final int REF = 2006; ! public static final int DATALINK = 70; ! public static final int BOOLEAN = 16; // This class can't be instantiated. ! private Types() { } ! } diff -Nrc3pad gcc-3.2.3/libjava/java/text/ChoiceFormat.java gcc-3.3/libjava/java/text/ChoiceFormat.java *** gcc-3.2.3/libjava/java/text/ChoiceFormat.java 2002-01-22 22:40:37.000000000 +0000 --- gcc-3.3/libjava/java/text/ChoiceFormat.java 2002-07-02 19:43:02.000000000 +0000 *************** *** 1,5 **** /* ChoiceFormat.java -- Format over a range of numbers ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* ChoiceFormat.java -- Format over a range of numbers ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.util.Vector; *** 52,61 **** * This sounds complicated, but that is because I did a poor job of * explaining it. Consider the following example: *

          ! *

          !  * terminators = { 1, ChoiceFormat.nextDouble(1) }
          !  * formats = { "file", "files" }
          !  * 
          *

          * In this case if the actual number tested is one or less, then the word * "file" is used as the format value. If the number tested is greater than --- 52,61 ---- * This sounds complicated, but that is because I did a poor job of * explaining it. Consider the following example: *

          ! * !

          terminators = { 1, ChoiceFormat.nextDouble(1) }
          ! formats = { "file", "files" }
          ! * *

          * In this case if the actual number tested is one or less, then the word * "file" is used as the format value. If the number tested is greater than *************** public class ChoiceFormat extends Number *** 259,272 **** if (choiceLimits.length == 0) return appendBuf; ! int index = 0; if (! Double.isNaN(num) && num >= choiceLimits[0]) { for (; index < choiceLimits.length - 1; ++index) { ! if (choiceLimits[index] <= num ! && index != choiceLimits.length - 2 ! && num < choiceLimits[index + 1]) break; } } --- 259,270 ---- if (choiceLimits.length == 0) return appendBuf; ! int index = 0; if (! Double.isNaN(num) && num >= choiceLimits[0]) { for (; index < choiceLimits.length - 1; ++index) { ! if (choiceLimits[index] <= num && num < choiceLimits[index + 1]) break; } } diff -Nrc3pad gcc-3.2.3/libjava/java/text/Collator.java gcc-3.3/libjava/java/text/Collator.java *** gcc-3.2.3/libjava/java/text/Collator.java 2002-01-22 22:40:37.000000000 +0000 --- gcc-3.3/libjava/java/text/Collator.java 2002-10-04 08:48:02.000000000 +0000 *************** public abstract class Collator implement *** 153,160 **** * @param str1 The first object to compare * @param str2 The second object to compare * ! * @return A negative integer if str1 < str2, 0 if str1 == str2, or ! * a positive integer if str1 > str2. */ public abstract int compare (String source, String target); --- 153,160 ---- * @param str1 The first object to compare * @param str2 The second object to compare * ! * @return A negative integer if str1 < str2, 0 if str1 == str2, or ! * a positive integer if str1 > str2. */ public abstract int compare (String source, String target); *************** public abstract class Collator implement *** 167,174 **** * @param obj1 The first object to compare * @param obj2 The second object to compare * ! * @return A negative integer if obj1 < obj2, 0 if obj1 == obj2, or ! * a positive integer if obj1 > obj2. * * @exception ClassCastException If the arguments are not instances * of String. --- 167,174 ---- * @param obj1 The first object to compare * @param obj2 The second object to compare * ! * @return A negative integer if obj1 < obj2, 0 if obj1 == obj2, or ! * a positive integer if obj1 > obj2. * * @exception ClassCastException If the arguments are not instances * of String. diff -Nrc3pad gcc-3.2.3/libjava/java/text/Format.java gcc-3.3/libjava/java/text/Format.java *** gcc-3.2.3/libjava/java/text/Format.java 2002-01-22 22:40:37.000000000 +0000 --- gcc-3.3/libjava/java/text/Format.java 2002-11-10 22:06:48.000000000 +0000 *************** import java.io.Serializable; *** 59,64 **** --- 59,66 ---- */ public abstract class Format implements Serializable, Cloneable { + static final long serialVersionUID = -299282585814624189L; + /** * This method initializes a new instance of Format. * It performs no actions, but acts as a default constructor for diff -Nrc3pad gcc-3.2.3/libjava/java/text/MessageFormat.java gcc-3.3/libjava/java/text/MessageFormat.java *** gcc-3.2.3/libjava/java/text/MessageFormat.java 2002-01-22 22:40:37.000000000 +0000 --- gcc-3.3/libjava/java/text/MessageFormat.java 2002-07-02 19:43:06.000000000 +0000 *************** *** 1,5 **** /* MessageFormat.java - Localized message formatting. ! Copyright (C) 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* MessageFormat.java - Localized message formatting. ! Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class MessageFormat extends Forma *** 373,389 **** if (formatter instanceof ChoiceFormat) { StringBuffer buf = new StringBuffer (); - // FIXME: don't actually know what is correct here. - // Can a sub-format refer to any argument, or just - // the single argument passed to it? Must test - // against JDK. formatter.format(thisArg, buf, ignore); MessageFormat mf = new MessageFormat (); mf.setLocale(locale); mf.applyPattern(buf.toString()); ! formatter = mf; } ! formatter.format(thisArg, appendBuf, ignore); } appendBuf.append(elements[i].trailer); --- 373,386 ---- if (formatter instanceof ChoiceFormat) { StringBuffer buf = new StringBuffer (); formatter.format(thisArg, buf, ignore); MessageFormat mf = new MessageFormat (); mf.setLocale(locale); mf.applyPattern(buf.toString()); ! mf.format(arguments, appendBuf, ignore); } ! else ! formatter.format(thisArg, appendBuf, ignore); } appendBuf.append(elements[i].trailer); diff -Nrc3pad gcc-3.2.3/libjava/java/text/ParseException.java gcc-3.3/libjava/java/text/ParseException.java *** gcc-3.2.3/libjava/java/text/ParseException.java 2002-01-22 22:40:37.000000000 +0000 --- gcc-3.3/libjava/java/text/ParseException.java 2002-06-15 18:38:00.000000000 +0000 *************** *** 1,5 **** ! /* ParseException.java -- An error occurred while parsing. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ParseException.java -- an error occurred while parsing ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 38,102 **** package java.text; - /* Written using "Java Class Libraries", 2nd edition, plus online - * API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - - /** - * This exception is thrown when an unexpected error occurs during parsing. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Per Bothner - * @date October 25, 1998. - */ - public class ParseException extends Exception - { - - /* - * Instance Variables - */ - /** ! * This is the position where the error was encountered. ! */ ! private int errorOffset; ! ! /*************************************************************************/ ! ! /* ! * Constructors */ ! ! /** ! * This method initializes a new instance of ParseException ! * with a detailed error message and a error position. ! * ! * @param msg The descriptive message describing the error. ! * @param offset The position where the error was encountered. ! */ ! public ! ParseException(String s, int offset) { ! super(s); ! ! errorOffset = offset; ! } ! /*************************************************************************/ ! /** ! * This method returns the position where the error occurred. ! * ! * @return The position where the error occurred. ! */ ! public int ! getErrorOffset() ! { ! return(errorOffset); ! } } // class ParseException - --- 38,86 ---- package java.text; /** ! * This exception is thrown when an unexpected error occurs during parsing. ! * ! * @author Aaron M. Renn (arenn@urbanophile.com) ! * @author Per Bothner ! * @see Format ! * @see FieldPosition ! * @status updated to 1.4 */ ! public class ParseException extends Exception { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 2703218443322787634L; ! /** ! * This is the position where the error was encountered. ! * ! * @serial the zero-based offset in the string where the error occurred ! */ ! private final int errorOffset; ! /** ! * This method initializes a new instance of ParseException ! * with a detailed error message and a error position. ! * ! * @param msg the descriptive message describing the error ! * @param offset the position where the error was encountered ! */ ! public ParseException(String s, int offset) ! { ! super(s); ! errorOffset = offset; ! } + /** + * This method returns the position where the error occurred. + * + * @return the position where the error occurred + */ + public int getErrorOffset() + { + return errorOffset; + } } // class ParseException diff -Nrc3pad gcc-3.2.3/libjava/java/util/AbstractList.java gcc-3.3/libjava/java/util/AbstractList.java *** gcc-3.2.3/libjava/java/util/AbstractList.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/AbstractList.java 2002-06-18 15:39:43.000000000 +0000 *************** *** 1,5 **** /* AbstractList.java -- Abstract implementation of most of List ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* AbstractList.java -- Abstract implementation of most of List ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public abstract class AbstractList exten *** 237,256 **** } /** ! * Obtain a hash code for this list. In order to obey the general contract of ! * the hashCode method of class Object, this value is calculated as follows: ! *

          !    *   hashCode = 1;
          !    *   Iterator i = list.iterator();
          !    *   while (i.hasNext())
          !    *     {
          !    *       Object obj = i.next();
          !    *       hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
          !    *     }
          !    * 
          * This ensures that the general contract of Object.hashCode() is adhered to. * * @return the hash code of this list * @see Object#hashCode() * @see #equals(Object) */ --- 237,258 ---- } /** ! * Obtains a hash code for this list. In order to obey the general ! * contract of the hashCode method of class Object, this value is ! * calculated as follows: ! * !
          hashCode = 1;
          ! Iterator i = list.iterator();
          ! while (i.hasNext())
          ! {
          !   Object obj = i.next();
          !   hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
          ! }
          ! * * This ensures that the general contract of Object.hashCode() is adhered to. * * @return the hash code of this list + * * @see Object#hashCode() * @see #equals(Object) */ *************** public abstract class AbstractList exten *** 611,629 **** /** * This class follows the implementation requirements set forth in ! * {@link AbstractList#subList(int, int)}. Some compilers have problems ! * with AbstractList.this.modCount if this class is nested in AbstractList, ! * even though the JLS defines that to be legal, so we make it a top-level ! * class. * * @author Original author unknown * @author Eric Blake */ class SubList extends AbstractList { ! private final AbstractList backingList; ! private final int offset; ! private int size; /** * Construct the sublist. --- 613,633 ---- /** * This class follows the implementation requirements set forth in ! * {@link AbstractList#subList(int, int)}. It matches Sun's implementation ! * by using a non-public top-level class in the same package. * * @author Original author unknown * @author Eric Blake */ class SubList extends AbstractList { ! // Package visible, for use by iterator. ! /** The original list. */ ! final AbstractList backingList; ! /** The index of the first element of the sublist. */ ! final int offset; ! /** The size of the sublist. */ ! int size; /** * Construct the sublist. *************** class SubList extends AbstractList *** 647,654 **** * @throws ConcurrentModificationException if the backing list has been * modified externally to this sublist */ ! // This will get inlined, since it is private. ! private void checkMod() { if (modCount != backingList.modCount) throw new ConcurrentModificationException(); --- 651,658 ---- * @throws ConcurrentModificationException if the backing list has been * modified externally to this sublist */ ! // This can be inlined. Package visible, for use by iterator. ! void checkMod() { if (modCount != backingList.modCount) throw new ConcurrentModificationException(); diff -Nrc3pad gcc-3.2.3/libjava/java/util/AbstractMap.java gcc-3.3/libjava/java/util/AbstractMap.java *** gcc-3.2.3/libjava/java/util/AbstractMap.java 2002-04-08 00:24:46.000000000 +0000 --- gcc-3.3/libjava/java/util/AbstractMap.java 2002-11-10 22:06:49.000000000 +0000 *************** *** 1,5 **** /* AbstractMap.java -- Abstract implementation of most of Map ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* AbstractMap.java -- Abstract implementation of most of Map ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public abstract class AbstractMap implem *** 466,471 **** --- 466,476 ---- return AbstractMap.this.size(); } + public boolean contains(Object value) + { + return containsValue(value); + } + public Iterator iterator() { return new Iterator() *************** public abstract class AbstractMap implem *** 518,521 **** --- 523,650 ---- { return o == null ? 0 : o.hashCode(); } + + /** + * A class which implements Map.Entry. It is shared by HashMap, TreeMap, + * Hashtable, and Collections. It is not specified by the JDK, but makes + * life much easier. + * + * @author Jon Zeppieri + * @author Eric Blake + */ + // XXX - FIXME Use fully qualified implements as gcj 3.1 workaround. + static class BasicMapEntry implements Map.Entry + { + /** + * The key. Package visible for direct manipulation. + */ + Object key; + + /** + * The value. Package visible for direct manipulation. + */ + Object value; + + /** + * Basic constructor initializes the fields. + * @param newKey the key + * @param newValue the value + */ + BasicMapEntry(Object newKey, Object newValue) + { + key = newKey; + value = newValue; + } + + /** + * Compares the specified object with this entry. Returns true only if + * the object is a mapping of identical key and value. In other words, + * this must be:
          + *
          (o instanceof Map.Entry)
          +      *       && (getKey() == null ? ((HashMap) o).getKey() == null
          +      *           : getKey().equals(((HashMap) o).getKey()))
          +      *       && (getValue() == null ? ((HashMap) o).getValue() == null
          +      *           : getValue().equals(((HashMap) o).getValue()))
          + * + * @param o the object to compare + * @return true if it is equal + */ + public final boolean equals(Object o) + { + if (! (o instanceof Map.Entry)) + return false; + // Optimize for our own entries. + if (o instanceof BasicMapEntry) + { + BasicMapEntry e = (BasicMapEntry) o; + return (AbstractMap.equals(key, e.key) + && AbstractMap.equals(value, e.value)); + } + Map.Entry e = (Map.Entry) o; + return (AbstractMap.equals(key, e.getKey()) + && AbstractMap.equals(value, e.getValue())); + } + + /** + * Get the key corresponding to this entry. + * + * @return the key + */ + public final Object getKey() + { + return key; + } + + /** + * Get the value corresponding to this entry. If you already called + * Iterator.remove(), the behavior undefined, but in this case it works. + * + * @return the value + */ + public final Object getValue() + { + return value; + } + + /** + * Returns the hash code of the entry. This is defined as the exclusive-or + * of the hashcodes of the key and value (using 0 for null). In other + * words, this must be:
          + *
          (getKey() == null ? 0 : getKey().hashCode())
          +      *       ^ (getValue() == null ? 0 : getValue().hashCode())
          + * + * @return the hash code + */ + public final int hashCode() + { + return (AbstractMap.hashCode(key) ^ AbstractMap.hashCode(value)); + } + + /** + * Replaces the value with the specified object. This writes through + * to the map, unless you have already called Iterator.remove(). It + * may be overridden to restrict a null value. + * + * @param newVal the new value to store + * @return the old value + * @throws NullPointerException if the map forbids null values + */ + public Object setValue(Object newVal) + { + Object r = value; + value = newVal; + return r; + } + + /** + * This provides a string representation of the entry. It is of the form + * "key=value", where string concatenation is used on key and value. + * + * @return the string representation + */ + public final String toString() + { + return key + "=" + value; + } + } // class BasicMapEntry } diff -Nrc3pad gcc-3.2.3/libjava/java/util/ArrayList.java gcc-3.3/libjava/java/util/ArrayList.java *** gcc-3.2.3/libjava/java/util/ArrayList.java 2002-04-07 07:42:30.000000000 +0000 --- gcc-3.3/libjava/java/util/ArrayList.java 2002-11-03 20:27:31.000000000 +0000 *************** public class ArrayList extends AbstractL *** 160,166 **** /** * Guarantees that this list will have at least enough capacity to * hold minCapacity elements. This implementation will grow the list to ! * max(current * 2, minCapacity) if (minCapacity > current). The JCL says * explictly that "this method increases its capacity to minCap", while * the JDK 1.3 online docs specify that the list will grow to at least the * size specified. --- 160,166 ---- /** * Guarantees that this list will have at least enough capacity to * hold minCapacity elements. This implementation will grow the list to ! * max(current * 2, minCapacity) if (minCapacity > current). The JCL says * explictly that "this method increases its capacity to minCap", while * the JDK 1.3 online docs specify that the list will grow to at least the * size specified. *************** public class ArrayList extends AbstractL *** 558,564 **** // We serialize unused list entries to preserve capacity. int len = data.length; s.writeInt(len); ! for (int i = 0; i < len; i++) s.writeObject(data[i]); } --- 558,566 ---- // We serialize unused list entries to preserve capacity. int len = data.length; s.writeInt(len); ! // it would be more efficient to just write "size" items, ! // this need readObject read "size" items too. ! for (int i = 0; i < size; i++) s.writeObject(data[i]); } *************** public class ArrayList extends AbstractL *** 578,584 **** s.defaultReadObject(); int capacity = s.readInt(); data = new Object[capacity]; ! for (int i = 0; i < capacity; i++) data[i] = s.readObject(); } } --- 580,586 ---- s.defaultReadObject(); int capacity = s.readInt(); data = new Object[capacity]; ! for (int i = 0; i < size; i++) data[i] = s.readObject(); } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/Arrays.java gcc-3.3/libjava/java/util/Arrays.java *** gcc-3.2.3/libjava/java/util/Arrays.java 2002-04-04 12:02:36.000000000 +0000 --- gcc-3.3/libjava/java/util/Arrays.java 2002-06-16 21:15:41.000000000 +0000 *************** public class Arrays *** 2205,2213 **** * comparable * @throws NullPointerException if an element is null (since * null.compareTo cannot work) ! * @throws ArrayIndexOutOfBoundsException, if fromIndex and toIndex * are not in range. ! * @throws IllegalArgumentException if fromIndex > toIndex */ public static void sort(Object[] a, int fromIndex, int toIndex) { --- 2205,2213 ---- * comparable * @throws NullPointerException if an element is null (since * null.compareTo cannot work) ! * @throws ArrayIndexOutOfBoundsException if fromIndex and toIndex * are not in range. ! * @throws IllegalArgumentException if fromIndex > toIndex */ public static void sort(Object[] a, int fromIndex, int toIndex) { *************** public class Arrays *** 2229,2237 **** * the elements' natural order * @throws ClassCastException if any two elements are not mutually * comparable by the Comparator provided ! * @throws ArrayIndexOutOfBoundsException, if fromIndex and toIndex * are not in range. ! * @throws IllegalArgumentException if fromIndex > toIndex * @throws NullPointerException if a null element is compared with natural * ordering (only possible when c is null) */ --- 2229,2237 ---- * the elements' natural order * @throws ClassCastException if any two elements are not mutually * comparable by the Comparator provided ! * @throws ArrayIndexOutOfBoundsException if fromIndex and toIndex * are not in range. ! * @throws IllegalArgumentException if fromIndex > toIndex * @throws NullPointerException if a null element is compared with natural * ordering (only possible when c is null) */ diff -Nrc3pad gcc-3.2.3/libjava/java/util/BasicMapEntry.java gcc-3.3/libjava/java/util/BasicMapEntry.java *** gcc-3.2.3/libjava/java/util/BasicMapEntry.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/BasicMapEntry.java 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,168 **** - /* BasicMapEntry.java -- a class providing a plain-vanilla implementation of - the Map.Entry interface; could be used anywhere in java.util - Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. - - This file is part of GNU Classpath. - - GNU Classpath is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GNU Classpath is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU Classpath; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. - - Linking this library statically or dynamically with other modules is - making a combined work based on this library. Thus, the terms and - conditions of the GNU General Public License cover the whole - combination. - - As a special exception, the copyright holders of this library give you - permission to link this library with independent modules to produce an - executable, regardless of the license terms of these independent - modules, and to copy and distribute the resulting executable under - terms of your choice, provided that you also meet, for each linked - independent module, the terms and conditions of the license of that - module. An independent module is a module which is not derived from - or based on this library. If you modify this library, you may extend - this exception to your version of the library, but you are not - obligated to do so. If you do not wish to do so, delete this - exception statement from your version. */ - - - package java.util; - - /** - * A class which implements Map.Entry. It is shared by HashMap, TreeMap, - * Hashtable, and Collections. It is not specified by the JDK, but makes - * life much easier. - * - * @author Jon Zeppieri - * @author Eric Blake - */ - class BasicMapEntry implements Map.Entry - { - /** - * The key. Package visible for direct manipulation. - */ - Object key; - - /** - * The value. Package visible for direct manipulation. - */ - Object value; - - /** - * Basic constructor initializes the fields. - * @param newKey the key - * @param newValue the value - */ - BasicMapEntry(Object newKey, Object newValue) - { - key = newKey; - value = newValue; - } - - /** - * Compares the specified object with this entry. Returns true only if - * the object is a mapping of identical key and value. In other words, - * this must be: - *
          -    * (o instanceof Map.Entry) &&
          -    * (getKey() == null ? ((HashMap) o).getKey() == null
          -    *                   : getKey().equals(((HashMap) o).getKey())) &&
          -    * (getValue() == null ? ((HashMap) o).getValue() == null
          -    *                   : getValue().equals(((HashMap) o).getValue()))
          -    * 
          - * - * @param o the object to compare - * @return true if it is equal - */ - public final boolean equals(Object o) - { - if (! (o instanceof Map.Entry)) - return false; - // Optimize for our own entries. - if (o instanceof BasicMapEntry) - { - BasicMapEntry e = (BasicMapEntry) o; - return (AbstractCollection.equals(key, e.key) - && AbstractCollection.equals(value, e.value)); - } - Map.Entry e = (Map.Entry) o; - return (AbstractCollection.equals(key, e.getKey()) - && AbstractCollection.equals(value, e.getValue())); - } - - /** - * Get the key corresponding to this entry. - * - * @return the key - */ - public final Object getKey() - { - return key; - } - - /** - * Get the value corresponding to this entry. If you already called - * Iterator.remove(), the behavior undefined, but in this case it works. - * - * @return the value - */ - public final Object getValue() - { - return value; - } - - /** - * Returns the hash code of the entry. This is defined as the exclusive-or - * of the hashcodes of the key and value (using 0 for null). In other - * words, this must be: - *
          -    *  (getKey() == null ? 0 : getKey().hashCode()) ^
          -    *  (getValue() == null ? 0 : getValue().hashCode())
          -    * 
          - * - * @return the hash code - */ - public final int hashCode() - { - return (AbstractCollection.hashCode(key) - ^ AbstractCollection.hashCode(value)); - } - - /** - * Replaces the value with the specified object. This writes through - * to the map, unless you have already called Iterator.remove(). It - * may be overridden to restrict a null value. - * - * @param newVal the new value to store - * @return the old value - * @throws NullPointerException if the map forbids null values - */ - public Object setValue(Object newVal) - { - Object r = value; - value = newVal; - return r; - } - - /** - * This provides a string representation of the entry. It is of the form - * "key=value", where string concatenation is used on key and value. - * - * @return the string representation - */ - public final String toString() - { - return key + "=" + value; - } - } --- 0 ---- diff -Nrc3pad gcc-3.2.3/libjava/java/util/BitSet.java gcc-3.3/libjava/java/util/BitSet.java *** gcc-3.2.3/libjava/java/util/BitSet.java 2002-04-01 20:00:31.000000000 +0000 --- gcc-3.3/libjava/java/util/BitSet.java 2002-06-16 21:15:42.000000000 +0000 *************** public class BitSet implements Cloneable *** 398,419 **** * bit k is set in the BitSet (for non-negative values * of k) if and only if * ! *
          !    * ((k/64) < bits.length) && ((bits[k/64] & (1L << (bit % 64))) != 0)
          !    * 
          * * Then the following definition of the hashCode method * would be a correct implementation of the actual algorithm: * ! *
          !    * public int hashCode() {
          !    *     long h = 1234;
          !    *     for (int i = bits.length-1; i>=0; i--) {
          !    *         h ^= bits[i] * (i + 1);
          !    *     }
          !    *     return (int)((h >> 32) ^ h);
          !    * }
          !    * 
          * * Note that the hash code values changes, if the set is changed. * --- 398,421 ---- * bit k is set in the BitSet (for non-negative values * of k) if and only if * ! * ((k/64) < bits.length) ! * && ((bits[k/64] & (1L << (bit % 64))) != 0) ! * * * Then the following definition of the hashCode method * would be a correct implementation of the actual algorithm: * ! * !
          public int hashCode()
          ! {
          !   long h = 1234;
          !   for (int i = bits.length-1; i >= 0; i--)
          !   {
          !     h ^= bits[i] * (i + 1);
          !   }
          ! 
          !   return (int)((h >> 32) ^ h);
          ! }
          * * Note that the hash code values changes, if the set is changed. * *************** public class BitSet implements Cloneable *** 526,535 **** * Returns the index of the next true bit, from the specified bit * (inclusive). If there is none, -1 is returned. You can iterate over * all true bits with this loop:
          ! *
          !    * for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1))
          !    *   { // operate on i here }
          !    * 
          * * @param from the start location * @return the first true bit, or -1 --- 528,538 ---- * Returns the index of the next true bit, from the specified bit * (inclusive). If there is none, -1 is returned. You can iterate over * all true bits with this loop:
          ! * !
          for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1))
          ! {
          !   // operate on i here
          ! }
          * * @param from the start location * @return the first true bit, or -1 diff -Nrc3pad gcc-3.2.3/libjava/java/util/Calendar.java gcc-3.3/libjava/java/util/Calendar.java *** gcc-3.2.3/libjava/java/util/Calendar.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/Calendar.java 2002-08-31 05:27:15.000000000 +0000 *************** *** 1,5 **** /* java.util.Calendar ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* java.util.Calendar ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.*; *** 73,85 **** * and for the first line all fields are set, that line is used to * compute the day.
          * ! *
          !  * month + day_of_month
          !  * month + week_of_month + day_of_week
          !  * month + day_of_week_of_month + day_of_week
          !  * day_of_year
          !  * day_of_week + week_of_year
          !  * 
          * * The hour_of_day-field takes precedence over the ampm and * hour_of_ampm fields.
          --- 73,84 ---- * and for the first line all fields are set, that line is used to * compute the day.
          * ! * !
          month + day_of_month
          ! month + week_of_month + day_of_week
          ! month + day_of_week_of_month + day_of_week
          ! day_of_year
          ! day_of_week + week_of_year
          * * The hour_of_day-field takes precedence over the ampm and * hour_of_ampm fields.
          *************** public abstract class Calendar implement *** 505,512 **** /** * Returns the time represented by this Calendar. * @return the time in milliseconds since the epoch. */ ! protected long getTimeInMillis() { if (!isTimeSet) computeTime(); --- 504,512 ---- /** * Returns the time represented by this Calendar. * @return the time in milliseconds since the epoch. + * @specnote This was made public in 1.4. */ ! public long getTimeInMillis() { if (!isTimeSet) computeTime(); *************** public abstract class Calendar implement *** 517,524 **** * Sets this Calendar's time to the given Time. All time fields * are invalidated by this method. * @param time the time in milliseconds since the epoch */ ! protected void setTimeInMillis(long time) { this.time = time; isTimeSet = true; --- 517,525 ---- * Sets this Calendar's time to the given Time. All time fields * are invalidated by this method. * @param time the time in milliseconds since the epoch + * @specnote This was made public in 1.4. */ ! public void setTimeInMillis(long time) { this.time = time; isTimeSet = true; diff -Nrc3pad gcc-3.2.3/libjava/java/util/Collections.java gcc-3.3/libjava/java/util/Collections.java *** gcc-3.2.3/libjava/java/util/Collections.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/Collections.java 2002-06-18 15:39:49.000000000 +0000 *************** *** 1,5 **** /* Collections.java -- Utility class with methods to operate on collections ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Collections.java -- Utility class with methods to operate on collections ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.Serializable; *** 60,66 **** * modify the set. * * @author Original author unknown - * @author Bryce McKinlay * @author Eric Blake * @see Collection * @see Set --- 60,65 ---- *************** public class Collections *** 108,131 **** */ public static final Set EMPTY_SET = new EmptySet(); - private static final Iterator EMPTY_ITERATOR = new Iterator() - { - public boolean hasNext() - { - return false; - } - - public Object next() - { - throw new NoSuchElementException(); - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - /** * The implementation of {@link #EMPTY_SET}. This class name is required * for compatibility with Sun's JDK serializability. --- 107,112 ---- *************** public class Collections *** 158,166 **** /** * Returns an iterator that does not iterate. */ public Iterator iterator() { ! return EMPTY_ITERATOR; } } // class EmptySet --- 139,232 ---- /** * Returns an iterator that does not iterate. */ + // This is really cheating! I think it's perfectly valid, though. public Iterator iterator() { ! return EMPTY_LIST.iterator(); ! } ! ! // The remaining methods are optional, but provide a performance ! // advantage by not allocating unnecessary iterators in AbstractSet. ! /** ! * The empty set never contains anything. ! */ ! public boolean contains(Object o) ! { ! return false; ! } ! ! /** ! * This is true only if the given collection is also empty. ! */ ! public boolean containsAll(Collection c) ! { ! return c.isEmpty(); ! } ! ! /** ! * Equal only if the other set is empty. ! */ ! public boolean equals(Object o) ! { ! return o instanceof Set && ((Set) o).isEmpty(); ! } ! ! /** ! * The hashcode is always 0. ! */ ! public int hashCode() ! { ! return 0; ! } ! ! /** ! * Always succeeds with false result. ! */ ! public boolean remove(Object o) ! { ! return false; ! } ! ! /** ! * Always succeeds with false result. ! */ ! public boolean removeAll(Collection c) ! { ! return false; ! } ! ! /** ! * Always succeeds with false result. ! */ ! public boolean retainAll(Collection c) ! { ! return false; ! } ! ! /** ! * The array is always empty. ! */ ! public Object[] toArray() ! { ! return new Object[0]; ! } ! ! /** ! * We don't even need to use reflection! ! */ ! public Object[] toArray(Object[] a) ! { ! if (a.length > 0) ! a[0] = null; ! return a; ! } ! ! /** ! * The string never changes. ! */ ! public String toString() ! { ! return "[]"; } } // class EmptySet *************** public class Collections *** 207,221 **** { throw new IndexOutOfBoundsException(); } ! /** ! * Returns an iterator that does not iterate. Optional, but avoids ! * allocation of an iterator in AbstractList. */ ! public Iterator iterator() { ! return EMPTY_ITERATOR; ! } } // class EmptyList /** --- 273,378 ---- { throw new IndexOutOfBoundsException(); } ! ! // The remaining methods are optional, but provide a performance ! // advantage by not allocating unnecessary iterators in AbstractList. /** ! * Never contains anything. */ ! public boolean contains(Object o) { ! return false; ! } ! ! /** ! * This is true only if the given collection is also empty. ! */ ! public boolean containsAll(Collection c) ! { ! return c.isEmpty(); ! } ! ! /** ! * Equal only if the other set is empty. ! */ ! public boolean equals(Object o) ! { ! return o instanceof List && ((List) o).isEmpty(); ! } ! ! /** ! * The hashcode is always 1. ! */ ! public int hashCode() ! { ! return 1; ! } ! ! /** ! * Returns -1. ! */ ! public int indexOf(Object o) ! { ! return -1; ! } ! ! /** ! * Returns -1. ! */ ! public int lastIndexOf(Object o) ! { ! return -1; ! } ! ! /** ! * Always succeeds with false result. ! */ ! public boolean remove(Object o) ! { ! return false; ! } ! ! /** ! * Always succeeds with false result. ! */ ! public boolean removeAll(Collection c) ! { ! return false; ! } ! ! /** ! * Always succeeds with false result. ! */ ! public boolean retainAll(Collection c) ! { ! return false; ! } ! ! /** ! * The array is always empty. ! */ ! public Object[] toArray() ! { ! return new Object[0]; ! } ! ! /** ! * We don't even need to use reflection! ! */ ! public Object[] toArray(Object[] a) ! { ! if (a.length > 0) ! a[0] = null; ! return a; ! } ! ! /** ! * The string never changes. ! */ ! public String toString() ! { ! return "[]"; ! } } // class EmptyList /** *************** public class Collections *** 253,258 **** --- 410,473 ---- return EMPTY_SET; } + // The remaining methods are optional, but provide a performance + // advantage by not allocating unnecessary iterators in AbstractMap. + /** + * No entries! + */ + public boolean containsKey(Object key) + { + return false; + } + + /** + * No entries! + */ + public boolean containsValue(Object value) + { + return false; + } + + /** + * Equal to all empty maps. + */ + public boolean equals(Object o) + { + return o instanceof Map && ((Map) o).isEmpty(); + } + + /** + * No mappings, so this returns null. + */ + public Object get(Object o) + { + return null; + } + + /** + * The hashcode is always 0. + */ + public int hashCode() + { + return 0; + } + + /** + * No entries. + */ + public Set keySet() + { + return EMPTY_SET; + } + + /** + * Remove always succeeds, with null result. + */ + public Object remove(Object o) + { + return null; + } + /** * Size is always 0. */ *************** public class Collections *** 269,276 **** --- 484,500 ---- { return EMPTY_SET; } + + /** + * The string never changes. + */ + public String toString() + { + return "[]"; + } } // class EmptyMap + /** * Compare two objects with or without a Comparator. If c is null, uses the * natural ordering. Slightly slower than doing it inline if the JVM isn't *************** public class Collections *** 502,508 **** } /** ! * Returns an array list holding the elements visited by a given * Enumeration. This method exists for interoperability between legacy * APIs and the new Collection API. * --- 726,732 ---- } /** ! * Returns an ArrayList holding the elements visited by a given * Enumeration. This method exists for interoperability between legacy * APIs and the new Collection API. * *************** public class Collections *** 511,519 **** * @see ArrayList * @since 1.4 */ ! public static List list(Enumeration e) { ! List l = new ArrayList(); while (e.hasMoreElements()) l.add(e.nextElement()); return l; --- 735,743 ---- * @see ArrayList * @since 1.4 */ ! public static ArrayList list(Enumeration e) { ! ArrayList l = new ArrayList(); while (e.hasMoreElements()) l.add(e.nextElement()); return l; *************** public class Collections *** 1353,1359 **** public Set entrySet() { if (entries == null) ! entries = singleton(new BasicMapEntry(k, v) { public Object setValue(Object o) { --- 1577,1583 ---- public Set entrySet() { if (entries == null) ! entries = singleton(new AbstractMap.BasicMapEntry(k, v) { public Object setValue(Object o) { *************** public class Collections *** 1500,1505 **** --- 1724,1730 ---- l.set(i, l.set(j, l.get(i))); } + /** * Returns a synchronized (thread-safe) collection wrapper backed by the * given collection. Notice that element access through the iterators *************** public class Collections *** 2682,2687 **** --- 2907,2913 ---- } } // class SynchronizedSortedSet + /** * Returns an unmodifiable view of the given collection. This allows * "read-only" access, although changes in the backing collection show up diff -Nrc3pad gcc-3.2.3/libjava/java/util/Dictionary.java gcc-3.3/libjava/java/util/Dictionary.java *** gcc-3.2.3/libjava/java/util/Dictionary.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/Dictionary.java 2002-06-16 21:15:42.000000000 +0000 *************** *** 1,6 **** /* Dictionary.java -- an abstract (and essentially worthless) class which is Hashtable's superclass ! Copyright (C) 1998, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* Dictionary.java -- an abstract (and essentially worthless) class which is Hashtable's superclass ! Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.util; *** 47,64 **** * People at Javasoft are probably embarrassed by it. At this point, * it might as well be an interface rather than a class, but it remains * this poor, laughable skeleton for the sake of backwards compatibility. ! * At any rate, this was what came before the
          Map
          interface * in the Collections framework. * * @author Jon Zeppieri ! * @author Eric Blake * @see Map * @see Hashtable * @since 1.0 * @status updated to 1.4 */ ! public abstract class Dictionary extends Object { /** * Sole constructor (often called implicitly). */ --- 47,67 ---- * People at Javasoft are probably embarrassed by it. At this point, * it might as well be an interface rather than a class, but it remains * this poor, laughable skeleton for the sake of backwards compatibility. ! * At any rate, this was what came before the {@link Map} interface * in the Collections framework. * * @author Jon Zeppieri ! * @author Eric Blake (ebb9@email.byu.edu) * @see Map * @see Hashtable * @since 1.0 * @status updated to 1.4 */ ! public abstract class Dictionary { + // WARNING: Dictionary is a CORE class in the bootstrap cycle. See the + // comments in vm/reference/java/lang/Runtime for implications of this fact. + /** * Sole constructor (often called implicitly). */ *************** public abstract class Dictionary extends *** 130,133 **** * @return the number of keys in the Dictionary */ public abstract int size(); ! } --- 133,136 ---- * @return the number of keys in the Dictionary */ public abstract int size(); ! } // class Dictionary diff -Nrc3pad gcc-3.2.3/libjava/java/util/EventListener.java gcc-3.3/libjava/java/util/EventListener.java *** gcc-3.2.3/libjava/java/util/EventListener.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/EventListener.java 2002-06-17 21:31:57.000000000 +0000 *************** *** 1,5 **** ! /* An interface that all event listener interfaces must extend ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* EventListener.java -- tagging interface for all event listeners ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,48 **** package java.util; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * Status: Believed complete and correct. - */ - /** * Empty interface that is implemented by classes that need to receive * events. Subinterfaces define methods that can be called to fire an --- 38,43 ---- *************** package java.util; *** 51,57 **** * take as argument an subclass of EventObject. * * @author Tom Tromey ! * @date December 12, 1998 */ public interface EventListener { --- 46,53 ---- * take as argument an subclass of EventObject. * * @author Tom Tromey ! * @see EventObject ! * @status updated to 1.4 */ public interface EventListener { diff -Nrc3pad gcc-3.2.3/libjava/java/util/EventListenerProxy.java gcc-3.3/libjava/java/util/EventListenerProxy.java *** gcc-3.2.3/libjava/java/util/EventListenerProxy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/util/EventListenerProxy.java 2002-06-17 21:31:58.000000000 +0000 *************** *** 0 **** --- 1,75 ---- + /* EventListenerProxy.java -- abstract wrapper for event listeners + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.util; + + /** + * An abstract wrapper for event listeners. This allows subclasses to + * attach additional parameters to an existing event listener to create + * a new one. Subclasses are expected to add methods to set and retrieve + * any attached properties. + * + * @author Eric Blake + * @since 1.4 + * @status updated to 1.4 + */ + public abstract class EventListenerProxy implements EventListener + { + /** The listener that this proxy wraps. */ + private final EventListener listener; + + /** + * Construct a proxy event listener, given an existing one to augment. + * + * @param listener the listener to wrap + */ + public EventListenerProxy(EventListener listener) + { + this.listener = listener; + } + + /** + * Return the wrapped event listener. + * + * @return the listener associated with this proxy + */ + public EventListener getListener() + { + return listener; + } + } // class EventListenerProxy diff -Nrc3pad gcc-3.2.3/libjava/java/util/EventObject.java gcc-3.3/libjava/java/util/EventObject.java *** gcc-3.2.3/libjava/java/util/EventObject.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/EventObject.java 2002-06-17 21:31:58.000000000 +0000 *************** *** 1,5 **** ! /* EventObject.java - Represent events fired by objects. ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* EventObject.java -- represents an event on an object ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.Serializable; *** 43,65 **** /** * Represents Events fired by Objects. * * @see EventListener */ public class EventObject implements Serializable { private static final long serialVersionUID = 5516075349620653480L; protected transient Object source; /** * Constructs an EventObject with the specified source. */ public EventObject(Object source) { this.source = source; } /** ! * @return The source of the Event. */ public Object getSource() { --- 43,86 ---- /** * Represents Events fired by Objects. * + * @author Eric Blake * @see EventListener + * @since 1.1 + * @status updated to 1.4 */ public class EventObject implements Serializable { + /** + * Compatible with JDK 1.1+. + */ private static final long serialVersionUID = 5516075349620653480L; + + /** + * The source object; in other words, the object which this event takes + * place on. + */ protected transient Object source; /** * Constructs an EventObject with the specified source. + * + * @param source the source of the event + * @throws IllegalArgumentException if source is null (This is not + * specified, but matches the behavior of the JDK) */ public EventObject(Object source) { + // This check for null is stupid, if you ask me, since source is + // protected and non-final, so a subclass can set it to null later on. + if (source == null) + throw new IllegalArgumentException(); this.source = source; } /** ! * Returns the source of the event. ! * ! * @return the event source */ public Object getSource() { *************** public class EventObject implements Seri *** 67,77 **** } /** ! * @return String representation of the Event. ! * @override toString in class Object */ public String toString() { ! return this.getClass() + "[source=" + source.toString() + "]"; } ! } --- 88,101 ---- } /** ! * Converts the event to a String. The format is not specified, but by ! * observation, the JDK uses: ! * getClass().getName() + "[source=" + source + "]";. ! * ! * @return String representation of the Event */ public String toString() { ! return getClass().getName() + "[source=" + source + "]"; } ! } // class EventObject diff -Nrc3pad gcc-3.2.3/libjava/java/util/HashMap.java gcc-3.3/libjava/java/util/HashMap.java *** gcc-3.2.3/libjava/java/util/HashMap.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/HashMap.java 2002-11-10 22:06:49.000000000 +0000 *************** *** 1,6 **** /* HashMap.java -- a class providing a basic hashtable data structure, mapping Object --> Object ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* HashMap.java -- a class providing a basic hashtable data structure, mapping Object --> Object ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class HashMap extends AbstractMap *** 162,168 **** * * @author Eric Blake */ ! static class HashEntry extends BasicMapEntry { /** * The next entry in the linked list. Package visible for use by subclass. --- 162,168 ---- * * @author Eric Blake */ ! static class HashEntry extends AbstractMap.BasicMapEntry { /** * The next entry in the linked list. Package visible for use by subclass. *************** public class HashMap extends AbstractMap *** 180,185 **** --- 180,194 ---- } /** + * Called when this entry is accessed via {@link #put(Object, Object)}. + * This version does nothing, but in LinkedHashMap, it must do some + * bookkeeping for access-traversal mode. + */ + void access() + { + } + + /** * Called when this entry is removed from the map. This version simply * returns the value, but in LinkedHashMap, it must also do bookkeeping. * *************** public class HashMap extends AbstractMap *** 338,345 **** while (e != null) { if (equals(key, e.key)) ! // Must use this method for necessary bookkeeping in LinkedHashMap. ! return e.setValue(value); else e = e.next; } --- 347,358 ---- while (e != null) { if (equals(key, e.key)) ! { ! e.access(); // Must call this for bookkeeping in LinkedHashMap. ! Object r = e.value; ! e.value = value; ! return r; ! } else e = e.next; } *************** public class HashMap extends AbstractMap *** 368,387 **** public void putAll(Map m) { Iterator itr = m.entrySet().iterator(); ! ! for (int msize = m.size(); msize > 0; msize--) { Map.Entry e = (Map.Entry) itr.next(); // Optimize in case the Entry is one of our own. ! if (e instanceof BasicMapEntry) { ! BasicMapEntry entry = (BasicMapEntry) e; put(entry.key, entry.value); } else ! { ! put(e.getKey(), e.getValue()); ! } } } --- 381,398 ---- public void putAll(Map m) { Iterator itr = m.entrySet().iterator(); ! int msize = m.size(); ! while (msize-- > 0) { Map.Entry e = (Map.Entry) itr.next(); // Optimize in case the Entry is one of our own. ! if (e instanceof AbstractMap.BasicMapEntry) { ! AbstractMap.BasicMapEntry entry = (AbstractMap.BasicMapEntry) e; put(entry.key, entry.value); } else ! put(e.getKey(), e.getValue()); } } *************** public class HashMap extends AbstractMap *** 520,526 **** public boolean remove(Object o) { // Test against the size of the HashMap to determine if anything ! // really got removed. This is neccessary because the return value // of HashMap.remove() is ambiguous in the null case. int oldsize = size; HashMap.this.remove(o); --- 531,537 ---- public boolean remove(Object o) { // Test against the size of the HashMap to determine if anything ! // really got removed. This is necessary because the return value // of HashMap.remove() is ambiguous in the null case. int oldsize = size; HashMap.this.remove(o); *************** public class HashMap extends AbstractMap *** 634,640 **** void addEntry(Object key, Object value, int idx, boolean callRemove) { HashEntry e = new HashEntry(key, value); - e.next = buckets[idx]; buckets[idx] = e; } --- 645,650 ---- *************** public class HashMap extends AbstractMap *** 647,663 **** * @return the matching entry, if found, or null * @see #entrySet() */ ! private HashEntry getEntry(Object o) { ! if (!(o instanceof Map.Entry)) return null; Map.Entry me = (Map.Entry) o; ! int idx = hash(me.getKey()); HashEntry e = buckets[idx]; while (e != null) { ! if (e.equals(me)) ! return e; e = e.next; } return null; --- 657,675 ---- * @return the matching entry, if found, or null * @see #entrySet() */ ! // Package visible, for use in nested classes. ! final HashEntry getEntry(Object o) { ! if (! (o instanceof Map.Entry)) return null; Map.Entry me = (Map.Entry) o; ! Object key = me.getKey(); ! int idx = hash(key); HashEntry e = buckets[idx]; while (e != null) { ! if (equals(e.key, key)) ! return equals(e.value, me.getValue()) ? e : null; e = e.next; } return null; *************** public class HashMap extends AbstractMap *** 698,706 **** { Iterator itr = m.entrySet().iterator(); int msize = m.size(); ! this.size = msize; ! ! for (; msize > 0; msize--) { Map.Entry e = (Map.Entry) itr.next(); Object key = e.getKey(); --- 710,717 ---- { Iterator itr = m.entrySet().iterator(); int msize = m.size(); ! size = msize; ! while (msize-- > 0) { Map.Entry e = (Map.Entry) itr.next(); Object key = e.getKey(); *************** public class HashMap extends AbstractMap *** 710,723 **** } /** ! * Increases the size of the HashMap and rehashes all keys to new array ! * indices; this is called when the addition of a new value would cause ! * size() > threshold. Note that the existing Entry objects are reused in ! * the new hash table. ! *

          * ! * This is not specified, but the new size is twice the current size plus ! * one; this number is not always prime, unfortunately. */ private void rehash() { --- 721,733 ---- } /** ! * Increases the size of the HashMap and rehashes all keys to new ! * array indices; this is called when the addition of a new value ! * would cause size() > threshold. Note that the existing Entry ! * objects are reused in the new hash table. * ! *

          This is not specified, but the new size is twice the current size ! * plus one; this number is not always prime, unfortunately. */ private void rehash() { *************** public class HashMap extends AbstractMap *** 742,750 **** dest.next = e; } else ! { ! buckets[idx] = e; ! } HashEntry next = e.next; e.next = null; --- 752,758 ---- dest.next = e; } else ! buckets[idx] = e; HashEntry next = e.next; e.next = null; *************** public class HashMap extends AbstractMap *** 797,809 **** // Read the threshold and loadFactor fields. s.defaultReadObject(); ! // Read and use capacity. buckets = new HashEntry[s.readInt()]; int len = s.readInt(); ! ! // Read and use key/value pairs. ! for ( ; len > 0; len--) ! put(s.readObject(), s.readObject()); } /** --- 805,818 ---- // Read the threshold and loadFactor fields. s.defaultReadObject(); ! // Read and use capacity, followed by key/value pairs. buckets = new HashEntry[s.readInt()]; int len = s.readInt(); ! while (len-- > 0) ! { ! Object key = s.readObject(); ! addEntry(key, s.readObject(), hash(key), false); ! } } /** diff -Nrc3pad gcc-3.2.3/libjava/java/util/Hashtable.java gcc-3.3/libjava/java/util/Hashtable.java *** gcc-3.2.3/libjava/java/util/Hashtable.java 2002-04-07 12:15:36.000000000 +0000 --- gcc-3.3/libjava/java/util/Hashtable.java 2002-06-18 15:39:52.000000000 +0000 *************** *** 1,6 **** /* Hashtable.java -- a class providing a basic hashtable data structure, mapping Object --> Object ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* Hashtable.java -- a class providing a basic hashtable data structure, mapping Object --> Object ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.io.ObjectOutputStream; *** 102,107 **** --- 102,110 ---- public class Hashtable extends Dictionary implements Map, Cloneable, Serializable { + // WARNING: Hashtable is a CORE class in the bootstrap cycle. See the + // comments in vm/reference/java/lang/Runtime for implications of this fact. + /** Default number of buckets. This is the value the JDK 1.3 uses. Some * early documentation specified this value as 101. That is incorrect. */ *************** public class Hashtable extends Dictionar *** 176,182 **** * pair. A Hashtable Entry is identical to a HashMap Entry, except that * `null' is not allowed for keys and values. */ ! private static final class HashEntry extends BasicMapEntry { /** The next entry in the linked list. */ HashEntry next; --- 179,185 ---- * pair. A Hashtable Entry is identical to a HashMap Entry, except that * `null' is not allowed for keys and values. */ ! private static final class HashEntry extends AbstractMap.BasicMapEntry { /** The next entry in the linked list. */ HashEntry next; *************** public class Hashtable extends Dictionar *** 340,348 **** * * @param value the value to search for in this Hashtable * @return true if at least one key maps to the value - * @throws NullPointerException if value is null * @see #contains(Object) * @see #containsKey(Object) * @since 1.2 */ public boolean containsValue(Object value) --- 343,351 ---- * * @param value the value to search for in this Hashtable * @return true if at least one key maps to the value * @see #contains(Object) * @see #containsKey(Object) + * @throws NullPointerException if value is null * @since 1.2 */ public boolean containsValue(Object value) *************** public class Hashtable extends Dictionar *** 361,367 **** // Must throw on null argument even if the table is empty if (value == null) throw new NullPointerException(); ! return false; } --- 364,370 ---- // Must throw on null argument even if the table is empty if (value == null) throw new NullPointerException(); ! return false; } *************** public class Hashtable extends Dictionar *** 511,519 **** { Map.Entry e = (Map.Entry) itr.next(); // Optimize in case the Entry is one of our own. ! if (e instanceof BasicMapEntry) { ! BasicMapEntry entry = (BasicMapEntry) e; put(entry.key, entry.value); } else --- 514,522 ---- { Map.Entry e = (Map.Entry) itr.next(); // Optimize in case the Entry is one of our own. ! if (e instanceof AbstractMap.BasicMapEntry) { ! AbstractMap.BasicMapEntry entry = (AbstractMap.BasicMapEntry) e; put(entry.key, entry.value); } else *************** public class Hashtable extends Dictionar *** 763,771 **** /** * Returns true if this Hashtable equals the supplied Object o. * As specified by Map, this is: ! *

               * (o instanceof Map) && entrySet().equals(((Map) o).entrySet());
          !    * 
          * * @param o the object to compare to * @return true if o is an equal map --- 766,774 ---- /** * Returns true if this Hashtable equals the supplied Object o. * As specified by Map, this is: ! * * (o instanceof Map) && entrySet().equals(((Map) o).entrySet()); ! * * * @param o the object to compare to * @return true if o is an equal map *************** public class Hashtable extends Dictionar *** 812,818 **** */ private int hash(Object key) { ! return Math.abs(key.hashCode() % buckets.length); } /** --- 815,824 ---- */ private int hash(Object key) { ! // Note: Inline Math.abs here, for less method overhead, and to avoid ! // a bootstrap dependency, since Math relies on native methods. ! int hash = key.hashCode() % buckets.length; ! return hash < 0 ? -hash : hash; } /** *************** public class Hashtable extends Dictionar *** 823,829 **** * @return the matching entry, if found, or null * @see #entrySet() */ ! private HashEntry getEntry(Object o) { if (! (o instanceof Map.Entry)) return null; --- 829,836 ---- * @return the matching entry, if found, or null * @see #entrySet() */ ! // Package visible, for use in nested classes. ! HashEntry getEntry(Object o) { if (! (o instanceof Map.Entry)) return null; *************** public class Hashtable extends Dictionar *** 869,875 **** /** * Increases the size of the Hashtable and rehashes all keys to new array * indices; this is called when the addition of a new value would cause ! * size() > threshold. Note that the existing Entry objects are reused in * the new hash table. *

          * --- 876,882 ---- /** * Increases the size of the Hashtable and rehashes all keys to new array * indices; this is called when the addition of a new value would cause ! * size() > threshold. Note that the existing Entry objects are reused in * the new hash table. *

          * *************** public class Hashtable extends Dictionar *** 1139,1142 **** return type == VALUES ? e.value : e.key; } } // class Enumerator ! } --- 1146,1149 ---- return type == VALUES ? e.value : e.key; } } // class Enumerator ! } // class Hashtable diff -Nrc3pad gcc-3.2.3/libjava/java/util/IdentityHashMap.java gcc-3.3/libjava/java/util/IdentityHashMap.java *** gcc-3.2.3/libjava/java/util/IdentityHashMap.java 2002-04-02 13:56:44.000000000 +0000 --- gcc-3.3/libjava/java/util/IdentityHashMap.java 2002-06-16 21:15:42.000000000 +0000 *************** public class IdentityHashMap extends Abs *** 162,170 **** // Need at least two slots, or hash() will break. if (max < 2) max = 2; ! table = new Object[2 * max]; Arrays.fill(table, emptyslot); ! threshold = max / 4 * 3; } /** --- 162,170 ---- // Need at least two slots, or hash() will break. if (max < 2) max = 2; ! table = new Object[max << 1]; Arrays.fill(table, emptyslot); ! threshold = (max >> 2) * 3; } /** *************** public class IdentityHashMap extends Abs *** 176,182 **** */ public IdentityHashMap(Map m) { ! this(Math.max(m.size() * 2, DEFAULT_CAPACITY)); putAll(m); } --- 176,182 ---- */ public IdentityHashMap(Map m) { ! this(Math.max(m.size() << 1, DEFAULT_CAPACITY)); putAll(m); } *************** public class IdentityHashMap extends Abs *** 341,352 **** } /** ! * Return the value in this Map associated with the supplied key, ! * or

          null
          if the key maps to nothing. NOTE: Since the value ! * could also be null, you must use containsKey to see if this key ! * actually maps to something. Unlike normal maps, this tests for the key ! * with entry == key instead of ! * entry == null ? key == null : entry.equals(key). * * @param key the key for which to fetch an associated value * @return what the key maps to, if present --- 341,354 ---- } /** ! * Return the value in this Map associated with the supplied key, or ! * null if the key maps to nothing. ! * ! *

          NOTE: Since the value could also be null, you must use ! * containsKey to see if this key actually maps to something. ! * Unlike normal maps, this tests for the key with entry == ! * key instead of entry == null ? key == null : ! * entry.equals(key). * * @param key the key for which to fetch an associated value * @return what the key maps to, if present *************** public class IdentityHashMap extends Abs *** 487,496 **** Object[] old = table; // This isn't necessarily prime, but it is an odd number of key/value // slots, which has a higher probability of fewer collisions. ! table = new Object[old.length * 2 + 2]; Arrays.fill(table, emptyslot); size = 0; ! threshold = (table.length / 2) / 4 * 3; for (int i = old.length - 2; i >= 0; i -= 2) { --- 489,498 ---- Object[] old = table; // This isn't necessarily prime, but it is an odd number of key/value // slots, which has a higher probability of fewer collisions. ! table = new Object[old.length << 1 + 2]; Arrays.fill(table, emptyslot); size = 0; ! threshold = (table.length >>> 3) * 3; for (int i = old.length - 2; i >= 0; i -= 2) { *************** public class IdentityHashMap extends Abs *** 531,543 **** } /** ! * Removes from the HashMap and returns the value which is mapped by the ! * supplied key. If the key maps to nothing, then the HashMap remains ! * unchanged, and

          null
          is returned. NOTE: Since the value ! * could also be null, you must use containsKey to see if you are ! * actually removing a mapping. Unlike normal maps, this tests for the ! * key with entry == key instead of ! * entry == null ? key == null : entry.equals(key). * * @param key the key used to locate the value to remove * @return whatever the key mapped to, if present --- 533,547 ---- } /** ! * Removes from the HashMap and returns the value which is mapped by ! * the supplied key. If the key maps to nothing, then the HashMap ! * remains unchanged, and null is returned. ! * ! * NOTE: Since the value could also be null, you must use ! * containsKey to see if you are actually removing a mapping. ! * Unlike normal maps, this tests for the key with entry == ! * key instead of entry == null ? key == null : ! * entry.equals(key). * * @param key the key used to locate the value to remove * @return whatever the key mapped to, if present *************** public class IdentityHashMap extends Abs *** 642,648 **** // By requiring at least 2 key/value slots, and rehashing at 75% // capacity, we guarantee that there will always be either an emptyslot // or a tombstone somewhere in the table. ! int h = 2 * Math.abs(System.identityHashCode(key) % (table.length / 2)); int del = -1; int save = h; --- 646,652 ---- // By requiring at least 2 key/value slots, and rehashing at 75% // capacity, we guarantee that there will always be either an emptyslot // or a tombstone somewhere in the table. ! int h = Math.abs(System.identityHashCode(key) % (table.length >> 1)) << 1; int del = -1; int save = h; *************** public class IdentityHashMap extends Abs *** 735,741 **** /** * Removes from the backing Map the last element which was fetched ! * with the
          next()
          method. * @throws ConcurrentModificationException if the Map was modified * @throws IllegalStateException if called when there is no last element */ --- 739,746 ---- /** * Removes from the backing Map the last element which was fetched ! * with the next() method. ! * * @throws ConcurrentModificationException if the Map was modified * @throws IllegalStateException if called when there is no last element */ *************** public class IdentityHashMap extends Abs *** 894,900 **** s.defaultReadObject(); int num = s.readInt(); ! table = new Object[2 * Math.max(num * 2, DEFAULT_CAPACITY)]; // Read key/value pairs. while (--num >= 0) put(s.readObject(), s.readObject()); --- 899,905 ---- s.defaultReadObject(); int num = s.readInt(); ! table = new Object[Math.max(num << 1, DEFAULT_CAPACITY) << 1]; // Read key/value pairs. while (--num >= 0) put(s.readObject(), s.readObject()); diff -Nrc3pad gcc-3.2.3/libjava/java/util/jar/Attributes.java gcc-3.3/libjava/java/util/jar/Attributes.java *** gcc-3.2.3/libjava/java/util/jar/Attributes.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/jar/Attributes.java 2002-11-10 21:13:44.000000000 +0000 *************** *** 1,5 **** /* Attributes.java -- Represents attribute name/value pairs from a Manifest ! Copyright (C) 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* Attributes.java -- Represents attribute name/value pairs from a Manifest ! Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class Attributes implements Clone *** 285,290 **** --- 285,291 ---- // all other characters must be alphanums, '-' or '_' for (int i = 1; i < chars.length; i++) { + c = chars[i]; if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c == '-') || (c == '_'))) *************** public class Attributes implements Clone *** 430,436 **** * @returns the old value of the attribute name or null if it didn't exist * yet */ ! private String putValue(Name name, String value) { return (String) put(name, value); } --- 431,437 ---- * @returns the old value of the attribute name or null if it didn't exist * yet */ ! String putValue(Name name, String value) { return (String) put(name, value); } diff -Nrc3pad gcc-3.2.3/libjava/java/util/jar/JarException.java gcc-3.3/libjava/java/util/jar/JarException.java *** gcc-3.2.3/libjava/java/util/jar/JarException.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/jar/JarException.java 2002-06-18 15:40:15.000000000 +0000 *************** *** 1,5 **** ! /* Attributes.java -- exception thrown to indicate an problem with a jar file ! Copyright (C) 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* JarException.java -- thrown to indicate an problem with a jar file ! Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** import java.util.zip.ZipException; *** 41,75 **** /** * This exception is thrown to indicate an problem with a jar file. - * It can be constructed with or without a descriptive message of the problem. - *

          * Note that none of the methods in the java.util.jar package actually declare * to throw this exception, most just declare that they throw an IOException * which is super class of JarException. ! * ! * @since 1.2 * @author Mark Wielaard (mark@klomp.org) */ - public class JarException extends ZipException { ! // Constructors /** * Create a new JarException without a descriptive error message. */ public JarException() { - super(); } /** * Create a new JarException with a descriptive error message indicating * what went wrong. This message can later be retrieved by calling the * getMessage() method. - * @see java.lang.Throwable@getMessage() * * @param message The descriptive error message */ public JarException(String message) { --- 41,74 ---- /** * This exception is thrown to indicate an problem with a jar file. * Note that none of the methods in the java.util.jar package actually declare * to throw this exception, most just declare that they throw an IOException * which is super class of JarException. ! * * @author Mark Wielaard (mark@klomp.org) + * @since 1.2 */ public class JarException extends ZipException { ! /** ! * Compatible with JDK 1.2+. ! */ ! private static final long serialVersionUID = 7159778400963954473L; /** * Create a new JarException without a descriptive error message. */ public JarException() { } /** * Create a new JarException with a descriptive error message indicating * what went wrong. This message can later be retrieved by calling the * getMessage() method. * * @param message The descriptive error message + * @see #getMessage() */ public JarException(String message) { diff -Nrc3pad gcc-3.2.3/libjava/java/util/jar/JarFile.java gcc-3.3/libjava/java/util/jar/JarFile.java *** gcc-3.2.3/libjava/java/util/jar/JarFile.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/jar/JarFile.java 2003-02-07 21:33:44.000000000 +0000 *************** *** 1,5 **** /* JarFile.java - Representation of a jar file ! Copyright (C) 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* JarFile.java - Representation of a jar file ! Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class JarFile extends ZipFile *** 67,84 **** /** * The manifest of this file, if any, otherwise null. ! * Read by the constructor. */ ! private final Manifest manifest; ! /** Wether to verify the manifest and all entries */ private boolean verify; // Constructors /** ! * Creates a new JarFile, tries to read the manifest and if the manifest ! * exists verifies it. * * @param fileName the name of the file to open * @exception FileNotFoundException if the fileName cannot be found --- 67,88 ---- /** * The manifest of this file, if any, otherwise null. ! * Read when first needed. */ ! private Manifest manifest; ! /** Whether to verify the manifest and all entries. */ private boolean verify; + /** Whether the has already been loaded. */ + private boolean manifestRead = false; + // Constructors /** ! * Creates a new JarFile. All jar entries are verified (when a Manifest file ! * for this JarFile exists). You need to actually open and read the complete ! * jar entry (with getInputStream()) to check its signature. * * @param fileName the name of the file to open * @exception FileNotFoundException if the fileName cannot be found *************** public class JarFile extends ZipFile *** 90,97 **** } /** ! * Creates a new JarFile, tries to read the manifest and if the manifest ! * exists and verify is true verfies it. * * @param fileName the name of the file to open * @param verify checks manifest and entries when true and a manifest --- 94,103 ---- } /** ! * Creates a new JarFile. If verify is true then all jar entries are ! * verified (when a Manifest file for this JarFile exists). You need to ! * actually open and read the complete jar entry ! * (with getInputStream()) to check its signature. * * @param fileName the name of the file to open * @param verify checks manifest and entries when true and a manifest *************** public class JarFile extends ZipFile *** 103,116 **** FileNotFoundException, IOException { super(fileName); - manifest = readManifest(); if (verify) ! verify(); } /** ! * Creates a new JarFile, tries to read the manifest and if the manifest ! * exists verifies it. * * @param file the file to open as a jar file * @exception FileNotFoundException if the file does not exits --- 109,125 ---- FileNotFoundException, IOException { super(fileName); if (verify) ! { ! manifest = readManifest(); ! verify(); ! } } /** ! * Creates a new JarFile. All jar entries are verified (when a Manifest file ! * for this JarFile exists). You need to actually open and read the complete ! * jar entry (with getInputStream()) to check its signature. * * @param file the file to open as a jar file * @exception FileNotFoundException if the file does not exits *************** public class JarFile extends ZipFile *** 122,129 **** } /** ! * Creates a new JarFile, tries to read the manifest and if the manifest ! * exists and verify is true verfies it. * * @param file the file to open to open as a jar file * @param verify checks manifest and entries when true and a manifest --- 131,140 ---- } /** ! * Creates a new JarFile. If verify is true then all jar entries are ! * verified (when a Manifest file for this JarFile exists). You need to ! * actually open and read the complete jar entry ! * (with getInputStream()) to check its signature. * * @param file the file to open to open as a jar file * @param verify checks manifest and entries when true and a manifest *************** public class JarFile extends ZipFile *** 135,147 **** IOException { super(file); - manifest = readManifest(); if (verify) ! verify(); } /** ! * Creates a new JarFile with the indicated mode, tries to read the * manifest and if the manifest exists and verify is true verfies it. * * @param file the file to open to open as a jar file --- 146,163 ---- IOException { super(file); if (verify) ! { ! manifest = readManifest(); ! verify(); ! } } /** ! * Creates a new JarFile with the indicated mode. If verify is true then ! * all jar entries are verified (when a Manifest file for this JarFile ! * exists). You need to actually open and read the complete jar entry ! * (with getInputStream()) to check its signature. * manifest and if the manifest exists and verify is true verfies it. * * @param file the file to open to open as a jar file *************** public class JarFile extends ZipFile *** 159,167 **** FileNotFoundException, IOException, IllegalArgumentException { super(file, mode); - manifest = readManifest(); if (verify) ! verify(); } // Methods --- 175,185 ---- FileNotFoundException, IOException, IllegalArgumentException { super(file, mode); if (verify) ! { ! manifest = readManifest(); ! verify(); ! } } // Methods *************** public class JarFile extends ZipFile *** 193,207 **** --- 211,228 ---- if (manEntry != null) { InputStream in = super.getInputStream(manEntry); + manifestRead = true; return new Manifest(in); } else { + manifestRead = true; return null; } } catch (IOException ioe) { + manifestRead = true; return null; } } *************** public class JarFile extends ZipFile *** 241,246 **** --- 262,277 ---- { ZipEntry zip = (ZipEntry) entries.nextElement(); JarEntry jar = new JarEntry(zip); + Manifest manifest; + try + { + manifest = getManifest(); + } + catch (IOException ioe) + { + manifest = null; + } + if (manifest != null) { jar.attr = manifest.getAttributes(jar.getName()); *************** public class JarFile extends ZipFile *** 261,266 **** --- 292,307 ---- if (entry != null) { JarEntry jarEntry = new JarEntry(entry); + Manifest manifest; + try + { + manifest = getManifest(); + } + catch (IOException ioe) + { + manifest = null; + } + if (manifest != null) { jarEntry.attr = manifest.getAttributes(name); *************** public class JarFile extends ZipFile *** 301,308 **** * Returns the manifest for this JarFile or null when the JarFile does not * contain a manifest file. */ ! public Manifest getManifest() { return manifest; } } --- 342,352 ---- * Returns the manifest for this JarFile or null when the JarFile does not * contain a manifest file. */ ! public Manifest getManifest() throws IOException { + if (!manifestRead) + manifest = readManifest(); + return manifest; } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/jar/Manifest.java gcc-3.3/libjava/java/util/jar/Manifest.java *** gcc-3.2.3/libjava/java/util/jar/Manifest.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/jar/Manifest.java 2002-06-18 15:40:16.000000000 +0000 *************** public class Manifest implements Cloneab *** 174,183 **** private static void read_main_section(Attributes attr, BufferedReader br) throws IOException { ! read_version_info(attr, br); read_attributes(attr, br); } private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { --- 174,192 ---- private static void read_main_section(Attributes attr, BufferedReader br) throws IOException { ! // According to the spec we should actually call read_version_info() here. read_attributes(attr, br); + // Explicitly set Manifest-Version attribute if not set in Main + // attributes of Manifest. + if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) + attr.putValue(Attributes.Name.MANIFEST_VERSION, "0.0"); } + /** + * Pedantic method that requires the next attribute in the Manifest to be + * the "Manifest-Version". This follows the Manifest spec closely but + * reject some jar Manifest files out in the wild. + */ private static void read_version_info(Attributes attr, BufferedReader br) throws IOException { *************** public class Manifest implements Cloneab *** 185,191 **** try { String value = expect_header(version_header, br); ! attr.putValue(version_header, value); } catch (IOException ioe) { --- 194,200 ---- try { String value = expect_header(version_header, br); ! attr.putValue(Attributes.Name.MANIFEST_VERSION, value); } catch (IOException ioe) { diff -Nrc3pad gcc-3.2.3/libjava/java/util/LinkedHashMap.java gcc-3.3/libjava/java/util/LinkedHashMap.java *** gcc-3.2.3/libjava/java/util/LinkedHashMap.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/LinkedHashMap.java 2002-11-10 22:06:49.000000000 +0000 *************** *** 1,6 **** /* LinkedHashMap.java -- a class providing hashtable data structure, mapping Object --> Object, with linked list traversal ! Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* LinkedHashMap.java -- a class providing hashtable data structure, mapping Object --> Object, with linked list traversal ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** package java.util; *** 50,57 **** * can cause primary clustering) and rehashing (which does not fit very * well with Java's method of precomputing hash codes) are avoided. In * addition, this maintains a doubly-linked list which tracks either ! * insertion or access order. Note that the insertion order is not ! * modified if a put simply reinserts a key in the map. *

          * * One of the nice features of tracking insertion order is that you can --- 50,66 ---- * can cause primary clustering) and rehashing (which does not fit very * well with Java's method of precomputing hash codes) are avoided. In * addition, this maintains a doubly-linked list which tracks either ! * insertion or access order. ! *

          ! * ! * In insertion order, calling put adds the key to the end of ! * traversal, unless the key was already in the map; changing traversal order ! * requires removing and reinserting a key. On the other hand, in access ! * order, all calls to put and get cause the ! * accessed key to move to the end of the traversal list. Note that any ! * accesses to the map's contents via its collection views and iterators do ! * not affect the map's traversal order, since the collection views do not ! * call put or get. *

          * * One of the nice features of tracking insertion order is that you can *************** package java.util; *** 61,79 **** *

          * * When using this {@link #LinkedHashMap(int, float, boolean) constructor}, ! * you build an access-order mapping. This can be used to implement LRU ! * caches, for example. In this case, every invocation of put, ! * putAll, or get moves the accessed entry to ! * the end of the iteration list. By overriding ! * {@link #removeEldestEntry(Map.Entry)}, you can also control the ! * removal of the oldest entry, and thereby do things like keep the map ! * at a fixed size. *

          * * Under ideal circumstances (no collisions), LinkedHashMap offers O(1) ! * performance on most operations (

          containsValue()
          is, * of course, O(n)). In the worst case (all keys map to the same ! * hash code -- very unlikely), most operations are O(n). *

          * * LinkedHashMap accepts the null key and null values. It is not --- 70,88 ---- *

          * * When using this {@link #LinkedHashMap(int, float, boolean) constructor}, ! * you can build an access-order mapping. This can be used to implement LRU ! * caches, for example. By overriding {@link #removeEldestEntry(Map.Entry)}, ! * you can also control the removal of the oldest entry, and thereby do ! * things like keep the map at a fixed size. *

          * * Under ideal circumstances (no collisions), LinkedHashMap offers O(1) ! * performance on most operations (containsValue() is, * of course, O(n)). In the worst case (all keys map to the same ! * hash code -- very unlikely), most operations are O(n). Traversal is ! * faster than in HashMap (proportional to the map size, and not the space ! * allocated for the map), but other operations may be slower because of the ! * overhead of the maintaining the traversal order list. *

          * * LinkedHashMap accepts the null key and null values. It is not *************** package java.util; *** 87,93 **** * {@link ConcurrentModificationException} rather than exhibit * non-deterministic behavior. * ! * @author Eric Blake * @see Object#hashCode() * @see Collection * @see Map --- 96,102 ---- * {@link ConcurrentModificationException} rather than exhibit * non-deterministic behavior. * ! * @author Eric Blake (ebb9@email.byu.edu) * @see Object#hashCode() * @see Collection * @see Map *************** public class LinkedHashMap extends HashM *** 105,123 **** private static final long serialVersionUID = 3801124242820219131L; /** ! * The first Entry to iterate over. ! */ ! transient LinkedHashEntry head; ! ! /** ! * The last Entry to iterate over. */ ! transient LinkedHashEntry tail; /** * The iteration order of this linked hash map: true for * access-order, false for insertion-order. ! * @serial */ final boolean accessOrder; --- 114,128 ---- private static final long serialVersionUID = 3801124242820219131L; /** ! * The oldest Entry to begin iteration at. */ ! transient LinkedHashEntry root; /** * The iteration order of this linked hash map: true for * access-order, false for insertion-order. ! * ! * @serial true for access order traversal */ final boolean accessOrder; *************** public class LinkedHashMap extends HashM *** 127,195 **** */ class LinkedHashEntry extends HashEntry { ! /** The predecessor in the iteration list, null if this is the eldest. */ LinkedHashEntry pred; /** The successor in the iteration list, null if this is the newest. */ LinkedHashEntry succ; /** * Simple constructor. * @param key the key * @param value the value */ LinkedHashEntry(Object key, Object value) { super(key, value); ! if (head == null) ! head = this; ! pred = tail; ! tail = this; ! if (pred != null) ! pred.succ = this; } /** ! * Sets the value of this entry, and shuffles it to the end of ! * the list if this is in access-order. ! * @param value the new value ! * @return the prior value */ ! public Object setValue(Object value) { if (accessOrder && succ != null) { ! succ.pred = pred; ! if (pred == null) ! head = succ; else ! pred.succ = succ; ! succ = null; ! pred = tail; ! pred.succ = this; ! tail = this; } - return super.setValue(value); } /** * Called when this entry is removed from the map. This version does * the necessary bookkeeping to keep the doubly-linked list in order. * @return the value of this key as it is removed */ Object cleanup() { ! if (pred == null) ! head = succ; ! else ! pred.succ = succ; ! if (succ == null) ! tail = pred; else ! succ.pred = pred; ! return value; } ! } /** * Construct a new insertion-ordered LinkedHashMap with the default --- 132,222 ---- */ class LinkedHashEntry extends HashEntry { ! /** ! * The predecessor in the iteration list. If this entry is the root ! * (eldest), pred points to the newest entry. ! */ LinkedHashEntry pred; + /** The successor in the iteration list, null if this is the newest. */ LinkedHashEntry succ; /** * Simple constructor. + * * @param key the key * @param value the value */ LinkedHashEntry(Object key, Object value) { super(key, value); ! if (root == null) ! { ! root = this; ! pred = this; ! } ! else ! { ! pred = root.pred; ! pred.succ = this; ! root.pred = this; ! } } /** ! * Called when this entry is accessed via put or get. This version does ! * the necessary bookkeeping to keep the doubly-linked list in order, ! * after moving this element to the newest position in access order. */ ! void access() { if (accessOrder && succ != null) { ! modCount++; ! if (this == root) ! { ! root = succ; ! pred.succ = this; ! succ = null; ! } else ! { ! pred.succ = succ; ! succ.pred = pred; ! succ = null; ! pred = root.pred; ! pred.succ = this; ! } } } /** * Called when this entry is removed from the map. This version does * the necessary bookkeeping to keep the doubly-linked list in order. + * * @return the value of this key as it is removed */ Object cleanup() { ! if (this == root) ! { ! root = succ; ! if (succ != null) ! succ.pred = pred; ! } ! else if (succ == null) ! { ! pred.succ = null; ! root.pred = pred; ! } else ! { ! pred.succ = succ; ! succ.pred = pred; ! } return value; } ! } // class LinkedHashEntry /** * Construct a new insertion-ordered LinkedHashMap with the default *************** public class LinkedHashMap extends HashM *** 253,263 **** * Construct a new LinkedHashMap with a specific inital capacity, load * factor, and ordering mode. * ! * @param initialCapacity the initial capacity (>=0) ! * @param loadFactor the load factor (>0, not NaN) * @param accessOrder true for access-order, false for insertion-order ! * @throws IllegalArgumentException if (initialCapacity < 0) || ! * ! (loadFactor > 0.0) */ public LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) --- 280,290 ---- * Construct a new LinkedHashMap with a specific inital capacity, load * factor, and ordering mode. * ! * @param initialCapacity the initial capacity (>=0) ! * @param loadFactor the load factor (>0, not NaN) * @param accessOrder true for access-order, false for insertion-order ! * @throws IllegalArgumentException if (initialCapacity < 0) || ! * ! (loadFactor > 0.0) */ public LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder) *************** public class LinkedHashMap extends HashM *** 272,291 **** public void clear() { super.clear(); ! head = null; ! tail = null; } /** ! * Returns true if this HashMap contains a value

          o
          , such that ! *
          o.equals(value)
          . * * @param value the value to search for in this HashMap ! * @return true if at least one key maps to the value */ public boolean containsValue(Object value) { ! LinkedHashEntry e = head; while (e != null) { if (equals(value, e.value)) --- 299,317 ---- public void clear() { super.clear(); ! root = null; } /** ! * Returns true if this HashMap contains a value ! * o, such that o.equals(value). * * @param value the value to search for in this HashMap ! * @return true if at least one key maps to the value */ public boolean containsValue(Object value) { ! LinkedHashEntry e = root; while (e != null) { if (equals(value, e.value)) *************** public class LinkedHashMap extends HashM *** 297,303 **** /** * Return the value in this Map associated with the supplied key, ! * or
          null
          if the key maps to nothing. If this is an * access-ordered Map and the key is found, this performs structural * modification, moving the key to the newest end of the list. NOTE: * Since the value could also be null, you must use containsKey to --- 323,329 ---- /** * Return the value in this Map associated with the supplied key, ! * or null if the key maps to nothing. If this is an * access-ordered Map and the key is found, this performs structural * modification, moving the key to the newest end of the list. NOTE: * Since the value could also be null, you must use containsKey to *************** public class LinkedHashMap extends HashM *** 316,338 **** { if (equals(key, e.key)) { ! if (accessOrder) ! { ! modCount++; ! LinkedHashEntry l = (LinkedHashEntry) e; ! if (l.succ != null) ! { ! l.succ.pred = l.pred; ! if (l.pred == null) ! head = l.succ; ! else ! l.pred.succ = l.succ; ! l.succ = null; ! l.pred = tail; ! tail.succ = l; ! tail = l; ! } ! } return e.value; } e = e.next; --- 342,348 ---- { if (equals(key, e.key)) { ! e.access(); return e.value; } e = e.next; *************** public class LinkedHashMap extends HashM *** 352,369 **** * For example, to keep the Map limited to 100 entries, override as follows: *
               * private static final int MAX_ENTRIES = 100;
          -    *
               * protected boolean removeEldestEntry(Map.Entry eldest)
               * {
          !    *   return size() > MAX_ENTRIES;
               * }
               * 

          * * Typically, this method does not modify the map, but just uses the * return value as an indication to put whether to proceed. * However, if you override it to modify the map, you must return false ! * (indicating that put should do nothing), or face ! * unspecified behavior. *

          * * This method is called after the eldest entry has been inserted, so --- 362,380 ---- * For example, to keep the Map limited to 100 entries, override as follows: *

               * private static final int MAX_ENTRIES = 100;
               * protected boolean removeEldestEntry(Map.Entry eldest)
               * {
          !    *   return size() > MAX_ENTRIES;
               * }
               * 

          * * Typically, this method does not modify the map, but just uses the * return value as an indication to put whether to proceed. * However, if you override it to modify the map, you must return false ! * (indicating that put should leave the modified map alone), ! * or you face unspecified behavior. Remember that in access-order mode, ! * even calling get is a structural modification, but using ! * the collections views (such as keySet) is not. *

          * * This method is called after the eldest entry has been inserted, so *************** public class LinkedHashMap extends HashM *** 393,425 **** * @param callRemove whether to call the removeEldestEntry method * @see #put(Object, Object) * @see #removeEldestEntry(Map.Entry) */ void addEntry(Object key, Object value, int idx, boolean callRemove) { LinkedHashEntry e = new LinkedHashEntry(key, value); - e.next = buckets[idx]; buckets[idx] = e; ! ! if (callRemove && removeEldestEntry(head)) ! remove(head); } /** * Helper method, called by clone() to reset the doubly-linked list. * @param m the map to add entries from * @see #clone() */ void putAllInternal(Map m) { ! head = null; ! tail = null; super.putAllInternal(m); } /** * Generates a parameterized iterator. This allows traversal to follow * the doubly-linked list instead of the random bin order of HashMap. * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES} * @return the appropriate iterator */ --- 404,436 ---- * @param callRemove whether to call the removeEldestEntry method * @see #put(Object, Object) * @see #removeEldestEntry(Map.Entry) + * @see LinkedHashEntry#LinkedHashEntry(Object, Object) */ void addEntry(Object key, Object value, int idx, boolean callRemove) { LinkedHashEntry e = new LinkedHashEntry(key, value); e.next = buckets[idx]; buckets[idx] = e; ! if (callRemove && removeEldestEntry(root)) ! remove(root); } /** * Helper method, called by clone() to reset the doubly-linked list. + * * @param m the map to add entries from * @see #clone() */ void putAllInternal(Map m) { ! root = null; super.putAllInternal(m); } /** * Generates a parameterized iterator. This allows traversal to follow * the doubly-linked list instead of the random bin order of HashMap. + * * @param type {@link #KEYS}, {@link #VALUES}, or {@link #ENTRIES} * @return the appropriate iterator */ *************** public class LinkedHashMap extends HashM *** 427,443 **** { return new Iterator() { ! /** The current Entry */ ! LinkedHashEntry current = head; ! /** The previous Entry returned by next() */ LinkedHashEntry last; ! /** The number of known modifications to the backing HashMap */ int knownMod = modCount; /** * Returns true if the Iterator has more elements. * @return true if there are more elements * @throws ConcurrentModificationException if the HashMap was modified */ --- 438,455 ---- { return new Iterator() { ! /** The current Entry. */ ! LinkedHashEntry current = root; ! /** The previous Entry returned by next(). */ LinkedHashEntry last; ! /** The number of known modifications to the backing Map. */ int knownMod = modCount; /** * Returns true if the Iterator has more elements. + * * @return true if there are more elements * @throws ConcurrentModificationException if the HashMap was modified */ *************** public class LinkedHashMap extends HashM *** 450,455 **** --- 462,468 ---- /** * Returns the next element in the Iterator's sequential view. + * * @return the next element * @throws ConcurrentModificationException if the HashMap was modified * @throws NoSuchElementException if there is none *************** public class LinkedHashMap extends HashM *** 467,473 **** /** * Removes from the backing HashMap the last element which was fetched ! * with the

          next()
          method. * @throws ConcurrentModificationException if the HashMap was modified * @throws IllegalStateException if called when there is no last element */ --- 480,487 ---- /** * Removes from the backing HashMap the last element which was fetched ! * with the next() method. ! * * @throws ConcurrentModificationException if the HashMap was modified * @throws IllegalStateException if called when there is no last element */ *************** public class LinkedHashMap extends HashM *** 477,487 **** throw new ConcurrentModificationException(); if (last == null) throw new IllegalStateException(); - LinkedHashMap.this.remove(last.key); last = null; knownMod++; } }; } ! } --- 491,500 ---- throw new ConcurrentModificationException(); if (last == null) throw new IllegalStateException(); LinkedHashMap.this.remove(last.key); last = null; knownMod++; } }; } ! } // class LinkedHashMap diff -Nrc3pad gcc-3.2.3/libjava/java/util/LinkedList.java gcc-3.3/libjava/java/util/LinkedList.java *** gcc-3.2.3/libjava/java/util/LinkedList.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/LinkedList.java 2002-06-18 15:39:54.000000000 +0000 *************** *** 1,5 **** /* LinkedList.java -- Linked list implementation of the List interface ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* LinkedList.java -- Linked list implementation of the List interface ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class LinkedList extends Abstract *** 125,136 **** * entry in the list is obtained in constant time, which is a very desirable * property. * For speed and flexibility, range checking is not done in this method: ! * Incorrect values will be returned if (n < 0) or (n >= size). * * @param n the number of the entry to get * @return the entry at position n */ ! private Entry getEntry(int n) { Entry e; if (n < size / 2) --- 125,137 ---- * entry in the list is obtained in constant time, which is a very desirable * property. * For speed and flexibility, range checking is not done in this method: ! * Incorrect values will be returned if (n < 0) or (n >= size). * * @param n the number of the entry to get * @return the entry at position n */ ! // Package visible for use in nested classes. ! Entry getEntry(int n) { Entry e; if (n < size / 2) *************** public class LinkedList extends Abstract *** 156,162 **** * * @param e the entry to remove */ ! private void removeEntry(Entry e) { modCount++; size--; --- 157,164 ---- * * @param e the entry to remove */ ! // Package visible for use in nested classes. ! void removeEntry(Entry e) { modCount++; size--; diff -Nrc3pad gcc-3.2.3/libjava/java/util/List.java gcc-3.3/libjava/java/util/List.java *** gcc-3.2.3/libjava/java/util/List.java 2002-01-22 22:40:38.000000000 +0000 --- gcc-3.3/libjava/java/util/List.java 2002-06-18 15:39:55.000000000 +0000 *************** public interface List extends Collection *** 201,207 **** * @see Object#equals(Object) * @see #hashCode() */ ! /* boolean equals(Object o);*/ /** * Get the element at a given index in this list. --- 201,207 ---- * @see Object#equals(Object) * @see #hashCode() */ ! boolean equals(Object o); /** * Get the element at a given index in this list. *************** public interface List extends Collection *** 213,230 **** Object get(int index); /** ! * Obtain a hash code for this list. In order to obey the general contract of ! * the hashCode method of class Object, this value is calculated as follows: ! *
          !    *   hashCode = 1;
          !    *   Iterator i = list.iterator();
          !    *   while (i.hasNext())
          !    *     {
          !    *       Object obj = i.next();
          !    *       hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
          !    *     }
          !    * 
          ! * This ensures that the general contract of Object.hashCode() is adhered to. * * @return the hash code of this list * @see Object#hashCode() --- 213,232 ---- Object get(int index); /** ! * Obtains a hash code for this list. In order to obey the general ! * contract of the hashCode method of class Object, this value is ! * calculated as follows: ! * !

          hashCode = 1;
          ! Iterator i = list.iterator();
          ! while (i.hasNext())
          ! {
          !   Object obj = i.next();
          !   hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
          ! }
          ! * ! *

          This ensures that the general contract of Object.hashCode() ! * is adhered to. * * @return the hash code of this list * @see Object#hashCode() diff -Nrc3pad gcc-3.2.3/libjava/java/util/ListResourceBundle.java gcc-3.3/libjava/java/util/ListResourceBundle.java *** gcc-3.2.3/libjava/java/util/ListResourceBundle.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/ListResourceBundle.java 2002-06-18 15:39:55.000000000 +0000 *************** *** 1,5 **** ! /* java.util.ListResourceBundle ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ListResourceBundle -- a resource bundle build around a list ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,111 **** package java.util; /** ! * A ListResouceBundle provides an easy way, to create ! * your own resource bundle. It is an abstract class that you can ! * subclass. You should then overwrite the getContents method, that ! * provides a key/value list. ! *
          ! * The key/value list is a two dimensional list of Object. The first ! * dimension ranges over the resources. The second dimension ranges ! * from zero (key) to one (value). The keys must be of type String. ! *
          ! * XXX Example! * * @see Locale * @see PropertyResourceBundle ! * @author Jochen Hoenicke */ public abstract class ListResourceBundle extends ResourceBundle { /** ! * The constructor. It does nothing special. */ public ListResourceBundle() { } /** ! * Gets the key/value list. You must override this method. ! * @return a two dimensional list of Objects. The first dimension ! * ranges over the objects, and the second dimension ranges from ! * zero (key) to one (value). ! */ ! protected abstract Object[][] getContents(); ! ! /** ! * Override this method to provide the resource for a keys. This gets ! * called by getObject. ! * @param key The key of the resource. ! * @return The resource for the key or null if it doesn't exists. */ public final Object handleGetObject(String key) { Object[][] contents = getContents(); ! for (int i = 0; i < contents.length; i++) ! { ! if (key.equals(contents[i][0])) ! return contents[i][1]; ! } return null; } /** * This method should return all keys for which a resource exists. ! * @return An enumeration of the keys. */ public Enumeration getKeys() { final Object[][] contents = getContents(); ! ! return new Enumeration() ! { ! int i = 0; ! public boolean hasMoreElements() ! { ! return i < contents.length; ! } ! public Object nextElement() { ! return contents[i++][0]; } ! }; } ! } --- 39,140 ---- package java.util; /** ! * A ListResouceBundle provides an easy way, to create your own ! * resource bundle. It is an abstract class that you can subclass. You should ! * then overwrite the getContents method, that provides a key/value list. ! * ! *

          The key/value list is a two dimensional list of Object. The first ! * dimension ranges over the resources. The second dimension ranges from ! * zero (key) to one (value). The keys must be of type String, and they are ! * case-sensitive. For example: * +

          public class MyResources
          +   extends ListResourceBundle
          + {
          +   public Object[][] getContents()
          +   {
          +     return contents;
          +   }
          + 
          +   static final Object[][] contents =
          +   {
          +     // LOCALIZED STRINGS
          +     {"s1", "The disk \"{1}\" contains {0}."},  // MessageFormat pattern
          +     {"s2", "1"},                       // location of {0} in pattern
          +     {"s3", "My Disk"},                 // sample disk name
          +     {"s4", "no files"},                // first ChoiceFormat choice
          +     {"s5", "one file"},                // second ChoiceFormat choice
          +     {"s6", "{0,number} files"}         // third ChoiceFormat choice
          +     {"s7", "3 Mar 96"},                // sample date
          +     {"s8", new Dimension(1,5)}         // real object, not just string
          +     // END OF LOCALIZED MATERIAL
          +   };
          + }
          + * + * @author Jochen Hoenicke + * @author Eric Blake * @see Locale * @see PropertyResourceBundle ! * @since 1.1 ! * @status updated to 1.4 ! */ public abstract class ListResourceBundle extends ResourceBundle { /** ! * The constructor. It does nothing special. */ public ListResourceBundle() { } /** ! * Gets a resource for a given key. This is called by getObject. ! * ! * @param key the key of the resource ! * @return the resource for the key, or null if it doesn't exist */ public final Object handleGetObject(String key) { Object[][] contents = getContents(); ! int i = contents.length; ! while (--i >= 0) ! if (key.equals(contents[i][0])) ! return contents[i][1]; return null; } /** * This method should return all keys for which a resource exists. ! * ! * @return an enumeration of the keys */ public Enumeration getKeys() { + // We make a new Set that holds all the keys, then return an enumeration + // for that. This prevents modifications from ruining the enumeration, + // as well as ignoring duplicates. final Object[][] contents = getContents(); ! Set s = new HashSet(); ! int i = contents.length; ! while (--i >= 0) ! s.add(contents[i][0]); ! ResourceBundle bundle = parent; ! // Eliminate tail recursion. ! while (bundle != null) { ! Enumeration e = bundle.getKeys(); ! while (e.hasMoreElements()) ! s.add(e.nextElement()); ! bundle = bundle.parent; } ! return Collections.enumeration(s); } ! ! /** ! * Gets the key/value list. You must override this method, and should not ! * provide duplicate keys or null entries. ! * ! * @return a two dimensional list of String key / Object resouce pairs ! */ ! protected abstract Object[][] getContents(); ! } // class ListResourceBundle diff -Nrc3pad gcc-3.2.3/libjava/java/util/Locale.java gcc-3.3/libjava/java/util/Locale.java *** gcc-3.2.3/libjava/java/util/Locale.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/Locale.java 2002-11-27 22:41:07.000000000 +0000 *************** *** 1,23 **** ! /* java.util.Locale ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole --- 1,23 ---- ! /* Locale.java -- i18n locales ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole *************** exception statement from your version. * *** 37,243 **** package java.util; /** ! * Locales represent a specific country and culture. ! *

          ! * Classes which can be passed a Locale object tailor their information ! * for a given locale. For instance, currency number formatting is ! * handled differently for the USA and France. ! *

          ! * Locales are made up of a language code, a country code, and an optional ! * set of variant strings. ! *

          ! * Language codes are represented by ! * ISO 639:1988 ! * w/ additions from ISO 639/RA Newsletter No. 1/1989 ! * and a decision of the Advisory Committee of ISO/TC39 on ! * August 8, 1997. ! *

          ! * Country codes are represented by ! * ISO 3166. ! *

          ! * Variant strings are vendor and browser specific. Standard variant ! * strings include "POSIX" for POSIX, "WIN" for MS-Windows, and "MAC" for ! * Macintosh. When there is more than one variant string, they must * be separated by an underscore (U+005F). ! *

          ! * The default locale is determined by the values of the system properties ! * user.language, user.region, and user.variant. * @see ResourceBundle * @see java.text.Format * @see java.text.NumberFormat * @see java.text.Collator * @author Jochen Hoenicke * @author Paul Fisher */ ! public final class Locale implements java.io.Serializable, Cloneable { ! /** ! * Locale which represents the English language. ! */ ! public static final Locale ENGLISH = new Locale("en", ""); ! /** ! * Locale which represents the English language. ! */ ! public static final Locale FRENCH = new Locale("fr", ""); ! /** ! * Locale which represents the German language. ! */ ! public static final Locale GERMAN = new Locale("de", ""); ! /** ! * Locale which represents the Italian language. ! */ ! public static final Locale ITALIAN = new Locale("it", ""); ! /** ! * Locale which represents the Japanese language. ! */ ! public static final Locale JAPANESE = new Locale("ja", ""); ! /** ! * Locale which represents the Korean language. ! */ ! public static final Locale KOREAN = new Locale("ko", ""); ! /** ! * Locale which represents the Chinese language. ! */ ! public static final Locale CHINESE = new Locale("zh", ""); ! /** ! * Locale which represents the Chinese language as used in China. ! */ public static final Locale SIMPLIFIED_CHINESE = new Locale("zh", "CN"); /** * Locale which represents the Chinese language as used in Taiwan. * Same as TAIWAN Locale. */ public static final Locale TRADITIONAL_CHINESE = new Locale("zh", "TW"); ! /** ! * Locale which represents France. ! */ public static final Locale FRANCE = new Locale("fr", "FR"); ! /** ! * Locale which represents Germany. ! */ public static final Locale GERMANY = new Locale("de", "DE"); ! /** ! * Locale which represents Italy. ! */ public static final Locale ITALY = new Locale("it", "IT"); ! /** ! * Locale which represents Japan. ! */ public static final Locale JAPAN = new Locale("ja", "JP"); ! /** ! * Locale which represents Korea. ! */ public static final Locale KOREA = new Locale("ko", "KR"); /** * Locale which represents China. * Same as SIMPLIFIED_CHINESE Locale. */ public static final Locale CHINA = SIMPLIFIED_CHINESE; /** * Locale which represents the People's Republic of China. * Same as CHINA Locale. */ public static final Locale PRC = CHINA; /** * Locale which represents Taiwan. * Same as TRADITIONAL_CHINESE Locale. */ public static final Locale TAIWAN = TRADITIONAL_CHINESE; ! /** ! * Locale which represents the United Kingdom. ! */ public static final Locale UK = new Locale("en", "GB"); ! /** ! * Locale which represents the United States. ! */ public static final Locale US = new Locale("en", "US"); ! /** ! * Locale which represents the English speaking portion of Canada. ! */ public static final Locale CANADA = new Locale("en", "CA"); ! /** ! * Locale which represents the French speaking portion of Canada. ! */ public static final Locale CANADA_FRENCH = new Locale("fr", "CA"); /** ! * We are compatible to sun's Locale. */ ! static final long serialVersionUID = 9149081749638150636L; /** * The language code, as returned by getLanguage(). ! * @serial */ private String language; /** * The country code, as returned by getCountry(). ! * @serial */ private String country; /** * The variant code, as returned by getVariant(). ! * @serial */ private String variant; /** ! * This is the cached hashcode. When writing to stream, we write -1. ! * @serial */ private int hashcode; /** ! * Convert old iso639 codes to the new ones. */ private String convertLanguage(String language) { if (language.equals("")) return language; - language = language.toLowerCase(); ! int index = "iw,in,ji".indexOf(language); if (index != -1) ! return "he,id,yi".substring(index, index + 2); return language; } /** * Creates a new locale for the given language and country. ! * @param language lowercase two-letter ISO-639 A2 language code. ! * @param country uppercase two-letter ISO-3166 A2 contry code. ! * @param variant vendor and browser specific. */ public Locale(String language, String country, String variant) { ! this.language = convertLanguage(language); ! this.country = country.toUpperCase(); ! this.variant = variant.toUpperCase(); ! this.hashcode = (this.language.hashCode() ^ this.country.hashCode() ! ^ this.variant.hashCode()); } /** * Creates a new locale for the given language and country. ! * @param language lowercase two-letter ISO-639 A2 language code. ! * @param country uppercase two-letter ISO-3166 A2 country code. */ public Locale(String language, String country) { this(language, country, ""); } ! private static Locale defaultLocale = ! new Locale(System.getProperty("user.language", ""), ! System.getProperty("user.region", ""), ! System.getProperty("user.variant", "")); /** ! * Returns the default Locale. The default locale is generally ! * once set on start up and then never changed. Normally you ! * should use this locale for everywhere you need a locale. ! * The initial setting matches the default locale, the user has ! * chosen. */ public static Locale getDefault() { --- 37,277 ---- package java.util; + import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; + import java.io.Serializable; + /** ! * Locales represent a specific country and culture. Classes which can be ! * passed a Locale object tailor their information for a given locale. For ! * instance, currency number formatting is handled differently for the USA ! * and France. ! * ! *

          Locales are made up of a language code, a country code, and an optional ! * set of variant strings. Language codes are represented by ! * ! * ISO 639:1988 w/ additions from ISO 639/RA Newsletter No. 1/1989 ! * and a decision of the Advisory Committee of ISO/TC39 on August 8, 1997. ! * ! *

          Country codes are represented by ! * ! * ISO 3166. Variant strings are vendor and browser specific. Standard ! * variant strings include "POSIX" for POSIX, "WIN" for MS-Windows, and ! * "MAC" for Macintosh. When there is more than one variant string, they must * be separated by an underscore (U+005F). ! * ! *

          The default locale is determined by the values of the system properties ! * user.language, user.region, and user.variant, defaulting to "en". Note that ! * the locale does NOT contain the conversion and formatting capabilities (for ! * that, use ResourceBundle and java.text). Rather, it is an immutable tag ! * object for identifying a given locale, which is referenced by these other ! * classes when they must make locale-dependent decisions. ! * * @see ResourceBundle * @see java.text.Format * @see java.text.NumberFormat * @see java.text.Collator * @author Jochen Hoenicke * @author Paul Fisher + * @author Eric Blake + * @since 1.1 + * @status updated to 1.4 */ ! public final class Locale implements Serializable, Cloneable { ! /** Locale which represents the English language. */ ! public static final Locale ENGLISH = new Locale("en"); ! ! /** Locale which represents the French language. */ ! public static final Locale FRENCH = new Locale("fr"); ! ! /** Locale which represents the German language. */ ! public static final Locale GERMAN = new Locale("de"); ! ! /** Locale which represents the Italian language. */ ! public static final Locale ITALIAN = new Locale("it"); ! ! /** Locale which represents the Japanese language. */ ! public static final Locale JAPANESE = new Locale("ja"); ! ! /** Locale which represents the Korean language. */ ! public static final Locale KOREAN = new Locale("ko"); ! ! /** Locale which represents the Chinese language. */ ! public static final Locale CHINESE = new Locale("zh"); ! ! /** Locale which represents the Chinese language as used in China. */ public static final Locale SIMPLIFIED_CHINESE = new Locale("zh", "CN"); + /** * Locale which represents the Chinese language as used in Taiwan. * Same as TAIWAN Locale. */ public static final Locale TRADITIONAL_CHINESE = new Locale("zh", "TW"); ! ! /** Locale which represents France. */ public static final Locale FRANCE = new Locale("fr", "FR"); ! ! /** Locale which represents Germany. */ public static final Locale GERMANY = new Locale("de", "DE"); ! ! /** Locale which represents Italy. */ public static final Locale ITALY = new Locale("it", "IT"); ! ! /** Locale which represents Japan. */ public static final Locale JAPAN = new Locale("ja", "JP"); ! ! /** Locale which represents Korea. */ public static final Locale KOREA = new Locale("ko", "KR"); + /** * Locale which represents China. * Same as SIMPLIFIED_CHINESE Locale. */ public static final Locale CHINA = SIMPLIFIED_CHINESE; + /** * Locale which represents the People's Republic of China. * Same as CHINA Locale. */ public static final Locale PRC = CHINA; + /** * Locale which represents Taiwan. * Same as TRADITIONAL_CHINESE Locale. */ public static final Locale TAIWAN = TRADITIONAL_CHINESE; ! ! /** Locale which represents the United Kingdom. */ public static final Locale UK = new Locale("en", "GB"); ! ! /** Locale which represents the United States. */ public static final Locale US = new Locale("en", "US"); ! ! /** Locale which represents the English speaking portion of Canada. */ public static final Locale CANADA = new Locale("en", "CA"); ! ! /** Locale which represents the French speaking portion of Canada. */ public static final Locale CANADA_FRENCH = new Locale("fr", "CA"); /** ! * Compatible with JDK 1.1+. */ ! private static final long serialVersionUID = 9149081749638150636L; /** * The language code, as returned by getLanguage(). ! * ! * @serial the languange, possibly "" */ private String language; + /** * The country code, as returned by getCountry(). ! * ! * @serial the country, possibly "" */ private String country; + /** * The variant code, as returned by getVariant(). ! * ! * @serial the variant, possibly "" */ private String variant; + /** ! * This is the cached hashcode. When writing to stream, we write -1. ! * ! * @serial should be -1 in serial streams */ private int hashcode; /** ! * The default locale. Except for during bootstrapping, this should never be ! * null. Note the logic in the main constructor, to detect when ! * bootstrapping has completed. ! */ ! private static Locale defaultLocale = ! new Locale(System.getProperty("user.language", "en"), ! System.getProperty("user.region", ""), ! System.getProperty("user.variant", "")); ! ! /** ! * Convert new iso639 codes to the old ones. ! * ! * @param language the language to check ! * @return the appropriate code */ private String convertLanguage(String language) { if (language.equals("")) return language; language = language.toLowerCase(); ! int index = "he,id,yi".indexOf(language); if (index != -1) ! return "iw,in,ji".substring(index, index + 2); return language; } /** * Creates a new locale for the given language and country. ! * ! * @param language lowercase two-letter ISO-639 A2 language code ! * @param country uppercase two-letter ISO-3166 A2 contry code ! * @param variant vendor and browser specific ! * @throws NullPointerException if any argument is null */ public Locale(String language, String country, String variant) { ! // During bootstrap, we already know the strings being passed in are ! // the correct capitalization, and not null. We can't call ! // String.toUpperCase during this time, since that depends on the ! // default locale. ! if (defaultLocale != null) ! { ! language = convertLanguage(language); ! country = country.toUpperCase(); ! variant = variant.toUpperCase(); ! } ! this.language = language; ! this.country = country; ! this.variant = variant; ! hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); } /** * Creates a new locale for the given language and country. ! * ! * @param language lowercase two-letter ISO-639 A2 language code ! * @param country uppercase two-letter ISO-3166 A2 country code ! * @throws NullPointerException if either argument is null */ public Locale(String language, String country) { this(language, country, ""); } ! /** ! * Creates a new locale for a language. ! * ! * @param language lowercase two-letter ISO-639 A2 language code ! * @throws NullPointerException if either argument is null ! * @since 1.4 ! */ ! public Locale(String language) ! { ! this(language, "", ""); ! } /** ! * Returns the default Locale. The default locale is generally once set ! * on start up and then never changed. Normally you should use this locale ! * for everywhere you need a locale. The initial setting matches the ! * default locale, the user has chosen. ! * ! * @return the default locale for this virtual machine */ public static Locale getDefault() { *************** public final class Locale implements jav *** 245,267 **** } /** ! * Changes the default locale. Normally only called on program ! * start up. Note that this doesn't change the locale for other ! * programs. */ public static void setDefault(Locale newLocale) { defaultLocale = newLocale; } /** * Returns the list of available locales. */ public static Locale[] getAvailableLocales() { /* I only return those for which localized language * or country information exists. ! * XXX - remove hard coded list. */ return new Locale[] { --- 279,315 ---- } /** ! * Changes the default locale. Normally only called on program start up. ! * Note that this doesn't change the locale for other programs. This has ! * a security check, ! * PropertyPermission("user.language", "write"), because of ! * its potential impact to running code. ! * ! * @param newLocale the new default locale ! * @throws NullPointerException if newLocale is null ! * @throws SecurityException if permission is denied */ public static void setDefault(Locale newLocale) { + if (newLocale == null) + throw new NullPointerException(); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkPermission(new PropertyPermission("user.language", "write")); defaultLocale = newLocale; } /** * Returns the list of available locales. + * + * @return the installed locales */ public static Locale[] getAvailableLocales() { /* I only return those for which localized language * or country information exists. ! * XXX - remove hard coded list, and implement more locales (Sun's JDK 1.4 ! * has 148 installed locales!). */ return new Locale[] { *************** public final class Locale implements jav *** 271,341 **** /** * Returns a list of all 2-letter uppercase country codes as defined ! * in ISO 3166 */ public static String[] getISOCountries() { return new String[] { ! "AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", ! "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", ! "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BA", ! "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", ! "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", ! "CC", "CO", "KM", "CG", "CK", "CR", "CI", "HR", "CU", ! "CY", "CZ", "DK", "DJ", "DM", "DO", "TP", "EC", "EG", ! "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", ! "FR", "FX", "GF", "PF", "TF", "GA", "GM", "GE", "DE", ! "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GN", ! "GW", "GY", "HT", "HM", "HN", "HK", "HU", "IS", "IN", ! "ID", "IR", "IQ", "IE", "IL", "IT", "JM", "JP", "JO", ! "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", ! "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", ! "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", ! "MU", "YT", "MX", "FM", "MD", "MC", "MN", "MS", "MA", ! "MZ", "MM", "NA", "NR", "NP", "NL", "AN", "NC", "NZ", ! "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", ! "PW", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", ! "PR", "QA", "RE", "RO", "RU", "RW", "KN", "LC", "VC", ! "WS", "SM", "ST", "SA", "SN", "SC", "SL", "SG", "SK", ! "SI", "SB", "SO", "ZA", "GS", "ES", "LK", "SH", "PM", ! "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", ! "TZ", "TH", "TG", "TK", "TO", "TT", "TN", "TR", "TM", ! "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", ! "UZ", "VU", "VA", "VE", "VN", "VG", "VI", "WF", "EH", ! "YE", "YU", "ZR", "ZM", "ZW"}; } /** * Returns a list of all 2-letter lowercase language codes as defined * in ISO 639 (both old and new variant). */ public static String[] getISOLanguages() { return new String[] { ! "aa", "ab", "af", "am", "ar", "as", "ay", "az", "ba", ! "be", "bg", "bh", "bi", "bn", "bo", "br", "ca", "co", ! "cs", "cy", "da", "de", "dz", "el", "en", "eo", "es", ! "et", "eu", "fa", "fi", "fj", "fo", "fr", "fy", "ga", ! "gd", "gl", "gn", "gu", "ha", "iw", "he", "hi", "hr", ! "hu", "hy", "ia", "in", "id", "ie", "ik", "is", "it", ! "iu", "ja", "jw", "ka", "kk", "kl", "km", "kn", "ko", ! "ks", "ku", "ky", "la", "ln", "lo", "lt", "lv", "mg", ! "mi", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", ! "na", "ne", "nl", "no", "oc", "om", "or", "pa", "pl", ! "ps", "pt", "qu", "rm", "rn", "ro", "ru", "rw", "sa", ! "sd", "sg", "sh", "si", "sk", "sl", "sm", "sn", "so", ! "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", ! "tg", "th", "ti", "tk", "tl", "tn", "to", "tr", "ts", ! "tt", "tw", "ug", "uk", "ur", "uz", "vi", "vo", "wo", ! "xh", "ji", "yi", "yo", "za", "zh", "zu"}; } /** ! * Returns the language code of this locale. ! * @return language code portion of this locale, or an empty String if ! * none exists */ public String getLanguage() { --- 319,386 ---- /** * Returns a list of all 2-letter uppercase country codes as defined ! * in ISO 3166. ! * ! * @return a list of acceptible country codes */ public static String[] getISOCountries() { return new String[] { ! "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", ! "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", ! "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", ! "CC", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", ! "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", ! "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", ! "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", ! "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", ! "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", ! "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", ! "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", ! "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", ! "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", ! "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", ! "PH", "PK", "PL", "PM", "PN", "PR", "PT", "PW", "PY", "QA", "RE", "RO", ! "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", ! "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", ! "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", ! "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", ! "VN", "VU", "WF", "WS", "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW" ! }; } /** * Returns a list of all 2-letter lowercase language codes as defined * in ISO 639 (both old and new variant). + * + * @return a list of acceptable language codes */ public static String[] getISOLanguages() { return new String[] { ! "aa", "ab", "af", "am", "ar", "as", "ay", "az", "ba", "be", "bg", "bh", ! "bi", "bn", "bo", "br", "ca", "co", "cs", "cy", "da", "de", "dz", "el", ! "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fy", "ga", ! "gd", "gl", "gn", "gu", "ha", "he", "hi", "hr", "hu", "hy", "ia", "id", ! "ie", "ik", "in", "is", "it", "iu", "iw", "ja", "ji", "jw", "ka", "kk", ! "kl", "km", "kn", "ko", "ks", "ku", "ky", "la", "ln", "lo", "lt", "lv", ! "mg", "mi", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "na", "ne", ! "nl", "no", "oc", "om", "or", "pa", "pl", "ps", "pt", "qu", "rm", "rn", ! "ro", "ru", "rw", "sa", "sd", "sg", "sh", "si", "sk", "sl", "sm", "sn", ! "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", ! "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ug", "uk", "ur", ! "uz", "vi", "vo", "wo", "xh", "yi", "yo", "za", "zh", "zu" ! }; } /** ! * Returns the language code of this locale. Some language codes have changed ! * as ISO 639 has evolved; this returns the old name, even if you built ! * the locale with the new one. ! * ! * @return language code portion of this locale, or an empty String */ public String getLanguage() { *************** public final class Locale implements jav *** 344,351 **** /** * Returns the country code of this locale. ! * @return country code portion of this locale, or an empty String if ! * none exists */ public String getCountry() { --- 389,396 ---- /** * Returns the country code of this locale. ! * ! * @return country code portion of this locale, or an empty String */ public String getCountry() { *************** public final class Locale implements jav *** 354,359 **** --- 399,406 ---- /** * Returns the variant code of this locale. + * + * @return the variant code portion of this locale, or an empty String */ public String getVariant() { *************** public final class Locale implements jav *** 361,574 **** } /** ! * Gets the string representation of the current locale. This ! * consists of the language, the country, and the variant, ! * separated by an underscore. If one of this three component is ! * missing the underscore will also disappear. ! * @return the string representation of this Locale. */ public final String toString() { StringBuffer result = new StringBuffer(language); ! String underscore = ""; ! if (language.length() != 0) ! underscore = "_"; ! if (country.length() != 0) ! { ! result.append(underscore); ! result.append(country); ! underscore = "_"; ! } if (variant.length() != 0) ! { ! result.append(underscore); ! result.append(variant); ! } return result.toString(); } /** * Returns the three-letter ISO language abbrevation of this locale. ! * @exception MissingResourceException if the three-letter code is not ! * known. */ ! public String getISO3Language() throws MissingResourceException { ! int index = ! ("aa,ab,af,am,ar,as,ay,az,ba,be,bg,bh,bi,bn,bo,br,ca,co,cs,cy," + ! "da,de,dz,el,en,eo,es,et,eu,fa,fi,fj,fo,fr,fy,ga,gd,gl,gn,gu," + ! "gv,ha,hi,hr,hu,hy,ia,ie,ik,id,is,it,iu,he,ja,yi,jw,ka,kk,kl," + ! "km,kn,ko,ks,ku,kw,ky,la,lb,ln,lo,lt,lv,mg,mi,mk,ml,mn,mo,mr," + ! "ms,mt,my,na,ne,nl,no,oc,om,or,pa,pl,ps,pt,qu,rm,rn,ro,ru,rw," + ! "sa,sd,se,sg,sh,si,sk,sl,sm,sn,so,sq,sr,ss,st,su,sv,sw,ta,te," + ! "tg,th,ti,tk,tl,tn,to,tr,ts,tt,tw,ug,uk,ur,uz,vi,vo,wo,xh,yo," + ! "za,zh,zu,").indexOf(language + ","); ! ! if (index == -1 || language.length() != 2) throw new MissingResourceException ! ("Can't find ISO3 language for " + language, ! "java.util.Locale", language); ! /* Don't read this aloud. This are the three letter language codes ! */ return ! ("aarabkaframharaasmaymazebakbelbulbihbisbenbodbrecatcoscescym" + ! "dandeudzoellengepospaesteusfasfinfijfaofrafrygaigdhglggrnguj" + ! "maxhauhinhrvhunhyeinaileipkindislitaikuhebjpnyidjawkatkazkal" + ! "khmkankorkaskurcorkirlatltzlinlaolitlavmlgmrimkdmalmonmolmar" + ! "msamltmyanaunepnldnorociormoripanpolpusporquerohrunronruskin" + ! "sansndsmisagsrpsinslkslvsmosnasomsqisrpsswsotsunsweswatamtel" + ! "tgkthatirtuktgltsntonturtsotattwiuigukrurduzbvievolwolxhoyor" + ! "zhazhozul").substring(index, index + 3); } /** * Returns the three-letter ISO country abbrevation of the locale. ! * @exception MissingResourceException if the three-letter code is not ! * known. */ ! public String getISO3Country() throws MissingResourceException { ! int index = ! ("AF,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AZ,BS,BH,BD,BB,BY,BE," + ! "BZ,BJ,BM,BT,BO,BA,BW,BV,BR,IO,BN,BG,BF,BI,KH,CM,CA,CV,KY,CF,TD," + ! "CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CI,HR,CU,CY,CZ,DK,DJ,DM,DO,TP,EC," + ! "EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,FX,GF,PF,TF,GA,GM,GE,DE,GH,GI," + ! "GR,GL,GD,GP,GU,GT,GN,GW,GY,HT,HM,VA,HN,HK,HU,IS,IN,ID,IR,IQ,IE," + ! "IL,IT,JM,JP,JO,KZ,KE,KI,KP,KR,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU," + ! "MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,MS,MA,MZ," + ! "MM,NA,NR,NP,NL,AN,NC,NZ,NI,NE,NG,NU,NF,MP,NO,OM,PK,PW,PA,PG,PY," + ! "PE,PH,PN,PL,PT,PR,QA,RE,RO,RU,RW,KN,LC,VC,WS,SM,ST,SA,SN,SC,SL," + ! "SG,SK,SI,SB,SO,ZA,GS,ES,LK,SH,PM,SD,SR,SJ,SZ,SE,CH,SY,TW,TJ,TZ," + ! "TH,TG,TK,TO,TT,TN,TR,TM,TC,TV,UG,UA,AE,GB,US,UM,UY,UZ,VU,VE,VN," + ! "VG,VI,WF,EH,YE,YU,ZM,ZW,").indexOf(country + ","); ! ! if (index == -1 || language.length() != 2) throw new MissingResourceException ! ("Can't find ISO3 country for " + country, ! "java.util.Locale", country); ! /* Don't read this aloud. This are the three letter country codes ! */ return ! ("AFGALBDZAASMANDAGOAIAATAATGARGARMABWAUSAUTAZEBHSBHRBGDBRBBLRBEL" + ! "BLZBENBMUBTNBOLBIHBWABVTBRAIOTBRNBGRBFABDIKHMCMRCANCPVCYMCAFTCD" + ! "CHLCHNCXRCCKCOLCOMCOGCODCOKCRICIVHRVCUBCYPCZEDNKDJIDMADOMTMPECU" + ! "EGYSLVGNQERIESTETHFLKFROFJIFINFRAFXXGUFPYFATFGABGMBGEODEUGHAGIB" + ! "GRCGRLGRDGLPGUMGTMGINGNBGUYHTIHMDVATHNDHKGHUNISLINDIDNIRNIRQIRL" + ! "ISRITAJAMJPNJORKAZKENKIRPRKKORKWTKGZLAOLVALBNLSOLBRLBYLIELTULUX" + ! "MACMKDMDGMWIMYSMDVMLIMLTMHLMTQMRTMUSMYTMEXFSMMDAMCOMNGMSRMARMOZ" + ! "MMRNAMNRUNPLNLDANTNCLNZLNICNERNGANIUNFKMNPNOROMNPAKPLWPANPNGPRY" + ! "PERPHLPCNPOLPRTPRIQATREUROMRUSRWAKNALCAVCTWSMSMRSTPSAUSENSYCSLE" + ! "SGPSVKSVNSLBSOMZAFSGSESPLKASHNSPMSDNSURSJMSWZSWECHESYRTWNTJKTZA" + ! "THATGOTKLTONTTOTUNTURTKMTCATUVUGAUKRAREGBRUSAUMIURYUZBVUTVENVNM" + ! "VGBVIRWLFESHYEMYUGZMBZWE").substring(index, index + 3); } ! /** * Gets the country name suitable for display to the user, formatted * for the default locale. This has the same effect as *

               * getDisplayLanguage(Locale.getDefault());
               * 
          * ! * @return the language name of this locale localized to the ! * default locale. If the localized is not found, the ISO code ! * is returned. */ public String getDisplayLanguage() { ! return getDisplayLanguage(getDefault()); } ! /** * Gets the language name suitable for display to the user, formatted * for a specified locale. * @param locale locale to use for formatting ! * @return the language name of this locale localized to the ! * given locale. If the localized is not found, the ISO code ! * is returned. */ public String getDisplayLanguage(Locale locale) { try { ! ResourceBundle bundle ! = ResourceBundle.getBundle("gnu.java.locale.iso639", locale); ! return bundle.getString(language); } catch (MissingResourceException ex) { ! return language; } } ! /** * Returns the country name of this locale localized to the ! * default locale. If the localized is not found, the ISO code ! * is returned. This has the same effect as *
               * getDisplayCountry(Locale.getDefault());
               * 
          */ public String getDisplayCountry() { ! return getDisplayCountry(getDefault()); } ! /** * Gets the country name suitable for display to the user, formatted * for a specified locale. * * @param locale locale to use for formatting ! * @return the country name of this locale localized to the given ! * locale. If the localized is not found, the ISO country code is ! * returned. */ public String getDisplayCountry(Locale locale) { try { ! ResourceBundle bundle = ! ResourceBundle.getBundle("gnu.java.locale.iso3166", locale); ! return bundle.getString(country); } catch (MissingResourceException ex) { ! return country; } } ! /** * Returns the variant name of this locale localized to the ! * default locale. If the localized is not found, the variant code ! * itself is returned. This has the same effect as *
               * getDisplayVariant(Locale.getDefault());
               * 
          */ public String getDisplayVariant() { ! return getDisplayVariant(getDefault()); } ! /** * Returns the variant name of this locale localized to the ! * given locale. If the localized is not found, the variant code * itself is returned. */ public String getDisplayVariant(Locale locale) { ! /*XXX - load a bundle? */ return variant; } /** * Gets all local components suitable for display to the user, formatted ! * for the default locale. For the language component, getDisplayLanguage ! * is called. For the country component, getDisplayCountry is called. * For the variant set component, getDisplayVariant is called. ! *

          ! * The returned String will be one of the following forms:
          *
               * language (country, variant)
               * language (country)
          --- 408,628 ----
              }
            
              /**
          !    * Gets the string representation of the current locale. This consists of
          !    * the language, the country, and the variant, separated by an underscore.
          !    * The variant is listed only if there is a language or country. Examples:
          !    * "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC".
          !    *
          !    * @return the string representation of this Locale
          !    * @see #getDisplayName()
               */
              public final String toString()
              {
          +     if (language.length() == 0 && country.length() == 0)
          +       return "";
          +     else if (country.length() == 0 && variant.length() == 0)
          +       return language;
                StringBuffer result = new StringBuffer(language);
          !     result.append('_').append(country);
                if (variant.length() != 0)
          !       result.append('_').append(variant);
                return result.toString();
              }
            
              /**
               * Returns the three-letter ISO language abbrevation of this locale.
          !    *
          !    * @throws MissingResourceException if the three-letter code is not known
               */
          !   public String getISO3Language()
              {
          !     if ("".equals(language))
          !       return "";
          !     int index
          !       = ("aa,ab,af,am,ar,as,ay,az,ba,be,bg,bh,bi,bn,bo,br,ca,co,cs,cy,da,"
          !          + "de,dz,el,en,eo,es,et,eu,fa,fi,fj,fo,fr,fy,ga,gd,gl,gn,gu,ha,iw,"
          !          + "hi,hr,hu,hy,ia,in,ie,ik,in,is,it,iu,iw,ja,ji,jw,ka,kk,kl,km,kn,"
          !          + "ko,ks,ku,ky,la,ln,lo,lt,lv,mg,mi,mk,ml,mn,mo,mr,ms,mt,my,na,ne,"
          !          + "nl,no,oc,om,or,pa,pl,ps,pt,qu,rm,rn,ro,ru,rw,sa,sd,sg,sh,si,sk,"
          !          + "sl,sm,sn,so,sq,sr,ss,st,su,sv,sw,ta,te,tg,th,ti,tk,tl,tn,to,tr,"
          !          + "ts,tt,tw,ug,uk,ur,uz,vi,vo,wo,xh,ji,yo,za,zh,zu")
          !       .indexOf(language);
          ! 
          !     if (index % 3 != 0 || language.length() != 2)
                  throw new MissingResourceException
          !         ("Can't find ISO3 language for " + language,
          !          "java.util.Locale", language);
            
          !     // Don't read this aloud. These are the three letter language codes.
                return
          !       ("aarabkaframharaasmaymazebakbelbulbihbisbenbodbrecatcoscescymdandeu"
          !        + "dzoellengepospaesteusfasfinfijfaofrafrygaigdhglggrngujhauhebhinhrv"
          !        + "hunhyeinaindileipkindislitaikuhebjpnyidjawkatkazkalkhmkankorkaskur"
          !        + "kirlatlinlaolitlavmlgmrimkdmalmonmolmarmsamltmyanaunepnldnorociorm"
          !        + "oripanpolpusporquerohrunronruskinsansndsagsrpsinslkslvsmosnasomsqi"
          !        + "srpsswsotsunsweswatamteltgkthatirtuktgltsntonturtsotattwiuigukrurd"
          !        + "uzbvievolwolxhoyidyorzhazhozul")
          !       .substring(index, index + 3);
              }
            
              /**
               * Returns the three-letter ISO country abbrevation of the locale.
          !    *
          !    * @throws MissingResourceException if the three-letter code is not known
               */
          !   public String getISO3Country()
              {
          !     if ("".equals(country))
          !       return "";
          !     int index
          !       = ("AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AZ,BA,BB,BD,BE,BF,"
          !          + "BG,BH,BI,BJ,BM,BN,BO,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CF,CG,CH,CI,CK,"
          !          + "CL,CM,CN,CO,CR,CU,CV,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,"
          !          + "ES,ET,FI,FJ,FK,FM,FO,FR,FX,GA,GB,GD,GE,GF,GH,GI,GL,GM,GN,GP,GQ,"
          !          + "GR,GS,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IN,IO,IQ,IR,IS,IT,"
          !          + "JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,"
          !          + "LT,LU,LV,LY,MA,MC,MD,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV,"
          !          + "MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA,PE,PF,PG,"
          !          + "PH,PK,PL,PM,PN,PR,PT,PW,PY,QA,RE,RO,RU,RW,SA,SB,SC,SD,SE,SG,SH,"
          !          + "SI,SJ,SK,SL,SM,SN,SO,SR,ST,SV,SY,SZ,TC,TD,TF,TG,TH,TJ,TK,TM,TN,"
          !          + "TO,TP,TR,TT,TV,TW,TZ,UA,UG,UM,US,UY,UZ,VA,VC,VE,VG,VI,VN,VU,WF,"
          !          + "WS,YE,YT,YU,ZA,ZM,ZR,ZW")
          !       .indexOf(country);
          ! 
          !     if (index % 3 != 0 || language.length() != 2)
                  throw new MissingResourceException
          !         ("Can't find ISO3 country for " + country,
          !          "java.util.Locale", country);
            
          !     // Don't read this aloud. These are the three letter country codes.
                return
          !       ("ANDAREAFGATGAIAALBARMANTAGOATAARGASMAUTAUSABWAZEBIHBRBBGDBELBFABGR"
          !        + "BHRBDIBENBMUBRNBOLBRABHSBTNBVTBWABLRBLZCANCCKCAFCOGCHECIVCOKCHLCMR"
          !        + "CHNCOLCRICUBCPVCXRCYPCZEDEUDJIDNKDMADOMDZAECUESTEGYESHERIESPETHFIN"
          !        + "FJIFLKFSMFROFRAFXXGABGBRGRDGEOGUFGHAGIBGRLGMBGINGLPGNQGRCSGSGTMGUM"
          !        + "GNBGUYHKGHMDHNDHRVHTIHUNIDNIRLISRINDIOTIRQIRNISLITAJAMJORJPNKENKGZ"
          !        + "KHMKIRCOMKNAPRKKORKWTCYMKAZLAOLBNLCALIELKALBRLSOLTULUXLVALBYMARMCO"
          !        + "MDAMDGMHLMKDMLIMMRMNGMACMNPMTQMRTMSRMLTMUSMDVMWIMEXMYSMOZNAMNCLNER"
          !        + "NFKNGANICNLDNORNPLNRUNIUNZLOMNPANPERPYFPNGPHLPAKPOLSPMPCNPRIPRTPLW"
          !        + "PRYQATREUROMRUSRWASAUSLBSYCSDNSWESGPSHNSVNSJMSVKSLESMRSENSOMSURSTP"
          !        + "SLVSYRSWZTCATCDATFTGOTHATJKTKLTKMTUNTONTMPTURTTOTUVTWNTZAUKRUGAUMI"
          !        + "USAURYUZBVATVCTVENVGBVIRVNMVUTWLFWSMYEMMYTYUGZAFZMBZARZWE")
          !       .substring(index, index + 3);
              }
            
          !   /**
               * Gets the country name suitable for display to the user, formatted
               * for the default locale.  This has the same effect as
               * 
               * getDisplayLanguage(Locale.getDefault());
               * 
          * ! * @return the language name of this locale localized to the default locale, ! * with the ISO code as backup */ public String getDisplayLanguage() { ! return getDisplayLanguage(defaultLocale); } ! /** * Gets the language name suitable for display to the user, formatted * for a specified locale. + * * @param locale locale to use for formatting ! * @return the language name of this locale localized to the given locale, ! * with the ISO code as backup */ public String getDisplayLanguage(Locale locale) { try { ! ResourceBundle bundle ! = ResourceBundle.getBundle("gnu.java.locale.iso639", locale); ! return bundle.getString(language); } catch (MissingResourceException ex) { ! return language; } } ! /** * Returns the country name of this locale localized to the ! * default locale. If the localized is not found, the ISO code ! * is returned. This has the same effect as *
               * getDisplayCountry(Locale.getDefault());
               * 
          + * + * @return the country name of this locale localized to the given locale, + * with the ISO code as backup */ public String getDisplayCountry() { ! return getDisplayCountry(defaultLocale); } ! /** * Gets the country name suitable for display to the user, formatted * for a specified locale. * * @param locale locale to use for formatting ! * @return the country name of this locale localized to the given locale, ! * with the ISO code as backup ! */ public String getDisplayCountry(Locale locale) { try { ! ResourceBundle bundle = ! ResourceBundle.getBundle("gnu.java.locale.iso3166", locale); ! return bundle.getString(country); } catch (MissingResourceException ex) { ! return country; } } ! /** * Returns the variant name of this locale localized to the ! * default locale. If the localized is not found, the variant code ! * itself is returned. This has the same effect as *
               * getDisplayVariant(Locale.getDefault());
               * 
          + * + * @return the variant code of this locale localized to the given locale, + * with the ISO code as backup */ public String getDisplayVariant() { ! return getDisplayVariant(defaultLocale); } ! /** * Returns the variant name of this locale localized to the ! * given locale. If the localized is not found, the variant code * itself is returned. + * + * @param locale locale to use for formatting + * @return the variant code of this locale localized to the given locale, + * with the ISO code as backup */ public String getDisplayVariant(Locale locale) { ! // XXX - load a bundle? return variant; } /** * Gets all local components suitable for display to the user, formatted ! * for the default locale. For the language component, getDisplayLanguage ! * is called. For the country component, getDisplayCountry is called. * For the variant set component, getDisplayVariant is called. ! * ! *

          The returned String will be one of the following forms:
          *

               * language (country, variant)
               * language (country)
          *************** public final class Locale implements jav
          *** 578,599 ****
               * country
               * variant
               * 
          ! * @return String version of this locale, suitable for display to the ! * user. */ public String getDisplayName() { ! return getDisplayName(getDefault()); } /** * Gets all local components suitable for display to the user, formatted ! * for a specified locale. For the language component, ! * getDisplayLanguage(Locale) is called. For the country component, ! * getDisplayCountry(Locale) is called. For the variant set component, * getDisplayVariant(Locale) is called. ! *

          ! * The returned String will be one of the following forms:
          *
               * language (country, variant)
               * language (country)
          --- 632,653 ----
               * country
               * variant
               * 
          ! * ! * @return String version of this locale, suitable for display to the user */ public String getDisplayName() { ! return getDisplayName(defaultLocale); } /** * Gets all local components suitable for display to the user, formatted ! * for a specified locale. For the language component, ! * getDisplayLanguage(Locale) is called. For the country component, ! * getDisplayCountry(Locale) is called. For the variant set component, * getDisplayVariant(Locale) is called. ! * ! *

          The returned String will be one of the following forms:
          *

               * language (country, variant)
               * language (country)
          *************** public final class Locale implements jav
          *** 605,667 ****
               * 
          * * @param locale locale to use for formatting ! * ! * @return String version of this locale, suitable for display to the ! * user. */ public String getDisplayName(Locale locale) { StringBuffer result = new StringBuffer(); int count = 0; String[] delimiters = {"", " (", ","}; - if (language.length() != 0) { ! result.append(delimiters[count++]); ! result.append(getDisplayLanguage(locale)); } - if (country.length() != 0) { ! result.append(delimiters[count++]); ! result.append(getDisplayCountry(locale)); } - if (variant.length() != 0) { ! result.append(delimiters[count++]); ! result.append(getDisplayVariant(locale)); } - if (count > 1) result.append(")"); - return result.toString(); } /** * Does the same as Object.clone() but does not throw ! * an CloneNotSupportedException. Why anyone would ! * use this method is a secret to me, since this class is ! * immutable. */ public Object clone() { ! try ! { ! return super.clone(); ! } ! catch (CloneNotSupportedException ex) ! { ! return null; ! } } /** ! * Return the hash code for this locale. The hashcode is the logical * xor of the hash codes of the language, the country and the variant. * The hash code is precomputed, since Locales are often * used in hash tables. */ public synchronized int hashCode() { --- 659,711 ---- *
          * * @param locale locale to use for formatting ! * @return String version of this locale, suitable for display to the user */ public String getDisplayName(Locale locale) { StringBuffer result = new StringBuffer(); int count = 0; String[] delimiters = {"", " (", ","}; if (language.length() != 0) { ! result.append(delimiters[count++]); ! result.append(getDisplayLanguage(locale)); } if (country.length() != 0) { ! result.append(delimiters[count++]); ! result.append(getDisplayCountry(locale)); } if (variant.length() != 0) { ! result.append(delimiters[count++]); ! result.append(getDisplayVariant(locale)); } if (count > 1) result.append(")"); return result.toString(); } /** * Does the same as Object.clone() but does not throw ! * a CloneNotSupportedException. Why anyone would ! * use this method is a secret to me, since this class is immutable. ! * ! * @return the clone */ public Object clone() { ! // This class is final, so no need to use native super.clone(). ! return new Locale(language, country, variant); } /** ! * Return the hash code for this locale. The hashcode is the logical * xor of the hash codes of the language, the country and the variant. * The hash code is precomputed, since Locales are often * used in hash tables. + * + * @return the hashcode */ public synchronized int hashCode() { *************** public final class Locale implements jav *** 671,700 **** } /** ! * Compares two locales. ! * @param obj the other locale. ! * @return true, if obj is a Locale with the same language, country, and ! * variant code as this locale, otherwise false. */ public boolean equals(Object obj) { ! if (this == obj) ! return true; ! if (!(obj instanceof Locale)) return false; Locale l = (Locale) obj; return (language.equals(l.language) ! && country.equals(l.country) ! && variant.equals(l.variant)); } /** ! * @serialdata According to jdk1.2 the hashcode should always be ! * written as -1; */ ! private synchronized void writeObject(java.io.ObjectOutputStream output) ! throws java.io.IOException { int tmpHashcode = hashcode; hashcode = -1; output.defaultWriteObject(); --- 715,748 ---- } /** ! * Compares two locales. To be equal, obj must be a Locale with the same ! * language, country, and variant code. ! * ! * @param obj the other locale ! * @return true if obj is equal to this */ public boolean equals(Object obj) { ! if (! (obj instanceof Locale)) return false; Locale l = (Locale) obj; return (language.equals(l.language) ! && country.equals(l.country) ! && variant.equals(l.variant)); } /** ! * Write the locale to an object stream. ! * ! * @param output the stream to write to ! * @throws IOException if the write fails ! * @serialData the hashcode should always be written as -1, and recomputed ! * when reading it back */ ! private synchronized void writeObject(ObjectOutputStream output) ! throws IOException { + // Synchronized so that hashCode() doesn't get wrong value. int tmpHashcode = hashcode; hashcode = -1; output.defaultWriteObject(); *************** public final class Locale implements jav *** 702,714 **** } /** ! * @serialdata According to jdk1.2 the hashCode is always invalid ! * and must be recomputed. */ ! private void readObject(java.io.ObjectInputStream input) ! throws java.io.IOException, ClassNotFoundException { input.defaultReadObject(); hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); } ! } --- 750,766 ---- } /** ! * Reads a locale from the input stream. ! * ! * @param input the stream to read from ! * @throws IOException if reading fails ! * @throws ClassNotFoundException if reading fails ! * @serialData the hashCode is always invalid and must be recomputed */ ! private void readObject(ObjectInputStream input) ! throws IOException, ClassNotFoundException { input.defaultReadObject(); hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); } ! } // class Locale diff -Nrc3pad gcc-3.2.3/libjava/java/util/Map.java gcc-3.3/libjava/java/util/Map.java *** gcc-3.2.3/libjava/java/util/Map.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/Map.java 2002-06-18 15:39:56.000000000 +0000 *************** public interface Map *** 296,309 **** */ public Object setValue(Object value); /** ! * Returns the hash code of the entry. This is defined as the exclusive-or ! * of the hashcodes of the key and value (using 0 for null). In other ! * words, this must be: ! *
          !      *  (getKey() == null ? 0 : getKey().hashCode()) ^
          !      *  (getValue() == null ? 0 : getValue().hashCode())
          !      * 
          * * @return the hash code */ --- 296,309 ---- */ public Object setValue(Object value); + /** ! * Returns the hash code of the entry. This is defined as the ! * exclusive-or of the hashcodes of the key and value (using 0 for ! * null). In other words, this must be: ! * !

          (getKey() == null ? 0 : getKey().hashCode())
          ! ^ (getValue() == null ? 0 : getValue().hashCode())
          * * @return the hash code */ *************** public interface Map *** 313,328 **** * Compares the specified object with this entry. Returns true only if * the object is a mapping of identical key and value. In other words, * this must be: ! *
          !      * (o instanceof Map.Entry)
          !      * && (getKey() == null ? ((HashMap) o).getKey() == null
          !      *                      : getKey().equals(((HashMap) o).getKey()))
          !      * && (getValue() == null ? ((HashMap) o).getValue() == null
          !      *                        : getValue().equals(((HashMap) o).getValue()))
          !      * 
          * * @param o the object to compare ! * @return true if it is equal */ public boolean equals(Object o); } --- 313,328 ---- * Compares the specified object with this entry. Returns true only if * the object is a mapping of identical key and value. In other words, * this must be: ! * !

          (o instanceof Map.Entry)
          ! && (getKey() == null ? ((HashMap) o).getKey() == null
          !                      : getKey().equals(((HashMap) o).getKey()))
          ! && (getValue() == null ? ((HashMap) o).getValue() == null
          !                        : getValue().equals(((HashMap) o).getValue()))
          * * @param o the object to compare ! * ! * @return true if it is equal */ public boolean equals(Object o); } diff -Nrc3pad gcc-3.2.3/libjava/java/util/MissingResourceException.java gcc-3.3/libjava/java/util/MissingResourceException.java *** gcc-3.2.3/libjava/java/util/MissingResourceException.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/MissingResourceException.java 2002-06-16 21:15:42.000000000 +0000 *************** *** 1,5 **** ! /* java.util.MissingResourceException ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* MissingResourceException.java -- thrown for a missing resource ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,75 **** package java.util; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * This exception is thrown when a resource is missing. * - * @see ResourceBundle * @author Jochen Hoenicke * @author Warren Levy */ public class MissingResourceException extends RuntimeException { private static final long serialVersionUID = -4876345176062000401L; /** * The name of the resource bundle requested by user. */ ! private String className; /** * The key of the resource in the bundle requested by user. */ ! private String key; /** * Creates a new exception, with the specified parameters. ! * @param s the detail message. ! * @param className the name of the resource bundle. ! * @param key the key of the missing resource. */ public MissingResourceException(String s, String className, String key) { --- 38,79 ---- package java.util; /** * This exception is thrown when a resource is missing. * * @author Jochen Hoenicke * @author Warren Levy + * @see ResourceBundle + * @since 1.1 + * @status updated to 1.4 */ public class MissingResourceException extends RuntimeException { + /** + * Compatible with JDK 1.1+. + */ private static final long serialVersionUID = -4876345176062000401L; /** * The name of the resource bundle requested by user. + * + * @serial the class name of the resource bundle */ ! private final String className; /** * The key of the resource in the bundle requested by user. + * + * @serial the name of the resouce */ ! private final String key; /** * Creates a new exception, with the specified parameters. ! * ! * @param s the detail message ! * @param className the name of the resource bundle ! * @param key the key of the missing resource */ public MissingResourceException(String s, String className, String key) { *************** public class MissingResourceException ex *** 80,86 **** /** * Gets the name of the resource bundle, for which a resource is missing. ! * @return the name of the resource bundle. */ public String getClassName() { --- 84,91 ---- /** * Gets the name of the resource bundle, for which a resource is missing. ! * ! * @return the name of the resource bundle */ public String getClassName() { *************** public class MissingResourceException ex *** 90,96 **** /** * Gets the key of the resource that is missing bundle, this is an empty * string if the whole resource bundle is missing. ! * @return the name of the resource bundle. */ public String getKey() { --- 95,102 ---- /** * Gets the key of the resource that is missing bundle, this is an empty * string if the whole resource bundle is missing. ! * ! * @return the name of the resource bundle */ public String getKey() { diff -Nrc3pad gcc-3.2.3/libjava/java/util/natResourceBundle.cc gcc-3.3/libjava/java/util/natResourceBundle.cc *** gcc-3.2.3/libjava/java/util/natResourceBundle.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/util/natResourceBundle.cc 2003-01-21 21:17:02.000000000 +0000 *************** *** 0 **** --- 1,42 ---- + /* Copyright (C) 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + // Written by Tom Tromey + + #include + + #include + #include + #include + #include + #include + #include + #include + #include + + java::lang::ClassLoader * + java::util::ResourceBundle::getCallingClassLoader () + { + gnu::gcj::runtime::StackTrace *t = new gnu::gcj::runtime::StackTrace(6); + try + { + /* Frame 0 is this method, frame 1 is getBundle, so starting at + frame 2 we might see the user's class. FIXME: should account + for reflection, JNI, etc, here. */ + for (int i = 2; ; ++i) + { + jclass klass = t->classAt(i); + if (klass != NULL) + return klass->getClassLoaderInternal(); + } + } + catch (::java::lang::ArrayIndexOutOfBoundsException *e) + { + } + return NULL; + } diff -Nrc3pad gcc-3.2.3/libjava/java/util/natTimeZone.cc gcc-3.3/libjava/java/util/natTimeZone.cc *** gcc-3.2.3/libjava/java/util/natTimeZone.cc 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/util/natTimeZone.cc 2003-02-19 16:27:22.000000000 +0000 *************** *** 0 **** --- 1,170 ---- + // natTimeZone.cc -- Native side of TimeZone class. + + /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #include + #include + + #include + #include + + #include + #include + #include + + #include + + #if TIME_WITH_SYS_TIME + # include + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + + #include + + /* + * This method returns a time zone string that is used by init_properties + * to set the default timezone property 'user.timezone'. That value is + * used by default as a key into the timezone table used by the + * java::util::TimeZone class. + */ + static jstring + getSystemTimeZone (void) + { + struct tm *tim; + time_t current_time; + long tzoffset; + const char *tz1, *tz2; + char *tzid; + + current_time = time(0); + + mktime(tim = localtime(¤t_time)); + #ifdef STRUCT_TM_HAS_GMTOFF + // tm_gmtoff is secs EAST of UTC. + tzoffset = -(tim->tm_gmtoff) + tim->tm_isdst * 3600L; + #elif HAVE_UNDERSCORE_TIMEZONE + tzoffset = _timezone; + #elif HAVE_TIMEZONE + // timezone is secs WEST of UTC. + tzoffset = timezone; + #else + // FIXME: there must be another global if neither tm_gmtoff nor timezone + // is available, esp. if tzname is valid. + // Richard Earnshaw has suggested using difftime to + // calculate between gmtime and localtime (and accounting for possible + // daylight savings time) as an alternative. + tzoffset = 0L; + #endif + + #ifdef HAVE_TM_ZONE + tz1 = tim->tm_zone; + tz2 = ""; + #elif defined (HAVE_TZNAME) + tz1 = tzname[0]; + tz2 = strcmp (tzname[0], tzname[1]) ? tzname[1] : ""; + #else + // Some targets have no concept of timezones. + tz1 = "???"; + tz2 = tz1; + #endif + + if ((tzoffset % 3600) == 0) + tzoffset = tzoffset / 3600; + + tzid = (char*) _Jv_Malloc (strlen(tz1) + strlen(tz2) + 6); + sprintf(tzid, "%s%ld%s", tz1, tzoffset, tz2); + jstring retval = JvNewStringUTF (tzid); + _Jv_Free (tzid); + + return retval; + } + + // Get the System Timezone as reported by the OS. It should be in + // the form PST8PDT so we'll need to parse it and check that it's valid. + // FIXME: Using the code from Classpath for generating the System + // Timezone IMO is suboptimal because it ignores whether the rules for + // DST match up. + jstring + java::util::TimeZone::getDefaultTimeZoneId () + { + jstring sysTimeZoneId = getSystemTimeZone (); + + using namespace java::lang; + + // Check if this is a valid timezone. Make sure the IDs match + // since getTimeZone returns GMT if no match is found. + TimeZone *tz = TimeZone::getTimeZone (sysTimeZoneId); + if (tz->getID ()->equals (sysTimeZoneId)) + return sysTimeZoneId; + + // Check if the base part of sysTimeZoneId is a valid timezone that + // matches with daylight usage and rawOffset. Make sure the IDs match + // since getTimeZone returns GMT if no match is found. + // First find start of GMT offset info and any Daylight zone name. + int startGMToffset = 0; + int sysTimeZoneIdLength = sysTimeZoneId->length(); + for (int i = 0; i < sysTimeZoneIdLength && startGMToffset == 0; i++) + { + if (Character::isDigit (sysTimeZoneId->charAt (i))) + startGMToffset = i; + } + + int startDaylightZoneName = 0; + jboolean usesDaylight = false; + for (int i = sysTimeZoneIdLength - 1; + i >= 0 && !Character::isDigit (sysTimeZoneId->charAt (i)); --i) + { + startDaylightZoneName = i; + } + if (startDaylightZoneName > 0) + usesDaylight = true; + + int GMToffset + = Integer::parseInt (startDaylightZoneName == 0 ? + sysTimeZoneId->substring (startGMToffset) : + sysTimeZoneId->substring (startGMToffset, + startDaylightZoneName)); + + // Offset could be in hours or seconds. Convert to millis. + if (GMToffset < 24) + GMToffset *= 60 * 60; + GMToffset *= -1000; + + jstring tzBasename = sysTimeZoneId->substring (0, startGMToffset); + tz = TimeZone::getTimeZone (tzBasename); + if (tz->getID ()->equals (tzBasename) && tz->getRawOffset () == GMToffset) + { + jboolean tzUsesDaylight = tz->useDaylightTime (); + if (usesDaylight && tzUsesDaylight || !usesDaylight && !tzUsesDaylight) + return tzBasename; + } + + // If no match, see if a valid timezone has the same attributes as this + // and then use it instead. + jstringArray IDs = TimeZone::getAvailableIDs (GMToffset); + jstring *elts = elements (IDs); + for (int i = 0; i < IDs->length; ++i) + { + // FIXME: The daylight savings rules may not match the rules + // for the desired zone. + jboolean IDusesDaylight = + TimeZone::getTimeZone (elts[i])->useDaylightTime (); + if (usesDaylight && IDusesDaylight || !usesDaylight && !IDusesDaylight) + return elts[i]; + } + + // If all else fails, return null. + return NULL; + } diff -Nrc3pad gcc-3.2.3/libjava/java/util/Observable.java gcc-3.3/libjava/java/util/Observable.java *** gcc-3.2.3/libjava/java/util/Observable.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/Observable.java 2002-06-18 15:39:56.000000000 +0000 *************** *** 1,5 **** ! /* java.util.Observable ! Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Observable.java -- an object to be observed ! Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,92 **** package java.util; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * @author Warren Levy ! * @date September 2, 1998. */ public class Observable { ! /** tracks whether this object has changed */ private boolean changed; ! /* list of the Observers registered as interested in this Observable */ ! private Vector observers; ! ! /* TBD: This might be better implemented as an Observer[] ! * but that would mean writing more code rather than making use of ! * the existing Vector class (this also implies a larger text code ! * space in resulting executables). The tradeoff is one of speed ! * (manipulating the Observer[] directly) vs. size/reuse. In the future, ! * we may decide to make the tradeoff and reimplement with an Observer[]. ! */ /** * Constructs an Observable with zero Observers. */ public Observable() { ! changed = false; ! observers = new Vector(); } /** * Adds an Observer. If the observer was already added this method does * nothing. * ! * @param observer Observer to add. */ public synchronized void addObserver(Observer observer) { ! if (!observers.contains(observer)) ! observers.addElement(observer); } /** ! * Reset this Observable's state to unchanged. */ protected synchronized void clearChanged() { --- 38,90 ---- package java.util; /** + * This class represents an object which is observable. Other objects may + * register their intent to be notified when this object changes; and when + * this object does change, it will trigger the update method + * of each observer. + * + * Note that the notifyObservers() method of this class is + * unrelated to the notify() of Object. + * * @author Warren Levy ! * @author Eric Blake ! * @see Observer ! * @status updated to 1.4 */ public class Observable { ! /** Tracks whether this object has changed. */ private boolean changed; ! /* List of the Observers registered as interested in this Observable. */ ! private LinkedHashSet observers; /** * Constructs an Observable with zero Observers. */ public Observable() { ! observers = new LinkedHashSet(); } /** * Adds an Observer. If the observer was already added this method does * nothing. * ! * @param observer Observer to add ! * @throws NullPointerException if observer is null */ public synchronized void addObserver(Observer observer) { ! observers.add(observer); } /** ! * Reset this Observable's state to unchanged. This is called automatically ! * by notifyObservers once all observers have been notified. ! * ! * @see #notifyObservers() */ protected synchronized void clearChanged() { *************** public class Observable *** 94,100 **** } /** ! * @return Number of Observers for this Observable. */ public synchronized int countObservers() { --- 92,100 ---- } /** ! * Returns the number of observers for this object. ! * ! * @return number of Observers for this */ public synchronized int countObservers() { *************** public class Observable *** 104,114 **** /** * Deletes an Observer of this Observable. * ! * @param victim Observer to delete. */ public synchronized void deleteObserver(Observer victim) { ! observers.removeElement(victim); } /** --- 104,114 ---- /** * Deletes an Observer of this Observable. * ! * @param victim Observer to delete */ public synchronized void deleteObserver(Observer victim) { ! observers.remove(victim); } /** *************** public class Observable *** 116,126 **** */ public synchronized void deleteObservers() { ! observers.removeAllElements(); } /** ! * @return Whether or not this Observable has changed. */ public synchronized boolean hasChanged() { --- 116,129 ---- */ public synchronized void deleteObservers() { ! observers.clear(); } /** ! * True if setChanged has been called more recently than ! * clearChanged. ! * ! * @return whether or not this Observable has changed */ public synchronized boolean hasChanged() { *************** public class Observable *** 129,135 **** /** * If the Observable has actually changed then tell all Observers about it, ! * then resets state to unchanged. */ public void notifyObservers() { --- 132,141 ---- /** * If the Observable has actually changed then tell all Observers about it, ! * then reset state to unchanged. ! * ! * @see #notifyObservers(Object) ! * @see Observer#update(Observable, Object) */ public void notifyObservers() { *************** public class Observable *** 138,158 **** /** * If the Observable has actually changed then tell all Observers about it, ! * then resets state to unchanged. ! * Note that though the order of notification is unspecified in subclasses, ! * in Observable it is in the order of registration. * ! * @param obj Arguement to Observer's update method. */ public void notifyObservers(Object obj) { ! if (!hasChanged()) return; ! Vector ob1 = (Vector) observers.clone(); ! ! for (int i = 0; i < ob1.size(); i++) ! ((Observer) ob1.elementAt(i)).update(this, obj); ! clearChanged(); } --- 144,172 ---- /** * If the Observable has actually changed then tell all Observers about it, ! * then reset state to unchanged. Note that though the order of ! * notification is unspecified in subclasses, in Observable it is in the ! * order of registration. * ! * @param obj argument to Observer's update method ! * @see Observer#update(Observable, Object) */ public void notifyObservers(Object obj) { ! if (! hasChanged()) return; ! // Create clone inside monitor, as that is relatively fast and still ! // important to keep threadsafe, but update observers outside of the ! // lock since update() can call arbitrary code. ! Set s; ! synchronized (this) ! { ! s = (Set) observers.clone(); ! } ! int i = s.size(); ! Iterator iter = s.iterator(); ! while (--i >= 0) ! ((Observer) iter.next()).update(this, obj); clearChanged(); } diff -Nrc3pad gcc-3.2.3/libjava/java/util/Observer.java gcc-3.3/libjava/java/util/Observer.java *** gcc-3.2.3/libjava/java/util/Observer.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/Observer.java 2002-06-16 21:15:42.000000000 +0000 *************** *** 1,6 **** ! /* Implemented when a class wants to be informed of changes in Observable ! objects. ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Observer.java -- an object that will be informed of changes in an Observable ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,59 **** package java.util; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct - */ - /** * Interface that is implemented when a class wants to be informed of changes * in Observable objects. * - * @see java.util.Observable * @author Warren Levy ! * @date August 25, 1998. */ public interface Observer { public void update(Observable observable, Object arg); } --- 38,60 ---- package java.util; /** * Interface that is implemented when a class wants to be informed of changes * in Observable objects. * * @author Warren Levy ! * @see Observable ! * @status updated to 1.4 */ public interface Observer { + /** + * This method is called whenever the observable object changes, and has + * called notifyObservers. The Observable object can pass + * arbitrary information in the second parameter. + * + * @param observable the Observable object that changed + * @param arg arbitrary information, usually relating to the change + */ public void update(Observable observable, Object arg); } diff -Nrc3pad gcc-3.2.3/libjava/java/util/Properties.java gcc-3.3/libjava/java/util/Properties.java *** gcc-3.2.3/libjava/java/util/Properties.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/Properties.java 2003-03-02 22:37:01.000000000 +0000 *************** *** 1,5 **** ! /* java.util.Properties ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Properties.java -- a set of persistent properties ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,100 **** package java.util; ! import java.io.*; /** * An example of a properties file for the german language is given * here. This extends the example given in ListResourceBundle. * Create a file MyResource_de.properties with the following contents * and put it in the CLASSPATH. (The character * \u00e4 is the german ä) * ! *
          !  * s1=3
          !  * s2=MeineDisk
          !  * s3=3. M\u00e4rz 96
          !  * s4=Die Diskette ''{1}'' enth\u00e4lt {0} in {2}.
          !  * s5=0
          !  * s6=keine Dateien
          !  * s7=1
          !  * s8=eine Datei
          !  * s9=2
          !  * s10={0,number} Dateien
          !  * s11=Das Formatieren schlug fehl mit folgender Exception: {0}
          !  * s12=FEHLER
          !  * s13=Ergebnis
          !  * s14=Dialog
          !  * s15=Auswahlkriterium
          !  * s16=1,3
          !  * 
          * ! * Although this is a sub class of a hash table, you should never * insert anything other than strings to this property, or several * methods, that need string keys and values, will fail. To ensure * this, you should use the get/setProperty method instead * of get/put. * ! * @see PropertyResourceBundle * @author Jochen Hoenicke */ public class Properties extends Hashtable { /** * The property list that contains default values for any keys not ! * in this property list. */ protected Properties defaults; private static final long serialVersionUID = 4112578634029874840L; /** ! * Creates a new empty property list. */ public Properties() { - this.defaults = null; } /** * Create a new empty property list with the specified default values. ! * @param defaults a Properties object containing the default values. */ public Properties(Properties defaults) { --- 37,124 ---- package java.util; ! ! import java.io.IOException; ! import java.io.InputStream; ! import java.io.BufferedReader; ! import java.io.InputStreamReader; ! import java.io.OutputStream; ! import java.io.PrintWriter; ! import java.io.PrintStream; ! import java.io.OutputStreamWriter; /** + * A set of persistent properties, which can be saved or loaded from a stream. + * A property list may also contain defaults, searched if the main list + * does not contain a property for a given key. + * * An example of a properties file for the german language is given * here. This extends the example given in ListResourceBundle. * Create a file MyResource_de.properties with the following contents * and put it in the CLASSPATH. (The character * \u00e4 is the german ä) + * * !
          s1=3
          ! s2=MeineDisk
          ! s3=3. M\u00e4rz 96
          ! s4=Die Diskette ''{1}'' enth\u00e4lt {0} in {2}.
          ! s5=0
          ! s6=keine Dateien
          ! s7=1
          ! s8=eine Datei
          ! s9=2
          ! s10={0,number} Dateien
          ! s11=Das Formatieren schlug fehl mit folgender Exception: {0}
          ! s12=FEHLER
          ! s13=Ergebnis
          ! s14=Dialog
          ! s15=Auswahlkriterium
          ! s16=1,3
          * ! *

          Although this is a sub class of a hash table, you should never * insert anything other than strings to this property, or several * methods, that need string keys and values, will fail. To ensure * this, you should use the get/setProperty method instead * of get/put. * ! * Properties are saved in ISO 8859-1 encoding, using Unicode escapes with ! * a single u for any character which cannot be represented. ! * * @author Jochen Hoenicke + * @author Eric Blake + * @see PropertyResourceBundle + * @status updated to 1.4 */ public class Properties extends Hashtable { + // WARNING: Properties is a CORE class in the bootstrap cycle. See the + // comments in vm/reference/java/lang/Runtime for implications of this fact. + /** * The property list that contains default values for any keys not ! * in this property list. ! * ! * @serial the default properties */ protected Properties defaults; + /** + * Compatible with JDK 1.0+. + */ private static final long serialVersionUID = 4112578634029874840L; /** ! * Creates a new empty property list with no default values. */ public Properties() { } /** * Create a new empty property list with the specified default values. ! * ! * @param defaults a Properties object containing the default values */ public Properties(Properties defaults) { *************** public class Properties extends Hashtabl *** 102,107 **** --- 126,146 ---- } /** + * Adds the given key/value pair to this properties. This calls + * the hashtable method put. + * + * @param key the key for this property + * @param value the value for this property + * @return The old value for the given key + * @see #getProperty(String) + * @since 1.2 + */ + public Object setProperty(String key, String value) + { + return put(key, value); + } + + /** * Reads a property list from an input stream. The stream should * have the following format:
          * *************** public class Properties extends Hashtabl *** 120,292 **** * * Escape sequences \t, \n, \r, \\, \", \', \!, \#, \ (a * space), and unicode characters with the ! * \uxxxx notation are detected, and * converted to the corresponding single character.
          * ! *

          !    * # This is a comment
          !    * key     = value
          !    * k\:5      \ a string starting with space and ending with newline\n
          !    * # This is a multiline specification; note that the value contains
          !    * # no white space.
          !    * weekdays: Sunday,Monday,Tuesday,Wednesday,\
          !    *           Thursday,Friday,Saturday
          !    * # The safest way to include a space at the end of a value:
          !    * label   = Name:\u0020
          !    * 
          * * @param in the input stream ! * @exception IOException if an error occurred when reading ! * from the input. */ public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; ! while ((line = reader.readLine()) != null) { ! char c = 0; ! int pos = 0; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! // If line is empty or begins with a comment character, ! // skip this line. ! if (pos == line.length() || c == '#' || c == '!') ! continue; ! // The characters up to the next Whitespace, ':', or '=' ! // describe the key. But look for escape sequences. ! StringBuffer key = new StringBuffer(); ! while (pos < line.length() ! && !Character.isWhitespace(c = line.charAt(pos++)) ! && c != '=' && c != ':') ! { ! if (c == '\\') ! { ! if (pos == line.length()) ! { ! // The line continues on the next line. ! line = reader.readLine(); ! pos = 0; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! } ! else ! { ! c = line.charAt(pos++); ! switch (c) ! { ! case 'n': ! key.append('\n'); ! break; ! case 't': ! key.append('\t'); ! break; ! case 'r': ! key.append('\r'); ! break; ! case 'u': ! if (pos + 4 <= line.length()) ! { ! char uni = (char) Integer.parseInt ! (line.substring(pos, pos + 4), 16); ! key.append(uni); ! pos += 4; ! } // else throw exception? ! break; ! default: ! key.append(c); ! break; ! } ! } ! } ! else ! key.append(c); ! } ! boolean isDelim = (c == ':' || c == '='); ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! if (!isDelim && (c == ':' || c == '=')) ! { ! pos++; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! } ! StringBuffer element = new StringBuffer(line.length() - pos); ! while (pos < line.length()) ! { ! c = line.charAt(pos++); ! if (c == '\\') ! { ! if (pos == line.length()) ! { ! // The line continues on the next line. ! line = reader.readLine(); ! pos = 0; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! element.ensureCapacity(line.length() - pos + ! element.length()); ! } ! else ! { ! c = line.charAt(pos++); ! switch (c) ! { ! case 'n': ! element.append('\n'); ! break; ! case 't': ! element.append('\t'); ! break; ! case 'r': ! element.append('\r'); ! break; ! case 'u': ! if (pos + 4 <= line.length()) ! { ! char uni = (char) Integer.parseInt ! (line.substring(pos, pos + 4), 16); ! element.append(uni); ! pos += 4; ! } // else throw exception? ! break; ! default: ! element.append(c); ! break; ! } ! } ! } ! else ! element.append(c); ! } ! put(key.toString(), element.toString()); } } /** * Calls store(OutputStream out, String header) and * ignores the IOException that may be thrown. ! * @deprecated use store instead. ! * @exception ClassCastException if this property contains any key or ! * value that isn't a string. */ public void save(OutputStream out, String header) { try { ! store(out, header); } catch (IOException ex) { --- 159,345 ---- * * Escape sequences \t, \n, \r, \\, \", \', \!, \#, \ (a * space), and unicode characters with the ! * \\uxxxx notation are detected, and * converted to the corresponding single character.
          * ! * !
          # This is a comment
          ! key     = value
          ! k\:5      \ a string starting with space and ending with newline\n
          ! # This is a multiline specification; note that the value contains
          ! # no white space.
          ! weekdays: Sunday,Monday,Tuesday,Wednesday,\\
          !           Thursday,Friday,Saturday
          ! # The safest way to include a space at the end of a value:
          ! label   = Name:\\u0020
          * * @param in the input stream ! * @throws IOException if an error occurred when reading the input ! * @throws NullPointerException if in is null ! */ public void load(InputStream inStream) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); String line; ! while ((line = reader.readLine()) != null) { ! char c = 0; ! int pos = 0; ! // If empty line or begins with a comment character, skip this line. ! if (line.length() == 0 ! || line.charAt(0) == '#' || line.charAt(0) == '!') ! continue; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! // If line is empty skip this line. ! if (pos == line.length()) ! continue; ! // The characters up to the next Whitespace, ':', or '=' ! // describe the key. But look for escape sequences. ! StringBuffer key = new StringBuffer(); ! while (pos < line.length() ! && ! Character.isWhitespace(c = line.charAt(pos++)) ! && c != '=' && c != ':') ! { ! if (c == '\\') ! { ! if (pos == line.length()) ! { ! // The line continues on the next line. ! line = reader.readLine(); ! pos = 0; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! } ! else ! { ! c = line.charAt(pos++); ! switch (c) ! { ! case 'n': ! key.append('\n'); ! break; ! case 't': ! key.append('\t'); ! break; ! case 'r': ! key.append('\r'); ! break; ! case 'u': ! if (pos + 4 <= line.length()) ! { ! char uni = (char) Integer.parseInt ! (line.substring(pos, pos + 4), 16); ! key.append(uni); ! pos += 4; ! } // else throw exception? ! break; ! default: ! key.append(c); ! break; ! } ! } ! } ! else ! key.append(c); ! } ! boolean isDelim = (c == ':' || c == '='); ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! if (! isDelim && (c == ':' || c == '=')) ! { ! pos++; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! } ! ! StringBuffer element = new StringBuffer(line.length() - pos); ! while (pos < line.length()) ! { ! c = line.charAt(pos++); ! if (c == '\\') ! { ! if (pos == line.length()) ! { ! // The line continues on the next line. ! line = reader.readLine(); ! ! // We might have seen a backslash at the end of ! // the file. The JDK ignores the backslash in ! // this case, so we follow for compatibility. ! if (line == null) ! break; ! ! pos = 0; ! while (pos < line.length() ! && Character.isWhitespace(c = line.charAt(pos))) ! pos++; ! element.ensureCapacity(line.length() - pos + ! element.length()); ! } ! else ! { ! c = line.charAt(pos++); ! switch (c) ! { ! case 'n': ! element.append('\n'); ! break; ! case 't': ! element.append('\t'); ! break; ! case 'r': ! element.append('\r'); ! break; ! case 'u': ! if (pos + 4 <= line.length()) ! { ! char uni = (char) Integer.parseInt ! (line.substring(pos, pos + 4), 16); ! element.append(uni); ! pos += 4; ! } // else throw exception? ! break; ! default: ! element.append(c); ! break; ! } ! } ! } ! else ! element.append(c); ! } ! put(key.toString(), element.toString()); } } /** * Calls store(OutputStream out, String header) and * ignores the IOException that may be thrown. ! * ! * @param out the stream to write to ! * @param header a description of the property list ! * @throws ClassCastException if this property contains any key or ! * value that are not strings ! * @deprecated use {@link #store(OutputStream, String)} instead */ public void save(OutputStream out, String header) { try { ! store(out, header); } catch (IOException ex) { *************** public class Properties extends Hashtabl *** 294,306 **** } /** ! * Writes the key/value pairs to the given output stream.
          * * If header is not null, this method writes a comment containing * the header as first line to the stream. The next line (or first * line if header is null) contains a comment with the current date. * Afterwards the key/value pairs are written to the stream in the ! * following format.
          * * Each line has the form key = value. Newlines, * Returns and tabs are written as \n,\t,\r resp. --- 347,360 ---- } /** ! * Writes the key/value pairs to the given output stream, in a format ! * suitable for load.
          * * If header is not null, this method writes a comment containing * the header as first line to the stream. The next line (or first * line if header is null) contains a comment with the current date. * Afterwards the key/value pairs are written to the stream in the ! * following format.
          * * Each line has the form key = value. Newlines, * Returns and tabs are written as \n,\t,\r resp. *************** public class Properties extends Hashtabl *** 308,354 **** * preceeded by a backslash. Spaces are preceded with a backslash, * if and only if they are at the beginning of the key. Characters * that are not in the ascii range 33 to 127 are written in the ! * \uxxxx Form. * * @param out the output stream ! * @param header the header written in the first line, may be null. ! * @exception ClassCastException if this property contains any key or ! * value that isn't a string. */ public void store(OutputStream out, String header) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. PrintWriter writer ! = new PrintWriter(new OutputStreamWriter (out, "ISO-8859-1")); if (header != null) writer.println("#" + header); ! writer.println("#" + new Date().toString()); ! list(writer); ! writer.flush(); ! } ! /** ! * Adds the given key/value pair to this properties. This calls ! * the hashtable method put. ! * @param key the key for this property ! * @param value the value for this property ! * @return The old value for the given key. ! * @since JDK1.2 */ ! public Object setProperty(String key, String value) ! { ! return put(key, value); } /** * Gets the property with the specified key in this property list. * If the key is not found, the default property list is searched. ! * If the property is not found in default or the default of ! * default, null is returned. ! * @param key The key for this property. ! * @param defaulValue A default value ! * @return The value for the given key, or null if not found. ! * @exception ClassCastException if this property contains any key or ! * value that isn't a string. */ public String getProperty(String key) { --- 362,415 ---- * preceeded by a backslash. Spaces are preceded with a backslash, * if and only if they are at the beginning of the key. Characters * that are not in the ascii range 33 to 127 are written in the ! * \uxxxx Form.
          ! * ! * Following the listing, the output stream is flushed but left open. * * @param out the output stream ! * @param header the header written in the first line, may be null ! * @throws ClassCastException if this property contains any key or ! * value that isn't a string ! * @throws IOException if writing to the stream fails ! * @throws NullPointerException if out is null ! * @since 1.2 */ public void store(OutputStream out, String header) throws IOException { // The spec says that the file must be encoded using ISO-8859-1. PrintWriter writer ! = new PrintWriter(new OutputStreamWriter(out, "ISO-8859-1")); if (header != null) writer.println("#" + header); ! writer.println ("#" + Calendar.getInstance ().getTime ()); ! ! Iterator iter = entrySet ().iterator (); ! int i = size (); ! StringBuffer s = new StringBuffer (); // Reuse the same buffer. ! while (--i >= 0) ! { ! Map.Entry entry = (Map.Entry) iter.next (); ! formatForOutput ((String) entry.getKey (), s, true); ! s.append ('='); ! formatForOutput ((String) entry.getValue (), s, false); ! writer.println (s); ! } ! writer.flush (); } /** * Gets the property with the specified key in this property list. * If the key is not found, the default property list is searched. ! * If the property is not found in the default, null is returned. ! * ! * @param key The key for this property ! * @return the value for the given key, or null if not found ! * @throws ClassCastException if this property contains any key or ! * value that isn't a string ! * @see #defaults ! * @see #setProperty(String, String) ! * @see #getProperty(String, String) */ public String getProperty(String key) { *************** public class Properties extends Hashtabl *** 358,370 **** /** * Gets the property with the specified key in this property list. If * the key is not found, the default property list is searched. If the ! * property is not found in default or the default of default, the ! * specified defaultValue is returned. ! * @param key The key for this property. ! * @param defaulValue A default value ! * @return The value for the given key. ! * @exception ClassCastException if this property contains any key or ! * value that isn't a string. */ public String getProperty(String key, String defaultValue) { --- 419,434 ---- /** * Gets the property with the specified key in this property list. If * the key is not found, the default property list is searched. If the ! * property is not found in the default, the specified defaultValue is ! * returned. ! * ! * @param key The key for this property ! * @param defaultValue A default value ! * @return The value for the given key ! * @throws ClassCastException if this property contains any key or ! * value that isn't a string ! * @see #defaults ! * @see #setProperty(String, String) */ public String getProperty(String key, String defaultValue) { *************** public class Properties extends Hashtabl *** 372,555 **** // Eliminate tail recursion. do { ! String value = (String) prop.get(key); ! if (value != null) ! return value; ! prop = prop.defaults; } while (prop != null); return defaultValue; } - private final void addHashEntries(Hashtable base) - { - if (defaults != null) - defaults.addHashEntries(base); - Enumeration keys = keys(); - while (keys.hasMoreElements()) - base.put(keys.nextElement(), base); - } - /** * Returns an enumeration of all keys in this property list, including * the keys in the default property list. */ public Enumeration propertyNames() { ! // We make a new Hashtable that holds all the keys. Then we ! // return an enumeration for this hash. We do this because we ! // don't want modifications to be reflected in the enumeration ! // (per JCL), and because there doesn't seem to be a ! // particularly better way to ensure that duplicates are ! // ignored. ! Hashtable t = new Hashtable(); ! addHashEntries(t); ! return t.keys(); } /** ! * Formats a key/value pair for output in a properties file. ! * See store for a description of the format. ! * @param key the key. ! * @param value the value. ! * @see #store */ ! private String formatForOutput(String key, String value) { ! // This is a simple approximation of the expected line size. ! StringBuffer result = ! new StringBuffer(key.length() + value.length() + 16); ! boolean head = true; ! for (int i = 0; i < key.length(); i++) ! { ! char c = key.charAt(i); ! switch (c) ! { ! case '\n': ! result.append("\\n"); ! break; ! case '\r': ! result.append("\\r"); ! break; ! case '\t': ! result.append("\\t"); ! break; ! case '\\': ! result.append("\\\\"); ! break; ! case '!': ! result.append("\\!"); ! break; ! case '#': ! result.append("\\#"); ! break; ! case '=': ! result.append("\\="); ! break; ! case ':': ! result.append("\\:"); ! break; ! case ' ': ! result.append("\\ "); ! break; ! default: ! if (c < 32 || c > '~') ! { ! String hex = Integer.toHexString(c); ! result.append("\\u0000".substring(0, 6 - hex.length())); ! result.append(hex); ! } ! else ! result.append(c); ! } ! if (c != 32) ! head = false; ! } ! result.append('='); ! head = true; ! for (int i = 0; i < value.length(); i++) ! { ! char c = value.charAt(i); ! switch (c) ! { ! case '\n': ! result.append("\\n"); ! break; ! case '\r': ! result.append("\\r"); ! break; ! case '\t': ! result.append("\\t"); ! break; ! case '\\': ! result.append("\\\\"); ! break; ! case '!': ! result.append("\\!"); ! break; ! case '#': ! result.append("\\#"); ! break; ! case ' ': ! result.append(head ? "\\ " : " "); ! break; ! default: ! if (c < 32 || c > '~') ! { ! String hex = Integer.toHexString(c); ! result.append("\\u0000".substring(0, 6 - hex.length())); ! result.append(hex); ! } ! else ! result.append(c); ! } ! if (c != 32) ! head = false; ! } ! return result.toString(); } /** ! * Writes the key/value pairs to the given print stream. They are ! * written in the way, described in the method store. ! * @param out the stream, where the key/value pairs are written to. ! * @exception ClassCastException if this property contains any key or ! * value that isn't a string. ! * @see #store */ ! public void list(PrintStream out) { ! Enumeration keys = keys(); ! Enumeration elts = elements(); ! while (keys.hasMoreElements()) { ! String key = (String) keys.nextElement(); ! String elt = (String) elts.nextElement(); ! String output = formatForOutput(key, elt); ! out.println(output); } } /** ! * Writes the key/value pairs to the given print writer. They are ! * written in the way, described in the method store. ! * @param out the writer, where the key/value pairs are written to. ! * @exception ClassCastException if this property contains any key or ! * value that isn't a string. ! * @see #store ! * @see #list(java.io.PrintStream) ! * @since JDK1.1 */ ! public void list(PrintWriter out) { ! Enumeration keys = keys(); ! Enumeration elts = elements(); ! while (keys.hasMoreElements()) { ! String key = (String) keys.nextElement(); ! String elt = (String) elts.nextElement(); ! String output = formatForOutput(key, elt); ! out.println(output); } } ! } --- 436,577 ---- // Eliminate tail recursion. do { ! String value = (String) prop.get(key); ! if (value != null) ! return value; ! prop = prop.defaults; } while (prop != null); return defaultValue; } /** * Returns an enumeration of all keys in this property list, including * the keys in the default property list. + * + * @return an Enumeration of all defined keys */ public Enumeration propertyNames() { ! // We make a new Set that holds all the keys, then return an enumeration ! // for that. This prevents modifications from ruining the enumeration, ! // as well as ignoring duplicates. ! Properties prop = this; ! Set s = new HashSet(); ! // Eliminate tail recursion. ! do ! { ! s.addAll(prop.keySet()); ! prop = prop.defaults; ! } ! while (prop != null); ! return Collections.enumeration(s); } /** ! * Prints the key/value pairs to the given print stream. This is ! * mainly useful for debugging purposes. ! * ! * @param out the print stream, where the key/value pairs are written to ! * @throws ClassCastException if this property contains a key or a ! * value that isn't a string ! * @see #list(PrintWriter) */ ! public void list(PrintStream out) { ! PrintWriter writer = new PrintWriter (out); ! list (writer); } /** ! * Prints the key/value pairs to the given print writer. This is ! * mainly useful for debugging purposes. ! * ! * @param out the print writer where the key/value pairs are written to ! * @throws ClassCastException if this property contains a key or a ! * value that isn't a string ! * @see #list(PrintStream) ! * @since 1.1 */ ! public void list(PrintWriter out) { ! out.println ("-- listing properties --"); ! ! Iterator iter = entrySet ().iterator (); ! int i = size (); ! while (--i >= 0) { ! Map.Entry entry = (Map.Entry) iter.next (); ! out.print ((String) entry.getKey () + "="); ! ! // JDK 1.3/1.4 restrict the printed value, but not the key, ! // to 40 characters, including the truncating ellipsis. ! String s = (String ) entry.getValue (); ! if (s != null && s.length () > 40) ! out.println (s.substring (0, 37) + "..."); ! else ! out.println (s); } + out.flush (); } /** ! * Formats a key or value for output in a properties file. ! * See store for a description of the format. ! * ! * @param str the string to format ! * @param buffer the buffer to add it to ! * @param key true if all ' ' must be escaped for the key, false if only ! * leading spaces must be escaped for the value ! * @see #store(OutputStream, String) */ ! private void formatForOutput(String str, StringBuffer buffer, boolean key) { ! if (key) { ! buffer.setLength(0); ! buffer.ensureCapacity(str.length()); ! } ! else ! buffer.ensureCapacity(buffer.length() + str.length()); ! boolean head = true; ! int size = str.length(); ! for (int i = 0; i < size; i++) ! { ! char c = str.charAt(i); ! switch (c) ! { ! case '\n': ! buffer.append("\\n"); ! break; ! case '\r': ! buffer.append("\\r"); ! break; ! case '\t': ! buffer.append("\\t"); ! break; ! case ' ': ! buffer.append(head ? "\\ " : " "); ! break; ! case '\\': ! case '!': ! case '#': ! case '=': ! case ':': ! buffer.append('\\').append(c); ! break; ! default: ! if (c < ' ' || c > '~') ! { ! String hex = Integer.toHexString(c); ! buffer.append("\\u0000".substring(0, 6 - hex.length())); ! buffer.append(hex); ! } ! else ! buffer.append(c); ! } ! if (c != ' ') ! head = key; } } ! } // class Properties diff -Nrc3pad gcc-3.2.3/libjava/java/util/PropertyPermissionCollection.java gcc-3.3/libjava/java/util/PropertyPermissionCollection.java *** gcc-3.2.3/libjava/java/util/PropertyPermissionCollection.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/util/PropertyPermissionCollection.java 2002-06-18 15:39:59.000000000 +0000 *************** *** 0 **** --- 1,164 ---- + /* PropertyPermissionCollection.java -- a collection of PropertyPermissions + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package java.util; + + import java.security.Permission; + import java.security.PermissionCollection; + + /** + * This class provides the implementation for + * PropertyPermission.newPermissionCollection(). It only accepts + * PropertyPermissions, and correctly implements implies. It + * is synchronized, as specified in the superclass. + * + * @author Eric Blake + * @status an undocumented class, but this matches Sun's serialization + */ + class PropertyPermissionCollection extends PermissionCollection + { + /** + * Compatible with JDK 1.4. + */ + private static final long serialVersionUID = 7015263904581634791L; + + /** + * The permissions. + * + * @serial the table of permissions in the collection + */ + private final Hashtable permissions = new Hashtable(); + + /** + * A flag to detect if "*" is in the collection. + * + * @serial true if "*" is in the collection + */ + private boolean all_allowed; + + /** + * Adds a PropertyPermission to this collection. + * + * @param permission the permission to add + * @throws IllegalArgumentException if permission is not a PropertyPermission + * @throws SecurityException if collection is read-only + */ + public void add(Permission permission) + { + if (isReadOnly()) + throw new SecurityException("readonly"); + if (! (permission instanceof PropertyPermission)) + throw new IllegalArgumentException(); + PropertyPermission pp = (PropertyPermission) permission; + String name = pp.getName(); + if (name.equals("*")) + all_allowed = true; + PropertyPermission old = (PropertyPermission) permissions.get(name); + if (old != null) + { + if ((pp.actions | old.actions) == old.actions) + pp = old; // Old implies pp. + else if ((pp.actions | old.actions) != pp.actions) + // Here pp doesn't imply old; the only case left is both actions. + pp = new PropertyPermission(name, "read,write"); + } + permissions.put(name, pp); + } + + /** + * Returns true if this collection implies the given permission. This even + * returns true for this case: + *

          +

          collection.add(new PropertyPermission("a.*", "read"));
          + collection.add(new PropertyPermission("a.b.*", "write"));
          + collection.implies(new PropertyPermission("a.b.c", "read,write"));
          + * + * @param permission the permission to check + * @return true if it is implied by this + */ + public boolean implies(Permission permission) + { + if (! (permission instanceof PropertyPermission)) + return false; + PropertyPermission toImply = (PropertyPermission) permission; + int actions = toImply.actions; + + if (all_allowed) + { + int all_actions = ((PropertyPermission) permissions.get("*")).actions; + actions &= ~all_actions; + if (actions == 0) + return true; + } + + String name = toImply.getName(); + if (name.equals("*")) + return false; + + int prefixLength = name.length(); + if (name.endsWith("*")) + prefixLength -= 2; + + while (true) + { + PropertyPermission forName = + (PropertyPermission) permissions.get(name); + if (forName != null) + { + actions &= ~forName.actions; + if (actions == 0) + return true; + } + + prefixLength = name.lastIndexOf('.', prefixLength); + if (prefixLength < 0) + return false; + name = name.substring(0, prefixLength + 1) + '*'; + } + } + + /** + * Enumerate over the collection. + * + * @return an enumeration of the collection contents + */ + public Enumeration elements() + { + return permissions.elements(); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/util/PropertyPermission.java gcc-3.3/libjava/java/util/PropertyPermission.java *** gcc-3.2.3/libjava/java/util/PropertyPermission.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/PropertyPermission.java 2002-06-18 15:39:58.000000000 +0000 *************** *** 1,5 **** ! /* java.util.PropertyPermission ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PropertyPermission.java -- permission to get and set System properties ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,42 **** --- 37,43 ---- package java.util; + import java.security.Permission; import java.security.BasicPermission; import java.security.PermissionCollection; *************** import java.io.IOException; *** 49,127 **** * This class represents the permission to access and modify a property.
          * * The name is the name of the property, e.g. xxx. You can also ! * use an asterisk "*" as described in BasicPermission
          * ! * The action string is a comma-separated list if keywords. There are * two possible actions: *
          ! *
          read
          *
          Allows to read the property via System.getProperty.
          ! *
          write
          *
          Allows to write the property via System.setProperty.
          *
          ! * * The action string is case insensitive (it is converted to lower case). * * @see Permission * @see BasicPermission ! * @author Jochen Hoenicke */ public final class PropertyPermission extends BasicPermission { /** ! * @serialField action String ! * The action string. */ private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("action", String.class) }; private static final long serialVersionUID = 885438825399942851L; private static final int READ = 1; private static final int WRITE = 2; - private transient int actions; private static final String actionStrings[] = { "", "read", "write", "read,write" }; /** ! * Constructs a PropertyPermission witha he specified property. Possible ! * actions are read and write. ! * @param name the name of the property. ! * @param actions the action string. ! * @exception IllegalArgumentException if name string contains an ! * illegal wildcard or actions string contains an illegal action */ public PropertyPermission(String name, String actions) { super(name); setActions(actions.toLowerCase()); } /** * Parse the action string and convert actions from external to internal * form. This will set the internal actions field. ! * @param actions the action string. ! * @exception IllegalArgumentException if actions string contains an ! * illegal action */ ! private void setActions(String actions) { ! this.actions = 0; ! StringTokenizer actionTokenizer = new StringTokenizer(actions, ","); ! while (actionTokenizer.hasMoreElements()) ! { ! String anAction = actionTokenizer.nextToken(); ! if ("read".equals(anAction)) ! this.actions |= READ; ! else if ("write".equals(anAction)) ! this.actions |= WRITE; ! else ! throw new IllegalArgumentException("illegal action " + anAction); ! } } /** --- 50,176 ---- * This class represents the permission to access and modify a property.
          * * The name is the name of the property, e.g. xxx. You can also ! * use an asterisk "*" as described in BasicPermission.
          * ! * The action string is a comma-separated list of keywords. There are * two possible actions: *
          ! *
          read
          *
          Allows to read the property via System.getProperty.
          ! *
          write
          *
          Allows to write the property via System.setProperty.
          *
          ! * * The action string is case insensitive (it is converted to lower case). * * @see Permission * @see BasicPermission ! * @see SecurityManager ! * @author Jochen Hoenicke ! * @since 1.2 ! * @status updated to 1.4 */ public final class PropertyPermission extends BasicPermission { /** ! * PropertyPermission uses a more efficient representation than the ! * serialized form; this documents the difference. ! * ! * @serialField action String the action string */ private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("action", String.class) }; + /** + * Compatible with JDK 1.2+. + */ private static final long serialVersionUID = 885438825399942851L; + /** Permission to read. */ private static final int READ = 1; + /** Permission to write. */ private static final int WRITE = 2; + /** The set of actions permitted. */ + // Package visible for use by PropertyPermissionCollection. + transient int actions; + + /** + * The String forms of the actions permitted. + */ private static final String actionStrings[] = { "", "read", "write", "read,write" }; /** ! * Constructs a PropertyPermission with the specified property. Possible ! * actions are read and write, comma-separated and case-insensitive. ! * ! * @param name the name of the property ! * @param actions the action string ! * @throws NullPointerException if name is null ! * @throws IllegalArgumentException if name string contains an ! * illegal wildcard or actions string contains an illegal action ! * (this includes a null actions string) */ public PropertyPermission(String name, String actions) { super(name); + if (actions == null) + throw new IllegalArgumentException(); setActions(actions.toLowerCase()); } /** * Parse the action string and convert actions from external to internal * form. This will set the internal actions field. ! * ! * @param str the action string ! * @throws IllegalArgumentException if actions string contains an ! * illegal action ! */ ! private void setActions(String str) { ! if ("read".equals(str)) ! actions = READ; ! else if ("write".equals(str)) ! actions = WRITE; ! else if ("read,write".equals(str) || "write,read".equals(str)) ! actions = READ | WRITE; ! else ! throw new IllegalArgumentException("illegal action " + str); ! } ! ! /** ! * Reads an object from the stream. This converts the external to the ! * internal representation. ! * ! * @param s the stream to read from ! * @throws IOException if the stream fails ! * @throws ClassNotFoundException if reserialization fails ! */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException ! { ! ObjectInputStream.GetField fields = s.readFields(); ! setActions((String) fields.get("actions", null)); ! } ! ! /** ! * Writes an object to the stream. This converts the internal to the ! * external representation. ! * ! * @param s the stram to write to ! * @throws IOException if the stream fails ! */ ! private void writeObject(ObjectOutputStream s) throws IOException ! { ! ObjectOutputStream.PutField fields = s.putFields(); ! fields.put("actions", getActions()); ! s.writeFields(); } /** *************** public final class PropertyPermission ex *** 129,262 **** * the following conditions are true: *
            *
          • p is a PropertyPermission
          • ! *
          • this.getName() implies p.getName(), * e.g. java.* implies java.home
          • *
          • this.getActions is a subset of p.getActions
          • *
          */ public boolean implies(Permission p) { ! if (!(p instanceof PropertyPermission)) ! return false; ! ! // We have to check the actions. ! PropertyPermission pp = (PropertyPermission) p; ! if ((pp.actions & ~actions) != 0) ! return false; ! ! // BasicPermission checks for name. ! if (!super.implies(p)) ! return false; ! ! return true; ! } ! ! /** ! * Returns the action string. Note that this may differ from the string ! * given at the constructor: The actions are converted to lowercase and ! * may be reordered. ! */ ! public String getActions() ! { ! return actionStrings[actions]; } /** * Check to see whether this object is the same as another ! * PropertyPermission object. * ! * @param obj The other object */ ! public boolean equals (Object obj) { ! if (! (obj instanceof PropertyPermission)) ! return false; ! PropertyPermission p = (PropertyPermission) obj; ! return actions == p.actions && super.equals (p); } /** ! * Reads an object from the stream. This converts the external to the ! * internal representation. */ ! private void readObject(ObjectInputStream s) ! throws IOException, ClassNotFoundException { ! ObjectInputStream.GetField fields = s.readFields(); ! setActions((String) fields.get("actions", null)); } /** ! * Writes an object to the stream. This converts the internal to the ! * external representation. */ ! private void writeObject(ObjectOutputStream s) throws IOException { ! ObjectOutputStream.PutField fields = s.putFields(); ! fields.put("actions", getActions()); ! s.writeFields(); } /** * Returns a permission collection suitable to take * PropertyPermission objects. ! * @return a new empty PermissionCollection. */ public PermissionCollection newPermissionCollection() { ! return new PermissionCollection() ! { ! Hashtable permissions = new Hashtable(); ! int allActions = 0; ! ! public void add(Permission permission) ! { ! if (isReadOnly()) ! throw new IllegalStateException("readonly"); ! ! // also check that permission is of correct type. ! PropertyPermission pp = (PropertyPermission) permission; ! String name = pp.getName(); ! if (name.equals("*")) ! allActions |= pp.actions; ! permissions.put(name, pp); ! } ! ! public boolean implies(Permission permission) ! { ! if (!(permission instanceof PropertyPermission)) ! return false; ! ! PropertyPermission toImply = (PropertyPermission) permission; ! if ((toImply.actions & ~allActions) == 0) ! return true; ! ! String name = toImply.getName(); ! if (name.equals("*")) ! return false; ! ! int prefixLength = name.length(); ! if (name.endsWith("*")) ! prefixLength -= 2; ! ! while (true) ! { ! PropertyPermission forName = ! (PropertyPermission) permissions.get(name); ! if (forName != null && (toImply.actions & ~forName.actions) == 0) ! return true; ! ! prefixLength = name.lastIndexOf('.', prefixLength); ! if (prefixLength < 0) ! return false; ! name = name.substring(0, prefixLength + 1) + '*'; ! } ! } ! ! public Enumeration elements() ! { ! return permissions.elements(); ! } ! }; } } --- 178,247 ---- * the following conditions are true: *
            *
          • p is a PropertyPermission
          • ! *
          • this.getName() implies p.getName(), * e.g. java.* implies java.home
          • *
          • this.getActions is a subset of p.getActions
          • *
          + * + * @param p the permission to check + * @return true if this permission implies p */ public boolean implies(Permission p) { ! // BasicPermission checks for name and type. ! if (super.implies(p)) ! { ! // We have to check the actions. ! PropertyPermission pp = (PropertyPermission) p; ! return (pp.actions & ~actions) == 0; ! } ! return false; } /** * Check to see whether this object is the same as another ! * PropertyPermission object; this is true if it has the same name and ! * actions. * ! * @param obj the other object ! * @return true if the two are equivalent */ ! public boolean equals(Object obj) { ! return super.equals(obj) && actions == ((PropertyPermission) obj).actions; } /** ! * Returns the hash code for this permission. It is equivalent to ! * getName().hashCode(). ! * ! * @return the hash code */ ! public int hashCode() { ! return super.hashCode(); } /** ! * Returns the action string. Note that this may differ from the string ! * given at the constructor: The actions are converted to lowercase and ! * may be reordered. ! * ! * @return one of "read", "write", or "read,write" */ ! public String getActions() { ! return actionStrings[actions]; } /** * Returns a permission collection suitable to take * PropertyPermission objects. ! * ! * @return a new empty PermissionCollection */ public PermissionCollection newPermissionCollection() { ! return new PropertyPermissionCollection(); } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/PropertyResourceBundle.java gcc-3.3/libjava/java/util/PropertyResourceBundle.java *** gcc-3.2.3/libjava/java/util/PropertyResourceBundle.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/PropertyResourceBundle.java 2002-06-18 15:39:59.000000000 +0000 *************** *** 1,5 **** ! /* java.util.PropertyResourceBundle ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* PropertyResourceBundle -- a resource bundle built from a Property file ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,48 **** package java.util; import gnu.java.util.DoubleEnumeration; /** * This class is a concrete ResourceBundle that gets it ! * resources from a property file. This implies that the resources are * strings. For more information about resource bundles see the class * ResourceBundle. * --- 38,50 ---- package java.util; + import java.io.IOException; + import java.io.InputStream; import gnu.java.util.DoubleEnumeration; /** * This class is a concrete ResourceBundle that gets it ! * resources from a property file. This implies that the resources are * strings. For more information about resource bundles see the class * ResourceBundle. * *************** import gnu.java.util.DoubleEnumeration; *** 52,126 **** * file. * * If there is also a class for this resource and the same locale, the ! * class does win. ! * ! * The properties file should have the name of the resource bundle, ! * appended with the locale (e.g. _de.properties. The file should have the same format * as for Properties.load() * - * XXX- move this to properties. - * The file should have the following - * format: An empty line or a line starting with # is - * ignored. An backslash (\) at the end of the line - * makes the line continueing on the next line. Otherwise, each line - * describes a key/value pair. The chars up to the first whitespace, - * = or : are the key. The key is followed by one or more - * whitespaces, = or :. The rest of the - * line is the resource belonging to the key. You can give unicode - * characters with the \\uxxxx notation, where - * xxxx is the hex encoding of the 16 bit unicode char - * number. - * * An example of a properties file for the german language is given ! * here. This extends the example given in ListResourceBundle. * Create a file MyResource_de.properties with the following contents ! * and put it in the CLASSPATH. (The char \u00e4 is the * german ä) - * - *
          -  * s1=3
          -  * s2=MeineDisk
          -  * s3=3. M\u00e4rz 96
          -  * s4=Die Diskette ''{1}'' enth\u00e4lt {0} in {2}.
          -  * s5=0
          -  * s6=keine Dateien
          -  * s7=1
          -  * s8=eine Datei
          -  * s9=2
          -  * s10={0,number} Dateien
          -  * s11=Die Formatierung warf eine Exception: {0}
          -  * s12=FEHLER
          -  * s13=Ergebnis
          -  * s14=Dialog
          -  * s15=Auswahlkriterium
          -  * s16=1,3
          -  * 
          * * @see ResourceBundle * @see ListResourceBundle * @see Properties#load() ! * @author Jochen Hoenicke */ public class PropertyResourceBundle extends ResourceBundle { ! Properties properties; /** * Creates a new property resource bundle. ! * @param stream An input stream, where the resources are read from. */ ! public PropertyResourceBundle(java.io.InputStream stream) ! throws java.io.IOException { properties = new Properties(); properties.load(stream); } /** ! * Called by getObject when a resource is needed. This * returns the resource given by the key. ! * @param key The key of the resource. ! * @return The resource for the key or null if it doesn't exists. */ public Object handleGetObject(String key) { --- 54,121 ---- * file. * * If there is also a class for this resource and the same locale, the ! * class will be chosen. The properties file should have the name of the ! * resource bundle, appended with the locale (e.g. _de.properties. The file should have the same format * as for Properties.load() * * An example of a properties file for the german language is given ! * here. This extends the example given in ListResourceBundle. * Create a file MyResource_de.properties with the following contents ! * and put it in the CLASSPATH. (The char \u00e4 is the * german ä) * + * +
          + s1=3
          + s2=MeineDisk
          + s3=3. M\u00e4rz 96
          + s4=Die Diskette ''{1}'' enth\u00e4lt {0} in {2}.
          + s5=0
          + s6=keine Dateien
          + s7=1
          + s8=eine Datei
          + s9=2
          + s10={0,number} Dateien
          + s11=Die Formatierung warf eine Exception: {0}
          + s12=FEHLER
          + s13=Ergebnis
          + s14=Dialog
          + s15=Auswahlkriterium
          + s16=1,3
          + 
          + * + * @author Jochen Hoenicke * @see ResourceBundle * @see ListResourceBundle * @see Properties#load() ! * @since 1.1 ! * @status updated to 1.4 ! */ public class PropertyResourceBundle extends ResourceBundle { ! /** The properties file this bundle is based on. */ ! private Properties properties; /** * Creates a new property resource bundle. ! * ! * @param stream an input stream, where the resources are read from ! * @throws NullPointerException if stream is null ! * @throws IOException if reading the stream fails */ ! public PropertyResourceBundle(InputStream stream) throws IOException { properties = new Properties(); properties.load(stream); } /** ! * Called by getObject when a resource is needed. This * returns the resource given by the key. ! * ! * @param key the key of the resource ! * @return the resource for the key, or null if it doesn't exist */ public Object handleGetObject(String key) { *************** public class PropertyResourceBundle exte *** 129,144 **** /** * This method should return all keys for which a resource exists. ! * @return An enumeration of the keys. */ public Enumeration getKeys() { ! // We must also return the keys of our parent. ! if (parent != null) { ! return new DoubleEnumeration(properties.propertyNames(), ! parent.getKeys()); } ! return properties.propertyNames(); } ! } --- 124,153 ---- /** * This method should return all keys for which a resource exists. ! * ! * @return an enumeration of the keys */ public Enumeration getKeys() { ! if (parent == null) ! return properties.propertyNames(); ! // We make a new Set that holds all the keys, then return an enumeration ! // for that. This prevents modifications from ruining the enumeration, ! // as well as ignoring duplicates. ! Set s = new HashSet(); ! Enumeration e = properties.propertyNames(); ! while (e.hasMoreElements()) ! s.add(e.nextElement()); ! ResourceBundle bundle = parent; ! // Eliminate tail recursion. ! do { ! e = bundle.getKeys(); ! while (e.hasMoreElements()) ! s.add(e.nextElement()); ! bundle = bundle.parent; } ! while (bundle != null); ! return Collections.enumeration(s); } ! } // class PropertyResourceBundle diff -Nrc3pad gcc-3.2.3/libjava/java/util/Random.java gcc-3.3/libjava/java/util/Random.java *** gcc-3.2.3/libjava/java/util/Random.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/Random.java 2002-11-07 04:38:21.000000000 +0000 *************** *** 1,5 **** ! /* java.util.Random ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* Random.java -- a pseudo-random number generator ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,50 **** package java.util; /** * This class generates pseudorandom numbers. It uses the same * algorithm as the original JDK-class, so that your programs behave * exactly the same way, if started with the same seed. * * The algorithm is described in The Art of Computer Programming, ! * Volume 2 by Donald Knuth in Section 3.2.1. * * If two instances of this class are created with the same seed and * the same calls to these classes are made, they behave exactly the --- 38,53 ---- package java.util; + import java.io.Serializable; + /** * This class generates pseudorandom numbers. It uses the same * algorithm as the original JDK-class, so that your programs behave * exactly the same way, if started with the same seed. * * The algorithm is described in The Art of Computer Programming, ! * Volume 2 by Donald Knuth in Section 3.2.1. It is a 48-bit seed, ! * linear congruential formula. * * If two instances of this class are created with the same seed and * the same calls to these classes are made, they behave exactly the *************** package java.util; *** 57,63 **** * setSeed(long) method. In that case the above * paragraph doesn't apply to you. * ! * This class shouldn't be used for security sensitive purposes (like * generating passwords or encryption keys. See SecureRandom * in package java.security for this purpose. * --- 60,66 ---- * setSeed(long) method. In that case the above * paragraph doesn't apply to you. * ! * This class shouldn't be used for security sensitive purposes (like * generating passwords or encryption keys. See SecureRandom * in package java.security for this purpose. * *************** package java.util; *** 66,116 **** * * @see java.security.SecureRandom * @see Math#random() ! * @author Jochen Hoenicke */ ! public class Random implements java.io.Serializable { /** * True if the next nextGaussian is available. This is used by * nextGaussian, which generates two gaussian numbers by one call, ! * and returns the second on the second call. ! * @see #nextGaussian. */ private boolean haveNextNextGaussian; /** ! * The next nextGaussian if available. This is used by nextGaussian, * which generates two gaussian numbers by one call, and returns the * second on the second call. ! * @see #nextGaussian. */ private double nextNextGaussian; /** * The seed. This is the number set by setSeed and which is used * in next. ! * @see #next */ private long seed; private static final long serialVersionUID = 3905348978240129619L; /** * Creates a new pseudorandom number generator. The seed is initialized ! * to the current time as follows. ! *
          !    * setSeed(System.currentTimeMillis());
          !    * 
          * @see System#currentTimeMillis() */ public Random() { ! setSeed(System.currentTimeMillis()); } /** * Creates a new pseudorandom number generator, starting with the ! * specified seed. This does: ! *
          !    * setSeed(seed);
          !    * 
          ! * @param seed the initial seed. */ public Random(long seed) { --- 69,133 ---- * * @see java.security.SecureRandom * @see Math#random() ! * @author Jochen Hoenicke ! * @author Eric Blake (ebb9@email.byu.edu) ! * @status updated to 1.4 ! */ ! public class Random implements Serializable { /** * True if the next nextGaussian is available. This is used by * nextGaussian, which generates two gaussian numbers by one call, ! * and returns the second on the second call. ! * ! * @serial whether nextNextGaussian is available ! * @see #nextGaussian() ! * @see #nextNextGaussian ! */ private boolean haveNextNextGaussian; + /** ! * The next nextGaussian, when available. This is used by nextGaussian, * which generates two gaussian numbers by one call, and returns the * second on the second call. ! * ! * @serial the second gaussian of a pair ! * @see #nextGaussian() ! * @see #haveNextNextGaussian */ private double nextNextGaussian; + /** * The seed. This is the number set by setSeed and which is used * in next. ! * ! * @serial the internal state of this generator ! * @see #next() */ private long seed; + /** + * Compatible with JDK 1.0+. + */ private static final long serialVersionUID = 3905348978240129619L; /** * Creates a new pseudorandom number generator. The seed is initialized ! * to the current time, as if by ! * setSeed(System.currentTimeMillis());. ! * * @see System#currentTimeMillis() */ public Random() { ! this(System.currentTimeMillis()); } /** * Creates a new pseudorandom number generator, starting with the ! * specified seed, using setSeed(seed);. ! * ! * @param seed the initial seed */ public Random(long seed) { *************** public class Random implements java.io.S *** 122,133 **** * above, two instances of the same random class, starting with the * same seed, should produce the same results, if the same methods * are called. The implementation for java.util.Random is: ! *
          !    * public synchronized void setSeed(long seed) {
          !    *     this.seed = (seed ^ 0x5DEECE66DL) & ((1L << 48) - 1);
          !    *     haveNextNextGaussian = false;
          !    * }
          !    * 
          */ public synchronized void setSeed(long seed) { --- 139,152 ---- * above, two instances of the same random class, starting with the * same seed, should produce the same results, if the same methods * are called. The implementation for java.util.Random is: ! * !
          public synchronized void setSeed(long seed)
          ! {
          !   this.seed = (seed ^ 0x5DEECE66DL) & ((1L << 48) - 1);
          !   haveNextNextGaussian = false;
          ! }
          ! * ! * @param seed the new seed */ public synchronized void setSeed(long seed) { *************** public class Random implements java.io.S *** 140,159 **** * an int value whose bits low order bits are * independent chosen random bits (0 and 1 are equally likely). * The implementation for java.util.Random is: ! *
          !    * protected synchronized int next(int bits) {
          !    *     seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
          !    *     return (int) (seed >>> (48 - bits));
          !    * }
          !    * 
          ! * @param bits the number of random bits to generate. Must be in range ! * 1..32. ! * @return the next pseudorandom value. ! * @since JDK1.1 */ protected synchronized int next(int bits) - /*{ require { 1 <= bits && bits <=32 :: - "bits "+bits+" not in range [1..32]" } } */ { seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); return (int) (seed >>> (48 - bits)); --- 159,176 ---- * an int value whose bits low order bits are * independent chosen random bits (0 and 1 are equally likely). * The implementation for java.util.Random is: ! * !
          protected synchronized int next(int bits)
          ! {
          !   seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
          !   return (int) (seed >>> (48 - bits));
          ! }
          ! * ! * @param bits the number of random bits to generate, in the range 1..32 ! * @return the next pseudorandom value ! * @since 1.1 */ protected synchronized int next(int bits) { seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); return (int) (seed >>> (48 - bits)); *************** public class Random implements java.io.S *** 163,204 **** * Fills an array of bytes with random numbers. All possible values * are (approximately) equally likely. * The JDK documentation gives no implementation, but it seems to be: ! *
          !    * public void nextBytes(byte[] bytes) {
          !    *     for (int i=0; i< bytes.length; i+=4) {
          !    *         int random = next(32);
          !    *         for (int j=0; i+j< bytes.length && j<4; j++)
          !    *             bytes[i+j] = (byte) (random & 0xff)
          !    *             random >>= 8;
          !    *         }
          !    *     }
          !    * }
          !    * 
          ! * @param bytes The byte array that should be filled. ! * @since JDK1.1 */ public void nextBytes(byte[] bytes) - /*{ require { bytes != null :: "bytes is null"; } } */ { int random; ! /* Do a little bit unrolling of the above algorithm. */ int max = bytes.length & ~0x3; for (int i = 0; i < max; i += 4) { ! random = next(32); ! bytes[i] = (byte) random; ! bytes[i + 1] = (byte) (random >> 8); ! bytes[i + 2] = (byte) (random >> 16); ! bytes[i + 3] = (byte) (random >> 24); } if (max < bytes.length) { ! random = next(32); ! for (int j = max; j < bytes.length; j++) ! { ! bytes[j] = (byte) random; ! random >>= 8; ! } } } --- 180,224 ---- * Fills an array of bytes with random numbers. All possible values * are (approximately) equally likely. * The JDK documentation gives no implementation, but it seems to be: ! * !
          public void nextBytes(byte[] bytes)
          ! {
          !   for (int i = 0; i < bytes.length; i += 4)
          !   {
          !     int random = next(32);
          !     for (int j = 0; i + j < bytes.length && j < 4; j++)
          !     {
          !       bytes[i+j] = (byte) (random & 0xff)
          !       random >>= 8;
          !     }
          !   }
          ! }
          ! * ! * @param bytes the byte array that should be filled ! * @throws NullPointerException if bytes is null ! * @since 1.1 */ public void nextBytes(byte[] bytes) { int random; ! // Do a little bit unrolling of the above algorithm. int max = bytes.length & ~0x3; for (int i = 0; i < max; i += 4) { ! random = next(32); ! bytes[i] = (byte) random; ! bytes[i + 1] = (byte) (random >> 8); ! bytes[i + 2] = (byte) (random >> 16); ! bytes[i + 3] = (byte) (random >> 24); } if (max < bytes.length) { ! random = next(32); ! for (int j = max; j < bytes.length; j++) ! { ! bytes[j] = (byte) random; ! random >>= 8; ! } } } *************** public class Random implements java.io.S *** 207,219 **** * an int value whose 32 bits are independent chosen random bits * (0 and 1 are equally likely). The implementation for * java.util.Random is: ! *
          !    * public int nextInt() {
          !    *     return next(32);
          !    * }
          !    * 
          * ! * @return the next pseudorandom value. */ public int nextInt() { return next(32); --- 227,240 ---- * an int value whose 32 bits are independent chosen random bits * (0 and 1 are equally likely). The implementation for * java.util.Random is: ! * !
          public int nextInt()
          ! {
          !   return next(32);
          ! }
          * ! * @return the next pseudorandom value ! */ public int nextInt() { return next(32); *************** public class Random implements java.io.S *** 225,275 **** * each value has the same likelihodd (1/n). * (0 and 1 are equally likely). The implementation for * java.util.Random is: ! *
          !    * public int nextInt(int n) {
          !    *     if (n<=0)
          !    *         throw new IllegalArgumentException("n must be positive");
          !    *     if ((n & -n) == n)  // i.e., n is a power of 2
          !    *         return (int)((n * (long)next(31)) >> 31);
          !    *     int bits, val;
          !    *     do {
          !    *         bits = next(32);
          !    *         val = bits % n;
          !    *     } while(bits - val + (n-1) < 0);
          !    *     return val;
          !    * }
          !    * 
          ! * This algorithm would return every value with exactly the same * probability, if the next()-method would be a perfect random number * generator. ! * * The loop at the bottom only accepts a value, if the random * number was between 0 and the highest number less then 1<<31, * which is divisible by n. The probability for this is high for small * n, and the worst case is 1/2 (for n=(1<<30)+1). * ! * The special treatment for n = power of 2, selects the high bits of * the random number (the loop at the bottom would select the low order * bits). This is done, because the low order bits of linear congruential ! * number generators (like the one used in this class) are known to be * ``less random'' than the high order bits. * ! * @param n the upper bound. ! * @exception IllegalArgumentException if the given upper bound is negative ! * @return the next pseudorandom value. */ public int nextInt(int n) - /*{ require { n > 0 :: "n must be positive"; } } */ { if (n <= 0) throw new IllegalArgumentException("n must be positive"); ! if ((n & -n) == n) // i.e., n is a power of 2 return (int) ((n * (long) next(31)) >> 31); int bits, val; do { ! bits = next(32); ! val = bits % n; } while (bits - val + (n - 1) < 0); return val; --- 246,303 ---- * each value has the same likelihodd (1/n). * (0 and 1 are equally likely). The implementation for * java.util.Random is: ! * !
          ! public int nextInt(int n)
          ! {
          !   if (n <= 0)
          !     throw new IllegalArgumentException("n must be positive");
          ! 
          !   if ((n & -n) == n)  // i.e., n is a power of 2
          !     return (int)((n * (long) next(31)) >> 31);
          ! 
          !   int bits, val;
          !   do
          !   {
          !     bits = next(31);
          !     val = bits % n;
          !   }
          !   while(bits - val + (n-1) < 0);
          ! 
          !   return val;
          ! }
          ! * ! *

          This algorithm would return every value with exactly the same * probability, if the next()-method would be a perfect random number * generator. ! * * The loop at the bottom only accepts a value, if the random * number was between 0 and the highest number less then 1<<31, * which is divisible by n. The probability for this is high for small * n, and the worst case is 1/2 (for n=(1<<30)+1). * ! * The special treatment for n = power of 2, selects the high bits of * the random number (the loop at the bottom would select the low order * bits). This is done, because the low order bits of linear congruential ! * number generators (like the one used in this class) are known to be * ``less random'' than the high order bits. * ! * @param n the upper bound ! * @throws IllegalArgumentException if the given upper bound is negative ! * @return the next pseudorandom value ! * @since 1.2 */ public int nextInt(int n) { if (n <= 0) throw new IllegalArgumentException("n must be positive"); ! if ((n & -n) == n) // i.e., n is a power of 2 return (int) ((n * (long) next(31)) >> 31); int bits, val; do { ! bits = next(31); ! val = bits % n; } while (bits - val + (n - 1) < 0); return val; *************** public class Random implements java.io.S *** 279,290 **** * Generates the next pseudorandom long number. All bits of this * long are independently chosen and 0 and 1 have equal likelihood. * The implementation for java.util.Random is: ! *

          !    * public long nextLong() {
          !    *     return ((long)next(32) << 32) + next(32);
          !    * }
          !    * 
          ! * @return the next pseudorandom value. */ public long nextLong() { --- 307,319 ---- * Generates the next pseudorandom long number. All bits of this * long are independently chosen and 0 and 1 have equal likelihood. * The implementation for java.util.Random is: ! * !
          public long nextLong()
          ! {
          !   return ((long) next(32) << 32) + next(32);
          ! }
          ! * ! * @return the next pseudorandom value */ public long nextLong() { *************** public class Random implements java.io.S *** 294,305 **** /** * Generates the next pseudorandom boolean. True and false have * the same probability. The implementation is: ! *
          !    * public boolean nextBoolean() {
          !    *     return next(1) != 0;
          !    * }
          !    * 
          ! * @return the next pseudorandom boolean. */ public boolean nextBoolean() { --- 323,336 ---- /** * Generates the next pseudorandom boolean. True and false have * the same probability. The implementation is: ! * !
          public boolean nextBoolean()
          ! {
          !   return next(1) != 0;
          ! }
          ! * ! * @return the next pseudorandom boolean ! * @since 1.2 */ public boolean nextBoolean() { *************** public class Random implements java.io.S *** 308,390 **** /** * Generates the next pseudorandom float uniformly distributed ! * between 0.0f (inclusive) and 1.0 (exclusive). The * implementation is as follows. ! *
          !    * public float nextFloat() {
          !    *     return next(24) / ((float)(1 << 24));
          !    * }
          !    * 
          ! * @return the next pseudorandom float. */ public float nextFloat() { ! return next(24) / ((float) (1 << 24)); } /** * Generates the next pseudorandom double uniformly distributed ! * between 0.0f (inclusive) and 1.0 (exclusive). The * implementation is as follows. ! *
          !    * public double nextDouble() {
          !    *     return (((long)next(26) << 27) + next(27)) / (double)(1 << 53);
          !    * }
          !    * 
          ! * @return the next pseudorandom double. */ public double nextDouble() { return (((long) next(26) << 27) + next(27)) / (double) (1L << 53); } /** ! * Generates the next pseudorandom, Gaussian (normally) distributed * double value, with mean 0.0 and standard deviation 1.0. * The algorithm is as follows. ! *
          !    * public synchronized double nextGaussian() {
          !    *     if (haveNextNextGaussian) {
          !    *         haveNextNextGaussian = false;
          !    *         return nextNextGaussian;
          !    *     } else {
          !    *         double v1, v2, s;
          !    *         do {
          !    *             v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0
          !    *             v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0
          !    *             s = v1 * v1 + v2 * v2;
          !    *         } while (s >= 1);
          !    *         double norm = Math.sqrt(-2 * Math.log(s)/s);
          !    *         nextNextGaussian = v2 * norm;
          !    *         haveNextNextGaussian = true;
          !    *         return v1 * norm;
          !    *     }
          !    * }
          !    * 
          ! * This is described in section 3.4.1 of The Art of Computer * Programming, Volume 2 by Donald Knuth. * ! * @return the next pseudorandom Gaussian distributed double. */ public synchronized double nextGaussian() { if (haveNextNextGaussian) { ! haveNextNextGaussian = false; ! return nextNextGaussian; } ! else { ! double v1, v2, s; ! do ! { ! v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0 ! v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0 ! s = v1 * v1 + v2 * v2; ! } ! while (s >= 1); ! double norm = Math.sqrt(-2 * Math.log(s) / s); ! nextNextGaussian = v2 * norm; ! haveNextNextGaussian = true; ! return v1 * norm; } } } --- 339,429 ---- /** * Generates the next pseudorandom float uniformly distributed ! * between 0.0f (inclusive) and 1.0f (exclusive). The * implementation is as follows. ! * !
          public float nextFloat()
          ! {
          !   return next(24) / ((float)(1 << 24));
          ! }
          ! * ! * @return the next pseudorandom float ! */ public float nextFloat() { ! return next(24) / (float) (1 << 24); } /** * Generates the next pseudorandom double uniformly distributed ! * between 0.0 (inclusive) and 1.0 (exclusive). The * implementation is as follows. ! * !
          public double nextDouble()
          ! {
          !   return (((long) next(26) << 27) + next(27)) / (double)(1L << 53);
          ! }
          ! * ! * @return the next pseudorandom double ! */ public double nextDouble() { return (((long) next(26) << 27) + next(27)) / (double) (1L << 53); } /** ! * Generates the next pseudorandom, Gaussian (normally) distributed * double value, with mean 0.0 and standard deviation 1.0. * The algorithm is as follows. ! * !
          public synchronized double nextGaussian()
          ! {
          !   if (haveNextNextGaussian)
          !   {
          !     haveNextNextGaussian = false;
          !     return nextNextGaussian;
          !   }
          !   else
          !   {
          !     double v1, v2, s;
          !     do
          !     {
          !       v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0
          !       v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0
          !       s = v1 * v1 + v2 * v2;
          !     }
          !     while (s >= 1);
          ! 
          !     double norm = Math.sqrt(-2 * Math.log(s) / s);
          !     nextNextGaussian = v2 * norm;
          !     haveNextNextGaussian = true;
          !     return v1 * norm;
          !   }
          ! }
          ! * ! *

          This is described in section 3.4.1 of The Art of Computer * Programming, Volume 2 by Donald Knuth. * ! * @return the next pseudorandom Gaussian distributed double */ public synchronized double nextGaussian() { if (haveNextNextGaussian) { ! haveNextNextGaussian = false; ! return nextNextGaussian; } ! double v1, v2, s; ! do { ! v1 = 2 * nextDouble() - 1; // Between -1.0 and 1.0. ! v2 = 2 * nextDouble() - 1; // Between -1.0 and 1.0. ! s = v1 * v1 + v2 * v2; } + while (s >= 1); + double norm = Math.sqrt(-2 * Math.log(s) / s); + nextNextGaussian = v2 * norm; + haveNextNextGaussian = true; + return v1 * norm; } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/regex/Matcher.java gcc-3.3/libjava/java/util/regex/Matcher.java *** gcc-3.2.3/libjava/java/util/regex/Matcher.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/util/regex/Matcher.java 2002-09-18 10:15:52.000000000 +0000 *************** *** 0 **** --- 1,51 ---- + /* Matcher.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + // Stub class until java.util.regex is implemented. + package java.util.regex; + + public class Matcher + { + public String replaceFirst(String replacement) + { + throw new InternalError("Not implemented yet"); + } + public String replaceAll(String replacement) + { + throw new InternalError("Not implemented yet"); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/util/regex/Pattern.java gcc-3.3/libjava/java/util/regex/Pattern.java *** gcc-3.2.3/libjava/java/util/regex/Pattern.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/util/regex/Pattern.java 2002-09-18 10:15:52.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* Pattern.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + // Stub class until java.util.regex is implemented. + package java.util.regex; + + public class Pattern + { + public static Pattern compile(String regex) + { + throw new InternalError("Not implemented yet"); + } + public static boolean matches(String regex, CharSequence input) + { + throw new InternalError("Not implemented yet"); + } + public Matcher matcher(CharSequence input) + { + throw new InternalError("Not implemented yet"); + } + public String[] split(CharSequence input, int limit) + { + throw new InternalError("Not implemented yet"); + } + } diff -Nrc3pad gcc-3.2.3/libjava/java/util/regex/PatternSyntaxException.java gcc-3.3/libjava/java/util/regex/PatternSyntaxException.java *** gcc-3.2.3/libjava/java/util/regex/PatternSyntaxException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/java/util/regex/PatternSyntaxException.java 2002-09-18 10:15:52.000000000 +0000 *************** *** 0 **** --- 1,131 ---- + /* PatternSyntaxException - Indicates illegal pattern for regular expression. + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package java.util.regex; + + /** + * Indicates illegal pattern for regular expression. + * Includes state to inspect the pattern and what and where the expression + * was not valid regular expression. + */ + public class PatternSyntaxException extends IllegalArgumentException + { + + /** + * Human readable escription of the syntax error. + */ + private final String desc; + + /** + * The original pattern that contained the syntax error. + */ + private final String pattern; + + /** + * Index of the first character in the String that was probably invalid, + * or -1 when unknown. + */ + private final int index; + + /** + * Creates a new PatternSyntaxException. + * + * @param description Human readable escription of the syntax error. + * @param pattern The original pattern that contained the syntax error. + * @param index Index of the first character in the String that was + * probably invalid, or -1 when unknown. + */ + public PatternSyntaxException(String description, + String pattern, + int index) + { + super(description); + this.desc = description; + this.pattern = pattern; + this.index = index; + } + + /** + * Returns a human readable escription of the syntax error. + */ + public String getDescription() + { + return desc; + } + + /** + * Returns the original pattern that contained the syntax error. + */ + public String getPattern() + { + return pattern; + } + + /** + * Returns the index of the first character in the String that was probably + * invalid, or -1 when unknown. + */ + public int getIndex() + { + return index; + } + + /** + * Returns a string containing a line with the description, a line with + * the original pattern and a line indicating with a ^ which character is + * probably the first invalid character in the pattern if the index is not + * negative. + */ + public String getMessage() + { + String lineSep = System.getProperty("line.separator"); + StringBuffer sb = new StringBuffer(desc); + sb.append(lineSep); + sb.append('\t'); + sb.append(pattern); + if (index != -1) + { + sb.append(lineSep); + sb.append('\t'); + for (int i=0; igetBundle. Now you can get your object by ! * calling getObject or getString on that ! * bundle. ! *
          ! * When a bundle is demanded for a specific locale, the ResourceBundle ! * is searched in following order (def. language code stands for ! * the two letter ISO language code of the default locale (see * Locale.getDefault()). - *

          -  * baseName_language code_country code_variant
          -  * baseName_language code_country code
          -  * baseName_language code
          -  * baseName_def. language code_def. country code_def. variant
          -  * baseName_def. language code_def. country code
          -  * baseName_def. language code
          -  * baseName
          -  * 
          * ! * A bundle is backed up, by less specific bundle (omiting variant, ! * country or language). But it is not backed up by the default ! * language locale. ! *
          ! * If you provide a bundle for a given locale, say * Bundle_en_UK_POSIX, you must also provide a bundle for * all sub locales, ie. Bundle_en_UK, Bundle_en, and * Bundle. - *
          - * When a bundle is searched, we look first for a class with - * the given name and if that is not found for a file with - * .properties extension in the classpath. The name - * must be a fully qualified classname (with dots as path separators). - *
          - * (Note: This implementation always backs up the class with a - * properties file if that is existing, but you shouldn't rely on - * this, if you want to be compatible to the standard JDK.) * * @see Locale * @see PropertyResourceBundle ! * @author Jochen Hoenicke */ public abstract class ResourceBundle { /** ! * The parent bundle. This is consulted when you call getObject ! * and there is no such resource in the current bundle. This ! * field may be null. */ protected ResourceBundle parent; /** ! * The locale of this resource bundle. You can read this with * getLocale and it is automatically set in ! * getBundle. */ private Locale locale; /** ! * We override SecurityManager in order to access getClassContext(). */ ! static class Security extends SecurityManager ! { ! /** Return the ClassLoader of the class which called into this ! ResourceBundle, or null if it cannot be determined. */ ! ClassLoader getCallingClassLoader() ! { ! Class[] stack = super.getClassContext(); ! for (int i = 0; i < stack.length; i++) ! if (stack[i] != Security.class && stack[i] != ResourceBundle.class) ! return stack[i].getClassLoader(); ! return null; ! } ! } ! ! // This will always work since java.util classes have (all) system ! // permissions. ! static Security security = (Security) AccessController.doPrivileged ! ( ! new PrivilegedAction() ! { ! public Object run() ! { ! return new Security(); ! } ! } ! ); /** ! * The constructor. It does nothing special. */ public ResourceBundle() { } /** ! * Get a String from this resource bundle. Since most localized ! * Objects are Strings, this method provides a convenient way to get ! * them without casting. ! * @param key the name of the resource. ! * @exception MissingResourceException ! * if that particular object could not be found in this bundle nor ! * the parent bundle. */ ! public final String getString(String key) throws MissingResourceException { return (String) getObject(key); } /** ! * Get an array of Strings from this resource bundle. This method * provides a convenient way to get it without casting. ! * @param key the name of the resource. ! * @exception MissingResourceException ! * if that particular object could not be found in this bundle nor ! * the parent bundle. */ public final String[] getStringArray(String key) - throws MissingResourceException { return (String[]) getObject(key); } /** ! * Get an object from this resource bundle. ! * @param key the name of the resource. ! * @exception MissingResourceException ! * if that particular object could not be found in this bundle nor ! * the parent bundle. */ ! public final Object getObject(String key) throws MissingResourceException { for (ResourceBundle bundle = this; bundle != null; bundle = bundle.parent) ! { ! try ! { ! Object o = bundle.handleGetObject(key); ! if (o != null) ! return o; ! } ! catch (MissingResourceException ex) ! { ! } ! } ! throw new MissingResourceException ! ("Key not found", getClass().getName(), key); } /** ! * Get the appropriate ResourceBundle for the default locale. ! * @param baseName the name of the ResourceBundle. This should be ! * a name of a Class or a properties-File. See the class ! * description for details. * @return the desired resource bundle ! * @exception MissingResourceException ! * if the resource bundle couldn't be found. */ public static final ResourceBundle getBundle(String baseName) - throws MissingResourceException { return getBundle(baseName, Locale.getDefault(), ! security.getCallingClassLoader()); } /** ! * Get the appropriate ResourceBundle for the given locale. ! * @param baseName the name of the ResourceBundle. This should be ! * a name of a Class or a properties-File. See the class ! * description for details. ! * @param locale A locale. * @return the desired resource bundle ! * @exception MissingResourceException ! * if the resource bundle couldn't be found. */ public static final ResourceBundle getBundle(String baseName, ! Locale locale) ! throws MissingResourceException { ! return getBundle(baseName, locale, security.getCallingClassLoader()); } /** ! * The resource bundle cache. This is a two-level hash map: The key ! * is the class loader, the value is a new HashMap. The key of this ! * second hash map is the localized name, the value is a soft ! * references to the resource bundle. */ ! private static Map resourceBundleCache = new HashMap(); /** ! * The `empty' locale is created once in order to optimize ! * tryBundle(). */ ! private static final Locale emptyLocale = new Locale ("", ""); /** * Tries to load a class or a property file with the specified name. ! * @param localizedName the name. ! * @param locale the locale, that must be used exactly. ! * @param classloader the classloader. ! * @param bundle the back up (parent) bundle ! * @return the resource bundle if that could be loaded, otherwise ! * bundle. */ private static final ResourceBundle tryBundle(String localizedName, ! Locale locale, ! ClassLoader classloader, ! ResourceBundle bundle, ! HashMap cache) { ! { ! // First look into the cache. ! // XXX We should remove cleared references from the cache. ! Reference ref = (Reference) cache.get(localizedName); ! if (ref != null) ! { ! ResourceBundle rb = (ResourceBundle) ref.get(); ! if (rb != null) ! // rb should already have the right parent, except if ! // something very strange happened. ! return rb; ! } ! } ! ! // foundBundle holds exact matches for the localizedName resource ! // bundle, which may later be cached. ! ResourceBundle foundBundle = null; ! ! try { ! java.io.InputStream is; ! final String resourceName = ! localizedName.replace('.', '/') + ".properties"; ! if (classloader == null) ! is = ClassLoader.getSystemResourceAsStream (resourceName); else - is = classloader.getResourceAsStream (resourceName); - if (is != null) { ! foundBundle = new PropertyResourceBundle(is); ! foundBundle.parent = bundle; ! foundBundle.locale = locale; } } - catch (java.io.IOException ex) - { - } try { ! Class rbClass; ! if (classloader == null) ! rbClass = Class.forName(localizedName); ! else ! rbClass = classloader.loadClass(localizedName); ! foundBundle = (ResourceBundle) rbClass.newInstance(); ! foundBundle.parent = bundle; ! foundBundle.locale = locale; ! } ! catch (ClassNotFoundException ex) ! { } ! catch (IllegalAccessException ex) { } ! catch (InstantiationException ex) { ! // ignore them all ! // XXX should we also ignore ClassCastException? } ! if (foundBundle != null) cache.put(localizedName, new SoftReference(foundBundle)); ! ! return foundBundle != null ? foundBundle : bundle; } /** * Tries to load a the bundle for a given locale, also loads the backup * locales with the same language. * ! * @param name the name. ! * @param locale the locale, that must be used exactly. ! * @param classloader the classloader. ! * @param bundle the back up (parent) bundle ! * @return the resource bundle if that could be loaded, otherwise ! * bundle. */ private static final ResourceBundle tryLocalBundle(String baseName, Locale locale, ! ClassLoader classloader, ! ResourceBundle bundle, ! HashMap cache) { final String language = locale.getLanguage(); if (language.length() > 0) { ! final String country = locale.getCountry(); ! String name = baseName + "_" + language; ! ! if (country.length() != 0) ! { ! bundle = tryBundle(name, ! new Locale(language, ""), ! classloader, bundle, cache); ! ! name += "_" + country; ! ! final String variant = locale.getVariant(); ! ! if (variant.length() != 0) ! { ! bundle = tryBundle(name, ! new Locale(language, ! country), ! classloader, bundle, cache); ! ! name += "_" + variant; ! } ! } ! bundle = tryBundle(name, locale, classloader, bundle, cache); } ! return bundle; ! } ! ! /** ! * Get the appropriate ResourceBundle for the given locale. ! * @param baseName the name of the ResourceBundle. This should be ! * a name of a Class or a properties file. See the class ! * description for details. ! * @param locale A locale. ! * @param classloader a ClassLoader. ! * @return the desired resource bundle ! * @exception MissingResourceException ! * if the resource bundle couldn't be found. ! */ ! // This method is synchronized so that the cache is properly ! // handled. ! public static final synchronized ResourceBundle getBundle(String baseName, ! Locale locale, ! ClassLoader classLoader) ! throws MissingResourceException ! { ! // This implementation searches the bundle in the reverse direction ! // and builds the parent chain on the fly. ! HashMap cache = (HashMap) resourceBundleCache.get(classLoader); ! if (cache == null) ! { ! cache = new HashMap(); ! resourceBundleCache.put(classLoader, cache); ! } ! else { ! // Fast path: If baseName + "_" + locale is in cache use it. ! String name = baseName + "_" + locale.toString(); ! Reference ref = (Reference) cache.get(name); ! if (ref != null) ! { ! ResourceBundle rb = (ResourceBundle) ref.get(); ! if (rb != null) ! // rb should already have the right parent, except if ! // something very strange happened. ! return rb; ! } } ! ResourceBundle baseBundle = tryBundle(baseName, emptyLocale, ! classLoader, null, cache); ! if (baseBundle == null) ! // JDK says, that if one provides a bundle base_en_UK, one ! // must also provide the bundles base_en and base. ! // This implies that if there is no bundle for base, there ! // is no bundle at all. ! throw new MissingResourceException("Bundle " + baseName + " not found", baseName, ""); ! ! // Now use the default locale. ! ResourceBundle bundle = tryLocalBundle(baseName, locale, ! classLoader, baseBundle, cache); ! if (bundle == baseBundle && !locale.equals(Locale.getDefault())) { ! bundle = tryLocalBundle(baseName, Locale.getDefault(), ! classLoader, baseBundle, cache); } - return bundle; - } ! /** ! * Return the actual locale of this bundle. You can use it after ! * calling getBundle, to know if the bundle for the desired locale ! * was loaded or if the fall back was used. ! */ ! public Locale getLocale() ! { ! return locale; ! } ! ! /** ! * Set the parent of this bundle. This is consulted when you call ! * getObject and there is no such resource in the current bundle. ! * @param parent the parent of this bundle. ! */ ! protected void setParent(ResourceBundle parent) ! { ! // Shall we ignore the old parent? ! this.parent = parent; } - - /** - * Override this method to provide the resource for a keys. This gets - * called by getObject. If you don't have a resource - * for the given key, you should return null instead throwing a - * MissingResourceException. You don't have to ask the parent, - * getObject() already does this. - * - * @param key The key of the resource. - * @return The resource for the key, or null if not in bundle. - * @exception MissingResourceException - * you shouldn't throw this. - */ - protected abstract Object handleGetObject(String key) - throws MissingResourceException; - - /** - * This method should return all keys for which a resource exists. - * @return An enumeration of the keys. - */ - public abstract Enumeration getKeys(); } --- 37,560 ---- package java.util; + import java.lang.ref.Reference; import java.lang.ref.SoftReference; ! import java.io.InputStream; ! import java.io.IOException; import gnu.classpath.Configuration; /** ! * A resource bundle contains locale-specific data. If you need localized ! * data, you can load a resource bundle that matches the locale with ! * getBundle. Now you can get your object by calling ! * getObject or getString on that bundle. ! * ! *

          When a bundle is demanded for a specific locale, the ResourceBundle ! * is searched in following order (def. language stands for the ! * two letter ISO language code of the default locale (see * Locale.getDefault()). * !

          baseName_language code_country code_variant
          ! baseName_language code_country code
          ! baseName_language code
          ! baseName_def. language_def. country_def. variant
          ! baseName_def. language_def. country
          ! baseName_def. language
          ! baseName
          ! * ! *

          A bundle is backed up by less specific bundles (omitting variant, country ! * or language). But it is not backed up by the default language locale. ! * ! *

          If you provide a bundle for a given locale, say * Bundle_en_UK_POSIX, you must also provide a bundle for * all sub locales, ie. Bundle_en_UK, Bundle_en, and * Bundle. * + *

          When a bundle is searched, we look first for a class with the given + * name, then for a file with .properties extension in the + * classpath. The name must be a fully qualified classname (with dots as + * path separators). + * + *

          (Note: This implementation always backs up the class with a properties + * file if that is existing, but you shouldn't rely on this, if you want to + * be compatible to the standard JDK.) + * + * @author Jochen Hoenicke + * @author Eric Blake (ebb9@email.byu.edu) * @see Locale + * @see ListResourceBundle * @see PropertyResourceBundle ! * @since 1.1 ! * @status updated to 1.4 ! */ public abstract class ResourceBundle { /** ! * The parent bundle. This is consulted when you call getObject and there ! * is no such resource in the current bundle. This field may be null. */ protected ResourceBundle parent; /** ! * The locale of this resource bundle. You can read this with * getLocale and it is automatically set in ! * getBundle. */ private Locale locale; + private static native ClassLoader getCallingClassLoader(); + /** ! * The resource bundle cache. This is a two-level hash map: The key ! * is the class loader, the value is a new HashMap. The key of this ! * second hash map is the localized name, the value is a soft ! * references to the resource bundle. */ ! private static Map resourceBundleCache; /** ! * The last default Locale we saw. If this ever changes then we have to ! * reset our caches. ! */ ! private static Locale lastDefaultLocale; ! ! /** ! * The `empty' locale is created once in order to optimize ! * tryBundle(). ! */ ! private static final Locale emptyLocale = new Locale(""); ! ! /** ! * The constructor. It does nothing special. */ public ResourceBundle() { } /** ! * Get a String from this resource bundle. Since most localized Objects ! * are Strings, this method provides a convenient way to get them without ! * casting. ! * ! * @param key the name of the resource ! * @throws MissingResourceException if the resource can't be found ! * @throws NullPointerException if key is null ! * @throws ClassCastException if resource is not a string */ ! public final String getString(String key) { return (String) getObject(key); } /** ! * Get an array of Strings from this resource bundle. This method * provides a convenient way to get it without casting. ! * ! * @param key the name of the resource ! * @throws MissingResourceException if the resource can't be found ! * @throws NullPointerException if key is null ! * @throws ClassCastException if resource is not a string */ public final String[] getStringArray(String key) { return (String[]) getObject(key); } /** ! * Get an object from this resource bundle. This will call ! * handleGetObject for this resource and all of its parents, ! * until it finds a non-null resource. ! * ! * @param key the name of the resource ! * @throws MissingResourceException if the resource can't be found ! * @throws NullPointerException if key is null */ ! public final Object getObject(String key) { for (ResourceBundle bundle = this; bundle != null; bundle = bundle.parent) ! try ! { ! Object o = bundle.handleGetObject(key); ! if (o != null) ! return o; ! } ! catch (MissingResourceException ex) ! { ! } ! throw new MissingResourceException("Key not found", ! getClass().getName(), key); } /** ! * Return the actual locale of this bundle. You can use it after calling ! * getBundle, to know if the bundle for the desired locale was loaded or ! * if the fall back was used. ! * ! * @return the bundle's locale ! */ ! public Locale getLocale() ! { ! return locale; ! } ! ! /** ! * Set the parent of this bundle. The parent is consulted when you call ! * getObject and there is no such resource in the current bundle. ! * ! * @param parent the parent of this bundle ! */ ! protected void setParent(ResourceBundle parent) ! { ! this.parent = parent; ! } ! ! /** ! * Get the appropriate ResourceBundle for the default locale. This is like ! * calling getBundle(baseName, Locale.getDefault(), ! * getClass().getClassLoader(), except that any security check of ! * getClassLoader won't fail. ! * ! * @param baseName the name of the ResourceBundle * @return the desired resource bundle ! * @throws MissingResourceException if the resource bundle can't be found ! * @throws NullPointerException if baseName is null */ public static final ResourceBundle getBundle(String baseName) { return getBundle(baseName, Locale.getDefault(), ! getCallingClassLoader()); } /** ! * Get the appropriate ResourceBundle for the given locale. This is like ! * calling getBundle(baseName, locale, ! * getClass().getClassLoader(), except that any security check of ! * getClassLoader won't fail. ! * ! * @param baseName the name of the ResourceBundle ! * @param locale A locale * @return the desired resource bundle ! * @throws MissingResourceException if the resource bundle can't be found ! * @throws NullPointerException if baseName or locale is null */ public static final ResourceBundle getBundle(String baseName, ! Locale locale) { ! return getBundle(baseName, locale, getCallingClassLoader()); } /** ! * Get the appropriate ResourceBundle for the given locale. The following ! * strategy is used: ! * ! *

          A sequence of candidate bundle names are generated, and tested in ! * this order, where the suffix 1 means the string from the specified ! * locale, and the suffix 2 means the string from the default locale:

            ! *
          • baseName + "_" + language1 + "_" + country1 + "_" + variant1
          • ! *
          • baseName + "_" + language1 + "_" + country1
          • ! *
          • baseName + "_" + language1
          • ! *
          • baseName + "_" + language2 + "_" + country2 + "_" + variant2
          • ! *
          • baseName + "_" + language2 + "_" + country2
          • ! *
          • baseName + "_" + language2
          • ! *
          • baseName
          • ! *
          ! * ! *

          In the sequence, entries with an empty string are ignored. Next, ! * getBundle tries to instantiate the resource bundle:

            ! *
          • First, an attempt is made to load a class in the specified classloader ! * which is a subclass of ResourceBundle, and which has a public constructor ! * with no arguments, via reflection.
          • ! *
          • Next, a search is made for a property resource file, by replacing ! * '.' with '/' and appending ".properties", and using ! * ClassLoader.getResource(). If a file is found, then a ! * PropertyResourceBundle is created from the file's contents.
          • ! *
          ! * If no resource bundle was found, a MissingResourceException is thrown. ! * ! *

          Next, the parent chain is implemented. The remaining candidate names ! * in the above sequence are tested in a similar manner, and if any results ! * in a resource bundle, it is assigned as the parent of the first bundle ! * using the setParent method (unless the first bundle already ! * has a parent). ! * ! *

          For example, suppose the following class and property files are ! * provided: MyResources.class, MyResources_fr_CH.properties, ! * MyResources_fr_CH.class, MyResources_fr.properties, ! * MyResources_en.properties, and MyResources_es_ES.class. The contents of ! * all files are valid (that is, public non-abstract subclasses of ! * ResourceBundle with public nullary constructors for the ".class" files, ! * syntactically correct ".properties" files). The default locale is ! * Locale("en", "UK"). ! * ! *

          Calling getBundle with the shown locale argument values instantiates ! * resource bundles from the following sources:

            ! *
          • Locale("fr", "CH"): result MyResources_fr_CH.class, parent ! * MyResources_fr.properties, parent MyResources.class
          • ! *
          • Locale("fr", "FR"): result MyResources_fr.properties, parent ! * MyResources.class
          • ! *
          • Locale("de", "DE"): result MyResources_en.properties, parent ! * MyResources.class
          • ! *
          • Locale("en", "US"): result MyResources_en.properties, parent ! * MyResources.class
          • ! *
          • Locale("es", "ES"): result MyResources_es_ES.class, parent ! * MyResources.class
          • ! *
          ! * The file MyResources_fr_CH.properties is never used because it is hidden ! * by MyResources_fr_CH.class. ! * ! * @param baseName the name of the ResourceBundle ! * @param locale A locale ! * @param classloader a ClassLoader ! * @return the desired resource bundle ! * @throws MissingResourceException if the resource bundle can't be found ! * @throws NullPointerException if any argument is null ! * @since 1.2 ! */ ! // This method is synchronized so that the cache is properly ! // handled. ! public static final synchronized ResourceBundle getBundle ! (String baseName, Locale locale, ClassLoader classLoader) ! { ! // This implementation searches the bundle in the reverse direction ! // and builds the parent chain on the fly. ! Locale defaultLocale = Locale.getDefault(); ! if (defaultLocale != lastDefaultLocale) ! { ! resourceBundleCache = new HashMap(); ! lastDefaultLocale = defaultLocale; ! } ! HashMap cache = (HashMap) resourceBundleCache.get(classLoader); ! StringBuffer sb = new StringBuffer(60); ! sb.append(baseName).append('_').append(locale); ! String name = sb.toString(); ! ! if (cache == null) ! { ! cache = new HashMap(); ! resourceBundleCache.put(classLoader, cache); ! } ! else if (cache.containsKey(name)) ! { ! Reference ref = (Reference) cache.get(name); ! ResourceBundle result = null; ! // If REF is null, that means that we added a `null' value to ! // the hash map. That means we failed to find the bundle ! // previously, and we cached that fact. The JDK does this, so ! // it must be ok. ! if (ref == null) ! throw new MissingResourceException("Bundle " + baseName ! + " not found", ! baseName, ""); ! else ! { ! ResourceBundle rb = (ResourceBundle) ref.get(); ! if (rb != null) ! { ! // RB should already have the right parent, except if ! // something very strange happened. ! return rb; ! } ! // If RB is null, then we previously found it but it was ! // collected. So we try again. ! } ! } ! ! // It is ok if this returns null. We aren't required to have the ! // base bundle. ! ResourceBundle baseBundle = tryBundle(baseName, emptyLocale, ! classLoader, null, cache); ! ! // Now use our locale, followed by the default locale. We only ! // need to try the default locale if our locale is different, and ! // if our locale failed to yield a result other than the base ! // bundle. ! ResourceBundle bundle = tryLocalBundle(baseName, locale, ! classLoader, baseBundle, cache); ! if (bundle == baseBundle && !locale.equals(defaultLocale)) ! { ! bundle = tryLocalBundle(baseName, defaultLocale, ! classLoader, baseBundle, cache); ! // We need to record that the argument locale maps to the ! // bundle we just found. If we didn't find a bundle, record ! // that instead. ! if (bundle == null) ! cache.put(name, null); ! else ! cache.put(name, new SoftReference(bundle)); ! } ! ! if (bundle == null) ! throw new MissingResourceException("Bundle " + baseName + " not found", ! baseName, ""); ! ! return bundle; ! } /** ! * Override this method to provide the resource for a keys. This gets ! * called by getObject. If you don't have a resource ! * for the given key, you should return null instead throwing a ! * MissingResourceException. You don't have to ask the parent, getObject() ! * already does this; nor should you throw a MissingResourceException. ! * ! * @param key the key of the resource ! * @return the resource for the key, or null if not in bundle ! * @throws NullPointerException if key is null */ ! protected abstract Object handleGetObject(String key); ! ! /** ! * This method should return all keys for which a resource exists; you ! * should include the enumeration of any parent's keys, after filtering out ! * duplicates. ! * ! * @return an enumeration of the keys ! */ ! public abstract Enumeration getKeys(); /** * Tries to load a class or a property file with the specified name. ! * ! * @param localizedName the name ! * @param locale the locale, that must be used exactly ! * @param classloader the classloader ! * @param bundle the backup (parent) bundle ! * @return the resource bundle if it was loaded, otherwise the backup */ private static final ResourceBundle tryBundle(String localizedName, ! Locale locale, ! ClassLoader classloader, ! ResourceBundle bundle, ! HashMap cache) { ! // First look into the cache. ! if (cache.containsKey(localizedName)) { ! Reference ref = (Reference) cache.get(localizedName); ! ResourceBundle result = null; ! // If REF is null, that means that we added a `null' value to ! // the hash map. That means we failed to find the bundle ! // previously, and we cached that fact. The JDK does this, so ! // it must be ok. ! if (ref == null) ! return null; else { ! ResourceBundle rb = (ResourceBundle) ref.get(); ! if (rb != null) ! { ! // RB should already have the right parent, except if ! // something very strange happened. ! return rb; ! } ! // If RB is null, then we previously found it but it was ! // collected. So we try again. } } + // foundBundle holds exact matches for the localizedName resource + // bundle, which may later be cached. + ResourceBundle foundBundle = null; try { ! Class rbClass; ! if (classloader == null) ! rbClass = Class.forName(localizedName); ! else ! rbClass = classloader.loadClass(localizedName); ! foundBundle = (ResourceBundle) rbClass.newInstance(); ! foundBundle.parent = bundle; ! foundBundle.locale = locale; } ! catch (Exception ex) { + // ignore them all } ! if (foundBundle == null) { ! try ! { ! InputStream is; ! final String resourceName ! = localizedName.replace('.', '/') + ".properties"; ! if (classloader == null) ! is = ClassLoader.getSystemResourceAsStream(resourceName); ! else ! is = classloader.getResourceAsStream(resourceName); ! if (is != null) ! { ! foundBundle = new PropertyResourceBundle(is); ! foundBundle.parent = bundle; ! foundBundle.locale = locale; ! } ! } ! catch (IOException ex) ! { ! } } ! // Put the result into the hash table. If we didn't find anything ! // here, we record our parent bundle. If we record `null' that means ! // nothing, not even the base, was found. ! if (foundBundle == null) ! foundBundle = bundle; ! if (foundBundle == null) ! cache.put(localizedName, null); ! else cache.put(localizedName, new SoftReference(foundBundle)); ! return foundBundle; } /** * Tries to load a the bundle for a given locale, also loads the backup * locales with the same language. * ! * @param name the name ! * @param locale the locale ! * @param classloader the classloader ! * @param bundle the backup (parent) bundle ! * @return the resource bundle if it was loaded, otherwise the backup */ private static final ResourceBundle tryLocalBundle(String baseName, Locale locale, ! ClassLoader classloader, ! ResourceBundle bundle, ! HashMap cache) { final String language = locale.getLanguage(); + final String country = locale.getCountry(); + final String variant = locale.getVariant(); + + StringBuffer sb = new StringBuffer(60); + sb.append(baseName); + sb.append('_'); if (language.length() > 0) { ! sb.append(language); ! bundle = tryBundle(sb.toString(), new Locale(language), ! classloader, bundle, cache); } ! // If LANGUAGE was empty, we still need to try the other ! // components, and the `_' is required. ! sb.append('_'); ! if (country.length() > 0) { ! sb.append(country); ! bundle = tryBundle(sb.toString(), new Locale(language, country), ! classloader, bundle, cache); } + sb.append('_'); ! if (variant.length() > 0) { ! sb.append(variant); ! bundle = tryBundle(sb.toString(), locale, ! classloader, bundle, cache); } ! return bundle; } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/SimpleTimeZone.java gcc-3.3/libjava/java/util/SimpleTimeZone.java *** gcc-3.2.3/libjava/java/util/SimpleTimeZone.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/SimpleTimeZone.java 2002-06-18 15:40:00.000000000 +0000 *************** import java.text.DateFormatSymbols; *** 52,58 **** * * @see Calendar * @see GregorianCalender ! * @author Jochen Hoenicke */ public class SimpleTimeZone extends TimeZone { /** --- 52,59 ---- * * @see Calendar * @see GregorianCalender ! * @author Jochen Hoenicke ! */ public class SimpleTimeZone extends TimeZone { /** *************** public class SimpleTimeZone extends Time *** 436,444 **** * In the standard JDK the results given by this method may result in * inaccurate results at the end of February or the beginning of March. * To avoid this, you should use Calendar instead: ! *
          !    * offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
          !    * 
          * You could also use in * * This version doesn't suffer this inaccuracy. --- 437,445 ---- * In the standard JDK the results given by this method may result in * inaccurate results at the end of February or the beginning of March. * To avoid this, you should use Calendar instead: ! * offset = cal.get(Calendar.ZONE_OFFSET) ! * + cal.get(Calendar.DST_OFFSET); ! * * You could also use in * * This version doesn't suffer this inaccuracy. diff -Nrc3pad gcc-3.2.3/libjava/java/util/StringTokenizer.java gcc-3.3/libjava/java/util/StringTokenizer.java *** gcc-3.2.3/libjava/java/util/StringTokenizer.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/StringTokenizer.java 2002-06-18 15:40:01.000000000 +0000 *************** *** 1,5 **** ! /* java.util.StringTokenizer ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* StringTokenizer -- breaks a String into tokens ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 39,113 **** package java.util; /** ! * This class splits a string into tokens. The caller can set on which * delimiters the string should be split and if the delimiters should be ! * returned. * ! * You may change the delimiter set on the fly by calling * nextToken(String). But the semantic is quite difficult; it even * depends on calling hasMoreTokens(). You should call * hasMoreTokens() before, otherwise the old delimiters ! * after the last token are returned. * ! * If you want to get the delimiters, you have to use the three argument * constructor. The delimiters are returned as token consisting of a ! * single character. * * @author Jochen Hoenicke * @author Warren Levy */ public class StringTokenizer implements Enumeration { /** * The position in the str, where we currently are. */ private int pos; /** * The string that should be split into tokens. */ ! private String str; /** * The string containing the delimiter characters. */ private String delim; /** * Tells, if we should return the delimiters. */ ! private boolean retDelims; ! ! /*{ ! invariant { ! pos >= 0 :: "position is negative"; ! pos <= str.length() :: "position is out of string"; ! str != null :: "String is null"; ! delim != null :: "Delimiters are null"; ! } ! } */ /** * Creates a new StringTokenizer for the string str, ! * that should split on the default delimiter set (space, tap, * newline, return and formfeed), and which doesn't return the * delimiters. ! * @param str The string to split. */ public StringTokenizer(String str) - /*{ require { str != null :: "str must not be null"; } } */ { this(str, " \t\n\r\f", false); } /** ! * Create a new StringTokenizer, that splits the given string on * the given delimiter characters. It doesn't return the delimiter * characters. * ! * @param str The string to split. ! * @param delim A string containing all delimiter characters. */ public StringTokenizer(String str, String delim) - /*{ require { str != null :: "str must not be null"; - delim != null :: "delim must not be null"; } } */ { this(str, delim, false); } --- 39,117 ---- package java.util; /** ! * This class splits a string into tokens. The caller can set on which * delimiters the string should be split and if the delimiters should be ! * returned. This is much simpler than {@link java.io.StreamTokenizer}. * ! *

          You may change the delimiter set on the fly by calling * nextToken(String). But the semantic is quite difficult; it even * depends on calling hasMoreTokens(). You should call * hasMoreTokens() before, otherwise the old delimiters ! * after the last token are candidates for being returned. * ! *

          If you want to get the delimiters, you have to use the three argument * constructor. The delimiters are returned as token consisting of a ! * single character. * * @author Jochen Hoenicke * @author Warren Levy + * @see java.io.StreamTokenizer + * @status updated to 1.4 */ public class StringTokenizer implements Enumeration { + // WARNING: StringTokenizer is a CORE class in the bootstrap cycle. See the + // comments in vm/reference/java/lang/Runtime for implications of this fact. + /** * The position in the str, where we currently are. */ private int pos; + /** * The string that should be split into tokens. */ ! private final String str; ! ! /** ! * The length of the string. ! */ ! private final int len; ! /** * The string containing the delimiter characters. */ private String delim; + /** * Tells, if we should return the delimiters. */ ! private final boolean retDelims; /** * Creates a new StringTokenizer for the string str, ! * that should split on the default delimiter set (space, tab, * newline, return and formfeed), and which doesn't return the * delimiters. ! * ! * @param str The string to split ! * @throws NullPointerException if str is null */ public StringTokenizer(String str) { this(str, " \t\n\r\f", false); } /** ! * Create a new StringTokenizer, that splits the given string on * the given delimiter characters. It doesn't return the delimiter * characters. * ! * @param str the string to split ! * @param delim a string containing all delimiter characters ! * @throws NullPointerException if either argument is null */ public StringTokenizer(String str, String delim) { this(str, delim, false); } *************** public class StringTokenizer implements *** 119,152 **** * characters are returned as tokens of their own. The delimiter * tokens always consist of a single character. * ! * @param str The string to split. ! * @param delim A string containing all delimiter characters. ! * @param returnDelims Tells, if you want to get the delimiters. */ public StringTokenizer(String str, String delim, boolean returnDelims) - /*{ require { str != null :: "str must not be null"; - delim != null :: "delim must not be null"; } } */ { this.str = str; ! this.delim = delim; this.retDelims = returnDelims; this.pos = 0; } /** * Tells if there are more tokens. ! * @return True, if the next call of nextToken() succeeds, false otherwise. */ public boolean hasMoreTokens() { ! if (!retDelims) { ! while (pos < str.length() && delim.indexOf(str.charAt(pos)) > -1) ! { ! pos++; ! } } ! return pos < str.length(); } /** --- 123,156 ---- * characters are returned as tokens of their own. The delimiter * tokens always consist of a single character. * ! * @param str the string to split ! * @param delim a string containing all delimiter characters ! * @param returnDelims tells, if you want to get the delimiters ! * @throws NullPointerException if str or delim is null */ public StringTokenizer(String str, String delim, boolean returnDelims) { + len = str.length(); this.str = str; ! // The toString() hack causes the NullPointerException. ! this.delim = delim.toString(); this.retDelims = returnDelims; this.pos = 0; } /** * Tells if there are more tokens. ! * ! * @return true if the next call of nextToken() will succeed */ public boolean hasMoreTokens() { ! if (! retDelims) { ! while (pos < len && delim.indexOf(str.charAt(pos)) >= 0) ! pos++; } ! return pos < len; } /** *************** public class StringTokenizer implements *** 154,166 **** * delim. The change of the delimiter set is * permanent, ie. the next call of nextToken(), uses the same * delimiter set. ! * @param delim a string containing the new delimiter characters. ! * @return the next token with respect to the new delimiter characters. ! * @exception NoSuchElementException if there are no more tokens. */ public String nextToken(String delim) throws NoSuchElementException - /*{ require { hasMoreTokens() :: "no more Tokens available"; - ensure { $return != null && $return.length() > 0; } } */ { this.delim = delim; return nextToken(); --- 158,170 ---- * delim. The change of the delimiter set is * permanent, ie. the next call of nextToken(), uses the same * delimiter set. ! * ! * @param delim a string containing the new delimiter characters ! * @return the next token with respect to the new delimiter characters ! * @throws NoSuchElementException if there are no more tokens ! * @throws NullPointerException if delim is null */ public String nextToken(String delim) throws NoSuchElementException { this.delim = delim; return nextToken(); *************** public class StringTokenizer implements *** 168,199 **** /** * Returns the nextToken of the string. ! * @param delim a string containing the new delimiter characters. ! * @return the next token with respect to the new delimiter characters. ! * @exception NoSuchElementException if there are no more tokens. */ public String nextToken() throws NoSuchElementException - /*{ require { hasMoreTokens() :: "no more Tokens available"; - ensure { $return != null && $return.length() > 0; } } */ { ! if (pos < str.length() && delim.indexOf(str.charAt(pos)) > -1) { ! if (retDelims) ! return str.substring(pos, ++pos); ! ! while (++pos < str.length() && delim.indexOf(str.charAt(pos)) > -1) ! { ! /* empty */ ! } } ! if (pos < str.length()) { ! int start = pos; ! while (++pos < str.length() && delim.indexOf(str.charAt(pos)) == -1) ! { ! /* empty */ ! } ! return str.substring(start, pos); } throw new NoSuchElementException(); } --- 172,195 ---- /** * Returns the nextToken of the string. ! * ! * @return the next token with respect to the current delimiter characters ! * @throws NoSuchElementException if there are no more tokens */ public String nextToken() throws NoSuchElementException { ! if (pos < len && delim.indexOf(str.charAt(pos)) >= 0) { ! if (retDelims) ! return str.substring(pos, ++pos); ! while (++pos < len && delim.indexOf(str.charAt(pos)) >= 0); } ! if (pos < len) { ! int start = pos; ! while (++pos < len && delim.indexOf(str.charAt(pos)) < 0); ! ! return str.substring(start, pos); } throw new NoSuchElementException(); } *************** public class StringTokenizer implements *** 201,209 **** /** * This does the same as hasMoreTokens. This is the * EnumerationEnumerationEnumerationEnumerationnextTokens() will ! * succeed. ! * @see #nextToken */ public int countTokens() { int count = 0; int delimiterCount = 0; ! boolean tokenFound = false; // Set when a non-delimiter is found int tmpPos = pos; // Note for efficiency, we count up the delimiters rather than check // retDelims every time we encounter one. That way, we can // just do the conditional once at the end of the method ! while (tmpPos < str.length()) { ! if (delim.indexOf(str.charAt(tmpPos++)) > -1) ! { ! if (tokenFound) ! { ! // Got to the end of a token ! count++; ! tokenFound = false; ! } ! ! delimiterCount++; // Increment for this delimiter ! } ! else ! { ! tokenFound = true; ! ! // Get to the end of the token ! while (tmpPos < str.length() ! && delim.indexOf(str.charAt(tmpPos)) == -1) ! ++tmpPos; ! } } ! // Make sure to count the last token if (tokenFound) count++; // if counting delmiters add them into the token count return retDelims ? count + delimiterCount : count; } ! } --- 222,268 ---- /** * This counts the number of remaining tokens in the string, with * respect to the current delimiter set. ! * ! * @return the number of times nextTokens() will succeed ! * @see #nextToken() */ public int countTokens() { int count = 0; int delimiterCount = 0; ! boolean tokenFound = false; // Set when a non-delimiter is found int tmpPos = pos; // Note for efficiency, we count up the delimiters rather than check // retDelims every time we encounter one. That way, we can // just do the conditional once at the end of the method ! while (tmpPos < len) { ! if (delim.indexOf(str.charAt(tmpPos++)) >= 0) ! { ! if (tokenFound) ! { ! // Got to the end of a token ! count++; ! tokenFound = false; ! } ! delimiterCount++; // Increment for this delimiter ! } ! else ! { ! tokenFound = true; ! // Get to the end of the token ! while (tmpPos < len ! && delim.indexOf(str.charAt(tmpPos)) < 0) ! ++tmpPos; ! } } ! // Make sure to count the last token if (tokenFound) count++; // if counting delmiters add them into the token count return retDelims ? count + delimiterCount : count; } ! } // class StringTokenizer diff -Nrc3pad gcc-3.2.3/libjava/java/util/TimerTask.java gcc-3.3/libjava/java/util/TimerTask.java *** gcc-3.2.3/libjava/java/util/TimerTask.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/TimerTask.java 2002-06-18 15:40:01.000000000 +0000 *************** package java.util; *** 44,54 **** * it should have been scheduled and cancel itself when no longer needed. *

          * Example: ! * * Timer timer = new Timer(); * TimerTask task = new TimerTask() { * public void run() { ! * if (this.scheduledExecutionTime() < System.currentTimeMillis() + 500) * // Do something * else * // Complain: We are more then half a second late! --- 44,54 ---- * it should have been scheduled and cancel itself when no longer needed. *

          * Example: ! *

             *  Timer timer = new Timer();
             *  TimerTask task = new TimerTask() {
             *      public void run() {
          !  *      if (this.scheduledExecutionTime() < System.currentTimeMillis() + 500)
             *          // Do something
             *      else
             *          // Complain: We are more then half a second late!
          *************** package java.util;
          *** 56,62 ****
             *          this.cancel(); // This was our last execution
             *  };
             *  timer.scheduleAtFixedRate(task, 1000, 1000); // schedule every second
          !  * 
             * 

          * Note that a TimerTask object is a one shot object and can only given once * to a Timer. (The Timer will use the TimerTask object for bookkeeping, --- 56,62 ---- * this.cancel(); // This was our last execution * }; * timer.scheduleAtFixedRate(task, 1000, 1000); // schedule every second ! *

          *

          * Note that a TimerTask object is a one shot object and can only given once * to a Timer. (The Timer will use the TimerTask object for bookkeeping, diff -Nrc3pad gcc-3.2.3/libjava/java/util/TimeZone.java gcc-3.3/libjava/java/util/TimeZone.java *** gcc-3.2.3/libjava/java/util/TimeZone.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/TimeZone.java 2002-09-25 21:10:21.000000000 +0000 *************** *** 1,5 **** /* java.util.TimeZone ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* java.util.TimeZone ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,43 **** --- 38,44 ---- package java.util; import java.text.DateFormatSymbols; + import gnu.classpath.Configuration; /** * This class represents a time zone offset and handles daylight savings. *************** public abstract class TimeZone implement *** 753,768 **** /* Look up default timezone */ static { ! // System.loadLibrary("javautil"); ! String tzid = System.getProperty("user.timezone"); if (tzid == null) tzid = "GMT"; defaultZone = getTimeZone(tzid); } /** * Gets the time zone offset, for current date, modified in case of * daylight savings. This is the offset to add to UTC to get the local --- 754,785 ---- /* Look up default timezone */ static { ! if (Configuration.INIT_LOAD_LIBRARY) ! { ! System.loadLibrary("javautil"); ! } String tzid = System.getProperty("user.timezone"); if (tzid == null) + tzid = getDefaultTimeZoneId(); + + if (tzid == null) tzid = "GMT"; defaultZone = getTimeZone(tzid); } + /* This method returns us a time zone id string which is in the + form . + The GMT offset is in seconds, except where it is evenly divisible + by 3600, then it is in hours. If the zone does not observe + daylight time, then the daylight zone name is omitted. Examples: + in Chicago, the timezone would be CST6CDT. In Indianapolis + (which does not have Daylight Savings Time) the string would + be EST5 + */ + private static native String getDefaultTimeZoneId(); + /** * Gets the time zone offset, for current date, modified in case of * daylight savings. This is the offset to add to UTC to get the local *************** public abstract class TimeZone implement *** 944,949 **** --- 961,982 ---- public abstract boolean inDaylightTime(Date date); /** + * Gets the daylight savings offset. This is a positive offset in + * milliseconds with respect to standard time. Typically this + * is one hour, but for some time zones this may be half an our. + *

          The default implementation returns 3600000 milliseconds + * (one hour) if the time zone uses daylight savings time + * (as specified by {@link #useDaylightTime()}), otherwise + * it returns 0. + * @return the daylight savings offset in milliseconds. + * @since 1.4 + */ + public int getDSTSavings () + { + return useDaylightTime () ? 3600000 : 0; + } + + /** * Gets the TimeZone for the given ID. * @param ID the time zone identifier. * @return The time zone for the identifier or GMT, if no such time diff -Nrc3pad gcc-3.2.3/libjava/java/util/TooManyListenersException.java gcc-3.3/libjava/java/util/TooManyListenersException.java *** gcc-3.2.3/libjava/java/util/TooManyListenersException.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/TooManyListenersException.java 2002-06-16 21:15:42.000000000 +0000 *************** *** 1,5 **** ! /* java.util.TooManyListenersException ! Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- ! /* TooManyListenersException.java -- thrown when a unicast event can't accept ! another Listener ! Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 38,63 **** package java.util; - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - * "The Java Language Specification", ISBN 0-201-63451-1 - * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. - */ - /** * This exception is part of the java event model. It is thrown if an * event listener is added via the addXyzEventListener method, but the * object doesn't support any more listeners, e.g. it only supports a * single event listener. * * @see EventListener * @see EventObject ! * @author Jochen Hoenicke ! * @author Warren Levy */ - public class TooManyListenersException extends Exception { private static final long serialVersionUID = 5074640544770687831L; /** --- 39,62 ---- package java.util; /** * This exception is part of the java event model. It is thrown if an * event listener is added via the addXyzEventListener method, but the * object doesn't support any more listeners, e.g. it only supports a * single event listener. * + * @author Jochen Hoenicke + * @author Warren Levy * @see EventListener * @see EventObject ! * @since 1.1 ! * @status updated to 1.4 */ public class TooManyListenersException extends Exception { + /** + * Compatible with JDK 1.1+. + */ private static final long serialVersionUID = 5074640544770687831L; /** *************** public class TooManyListenersException e *** 69,75 **** /** * Constructs a TooManyListenersException with a detail message. ! * @param detail the detail message. */ public TooManyListenersException(String detail) { --- 68,75 ---- /** * Constructs a TooManyListenersException with a detail message. ! * ! * @param detail the detail message */ public TooManyListenersException(String detail) { diff -Nrc3pad gcc-3.2.3/libjava/java/util/TreeMap.java gcc-3.3/libjava/java/util/TreeMap.java *** gcc-3.2.3/libjava/java/util/TreeMap.java 2002-01-22 22:40:39.000000000 +0000 --- gcc-3.3/libjava/java/util/TreeMap.java 2003-01-03 17:02:06.000000000 +0000 *************** *** 1,6 **** /* TreeMap.java -- a class providing a basic Red-Black Tree data structure, mapping Object --> Object ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,6 ---- /* TreeMap.java -- a class providing a basic Red-Black Tree data structure, mapping Object --> Object ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class TreeMap extends AbstractMap *** 162,168 **** * * @author Eric Blake */ ! private static final class Node extends BasicMapEntry { // All fields package visible for use by nested classes. /** The color of this node. */ --- 162,168 ---- * * @author Eric Blake */ ! private static final class Node extends AbstractMap.BasicMapEntry { // All fields package visible for use by nested classes. /** The color of this node. */ *************** public class TreeMap extends AbstractMap *** 623,630 **** Node n = getNode(key); if (n == nil) return null; removeNode(n); ! return n.value; } /** --- 623,632 ---- Node n = getNode(key); if (n == nil) return null; + // Note: removeNode can alter the contents of n, so save value now. + Object result = n.value; removeNode(n); ! return result; } /** *************** public class TreeMap extends AbstractMap *** 863,869 **** int rowsize; // Fill each row that is completely full of nodes. ! for (rowsize = 2; rowsize + rowsize < count; rowsize <<= 1) { Node parent = row; Node last = null; --- 865,871 ---- int rowsize; // Fill each row that is completely full of nodes. ! for (rowsize = 2; rowsize + rowsize <= count; rowsize <<= 1) { Node parent = row; Node last = null; *************** public class TreeMap extends AbstractMap *** 1466,1475 **** */ public void remove() { - if (knownMod != modCount) - throw new ConcurrentModificationException(); if (last == null) throw new IllegalStateException(); removeNode(last); last = null; --- 1468,1477 ---- */ public void remove() { if (last == null) throw new IllegalStateException(); + if (knownMod != modCount) + throw new ConcurrentModificationException(); removeNode(last); last = null; *************** public class TreeMap extends AbstractMap *** 1768,1774 **** SubMap.this.clear(); } }; ! return this.keys; } } // class SubMap } // class TreeMap --- 1770,1776 ---- SubMap.this.clear(); } }; ! return this.values; } } // class SubMap } // class TreeMap diff -Nrc3pad gcc-3.2.3/libjava/java/util/WeakHashMap.java gcc-3.3/libjava/java/util/WeakHashMap.java *** gcc-3.2.3/libjava/java/util/WeakHashMap.java 2002-02-14 23:16:11.000000000 +0000 --- gcc-3.3/libjava/java/util/WeakHashMap.java 2002-06-18 15:40:05.000000000 +0000 *************** *** 1,4 **** ! /* java.util.WeakHashMap -- a hashtable that keeps only weak references to its keys, allowing the virtual machine to reclaim them Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. --- 1,4 ---- ! /* WeakHashMap -- a hashtable that keeps only weak references to its keys, allowing the virtual machine to reclaim them Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. *************** import java.lang.ref.WeakReference; *** 43,83 **** import java.lang.ref.ReferenceQueue; /** ! * A weak hash map has only weak references to the key. This means ! * that it allows the key to be garbage collected if they are not used ! * otherwise. If this happens, the weak hash map will eventually ! * remove the whole entry from this map.
          * ! * A weak hash map makes most sense, if the keys doesn't override the ! * equals-method: If there is no other reference to the * key nobody can ever look up the key in this table and so the entry ! * can be removed. This table also works, if the equals ! * method is overloaded, e.g. with Strings as keys, but you should be ! * prepared that some entries disappear spontaneously.
          * ! * You should also be prepared that this hash map behaves very ! * strange: The size of this map may spontaneously shrink (even if you ! * use a synchronized map and synchronize it); it behaves as if ! * another thread removes entries from this table without ! * synchronizations. The entry set returned by entrySet * has similar phenomenons: The size may spontaneously shrink, or an ! * entry, that was in the set before, suddenly disappears.
          * ! * A weak hash map is not meant for caches; use a normal map, with ! * soft references as values instead, or try {@link LinkedHashMap}.
          * ! * The weak hash map supports null values and null keys. The null key ! * is never deleted from the map (except explictly of course). ! * The performance of the methods are similar to that of a hash map.
          * ! * The value objects are strongly referenced by this table. So if a * value object maintains a strong reference to the key (either direct * or indirect) the key will never be removed from this map. According * to Sun, this problem may be fixed in a future release. It is not * possible to do it with the jdk 1.2 reference model, though. * * @author Jochen Hoenicke ! * @author Eric Blake * @see HashMap * @see WeakReference * @see LinkedHashMap --- 43,83 ---- import java.lang.ref.ReferenceQueue; /** ! * A weak hash map has only weak references to the key. This means that it ! * allows the key to be garbage collected if it is not used otherwise. If ! * this happens, the entry will eventually disappear from the map, ! * asynchronously. * ! *

          A weak hash map makes most sense when the keys doesn't override the ! * equals method: If there is no other reference to the * key nobody can ever look up the key in this table and so the entry ! * can be removed. This table also works when the equals ! * method is overloaded, such as String keys, but you should be prepared ! * to deal with some entries disappearing spontaneously. * ! *

          Other strange behaviors to be aware of: The size of this map may ! * spontaneously shrink (even if you use a synchronized map and synchronize ! * it); it behaves as if another thread removes entries from this table ! * without synchronization. The entry set returned by entrySet * has similar phenomenons: The size may spontaneously shrink, or an ! * entry, that was in the set before, suddenly disappears. * ! *

          A weak hash map is not meant for caches; use a normal map, with ! * soft references as values instead, or try {@link LinkedHashMap}. * ! *

          The weak hash map supports null values and null keys. The null key ! * is never deleted from the map (except explictly of course). The ! * performance of the methods are similar to that of a hash map. * ! *

          The value objects are strongly referenced by this table. So if a * value object maintains a strong reference to the key (either direct * or indirect) the key will never be removed from this map. According * to Sun, this problem may be fixed in a future release. It is not * possible to do it with the jdk 1.2 reference model, though. * * @author Jochen Hoenicke ! * @author Eric Blake (ebb9@email.byu.edu) ! * * @see HashMap * @see WeakReference * @see LinkedHashMap *************** import java.lang.ref.ReferenceQueue; *** 86,91 **** --- 86,94 ---- */ public class WeakHashMap extends AbstractMap implements Map { + // WARNING: WeakHashMap is a CORE class in the bootstrap cycle. See the + // comments in vm/reference/java/lang/Runtime for implications of this fact. + /** * The default capacity for an instance of HashMap. * Sun's documentation mildly suggests that this (11) is the correct *************** public class WeakHashMap extends Abstrac *** 148,154 **** /** * The rounded product of the capacity (i.e. number of buckets) and * the load factor. When the number of elements exceeds the ! * threshold, the HashMap calls

          rehash()
          . */ private int threshold; --- 151,157 ---- /** * The rounded product of the capacity (i.e. number of buckets) and * the load factor. When the number of elements exceeds the ! * threshold, the HashMap calls rehash(). */ private int threshold; *************** public class WeakHashMap extends Abstrac *** 364,374 **** /** * The slot of this entry. This should be ! *
          !      *  Math.abs(key.hashCode() % buckets.length)
          !      * 
          * But since the key may be silently removed we have to remember * the slot number. * If this bucket was removed the slot is -1. This marker will * prevent the bucket from being removed twice. */ --- 367,377 ---- /** * The slot of this entry. This should be ! * Math.abs(key.hashCode() % buckets.length). ! * * But since the key may be silently removed we have to remember * the slot number. + * * If this bucket was removed the slot is -1. This marker will * prevent the bucket from being removed twice. */ *************** public class WeakHashMap extends Abstrac *** 503,511 **** private final WeakEntrySet theEntrySet; /** ! * The hash buckets. These are linked lists. */ ! private WeakBucket[] buckets; /** * Creates a new weak hash map with default load factor and default --- 506,515 ---- private final WeakEntrySet theEntrySet; /** ! * The hash buckets. These are linked lists. Package visible for use in ! * nested classes. */ ! WeakBucket[] buckets; /** * Creates a new weak hash map with default load factor and default *************** public class WeakHashMap extends Abstrac *** 676,685 **** /** * Removes a bucket from this hash map, if it wasn't removed before ! * (e.g. one time through rehashing and one time through reference queue) * @param bucket the bucket to remove. */ ! private void internalRemove(WeakBucket bucket) { int slot = bucket.slot; if (slot == -1) --- 680,691 ---- /** * Removes a bucket from this hash map, if it wasn't removed before ! * (e.g. one time through rehashing and one time through reference queue). ! * Package visible for use in nested classes. ! * * @param bucket the bucket to remove. */ ! void internalRemove(WeakBucket bucket) { int slot = bucket.slot; if (slot == -1) *************** public class WeakHashMap extends Abstrac *** 870,873 **** cleanQueue(); return super.values(); } ! } --- 876,879 ---- cleanQueue(); return super.values(); } ! } // class WeakHashMap diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/DataFormatException.java gcc-3.3/libjava/java/util/zip/DataFormatException.java *** gcc-3.2.3/libjava/java/util/zip/DataFormatException.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/DataFormatException.java 2002-06-16 21:15:44.000000000 +0000 *************** *** 1,5 **** ! /* DataformatException.java - Exception thrown when compressed data is corrupt ! Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* DataformatException.java -- thrown when compressed data is corrupt ! Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,61 **** package java.util.zip; - /* Written using on-line Java Platform 1.2 API Specification. - * Believed complete and correct. - */ - /** * Exception thrown when compressed data is corrupt. * * @author Tom Tromey * @author John Leuner ! * @since JDK 1.1 */ public class DataFormatException extends Exception { ! public DataFormatException () { - super(); } ! public DataFormatException (String msg) { super(msg); } --- 37,70 ---- package java.util.zip; /** * Exception thrown when compressed data is corrupt. * * @author Tom Tromey * @author John Leuner ! * @since 1.1 ! * @status updated to 1.4 */ public class DataFormatException extends Exception { ! /** ! * Compatible with JDK 1.1+. ! */ ! private static final long serialVersionUID = 2219632870893641452L; ! ! /** ! * Create an exception without a message. ! */ ! public DataFormatException() { } ! /** ! * Create an exception with a message. ! * ! * @param msg the message ! */ ! public DataFormatException(String msg) { super(msg); } diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/GZIPInputStream.java gcc-3.3/libjava/java/util/zip/GZIPInputStream.java *** gcc-3.2.3/libjava/java/util/zip/GZIPInputStream.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/GZIPInputStream.java 2002-11-16 00:41:32.000000000 +0000 *************** *** 1,5 **** /* GZIPInputStream.java - Input filter for reading gzip file ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* GZIPInputStream.java - Input filter for reading gzip file ! Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class GZIPInputStream extends Inf *** 141,168 **** if (r == -1) { eos = true; ! int header_crc = read4 (); if (crc.getValue() != header_crc) ! throw new ZipException ("corrupted gzip file"); ! // Read final `ISIZE' field. ! // FIXME: should we check this length? ! read4 (); return -1; } crc.update(buf, off, r); return r; } ! private final int read4 () throws IOException { ! int byte0 = in.read(); ! int byte1 = in.read(); ! int byte2 = in.read(); ! int byte3 = in.read(); ! if (byte3 < 0) ! throw new ZipException (".zip archive ended prematurely"); ! return ((byte3 & 0xFF) << 24) + ((byte2 & 0xFF) << 16) ! + ((byte1 & 0xFF) << 8) + (byte0 & 0xFF); } // Checksum used by this input stream. --- 141,174 ---- if (r == -1) { eos = true; ! ! byte[] tmp = new byte[8]; ! // First copy remaining bytes from inflater input buffer. ! int avail = inf.getRemaining (); ! System.arraycopy (this.buf, this.len - avail, tmp, 0, avail); ! ! // Now read remaining bytes from wrapped input stream. ! for (int i = avail; i < 8; ++i) ! { ! tmp[i] = (byte) eof_read (); ! } ! ! int header_crc = read4 (tmp, 0); if (crc.getValue() != header_crc) ! throw new ZipException ("corrupted gzip file - crc mismatch"); ! int isize = read4 (tmp, 4); ! if (inf.getTotalOut() != isize) ! throw new ZipException ("corrupted gzip file - size mismatch"); return -1; } crc.update(buf, off, r); return r; } ! private final int read4 (byte[] buf, int offset) throws IOException { ! return (((buf[offset + 3] & 0xFF) << 24) + ((buf[offset + 2] & 0xFF) << 16) ! + ((buf[offset + 1] & 0xFF) << 8) + (buf[offset] & 0xFF)); } // Checksum used by this input stream. diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/InflaterInputStream.java gcc-3.3/libjava/java/util/zip/InflaterInputStream.java *** gcc-3.2.3/libjava/java/util/zip/InflaterInputStream.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/InflaterInputStream.java 2003-02-13 23:16:27.000000000 +0000 *************** *** 1,5 **** /* InflaterInputStream.java - Input stream filter for decompressing ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- /* InflaterInputStream.java - Input stream filter for decompressing ! Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** public class InflaterInputStream extends *** 90,114 **** { if (inf == null) throw new IOException ("stream closed"); if (inf.finished()) return -1; ! if (inf.needsInput()) ! fill (); ! int count; ! try { ! count = inf.inflate(buf, off, len); ! if (count == 0) { ! if (this.len == -1) ! return -1; // Couldn't get any more data to feed to the Inflater ! if (inf.needsDictionary()) ! throw new ZipException ("Inflater needs Dictionary"); ! } ! } ! catch (DataFormatException dfe) ! { ! throw new ZipException (dfe.getMessage()); } return count; } --- 90,123 ---- { if (inf == null) throw new IOException ("stream closed"); + if (len == 0) + return 0; if (inf.finished()) return -1; ! ! int count = 0; ! while (count == 0) { ! if (inf.needsInput()) ! fill (); ! try { ! count = inf.inflate(buf, off, len); ! if (count == 0) ! { ! if (this.len == -1) ! { ! // Couldn't get any more data to feed to the Inflater ! return -1; ! } ! if (inf.needsDictionary()) ! throw new ZipException ("Inflater needs Dictionary"); ! } ! } ! catch (DataFormatException dfe) ! { ! throw new ZipException (dfe.getMessage()); ! } } return count; } diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/natDeflater.cc gcc-3.3/libjava/java/util/zip/natDeflater.cc *** gcc-3.2.3/libjava/java/util/zip/natDeflater.cc 2001-03-26 07:05:32.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/natDeflater.cc 2002-10-16 14:58:15.000000000 +0000 *************** *** 1,6 **** // natDeflater.cc - Implementation of Deflater native methods. ! /* Copyright (C) 1999 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natDeflater.cc - Implementation of Deflater native methods. ! /* Copyright (C) 1999, 2002 Free Software Foundation This file is part of libgcj. *************** java::util::zip::Deflater::reset () *** 124,130 **** --- 124,132 ---- z_streamp s = (z_streamp) zstream; // Just ignore errors. deflateReset (s); + s->avail_in = 0; flush_flag = 0; + is_finished = false; } void diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/natInflater.cc gcc-3.3/libjava/java/util/zip/natInflater.cc *** gcc-3.2.3/libjava/java/util/zip/natInflater.cc 2001-03-26 07:05:32.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/natInflater.cc 2002-10-16 14:58:15.000000000 +0000 *************** *** 1,6 **** // natInflater.cc - Implementation of Inflater native methods. ! /* Copyright (C) 1999 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // natInflater.cc - Implementation of Inflater native methods. ! /* Copyright (C) 1999, 2002 Free Software Foundation This file is part of libgcj. *************** java::util::zip::Inflater::reset () *** 149,154 **** --- 149,157 ---- z_streamp s = (z_streamp) zstream; // Just ignore errors. inflateReset (s); + s->avail_in = 0; + is_finished = false; + dict_needed = false; } void diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/ZipConstants.java gcc-3.3/libjava/java/util/zip/ZipConstants.java *** gcc-3.2.3/libjava/java/util/zip/ZipConstants.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/ZipConstants.java 2002-06-15 18:31:13.000000000 +0000 *************** *** 1,5 **** ! /* ZipConstants.java - Some constants used in the zip package ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* java.util.zip.ZipConstants ! Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,55 **** package java.util.zip; - /** - * Some constants used in the zip package. - *

          - * Since this package local interface is completely undocumented no effort - * is made to make it compatible with other implementations. - * If someone is really interested you can probably come up with the right - * constants and documentation by studying the Info-ZIP zipfile.c constants. - */ interface ZipConstants { ! // Size in bytes of local file header, including signature. ! public static final int LOCAL_FILE_HEADER_SIZE = 30; ! // Size in bytes of the "end of central directory" record, with signature. ! public static final int END_CENTRAL_DIR_SIZE = 22; } --- 37,97 ---- package java.util.zip; interface ZipConstants { ! /* The local file header */ ! public final static int LOCHDR = 30; ! public final static int LOCSIG = 'P'|('K'<<8)|(3<<16)|(4<<24); ! public final static int LOCVER = 4; ! public final static int LOCFLG = 6; ! public final static int LOCHOW = 8; ! public final static int LOCTIM = 10; ! public final static int LOCCRC = 14; ! public final static int LOCSIZ = 18; ! public final static int LOCLEN = 22; ! public final static int LOCNAM = 26; ! public final static int LOCEXT = 28; ! ! /* The Data descriptor */ ! public final static int EXTSIG = 'P'|('K'<<8)|(7<<16)|(8<<24); ! public final static int EXTHDR = 16; ! ! public final static int EXTCRC = 4; ! public final static int EXTSIZ = 8; ! public final static int EXTLEN = 12; ! ! /* The central directory file header */ ! public final static int CENSIG = 'P'|('K'<<8)|(1<<16)|(2<<24); ! public final static int CENHDR = 46; ! ! public final static int CENVEM = 4; ! public final static int CENVER = 6; ! public final static int CENFLG = 8; ! public final static int CENHOW = 10; ! public final static int CENTIM = 12; ! public final static int CENCRC = 16; ! public final static int CENSIZ = 20; ! public final static int CENLEN = 24; ! public final static int CENNAM = 28; ! public final static int CENEXT = 30; ! public final static int CENCOM = 32; ! public final static int CENDSK = 34; ! public final static int CENATT = 36; ! public final static int CENATX = 38; ! public final static int CENOFF = 42; ! ! /* The entries in the end of central directory */ ! public final static int ENDSIG = 'P'|('K'<<8)|(5<<16)|(6<<24); ! public final static int ENDHDR = 22; ! ! /* The following two fields are missing in SUN JDK */ ! final static int ENDNRD = 4; ! final static int ENDDCD = 6; ! public final static int ENDSUB = 8; ! public final static int ENDTOT = 10; ! public final static int ENDSIZ = 12; ! public final static int ENDOFF = 16; ! public final static int ENDCOM = 20; } + diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/ZipEntry.java gcc-3.3/libjava/java/util/zip/ZipEntry.java *** gcc-3.2.3/libjava/java/util/zip/ZipEntry.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/ZipEntry.java 2003-02-21 17:01:44.000000000 +0000 *************** *** 1,5 **** ! /* ZipEntry.java - Represents entries in a zip file archive ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* java.util.zip.ZipEntry ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** obligated to do so. If you do not wish *** 36,236 **** exception statement from your version. */ package java.util.zip; /** ! * @author Per Bothner ! * @date January 6, 1999. ! */ ! ! /* ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Believed complete and correct. ! */ ! ! /** ! * Represents entries in a zip file archive. ! * An Entry cn be created by giving a name or by giving an already existing ! * ZipEntries whose values should be copied. The name normally represents a ! * file path name or directory name. */ public class ZipEntry implements ZipConstants, Cloneable { ! // These values were determined using a simple test program. ! public static final int STORED = 0; ! public static final int DEFLATED = 8; ! String comment; ! long compressedSize = -1; ! long crc = -1; ! byte[] extra; ! int method = -1; ! String name; ! long size = -1; ! long time = -1; ! long relativeOffset = -1; ! ZipEntry next; ! public ZipEntry (String name) { ! if (name.length() > 65535) ! throw new IllegalArgumentException (); this.name = name; } /** ! * Creates a new ZipEntry using the fields of a given ZipEntry. ! * The comment, compressedSize, crc, extra, method, name, size, time and ! * relativeOffset fields are copied from the given entry. ! * Note that the contents of the extra byte array field is not cloned, ! * only the reference is copied. ! * The clone() method does clone the contents of the extra byte array if ! * needed. ! * @since 1.2 */ ! public ZipEntry (ZipEntry ent) { ! comment = ent.comment; ! compressedSize = ent.compressedSize; ! crc = ent.crc; ! extra = ent.extra; ! method = ent.method; ! name = ent.name; ! size = ent.size; ! time = ent.time; ! relativeOffset = ent.relativeOffset; } ! ! /** ! * Creates a clone of this ZipEntry. Calls new ZipEntry (this) ! * and creates a clone of the contents of the extra byte array field. ! * ! * @since 1.2 ! */ ! public Object clone () { ! // JCL defines this as being the same as the copy constructor above, ! // except that value of the "extra" field is also copied. ! ZipEntry clone = new ZipEntry (this); ! clone.extra = (byte[]) extra.clone (); ! return clone; } ! public String getComment () { return comment; } ! public long getCompressedSize () { return compressedSize; } ! public long getCrc () { return crc; } ! public byte[] getExtra() { return extra; } ! public int getMethod () { return method; } ! public String getName () { return name; } ! public long getSize () { return size; } ! public long getTime () { return time; } ! public boolean isDirectory () { ! if (name != null) ! { ! int nlen = name.length(); ! if (nlen > 0 && name.charAt(nlen-1) == '/') ! return true; ! } ! return false; } ! public void setComment (String comment) { ! if (comment != null && comment.length() > 65535) ! throw new IllegalArgumentException (); ! this.comment = comment; } ! /** ! * Sets the compressedSize of this ZipEntry. ! * The new size must be between 0 and 0xffffffffL. ! * @since 1.2 */ ! public void setCompressedSize (long compressedSize) { ! if (compressedSize < 0 || compressedSize > 0xffffffffL) ! throw new IllegalArgumentException (); ! this.compressedSize = compressedSize; } ! public void setCrc (long crc) { ! if (crc < 0 || crc > 0xffffffffL) ! throw new IllegalArgumentException (); ! this.crc = crc; } ! public void setExtra (byte[] extra) { ! if (extra != null && extra.length > 65535) ! throw new IllegalArgumentException (); ! this.extra = extra; } ! public void setMethod (int method) { ! if (method != DEFLATED && method != STORED) ! throw new IllegalArgumentException (); ! this.method = method; } ! public void setSize (long size) { ! if (size < 0 || size > 0xffffffffL) ! throw new IllegalArgumentException (); ! this.size = size; } ! public void setTime (long time) { ! this.time = time; } ! private final static short[] daysToMonthStart = { ! //Jan Feb Mar Apr May Jun Jul ! 0, 31, 31+28, 2*31+28, 2*31+28+30, 3*31+28+30, 3*31+28+2*30, ! // Aug Sep Oct Nov Dec ! 4*31+28+2*30, 5*31+28+2*30, 5*31+28+3*30, 6*31+28+3*30, 6*31+28+4*30}; ! /** Convert a DOS-style type value to milliseconds since 1970. */ ! static long timeFromDOS (int date, int time) { ! int sec = 2 * (time & 0x1f); ! int min = (time >> 5) & 0x3f; ! int hrs = (time >> 11) & 0x1f; ! int day = date & 0x1f; ! int mon = ((date >> 5) & 0xf) - 1; ! int year = ((date >> 9) & 0x7f) + 10; /* Since 1970. */ ! // Guard against invalid or missing date causing IndexOutOfBoundsException. ! if (mon < 0 || mon > 11) ! return -1; ! long mtime = (((hrs * 60) + min) * 60 + sec) * 1000; ! // Leap year calculations are rather trivial in this case ... ! int days = 365 * year + ((year+1)>>2); ! days += daysToMonthStart[mon]; ! if ((year & 3) == 0 && mon > 1) ! days++; ! days += day; ! return (days * 24*60*60L + ((hrs * 60) + min) * 60 + sec) * 1000L; } - public String toString () { return name; } - /** ! * Returns the hashcode of the name of this ZipEntry. */ ! public int hashCode () { return name.hashCode (); } } --- 36,413 ---- exception statement from your version. */ package java.util.zip; + import java.util.Calendar; + import java.util.TimeZone; + import java.util.Date; /** ! * This class represents a member of a zip archive. ZipFile and ! * ZipInputStream will give you instances of this class as information ! * about the members in an archive. On the other hand ZipOutputStream ! * needs an instance of this class to create a new member. ! * ! * @author Jochen Hoenicke */ public class ZipEntry implements ZipConstants, Cloneable { ! private static int KNOWN_SIZE = 1; ! private static int KNOWN_CSIZE = 2; ! private static int KNOWN_CRC = 4; ! private static int KNOWN_TIME = 8; ! private static Calendar cal; ! private String name; ! private int size; ! private int compressedSize; ! private int crc; ! private int dostime; ! private short known = 0; ! private short method = -1; ! private byte[] extra = null; ! private String comment = null; ! int flags; /* used by ZipOutputStream */ ! int offset; /* used by ZipFile and ZipOutputStream */ ! ! ! /** ! * Compression method. This method doesn't compress at all. ! */ ! public final static int STORED = 0; ! /** ! * Compression method. This method uses the Deflater. ! */ ! public final static int DEFLATED = 8; ! ! /** ! * Creates a zip entry with the given name. ! * @param name the name. May include directory components separated ! * by '/'. ! * ! * @exception NullPointerException when name is null. ! * @exception IllegalArgumentException when name is bigger then 65535 chars. ! */ ! public ZipEntry(String name) { ! int length = name.length(); ! if (length > 65535) ! throw new IllegalArgumentException("name length is " + length); this.name = name; } /** ! * Creates a copy of the given zip entry. ! * @param e the entry to copy. */ ! public ZipEntry(ZipEntry e) { ! name = e.name; ! known = e.known; ! size = e.size; ! compressedSize = e.compressedSize; ! crc = e.crc; ! dostime = e.dostime; ! method = e.method; ! extra = e.extra; ! comment = e.comment; } ! ! final void setDOSTime(int dostime) { ! this.dostime = dostime; ! known |= KNOWN_TIME; } ! final int getDOSTime() ! { ! if ((known & KNOWN_TIME) == 0) ! return 0; ! else ! return dostime; ! } ! /** ! * Creates a copy of this zip entry. ! */ ! /** ! * Clones the entry. ! */ ! public Object clone() ! { ! try ! { ! // The JCL says that the `extra' field is also copied. ! ZipEntry clone = (ZipEntry) super.clone(); ! if (extra != null) ! clone.extra = (byte[]) extra.clone(); ! return clone; ! } ! catch (CloneNotSupportedException ex) ! { ! throw new InternalError(); ! } ! } ! /** ! * Returns the entry name. The path components in the entry are ! * always separated by slashes ('/'). ! */ ! public String getName() ! { ! return name; ! } ! /** ! * Sets the time of last modification of the entry. ! * @time the time of last modification of the entry. ! */ ! public void setTime(long time) ! { ! Calendar cal = getCalendar(); ! synchronized (cal) ! { ! cal.setTime(new Date(time*1000L)); ! dostime = (cal.get(cal.YEAR) - 1980 & 0x7f) << 25 ! | (cal.get(cal.MONTH) + 1) << 21 ! | (cal.get(cal.DAY_OF_MONTH)) << 16 ! | (cal.get(cal.HOUR_OF_DAY)) << 11 ! | (cal.get(cal.MINUTE)) << 5 ! | (cal.get(cal.SECOND)) >> 1; ! } ! dostime = (int) (dostime / 1000L); ! this.known |= KNOWN_TIME; ! } ! /** ! * Gets the time of last modification of the entry. ! * @return the time of last modification of the entry, or -1 if unknown. ! */ ! public long getTime() ! { ! if ((known & KNOWN_TIME) == 0) ! return -1; ! ! int sec = 2 * (dostime & 0x1f); ! int min = (dostime >> 5) & 0x3f; ! int hrs = (dostime >> 11) & 0x1f; ! int day = (dostime >> 16) & 0x1f; ! int mon = ((dostime >> 21) & 0xf) - 1; ! int year = ((dostime >> 25) & 0x7f) + 1980; /* since 1900 */ ! ! try ! { ! cal = getCalendar(); ! synchronized (cal) ! { ! cal.set(year, mon, day, hrs, min, sec); ! return cal.getTime().getTime(); ! } ! } ! catch (RuntimeException ex) ! { ! /* Ignore illegal time stamp */ ! known &= ~KNOWN_TIME; ! return -1; ! } ! } ! private static synchronized Calendar getCalendar() ! { ! if (cal == null) ! cal = Calendar.getInstance(); ! return cal; ! } ! /** ! * Sets the size of the uncompressed data. ! * @exception IllegalArgumentException if size is not in 0..0xffffffffL ! */ ! public void setSize(long size) ! { ! if ((size & 0xffffffff00000000L) != 0) ! throw new IllegalArgumentException(); ! this.size = (int) size; ! this.known |= KNOWN_SIZE; ! } ! /** ! * Gets the size of the uncompressed data. ! * @return the size or -1 if unknown. ! */ ! public long getSize() { ! return (known & KNOWN_SIZE) != 0 ? size & 0xffffffffL : -1L; } ! /** ! * Sets the size of the compressed data. ! * @exception IllegalArgumentException if size is not in 0..0xffffffffL ! */ ! public void setCompressedSize(long csize) { ! if ((csize & 0xffffffff00000000L) != 0) ! throw new IllegalArgumentException(); ! this.compressedSize = (int) csize; ! this.known |= KNOWN_CSIZE; } ! /** ! * Gets the size of the compressed data. ! * @return the size or -1 if unknown. */ ! public long getCompressedSize() { ! return (known & KNOWN_CSIZE) != 0 ? compressedSize & 0xffffffffL : -1L; } ! /** ! * Sets the crc of the uncompressed data. ! * @exception IllegalArgumentException if crc is not in 0..0xffffffffL ! */ ! public void setCrc(long crc) { ! if ((crc & 0xffffffff00000000L) != 0) ! throw new IllegalArgumentException(); ! this.crc = (int) crc; ! this.known |= KNOWN_CRC; } ! /** ! * Gets the crc of the uncompressed data. ! * @return the crc or -1 if unknown. ! */ ! public long getCrc() { ! return (known & KNOWN_CRC) != 0 ? crc & 0xffffffffL : -1L; } ! /** ! * Sets the compression method. Only DEFLATED and STORED are ! * supported. ! * @exception IllegalArgumentException if method is not supported. ! * @see ZipOutputStream#DEFLATED ! * @see ZipOutputStream#STORED ! */ ! public void setMethod(int method) { ! if (method != ZipOutputStream.STORED ! && method != ZipOutputStream.DEFLATED) ! throw new IllegalArgumentException(); ! this.method = (short) method; } ! /** ! * Gets the compression method. ! * @return the compression method or -1 if unknown. ! */ ! public int getMethod() { ! return method; } ! /** ! * Sets the extra data. ! * @exception IllegalArgumentException if extra is longer than 0xffff bytes. ! */ ! public void setExtra(byte[] extra) { ! if (extra == null) ! { ! this.extra = null; ! return; ! } ! ! if (extra.length > 0xffff) ! throw new IllegalArgumentException(); ! this.extra = extra; ! try ! { ! int pos = 0; ! while (pos < extra.length) ! { ! int sig = (extra[pos++] & 0xff) ! | (extra[pos++] & 0xff) << 8; ! int len = (extra[pos++] & 0xff) ! | (extra[pos++] & 0xff) << 8; ! if (sig == 0x5455) ! { ! /* extended time stamp */ ! int flags = extra[pos]; ! if ((flags & 1) != 0) ! { ! long time = ((extra[pos+1] & 0xff) ! | (extra[pos+2] & 0xff) << 8 ! | (extra[pos+3] & 0xff) << 16 ! | (extra[pos+4] & 0xff) << 24); ! setTime(time); ! } ! } ! pos += len; ! } ! } ! catch (ArrayIndexOutOfBoundsException ex) ! { ! /* be lenient */ ! return; ! } } ! /** ! * Gets the extra data. ! * @return the extra data or null if not set. ! */ ! public byte[] getExtra() ! { ! return extra; ! } ! /** ! * Sets the entry comment. ! * @exception IllegalArgumentException if comment is longer than 0xffff. ! */ ! public void setComment(String comment) { ! if (comment != null && comment.length() > 0xffff) ! throw new IllegalArgumentException(); ! this.comment = comment; ! } ! /** ! * Gets the comment. ! * @return the comment or null if not set. ! */ ! public String getComment() ! { ! return comment; ! } ! /** ! * Gets true, if the entry is a directory. This is solely ! * determined by the name, a trailing slash '/' marks a directory. ! */ ! public boolean isDirectory() ! { ! int nlen = name.length(); ! return nlen > 0 && name.charAt(nlen - 1) == '/'; ! } ! /** ! * Gets the string representation of this ZipEntry. This is just ! * the name as returned by getName(). ! */ ! public String toString() ! { ! return name; } /** ! * Gets the hashCode of this ZipEntry. This is just the hashCode ! * of the name. Note that the equals method isn't changed, though. */ ! public int hashCode() ! { ! return name.hashCode(); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/ZipException.java gcc-3.3/libjava/java/util/zip/ZipException.java *** gcc-3.2.3/libjava/java/util/zip/ZipException.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/ZipException.java 2002-06-16 21:15:44.000000000 +0000 *************** *** 1,5 **** ! /* ZipException.java - Exception representing a zip related error ! Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* ZipException.java - exception representing a zip related error ! Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** exception statement from your version. * *** 37,60 **** package java.util.zip; ! /* Written using on-line Java Platform 1.2 API Specification. ! * Believed complete and correct. ! */ /** ! * Is thrown during the creation or input of a zip file. * * @author Jochen Hoenicke * @author Per Bothner ! * @since JDK 1.1 */ ! public class ZipException extends java.io.IOException { ! public ZipException () { - super(); } public ZipException (String msg) { super(msg); --- 37,70 ---- package java.util.zip; ! import java.io.IOException; /** ! * Thrown during the creation or input of a zip file. * * @author Jochen Hoenicke * @author Per Bothner ! * @status updated to 1.4 */ ! public class ZipException extends IOException { ! /** ! * Compatible with JDK 1.0+. ! */ ! private static final long serialVersionUID = 8000196834066748623L; ! ! /** ! * Create an exception without a message. ! */ ! public ZipException() { } + /** + * Create an exception with a message. + * + * @param msg the message + */ public ZipException (String msg) { super(msg); diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/ZipFile.java gcc-3.3/libjava/java/util/zip/ZipFile.java *** gcc-3.2.3/libjava/java/util/zip/ZipFile.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/ZipFile.java 2003-02-21 12:36:59.000000000 +0000 *************** *** 1,5 **** ! /* ZipFile.java - Read contents of a ZIP file ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* java.util.zip.ZipFile ! Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** exception statement from your version. * *** 37,268 **** package java.util.zip; ! import java.io.*; ! /* Written using on-line Java Platform 1.2 API Specification ! * and JCL book. ! * Believed complete and correct. */ - public class ZipFile implements ZipConstants { - public static final int OPEN_READ = 1; - public static final int OPEN_DELETE = 4; ! public ZipFile (String fname) throws IOException { ! this(new File(fname)); } ! public ZipFile (File f) throws IOException { ! this(f, OPEN_READ); } ! public ZipFile (File f, int mode) throws IOException { - if (mode != OPEN_READ && mode != (OPEN_READ | OPEN_DELETE)) - throw new IllegalArgumentException - ("mode can only be OPEN_READ or OPEN_READ | OPEN_DELETE"); - if ((mode & OPEN_DELETE) != 0) { ! delete_on_close = f; ! f.deleteOnExit(); ! } ! else ! { ! delete_on_close = null; } ! file = new RandomAccessFile(f, "r"); ! name = f.getName(); ! readDirectory (); } ! void readDirectory () throws IOException { ! long size = file.length (); ! if (size < ZipConstants.END_CENTRAL_DIR_SIZE) ! throw new ZipException ("zipfile too short"); ! // We do not handle a "zipfile comment", which the appnote says can ! // be at the end of a .zip file. We could handle this by seeking ! // to the beginning and reading forwards. ! file.seek(size - ZipConstants.END_CENTRAL_DIR_SIZE); ! if (file.read() != 'P' ! || file.read() != 'K' ! || file.read() != '\005' ! || file.read() != '\006') ! throw new ZipException("not a valid zipfile"); ! file.skipBytes(6); ! numEntries = readu2(); ! int dir_size = read4 (); // Read "size of the central directory". ! file.seek(size - (dir_size + ZipConstants.END_CENTRAL_DIR_SIZE)); ! ZipEntry last = null; ! for (int i = 0; i < numEntries; i++) { ! file.skipBytes(10); ! int method = readu2(); ! int modtime = readu2(); ! int moddate = readu2(); ! int crc = read4(); ! int compressedSize = read4(); ! int uncompressedSize = read4(); ! int filenameLength = readu2(); ! int extraLength = readu2(); ! int commentLength = readu2(); ! int diskNumberStart = readu2(); ! int intAttributes = readu2(); ! int extAttributes = read4(); ! int relativeOffset = read4(); ! byte[] bname = new byte[filenameLength]; ! file.readFully(bname); ! ZipEntry entry = new ZipEntry(new String(bname, "8859_1")); ! if (extraLength > 0) { ! byte[] bextra = new byte[extraLength]; ! file.readFully(bextra); ! entry.extra = bextra; } ! if (commentLength > 0) { ! byte[] bcomment = new byte[commentLength]; ! file.readFully(bcomment); ! entry.comment = new String(bcomment, "8859_1"); } ! entry.compressedSize = compressedSize; ! entry.size = uncompressedSize; ! entry.crc = (long) crc & 0xffffffffL; ! entry.method = method; ! entry.relativeOffset = relativeOffset; ! entry.time = ZipEntry.timeFromDOS(moddate, modtime); ! if (last == null) ! entries = entry; ! else ! last.next = entry; ! last = entry; } } ! public java.util.Enumeration entries() { ! return new ZipEnumeration(this); } ! public void close() throws IOException { ! file.close(); ! entries = null; ! numEntries = 0; ! if (delete_on_close != null) ! delete_on_close.delete(); } ! public ZipEntry getEntry(String name) { ! for (ZipEntry entry = entries; entry != null; entry = entry.next) { ! if (name.equals(entry.getName())) ! return entry; } - return null; } ! public InputStream getInputStream(ZipEntry ze) throws IOException { ! byte[] buffer = new byte[(int) ze.getCompressedSize()]; ! ! /* Read the size of the extra field, and skip to the start of the ! data. */ ! file.seek (ze.relativeOffset + ZipConstants.LOCAL_FILE_HEADER_SIZE - 2); ! int extraFieldLength = readu2(); ! file.skipBytes (ze.getName().length() + extraFieldLength); ! file.readFully(buffer); ! InputStream is = new ByteArrayInputStream (buffer); ! if (ze.getMethod() == ZipEntry.DEFLATED) ! // Data in zipfile entries does not have a zlib header, so construct ! // an Inflater with the `nowrapper' option. ! is = new InflaterInputStream (is, new Inflater (true), 512); ! return is; } ! public String getName () { ! return name; } /** ! * Returns the number of entries in this ZipFile. ! * @exception IllegalStateException if the ZipFile has been closed. * ! * @since 1.2 */ ! public int size () { ! if (entries == null) ! throw new IllegalStateException("ZipFile already closed"); ! else ! return numEntries; } ! protected void finalize () throws IOException { ! close(); ! } ! private int readu2 () throws IOException { ! int byte0 = file.read(); ! int byte1 = file.read(); ! if (byte0 < 0 || byte1 < 0) ! throw new ZipException (".zip archive ended prematurely"); ! return ((byte1 & 0xFF) << 8) | (byte0 & 0xFF); } ! private int read4 () throws IOException { ! int byte0 = file.read(); ! int byte1 = file.read(); ! int byte2 = file.read(); ! int byte3 = file.read(); ! if (byte3 < 0) ! throw new ZipException (".zip archive ended prematurely"); ! return ((byte3 & 0xFF) << 24) + ((byte2 & 0xFF) << 16) ! + ((byte1 & 0xFF) << 8) + (byte0 & 0xFF); } ! ZipEntry entries; ! int numEntries; ! RandomAccessFile file; ! String name; ! /** File to delete on close or null. */ ! File delete_on_close; ! ! } ! final class ZipEnumeration implements java.util.Enumeration ! { ! ZipEntry entry; ! ZipEnumeration (ZipFile zfile) ! { ! entry = zfile.entries; } ! public boolean hasMoreElements () { ! return entry != null; ! } ! public Object nextElement () ! { ! ZipEntry cur = entry; ! if (cur == null) ! throw new java.util.NoSuchElementException(); ! entry = cur.next; ! return cur; } } --- 37,547 ---- package java.util.zip; ! import java.io.BufferedInputStream; ! import java.io.ByteArrayInputStream; ! import java.io.DataInput; ! import java.io.DataInputStream; ! import java.io.File; ! import java.io.InputStream; ! import java.io.IOException; ! import java.io.EOFException; ! import java.io.RandomAccessFile; ! import java.util.Enumeration; ! import java.util.HashMap; ! import java.util.Iterator; ! import java.util.NoSuchElementException; ! /** ! * This class represents a Zip archive. You can ask for the contained ! * entries, or get an input stream for a file entry. The entry is ! * automatically decompressed. ! * ! * This class is thread safe: You can open input streams for arbitrary ! * entries in different threads. ! * ! * @author Jochen Hoenicke ! * @author Artur Biesiadowski */ public class ZipFile implements ZipConstants { ! /** ! * Mode flag to open a zip file for reading. ! */ ! public static final int OPEN_READ = 0x1; ! ! /** ! * Mode flag to delete a zip file after reading. ! */ ! public static final int OPEN_DELETE = 0x4; ! ! // Name of this zip file. ! private final String name; ! ! // File from which zip entries are read. ! private final RandomAccessFile raf; ! ! // The entries of this zip file when initialized and not yet closed. ! private HashMap entries; ! ! private boolean closed = false; ! ! /** ! * Opens a Zip file with the given name for reading. ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the file doesn't contain a valid zip ! * archive. ! */ ! public ZipFile(String name) throws ZipException, IOException { ! this.raf = new RandomAccessFile(name, "r"); ! this.name = name; } ! /** ! * Opens a Zip file reading the given File. ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the file doesn't contain a valid zip ! * archive. ! */ ! public ZipFile(File file) throws ZipException, IOException { ! this.raf = new RandomAccessFile(file, "r"); ! this.name = file.getName(); } ! /** ! * Opens a Zip file reading the given File in the given mode. ! * ! * If the OPEN_DELETE mode is specified, the zip file will be deleted at ! * some time moment after it is opened. It will be deleted before the zip ! * file is closed or the Virtual Machine exits. ! * ! * The contents of the zip file will be accessible until it is closed. ! * ! * The OPEN_DELETE mode is currently unimplemented in this library ! * ! * @since JDK1.3 ! * @param mode Must be one of OPEN_READ or OPEN_READ | OPEN_DELETE ! * ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the file doesn't contain a valid zip ! * archive. ! */ ! public ZipFile(File file, int mode) throws ZipException, IOException { if ((mode & OPEN_DELETE) != 0) { ! throw new IllegalArgumentException ! ("OPEN_DELETE mode not supported yet in java.util.zip.ZipFile"); } + this.raf = new RandomAccessFile(file, "r"); + this.name = file.getName(); + } ! /** ! * Read an unsigned short in little endian byte order from the given ! * DataInput stream using the given byte buffer. ! * ! * @param di DataInput stream to read from. ! * @param b the byte buffer to read in (must be at least 2 bytes long). ! * @return The value read. ! * ! * @exception IOException if a i/o error occured. ! * @exception EOFException if the file ends prematurely ! */ ! private final int readLeShort(DataInput di, byte[] b) throws IOException ! { ! di.readFully(b, 0, 2); ! return (b[0] & 0xff) | (b[1] & 0xff) << 8; } ! /** ! * Read an int in little endian byte order from the given ! * DataInput stream using the given byte buffer. ! * ! * @param di DataInput stream to read from. ! * @param b the byte buffer to read in (must be at least 4 bytes long). ! * @return The value read. ! * ! * @exception IOException if a i/o error occured. ! * @exception EOFException if the file ends prematurely ! */ ! private final int readLeInt(DataInput di, byte[] b) throws IOException { ! di.readFully(b, 0, 4); ! return ((b[0] & 0xff) | (b[1] & 0xff) << 8) ! | ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16; ! } ! ! /** ! * Read an unsigned short in little endian byte order from the given ! * byte buffer at the given offset. ! * ! * @param b the byte array to read from. ! * @param off the offset to read from. ! * @return The value read. ! */ ! private final int readLeShort(byte[] b, int off) ! { ! return (b[off] & 0xff) | (b[off+1] & 0xff) << 8; ! } ! ! /** ! * Read an int in little endian byte order from the given ! * byte buffer at the given offset. ! * ! * @param b the byte array to read from. ! * @param off the offset to read from. ! * @return The value read. ! */ ! private final int readLeInt(byte[] b, int off) ! { ! return ((b[off] & 0xff) | (b[off+1] & 0xff) << 8) ! | ((b[off+2] & 0xff) | (b[off+3] & 0xff) << 8) << 16; ! } ! ! ! /** ! * Read the central directory of a zip file and fill the entries ! * array. This is called exactly once when first needed. It is called ! * while holding the lock on raf. ! * ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the central directory is malformed ! */ ! private void readEntries() throws ZipException, IOException ! { ! /* Search for the End Of Central Directory. When a zip comment is ! * present the directory may start earlier. ! * FIXME: This searches the whole file in a very slow manner if the ! * file isn't a zip file. ! */ ! long pos = raf.length() - ENDHDR; ! byte[] ebs = new byte[CENHDR]; ! ! do { ! if (pos < 0) ! throw new ZipException ! ("central directory not found, probably not a zip file: " + name); ! raf.seek(pos--); ! } ! while (readLeInt(raf, ebs) != ENDSIG); ! ! if (raf.skipBytes(ENDTOT - ENDNRD) != ENDTOT - ENDNRD) ! throw new EOFException(name); ! int count = readLeShort(raf, ebs); ! if (raf.skipBytes(ENDOFF - ENDSIZ) != ENDOFF - ENDSIZ) ! throw new EOFException(name); ! int centralOffset = readLeInt(raf, ebs); ! ! entries = new HashMap(count+count/2); ! raf.seek(centralOffset); ! ! byte[] buffer = new byte[16]; ! for (int i = 0; i < count; i++) ! { ! raf.readFully(ebs); ! if (readLeInt(ebs, 0) != CENSIG) ! throw new ZipException("Wrong Central Directory signature: " + name); ! ! int method = readLeShort(ebs, CENHOW); ! int dostime = readLeInt(ebs, CENTIM); ! int crc = readLeInt(ebs, CENCRC); ! int csize = readLeInt(ebs, CENSIZ); ! int size = readLeInt(ebs, CENLEN); ! int nameLen = readLeShort(ebs, CENNAM); ! int extraLen = readLeShort(ebs, CENEXT); ! int commentLen = readLeShort(ebs, CENCOM); ! ! int offset = readLeInt(ebs, CENOFF); ! ! int needBuffer = Math.max(nameLen, commentLen); ! if (buffer.length < needBuffer) ! buffer = new byte[needBuffer]; ! ! raf.readFully(buffer, 0, nameLen); ! String name = new String(buffer, 0, 0, nameLen); ! ! ZipEntry entry = new ZipEntry(name); ! entry.setMethod(method); ! entry.setCrc(crc & 0xffffffffL); ! entry.setSize(size & 0xffffffffL); ! entry.setCompressedSize(csize & 0xffffffffL); ! entry.setDOSTime(dostime); ! if (extraLen > 0) { ! byte[] extra = new byte[extraLen]; ! raf.readFully(extra); ! entry.setExtra(extra); } ! if (commentLen > 0) { ! raf.readFully(buffer, 0, commentLen); ! entry.setComment(new String(buffer, 0, commentLen)); } ! entry.offset = offset; ! entries.put(name, entry); } } ! /** ! * Closes the ZipFile. This also closes all input streams given by ! * this class. After this is called, no further method should be ! * called. ! * ! * @exception IOException if a i/o error occured. ! */ ! public void close() throws IOException { ! synchronized (raf) ! { ! closed = true; ! entries = null; ! raf.close(); ! } } ! /** ! * Calls the close() method when this ZipFile has not yet ! * been explicitly closed. ! */ ! protected void finalize() throws IOException { ! if (!closed) close(); } ! /** ! * Returns an enumeration of all Zip entries in this Zip file. ! */ ! public Enumeration entries() { ! try { ! return new ZipEntryEnumeration(getEntries().values().iterator()); ! } ! catch (IOException ioe) ! { ! return null; } } ! /** ! * Checks that the ZipFile is still open and reads entries when necessary. ! * ! * @exception IllegalStateException when the ZipFile has already been closed. ! * @exception IOEexception when the entries could not be read. ! */ ! private HashMap getEntries() throws IOException { ! synchronized(raf) ! { ! if (closed) ! throw new IllegalStateException("ZipFile has closed: " + name); ! if (entries == null) ! readEntries(); ! return entries; ! } } ! /** ! * Searches for a zip entry in this archive with the given name. ! * ! * @param the name. May contain directory components separated by ! * slashes ('/'). ! * @return the zip entry, or null if no entry with that name exists. ! */ ! public ZipEntry getEntry(String name) { ! try ! { ! HashMap entries = getEntries(); ! ZipEntry entry = (ZipEntry) entries.get(name); ! return entry != null ? (ZipEntry) entry.clone() : null; ! } ! catch (IOException ioe) ! { ! return null; ! } } + + //access should be protected by synchronized(raf) + private byte[] locBuf = new byte[LOCHDR]; + /** ! * Checks, if the local header of the entry at index i matches the ! * central directory, and returns the offset to the data. ! * ! * @param entry to check. ! * @return the start offset of the (compressed) data. * ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the local header doesn't match the ! * central directory header */ ! private long checkLocalHeader(ZipEntry entry) throws IOException { ! synchronized (raf) ! { ! raf.seek(entry.offset); ! raf.readFully(locBuf); ! ! if (readLeInt(locBuf, 0) != LOCSIG) ! throw new ZipException("Wrong Local header signature: " + name); ! ! if (entry.getMethod() != readLeShort(locBuf, LOCHOW)) ! throw new ZipException("Compression method mismatch: " + name); ! ! if (entry.getName().length() != readLeShort(locBuf, LOCNAM)) ! throw new ZipException("file name length mismatch: " + name); ! ! int extraLen = entry.getName().length() + readLeShort(locBuf, LOCEXT); ! return entry.offset + LOCHDR + extraLen; ! } } ! /** ! * Creates an input stream reading the given zip entry as ! * uncompressed data. Normally zip entry should be an entry ! * returned by getEntry() or entries(). ! * ! * @param entry the entry to create an InputStream for. ! * @return the input stream. ! * ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the Zip archive is malformed. ! */ ! public InputStream getInputStream(ZipEntry entry) throws IOException { ! HashMap entries = getEntries(); ! String name = entry.getName(); ! ZipEntry zipEntry = (ZipEntry) entries.get(name); ! if (zipEntry == null) ! throw new NoSuchElementException(name); ! long start = checkLocalHeader(zipEntry); ! int method = zipEntry.getMethod(); ! InputStream is = new BufferedInputStream(new PartialInputStream ! (raf, start, zipEntry.getCompressedSize())); ! switch (method) ! { ! case ZipOutputStream.STORED: ! return is; ! case ZipOutputStream.DEFLATED: ! return new InflaterInputStream(is, new Inflater(true)); ! default: ! throw new ZipException("Unknown compression method " + method); ! } ! } ! ! /** ! * Returns the name of this zip file. ! */ ! public String getName() { ! return name; } ! /** ! * Returns the number of entries in this zip file. ! */ ! public int size() { ! try ! { ! return getEntries().size(); ! } ! catch (IOException ioe) ! { ! return 0; ! } } + + private static class ZipEntryEnumeration implements Enumeration + { + private final Iterator elements; ! public ZipEntryEnumeration(Iterator elements) ! { ! this.elements = elements; ! } ! public boolean hasMoreElements() ! { ! return elements.hasNext(); ! } ! public Object nextElement() ! { ! /* We return a clone, just to be safe that the user doesn't ! * change the entry. ! */ ! return ((ZipEntry)elements.next()).clone(); ! } } ! private static class PartialInputStream extends InputStream { ! private final RandomAccessFile raf; ! long filepos, end; ! public PartialInputStream(RandomAccessFile raf, long start, long len) ! { ! this.raf = raf; ! filepos = start; ! end = start + len; ! } ! ! public int available() ! { ! long amount = end - filepos; ! if (amount > Integer.MAX_VALUE) ! return Integer.MAX_VALUE; ! return (int) amount; ! } ! ! public int read() throws IOException ! { ! if (filepos == end) ! return -1; ! synchronized (raf) ! { ! raf.seek(filepos++); ! return raf.read(); ! } ! } ! ! public int read(byte[] b, int off, int len) throws IOException ! { ! if (len > end - filepos) ! { ! len = (int) (end - filepos); ! if (len == 0) ! return -1; ! } ! synchronized (raf) ! { ! raf.seek(filepos); ! int count = raf.read(b, off, len); ! if (count > 0) ! filepos += len; ! return count; ! } ! } ! ! public long skip(long amount) ! { ! if (amount < 0) ! throw new IllegalArgumentException(); ! if (amount > end - filepos) ! amount = end - filepos; ! filepos += amount; ! return amount; ! } } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/ZipInputStream.java gcc-3.3/libjava/java/util/zip/ZipInputStream.java *** gcc-3.2.3/libjava/java/util/zip/ZipInputStream.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/ZipInputStream.java 2003-02-12 01:25:37.000000000 +0000 *************** *** 1,5 **** ! /* ZipInputStream.java - Input filter for reading zip file ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* java.util.zip.ZipInputStream ! Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** obligated to do so. If you do not wish *** 36,294 **** exception statement from your version. */ package java.util.zip; ! import java.io.*; /** ! * @author Per Bothner ! * @date May 1999. */ ! /* ! * Written using on-line Java Platform 1.2 API Specification, as well ! * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). ! * Status: Quite incomplete, but can read uncompressed .zip archives. ! */ ! // We do not calculate the CRC and compare it with the specified value; ! // we probably should. FIXME. ! ! public class ZipInputStream extends InflaterInputStream implements ZipConstants ! { ! public ZipInputStream (InputStream in) { ! super (in, new Inflater (true)); } ! public ZipEntry getNextEntry () throws IOException { ! if (closed) ! throw new IOException ("stream closed"); ! if (current != null) ! closeEntry(); ! if (in.read() != 'P' ! || in.read() != 'K') ! return null; ! int code = in.read(); ! while (code == '\001') { ! code = in.read(); ! if (code != '\002') ! return null; ! in.skip(16); ! int size = read4(); ! in.skip(4); ! int fname_length = readu2(); ! int extra_length = readu2(); ! int fcomment_length = readu2(); ! // `12' is the number of bytes between the comment length ! // field and the end of the fixed part of the header: ! // 2 bytes for `disk number start' ! // 2 bytes for `internal file attributes' ! // 4 bytes for `external file attributes' ! // 4 bytes for `relative offset of local header' ! in.skip(12 + fname_length + extra_length + fcomment_length); ! if (in.read() != 'P' || in.read() != 'K') ! return null; ! code = in.read(); } ! if (code == '\005') { ! if (in.read() != '\006') ! return null; ! in.skip(16); ! int comment_size = readu2(); ! in.skip(comment_size); ! if (in.read() != 'P' || in.read() != 'K') ! return null; ! code = in.read(); } ! if (code != '\003' ! || in.read() != '\004') ! return null; ! int ex_version = readu2(); ! current_flags = readu2(); ! int method = readu2(); ! int modtime = readu2(); ! int moddate = readu2(); ! int crc = read4(); ! int compressedSize = read4(); ! int uncompressedSize = read4(); ! int filenameLength = readu2(); ! int extraLength = readu2(); ! byte[] bname = new byte[filenameLength]; ! readFully(bname); ! ZipEntry entry = createZipEntry(new String(bname, "8859_1")); ! if (extraLength > 0) { ! byte[] bextra = new byte[extraLength]; ! readFully(bextra); ! entry.extra = bextra; } ! entry.compressedSize = compressedSize; ! entry.size = uncompressedSize; ! entry.crc = (long) crc & 0xffffffffL; ! entry.method = method; ! entry.time = ZipEntry.timeFromDOS(moddate, modtime); ! current = entry; ! avail = uncompressedSize; ! compressed_bytes = compressedSize; ! return entry; } ! // We override fill to let us control how much data gets read from ! // the underlying input stream. This lets us avoid having to push ! // back data. ! protected void fill () throws IOException { ! if (closed) ! throw new IOException ("stream closed"); ! int count = buf.length; ! if (count > compressed_bytes) ! count = compressed_bytes; ! len = in.read(buf, 0, count); ! if (len != -1) ! { ! compressed_bytes -= len; ! inf.setInput(buf, 0, len); ! } } /** ! * Creates a new ZipEntry with the given name. ! * Used by ZipInputStream when normally new ZipEntry (name) ! * would be called. This gives subclasses such as JarInputStream a change ! * to override this method and add aditional information to the ZipEntry ! * (subclass). */ ! protected ZipEntry createZipEntry (String name) { ! return new ZipEntry (name); } ! public int read (byte[] b, int off, int len) throws IOException { ! if (closed) ! throw new IOException ("stream closed"); ! if (len > avail) ! len = avail; ! int count; ! if (current.method == Deflater.DEFLATED) ! count = super.read(b, off, len); ! else ! count = in.read(b, off, len); ! if (count == -1 || avail == 0) { ! inf.reset(); ! count = -1; } ! else ! avail -= count; ! return count; } ! public long skip (long n) throws IOException { ! if (closed) ! throw new IOException ("stream closed"); ! if (n > avail) ! n = avail; ! long count; ! if (current.method == Deflater.DEFLATED) ! count = super.skip(n); ! else ! count = in.skip(n); ! avail = avail - (int) count; ! return count; } /** ! * Returns 0 if the ZipInputStream is closed and 1 otherwise. ! * ! * @since 1.2 */ ! public int available() { ! return closed ? 0 : 1; ! } ! private void readFully (byte[] b) throws IOException ! { ! int off = 0; ! int len = b.length; ! while (len > 0) { ! int count = in.read(b, off, len); ! if (count <= 0) ! throw new EOFException(".zip archive ended prematurely"); ! off += count; ! len -= count; } } ! private int readu2 () throws IOException { ! int byte0 = in.read(); ! int byte1 = in.read(); ! if (byte0 < 0 || byte1 < 0) ! throw new EOFException(".zip archive ended prematurely"); ! return ((byte1 & 0xFF) << 8) | (byte0 & 0xFF); } ! private int read4 () throws IOException { ! int byte0 = in.read(); ! int byte1 = in.read(); ! int byte2 = in.read(); ! int byte3 = in.read(); ! if (byte3 < 0) ! throw new EOFException(".zip archive ended prematurely"); ! return ((byte3 & 0xFF) << 24) + ((byte2 & 0xFF) << 16) ! + ((byte1 & 0xFF) << 8) + (byte0 & 0xFF); } ! public void closeEntry () throws IOException { ! if (current != null) { ! if (avail > 0) ! skip (avail); ! if ((current_flags & 8) != 0) { ! int sig = read4(); ! if (sig != 0x04034b50) ! throw new ZipException("bad/missing magic number at end of .zip entry"); ! int crc = read4(); ! int compressedSize = read4(); ! int uncompressedSize = read4(); ! if (current.compressedSize != compressedSize ! || current.size != uncompressedSize ! || current.crc != crc) ! throw new ZipException("bad data descriptor at end of .zip entry"); } ! current = null; ! avail = 0; } } /** ! * Closes this InflaterInputStream. ! * ! * @since 1.2 */ ! public void close () throws IOException { - current = null; - closed = true; super.close(); } ! private ZipEntry current; ! private int current_flags; ! // Number of uncompressed bytes to be read. ! private int avail; ! // Number of bytes we can read from underlying stream. ! private int compressed_bytes; ! // Is this ZipInputStream closed? Set by the close() method. ! private boolean closed = false; } --- 36,370 ---- exception statement from your version. */ package java.util.zip; ! import java.io.EOFException; ! import java.io.InputStream; ! import java.io.IOException; ! import java.util.Enumeration; /** ! * This is a FilterInputStream that reads the files in an zip archive ! * one after another. It has a special method to get the zip entry of ! * the next file. The zip entry contains information about the file name ! * size, compressed size, CRC, etc. ! * ! * It includes support for STORED and DEFLATED entries. ! * ! * @author Jochen Hoenicke */ + public class ZipInputStream extends InflaterInputStream implements ZipConstants + { + private CRC32 crc = new CRC32(); + private ZipEntry entry = null; ! private int csize; ! private int size; ! private int method; ! private int flags; ! private int avail; ! private boolean entryAtEOF; ! /** ! * Creates a new Zip input stream, reading a zip archive. ! */ ! public ZipInputStream(InputStream in) ! { ! super(in, new Inflater(true)); ! } ! private void fillBuf() throws IOException { ! avail = len = in.read(buf, 0, buf.length); } ! private int readBuf(byte[] out, int offset, int length) throws IOException { ! if (avail <= 0) { ! fillBuf(); ! if (avail <= 0) ! return -1; } ! if (length > avail) ! length = avail; ! System.arraycopy(buf, len - avail, out, offset, length); ! avail -= length; ! return length; ! } ! ! private void readFully(byte[] out) throws IOException ! { ! int off = 0; ! int len = out.length; ! while (len > 0) { ! int count = readBuf(out, off, len); ! if (count == -1) ! throw new EOFException(); ! off += count; ! len -= count; } ! } ! ! private final int readLeByte() throws IOException ! { ! if (avail <= 0) { ! fillBuf(); ! if (avail <= 0) ! throw new ZipException("EOF in header"); } ! return buf[len - avail--] & 0xff; } ! /** ! * Read an unsigned short in little endian byte order. ! */ ! private final int readLeShort() throws IOException { ! return readLeByte() | (readLeByte() << 8); } /** ! * Read an int in little endian byte order. */ ! private final int readLeInt() throws IOException { ! return readLeShort() | (readLeShort() << 16); } ! /** ! * Open the next entry from the zip archive, and return its description. ! * If the previous entry wasn't closed, this method will close it. ! */ ! public ZipEntry getNextEntry() throws IOException { ! if (crc == null) ! throw new IOException("Stream closed."); ! if (entry != null) ! closeEntry(); ! ! int header = readLeInt(); ! if (header == CENSIG) { ! /* Central Header reached. */ ! close(); ! return null; } ! if (header != LOCSIG) ! throw new ZipException("Wrong Local header signature: " ! + Integer.toHexString(header)); ! /* skip version */ ! readLeShort(); ! flags = readLeShort(); ! method = readLeShort(); ! int dostime = readLeInt(); ! int crc = readLeInt(); ! csize = readLeInt(); ! size = readLeInt(); ! int nameLen = readLeShort(); ! int extraLen = readLeShort(); ! ! if (method == ZipOutputStream.STORED && csize != size) ! throw new ZipException("Stored, but compressed != uncompressed"); ! ! ! byte[] buffer = new byte[nameLen]; ! readFully(buffer); ! String name = new String(buffer); ! ! entry = createZipEntry(name); ! entryAtEOF = false; ! entry.setMethod(method); ! if ((flags & 8) == 0) ! { ! entry.setCrc(crc & 0xffffffffL); ! entry.setSize(size & 0xffffffffL); ! entry.setCompressedSize(csize & 0xffffffffL); ! } ! entry.setDOSTime(dostime); ! if (extraLen > 0) ! { ! byte[] extra = new byte[extraLen]; ! readFully(extra); ! entry.setExtra(extra); ! } ! ! if (method == ZipOutputStream.DEFLATED && avail > 0) ! { ! System.arraycopy(buf, len - avail, buf, 0, avail); ! len = avail; ! avail = 0; ! inf.setInput(buf, 0, len); ! } ! return entry; } ! private void readDataDescr() throws IOException { ! if (readLeInt() != EXTSIG) ! throw new ZipException("Data descriptor signature not found"); ! entry.setCrc(readLeInt() & 0xffffffffL); ! csize = readLeInt(); ! size = readLeInt(); ! entry.setSize(size & 0xffffffffL); ! entry.setCompressedSize(csize & 0xffffffffL); } /** ! * Closes the current zip entry and moves to the next one. */ ! public void closeEntry() throws IOException { ! if (crc == null) ! throw new IOException("Stream closed."); ! if (entry == null) ! return; ! if (method == ZipOutputStream.DEFLATED) { ! if ((flags & 8) != 0) ! { ! /* We don't know how much we must skip, read until end. */ ! byte[] tmp = new byte[2048]; ! while (read(tmp) > 0) ! ; ! /* read will close this entry */ ! return; ! } ! csize -= inf.getTotalIn(); ! avail = inf.getRemaining(); } + + if (avail > csize && csize >= 0) + avail -= csize; + else + { + csize -= avail; + avail = 0; + while (csize != 0) + { + long skipped = in.skip(csize & 0xffffffffL); + if (skipped <= 0) + throw new ZipException("zip archive ends early."); + csize -= skipped; + } + } + + size = 0; + crc.reset(); + if (method == ZipOutputStream.DEFLATED) + inf.reset(); + entry = null; + entryAtEOF = true; } ! public int available() throws IOException { ! return entryAtEOF ? 0 : 1; } ! /** ! * Reads a byte from the current zip entry. ! * @return the byte or -1 on EOF. ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the deflated stream is corrupted. ! */ ! public int read() throws IOException { ! byte[] b = new byte[1]; ! if (read(b, 0, 1) <= 0) ! return -1; ! return b[0] & 0xff; } ! /** ! * Reads a block of bytes from the current zip entry. ! * @return the number of bytes read (may be smaller, even before ! * EOF), or -1 on EOF. ! * @exception IOException if a i/o error occured. ! * @exception ZipException if the deflated stream is corrupted. ! */ ! public int read(byte[] b, int off, int len) throws IOException { ! if (len == 0) ! return 0; ! if (crc == null) ! throw new IOException("Stream closed."); ! if (entry == null) ! return -1; ! boolean finished = false; ! switch (method) { ! case ZipOutputStream.DEFLATED: ! len = super.read(b, off, len); ! if (len < 0) { ! if (!inf.finished()) ! throw new ZipException("Inflater not finished!?"); ! avail = inf.getRemaining(); ! if ((flags & 8) != 0) ! readDataDescr(); ! ! if (inf.getTotalIn() != csize ! || inf.getTotalOut() != size) ! throw new ZipException("size mismatch: "+csize+";"+size+" <-> "+inf.getTotalIn()+";"+inf.getTotalOut()); ! inf.reset(); ! finished = true; } ! break; ! ! case ZipOutputStream.STORED: ! ! if (len > csize && csize >= 0) ! len = csize; ! ! len = readBuf(b, off, len); ! if (len > 0) ! { ! csize -= len; ! size -= len; ! } ! ! if (csize == 0) ! finished = true; ! else if (len < 0) ! throw new ZipException("EOF in stored block"); ! break; ! } ! ! if (len > 0) ! crc.update(b, off, len); ! ! if (finished) ! { ! if ((crc.getValue() & 0xffffffffL) != entry.getCrc()) ! throw new ZipException("CRC mismatch"); ! crc.reset(); ! entry = null; ! entryAtEOF = true; } + return len; } /** ! * Closes the zip file. ! * @exception IOException if a i/o error occured. */ ! public void close() throws IOException { super.close(); + crc = null; + entry = null; + entryAtEOF = true; } ! /** ! * Creates a new zip entry for the given name. This is equivalent ! * to new ZipEntry(name). ! * @param name the name of the zip entry. ! */ ! protected ZipEntry createZipEntry(String name) ! { ! return new ZipEntry(name); ! } } diff -Nrc3pad gcc-3.2.3/libjava/java/util/zip/ZipOutputStream.java gcc-3.3/libjava/java/util/zip/ZipOutputStream.java *** gcc-3.2.3/libjava/java/util/zip/ZipOutputStream.java 2002-01-22 22:40:41.000000000 +0000 --- gcc-3.3/libjava/java/util/zip/ZipOutputStream.java 2002-11-03 20:27:31.000000000 +0000 *************** *** 1,5 **** ! /* ZipOutputStream.java - Create a file in zip format ! Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of GNU Classpath. --- 1,5 ---- ! /* java.util.zip.ZipOutputStream ! Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Classpath. *************** GNU Classpath is free software; you can *** 7,13 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- 7,13 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ! GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *************** obligated to do so. If you do not wish *** 36,321 **** exception statement from your version. */ package java.util.zip; ! import java.io.*; ! ! /* Written using on-line Java Platform 1.2 API Specification ! * and JCL book. ! * Believed complete and correct. */ ! ! public class ZipOutputStream extends DeflaterOutputStream ! implements ZipConstants { ! public static final int STORED = 0; ! public static final int DEFLATED = 8; ! public void close () throws IOException ! { ! finish (); ! out.close(); ! } ! public void closeEntry () throws IOException ! { ! int compressed_size; ! if (current.method == STORED) ! { ! compressed_size = uncompressed_size; ! } ! else ! { ! super.finish(); ! compressed_size = def.getTotalOut(); ! } ! long crc = sum.getValue(); ! bytes_written += compressed_size; ! if (current.getCrc() == -1 || current.getCompressedSize() == -1 ! || current.getSize() == -1) ! { ! current.setCrc(crc); ! current.compressedSize = compressed_size; ! current.setSize(uncompressed_size); ! put4 (0x08074b50); ! put4 ((int) (current.getCrc())); ! put4 ((int) (current.getCompressedSize())); ! put4 ((int) (current.getSize())); ! bytes_written += 16; ! } ! else if (current.getCrc() != crc ! || current.getCompressedSize() != compressed_size ! || current.getSize() != uncompressed_size) ! throw new ZipException ("zip entry field incorrect"); ! current.next = chain; ! chain = current; ! current = null; } ! public void write (int bval) throws IOException { ! if (current.method == STORED) ! { ! out.write(bval); ! } ! else ! super.write(bval); ! sum.update(bval); ! uncompressed_size += 1; } ! ! public void write (byte[] buf, int off, int len) throws IOException { ! if (current.method == STORED) ! out.write(buf, off, len); ! else ! super.write(buf, off, len); ! sum.update(buf, off, len); ! uncompressed_size += len; } ! public void finish () throws IOException { ! if (current != null) ! closeEntry (); ! ! // Write the central directory. ! long offset = bytes_written; ! int count = 0; ! int bytes = 0; ! while (chain != null) ! { ! bytes += write_entry (chain, false); ! ++count; ! chain = chain.next; ! } ! ! // Write the end of the central directory record. ! put4 (0x06054b50); ! // Disk number. ! put2 (0); ! // Another disk number. ! put2 (0); ! put2 (count); ! put2 (count); ! put4 (bytes); ! put4 ((int) offset); ! ! byte[] c = comment.getBytes("8859_1"); ! put2 (c.length); ! out.write(c); } ! // Helper for finish and putNextEntry. ! private int write_entry (ZipEntry entry, boolean is_local) ! throws IOException { ! int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); ! if (! is_local) ! bytes += put_version (); ! bytes += put_version (); ! boolean crc_after = false; ! if (is_local ! && (entry.getCrc() == -1 || entry.getCompressedSize() == -1 ! || entry.getSize() == -1)) ! crc_after = true; ! // For the bits field we always indicate `normal' compression, ! // even if that isn't true. ! bytes += put2 (crc_after ? (1 << 3) : 0); ! bytes += put2 (entry.method); ! bytes += put2(0); // time - FIXME ! bytes += put2(0); // date - FIXME ! if (crc_after) { ! // CRC, compressedSize, and Size are always 0 in this header. ! // The actual values are given after the entry. ! bytes += put4 (0); ! bytes += put4 (0); ! bytes += put4 (0); } ! else { ! bytes += put4 ((int) (entry.getCrc())); ! bytes += put4 ((int) (entry.getCompressedSize())); ! bytes += put4 ((int) (entry.getSize())); } ! byte[] name = entry.name.getBytes("8859_1"); ! bytes += put2 (name.length); ! bytes += put2 (entry.extra == null ? 0 : entry.extra.length); ! ! byte[] comment = null; ! if (! is_local) ! { ! if (entry.getComment() == null) ! bytes += put2 (0); ! else ! { ! comment = entry.getComment().getBytes("8859_1"); ! bytes += put2 (comment.length); ! } ! // Disk number start. ! bytes += put2 (0); ! // Internal file attributes. ! bytes += put2 (0); ! // External file attributes. ! bytes += put4 (0); ! // Relative offset of local header. ! bytes += put4 ((int) entry.relativeOffset); ! } ! out.write (name); ! bytes += name.length; ! if (entry.extra != null) { ! out.write(entry.extra); ! bytes += entry.extra.length; } ! if (comment != null) { ! out.write(comment); ! bytes += comment.length; } ! bytes_written += bytes; ! return bytes; } ! public void putNextEntry (ZipEntry entry) throws IOException { ! if (current != null) ! closeEntry (); ! if (entry.method < 0 ) ! entry.method = method; ! if (entry.method == STORED) { ! if (entry.getSize() == -1 || entry.getCrc() == -1) ! throw new ZipException ("required entry not set"); ! // Just in case. ! entry.compressedSize = entry.getSize(); } - entry.relativeOffset = bytes_written; - write_entry (entry, true); - current = entry; - int compr = (method == STORED) ? Deflater.NO_COMPRESSION : level; - def.reset(); - def.setLevel(compr); - sum.reset(); - uncompressed_size = 0; - } ! public void setLevel (int level) ! { ! if (level != Deflater.DEFAULT_COMPRESSION ! && (level < Deflater.NO_COMPRESSION ! || level > Deflater.BEST_COMPRESSION)) ! throw new IllegalArgumentException (); ! this.level = level; ! } ! ! public void setMethod (int method) ! { ! if (method != DEFLATED && method != STORED) ! throw new IllegalArgumentException (); ! this.method = method; } ! public void setComment (String comment) { ! if (comment.length() > 65535) ! throw new IllegalArgumentException (); ! this.comment = comment; ! } ! public ZipOutputStream (OutputStream out) ! { ! super (out, new Deflater (Deflater.DEFAULT_COMPRESSION, true), 8192); ! sum = new CRC32 (); ! } ! private int put2 (int i) throws IOException ! { ! out.write (i); ! out.write (i >> 8); ! return 2; } ! private int put4 (int i) throws IOException { ! out.write (i); ! out.write (i >> 8); ! out.write (i >> 16); ! out.write (i >> 24); ! return 4; ! } ! private int put_version () throws IOException ! { ! // FIXME: for now we assume Unix, and we ignore the version ! // number. ! return put2 (3 << 8); ! } ! // The entry we are currently writing, or null if we've called ! // closeEntry. ! private ZipEntry current; ! // The chain of entries which have been written to this file. ! private ZipEntry chain; ! private int method = DEFLATED; ! private int level = Deflater.DEFAULT_COMPRESSION; ! private String comment = ""; ! private long bytes_written; ! private int uncompressed_size; ! /** The checksum object. */ ! private Checksum sum; } --- 36,397 ---- exception statement from your version. */ package java.util.zip; + import java.io.OutputStream; + import java.io.IOException; + import java.io.UnsupportedEncodingException; + import java.util.Vector; + import java.util.Enumeration; ! /** ! * This is a FilterOutputStream that writes the files into a zip ! * archive one after another. It has a special method to start a new ! * zip entry. The zip entries contains information about the file name ! * size, compressed size, CRC, etc. ! * ! * It includes support for STORED and DEFLATED entries. ! * ! * This class is not thread safe. ! * ! * @author Jochen Hoenicke */ ! public class ZipOutputStream extends DeflaterOutputStream implements ZipConstants { ! private Vector entries = new Vector(); ! private CRC32 crc = new CRC32(); ! private ZipEntry curEntry = null; ! private int curMethod; ! private int size; ! private int offset = 0; ! private byte[] zipComment = new byte[0]; ! private int defaultMethod = DEFLATED; ! /** ! * Our Zip version is hard coded to 1.0 resp. 2.0 ! */ ! private final static int ZIP_STORED_VERSION = 10; ! private final static int ZIP_DEFLATED_VERSION = 20; ! /** ! * Compression method. This method doesn't compress at all. ! */ ! public final static int STORED = 0; ! /** ! * Compression method. This method uses the Deflater. ! */ ! public final static int DEFLATED = 8; ! /** ! * Creates a new Zip output stream, writing a zip archive. ! * @param out the output stream to which the zip archive is written. ! */ ! public ZipOutputStream(OutputStream out) ! { ! super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true)); } ! /** ! * Set the zip file comment. ! * @param comment the comment. ! * @exception IllegalArgumentException if encoding of comment is ! * longer than 0xffff bytes. ! */ ! public void setComment(String comment) { ! byte[] commentBytes; ! commentBytes = comment.getBytes(); ! if (commentBytes.length > 0xffff) ! throw new IllegalArgumentException("Comment too long."); ! zipComment = commentBytes; } ! ! /** ! * Sets default compression method. If the Zip entry specifies ! * another method its method takes precedence. ! * @param method the method. ! * @exception IllegalArgumentException if method is not supported. ! * @see #STORED ! * @see #DEFLATED ! */ ! public void setMethod(int method) { ! if (method != STORED && method != DEFLATED) ! throw new IllegalArgumentException("Method not supported."); ! defaultMethod = method; } ! /** ! * Sets default compression level. The new level will be activated ! * immediately. ! * @exception IllegalArgumentException if level is not supported. ! * @see Deflater ! */ ! public void setLevel(int level) { ! def.setLevel(level); ! } ! ! /** ! * Write an unsigned short in little endian byte order. ! */ ! private final void writeLeShort(int value) throws IOException ! { ! out.write(value & 0xff); ! out.write((value >> 8) & 0xff); } ! /** ! * Write an int in little endian byte order. ! */ ! private final void writeLeInt(int value) throws IOException { ! writeLeShort(value); ! writeLeShort(value >> 16); ! } ! /** ! * Starts a new Zip entry. It automatically closes the previous ! * entry if present. If the compression method is stored, the entry ! * must have a valid size and crc, otherwise all elements (except ! * name) are optional, but must be correct if present. If the time ! * is not set in the entry, the current time is used. ! * @param entry the entry. ! * @exception IOException if an I/O error occured. ! * @exception ZipException if stream was finished. ! */ ! public void putNextEntry(ZipEntry entry) throws IOException ! { ! if (entries == null) ! throw new ZipException("ZipOutputStream was finished"); ! int method = entry.getMethod(); ! int flags = 0; ! if (method == -1) ! method = defaultMethod; ! if (method == STORED) { ! if (entry.getCompressedSize() >= 0) ! { ! if (entry.getSize() < 0) ! entry.setSize(entry.getCompressedSize()); ! else if (entry.getSize() != entry.getCompressedSize()) ! throw new ZipException ! ("Method STORED, but compressed size != size"); ! } ! else ! entry.setCompressedSize(entry.getSize()); ! ! if (entry.getSize() < 0) ! throw new ZipException("Method STORED, but size not set"); ! if (entry.getCrc() < 0) ! throw new ZipException("Method STORED, but crc not set"); } ! else if (method == DEFLATED) { ! if (entry.getCompressedSize() < 0 ! || entry.getSize() < 0 || entry.getCrc() < 0) ! flags |= 8; } ! if (curEntry != null) ! closeEntry(); ! if (entry.getTime() < 0) ! entry.setTime(System.currentTimeMillis()); ! entry.flags = flags; ! entry.offset = offset; ! entry.setMethod(method); ! curMethod = method; ! /* Write the local file header */ ! writeLeInt(LOCSIG); ! writeLeShort(method == STORED ! ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION); ! writeLeShort(flags); ! writeLeShort(method); ! writeLeInt(entry.getDOSTime()); ! if ((flags & 8) == 0) { ! writeLeInt((int)entry.getCrc()); ! writeLeInt((int)entry.getCompressedSize()); ! writeLeInt((int)entry.getSize()); } ! else { ! writeLeInt(0); ! writeLeInt(0); ! writeLeInt(0); } + byte[] name = entry.getName().getBytes(); + if (name.length > 0xffff) + throw new ZipException("Name too long."); + byte[] extra = entry.getExtra(); + if (extra == null) + extra = new byte[0]; + writeLeShort(name.length); + writeLeShort(extra.length); + out.write(name); + out.write(extra); ! offset += LOCHDR + name.length + extra.length; ! ! /* Activate the entry. */ ! ! curEntry = entry; ! crc.reset(); ! if (method == DEFLATED) ! def.reset(); ! size = 0; } ! /** ! * Closes the current entry. ! * @exception IOException if an I/O error occured. ! * @exception ZipException if no entry is active. ! */ ! public void closeEntry() throws IOException { ! if (curEntry == null) ! throw new ZipException("No open entry"); ! /* First finish the deflater, if appropriate */ ! if (curMethod == DEFLATED) ! super.finish(); ! ! int csize = curMethod == DEFLATED ? def.getTotalOut() : size; ! ! if (curEntry.getSize() < 0) ! curEntry.setSize(size); ! else if (curEntry.getSize() != size) ! throw new ZipException("size was "+size ! +", but I expected "+curEntry.getSize()); ! ! if (curEntry.getCompressedSize() < 0) ! curEntry.setCompressedSize(csize); ! else if (curEntry.getCompressedSize() != csize) ! throw new ZipException("compressed size was "+csize ! +", but I expected "+curEntry.getSize()); ! ! if (curEntry.getCrc() < 0) ! curEntry.setCrc(crc.getValue()); ! else if (curEntry.getCrc() != crc.getValue()) ! throw new ZipException("crc was " + Long.toHexString(crc.getValue()) ! + ", but I expected " ! + Long.toHexString(curEntry.getCrc())); ! ! offset += csize; ! ! /* Now write the data descriptor entry if needed. */ ! if (curMethod == DEFLATED && (curEntry.flags & 8) != 0) { ! writeLeInt(EXTSIG); ! writeLeInt((int)curEntry.getCrc()); ! writeLeInt((int)curEntry.getCompressedSize()); ! writeLeInt((int)curEntry.getSize()); ! offset += EXTHDR; } ! entries.addElement(curEntry); ! curEntry = null; } ! /** ! * Writes the given buffer to the current entry. ! * @exception IOException if an I/O error occured. ! * @exception ZipException if no entry is active. ! */ ! public void write(byte[] b, int off, int len) throws IOException { ! if (curEntry == null) ! throw new ZipException("No open entry."); ! switch (curMethod) ! { ! case DEFLATED: ! super.write(b, off, len); ! break; ! ! case STORED: ! out.write(b, off, len); ! break; ! } ! crc.update(b, off, len); ! size += len; } ! /** ! * Finishes the stream. This will write the central directory at the ! * end of the zip file and flush the stream. ! * @exception IOException if an I/O error occured. ! */ ! public void finish() throws IOException { ! if (entries == null) ! return; ! if (curEntry != null) ! closeEntry(); ! int numEntries = 0; ! int sizeEntries = 0; ! ! Enumeration enum = entries.elements(); ! while (enum.hasMoreElements()) ! { ! ZipEntry entry = (ZipEntry) enum.nextElement(); ! ! int method = entry.getMethod(); ! writeLeInt(CENSIG); ! writeLeShort(method == STORED ! ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION); ! writeLeShort(method == STORED ! ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION); ! writeLeShort(entry.flags); ! writeLeShort(method); ! writeLeInt(entry.getDOSTime()); ! writeLeInt((int)entry.getCrc()); ! writeLeInt((int)entry.getCompressedSize()); ! writeLeInt((int)entry.getSize()); ! byte[] name = entry.getName().getBytes(); ! if (name.length > 0xffff) ! throw new ZipException("Name too long."); ! byte[] extra = entry.getExtra(); ! if (extra == null) ! extra = new byte[0]; ! String strComment = entry.getComment(); ! byte[] comment = strComment != null ! ? strComment.getBytes() : new byte[0]; ! if (comment.length > 0xffff) ! throw new ZipException("Comment too long."); ! writeLeShort(name.length); ! writeLeShort(extra.length); ! writeLeShort(comment.length); ! writeLeShort(0); /* disk number */ ! writeLeShort(0); /* internal file attr */ ! writeLeInt(0); /* external file attr */ ! writeLeInt(entry.offset); ! out.write(name); ! out.write(extra); ! out.write(comment); ! numEntries++; ! sizeEntries += CENHDR + name.length + extra.length + comment.length; ! } ! writeLeInt(ENDSIG); ! writeLeShort(0); /* disk number */ ! writeLeShort(0); /* disk with start of central dir */ ! writeLeShort(numEntries); ! writeLeShort(numEntries); ! writeLeInt(sizeEntries); ! writeLeInt(offset); ! writeLeShort(zipComment.length); ! out.write(zipComment); ! out.flush(); ! entries = null; ! } } diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleAction.java gcc-3.3/libjava/javax/accessibility/AccessibleAction.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleAction.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleAction.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,82 ---- + /* AccessibleAction.java -- aids in accessibly performing actions + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * If an object implements this interface then it must be able to perform one + * or more actions. Accessibility software can use the implementations of this + * interface to discover and perform actions on an object. + * + *

          The AccessibleContext.getAccessibleAction() method should + * return null if an object does not implement this interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleAction() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleAction + { + /** + * Get the number possible actions for this object, with the zeroth + * representing the default action. + * + * @return the 0-based number of actions + */ + int getAccessibleActionCount(); + + /** + * Get a description for the specified action. Returns null if out of + * bounds. + * + * @param i the action to describe, 0-based + * @return description of the action + */ + String getAccessibleActionDescription(int i); + + /** + * Perform the specified action. Does nothing if out of bounds. + * + * @param i the action to perform, 0-based + * @return true if the action was performed + */ + boolean doAccessibleAction(int i); + } // interface AccessibleAction diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleBundle.java gcc-3.3/libjava/javax/accessibility/AccessibleBundle.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleBundle.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleBundle.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,120 ---- + /* AccessibleBundle.java -- base class for accessibility "enumerations" + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + import java.util.Locale; + + /** + * This serves as a base class for accessibility "enumerations". These + * objects are strongly typed; to make up for the lack of true enums in Java. + * Display should be locale dependent. + * + * @author Eric Blake + * @see AccessibleRole + * @see AccessibleState + * @since 1.2 + * @status updated to 1.4, but missing Locale support + */ + public abstract class AccessibleBundle + { + /** + * The locale independent name of the object. This is for the computer, not + * necessarily for humans; changing it in subclasses is frowned upon. + * + * @see #toDisplayString(String, Locale) + */ + protected String key; + + /** + * Default constructor. + */ + public AccessibleBundle() + { + } + + /** + * Obtains the key as a localized string, falling back to the + * locale-independent version if necessary. + * + * @param resourceBundle the resource to use for lookup + * @param locale the locale to translate to + * @return the translated name + * @throws NullPointerException if resourceBundle or locale is null + * @XXX For now, no transformation is done. + */ + protected String toDisplayString(String resourceBundle, Locale locale) + { + return key; + } + + /** + * Obtains the key as a localized string, falling back to the + * locale-independent version if necessary. + * + * @param locale the locale to translate to + * @return the translated name + * @throws NullPointerException if locale is null + * @XXX For now, no transformation is done. + */ + public String toDisplayString(Locale locale) + { + return key; + } + + /** + * Obtains the key as a localized string, using the default locale. + * + * @return the translated name + * @XXX For now, no transformation is done. + */ + public String toDisplayString() + { + return toDisplayString(Locale.getDefault()); + } + + /** + * Obtains the key as a localized string, using the default locale. + * + * @return the translated name + * @XXX For now, no transformation is done. + */ + public String toString() + { + return toDisplayString(Locale.getDefault()); + } + } // class AccessibleBundle diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleComponent.java gcc-3.3/libjava/javax/accessibility/AccessibleComponent.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleComponent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleComponent.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,321 ---- + /* AccessibleComponent.java -- aids in accessibly rendering Java components + Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + import java.awt.Color; + import java.awt.Cursor; + import java.awt.Dimension; + import java.awt.Font; + import java.awt.FontMetrics; + import java.awt.Point; + import java.awt.Rectangle; + import java.awt.event.FocusListener; + + /** + * Objects which are to be rendered to a screen as part of a graphical + * user interface should implement this interface. Accessibility + * software can use the implementations of this interface to determine + * and set the screen representation for an object. + * + *

          The AccessibleContext.getAccessibleComponent() method + * should return null if an object does not implement this + * interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleComponent() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleComponent + { + /** + * Get the background color of this component. + * + * @return the background color of this component, or null if not supported + * @see #setBackground(Color) + */ + Color getBackground(); + + /** + * Set the background color of this component to the specified color. + * + * @param color the color to set the background to + * @see #getBackground() + */ + void setBackground(Color color); + + /** + * Get the foreground color of this component. + * + * @return the foreground color of this component, or null if not supported + * @see #setForeground(Color) + */ + Color getForeground(); + + /** + * Set the foreground color of this component. + * + * @param color the color to set the foreground to + * @see #getForeground() + */ + void setForeground(Color color); + + /** + * Get the cursor of this component. + * + * @return the Cursor of this component, or null if not supported + * @see #setCursor(Cursor) + */ + Cursor getCursor(); + + /** + * Set the cursor of the component. + * + * @param cursor the graphical representation of the cursor to use + * @see #getCursor() + */ + void setCursor(Cursor cursor); + + /** + * Get the font of this component + * + * @return the font of the component, or null if not supported + * @see setFont(Font) + */ + Font getFont(); + + /** + * Set the font of this component. + * + * @param font the font to use + * @see #getFont() + */ + void setFont(Font font); + + /** + * Get the FontMetrics of the specified font in this component. + * + * @param font the specified font + * @return the metrics for the specified font, or null if not supported + * @throws NullPointerException if font is null + * @see #getFont() + */ + FontMetrics getFontMetrics(Font font); + + /** + * Indicates whether or not this component is enabled. An object which is + * enabled also has AccessibleState.ENABLED in its StateSet. + * + * @return true if the component is enabled + * @see #setEnabled(boolean) + * @see AccessibleContext#getAccessibleStateSet() + * @see AccessibleState#ENABLED + */ + boolean isEnabled(); + + /** + * Set this component to an enabled or disabled state. + * + * @param b true to enable the component, else disable it + * @see #isEnabled() + */ + void setEnabled(boolean b); + + /** + * Indicates whether or not this component is visible or intends to be + * visible although one of its ancestors may not be. An object which is + * visible also has AccessibleState.VISIBLE in its StateSet. Check + * isShowing() to see if the object is on screen. + * + * @return true if the component is visible + * @see #setVisible(boolean) + * @see AccessibleContext#getAccessibleStateSet() + * @see AccessibleState#VISIBLE + */ + boolean isVisible(); + + /** + * Set the visible state of this component. + * + * @param b true to make the component visible, else hide it + * @see #isVisible() + */ + void setVisible(boolean b); + + /** + * Indicates whether or not this component is visible by checking + * the visibility of this component and its ancestors. The component may + * be hidden on screen by another component like pop-up help. An object + * which is showing on screen also has AccessibleState.SHOWING in its + * StateSet. + * + * @return true if component and ancestors are visible + * @see #isVisible() + * @see #setVisible(boolean) + * @see AccessibleContext#getAccessibleStateSet() + * @see AccessibleState#SHOWING + */ + boolean isShowing(); + + /** + * Tests whether or not the specified point is contained within + * this component. The coordinates are specified relative to this + * component's coordinate system. + * + * @param point the Point to locate + * @return true if the point is within this component + * @throws NullPointerException if point is null + * @see #getBounds() + */ + boolean contains(Point point); + + /** + * Get the location of this component in the screen's coordinate space. + * The point specified is the top-left corner of this component. + * + * @return the location on screen, or null if off-screen + * @see #getBounds() + * @see #getLocation() + */ + Point getLocationOnScreen(); + + /** + * Get the location of this component in the parent's coordinate system. + * The point specified is the top-left corner of this component. + * + * @return the location in the parent on screen, or null if off-screen + * @see #getBounds() + * @see #getLocationOnScreen() + * @see #setLocation(Point) + */ + Point getLocation(); + + /** + * Set the location of this component relative to its parent. The point + * specified represents the top-left corner of this component. + * + * @param point the top-left corner of this component relative to the parent + * @throws NullPointerException if point is null + * @see #getLocation() + */ + void setLocation(Point point); + + /** + * Get the bounds of this component relative to its parent - it's width, + * height, and relative location to its parent. + * + * @return the bounds of this component, or null if not on screen + * @see #contains(Point) + */ + Rectangle getBounds(); + + /** + * Set the bounds of this component to the specified height and width, and + * relative location to its parent. + * + * @param rectangle the new height, width, and relative location + * @throws NullPointerException if rectangle is null + */ + void setBounds(Rectangle rectangle); + + /** + * Get the size of this component - it's width and height. + * + * @return the dimensions of this component, or null if not on screen + * @see #setSize(Dimension) + */ + Dimension getSize(); + + /** + * Set the size of this component to the given dimensions. + * + * @param dimension the new size of the component + * @throws NullPointerException if dimension is null + * @see #getSize() + */ + void setSize(Dimension dimension); + + /** + * If an object exists at the specified point which is a child of this + * parent component, and it is accessible, then it is returned. + * + * @param point the location within this component's coordinate system + * @return the accessible child object at that point, or null + */ + Accessible getAccessibleAt(Point point); + + /** + * Indicates whether or not this component can accept focus. An object + * which can accept focus also has AccessibleState.FOCUSABLE in its + * StateSet. + * + * @return true if the component can accept focus + * @see AccessibleContext#getAccessibleStateSet() + * @see AccessibleState#FOCUSABLE + * @see AccessibleState#FOCUSED + */ + boolean isFocusTraversable(); + + /** + * If this method is called this component will attempt to gain focus, + * but if it cannot accept focus nothing happens. On success, the StateSet + * will contain AccessibleState.FOCUSED + * + * @see #isFocusTraversable() + * @see AccessibleState#FOCUSED + */ + void requestFocus(); + + /** + * Adds the specified listener to this component. + * + * @param listener the listener to add to this component + * @see #removeFocusListener(FocusListener) + */ + void addFocusListener(FocusListener listener); + + /** + * Removes the specified listener from this component. + * + * @param listener the listener to remove + * @see #addFocusListener(FocusListener) + */ + void removeFocusListener(FocusListener listener); + } // interface AccessibleComponent diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleContext.java gcc-3.3/libjava/javax/accessibility/AccessibleContext.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleContext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleContext.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,589 ---- + /* AccessibleContext.java -- the context of an accessible object + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + import java.beans.PropertyChangeListener; + import java.beans.PropertyChangeSupport; + import java.util.Locale; + + /** + * The minimum information that all accessible objects return. This includes + * name, description, role, and state of the object, parents and children, + * and any other useful information. If a component supports further details, + * it should implement one of the following:

            + *
          • {@link AccessibleAction} - the object can perform actions
          • + *
          • {@link AccessibleComponent} - the object has a graphical + * representation
          • + *
          • {@link AccessibleSelection} - the object allows its children to be + * selected
          • + *
          • {@link AccessibleText} - the object represents editable text
          • + *
          • {@link AccessibleValue} - the object represents a numerical value
          • + *
          + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public abstract class AccessibleContext + { + /** + * Constant used when the accessible name has changed. Both the old and new + * values are listed in the event. + * + * @see #getAccessibleName() + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_NAME_PROPERTY + = "AccessibleName"; + + /** + * Constanat used when the accessible description has changed. Both the old + * and new values are listed in the event. + * + * @see #getAccessibleDescription() + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_DESCRIPTION_PROPERTY + = "AccessibleDescription"; + + /** + * Constant used when the accessibleStateSet has changed. Both the old and + * new values are listed in the event, although either may be null if a + * state was disabled at that time. + * + * @see #getAccessibleStateSet() + * @see AccessibleState + * @see AccessibleStateSet + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_STATE_PROPERTY + = "AccessibleState"; + + /** + * Constant used when the accessibleValue has changed. Both the old and new + * values are listed in the event. + * + * @see #getAccessibleValue() + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_VALUE_PROPERTY + = "AccessibleValue"; + + /** + * Constant used when the accessibleSelection has changed. Both the old and + * new values of the event are reserved for future use. + * + * @see #getAccessibleSelection() + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_SELECTION_PROPERTY + = "AccessibleSelection"; + + /** + * Constant used when the accessibleText has changed. Both the old and new + * values of the event are reserved for future use. + * + * @see #getAccessibleText() + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_TEXT_PROPERTY + = "AccessibleText"; + + /** + * Constant used when the accessibleText caret has changed. Both the old and + * new values are listed in the event. + * + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_CARET_PROPERTY + = "AccessibleCaret"; + + /** + * Constant used when the visible data has changed. Both the old and new + * values of the event are reserved for future use. + * + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY + = "AccessibleVisibleData"; + + /** + * Constant used when children are added or removed. On addition, the new + * value of the event holds the new child; on removal, the old value holds + * the removed child. + * + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_CHILD_PROPERTY + = "AccessibleChild"; + + /** + * Constant used when active descendent of a component has changed. Both + * the old and new values are listed in the event. + * + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY + = "AccessibleActiveDescendant"; + + /** + * Constant used when the accessible table caption has changed. Both the + * old and new values are listed in the event. + * + * @see Accessible + * @see AccessibleTable + */ + public static final String ACCESSIBLE_TABLE_CAPTION_CHANGED + = "accessibleTableCaptionChanged"; + + /** + * Constant used when the accessible table summary has changed. Both the + * old and new values are listed in the event. + * + * @see Accessible + * @see AccessibleTable + */ + public static final String ACCESSIBLE_TABLE_SUMMARY_CHANGED + = "accessibleTableSummaryChanged"; + + /** + * Constant used when the accessible table model has changed. Only the new + * value of the event has meaning. + * + * @see AccessibleTable + * @see AccessibleTableModelChange + */ + public static final String ACCESSIBLE_TABLE_MODEL_CHANGED + = "accessibleTableModelChanged"; + + /** + * Constant used when the accessible table row header has changed. Only the + * new value of the event has meaning. + * + * @see AccessibleTable + * @see AccessibleTableModelChange + */ + public static final String ACCESSIBLE_TABLE_ROW_HEADER_CHANGED + = "accessibleTableRowHeaderChanged"; + + /** + * Constant used when the accessible table row description has changed. Only + * the new value of the event has meaning. + * + * @see AccessibleTable + */ + public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED + = "accessibleTableRowDescriptionChanged"; + + /** + * Constant used when the accessible table column header has changed. Only + * the new value of the event has meaning. + * + * @see AccessibleTable + * @see AccessibleTableModelChange + */ + public static final String ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED + = "accessibleTableColumnHeaderChanged"; + + /** + * Constant used when the accessible table column description has changed. + * Only the new value of the event has meaning. + * + * @see AccessibleTable + */ + public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED + = "accessibleTableColumnDescriptionChanged"; + + /** + * Constant used when supported set of actions has changed. Both the old + * and new values are listed in the event. + * + * @see AccessibleAction + */ + public static final String ACCESSIBLE_ACTION_PROPERTY + = "accessibleActionProperty"; + + /** + * Constant used when a hypertext element received focus. Both the old + * and new values are listed in the event, with -1 indicating that no link + * had focus. + * + * @see AccessibleHyperlink + */ + public static final String ACCESSIBLE_HYPERTEXT_OFFSET + = "AccessibleHypertextOffset"; + + /** + * The accessible parent of this object. + * + * @see #getAccessibleParent() + * @see #setAccessibleParent(Accessible) + */ + protected Accessible accessibleParent; + + /** + * A localized string naming this object. + * + * @see #getAccessibleName() + * @see #setAccessibleName(String) + */ + protected String accessibleName; + + /** + * A localized string describing this object. + * + * @see #getAccessibleDescription() + * @see #setAccessibleDescription(String) + */ + protected String accessibleDescription; + + /** + * The listener tool. + * + * @see #addPropertyChangeListener(PropertyChangeListener) + * @see #removePropertyChangeListener(PropertyChangeListener) + * @see #firePropertyChange(String, Object, Object) + */ + private final PropertyChangeSupport listeners + = new PropertyChangeSupport(this); + + /** + * Default constructor. + */ + public AccessibleContext() + { + } + + /** + * Get the localized name of the object. For example, a label may just + * return the text of the label, while an entry field for city may return + * "city" in en_US. + * + * @return the accessible object's name, or null if it is unnamed + * @see #setAccessibleName(String) + */ + public String getAccessibleName() + { + return accessibleName; + } + + /** + * Set the localized name of the object. This will fire a + * PropertyChangeEvent with ACCESSIBLE_NAME_PROPERTY. + * + * @param s the new name + * @see #getAccessibleName() + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public void setAccessibleName(String s) + { + listeners.firePropertyChange(ACCESSIBLE_NAME_PROPERTY, accessibleName, s); + accessibleName = s; + } + + /** + * Get the localized description of the object. For example, a 'Cancel' + * button may be described as "Ignore changes and close dialog box" in + * en_US. + * + * @return the accessible object's description, or null if there is none + * @see #setAccessibleDescription(String) + */ + public String getAccessibleDescription() + { + return accessibleDescription; + } + + /** + * Set the localized name of the object. This will fire a + * PropertyChangeEvent with ACCESSIBLE_DESCRIPTION_PROPERTY. + * + * @param s the new description + * @see #getAccessibleDescription() + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public void setAccessibleDescription(String s) + { + listeners.firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY, + accessibleDescription, s); + accessibleDescription = s; + } + + /** + * Gets the role of this object. For example, a button serves the role of + * AccessibleRole.PUSH_BUTTON. This allows assistive technologies to funnel + * similar objects into the same assistance classes. Note that the class + * is extensible, to define new roles if necessary. + * + * @return the role of the object + * @see AccessibleRole + */ + public abstract AccessibleRole getAccessibleRole(); + + /** + * Gets the state set of this object. A change in the state of the object + * will fire a PropertyChangeEvent for ACCESSIBLE_STATE_PROPERTY. + * + * @return the current state of the object + * @see AccessibleState + * @see AccessibleStateSet + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public abstract AccessibleStateSet getAccessibleStateSet(); + + /** + * Return the accessible parent of this object. + * + * @return the accessible parent, or null if there is none + */ + public Accessible getAccessibleParent() + { + return accessibleParent; + } + + /** + * Sets the accessible parent of this object. This should only be used when + * the current parent object should not be the accessible parent; only the + * parent of the accessible child should call this method. + * + * @param a the new parent + */ + public void setAccessibleParent(Accessible a) + { + accessibleParent = a; + } + + /** + * Gets the index of this object within its accessible parent. + * + * @return the 0-based index, or -1 if there is no accessible parent + * @see #getAccessibleParent() + * @see #getAccessibleChildrenCount() + * @see #getAccessibleChild(int) + */ + public abstract int getAccessibleIndexInParent(); + + /** + * Returns the number of accessible children of this object. + * + * @return the number of accessible children + * @see #getAccessibleChild(int) + */ + public abstract int getAccessibleChildrenCount(); + + /** + * Returns the specified accessible chile. + * + * @param i the 0-based index to get + * @return the child, or null if out of bounds + * @see #getAccessibleChildrenCount() + */ + public abstract Accessible getAccessibleChild(int i); + + /** + * Gets the component locale, deferring to the parent if one is not declared. + * + * @return the locale + * @throws java.awt.IllegalComponentStateException if there is no locale + * or parent + */ + public abstract Locale getLocale(); + + /** + * Add a PropertyChangeListener to the listener list. This listener will + * be notified of all property changes to the accessible object. + * + * @param l the listener to add + * @see #ACCESSIBLE_NAME_PROPERTY + * @see #ACCESSIBLE_DESCRIPTION_PROPERTY + * @see #ACCESSIBLE_STATE_PROPERTY + * @see #ACCESSIBLE_VALUE_PROPERTY + * @see #ACCESSIBLE_SELECTION_PROPERTY + * @see #ACCESSIBLE_TEXT_PROPERTY + * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY + * @see #removePropertyChangeListener(PropertyChangeListener) + */ + public void addPropertyChangeListener(PropertyChangeListener l) + { + listeners.addPropertyChangeListener(l); + } + + /** + * Remove a PropertyChangeListener from the listener list. + * + * @param l the listener to remove + * @see #addPropertyChangeListener(PropertyChangeListener) + */ + public void removePropertyChangeListener(PropertyChangeListener l) + { + listeners.removePropertyChangeListener(l); + } + + /** + * Get any supported accessible actions. The default implementation returns + * null. + * + * @return the supported action, or null + * @see AccessibleAction + */ + public AccessibleAction getAccessibleAction() + { + return null; + } + + /** + * Get any supported accessible compoent. The default implementation returns + * null. + * + * @return the supported component, or null + * @see AccessibleComponent + */ + public AccessibleComponent getAccessibleComponent() + { + return null; + } + + /** + * Get any supported accessible selection. The default implementation returns + * null. + * + * @return the supported selection, or null + * @see AccessibleSelection + */ + public AccessibleSelection getAccessibleSelection() + { + return null; + } + + /** + * Get any supported accessible text. The default implementation returns + * null. + * + * @return the supported text, or null + * @see AccessibleText + */ + public AccessibleText getAccessibleText() + { + return null; + } + + /** + * Get any supported accessible editable text. The default implementation + * returns null. + * + * @return the supported editable text, or null + * @see AccessibleEditableText + */ + public AccessibleEditableText getAccessibleEditableText() + { + return null; + } + + /** + * Get any supported accessible value. The default implementation returns + * null. + * + * @return the supported value, or null + * @see AccessibleValue + */ + public AccessibleValue getAccessibleValue() + { + return null; + } + + /** + * Get all supported accessible icons. The default implementation returns + * null. + * + * @return the supported icons, or null + * @see AccessibleIcon + */ + public AccessibleIcon[] getAccessibleIcon() + { + return null; + } + + /** + * Get any supported accessible relation set. The default implementation + * returns null. + * + * @return the supported relation set, or null + * @see AccessibleRelationSet + */ + public AccessibleRelationSet getAccessibleRelationSet() + { + return null; + } + + /** + * Get any supported accessible table. The default implementation returns + * null. + * + * @return the supported table, or null + * @see AccessibleTable + */ + public AccessibleTable getAccessibleTable() + { + return null; + } + + /** + * Fire an event to report property changes. This is intended for use by + * the accessible objects, not general application programs. If oldValue and + * newValue differ, and the listenter list is not empty, a PropertyChange + * event is fired to each listener. + * + * @param name the property name + * @param oldValue the prior value + * @param newValue the updated value + * @see PropertyChangeSupport + * @see #addPropertyChangeListener(PropertyChangeListener) + * @see #removePropertyChangeListener(PropertyChangeListener) + * @see #ACCESSIBLE_NAME_PROPERTY + * @see #ACCESSIBLE_DESCRIPTION_PROPERTY + * @see #ACCESSIBLE_STATE_PROPERTY + * @see #ACCESSIBLE_VALUE_PROPERTY + * @see #ACCESSIBLE_SELECTION_PROPERTY + * @see #ACCESSIBLE_TEXT_PROPERTY + * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY + */ + public void firePropertyChange(String name, Object oldValue, Object newValue) + { + listeners.firePropertyChange(name, oldValue, newValue); + } + } // class AccessibleContext diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleEditableText.java gcc-3.3/libjava/javax/accessibility/AccessibleEditableText.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleEditableText.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleEditableText.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,142 ---- + /* AccessibleEditableText.java -- aids in accessibly for editable text + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + import javax.swing.text.AttributeSet; + + /** + * Objects which present editable textual information on the display should + * implement this interface. Accessibility software can use the + * implementations of this interface to change the content, attributes, + * and spacial location of the text. + * + *

          The AccessibleContext.getAccessibleEditableText() method + * should return null if an object does not implement this + * interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleText() + * @see AccessibleContext#getAccessibleEditableText() + * @since 1.2 + * @status updated to 1.4, except for javax.swing support + */ + public interface AccessibleEditableText extends AccessibleText + { + /** + * Set the text contents to the given string. + * + * @param s the new text + */ + // XXX What happens if s is null? + void setTextContents(String s); + + /** + * Inserts the given string at the specified location. + * + * @param index the index for insertion + * @param s the new text + */ + // XXX What happens if index is out of bounds, or s is null? + void insertTextAtIndex(int index, String s); + + /** + * Return the text between two points. + * + * @param start the start position, inclusive + * @param end the end position, exclusive + */ + // XXX What happens if indices are out of bounds? + String getTextRange(int start, int end); + + /** + * Delete the text between two points. + * + * @param start the start position, inclusive + * @param end the end position, exclusive + */ + // XXX What happens if indices are out of bounds? + String delete(int start, int end); + + /** + * Cut the text between two points to the system clipboard. + * + * @param start the start position, inclusive + * @param end the end position, exclusive + */ + // XXX What happens if indices are out of bounds? + String cut(int start, int end); + + /** + * Paste the text from the system clipboard at the given index. + * + * @param start the start position + */ + // XXX What happens if start is out of bounds? + void paste(int start); + + /** + * Replace the text between two points with the given string. + * + * @param start the start position, inclusive + * @param end the end position, exclusive + * @param s the string to paste + */ + // XXX What happens if indices are out of bounds, or s is null? + void replaceText(int start, int end, String s); + + /** + * Select the text between two points. + * + * @param start the start position, inclusive + * @param end the end position, exclusive + */ + // XXX What happens if indices are out of bounds? + void selectText(int start, int stop); + + /** + * Set the attributes of text between two points. + * + * @param start the start position, inclusive + * @param end the end position, exclusive + * @param s the new attribute set for the range + */ + // XXX What happens if indices are out of bounds, or s is null? + void setAttributes(int start, int end, AttributeSet s); + } // interface AccessibleEditableText diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleExtendedComponent.java gcc-3.3/libjava/javax/accessibility/AccessibleExtendedComponent.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleExtendedComponent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleExtendedComponent.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,78 ---- + /* AccessibleExtendedComponent.java -- aids in extended component access + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + /** + * Objects which present graphical components with extensions such as key + * bindings or tool-tips should implement this interface. Accessibility + * software can use the implementations of this interface to display the + * extended information of the component. + * + *

          The AccessibleContext.getAccessibleComponent() method + * should return an instance of this interface only when it is supported. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleComponent() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleExtendedComponent extends AccessibleComponent + { + /** + * Returns the tool-tip text for this component. + * + * @return the tool-tip, or null if not supported + */ + String getToolTipText(); + + /** + * Returns the title border text for this component. + * + * @return the titled border text, or null if not supported + */ + String getTitledBorderText(); + + /** + * Returns the accessible key bindings for this component. + * + * @return the key bindings, or null if not supported + */ + AccessibleKeyBinding getAccessibleKeyBinding(); + } // interface AccessibleExtendedComponent diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleExtendedTable.java gcc-3.3/libjava/javax/accessibility/AccessibleExtendedTable.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleExtendedTable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleExtendedTable.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,81 ---- + /* AccessibleExtendedTable.java -- aids in extended table access + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + /** + * Objects which present 2-D tables with the extension of a flat address + * space should implement this interface. Accessibility software can use the + * implementations of this interface to better manipulate the table. + * + *

          The AccessibleContext.getAccessibleTable() method + * should return an instance of this interface only when it is supported. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleTable() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleExtendedTable extends AccessibleTable + { + /** + * Returns the row number of an index in the table. + * + * @param index the cell index, in row-major form from (0,0) + * @return the row number, or -1 if out of bounds + */ + int getAccessibleRow(int index); + + /** + * Returns the column number of an index in the table. + * + * @param index the cell index, in row-major form from (0,0) + * @return the column number, or -1 if out of bounds + */ + int getAccessibleColumn(int index); + + /** + * Returns the cell number for a row-major address from (0,0). + * + * @param r the row + * @param c the column + * @return the cell index + */ + int getAccessibleIndex(int r, int c); + } // interface AccessibleExtendedTable diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleHyperlink.java gcc-3.3/libjava/javax/accessibility/AccessibleHyperlink.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleHyperlink.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleHyperlink.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,139 ---- + /* AccessibleHyperlink.java -- aids in accessibly navigating hypertext + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * This object encapsulates actions associated with navigating hypertext. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleText + * @see AccessibleContext#getAccessibleText() + * @since 1.2 + * @status updated to 1.4 + */ + public abstract class AccessibleHyperlink implements AccessibleAction + { + /** + * The default constructor. + */ + public AccessibleHyperlink() + { + } + + /** + * Returns whether the document the link references is still valid, as the + * association may have changed with a text edit. + * + * @return true if the link is valid with respect to the AccessibleHypertext + */ + public abstract boolean isValid(); + + /** + * Get the number possible actions for this object, starting from 0. In + * general, a hypertext link has only one action, except for an image map, + * so there isn't really a default action. + * + * @return the 0-based number of actions + */ + public abstract int getAccessibleActionCount(); + + /** + * Perform the specified action. Does nothing if out of bounds. + * + * @param i the action to perform, 0-based + * @return true if the action was performed + * @see #getAccessibleActionCount() + */ + public abstract boolean doAccessibleAction(int i); + + /** + * Get the anchor text of the link, or null if the index is out of bounds. + * For example, <a href="http://www.gnu.org/">GNU Home Page</a> + * would return "GNU Home Page", while <a HREF="#top"> + * <img src="top-hat.png" alt="top hat"></a> would return + * "top hat". + * + * @param i the link to retrieve, 0-based + * @return the link anchor text + * @see #getAccessibleActionCount() + */ + public abstract String getAccessibleActionDescription(int i); + + /** + * Get the link location, or null if the index is out of bounds. For + * example, <a href="http://www.gnu.org/">GNU Home Page</a> + * would return a java.net.URL("http://www.gnu.org/"). + * + * @param i the link to retrieve, 0-based + * @return the link location + * @see #getAccessibleActionCount() + */ + public abstract String getAccessibleActionObject(int i); + + /** + * Get the anchor appropriate for the link, or null if the index is out of + * bounds. For example, <a href="http://www.gnu.org/">GNU Home Page + * </a> would return "GNU Home Page", while <a HREF="#top"> + * <img src="top-hat.png" alt="top hat"></a> would return + * an ImageIcon("top-hat.png", "top hat"). + * + * @param i the link to retrieve, 0-based + * @return the link anchor object + * @see #getAccessibleActionCount() + */ + public abstract String getAccessibleActionAnchor(int i); + + /** + * Gets the character index where this link starts in the parent hypertext + * document. + * + * @return the starting index + */ + public abstract int getStartIndex(); + + /** + * Gets the character index where this link ends in the parent hypertext + * document. + * + * @return the ending index + */ + public abstract int getEndIndex(); + } // class AccessibleAction diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleHypertext.java gcc-3.3/libjava/javax/accessibility/AccessibleHypertext.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleHypertext.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleHypertext.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,84 ---- + /* AccessibleHypertext.java -- aids in accessibly rendering hypertext + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * Objects which present hyperlinks in a document should implement this + * interface. Accessibility software can use the implementations of this + * interface to aid the user in navigating the links. + * + *

          The AccessibleContext.getAccessibleText() method + * should return an instance of this interface only when it is supported. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleText + * @see AccessibleContext#getAccessibleText() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleHypertext extends AccessibleText + { + /** + * Returns the number of links in the document, if any exist. + * + * @return the number of links, or -1 + */ + int getLinkCount(); + + /** + * Returns link object denoted by the number i in this + * document, or null if i is out of bounds. + * + * @param i the ith hyperlink of the document + * @return link object denoted by i + */ + AccessibleHyperlink getLink(int i); + + /** + * Returns the link index for this character index if it resides within + * one of the hyperlinks of the document. If no association exists at that + * character, or c is out of bounds, returns -1. + * + * @param c the character index + * @return the link index, or -1 + */ + int getLinkIndex(int c); + } // interface AccessibleHypertext diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleIcon.java gcc-3.3/libjava/javax/accessibility/AccessibleIcon.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleIcon.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleIcon.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,85 ---- + /* AccessibleIcon.java -- aids in accessibly rendering icons + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * Objects which have an associated icon, such as buttons, should implement + * this interface. Accessibility software can use the implementations of this + * interface to aid the user in navigating the links. + * + *

          The AccessibleContext.getAccessibleIcon() method should + * return null if an object does not implement this interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleIcon() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleIcon + { + /** + * Returns a textual description of the icon and its purpose. + * + * @return the description, or null if there is none + */ + String getAccessibleIconDescription(); + + /** + * Modify the textual description of the icon and its purpose. + * + * @param s the new descrption string + */ + void setAccessibleIconDescription(String s); + + /** + * Get the icon width. + * + * @return the width + */ + int getAccessibleIconWidth(); + + /** + * Get the icon height. + * + * @return the height + */ + int getAccessibleIconHeight(); + } // interface AccessibleIcon diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/Accessible.java gcc-3.3/libjava/javax/accessibility/Accessible.java *** gcc-3.2.3/libjava/javax/accessibility/Accessible.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/Accessible.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,61 ---- + /* Accessible.java -- primary Java accessibility interface + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * Implementing the Accessibility API must start with implementation + * of this interface at a bare minimum. This is the major interface + * for the Accessibility API which must be implemented by all user + * interface components. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public interface Accessible + { + /** + * If a component supports the Accessibility API then this method should + * not return null. Only classes which must extend an accessible + * class, but must not itself be accessible, may return null. + * + * @return the context associated with this accessible object + */ + AccessibleContext getAccessibleContext(); + } // interface Accessible diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleKeyBinding.java gcc-3.3/libjava/javax/accessibility/AccessibleKeyBinding.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleKeyBinding.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleKeyBinding.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,78 ---- + /* AccessibleKeyBinding.java -- aids in using keyboard navigation + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * Objects which have keyboard bindings for mneumonics or shortcuts should + * implement this interface. Accessibility software can use the + * implementations of this interface to aid the user in using the key + * bindings. + * + *

          The AccessibleContext.getAccessibleKeyBinding() method + * should return null if an object does not implement this + * interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleKeyBinding() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleKeyBinding + { + /** + * Returns the count of key bindings for this object. + * + * @return the 0-based count, or -1 if there are none + */ + int getAccessibleKeyBindingCount(); + + /** + * Return the numbered key binding, which can then be cast in an + * implementation dependent way to the appropriate object type. For example, + * swing uses javax.swing.KeyStroke. This returns null if i + * is out of bounds. + * + * @param i the 0-based index of key bindings + * @return the key binding + * @see #getAccessibleKeyBindingCount() + */ + Object getAccessibleKeyBinding(int i); + } // interface AccessibleKeyBinding diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleRelation.java gcc-3.3/libjava/javax/accessibility/AccessibleRelation.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleRelation.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleRelation.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,220 ---- + /* AccessibleRelation.java -- the relation between accessible objects + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + /** + * The relation between one accessible object and one or more other objects. + * For example, a button may control an action. An AccessibleRelationSet + * summarizes all relations of the object. This strongly typed "enumeration" + * supports localized strings. If the constants of this class are not + * adequate, new ones may be added in a similar matter. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public class AccessibleRelation extends AccessibleBundle + { + /** + * Indicates the object labels other objects. + * + * @see #getTarget() + * @see #CONTROLLER_FOR + * @see #CONTROLLED_BY + * @see #LABELED_BY + * @see #MEMBER_OF + */ + public static final String LABEL_FOR = "labelFor"; + + /** + * Indicates the object is labeled by other objects. + * + * @see #getTarget() + * @see #CONTROLLER_FOR + * @see #CONTROLLED_BY + * @see #LABEL_FOR + * @see #MEMBER_OF + */ + public static final String LABELED_BY = "labeledBy"; + + /** + * Indicates an object is a member of a group of target objects. + * + * @see #getTarget() + * @see #CONTROLLER_FOR + * @see #CONTROLLED_BY + * @see #LABEL_FOR + * @see #LABELED_BY + */ + public static final String MEMBER_OF = "memberOf"; + + /** + * Indicates an object is a controller for other objects. + * + * @see #getTarget() + * @see #CONTROLLED_BY + * @see #LABEL_FOR + * @see #LABELED_BY + * @see #MEMBER_OF + */ + public static final String CONTROLLER_FOR = "controllerFor"; + + /** + * Indicates an object is controlled by other objects. + * + * @see #getTarget() + * @see #CONTROLLER_FOR + * @see #LABEL_FOR + * @see #LABELED_BY + * @see #MEMBER_OF + */ + public static final String CONTROLLED_BY = "controlledBy"; + + /** Indicates that the label target group has changed. */ + public static final String LABEL_FOR_PROPERTY = "labelForProperty"; + + /** Indicates that the labelling objects have changed. */ + public static final String LABELED_BY_PROPERTY = "labeledByProperty"; + + /** Indicates that group membership has changed. */ + public static final String MEMBER_OF_PROPERTY = "memberOfProperty"; + + /** Indicates that the controller target group has changed. */ + public static final String CONTROLLER_FOR_PROPERTY = "controllerForProperty"; + + /** Indicates that the controlling objects have changed. */ + public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty"; + + /** An empty set of targets. */ + private static final Object[] EMPTY_TARGETS = { }; + + /** + * The related objects. + * + * @see #getTarget() + * @see #setTarget(Object) + * @see #setTarget(Object[]) + */ + Object[] targets; + + /** + * Create a new relation with a locale independent key, and no related + * objects. + * + * @param key the name of the role + * @see #toDisplayString(String, Locale) + */ + public AccessibleRelation(String key) + { + this.key = key; + targets = EMPTY_TARGETS; + } + + /** + * Create a new relation with a locale independent key, and a single related + * object. + * + * @param key the name of the role + * @param target the related object + * @see #toDisplayString(String, Locale) + */ + public AccessibleRelation(String key, Object target) + { + this.key = key; + targets = new Object[] { target }; + } + + /** + * Create a new relation with a locale independent key, and the given + * related objects. + * + * @param key the name of the role + * @param targets the related objects + * @see #toDisplayString(String, Locale) + */ + public AccessibleRelation(String key, Object[] targets) + { + this.key = key; + this.targets = targets == null ? EMPTY_TARGETS : targets; + } + + /** + * Return the key for this relation. + * + * @return the key + * @see #CONTROLLER_FOR + * @see #CONTROLLED_BY + * @see #LABEL_FOR + * @see #LABELED_BY + * @see #MEMBER_OF + */ + public String getKey() + { + return key; + } + + /** + * Return the targets of this relation. + * + * @return the targets, may be empty, but never null + */ + public Object[] getTarget() + { + return targets; + } + + /** + * Set the target to a single object. + * + * @param target the new target + */ + public void setTarget(Object target) + { + targets = new Object[] { target }; + } + + /** + * Set the target to an array of objects. + * + * @param targets the new targets + */ + public void setTarget(Object[] targets) + { + this.targets = targets == null ? EMPTY_TARGETS : targets; + } + } // class AccessibleRelation diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleRelationSet.java gcc-3.3/libjava/javax/accessibility/AccessibleRelationSet.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleRelationSet.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleRelationSet.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,222 ---- + /* AccessibleRelationSet.java -- the combined relations of an accessible object + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + import java.util.Vector; + + /** + * Describes all relations of an accessible object. For example, an object + * by labeled by one object and control another. + * + * @author Eric Blake + * @see AccessibleRelation + * @since 1.2 + * @status updated to 1.4 + */ + public class AccessibleRelationSet + { + /** + * The list of relations, should be instances of AccessibleRelation. Don't + * set this to null. + * + * @see #add(AccessibleRelation) + * @see #addAll(AccessibleRelation[]) + * @see #remove(AccessibleRelation) + * @see #contains(String) + * @see #get(String) + * @see #size() + * @see #toArray() + * @see #clear() + */ + protected Vector relations = new Vector(); + + /** + * Create an empty relation set. + */ + public AccessibleRelationSet() + { + } + + /** + * Create a relation set initialized with the given relations, duplicates are + * ignored. + * + * @param relations the relations to insert + * @throws NullPointerException if relations is null + */ + public AccessibleRelationSet(AccessibleRelation[] relations) + { + addAll(relations); + } + + /** + * Add a new relation to the current set. If the relation is already in + * the set, the targets are merged with the existing relation, possibly + * resulting in an object being in the target list more than once. Do not + * add a relation with a null key, as it will cause problems later. + * + * @param relation the relation to add + * @return true if the set was modified, which is always the case + * @throws NullPointerException if relation is null + */ + public boolean add(AccessibleRelation relation) + { + AccessibleRelation old = get(relation.key); + if (old == null) + return relations.add(relation); + if (old.targets.length == 0) + old.targets = relation.targets; + else if (relation.targets.length != 0) + { + Object[] t = new Object[old.targets.length + relation.targets.length]; + System.arraycopy(old.targets, 0, t, 0, old.targets.length); + System.arraycopy(relation.targets, 0, t, old.targets.length, + relation.targets.length); + old.targets = t; + } + return true; + } + + /** + * Add all of the relations to the current set. Duplicates are ignored. + * + * @param array the array of relations to add + * @throws NullPointerException if array is null or has null entries + */ + public void addAll(AccessibleRelation[] array) + { + int i = array.length; + while (--i >= 0) + add(array[i]); + } + + /** + * Remove a relation from the set. If a relation was removed, return true. + * Note that this uses AccessibleRelation.equals, which defaults to ==, so a + * relation with the same key may still exist in the set afterwords. + * + * @param relation the state to remove + * @return true if the set changed + */ + public boolean remove(AccessibleRelation relation) + { + return relations.remove(relation); + } + + /** + * Clear all relations in the set. + */ + public void clear() + { + relations.clear(); + } + + /** + * Return the number of relations in the set. + * + * @return the set size + */ + public int size() + { + return relations.size(); + } + + /** + * Check if the relation key is in the set. + * + * @param relation the relation to locate + * @return true if it is in the set + */ + public boolean contains(String key) + { + int i = relations.size(); + while (--i >= 0) + if (((AccessibleRelation) relations.get(i)).key.equals(key)) + return true; + return false; + } + + /** + * Get the relation that matches the key. + * + * @param relation the relation to locate + * @return the relation in the set, or null + */ + public AccessibleRelation get(String key) + { + int i = relations.size(); + while (--i >= 0) + { + AccessibleRelation r = (AccessibleRelation) relations.get(i); + if (r.key.equals(key)) + return r; + } + return null; + } + + /** + * Return the relation set as an array. + * + * @return an array of the current relations + */ + public AccessibleRelation[] toArray() + { + AccessibleRelation[] result = new AccessibleRelation[relations.size()]; + relations.toArray(result); + return result; + } + + /** + * Return a localized, comma-separated string representing all relations + * in the set. This is in arbitrary order. + * + * @return the string representation + * @see AccessibleBundle#toDisplayString(String, Locale) + */ + public String toString() + { + int i = relations.size(); + if (i == 0) + return ""; + // Pre-allocate an average of 10 chars per state. + StringBuffer b = new StringBuffer(i * 10); + while (--i >= 0) + b.append(relations.get(i)).append(','); + return b.substring(0, b.length() - 1); + } + } // class AccessibleRelationSet diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleResourceBundle.java gcc-3.3/libjava/javax/accessibility/AccessibleResourceBundle.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleResourceBundle.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleResourceBundle.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,74 ---- + /* AccessibleResourceBundle.java -- deprecated class + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + import java.util.ListResourceBundle; + + /** + * This class is deprecated. It once was used for localizing accessibility + * strings, and was never meant for external use anyway. + * + * @author Eric Blake + * @see AccessibleBundle.toDisplayString(String, Locale) + * @since 1.2 + * @deprecated this class is no longer used + * @status updated to 1.4 + */ + public class AccessibleResourceBundle extends ListResourceBundle + { + /** + * Default constructor. + * + * @deprecated do not use this class + */ + public AccessibleResourceBundle() + { + } + + /** + * Returns the mapping between keys and display strings. + * + * @return null + * @deprecated do not use this class + */ + public Object[][] getContents() + { + return null; + } + } // class AccessibleResourceBundle diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleRole.java gcc-3.3/libjava/javax/accessibility/AccessibleRole.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleRole.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleRole.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,478 ---- + /* AccessibleRole.java -- the primary role of an accessible object + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + /** + * The role of an accessible object. For example, this could be "button" or + * "table". This strongly typed "enumeration" supports localized strings. If + * the constants of this class are not adequate, new ones may be added in a + * similar matter, while avoiding a public constructor. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public class AccessibleRole extends AccessibleBundle + { + /** The object alerts the user about something. */ + public static final AccessibleRole ALERT + = new AccessibleRole("alert"); + + /** The header for a column of data. */ + public static final AccessibleRole COLUMN_HEADER + = new AccessibleRole("column header"); + + /** + * The object can be drawn into, and traps events. + * + * @see #FRAME + * @see #GLASS_PANE + * @see #LAYERED_PANE + */ + public static final AccessibleRole CANVAS + = new AccessibleRole("canvas"); + + /** + * A list of choices, which may optionally allow the user to create a new + * choice. + */ + public static final AccessibleRole COMBO_BOX + = new AccessibleRole("combo box"); + + /** + * An iconified frame in a desktop. + * + * @see #DESKTOP_PANE + * @see #INTERNAL_FRAME + */ + public static final AccessibleRole DESKTOP_ICON + = new AccessibleRole("desktop icon"); + + /** + * A frame-like object clipped by a desktop pane. + * + * @see #DESKTOP_ICON + * @see #DESKTOP_PANE + * @see #FRAME + */ + public static final AccessibleRole INTERNAL_FRAME + = new AccessibleRole("internal frame"); + + /** + * A pane which supports internal frames and their icons. + * + * @see #DESKTOP_ICON + * @see #INTERNAL_FRAME + */ + public static final AccessibleRole DESKTOP_PANE + = new AccessibleRole("desktop pane"); + + /** + * A specialized pane for use in a dialog. + * + * @see #DIALOG + */ + public static final AccessibleRole OPTION_PANE + = new AccessibleRole("option pane"); + + /** + * A top level window with no title or border. + * + * @see #FRAME + * @see #DIALOG + */ + public static final AccessibleRole WINDOW + = new AccessibleRole("window"); + + /** + * A top level window with title, menu bar, border, and so forth. It is + * often the primary window of an application. + * + * @see #DIALOG + * @see #CANVAS + * @see #WINDOW + */ + public static final AccessibleRole FRAME + = new AccessibleRole("frame"); + + /** + * A top level window title bar and border. It is limited compared to a + * frame, and is often a secondary window. + * + * @see #FRAME + * @see #WINDOW + */ + public static final AccessibleRole DIALOG + = new AccessibleRole("dialog"); + + /** A specialized dialog for choosing a color. */ + public static final AccessibleRole COLOR_CHOOSER + = new AccessibleRole("color chooser"); + + /** + * A pane for navigating through directories. + * + * @see #FILE_CHOOSER + */ + public static final AccessibleRole DIRECTORY_PANE + = new AccessibleRole("directory pane"); + + /** + * A specialized dialog that allows a user to select a file. + * + * @see #DIRECTORY_PANE + */ + public static final AccessibleRole FILE_CHOOSER + = new AccessibleRole("file chooser"); + + /** An object to fill space between other components. */ + public static final AccessibleRole FILLER + = new AccessibleRole("filler"); + + /** A hypertext anchor. */ + public static final AccessibleRole HYPERLINK + = new AccessibleRole("hyperlink"); + + /** A small picture to decorate components. */ + public static final AccessibleRole ICON + = new AccessibleRole("icon"); + + /** An object to label something in a graphic interface. */ + public static final AccessibleRole LABEL + = new AccessibleRole("label"); + + /** + * A specialized pane with a glass pane and layered pane as children. + * + * @see #GLASS_PANE + * @see #LAYERED_PANE + */ + public static final AccessibleRole ROOT_PANE + = new AccessibleRole("root pane"); + + /** + * A pane guaranteed to be painted on top of panes beneath it. + * + * @see #ROOT_PANE + * @see #LAYERED_PANE + */ + public static final AccessibleRole GLASS_PANE + = new AccessibleRole("glass pane"); + + /** + * A specialized pane that allows drawing children in layers. This is often + * used in menus and other visual components. + * + * @see #ROOT_PANE + * @see #GLASS_PANE + */ + public static final AccessibleRole LAYERED_PANE + = new AccessibleRole("layered pane"); + + /** + * An object which presents a list of items for selection. Often contained + * in a scroll pane. + * + * @see #SCROLL_PANE + * @see #LIST_ITEM + */ + public static final AccessibleRole LIST + = new AccessibleRole("list"); + + /** + * An object which represents an item in a list. Often contained in a scroll + * pane. + * + * @see #SCROLL_PANE + * @see #LIST + */ + public static final AccessibleRole LIST_ITEM + = new AccessibleRole("list item"); + + /** + * An object usually at the top of a frame to list available menus. + * + * @see #MENU + * @see #POPUP_MENU + * @see #LAYERED_PANE + */ + public static final AccessibleRole MENU_BAR + = new AccessibleRole("menu bar"); + + /** + * A temporary window with a menu of options, which hides on selection. + * + * @see #MENU + * @see #MENU_ITEM + */ + public static final AccessibleRole POPUP_MENU + = new AccessibleRole("popup menu"); + + /** + * An object usually in a menu bar which contains a list of actions to + * perform. Such actions are usually associated with menu items or submenus. + * + * @see #MENU_BAR + * @see #MENU_ITEM + * @see #SEPARATOR + * @see #RADIO_BUTTON + * @see #CHECK_BOX + * @see #POPUP_MENU + */ + public static final AccessibleRole MENU + = new AccessibleRole("menu"); + + /** + * An object usually in a menu with an action available for the user. + * + * @see #MENU_BAR + * @see #SEPARATOR + * @see #POPUP_MENU + */ + public static final AccessibleRole MENU_ITEM + = new AccessibleRole("menu item"); + + /** + * An object usually in a menu which separates logical sections of items. + * + * @see #MENU + * @see #MENU_ITEM + */ + public static final AccessibleRole SEPARATOR + = new AccessibleRole("separator"); + + /** + * An object which presents a series of panels, usually via tabs along the + * top. Children are all page tabs. + * + * @see #PAGE_TAB + */ + public static final AccessibleRole PAGE_TAB_LIST + = new AccessibleRole("page tab list"); + + /** + * An object in a page tab list, which contains the panel to display when + * selected from the list. + * + * @see #PAGE_TAB_LIST + */ + public static final AccessibleRole PAGE_TAB + = new AccessibleRole("page tab"); + + /** A generic container to group objects. */ + public static final AccessibleRole PANEL + = new AccessibleRole("panel"); + + /** An object used to track amount of a task that has completed. */ + public static final AccessibleRole PROGRESS_BAR + = new AccessibleRole("progress bar"); + + /** An object for passwords which should not be shown to the user. */ + public static final AccessibleRole PASSWORD_TEXT + = new AccessibleRole("password text"); + + /** + * An object that can be manipulated to do something. + * + * @see #CHECK_BOX + * @see #TOGGLE_BUTTON + * @see #RADIO_BUTTON + */ + public static final AccessibleRole PUSH_BUTTON + = new AccessibleRole("push button"); + + /** + * A specialized button which can be on or off, with no separate indicator. + * + * @see #PUSH_BUTTON + * @see #CHECK_BOX + * @see #RADIO_BUTTON + */ + public static final AccessibleRole TOGGLE_BUTTON + = new AccessibleRole("toggle button"); + + /** + * A choice which can be on or off, and has a separate indicator. + * + * @see #PUSH_BUTTON + * @see #TOGGLE_BUTTON + * @see #RADIO_BUTTON + */ + public static final AccessibleRole CHECK_BOX + = new AccessibleRole("check box"); + + /** + * A specialized choice which toggles radio buttons in the group when it + * is selected. + * + * @see #PUSH_BUTTON + * @see #TOGGLE_BUTTON + * @see #CHECK_BOX + */ + public static final AccessibleRole RADIO_BUTTON + = new AccessibleRole("radio button"); + + /** The header for a row of data. */ + public static final AccessibleRole ROW_HEADER + = new AccessibleRole("row header"); + + /** + * An object which allows an incremental view of a larger pane. + * + * @see #SCROLL_BAR + * @see #VIEWPORT + */ + public static final AccessibleRole SCROLL_PANE + = new AccessibleRole("scroll pane"); + + /** + * An object which allows selection of the view in a scroll pane. + * + * @see #SCROLL_PANE + */ + public static final AccessibleRole SCROLL_BAR + = new AccessibleRole("scroll bar"); + + /** + * An object which represents the visual section in a scroll pane. + * + * @see #SCROLL_PANE + */ + public static final AccessibleRole VIEWPORT + = new AccessibleRole("viewport"); + + /** An object which allows selection in a bounded range. */ + public static final AccessibleRole SLIDER + = new AccessibleRole("slider"); + + /** + * A specialized pane which presents two other panels, and can often adjust + * the divider between them. + */ + public static final AccessibleRole SPLIT_PANE + = new AccessibleRole("split pane"); + + /** An object for presenting data in rows and columns. */ + public static final AccessibleRole TABLE + = new AccessibleRole("table"); + + /** + * An object which represents text, usually editable by the user. + * + * @see #LABEL + */ + public static final AccessibleRole TEXT + = new AccessibleRole("text"); + + /** + * An object which represents a hierachical view of data. Subnodes can + * often be expanded or collapsed. + */ + public static final AccessibleRole TREE + = new AccessibleRole("tree"); + + /** A bar or pallete with buttons for common actions in an application. */ + public static final AccessibleRole TOOL_BAR + = new AccessibleRole("tool bar"); + + /** + * An object which provides information about another object. This is often + * displayed as a "help bubble" when a mouse hovers over the other object. + */ + public static final AccessibleRole TOOL_TIP + = new AccessibleRole("tool tip"); + + /** + * An AWT component with nothing else known about it. + * + * @see #SWING_COMPONENT + * @see #UNKNOWN + */ + public static final AccessibleRole AWT_COMPONENT + = new AccessibleRole("AWT component"); + + /** + * A swing component with nothing else known about it. + * + * @see #AWT_COMPONENT + * @see #UNKNOWN + */ + public static final AccessibleRole SWING_COMPONENT + = new AccessibleRole("SWING component"); + + /** + * An accessible object whose role is unknown. + * + * @see #AWT_COMPONENT + * @see #SWING_COMPONENT + */ + public static final AccessibleRole UNKNOWN + = new AccessibleRole("unknown"); + + /** A component with multiple labels of status information. */ + public static final AccessibleRole STATUS_BAR + = new AccessibleRole("statusbar"); + + /** A component which allows editing of Date and Time objects. */ + public static final AccessibleRole DATE_EDITOR + = new AccessibleRole("dateeditor"); + + /** A component with spinner arrows for simple numbers. */ + public static final AccessibleRole SPIN_BOX + = new AccessibleRole("spinbox"); + + /** A component for choosing fonts and their attributes. */ + public static final AccessibleRole FONT_CHOOSER + = new AccessibleRole("fontchooser"); + + /** A component with a border to group other components. */ + public static final AccessibleRole GROUP_BOX + = new AccessibleRole("groupbox"); + + /** + * Create a new constant with a locale independent key. Follow the example, + * keep the constructor private and make public constants instead. + * + * @param key the name of the role + * @see #toDisplayString(String, Locale) + */ + protected AccessibleRole(String key) + { + this.key = key; + } + } // class AccessibleRole diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleSelection.java gcc-3.3/libjava/javax/accessibility/AccessibleSelection.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleSelection.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleSelection.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,113 ---- + /* AccessibleSelection.java -- aids in accessibly selecting components + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * If an object implements this interface then it must be able to control + * the selection of its children. Accessibility software can use the + * implementations of this interface to change the selection set of children. + * + *

          The AccessibleContext.getAccessibleSelection() method should + * return null if an object does not implement this interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleSelection() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleSelection + { + /** + * Returns the number of currently selected Accessible children, which may + * be 0 if nothing is selected. + * + * @return the number of selected children + */ + int getAccessibleSelectionCount(); + + /** + * Returns the i-th selected child (not necessarily the overall i-th child) + * of this Accessible object. If i is out of bounds, null is returned. + * + * @param i zero-based index of selected child objects + * @return the Accessible child, or null + * @see #getAccessibleSelectionCount() + */ + Accessible getAccessibleSelection(int i); + + /** + * Determine if i-th overall child of this accessible object is selected. + * If i is out of bounds, false is returned. + * + * @param i zero-based index of child objects + * @return true if specified child exists and is selected + */ + boolean isAccessibleChildSelected(int i); + + /** + * Select the specified child if it is not already selected, placing it in + * the object's current selection. If the object does not support multiple + * selections then the new selection replaces the old. If the specified + * child is already selected, or is out of bounds, this method does nothing. + * + * @param i zero-based index of child objects + */ + void addAccessibleSelection(int i); + + /** + * Unselect the specified child of this Accessible object. If the specified + * child is not selected, or is out of bounds, this method does nothing. + * + * @param i the zero-based index of the child objects + */ + void removeAccessibleSelection(int i); + + /** + * Unselect all children of this Accessible object. + */ + void clearAccessibleSelection(); + + /** + * Select all children of this Accessible object if the object supports + * multiple selections or has a single child. Otherwise this does nothing. + */ + void selectAllAccessibleSelection(); + } // interface AccessibleSelection diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleState.java gcc-3.3/libjava/javax/accessibility/AccessibleState.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleState.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleState.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,315 ---- + /* AccessibleState.java -- a state of an accessible object + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + /** + * A state portion of an accessible object. A combination of states represent + * the entire object state, in an AccessibleStateSet. For example, this could + * be "active" or "selected". This strongly typed "enumeration" supports + * localized strings. If the constants of this class are not adequate, new + * ones may be added in a similar matter, while avoiding a public constructor. + * + * @author Eric Blake + * @since 1.2 + * @status updated to 1.4 + */ + public class AccessibleState extends AccessibleBundle + { + /** + * Indicates an active window, as well as an active child in a list or other + * collection. + * + * @see AccessibleRole#WINDOW + * @see AccessibleRole#FRAME + * @see AccessibleRole#DIALOG + */ + public static final AccessibleState ACTIVE + = new AccessibleState("active"); + + /** + * Indicates a pushed button, usually when the mouse has been pressed but + * not released. + * + * @see AccessibleRole#PUSH_BUTTON + */ + public static final AccessibleState PRESSED + = new AccessibleState("pressed"); + + /** + * Indicates an armed object, usually a button which has been pushed and + * the mouse has not left the button area. + * + * @see AccessibleRole#PUSH_BUTTON + */ + public static final AccessibleState ARMED + = new AccessibleState("armed"); + + /** + * Indicates an object is busy, such as a slider, scroll bar, or progress + * bar in transition. + * + * @see AccessibleRole#PROGRESS_BAR + * @see AccessibleRole#SCROLL_BAR + * @see AccessibleRole#SLIDER + */ + public static final AccessibleState BUSY + = new AccessibleState("busy"); + + /** + * Indicates an object is checked. + * + * @see AccessibleRole#TOGGLE_BUTTON + * @see AccessibleRole#RADIO_BUTTON + * @see AccessibleRole#CHECK_BOX + */ + public static final AccessibleState CHECKED + = new AccessibleState("checked"); + + /** + * Indicates the user can edit the component contents. This is usually for + * text, as other objects like scroll bars are automatically editable. + * + * @see #ENABLED + */ + public static final AccessibleState EDITABLE + = new AccessibleState("editable"); + + /** + * Indicates the object allows progressive disclosure of its children, + * usually in a collapsible tree or other hierachical object. + * + * @see #EXPANDED + * @see #COLLAPSED + * @see AccessibleRole#TREE + */ + public static final AccessibleState EXPANDABLE + = new AccessibleState("expandable"); + + /** + * Indicates that the object is collapsed, usually in a tree. + * + * @see #EXPANDABLE + * @see #EXPANDED + * @see AccessibleRole#TREE + */ + public static final AccessibleState COLLAPSED + = new AccessibleState("collapsed"); + + /** + * Indicates that the object is expanded, usually in a tree. + * + * @see #EXPANDABLE + * @see #COLLAPSED + * @see AccessibleRole#TREE + */ + public static final AccessibleState EXPANDED + = new AccessibleState("expanded"); + + /** + * Indicates that an object is enabled. In the absence of this state, + * graphics are often grayed out, and cannot be manipulated. + */ + public static final AccessibleState ENABLED + = new AccessibleState("enabled"); + + /** + * Indicates that an object can accept focus, which means it will process + * keyboard events when focused. + * + * @see #FOCUSED + */ + public static final AccessibleState FOCUSABLE + = new AccessibleState("focusable"); + + /** + * Indicates that an object has keyboard focus. + * + * @see #FOCUSABLE + */ + public static final AccessibleState FOCUSED + = new AccessibleState("focused"); + + /** + * Indicates that an object is minimized to an icon. + * + * @see AccessibleRole#FRAME + * @see AccessibleRole#INTERNAL_FRAME + */ + public static final AccessibleState ICONIFIED + = new AccessibleState("iconified"); + + /** + * Indicates that something must be done in the current object before + * interaction is allowed on other windows, usually for dialogs. + * + * @see AccessibleRole#DIALOG + */ + public static final AccessibleState MODAL + = new AccessibleState("modal"); + + /** + * Indicates that all pixels in the object are painted. If this state is not + * present, then the object has some degree of transparency, letting lower + * panes show through. + * + * @see Accessible#getAccessibleContext() + * @see AccessibleContext#getAccessibleComponent() + * @see AccessibleComponent#getBounds() + */ + public static final AccessibleState OPAQUE + = new AccessibleState("opaque"); + + /** + * Indicates the size of this object is not fixed. + * + * @see Accessible#getAccessibleContext() + * @see AccessibleContext#getAccessibleComponent() + * @see AccessibleComponent#getSize() + * @see AccessibleComponent#setSize(Dimension) + */ + public static final AccessibleState RESIZABLE + = new AccessibleState("resizable"); + + /** + * Indicates that multiple children can be selected at once. + * + * @see Accessible#getAccessibleContext() + * @see AccessibleContext#getAccessibleSelection() + * @see AccessibleSelection + */ + public static final AccessibleState MULTISELECTABLE + = new AccessibleState("multiselectable"); + + /** + * Indicates that this child is one which can be selected from its parent. + * + * @see #SELECTED + * @see Accessible#getAccessibleContext() + * @see AccessibleContext#getAccessibleSelection() + * @see AccessibleSelection + */ + public static final AccessibleState SELECTABLE + = new AccessibleState("selectable"); + + /** + * Indicates that this child has been selected from its parent. + * + * @see #SELECTABLE + * @see Accessible#getAccessibleContext() + * @see AccessibleContext#getAccessibleSelection() + * @see AccessibleSelection + */ + public static final AccessibleState SELECTED + = new AccessibleState("selected"); + + /** + * Indicates that this object and all its parents are visible, so that it + * is on the screen. However, something opaque may be on top of it. + * + * @see #VISIBLE + */ + public static final AccessibleState SHOWING + = new AccessibleState("showing"); + + /** + * Indicates that this object intends to be visible. However, if its + * parent is invisible, this object is as well. + * + * @see #SHOWING + */ + public static final AccessibleState VISIBLE + = new AccessibleState("visible"); + + /** + * Indicates that an object has vertical orientation. + * + * @see #HORIZONTAL + * @see AccessibleRole#SCROLL_BAR + * @see AccessibleRole#SLIDER + * @see AccessibleRole#PROGRESS_BAR + */ + public static final AccessibleState VERTICAL + = new AccessibleState("vertical"); + + /** + * Indicates that an object has horizontal orientation. + * + * @see #VERTICAL + * @see AccessibleRole#SCROLL_BAR + * @see AccessibleRole#SLIDER + * @see AccessibleRole#PROGRESS_BAR + */ + public static final AccessibleState HORIZONTAL + = new AccessibleState("horizontal"); + + /** + * Indicates that this text object can only hold a single line. + * + * @see #MULTI_LINE + */ + public static final AccessibleState SINGLE_LINE + = new AccessibleState("single line"); + + /** + * Indicates that this text object can hold multiple lines. + * + * @see #SINGLE_LINE + */ + public static final AccessibleState MULTI_LINE + = new AccessibleState("multiple line"); + + /** + * Indicates that this object is transient. This means the object is + * generated for method queries, but will never generate events, because + * its container (such as a tree, list, or table) does all the work. + */ + public static final AccessibleState TRANSIENT + = new AccessibleState("transient"); + + /** + * Create a new constant with a locale independent key. Follow the example, + * keep the constructor private and make public constants instead. + * + * @param key the name of the state + * @see #toDisplayString(String, Locale) + */ + protected AccessibleState(String key) + { + this.key = key; + } + } // class AccessibleState diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleStateSet.java gcc-3.3/libjava/javax/accessibility/AccessibleStateSet.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleStateSet.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleStateSet.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,172 ---- + /* AccessibleStateSet.java -- the combined state of an accessible object + Copyright (C) 2002 Free Software Foundation + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.accessibility; + + import java.util.Vector; + + /** + * Describes all elements of an accessible object's state. For example, an + * object may be enabled and have focus. + * + * @author Eric Blake + * @see AccessibleState + * @since 1.2 + * @status updated to 1.4 + */ + public class AccessibleStateSet + { + /** + * The list of states, should be instances of AccessibleState. Don't set + * this to null. + * + * @see #add(AccessibleState) + * @see #addAll(AccessibleState[]) + * @see #remove(AccessibleState) + * @see #contains(AccessibleState) + * @see #toArray() + * @see #clear() + */ + protected Vector states = new Vector(); + + /** + * Create an empty state set. + */ + public AccessibleStateSet() + { + } + + /** + * Create a state set initialized with the given states, duplicates are + * ignored. + * + * @param states the states to insert + * @throws NullPointerException if states is null + */ + public AccessibleStateSet(AccessibleState[] states) + { + addAll(states); + } + + /** + * Add a new state to the current set. Return true if the state was added, + * as duplicates are ignored. Entering a null state will cause problems + * later, so don't do it. + * + * @param state the state to add + * @return true if the state was added + */ + public boolean add(AccessibleState state) + { + return states.contains(state) ? false : states.add(state); + } + + /** + * Add all of the states to the current set. Duplicates are ignored. + * Entering a null state will cause problems later, so don't do it. + * + * @param array the array of states to add + * @throws NullPointerException if array is null + */ + public void addAll(AccessibleState[] array) + { + int i = array.length; + while (--i >= 0) + add(array[i]); + } + + /** + * Remove a state from the set. If a state was removed, return true. + * + * @param state the state to remove + * @return true if the set changed + */ + public boolean remove(AccessibleState state) + { + return states.remove(state); + } + + /** + * Clear all states in the set. + */ + public void clear() + { + states.clear(); + } + + /** + * Check if the current state is in the set. + * + * @param state the state to locate + * @return true if it is in the set + */ + public boolean contains(AccessibleState state) + { + return states.contains(state); + } + + /** + * Return the state set as an array. + * + * @return an array of the current states + */ + public AccessibleState[] toArray() + { + AccessibleState[] result = new AccessibleState[states.size()]; + states.toArray(result); + return result; + } + + /** + * Return a localized, comma-separated string representing all states + * in the set. This is in arbitrary order. + * + * @return the string representation + * @see AccessibleBundle#toDisplayString(String, Locale) + */ + public String toString() + { + int i = states.size(); + if (i == 0) + return ""; + // Pre-allocate an average of 10 chars per state. + StringBuffer b = new StringBuffer(i * 10); + while (--i >= 0) + b.append(states.get(i)).append(','); + return b.substring(0, b.length() - 1); + } + } // class AccessibleStateSet diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleTable.java gcc-3.3/libjava/javax/accessibility/AccessibleTable.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleTable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleTable.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,236 ---- + /* AccessibleTable.java -- aids in accessibly manipulating tables + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * Objects which present information in a 2-dimensional table should implement + * this interface. Accessibility software can use the implementations of + * this interface to navigate and change the attributes of the table. + * + *

          The AccessibleContext.getAccessibleTable() method + * should return null if an object does not implement this + * interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleTable() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleTable + { + /** + * Return the caption for the table, or null if unknown. + * + * @return the table caption + */ + Accessible getAccessibleCaption(); + + /** + * Set the table caption. + * + * @param caption the new caption + */ + void setAccessibleCaption(Accessible caption); + + /** + * Return the summary description of the table, or null if unknown. + * + * @return the summary description + */ + Accessible getAccessibleSummary(); + + /** + * Set the table summary description. + * + * @param summary the new summary + */ + void setAccessibleSummary(Accessible summary); + + /** + * Return the number of rows in the table. + * + * @return the row count + */ + int getAccessibleRowCount(); + + /** + * Return the number of columns in the table. + * + * @return the column count + */ + int getAccessibleColumnCount(); + + /** + * Return the cell at the specified row and column, or null if out of bounds. + * + * @param r the 0-based row index + * @param c the 0-based column index + * @return the cell at (r,c) + */ + Accessible getAccessibleAt(int r, int c); + + /** + * Returns the number of merged rows occupied at the specified row and + * column, or 0 if out of bounds. + * + * @param r the 0-based row index + * @param c the 0-based column index + * @return the row extent at (r,c) + */ + int getAccessibleRowExtentAt(int r, int c); + + /** + * Returns the number of merged columns occupied at the specified row and + * column, or 0 if out of bounds. + * + * @param r the 0-based row index + * @param c the 0-based column index + * @return the column extent at (r,c) + */ + int getAccessibleColumnExtentAt(int r, int c); + + /** + * Return the row headers as a table. + * + * @return the row headers, or null if there are none + */ + AccessibleTable getAccessibleRowHeader(); + + /** + * Set the row headers. + * + * @param header the new row header + */ + // XXX What happens if header is incompatible size? + void setAccessibleRowHeader(AccessibleTable header); + + /** + * Return the column headers as a table. + * + * @return the column headers, or null if there are none + */ + AccessibleTable getAccessibleColumnHeader(); + + /** + * Set the column headers. + * + * @param header the new column header + */ + // XXX What happens if header is incompatible size? + void setAccessibleColumnHeader(AccessibleTable header); + + /** + * Return the description of a row, or null if there is none or the index + * is out of bounds. + * + * @param r the 0-based row index + * @return the description + */ + Accessible getAccessibleRowDescription(int r); + + /** + * Set the description of a row. Does nothing if the index is invalid. + * + * @param r the 0-based row index + * @param description the new description + */ + void setAccessibleRowDescription(int r, Accessible description); + + /** + * Return the description of a column, or null if there is none or the index + * is out of bounds. + * + * @param c the 0-based column index + * @return the description + */ + Accessible getAccessibleColumnDescription(int c); + + /** + * Set the description of a column. Does nothing if the index is invalid. + * + * @param c the 0-based column index + * @param description the new description + */ + void setAccessibleColumnDescription(int c, Accessible description); + + /** + * Return whether the cell at the specified location is selected. Returns + * false if the index is out of bounds. + * + * @param r the 0-based row index + * @param c the 0-based column index + * @return true if that cell is selected + */ + boolean isAccessibleSelected(int r, int c); + + /** + * Return whether the specified row is selected. Returns false if the + * index is out of bounds. + * + * @param r the 0-based row index + * @return true if that row is selected + */ + boolean isAccessibleRowSelected(int r); + + /** + * Return whether the specified column is selected. Returns false if the + * index is out of bounds. + * + * @param c the 0-based column index + * @return true if that column is selected + */ + boolean isAccessibleColumnSelected(int c); + + /** + * Return the selected rows. May be null or empty if there is no selection. + * + * @return the indices of selected rows + */ + int[] getSelectedAccessibleRows(); + + /** + * Return the selected columns. May be null or empty if there is no + * selection. + * + * @return the indices of selected columns + */ + int[] getSelectedAccessibleColumns(); + } // interface AccessibleTable diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleTableModelChange.java gcc-3.3/libjava/javax/accessibility/AccessibleTableModelChange.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleTableModelChange.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleTableModelChange.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,102 ---- + /* AccessibleTableModelChange.java -- describes change to an accessible table + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * Describes a change to an accessible table. Accessibility software can use + * the implementations of this interface to update their state after a + * change to a table. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleTable() + * @see AccessibleTable + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleTableModelChange + { + /** Identifies insertion of rows or columns. */ + int INSERT = 1; + + /** Identifies change to existing data. */ + int UPDATE = 0; + + /** Identifies deletion of rows or columns. */ + int DELETE = -1; + + /** + * Returns the change type. + * + * @return the type + * @see #INSERT + * @see #UPDATE + * @see #DELETE + */ + int getType(); + + /** + * Returns the first row that changed. + * + * @return the 0-based index of the first row to change + */ + int getFirstRow(); + + /** + * Returns the last row that changed. + * + * @return the 0-based index of the last row to change + */ + int getLastRow(); + + /** + * Returns the first column that changed. + * + * @return the 0-based index of the first column to change + */ + int getFirstColumn(); + + /** + * Returns the last column that changed. + * + * @return the 0-based index of the last column to change + */ + int getLastColumn(); + } // interface AccessibleTableModelChange diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleText.java gcc-3.3/libjava/javax/accessibility/AccessibleText.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleText.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleText.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,184 ---- + /* AccessibleText.java -- aids in accessibly manipulating text + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + import java.awt.Rectangle; + import java.awt.Point; + import javax.swing.text.AttributeSet; + + /** + * Objects which present textual information on the display should implement + * this interface. Accessibility software can use the implementations of + * this interface to change the attributes and spacial location of the text. + * + *

          The AccessibleContext.getAccessibleText() method + * should return null if an object does not implement this + * interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleText() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleText + { + /** + * Constant designating that the next selection should be a character. + * + * @see #getAtIndex(int, int) + * @see #getAfterIndex(int, int) + * @see #getBeforeIndex(int, int) + */ + int CHARACTER = 1; + + /** + * Constant designating that the next selection should be a word. + * + * @see #getAtIndex(int, int) + * @see #getAfterIndex(int, int) + * @see #getBeforeIndex(int, int) + */ + int WORD = 2; + + /** + * Constant designating that the next selection should be a sentence. + * + * @see #getAtIndex(int, int) + * @see #getAfterIndex(int, int) + * @see #getBeforeIndex(int, int) + */ + int SENTENCE = 3; + + /** + * Given a point in the coordinate system of this object, return the + * 0-based index of the character at that point, or -1 if there is none. + * + * @param p the point to look at + * @return the character index, or -1 + */ + int getIndexAtPoint(Point point); + + /** + * Determines the bounding box of the indexed character. Returns an empty + * rectangle if the index is out of bounds. + * + * @param index the 0-based character index + * @return the bounding box, may be empty + */ + Rectangle getCharacterBounds(int index); + + /** + * Return the number of characters. + * + * @return the character count + */ + int getCharCount(); + + /** + * Return the offset of the character. The offset matches the index of the + * character to the right, since the carat lies between characters. + * + * @return the 0-based caret position + */ + int getCaretPosition(); + + /** + * Returns the section of text at the index, or null if the index or part + * is invalid. + * + * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE} + * @param index the 0-based character index + * @return the selection of text at that index, or null + */ + String getAtIndex(int part, int index); + + /** + * Returns the section of text after the index, or null if the index or part + * is invalid. + * + * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE} + * @param index the 0-based character index + * @return the selection of text after that index, or null + */ + String getAfterIndex(int part, int index); + + /** + * Returns the section of text before the index, or null if the index or part + * is invalid. + * + * @param part {@link CHARACTER}, {@link WORD}, or {@link SENTENCE} + * @param index the 0-based character index + * @return the selection of text before that index, or null + */ + String getBeforeIndex(int part, int index); + + /** + * Returns the attributes of a character at an index, or null if the index + * is out of bounds. + * + * @param index the 0-based character index + * @return the character's attributes + */ + AttributeSet getCharacterAttribute(int index); + + /** + * Returns the start index of the selection. If there is no selection, this + * is the same as the caret location. + * + * @return the 0-based character index of the selection start + */ + int getSelectionStart(); + + /** + * Returns the end index of the selection. If there is no selection, this + * is the same as the caret location. + * + * @return the 0-based character index of the selection end + */ + int getSelectionEnd(); + + /** + * Returns the selected text. This may be null or "" if no text is selected. + * + * @return the selected text + */ + String getSelectedText(); + } // interface AccessibleText diff -Nrc3pad gcc-3.2.3/libjava/javax/accessibility/AccessibleValue.java gcc-3.3/libjava/javax/accessibility/AccessibleValue.java *** gcc-3.2.3/libjava/javax/accessibility/AccessibleValue.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/accessibility/AccessibleValue.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,94 ---- + /* AccessibleValue.java -- aids in accessibly controlling values + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.accessibility; + + /** + * If an object implements this interface then it must be able to control + * a numerical value. For example, a scroll bar has a position represented + * by a number. Accessibility software can use the implementations of this + * interface to change the associated value. + * + *

          The AccessibleContext.getAccessibleValue() method should + * return null if an object does not implement this interface. + * + * @author Eric Blake + * @see Accessible + * @see AccessibleContext + * @see AccessibleContext#getAccessibleValue() + * @since 1.2 + * @status updated to 1.4 + */ + public interface AccessibleValue + { + /** + * Gets the current value of this object, or null if it has not been set. + * + * @return the current value, or null + * @see #setCurrentAccessibleValue(Number) + */ + Number getCurrentAccessibleValue(); + + /** + * Sets the current value of this object. Returns true if the number + * successfully changed. + * + * @param number the new value + * @return true on success + */ + // XXX What happens if number is null? + boolean setCurrentAccessibleValue(Number number); + + /** + * Gets the minimum value in the range of this object, or null if there is + * no minimum. + * + * @return the minimum + * @see #getMaximumAccessibleValue() + */ + Number getMinimumAccessibleValue(); + + /** + * Gets the maximum value in the range of this object, or null if there is + * no maximum. + * + * @return the maximum + * @see #getMinimumAccessibleValue() + */ + Number getMaximumAccessibleValue(); + } // interface AccessibleValue diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/AuthenticationException.java gcc-3.3/libjava/javax/naming/AuthenticationException.java *** gcc-3.2.3/libjava/javax/naming/AuthenticationException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/AuthenticationException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* AuthenticationException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/AuthenticationNotSupportedException.java gcc-3.3/libjava/javax/naming/AuthenticationNotSupportedException.java *** gcc-3.2.3/libjava/javax/naming/AuthenticationNotSupportedException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/AuthenticationNotSupportedException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* AuthenticationNotSupportedException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/BinaryRefAddr.java gcc-3.3/libjava/javax/naming/BinaryRefAddr.java *** gcc-3.2.3/libjava/javax/naming/BinaryRefAddr.java 2002-01-22 22:40:42.000000000 +0000 --- gcc-3.3/libjava/javax/naming/BinaryRefAddr.java 2002-11-10 22:06:49.000000000 +0000 *************** import java.util.Arrays; *** 50,56 **** */ public class BinaryRefAddr extends RefAddr { ! /** * The possibly null content of this RefAddr. * Set by the constructor and returned by getContent. --- 50,57 ---- */ public class BinaryRefAddr extends RefAddr { ! static final long serialVersionUID = -3415254970957330361L; ! /** * The possibly null content of this RefAddr. * Set by the constructor and returned by getContent. *************** public class BinaryRefAddr extends RefAd *** 97,113 **** * the addrType is the same as this addrType and the bytes of the * content are the same. */ ! public boolean equals (Object o) { if (o instanceof BinaryRefAddr) { BinaryRefAddr refAddr = (BinaryRefAddr) o; if (this.getType().equals(refAddr.getType())) ! { ! byte[] c1 = (byte[]) this.getContent(); ! byte[] c2 = (byte[]) refAddr.getContent(); ! return Arrays.equals(c1, c2); ! } } return false; } --- 98,114 ---- * the addrType is the same as this addrType and the bytes of the * content are the same. */ ! public boolean equals(Object o) { if (o instanceof BinaryRefAddr) { BinaryRefAddr refAddr = (BinaryRefAddr) o; if (this.getType().equals(refAddr.getType())) ! { ! byte[] c1 = (byte[]) this.getContent(); ! byte[] c2 = (byte[]) refAddr.getContent(); ! return Arrays.equals(c1, c2); ! } } return false; } diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/Binding.java gcc-3.3/libjava/javax/naming/Binding.java *** gcc-3.2.3/libjava/javax/naming/Binding.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/Binding.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* Binding.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/CannotProceedException.java gcc-3.3/libjava/javax/naming/CannotProceedException.java *** gcc-3.2.3/libjava/javax/naming/CannotProceedException.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/CannotProceedException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* CannotProceedException.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/CommunicationException.java gcc-3.3/libjava/javax/naming/CommunicationException.java *** gcc-3.2.3/libjava/javax/naming/CommunicationException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/CommunicationException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* CommunicationException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/CompositeName.java gcc-3.3/libjava/javax/naming/CompositeName.java *** gcc-3.2.3/libjava/javax/naming/CompositeName.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/CompositeName.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* CompositeName.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/CompoundName.java gcc-3.3/libjava/javax/naming/CompoundName.java *** gcc-3.2.3/libjava/javax/naming/CompoundName.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/CompoundName.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* CompoundName.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ConfigurationException.java gcc-3.3/libjava/javax/naming/ConfigurationException.java *** gcc-3.2.3/libjava/javax/naming/ConfigurationException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ConfigurationException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* ConfigurationException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/Context.java gcc-3.3/libjava/javax/naming/Context.java *** gcc-3.2.3/libjava/javax/naming/Context.java 2001-03-28 00:32:02.000000000 +0000 --- gcc-3.3/libjava/javax/naming/Context.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* Context.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ContextNotEmptyException.java gcc-3.3/libjava/javax/naming/ContextNotEmptyException.java *** gcc-3.2.3/libjava/javax/naming/ContextNotEmptyException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ContextNotEmptyException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* ContextNotEmptyException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/AttributeInUseException.java gcc-3.3/libjava/javax/naming/directory/AttributeInUseException.java *** gcc-3.2.3/libjava/javax/naming/directory/AttributeInUseException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/AttributeInUseException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming.directory; --- 1,40 ---- ! /* AttributeInUseException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/Attribute.java gcc-3.3/libjava/javax/naming/directory/Attribute.java *** gcc-3.2.3/libjava/javax/naming/directory/Attribute.java 2001-10-24 21:39:16.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/Attribute.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.*; --- 1,41 ---- ! /* Attribute.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/AttributeModificationException.java gcc-3.3/libjava/javax/naming/directory/AttributeModificationException.java *** gcc-3.2.3/libjava/javax/naming/directory/AttributeModificationException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/AttributeModificationException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* AttributeModificationException.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/Attributes.java gcc-3.3/libjava/javax/naming/directory/Attributes.java *** gcc-3.2.3/libjava/javax/naming/directory/Attributes.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/Attributes.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.*; --- 1,41 ---- ! /* Attributes.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/BasicAttribute.java gcc-3.3/libjava/javax/naming/directory/BasicAttribute.java *** gcc-3.2.3/libjava/javax/naming/directory/BasicAttribute.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/BasicAttribute.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming.directory; --- 1,40 ---- ! /* BasicAttribute.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/BasicAttributes.java gcc-3.3/libjava/javax/naming/directory/BasicAttributes.java *** gcc-3.2.3/libjava/javax/naming/directory/BasicAttributes.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/BasicAttributes.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming.directory; --- 1,40 ---- ! /* BasicAttributes.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/DirContext.java gcc-3.3/libjava/javax/naming/directory/DirContext.java *** gcc-3.2.3/libjava/javax/naming/directory/DirContext.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/DirContext.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.*; --- 1,41 ---- ! /* DirContext.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/InitialDirContext.java gcc-3.3/libjava/javax/naming/directory/InitialDirContext.java *** gcc-3.2.3/libjava/javax/naming/directory/InitialDirContext.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/InitialDirContext.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming.directory; --- 1,40 ---- ! /* InitialDirContext.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/InvalidAttributeIdentifierException.java gcc-3.3/libjava/javax/naming/directory/InvalidAttributeIdentifierException.java *** gcc-3.2.3/libjava/javax/naming/directory/InvalidAttributeIdentifierException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/InvalidAttributeIdentifierException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* InvalidAttributeIdentifierException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/InvalidAttributesException.java gcc-3.3/libjava/javax/naming/directory/InvalidAttributesException.java *** gcc-3.2.3/libjava/javax/naming/directory/InvalidAttributesException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/InvalidAttributesException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* InvalidAttributesException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/InvalidAttributeValueException.java gcc-3.3/libjava/javax/naming/directory/InvalidAttributeValueException.java *** gcc-3.2.3/libjava/javax/naming/directory/InvalidAttributeValueException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/InvalidAttributeValueException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* InvalidAttributeValueException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/InvalidSearchControlsException.java gcc-3.3/libjava/javax/naming/directory/InvalidSearchControlsException.java *** gcc-3.2.3/libjava/javax/naming/directory/InvalidSearchControlsException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/InvalidSearchControlsException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* InvalidSearchControlsException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/InvalidSearchFilterException.java gcc-3.3/libjava/javax/naming/directory/InvalidSearchFilterException.java *** gcc-3.2.3/libjava/javax/naming/directory/InvalidSearchFilterException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/InvalidSearchFilterException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* InvalidSearchFilterException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/ModificationItem.java gcc-3.3/libjava/javax/naming/directory/ModificationItem.java *** gcc-3.2.3/libjava/javax/naming/directory/ModificationItem.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/ModificationItem.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import java.io.Serializable; --- 1,41 ---- ! /* ModificationItem.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import java.io.Serializable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/NoSuchAttributeException.java gcc-3.3/libjava/javax/naming/directory/NoSuchAttributeException.java *** gcc-3.2.3/libjava/javax/naming/directory/NoSuchAttributeException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/NoSuchAttributeException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* NoSuchAttributeException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/SchemaViolationException.java gcc-3.3/libjava/javax/naming/directory/SchemaViolationException.java *** gcc-3.2.3/libjava/javax/naming/directory/SchemaViolationException.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/SchemaViolationException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.NamingException; --- 1,41 ---- ! /* SchemaViolationException.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.NamingException; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/SearchControls.java gcc-3.3/libjava/javax/naming/directory/SearchControls.java *** gcc-3.2.3/libjava/javax/naming/directory/SearchControls.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/SearchControls.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import java.io.Serializable; --- 1,41 ---- ! /* SearchControls.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import java.io.Serializable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/directory/SearchResult.java gcc-3.3/libjava/javax/naming/directory/SearchResult.java *** gcc-3.2.3/libjava/javax/naming/directory/SearchResult.java 2001-10-24 21:39:17.000000000 +0000 --- gcc-3.3/libjava/javax/naming/directory/SearchResult.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.directory; import javax.naming.*; import java.io.Serializable; --- 1,41 ---- ! /* SearchResult.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.directory; import javax.naming.*; import java.io.Serializable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/event/EventContext.java gcc-3.3/libjava/javax/naming/event/EventContext.java *** gcc-3.2.3/libjava/javax/naming/event/EventContext.java 2001-10-24 21:39:18.000000000 +0000 --- gcc-3.3/libjava/javax/naming/event/EventContext.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.event; import javax.naming.*; --- 1,41 ---- ! /* EventContext.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.event; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/event/EventDirContext.java gcc-3.3/libjava/javax/naming/event/EventDirContext.java *** gcc-3.2.3/libjava/javax/naming/event/EventDirContext.java 2001-10-24 21:39:18.000000000 +0000 --- gcc-3.3/libjava/javax/naming/event/EventDirContext.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.event; import javax.naming.*; import javax.naming.directory.*; --- 1,41 ---- ! /* EventDirContext.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.event; import javax.naming.*; import javax.naming.directory.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/event/NamespaceChangeListener.java gcc-3.3/libjava/javax/naming/event/NamespaceChangeListener.java *** gcc-3.2.3/libjava/javax/naming/event/NamespaceChangeListener.java 2001-10-24 21:39:18.000000000 +0000 --- gcc-3.3/libjava/javax/naming/event/NamespaceChangeListener.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.event; /** --- 1,41 ---- ! /* NamespaceChangeListener.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.event; /** diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/event/NamingEvent.java gcc-3.3/libjava/javax/naming/event/NamingEvent.java *** gcc-3.2.3/libjava/javax/naming/event/NamingEvent.java 2001-10-24 21:39:18.000000000 +0000 --- gcc-3.3/libjava/javax/naming/event/NamingEvent.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.event; import javax.naming.*; import java.util.EventObject; --- 1,41 ---- ! /* NamingEvent.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.event; import javax.naming.*; import java.util.EventObject; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/event/NamingExceptionEvent.java gcc-3.3/libjava/javax/naming/event/NamingExceptionEvent.java *** gcc-3.2.3/libjava/javax/naming/event/NamingExceptionEvent.java 2001-10-24 21:39:18.000000000 +0000 --- gcc-3.3/libjava/javax/naming/event/NamingExceptionEvent.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.event; import javax.naming.*; import java.util.EventObject; --- 1,41 ---- ! /* NamingExceptionEvent.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.event; import javax.naming.*; import java.util.EventObject; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/event/NamingListener.java gcc-3.3/libjava/javax/naming/event/NamingListener.java *** gcc-3.2.3/libjava/javax/naming/event/NamingListener.java 2001-10-24 21:39:18.000000000 +0000 --- gcc-3.3/libjava/javax/naming/event/NamingListener.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.event; import java.util.EventListener; --- 1,41 ---- ! /* NamingListener.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.event; import java.util.EventListener; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/event/ObjectChangeListener.java gcc-3.3/libjava/javax/naming/event/ObjectChangeListener.java *** gcc-3.2.3/libjava/javax/naming/event/ObjectChangeListener.java 2001-10-24 21:39:18.000000000 +0000 --- gcc-3.3/libjava/javax/naming/event/ObjectChangeListener.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.event; /** --- 1,41 ---- ! /* ObjectChangeListener.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.event; /** diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/InitialContext.java gcc-3.3/libjava/javax/naming/InitialContext.java *** gcc-3.2.3/libjava/javax/naming/InitialContext.java 2001-10-19 20:36:07.000000000 +0000 --- gcc-3.3/libjava/javax/naming/InitialContext.java 2002-12-31 22:49:37.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! ! This file is part of libgcj. ! ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.naming; --- 1,40 ---- ! /* InitialContext.java -- ! Copyright (C) 2000, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ ! package javax.naming; *************** public class InitialContext implements C *** 96,113 **** } catch (IOException e) {} ! String home = System.getProperty("java.home"); if (home != null) { ! String fileName = home + File.separator ! + "lib" + File.separator + "jndi.properties"; Properties p = new Properties (); ! try { ! InputStream is = new FileInputStream (fileName); ! p.load (is); ! is.close (); ! } catch (IOException e) {} merge (myProps, p); } --- 126,147 ---- } catch (IOException e) {} ! String home = System.getProperty("gnu.classpath.home.url"); if (home != null) { ! String url = home + "/jndi.properties"; Properties p = new Properties (); ! try ! { ! InputStream is = new URL(url).openStream(); ! p.load (is); ! is.close (); ! } ! catch (IOException e) ! { ! // Ignore. ! } merge (myProps, p); } diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/InsufficientResourcesException.java gcc-3.3/libjava/javax/naming/InsufficientResourcesException.java *** gcc-3.2.3/libjava/javax/naming/InsufficientResourcesException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/InsufficientResourcesException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* InsufficientResourcesException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/InterruptedNamingException.java gcc-3.3/libjava/javax/naming/InterruptedNamingException.java *** gcc-3.2.3/libjava/javax/naming/InterruptedNamingException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/InterruptedNamingException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* InterruptedNamingException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/ControlFactory.java gcc-3.3/libjava/javax/naming/ldap/ControlFactory.java *** gcc-3.2.3/libjava/javax/naming/ldap/ControlFactory.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/ControlFactory.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import javax.naming.*; --- 1,41 ---- ! /* ControlFactory.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/Control.java gcc-3.3/libjava/javax/naming/ldap/Control.java *** gcc-3.2.3/libjava/javax/naming/ldap/Control.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/Control.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import java.io.Serializable; --- 1,41 ---- ! /* Control.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import java.io.Serializable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/ExtendedRequest.java gcc-3.3/libjava/javax/naming/ldap/ExtendedRequest.java *** gcc-3.2.3/libjava/javax/naming/ldap/ExtendedRequest.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/ExtendedRequest.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import java.io.Serializable; import javax.naming.*; --- 1,41 ---- ! /* ExtendedRequest.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import java.io.Serializable; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/ExtendedResponse.java gcc-3.3/libjava/javax/naming/ldap/ExtendedResponse.java *** gcc-3.2.3/libjava/javax/naming/ldap/ExtendedResponse.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/ExtendedResponse.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import java.io.Serializable; --- 1,41 ---- ! /* ExtendedResponse.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import java.io.Serializable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/HasControls.java gcc-3.3/libjava/javax/naming/ldap/HasControls.java *** gcc-3.2.3/libjava/javax/naming/ldap/HasControls.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/HasControls.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import javax.naming.*; --- 1,41 ---- ! /* HasControls.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/InitialLdapContext.java gcc-3.3/libjava/javax/naming/ldap/InitialLdapContext.java *** gcc-3.2.3/libjava/javax/naming/ldap/InitialLdapContext.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/InitialLdapContext.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import javax.naming.*; --- 1,41 ---- ! /* InitialLdapContext.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/LdapContext.java gcc-3.3/libjava/javax/naming/ldap/LdapContext.java *** gcc-3.2.3/libjava/javax/naming/ldap/LdapContext.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/LdapContext.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import javax.naming.*; import javax.naming.directory.*; --- 1,41 ---- ! /* LdapContext.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import javax.naming.*; import javax.naming.directory.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/LdapReferralException.java gcc-3.3/libjava/javax/naming/ldap/LdapReferralException.java *** gcc-3.2.3/libjava/javax/naming/ldap/LdapReferralException.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/LdapReferralException.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import javax.naming.*; import java.util.Hashtable; --- 1,41 ---- ! /* LdapReferralException.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import javax.naming.*; import java.util.Hashtable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java gcc-3.3/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java *** gcc-3.2.3/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import java.util.EventObject; --- 1,41 ---- ! /* UnsolicitedNotificationEvent.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import java.util.EventObject; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/UnsolicitedNotification.java gcc-3.3/libjava/javax/naming/ldap/UnsolicitedNotification.java *** gcc-3.2.3/libjava/javax/naming/ldap/UnsolicitedNotification.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/UnsolicitedNotification.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import javax.naming.*; --- 1,41 ---- ! /* UnsolicitedNotification.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java gcc-3.3/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java *** gcc-3.2.3/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java 2001-10-24 21:39:20.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.ldap; import javax.naming.event.*; --- 1,41 ---- ! /* UnsolicitedNotificationListener.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.ldap; import javax.naming.event.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/LimitExceededException.java gcc-3.3/libjava/javax/naming/LimitExceededException.java *** gcc-3.2.3/libjava/javax/naming/LimitExceededException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/LimitExceededException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* LimitExceededException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/LinkException.java gcc-3.3/libjava/javax/naming/LinkException.java *** gcc-3.2.3/libjava/javax/naming/LinkException.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/LinkException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* LinkException.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/LinkLoopException.java gcc-3.3/libjava/javax/naming/LinkLoopException.java *** gcc-3.2.3/libjava/javax/naming/LinkLoopException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/LinkLoopException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* LinkLoopException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/LinkRef.java gcc-3.3/libjava/javax/naming/LinkRef.java *** gcc-3.2.3/libjava/javax/naming/LinkRef.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/LinkRef.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* LinkRef.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/MalformedLinkException.java gcc-3.3/libjava/javax/naming/MalformedLinkException.java *** gcc-3.2.3/libjava/javax/naming/MalformedLinkException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/MalformedLinkException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* MalformedLinkException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NameAlreadyBoundException.java gcc-3.3/libjava/javax/naming/NameAlreadyBoundException.java *** gcc-3.2.3/libjava/javax/naming/NameAlreadyBoundException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NameAlreadyBoundException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* NameAlreadyBoundException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NameClassPair.java gcc-3.3/libjava/javax/naming/NameClassPair.java *** gcc-3.2.3/libjava/javax/naming/NameClassPair.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NameClassPair.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* NameClassPair.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/Name.java gcc-3.3/libjava/javax/naming/Name.java *** gcc-3.2.3/libjava/javax/naming/Name.java 2002-01-22 22:40:42.000000000 +0000 --- gcc-3.3/libjava/javax/naming/Name.java 2002-10-04 08:48:03.000000000 +0000 *************** import java.io.Serializable; *** 62,67 **** --- 62,69 ---- */ public interface Name extends Cloneable, Serializable { + static final long serialVersionUID = -3617482732056931635L; + /** * Returns the number of components of this Name. * The returned number can be zero. diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NameNotFoundException.java gcc-3.3/libjava/javax/naming/NameNotFoundException.java *** gcc-3.2.3/libjava/javax/naming/NameNotFoundException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NameNotFoundException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* NameNotFoundException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NameParser.java gcc-3.3/libjava/javax/naming/NameParser.java *** gcc-3.2.3/libjava/javax/naming/NameParser.java 2000-11-27 08:44:59.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NameParser.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* NameParser.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NamingEnumeration.java gcc-3.3/libjava/javax/naming/NamingEnumeration.java *** gcc-3.2.3/libjava/javax/naming/NamingEnumeration.java 2000-11-27 03:16:13.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NamingEnumeration.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* NamingEnumeration.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NamingException.java gcc-3.3/libjava/javax/naming/NamingException.java *** gcc-3.2.3/libjava/javax/naming/NamingException.java 2002-01-22 22:40:42.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NamingException.java 2002-09-16 09:46:37.000000000 +0000 *************** import java.io.PrintWriter; *** 47,53 **** * NamingException), the part of the Name that * could be resolved (including the Object it resolved to) * and the part of the Name that could not be resolved when ! * the exception occurred. * * @since 1.3 * @author Anthony Green (green@redhat.com) --- 47,53 ---- * NamingException), the part of the Name that * could be resolved (including the Object it resolved to) * and the part of the Name that could not be resolved when ! * the exception occured. * * @since 1.3 * @author Anthony Green (green@redhat.com) diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NamingSecurityException.java gcc-3.3/libjava/javax/naming/NamingSecurityException.java *** gcc-3.2.3/libjava/javax/naming/NamingSecurityException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NamingSecurityException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* NamingSecurityException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NoInitialContextException.java gcc-3.3/libjava/javax/naming/NoInitialContextException.java *** gcc-3.2.3/libjava/javax/naming/NoInitialContextException.java 2000-11-27 03:16:13.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NoInitialContextException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* NoInitialContextException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NoPermissionException.java gcc-3.3/libjava/javax/naming/NoPermissionException.java *** gcc-3.2.3/libjava/javax/naming/NoPermissionException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NoPermissionException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* NoPermissionException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/NotContextException.java gcc-3.3/libjava/javax/naming/NotContextException.java *** gcc-3.2.3/libjava/javax/naming/NotContextException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/NotContextException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* NotContextException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/OperationNotSupportedException.java gcc-3.3/libjava/javax/naming/OperationNotSupportedException.java *** gcc-3.2.3/libjava/javax/naming/OperationNotSupportedException.java 2001-10-19 20:36:07.000000000 +0000 --- gcc-3.3/libjava/javax/naming/OperationNotSupportedException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; public class OperationNotSupportedException extends NamingException --- 1,41 ---- ! /* OperationNotSupportedException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; public class OperationNotSupportedException extends NamingException diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/PartialResultException.java gcc-3.3/libjava/javax/naming/PartialResultException.java *** gcc-3.2.3/libjava/javax/naming/PartialResultException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/PartialResultException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* PartialResultException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/RefAddr.java gcc-3.3/libjava/javax/naming/RefAddr.java *** gcc-3.2.3/libjava/javax/naming/RefAddr.java 2002-01-22 22:40:42.000000000 +0000 --- gcc-3.3/libjava/javax/naming/RefAddr.java 2002-09-25 05:05:07.000000000 +0000 *************** public abstract class RefAddr implements *** 61,67 **** * The string resprenstation of the type of address. * Set by the constructor and returned by the getType() method. */ ! protected final String addrType; /** * Protected constructor for use by subclasses. --- 61,67 ---- * The string resprenstation of the type of address. * Set by the constructor and returned by the getType() method. */ ! protected String addrType; /** * Protected constructor for use by subclasses. *************** public abstract class RefAddr implements *** 71,79 **** */ protected RefAddr(String addrType) { ! if (addrType == null) ! throw new NullPointerException("addrType cannot be null"); ! this.addrType = addrType; } --- 71,79 ---- */ protected RefAddr(String addrType) { ! if (addrType == null) ! throw new NullPointerException("addrType cannot be null"); ! this.addrType = addrType; } *************** public abstract class RefAddr implements *** 98,117 **** * is the same as this addrType and the content is equals to the * content of this object. */ ! public boolean equals (Object o) { if (o instanceof RefAddr) { RefAddr refAddr = (RefAddr) o; if (this.getType().equals(refAddr.getType())) ! { ! Object c1 = this.getContent(); ! Object c2 = refAddr.getContent(); ! if (c1 == null) ! return c2 == null; ! else ! return c1.equals(c2); ! } } return false; } --- 98,117 ---- * is the same as this addrType and the content is equals to the * content of this object. */ ! public boolean equals(Object o) { if (o instanceof RefAddr) { RefAddr refAddr = (RefAddr) o; if (this.getType().equals(refAddr.getType())) ! { ! Object c1 = this.getContent(); ! Object c2 = refAddr.getContent(); ! if (c1 == null) ! return c2 == null; ! else ! return c1.equals(c2); ! } } return false; } diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/Referenceable.java gcc-3.3/libjava/javax/naming/Referenceable.java *** gcc-3.2.3/libjava/javax/naming/Referenceable.java 2000-11-27 03:16:13.000000000 +0000 --- gcc-3.3/libjava/javax/naming/Referenceable.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* Referenceable.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/Reference.java gcc-3.3/libjava/javax/naming/Reference.java *** gcc-3.2.3/libjava/javax/naming/Reference.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/Reference.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming; --- 1,40 ---- ! /* Reference.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ReferralException.java gcc-3.3/libjava/javax/naming/ReferralException.java *** gcc-3.2.3/libjava/javax/naming/ReferralException.java 2001-10-24 21:39:15.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ReferralException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* ReferralException.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/ServiceUnavailableException.java gcc-3.3/libjava/javax/naming/ServiceUnavailableException.java *** gcc-3.2.3/libjava/javax/naming/ServiceUnavailableException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/ServiceUnavailableException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* ServiceUnavailableException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/SizeLimitExceededException.java gcc-3.3/libjava/javax/naming/SizeLimitExceededException.java *** gcc-3.2.3/libjava/javax/naming/SizeLimitExceededException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/SizeLimitExceededException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* SizeLimitExceededException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/DirectoryManager.java gcc-3.3/libjava/javax/naming/spi/DirectoryManager.java *** gcc-3.2.3/libjava/javax/naming/spi/DirectoryManager.java 2001-10-24 21:39:21.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/DirectoryManager.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! ! This file is part of libgcj. ! ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.naming.spi; --- 1,40 ---- ! /* DirectoryManager.java -- ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ ! package javax.naming.spi; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/DirObjectFactory.java gcc-3.3/libjava/javax/naming/spi/DirObjectFactory.java *** gcc-3.2.3/libjava/javax/naming/spi/DirObjectFactory.java 2001-10-24 21:39:21.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/DirObjectFactory.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.spi; import javax.naming.*; import javax.naming.directory.*; --- 1,41 ---- ! /* DirObjectFactory.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.spi; import javax.naming.*; import javax.naming.directory.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/DirStateFactory.java gcc-3.3/libjava/javax/naming/spi/DirStateFactory.java *** gcc-3.2.3/libjava/javax/naming/spi/DirStateFactory.java 2001-10-24 21:39:21.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/DirStateFactory.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.spi; import javax.naming.*; import javax.naming.directory.*; --- 1,41 ---- ! /* DirStateFactory.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.spi; import javax.naming.*; import javax.naming.directory.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/InitialContextFactoryBuilder.java gcc-3.3/libjava/javax/naming/spi/InitialContextFactoryBuilder.java *** gcc-3.2.3/libjava/javax/naming/spi/InitialContextFactoryBuilder.java 2000-11-27 03:16:14.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/InitialContextFactoryBuilder.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! ! This file is part of libgcj. ! ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.naming.spi; --- 1,40 ---- ! /* InitialContextFactoryBuilder.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ ! package javax.naming.spi; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/InitialContextFactory.java gcc-3.3/libjava/javax/naming/spi/InitialContextFactory.java *** gcc-3.2.3/libjava/javax/naming/spi/InitialContextFactory.java 2000-11-27 03:16:14.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/InitialContextFactory.java 2002-11-23 21:50:40.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000 Free Software Foundation ! ! This file is part of libgcj. ! ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.naming.spi; --- 1,40 ---- ! /* InitialContextFactory.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ ! package javax.naming.spi; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/NamingManager.java gcc-3.3/libjava/javax/naming/spi/NamingManager.java *** gcc-3.2.3/libjava/javax/naming/spi/NamingManager.java 2001-10-24 21:39:21.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/NamingManager.java 2002-11-23 21:50:41.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2000, 2001 Free Software Foundation ! ! This file is part of libgcj. ! ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.naming.spi; --- 1,40 ---- ! /* NamingManager.java -- ! Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ ! package javax.naming.spi; *************** public class NamingManager *** 16,22 **** public static final String CPE = "java.naming.spi.CannotProceedException"; private static InitialContextFactoryBuilder icfb = null; ! private static ObjectFactoryBuilder ofb = null; // This class cannot be instantiated. NamingManager () --- 46,54 ---- public static final String CPE = "java.naming.spi.CannotProceedException"; private static InitialContextFactoryBuilder icfb = null; ! ! // Package private so DirectoryManager can access it. ! static ObjectFactoryBuilder ofb = null; // This class cannot be instantiated. NamingManager () *************** public class NamingManager *** 166,172 **** path = path2; else if (path2 != null) path += ":" + path2; ! return new StringTokenizer (path, ":"); } public static Object getObjectInstance (Object refInfo, --- 198,204 ---- path = path2; else if (path2 != null) path += ":" + path2; ! return new StringTokenizer (path != null ? path : "", ":"); } public static Object getObjectInstance (Object refInfo, diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/ObjectFactoryBuilder.java gcc-3.3/libjava/javax/naming/spi/ObjectFactoryBuilder.java *** gcc-3.2.3/libjava/javax/naming/spi/ObjectFactoryBuilder.java 2001-10-24 21:39:22.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/ObjectFactoryBuilder.java 2002-11-23 21:50:41.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.spi; import javax.naming.*; import java.util.Hashtable; --- 1,41 ---- ! /* ObjectFactoryBuilder.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.spi; import javax.naming.*; import java.util.Hashtable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/ObjectFactory.java gcc-3.3/libjava/javax/naming/spi/ObjectFactory.java *** gcc-3.2.3/libjava/javax/naming/spi/ObjectFactory.java 2001-10-24 21:39:22.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/ObjectFactory.java 2002-11-23 21:50:41.000000000 +0000 *************** *** 1,10 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ package javax.naming.spi; --- 1,40 ---- ! /* ObjectFactory.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.spi; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/ResolveResult.java gcc-3.3/libjava/javax/naming/spi/ResolveResult.java *** gcc-3.2.3/libjava/javax/naming/spi/ResolveResult.java 2001-10-24 21:39:22.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/ResolveResult.java 2002-11-23 21:50:41.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.spi; import javax.naming.*; import java.util.EventObject; --- 1,41 ---- ! /* ResolveResult.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.spi; import javax.naming.*; import java.util.EventObject; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/Resolver.java gcc-3.3/libjava/javax/naming/spi/Resolver.java *** gcc-3.2.3/libjava/javax/naming/spi/Resolver.java 2001-10-24 21:39:22.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/Resolver.java 2002-11-23 21:50:41.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.spi; import javax.naming.*; --- 1,41 ---- ! /* Resolver.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.spi; import javax.naming.*; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/spi/StateFactory.java gcc-3.3/libjava/javax/naming/spi/StateFactory.java *** gcc-3.2.3/libjava/javax/naming/spi/StateFactory.java 2001-10-24 21:39:22.000000000 +0000 --- gcc-3.3/libjava/javax/naming/spi/StateFactory.java 2002-11-23 21:50:41.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming.spi; import javax.naming.*; import java.util.Hashtable; --- 1,41 ---- ! /* StateFactory.java -- ! Copyright (C) 2001 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming.spi; import javax.naming.*; import java.util.Hashtable; diff -Nrc3pad gcc-3.2.3/libjava/javax/naming/TimeLimitExceededException.java gcc-3.3/libjava/javax/naming/TimeLimitExceededException.java *** gcc-3.2.3/libjava/javax/naming/TimeLimitExceededException.java 2000-11-27 05:57:58.000000000 +0000 --- gcc-3.3/libjava/javax/naming/TimeLimitExceededException.java 2002-11-23 21:50:39.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2000 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.naming; import java.lang.Exception; --- 1,41 ---- ! /* TimeLimitExceededException.java -- ! Copyright (C) 2000 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.naming; import java.lang.Exception; diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/ConnectionEvent.java gcc-3.3/libjava/javax/sql/ConnectionEvent.java *** gcc-3.2.3/libjava/javax/sql/ConnectionEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/ConnectionEvent.java 2003-02-11 05:12:37.000000000 +0000 *************** *** 0 **** --- 1,78 ---- + /* ConnectionEvent.java + Copyright (C) 2002, 2003 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.sql.SQLException; + import java.util.EventObject; + + /** + * @since 1.4 + */ + public class ConnectionEvent extends EventObject + { + private static final long serialVersionUID = -4843217645290030002L; + + // Note that the name is chosen for serialization. + private SQLException ex; + + /** + * @since 1.4 + */ + public ConnectionEvent(PooledConnection con) + { + super(con); + } + + /** + * @since 1.4 + */ + public ConnectionEvent(PooledConnection con, SQLException ex) + { + super(con); + this.ex = ex; + } + + /** + * @since 1.4 + */ + public SQLException getSQLException() + { + return ex; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/ConnectionEventListener.java gcc-3.3/libjava/javax/sql/ConnectionEventListener.java *** gcc-3.2.3/libjava/javax/sql/ConnectionEventListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/ConnectionEventListener.java 2002-06-21 05:39:26.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* ConnectionEventListener.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.util.EventListener; + + /** + * @since 1.4 + */ + public interface ConnectionEventListener extends EventListener + { + /** + * @since 1.4 + */ + public void connectionClosed(ConnectionEvent event); + + /** + * @since 1.4 + */ + public void connectionErrorOccurred(ConnectionEvent event); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/ConnectionPoolDataSource.java gcc-3.3/libjava/javax/sql/ConnectionPoolDataSource.java *** gcc-3.2.3/libjava/javax/sql/ConnectionPoolDataSource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/ConnectionPoolDataSource.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,79 ---- + /* ConnectionPoolDataSource.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.io.PrintWriter; + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface ConnectionPoolDataSource + { + /** + * @since 1.4 + */ + public PooledConnection getPooledConnection() throws SQLException; + + /** + * @since 1.4 + */ + public PooledConnection getPooledConnection(String user, String password) + throws SQLException; + + /** + * @since 1.4 + */ + public PrintWriter getLogWriter() throws SQLException; + + /** + * @since 1.4 + */ + public void setLogWriter(PrintWriter out) throws SQLException; + + /** + * @since 1.4 + */ + public void setLoginTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public int getLoginTimeout() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/DataSource.java gcc-3.3/libjava/javax/sql/DataSource.java *** gcc-3.2.3/libjava/javax/sql/DataSource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/DataSource.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,80 ---- + /* DataSource.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.io.PrintWriter; + import java.sql.Connection; + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface DataSource + { + /** + * @since 1.4 + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public Connection getConnection(String username, String password) + throws SQLException; + + /** + * @since 1.4 + */ + public PrintWriter getLogWriter() throws SQLException; + + /** + * @since 1.4 + */ + public void setLogWriter(PrintWriter out) throws SQLException; + + /** + * @since 1.4 + */ + public void setLoginTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public int getLoginTimeout() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/PooledConnection.java gcc-3.3/libjava/javax/sql/PooledConnection.java *** gcc-3.2.3/libjava/javax/sql/PooledConnection.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/PooledConnection.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,68 ---- + /* PooledConnection.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.sql.Connection; + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface PooledConnection + { + /** + * @since 1.4 + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public void close() throws SQLException; + + /** + * @since 1.4 + */ + public void addConnectionEventListener(ConnectionEventListener listener); + + /** + * @since 1.4 + */ + public void removeConnectionEventListener(ConnectionEventListener listener); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/RowSetEvent.java gcc-3.3/libjava/javax/sql/RowSetEvent.java *** gcc-3.2.3/libjava/javax/sql/RowSetEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/RowSetEvent.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* RowSetEvent.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.util.EventObject; + + /** + * @since 1.4 + */ + public class RowSetEvent extends EventObject + { + public RowSetEvent(RowSet source) + { + super(source); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/RowSetInternal.java gcc-3.3/libjava/javax/sql/RowSetInternal.java *** gcc-3.2.3/libjava/javax/sql/RowSetInternal.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/RowSetInternal.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,74 ---- + /* RowSetInternal.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.sql.Connection; + import java.sql.ResultSet; + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface RowSetInternal + { + /** + * @since 1.4 + */ + public Object[] getParams() throws SQLException; + + /** + * @since 1.4 + */ + public Connection getConnection() throws SQLException; + + /** + * @since 1.4 + */ + public void setMetaData(RowSetMetaData md) throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getOriginal() throws SQLException; + + /** + * @since 1.4 + */ + public ResultSet getOriginalRow() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/RowSet.java gcc-3.3/libjava/javax/sql/RowSet.java *** gcc-3.2.3/libjava/javax/sql/RowSet.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/RowSet.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,361 ---- + /* RowSet.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.io.InputStream; + import java.io.Reader; + import java.math.BigDecimal; + import java.sql.Array; + import java.sql.Blob; + import java.sql.Clob; + import java.sql.Date; + import java.sql.Ref; + import java.sql.ResultSet; + import java.sql.SQLException; + import java.sql.Time; + import java.sql.Timestamp; + import java.util.Calendar; + import java.util.Map; + + /** + * @since 1.4 + */ + public interface RowSet extends ResultSet + { + /** + * @since 1.4 + */ + public String getUrl() throws SQLException; + + /** + * @since 1.4 + */ + public void setUrl(String url) throws SQLException; + + /** + * @since 1.4 + */ + public String getDataSourceName(); + + /** + * @since 1.4 + */ + public void setDataSourceName(String name) throws SQLException; + + /** + * @since 1.4 + */ + public String getUsername(); + + /** + * @since 1.4 + */ + public void setUsername(String name) throws SQLException; + + /** + * @since 1.4 + */ + public String getPassword(); + + /** + * @since 1.4 + */ + public void setPassword(String password) throws SQLException; + + /** + * @since 1.4 + */ + public int getTransactionIsolation(); + + /** + * @since 1.4 + */ + public void setTransactionIsolation(int level) throws SQLException; + + /** + * @since 1.4 + */ + public Map getTypeMap() throws SQLException; + + /** + * @since 1.4 + */ + public void setTypeMap(Map map) throws SQLException; + + /** + * @since 1.4 + */ + public String getCommand(); + + /** + * @since 1.4 + */ + public void setCommand(String cmd) throws SQLException; + + /** + * @since 1.4 + */ + public boolean isReadOnly(); + + /** + * @since 1.4 + */ + public void setReadOnly(boolean value) throws SQLException; + + /** + * @since 1.4 + */ + public int getMaxFieldSize() throws SQLException; + + /** + * @since 1.4 + */ + public void setMaxFieldSize(int max) throws SQLException; + + /** + * @since 1.4 + */ + public int getMaxRows() throws SQLException; + + /** + * @since 1.4 + */ + public void setMaxRows(int max) throws SQLException; + + /** + * @since 1.4 + */ + public boolean getEscapeProcessing() throws SQLException; + + /** + * @since 1.4 + */ + public void setEscapeProcessing(boolean enable) throws SQLException; + + /** + * @since 1.4 + */ + public int getQueryTimeout() throws SQLException; + + /** + * @since 1.4 + */ + public void setQueryTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public void setType(int type) throws SQLException; + + /** + * @since 1.4 + */ + public void setConcurrency(int concurrency) throws SQLException; + + /** + * @since 1.4 + */ + public void setNull(int parameterIndex, int sqlType) throws SQLException; + + /** + * @since 1.4 + */ + public void setNull(int paramIndex, int sqlType, String typeName) throws + SQLException; + + /** + * @since 1.4 + */ + public void setBoolean(int parameterIndex, boolean x) throws SQLException; + + /** + * @since 1.4 + */ + public void setByte(int parameterIndex, byte x) throws SQLException; + + /** + * @since 1.4 + */ + public void setShort(int parameterIndex, short x) throws SQLException; + + /** + * @since 1.4 + */ + public void setInt(int parameterIndex, int x) throws SQLException; + + /** + * @since 1.4 + */ + public void setLong(int parameterIndex, long x) throws SQLException; + + /** + * @since 1.4 + */ + public void setFloat(int parameterIndex, float x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDouble(int parameterIndex, double x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBigDecimal(int parameterIndex, BigDecimal x) throws + SQLException; + + /** + * @since 1.4 + */ + public void setString(int parameterIndex, String x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBytes(int parameterIndex, byte[] x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDate(int parameterIndex, Date x) throws SQLException; + + /** + * @since 1.4 + */ + public void setTime(int parameterIndex, Time x) throws SQLException; + + /** + * @since 1.4 + */ + public void setTimestamp(int parameterIndex, Timestamp x) throws + SQLException; + + /** + * @since 1.4 + */ + public void setAsciiStream(int parameterIndex, InputStream x, int length) + throws SQLException; + + /** + * @since 1.4 + */ + public void setBinaryStream(int parameterIndex, InputStream x, int length) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCharacterStream(int parameterIndex, Reader reader, int + length) throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(int parameterIndex, Object x, int targetSqlType, int + scale) throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(int parameterIndex, Object x, int targetSqlType) + throws SQLException; + + /** + * @since 1.4 + */ + public void setObject(int parameterIndex, Object x) throws SQLException; + + /** + * @since 1.4 + */ + public void setRef(int i, Ref x) throws SQLException; + + /** + * @since 1.4 + */ + public void setBlob(int i, Blob x) throws SQLException; + + /** + * @since 1.4 + */ + public void setClob(int i, Clob x) throws SQLException; + + /** + * @since 1.4 + */ + public void setArray(int i, Array x) throws SQLException; + + /** + * @since 1.4 + */ + public void setDate(int parameterIndex, Date x, Calendar cal) throws + SQLException; + + /** + * @since 1.4 + */ + public void setTime(int parameterIndex, Time x, Calendar cal) throws + SQLException; + + /** + * @since 1.4 + */ + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) + throws SQLException; + + /** + * @since 1.4 + */ + public void clearParameters() throws SQLException; + + /** + * @since 1.4 + */ + public void execute() throws SQLException; + + /** + * @since 1.4 + */ + public void addRowSetListener(RowSetListener listener); + + /** + * @since 1.4 + */ + public void removeRowSetListener(RowSetListener listener); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/RowSetListener.java gcc-3.3/libjava/javax/sql/RowSetListener.java *** gcc-3.2.3/libjava/javax/sql/RowSetListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/RowSetListener.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* RowSetListener.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.util.EventListener; + + /** + * @since 1.4 + */ + public interface RowSetListener extends EventListener + { + /** + * @since 1.4 + */ + public void rowSetChanged(RowSetEvent event); + + /** + * @since 1.4 + */ + public void rowChanged(RowSetEvent event); + + /** + * @since 1.4 + */ + public void cursorMoved(RowSetEvent event); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/RowSetMetaData.java gcc-3.3/libjava/javax/sql/RowSetMetaData.java *** gcc-3.2.3/libjava/javax/sql/RowSetMetaData.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/RowSetMetaData.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,147 ---- + /* RowSetMetaData.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.sql.ResultSetMetaData; + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface RowSetMetaData extends ResultSetMetaData + { + + /** + * @since 1.4 + */ + public void setColumnCount(int columnCount) throws SQLException; + + /** + * @since 1.4 + */ + public void setAutoIncrement(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCaseSensitive(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setSearchable(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCurrency(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setNullable(int columnIndex, int property) throws SQLException; + + /** + * @since 1.4 + */ + public void setSigned(int columnIndex, boolean property) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnDisplaySize(int columnIndex, int size) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnLabel(int columnIndex, String label) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnName(int columnIndex, String columnName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setSchemaName(int columnIndex, String schemaName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setPrecision(int columnIndex, int precision) + throws SQLException; + + /** + * @since 1.4 + */ + public void setScale(int columnIndex, int scale) throws SQLException; + + /** + * @since 1.4 + */ + public void setTableName(int columnIndex, String tableName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setCatalogName(int columnIndex, String catalogName) + throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnType(int columnIndex, int SQLType) throws SQLException; + + /** + * @since 1.4 + */ + public void setColumnTypeName(int columnIndex, String typeName) + throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/RowSetReader.java gcc-3.3/libjava/javax/sql/RowSetReader.java *** gcc-3.2.3/libjava/javax/sql/RowSetReader.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/RowSetReader.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* RowSetReader.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface RowSetReader + { + /** + * @since 1.4 + */ + public void readData(RowSetInternal caller) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/RowSetWriter.java gcc-3.3/libjava/javax/sql/RowSetWriter.java *** gcc-3.2.3/libjava/javax/sql/RowSetWriter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/RowSetWriter.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* RowSetWriter.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface RowSetWriter + { + /** + * @since 1.4 + */ + public boolean writeData(RowSetInternal caller) throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/XAConnection.java gcc-3.3/libjava/javax/sql/XAConnection.java *** gcc-3.2.3/libjava/javax/sql/XAConnection.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/XAConnection.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,53 ---- + /* XAConnection.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.sql.SQLException; + import javax.transaction.xa.XAResource; + + /** + * @since 1.4 + */ + public interface XAConnection extends PooledConnection + { + /** + * @since 1.4 + */ + public XAResource getXAResource() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/sql/XADataSource.java gcc-3.3/libjava/javax/sql/XADataSource.java *** gcc-3.2.3/libjava/javax/sql/XADataSource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/sql/XADataSource.java 2002-06-21 05:39:27.000000000 +0000 *************** *** 0 **** --- 1,79 ---- + /* XADataSource.java + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.sql; + + import java.io.PrintWriter; + import java.sql.SQLException; + + /** + * @since 1.4 + */ + public interface XADataSource + { + /** + * @since 1.4 + */ + public XAConnection getXAConnection() throws SQLException; + + /** + * @since 1.4 + */ + public XAConnection getXAConnection(String user, String password) throws + SQLException; + + /** + * @since 1.4 + */ + public PrintWriter getLogWriter() throws SQLException; + + /** + * @since 1.4 + */ + public void setLogWriter(PrintWriter out) throws SQLException; + + /** + * @since 1.4 + */ + public void setLoginTimeout(int seconds) throws SQLException; + + /** + * @since 1.4 + */ + public int getLoginTimeout() throws SQLException; + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/AbstractAction.java gcc-3.3/libjava/javax/swing/AbstractAction.java *** gcc-3.2.3/libjava/javax/swing/AbstractAction.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/AbstractAction.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,215 ---- + /* AbstractAction.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.event.*; + import java.beans.*; + import java.io.*; + import javax.swing.event.*; + import java.util.*; + + /** + * AbstractAction + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class AbstractAction implements Action, Cloneable, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * enabled + */ + protected boolean enabled = true; + + /** + * changeSupport + */ + protected SwingPropertyChangeSupport changeSupport = + new SwingPropertyChangeSupport(this); + + /** + * store + */ + private transient HashMap store = new HashMap(); + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AbstractAction + */ + public AbstractAction() { + this(""); // TODO: default name + } // AbstractAction() + + /** + * Constructor AbstractAction + * @param name TODO + */ + public AbstractAction(String name) { + this(name, null); // TODO: default icon?? + } // AbstractAction() + + /** + * Constructor AbstractAction + * @param name TODO + * @param icon TODO + */ + public AbstractAction(String name, Icon icon) { + putValue(NAME, name); + putValue(SMALL_ICON, icon); + } // AbstractAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * readObject + * @param stream TODO + * @exception ClassNotFoundException TODO + * @exception IOException TODO + */ + private void readObject(ObjectInputStream stream) + throws ClassNotFoundException, IOException { + // TODO + } // readObject() + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * clone + * @exception CloneNotSupportedException TODO + * @returns Object + */ + protected Object clone() throws CloneNotSupportedException { + // What to do?? + return null; + } // clone() + + /** + * getValue + * @param key TODO + * @returns Object + */ + public Object getValue(String key) { + return store.get(key); + } // getValue() + + /** + * putValue + * @param key TODO + * @param value TODO + */ + public void putValue(String key, Object value) { + store.put(key, value); + } // putValue() + + /** + * isEnabled + * @returns boolean + */ + public boolean isEnabled() { + return enabled; + } // isEnabled() + + /** + * setEnabled + * @param enabled TODO + */ + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } // setEnabled() + + /** + * getKeys + * @returns Object[] + */ + public Object[] getKeys() { + return store.keySet().toArray(); + } // getKeys() + + /** + * firePropertyChange + * @param propertyName TODO + * @param oldValue TODO + * @param newValue TODO + */ + protected void firePropertyChange(String propertyName, + Object oldValue, Object newValue) { + changeSupport.firePropertyChange(propertyName, oldValue, newValue); + } // firePropertyChange() + + /** + * addPropertyChangeListener + * @param listener TODO + */ + public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { + changeSupport.addPropertyChangeListener(listener); + } // addPropertyChangeListener() + + /** + * removePropertyChangeListener + * @param listener TODO + */ + public synchronized void removePropertyChangeListener(PropertyChangeListener listener) { + changeSupport.removePropertyChangeListener(listener); + } // removePropertyChangeListener() + + /** + * actionPerformed + * @param event TODO + */ + public abstract void actionPerformed(ActionEvent event); + + + } // AbstractAction diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/AbstractButton.java gcc-3.3/libjava/javax/swing/AbstractButton.java *** gcc-3.2.3/libjava/javax/swing/AbstractButton.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/AbstractButton.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,795 ---- + /* AbstractButton.java -- Provides basic button functionality. + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + + import javax.swing.event.*; + import javax.swing.plaf.*; + import javax.swing.text.*; + import javax.accessibility.*; + + import java.util.*; + import java.beans.*; + + /** + * Provides basic button functionality + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public abstract class AbstractButton extends JComponent + implements ItemSelectable, SwingConstants + { + Icon default_icon, pressed_button, disabled_button, + selected_button, disabled_selected_button, current_icon; + String text; + + int vert_align = CENTER; + int hori_align = CENTER; + int hori_text_pos = CENTER; + int vert_text_pos = CENTER; + + boolean paint_border = true, paint_focus; + Action action_taken; + ButtonModel model; + Insets margin; + + + public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted"; + + /** + * AccessibleAbstractButton + */ + protected abstract class AccessibleAbstractButton + extends AccessibleJComponent + implements AccessibleAction, AccessibleValue, AccessibleText { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleAbstractButton + * @param component TODO + */ + protected AccessibleAbstractButton(AbstractButton component) { + super(component); + // TODO + } // AccessibleAbstractButton() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + /** + * getAccessibleName + * @returns String + */ + public String getAccessibleName() { + return null; // TODO + } // getAccessibleName() + + /** + * getAccessibleIcon + * @returns AccessibleIcon[] + */ + public AccessibleIcon[] getAccessibleIcon() { + return null; // TODO + } // getAccessibleIcon() + + /** + * getAccessibleRelationSet + * @returns AccessibleRelationSet + */ + public AccessibleRelationSet getAccessibleRelationSet() { + return null; // TODO + } // getAccessibleRelationSet() + + /** + * getAccessibleAction + * @returns AccessibleAction + */ + public AccessibleAction getAccessibleAction() { + return null; // TODO + } // getAccessibleAction() + + /** + * getAccessibleValue + * @returns AccessibleValue + */ + public AccessibleValue getAccessibleValue() { + return null; // TODO + } // getAccessibleValue() + + /** + * getAccessibleActionCount + * @returns int + */ + public int getAccessibleActionCount() { + return 0; // TODO + } // getAccessibleActionCount() + + /** + * getAccessibleActionDescription + * @param value0 TODO + * @returns String + */ + public String getAccessibleActionDescription(int value0) { + return null; // TODO + } // getAccessibleActionDescription() + + /** + * doAccessibleAction + * @param value0 TODO + * @returns boolean + */ + public boolean doAccessibleAction(int value0) { + return false; // TODO + } // doAccessibleAction() + + /** + * getCurrentAccessibleValue + * @returns Number + */ + public Number getCurrentAccessibleValue() { + return null; // TODO + } // getCurrentAccessibleValue() + + /** + * setCurrentAccessibleValue + * @param value0 TODO + * @returns boolean + */ + public boolean setCurrentAccessibleValue(Number value0) { + return false; // TODO + } // setCurrentAccessibleValue() + + /** + * getMinimumAccessibleValue + * @returns Number + */ + public Number getMinimumAccessibleValue() { + return null; // TODO + } // getMinimumAccessibleValue() + + /** + * getMaximumAccessibleValue + * @returns Number + */ + public Number getMaximumAccessibleValue() { + return null; // TODO + } // getMaximumAccessibleValue() + + /** + * getAccessibleText + * @returns AccessibleText + */ + public AccessibleText getAccessibleText() { + return null; // TODO + } // getAccessibleText() + + /** + * getIndexAtPoint + * @param value0 TODO + * @returns int + */ + public int getIndexAtPoint(Point value0) { + return 0; // TODO + } // getIndexAtPoint() + + /** + * getCharacterBounds + * @param value0 TODO + * @returns Rectangle + */ + public Rectangle getCharacterBounds(int value0) { + return null; // TODO + } // getCharacterBounds() + + /** + * getCharCount + * @returns int + */ + public int getCharCount() { + return 0; // TODO + } // getCharCount() + + /** + * getCaretPosition + * @returns int + */ + public int getCaretPosition() { + return 0; // TODO + } // getCaretPosition() + + /** + * getAtIndex + * @param value0 TODO + * @param value1 TODO + * @returns String + */ + public String getAtIndex(int value0, int value1) { + return null; // TODO + } // getAtIndex() + + /** + * getAfterIndex + * @param value0 TODO + * @param value1 TODO + * @returns String + */ + public String getAfterIndex(int value0, int value1) { + return null; // TODO + } // getAfterIndex() + + /** + * getBeforeIndex + * @param value0 TODO + * @param value1 TODO + * @returns String + */ + public String getBeforeIndex(int value0, int value1) { + return null; // TODO + } // getBeforeIndex() + + /** + * getCharacterAttribute + * @param value0 TODO + * @returns AttributeSet + */ + public AttributeSet getCharacterAttribute(int value0) { + return null; // TODO + } // getCharacterAttribute() + + /** + * getSelectionStart + * @returns int + */ + public int getSelectionStart() { + return 0; // TODO + } // getSelectionStart() + + /** + * getSelectionEnd + * @returns int + */ + public int getSelectionEnd() { + return 0; // TODO + } // getSelectionEnd() + + /** + * getSelectedText + * @returns String + */ + public String getSelectedText() { + return null; // TODO + } // getSelectedText() + + /** + * getTextRectangle + * @returns Rectangle + */ + private Rectangle getTextRectangle() { + return null; // TODO + } // getTextRectangle() + + + } // AccessibleAbstractButton + + + static private class JFocusListener implements FocusListener + { + AbstractButton c; + + JFocusListener(AbstractButton c) + { + this.c = c; + } + + public void focusLost(FocusEvent event) + { + c.getModel().setArmed(false); + + System.out.println("LOST FOCUS"); + if (c.isFocusPainted()) + { + c.repaint(); + } + } + public void focusGained(FocusEvent event) + { + System.out.println("GAIN FOCUS"); + } + } + + + /********************************************** + * + * + * Constructors + * + * + ****************/ + + AbstractButton() + { + this("",null); + } + + AbstractButton(String text, + Icon icon) + { + this.text = text; + setIcon(icon); + + setAlignmentX(LEFT_ALIGNMENT); + setAlignmentY(CENTER_ALIGNMENT); + + addFocusListener( new JFocusListener(this) ); + + setModel(new DefaultButtonModel(this)); + + updateUI(); // get a proper ui + } + + + /********************************************** + * + * + * Actions etc + * + * + ****************/ + + public ButtonModel getModel() + { return model; } + public void setModel(ButtonModel newModel) + { model = newModel; } + + public String getActionCommand() + { return getModel().getActionCommand(); } + public void setActionCommand(String aCommand) + { getModel().setActionCommand(aCommand); } + + public void addActionListener(ActionListener l) + { getModel().addActionListener(l); } + public void removeActionListener(ActionListener l) + { getModel().removeActionListener(l); } + + public void addChangeListener(ChangeListener l) + { getModel().addChangeListener(l); } + public void removeChangeListener(ChangeListener l) + { getModel().removeChangeListener(l); } + + public void addItemListener(ItemListener l) + { getModel().addItemListener(l); } + public void removeItemListener(ItemListener l) + { getModel().removeItemListener(l); } + + public int getHorizontalAlignment() + { return hori_align; } + public int getHorizontalTextPosition() + { return hori_text_pos; } + public int getVerticalAlignment() + { return vert_align; } + public int getVerticalTextPosition() + { return vert_text_pos; } + + + protected void fireItemStateChanged(ItemEvent event) + { getModel().fireItemStateChanged(event); } + protected void fireStateChanged(ChangeEvent event) + { getModel().fireStateChanged(event); } + protected void fireActionPerformed(ActionEvent event) + { getModel().fireActionPerformed(event); } + + public void setVerticalAlignment(int alignment) + { vert_align = alignment; } + public void setHorizontalAlignment(int alignment) + { hori_align = alignment; } + public void setVerticalTextPosition(int textPosition) + { vert_text_pos = textPosition; } + public void setHorizontalTextPosition(int textPosition) + { hori_text_pos = textPosition; } + + public int getMnemonic() + { return getModel().getMnemonic(); } + public void setMnemonic(char mne) + { getModel().setMnemonic(mne); } + public void setMnemonic(int mne) + { getModel().setMnemonic(mne); } + + public void setRolloverEnabled(boolean b) + { getModel().setRollover(b); } + public boolean isRolloverEnabled() + { return getModel().isRollover(); } + + + public boolean isBorderPainted() + { return paint_border; } + public void setBorderPainted(boolean b) + { + if (b != paint_border) + { + paint_border = b; + revalidate(); + repaint(); + } + } + + public Action getAction() + { return action_taken; } + public void setAction(Action a) + { + action_taken = a; + revalidate(); + repaint(); + } + + public void setSelected(boolean b) + { getModel().setSelected(b); } + public boolean isSelected() + { return getModel().isSelected(); } + + + public Icon getIcon() + { return default_icon; } + public void setIcon(Icon defaultIcon) + { + if (default_icon == defaultIcon) + return; + + default_icon = defaultIcon; + if (default_icon != null) + { + // XXX FIXME - icons do not know their parent + // default_icon.setParent(this); + } + revalidate(); + repaint(); + } + + public String getText() + { return text; } + public void setLabel(String label) + { setText(label); } + public String getLabel() + { return getText(); } + public void setText(String text) + { + this.text = text; + revalidate(); + repaint(); + } + + + public Insets getMargin() + { return margin; } + public void setMargin(Insets m) + { + margin = m; + revalidate(); + repaint(); + } + + public void setEnabled(boolean b) + { + super.setEnabled(b); + getModel().setEnabled(b); + repaint(); + } + + public Icon getPressedIcon() + { return pressed_button; } + public void setPressedIcon(Icon pressedIcon) + { + pressed_button = pressedIcon; + revalidate(); + repaint(); + } + + + public Icon getDisabledIcon() + { return disabled_button; } + public void setDisabledIcon(Icon disabledIcon) + { + disabled_button = disabledIcon; + revalidate(); + repaint(); + } + + public boolean isFocusPainted() + { return paint_focus; } + public void setFocusPainted(boolean b) + { + boolean old = paint_focus; + paint_focus = b; + + firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY, + old, + b); + if (hasFocus()) + { + revalidate(); + repaint(); + } + } + + public boolean isFocusTraversable() + { + //Identifies whether or not this component can receive the focus. + return true; + } + + + protected int checkHorizontalKey(int key, String exception) + { + // Verify that key is a legal value for the horizontalAlignment properties. + return 0; + } + protected int checkVerticalKey(int key, String exception) + { + // Ensures that the key is a valid. + return 0; + } + protected void configurePropertiesFromAction(Action a) + { + //Factory method which sets the ActionEvent source's properties according to values from the Action instance. + } + + protected ActionListener createActionListener() + { + return new ActionListener() + { + public void actionPerformed(ActionEvent e) { } + }; + } + + protected PropertyChangeListener createActionPropertyChangeListener(Action a) + { + //Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance. + return null; + } + protected ChangeListener createChangeListener() + { + // Subclasses that want to handle ChangeEvents differently can override this to return another ChangeListener implementation. + return new ChangeListener() + { + public void stateChanged(ChangeEvent e) { } + }; + } + + protected ItemListener createItemListener() + { + return new ItemListener() + { + public void itemStateChanged(ItemEvent e) { } + }; + } + + + public void doClick() + { + doClick(100); + } + public void doClick(int pressTime) + { + //Toolkit.tlkBeep (); + //Programmatically perform a "click". + } + + + public Icon getDisabledSelectedIcon() + { + //Returns the icon used by the button when it's disabled and selected. + return disabled_selected_button; + } + + + public Icon getRolloverIcon() + { + // Returns the rollover icon for the button. + return null; + } + + Icon getRolloverSelectedIcon() + { + // Returns the rollover selection icon for the button. + return null; + } + Icon getSelectedIcon() + { + // Returns the selected icon for the button. + return selected_button; + } + + + public Object[] getSelectedObjects() + { + //Returns an array (length 1) containing the label or null if the button is not selected. + return null; + } + + + public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) + { + //This is overridden to return false if the current Icon's Image is not equal to the passed in Image img. + return current_icon == img; + } + + public boolean isContentAreaFilled() + { + // Checks whether the "content area" of the button should be filled. + return false; + } + + + + protected void paintBorder(Graphics g) + { + // Paint the button's border if BorderPainted property is true. + if (isBorderPainted()) + super.paintBorder(g); + } + protected String paramString() + { + // Returns a string representation of this AbstractButton. + return "AbstractButton"; + } + + + public void setContentAreaFilled(boolean b) + { + //Sets whether the button should paint the content area or leave it transparent. + } + + + public void setDisabledSelectedIcon(Icon disabledSelectedIcon) + { + // Sets the disabled selection icon for the button. + } + + public void setRolloverIcon(Icon rolloverIcon) + { + // Sets the rollover icon for the button. + } + public void setRolloverSelectedIcon(Icon rolloverSelectedIcon) + { + // Sets the rollover selected icon for the button. + } + + + public void setSelectedIcon(Icon selectedIcon) + { + // Sets the selected icon for the button. + } + + + public void setUI(ButtonUI ui) + { // Sets the L&F object that renders this component. + super.setUI(ui); + } + + public ButtonUI getUI() + { + //Returns the L&F object that renders this component. + return (ButtonUI) ui; + } + + public void updateUI() + { + /* + // Notification from the UIFactory that the L&F has changed. + if (getUI() == null) + { + setUI(getUI()); + } + */ + } + + protected void processActionEvent(ActionEvent e) + { + System.out.println("PROCESS-ACTION-EVENT: " + e); + } + + + protected void processMouseEvent(MouseEvent e) + { + // System.out.println("PROCESS-MOUSE-EVENT: " + e + ", PRESSED-IN-MODEL="+getModel().isPressed()); + + switch (e.getID()) + { + case MouseEvent.MOUSE_MOVED: + { + break; + } + case MouseEvent.MOUSE_PRESSED: + { + if (! isEnabled()) + { + System.out.println("button not enabled, ignoring press"); + } + else + { + System.out.println("telling model:press: " + getModel()); + getModel().setPressed(true); + repaint(); + } + break; + } + + case MouseEvent.MOUSE_RELEASED: + { + if (! isEnabled()) + { + System.out.println("button not enabled, ignoring release"); + } + else + { + int flags = 0; + + System.out.println(" XXX--> " + getActionCommand()); + + fireActionPerformed(new ActionEvent(this, + ActionEvent.ACTION_PERFORMED, + getActionCommand(), + flags)); + + //System.out.println("telling model:release"); + getModel().setPressed(false); + repaint(); + } + break; + } + case MouseEvent.MOUSE_CLICKED: + { + break; + } + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/AbstractCellEditor.java gcc-3.3/libjava/javax/swing/AbstractCellEditor.java *** gcc-3.2.3/libjava/javax/swing/AbstractCellEditor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/AbstractCellEditor.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,153 ---- + /* AbstractCellEditor.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import java.util.*; + import javax.swing.event.*; + + /** + * AbstractCellEditor + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class AbstractCellEditor implements CellEditor, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * listenerList + */ + protected EventListenerList listenerList; + + /** + * changeEvent + */ + protected transient ChangeEvent changeEvent; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AbstractCellEditor + */ + public AbstractCellEditor() { + // TODO + } // AbstractCellEditor() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * isCellEditable + * @param event TODO + * @returns boolean + */ + public boolean isCellEditable(EventObject event) { + return false; // TODO + } // isCellEditable() + + /** + * shouldSelectCell + * @param event TODO + * @returns boolean + */ + public boolean shouldSelectCell(EventObject event) { + return false; // TODO + } // shouldSelectCell() + + /** + * stopCellEditing + * @returns boolean + */ + public boolean stopCellEditing() { + return false; // TODO + } // stopCellEditing() + + /** + * cancelCellEditing + */ + public void cancelCellEditing() { + // TODO + } // cancelCellEditing() + + /** + * addCellEditorListener + * @param listener TODO + */ + public void addCellEditorListener(CellEditorListener listener) { + // TODO + } // addCellEditorListener() + + /** + * removeCellEditorListener + * @param listener TODO + */ + public void removeCellEditorListener(CellEditorListener listener) { + // TODO + } // removeCellEditorListener() + + /** + * fireEditingStopped + */ + protected void fireEditingStopped() { + // TODO + } // fireEditingStopped() + + /** + * fireEditingCanceled + */ + protected void fireEditingCanceled() { + // TODO + } // fireEditingCanceled() + + /** + * getCellEditorValue + * @returns Object + */ + public abstract Object getCellEditorValue(); + + + } // AbstractCellEditor diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/AbstractListModel.java gcc-3.3/libjava/javax/swing/AbstractListModel.java *** gcc-3.2.3/libjava/javax/swing/AbstractListModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/AbstractListModel.java 2002-10-10 12:08:37.000000000 +0000 *************** *** 0 **** --- 1,213 ---- + /* AbstractListModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import java.util.*; + import javax.swing.event.*; + + /** + * AbstractListModel + * A2uthor Ronald Veldema + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class AbstractListModel implements ListModel, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * listenerList + */ + protected EventListenerList listenerList = new EventListenerList(); + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AbstractListModel + */ + public AbstractListModel() { + } // AbstractListModel() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * addListDataListener + * @param listener TODO + */ + public void addListDataListener(ListDataListener listener) { + listenerList.add(ListDataListener.class, (EventListener) listener); + } // addListDataListener() + + /** + * removeListDataListener + * @param listener TODO + */ + public void removeListDataListener(ListDataListener listener) { + listenerList.remove(ListDataListener.class, (EventListener) listener); + } // removeListDataListener() + + /** + * fireContentsChanged + * @param source TODO + * @param startIndex TODO + * @param endIndex TODO + */ + protected void fireContentsChanged(Object source, int startIndex, int endIndex) { + + // Variables + ListDataEvent event; + EventListener[] listeners; + ListDataListener listener; + int index; + + // Create Event + event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED, + startIndex, endIndex); + + // Get Listeners + listeners = listenerList.getListeners(ListDataListener.class); + + // Process Listeners + for (index = 0; index < listeners.length; index++) { + listener = (ListDataListener) listeners[index]; + listener.contentsChanged(event); + } // for + + } // fireContentsChanged() + + /** + * fireIntervalAdded + * @param source TODO + * @param startIndex TODO + * @param endIndex TODO + */ + protected void fireIntervalAdded(Object source, int startIndex, int endIndex) { + + // Variables + ListDataEvent event; + EventListener[] listeners; + ListDataListener listener; + int index; + + // Create Event + event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED, + startIndex, endIndex); + + // Get Listeners + listeners = listenerList.getListeners(ListDataListener.class); + + // Process Listeners + for (index = 0; index < listeners.length; index++) { + listener = (ListDataListener) listeners[index]; + listener.intervalAdded(event); + } // for + + } // fireIntervalAdded() + + /** + * fireIntervalRemoved + * @param source TODO + * @param startIndex TODO + * @param endIndex TODO + */ + protected void fireIntervalRemoved(Object source, int startIndex, int endIndex) { + + // Variables + ListDataEvent event; + EventListener[] listeners; + ListDataListener listener; + int index; + + // Create Event + event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED, + startIndex, endIndex); + + // Get Listeners + listeners = listenerList.getListeners(ListDataListener.class); + + // Process Listeners + for (index = 0; index < listeners.length; index++) { + listener = (ListDataListener) listeners[index]; + listener.intervalRemoved(event); + } // for + + } // fireIntervalRemoved() + + /** + * getListeners + * @param listenerType TODO + * @returns EventListener[] + */ + public EventListener[] getListeners(Class listenerType) { + return listenerList.getListeners(listenerType); + } // getListeners() + + /** + * getListDataListeners + */ + public ListDataListener[] getListDataListeners() + { + // FIXME: implement this + return null; + } + + /** + * getElementAt + * @param index TODO + * @returns Object + */ + public abstract Object getElementAt(int index); + + /** + * getSize + * @returns int + */ + public abstract int getSize(); + + + } // AbstractListModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/AbstractSet.java gcc-3.3/libjava/javax/swing/AbstractSet.java *** gcc-3.2.3/libjava/javax/swing/AbstractSet.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/AbstractSet.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,101 ---- + /* AbstractSet.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.util.*; + + /** + * Empty + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public abstract class AbstractSet extends AbstractCollection implements Set + { + boolean contained(Object []a1, Object b) + { + for (int i=0;i value || value > (value + extent) || + (value + extent) > maximum) { + throw new IllegalArgumentException("Invalid value property set"); + } // if + + // Set Value + this.value = value; + + // Notification + fireStateChanged(); + + } // setValue() + + /** + * getExtent + * @returns int + */ + public int getExtent() { + return extent; + } // getExtent() + + /** + * setExtent + * @param extent TODO + */ + public void setExtent(int extent) { + + // Validate Constraints + if (minimum > value || value > (value + extent) || + (value + extent) > maximum) { + throw new IllegalArgumentException("Invalid extent property set"); + } // if + + // Set Extent + this.extent = extent; + + // Notification + fireStateChanged(); + + } // setExtent() + + /** + * getMinimum + * @returns int + */ + public int getMinimum() { + return minimum; + } // getMinimum() + + /** + * setMinimum + * @param minimum TODO + */ + public void setMinimum(int minimum) { + + // Validate Constraints + if (minimum > value || value > (value + extent) || + (value + extent) > maximum) { + throw new IllegalArgumentException("Invalid minimum property set"); + } // if + + // Set Minimum + this.minimum = minimum; + + // Notification + fireStateChanged(); + + } // setMinimum() + + /** + * getMaximum + * @returns int + */ + public int getMaximum() { + return maximum; + } // getMaximum() + + /** + * setMaximum + * @param maximum TODO + */ + public void setMaximum(int maximum) { + + // Validate Constraints + if (minimum > value || value > (value + extent) || + (value + extent) > maximum) { + throw new IllegalArgumentException("Invalid maximum property set"); + } // if + + // Set Maximum + this.maximum = maximum; + + // Notification + fireStateChanged(); + + } // setMaximum() + + /** + * getValueIsAdjusting + * @returns boolean + */ + public boolean getValueIsAdjusting() { + return isAdjusting; + } // getValueIsAdjusting() + + /** + * setValueIsAdjusting + * @param isAdjusting TODO + */ + public void setValueIsAdjusting(boolean isAdjusting) { + + // Set isAdjusting + this.isAdjusting = isAdjusting; + + // Notification + fireStateChanged(); + + } // setValueIsAdjusting() + + /** + * setRangeProperties + * @param value TODO + * @param extent TODO + * @param minimum TODO + * @param maximum TODO + * @param isAdjusting TODO + */ + public void setRangeProperties(int value, int extent, int minimum, + int maximum, boolean isAdjusting) { + + // Validate Constraints + if (minimum > value || value > (value + extent) || + (value + extent) > maximum) { + throw new IllegalArgumentException("Invalid property set"); + } // if + + // Set Data + this.value = value; + this.extent = extent; + this.minimum = minimum; + this.maximum = maximum; + this.isAdjusting = isAdjusting; + + // Notification + fireStateChanged(); + + } // setRangeProperties() + + /** + * addChangeListener + * @param listener TODO + */ + public void addChangeListener(ChangeListener listener) { + listenerList.add(ChangeListener.class, listener); + } // addChangeListener() + + /** + * removeChangeListener + * @param listener TODO + */ + public void removeChangeListener(ChangeListener listener) { + listenerList.remove(ChangeListener.class, listener); + } // removeChangeListener() + + /** + * fireStateChanged + */ + protected void fireStateChanged() { + + // Variables + ChangeListener listener; + EventListener[] listeners; + int index; + + // Get Listeners + listeners = listenerList.getListeners(ChangeListener.class); + + // Process Listeners + for (index = 0; index < listeners.length; index++) { + listener = (ChangeListener) listeners[index]; + listener.stateChanged(changeEvent); + } // for + + } // fireStateChanged() + + /** + * getListeners + * @param c TODO + * @returns EventListener[] + */ + public EventListener[] getListeners(Class c) { + return listenerList.getListeners(c); + } // getListeners() + + /** + * getChangeListeners + */ + public ChangeListener[] getChangeListeners() + { + // FIXME: implement this + return null; + } + + + } // DefaultBoundedRangeModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/DefaultButtonModel.java gcc-3.3/libjava/javax/swing/DefaultButtonModel.java *** gcc-3.2.3/libjava/javax/swing/DefaultButtonModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/DefaultButtonModel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,169 ---- + /* DefaultButtonModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.util.*; + import java.awt.event.*; + import java.awt.*; + import javax.swing.event.*; + + public + class DefaultButtonModel implements ButtonModel, java.io.Serializable + { + Vector actions = new Vector(); + + Vector items = new Vector(); + Vector changes = new Vector(); + ButtonGroup group; + JComponent comp; + + + DefaultButtonModel(JComponent a) + { + comp = a; + } + + + public Object[] getSelectedObjects() + { + return null; + } + + + public void fireItemStateChanged(ItemEvent event) + { + for (int i=0;i= 0; index--) { + test = elements.get(index); + if (test.equals(element) == true) { + return index; + } // if + } // for + return -1; + + } // lastIndexOf() + + /** + * get + * @param index TODO + * @returns Object + */ + public Object get(int index) { + return elements.get(index); + } // get() + + /** + * set + * @param index TODO + * @param element TODO + * @returns Object + */ + public Object set(int index, Object element) { + + // Variables + Object result; + + // Process Action + result = elements.set(index, element); + + // Send event + fireContentsChanged(this, index, index); + + return result; + + } // set() + + /** + * add + * @param index TODO + * @param element TODO + */ + public void add(int index, Object element) { + + // Process Action + elements.add(index, element); + + // Send event + fireContentsChanged(this, index, index); + + } // add() + + /** + * addElement + * @param element TODO + */ + public void addElement(Object element) { + + // Process Action + elements.add(element); + + // Send event + fireIntervalAdded(this, elements.size(), elements.size()); + + } // addElement() + + /** + * size + * @returns int + */ + public int size() { + return elements.size(); + } // size() + + /** + * toArray + * @returns Object[] + */ + public Object[] toArray() { + return elements.toArray(); + } // toArray() + + /** + * contains + * @param element TODO + * @returns boolean + */ + public boolean contains(Object element) { + return elements.contains(element); + } // contains() + + /** + * copyInto + * @param array TODO + */ + public void copyInto(Object[] array) { + + // Variables + int index; + int size; + Object[] srcArray; + + // Initialize + size = size(); + srcArray = toArray(); + + // Process Elements + for (index = 0; index < size; index++) { + array[index] = srcArray[index]; + } // for + + } // copyInto() + + /** + * clear + */ + public void clear() { + + // Process Action + elements.clear(); + + // Send event + fireIntervalRemoved(this, 0, elements.size()); + + } // clear() + + /** + * remove + * @param index TODO + * @returns Object + */ + public Object remove(int index) { + + // Variables + Object result; + + // Process Action + result = elements.remove(index); + + // Send event + fireIntervalRemoved(this, index, index); + + return result; + + } // remove() + + /** + * isEmpty + * @returns boolean + */ + public boolean isEmpty() { + return elements.isEmpty(); + } // isEmpty() + + /** + * elements + * @returns Enumeration + */ + public Enumeration elements() { + + // TODO + // Note: This is a pathetic implementation. If Vector + // was used for storage, this wouldn't be an issue. I'll + // have to implement an Enumeration inner class sometime. + + // Variables + Vector vector; + + // Get Enumeration + vector = new Vector(elements); + return vector.elements(); + + } // elements() + + /** + * trimToSize + */ + public void trimToSize() { + elements.trimToSize(); + } // trimToSize() + + /** + * ensureCapacity + * @param size TODO + */ + public void ensureCapacity(int size) { + elements.ensureCapacity(size); + } // ensureCapacity() + + /** + * setSize + * @param size TODO + */ + public void setSize(int size) { + elements.ensureCapacity(size); + } // setSize() + + /** + * capacity + * @returns int + */ + public int capacity() { + return elements.size(); + } // capacity() + + /** + * firstElement + * @returns Object + */ + public Object firstElement() { + + // Variables + Object element; + + try { + element = elements.get(0); + return element; + } catch (IndexOutOfBoundsException e) { + throw new NoSuchElementException(); + } // try + + } // firstElement() + + /** + * lastElement + * @returns Object + */ + public Object lastElement() { + + // Variables + Object element; + + try { + element = elements.get(elements.size() - 1); + return element; + } catch (ArrayIndexOutOfBoundsException e) { + throw new NoSuchElementException(); + } // try + + } // lastElement() + + /** + * setElementAt + * @param element TODO + * @param index TODO + */ + public void setElementAt(Object element, int index) { + + // Process Action + elements.set(index, element); + + // Send event + fireContentsChanged(this, index, index); + + } // setElementAt() + + /** + * removeElementAt + * @param index TODO + */ + public void removeElementAt(int index) { + + // Process Action + elements.remove(index); + + // Send event + fireIntervalRemoved(this, index, index); + + } // removeElementAt() + + /** + * insertElementAt + * @param element TODO + * @param index TODO + */ + public void insertElementAt(Object element, int index) { + + // Process Action + elements.add(index, element); + + // Send event + fireIntervalRemoved(this, index, index); + + } // insertElementAt() + + /** + * removeElement + * @param element TODO + * @returns boolean + */ + public boolean removeElement(Object element) { + + // Variables + int index; + + index = elements.indexOf(element); + if (index != -1) { + elements.remove(index); + + // Send event + fireIntervalRemoved(this, index, index); + + return true; + + } // if + + return false; + + } // removeElement() + + /** + * removeAllElements + */ + public void removeAllElements() { + + // Variables + int size; + + size = size(); + + if (size > 0) { + + // Process Action + elements.clear(); + + // Send event + fireIntervalRemoved(this, 0, size - 1); + + } // if + + } // removeAllElements() + + /** + * removeRange + * @param startIndex TODO + * @param endIndex TODO + */ + public void removeRange(int startIndex, int endIndex) { + + // Variables + int index; + + // Check Indices + if (startIndex > endIndex) { + throw new IllegalArgumentException(); + } // if + + // Process Elements + for (index = endIndex; index >= startIndex; index--) { + elements.remove(index); + } // for + + // Send event + fireIntervalRemoved(this, startIndex, endIndex); + + } // removeRange() + + /** + * getSize + * @returns int + */ + public int getSize() { + return elements.size(); + } // getSize() + + /** + * getElementAt + * @param index TODO + * @returns Object + */ + public Object getElementAt(int index) { + return elements.get(index); + } // getElementAt() + + + } // DefaultListModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/DefaultListSelectionModel.java gcc-3.3/libjava/javax/swing/DefaultListSelectionModel.java *** gcc-3.2.3/libjava/javax/swing/DefaultListSelectionModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/DefaultListSelectionModel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,181 ---- + /* DefaultListSelectionModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import javax.swing.event.*; + import java.util.*; + + public class DefaultListSelectionModel implements ListSelectionModel + { + int mode = SINGLE_SELECTION; + + Vector sel = new Vector(); + + Vector listeners; + + Vector get_listeners() + { + if (listeners == null) + listeners = new Vector(); + return listeners; + } + + + public void addListSelectionListener(ListSelectionListener listener) + { + get_listeners().addElement(listener); + } + + public void removeListSelectionListener(ListSelectionListener listener) + { + get_listeners().removeElement(listener); + } + + class Range + { + int i0, i1; + + Range(int a, int b) + { + if (a > b) + { + i0 = b; + i1 = a; + } + else + { + i0 = a; + i1 = b; + } + } + } + + + public int getMinSelectionIndex() + { + if (isSelectionEmpty()) + return -1; + + boolean first = true; + int min = -1; + for (int i=0;i min) + { + min = r.i0; + } + } + } + return min; + } + + public int getMaxSelectionIndex() + { + if (isSelectionEmpty()) + return -1; + + boolean first = true; + int max = -1; + for (int i=1;i max) + { + max = r.i1; + } + } + } + return max; + } + + public boolean isSelectedIndex(int a) + { + for (int i=0;i= a) + { + return true; + } + } + return false; + } + + + public int getSelectionMode() + { return mode; } + public void setSelectionMode(int a) + { mode = a; } + + boolean isSelectionEmpty() + { + return sel.size() == 0; + } + + public void clearSelection() + { + sel.removeAllElements(); + } + + public void setSelectionInterval(int index0, int index1) + { + if (mode == SINGLE_SELECTION) + { + sel.removeAllElements(); + } + + sel.addElement(new Range(index0, index1)); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/DefaultSingleSelectionModel.java gcc-3.3/libjava/javax/swing/DefaultSingleSelectionModel.java *** gcc-3.2.3/libjava/javax/swing/DefaultSingleSelectionModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/DefaultSingleSelectionModel.java 2002-10-10 12:08:37.000000000 +0000 *************** *** 0 **** --- 1,188 ---- + /* DefaultSingleSelectionModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import java.util.*; + import javax.swing.event.*; + + /** + * DefaultSingleSelectionModel + * @author Andrew Selkirk + * @version 1.0 + */ + public class DefaultSingleSelectionModel implements + SingleSelectionModel, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * changeEvent + */ + protected transient ChangeEvent changeEvent = new ChangeEvent(this); + + /** + * listenerList + */ + protected EventListenerList listenerList= new EventListenerList(); + + /** + * index + */ + private int index = -1; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultSingleSelectionModel + */ + public DefaultSingleSelectionModel() { + // TODO + } // DefaultSingleSelectionModel() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getSelectedIndex + * @returns int + */ + public int getSelectedIndex() { + return index; + } // getSelectedIndex() + + /** + * setSelectedIndex + * @param index TODO + */ + public void setSelectedIndex(int index) { + + // Set Data + this.index = index; + + // Notify Listeners + fireStateChanged(); + + } // setSelectedIndex() + + /** + * clearSelection + */ + public void clearSelection() { + + // Set Data + index = -1; + + // Notify Listeners + fireStateChanged(); + + } // clearSelection() + + /** + * isSelected + * @returns boolean + */ + public boolean isSelected() { + return (index == -1); + } // isSelected() + + /** + * addChangeListener + * @param listener TODO + */ + public void addChangeListener(ChangeListener listener) { + listenerList.add(ChangeListener.class, listener); + } // addChangeListener() + + /** + * removeChangeListener + * @param listener TODO + */ + public void removeChangeListener(ChangeListener listener) { + listenerList.remove(ChangeListener.class, listener); + } // removeChangeListener() + + /** + * fireStateChanged + */ + protected void fireStateChanged() { + + // Variables + ChangeListener listener; + EventListener[] listeners; + int index; + + // Get Listeners + listeners = listenerList.getListeners(ChangeListener.class); + + // Process Listeners + for (index = 0; index < listeners.length; index++) { + listener = (ChangeListener) listeners[index]; + listener.stateChanged(changeEvent); + } // for + + } // fireStateChanged() + + /** + * getListeners + * @param listenerClass TODO + * @returns EventListener[] + */ + public EventListener[] getListeners(Class listenerClass) { + return listenerList.getListeners(listenerClass); + } // getListeners() + + /** + * getChangeListeners + */ + public ChangeListener[] getChangeListeners() + { + // FIXME: implement this + return null; + } + + + } // DefaultSingleSelectionModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/DesktopManager.java gcc-3.3/libjava/javax/swing/DesktopManager.java *** gcc-3.2.3/libjava/javax/swing/DesktopManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/DesktopManager.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,155 ---- + /* DesktopManager.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + /** + * DesktopManager + * @author Andrew Selkirk + * @version 1.0 + */ + public interface DesktopManager { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * openFrame + * @param frame TODO + */ + public void openFrame(JInternalFrame frame); + + /** + * closeFrame + * @param frame TODO + */ + public void closeFrame(JInternalFrame frame); + + /** + * maximizeFrame + * @param frame TODO + */ + public void maximizeFrame(JInternalFrame frame); + + /** + * minimizeFrame + * @param frame TODO + */ + public void minimizeFrame(JInternalFrame frame); + + /** + * iconifyFrame + * @param frame TODO + */ + public void iconifyFrame(JInternalFrame frame); + + /** + * deiconifyFrame + * @param frame TODO + */ + public void deiconifyFrame(JInternalFrame frame); + + /** + * activateFrame + * @param frame TODO + */ + public void activateFrame(JInternalFrame vframe); + + /** + * deactivateFrame + * @param frame TODO + */ + public void deactivateFrame(JInternalFrame frame); + + /** + * beginDraggingFrame + * @param frame TODO + */ + public void beginDraggingFrame(JComponent frame); + + /** + * dragFrame + * @param frame TODO + * @param x TODO + * @param y TODO + */ + public void dragFrame(JComponent frame, int x, int y); + + /** + * endDraggingFrame + * @param frame TODO + */ + public void endDraggingFrame(JComponent frame); + + /** + * beginResizingFrame + * @param frame TODO + * @param direction TODO + */ + public void beginResizingFrame(JComponent frame, int direction); + + /** + * resizeFrame + * @param frame TODO + * @param x TODO + * @param y TODO + * @param width TODO + * @param height TODO + */ + public void resizeFrame(JComponent frame, int x, int y, + int width, int height); + + /** + * endResizingFrame + * @param frame TODO + */ + public void endResizingFrame(JComponent frame); + + /** + * setBoundsForFrame + * @param frame TODO + * @param x TODO + * @param y TODO + * @param width TODO + * @param height TODO + */ + public void setBoundsForFrame(JComponent frame, int x, int y, + int width, int height); + + + } // DesktopManager diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/AncestorEvent.java gcc-3.3/libjava/javax/swing/event/AncestorEvent.java *** gcc-3.2.3/libjava/javax/swing/event/AncestorEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/AncestorEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,140 ---- + /* AncestorEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import javax.swing.*; + import java.awt.*; + + /** + * Ancestor Event + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public class AncestorEvent extends AWTEvent { + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * ANCESTOR_ADDED constant + */ + public static int ANCESTOR_ADDED = 0; + + /** + * ANCESTOR_MOVED constant + */ + public static int ANCESTOR_MOVED = 1; + + /** + * ANCESTOR_REMOVED constant + */ + public static int ANCESTOR_REMOVED = 2; + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * Source component + */ + private JComponent sourceComponent = null; + + /** + * Ancestor + */ + private Container ancestor = null; + + /** + * Ancestor Parent + */ + private Container ancestorParent = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AncestorEvent + * @param source Source component + * @param id ID + * @param ancestor ancestor + * @param ancestorParent parent ancestor + */ + public AncestorEvent(JComponent source, int id, Container ancestor, + Container ancestorParent) { + super(source, id); + this.sourceComponent = source; + this.ancestor = ancestor; + this.ancestorParent = ancestorParent; + } // AncestorEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Get ancestor + * @return ancestor + */ + public Container getAncestor() { + return ancestor; + } // getAncestor() + + /** + * Get ancestor parent + * @return ancestor parent + */ + public Container getAncestorParent() { + return ancestorParent; + } // getAncestorParent() + + /** + * Get component + * @return component + */ + public JComponent getComponent() { + return sourceComponent; + } // getComponent() + + + } // AncestorEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/AncestorListener.java gcc-3.3/libjava/javax/swing/event/AncestorListener.java *** gcc-3.2.3/libjava/javax/swing/event/AncestorListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/AncestorListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,69 ---- + /* AncestorListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * AncestorListener Interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface AncestorListener extends EventListener { + + /** + * Ancestor Added + * @param event Ancestor Event + */ + public void ancestorAdded(AncestorEvent event); + + /** + * Ancestor Removed + * @param event Ancestor Event + */ + public void ancestorRemoved(AncestorEvent event); + + /** + * Ancestor Moved + * @param event Ancestor Event + */ + public void ancestorMoved(AncestorEvent event); + + + } // AncestorListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/CaretEvent.java gcc-3.3/libjava/javax/swing/event/CaretEvent.java *** gcc-3.2.3/libjava/javax/swing/event/CaretEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/CaretEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,79 ---- + /* CaretEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + + /** + * CaretEvent + * @author Andrew Selkirk + */ + public abstract class CaretEvent extends EventObject { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * CaretEvent constructor + * @param source Source object + */ + public CaretEvent(Object source) { + super(source); + } // CaretEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Get caret location + * @returns the dot + */ + public abstract int getDot(); + + /** + * Get mark + * @returns the mark + */ + public abstract int getMark(); + + + } // CaretEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/CaretListener.java gcc-3.3/libjava/javax/swing/event/CaretListener.java *** gcc-3.2.3/libjava/javax/swing/event/CaretListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/CaretListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,56 ---- + /* CaretListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * CaretListener interface + * @author Andrew Selkirk + */ + public interface CaretListener extends EventListener { + + /** + * Caret position has been updated + * @param event Caret Event + */ + public void caretUpdate(CaretEvent event); + + + } // CaretListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/CellEditorListener.java gcc-3.3/libjava/javax/swing/event/CellEditorListener.java *** gcc-3.2.3/libjava/javax/swing/event/CellEditorListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/CellEditorListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* CellEditorListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * CellEditorListener interface + * @author Andrew Selkirk + */ + public interface CellEditorListener extends EventListener { + + /** + * Editing has been canceled + * @param event Change Event + */ + public void editingCanceled(ChangeEvent event); + + /** + * Editing has been stopped + * @param event Change Event + */ + public void editingStopped(ChangeEvent event); + + + } // CellEditorListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/ChangeEvent.java gcc-3.3/libjava/javax/swing/event/ChangeEvent.java *** gcc-3.2.3/libjava/javax/swing/event/ChangeEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/ChangeEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ChangeEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + + /** + * ChangeEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public class ChangeEvent extends EventObject { + + /** + * ChangeEvent constructor + * @param source Source object + */ + public ChangeEvent(Object source) { + super(source); + } // ChangeEvent() + + + } // ChangeEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/ChangeListener.java gcc-3.3/libjava/javax/swing/event/ChangeListener.java *** gcc-3.2.3/libjava/javax/swing/event/ChangeListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/ChangeListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* ChangeListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * ChangeListener interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface ChangeListener extends EventListener { + + /** + * State changed + * @param event Change Event + */ + public void stateChanged(ChangeEvent event); + + + } // ChangeListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/DocumentEvent.java gcc-3.3/libjava/javax/swing/event/DocumentEvent.java *** gcc-3.2.3/libjava/javax/swing/event/DocumentEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/DocumentEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,185 ---- + /* DocumentEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import javax.swing.text.*; + + /** + * DocumentEvent interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface DocumentEvent { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * ElementChange interface + */ + public static interface ElementChange { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getIndex + * @returns int + */ + public int getIndex(); + + /** + * getElement + * @returns Element + */ + public Element getElement(); + + /** + * getChildrenRemoved + * @returns Element[] + */ + public Element[] getChildrenRemoved(); + + /** + * getChildrenAdded + * @returns Element[] + */ + public Element[] getChildrenAdded(); + + + } // ElementChange + + /** + * EventType + */ + public static final class EventType { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * INSERT + */ + public static final EventType INSERT = new EventType("INSERT"); // TODO + + /** + * REMOVE + */ + public static final EventType REMOVE = new EventType("REMOVE"); // TODO + + /** + * CHANGE + */ + public static final EventType CHANGE = new EventType("CHANGE"); // TODO + + /** + * typeString + */ + private String type; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor EventType + * @param type TODO + */ + private EventType(String type) { + this.type = type; + } // EventType() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() { + return type; // TODO + } // toString() + + + } // EventType + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getType + * @returns EventType + */ + public EventType getType(); + + /** + * getOffset + * @returns int + */ + public int getOffset(); + + /** + * getLength + * @returns int + */ + public int getLength(); + + /** + * getDocument + * @returns Document + */ + public Document getDocument(); + + /** + * getChange + * @param element TODO + * @returns ElementChange + */ + public ElementChange getChange(Element element); + + + } // DocumentEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/DocumentListener.java gcc-3.3/libjava/javax/swing/event/DocumentListener.java *** gcc-3.2.3/libjava/javax/swing/event/DocumentListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/DocumentListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,68 ---- + /* DocumentListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + import java.util.EventListener; + + /** + * DocumentListener interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface DocumentListener extends EventListener { + + /** + * Changed update + * @param event Document Event + */ + public void changedUpdate(DocumentEvent event); + + /** + * Insert update + * @param event Document Event + */ + public void insertUpdate(DocumentEvent event); + + /** + * Remove update + * @param event Document Event + */ + public void removeUpdate(DocumentEvent event); + + + } // DocumentListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/EventListenerList.java gcc-3.3/libjava/javax/swing/event/EventListenerList.java *** gcc-3.2.3/libjava/javax/swing/event/EventListenerList.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/EventListenerList.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,241 ---- + /* EventListenerList.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.io.Serializable; + import java.util.EventListener; + + /** + * EventListenerList + * @author Andrew Selkirk + */ + public class EventListenerList extends Object + implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * Listener list + */ + protected Object[] listenerList = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * EventListenerList constructor + */ + public EventListenerList() { + listenerList = new Object[0]; + } // EventListenerList() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Add Listener + * @param t Class type + * @param listener Listener to add + */ + public void add(Class t, EventListener listener) { + + // Variables + Object[] list; + int index; + Class checkClass; + EventListener checkListener; + + // Create New list in anticipation that listener is not present + list = new Object[listenerList.length + 2]; + + // Search through list looking for listener + for (index = 0; index < listenerList.length; index += 2) { + checkClass = (Class) listenerList[index]; + checkListener = (EventListener) listenerList[index + 1]; + if (checkClass.equals(t) == true && + checkListener.equals(listener) == true) { + return; + } // if + } // for + + // Add Listener + list[listenerList.length] = t; + list[listenerList.length + 1] = listener; + + // Replace Listener List + listenerList = list; + + } // add() + + /** + * Get the total number of listeners + * @return Count of listeners + */ + public int getListenerCount() { + return (int) listenerList.length / 2; + } // getListenerCount + + /** + * Get the number of listeners of a particular type + * @param t Class type to count + * @returns Count of the specified listeners + */ + public int getListenerCount(Class t) { + + // Variables + int index; + int count; + String name; + + // Loop through entire list + count = 0; + name = t.getName(); + for (index = 0; index < listenerList.length; index += 2) { + if (((Class) listenerList[index]).getName().equals(name) == true) { + count += 1; + } + } // for: index + + // Return Count + return count; + + } // getListenerCount() + + /** + * Get a list of listenerType/listener pairs + * @returns Listener list + */ + public Object[] getListenerList() { + return listenerList; + } // getListenerList() + + /** + * Get list of listeners of a particular type + * @param c Class type + * @returns List of listeners of the specified type + */ + public EventListener[] getListeners(Class c) { + + // Variables + int count; + EventListener[] list; + String name; + int index; + + // Get count of listeners + count = getListenerCount(c); + + // Create Event Listener list + list = new EventListener[count]; + + // Construct List + count = 0; + name = c.getName(); + for (index = 0; index < listenerList.length; index += 2) { + if (((Class) listenerList[index]).getName().equals(name) == true) { + list[count] = (EventListener) listenerList[index]; + count += 1; + } // if + } // for: index + + // Return List + return list; + + } // getListeners() + + /** + * Remove a listener + * @param t Class type + * @param listener Listener to be removed + */ + public void remove(Class t, EventListener listener) { + + // Variables + Object[] list; + int index; + Class checkClass; + EventListener checkListener; + int pointer; + boolean found; + + // Create New list in anticipation that listener is not present + if (listenerList.length == 0) { + return; + } // if + list = new Object[listenerList.length - 2]; + + // Search through list looking for listener + pointer = 0; + found = false; + for (index = 0; index < listenerList.length - 2; index += 2) { + checkClass = (Class) listenerList[index]; + checkListener = (EventListener) listenerList[index + 1]; + if (checkClass.equals(t) == false || + checkListener.equals(listener) == false) { + list[pointer] = checkClass; + list[pointer + 1] = checkListener; + pointer += 2; + } else { + found = true; + } // if + } // for + + // Replace Listener List + if (found == true) { + listenerList = list; + } // if + + } // remove() + + /** + * Get a string representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + + } // EventListenerList diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/HyperlinkEvent.java gcc-3.3/libjava/javax/swing/event/HyperlinkEvent.java *** gcc-3.2.3/libjava/javax/swing/event/HyperlinkEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/HyperlinkEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,195 ---- + /* HyperlinkEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.net.*; + import java.util.*; + + /** + * HyperlinkEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public class HyperlinkEvent extends EventObject { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * EventType + */ + public static final class EventType { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * ENTERED + */ + public static final EventType ENTERED = new EventType("ENTERED"); // TODO + + /** + * EXITED + */ + public static final EventType EXITED = new EventType("EXITED"); // TODO + + /** + * ACTIVATED + */ + public static final EventType ACTIVATED = new EventType("ACTIVATED"); // TODO + + /** + * type + */ + private String type; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor EventType + * @param type TODO + */ + private EventType(String type) { + this.type = type; + } // EventType() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() { + return type; // TODO + } // toString() + + + } // EventType + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * type + */ + private EventType type; + + /** + * url + */ + private URL url; + + /** + * description + */ + private String description; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor HyperlinkEvent + * @param source TODO + * @param type TODO + * @param url TODO + */ + public HyperlinkEvent(Object source, EventType type, URL url) { + super(source); + this.type = type; + this.url = url; + this.description = null; + } // HyperlinkEvent() + + /** + * Constructor HyperlinkEvent + * @param source TODO + * @param type TODO + * @param url TODO + * @param description TODO + */ + public HyperlinkEvent(Object source, EventType type, URL url, String description) { + super(source); + this.type = type; + this.url = url; + this.description = null; + } // HyperlinkEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getURL + * @returns URL + */ + public URL getURL() { + return url; + } // getURL() + + /** + * getEventType + * @returns EventType + */ + public EventType getEventType() { + return type; + } // getEventType() + + /** + * getDescription + * @returns String + */ + public String getDescription() { + return description; + } // getDescription() + + + } // HyperlinkEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/HyperlinkListener.java gcc-3.3/libjava/javax/swing/event/HyperlinkListener.java *** gcc-3.2.3/libjava/javax/swing/event/HyperlinkListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/HyperlinkListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* HyperlinkListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * HyperlinkListener + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface HyperlinkListener extends EventListener { + + /** + * Hyperlink updated + * @param event Hyperlink Event + */ + public void hyperlinkUpdate(HyperlinkEvent event); + + + } // HyperlinkListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/InternalFrameAdapter.java gcc-3.3/libjava/javax/swing/event/InternalFrameAdapter.java *** gcc-3.2.3/libjava/javax/swing/event/InternalFrameAdapter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/InternalFrameAdapter.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,112 ---- + /* InternalFrameAdapter.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + /** + * InternalFrameAdapter + * @author Andrew Selkirk + */ + public class InternalFrameAdapter extends Object + implements InternalFrameListener { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * InternalFrameAdapter constructor + */ + public InternalFrameAdapter() { + } // InternalFrameAdapter() + + + //------------------------------------------------------------- + // Interface: InternalFrameListener --------------------------- + //------------------------------------------------------------- + + /** + * Internal frame activated + * @param event Internal frame event + */ + public void internalFrameActivated(InternalFrameEvent event) { + } // internalFrameActivated() + + /** + * Internal frame closed + * @param event Internal frame event + */ + public void internalFrameClosed(InternalFrameEvent event) { + } // internalFrameClosed() + + /** + * Internal frame closing + * @param event Internal frame event + */ + public void internalFrameClosing(InternalFrameEvent event) { + } // internalFrameClosing() + + /** + * Internal frame deactivated + * @param event Internal frame event + */ + public void internalFrameDeactivated(InternalFrameEvent event) { + } // internalFrameDeactivated() + + /** + * Internal frame deiconified + * @param event Internal frame event + */ + public void internalFrameDeiconified(InternalFrameEvent event) { + } // internalFrameDeiconified() + + /** + * Internal frame iconified + * @param event Internal frame event + */ + public void internalFrameIconified(InternalFrameEvent event) { + } // internalFrameIconified() + + /** + * Internal frame opened + * @param event Internal frame event + */ + public void internalFrameOpened(InternalFrameEvent event) { + } // internalFrameOpened() + + + } // InternalFrameAdapter diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/InternalFrameEvent.java gcc-3.3/libjava/javax/swing/event/InternalFrameEvent.java *** gcc-3.2.3/libjava/javax/swing/event/InternalFrameEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/InternalFrameEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,114 ---- + /* InternalFrameEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.awt.AWTEvent; + import javax.swing.JInternalFrame; + + /** + * InternalFrameEvent + * @author Andrew Selkirk + */ + public class InternalFrameEvent extends AWTEvent { + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * Internal frame activated event + */ + public static int INTERNAL_FRAME_ACTIVATED = 25554; + + /** + * Internal frame closed event + */ + public static int INTERNAL_FRAME_CLOSED = 25551; + + /** + * Internal frame closing event + */ + public static int INTERNAL_FRAME_CLOSING = 25550; + + /** + * Internal frame deactivated event + */ + public static int INTERNAL_FRAME_DEACTIVATED = 25555; + + /** + * Internal frame deiconifed event + */ + public static int INTERNAL_FRAME_DEICONIFIED = 25553; + + /** + * Internal frame frame first event + */ + public static int INTERNAL_FRAME_FIRST = 25549; + + /** + * Internal frame iconified event + */ + public static int INTERNAL_FRAME_ICONIFIED = 2552; + + /** + * Internal frame last event + */ + public static int INTERNAL_FRAME_LAST = 25555; + + /** + * Internal frame opened event + */ + public static int INTERNAL_FRAME_OPENED = 25550; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor InternalFrameEvent + * @param source JInternalFrame + * @param id Event ID + */ + public InternalFrameEvent(JInternalFrame source, int id) { + super(source, id); + } // InternalFrameEvent() + + + } // InternalFrameEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/InternalFrameListener.java gcc-3.3/libjava/javax/swing/event/InternalFrameListener.java *** gcc-3.2.3/libjava/javax/swing/event/InternalFrameListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/InternalFrameListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,92 ---- + /* InternalFrameListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * InternalFrameListener interface + * @author Andrew Selkirk + */ + public interface InternalFrameListener extends EventListener { + + /** + * Internal frame activated + * @param event Internal Frame Event + */ + public void internalFrameActivated(InternalFrameEvent event); + + /** + * Internal frame closed + * @param event Internal Frame Event + */ + public void internalFrameClosed(InternalFrameEvent event); + + /** + * Internal frame closing + * @param event Internal Frame Event + */ + public void internalFrameClosing(InternalFrameEvent event); + + /** + * Internal frame deactivated + * @param event Internal Frame Event + */ + public void internalFrameDeactivated(InternalFrameEvent event); + + /** + * Internal frame deiconified + * @param event Internal Frame Event + */ + public void internalFrameDeiconified(InternalFrameEvent event); + + /** + * Internal frame iconified + * @param event Internal Frame Event + */ + public void internalFrameIconified(InternalFrameEvent event); + + /** + * Internal frame opened + * @param event Internal Frame Event + */ + public void internalFrameOpened(InternalFrameEvent event); + + + } // InternalFrameListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/ListDataEvent.java gcc-3.3/libjava/javax/swing/event/ListDataEvent.java *** gcc-3.2.3/libjava/javax/swing/event/ListDataEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/ListDataEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,139 ---- + /* ListDataEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + + /** + * ListDataEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public class ListDataEvent extends EventObject { + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * Contents changed + */ + public static int CONTENTS_CHANGED = 0; + + /** + * Internal added + */ + public static int INTERVAL_ADDED = 1; + + /** + * Interval removed + */ + public static int INTERVAL_REMOVED = 2; + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * type + */ + private int type = 0; + + /** + * index0 + */ + private int index0 = 0; + + /** + * index1 + */ + private int index1 = 0; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ListDataEvent + * @param source Source + * @param type Event type + * @param index0 Bottom of range + * @param index1 Top of range + */ + public ListDataEvent(Object source, int type, + int index0, int index1) { + super(source); + this.type = type; + this.index0 = index0; + this.index1 = index1; + } // ListDataEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getIndex0 + * @returns index0 + */ + public int getIndex0() { + return index0; + } // getIndex0() + + /** + * getIndex1 + * @returns index1 + */ + public int getIndex1() { + return index1; + } // getIndex1() + + /** + * Event type + * @returns Event type + */ + public int getType() { + return type; + } // getType() + + + } // ListDataEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/ListDataListener.java gcc-3.3/libjava/javax/swing/event/ListDataListener.java *** gcc-3.2.3/libjava/javax/swing/event/ListDataListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/ListDataListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,69 ---- + /* ListDataListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * ListDataListener interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface ListDataListener extends EventListener { + + /** + * Contents Changed + * @param event ListDataEvent Event + */ + public void contentsChanged(ListDataEvent event); + + /** + * Interval Added + * @param event ListDataEvent Event + */ + public void intervalAdded(ListDataEvent event); + + /** + * Interval Removed + * @param event ListDataEvent Event + */ + public void intervalRemoved(ListDataEvent event); + + + } // ListDataListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/ListSelectionEvent.java gcc-3.3/libjava/javax/swing/event/ListSelectionEvent.java *** gcc-3.2.3/libjava/javax/swing/event/ListSelectionEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/ListSelectionEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,126 ---- + /* ListSelectionEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + + /** + * ListSelectionEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public class ListSelectionEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * firstIndex + */ + private int firstIndex = 0; + + /** + * lastIndex + */ + private int lastIndex = 0; + + /** + * isAdjusting + */ + private boolean isAdjusting = false; + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ListSelectionEvent + * @param source Source + * @param firstIndex First index + * @param lastIndex Last index + * @param isAdjusting Is Adjusting? + */ + public ListSelectionEvent(Object source, int firstIndex, + int lastIndex, boolean isAdjusting) { + super(source); + this.firstIndex = firstIndex; + this.lastIndex = lastIndex; + this.isAdjusting = isAdjusting; + } // ListSelectionEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getFirstIndex + * @returns firstIndex + */ + public int getFirstIndex() { + return firstIndex; + } // getFirstIndex() + + /** + * getLastIndex + * @returns lastIndex + */ + public int getLastIndex() { + return lastIndex; + } // getLastIndex() + + /** + * getValueIsAdjusting + * @returns isAdjusting + */ + public boolean getValueIsAdjusting() { + return isAdjusting; + } // getValueIsAdjusting() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + + } // ListSelectionEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/ListSelectionListener.java gcc-3.3/libjava/javax/swing/event/ListSelectionListener.java *** gcc-3.2.3/libjava/javax/swing/event/ListSelectionListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/ListSelectionListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* ListSelectionListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * ListSelectionListener interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface ListSelectionListener extends EventListener { + + /** + * Value changed + * @param event List Selection Event + */ + public void valueChanged(ListSelectionEvent event); + + + } // ListSelectionListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MenuDragMouseEvent.java gcc-3.3/libjava/javax/swing/event/MenuDragMouseEvent.java *** gcc-3.2.3/libjava/javax/swing/event/MenuDragMouseEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MenuDragMouseEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,114 ---- + /* MenuDragMouseEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.awt.event.MouseEvent; + import java.awt.Component; + import javax.swing.MenuElement; + import javax.swing.MenuSelectionManager; + + /** + * MenuDragMouseEvent + * @author Andrew Selkirk + */ + public class MenuDragMouseEvent extends MouseEvent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * path + */ + private MenuElement[] path = null; + + /** + * manager + */ + private MenuSelectionManager manager = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor MenuDragMouseEvent + * @param source Source + * @param id MouseEvent type + * @param when Time + * @param modifiers Key modifiers + * @param x Horizontal position + * @param y Vertical position + * @param clickCount Click count + * @param popupTrigger Popup trigger? + * @param path Path + * @param manager MenuSelectionManager + */ + public MenuDragMouseEvent(Component source, int id, long when, int modifiers, + int x, int y, int clickCount, boolean popupTrigger, + MenuElement[] path, MenuSelectionManager manager) { + super(source, id, when, modifiers, x, y, clickCount, popupTrigger); + this.path = path; + this.manager = manager; + } // MenuDragMouseEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Get path + * @returns path + */ + public MenuElement[] getPath() { + return path; + } // getPath() + + /** + * Get menu selection manager + * @returns manager + */ + public MenuSelectionManager getMenuSelectionManager() { + return manager; + } // getMenuSelectionManager() + + + } // MenuDragMouseEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MenuDragMouseListener.java gcc-3.3/libjava/javax/swing/event/MenuDragMouseListener.java *** gcc-3.2.3/libjava/javax/swing/event/MenuDragMouseListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MenuDragMouseListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,74 ---- + /* MenuDragMouseListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * MenuDragMouseListener interface + * @author Andrew Selkirk + */ + public interface MenuDragMouseListener extends EventListener { + + /** + * Menu drag mouse dragged + * @param event Menu Drag Mouse Event + */ + public void menuDragMouseDragged(MenuDragMouseEvent event); + + /** + * Menu drag mouse entered + * @param event Menu Drag Mouse Event + */ + public void menuDragMouseEntered(MenuDragMouseEvent event); + + /** + * Menu drag mouse exited + * @param event Menu Drag Mouse Event + */ + public void menuDragMouseExited(MenuDragMouseEvent event); + + /** + * Menu drag mouse released + * @param event Menu Drag Mouse Event + */ + public void menuDragMouseReleased(MenuDragMouseEvent event); + + + } // MenuDragMouseListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MenuEvent.java gcc-3.3/libjava/javax/swing/event/MenuEvent.java *** gcc-3.2.3/libjava/javax/swing/event/MenuEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MenuEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* MenuEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + + /** + * MenuEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public class MenuEvent extends EventObject { + + /** + * Constructor MenuEvent + * @param source Source object + */ + public MenuEvent(Object source) { + super(source); + } // MenuEvent() + + + } // MenuEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MenuKeyEvent.java gcc-3.3/libjava/javax/swing/event/MenuKeyEvent.java *** gcc-3.2.3/libjava/javax/swing/event/MenuKeyEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MenuKeyEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,112 ---- + /* MenuKeyEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.awt.Component; + import java.awt.event.KeyEvent; + import javax.swing.MenuElement; + import javax.swing.MenuSelectionManager; + + /** + * MenuKeyEvent + * @author Andrew Selkirk + */ + public class MenuKeyEvent extends KeyEvent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * path + */ + private MenuElement[] path = null; + + /** + * manager + */ + private MenuSelectionManager manager = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor MenuKeyEvent + * @param source Source + * @param id KeyEvent ID + * @param when Time + * @param modifiers Modifier keys + * @param keyCode Key code + * @param keyhar Key char + * @param path Path + * @param manager MenuSelectionManager + */ + public MenuKeyEvent(Component source, int id, long when, int modifiers, + int keyCode, char keyChar, MenuElement[] path, + MenuSelectionManager manager) { + super(source, id, when, modifiers, keyCode, keyChar); + this.path = path; + this.manager = manager; + } // MenuKeyEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getPath + * @returns path + */ + public MenuElement[] getPath() { + return path; + } // getPath() + + /** + * getMenuSelectionManager + * @returns MenuSelectionManager + */ + public MenuSelectionManager getMenuSelectionManager() { + return manager; + } // getMenuSelectionManager() + + + } // MenuKeyEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MenuKeyListener.java gcc-3.3/libjava/javax/swing/event/MenuKeyListener.java *** gcc-3.2.3/libjava/javax/swing/event/MenuKeyListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MenuKeyListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,68 ---- + /* MenuKeyListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * MenuKeyListener interface + * @author Andrew Selkirk + */ + public interface MenuKeyListener extends EventListener { + + /** + * Menu key pressed + * @param event Menu Key Event + */ + public void menuKeyPressed(MenuKeyEvent event); + + /** + * Menu key released + * @param event Menu Key Event + */ + public void menuKeyReleased(MenuKeyEvent event); + + /** + * Menu key typed + * @param event Menu Key Event + */ + public void menuKeyTyped(MenuKeyEvent event); + + + } // MenuKeyListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MenuListener.java gcc-3.3/libjava/javax/swing/event/MenuListener.java *** gcc-3.2.3/libjava/javax/swing/event/MenuListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MenuListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,68 ---- + /* MenuListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * MenuListener interface + * @author Andrew Selkirk + */ + public interface MenuListener extends EventListener { + + /** + * Menu canceled + * @param event Menu Event + */ + public void menuCanceled(MenuEvent event); + + /** + * Menu deselected + * @param event Menu Event + */ + public void menuDeselected(MenuEvent event); + + /** + * Menu selected + * @param event Menu Event + */ + public void menuSelected(MenuEvent event); + + + } // MenuListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MouseInputAdapter.java gcc-3.3/libjava/javax/swing/event/MouseInputAdapter.java *** gcc-3.2.3/libjava/javax/swing/event/MouseInputAdapter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MouseInputAdapter.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,115 ---- + /* MouseInputAdapter.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.awt.event.MouseEvent; + + /** + * MouseInputAdapter + * @author Andrew Selkirk + */ + public class MouseInputAdapter extends Object + implements MouseInputListener { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor MouseInputAdapter + */ + public MouseInputAdapter() { + } // MouseInputAdapter() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Mouse clicked + * @param event Mouse event + */ + public void mouseClicked(MouseEvent event) { + } // mouseClicked() + + /** + * Mouse dragged + * @param event Mouse event + */ + public void mouseDragged(MouseEvent event) { + } // mouseDragged() + + /** + * Mouse entered + * @param event Mouse event + */ + public void mouseEntered(MouseEvent event) { + } // mouseEntered() + + /** + * Mouse exited + * @param event Mouse event + */ + public void mouseExited(MouseEvent event) { + } // mouseExited() + + /** + * Mouse moved + * @param event Mouse event + */ + public void mouseMoved(MouseEvent event) { + } // mouseMoved() + + /** + * Mouse pressed + * @param event Mouse event + */ + public void mousePressed(MouseEvent event) { + } // mousePressed() + + /** + * Mouse released + * @param event Mouse event + */ + public void mouseReleased(MouseEvent event) { + } // mouseReleased() + + + } // MouseInputAdapterEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/MouseInputListener.java gcc-3.3/libjava/javax/swing/event/MouseInputListener.java *** gcc-3.2.3/libjava/javax/swing/event/MouseInputListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/MouseInputListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + /* MouseInputListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.awt.event.MouseListener; + import java.awt.event.MouseMotionListener; + + /** + * MouseInputListener interface + * @author Andrew Selkirk + */ + public interface MouseInputListener extends MouseListener, + MouseMotionListener { + + } // MouseInputListener + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/PopupMenuEvent.java gcc-3.3/libjava/javax/swing/event/PopupMenuEvent.java *** gcc-3.2.3/libjava/javax/swing/event/PopupMenuEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/PopupMenuEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,58 ---- + /* PopupMenuEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + + /** + * PopupMenuEvent + * @author Andrew Selkirk + */ + public class PopupMenuEvent extends EventObject { + + /** + * Constructor PopupMenuEvent + * @param source Source + */ + public PopupMenuEvent(Object source) { + super(source); + } // PopupMenuEvent() + + + } // PopupMenuEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/PopupMenuListener.java gcc-3.3/libjava/javax/swing/event/PopupMenuListener.java *** gcc-3.2.3/libjava/javax/swing/event/PopupMenuListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/PopupMenuListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,68 ---- + /* PopupMenuListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * PopupMenuListener interface + * @author Andrew Selkirk + */ + public interface PopupMenuListener extends EventListener { + + /** + * Popup Menu Canceled + * @param event Popup Menu Event + */ + public void popupMenuCanceled(PopupMenuEvent event); + + /** + * Popup Menu will become invisible + * @param event Popup Menu Event + */ + public void popupMenuWillBecomeInvisible(PopupMenuEvent event); + + /** + * Popup Menu will become visible + * @param event Popup Menu Event + */ + public void popupMenuWillBecomeVisible(PopupMenuEvent event); + + + } // PopupMenuListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/SwingPropertyChangeSupport.java gcc-3.3/libjava/javax/swing/event/SwingPropertyChangeSupport.java *** gcc-3.2.3/libjava/javax/swing/event/SwingPropertyChangeSupport.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/SwingPropertyChangeSupport.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,248 ---- + /* SwingPropertyChangeSupport.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.beans.*; + import java.io.*; + import java.util.*; + + /** + * SwingPropertyChangeSupport + * @author Andrew Selkirk + */ + public final class SwingPropertyChangeSupport + extends PropertyChangeSupport { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * listeners + */ + private transient EventListenerList listeners; + + /** + * propertyListeners + */ + private Hashtable propertyListeners; + + /** + * source + */ + private Object source; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor SwingPropertyChangeSupport + * @param source TODO + */ + public SwingPropertyChangeSupport(Object source) { + super(source); + this.source = source; + this.listeners = new EventListenerList(); + this.propertyListeners = new Hashtable(); + } // SwingPropertyChangeSupport() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * readObject + * @param stream TODO + * @exception ClassNotFoundException TODO + * @exception IOException TODO + */ + private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException { + // TODO + } // readObject() + + /** + * addPropertyChangeListener + * @param listener TODO + */ + public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { + listeners.add(PropertyChangeListener.class, listener); + } // addPropertyChangeListener() + + /** + * addPropertyChangeListener + * @param propertyName TODO + * @param listener TODO + */ + public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + + // Variables + EventListenerList list; + + // Get Listener list + list = (EventListenerList) propertyListeners.get(propertyName); + if (list == null) { + list = new EventListenerList(); + propertyListeners.put(propertyName, list); + } // if + + // Add Listeners + list.add(PropertyChangeListener.class, listener); + + } // addPropertyChangeListener() + + /** + * removePropertyChangeListener + * @param listener TODO + */ + public synchronized void removePropertyChangeListener(PropertyChangeListener listener) { + listeners.remove(PropertyChangeListener.class, listener); + } // removePropertyChangeListener() + + /** + * removePropertyChangeListener + * @param propertyName TODO + * @param listener TODO + */ + public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + + // Variables + EventListenerList list; + + // Get Listener list + list = (EventListenerList) propertyListeners.get(propertyName); + if (list == null) { + return; + } // if + + // Remove Listeners + list.remove(PropertyChangeListener.class, listener); + + // Clean up propertyListeners + if (list.getListenerCount() == 0) { + propertyListeners.remove(propertyName); + } // if + + } // removePropertyChangeListener() + + /** + * firePropertyChange + * @param propertyName TODO + * @param oldValue TODO + * @param newValue TODO + */ + public void firePropertyChange(String propertyName, Object oldValue, Object newValue) { + + // Variables + PropertyChangeEvent event; + + // Create Property Change Event + event = new PropertyChangeEvent(source, propertyName, oldValue, newValue); + + // Fire Event + firePropertyChange(event); + + } // firePropertyChange() + + /** + * firePropertyChange + * @param event TODO + */ + public void firePropertyChange(PropertyChangeEvent event) { + + // Variables + EventListenerList list; + EventListener[] listenerList; + int index; + PropertyChangeListener listener; + + // Check Values if they are equal + if (event.getOldValue() == null || event.getNewValue() == null || + event.getOldValue().equals(event.getNewValue()) == true) { + return; + } // if + + // Process Main Listener List + listenerList = listeners.getListeners(PropertyChangeListener.class); + for (index = 0; index < listenerList.length; index++) { + listener = (PropertyChangeListener) listenerList[index]; + listener.propertyChange(event); + } // for + + // Process Property Listener List + list = (EventListenerList) propertyListeners.get(event.getPropertyName()); + if (list != null) { + listenerList = list.getListeners(PropertyChangeListener.class); + for (index = 0; index < listenerList.length; index++) { + listener = (PropertyChangeListener) listenerList[index]; + listener.propertyChange(event); + } // for + } // if + + } // firePropertyChange() + + /** + * hasListeners + * @param propertyName TODO + * @returns boolean + */ + public synchronized boolean hasListeners(String propertyName) { + + // Get Listener list + if (propertyListeners.get(propertyName) == null) { + return false; + } // if + + return true; + + } // hasListeners() + + + } // SwingPropertyChangeSupport diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TableColumnModelEvent.java gcc-3.3/libjava/javax/swing/event/TableColumnModelEvent.java *** gcc-3.2.3/libjava/javax/swing/event/TableColumnModelEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TableColumnModelEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,104 ---- + /* TableColumnModelEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + import javax.swing.table.TableColumnModel; + + /** + * TableColumnModelEvent + * @author Andrew Selkirk + */ + public class TableColumnModelEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * fromIndex + */ + protected int fromIndex = 0; + + /** + * toIndex + */ + protected int toIndex = 0; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TableColumnModelEvent + * @param source Source TableColumnModel + * @param from From index + * @param to To index + */ + public TableColumnModelEvent(TableColumnModel source, + int from, int to) { + super(source); + fromIndex = from; + toIndex = to; + } // TableColumnModelEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getFromIndex. + * @returns From index + */ + public int getFromIndex() { + return fromIndex; + } // getFromIndex() + + /** + * getToIndex. + * @returns To index + */ + public int getToIndex() { + return toIndex; + } // getToIndex() + + + } // TableColumnModelEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TableColumnModelListener.java gcc-3.3/libjava/javax/swing/event/TableColumnModelListener.java *** gcc-3.2.3/libjava/javax/swing/event/TableColumnModelListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TableColumnModelListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,80 ---- + /* TableColumnModelListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * TableColumnModelListener interface + * @author Andrew Selkirk + */ + public interface TableColumnModelListener extends EventListener { + + /** + * Column added + * @param event Table Column Model Event + */ + public void columnAdded(TableColumnModelEvent event); + + /** + * Column margin changed + * @param event Change Event + */ + public void columnMarginChanged(ChangeEvent event); + + /** + * Column moved + * @param event Table Column Model Event + */ + public void columnMoved(TableColumnModelEvent event); + + /** + * Column removed + * @param event Table Column Model Event + */ + public void columnRemoved(TableColumnModelEvent event); + + /** + * Column selection changed + * @param event List Selection Event + */ + public void columnSelectionChanged(ListSelectionEvent event); + + + } // TableColumnModelListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TableModelEvent.java gcc-3.3/libjava/javax/swing/event/TableModelEvent.java *** gcc-3.2.3/libjava/javax/swing/event/TableModelEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TableModelEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,204 ---- + /* TableModelEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + import javax.swing.table.TableModel; + + /** + * TableModelEvent + * @author Andrew Selkirk + */ + public class TableModelEvent extends EventObject { + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * ALL_COLUMNS + */ + public static int ALL_COLUMNS = -1; + + /** + * DELETE + */ + public static int DELETE = -1; + + /** + * HEADER_ROW + */ + public static int HEADER_ROW = -1; + + /** + * INSERT + */ + public static int INSERT = 1; + + /** + * UPDATE + */ + public static int UPDATE = 0; + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * column + */ + protected int column = 0; + + /** + * firstRow + */ + protected int firstRow = 0; + + /** + * lastRow + */ + protected int lastRow = 0; + + /** + * type + */ + protected int type = 0; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TableModelEvent + * @param source Source object + */ + public TableModelEvent(TableModel source) { + this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE); + } // TableModelEvent() + + /** + * Constructor TableModelEvent + * @param source Source table model + * @param row Updated row + */ + public TableModelEvent(TableModel source, int row) { + this(source, row, row, ALL_COLUMNS, UPDATE); + } // TableModelEvent() + + /** + * Constructor TableModelEvent + * @param source Source table model + * @param firstRow First row of update + * @param lastRow Last row of update + */ + public TableModelEvent(TableModel source, int firstRow, + int lastRow) { + this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE); + } // TableModelEvent() + + /** + * Constructor TableModelEvent + * @param source Source table model + * @param firstRow First row of update + * @param lastRow Last row of update + * @param column Affected column + */ + public TableModelEvent(TableModel source, int firstRow, + int lastRow, int column) { + this(source, firstRow, lastRow, column, UPDATE); + } // TableModelEvent() + + /** + * Constructor TableModelEvent + * @param source Source table model + * @param firstRow First row of update + * @param lastRow Last row of update + * @param column Affected column + * @param type Type of change + */ + public TableModelEvent(TableModel source, int firstRow, + int lastRow, int column, int type) { + super(source); + this.firstRow = firstRow; + this.lastRow = lastRow; + this.column = column; + this.type = type; + } // TableModelEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getColumn + * @returns column + */ + public int getColumn() { + return column; + } // getColumn() + + /** + * getFirstRow + * @returns row + */ + public int getFirstRow() { + return firstRow; + } // getFirstRow() + + /** + * getLastRow + * @returns row + */ + public int getLastRow() { + return lastRow; + } // getLastRow() + + /** + * Get type + * @returns Type of event + */ + public int getType() { + return type; + } // getType() + + + } // TableModelEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TableModelListener.java gcc-3.3/libjava/javax/swing/event/TableModelListener.java *** gcc-3.2.3/libjava/javax/swing/event/TableModelListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TableModelListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* TableModelListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + import java.util.EventListener; + + /** + * TableModelListener interface + * @author Andrew Selkirk + */ + public interface TableModelListener extends EventListener { + + /** + * Table changed + * @param event Table Model Event + */ + public void tableChanged(TableModelEvent event); + + + } // TableModelListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TreeExpansionEvent.java gcc-3.3/libjava/javax/swing/event/TreeExpansionEvent.java *** gcc-3.2.3/libjava/javax/swing/event/TreeExpansionEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TreeExpansionEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,88 ---- + /* TreeExpansionEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + import javax.swing.tree.TreePath; + + /** + * TreeExpansionEvent + * @author Andrew Selkirk + */ + public class TreeExpansionEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * path + */ + protected TreePath path = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TreeExpansionEvent + * @param source Source object + * @param path Path + */ + public TreeExpansionEvent(Object source, TreePath path) { + super(source); + this.path = path; + } // TreeExpansionEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getPath + * @returns Tree path + */ + public TreePath getPath() { + return path; + } // getPath() + + + } // TreeExpansionEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TreeExpansionListener.java gcc-3.3/libjava/javax/swing/event/TreeExpansionListener.java *** gcc-3.2.3/libjava/javax/swing/event/TreeExpansionListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TreeExpansionListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* TreeExpansionListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * TreeExpansionListener interface + * @author Andrew Selkirk + */ + public interface TreeExpansionListener extends EventListener { + + /** + * Tree collapsed + * @param event Tree Expansion Event + */ + public void treeCollapsed(TreeExpansionEvent event); + + /** + * Tree expanded + * @param event Tree Expansion Event + */ + public void treeExpanded(TreeExpansionEvent event); + + + } // TreeExpansionListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TreeModelEvent.java gcc-3.3/libjava/javax/swing/event/TreeModelEvent.java *** gcc-3.2.3/libjava/javax/swing/event/TreeModelEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TreeModelEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,170 ---- + /* TreeModelEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventObject; + import javax.swing.tree.TreePath; + + /** + * TreeModelEvent + * @author Andrew Selkirk + */ + public class TreeModelEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * childIndices + */ + protected int[] childIndices = new int[0]; + + /** + * children + */ + protected Object[] children = new Object[0]; + + /** + * path + */ + protected TreePath path = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path + */ + public TreeModelEvent(Object source, Object[] path) { + super(source); + this.path = new TreePath(path); + } // TreeModelEvent() + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path path + * @param childIndices Child indices + * @param children Children + */ + public TreeModelEvent(Object source, Object[] path, + int[] childIndices, Object[] children) { + super(source); + this.path = new TreePath(path); + this.childIndices = childIndices; + this.children = children; + } // TreeModelEvent() + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path Path + */ + public TreeModelEvent(Object source, TreePath path) { + super(source); + this.path = path; + } // TreeModelEvent() + + /** + * Constructor TreeModelEvent + * @param source Source object + * @param path Path + * @param childIndices Child indices + * @param children Children + */ + public TreeModelEvent(Object source, TreePath path, + int[] childIndices, Object[] children) { + super(source); + this.path = path; + this.childIndices = childIndices; + this.children = children; + } // TreeModelEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getChildIndices + * @returns child indices + */ + public int[] getChildIndices() { + return childIndices; + } // getChildIndices() + + /** + * getChildren + * @returns children + */ + public Object[] getChildren() { + return children; + } // getChildren() + + /** + * getPath + * @returns path + */ + public Object[] getPath() { + return path.getPath(); + } // getPath() + + /** + * getTreePath + * @returns TreePath + */ + public TreePath getTreePath() { + return path; + } // getTreePath() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + + } // TreeModelEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TreeModelListener.java gcc-3.3/libjava/javax/swing/event/TreeModelListener.java *** gcc-3.2.3/libjava/javax/swing/event/TreeModelListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TreeModelListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,74 ---- + /* TreeModelListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * TreeModelListener interface + * @author Andrew Selkirk + */ + public interface TreeModelListener extends EventListener { + + /** + * Tree nodes changed + * @param event Tree Model Event + */ + public void treeNodesChanged(TreeModelEvent event); + + /** + * Tree nodes inserted + * @param event Tree Model Event + */ + public void treeNodesInserted(TreeModelEvent event); + + /** + * Tree nodes removed + * @param event Tree Model Event + */ + public void treeNodesRemoved(TreeModelEvent event); + + /** + * Tree structured changed + * @param event Tree Model Event + */ + public void treeStructureChanged(TreeModelEvent event); + + + } // TreeModelListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TreeSelectionEvent.java gcc-3.3/libjava/javax/swing/event/TreeSelectionEvent.java *** gcc-3.2.3/libjava/javax/swing/event/TreeSelectionEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TreeSelectionEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,189 ---- + /* TreeSelectionEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.*; + import javax.swing.tree.*; + + /** + * TreeSelectionEvent + * @author Andrew Selkirk + * @version 1.0 + */ + public class TreeSelectionEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * paths + */ + protected TreePath[] paths; + + /** + * areNew + */ + protected boolean[] areNew; + + /** + * oldLeadSelectionPath + */ + protected TreePath oldLeadSelectionPath; + + /** + * newLeadSelectionPath + */ + protected TreePath newLeadSelectionPath; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TreeSelectionEvent + * @param source TODO + * @param paths TODO + * @param areNew TODO + * @param oldLeadSelectionPath TODO + * @param newLeadSelectionPath TODO + */ + public TreeSelectionEvent(Object source, TreePath[] paths, + boolean[] areNew, TreePath oldLeadSelectionPath, + TreePath newLeadSelectionPath) { + super(source); + this.paths = paths; + this.areNew = areNew; + this.oldLeadSelectionPath = oldLeadSelectionPath; + this.newLeadSelectionPath = newLeadSelectionPath; + } // TreeSelectionEvent() + + /** + * Constructor TreeSelectionEvent + * @param source TODO + * @param paths TODO + * @param areNew TODO + * @param oldLeadSelectionPath TODO + * @param newLeadSelectionPath TODO + */ + public TreeSelectionEvent(Object source, TreePath path, + boolean isNew, TreePath oldLeadSelectionPath, + TreePath newLeadSelectionPath) { + super(source); + //TODO this.paths = new TreePath[1]{path}; + //TODO this.areNew = new boolean[1]{isNew}; + this.oldLeadSelectionPath = oldLeadSelectionPath; + this.newLeadSelectionPath = newLeadSelectionPath; + } // TreeSelectionEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getPath + * @returns TreePath + */ + public TreePath getPath() { + return paths[0]; + } // getPath() + + /** + * getPaths + * @returns TreePath[] + */ + public TreePath[] getPaths() { + return paths; + } // getPaths() + + /** + * isAddedPath + * @returns boolean + */ + public boolean isAddedPath() { + return false; // TODO + } // isAddedPath() + + /** + * isAddedPath + * @param path TODO + * @returns boolean + */ + public boolean isAddedPath(TreePath path) { + return false; // TODO + } // isAddedPath() + + /** + * isAddedPath + * @param index TODO + * @returns boolean + */ + public boolean isAddedPath(int index) { + return false; // TODO + } // isAddedPath() + + /** + * getOldLeadSelectionPath + * @returns TreePath + */ + public TreePath getOldLeadSelectionPath() { + return oldLeadSelectionPath; + } // getOldLeadSelectionPath() + + /** + * getNewLeadSelectionPath + * @returns TreePath + */ + public TreePath getNewLeadSelectionPath() { + return newLeadSelectionPath; + } // getNewLeadSelectionPath() + + /** + * cloneWithSource + * @param source TODO + * @returns Object + */ + public Object cloneWithSource(Object source) { + return null; // TODO + } // cloneWithSource() + + + } // TreeSelectionEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TreeSelectionListener.java gcc-3.3/libjava/javax/swing/event/TreeSelectionListener.java *** gcc-3.2.3/libjava/javax/swing/event/TreeSelectionListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TreeSelectionListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,56 ---- + /* TreeSelectionListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * TreeSelectionListener interface + * @author Andrew Selkirk + */ + public interface TreeSelectionListener extends EventListener { + + /** + * Value changed + * @param event Tree Selection Event + */ + public void valueChanged(TreeSelectionEvent event); + + + } // TreeSelectionListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/TreeWillExpandListener.java gcc-3.3/libjava/javax/swing/event/TreeWillExpandListener.java *** gcc-3.2.3/libjava/javax/swing/event/TreeWillExpandListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/TreeWillExpandListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* TreeWillExpandListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * TreeWillExpandListener interface + * @author Andrew Selkirk + */ + public interface TreeWillExpandListener extends EventListener { + + /** + * Tree will collapse + * @param event Tree Expansion Event + */ + public void treeWillCollapse(TreeExpansionEvent event); + + /** + * Tree will expand + * @param event Tree Expansion Event + */ + public void treeWillExpand(TreeExpansionEvent event); + + + } // TreeWillExpandListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/UndoableEditEvent.java gcc-3.3/libjava/javax/swing/event/UndoableEditEvent.java *** gcc-3.2.3/libjava/javax/swing/event/UndoableEditEvent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/UndoableEditEvent.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,89 ---- + /* UndoableEditEvent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.*; + import javax.swing.undo.*; + + /** + * UndoableEditEvent + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public class UndoableEditEvent extends EventObject { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * edit + */ + private UndoableEdit edit; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UndoableEditEvent + * @param source TODO + * @param edit TODO + */ + public UndoableEditEvent(Object source, UndoableEdit edit) { + super(source); + this.edit = edit; + } // UndoableEditEvent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getEdit + * @returns UndoableEdit + */ + public UndoableEdit getEdit() { + return edit; + } // getEdit() + + + } // UndoableEditEvent diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/event/UndoableEditListener.java gcc-3.3/libjava/javax/swing/event/UndoableEditListener.java *** gcc-3.2.3/libjava/javax/swing/event/UndoableEditListener.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/event/UndoableEditListener.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,57 ---- + /* UndoableEditListener.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.event; + + // Imports + import java.util.EventListener; + + /** + * UndoableEditListener interface + * @author Andrew Selkirk + * @author Ronald Veldema + */ + public interface UndoableEditListener extends EventListener { + + /** + * Undoable edit has happened + * @param event Undoable Edit Event + */ + public void undoableEditHappened(UndoableEditEvent event); + + + } // UndoableEditListener diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/filechooser/FileFilter.java gcc-3.3/libjava/javax/swing/filechooser/FileFilter.java *** gcc-3.2.3/libjava/javax/swing/filechooser/FileFilter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/filechooser/FileFilter.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,80 ---- + /* FileFilter.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.filechooser; + + // Imports + import java.io.*; + + /** + * FileFilter + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class FileFilter { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FileFilter + */ + public FileFilter() { + // TODO + } // FileFilter() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * accept + * @param file TODO + * @returns boolean + */ + public abstract boolean accept(File file); + + /** + * getDescription + * @returns String + */ + public abstract String getDescription(); + + + } // FileFilter diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/filechooser/FileSystemView.java gcc-3.3/libjava/javax/swing/filechooser/FileSystemView.java *** gcc-3.2.3/libjava/javax/swing/filechooser/FileSystemView.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/filechooser/FileSystemView.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,149 ---- + /* FileSystemView.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.filechooser; + + // Imports + import java.io.*; + + /** + * FileSystemView + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class FileSystemView { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FileSystemView + */ + public FileSystemView() { + // TODO + } // FileSystemView() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getFileSystemView + * @returns FileSystemView + */ + public static FileSystemView getFileSystemView() { + return null; // TODO + } // getFileSystemView() + + /** + * isRoot + * @param file TODO + * @returns boolean + */ + public abstract boolean isRoot(File file); + + /** + * createNewFolder + * @param file TODO + * @exception IOException TODO + * @returns File + */ + public abstract File createNewFolder(File file) throws IOException; + + /** + * isHiddenFile + * @param file TODO + * @returns boolean + */ + public abstract boolean isHiddenFile(File file); + + /** + * getRoots + * @returns File[] + */ + public abstract File[] getRoots(); + + /** + * getHomeDirectory + * @returns File + */ + public File getHomeDirectory() { + return null; // TODO + } // getHomeDirectory() + + /** + * createFileObject + * @param directory TODO + * @param filename TODO + * @returns File + */ + public File createFileObject(File directory, String filename) { + return null; // TODO + } // createFileObject() + + /** + * createFileObject + * @param path TODO + * @returns File + */ + public File createFileObject(String path) { + return null; // TODO + } // createFileObject() + + /** + * getFiles + * @param directory TODO + * @param fileHiding TODO + * @returns File[] + */ + public File[] getFiles(File directory, boolean fileHiding) { + return null; // TODO + } // getFiles() + + /** + * getParentDirectory + * @param directory TODO + * @returns File + */ + public File getParentDirectory(File directory) { + return null; // TODO + } // getParentDirectory() + + + } // FileSystemView diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/filechooser/FileView.java gcc-3.3/libjava/javax/swing/filechooser/FileView.java *** gcc-3.2.3/libjava/javax/swing/filechooser/FileView.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/filechooser/FileView.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,113 ---- + /* FileView.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.filechooser; + + // Imports + import java.io.*; + import javax.swing.*; + + /** + * FileView + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class FileView { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FileView + */ + public FileView() { + // TODO + } // FileView() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getName + * @param file TODO + * @returns String + */ + public String getName(File file) { + return null; // TODO + } // getName() + + /** + * getDescription + * @param value0 TODO + * @returns String + */ + public String getDescription(File value0) { + return null; // TODO + } // getDescription() + + /** + * getTypeDescription + * @param value0 TODO + * @returns String + */ + public String getTypeDescription(File value0) { + return null; // TODO + } // getTypeDescription() + + /** + * getIcon + * @param value0 TODO + * @returns Icon + */ + public Icon getIcon(File value0) { + return null; // TODO + } // getIcon() + + /** + * isTraversable + * @param value0 TODO + * @returns Boolean + */ + public Boolean isTraversable(File value0) { + return null; // TODO + } // isTraversable() + + + } // FileView diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/FocusManager.java gcc-3.3/libjava/javax/swing/FocusManager.java *** gcc-3.2.3/libjava/javax/swing/FocusManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/FocusManager.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,182 ---- + /* FocusManager.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + + /** + * FocusManager + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class FocusManager { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * DisabledFocusManager + */ + static class DisabledFocusManager extends FocusManager { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DisabledFocusManager + */ + DisabledFocusManager() { + // TODO + } // DisabledFocusManager() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * processKeyEvent + * @param component TODO + * @param event TODO + */ + public void processKeyEvent(Component component, KeyEvent event) { + // TODO + } // processKeyEvent() + + /** + * focusNextComponent + * @param component TODO + */ + public void focusNextComponent(Component component) { + // TODO + } // focusNextComponent() + + /** + * focusPreviousComponent + * @param value0 TODO + */ + public void focusPreviousComponent(Component value0) { + // TODO + } // focusPreviousComponent() + + + } // DisabledFocusManager + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * FOCUS_MANAGER_CLASS_PROPERTY + */ + public static final String FOCUS_MANAGER_CLASS_PROPERTY = "FocusManagerClassName"; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FocusManager + */ + public FocusManager() { + // TODO + } // FocusManager() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getCurrentManager + * @returns FocusManager + */ + public static FocusManager getCurrentManager() { + return null; // TODO + } // getCurrentManager() + + /** + * setCurrentManager + * @param manager TODO + */ + public static void setCurrentManager(FocusManager manager) { + // TODO + } // setCurrentManager() + + /** + * disableSwingFocusManager + */ + public static void disableSwingFocusManager() { + // TODO + } // disableSwingFocusManager() + + /** + * isFocusManagerEnabled + * @returns boolean + */ + public static boolean isFocusManagerEnabled() { + return false; // TODO + } // isFocusManagerEnabled() + + /** + * processKeyEvent + * @param component TODO + * @param event TODO + */ + public abstract void processKeyEvent(Component component, KeyEvent event); + + /** + * focusNextComponent + * @param component TODO + */ + public abstract void focusNextComponent(Component component); + + /** + * focusPreviousComponent + * @param component TODO + */ + public abstract void focusPreviousComponent(Component component); + + + } // FocusManager diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/GrayFilter.java gcc-3.3/libjava/javax/swing/GrayFilter.java *** gcc-3.2.3/libjava/javax/swing/GrayFilter.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/GrayFilter.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,85 ---- + /* GrayFilter.java -- Java class for filtering Pixels to produce Gray Pictures + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.swing; + + import java.awt.Image; + import java.awt.image.FilteredImageSource; + import java.awt.image.RGBImageFilter; + import java.awt.Toolkit; + + public class GrayFilter extends RGBImageFilter + { + private boolean b; + private int p; + + /** + Create a GrayFilter. If b is true then brighten. Also, indicate how much gray. + + @param b if brighten + @param p percent of gray, 0 - 100 + */ + public GrayFilter(boolean b, int p) + { + this.b = b; //FIXME - HANDLE THIS + this.p = p; + } + + /** + Create grayed image + + @param i image to gray + + @return a grayed image + */ + public static Image createDisabledImage(Image src) + { + return Toolkit.getDefaultToolkit().createImage( new FilteredImageSource(src.getSource(), + new GrayFilter(false, 100))); + } + + /** + Filter RGB to gray + */ + public int filterRGB(int x, + int y, + int rgb) + { + return (int) ( ( p * ( 0.299 * ( (0xff0000 & rgb) >> 16) + 0.587 * ( (0xff00 & rgb) >> 8 ) + 0.114 * (0xff & rgb ) ) )); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/Icon.java gcc-3.3/libjava/javax/swing/Icon.java *** gcc-3.2.3/libjava/javax/swing/Icon.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/Icon.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,47 ---- + /* Icon.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + + public interface Icon + { + int getIconHeight(); + int getIconWidth(); + void paintIcon(Component c, Graphics g, int x, int y); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ImageIcon.java gcc-3.3/libjava/javax/swing/ImageIcon.java *** gcc-3.2.3/libjava/javax/swing/ImageIcon.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ImageIcon.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,95 ---- + /* ImageIcon.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.image.*; + + + + public class ImageIcon implements Icon + { + Image image; + String file, descr; + Component observer; + + public ImageIcon(String s) + { + this(s, ""); + } + + public ImageIcon(String file, + String descr) + { + this.file = file; + this.descr = descr; + + image = Toolkit.getDefaultToolkit().getImage(file); + if (image == null) { + return; + } + //loadImage(image); + } + + // not in SUN's spec !!! + public void setParent(Component p) + { + observer = p; + } + + public Image getImage() + { return image; } + + public String getDescription() + { return descr; } + public void setDescription(String description) + { this.descr = description; } + + public int getIconHeight() + { return image.getHeight(observer); } + public int getIconWidth() + { return image.getWidth(observer); } + + public void paintIcon(Component c, + Graphics g, + int x, + int y) + { + g.drawImage(image, x, y, observer); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/InputMap.java gcc-3.3/libjava/javax/swing/InputMap.java *** gcc-3.2.3/libjava/javax/swing/InputMap.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/InputMap.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,230 ---- + /* InputMap.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.util.*; + import java.io.*; + + /** + * InputMap + * @author Andrew Selkirk + * @version 1.0 + */ + public class InputMap implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * inputMap + */ + private Map inputMap = new HashMap(); + + /** + * parent + */ + private InputMap parent = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor InputMap + */ + public InputMap() { + // TODO + } // InputMap() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * get + * @param value0 TODO + * @returns Object + */ + public Object get(KeyStroke keystroke) { + + // Variables + Object result; + + // Check Local store + result = inputMap.get(keystroke); + + // Check Parent + if (result == null) { + result = parent.get(keystroke); + } // if + + return result; + + } // get() + + /** + * put + * @param keystroke TODO + * @param actionMapKey TODO + */ + public void put(KeyStroke keystroke, Object actionMapKey) { + if (actionMapKey == null) { + inputMap.remove(keystroke); + } else { + inputMap.put(keystroke, actionMapKey); + } // if + } // put() + + /** + * remove + * @param keystroke TODO + */ + public void remove(KeyStroke keystroke) { + inputMap.remove(keystroke); + } // remove() + + /** + * getParent + * @returns InputMap + */ + public InputMap getParent() { + return parent; + } // getParent() + + /** + * setParent + * @param parentMap TODO + */ + public void setParent(InputMap parentMap) { + parent = parentMap; + } // setParent() + + /** + * size + * @returns int + */ + public int size() { + return inputMap.size(); + } // size() + + /** + * clear + */ + public void clear() { + inputMap.clear(); + } // clear() + + /** + * keys + * @returns KeyStroke[] + */ + public KeyStroke[] keys() { + return convertSet(inputMap.keySet()); + } // keys() + + /** + * allKeys + * @returns KeyStroke[] + */ + public KeyStroke[] allKeys() { + + // Variables + Set set; + + // Initialize + set = new HashSet(); + + // Get Key Sets + if (parent != null) { + set.addAll(Arrays.asList(parent.allKeys())); + } // if + set.addAll(inputMap.keySet()); + + return convertSet(set); + + } // allKeys() + + private KeyStroke[] convertSet(Set set) { + + // Variables + int index; + Iterator iterator; + KeyStroke[] keys; + + // Create Final array + keys = new KeyStroke[set.size()]; + iterator = set.iterator(); + index = 0; + while (iterator.hasNext()) { + keys[index++] = (KeyStroke) iterator.next(); + } // while + + return keys; + + } // convertSet() + + + //------------------------------------------------------------- + // Interface: Serializable ------------------------------------ + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * readObject + * @param stream TODO + * @exception ClassNotFoundException TODO + * @exception IOException TODO + */ + private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException { + // TODO + } // readObject() + + + } // InputMap diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/InputVerifier.java gcc-3.3/libjava/javax/swing/InputVerifier.java *** gcc-3.2.3/libjava/javax/swing/InputVerifier.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/InputVerifier.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,79 ---- + /* InputVerifier.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + /** + * InputVerifier + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class InputVerifier { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor InputVerifier + */ + public InputVerifier() { + } // InputVerifier() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * verify + * @param component TODO + * @returns boolean + */ + public abstract boolean verify(JComponent component); + + /** + * shouldYieldFocus + * @param component TODO + * @returns boolean + */ + public boolean shouldYieldFocus(JComponent component) { + return verify(component); + } // shouldYieldFocus() + + + } // InputVerifier diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JApplet.java gcc-3.3/libjava/javax/swing/JApplet.java *** gcc-3.2.3/libjava/javax/swing/JApplet.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JApplet.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,213 ---- + /* JApplet.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.applet.*; + import java.awt.*; + import java.awt.event.*; + + + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + + public class JApplet extends Applet + { + + public final static int HIDE_ON_CLOSE = 0; + public final static int EXIT_ON_CLOSE = 1; + public final static int DISPOSE_ON_CLOSE = 2; + public final static int DO_NOTHING_ON_CLOSE = 3; + + private int close_action = EXIT_ON_CLOSE; + private boolean checking; + protected JRootPane rootPane; + + public JApplet() + { + frameInit(); + } + + public JApplet(String title) + { + frameInit(); + } + + protected void frameInit() + { + super.setLayout(new BorderLayout(1, 1)); + getRootPane(); // will do set/create + } + + public Dimension getPreferredSize() + { + Dimension d = super.getPreferredSize(); + System.out.println("JFrame.getPrefSize(): " + d + " , comp="+countComponents() + ", layout=" + getLayout()); + return d; + } + + public void setLayout(LayoutManager manager) + { super.setLayout(manager); } + + void setLayeredPane(JLayeredPane layeredPane) + { getRootPane().setLayeredPane(layeredPane); } + + JLayeredPane getLayeredPane() + { return getRootPane().getLayeredPane(); } + + JRootPane getRootPane() + { + if (rootPane == null) + setRootPane(createRootPane()); + return rootPane; + } + + void setRootPane(JRootPane root) + { + if (rootPane != null) + remove(rootPane); + + rootPane = root; + add(rootPane, BorderLayout.CENTER); + } + + JRootPane createRootPane() + { return new JRootPane(); } + + Container getContentPane() + { return getRootPane().getContentPane(); } + + void setContentPane(Container contentPane) + { getRootPane().setContentPane(contentPane); } + + Component getGlassPane() + { return getRootPane().getGlassPane(); } + + void setGlassPane(Component glassPane) + { getRootPane().setGlassPane(glassPane); } + + + ///////////////////////////////////////////////////////////////////////////////// + protected void addImpl(Component comp, Object constraints, int index) + { super.addImpl(comp, constraints, index); } + + public AccessibleContext getAccessibleContext() + { return null; } + + int getDefaultCloseOperation() + { return close_action; } + + + JMenuBar getJMenuBar() + { return getRootPane().getJMenuBar(); } + + void setJMenuBar(JMenuBar menubar) + { getRootPane().setJMenuBar(menubar); } + + + protected String paramString() + { return "JFrame"; } + + protected void processKeyEvent(KeyEvent e) + { super.processKeyEvent(e); } + + protected void processWindowEvent(WindowEvent e) + { + // System.out.println("PROCESS_WIN_EV-1: " + e); + + // super.processWindowEvent(e); + + // System.out.println("PROCESS_WIN_EV-2: " + e); + switch (e.getID()) + { + case WindowEvent.WINDOW_CLOSING: + { + switch(close_action) + { + case EXIT_ON_CLOSE: + { + System.out.println("user requested exit on close"); + System.exit(1); + break; + } + case DISPOSE_ON_CLOSE: + { + System.out.println("user requested dispose on close"); + //dispose(); + break; + } + case HIDE_ON_CLOSE: + + case DO_NOTHING_ON_CLOSE: + break; + } + break; + } + + case WindowEvent.WINDOW_CLOSED: + case WindowEvent.WINDOW_OPENED: + case WindowEvent.WINDOW_ICONIFIED: + case WindowEvent.WINDOW_DEICONIFIED: + case WindowEvent.WINDOW_ACTIVATED: + case WindowEvent.WINDOW_DEACTIVATED: + break; + } + } + + + public void remove(Component comp) + { getContentPane().remove(comp); } + + + void setDefaultCloseOperation(int operation) + { close_action = operation; } + + + + protected boolean isRootPaneCheckingEnabled() + { return checking; } + + + protected void setRootPaneCheckingEnabled(boolean enabled) + { checking = enabled; } + + public void update(Graphics g) + { paint(g); } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JButton.java gcc-3.3/libjava/javax/swing/JButton.java *** gcc-3.2.3/libjava/javax/swing/JButton.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JButton.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,133 ---- + /* JButton.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + import javax.swing.plaf.*; + import javax.accessibility.*; + + /** + * An instance of JButton can be added to a panel, frame etc + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class JButton extends AbstractButton implements Accessible + { + boolean def, is_def; + + + public JButton() + { + this(null, null); + } + + public JButton(Action a) + { + this(); + setAction(a); + } + + public JButton(Icon icon) + { + this(null, icon); + } + + public JButton(String text) + { + this(text, null); + } + + public JButton(String text, Icon icon) + { + super(text, icon); + } + + public Object[] getSelectedObjects() + { + return null; + } + + protected void configurePropertiesFromAction(Action a) + { + //Factory method which sets the AbstractButton's properties according to values from the Action instance. + } + + public AccessibleContext getAccessibleContext() + { + //Gets the AccessibleContext associated with this JButton. + return null; + } + + public String getUIClassID() + { + //Returns a string that specifies the name of the L&F class that renders this component. + return "JButton"; + } + + public boolean isDefaultButton() + { + //Returns whether or not this button is the default button on the RootPane. + return is_def; + } + + public boolean isDefaultCapable() + { + //Returns whether or not this button is capable of being the default button on the RootPane. + return def; + } + + protected String paramString() + { + return "JButton"; + } + + public void removeNotify() + { + //Overrides JComponent.removeNotify to check if this button is currently set as the default button on the RootPane, and if so, sets the RootPane's default button to null to ensure the RootPane doesn't hold onto an invalid button reference. + } + + public void setDefaultCapable(boolean defaultCapable) + { def = defaultCapable; } + + public void updateUI() + { + ButtonUI b = (ButtonUI)UIManager.getUI(this); + setUI(b); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JCheckBox.java gcc-3.3/libjava/javax/swing/JCheckBox.java *** gcc-3.2.3/libjava/javax/swing/JCheckBox.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JCheckBox.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,94 ---- + /* JCheckBox.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + import javax.swing.plaf.*; + import javax.accessibility.*; + + /** + * An instance of JCheckbox can be added to a panel, frame etc + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class JCheckBox extends JToggleButton + { + public JCheckBox() + { + this(null, null); + } + public JCheckBox(Action a) + { + this(); + setAction(a); + } + + public JCheckBox(Icon icon) + { + this(null, icon); + } + + public JCheckBox(String text) + { + this(text, null); + } + + public JCheckBox(String text, Icon icon) + { + super(text, icon); + } + + + public AccessibleContext getAccessibleContext() + { + //Gets the AccessibleContext associated with this JCheckBox. + return null; + } + + public String getUIClassID() + { + //Returns a string that specifies the name of the L&F class that renders this component. + return "JCheckBox"; + } + + protected String paramString() + { + return "JCheckBox"; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JCheckBoxMenuItem.java gcc-3.3/libjava/javax/swing/JCheckBoxMenuItem.java *** gcc-3.2.3/libjava/javax/swing/JCheckBoxMenuItem.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JCheckBoxMenuItem.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,241 ---- + /* JCheckBoxMenuItem.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import javax.accessibility.*; + + /** + * JCheckBoxMenuItem + * @author Andrew Selkirk + * @version 1.0 + */ + public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants, Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJCheckBoxMenuItem + */ + protected class AccessibleJCheckBoxMenuItem extends AccessibleJMenuItem { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJCheckBoxMenuItem + * @param component TODO + */ + protected AccessibleJCheckBoxMenuItem(JCheckBoxMenuItem component) { + super(component); + // TODO + } // AccessibleJCheckBoxMenuItem() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.CHECK_BOX; + } // getAccessibleRole() + + + } // AccessibleJCheckBoxMenuItem + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "CheckBoxMenuItemUI"; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JCheckBoxMenuItem + */ + public JCheckBoxMenuItem() { + // TODO + } // JCheckBoxMenuItem() + + /** + * Constructor JCheckBoxMenuItem + * @param icon TODO + */ + public JCheckBoxMenuItem(Icon icon) { + // TODO + } // JCheckBoxMenuItem() + + /** + * Constructor JCheckBoxMenuItem + * @param text TODO + */ + public JCheckBoxMenuItem(String text) { + // TODO + } // JCheckBoxMenuItem() + + /** + * Constructor JCheckBoxMenuItem + * @param action TODO + */ + public JCheckBoxMenuItem(Action action) { + // TODO + } // JCheckBoxMenuItem() + + /** + * Constructor JCheckBoxMenuItem + * @param text TODO + * @param icon TODO + */ + public JCheckBoxMenuItem(String text, Icon icon) { + // TODO + } // JCheckBoxMenuItem() + + /** + * Constructor JCheckBoxMenuItem + * @param text TODO + * @param state TODO + */ + public JCheckBoxMenuItem(String text, boolean state) { + // TODO + } // JCheckBoxMenuItem() + + /** + * Constructor JCheckBoxMenuItem + * @param text TODO + * @param icon TODO + * @param state TODO + */ + public JCheckBoxMenuItem(String text, Icon icon, boolean state) { + // TODO + } // JCheckBoxMenuItem() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getState + * @returns boolean + */ + public boolean getState() { + return false; // TODO + } // getState() + + /** + * setState + * @param state TODO + */ + public synchronized void setState(boolean state) { + // TODO + } // setState() + + /** + * getSelectedObjects + * @returns Object[] + */ + public Object[] getSelectedObjects() { + return null; // TODO + } // getSelectedObjects() + + /** + * requestFocus + */ + public void requestFocus() { + // TODO + } // requestFocus() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJCheckBoxMenuItem(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JCheckBoxMenuItem diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JColorChooser.java gcc-3.3/libjava/javax/swing/JColorChooser.java *** gcc-3.2.3/libjava/javax/swing/JColorChooser.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JColorChooser.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,365 ---- + /* JColorChooser.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.io.*; + import javax.accessibility.*; + import javax.swing.colorchooser.*; + import javax.swing.plaf.*; + + /** + * JColorChooser + * @author Andrew Selkirk + * @version 1.0 + */ + public class JColorChooser extends JComponent implements Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJColorChooser + */ + protected class AccessibleJColorChooser extends JComponent.AccessibleJComponent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJColorChooser + * @param component TODO + */ + protected AccessibleJColorChooser(JColorChooser component) { + super(component); + // TODO + } // AccessibleJColorChooser() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.COLOR_CHOOSER; + } // getAccessibleRole() + + + } // AccessibleJColorChooser + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "ColorChooserUI"; + + /** + * selectionModel + */ + private ColorSelectionModel selectionModel; + + /** + * previewPanel + */ + private JComponent previewPanel; + + /** + * chooserPanels + */ + private AbstractColorChooserPanel[] chooserPanels; + + /** + * SELECTION_MODEL_PROPERTY + */ + public static final String SELECTION_MODEL_PROPERTY = "selectionModel"; + + /** + * PREVIEW_PANEL_PROPERTY + */ + public static final String PREVIEW_PANEL_PROPERTY = "previewPanel"; + + /** + * CHOOSER_PANELS_PROPERTY + */ + public static final String CHOOSER_PANELS_PROPERTY = "chooserPanels"; + + /** + * accessibleContext + */ + protected AccessibleContext accessibleContext; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JColorChooser + */ + public JColorChooser() { + // TODO + } // JColorChooser() + + /** + * Constructor JColorChooser + * @param initial TODO + */ + public JColorChooser(Color initial) { + // TODO + } // JColorChooser() + + /** + * Constructor JColorChooser + * @param model TODO + */ + public JColorChooser(ColorSelectionModel model) { + // TODO + } // JColorChooser() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * setColor + * @param color TODO + */ + public void setColor(Color color) { + // TODO + } // setColor() + + /** + * setColor + * @param r TODO + * @param g TODO + * @param b TODO + */ + public void setColor(int r, int g, int b) { + // TODO + } // setColor() + + /** + * setColor + * @param color TODO + */ + public void setColor(int color) { + // TODO + } // setColor() + + /** + * showDialog + * @param component TODO + * @param title TODO + * @param initial TODO + * @returns Color + */ + public static Color showDialog(Component component, String title, + Color initial) { + return null; // TODO + } // showDialog() + + /** + * createDialog + * @param component TODO + * @param title TODO + * @param modal TODO + * @param chooserPane TODO + * @param okListener TODO + * @param cancelListener TODO + * @returns JDialog + */ + public static JDialog createDialog(Component component, String title, + boolean modal, JColorChooser chooserPane, + ActionListener okListener, ActionListener cancelListener) { + return null; // TODO + } // createDialog() + + /** + * getUI + * @returns ColorChooserUI + */ + public ColorChooserUI getUI() { + return (ColorChooserUI) ui; + } // getUI() + + /** + * setUI + * @param ui TODO + */ + public void setUI(ColorChooserUI ui) { + super.setUI(ui); + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((ColorChooserUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getColor + * @returns Color + */ + public Color getColor() { + return null; // TODO + } // getColor() + + /** + * setPreviewPanel + * @param component TODO + */ + public void setPreviewPanel(JComponent component) { + // TODO + } // setPreviewPanel() + + /** + * getPreviewPanel + * @returns JComponent + */ + public JComponent getPreviewPanel() { + return null; // TODO + } // getPreviewPanel() + + /** + * addChooserPanel + * @param panel TODO + */ + public void addChooserPanel(AbstractColorChooserPanel panel) { + // TODO + } // addChooserPanel() + + /** + * removeChooserPanel + * @param panel TODO + * @returns AbstractColorChooserPanel + */ + public AbstractColorChooserPanel removeChooserPanel( + AbstractColorChooserPanel panel) { + return null; // TODO + } // removeChooserPanel() + + /** + * setChooserPanels + * @param panels TODO + */ + public void setChooserPanels(AbstractColorChooserPanel[] panels) { + // TODO + } // setChooserPanels() + + /** + * getChooserPanels + * @returns AbstractColorChooserPanel[] + */ + public AbstractColorChooserPanel[] getChooserPanels() { + return null; // TODO + } // getChooserPanels() + + /** + * getSelectionModel + * @returns ColorSelectionModel + */ + public ColorSelectionModel getSelectionModel() { + return null; // TODO + } // getSelectionModel() + + /** + * setSelectionModel + * @param model TODO + */ + public void setSelectionModel(ColorSelectionModel model) { + // TODO + } // setSelectionModel() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJColorChooser(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JColorChooser diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JComboBox.java gcc-3.3/libjava/javax/swing/JComboBox.java *** gcc-3.2.3/libjava/javax/swing/JComboBox.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JComboBox.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,835 ---- + /* JComboBox.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.beans.*; + import java.io.*; + import java.util.*; + import javax.accessibility.*; + import javax.swing.event.*; + import javax.swing.plaf.*; + + /** + * JComboBox + * @author Andrew Selkirk + * @version 1.0 + */ + public class JComboBox extends JComponent implements ItemSelectable, + ListDataListener, ActionListener, Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJComboBox + */ + protected class AccessibleJComboBox extends AccessibleJComponent + implements AccessibleAction, AccessibleSelection { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJComboBox + * @param component TODO + */ + protected AccessibleJComboBox(JComboBox component) { + super(component); + // TODO + } // AccessibleJComboBox() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleChildrenCount + * @returns int + */ + public int getAccessibleChildrenCount() { + return 0; // TODO + } // getAccessibleChildrenCount() + + /** + * getAccessibleChild + * @param value0 TODO + * @returns Accessible + */ + public Accessible getAccessibleChild(int value0) { + return null; // TODO + } // getAccessibleChild() + + /** + * getAccessibleSelection + * @returns AccessibleSelection + */ + public AccessibleSelection getAccessibleSelection() { + return null; // TODO + } // getAccessibleSelection() + + /** + * getAccessibleSelection + * @param value0 TODO + * @returns Accessible + */ + public Accessible getAccessibleSelection(int value0) { + return null; // TODO + } // getAccessibleSelection() + + /** + * isAccessibleChildSelected + * @param value0 TODO + * @returns boolean + */ + public boolean isAccessibleChildSelected(int value0) { + return false; // TODO + } // isAccessibleChildSelected() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.COMBO_BOX; + } // getAccessibleRole() + + /** + * getAccessibleAction + * @returns AccessibleAction + */ + public AccessibleAction getAccessibleAction() { + return null; // TODO + } // getAccessibleAction() + + /** + * getAccessibleActionDescription + * @param value0 TODO + * @returns String + */ + public String getAccessibleActionDescription(int value0) { + return null; // TODO + } // getAccessibleActionDescription() + + /** + * getAccessibleActionCount + * @returns int + */ + public int getAccessibleActionCount() { + return 0; // TODO + } // getAccessibleActionCount() + + /** + * doAccessibleAction + * @param value0 TODO + * @returns boolean + */ + public boolean doAccessibleAction(int value0) { + return false; // TODO + } // doAccessibleAction() + + /** + * getAccessibleSelectionCount + * @returns int + */ + public int getAccessibleSelectionCount() { + return 0; // TODO + } // getAccessibleSelectionCount() + + /** + * addAccessibleSelection + * @param value0 TODO + */ + public void addAccessibleSelection(int value0) { + // TODO + } // addAccessibleSelection() + + /** + * removeAccessibleSelection + * @param value0 TODO + */ + public void removeAccessibleSelection(int value0) { + // TODO + } // removeAccessibleSelection() + + /** + * clearAccessibleSelection + */ + public void clearAccessibleSelection() { + // TODO + } // clearAccessibleSelection() + + /** + * selectAllAccessibleSelection + */ + public void selectAllAccessibleSelection() { + // TODO + } // selectAllAccessibleSelection() + + + } // AccessibleJComboBox + + /** + * KeySelectionManager + */ + public static interface KeySelectionManager { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * selectionForKey + * @param value0 TODO + * @param value1 TODO + * @returns int + */ + public abstract int selectionForKey(char value0, ComboBoxModel value1); + + + } // KeySelectionManager + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "ComboBoxUI"; + + /** + * dataModel + */ + protected ComboBoxModel dataModel; + + /** + * renderer + */ + protected ListCellRenderer renderer; + + /** + * editor + */ + protected ComboBoxEditor editor; + + /** + * maximumRowCount + */ + protected int maximumRowCount; + + /** + * isEditable + */ + protected boolean isEditable; + + /** + * selectedItemReminder + */ + protected Object selectedItemReminder; + + /** + * keySelectionManager + */ + protected JComboBox.KeySelectionManager keySelectionManager; + + /** + * actionCommand + */ + protected String actionCommand; + + /** + * lightWeightPopupEnabled + */ + protected boolean lightWeightPopupEnabled; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JComboBox + * @param value0 TODO + */ + public JComboBox(ComboBoxModel value0) { + // TODO + } // JComboBox() + + /** + * Constructor JComboBox + * @param value0 TODO + */ + public JComboBox(Object[] value0) { + // TODO + } // JComboBox() + + /** + * Constructor JComboBox + * @param value0 TODO + */ + public JComboBox(Vector value0) { + // TODO + } // JComboBox() + + /** + * Constructor JComboBox + */ + public JComboBox() { + // TODO + } // JComboBox() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * isEditable + * @returns boolean + */ + public boolean isEditable() { + return false; // TODO + } // isEditable() + + /** + * installAncestorListener + */ + protected void installAncestorListener() { + // TODO + } // installAncestorListener() + + /** + * setUI + * @param ui TODO + */ + public void setUI(ComboBoxUI ui) { + super.setUI(ui); + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((ComboBoxUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getUI + * @returns ComboBoxUI + */ + public ComboBoxUI getUI() { + return (ComboBoxUI) ui; + } // getUI() + + /** + * setModel + * @param value0 TODO + */ + public void setModel(ComboBoxModel value0) { + // TODO + } // setModel() + + /** + * getModel + * @returns ComboBoxModel + */ + public ComboBoxModel getModel() { + return null; // TODO + } // getModel() + + /** + * setLightWeightPopupEnabled + * @param value0 TODO + */ + public void setLightWeightPopupEnabled(boolean value0) { + // TODO + } // setLightWeightPopupEnabled() + + /** + * isLightWeightPopupEnabled + * @returns boolean + */ + public boolean isLightWeightPopupEnabled() { + return false; // TODO + } // isLightWeightPopupEnabled() + + /** + * setEditable + * @param value0 TODO + */ + public void setEditable(boolean value0) { + // TODO + } // setEditable() + + /** + * setMaximumRowCount + * @param value0 TODO + */ + public void setMaximumRowCount(int value0) { + // TODO + } // setMaximumRowCount() + + /** + * getMaximumRowCount + * @returns int + */ + public int getMaximumRowCount() { + return 0; // TODO + } // getMaximumRowCount() + + /** + * setRenderer + * @param value0 TODO + */ + public void setRenderer(ListCellRenderer value0) { + // TODO + } // setRenderer() + + /** + * getRenderer + * @returns ListCellRenderer + */ + public ListCellRenderer getRenderer() { + return null; // TODO + } // getRenderer() + + /** + * setEditor + * @param value0 TODO + */ + public void setEditor(ComboBoxEditor value0) { + // TODO + } // setEditor() + + /** + * getEditor + * @returns ComboBoxEditor + */ + public ComboBoxEditor getEditor() { + return null; // TODO + } // getEditor() + + /** + * setSelectedItem + * @param value0 TODO + */ + public void setSelectedItem(Object value0) { + // TODO + } // setSelectedItem() + + /** + * getSelectedItem + * @returns Object + */ + public Object getSelectedItem() { + return null; // TODO + } // getSelectedItem() + + /** + * setSelectedIndex + * @param value0 TODO + */ + public void setSelectedIndex(int value0) { + // TODO + } // setSelectedIndex() + + /** + * getSelectedIndex + * @returns int + */ + public int getSelectedIndex() { + return 0; // TODO + } // getSelectedIndex() + + /** + * addItem + * @param value0 TODO + */ + public void addItem(Object value0) { + // TODO + } // addItem() + + /** + * insertItemAt + * @param value0 TODO + * @param value1 TODO + */ + public void insertItemAt(Object value0, int value1) { + // TODO + } // insertItemAt() + + /** + * removeItem + * @param value0 TODO + */ + public void removeItem(Object value0) { + // TODO + } // removeItem() + + /** + * removeItemAt + * @param value0 TODO + */ + public void removeItemAt(int value0) { + // TODO + } // removeItemAt() + + /** + * removeAllItems + */ + public void removeAllItems() { + // TODO + } // removeAllItems() + + /** + * showPopup + */ + public void showPopup() { + // TODO + } // showPopup() + + /** + * hidePopup + */ + public void hidePopup() { + // TODO + } // hidePopup() + + /** + * setPopupVisible + * @param value0 TODO + */ + public void setPopupVisible(boolean value0) { + // TODO + } // setPopupVisible() + + /** + * isPopupVisible + * @returns boolean + */ + public boolean isPopupVisible() { + return false; // TODO + } // isPopupVisible() + + /** + * addItemListener + * @param value0 TODO + */ + public void addItemListener(ItemListener value0) { + // TODO + } // addItemListener() + + /** + * removeItemListener + * @param value0 TODO + */ + public void removeItemListener(ItemListener value0) { + // TODO + } // removeItemListener() + + /** + * addActionListener + * @param value0 TODO + */ + public void addActionListener(ActionListener value0) { + // TODO + } // addActionListener() + + /** + * removeActionListener + * @param value0 TODO + */ + public void removeActionListener(ActionListener value0) { + // TODO + } // removeActionListener() + + /** + * setActionCommand + * @param value0 TODO + */ + public void setActionCommand(String value0) { + // TODO + } // setActionCommand() + + /** + * getActionCommand + * @returns String + */ + public String getActionCommand() { + return null; // TODO + } // getActionCommand() + + /** + * setAction + * @param value0 TODO + */ + public void setAction(Action value0) { + // TODO + } // setAction() + + /** + * isListener + * @param value0 TODO + * @param value1 TODO + * @returns boolean + */ + private boolean isListener(Class value0, ActionListener value1) { + return false; // TODO + } // isListener() + + /** + * getAction + * @returns Action + */ + public Action getAction() { + return null; // TODO + } // getAction() + + /** + * configurePropertiesFromAction + * @param value0 TODO + */ + protected void configurePropertiesFromAction(Action value0) { + // TODO + } // configurePropertiesFromAction() + + /** + * createActionPropertyChangeListener + * @param value0 TODO + * @returns PropertyChangeListener + */ + protected PropertyChangeListener createActionPropertyChangeListener(Action value0) { + return null; // TODO + } // createActionPropertyChangeListener() + + /** + * fireItemStateChanged + * @param value0 TODO + */ + protected void fireItemStateChanged(ItemEvent value0) { + // TODO + } // fireItemStateChanged() + + /** + * fireActionEvent + */ + protected void fireActionEvent() { + // TODO + } // fireActionEvent() + + /** + * selectedItemChanged + */ + protected void selectedItemChanged() { + // TODO + } // selectedItemChanged() + + /** + * getSelectedObjects + * @returns Object[] + */ + public Object[] getSelectedObjects() { + return null; // TODO + } // getSelectedObjects() + + /** + * actionPerformed + * @param value0 TODO + */ + public void actionPerformed(ActionEvent value0) { + // TODO + } // actionPerformed() + + /** + * contentsChanged + * @param value0 TODO + */ + public void contentsChanged(ListDataEvent value0) { + // TODO + } // contentsChanged() + + /** + * selectWithKeyChar + * @param value0 TODO + * @returns boolean + */ + public boolean selectWithKeyChar(char value0) { + return false; // TODO + } // selectWithKeyChar() + + /** + * intervalAdded + * @param value0 TODO + */ + public void intervalAdded(ListDataEvent value0) { + // TODO + } // intervalAdded() + + /** + * intervalRemoved + * @param value0 TODO + */ + public void intervalRemoved(ListDataEvent value0) { + // TODO + } // intervalRemoved() + + /** + * setEnabled + * @param value0 TODO + */ + public void setEnabled(boolean value0) { + // TODO + } // setEnabled() + + /** + * configureEditor + * @param value0 TODO + * @param value1 TODO + */ + public void configureEditor(ComboBoxEditor value0, Object value1) { + // TODO + } // configureEditor() + + /** + * processKeyEvent + * @param value0 TODO + */ + public void processKeyEvent(KeyEvent value0) { + // TODO + } // processKeyEvent() + + /** + * isFocusTraversable + * @returns boolean + */ + public boolean isFocusTraversable() { + return false; // TODO + } // isFocusTraversable() + + /** + * setKeySelectionManager + * @param value0 TODO + */ + public void setKeySelectionManager(KeySelectionManager value0) { + // TODO + } // setKeySelectionManager() + + /** + * getKeySelectionManager + * @returns JComboBox.KeySelectionManager + */ + public JComboBox.KeySelectionManager getKeySelectionManager() { + return null; // TODO + } // getKeySelectionManager() + + /** + * getItemCount + * @returns int + */ + public int getItemCount() { + return 0; // TODO + } // getItemCount() + + /** + * getItemAt + * @param value0 TODO + * @returns Object + */ + public Object getItemAt(int value0) { + return null; // TODO + } // getItemAt() + + /** + * createDefaultKeySelectionManager + * @returns KeySelectionManager + */ + protected KeySelectionManager createDefaultKeySelectionManager() { + return null; // TODO + } // createDefaultKeySelectionManager() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJComboBox(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JComboBox diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JComponent.java gcc-3.3/libjava/javax/swing/JComponent.java *** gcc-3.2.3/libjava/javax/swing/JComponent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JComponent.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,1063 ---- + /* JComponent.java -- Every component in swing inherits from this class. + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.peer.*; + import java.awt.event.*; + import java.io.*; + + import javax.swing.event.*; + import javax.swing.border.*; + import javax.swing.plaf.*; + + import java.util.*; + import java.beans.*; + + import javax.accessibility.*; + + /** + * Every component in swing inherits from this class (JLabel, JButton, etc). + * It contains generic methods to manage events, properties and sizes. + * Actual drawing of the component is channeled to a look-and-feel class + * that is implemented elsewhere. + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public abstract class JComponent extends Container implements Serializable + { + /** + * accessibleContext + */ + protected AccessibleContext accessibleContext; + + Dimension pref,min,max; + Border border; + JToolTip tooltip; + String tool_tip_text; + boolean use_double_buffer, opaque; + protected ComponentUI ui; + + Vector ancestor_list; + Vector veto_list; + Vector change_list; + Hashtable prop_hash; + + /** + * AccessibleJComponent + */ + public abstract class AccessibleJComponent + extends AccessibleAWTContainer { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleFocusHandler + */ + protected class AccessibleFocusHandler implements FocusListener { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleFocusHandler + * @param component TODO + */ + protected AccessibleFocusHandler(AccessibleJComponent component) { + // TODO + } // AccessibleFocusHandler() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * focusGained + * @param event TODO + */ + public void focusGained(FocusEvent event) { + // TODO + } // focusGained() + + /** + * focusLost + * @param event TODO + */ + public void focusLost(FocusEvent valevent) { + // TODO + } // focusLost() + + + } // AccessibleFocusHandler + + /** + * AccessibleContainerHandler + */ + protected class AccessibleContainerHandler implements ContainerListener { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleContainerHandler + * @param component TODO + */ + protected AccessibleContainerHandler(AccessibleJComponent component) { + // TODO + } // AccessibleContainerHandler() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * componentAdded + * @param event TODO + */ + public void componentAdded(ContainerEvent event) { + // TODO + } // componentAdded() + + /** + * componentRemoved + * @param event TODO + */ + public void componentRemoved(ContainerEvent valevent) { + // TODO + } // componentRemoved() + + + } // AccessibleContainerHandler + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * accessibleContainerHandler + */ + protected ContainerListener accessibleContainerHandler; + + /** + * accessibleFocusHandler + */ + protected FocusListener accessibleFocusHandler; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJComponent + * @param component TODO + */ + protected AccessibleJComponent(JComponent component) { + // super((Container)component); + // TODO + } // AccessibleJComponent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * addPropertyChangeListener + * @param listener TODO + */ + public void addPropertyChangeListener(PropertyChangeListener listener) { + // TODO + } // addPropertyChangeListener() + + /** + * removePropertyChangeListener + * @param listener TODO + */ + public void removePropertyChangeListener(PropertyChangeListener listener) { + // TODO + } // removePropertyChangeListener() + + /** + * getAccessibleChildrenCount + * @returns int + */ + public int getAccessibleChildrenCount() { + return 0; // TODO + } // getAccessibleChildrenCount() + + /** + * getAccessibleChild + * @param value0 TODO + * @returns Accessible + */ + public Accessible getAccessibleChild(int value0) { + return null; // TODO + } // getAccessibleChild() + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + /** + * getAccessibleName + * @returns String + */ + public String getAccessibleName() { + return null; // TODO + } // getAccessibleName() + + /** + * getAccessibleDescription + * @returns String + */ + public String getAccessibleDescription() { + return null; // TODO + } // getAccessibleDescription() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return null; // TODO + } // getAccessibleRole() + + /** + * getBorderTitle + * @param value0 TODO + * @returns String + */ + protected String getBorderTitle(Border value0) { + return null; // TODO + } // getBorderTitle() + + + } // AccessibleJComponent + + + public JComponent() + { + super(); + super.setLayout(new FlowLayout()); + + //eventMask |= AWTEvent.COMP_KEY_EVENT_MASK; + enableEvents( AWTEvent.KEY_EVENT_MASK ); + + //updateUI(); // get a proper ui + } + + + // protected EventListenerList listenerList + public boolean contains(int x, int y) + { + //return dims.contains(x,y); + return super.contains(x,y); + } + + + public void addNotify() + { + //Notification to this component that it now has a parent component. + super.addNotify(); + } + + + Hashtable get_prop_hash() + { + if (prop_hash == null) + prop_hash = new Hashtable(); + return prop_hash; + } + public Vector get_veto_list() + { + if (veto_list == null) + veto_list = new Vector(); + return veto_list; + } + public Vector get_change_list() + { + if (change_list == null) + change_list = new Vector(); + return change_list; + } + public Vector get_ancestor_list() + { + if (ancestor_list == null) + ancestor_list = new Vector(); + return ancestor_list; + } + + public Object getClientProperty(Object key) + { return get_prop_hash().get(key); } + + public void putClientProperty(Object key, Object value) + { get_prop_hash().put(key, value); } + + + public void removeAncestorListener(AncestorListener listener) + { get_ancestor_list().removeElement(listener); } + + public void removePropertyChangeListener(PropertyChangeListener listener) + { get_change_list().removeElement(listener); } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) + { /* FIXME */ get_change_list().removeElement(listener); } + + public void removeVetoableChangeListener(VetoableChangeListener listener) + { get_veto_list().removeElement(listener); } + + public void addAncestorListener(AncestorListener listener) + { get_ancestor_list().addElement(listener); } + + public void addPropertyChangeListener(PropertyChangeListener listener) + { get_change_list().addElement(listener); } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) + { /* FIXME */ get_change_list().addElement(listener); } + + public void addVetoableChangeListener(VetoableChangeListener listener) + { get_veto_list().addElement(listener); } + + public void computeVisibleRect(Rectangle rect) + { + //Returns the Component's "visible rect rectangle" - the intersection of the visible rectangles for this component and all of its ancestors. + //super.computeVisibleRect(rect); + } + + + public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) + { + //Reports a bound property change. + } + public void firePropertyChange(String propertyName, byte oldValue, byte newValue) + { + // Reports a bound property change. + } + public void firePropertyChange(String propertyName, char oldValue, char newValue) + { + //Reports a bound property change. + } + + public void firePropertyChange(String propertyName, double oldValue, double newValue) + { + //Reports a bound property change. + } + + public void firePropertyChange(String propertyName, float oldValue, float newValue) + { + // Reports a bound property change. + } + public void firePropertyChange(String propertyName, int oldValue, int newValue) + { + // Reports a bound property change. + } + public void firePropertyChange(String propertyName, long oldValue, long newValue) + { + //Reports a bound property change. protected + } + + protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) + { + // Support for reporting bound property changes. + } + public void firePropertyChange(String propertyName, short oldValue, short newValue) + { + // Reports a bound property change. + } + + + protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) + { + // Support for reporting constrained property changes. + } + + public AccessibleContext getAccessibleContext() + { + // Get the AccessibleContext associated with this JComponent + return null; + } + + public ActionListener getActionForKeyStroke(KeyStroke aKeyStroke) + { + //Return the object that will perform the action registered for a given keystroke. + return null; + } + public float getAlignmentX() + { + // Overrides Container.getAlignmentX to return the vertical alignment. + return 0; + } + + public float getAlignmentY() + { + // Overrides Container.getAlignmentY to return the horizontal alignment. + return 0; + } + public boolean getAutoscrolls() + { + //Returns true if this component automatically scrolls its contents when dragged, (when contained in a component that supports scrolling, like JViewport + return false; + } + + public void setBorder(Border border) + { + //System.out.println("set border called !, new border = " + border); + this.border = border; + revalidate(); + repaint(); + } + + public Border getBorder() + { return border; } + + + public Rectangle getBounds(Rectangle rv) + { + if (rv == null) + return new Rectangle(getX(),getY(),getWidth(),getHeight()); + else + { + rv.setBounds(getX(),getY(),getWidth(),getHeight()); + return rv; + } + } + + protected Graphics getComponentGraphics(Graphics g) + { return g; } + + public int getConditionForKeyStroke(KeyStroke aKeyStroke) + { + //Return the condition that determines whether a registered action occurs in response to the specified keystroke. + return 0; + } + public int getDebugGraphicsOptions() + { + return 0; + } + + public Graphics getGraphics() + { return super.getGraphics(); } + + + // static MantaNative void DebugMe(Border b); + + public Insets getInsets() + { + // System.out.println("watch this border"); + // DebugMe(border); + // System.out.println("border = " + border); + + if (border == null) + { + //System.out.println("compares to null !"); + return super.getInsets(); + } + // System.out.println("compare failed !"); + return getBorder().getBorderInsets(this); + } + + public Insets getInsets(Insets insets) + { + Insets t = getInsets(); + + if (insets == null) + return t; + + + return new Insets(t.top, t.left, t.bottom, t.right); + } + public Point getLocation(Point rv) + { + //Store the x,y origin of this component into "return value" rv and return rv. + + if (rv == null) + return new Point(getX(), + getY()); + + rv.setLocation(getX(), + getY()); + return rv; + } + + public Dimension getMaximumSize() + { + if (max != null) + { + //System.out.println("HAVE_MAX_SIZE = " + max); + return max; + } + if (ui != null) + { + Dimension s = ui.getMaximumSize(this); + if (s != null) + { + //System.out.println(" UI-MAX = " + s + ", UI = " + ui + ", IM="+this); + return s; + } + } + Dimension p = super.getMaximumSize(); + //System.out.println(" MAX = " + p + ", COMP="+this); + return p; + } + + public Dimension getMinimumSize() + { + if (min != null) + { + //System.out.println("HAVE_MIN_SIZE = " + min); + return min; + } + if (ui != null) + { + Dimension s = ui.getMinimumSize(this); + if (s != null) + { + // System.out.println(" UI-MIN = " + s + ", UI = " + ui + ", IM="+this); + return s; + } + } + Dimension p = super.getMinimumSize(); + // System.out.println(" MIN = " + p + ", COMP="+this); + return p; + } + + public Dimension getPreferredSize() + { + if (pref != null) + { + //System.out.println("HAVE_PREF_SIZE = " + pref); + return pref; + } + + if (ui != null) + { + Dimension s = ui.getPreferredSize(this); + if (s != null) + { + //System.out.println(" UI-PREF = " + s + ", UI = " + ui + ", IM="+this); + return s; + } + } + Dimension p = super.getPreferredSize(); + // System.out.println(" PREF = " + p + ", COMP="+this); + return p; + } + + public Component getNextFocusableComponent() + { + // Return the next focusable component or null if the focus manager should choose the next focusable component automatically + return null; + } + + + public KeyStroke[] getRegisteredKeyStrokes() + { + // Return the KeyStrokes that will initiate registered actions. + return null; + } + + public JRootPane getRootPane() + { + JRootPane p = SwingUtilities.getRootPane(this); + System.out.println("root = " + p); + return p; + } + + public Dimension getSize(Dimension rv) + { + // System.out.println("JComponent, getsize()"); + if (rv == null) + return new Dimension(getWidth(), + getHeight()); + else + { + rv.setSize(getWidth(), + getHeight()); + return rv; + } + } + + + + /********************************************************************* + * + * + * tooltips: + * + * + **************************************/ + + public JToolTip createToolTip() + { + if (tooltip == null) + tooltip = new JToolTip(tool_tip_text); + return tooltip; + } + + public Point getToolTipLocation(MouseEvent event) + { return null; } + + public void setToolTipText(String text) + { tool_tip_text = text; } + + public String getToolTipText() + { return tool_tip_text; } + + public String getToolTipText(MouseEvent event) + { return tool_tip_text; } + + /********************************************************************* + * + * + * things to do with visibility: + * + * + **************************************/ + + + public Container getTopLevelAncestor() + { + // Returns the top-level ancestor of this component (either the containing Window or Applet), or null if this component has not been added to any container. + System.out.println("JComponent, getTopLevelAncestor()"); + return null; + } + + public Rectangle getVisibleRect() + { + /// Returns the Component's "visible rectangle" - the intersection of this components visible rectangle: + System.out.println("JComponent, getVisibleRect()"); + return null; + } + + public void grabFocus() + { + // Set the focus on the receiving component. + } + + public boolean hasFocus() + { + // Returns true if this Component has the keyboard focus. + return false; + } + + public boolean isDoubleBuffered() + { return use_double_buffer; } + + public boolean isFocusCycleRoot() + { + // Override this method and return true if your component is the root of of a component tree with its own focus cycle. + return false; + } + + public boolean isFocusTraversable() + { + // Identifies whether or not this component can receive the focus. + return false; + } + + public static boolean isLightweightComponent(Component c) + { + return c.getPeer() instanceof LightweightPeer; + } + + public boolean isManagingFocus() + { + // Override this method and return true if your JComponent manages focus. + return false; + } + + public boolean isOpaque() + { return opaque; } + + public boolean isOptimizedDrawingEnabled() + { + // Returns true if this component tiles its children, + return true; + } + + public boolean isPaintingTile() + { + // Returns true if the receiving component is currently painting a tile. + return false; + } + + public boolean isRequestFocusEnabled() + { + // Return whether the receiving component can obtain the focus by calling requestFocus + return false; + } + + public boolean isValidateRoot() + { + // If this method returns true, revalidate() calls by descendants of this component will cause the entire tree beginning with this root to be validated. + return false; + } + + public void paint(Graphics g) + { + // System.out.println("SWING_PAINT:" + this); + + paintBorder(g); + paintComponent(g); + paintChildren(g); + } + + protected void paintBorder(Graphics g) + { + // System.out.println("PAINT_BORDER x XXXXXXX x x x x x x x x x x x x:" + getBorder() + ", THIS="+this); + + // Paint the component's border. + if (getBorder() != null) + { + //System.out.println("PAINT_BORDER x XXXXXXX x x x x x x x x x x x x:" + getBorder() + ", THIS="+this); + + getBorder().paintBorder(this, + g, + 0, + 0, + getWidth(), + getHeight()); + } + } + + protected void paintChildren(Graphics g) + { + // Paint this component's children. + //super.paintChildren(g); + } + + protected void paintComponent(Graphics g) + { + // If the UI delegate is non-null, call its paint method. + if (ui != null) + { + ui.paint(g, this); + } + } + + /** + * Paint the specified region in this component and all of + * its descendants that overlap the region, immediately. + */ + public void paintImmediately(int x, int y, int w, int h) + { + + //Ronald: this shoudld probably redirect to the PLAF .... + } + + public void paintImmediately(Rectangle r) + { + /// Paint the specified region now. + paintImmediately((int)r.getX(), + (int)r.getY(), + (int)r.getWidth(), + (int)r.getHeight()); + } + protected String paramString() + { + // Returns a string representation of this JComponent. + return "JComponent"; + } + protected void processComponentKeyEvent(KeyEvent e) + { + // Process any key events that the component itself recognizes. + //System.out.println("COMP_KEY-EVENT: " + e); + } + protected void processFocusEvent(FocusEvent e) + { + // Processes focus events occurring on this component by dispatching them to any registered FocusListener objects. + //System.out.println("FOCUS_EVENT: " + e); + } + + protected void processKeyEvent(KeyEvent e) + { + // Override processKeyEvent to process events protected + //System.out.println("KEY-EVENT: " + e); + } + + public void processMouseMotionEvent(MouseEvent e) + { + // Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects. + //System.out.println("COMP_MOUSE-EVENT: " + e + ", MEMORY = " + Runtime.getRuntime().freeMemory()); + } + + public void registerKeyboardAction(ActionListener anAction, + KeyStroke aKeyStroke, + int aCondition) + { + registerKeyboardAction(anAction, + null, + aKeyStroke, + aCondition); + } + + public void registerKeyboardAction(ActionListener anAction, + String aCommand, + KeyStroke aKeyStroke, + int aCondition) + { + // Register a new keyboard action. + } + + + public void removeNotify() + { + // Notification to this component that it no longer has a parent component. + } + + public void repaint(long tm, int x, int y, int width, int height) + { + // Adds the specified region to the dirty region list if the component is showing. + //System.out.println("JC: repaint"); + super.repaint(tm, x,y,width,height); + } + + public void repaint(Rectangle r) + { + // Adds the specified region to the dirty region list if the component is showing. + repaint((long)0, + (int)r.getX(), + (int)r.getY(), + (int)r.getWidth(), + (int)r.getHeight()); + } + + public boolean requestDefaultFocus() + { + // Request the focus for the component that should have the focus by default. + return false; + } + + public void requestFocus() + { + // Set focus on the receiving component if isRequestFocusEnabled returns true + super.requestFocus(); + } + + public void resetKeyboardActions() + { + // Unregister all keyboard actions + } + + public void reshape(int x, int y, int w, int h) + { + /// Moves and resizes this component. + super.reshape(x,y,w,h); + } + + public void revalidate() + { + // Support for deferred automatic layout. + if (getParent() == null) + invalidate(); + } + + public void scrollRectToVisible(Rectangle aRect) + { + // Forwards the scrollRectToVisible() message to the JComponent's parent. + } + + public void setAlignmentX(float alignmentX) + { + // Set the the vertical alignment. + } + + public void setAlignmentY(float alignmentY) + { + // Set the the horizontal alignment. + } + + public void setAutoscrolls(boolean autoscrolls) + { + // If true this component will automatically scroll its contents when dragged, if contained in a component that supports scrolling, such as JViewport + } + + + public void setDebugGraphicsOptions(int debugOptions) + { + // Enables or disables diagnostic information about every graphics operation performed within the component or one of its children. + } + + public void setDoubleBuffered(boolean aFlag) + { + use_double_buffer = aFlag; + } + + public void setEnabled(boolean enabled) + { + // Sets whether or not this component is enabled. + super.setEnabled(enabled); + repaint(); + } + + public void setFont(Font font) + { + super.setFont(font); + revalidate(); + repaint(); + } + public void setBackground(Color bg) + { + super.setBackground(bg); + revalidate(); + repaint(); + } + public void setForeground(Color fg) + { + super.setForeground(fg); + revalidate(); + repaint(); + } + + public void setMaximumSize(Dimension maximumSize) + { max = maximumSize; } + + public void setMinimumSize(Dimension minimumSize) + { min = minimumSize; } + + public void setPreferredSize(Dimension preferredSize) + { pref = preferredSize; } + + public void setNextFocusableComponent(Component aComponent) + { + // Specifies the next component to get the focus after this one, for example, when the tab key is pressed. + } + + public void setOpaque(boolean isOpaque) + { + opaque = isOpaque; + revalidate(); + repaint(); + } + + + public void setRequestFocusEnabled(boolean aFlag) + { + } + + + public void setVisible(boolean aFlag) + { + // Makes the component visible or invisible. + + super.setVisible(aFlag); + if (getParent() != null) + { + Rectangle dims = getBounds(); + getParent().repaint((int)dims.getX(), + (int)dims.getY(), + (int)dims.getWidth(), + (int)dims.getHeight()); + } + } + + public void unregisterKeyboardAction(KeyStroke aKeyStroke) + { + // Unregister a keyboard action. + } + + + public void update(Graphics g) + { + paint(g); + } + + + + /****************************************** + * + * + * UI management + * + * + *********/ + + public String getUIClassID() + { + /// Return the UIDefaults key used to look up the name of the swing. + return "JComponent"; + } + + protected void setUI(ComponentUI newUI) + { + if (ui != null) + { + ui.uninstallUI(this); + } + + // Set the look and feel delegate for this component. + ui = newUI; + + if (ui != null) + { + ui.installUI(this); + } + + revalidate(); + repaint(); + } + + public void updateUI() + { + // Resets the UI property to a value from the current look and feel. + System.out.println("update UI not overwritten in class: " + this); + } + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JDesktopPane.java gcc-3.3/libjava/javax/swing/JDesktopPane.java *** gcc-3.2.3/libjava/javax/swing/JDesktopPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JDesktopPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,284 ---- + /* JDesktopPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import javax.accessibility.*; + import javax.swing.plaf.*; + + /** + * JDesktopPane + * @author Andrew Selkirk + * @version 1.0 + */ + public class JDesktopPane extends JLayeredPane implements Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJDesktopPane + */ + protected class AccessibleJDesktopPane extends AccessibleJComponent { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJDesktopPane + * @param component TODO + */ + protected AccessibleJDesktopPane(JDesktopPane component) { + super(component); + // TODO + } // AccessibleJDesktopPane() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.DESKTOP_PANE; + } // getAccessibleRole() + + + } // AccessibleJDesktopPane + + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * LIVE_DRAG_MODE + */ + public static int LIVE_DRAG_MODE = 0; + + /** + * OUTLINE_DRAG_MODE + */ + public static int OUTLINE_DRAG_MODE = 1; + + /** + * uiClassID + */ + private static final String uiClassID = "DesktopPaneUI"; + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * selectedFrame + */ + private transient JInternalFrame selectedFrame; + + /** + * desktopManager + */ + private transient DesktopManager desktopManager; + + + /** + * dragMode + */ + private int dragMode; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JDesktopPane + */ + public JDesktopPane() { + // TODO + } // JDesktopPane() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getUI + * @returns DesktopPaneUI + */ + public DesktopPaneUI getUI() { + return (DesktopPaneUI) ui; + } // getUI() + + /** + * setUI + * @param ui TODO + */ + public void setUI(DesktopPaneUI ui) { + super.setUI(ui); + } // setUI() + + /** + * setDragMode + * @param mode TODO + */ + public void setDragMode(int mode) { + this.dragMode = mode; + // TODO + } // setDragMode() + + /** + * getDragMode + * @returns int + */ + public int getDragMode() { + return dragMode; + } // getDragMode() + + /** + * getDesktopManager + * @returns DesktopManager + */ + public DesktopManager getDesktopManager() { + return desktopManager; + } // getDesktopManager() + + /** + * setDesktopManager + * @param manager TODO + */ + public void setDesktopManager(DesktopManager manager) { + this.desktopManager = manager; + // TODO + } // setDesktopManager() + + /** + * updateUI + */ + public void updateUI() { + setUI((DesktopPaneUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getAllFrames + * @returns JInternalFrame[] + */ + public JInternalFrame[] getAllFrames() { + return null; // TODO + } // getAllFrames() + + /** + * getSelectedFrame + * @returns JInternalFrame + */ + public JInternalFrame getSelectedFrame() { + return null; // TODO + } // getSelectedFrame() + + /** + * setSelectedFrame + * @param frame TODO + */ + public void setSelectedFrame(JInternalFrame frame) { + // TODO + } // setSelectedFrame() + + /** + * getAllFramesInLayer + * @param layer TODO + * @returns JInternalFrame[] + */ + public JInternalFrame[] getAllFramesInLayer(int layer) { + return null; // TODO + } // getAllFramesInLayer() + + /** + * isOpaque + * @returns boolean + */ + public boolean isOpaque() { + return true; + } // isOpaque() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJDesktopPane(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JDesktopPane diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JDialog.java gcc-3.3/libjava/javax/swing/JDialog.java *** gcc-3.2.3/libjava/javax/swing/JDialog.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JDialog.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,266 ---- + /* JDialog.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + + import javax.accessibility.Accessible; + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + /** + * Unlike JComponent derivatives, JDialog inherits from + * java.awt.Dialog. But also lets a look-and-feel component to its work. + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class JDialog extends Dialog implements Accessible + { + public final static int HIDE_ON_CLOSE = 0; + public final static int DISPOSE_ON_CLOSE = 1; + public final static int DO_NOTHING_ON_CLOSE = 2; + + protected AccessibleContext accessibleContext; + + private int close_action = HIDE_ON_CLOSE; + + /*************************************************** + * + * + * constructors + * + * + *************/ + + JDialog(Frame owner) + { + this(owner, "dialog"); + } + + JDialog(Frame owner, + String s) + { + this(owner, s, true); + } + + JDialog(Frame owner, + String s, + boolean modeld) + { + super(owner, s, modeld); + } + + JDialog(Frame owner, + // String s, + boolean modeld) + { + super(owner, "JDialog", modeld); + } + JDialog(Dialog owner) + { + this(owner, "dialog"); + } + + JDialog(Dialog owner, + String s) + { + this(owner, s, true); + } + + JDialog(Dialog owner, + String s, + boolean modeld) + { + super(owner, s, modeld); + } + + + /*************************************************** + * + * + * methods, this part is shared with JDialog, JFrame + * + * + *************/ + + + private boolean checking; + protected JRootPane rootPane; + + void setLocationRelativeTo(Component c) + { + } + + + protected void frameInit() + { + super.setLayout(new BorderLayout(1, 1)); + getRootPane(); // will do set/create + } + + public Dimension getPreferredSize() + { + Dimension d = super.getPreferredSize(); + return d; + } + + JMenuBar getJMenuBar() + { return getRootPane().getJMenuBar(); } + + void setJMenuBar(JMenuBar menubar) + { getRootPane().setJMenuBar(menubar); } + + + public void setLayout(LayoutManager manager) + { super.setLayout(manager); } + + void setLayeredPane(JLayeredPane layeredPane) + { getRootPane().setLayeredPane(layeredPane); } + + JLayeredPane getLayeredPane() + { return getRootPane().getLayeredPane(); } + + JRootPane getRootPane() + { + if (rootPane == null) + setRootPane(createRootPane()); + return rootPane; + } + + void setRootPane(JRootPane root) + { + if (rootPane != null) + remove(rootPane); + + rootPane = root; + add(rootPane, BorderLayout.CENTER); + } + + JRootPane createRootPane() + { return new JRootPane(); } + + Container getContentPane() + { return getRootPane().getContentPane(); } + + void setContentPane(Container contentPane) + { getRootPane().setContentPane(contentPane); } + + Component getGlassPane() + { return getRootPane().getGlassPane(); } + + void setGlassPane(Component glassPane) + { getRootPane().setGlassPane(glassPane); } + + + protected void addImpl(Component comp, Object constraints, int index) + { super.addImpl(comp, constraints, index); } + + + public void remove(Component comp) + { getContentPane().remove(comp); } + + protected boolean isRootPaneCheckingEnabled() + { return checking; } + + + protected void setRootPaneCheckingEnabled(boolean enabled) + { checking = enabled; } + + + public void update(Graphics g) + { paint(g); } + + protected void processKeyEvent(KeyEvent e) + { super.processKeyEvent(e); } + + ///////////////////////////////////////////////////////////////////////////////// + + + protected void processWindowEvent(WindowEvent e) + { + // System.out.println("PROCESS_WIN_EV-1: " + e); + super.processWindowEvent(e); + // System.out.println("PROCESS_WIN_EV-2: " + e); + switch (e.getID()) + { + case WindowEvent.WINDOW_CLOSING: + { + switch(close_action) + { + case DISPOSE_ON_CLOSE: + { + System.out.println("user requested dispose on close"); + dispose(); + break; + } + case HIDE_ON_CLOSE: + { + setVisible(false); + break; + } + case DO_NOTHING_ON_CLOSE: + break; + } + break; + } + + case WindowEvent.WINDOW_CLOSED: + case WindowEvent.WINDOW_OPENED: + case WindowEvent.WINDOW_ICONIFIED: + case WindowEvent.WINDOW_DEICONIFIED: + case WindowEvent.WINDOW_ACTIVATED: + case WindowEvent.WINDOW_DEACTIVATED: + break; + } + } + + + void setDefaultCloseOperation(int operation) + { close_action = operation; } + + protected String paramString() + { return "JDialog"; } + + public AccessibleContext getAccessibleContext() + { + return null; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JEditorPane.java gcc-3.3/libjava/javax/swing/JEditorPane.java *** gcc-3.2.3/libjava/javax/swing/JEditorPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JEditorPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,219 ---- + /* JEditorPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.io.*; + import java.net.*; + import javax.swing.text.*; + import javax.swing.event.*; + import java.awt.event.*; + import java.awt.*; + import javax.accessibility.*; + + public class JEditorPane extends JTextComponent + { + URL page_url; + EditorKit kit; + String ctype = "text/plain"; + boolean focus_root; + boolean manages_focus; + + + public JEditorPane() + { + } + + public JEditorPane(String url) + { + this(); + setPage(url); + } + + public JEditorPane(String type, String text) + { + ctype = text; + setText(text); + } + + public JEditorPane(URL url) + { + setPage(url); + } + + void addHyperlinkListener(HyperlinkListener listener) + { } + + protected EditorKit createDefaultEditorKit() + { return new PlainEditorKit(); } + + static EditorKit createEditorKitForContentType(String type) + { return new PlainEditorKit(); } + + void fireHyperlinkUpdate(HyperlinkEvent e) + { + } + + public AccessibleContext getAccessibleContext() + { return null; } + + String getContentType() + { return ctype; } + + EditorKit getEditorKit() + { return kit; } + + static String getEditorKitClassNameForContentType(String type) + { return "text/plain"; } + + EditorKit getEditorKitForContentType(String type) + { return kit; } + + public Dimension getPreferredSize() + { + //Returns the preferred size for the JEditorPane. + return super.getPreferredSize(); + } + + public boolean getScrollableTracksViewportHeight() + { return false; } + public boolean getScrollableTracksViewportWidth() + { return false; } + + URL getPage() + { return page_url; } + + protected InputStream getStream(URL page) + { + try { + return page.openStream(); + } catch (Exception e) { + System.out.println("Hhmmm, failed to open stream: " + e); + } + return null; + } + + public String getText() + { return super.getText(); } + + public String getUIClassID() + { return "JEditorPane"; } + + public boolean isFocusCycleRoot() + { return focus_root; } + + public boolean isManagingFocus() + { return manages_focus; } + + protected String paramString() + { return "JEditorPane"; } + + protected void processComponentKeyEvent(KeyEvent e) + { + //Overridden to handle processing of tab/shift tab. + } + + protected void processKeyEvent(KeyEvent e) + { + //Make sure that TAB and Shift-TAB events get consumed, so that awt doesn't attempt focus traversal. + } + + void read(InputStream in, Object desc) + { + //This method initializes from a stream. + } + + static void registerEditorKitForContentType(String type, String classname) + { + //Establishes the default bindings of type to classname. + } + + static void registerEditorKitForContentType(String type, String classname, ClassLoader loader) + { + //Establishes the default bindings of type to classname. + } + + void removeHyperlinkListener(HyperlinkListener listener) + { + //Removes a hyperlink listener. + } + + void replaceSelection(String content) + { + //Replaces the currently selected content with new content represented by the given string. + } + + protected void scrollToReference(String reference) + { + //Scrolls the view to the given reference location (that is, the value returned by the UL.getRef method for the URL being displayed). + } + + void setContentType(String type) + { + ctype = type; + invalidate(); + repaint(); + } + + void setEditorKit(EditorKit kit) + { + this.kit = kit; + invalidate(); + repaint(); + } + + void setEditorKitForContentType(String type, EditorKit k) + { + ctype = type; + setEditorKit(k); + } + + void setPage(String url) + { + // Sets the current URL being displayed. + } + + void setPage(URL page) + { + // Sets the current URL being displayed. + } + + public void setText(String t) + { + super.setText(t); + } + } // class JEditorPane diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JFileChooser.java gcc-3.3/libjava/javax/swing/JFileChooser.java *** gcc-3.2.3/libjava/javax/swing/JFileChooser.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JFileChooser.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,968 ---- + /* JFileChooser.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.io.*; + import java.util.*; + import javax.accessibility.*; + import javax.swing.filechooser.*; + import javax.swing.filechooser.FileFilter; + import javax.swing.plaf.*; + + /** + * JFileChooser + * @author Andrew Selkirk + * @version 1.0 + */ + public class JFileChooser extends JComponent implements Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJFileChooser + */ + protected class AccessibleJFileChooser extends AccessibleJComponent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJFileChooser + * @param component TODO + */ + protected AccessibleJFileChooser(JFileChooser component) { + super(component); + // TODO + } // AccessibleJFileChooser() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.FILE_CHOOSER; + } // getAccessibleRole() + + + } // AccessibleJFileChooser + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "FileChooserUI"; + + /** + * OPEN_DIALOG + */ + public static final int OPEN_DIALOG = 0; + + /** + * SAVE_DIALOG + */ + public static final int SAVE_DIALOG = 1; + + /** + * CUSTOM_DIALOG + */ + public static final int CUSTOM_DIALOG = 2; + + /** + * CANCEL_OPTION + */ + public static final int CANCEL_OPTION = 1; + + /** + * APPROVE_OPTION + */ + public static final int APPROVE_OPTION = 0; + + /** + * ERROR_OPTION + */ + public static final int ERROR_OPTION = -1; + + /** + * FILES_ONLY + */ + public static final int FILES_ONLY = 0; + + /** + * DIRECTORIES_ONLY + */ + public static final int DIRECTORIES_ONLY = 1; + + /** + * FILES_AND_DIRECTORIES + */ + public static final int FILES_AND_DIRECTORIES = 2; + + /** + * CANCEL_SELECTION + */ + public static final String CANCEL_SELECTION = "CancelSelection"; + + /** + * APPROVE_SELECTION + */ + public static final String APPROVE_SELECTION = "ApproveSelection"; + + /** + * APPROVE_BUTTON_TEXT_CHANGED_PROPERTY + */ + public static final String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY = "ApproveButtonTextChangedProperty"; + + /** + * APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY + */ + public static final String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY = "ApproveButtonToolTipTextChangedProperty"; + + /** + * APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY + */ + public static final String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY = "ApproveButtonMnemonicChangedProperty"; + + /** + * CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY + */ + public static final String CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY = "ControlButtonsAreShownChangedProperty"; + + /** + * DIRECTORY_CHANGED_PROPERTY + */ + public static final String DIRECTORY_CHANGED_PROPERTY = "directoryChanged"; + + /** + * SELECTED_FILE_CHANGED_PROPERTY + */ + public static final String SELECTED_FILE_CHANGED_PROPERTY = "SelectedFileChangedProperty"; + + /** + * SELECTED_FILES_CHANGED_PROPERTY + */ + public static final String SELECTED_FILES_CHANGED_PROPERTY = "SelectedFilesChangedProperty"; + + /** + * MULTI_SELECTION_ENABLED_CHANGED_PROPERTY + */ + public static final String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY = "MultiSelectionEnabledChangedProperty"; + + /** + * FILE_SYSTEM_VIEW_CHANGED_PROPERTY + */ + public static final String FILE_SYSTEM_VIEW_CHANGED_PROPERTY = "FileSystemViewChanged"; + + /** + * FILE_VIEW_CHANGED_PROPERTY + */ + public static final String FILE_VIEW_CHANGED_PROPERTY = "fileViewChanged"; + + /** + * FILE_HIDING_CHANGED_PROPERTY + */ + public static final String FILE_HIDING_CHANGED_PROPERTY = "FileHidingChanged"; + + /** + * FILE_FILTER_CHANGED_PROPERTY + */ + public static final String FILE_FILTER_CHANGED_PROPERTY = "fileFilterChanged"; + + /** + * FILE_SELECTION_MODE_CHANGED_PROPERTY + */ + public static final String FILE_SELECTION_MODE_CHANGED_PROPERTY = "fileSelectionChanged"; + + /** + * ACCESSORY_CHANGED_PROPERTY + */ + public static final String ACCESSORY_CHANGED_PROPERTY = "AccessoryChangedProperty"; + + /** + * ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY + */ + public static final String ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY = "acceptAllFileFilterUsedChanged"; + + /** + * DIALOG_TITLE_CHANGED_PROPERTY + */ + public static final String DIALOG_TITLE_CHANGED_PROPERTY = "DialogTitleChangedProperty"; + + /** + * DIALOG_TYPE_CHANGED_PROPERTY + */ + public static final String DIALOG_TYPE_CHANGED_PROPERTY = "DialogTypeChangedProperty"; + + /** + * CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY + */ + public static final String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY = "ChoosableFileFilterChangedProperty"; + + /** + * dialogTitle + */ + private String dialogTitle; + + /** + * approveButtonText + */ + private String approveButtonText; + + /** + * approveButtonToolTipText + */ + private String approveButtonToolTipText; + + /** + * approveButtonMnemonic + */ + private int approveButtonMnemonic; + + /** + * actionListener + */ + private ActionListener actionListener; + + /** + * filters + */ + private Vector filters; + + /** + * dialog + */ + private JDialog dialog; + + /** + * dialogType + */ + private int dialogType; + + /** + * returnValue + */ + private int returnValue; + + /** + * accessory + */ + private JComponent accessory; + + /** + * fileView + */ + private FileView fileView; + + /** + * uiFileView + */ + private FileView uiFileView; + + /** + * controlsShown + */ + private boolean controlsShown; + + /** + * useFileHiding + */ + private boolean useFileHiding; + + /** + * fileSelectionMode + */ + private int fileSelectionMode; + + /** + * multiSelectionEnabled + */ + private boolean multiSelectionEnabled; + + /** + * useAcceptAllFileFilter + */ + private boolean useAcceptAllFileFilter; + + /** + * fileFilter + */ + private FileFilter fileFilter; + + /** + * fileSystemView + */ + private FileSystemView fileSystemView; + + /** + * currentDirectory + */ + private File currentDirectory; + + /** + * selectedFile + */ + private File selectedFile; + + /** + * selectedFiles + */ + private File[] selectedFiles; + + /** + * accessibleContext + */ + protected AccessibleContext accessibleContext; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JFileChooser + */ + public JFileChooser() { + // TODO + } // JFileChooser() + + /** + * Constructor JFileChooser + * @param currentDirectoryPath TODO + */ + public JFileChooser(String currentDirectoryPath) { + // TODO + } // JFileChooser() + + /** + * Constructor JFileChooser + * @param currentDirectory TODO + */ + public JFileChooser(File currentDirectory) { + // TODO + } // JFileChooser() + + /** + * Constructor JFileChooser + * @param value0 TODO + */ + public JFileChooser(FileSystemView fsv) { + // TODO + } // JFileChooser() + + /** + * Constructor JFileChooser + * @param currentDirectory TODO + * @param fsv TODO + */ + public JFileChooser(File currentDirectory, FileSystemView fsv) { + // TODO + } // JFileChooser() + + /** + * Constructor JFileChooser + * @param currentDirectoryPath TODO + * @param fsv TODO + */ + public JFileChooser(String currentDirectoryPath, FileSystemView fsv) { + // TODO + } // JFileChooser() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getName + * @param file TODO + * @returns String + */ + public String getName(File file) { + return null; // TODO + } // getName() + + /** + * setup + * @param view TODO + */ + protected void setup(FileSystemView view) { + // TODO + } // setup() + + /** + * accept + * @param file TODO + * @returns boolean + */ + public boolean accept(File file) { + return false; // TODO + } // accept() + + /** + * getSelectedFile + * @returns File + */ + public File getSelectedFile() { + return null; // TODO + } // getSelectedFile() + + /** + * setSelectedFile + * @param file TODO + */ + public void setSelectedFile(File file) { + // TODO + } // setSelectedFile() + + /** + * getSelectedFiles + * @returns File[] + */ + public File[] getSelectedFiles() { + return null; // TODO + } // getSelectedFiles() + + /** + * setSelectedFiles + * @param files TODO + */ + public void setSelectedFiles(File[] files) { + // TODO + } // setSelectedFiles() + + /** + * getCurrentDirectory + * @returns File + */ + public File getCurrentDirectory() { + return null; // TODO + } // getCurrentDirectory() + + /** + * setCurrentDirectory + * @param directory TODO + */ + public void setCurrentDirectory(File directory) { + // TODO + } // setCurrentDirectory() + + /** + * changeToParentDirectory + */ + public void changeToParentDirectory() { + // TODO + } // changeToParentDirectory() + + /** + * rescanCurrentDirectory + */ + public void rescanCurrentDirectory() { + // TODO + } // rescanCurrentDirectory() + + /** + * ensureFileIsVisible + * @param file TODO + */ + public void ensureFileIsVisible(File file) { + // TODO + } // ensureFileIsVisible() + + /** + * showOpenDialog + * @param parent TODO + * @returns int + */ + public int showOpenDialog(Component parent) { + return 0; // TODO + } // showOpenDialog() + + /** + * showSaveDialog + * @param parent TODO + * @returns int + */ + public int showSaveDialog(Component parent) { + return 0; // TODO + } // showSaveDialog() + + /** + * showDialog + * @param parent TODO + * @param approveButtonText TODO + * @returns int + */ + public int showDialog(Component parent, String approveButtonText) { + return 0; // TODO + } // showDialog() + + /** + * getControlButtonsAreShown + * @returns boolean + */ + public boolean getControlButtonsAreShown() { + return false; // TODO + } // getControlButtonsAreShown() + + /** + * setControlButtonsAreShown + * @param value TODO + */ + public void setControlButtonsAreShown(boolean value) { + // TODO + } // setControlButtonsAreShown() + + /** + * getDialogType + * @returns int + */ + public int getDialogType() { + return 0; // TODO + } // getDialogType() + + /** + * setDialogType + * @param type TODO + */ + public void setDialogType(int type) { + // TODO + } // setDialogType() + + /** + * setDialogTitle + * @param title TODO + */ + public void setDialogTitle(String title) { + // TODO + } // setDialogTitle() + + /** + * getDialogTitle + * @returns String + */ + public String getDialogTitle() { + return null; // TODO + } // getDialogTitle() + + /** + * setApproveButtonToolTipText + * @param text TODO + */ + public void setApproveButtonToolTipText(String text) { + // TODO + } // setApproveButtonToolTipText() + + /** + * getApproveButtonToolTipText + * @returns String + */ + public String getApproveButtonToolTipText() { + return null; // TODO + } // getApproveButtonToolTipText() + + /** + * getApproveButtonMnemonic + * @returns int + */ + public int getApproveButtonMnemonic() { + return 0; // TODO + } // getApproveButtonMnemonic() + + /** + * setApproveButtonMnemonic + * @param mnemonic TODO + */ + public void setApproveButtonMnemonic(int mnemonic) { + // TODO + } // setApproveButtonMnemonic() + + /** + * setApproveButtonMnemonic + * @param mnemonic TODO + */ + public void setApproveButtonMnemonic(char mnemonic) { + // TODO + } // setApproveButtonMnemonic() + + /** + * setApproveButtonText + * @param text TODO + */ + public void setApproveButtonText(String text) { + // TODO + } // setApproveButtonText() + + /** + * getApproveButtonText + * @returns String + */ + public String getApproveButtonText() { + return null; // TODO + } // getApproveButtonText() + + /** + * getChoosableFileFilters + * @returns FileFilter[] + */ + public FileFilter[] getChoosableFileFilters() { + return null; // TODO + } // getChoosableFileFilters() + + /** + * addChoosableFileFilter + * @param filter TODO + */ + public void addChoosableFileFilter(FileFilter filter) { + // TODO + } // addChoosableFileFilter() + + /** + * removeChoosableFileFilter + * @param filter TODO + * @returns boolean + */ + public boolean removeChoosableFileFilter(FileFilter filter) { + return false; // TODO + } // removeChoosableFileFilter() + + /** + * resetChoosableFileFilters + */ + public void resetChoosableFileFilters() { + // TODO + } // resetChoosableFileFilters() + + /** + * getAcceptAllFileFilter + * @returns FileFilter + */ + public FileFilter getAcceptAllFileFilter() { + return null; // TODO + } // getAcceptAllFileFilter() + + /** + * isAcceptAllFileFilterUsed + * @returns boolean + */ + public boolean isAcceptAllFileFilterUsed() { + return false; // TODO + } // isAcceptAllFileFilterUsed() + + /** + * setAcceptAllFileFilterUsed + * @param value TODO + */ + public void setAcceptAllFileFilterUsed(boolean value) { + // TODO + } // setAcceptAllFileFilterUsed() + + /** + * getAccessory + * @returns JComponent + */ + public JComponent getAccessory() { + return null; // TODO + } // getAccessory() + + /** + * setAccessory + * @param accessory TODO + */ + public void setAccessory(JComponent accessory) { + // TODO + } // setAccessory() + + /** + * setFileSelectionMode + * @param mode TODO + */ + public void setFileSelectionMode(int mode) { + // TODO + } // setFileSelectionMode() + + /** + * getFileSelectionMode + * @returns int + */ + public int getFileSelectionMode() { + return 0; // TODO + } // getFileSelectionMode() + + /** + * isFileSelectionEnabled + * @returns boolean + */ + public boolean isFileSelectionEnabled() { + return false; // TODO + } // isFileSelectionEnabled() + + /** + * isDirectorySelectionEnabled + * @returns boolean + */ + public boolean isDirectorySelectionEnabled() { + return false; // TODO + } // isDirectorySelectionEnabled() + + /** + * isMultiSelectionEnabled + * @returns boolean + */ + public boolean isMultiSelectionEnabled() { + return false; // TODO + } // isMultiSelectionEnabled() + + /** + * setMultiSelectionEnabled + * @param enabled TODO + */ + public void setMultiSelectionEnabled(boolean enabled) { + // TODO + } // setMultiSelectionEnabled() + + /** + * isFileHidingEnabled + * @returns boolean + */ + public boolean isFileHidingEnabled() { + return false; // TODO + } // isFileHidingEnabled() + + /** + * setFileHidingEnabled + * @param enabled TODO + */ + public void setFileHidingEnabled(boolean enabled) { + // TODO + } // setFileHidingEnabled() + + /** + * getFileFilter + * @returns FileFilter + */ + public FileFilter getFileFilter() { + return null; // TODO + } // getFileFilter() + + /** + * setFileFilter + * @param filter TODO + */ + public void setFileFilter(FileFilter filter) { + // TODO + } // setFileFilter() + + /** + * getFileView + * @returns FileView + */ + public FileView getFileView() { + return null; // TODO + } // getFileView() + + /** + * setFileView + * @param view TODO + */ + public void setFileView(FileView view) { + // TODO + } // setFileView() + + /** + * getDescription + * @param file TODO + * @returns String + */ + public String getDescription(File file) { + return null; // TODO + } // getDescription() + + /** + * getTypeDescription + * @param file TODO + * @returns String + */ + public String getTypeDescription(File file) { + return null; // TODO + } // getTypeDescription() + + /** + * getIcon + * @param file TODO + * @returns Icon + */ + public Icon getIcon(File file) { + return null; // TODO + } // getIcon() + + /** + * isTraversable + * @param file TODO + * @returns boolean + */ + public boolean isTraversable(File file) { + return false; // TODO + } // isTraversable() + + /** + * getFileSystemView + * @returns FileSystemView + */ + public FileSystemView getFileSystemView() { + return null; // TODO + } // getFileSystemView() + + /** + * setFileSystemView + * @param fsv TODO + */ + public void setFileSystemView(FileSystemView fsv) { + // TODO + } // setFileSystemView() + + /** + * approveSelection + */ + public void approveSelection() { + // TODO + } // approveSelection() + + /** + * cancelSelection + */ + public void cancelSelection() { + // TODO + } // cancelSelection() + + /** + * addActionListener + * @param listener TODO + */ + public void addActionListener(ActionListener listener) { + // TODO + } // addActionListener() + + /** + * removeActionListener + * @param listener TODO + */ + public void removeActionListener(ActionListener listener) { + // TODO + } // removeActionListener() + + /** + * fireActionPerformed + * @param command TODO + */ + protected void fireActionPerformed(String command) { + // TODO + } // fireActionPerformed() + + /** + * updateUI + */ + public void updateUI() { + setUI((FileChooserUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getUI + * @returns FileChooserUI + */ + public FileChooserUI getUI() { + return (FileChooserUI) ui; + } // getUI() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJFileChooser(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JFileChooser diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JFrame.java gcc-3.3/libjava/javax/swing/JFrame.java *** gcc-3.2.3/libjava/javax/swing/JFrame.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JFrame.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,245 ---- + /* JFrame.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + /** + * Unlike JComponent derivatives, JFrame inherits from + * java.awt.Frame. But also lets a look-and-feel component to its work. + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class JFrame extends Frame + { + public final static int HIDE_ON_CLOSE = 0; + public final static int EXIT_ON_CLOSE = 1; + public final static int DISPOSE_ON_CLOSE = 2; + public final static int DO_NOTHING_ON_CLOSE = 3; + + protected AccessibleContext accessibleContext; + + private int close_action = EXIT_ON_CLOSE; + + + /*************************************************** + * + * initia + * + * + *************/ + + + public JFrame() + { + super("JFrame"); + frameInit(); + } + + public JFrame(String title) + { + super(title); + frameInit(); + } + + + /*************************************************** + * + * + * methods, this part is shared with JDialog, JFrame + * + * + *************/ + + + private boolean checking; + protected JRootPane rootPane; + + + protected void frameInit() + { + super.setLayout(new BorderLayout(1, 1)); + getRootPane(); // will do set/create + } + + public Dimension getPreferredSize() + { + Dimension d = super.getPreferredSize(); + return d; + } + + JMenuBar getJMenuBar() + { return getRootPane().getJMenuBar(); } + + void setJMenuBar(JMenuBar menubar) + { getRootPane().setJMenuBar(menubar); } + + + public void setLayout(LayoutManager manager) + { super.setLayout(manager); } + + void setLayeredPane(JLayeredPane layeredPane) + { getRootPane().setLayeredPane(layeredPane); } + + JLayeredPane getLayeredPane() + { return getRootPane().getLayeredPane(); } + + JRootPane getRootPane() + { + if (rootPane == null) + setRootPane(createRootPane()); + return rootPane; + } + + void setRootPane(JRootPane root) + { + if (rootPane != null) + remove(rootPane); + + rootPane = root; + add(rootPane, BorderLayout.CENTER); + } + + JRootPane createRootPane() + { return new JRootPane(); } + + Container getContentPane() + { return getRootPane().getContentPane(); } + + void setContentPane(Container contentPane) + { getRootPane().setContentPane(contentPane); } + + Component getGlassPane() + { return getRootPane().getGlassPane(); } + + void setGlassPane(Component glassPane) + { getRootPane().setGlassPane(glassPane); } + + + protected void addImpl(Component comp, Object constraints, int index) + { super.addImpl(comp, constraints, index); } + + + public void remove(Component comp) + { getContentPane().remove(comp); } + + protected boolean isRootPaneCheckingEnabled() + { return checking; } + + + protected void setRootPaneCheckingEnabled(boolean enabled) + { checking = enabled; } + + + public void update(Graphics g) + { paint(g); } + + protected void processKeyEvent(KeyEvent e) + { super.processKeyEvent(e); } + + ///////////////////////////////////////////////////////////////////////////////// + + public AccessibleContext getAccessibleContext() + { + return accessibleContext; + } + + int getDefaultCloseOperation() + { return close_action; } + + + + protected String paramString() + { return "JFrame"; } + + + protected void processWindowEvent(WindowEvent e) + { + // System.out.println("PROCESS_WIN_EV-1: " + e); + super.processWindowEvent(e); + // System.out.println("PROCESS_WIN_EV-2: " + e); + switch (e.getID()) + { + case WindowEvent.WINDOW_CLOSING: + { + switch(close_action) + { + case EXIT_ON_CLOSE: + { + System.out.println("user requested exit on close"); + System.exit(1); + break; + } + case DISPOSE_ON_CLOSE: + { + System.out.println("user requested dispose on close"); + dispose(); + break; + } + case HIDE_ON_CLOSE: + { + setVisible(false); + break; + } + case DO_NOTHING_ON_CLOSE: + break; + } + break; + } + + case WindowEvent.WINDOW_CLOSED: + case WindowEvent.WINDOW_OPENED: + case WindowEvent.WINDOW_ICONIFIED: + case WindowEvent.WINDOW_DEICONIFIED: + case WindowEvent.WINDOW_ACTIVATED: + case WindowEvent.WINDOW_DEACTIVATED: + break; + } + } + + + void setDefaultCloseOperation(int operation) + { close_action = operation; } + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JInternalFrame.java gcc-3.3/libjava/javax/swing/JInternalFrame.java *** gcc-3.2.3/libjava/javax/swing/JInternalFrame.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JInternalFrame.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,45 ---- + /* JInternalFrame.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + /** + * STUBBED + */ + public class JInternalFrame extends JComponent + /*implements Accessible, WindowConstants, RootPaneContainer*/ + { + } // class JInternalFrame diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JLabel.java gcc-3.3/libjava/javax/swing/JLabel.java *** gcc-3.2.3/libjava/javax/swing/JLabel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JLabel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,240 ---- + /* JLabel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import javax.swing.plaf.*; + + + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + + public class JLabel extends JComponent implements SwingConstants + { + String text; + Icon icon; + int gap; + int align; + + int hor_align; + int hor_text_pos; + + int vert_align; + int vert_text_pos; + + public JLabel() + { + this("", null, 0); + } + + public JLabel(Icon image) + { + this("", image, 0); + } + + public JLabel(Icon image, int horizontalAlignment) + { + this("", image, horizontalAlignment); + } + + public JLabel(String text) + { + this(text, null, 0); + } + + public JLabel(String text, int horizontalAlignment) + { + this(text, null, horizontalAlignment); + } + + public JLabel(String text, Icon icon, int horizontalAlignment) + { + // do the work..... + this.text = text; + setIcon(icon); + this.align = horizontalAlignment; + + updateUI(); // get a proper ui + } + + + protected int checkHorizontalKey(int key, String message) + { + // Verify that key is a legal value for the horizontalAlignment properties. + return 0; + } + protected int checkVerticalKey(int key, String message) + { + // Verify that key is a legal value for the verticalAlignment or verticalTextPosition properties. + return 0; + } + public AccessibleContext getAccessibleContext() + { + // Get the AccessibleContext of this object + return null; + } + public Icon getDisabledIcon() + { + // Returns the value of the disabledIcon property if it's been set, If it hasn't been set and the value of the icon property is an ImageIcon, we compute a "grayed out" version of the icon and update the disabledIcon property with that. + return null; + } + public int getDisplayedMnemonic() + { + // Return the keycode that indicates a mnemonic key. + return 0; + } + public int getHorizontalAlignment() + { + // Returns the alignment of the label's contents along the X axis. + return hor_align; + } + public int getHorizontalTextPosition() + { + // Returns the horizontal position of the label's text, relative to its image. + return hor_text_pos; + } + + public Icon getIcon() + { return icon; } + + public int getIconTextGap() + { + // Returns the amount of space between the text and the icon displayed in this label. + return 0; + } + public Component getLabelFor() + { + // Get the component this is labelling. + return null; + } + public String getText() + { return text; } + + public String getUIClassID() + { return "JLabel"; } + + public int getVerticalAlignment() + { + // Returns the alignment of the label's contents along the Y axis. + return vert_align; + } + public int getVerticalTextPosition() + { + // Returns the vertical position of the label's text, relative to its image. + return vert_text_pos; + } + + public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) + { + // This is overriden to return false if the current Icon's Image is not equal to the passed in Image img. + return (img == icon); + } + protected String paramString() + { + // Returns a string representation of this JLabel. + return "JLabel"; + } + public void setDisabledIcon(Icon disabledIcon) + { + // Set the icon to be displayed if this JLabel is "disabled" (JLabel.setEnabled(false)). + } + public void setDisplayedMnemonic(char aChar) + { + // Specifies the displayedMnemonic as a char value. + } + public void setDisplayedMnemonic(int key) + { + // Specify a keycode that indicates a mnemonic key. + } + public void setHorizontalAlignment(int alignment) + { + // Sets the alignment of the label's contents along the X axis. + hor_align = alignment; + } + public void setHorizontalTextPosition(int textPosition) + { + // Sets the horizontal position of the label's text, relative to its image. + hor_text_pos = textPosition; + } + public void setIcon(Icon icon) + { + this.icon = icon; + if (icon != null) + { + // XXX FIXME - icons do not know their parent + // icon.setParent(this); + } + revalidate(); + repaint(); + } + + public void setIconTextGap(int iconTextGap) + { + gap = iconTextGap; + } + + public void setLabelFor(Component c) + { + // Set the component this is labelling. + } + public void setText(String text) + { + this.text = text; + revalidate(); + repaint(); + } + + public void setVerticalAlignment(int alignment) + { + // Sets the alignment of the label's contents along the Y axis. + vert_align = alignment; + } + public void setVerticalTextPosition(int textPosition) + { + // Sets the vertical position of the label's text, relative to its image. + vert_text_pos = textPosition; + } + public void updateUI() + { + LabelUI b = (LabelUI)UIManager.getUI(this); + setUI(b); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JLayeredPane.java gcc-3.3/libjava/javax/swing/JLayeredPane.java *** gcc-3.2.3/libjava/javax/swing/JLayeredPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JLayeredPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,58 ---- + /* JLayeredPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + + public class JLayeredPane extends JComponent + { + JLayeredPane() + { + } + + + protected void addImpl(Component comp, Object constraints, int index) + { + super.addImpl(comp, constraints, index); + + comp.validate(); + comp.repaint(); + } + + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JList.java gcc-3.3/libjava/javax/swing/JList.java *** gcc-3.2.3/libjava/javax/swing/JList.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JList.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,239 ---- + /* JList.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import javax.swing.event.*; + + import java.awt.*; + import javax.swing.plaf.*; + import java.util.*; + + + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + public class JList extends JComponent implements Scrollable + { + Color select_back, select_fore; + ListCellRenderer render; + int visibles = 8; + + ListModel model; + ListSelectionModel sel_model; + + public JList() + { + init(); + } + + public JList(Object[] listData) + { + init(); + setListData(listData); + } + + + public JList(Vector listData) + { + init(); + setListData(listData); + } + + + public JList(ListModel listData) + { + init(); + setModel(listData); + } + void init() + { + render = new DefaultCellRenderer(); + + sel_model = new DefaultListSelectionModel(); + setModel(new DefaultListModel()); + + select_back = new Color(0,0,255); + select_fore = new Color(255,255,255); + + updateUI(); + } + + + public int getVisibleRowCount() + { return visibles; } + public void setVisibleRowCount(int visibleRowCount) + { + visibles = visibleRowCount; + invalidate(); + repaint(); + } + + void addListSelectionListener(ListSelectionListener listener) + { sel_model.addListSelectionListener(listener); } + void removeListSelectionListener(ListSelectionListener listener) + { sel_model.removeListSelectionListener(listener); } + + void setSelectionMode(int a) + { sel_model.setSelectionMode(a); } + void setSelectedIndex(int a) + { sel_model.setSelectionInterval(a,a); } + int getSelectedIndex() + { return sel_model.getMinSelectionIndex(); } + Object getSelectedValue() + { + int index = getSelectedIndex(); + if (index == -1) + return null; + return getModel().getElementAt(index); + } + + Color getSelectionBackground() + { return select_back; } + Color getSelectionForeground() + { return select_fore; } + + + public void setListData(final Object[] listData) + { + class AL extends AbstractListModel + { + public int getSize() { return listData.length; } + public Object getElementAt(int i) { return listData[i]; } + }; + + setModel (new AL()); + } + + public void setListData(final Vector listData) + { + // XXX - FIXME Don't also name this AL, workaround for gcj 3.1. + class ALData extends AbstractListModel + { + public int getSize() { return listData.size(); } + public Object getElementAt(int i) { return listData.elementAt(i); } + }; + + setModel (new ALData()); + } + + + public ListCellRenderer getCellRenderer() + { return render; } + public void setCellRenderer(ListCellRenderer cellRenderer) + { + render = cellRenderer; + invalidate(); + repaint(); + } + + public void setModel(ListModel model) + { + ListDataListener l = new ListDataListener() + { + public void intervalAdded(ListDataEvent e) { + repaint(); + } + public void intervalRemoved(ListDataEvent e) { + repaint(); + } + public void contentsChanged(ListDataEvent e) { + repaint(); + } + }; + + this.model = model; + model.addListDataListener(l); + } + + public ListModel getModel() + { return model; } + + + public ListUI getUI() + { return (ListUI) ui; } + public void setUI(ListUI ui) + { super.setUI(ui); } + + public void updateUI() + { + setUI((ListUI)UIManager.getUI(this)); + } + + public String getUIClassID() + { + return "JList"; + } + + + public AccessibleContext getAccessibleContext() + { + return null; + } + + public Dimension getPreferredScrollableViewportSize() + { + return null; + } + + public int getScrollableUnitIncrement(Rectangle visibleRect, + int orientation, + int direction) + { + return 1; + } + + public int getScrollableBlockIncrement(Rectangle visibleRect, + int orientation, + int direction) + { + return 1; + } + + public boolean getScrollableTracksViewportWidth() + { + return false; + } + + public boolean getScrollableTracksViewportHeight() + { + return false; + } + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JMenuBar.java gcc-3.3/libjava/javax/swing/JMenuBar.java *** gcc-3.2.3/libjava/javax/swing/JMenuBar.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JMenuBar.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,45 ---- + /* JMenuBar.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + public class JMenuBar extends JComponent + { + JMenuBar() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JMenuItem.java gcc-3.3/libjava/javax/swing/JMenuItem.java *** gcc-3.2.3/libjava/javax/swing/JMenuItem.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JMenuItem.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,463 ---- + /* JMenuItem.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.beans.*; + import java.io.*; + import javax.accessibility.*; + import javax.swing.event.*; + import javax.swing.plaf.*; + + /** + * JMenuItem + * @author Andrew Selkirk + * @version 1.0 + */ + public class JMenuItem extends AbstractButton implements Accessible, MenuElement { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJMenuItem + */ + protected class AccessibleJMenuItem extends AccessibleAbstractButton + implements ChangeListener { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJMenuItem + * @param component TODO + */ + AccessibleJMenuItem(JMenuItem component) { + super(component); + // TODO + } // AccessibleJMenuItem() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * stateChanged + * @param event TODO + */ + public void stateChanged(ChangeEvent event) { + // TODO + } // stateChanged() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.MENU_ITEM; + } // getAccessibleRole() + + + } // AccessibleJMenuItem + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "MenuItemUI"; + + /** + * accelerator + */ + private KeyStroke accelerator; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JMenuItem + */ + public JMenuItem() { + // TODO + } // JMenuItem() + + /** + * Constructor JMenuItem + * @param icon TODO + */ + public JMenuItem(Icon icon) { + // TODO + } // JMenuItem() + + /** + * Constructor JMenuItem + * @param text TODO + */ + public JMenuItem(String text) { + // TODO + } // JMenuItem() + + /** + * Constructor JMenuItem + * @param action TODO + */ + public JMenuItem(Action action) { + // TODO + } // JMenuItem() + + /** + * Constructor JMenuItem + * @param text TODO + * @param icon TODO + */ + public JMenuItem(String text, Icon icon) { + // TODO + } // JMenuItem() + + /** + * Constructor JMenuItem + * @param text TODO + * @param mnemonic TODO + */ + public JMenuItem(String text, int mnemonic) { + // TODO + } // JMenuItem() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * readObject + * @param stream TODO + * @exception IOException TODO + * @exception ClassNotFoundException TODO + */ + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + // TODO + } // readObject() + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * init + * @param text TODO + * @param icon TODO + */ + protected void init(String text, Icon icon) { + // TODO + } // init() + + /** + * setUI + * @param ui TODO + */ + public void setUI(MenuItemUI ui) { + super.setUI(ui); + // TODO + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((MenuItemUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * isArmed + * @returns boolean + */ + public boolean isArmed() { + return false; // TODO + } // isArmed() + + /** + * setArmed + * @param armed TODO + */ + public void setArmed(boolean armed) { + // TODO + } // setArmed() + + /** + * setEnabled + * @param enabled TODO + */ + public void setEnabled(boolean enabled) { + // TODO + } // setEnabled() + + /** + * getAccelerator + * @returns KeyStroke + */ + public KeyStroke getAccelerator() { + return null; // TODO + } // getAccelerator() + + /** + * setAccelerator + * @param keystroke TODO + */ + public void setAccelerator(KeyStroke keystroke) { + // TODO + } // setAccelerator() + + /** + * configurePropertiesFromAction + * @param action TODO + */ + protected void configurePropertiesFromAction(Action action) { + // TODO + } // configurePropertiesFromAction() + + /** + * createActionPropertyChangeListener + * @param action TODO + * @returns PropertyChangeListener + */ + protected PropertyChangeListener createActionPropertyChangeListener(Action action) { + return null; // TODO + } // createActionPropertyChangeListener() + + /** + * processMouseEvent + * @param event TODO + * @param path TODO + * @param manager TODO + */ + public void processMouseEvent(MouseEvent event, MenuElement[] path, + MenuSelectionManager manager) { + // TODO + } // processMouseEvent() + + /** + * processKeyEvent + * @param event TODO + * @param path TODO + * @param manager TODO + */ + public void processKeyEvent(KeyEvent event, MenuElement[] path, + MenuSelectionManager manager) { + // TODO + } // processKeyEvent() + + /** + * processMenuDragMouseEvent + * @param event TODO + */ + public void processMenuDragMouseEvent(MenuDragMouseEvent event) { + // TODO + } // processMenuDragMouseEvent() + + /** + * processMenuKeyEvent + * @param event TODO + */ + public void processMenuKeyEvent(MenuKeyEvent event) { + // TODO + } // processMenuKeyEvent() + + /** + * fireMenuDragMouseEntered + * @param event TODO + */ + protected void fireMenuDragMouseEntered(MenuDragMouseEvent event) { + // TODO + } // fireMenuDragMouseEntered() + + /** + * fireMenuDragMouseExited + * @param event TODO + */ + protected void fireMenuDragMouseExited(MenuDragMouseEvent event) { + // TODO + } // fireMenuDragMouseExited() + + /** + * fireMenuDragMouseDragged + * @param event TODO + */ + protected void fireMenuDragMouseDragged(MenuDragMouseEvent event) { + // TODO + } // fireMenuDragMouseDragged() + + /** + * fireMenuDragMouseReleased + * @param event TODO + */ + protected void fireMenuDragMouseReleased(MenuDragMouseEvent event) { + // TODO + } // fireMenuDragMouseReleased() + + /** + * fireMenuKeyPressed + * @param event TODO + */ + protected void fireMenuKeyPressed(MenuKeyEvent event) { + // TODO + } // fireMenuKeyPressed() + + /** + * fireMenuKeyReleased + * @param event TODO + */ + protected void fireMenuKeyReleased(MenuKeyEvent event) { + // TODO + } // fireMenuKeyReleased() + + /** + * fireMenuKeyTyped + * @param event TODO + */ + protected void fireMenuKeyTyped(MenuKeyEvent event) { + // TODO + } // fireMenuKeyTyped() + + /** + * menuSelectionChanged + * @param changed TODO + */ + public void menuSelectionChanged(boolean changed) { + // TODO + } // menuSelectionChanged() + + /** + * getSubElements + * @returns MenuElement[] + */ + public MenuElement[] getSubElements() { + return null; // TODO + } // getSubElements() + + /** + * getComponent + * @returns Component + */ + public Component getComponent() { + return null; // TODO + } // getComponent() + + /** + * addMenuDragMouseListener + * @param listener TODO + */ + public void addMenuDragMouseListener(MenuDragMouseListener listener) { + // TODO + } // addMenuDragMouseListener() + + /** + * removeMenuDragMouseListener + * @param listener TODO + */ + public void removeMenuDragMouseListener(MenuDragMouseListener listener) { + // TODO + } // removeMenuDragMouseListener() + + /** + * addMenuKeyListener + * @param listener TODO + */ + public void addMenuKeyListener(MenuKeyListener listener) { + // TODO + } // addMenuKeyListener() + + /** + * removeMenuKeyListener + * @param listener TODO + */ + public void removeMenuKeyListener(MenuKeyListener listener) { + // TODO + } // removeMenuKeyListener() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJMenuItem(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JMenuItem diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JMenu.java gcc-3.3/libjava/javax/swing/JMenu.java *** gcc-3.2.3/libjava/javax/swing/JMenu.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JMenu.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,756 ---- + /* JMenu.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.beans.*; + import java.io.*; + import java.util.*; + import javax.accessibility.*; + import javax.swing.event.*; + + /** + * JMenu + * @author Andrew Selkirk + * @version 1.0 + */ + public class JMenu extends JMenuItem implements Accessible, MenuElement { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJMenu + */ + protected class AccessibleJMenu extends AccessibleJMenuItem + implements AccessibleSelection { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJMenu + * @param component TODO + */ + protected AccessibleJMenu(JMenu component) { + super(component); + // TODO + } // AccessibleJMenu() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleChildrenCount + * @returns int + */ + public int getAccessibleChildrenCount() { + return 0; // TODO + } // getAccessibleChildrenCount() + + /** + * getAccessibleChild + * @param value0 TODO + * @returns Accessible + */ + public Accessible getAccessibleChild(int value0) { + return null; // TODO + } // getAccessibleChild() + + /** + * getAccessibleSelection + * @returns AccessibleSelection + */ + public AccessibleSelection getAccessibleSelection() { + return null; // TODO + } // getAccessibleSelection() + + /** + * getAccessibleSelection + * @param value0 TODO + * @returns Accessible + */ + public Accessible getAccessibleSelection(int value0) { + return null; // TODO + } // getAccessibleSelection() + + /** + * isAccessibleChildSelected + * @param value0 TODO + * @returns boolean + */ + public boolean isAccessibleChildSelected(int value0) { + return false; // TODO + } // isAccessibleChildSelected() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.MENU; + } // getAccessibleRole() + + /** + * getAccessibleSelectionCount + * @returns int + */ + public int getAccessibleSelectionCount() { + return 0; // TODO + } // getAccessibleSelectionCount() + + /** + * addAccessibleSelection + * @param value0 TODO + */ + public void addAccessibleSelection(int value0) { + // TODO + } // addAccessibleSelection() + + /** + * removeAccessibleSelection + * @param value0 TODO + */ + public void removeAccessibleSelection(int value0) { + // TODO + } // removeAccessibleSelection() + + /** + * clearAccessibleSelection + */ + public void clearAccessibleSelection() { + // TODO + } // clearAccessibleSelection() + + /** + * selectAllAccessibleSelection + */ + public void selectAllAccessibleSelection() { + // TODO + } // selectAllAccessibleSelection() + + + } // AccessibleJMenu + + /** + * WinListener + */ + protected class WinListener extends WindowAdapter implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * popupMenu + */ + JPopupMenu popupMenu; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor WinListener + * @param value0 TODO + * @param value1 TODO + */ + public WinListener(JMenu value0, JPopupMenu value1) { + // TODO + } // WinListener() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * windowClosing + * @param value0 TODO + */ + public void windowClosing(WindowEvent value0) { + // TODO + } // windowClosing() + + + } // WinListener + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "MenuUI"; + + /** + * popupMenu + */ + private JPopupMenu popupMenu; + + /** + * menuChangeListener + */ + private ChangeListener menuChangeListener; + + /** + * menuEvent + */ + private MenuEvent menuEvent; + + /** + * listenerRegistry + */ + private static Hashtable listenerRegistry = null; // TODO + + /** + * delay + */ + private int delay; + + /** + * TRACE + */ + private static final boolean TRACE = false; // TODO + + /** + * VERBOSE + */ + private static final boolean VERBOSE = false; // TODO + + /** + * DEBUG + */ + private static final boolean DEBUG = false; // TODO + + /** + * popupListener + */ + protected JMenu.WinListener popupListener; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JMenu + */ + public JMenu() { + // TODO + } // JMenu() + + /** + * Constructor JMenu + * @param text TODO + */ + public JMenu(String text) { + // TODO + } // JMenu() + + /** + * Constructor JMenu + * @param action TODO + */ + public JMenu(Action action) { + // TODO + } // JMenu() + + /** + * Constructor JMenu + * @param text TODO + * @param tearoff TODO + */ + public JMenu(String text, boolean tearoff) { + // TODO + } // JMenu() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * add + * @param value0 TODO + * @returns JMenuItem + */ + public JMenuItem add(JMenuItem item) { + return null; // TODO + } // add() + + /** + * add + * @param component TODO + * @returns Component + */ + public Component add(Component component) { + return null; // TODO + } // add() + + /** + * add + * @param component TODO + * @param index TODO + * @returns Component + */ + public Component add(Component component, int index) { + return null; // TODO + } // add() + + /** + * add + * @param text TODO + * @returns JMenuItem + */ + public JMenuItem add(String text) { + return null; // TODO + } // add() + + /** + * add + * @param action TODO + * @returns JMenuItem + */ + public JMenuItem add(Action action) { + return null; // TODO + } // add() + + /** + * remove + * @param item TODO + */ + public void remove(JMenuItem item) { + // TODO + } // remove() + + /** + * remove + * @param index TODO + */ + public void remove(int index) { + // TODO + } // remove() + + /** + * remove + * @param component TODO + */ + public void remove(Component component) { + // TODO + } // remove() + + /** + * removeAll + */ + public void removeAll() { + // TODO + } // removeAll() + + /** + * insert + * @param text TODO + * @param index TODO + */ + public void insert(String text, int index) { + // TODO + } // insert() + + /** + * insert + * @param item TODO + * @param index TODO + * @returns JMenuItem + */ + public JMenuItem insert(JMenuItem item, int index) { + return null; // TODO + } // insert() + + /** + * insert + * @param action TODO + * @param index TODO + * @returns JMenuItem + */ + public JMenuItem insert(Action action, int index) { + return null; // TODO + } // insert() + + /** + * updateUI + */ + public void updateUI() { + //setUI((MenuUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * setModel + * @param model TODO + */ + public void setModel(ButtonModel model) { + // TODO + } // setModel() + + /** + * isSelected + * @returns boolean + */ + public boolean isSelected() { + return false; // TODO + } // isSelected() + + /** + * setSelected + * @param selected TODO + */ + public void setSelected(boolean selected) { + // TODO + } // setSelected() + + /** + * isPopupMenuVisible + * @returns boolean + */ + public boolean isPopupMenuVisible() { + return false; // TODO + } // isPopupMenuVisible() + + /** + * setPopupMenuVisible + * @param popup TODO + */ + public void setPopupMenuVisible(boolean popup) { + // TODO + } // setPopupMenuVisible() + + /** + * getPopupMenuOrigin + * @returns Point + */ + protected Point getPopupMenuOrigin() { + return null; // TODO + } // getPopupMenuOrigin() + + /** + * getDelay + * @returns int + */ + public int getDelay() { + return 0; // TODO + } // getDelay() + + /** + * setDelay + * @param value0 TODO + */ + public void setDelay(int delay) { + // TODO + } // setDelay() + + /** + * setMenuLocation + * @param x TODO + * @param y TODO + */ + public void setMenuLocation(int x, int y) { + // TODO + } // setMenuLocation() + + /** + * createActionComponent + * @param action TODO + * @returns JMenuItem + */ + protected JMenuItem createActionComponent(Action action) { + return null; // TODO + } // createActionComponent() + + /** + * createActionChangeListener + * @param item TODO + * @returns PropertyChangeListener + */ + protected PropertyChangeListener createActionChangeListener(JMenuItem item) { + return null; // TODO + } // createActionChangeListener() + + /** + * addSeparator + */ + public void addSeparator() { + // TODO + } // addSeparator() + + /** + * insertSeparator + * @param index TODO + */ + public void insertSeparator(int index) { + // TODO + } // insertSeparator() + + /** + * getItem + * @param index TODO + * @returns JMenuItem + */ + public JMenuItem getItem(int index) { + return null; // TODO + } // getItem() + + /** + * getItemCount + * @returns int + */ + public int getItemCount() { + return 0; // TODO + } // getItemCount() + + /** + * isTearOff + * @returns boolean + */ + public boolean isTearOff() { + return false; // TODO + } // isTearOff() + + /** + * getMenuComponentCount + * @returns int + */ + public int getMenuComponentCount() { + return 0; // TODO + } // getMenuComponentCount() + + /** + * getMenuComponent + * @param index TODO + * @returns Component + */ + public Component getMenuComponent(int index) { + return null; // TODO + } // getMenuComponent() + + /** + * getMenuComponents + * @returns Component[] + */ + public Component[] getMenuComponents() { + return null; // TODO + } // getMenuComponents() + + /** + * isTopLevelMenu + * @returns boolean + */ + public boolean isTopLevelMenu() { + return false; // TODO + } // isTopLevelMenu() + + /** + * isMenuComponent + * @param component TODO + * @returns boolean + */ + public boolean isMenuComponent(Component component) { + return false; // TODO + } // isMenuComponent() + + /** + * getPopupMenu + * @returns JPopupMenu + */ + public JPopupMenu getPopupMenu() { + return null; // TODO + } // getPopupMenu() + + /** + * addMenuListener + * @param listener TODO + */ + public void addMenuListener(MenuListener listener) { + // TODO + } // addMenuListener() + + /** + * removeMenuListener + * @param listener TODO + */ + public void removeMenuListener(MenuListener listener) { + // TODO + } // removeMenuListener() + + /** + * fireMenuSelected + */ + protected void fireMenuSelected() { + // TODO + } // fireMenuSelected() + + /** + * fireMenuDeselected + */ + protected void fireMenuDeselected() { + // TODO + } // fireMenuDeselected() + + /** + * fireMenuCanceled + */ + protected void fireMenuCanceled() { + // TODO + } // fireMenuCanceled() + + /** + * createMenuChangeListener + * @returns ChangeListener + */ + private ChangeListener createMenuChangeListener() { + return null; // TODO + } // createMenuChangeListener() + + /** + * createWinListener + * @param popup TODO + * @returns JMenu.WinListener + */ + protected JMenu.WinListener createWinListener(JPopupMenu popup) { + return null; // TODO + } // createWinListener() + + /** + * menuSelectionChanged + * @param value0 TODO + */ + public void menuSelectionChanged(boolean changed) { + // TODO + } // menuSelectionChanged() + + /** + * getSubElements + * @returns MenuElement[] + */ + public MenuElement[] getSubElements() { + return null; // TODO + } // getSubElements() + + /** + * getComponent + * @returns Component + */ + public Component getComponent() { + return null; // TODO + } // getComponent() + + /** + * setAccelerator + * @param keystroke TODO + */ + public void setAccelerator(KeyStroke keystroke) { + // TODO + } // setAccelerator() + + /** + * processKeyEvent + * @param event TODO + */ + protected void processKeyEvent(KeyEvent event) { + // TODO + } // processKeyEvent() + + /** + * doClick + * @param time TODO + */ + public void doClick(int time) { + // TODO + } // doClick() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJMenu(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JMenu diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JOptionPane.java gcc-3.3/libjava/javax/swing/JOptionPane.java *** gcc-3.2.3/libjava/javax/swing/JOptionPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JOptionPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,397 ---- + /* JOptionPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import javax.swing.plaf.*; + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + public class JOptionPane extends JComponent + { + public static final int DEFAULT_OPTION = 0; + public static final int YES_NO_OPTION = 1; + public static final int YES_NO_CANCEL_OPTION = 2; + public static final int OK_CANCEL_OPTION = 3; + public static final int YES_OPTION = 4; + public static final int NO_OPTION = 5; + public static final int CANCEL_OPTION = 6; + public static final int OK_OPTION = 7; + public static final int CLOSED_OPTION = 8; + + public static final int ERROR_MESSAGE = 0; + public static final int INFORMATION_MESSAGE = 1; + public static final int WARNING_MESSAGE = 2; + public static final int QUESTION_MESSAGE = 3; + public static final int PLAIN_MESSAGE = 4; + + final static String VALUE_PROPERTY = "value_prop"; + final static String INPUT_VALUE_PROPERTY = "input_value_prop"; + + final static String UNINITIALIZED_VALUE = "uninit"; + + // Ronald: shouldnt by public ? + public Object msg; + public int mtype; + public int otype; + public Icon icon; + public Object []args; + public Object init; + + public JDialog dialog; + + /***************************************************************************** + * + * + * joptionpanels + * + * + ***********************************/ + + JOptionPane() + { + this("mess"); + } + + JOptionPane(Object m) + { + this(m, PLAIN_MESSAGE); + } + + JOptionPane(Object m, + int mtype) + { + this(m, mtype, DEFAULT_OPTION); + } + + JOptionPane(Object m, + int mtype, + int otype) + { + this(m, mtype, otype, null); + } + + JOptionPane(Object m, + int mtype, + int otype, + Icon icon) + { + this(m, mtype, otype, icon, null); + } + + JOptionPane(Object m, + int mtype, + int otype, + Icon icon, + Object []args) + { + this(m, mtype, otype, icon, args, null); + } + + JOptionPane(Object msg, + int mtype, + int otype, + Icon icon, + Object []args, + Object init) + { + // this(m, mtype, otype, icon, args, init); + this.msg = msg; + this.mtype = mtype; + this.otype = otype; + this.icon = icon; + this.args = args; + this.init = init; + + updateUI(); + } + + + /***************************************************************************** + * + * + * + * + * + ***********************************/ + + Object val; + public void setValue(Object v) + { val = v; } + public Object getValue() + { return val; } + + public String getUIClassID() + { return "JOptionPane"; } + + + public void setUI(OptionPaneUI ui) { + super.setUI(ui); + } + + public OptionPaneUI getUI() { + return (OptionPaneUI)ui; + } + + public void updateUI() { + setUI((OptionPaneUI)UIManager.getUI(this)); + } + + + public AccessibleContext getAccessibleContext() + { + return null; + } + + protected String paramString() + { + return "JOptionPane"; + } + + public static void showMessageDialog(Component frame, + String msg, + String title, + int bla) + { + DoShowOptionDialog(frame, + msg, + title, + bla, + 0, + null, + null, + null); + } + + public static void showMessageDialog(Component frame, + String msg, + String title, + int bla, + Icon icon) + { + DoShowOptionDialog(frame, + msg, + title, + bla, + 0, + icon, + null, + null); + } + + public static void showMessageDialog(Component frame, + String msg) + { + showMessageDialog(frame, + msg, + null); + } + + + public static void showMessageDialog(Component frame, + String msg, + Icon icon) + { + //System.out.println("++++++++++++++++++creating message dialog:"+msg + ", frame="+frame); + DoShowOptionDialog(frame, + msg, + "Message", + DEFAULT_OPTION, + PLAIN_MESSAGE, + icon, + null, + null); + } + + public static int showConfirmDialog(JFrame frame, + String yes, + String no, + int bla) + { + return 0; + } + + public static String showInputDialog(JFrame frame, + String msg, + String title, + int opt_type, + int msg_type, + Icon icon, + Object[] opts, + Object init) + { + return (String) DoShowOptionDialog(frame, + msg, + title, + opt_type, + msg_type, + icon, + opts, + init); + } + + public static Object showInputDialog(JFrame frame, + String msg, + String title, + int opt_type, + Icon icon, + Object[] opts, + Object init) + { + return DoShowOptionDialog(frame, + msg, + title, + opt_type, + 0, //msg_type, + icon, + opts, + init); + } + + + // everybody comes here eventually + public static int showOptionDialog(Component frame, + String msg, + String title, + int opt_type, + int msg_type, + Icon icon, + Object[] opts, + Object init) + { + Integer a = (Integer) DoShowOptionDialog(frame, + msg, + title, + opt_type, + msg_type, + icon, + opts, + init); + if (a == null) + return -1; + return a.intValue(); + } + + public static Object DoShowOptionDialog(Component frame, + String msg, + String title, + int opt_type, + int msg_type, + Icon icon, + Object[] opts, + Object init) + { + + JOptionPane p = new JOptionPane(msg, + msg_type, + opt_type, + icon, + opts, + init); + System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " + p.msg); + + + JDialog a; + + if (frame == null) + { + a = new JDialog((Frame)frame, + title, + true); + } + else if (frame instanceof Dialog) + { + a = new JDialog((Dialog) frame, + title, + true); + } + else if (frame instanceof Frame) + { + a = new JDialog((Frame) frame, + title, + true); + } + else + { + System.out.println("HUUUUHHH, not a frame or dialog !"); + + a = new JDialog((Frame)null, + title, + true); + } + + p.dialog = a; + + a.getContentPane().setLayout(new BorderLayout()); + a.getContentPane().add(p, + BorderLayout.CENTER); + // package the deal + a.pack(); + + a.setVisible(true); + + Object s = p.getValue(); + + System.out.println("RESULT FROM DIALOG = " + s); + + if (s == null) + return null; + + return s; + } + + } + + + + + + + + + + + + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JPanel.java gcc-3.3/libjava/javax/swing/JPanel.java *** gcc-3.2.3/libjava/javax/swing/JPanel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JPanel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,114 ---- + /* JPanel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import javax.swing.plaf.*; + + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + /** + * An instance of JPanel can be added to a panel, frame etc + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class JPanel extends JComponent + { + public JPanel() + { + this(new FlowLayout(), + true); + } + + public JPanel(boolean double_buffered) + { + this(new FlowLayout(), + double_buffered); + } + + public JPanel(LayoutManager layout) + { + this(layout, + true); + } + + + public JPanel(LayoutManager layout, + boolean isDoubleBuffered) + { + if (layout == null) + { + System.err.println("NO LAYOUT SET !!!"); + layout = new FlowLayout(); + } + setLayout(layout); + setOpaque(true); + + updateUI(); + } + + public String getUIClassID() + { return "JPanel"; } + + + public void setUI(PanelUI ui) { + super.setUI(ui); + } + + public PanelUI getUI() { + return (PanelUI)ui; + } + + public void updateUI() { + setUI((PanelUI)UIManager.getUI(this)); + } + + + public AccessibleContext getAccessibleContext() + { + return null; + } + + protected String paramString() + { + return "JPanel"; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JPasswordField.java gcc-3.3/libjava/javax/swing/JPasswordField.java *** gcc-3.2.3/libjava/javax/swing/JPasswordField.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JPasswordField.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,265 ---- + /* JPasswordField.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import javax.accessibility.*; + import javax.swing.text.*; + + /** + * JPasswordField + * @author Andrew Selkirk + * @version 1.0 + */ + public class JPasswordField extends JTextField { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJPasswordField + */ + protected class AccessibleJPasswordField extends AccessibleJTextField { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJPasswordField + * @param component TODO + */ + protected AccessibleJPasswordField(JPasswordField component) { + super(component); + // TODO + } // AccessibleJPasswordField() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.PASSWORD_TEXT; + } // getAccessibleRole() + + + } // AccessibleJPasswordField + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "PasswordFIeldUI"; + + /** + * echoChar. Default is 0 + */ + private char echoChar = 0; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JPasswordField + */ + public JPasswordField() { + // TODO + } // JPasswordField() + + /** + * Constructor JPasswordField + * @param text TODO + */ + public JPasswordField(String text) { + // TODO + } // JPasswordField() + + /** + * Constructor JPasswordField + * @param columns TODO + */ + public JPasswordField(int columns) { + // TODO + } // JPasswordField() + + /** + * Constructor JPasswordField + * @param text TODO + * @param columns TODO + */ + public JPasswordField(String text, int columns) { + // TODO + } // JPasswordField() + + /** + * Constructor JPasswordField + * @param document TODO + * @param text TODO + * @param columns TODO + */ + public JPasswordField(Document document, String text, int columns) { + // TODO + } // JPasswordField() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * copy + */ + public void copy() { + // TODO + } // copy() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getEchoChar + * @returns char + */ + public char getEchoChar() { + return echoChar; + } // getEchoChar() + + /** + * setEchoChar + * @param echo TODO + */ + public void setEchoChar(char echo) { + this.echoChar = echo; + // TODO + } // setEchoChar() + + /** + * echoCharIsSet + * @returns boolean + */ + public boolean echoCharIsSet() { + return (echoChar == 0); + } // echoCharIsSet() + + /** + * cut + */ + public void cut() { + // TODO + } // cut() + + /** + * getText + * @returns String + */ + public String getText() { + return null; // TODO + } // getText() + + /** + * getText + * @param offset TODO + * @param length TODO + * @exception BadLocationException TODO + * @returns String + */ + public String getText(int offset, int length) throws BadLocationException { + return null; // TODO + } // getText() + + /** + * getPassword + * @returns char[] + */ + public char[] getPassword() { + return null; // TODO + } // getPassword() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJPasswordField(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JPasswordField diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JPopupMenu.java gcc-3.3/libjava/javax/swing/JPopupMenu.java *** gcc-3.2.3/libjava/javax/swing/JPopupMenu.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JPopupMenu.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,667 ---- + /* JPopupMenu.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.beans.*; + import java.io.*; + import javax.accessibility.*; + import javax.swing.event.*; + import javax.swing.plaf.*; + + /** + * JPopupMenu + * @author Andrew Selkirk + * @version 1.0 + */ + public class JPopupMenu extends JComponent implements Accessible, MenuElement { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * Separator + */ + public static class Separator extends JSeparator { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor Separator + */ + public Separator() { + // TODO + } // Separator() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return null; // TODO + } // getUIClassID() + + + } // Separator + + /** + * AccessibleJPopupMenu + */ + protected class AccessibleJPopupMenu extends AccessibleJComponent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJPopupMenu + * @param component TODO + */ + protected AccessibleJPopupMenu(JPopupMenu component) { + super(component); + // TODO + } // AccessibleJPopupMenu() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.POPUP_MENU; + } // getAccessibleRole() + + + } // AccessibleJPopupMenu + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "PopupMenuUI"; + + /** + * invoker + */ + transient Component invoker; + + /** + * desiredLocationX + */ + private int desiredLocationX; + + /** + * desiredLocationY + */ + private int desiredLocationY; + + /** + * label + */ + private String label; + + /** + * paintBorder + */ + private boolean paintBorder; + + /** + * margin + */ + private Insets margin; + + /** + * defaultLWPopupEnabledKey + */ + private static final Object defaultLWPopupEnabledKey = null; // TODO + + /** + * lightWeightPopupEnabled + */ + private boolean lightWeightPopupEnabled; + + /** + * selectionModel + */ + private SingleSelectionModel selectionModel; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JPopupMenu + */ + public JPopupMenu() { + // TODO + } // JPopupMenu() + + /** + * Constructor JPopupMenu + * @param label TODO + */ + public JPopupMenu(String label) { + // TODO + } // JPopupMenu() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * readObject + * @param stream TODO + * @exception IOException TODO + * @exception ClassNotFoundException TODO + */ + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + // TODO + } // readObject() + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * add + * @param item TODO + * @returns JMenuItem + */ + public JMenuItem add(JMenuItem item) { + return null; // TODO + } // add() + + /** + * add + * @param text TODO + * @returns JMenuItem + */ + public JMenuItem add(String text) { + return null; // TODO + } // add() + + /** + * add + * @param action TODO + * @returns JMenuItem + */ + public JMenuItem add(Action action) { + return null; // TODO + } // add() + + /** + * remove + * @param index TODO + */ + public void remove(int index) { + // TODO + } // remove() + + /** + * insert + * @param action TODO + * @param index TODO + */ + public void insert(Action action, int index) { + // TODO + } // insert() + + /** + * insert + * @param component TODO + * @param index TODO + */ + public void insert(Component component, int index) { + // TODO + } // insert() + + /** + * paintBorder + * @param graphics TODO + */ + protected void paintBorder(Graphics graphics) { + // TODO + } // paintBorder() + + /** + * getDefaultLightWeightPopupEnabled + * @returns boolean + */ + public static boolean getDefaultLightWeightPopupEnabled() { + return false; // TODO + } // getDefaultLightWeightPopupEnabled() + + /** + * setDefaultLightWeightPopupEnabled + * @param enabled TODO + */ + public static void setDefaultLightWeightPopupEnabled(boolean enabled) { + // TODO + } // setDefaultLightWeightPopupEnabled() + + /** + * getUI + * @returns PopupMenuUI + */ + public PopupMenuUI getUI() { + return (PopupMenuUI) ui; + } // getUI() + + /** + * setUI + * @param ui TODO + */ + public void setUI(PopupMenuUI ui) { + super.setUI(ui); + // TODO + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((PopupMenuUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getSelectionModel + * @returns SingleSelectionModel + */ + public SingleSelectionModel getSelectionModel() { + return null; // TODO + } // getSelectionModel() + + /** + * setSelectionModel + * @param model TODO + */ + public void setSelectionModel(SingleSelectionModel model) { + // TODO + } // setSelectionModel() + + /** + * createActionComponent + * @param action TODO + * @returns JMenuItem + */ + protected JMenuItem createActionComponent(Action action) { + return null; // TODO + } // createActionComponent() + + /** + * createActionChangeListener + * @param item TODO + * @returns PropertyChangeListener + */ + protected PropertyChangeListener createActionChangeListener(JMenuItem item) { + return null; // TODO + } // createActionChangeListener() + + /** + * isLightWeightPopupEnabled + * @returns boolean + */ + public boolean isLightWeightPopupEnabled() { + return false; // TODO + } // isLightWeightPopupEnabled() + + /** + * setLightWeightPopupEnabled + * @param enabled TODO + */ + public void setLightWeightPopupEnabled(boolean enabled) { + // TODO + } // setLightWeightPopupEnabled() + + /** + * getLabel + * @returns String + */ + public String getLabel() { + return null; // TODO + } // getLabel() + + /** + * setLabel + * @param label TODO + */ + public void setLabel(String label) { + // TODO + } // setLabel() + + /** + * addSeparator + */ + public void addSeparator() { + // TODO + } // addSeparator() + + /** + * addPopupMenuListener + * @param listener TODO + */ + public void addPopupMenuListener(PopupMenuListener listener) { + // TODO + } // addPopupMenuListener() + + /** + * removePopupMenuListener + * @param listener TODO + */ + public void removePopupMenuListener(PopupMenuListener listener) { + // TODO + } // removePopupMenuListener() + + /** + * firePopupMenuWillBecomeVisible + */ + protected void firePopupMenuWillBecomeVisible() { + // TODO + } // firePopupMenuWillBecomeVisible() + + /** + * firePopupMenuWillBecomeInvisible + */ + protected void firePopupMenuWillBecomeInvisible() { + // TODO + } // firePopupMenuWillBecomeInvisible() + + /** + * firePopupMenuCanceled + */ + protected void firePopupMenuCanceled() { + // TODO + } // firePopupMenuCanceled() + + /** + * pack + */ + public void pack() { + // TODO + } // pack() + + /** + * isVisible + * @returns boolean + */ + public boolean isVisible() { + return false; // TODO + } // isVisible() + + /** + * setVisible + * @param visible TODO + */ + public void setVisible(boolean visible) { + // TODO + } // setVisible() + + /** + * setLocation + * @param x TODO + * @param y TODO + */ + public void setLocation(int x, int y) { + // TODO + } // setLocation() + + /** + * isPopupMenu + * @returns boolean + */ + private boolean isPopupMenu() { + return false; // TODO + } // isPopupMenu() + + /** + * getInvoker + * @returns Component + */ + public Component getInvoker() { + return null; // TODO + } // getInvoker() + + /** + * setInvoker + * @param component TODO + */ + public void setInvoker(Component component) { + // TODO + } // setInvoker() + + /** + * show + * @param component TODO + * @param x TODO + * @param y TODO + */ + public void show(Component component, int x, int y) { + // TODO + } // show() + + /** + * getRootPopupMenu + * @returns JPopupMenu + */ + JPopupMenu getRootPopupMenu() { + return null; // TODO + } // getRootPopupMenu() + + /** + * getComponentAtIndex + * @param index TODO + * @returns Component + */ + public Component getComponentAtIndex(int index) { + return null; // TODO + } // getComponentAtIndex() + + /** + * getComponentIndex + * @param component TODO + * @returns int + */ + public int getComponentIndex(Component component) { + return 0; // TODO + } // getComponentIndex() + + /** + * setPopupSize + * @param size TODO + */ + public void setPopupSize(Dimension size) { + // TODO + } // setPopupSize() + + /** + * setPopupSize + * @param x TODO + * @param y TODO + */ + public void setPopupSize(int x, int y) { + // TODO + } // setPopupSize() + + /** + * setSelected + * @param selected TODO + */ + public void setSelected(Component selected) { + // TODO + } // setSelected() + + /** + * isBorderPainted + * @returns boolean + */ + public boolean isBorderPainted() { + return false; // TODO + } // isBorderPainted() + + /** + * setBorderPainted + * @param painted TODO + */ + public void setBorderPainted(boolean painted) { + // TODO + } // setBorderPainted() + + /** + * getMargin + * @returns Insets + */ + public Insets getMargin() { + return null; // TODO + } // getMargin() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * processMouseEvent + * @param event TODO + * @param path TODO + * @param manager TODO + */ + public void processMouseEvent(MouseEvent event, MenuElement[] path, + MenuSelectionManager manager) { + // TODO + } // processMouseEvent() + + /** + * processKeyEvent + * @param event TODO + * @param path TODO + * @param manager TODO + */ + public void processKeyEvent(KeyEvent event, MenuElement[] path, + MenuSelectionManager manager) { + // TODO + } // processKeyEvent() + + /** + * menuSelectionChanged + * @param changed TODO + */ + public void menuSelectionChanged(boolean changed) { + // TODO + } // menuSelectionChanged() + + /** + * getSubElements + * @returns MenuElement[] + */ + public MenuElement[] getSubElements() { + return null; // TODO + } // getSubElements() + + /** + * getComponent + * @returns Component + */ + public Component getComponent() { + return null; // TODO + } // getComponent() + + /** + * isPopupTrigger + * @param event TODO + * @returns boolean + */ + public boolean isPopupTrigger(MouseEvent event) { + return false; // TODO + } // isPopupTrigger() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJPopupMenu(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JPopupMenu diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JProgressBar.java gcc-3.3/libjava/javax/swing/JProgressBar.java *** gcc-3.2.3/libjava/javax/swing/JProgressBar.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JProgressBar.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,482 ---- + /* JProgressBar.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.io.*; + import javax.accessibility.*; + import javax.swing.event.*; + import javax.swing.plaf.*; + + /** + * JProgressBar + * @author Andrew Selkirk + * @version 1.0 + */ + public class JProgressBar extends JComponent implements SwingConstants, Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + + /** + * AccessibleJProgressBar + */ + protected class AccessibleJProgressBar extends AccessibleJComponent + implements AccessibleValue { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJProgressBar + * @param component TODO + */ + protected AccessibleJProgressBar(JProgressBar component) { + super(component); + // TODO + } // AccessibleJProgressBar() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.PROGRESS_BAR; + } // getAccessibleRole() + + /** + * getAccessibleValue + * @returns AccessibleValue + */ + public AccessibleValue getAccessibleValue() { + return null; // TODO + } // getAccessibleValue() + + /** + * getCurrentAccessibleValue + * @returns Number + */ + public Number getCurrentAccessibleValue() { + return null; // TODO + } // getCurrentAccessibleValue() + + /** + * setCurrentAccessibleValue + * @param value0 TODO + * @returns boolean + */ + public boolean setCurrentAccessibleValue(Number value0) { + return false; // TODO + } // setCurrentAccessibleValue() + + /** + * getMinimumAccessibleValue + * @returns Number + */ + public Number getMinimumAccessibleValue() { + return null; // TODO + } // getMinimumAccessibleValue() + + /** + * getMaximumAccessibleValue + * @returns Number + */ + public Number getMaximumAccessibleValue() { + return null; // TODO + } // getMaximumAccessibleValue() + + + } // AccessibleJProgressBar + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "ProgressBarUI"; + + /** + * orientation + */ + protected int orientation; + + /** + * paintBorder + */ + protected boolean paintBorder; + + /** + * model + */ + protected BoundedRangeModel model; + + /** + * progressString + */ + protected String progressString; + + /** + * paintString + */ + protected boolean paintString; + + /** + * changeEvent + */ + protected transient ChangeEvent changeEvent; + + /** + * changeListener + */ + protected ChangeListener changeListener; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JProgressBar + */ + public JProgressBar() { + // TODO + } // JProgressBar() + + /** + * Constructor JProgressBar + * @param orientation TODO + */ + public JProgressBar(int orientation) { + // TODO + } // JProgressBar() + + /** + * Constructor JProgressBar + * @param minimum TODO + * @param maximum TODO + */ + public JProgressBar(int minimum, int maximum) { + // TODO + } // JProgressBar() + + /** + * Constructor JProgressBar + * @param minimum TODO + * @param maximum TODO + * @param orientation TODO + */ + public JProgressBar(int minimum, int maximum, int orientation) { + // TODO + } // JProgressBar() + + /** + * Constructor JProgressBar + * @param model TODO + */ + public JProgressBar(BoundedRangeModel model) { + // TODO + } // JProgressBar() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getValue + * @returns int + */ + public int getValue() { + return 0; // TODO + } // getValue() + + /** + * setValue + * @param value TODO + */ + public void setValue(int value) { + // TODO + } // setValue() + + /** + * paintBorder + * @param graphics TODO + */ + protected void paintBorder(Graphics graphics) { + // TODO + } // paintBorder() + + /** + * getOrientation + * @returns int + */ + public int getOrientation() { + return 0; // TODO + } // getOrientation() + + /** + * setOrientation + * @param orientation TODO + */ + public void setOrientation(int orientation) { + // TODO + } // setOrientation() + + /** + * isStringPainted + * @returns boolean + */ + public boolean isStringPainted() { + return false; // TODO + } // isStringPainted() + + /** + * setStringPainted + * @param painted TODO + */ + public void setStringPainted(boolean painted) { + // TODO + } // setStringPainted() + + /** + * getString + * @returns String + */ + public String getString() { + return null; // TODO + } // getString() + + /** + * setString + * @param string TODO + */ + public void setString(String string) { + // TODO + } // setString() + + /** + * getPercentComplete + * @returns double + */ + public double getPercentComplete() { + return 0.0; // TODO + } // getPercentComplete() + + /** + * isBorderPainted + * @returns boolean + */ + public boolean isBorderPainted() { + return false; // TODO + } // isBorderPainted() + + /** + * setBorderPainted + * @param painted TODO + */ + public void setBorderPainted(boolean painted) { + // TODO + } // setBorderPainted() + + /** + * getUI + * @returns ProgressBarUI + */ + public ProgressBarUI getUI() { + return (ProgressBarUI) ui; + } // getUI() + + /** + * setUI + * @param ui TODO + */ + public void setUI(ProgressBarUI ui) { + super.setUI(ui); + // TODO + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((ProgressBarUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * createChangeListener + * @returns ChangeListener + */ + protected ChangeListener createChangeListener() { + return null; // TODO + } // createChangeListener() + + /** + * addChangeListener + * @param listener TODO + */ + public void addChangeListener(ChangeListener listener) { + // TODO + } // addChangeListener() + + /** + * removeChangeListener + * @param listener TODO + */ + public void removeChangeListener(ChangeListener valulistener) { + // TODO + } // removeChangeListener() + + /** + * fireStateChanged + */ + protected void fireStateChanged() { + // TODO + } // fireStateChanged() + + /** + * getModel + * @returns BoundedRangeModel + */ + public BoundedRangeModel getModel() { + return null; // TODO + } // getModel() + + /** + * setModel + * @param model TODO + */ + public void setModel(BoundedRangeModel model) { + // TODO + } // setModel() + + /** + * getMinimum + * @returns int + */ + public int getMinimum() { + return 0; // TODO + } // getMinimum() + + /** + * setMinimum + * @param minimum TODO + */ + public void setMinimum(int minimum) { + // TODO + } // setMinimum() + + /** + * getMaximum + * @returns int + */ + public int getMaximum() { + return 0; // TODO + } // getMaximum() + + /** + * setMaximum + * @param maximum TODO + */ + public void setMaximum(int maximum) { + // TODO + } // setMaximum() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJProgressBar(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JProgressBar diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JRadioButton.java gcc-3.3/libjava/javax/swing/JRadioButton.java *** gcc-3.2.3/libjava/javax/swing/JRadioButton.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JRadioButton.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,92 ---- + /* JRadioButton.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + import javax.swing.plaf.*; + import javax.accessibility.*; + + public class JRadioButton extends JToggleButton + { + public JRadioButton() + { + this(null, null); + } + public JRadioButton(Action a) + { + this(); + setAction(a); + } + + public JRadioButton(Icon icon) + { + this(null, icon); + } + + public JRadioButton(String text) + { + this(text, null); + } + + public JRadioButton(String text, Icon icon) + { + super(text, icon); + } + + + public AccessibleContext getAccessibleContext() + { + //Gets the AccessibleContext associated with this JRadioButton. + return null; + } + + public String getUIClassID() + { + //Returns a string that specifies the name of the L&F class that renders this component. + return "JRadioButton"; + } + + protected String paramString() + { + return "JRadioButton"; + } + } + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JRadioButtonMenuItem.java gcc-3.3/libjava/javax/swing/JRadioButtonMenuItem.java *** gcc-3.2.3/libjava/javax/swing/JRadioButtonMenuItem.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JRadioButtonMenuItem.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,221 ---- + /* JRadioButtonMenuItem.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import javax.accessibility.*; + + /** + * JRadioButtonMenuItem + * @author Andrew Selkirk + * @version 1.0 + */ + public class JRadioButtonMenuItem extends JMenuItem implements Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJRadioButtonMenuItem + */ + protected class AccessibleJRadioButtonMenuItem extends AccessibleJMenuItem { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJRadioButtonMenuItem + * @param component TODO + */ + protected AccessibleJRadioButtonMenuItem(JRadioButtonMenuItem component) { + super(component); + // TODO + } // AccessibleJRadioButtonMenuItem() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.RADIO_BUTTON; + } // getAccessibleRole() + + + } // AccessibleJRadioButtonMenuItem + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "RadioButtonMenuItemUI"; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JRadioButtonMenuItem + */ + public JRadioButtonMenuItem() { + // TODO + } // JRadioButtonMenuItem() + + /** + * Constructor JRadioButtonMenuItem + * @param icon TODO + */ + public JRadioButtonMenuItem(Icon icon) { + // TODO + } // JRadioButtonMenuItem() + + /** + * Constructor JRadioButtonMenuItem + * @param text TODO + */ + public JRadioButtonMenuItem(String text) { + // TODO + } // JRadioButtonMenuItem() + + /** + * Constructor JRadioButtonMenuItem + * @param action TODO + */ + public JRadioButtonMenuItem(Action action) { + // TODO + } // JRadioButtonMenuItem() + + /** + * Constructor JRadioButtonMenuItem + * @param text TODO + * @param icon TODO + */ + public JRadioButtonMenuItem(String text, Icon icon) { + // TODO + } // JRadioButtonMenuItem() + + /** + * Constructor JRadioButtonMenuItem + * @param text TODO + * @param selected TODO + */ + public JRadioButtonMenuItem(String text, boolean selected) { + // TODO + } // JRadioButtonMenuItem() + + /** + * Constructor JRadioButtonMenuItem + * @param icon TODO + * @param selected TODO + */ + public JRadioButtonMenuItem(Icon icon, boolean selected) { + // TODO + } // JRadioButtonMenuItem() + + /** + * Constructor JRadioButtonMenuItem + * @param text TODO + * @param icon TODO + * @param selected TODO + */ + public JRadioButtonMenuItem(String text, Icon icon, boolean selected) { + // TODO + } // JRadioButtonMenuItem() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * requestFocus + */ + public void requestFocus() { + // TODO + } // requestFocus() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJRadioButtonMenuItem(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JRadioButtonMenuItem diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JRootPane.java gcc-3.3/libjava/javax/swing/JRootPane.java *** gcc-3.2.3/libjava/javax/swing/JRootPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JRootPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,209 ---- + /* JRootPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + /** + * This class is where JComponents are added to. + * Unlike awt where you could just say frame.add(), + * with swing you need to say frame.getRootPane() + * (which delivers an instance of this class) + * and add your components to that. + * + * It is implemented by several 'layers' (pane() should be read as plane()) + * each on top of the others + * where you can add components to. + * (getContentPane(), getGlassPane(), getLayeredPane()) + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class JRootPane extends JComponent + { + // The class used to obtain the accessible role for this object. + static protected class AccessibleJRootPane + { + } + + //A custom layout manager + static protected class RootLayout extends BorderLayout + { + public Dimension preferredLayoutSize ( Container c ) + { + Dimension p = super.preferredLayoutSize(c); + System.out.println(" PREF-SIZE from RootLayout = " + p); + return p; + } + } + + /***********************************************************/ + + + //The glass pane that overlays the menu bar and content pane, so it can intercept mouse movements and such. + protected Component glassPane; + + //The layered pane that manages the menu bar and content pane. + protected JLayeredPane layeredPane; + + // The menu bar. + protected JMenuBar menuBar; + + protected Container contentPane; + + /********************************************************/ + + public String getUIClassID() + { return "JPanel"; } + + + void setJMenuBar(JMenuBar m) + { menuBar = m; } + + JMenuBar getJMenuBar() + { return menuBar; } + + + public Container getContentPane() + { + if (contentPane == null) + { + setContentPane(createContentPane()); + } + return contentPane; + } + + public void setContentPane(Container p) + { + contentPane = p; + getLayeredPane().add(contentPane, 0); + } + + protected void addImpl(Component comp, + Object constraints, + int index) + { + super.addImpl(comp, constraints, index); + //System.out.println("don't do that !"); + } + + public Component getGlassPane() + { + if (glassPane == null) + setGlassPane(createGlassPane()); + return glassPane; + } + + public void setGlassPane(Component f) + { + if (glassPane != null) + remove(glassPane); + + glassPane = f; + + glassPane.setVisible(false); + add(glassPane, 0); + } + + public JLayeredPane getLayeredPane() + { + if (layeredPane == null) + setLayeredPane(createLayeredPane()); + return layeredPane; + } + public void setLayeredPane(JLayeredPane f) + { + if (layeredPane != null) + remove(layeredPane); + + layeredPane = f; + add(f, -1); + } + + + /********************************************************/ + + JRootPane() + { + setLayout(createRootLayout()); + + getGlassPane(); + getLayeredPane(); + getContentPane(); + + setDoubleBuffered(true); + updateUI(); + } + + protected LayoutManager createRootLayout() { + return new RootLayout(); + } + + JComponent createContentPane() + { + JPanel p = new JPanel(); + p.setName(this.getName()+".contentPane"); + p.setLayout(new BorderLayout()); + // p.setVisible(true); + + System.out.println("Created ContentPane: " + p); + return p; + } + + Component createGlassPane() + { + JPanel p = new JPanel(); + p.setName(this.getName()+".glassPane"); + p.setLayout(new BorderLayout()); + p.setVisible(false); + + System.out.println("created the glasspane: "+p); + return p; + } + + JLayeredPane createLayeredPane() + { + JLayeredPane l = new JLayeredPane(); + return l; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JScrollBar.java gcc-3.3/libjava/javax/swing/JScrollBar.java *** gcc-3.2.3/libjava/javax/swing/JScrollBar.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JScrollBar.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,43 ---- + /* JScrollBar.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + + public class JScrollBar extends JComponent + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JScrollPane.java gcc-3.3/libjava/javax/swing/JScrollPane.java *** gcc-3.2.3/libjava/javax/swing/JScrollPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JScrollPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,133 ---- + /* JScrollPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import javax.swing.plaf.*; + + + public class JScrollPane extends JComponent + { + protected JViewport columnHeader; + protected JViewport rowHeader; + + protected Component lowerLeft; + protected Component lowerRight; + protected Component upperLeft; + protected Component upperRight; + + protected JScrollBar horizontalScrollBar; + protected int horizontalScrollBarPolicy; + protected JScrollBar verticalScrollBar; + protected int verticalScrollBarPolicy; + + protected JViewport viewport; + + + public JScrollPane() + { + this(null, 0, 0); + } + + public JScrollPane(Component view) + { + this(view, 0, 0); + } + + + public JScrollPane(int vsbPolicy, int hsbPolicy) + { + this(null, 0, 0); + } + + public JScrollPane(Component view, int vsbPolicy, int hsbPolicy) + { + setViewportView(view); + setOpaque(true); + updateUI(); + } + + public String getUIClassID() + { + //Returns a string that specifies the name of the L&F class that renders this component. + return "JScrollPane"; + } + + public JViewport getViewport() + { + return viewport; + } + + public JViewport createViewport() + { + return new JViewport(); + } + + public void setViewport(JViewport v) + { + if (viewport != null) + remove(viewport); + + viewport = v; + + add(v); + + revalidate(); + repaint(); + } + + public void updateUI() + { + ScrollPaneUI b = (ScrollPaneUI)UIManager.getUI(this); + setUI(b); + } + + + public void setViewportView(Component view) + { + if (getViewport() == null) + { + setViewport(createViewport()); + } + + if (view != null) + { + getViewport().setView(view); + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JSeparator.java gcc-3.3/libjava/javax/swing/JSeparator.java *** gcc-3.2.3/libjava/javax/swing/JSeparator.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JSeparator.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,223 ---- + /* JSeparator.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import javax.accessibility.*; + import javax.swing.plaf.*; + + /** + * JSeparator + * @author Andrew Selkirk + * @version 1.0 + */ + public class JSeparator extends JComponent + implements SwingConstants, Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJSeparator + */ + protected class AccessibleJSeparator extends AccessibleJComponent { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJSeparator + * @param component TODO + */ + protected AccessibleJSeparator(JSeparator component) { + super(component); + // TODO + } // AccessibleJSeparator() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.SEPARATOR; + } // getAccessibleRole() + + + } // AccessibleJSeparator + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "SeparatorUI"; + + /** + * orientation + */ + private int orientation; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JSeparator + */ + public JSeparator() { + this(HORIZONTAL); + } // JSeparator() + + /** + * Constructor JSeparator + * @param value0 TODO + */ + public JSeparator(int orientation) { + this.orientation = orientation; + // TODO + } // JSeparator() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getUI + * @returns SeparatorUI + */ + public SeparatorUI getUI() { + return (SeparatorUI) ui; + } // getUI() + + /** + * setUI + * @param ui TODO + */ + public void setUI(SeparatorUI ui) { + super.setUI(ui); + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((SeparatorUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getOrientation + * @returns int + */ + public int getOrientation() { + return orientation; + } // getOrientation() + + /** + * setOrientation + * @param orientation TODO + */ + public void setOrientation(int orientation) { + this.orientation = orientation; + // TODO + } // setOrientation() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * isFocusTraversable + * @returns boolean + */ + public boolean isFocusTraversable() { + return false; + } // isFocusTraversable() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJSeparator(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JSeparator diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JSlider.java gcc-3.3/libjava/javax/swing/JSlider.java *** gcc-3.2.3/libjava/javax/swing/JSlider.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JSlider.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,689 ---- + /* JSlider.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + import java.util.*; + import javax.accessibility.*; + import javax.swing.event.*; + import javax.swing.plaf.*; + + /** + * JSlider + * @author Andrew Selkirk + * @version 1.0 + */ + public class JSlider extends JComponent implements SwingConstants, Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + + /** + * AccessibleJSlider + */ + protected class AccessibleJSlider extends JComponent.AccessibleJComponent implements AccessibleValue { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJSlider + * @param value0 TODO + */ + protected AccessibleJSlider(JSlider value0) { + super(value0); + // TODO + } // AccessibleJSlider() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return null; // TODO + } // getAccessibleRole() + + /** + * getAccessibleValue + * @returns AccessibleValue + */ + public AccessibleValue getAccessibleValue() { + return null; // TODO + } // getAccessibleValue() + + /** + * getCurrentAccessibleValue + * @returns Number + */ + public Number getCurrentAccessibleValue() { + return null; // TODO + } // getCurrentAccessibleValue() + + /** + * setCurrentAccessibleValue + * @param value0 TODO + * @returns boolean + */ + public boolean setCurrentAccessibleValue(Number value0) { + return false; // TODO + } // setCurrentAccessibleValue() + + /** + * getMinimumAccessibleValue + * @returns Number + */ + public Number getMinimumAccessibleValue() { + return null; // TODO + } // getMinimumAccessibleValue() + + /** + * getMaximumAccessibleValue + * @returns Number + */ + public Number getMaximumAccessibleValue() { + return null; // TODO + } // getMaximumAccessibleValue() + + + } // AccessibleJSlider + + /** + * ModelListener + */ + private class ModelListener implements ChangeListener, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ModelListener + * @param value0 TODO + */ + private ModelListener(JSlider value0) { + // TODO + } // ModelListener() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * stateChanged + * @param value0 TODO + */ + public void stateChanged(ChangeEvent value0) { + // TODO + } // stateChanged() + + + } // ModelListener + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "SliderUI"; + + /** + * paintTicks + */ + private boolean paintTicks; + + /** + * paintTrack + */ + private boolean paintTrack; + + /** + * paintLabels + */ + private boolean paintLabels; + + /** + * isInverted + */ + private boolean isInverted; + + /** + * sliderModel + */ + protected BoundedRangeModel sliderModel; + + /** + * majorTickSpacing + */ + protected int majorTickSpacing; + + /** + * minorTickSpacing + */ + protected int minorTickSpacing; + + /** + * snapToTicks + */ + protected boolean snapToTicks; + + /** + * snapToValue + */ + boolean snapToValue; + + /** + * orientation + */ + protected int orientation; + + /** + * labelTable + */ + private Dictionary labelTable; + + /** + * changeListener + */ + protected ChangeListener changeListener; + + /** + * changeEvent + */ + protected transient ChangeEvent changeEvent; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JSlider + */ + public JSlider() { + // TODO + } // JSlider() + + /** + * Constructor JSlider + * @param value0 TODO + */ + public JSlider(int orientation) { + // TODO + } // JSlider() + + /** + * Constructor JSlider + * @param minimum TODO + * @param maximum TODO + */ + public JSlider(int minimum, int maximum) { + // TODO + } // JSlider() + + /** + * Constructor JSlider + * @param minimum TODO + * @param maximum TODO + * @param value TODO + */ + public JSlider(int minimum, int maximum, int value) { + // TODO + } // JSlider() + + /** + * Constructor JSlider + * @param orientation TODO + * @param minimum TODO + * @param maximum TODO + * @param value TODO + */ + public JSlider(int orientation, int minimum, int maximum, int value) { + // TODO + } // JSlider() + + /** + * Constructor JSlider + * @param value0 TODO + */ + public JSlider(BoundedRangeModel model) { + // TODO + } // JSlider() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getValue + * @returns int + */ + public int getValue() { + return 0; // TODO + } // getValue() + + /** + * setValue + * @param value0 TODO + */ + public void setValue(int value) { + // TODO + } // setValue() + + /** + * getUI + * @returns SliderUI + */ + public SliderUI getUI() { + return (SliderUI) ui; + } // getUI() + + /** + * setUI + * @param ui TODO + */ + public void setUI(SliderUI ui) { + super.setUI(ui); + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((SliderUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * createChangeListener + * @returns ChangeListener + */ + protected ChangeListener createChangeListener() { + return null; // TODO + } // createChangeListener() + + /** + * addChangeListener + * @param listener TODO + */ + public void addChangeListener(ChangeListener listener) { + // TODO + } // addChangeListener() + + /** + * removeChangeListener + * @param listener TODO + */ + public void removeChangeListener(ChangeListener listener) { + // TODO + } // removeChangeListener() + + /** + * fireStateChanged + */ + protected void fireStateChanged() { + // TODO + } // fireStateChanged() + + /** + * getModel + * @returns BoundedRangeModel + */ + public BoundedRangeModel getModel() { + return null; // TODO + } // getModel() + + /** + * setModel + * @param model TODO + */ + public void setModel(BoundedRangeModel model) { + // TODO + } // setModel() + + /** + * getMinimum + * @returns int + */ + public int getMinimum() { + return 0; // TODO + } // getMinimum() + + /** + * setMinimum + * @param minimum TODO + */ + public void setMinimum(int minimum) { + // TODO + } // setMinimum() + + /** + * getMaximum + * @returns int + */ + public int getMaximum() { + return 0; // TODO + } // getMaximum() + + /** + * setMaximum + * @param maximum TODO + */ + public void setMaximum(int maximum) { + // TODO + } // setMaximum() + + /** + * getValueIsAdjusting + * @returns boolean + */ + public boolean getValueIsAdjusting() { + return false; // TODO + } // getValueIsAdjusting() + + /** + * setValueIsAdjusting + * @param adjusting TODO + */ + public void setValueIsAdjusting(boolean adjusting) { + // TODO + } // setValueIsAdjusting() + + /** + * getExtent + * @returns int + */ + public int getExtent() { + return 0; // TODO + } // getExtent() + + /** + * setExtent + * @param vextent TODO + */ + public void setExtent(int extent) { + // TODO + } // setExtent() + + /** + * getOrientation + * @returns int + */ + public int getOrientation() { + return 0; // TODO + } // getOrientation() + + /** + * setOrientation + * @param orientation TODO + */ + public void setOrientation(int orientation) { + // TODO + } // setOrientation() + + /** + * getLabelTable + * @returns Dictionary + */ + public Dictionary getLabelTable() { + return null; // TODO + } // getLabelTable() + + /** + * setLabelTable + * @param table TODO + */ + public void setLabelTable(Dictionary table) { + // TODO + } // setLabelTable() + + /** + * updateLabelUIs + */ + protected void updateLabelUIs() { + // TODO + } // updateLabelUIs() + + /** + * createStandardLabels + * @param increment TODO + * @returns Hashtable + */ + public Hashtable createStandardLabels(int increment) { + return null; // TODO + } // createStandardLabels() + + /** + * createStandardLabels + * @param increment TODO + * @param start TODO + * @returns Hashtable + */ + public Hashtable createStandardLabels(int increment, int start) { + return null; // TODO + } // createStandardLabels() + + /** + * getInverted + * @returns boolean + */ + public boolean getInverted() { + return false; // TODO + } // getInverted() + + /** + * setInverted + * @param inverted TODO + */ + public void setInverted(boolean inverted) { + // TODO + } // setInverted() + + /** + * getMajorTickSpacing + * @returns int + */ + public int getMajorTickSpacing() { + return 0; // TODO + } // getMajorTickSpacing() + + /** + * setMajorTickSpacing + * @param spacing TODO + */ + public void setMajorTickSpacing(int spacing) { + // TODO + } // setMajorTickSpacing() + + /** + * getMinorTickSpacing + * @returns int + */ + public int getMinorTickSpacing() { + return 0; // TODO + } // getMinorTickSpacing() + + /** + * setMinorTickSpacing + * @param spacing TODO + */ + public void setMinorTickSpacing(int spacing) { + // TODO + } // setMinorTickSpacing() + + /** + * getSnapToTicks + * @returns boolean + */ + public boolean getSnapToTicks() { + return false; // TODO + } // getSnapToTicks() + + /** + * getSnapToValue + * @returns boolean + */ + boolean getSnapToValue() { + return false; // TODO + } // getSnapToValue() + + /** + * setSnapToTicks + * @param snap TODO + */ + public void setSnapToTicks(boolean snap) { + // TODO + } // setSnapToTicks() + + /** + * getPaintTicks + * @returns boolean + */ + public boolean getPaintTicks() { + return false; // TODO + } // getPaintTicks() + + /** + * setPaintTicks + * @param paint TODO + */ + public void setPaintTicks(boolean paint) { + // TODO + } // setPaintTicks() + + /** + * getPaintTrack + * @returns boolean + */ + public boolean getPaintTrack() { + return false; // TODO + } // getPaintTrack() + + /** + * setPaintTrack + * @param paint TODO + */ + public void setPaintTrack(boolean paint) { + // TODO + } // setPaintTrack() + + /** + * getPaintLabels + * @returns boolean + */ + public boolean getPaintLabels() { + return false; // TODO + } // getPaintLabels() + + /** + * setPaintLabels + * @param paint TODO + */ + public void setPaintLabels(boolean paint) { + // TODO + } // setPaintLabels() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJSlider(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JSlider diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JSplitPane.java gcc-3.3/libjava/javax/swing/JSplitPane.java *** gcc-3.2.3/libjava/javax/swing/JSplitPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JSplitPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,643 ---- + /* JSplitPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.io.*; + import javax.accessibility.*; + import javax.swing.plaf.*; + + /** + * JSplitPane + * @author Andrew Selkirk + * @version 1.0 + */ + public class JSplitPane extends JComponent implements Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJSplitPane + */ + protected class AccessibleJSplitPane extends AccessibleJComponent + implements AccessibleValue { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJSplitPane + * @param component TODO + */ + protected AccessibleJSplitPane(JSplitPane component) { + super(component); + // TODO + } // AccessibleJSplitPane() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.SPLIT_PANE; + } // getAccessibleRole() + + /** + * getAccessibleValue + * @returns AccessibleValue + */ + public AccessibleValue getAccessibleValue() { + return null; // TODO + } // getAccessibleValue() + + /** + * getCurrentAccessibleValue + * @returns Number + */ + public Number getCurrentAccessibleValue() { + return null; // TODO + } // getCurrentAccessibleValue() + + /** + * setCurrentAccessibleValue + * @param value0 TODO + * @returns boolean + */ + public boolean setCurrentAccessibleValue(Number value0) { + return false; // TODO + } // setCurrentAccessibleValue() + + /** + * getMinimumAccessibleValue + * @returns Number + */ + public Number getMinimumAccessibleValue() { + return null; // TODO + } // getMinimumAccessibleValue() + + /** + * getMaximumAccessibleValue + * @returns Number + */ + public Number getMaximumAccessibleValue() { + return null; // TODO + } // getMaximumAccessibleValue() + + + } // AccessibleJSplitPane + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "SplitPaneUI"; + + /** + * VERTICAL_SPLIT + */ + public static final int VERTICAL_SPLIT = 0; + + /** + * HORIZONTAL_SPLIT + */ + public static final int HORIZONTAL_SPLIT = 1; + + /** + * LEFT + */ + public static final String LEFT = "left"; + + /** + * RIGHT + */ + public static final String RIGHT = "right"; + + /** + * TOP + */ + public static final String TOP = "top"; + + /** + * BOTTOM + */ + public static final String BOTTOM = "bottom"; + + /** + * DIVIDER + */ + public static final String DIVIDER = "divider"; + + /** + * ORIENTATION_PROPERTY + */ + public static final String ORIENTATION_PROPERTY = "orientation"; + + /** + * CONTINUOUS_LAYOUT_PROPERTY + */ + public static final String CONTINUOUS_LAYOUT_PROPERTY = "continuousLayout"; + + /** + * DIVIDER_SIZE_PROPERTY + */ + public static final String DIVIDER_SIZE_PROPERTY = "dividerSize"; + + /** + * ONE_TOUCH_EXPANDABLE_PROPERTY + */ + public static final String ONE_TOUCH_EXPANDABLE_PROPERTY = "oneTouchExpandable"; + + /** + * LAST_DIVIDER_LOCATION_PROPERTY + */ + public static final String LAST_DIVIDER_LOCATION_PROPERTY = "lastDividerLocation"; + + /** + * DIVIDER_LOCATION_PROPERTY + */ + public static final String DIVIDER_LOCATION_PROPERTY = "dividerLocation"; + + /** + * RESIZE_WEIGHT_PROPERTY + */ + public static final String RESIZE_WEIGHT_PROPERTY = "resizeWeight"; + + /** + * orientation + */ + protected int orientation; + + /** + * continuousLayout + */ + protected boolean continuousLayout; + + /** + * leftComponent + */ + protected Component leftComponent; + + /** + * rightComponent + */ + protected Component rightComponent; + + /** + * dividerSize + */ + protected int dividerSize; + + /** + * oneTouchExpandable + */ + protected boolean oneTouchExpandable; + + /** + * lastDividerLocation + */ + protected int lastDividerLocation; + + /** + * resizeWeight + */ + private double resizeWeight; + + /** + * dividerLocation + */ + private int dividerLocation; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JSplitPane + */ + public JSplitPane() { + // TODO + } // JSplitPane() + + /** + * Constructor JSplitPane + * @param value0 TODO + */ + public JSplitPane(int value0) { + // TODO + } // JSplitPane() + + /** + * Constructor JSplitPane + * @param value0 TODO + * @param value1 TODO + */ + public JSplitPane(int value0, boolean value1) { + // TODO + } // JSplitPane() + + /** + * Constructor JSplitPane + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public JSplitPane(int value0, Component value1, Component value2) { + // TODO + } // JSplitPane() + + /** + * Constructor JSplitPane + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + */ + public JSplitPane(int value0, boolean value1, Component value2, Component value3) { + // TODO + } // JSplitPane() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * remove + * @param value0 TODO + */ + public void remove(Component value0) { + // TODO + } // remove() + + /** + * remove + * @param value0 TODO + */ + public void remove(int value0) { + // TODO + } // remove() + + /** + * removeAll + */ + public void removeAll() { + // TODO + } // removeAll() + + /** + * setUI + * @param ui TODO + */ + public void setUI(SplitPaneUI ui) { + super.setUI(ui); + } // setUI() + + /** + * getUI + * @returns SplitPaneUI + */ + public SplitPaneUI getUI() { + return (SplitPaneUI) ui; + } // getUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((SplitPaneUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * setDividerSize + * @param value0 TODO + */ + public void setDividerSize(int value0) { + // TODO + } // setDividerSize() + + /** + * getDividerSize + * @returns int + */ + public int getDividerSize() { + return 0; // TODO + } // getDividerSize() + + /** + * setLeftComponent + * @param value0 TODO + */ + public void setLeftComponent(Component value0) { + // TODO + } // setLeftComponent() + + /** + * getLeftComponent + * @returns Component + */ + public Component getLeftComponent() { + return null; // TODO + } // getLeftComponent() + + /** + * setTopComponent + * @param value0 TODO + */ + public void setTopComponent(Component value0) { + // TODO + } // setTopComponent() + + /** + * getTopComponent + * @returns Component + */ + public Component getTopComponent() { + return null; // TODO + } // getTopComponent() + + /** + * setRightComponent + * @param value0 TODO + */ + public void setRightComponent(Component value0) { + // TODO + } // setRightComponent() + + /** + * getRightComponent + * @returns Component + */ + public Component getRightComponent() { + return null; // TODO + } // getRightComponent() + + /** + * setBottomComponent + * @param value0 TODO + */ + public void setBottomComponent(Component value0) { + // TODO + } // setBottomComponent() + + /** + * getBottomComponent + * @returns Component + */ + public Component getBottomComponent() { + return null; // TODO + } // getBottomComponent() + + /** + * setOneTouchExpandable + * @param value0 TODO + */ + public void setOneTouchExpandable(boolean value0) { + // TODO + } // setOneTouchExpandable() + + /** + * isOneTouchExpandable + * @returns boolean + */ + public boolean isOneTouchExpandable() { + return false; // TODO + } // isOneTouchExpandable() + + /** + * setLastDividerLocation + * @param value0 TODO + */ + public void setLastDividerLocation(int value0) { + // TODO + } // setLastDividerLocation() + + /** + * getLastDividerLocation + * @returns int + */ + public int getLastDividerLocation() { + return 0; // TODO + } // getLastDividerLocation() + + /** + * setOrientation + * @param value0 TODO + */ + public void setOrientation(int value0) { + // TODO + } // setOrientation() + + /** + * getOrientation + * @returns int + */ + public int getOrientation() { + return 0; // TODO + } // getOrientation() + + /** + * setContinuousLayout + * @param value0 TODO + */ + public void setContinuousLayout(boolean value0) { + // TODO + } // setContinuousLayout() + + /** + * isContinuousLayout + * @returns boolean + */ + public boolean isContinuousLayout() { + return false; // TODO + } // isContinuousLayout() + + /** + * setResizeWeight + * @param value0 TODO + */ + public void setResizeWeight(double value0) { + // TODO + } // setResizeWeight() + + /** + * getResizeWeight + * @returns double + */ + public double getResizeWeight() { + return 0.0; // TODO + } // getResizeWeight() + + /** + * resetToPreferredSizes + */ + public void resetToPreferredSizes() { + // TODO + } // resetToPreferredSizes() + + /** + * setDividerLocation + * @param value0 TODO + */ + public void setDividerLocation(double value0) { + // TODO + } // setDividerLocation() + + /** + * setDividerLocation + * @param value0 TODO + */ + public void setDividerLocation(int value0) { + // TODO + } // setDividerLocation() + + /** + * getDividerLocation + * @returns int + */ + public int getDividerLocation() { + return 0; // TODO + } // getDividerLocation() + + /** + * getMinimumDividerLocation + * @returns int + */ + public int getMinimumDividerLocation() { + return 0; // TODO + } // getMinimumDividerLocation() + + /** + * getMaximumDividerLocation + * @returns int + */ + public int getMaximumDividerLocation() { + return 0; // TODO + } // getMaximumDividerLocation() + + /** + * isValidateRoot + * @returns boolean + */ + public boolean isValidateRoot() { + return false; // TODO + } // isValidateRoot() + + /** + * addImpl + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + protected void addImpl(Component value0, Object value1, int value2) { + // TODO + } // addImpl() + + /** + * paintChildren + * @param value0 TODO + */ + protected void paintChildren(Graphics value0) { + // TODO + } // paintChildren() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJSplitPane(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JSplitPane diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JTabbedPane.java gcc-3.3/libjava/javax/swing/JTabbedPane.java *** gcc-3.2.3/libjava/javax/swing/JTabbedPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JTabbedPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,131 ---- + /* JTabbedPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.util.*; + import javax.swing.plaf.*; + import java.awt.*; + + + import javax.accessibility.AccessibleContext; + import javax.accessibility.AccessibleRole; + import javax.accessibility.AccessibleState; + import javax.accessibility.AccessibleStateSet; + + public class JTabbedPane extends JComponent + { + class Tab + { + Icon icon; + String name, descr; + Component tab; + + Tab(String name, + Icon icon, + Component tab, + String descr) + { + this.name = name; + this.icon = icon; + this.tab = tab; + this.descr = descr; + } + } + + private Vector tabs = new Vector(); + + public JTabbedPane() + { + } + + public void addTab(String name, + Component panel) + { + addTab(name, null, panel, null); + } + public void addTab(String name, + Icon icon, + Component panel) + { + addTab(name, icon, panel, null); + } + public void addTab(String name, + Icon icon, + Component panel, + String descr) + { + tabs.addElement(new Tab(name, icon, panel, descr)); + } + + public int getTabCount() + { + return tabs.size(); + } + public Component getComponentAt(int i) + { + Tab t = (Tab) tabs.elementAt(i); + return t.tab; + } + + public String getUIClassID() + { return "JTabbedPane"; } + + + public void setUI(TabbedPaneUI ui) { + super.setUI(ui); + } + + public TabbedPaneUI getUI() { + return (TabbedPaneUI)ui; + } + + public void updateUI() + { + setUI((TabbedPaneUI)UIManager.getUI(this)); + } + + public AccessibleContext getAccessibleContext() + { + return null; + } + + protected String paramString() + { + return "JTabbedPane"; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JTable.java gcc-3.3/libjava/javax/swing/JTable.java *** gcc-3.2.3/libjava/javax/swing/JTable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JTable.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,46 ---- + /* JTable.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + /** + * STUBBED + */ + public class JTable extends JComponent + /*implements TableModelListener, Scrollable, TableColumnModelListener, + ListSelectionListener, CellEditorListener, Accessible*/ + { + } // class JTable diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JTextField.java gcc-3.3/libjava/javax/swing/JTextField.java *** gcc-3.2.3/libjava/javax/swing/JTextField.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JTextField.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,106 ---- + /* JTextField.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.event.*; + import java.util.*; + + import javax.accessibility.*; + + public class JTextField extends JEditorPane + { + + /** + * AccessibleJTextField + */ + protected class AccessibleJTextField extends AccessibleJTextComponent { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJTextField + * @param component TODO + */ + protected AccessibleJTextField(JTextField component) { + super(component); + // TODO + } // AccessibleJTextField() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + + } // AccessibleJTextField + + + Vector actions = new Vector(); + + public JTextField() + { + } + + public JTextField(int a) + { + } + + public void addActionListener(ActionListener l) + { + actions.addElement(l); + } + + public void removeActionListener(ActionListener l) + { + actions.removeElement(l); + } + + public void selectAll() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JTextPane.java gcc-3.3/libjava/javax/swing/JTextPane.java *** gcc-3.2.3/libjava/javax/swing/JTextPane.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JTextPane.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,271 ---- + /* JTextPane.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.io.*; + import javax.swing.text.*; + + /** + * JTextPane + * @author Andrew Selkirk + * @version 1.0 + */ + public class JTextPane extends JEditorPane { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "TextPaneUI"; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JTextPane + */ + public JTextPane() { + // TODO + } // JTextPane() + + /** + * Constructor JTextPane + * @param document TODO + */ + public JTextPane(StyledDocument document) { + // TODO + } // JTextPane() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * setDocument + * @param document TODO + */ + public void setDocument(Document document) { + // TODO + } // setDocument() + + /** + * getStyledDocument + * @returns StyledDocument + */ + public StyledDocument getStyledDocument() { + return null; // TODO + } // getStyledDocument() + + /** + * setStyledDocument + * @param document TODO + */ + public void setStyledDocument(StyledDocument document) { + // TODO + } // setStyledDocument() + + /** + * replaceSelection + * @param content TODO + */ + public void replaceSelection(String content) { + // TODO + } // replaceSelection() + + /** + * insertComponent + * @param component TODO + */ + public void insertComponent(Component component) { + // TODO + } // insertComponent() + + /** + * insertIcon + * @param icon TODO + */ + public void insertIcon(Icon icon) { + // TODO + } // insertIcon() + + /** + * addStyle + * @param nm TODO + * @param parent TODO + * @returns Style + */ + public Style addStyle(String nm, Style parent) { + return null; // TODO + } // addStyle() + + /** + * removeStyle + * @param nm TODO + */ + public void removeStyle(String nm) { + // TODO + } // removeStyle() + + /** + * getStyle + * @param nm TODO + * @returns Style + */ + public Style getStyle(String nm) { + return null; // TODO + } // getStyle() + + /** + * getLogicalStyle + * @returns Style + */ + public Style getLogicalStyle() { + return null; // TODO + } // getLogicalStyle() + + /** + * setLogicalStyle + * @param style TODO + */ + public void setLogicalStyle(Style style) { + // TODO + } // setLogicalStyle() + + /** + * getCharacterAttributes + * @returns AttributeSet + */ + public AttributeSet getCharacterAttributes() { + return null; // TODO + } // getCharacterAttributes() + + /** + * setCharacterAttributes + * @param attribute TODO + * @param replace TODO + */ + public void setCharacterAttributes(AttributeSet attribute, + boolean replace) { + // TODO + } // setCharacterAttributes() + + /** + * getParagraphAttributes + * @returns AttributeSet + */ + public AttributeSet getParagraphAttributes() { + return null; // TODO + } // getParagraphAttributes() + + /** + * setParagraphAttributes + * @param attribute TODO + * @param replace TODO + */ + public void setParagraphAttributes(AttributeSet attribute, + boolean replace) { + // TODO + } // setParagraphAttributes() + + /** + * getInputAttributes + * @returns MutableAttributeSet + */ + public MutableAttributeSet getInputAttributes() { + return null; // TODO + } // getInputAttributes() + + /** + * getStyledEditorKit + * @returns StyledEditorKit + */ + protected final StyledEditorKit getStyledEditorKit() { + return null; // TODO + } // getStyledEditorKit() + + /** + * createDefaultEditorKit + * @returns EditorKit + */ + protected EditorKit createDefaultEditorKit() { + return null; // TODO + } // createDefaultEditorKit() + + /** + * setEditorKit + * @param editor TODO + */ + public final void setEditorKit(EditorKit editor) { + // TODO + } // setEditorKit() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + + } // JTextPane diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JToggleButton.java gcc-3.3/libjava/javax/swing/JToggleButton.java *** gcc-3.2.3/libjava/javax/swing/JToggleButton.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JToggleButton.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,110 ---- + /* JToggleButton.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + import javax.swing.plaf.*; + import javax.accessibility.*; + + public class JToggleButton extends AbstractButton + { + public JToggleButton() + { + this(null, null); + } + public JToggleButton(Action a) + { + this(); + setAction(a); + } + + public JToggleButton(Icon icon) + { + this(null, icon); + } + + public JToggleButton(String text) + { + this(text, null); + } + + public JToggleButton(String text, Icon icon) + { + this(text, icon, false); + } + + public JToggleButton (String text, Icon icon, boolean selected) + { + super(text, icon); + + // Create the model + setModel(new ToggleButtonModel(this)); + + model.setSelected(selected); + } + + + + public AccessibleContext getAccessibleContext() + { + //Gets the AccessibleContext associated with this JToggleButton. + return null; + } + + public String getUIClassID() + { + //Returns a string that specifies the name of the L&F class that renders this component. + return "JToggleButton"; + } + + protected String paramString() + { + return "JToggleButton"; + } + + + public void updateUI() + { + ButtonUI b = (ButtonUI)UIManager.getUI(this); + setUI(b); + } + } + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JToolBar.java gcc-3.3/libjava/javax/swing/JToolBar.java *** gcc-3.2.3/libjava/javax/swing/JToolBar.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JToolBar.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,466 ---- + /* JToolBar.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.beans.*; + import java.io.*; + import javax.accessibility.*; + import javax.swing.plaf.*; + + /** + * JToolBar + * @author Andrew Selkirk + * @version 1.0 + */ + public class JToolBar extends JComponent + implements SwingConstants, Accessible { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * AccessibleJToolBar + */ + protected class AccessibleJToolBar extends AccessibleJComponent { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJToolBar + * @param component TODO + */ + protected AccessibleJToolBar(JToolBar component) { + super(component); + // TODO + } // AccessibleJToolBar() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return AccessibleRole.TOOL_BAR; + } // getAccessibleRole() + + + } // AccessibleJToolBar + + /** + * Separator + */ + public static class Separator extends JSeparator { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * separatorSize + */ + private Dimension size; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor Separator + */ + public Separator() { + // TODO + } // Separator() + + /** + * Constructor Separator + * @param size TODO + */ + public Separator(Dimension size) { + // TODO + } // Separator() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return null; // TODO + } // getUIClassID() + + /** + * getPreferredSize + * @returns Dimension + */ + public Dimension getPreferredSize() { + return null; // TODO + } // getPreferredSize() + + /** + * getMaximumSize + * @returns Dimension + */ + public Dimension getMaximumSize() { + return null; // TODO + } // getMaximumSize() + + /** + * getMinimumSize + * @returns Dimension + */ + public Dimension getMinimumSize() { + return null; // TODO + } // getMinimumSize() + + /** + * getSeparatorSize + * @returns Dimension + */ + public Dimension getSeparatorSize() { + return null; // TODO + } // getSeparatorSize() + + /** + * setSeparatorSize + * @param size TODO + */ + public void setSeparatorSize(Dimension size) { + // TODO + } // setSeparatorSize() + + + } // Separator + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * uiClassID + */ + private static final String uiClassID = "ToolBarUI"; + + /** + * paintBorder + */ + private boolean paintBorder; + + /** + * margin + */ + private Insets margin; + + /** + * floatable + */ + private boolean floatable; + + /** + * orientation + */ + private int orientation; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor JToolBar + */ + public JToolBar() { + // TODO + } // JToolBar() + + /** + * Constructor JToolBar + * @param orientation TODO + */ + public JToolBar(int orientation) { + // TODO + } // JToolBar() + + /** + * Constructor JToolBar + * @param name TODO + */ + public JToolBar(String name) { + // TODO + } // JToolBar() + + /** + * Constructor JToolBar + * @param name TODO + * @param orientation TODO + */ + public JToolBar(String name, int orientation) { + // TODO + } // JToolBar() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param stream TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + // TODO + } // writeObject() + + /** + * add + * @param action TODO + * @returns JButton + */ + public JButton add(Action action) { + return null; // TODO + } // add() + + /** + * paintBorder + * @param graphics TODO + */ + protected void paintBorder(Graphics graphics) { + // TODO + } // paintBorder() + + /** + * getUI + * @returns ToolBarUI + */ + public ToolBarUI getUI() { + return (ToolBarUI) ui; + } // getUI() + + /** + * setUI + * @param ui TODO + */ + public void setUI(ToolBarUI ui) { + super.setUI(ui); + } // setUI() + + /** + * updateUI + */ + public void updateUI() { + setUI((ToolBarUI) UIManager.get(this)); + invalidate(); + } // updateUI() + + /** + * getUIClassID + * @returns String + */ + public String getUIClassID() { + return uiClassID; + } // getUIClassID() + + /** + * getComponentIndex + * @param component TODO + * @returns int + */ + public int getComponentIndex(Component component) { + return 0; // TODO + } // getComponentIndex() + + /** + * getComponentAtIndex + * @param index TODO + * @returns Component + */ + public Component getComponentAtIndex(int index) { + return null; // TODO + } // getComponentAtIndex() + + /** + * getMargin + * @returns Insets + */ + public Insets getMargin() { + return null; // TODO + } // getMargin() + + /** + * setMargin + * @param margin TODO + */ + public void setMargin(Insets margin) { + // TODO + } // setMargin() + + /** + * isBorderPainted + * @returns boolean + */ + public boolean isBorderPainted() { + return false; // TODO + } // isBorderPainted() + + /** + * setBorderPainted + * @param painted TODO + */ + public void setBorderPainted(boolean painted) { + // TODO + } // setBorderPainted() + + /** + * isFloatable + * @returns boolean + */ + public boolean isFloatable() { + return false; // TODO + } // isFloatable() + + /** + * setFloatable + * @param floatable TODO + */ + public void setFloatable(boolean floatable) { + // TODO + } // setFloatable() + + /** + * getOrientation + * @returns int + */ + public int getOrientation() { + return 0; // TODO + } // getOrientation() + + /** + * setOrientation + * @param orientation TODO + */ + public void setOrientation(int orientation) { + // TODO + } // setOrientation() + + /** + * addSeparator + */ + public void addSeparator() { + // TODO + } // addSeparator() + + /** + * addSeparator + * @param size TODO + */ + public void addSeparator(Dimension size) { + // TODO + } // addSeparator() + + /** + * createActionComponent + * @param action TODO + * @returns JButton + */ + protected JButton createActionComponent(Action action) { + return null; // TODO + } // createActionComponent() + + /** + * createActionChangeListener + * @param button TODO + * @returns PropertyChangeListener + */ + protected PropertyChangeListener createActionChangeListener(JButton button) { + return null; // TODO + } // createActionChangeListener() + + /** + * addImpl + * @param component TODO + * @param constraints TODO + * @param index TODO + */ + protected void addImpl(Component component, Object constraints, int index) { + // TODO + } // addImpl() + + /** + * paramString + * @returns String + */ + protected String paramString() { + return null; // TODO + } // paramString() + + /** + * getAccessibleContext + * @returns AccessibleContext + */ + public AccessibleContext getAccessibleContext() { + if (accessibleContext == null) { + accessibleContext = new AccessibleJToolBar(this); + } // if + return accessibleContext; + } // getAccessibleContext() + + + } // JToolBar diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JToolTip.java gcc-3.3/libjava/javax/swing/JToolTip.java *** gcc-3.2.3/libjava/javax/swing/JToolTip.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JToolTip.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,53 ---- + /* JToolTip.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + + + public class JToolTip extends JComponent + { + String text; + + JToolTip(String text) + { + this.text = text; + } + } + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JTree.java gcc-3.3/libjava/javax/swing/JTree.java *** gcc-3.2.3/libjava/javax/swing/JTree.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JTree.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,109 ---- + /* JTree.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import javax.swing.plaf.*; + import javax.accessibility.*; + + public class JTree extends JComponent implements Scrollable, Accessible + { + JTree() + { + updateUI(); + } + + public TreeUI getUI() + { + return (TreeUI) ui; + } + + public void setUI(TreeUI ui) + { + super.setUI(ui); + } + + public void updateUI() + { + setUI((TreeUI)UIManager.getUI(this)); + } + + + public String getUIClassID() + { + return "JTree"; + } + + + public AccessibleContext getAccessibleContext() + { + return null; + } + + public Dimension getPreferredScrollableViewportSize() + { + return null; + } + + public int getScrollableUnitIncrement(Rectangle visibleRect, + int orientation, + int direction) + { + return 1; + } + + public int getScrollableBlockIncrement(Rectangle visibleRect, + int orientation, + int direction) + { + return 1; + } + + public boolean getScrollableTracksViewportWidth() + { + return false; + } + + public boolean getScrollableTracksViewportHeight() + { + return false; + } + } + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JViewport.java gcc-3.3/libjava/javax/swing/JViewport.java *** gcc-3.2.3/libjava/javax/swing/JViewport.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JViewport.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,136 ---- + /* JViewport.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import javax.swing.plaf.*; + import java.awt.*; + + + public class JViewport extends JComponent + { + Component c; + + JViewport() + { + setOpaque(true); + updateUI(); + } + + void setView(Component c) + { + if (this.c != null) + remove(c); + + this.c = c; + + add(c); + } + + public String getUIClassID() + { + return "JViewport"; + } + + public void updateUI() + { + ViewportUI vp = (ViewportUI) UIManager.getUI(this); + setUI(vp); + } + + Container GetHeavy(Container parent) + { + if (parent == null) + return null; + + while (isLightweightComponent(parent)) + { + Container p = parent.getParent(); + + if (p == null) + { + System.out.println("GetHeavy FAILED, no heavy weight component found"); + return parent; + } + + parent = p; + } + return parent; + } + + + public void paint(Graphics g) + { + paintChildren(g); + + System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXX JViewport -----> paint()"); + + Container parent = GetHeavy(getParent()); + + System.out.println("parent = " + parent + ", " + getParent()); + + //parent.paint(); + + Graphics wg = parent.getGraphics(); + + int x = 0; + int y = 0; + int w = getWidth(); + int h = getHeight(); + + Rectangle r = new Rectangle(x, y, w, h); + + int ox = 0; + int oy = 0; + + wg.copyArea(r.x, + r.y, + r.width, + r.height, + ox, + oy); + + wg.dispose(); + } + } + + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/JWindow.java gcc-3.3/libjava/javax/swing/JWindow.java *** gcc-3.2.3/libjava/javax/swing/JWindow.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/JWindow.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,230 ---- + /* JWindow.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + import java.awt.event.*; + import javax.accessibility.*; + + /** + * Unlike JComponent derivatives, JWindow inherits from + * java.awt.Window. But also lets a look-and-feel component to its work. + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class JWindow extends Window implements Accessible + { + public final static int HIDE_ON_CLOSE = 0; + public final static int EXIT_ON_CLOSE = 1; + public final static int DISPOSE_ON_CLOSE = 2; + public final static int DO_NOTHING_ON_CLOSE = 3; + + protected AccessibleContext accessibleContext; + + private int close_action = EXIT_ON_CLOSE; + + + /*************************************************** + * + * + * constructors + * + * + *************/ + + // huuu ? + public JWindow(Frame f) + { + super(f); + } + + /*************************************************** + * + * + * methods, this part is shared with JDialog, JFrame + * + * + *************/ + + + private boolean checking; + protected JRootPane rootPane; + + + protected void frameInit() + { + super.setLayout(new BorderLayout(1, 1)); + getRootPane(); // will do set/create + } + + public Dimension getPreferredSize() + { + Dimension d = super.getPreferredSize(); + return d; + } + + JMenuBar getJMenuBar() + { return getRootPane().getJMenuBar(); } + + void setJMenuBar(JMenuBar menubar) + { getRootPane().setJMenuBar(menubar); } + + + public void setLayout(LayoutManager manager) + { super.setLayout(manager); } + + void setLayeredPane(JLayeredPane layeredPane) + { getRootPane().setLayeredPane(layeredPane); } + + JLayeredPane getLayeredPane() + { return getRootPane().getLayeredPane(); } + + JRootPane getRootPane() + { + if (rootPane == null) + setRootPane(createRootPane()); + return rootPane; + } + + void setRootPane(JRootPane root) + { + if (rootPane != null) + remove(rootPane); + + rootPane = root; + add(rootPane, BorderLayout.CENTER); + } + + JRootPane createRootPane() + { return new JRootPane(); } + + Container getContentPane() + { return getRootPane().getContentPane(); } + + void setContentPane(Container contentPane) + { getRootPane().setContentPane(contentPane); } + + Component getGlassPane() + { return getRootPane().getGlassPane(); } + + void setGlassPane(Component glassPane) + { getRootPane().setGlassPane(glassPane); } + + + protected void addImpl(Component comp, Object constraints, int index) + { super.addImpl(comp, constraints, index); } + + + public void remove(Component comp) + { getContentPane().remove(comp); } + + protected boolean isRootPaneCheckingEnabled() + { return checking; } + + + protected void setRootPaneCheckingEnabled(boolean enabled) + { checking = enabled; } + + + public void update(Graphics g) + { paint(g); } + + protected void processKeyEvent(KeyEvent e) + { super.processKeyEvent(e); } + + ///////////////////////////////////////////////////////////////////////////////// + + public AccessibleContext getAccessibleContext() + { return null; } + + int getDefaultCloseOperation() + { return close_action; } + + protected String paramString() + { return "JWindow"; } + + + protected void processWindowEvent(WindowEvent e) + { + // System.out.println("PROCESS_WIN_EV-1: " + e); + super.processWindowEvent(e); + // System.out.println("PROCESS_WIN_EV-2: " + e); + switch (e.getID()) + { + case WindowEvent.WINDOW_CLOSING: + { + switch(close_action) + { + case EXIT_ON_CLOSE: + { + System.out.println("user requested exit on close"); + System.exit(1); + break; + } + case DISPOSE_ON_CLOSE: + { + System.out.println("user requested dispose on close"); + dispose(); + break; + } + case HIDE_ON_CLOSE: + { + setVisible(false); + break; + } + case DO_NOTHING_ON_CLOSE: + break; + } + break; + } + + case WindowEvent.WINDOW_CLOSED: + case WindowEvent.WINDOW_OPENED: + case WindowEvent.WINDOW_ICONIFIED: + case WindowEvent.WINDOW_DEICONIFIED: + case WindowEvent.WINDOW_ACTIVATED: + case WindowEvent.WINDOW_DEACTIVATED: + break; + } + } + + + void setDefaultCloseOperation(int operation) + { close_action = operation; } + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/KeyStroke.java gcc-3.3/libjava/javax/swing/KeyStroke.java *** gcc-3.2.3/libjava/javax/swing/KeyStroke.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/KeyStroke.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,269 ---- + /* KeyStroke.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.event.*; + import java.io.*; + + /** + * KeyStroke + * @author Andrew Selkirk + * @version 1.0 + */ + public class KeyStroke implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * keyChar + */ + private char keyChar = 0; + + /** + * keyCode + */ + private int keyCode = 0; + + /** + * modifiers + */ + private int modifiers = 0; + + /** + * onKeyRelease + */ + private boolean onKeyRelease = false; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor KeyStroke + */ + private KeyStroke() { + } // KeyStroke() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * hashCode + * @returns int + */ + public int hashCode() { + return 0; // TODO + } // hashCode() + + /** + * equals + * @param object TODO + * @returns boolean + */ + public boolean equals(Object object) { + + // Variables + KeyStroke key; + + if (object instanceof KeyStroke) { + key = (KeyStroke) object; + if (key.keyChar == keyChar && + key.keyCode == keyCode && + key.modifiers == modifiers && + key.onKeyRelease == onKeyRelease) { + return true; + } // if + } // if + return false; + + } // equals() + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * getKeyStroke + * @param keyChar TODO + * @returns KeyStroke + */ + public static KeyStroke getKeyStroke(char keyChar) { + + // Variables + KeyStroke key; + + key = new KeyStroke(); + key.keyChar = keyChar; + return key; + + } // getKeyStroke() + + /** + * getKeyStroke - deprecated + * @param keyChar TODO + * @param onKeyRelease TODO + * @returns KeyStroke + */ + public static KeyStroke getKeyStroke(char keyChar, boolean onKeyRelease) { + KeyStroke key = getKeyStroke(keyChar); + key.onKeyRelease = onKeyRelease; + return key; + } // getKeyStroke() + + /** + * getKeyStroke + * @param keyChar TODO + * @param modifiers TODO + * @returns KeyStroke + */ + public static KeyStroke getKeyStroke(Character keyChar, int modifiers) { + KeyStroke key = getKeyStroke(keyChar.charValue()); + key.modifiers = modifiers; + return key; + } // getKeyStroke() + + /** + * getKeyStroke + * @param keyCode TODO + * @param modifiers TODO + * @param onKeyRelease TODO + * @returns KeyStroke + */ + public static KeyStroke getKeyStroke(int keyCode, int modifiers, + boolean onKeyRelease) { + + // Variables + KeyStroke key; + + key = new KeyStroke(); + key.keyCode = keyCode; + key.modifiers = modifiers; + key.onKeyRelease = onKeyRelease; + return key; + + } // getKeyStroke() + + /** + * getKeyStroke + * @param keyCode TODO + * @param modifiers TODO + * @returns KeyStroke + */ + public static KeyStroke getKeyStroke(int keyCode, int modifiers) { + return getKeyStroke(keyCode, modifiers, false); + } // getKeyStroke() + + /** + * getKeyStroke + * @param string TODO + * @returns KeyStroke + */ + public static KeyStroke getKeyStroke(String string) { + return null; // TODO + } // getKeyStroke() + + /** + * getKeyStrokeForEvent + * @param event TODO + * @returns KeyStroke + */ + public static KeyStroke getKeyStrokeForEvent(KeyEvent event) { + + // Variables + int eventID; + int eventMod; + + // Get Event ID + eventID = event.getID(); + eventMod = event.getModifiers(); + + // Check for KEY_TYPED event + if (eventID == KeyEvent.KEY_TYPED) { + return getKeyStroke(event.getKeyChar(), eventMod); + + // KEY_PRESSED or KEY_RELEASED event + } else { + return getKeyStroke(event.getKeyCode(), eventMod); + } // if + + } // getKeyStrokeForEvent() + + /** + * getKeyChar + * @returns char + */ + public char getKeyChar() { + return keyChar; + } // getKeyChar() + + /** + * getKeyCode + * @returns int + */ + public int getKeyCode() { + return keyCode; + } // getKeyCode() + + /** + * getModifiers + * @returns int + */ + public int getModifiers() { + return modifiers; // TODO + } // getModifiers() + + /** + * isOnKeyRelease + * @returns boolean + */ + public boolean isOnKeyRelease() { + return onKeyRelease; + } // isOnKeyRelease() + + + } // KeyStroke diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ListCellRenderer.java gcc-3.3/libjava/javax/swing/ListCellRenderer.java *** gcc-3.2.3/libjava/javax/swing/ListCellRenderer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ListCellRenderer.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,49 ---- + /* ListCellRenderer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + + public interface ListCellRenderer + { + public Component getListCellRendererComponent(JList list, + Object value, + int index, + boolean isSelected, + boolean cellHasFocus); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ListModel.java gcc-3.3/libjava/javax/swing/ListModel.java *** gcc-3.2.3/libjava/javax/swing/ListModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ListModel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,48 ---- + /* ListModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import javax.swing.event.*; + + public interface ListModel + { + int getSize(); + Object getElementAt(int index); + void addListDataListener(ListDataListener l); + void removeListDataListener(ListDataListener l); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ListSelectionModel.java gcc-3.3/libjava/javax/swing/ListSelectionModel.java *** gcc-3.2.3/libjava/javax/swing/ListSelectionModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ListSelectionModel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,65 ---- + /* ListSelectionModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + + import javax.swing.event.*; + + public interface ListSelectionModel + { + final static int SINGLE_SELECTION = 0; + final static int SINGLE_INTERVAL_SELECTION = 1; + final static int MULTIPLE_INTERVAL_SELECTION = 1; + + void setSelectionMode(int a); + int getSelectionMode(); + + void clearSelection(); + + int getMinSelectionIndex(); + int getMaxSelectionIndex(); + boolean isSelectedIndex(int a); + + void setSelectionInterval(int index0, int index1); + + + + void addListSelectionListener(ListSelectionListener listener); + void removeListSelectionListener(ListSelectionListener listener); + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/LookAndFeel.java gcc-3.3/libjava/javax/swing/LookAndFeel.java *** gcc-3.2.3/libjava/javax/swing/LookAndFeel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/LookAndFeel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,125 ---- + /* LookAndFeel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import javax.swing.text.*; + + public abstract class LookAndFeel + { + public UIDefaults getDefaults() + { + //This method is called once by UIManager.setLookAndFeel to create the look and feel specific defaults table. + return null; + } + + public abstract String getDescription(); + public abstract String getID(); + public abstract String getName(); + + public void initialize() + { + //UIManager.setLookAndFeel calls this method before the first call (and typically the only call) to getDefaults(). + } + + static void installBorder(JComponent c, String defaultBorderName) + { + //Convenience method for installing a component's default Border object on the specified component if either the border is currently null or already an instance of UIResource. + } + + public static void installColors(JComponent c, String defaultBgName, String defaultFgName) + { + //Convenience method for initializing a component's foreground and background color properties with values from the current defaults table. + } + + public static void installColorsAndFont(JComponent c, String defaultBgName, String defaultFgName, String defaultFontName) + { + //Convenience method for initializing a components foreground background and font properties with values from the current defaults table. + } + + public abstract boolean isNativeLookAndFeel(); + public abstract boolean isSupportedLookAndFeel(); + + public static void loadKeyBindings(InputMap retMap, Object[] keys) + { + //Loads the bindings in keys into retMap. + } + + public static ComponentInputMap makeComponentInputMap(JComponent c, Object[] keys) + { + // Creates a ComponentInputMap from keys. + return null; + } + + public static Object makeIcon(Class baseClass, String gifFile) + { + //Utility method that creates a UIDefaults.LazyValue that creates an ImageIcon UIResource for the specified gifFile filename. + return null; + } + + public static InputMap makeInputMap(Object[] keys) + { + //Creates a InputMap from keys. + return null; + } + + public static JTextComponent.KeyBinding[] makeKeyBindings(Object[] keyBindingList) + { + // Convenience method for building lists of KeyBindings. + return null; + } + + + public String toString() + { + //Returns a string that displays and identifies this object's properties. + return "LookAndFeel"; + } + + public void uninitialize() + { + //UIManager.setLookAndFeel calls this method just before we're replaced by a new default look and feel. + } + + + public static void uninstallBorder(JComponent c) + { + //Convenience method for un-installing a component's default border on the specified component if the border is currently an instance of UIResource. + } + + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/MenuElement.java gcc-3.3/libjava/javax/swing/MenuElement.java *** gcc-3.2.3/libjava/javax/swing/MenuElement.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/MenuElement.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,92 ---- + /* MenuElement.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.awt.event.*; + + /** + * MenuElement + * @author Andrew Selkirk + * @version 1.0 + */ + public interface MenuElement { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * processMouseEvent + * @param event TODO + * @param path TODO + * @param manager TODO + */ + public void processMouseEvent(MouseEvent event, + MenuElement[] path, MenuSelectionManager manager); + + /** + * processKeyEvent + * @param event TODO + * @param path TODO + * @param manager TODO + */ + public abstract void processKeyEvent(KeyEvent event, + MenuElement[] path, MenuSelectionManager manager); + + /** + * menuSelectionChanged + * @param included TODO + */ + public abstract void menuSelectionChanged(boolean included); + + /** + * getSubElements + * @returns MenuElement[] + */ + public abstract MenuElement[] getSubElements(); + + /** + * getComponent + * @returns Component + */ + public abstract Component getComponent(); + + + } // MenuElement diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/MenuSelectionManager.java gcc-3.3/libjava/javax/swing/MenuSelectionManager.java *** gcc-3.2.3/libjava/javax/swing/MenuSelectionManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/MenuSelectionManager.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,44 ---- + /* MenuSelectionManager.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + /** + * STUBBED + */ + public class MenuSelectionManager + { + } // class MenuSelectionManager diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/MutableComboBoxModel.java gcc-3.3/libjava/javax/swing/MutableComboBoxModel.java *** gcc-3.2.3/libjava/javax/swing/MutableComboBoxModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/MutableComboBoxModel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,77 ---- + /* MutableComboBoxModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + /** + * MutableComboBoxModel + * @author Andrew Selkirk + * @version 1.0 + */ + public interface MutableComboBoxModel extends ComboBoxModel { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * addElement + * @param object TODO + */ + public void addElement(Object object); + + /** + * removeElementAt + * @param index TODO + */ + public void removeElementAt(int index); + + /** + * insertElementAt + * @param object TODO + * @param index TODO + */ + public void insertElementAt(Object object, int index); + + /** + * removeElement + * @param object TODO + */ + public void removeElement(Object object); + + + } // MutableComboBoxModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/OverlayLayout.java gcc-3.3/libjava/javax/swing/OverlayLayout.java *** gcc-3.2.3/libjava/javax/swing/OverlayLayout.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/OverlayLayout.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,186 ---- + /* OverlayLayout.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.io.*; + + /** + * OverlayLayout + * @author Andrew Selkirk + * @version 1.0 + */ + public class OverlayLayout implements LayoutManager2, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * target + */ + private Container target; + + /** + * xChildren + */ + private SizeRequirements[] xChildren; + + /** + * yChildren + */ + private SizeRequirements[] yChildren; + + /** + * xTotal + */ + private SizeRequirements xTotal; + + /** + * yTotal + */ + private SizeRequirements yTotal; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor OverlayLayout + * @param target TODO + */ + public OverlayLayout(Container target) { + // TODO + } // OverlayLayout() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * invalidateLayout + * @param target TODO + */ + public void invalidateLayout(Container target) { + // TODO + } // invalidateLayout() + + /** + * addLayoutComponent + * @param string TODO + * @param component TODO + */ + public void addLayoutComponent(String string, Component component) { + // TODO + } // addLayoutComponent() + + /** + * addLayoutComponent + * @param component TODO + * @param constraints TODO + */ + public void addLayoutComponent(Component component, Object constraints) { + // TODO + } // addLayoutComponent() + + /** + * removeLayoutComponent + * @param component TODO + */ + public void removeLayoutComponent(Component component) { + // TODO + } // removeLayoutComponent() + + /** + * preferredLayoutSize + * @param target TODO + * @returns Dimension + */ + public Dimension preferredLayoutSize(Container target) { + return null; // TODO + } // preferredLayoutSize() + + /** + * minimumLayoutSize + * @param target TODO + * @returns Dimension + */ + public Dimension minimumLayoutSize(Container target) { + return null; // TODO + } // minimumLayoutSize() + + /** + * maximumLayoutSize + * @param target TODO + * @returns Dimension + */ + public Dimension maximumLayoutSize(Container target) { + return null; // TODO + } // maximumLayoutSize() + + /** + * getLayoutAlignmentX + * @param target TODO + * @returns float + */ + public float getLayoutAlignmentX(Container target) { + return (float) 0.0; // TODO + } // getLayoutAlignmentX() + + /** + * getLayoutAlignmentY + * @param target TODO + * @returns float + */ + public float getLayoutAlignmentY(Container target) { + return (float) 0.0; // TODO + } // getLayoutAlignmentY() + + /** + * layoutContainer + * @param target TODO + */ + public void layoutContainer(Container target) { + // TODO + } // layoutContainer() + + + } // OverlayLayout diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ActionMapUIResource.java gcc-3.3/libjava/javax/swing/plaf/ActionMapUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/ActionMapUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ActionMapUIResource.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* ActionMapUIResource.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + // Imports + import javax.swing.*; + + /** + * ActionMapUIResource + * @author Andrew Selkirk + * @version 1.0 + */ + public class ActionMapUIResource extends ActionMap implements UIResource { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ActionMapUIResource + */ + public ActionMapUIResource() { + // TODO + } // ActionMapUIResource() + + + } // ActionMapUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicBorders.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicBorders.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicBorders.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicBorders.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,42 ---- + package javax.swing.plaf.basic; + import java.awt.Color; + /** + * STUBBED + */ + public class BasicBorders + { + public static class ButtonBorder + { + } // class ButtonBorder + public static class FieldBorder + { + public FieldBorder(Color shadow, Color darkShadow, + Color highlight, Color lightHighlight) + { + } + } // class FieldBorder + public static class MarginBorder + { + } // class MarginBorder + public static class MenuBarBorder + { + public MenuBarBorder(Color shadow, Color highlight) + { + } + } // class MenuBarBorder + public static class RadioButtonBorder + { + } // class RadioButtonBorder + public static class RolloverButtonBorder + { + } // class RolloverButtonBorder + public static class SplitPaneBorder + { + public SplitPaneBorder(Color highlight, Color shadow) + { + } + } // class SplitPaneBorder + public static class ToggleButtonBorder + { + } // class ToggleButtonBorder + } // class BasicBorders diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicButtonUI.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicButtonUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicButtonUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicButtonUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,177 ---- + package javax.swing.plaf.basic; + + import javax.swing.*; + import javax.swing.plaf.*; + import java.awt.*; + + + public class BasicButtonUI extends ButtonUI + { + int gap = 3; + // int y_text_space = 2, x_text_space + 5; + + Color textColor, disabledTextColor; + Color pressedBackgroundColor; + Color normalBackgroundColor; + + + public static ComponentUI createUI(final JComponent c) + { + return new BasicButtonUI(); + } + + + public void installUI(final JComponent c) + { + super.installUI(c); + + textColor = new Color(0,0,0); + disabledTextColor = new Color(130, 130, 130); + pressedBackgroundColor = new Color(150,150,150); + pressedBackgroundColor = new Color(150,150,150); + normalBackgroundColor = new Color(192,192,192); + } + + + public Dimension getPreferredSize(JComponent c) + { + AbstractButton b = (AbstractButton)c; + Dimension d = BasicGraphicsUtils.getPreferredSize(b, + gap, + b.getText(), + b.getIcon(), + b.getVerticalAlignment(), + b.getHorizontalAlignment(), + b.getHorizontalTextPosition(), + b.getVerticalTextPosition()); + // System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text); + return d; + } + + + public void paint(Graphics g, JComponent c) + { + AbstractButton b = (AbstractButton) c; + + Rectangle tr = new Rectangle(); + Rectangle ir = new Rectangle(); + Rectangle vr = new Rectangle(); + + Font f = c.getFont(); + + g.setFont(f); + + FontMetrics fm = SwingUtilities.getFontMetrics(f); + + Insets i = c.getInsets(); + + vr.x = i.left; + vr.y = i.top; + vr.width = b.getWidth() - (i.right + vr.x); + vr.height = b.getHeight() - (i.bottom + vr.y); + + //System.out.println(" VIEW-RECT-BUTTON="+vr+", insets="+i+", FONTM="+fm); + + String text = SwingUtilities.layoutCompoundLabel(c, + fm, + b.getText(), + b.getIcon(), + b.getVerticalAlignment(), + b.getHorizontalAlignment(), + b.getVerticalTextPosition(), + b.getHorizontalTextPosition(), + vr, + ir, + tr, + gap); + + if (b.getModel().isPressed() || + b.getModel().isSelected()) + { + //System.out.println("paint pressed"); + paintButtonPressed(g, c); + } + else + { + //System.out.println("paint normal"); + paintButtonNormal(g, c); + } + + paintIcon(g, c, ir); + paintText(g, c, tr, b.getText()); + paintFocus(g, c, vr, tr, ir); + } + + + protected void paintFocus(Graphics g, + JComponent c, + Rectangle vr, + Rectangle tr, + Rectangle ir) + { + } + + protected void paintIcon(Graphics g, + JComponent c, + Rectangle iconRect) + { + AbstractButton b = (AbstractButton) c; + if (b.getIcon() != null) + { + int x = iconRect.x; + int y = iconRect.y; + + System.out.println("WE HAVE AN ICON: " + b.getIcon()); + + b.getIcon().paintIcon(c, g, x, y); + } + else + { + //System.out.println("NO ICON FOR BUTTON:" + b.text); + } + } + + protected void paintButtonPressed(Graphics g, + JComponent b) + { + Dimension size = b.getSize(); + + g.setColor(pressedBackgroundColor); + g.fillRect(1,1,size.width-2, size.height-2); + + } + + protected void paintButtonNormal(Graphics g, + JComponent b) + { + Dimension size = b.getSize(); + + g.setColor(normalBackgroundColor); + g.fillRect(1,1,size.width-2, size.height-2); + + } + + protected void paintText(Graphics g, + JComponent c, + Rectangle textRect, + String text) + { + Font f = c.getFont(); + + g.setFont(f); + + FontMetrics fm = SwingUtilities.getFontMetrics(f); + + g.setColor(c.isEnabled() ? textColor : disabledTextColor); + + BasicGraphicsUtils.drawString(g, + text, + 0, + textRect.x, + textRect.y + fm.getAscent()/2); + } + } + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,88 ---- + package javax.swing.plaf.basic; + + import javax.swing.*; + import javax.swing.plaf.*; + import java.awt.*; + + + public class BasicCheckBoxUI extends BasicRadioButtonUI + { + public static ComponentUI createUI(final JComponent c) { + return new BasicCheckBoxUI(); + } + + + public void installUI(final JComponent c) { + super.installUI(c); + } + + public Dimension getPreferredSize(JComponent c) + { + AbstractButton b = (AbstractButton)c; + Dimension d = BasicGraphicsUtils.getPreferredSize(b, + gap, + b.getText(), + b.getIcon(), + b.getVerticalAlignment(), + b.getHorizontalAlignment(), + b.getHorizontalTextPosition(), + b.getVerticalTextPosition()); + + //System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text); + return d; + } + + protected void paintFocus(Graphics g, + JComponent c, + Rectangle vr, + Rectangle tr, + Rectangle ir) + { + } + + protected void paintIcon(Graphics g, + JComponent c, + Rectangle iconRect) + { + } + + protected void paintButtonPressed(Graphics g, + JComponent b) + { + Dimension size = b.getSize(); + + g.setColor(pressedBackgroundColor); + g.fillRect(1,1,size.width-2, size.height-2); + + } + + protected void paintButtonNormal(Graphics g, + JComponent b) + { + Dimension size = b.getSize(); + + g.setColor(normalBackgroundColor); + g.fillRect(1,1,size.width-2, size.height-2); + + } + protected void paintText(Graphics g, + JComponent c, + Rectangle textRect, + String text) + { + // AbstractButton b = (AbstractButton) c; + + // System.out.println("drawing string: " + text + ", at:" + textRect); + + g.setColor(textColor); + BasicGraphicsUtils.drawString(g, + text, + 0, + textRect.x, + textRect.y); + } + } + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicDefaults.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicDefaults.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicDefaults.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicDefaults.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,82 ---- + package javax.swing.plaf.basic; + + import javax.swing.*; + import java.awt.*; + import javax.swing.border.*; + + class BasicBorder extends MatteBorder + { + static Color BtnPointClr = new Color( 180, 180, 180); + + BasicBorder() + { + super(5,5,5,5, null); + } + + public void paintBorder(Component c, + Graphics g, + int x, + int y, + int width, + int height) + { + // System.out.println("PAINT-------------------------------------------BORDER"); + + if (g != null) + { + g.setColor( BtnPointClr); + g.draw3DRect( 0, 0, width-1, height-1, true); + } + } + } + + class PanelBorder extends MatteBorder + { + PanelBorder() + { + super(5,5,5,5, null); + } + + public void paintBorder(Component c, + Graphics g, + int x, + int y, + int width, + int height) + { + // System.out.println("PAINT-------------------------------------------BORDER"); + super.paintBorder(c, g, x, y, width, height); + } + } + + public class BasicDefaults extends UIDefaults + { + public BasicDefaults() + { + // System.out.println("BasicDefaults !!!!!!!!!!!!!!!!!!!!!!!!!"); + put("JButton", new BasicButtonUI()); + put("JLabel", new BasicLabelUI()); + + put("JPanel", new BasicPanelUI()); + put("JCheckBox", new BasicCheckBoxUI()); + put("JRadioButton", new BasicRadioButtonUI()); + put("JToggleButton", new BasicToggleButtonUI()); + put("JOptionPane", new BasicOptionPaneUI()); + put("JList", new BasicListUI()); + put("JTree", new BasicTreeUI()); + put("JTextComponent", new BasicTextUI()); + put("JTabbedPane", new BasicTabbedPaneUI()); + put("JScrollPane", new BasicScrollPaneUI()); + put("JViewport", new BasicViewportUI()); + + put("JButton.border", new BasicBorder()); + put("JPanel.border", new PanelBorder()); + + put("JToggleButton.border", new PanelBorder()); + put("JCheckBox.border", new PanelBorder()); + put("JRadioButton.border", new PanelBorder()); + } + + } + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicGraphicsUtils.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,77 ---- + package javax.swing.plaf.basic; + + + import java.awt.*; + import javax.swing.*; + + + public class BasicGraphicsUtils + { + public static Dimension getPreferredSize(JComponent b, + int gap, + String text, + Icon icon, + int va, + int ha, + int htp, + int vtp) + { + JComponent c = b; + // this is a staight copy from BasicButtonUI.paint() + // + Rectangle tr = new Rectangle(); + Rectangle ir = new Rectangle(); + Rectangle vr = new Rectangle(); + + Font f = c.getFont(); + + FontMetrics fm = SwingUtilities.getFontMetrics(f); + + Insets i = c.getInsets(); + + vr.x = i.left; + vr.y = i.top; + vr.width = b.getWidth() - (i.right + i.left); + vr.height = b.getHeight() - (i.bottom + i.top); + + // System.out.println(" VIEW-RECT-BUTTON="+vr+", insets="+i); + + String tt = SwingUtilities.layoutCompoundLabel(b, + fm, + text, + icon, + va, + ha, + vtp, + htp, + vr, + ir, + tr, + gap); + + Rectangle r = ir.union(tr); + + Insets insets = b.getInsets(); + r.width += insets.left + insets.right; + r.height += insets.top + insets.bottom; + + // System.out.println("COMPUTED SIZE FOR PREF_SIZE="+r); + + return r.getSize(); + } + + public static void drawString(Graphics g, + String text, + int underlinedChar, + int x, + int y) + { + g.drawString(text, x, y); + } + } + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicIconFactory.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicIconFactory.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicIconFactory.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicIconFactory.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,45 ---- + package javax.swing.plaf.basic; + + import java.io.Serializable; + import javax.swing.Icon; + /** + * STUBBED + */ + public class BasicIconFactory implements Serializable + { + public BasicIconFactory() + { + } + public static Icon getMenuItemCheckIcon() + { + return null; + } + public static Icon getMenuItemArrowIcon() + { + return null; + } + public static Icon getMenuArrowIcon() + { + return null; + } + public static Icon getCheckBoxIcon() + { + return null; + } + public static Icon getRadioButtonIcon() + { + return null; + } + public static Icon getCheckBoxMenuItemIcon() + { + return null; + } + public static Icon getRadioButtonMenuItemIcon() + { + return null; + } + public static Icon createEmptyFrameIcon() + { + return null; + } + } // class BasicIconFactory diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicLabelUI.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicLabelUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicLabelUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicLabelUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,158 ---- + package javax.swing.plaf.basic; + + import javax.swing.*; + import javax.swing.plaf.*; + import java.awt.*; + + + public class BasicLabelUI extends LabelUI + { + int gap = 3; + + Color foreground; + + + public static ComponentUI createUI(final JComponent c) { + return new BasicLabelUI(); + } + + + public void installUI(final JComponent c) { + super.installUI(c); + + foreground = new Color(0,0,250); + } + + + public Dimension getPreferredSize(JComponent c) + { + JLabel b = (JLabel)c; + Dimension d = BasicGraphicsUtils.getPreferredSize(b, + gap, + b.getText(), + b.getIcon(), + b.getVerticalAlignment(), + b.getHorizontalAlignment(), + b.getHorizontalTextPosition(), + b.getVerticalTextPosition()); + System.out.println("JLABEL->^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.getText()); + return d; + } + + + public void paint(Graphics g, JComponent c) + { + JLabel b = (JLabel) c; + + Rectangle tr = new Rectangle(); + Rectangle ir = new Rectangle(); + Rectangle vr = new Rectangle(); + + Font f = c.getFont(); + + g.setFont(f); + + FontMetrics fm = SwingUtilities.getFontMetrics(f); + + Insets i = c.getInsets(); + + Rectangle bound = c.getBounds(); + + System.out.println("BOUND=" + bound + ", insets = " + i + ", " + b.getText()); + + if (bound == null) + { + vr.x = i.left; + vr.y = i.top; + vr.width = b.getWidth() - (i.right + i.left); + vr.height = b.getHeight() - (i.bottom + i.top); + } + else + { + vr.x = bound.x + i.left; + vr.y = bound.y + i.top; + vr.width = bound.width - (i.right + i.left); + vr.height = bound.height - (i.bottom + i.top); + } + + System.out.println(" VIEW-RECT-JLABEL="+vr+", insets="+i+", FONTM="+fm); + + String text = SwingUtilities.layoutCompoundLabel(c, + fm, + b.getText(), + b.getIcon(), + b.getVerticalAlignment(), + b.getHorizontalAlignment(), + b.getVerticalTextPosition(), + b.getHorizontalTextPosition(), + vr, + ir, + tr, + gap); + + paintIcon(g, c, ir); + paintText(g, c, tr, b.getText()); + paintFocus(g, c, vr, tr, ir); + } + + + protected void paintFocus(Graphics g, + JComponent c, + Rectangle vr, + Rectangle tr, + Rectangle ir) + { + } + + protected void paintIcon(Graphics g, + JComponent c, + Rectangle iconRect) + { + JLabel b = (JLabel) c; + if (b.getIcon() != null) + { + int x = iconRect.x; + int y = iconRect.y; + + System.out.println("WE HAVE AN ICON: " + b.getIcon()); + + b.getIcon().paintIcon(c, g, x, y); + } + else + { + //System.out.println("NO ICON FOR BUTTON:" + b.text); + } + } + + + protected void paintText(Graphics g, + JComponent c, + Rectangle textRect, + String text) + { + // AbstractLabel b = (AbstractLabel) c; + + System.out.println("JLabel: drawing string: " + text + ", at:" + textRect); + + g.setColor(foreground); + //g.setBackColor(new Color(190,190,190)); + + g.drawLine(0,0,100,100); + + BasicGraphicsUtils.drawString(g, + text, + 0, + 0,//textRect.x, + 0);//textRect.y); + } + } + + + + + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicListUI.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicListUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicListUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicListUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,132 ---- + package javax.swing.plaf.basic; + + import javax.swing.plaf.*; + import javax.swing.*; + import java.awt.*; + + + public class BasicListUI extends ListUI + { + int gap_between_cells; + Color textColor, disabledTextColor, pressedBackgroundColor, normalBackgroundColor; + + + public static ComponentUI createUI(final JComponent c) + { + return new BasicButtonUI(); + } + + + public void installUI(final JComponent c) + { + super.installUI(c); + + textColor = new Color(0,0,0); + disabledTextColor = new Color(130, 130, 130); + pressedBackgroundColor = new Color(150,150,150); + normalBackgroundColor = new Color(192,192,192); + } + + public Dimension getPreferredSize(JComponent c) + { + JList l = (JList) c; + + System.out.println("XXXXXXXXXXXXXXXxx getPreferredSize------------> " + l); + + + int rows = l.getVisibleRowCount(); + + ListCellRenderer render = l.getCellRenderer(); + + int width = 200; + int height = rows * 16; + + if (l.getModel().getSize() == 0) + { + return new Dimension(width, height); + } + + System.out.println("BASIC_LIST_UI ====-> " + l.getModel().getElementAt(0)); + + Component elt = render.getListCellRendererComponent(l, + l.getModel().getElementAt(0), + 0, + false, + false); + Dimension a = elt.getPreferredSize(); + if (a == null) + { + return new Dimension(width, height); + } + + return new Dimension(a.width, + a.height * rows); + } + + public void paintBackground(Graphics g, + JComponent c) + { + Dimension size = getPreferredSize(c); + + g.setColor(normalBackgroundColor); + g.fillRect(0,0,size.width, size.height); + } + + public void paint(Graphics g, + JComponent c) + { + JList l = (JList) c; + + int rows = l.getVisibleRowCount(); + + ListCellRenderer render = l.getCellRenderer(); + + System.out.println("RENDER-JLIST: " + rows + ", " + l.getModel().getSize()); + + paintBackground(g, c); + + if (l.getModel().getSize() == 0) + return; + + // use element 0 to figure out how big we are: + Component elt = render.getListCellRendererComponent(l, + l.getModel().getElementAt(0), + 0, + false, + false); + Dimension dim = elt.getPreferredSize(); + + Rectangle a = new Rectangle(0, + 0, + dim.width, + dim.height); + + for (int i=0;i " + a + ", " + comp + ", index = " + i); + + comp.setBounds(a); + + comp.paint(g); + + a.y += dim.height + gap_between_cells; + } + } + } + + + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,927 ---- + /* BasicLookAndFeel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.swing.plaf.basic; + + import java.awt.Color; + import java.awt.Dimension; + import java.awt.Font; + import java.awt.event.KeyEvent; + import java.io.Serializable; + import java.util.Enumeration; + import java.util.ResourceBundle; + import javax.swing.ImageIcon; + import javax.swing.KeyStroke; + import javax.swing.LookAndFeel; + import javax.swing.UIDefaults; + import javax.swing.plaf.BorderUIResource; + import javax.swing.plaf.ColorUIResource; + import javax.swing.plaf.DimensionUIResource; + import javax.swing.plaf.FontUIResource; + import javax.swing.plaf.IconUIResource; + import javax.swing.plaf.InsetsUIResource; + import javax.swing.text.JTextComponent; + + /** + * BasicLookAndFeel + * @author Andrew Selkirk + */ + public abstract class BasicLookAndFeel extends LookAndFeel + implements Serializable + { + /** + * Constructor BasicLookAndFeel + */ + public BasicLookAndFeel() + { + // TODO + } + + /** + * getDefaults + * @return UIDefaults + */ + public UIDefaults getDefaults() + { + // Variables + UIDefaults def = new UIDefaults(); + // Initialize Class Defaults + initClassDefaults(def); + // Initialize System Colour Defaults + initSystemColorDefaults(def); + // Initialize Component Defaults + initComponentDefaults(def); + // Return UI Defaults + return def; + } + + /** + * initClassDefaults + * @param value0 TODO + */ + protected void initClassDefaults(UIDefaults defaults) + { + // Variables + Object[] uiDefaults; + // Initialize Class Defaults + uiDefaults = new Object[] { + "ButtonUI", "javax.swing.plaf.basic.BasicButtonUI", + "CheckBoxMenuItemUI", "javax.swing.plaf.basic.BasicCheckBoxMenuItemUI", + "CheckBoxUI", "javax.swing.plaf.basic.BasicCheckBoxUI", + "ColorChooserUI", "javax.swing.plaf.basic.BasicColorChooserUI", + "ComboBoxUI", "javax.swing.plaf.basic.BasicComboBoxUI", + "DesktopIconUI", "javax.swing.plaf.basic.BasicDesktopIconUI", + "DesktopPaneUI", "javax.swing.plaf.basic.BasicDesktopPaneUI", + "EditorPaneUI", "javax.swing.plaf.basic.BasicEditorPaneUI", + "InternalFrameUI", "javax.swing.plaf.basic.BasicInternalFrameUI", + "LabelUI", "javax.swing.plaf.basic.BasicLabelUI", + "ListUI", "javax.swing.plaf.basic.BasicListUI", + "MenuBarUI", "javax.swing.plaf.basic.BasicMenuBarUI", + "MenuItemUI", "javax.swing.plaf.basic.BasicMenuItemUI", + "MenuUI", "javax.swing.plaf.basic.BasicMenuUI", + "OptionPaneUI", "javax.swing.plaf.basic.BasicOptionPaneUI", + "PanelUI", "javax.swing.plaf.basic.BasicPanelUI", + "PasswordFieldUI", "javax.swing.plaf.basic.BasicPasswordFieldUI", + "PopupMenuSeparatorUI", "javax.swing.plaf.basic.BasicPopupMenuSeparatorUI", + "PopupMenuUI", "javax.swing.plaf.basic.BasicPopupMenuUI", + "ProgressBarUI", "javax.swing.plaf.basic.BasicProgressBarUI", + "RadioButtonMenuItemUI", "javax.swing.plaf.basic.BasicRadioButtonMenuItemUI", + "RadioButtonUI", "javax.swing.plaf.basic.BasicRadioButtonUI", + "RootPaneUI", "javax.swing.plaf.basic.BasicRootPaneUI", + "ScrollBarUI", "javax.swing.plaf.basic.BasicScrollBarUI", + "ScrollPaneUI", "javax.swing.plaf.basic.BasicScrollPaneUI", + "SeparatorUI", "javax.swing.plaf.basic.BasicSeparatorUI", + "SliderUI", "javax.swing.plaf.basic.BasicSliderUI", + "SplitPaneUI", "javax.swing.plaf.basic.BasicSplitPaneUI", + "StandardDialogUI", "javax.swing.plaf.basic.BasicStandardDialogUI", + "TabbedPaneUI", "javax.swing.plaf.basic.BasicTabbedPaneUI", + "TableHeaderUI", "javax.swing.plaf.basic.BasicTableHeaderUI", + "TableUI", "javax.swing.plaf.basic.BasicTableUI", + "TextAreaUI", "javax.swing.plaf.basic.BasicTextAreaUI", + "TextFieldUI", "javax.swing.plaf.basic.BasicTextFieldUI", + "TextPaneUI", "javax.swing.plaf.basic.BasicTextPaneUI", + "ToggleButtonUI", "javax.swing.plaf.basic.BasicToggleButtonUI", + "ToolBarSeparatorUI", "javax.swing.plaf.basic.BasicToolBarSeparatorUI", + "ToolBarUI", "javax.swing.plaf.basic.BasicToolBarUI", + "ToolTipUI", "javax.swing.plaf.basic.BasicToolTipUI", + "TreeUI", "javax.swing.plaf.basic.BasicTreeUI", + "ViewportUI", "javax.swing.plaf.basic.BasicViewportUI" + }; + // Add Class Defaults to UI Defaults table + defaults.putDefaults(uiDefaults); + } + + /** + * initSystemColorDefaults + * @param defaults TODO + */ + protected void initSystemColorDefaults(UIDefaults defaults) + { + Object[] uiDefaults; + uiDefaults = new Object[] { + "activeCaption", new ColorUIResource(0, 0, 128), + "activeCaptionBorder", new ColorUIResource(Color.lightGray), + "activeCaptionText", new ColorUIResource(Color.white), + "control", new ColorUIResource(Color.lightGray), + "controlDkShadow", new ColorUIResource(Color.black), + "controlHighlight", new ColorUIResource(Color.lightGray), + "controlLtHighlight", new ColorUIResource(Color.white), + "controlShadow", new ColorUIResource(Color.gray), + "controlText", new ColorUIResource(Color.black), + "desktop", new ColorUIResource(0, 92, 92), + "inactiveCaption", new ColorUIResource(Color.gray), + "inactiveCaptionBorder", new ColorUIResource(Color.lightGray), + "inactiveCaptionText", new ColorUIResource(Color.lightGray), + "info", new ColorUIResource(Color.white), + "infoText", new ColorUIResource(Color.black), + "menu", new ColorUIResource(Color.lightGray), + "menuText", new ColorUIResource(Color.black), + "scrollbar", new ColorUIResource(224, 224, 224), + "text", new ColorUIResource(Color.lightGray), + "textHighlight", new ColorUIResource(0, 0, 128), + "textHighlightText", new ColorUIResource(Color.white), + "textInactiveText", new ColorUIResource(Color.gray), + "textText", new ColorUIResource(Color.black), + "window", new ColorUIResource(Color.white), + "windowBorder", new ColorUIResource(Color.black), + "windowText", new ColorUIResource(Color.black) + }; + defaults.putDefaults(uiDefaults); + } + + /** + * loadSystemColors + * @param defaults TODO + * @param value1 TODO + * @param value2 TODO + */ + protected void loadSystemColors(UIDefaults defaults, String[] value1, + boolean value2) + { + // TODO + } + + /** + * loadResourceBundle + * @param defaults TODO + */ + private void loadResourceBundle(UIDefaults defaults) + { + ResourceBundle bundle; + Enumeration enum; + String key; + String value; + bundle = ResourceBundle.getBundle("resources/basic"); + // Process Resources + enum = bundle.getKeys(); + while (enum.hasMoreElements()) + { + key = (String) enum.nextElement(); + value = bundle.getString(key); + defaults.put(key, value); + } + } + + /** + * initComponentDefaults + * @param defaults TODO + */ + protected void initComponentDefaults(UIDefaults defaults) + { + Object[] uiDefaults; + uiDefaults = new Object[] { + "Button.background", new ColorUIResource(Color.lightGray), + "Button.border", new BorderUIResource.CompoundBorderUIResource(null, + null), + "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "SPACE", "pressed", + "released SPACE", "released" + }), + "Button.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "Button.foreground", new ColorUIResource(Color.black), + "Button.margin", new InsetsUIResource(2, 14, 2, 14), + "Button.textIconGap", new Integer(4), + "Button.textShiftOffset", new Integer(0), + "CheckBox.background", new ColorUIResource(Color.lightGray), + "CheckBox.border", new BorderUIResource.CompoundBorderUIResource(null, + null), + "CheckBox.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "SPACE", "pressed", + "released SPACE", "released" + }), + "CheckBox.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "CheckBox.foreground", new ColorUIResource(Color.black), + "CheckBox.icon", BasicIconFactory.getCheckBoxIcon(), + "CheckBox.margin",new InsetsUIResource(2, 2, 2, 2), + "CheckBox.textIconGap", new Integer(4), + "CheckBox.textShiftOffset", new Integer(0), + "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", + Font.PLAIN, 12), + "CheckBoxMenuItem.acceleratorForeground", new ColorUIResource(Color.black), + "CheckBoxMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), + "CheckBoxMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), + "CheckBoxMenuItem.background", new ColorUIResource(Color.lightGray), + "CheckBoxMenuItem.border", new BasicBorders.MarginBorder(), + "CheckBoxMenuItem.borderPainted", Boolean.FALSE, + "CheckBoxMenuItem.checkIcon", BasicIconFactory.getCheckBoxMenuItemIcon(), + "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "CheckBoxMenuItem.foreground", new ColorUIResource(Color.black), + "CheckBoxMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), + "CheckBoxMenuItem.selectionBackground", new ColorUIResource(0, 0, 128), + "CheckBoxMenuItem.selectionForeground", new ColorUIResource(Color.white), + "ColorChooser.background", new ColorUIResource(Color.lightGray), + "ColorChooser.cancelText", "Cancel", + "ColorChooser.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "ColorChooser.foreground", new ColorUIResource(Color.black), + "ColorChooser.hsbBlueText", "B", + "ColorChooser.hsbBrightnessText", "B", + "ColorChooser.hsbGreenText", "G", + "ColorChooser.hsbHueText", "H", + "ColorChooser.hsbNameText", "HSB", + "ColorChooser.hsbRedText", "R", + "ColorChooser.hsbSaturationText", "S", + "ColorChooser.okText", "OK", + "ColorChooser.previewText", "Preview", + "ColorChooser.resetText", "Reset", + "ColorChooser.rgbBlueMnemonic", new Integer(66), + "ColorChooser.rgbBlueText", "Blue", + "ColorChooser.rgbGreenMnemonic", new Integer(71), + "ColorChooser.rgbGreenText", "Green", + "ColorChooser.rgbNameText", "RGB", + "ColorChooser.rgbRedMnemonic", new Integer(82), + "ColorChooser.rgbRedText", "Red", + "ColorChooser.sampleText", "Sample Text Sample Text", + "ColorChooser.swatchesDefaultRecentColor", new ColorUIResource(Color.lightGray), + "ColorChooser.swatchesNameText", "Swatches", + "ColorChooser.swatchesRecentSwatchSize", new Dimension(10, 10), + "ColorChooser.swatchesRecentText", "Recent:", + "ColorChooser.swatchesSwatchSize", new Dimension(10, 10), + "ComboBox.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "ESCAPE", "hidePopup", + "PAGE_UP", "pageUpPassThrough", + "PAGE_DOWN", "pageDownPassThrough", + "HOME", "homePassThrough", + "END", "endPassThrough" + }), + "ComboBox.background", new ColorUIResource(Color.white), + "ComboBox.disabledBackground", new ColorUIResource(Color.lightGray), + "ComboBox.disabledForeground", new ColorUIResource(Color.gray), + "ComboBox.font", new FontUIResource("SansSerif", Font.PLAIN, 12), + "ComboBox.foreground", new ColorUIResource(Color.black), + "ComboBox.selectionBackground", new ColorUIResource(0, 0, 128), + "ComboBox.selectionForeground", new ColorUIResource(Color.white), + "Desktop.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "KP_LEFT", "left", + "KP_RIGHT", "right", + "ctrl F5", "restore", + "LEFT", "left", + "ctrl alt F6", "selectNextFrame", + "UP", "up", + "ctrl F6", "selectNextFrame", + "RIGHT", "right", + "DOWN", "down", + "ctrl F7", "move", + "ctrl F8", "resize", + "ESCAPE", "escape", + "ctrl TAB", "selectNextFrame", + "ctrl F9", "minimize", + "KP_UP", "up", + "ctrl F4", "close", + "KP_DOWN", "down", + "ctrl F10", "maximize", + "ctrl alt shift F6","selectPreviousFrame" + }), + "Desktop.background", new ColorUIResource(0, 92, 92), + "DesktopIcon.border", new BorderUIResource.CompoundBorderUIResource(null, + null), + "EditorPane.background", new ColorUIResource(Color.white), + "EditorPane.border", new BasicBorders.MarginBorder(), + "EditorPane.caretBlinkRate", new Integer(500), + "EditorPane.caretForeground", new ColorUIResource(Color.red), + "EditorPane.font", new FontUIResource("Serif", Font.PLAIN, 12), + "EditorPane.foreground", new ColorUIResource(Color.black), + "EditorPane.inactiveForeground", new ColorUIResource(Color.gray), + "EditorPane.keyBindings", new JTextComponent.KeyBinding[] { + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, + 0), "caret-up"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, + 0), "caret-down"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, + 0), "page-up"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, + 0), "page-down"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, + 0), "insert-break"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, + 0), "insert-tab") + }, + "EditorPane.margin", new InsetsUIResource(3, 3, 3, 3), + "EditorPane.selectionBackground", new ColorUIResource(Color.lightGray), + "EditorPane.selectionForeground", new ColorUIResource(Color.white), + "FileChooser.acceptAllFileFilterText", "All Files (*.*)", + "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "ESCAPE", "cancelSelection" + }), + "FileChooser.cancelButtonMnemonic", new Integer(67), + "FileChooser.cancelButtonText", "Cancel", + "FileChooser.cancelButtonToolTipText", "Abort file chooser dialog", + // XXX Don't use gif + "FileChooser.detailsViewIcon", new IconUIResource(new ImageIcon("icons/DetailsView.gif")), + "FileChooser.directoryDescriptionText", "Directory", + "FileChooser.fileDescriptionText", "Generic File", + "FileChooser.helpButtonMnemonic", new Integer(72), + "FileChooser.helpButtonText", "Help", + "FileChooser.helpButtonToolTipText", "FileChooser help", + // XXX Don't use gif + "FileChooser.homeFolderIcon", new IconUIResource(new ImageIcon("icons/HomeFolder.gif")), + // XXX Don't use gif + "FileChooser.listViewIcon", new IconUIResource(new ImageIcon("icons/ListView.gif")), + "FileChooser.newFolderErrorSeparator", ":", + "FileChooser.newFolderErrorText", "Error creating new folder", + // XXX Don't use gif + "FileChooser.newFolderIcon", new IconUIResource(new ImageIcon("icons/NewFolder.gif")), + "FileChooser.openButtonMnemonic", new Integer(79), + "FileChooser.openButtonText", "Open", + "FileChooser.openButtonToolTipText", "Open selected file", + "FileChooser.saveButtonMnemonic", new Integer(83), + "FileChooser.saveButtonText", "Save", + "FileChooser.saveButtonToolTipText", "Save selected file", + // XXX Don't use gif + "FileChooser.upFolderIcon", new IconUIResource(new ImageIcon("icons/UpFolder.gif")), + "FileChooser.updateButtonMnemonic", new Integer(85), + "FileChooser.updateButtonText", "Update", + "FileChooser.updateButtonToolTipText", "Update directory listing", + // XXX Don't use gif + "FileView.computerIcon", new IconUIResource(new ImageIcon("icons/Computer.gif")), + // XXX Don't use gif + "FileView.directoryIcon", new IconUIResource(new ImageIcon("icons/Directory.gif")), + // XXX Don't use gif + "FileView.fileIcon", new IconUIResource(new ImageIcon("icons/File.gif")), + // XXX Don't use gif + "FileView.floppyDriveIcon", new IconUIResource(new ImageIcon("icons/Floppy.gif")), + // XXX Don't use gif + "FileView.hardDriveIcon", new IconUIResource(new ImageIcon("icons/HardDrive.gif")), + "FocusManagerClassName", "TODO", + "FormView.resetButtonText", "Reset", + "FormView.submitButtonText", "Submit Query", + "InternalFrame.activeTitleBackground", new ColorUIResource(0, 0, 128), + "InternalFrame.activeTitleForeground", new ColorUIResource(Color.white), + "InternalFrame.border", new BorderUIResource.CompoundBorderUIResource(null, + null), + "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(), + // XXX Don't use gif + "InternalFrame.icon", new IconUIResource(new ImageIcon("icons/JavaCup.gif")), + "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(), + "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray), + "InternalFrame.inactiveTitleForeground", new ColorUIResource(Color.lightGray), + "InternalFrame.maximizeIcon", BasicIconFactory.createEmptyFrameIcon(), + "InternalFrame.minimizeIcon", BasicIconFactory.createEmptyFrameIcon(), + "InternalFrame.titleFont", new FontUIResource("Dialog", Font.PLAIN, 12), + "InternalFrame.windowBindings", new Object[] { + "shift ESCAPE", "showSystemMenu", + "ctrl SPACE", "showSystemMenu", + "ESCAPE", "showSystemMenu" + }, + "Label.background", new ColorUIResource(Color.lightGray), + "Label.disabledForeground", new ColorUIResource(Color.white), + "Label.disabledShadow", new ColorUIResource(Color.gray), + "Label.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "List.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "PAGE_UP", "scrollUp", + "ctrl \\", "clearSelection", + "PAGE_DOWN", "scrollDown", + "shift PAGE_DOWN","scrollDownExtendSelection", + "END", "selectLastRow", + "HOME", "selectFirstRow", + "shift END", "selectLastRowExtendSelection", + "shift HOME", "selectFirstRowExtendSelection", + "UP", "selectPreviousRow", + "ctrl /", "selectAll", + "ctrl A", "selectAll", + "DOWN", "selectNextRow", + "shift UP", "selectPreviousRowExtendSelection", + "ctrl SPACE", "selectNextRowExtendSelection", + "shift DOWN", "selectNextRowExtendSelection", + "KP_UP", "selectPreviousRow", + "shift PAGE_UP","scrollUpExtendSelection", + "KP_DOWN", "selectNextRow" + }), + "List.foreground", new ColorUIResource(Color.black), + "List.selectionBackground", new ColorUIResource(0, 0, 128), + "List.selectionForeground", new ColorUIResource(Color.white), + "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), + "Menu.acceleratorForeground", new ColorUIResource(Color.black), + "Menu.acceleratorSelectionForeground", new ColorUIResource(Color.white), + "Menu.arrowIcon", BasicIconFactory.getMenuArrowIcon(), + "Menu.background", new ColorUIResource(Color.lightGray), + "Menu.border", new BasicBorders.MarginBorder(), + "Menu.borderPainted", Boolean.FALSE, + "Menu.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), + "Menu.consumesTabs", Boolean.TRUE, + "Menu.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "Menu.foreground", new ColorUIResource(Color.black), + "Menu.margin", new InsetsUIResource(2, 2, 2, 2), + "Menu.selectedWindowInputMapBindings", new Object[] { + "ESCAPE", "cancel", + "DOWN", "selectNext", + "KP_DOWN", "selectNext", + "UP", "selectPrevious", + "KP_UP", "selectPrevious", + "LEFT", "selectParent", + "KP_LEFT", "selectParent", + "RIGHT", "selectChild", + "KP_RIGHT", "selectChild", + "ENTER", "return", + "SPACE", "return" + }, + "Menutext.selectionBackground", new ColorUIResource(0, 0, 128), + "Menu.selectionForeground", new ColorUIResource(Color.white), + "MenuBar.background", new ColorUIResource(Color.lightGray), + "MenuBar.border", new BasicBorders.MenuBarBorder(null, null), + "MenuBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "MenuBar.foreground", new ColorUIResource(Color.black), + "MenuBar.windowBindings", new Object[] { + "F10", "takeFocus" + }, + "MenuItem.acceleratorDelimiter", "+", + "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 12), + "MenuItem.acceleratorForeground", new ColorUIResource(Color.black), + "MenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), + "MenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), + "MenuItem.background", new ColorUIResource(Color.lightGray), + "MenuItem.border", new BasicBorders.MarginBorder(), + "MenuItem.borderPainted", Boolean.FALSE, + "MenuItem.checkIcon", BasicIconFactory.getMenuItemCheckIcon(), + "MenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "MenuItem.foreground", new ColorUIResource(Color.black), + "MenuItem.margin", new InsetsUIResource(2, 2, 2, 2), + "MenuItem.selectionBackground", new ColorUIResource(0, 0, 128), + "MenuItem.selectionForeground", new ColorUIResource(Color.white), + "OptionPane.background", new ColorUIResource(Color.lightGray), + "OptionPane.border", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), + "OptionPane.buttonAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), + "OptionPane.cancelButtonText", "Cancel", + // XXX Don't use gif + "OptionPane.errorIcon", new IconUIResource(new ImageIcon("icons/Error.gif")), + "OptionPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "OptionPane.foreground", new ColorUIResource(Color.black), + // XXX Don't use gif + "OptionPane.informationIcon", new IconUIResource(new ImageIcon("icons/Inform.gif")), + "OptionPane.messageAreaBorder", new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0), + "OptionPane.messageForeground", new ColorUIResource(Color.black), + "OptionPane.minimumSize", new DimensionUIResource(262, 90), + "OptionPane.noButtonText", "No", + "OptionPane.okButtonText", "OK", + // XXX Don't use gif + "OptionPane.questionIcon", new IconUIResource(new ImageIcon("icons/Question.gif")), + // XXX Don't use gif + "OptionPane.warningIcon", new IconUIResource(new ImageIcon("icons/Warn.gif")), + "OptionPane.windowBindings", new Object[] { + "ESCAPE", "close" + }, + "OptionPane.yesButtonText", "Yes", + "Panel.background", new ColorUIResource(Color.lightGray), + "Panel.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "Panel.foreground", new ColorUIResource(Color.black), + "PasswordField.background", new ColorUIResource(Color.white), + "PasswordField.border", new BasicBorders.FieldBorder(null, null, + null, null), + "PasswordField.caretBlinkRate", new Integer(500), + "PasswordField.caretForeground", new ColorUIResource(Color.black), + "PasswordField.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), + "PasswordField.foreground", new ColorUIResource(Color.black), + "PasswordField.inactiveForeground", new ColorUIResource(Color.gray), + "PasswordField.keyBindings", new JTextComponent.KeyBinding[] { + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, + 0), + "notify-field-accept")}, + "PasswordField.margin", new InsetsUIResource(0, 0, 0, 0), + "PasswordField.selectionBackground", new ColorUIResource(0, 0, 128), + "PasswordField.selectionForeground", new ColorUIResource(Color.white), + "PopupMenu.background", new ColorUIResource(Color.lightGray), + "PopupMenu.border", new BorderUIResource.BevelBorderUIResource(0), + "PopupMenu.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "PopupMenu.foreground", new ColorUIResource(Color.black), + "ProgressBar.background", new ColorUIResource(Color.lightGray), + "ProgressBar.border", new BorderUIResource.LineBorderUIResource(null), + "ProgressBar.cellLength", new Integer(1), + "ProgressBar.cellSpacing", new Integer(0), + "ProgressBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "ProgressBar.foreground", new ColorUIResource(0, 0, 128), + "ProgressBar.selectionBackground", new ColorUIResource(0, 0, 128), + "ProgressBar.selectionForeground", new ColorUIResource(Color.lightGray), + "RadioButton.background", new ColorUIResource(Color.lightGray), + "RadioButton.border", new BorderUIResource.CompoundBorderUIResource(null, + null), + "RadioButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "SPACE", "pressed", + "released SPACE", "released" + }), + "RadioButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "RadioButton.foreground", new ColorUIResource(Color.black), + "RadioButton.icon", BasicIconFactory.getRadioButtonIcon(), + "RadioButton.margin", new InsetsUIResource(2, 2, 2, 2), + "RadioButton.textIconGap", new Integer(4), + "RadioButton.textShiftOffset", new Integer(0), + "RadioButtonMenuItem.acceleratorFont", new FontUIResource("Dialog", + Font.PLAIN, 12), + "RadioButtonMenuItem.acceleratorForeground", new ColorUIResource(Color.black), + "RadioButtonMenuItem.acceleratorSelectionForeground", new ColorUIResource(Color.white), + "RadioButtonMenuItem.arrowIcon", BasicIconFactory.getMenuItemArrowIcon(), + "RadioButtonMenuItem.background", new ColorUIResource(Color.lightGray), + "RadioButtonMenuItem.border", new BasicBorders.MarginBorder(), + "RadioButtonMenuItem.borderPainted", Boolean.FALSE, + "RadioButtonMenuItem.checkIcon", BasicIconFactory.getRadioButtonMenuItemIcon(), + "RadioButtonMenuItem.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "RadioButtonMenuItem.foreground", new ColorUIResource(Color.black), + "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), + "RadioButtonMenuItem.selectionBackground", new ColorUIResource(0, 0, 128), + "RadioButtonMenuItem.selectionForeground", new ColorUIResource(Color.white), + "RootPane.defaultButtonWindowKeyBindings", new Object[] { + "ENTER", "press", + "released ENTER", "release", + "ctrl ENTER", "press", + "ctrl released ENTER", "release" + }, + "ScrollBar.background", new ColorUIResource(224, 224, 224), + "ScrollBar.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "PAGE_UP", "negativeBlockIncrement", + "PAGE_DOWN", "positiveBlockIncrement", + "END", "maxScroll", + "HOME", "minScroll", + "LEFT", "positiveUnitIncrement", + "KP_UP", "negativeUnitIncrement", + "KP_DOWN", "positiveUnitIncrement", + "UP", "negativeUnitIncrement", + "RIGHT", "negativeUnitIncrement", + "KP_LEFT", "positiveUnitIncrement", + "DOWN", "positiveUnitIncrement", + "KP_RIGHT", "negativeUnitIncrement" + }), + "ScrollBar.foreground", new ColorUIResource(Color.lightGray), + "ScrollBar.maximumThumbSize", new DimensionUIResource(4096, 4096), + "ScrollBar.minimumThumbSize", new DimensionUIResource(8, 8), + "ScrollBar.thumb", new ColorUIResource(Color.lightGray), + "ScrollBar.thumbDarkShadow", new ColorUIResource(Color.black), + "ScrollBar.thumbHighlight", new ColorUIResource(Color.white), + "ScrollBar.thumbLightShadow", new ColorUIResource(Color.gray), + "ScrollBar.track", new ColorUIResource(224, 224, 224), + "ScrollBar.trackHighlight", new ColorUIResource(Color.black), + "ScrollPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "PAGE_UP", "scrollUp", + "KP_LEFT", "unitScrollLeft", + "ctrl PAGE_DOWN","scrollRight", + "PAGE_DOWN", "scrollDown", + "KP_RIGHT", "unitScrollRight", + "LEFT", "unitScrollLeft", + "ctrl END", "scrollEnd", + "UP", "unitScrollUp", + "RIGHT", "unitScrollRight", + "DOWN", "unitScrollDown", + "ctrl HOME", "scrollHome", + "ctrl PAGE_UP", "scrollLeft", + "KP_UP", "unitScrollUp", + "KP_DOWN", "unitScrollDown" + }), + "ScrollPane.background", new ColorUIResource(Color.lightGray), + "ScrollPane.border", new BorderUIResource.EtchedBorderUIResource(), + "ScrollPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "ScrollPane.foreground", new ColorUIResource(Color.black), + "Separator.background", new ColorUIResource(Color.white), + "Separator.foreground", new ColorUIResource(Color.gray), + "Separator.highlight", new ColorUIResource(Color.white), + "Separator.shadow", new ColorUIResource(Color.gray), + "Slider.background", new ColorUIResource(Color.lightGray), + "Slider.focus", new ColorUIResource(Color.black), + "Slider.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "PAGE_UP", "positiveBlockIncrement", + "PAGE_DOWN", "negativeBlockIncrement", + "END", "maxScroll", + "HOME", "minScroll", + "LEFT", "negativeUnitIncrement", + "KP_UP", "positiveUnitIncrement", + "KP_DOWN", "negativeUnitIncrement", + "UP", "positiveUnitIncrement", + "RIGHT", "positiveUnitIncrement", + "KP_LEFT", "negativeUnitIncrement", + "DOWN", "negativeUnitIncrement", + "KP_RIGHT", "positiveUnitIncrement" + }), + "Slider.focusInsets", new InsetsUIResource(2, 2, 2, 2), + "Slider.foreground", new ColorUIResource(Color.lightGray), + "Slider.highlight", new ColorUIResource(Color.white), + "Slider.shadow", new ColorUIResource(Color.gray), + "SplitPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "F6", "toggleFocus", + "F8", "startResize", + "END", "selectMax", + "HOME", "selectMin", + "LEFT", "negativeIncremnent", + "KP_UP", "negativeIncrement", + "KP_DOWN", "positiveIncrement", + "UP", "negativeIncrement", + "RIGHT", "positiveIncrement", + "KP_LEFT", "negativeIncrement", + "DOWN", "positiveIncrement", + "KP_RIGHT", "positiveIncrement" + }), + "SplitPane.background", new ColorUIResource(Color.lightGray), + "SplitPane.border", new BasicBorders.SplitPaneBorder(null, null), + "SplitPane.dividerSize", new Integer(7), + "SplitPane.highlight", new ColorUIResource(Color.white), + "SplitPane.shadow", new ColorUIResource(Color.gray), + "TabbedPane.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "ctrl PAGE_DOWN","navigatePageDown", + "ctrl PAGE_UP", "navigatePageUp", + "ctrl UP", "requestFocus", + "ctrl KP_UP", "requestFocus" + }), + "TabbedPane.background", new ColorUIResource(Color.lightGray), + "TabbedPane.contentBorderInsets", new InsetsUIResource(2, 2, 3, 3), + "TabbedPane.darkShadow", new ColorUIResource(Color.black), + "TabbedPane.focus", new ColorUIResource(Color.black), + "TabbedPane.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "LEFT", "navigateLeft", + "KP_UP", "navigateUp", + "ctrl DOWN", "requestFocusForVisibleComponent", + "UP", "navigateUp", + "KP_DOWN", "navigateDown", + "RIGHT", "navigateRight", + "KP_LEFT", "navigateLeft", + "ctrl KP_DOWN", "requestFocusForVisibleComponent", + "KP_RIGHT", "navigateRight", + "DOWN", "navigateDown" + }), + "TabbedPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "TabbedPane.foreground", new ColorUIResource(Color.black), + "TabbedPane.highlight", new ColorUIResource(Color.lightGray), + "TabbedPane.lightHighlight", new ColorUIResource(Color.white), + "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), + "TabbedPane.shadow", new ColorUIResource(Color.gray), + "TabbedPane.tabAreaInsets", new InsetsUIResource(3, 2, 0, 2), + "TabbedPane.tabInsets", new InsetsUIResource(0, 4, 1, 4), + "TabbedPane.tabRunOverlay", new Integer(2), + "TabbedPane.textIconGap", new Integer(4), + "Table.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "shift PAGE_DOWN","scrollDownExtendSelection", + "PAGE_DOWN", "scrollDownChangeSelection", + "END", "selectLastColumn", + "shift END", "selectLastColumnExtendSelection", + "HOME", "selectFirstColumn", + "ctrl END", "selectLastRow", + "ctrl shift END","selectLastRowExtendSelection", + "LEFT", "selectPreviousColumn", + "shift HOME", "selectFirstColumnExtendSelection", + "UP", "selectPreviousRow", + "RIGHT", "selectNextColumn", + "ctrl HOME", "selectFirstRow", + "shift LEFT", "selectPreviousColumnExtendSelection", + "DOWN", "selectNextRow", + "ctrl shift HOME","selectFirstRowExtendSelection", + "shift UP", "selectPreviousRowExtendSelection", + "F2", "startEditing", + "shift RIGHT", "selectNextColumnExtendSelection", + "TAB", "selectNextColumnCell", + "shift DOWN", "selectNextRowExtendSelection", + "ENTER", "selectNextRowCell", + "KP_UP", "selectPreviousRow", + "KP_DOWN", "selectNextRow", + "KP_LEFT", "selectPreviousColumn", + "KP_RIGHT", "selectNextColumn", + "shift TAB", "selectPreviousColumnCell", + "ctrl A", "selectAll", + "shift ENTER", "selectPreviousRowCell", + "shift KP_DOWN", "selectNextRowExtendSelection", + "shift KP_LEFT", "selectPreviousColumnExtendSelection", + "ESCAPE", "cancel", + "ctrl shift PAGE_UP", "scrollRightExtendSelection", + "shift KP_RIGHT", " selectNextColumnExtendSelection", + "ctrl PAGE_UP", "scrollLeftChangeSelection", + "shift PAGE_UP", "scrollUpExtendSelection", + "ctrl shift PAGE_DOWN", "scrollLeftExtendSelection", + "ctrl PAGE_DOWN", "scrollRightChangeSelection", + "PAGE_UP", "scrollUpChangeSelection" + }), + "Table.background", new ColorUIResource(Color.white), + "Table.focusCellBackground", new ColorUIResource(Color.white), + "Table.focusCellForeground", new ColorUIResource(Color.black), + "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(null), + "Table.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "Table.foreground", new ColorUIResource(Color.black), + "Table.gridColor", new ColorUIResource(Color.gray), + "Table.scrollPaneBorder", new BorderUIResource.BevelBorderUIResource(0), + "Table.selectionBackground", new ColorUIResource(0, 0, 128), + "Table.selectionForeground", new ColorUIResource(Color.white), + "TableHeader.background", new ColorUIResource(Color.lightGray), + "TableHeader.cellBorder", new BorderUIResource.BevelBorderUIResource(0), + "TableHeader.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "TableHeader.foreground", new ColorUIResource(Color.black), + "TextArea.background", new ColorUIResource(Color.white), + "TextArea.border", new BasicBorders.MarginBorder(), + "TextArea.caretBlinkRate", new Integer(500), + "TextArea.caretForeground", new ColorUIResource(Color.black), + "TextArea.font", new FontUIResource("MonoSpaced", Font.PLAIN, 12), + "TextArea.foreground", new ColorUIResource(Color.black), + "TextArea.inactiveForeground", new ColorUIResource(Color.gray), + "TextArea.keyBindings", new JTextComponent.KeyBinding[] { + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, + 0), "caret-up"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, + 0), "caret-down"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, + 0), "page-up"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, + 0), "page-down"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, + 0), "insert-break"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, + 0), "insert-tab") + }, + "TextArea.margin", new InsetsUIResource(0, 0, 0, 0), + "TextArea.selectionBackground", new ColorUIResource(0, 0, 128), + "TextArea.selectionForeground", new ColorUIResource(Color.white), + "TextField.background", new ColorUIResource(Color.white), + "TextField.border", new BasicBorders.FieldBorder(null, null, null, null), + "TextField.caretBlinkRate", new Integer(500), + "TextField.caretForeground", new ColorUIResource(Color.black), + "TextField.font", new FontUIResource("SansSerif", Font.PLAIN, 12), + "TextField.foreground", new ColorUIResource(Color.black), + "TextField.inactiveForeground", new ColorUIResource(Color.gray), + "TextField.keyBindings", new JTextComponent.KeyBinding[] { + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, + 0), + "notify-field-accept")}, + "TextField.margin", new InsetsUIResource(0, 0, 0, 0), + "TextField.selectionBackground", new ColorUIResource(0, 0, 128), + "TextField.selectionForeground", new ColorUIResource(Color.white), + "TextPane.background", new ColorUIResource(Color.white), + "TextPane.border", new BasicBorders.MarginBorder(), + "TextPane.caretBlinkRate", new Integer(500), + "TextPane.caretForeground", new ColorUIResource(Color.black), + "TextPane.font", new FontUIResource("Serif", Font.PLAIN, 12), + "TextPane.foreground", new ColorUIResource(Color.black), + "TextPane.inactiveForeground", new ColorUIResource(Color.gray), + "TextPane.keyBindings", new JTextComponent.KeyBinding[] { + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, + 0), "caret-up"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, + 0), "caret-down"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, + 0), "page-up"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, + 0), "page-down"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, + 0), "insert-break"), + new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, + 0), "insert-tab") + }, + "TextPane.margin", new InsetsUIResource(3, 3, 3, 3), + "TextPane.selectionBackground", new ColorUIResource(Color.lightGray), + "TextPane.selectionForeground", new ColorUIResource(Color.white), + "TitledBorder.border", new BorderUIResource.EtchedBorderUIResource(), + "TitledBorder.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "TitledBorder.titleColor", new ColorUIResource(Color.black), + "ToggleButton.background", new ColorUIResource(Color.lightGray), + "ToggleButton.border", new BorderUIResource.CompoundBorderUIResource(null, null), + "ToggleButton.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "SPACE", "pressed", + "released SPACE", "released" + }), + "ToggleButton.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "ToggleButton.foreground", new ColorUIResource(Color.black), + "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), + "ToggleButton.textIconGap", new Integer(4), + "ToggleButton.textShiftOffset", new Integer(0), + "ToolBar.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "UP", "navigateUp", + "KP_UP", "navigateUp", + "DOWN", "navigateDown", + "KP_DOWN", "navigateDown", + "LEFT", "navigateLeft", + "KP_LEFT", "navigateLeft", + "RIGHT", "navigateRight", + "KP_RIGHT", "navigateRight" + }), + "ToolBar.background", new ColorUIResource(Color.lightGray), + "ToolBar.border", new BorderUIResource.EtchedBorderUIResource(), + "ToolBar.dockingBackground", new ColorUIResource(Color.lightGray), + "ToolBar.dockingForeground", new ColorUIResource(Color.red), + "ToolBar.floatingBackground", new ColorUIResource(Color.lightGray), + "ToolBar.floatingForeground", new ColorUIResource(Color.darkGray), + "ToolBar.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "ToolBar.foreground", new ColorUIResource(Color.black), + "ToolBar.separatorSize", new DimensionUIResource(10, 10), + "ToolTip.background", new ColorUIResource(Color.white), + "ToolTip.border", new BorderUIResource.LineBorderUIResource(null), + "ToolTip.font", new FontUIResource("SansSerif", Font.PLAIN, 12), + "ToolTip.foreground", new ColorUIResource(Color.black), + "Tree.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { + "ESCAPE", "cancel" + }), + "Tree.background", new ColorUIResource(Color.white), + "Tree.changeSelectionWithFocus", Boolean.TRUE, + // XXX Don't use gif + "Tree.closedIcon", new IconUIResource(new ImageIcon("icons/TreeClosed.gif")), + "Tree.drawsFocusBorderAroundIcon", Boolean.FALSE, + "Tree.editorBorder", new BorderUIResource.LineBorderUIResource(null), + "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { + "shift PAGE_DOWN", "scrollDownExtendSelection", + "PAGE_DOWN", "scrollDownChangeSelection", + "END", "selectLast", + "ctrl KP_UP", "selectPreviousChangeLead", + "shift END", "selectLastExtendSelection", + "HOME", "selectFirst", + "ctrl END", "selectLastChangeLead", + "ctrl /", "selectAll", + "LEFT", "selectParent", + "shift HOME", "selectFirstExtendSelection", + "UP", "selectPrevious", + "ctrl KP_DOWN", "selectNextChangeLead", + "RIGHT", "selectChild", + "ctrl HOME", "selectFirstChangeLead", + "DOWN", "selectNext", + "ctrl KP_LEFT", "scrollLeft", + "shift UP", "selectPreviousExtendSelection", + "F2", "startEditing", + "ctrl LEFT", "scrollLeft", + "ctrl KP_RIGHT","scrollRight", + "ctrl UP", "selectPreviousChangeLead", + "shift DOWN", "selectNextExtendSelection", + "ENTER", "toggle", + "KP_UP", "selectPrevious", + "KP_DOWN", "selectNext", + "ctrl RIGHT", "scrollRight", + "KP_LEFT", "selectParent", + "KP_RIGHT", "selectChild", + "ctrl DOWN", "selectNextChangeLead", + "ctrl A", "selectAll", + "shift KP_UP", "selectPreviousExtendSelection", + "shift KP_DOWN","selectNextExtendSelection", + "ctrl SPACE", "toggleSelectionPreserveAnchor", + "ctrl shift PAGE_UP", "scrollUpExtendSelection", + "ctrl \\", "clearSelection", + "shift SPACE", "extendSelection", + "ctrl PAGE_UP", "scrollUpChangeLead", + "shift PAGE_UP","scrollUpExtendSelection", + "SPACE", "toggleSelectionPreserveAnchor", + "ctrl shift PAGE_DOWN", "scrollDownExtendSelection", + "PAGE_UP", "scrollUpChangeSelection", + "ctrl PAGE_DOWN", "scrollDownChangeLead" + }), + "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), + "Tree.foreground", new ColorUIResource(Color.black), + "Tree.hash", new ColorUIResource(Color.gray), + // XXX Don't use gif + "Tree.leafIcon", new IconUIResource(new ImageIcon("icons/TreeLeaf.gif")), + "Tree.leftChildIndent", new Integer(7), + // XXX Don't use gif + "Tree.openIcon", new IconUIResource(new ImageIcon("icons/TreeOpen.gif")), + "Tree.rightChildIndent", new Integer(13), + "Tree.rowHeight", new Integer(16), + "Tree.scrollsOnExpand", Boolean.TRUE, + "Tree.selectionBackground", new ColorUIResource(0, 0, 128), + "Tree.selectionBorderColor", new ColorUIResource(Color.black), + "Tree.selectionForeground", new ColorUIResource(Color.white), + "Tree.textBackground", new ColorUIResource(Color.lightGray), + "Tree.textForeground", new ColorUIResource(Color.black), + "Viewport.background", new ColorUIResource(Color.lightGray), + "Viewport.font", new FontUIResource("Dialog", Font.PLAIN, 12), + }; + defaults.putDefaults(uiDefaults); + } + } // class BasicLookAndFeel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,103 ---- + package javax.swing.plaf.basic; + + import java.awt.*; + import java.awt.event.*; + import javax.swing.*; + import javax.swing.plaf.*; + import javax.accessibility.*; + + public class BasicOptionPaneUI extends OptionPaneUI + { + JOptionPane pane; + + BasicOptionPaneUI() + { + } + + public static ComponentUI createUI(JComponent x) + { + return new BasicOptionPaneUI(); + } + + public void installUI(JComponent c) + { + super.installUI(c); + pane = (JOptionPane)c; + + System.out.println(" -------------: " + pane); + + JLabel message = pane.msg != null ? new JLabel((String)pane.msg) : null; + JButton ok_button = new JButton("Ok"); + + ok_button.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent a) + { + System.out.println("ACTION ---> " + a); + // pane.dialog.dispose(); + + if (pane.dialog.isModal()) + { + System.out.println("modal dialog !!"); + pane.dialog.setModal(false); + } + pane.dialog.setVisible(false); + } + }); + + if (pane.args != null) + { + for (int i=0; ipreff->"+d); + return d; + } + + public void paint(Graphics g, JComponent c) + { + System.out.println("BasicScrollPaneUI->paint()->"+c); + + JScrollPane p = (JScrollPane ) c; + p.getViewport().paint(g); + } + } + + + + + + + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java gcc-3.3/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,64 ---- + package javax.swing.plaf.basic; + + import javax.swing.*; + import java.awt.*; + import javax.swing.plaf.*; + + public class BasicTabbedPaneUI extends TabbedPaneUI + { + public static ComponentUI createUI(final JComponent c) + { + return new BasicTabbedPaneUI(); + } + + public void installUI(final JComponent c) + { + super.installUI(c); + } + + public Dimension getPreferredSize(JComponent c) + { + JTabbedPane p = (JTabbedPane) c; + + Dimension d = new Dimension(50,50); + + for (int i=0;ipreff->"+d); + return d; + } + + public void paint(Graphics g, JComponent c) + { + System.out.println("BasicViewportUI->paint->"+c); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/BorderUIResource.java gcc-3.3/libjava/javax/swing/plaf/BorderUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/BorderUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/BorderUIResource.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,275 ---- + /* BorderUIResource.java + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.swing.plaf; + import javax.swing.border.*; + import javax.swing.Icon; + import java.io.Serializable; + import java.awt.Component; + import java.awt.Graphics; + import java.awt.Insets; + import java.awt.Font; + import java.awt.Color; + + /** + * @serial + * @serialField delegate Border the Border wrapped + * @author Brian Jones + */ + public class BorderUIResource + extends Object + implements Border, UIResource, Serializable + { + private Border delegate; + + /** + * Creates a UIResource wrapper for a Border + * object. + * + * @param delegate the border to be wrapped + */ + public BorderUIResource(Border delegate) + { + this.delegate = delegate; + } + + /** + */ + public static Border getEtchedBorderUIResource() { + return null; + } + + /** + */ + public static Border getLoweredBevelBorderUIResource() { + return null; + } + + /** + */ + public static Border getRaisedBevelBorderUIResource() { + return null; + } + + /** + */ + public static Border getBlackLineBorderUIResource() { + return null; + } + + /** + */ + public void paintBorder(Component c, Graphics g, int x, int y, + int width, int height) { } + + /** + */ + public Insets getBorderInsets(Component c) { + return null; + } + + /** + */ + public boolean isBorderOpaque() { + return false; + } + + /** + * @serial + */ + public static class BevelBorderUIResource + extends BevelBorder + implements UIResource, Serializable + { + public BevelBorderUIResource(int bevelType) + { + + } + + public BevelBorderUIResource(int bevelType, + Color highlight, + Color shadow) + { + this(bevelType); + } + public BevelBorderUIResource(int bevelType, + Color highlightOuter, + Color highlightInner, + Color shadowOuter, + Color shadowInner) + { + this(bevelType); + } + } + + /** + * @serial + */ + public static class CompoundBorderUIResource + extends CompoundBorder + implements UIResource, Serializable + { + public CompoundBorderUIResource(Border outsideBorder, + Border insideBorder) + { + + } + } + + /** + * @serial + */ + public static class EmptyBorderUIResource + extends EmptyBorder + implements UIResource, Serializable + { + public EmptyBorderUIResource(int top, int left, int bottom, int right) + { + this(new Insets(top,left,bottom,right)); + } + + public EmptyBorderUIResource(Insets insets) + { + + } + } + + /** + * @serial + */ + public static class EtchedBorderUIResource + extends EtchedBorder + implements UIResource, Serializable + { + public EtchedBorderUIResource() { } + public EtchedBorderUIResource(int etchType) + { + + } + public EtchedBorderUIResource(Color highlight, Color shadow) + { + + } + public EtchedBorderUIResource(int etchType, Color highlight, + Color shadow) + { + + } + + } + + /** + * @serial + */ + public static class LineBorderUIResource + extends LineBorder + implements UIResource, Serializable + { + public LineBorderUIResource(Color color) + { + + } + public LineBorderUIResource(Color color, + int thickness) + { + + } + } + + /** + * @serial + */ + public static class MatteBorderUIResource + extends MatteBorder + implements UIResource, Serializable + { + public MatteBorderUIResource(int top, int left, int bottom, + int right, Color color) + { + + } + public MatteBorderUIResource(int top, int left, int bottom, + int right, Icon tileIcon) + { + + } + public MatteBorderUIResource(Icon tileIcon) + { + + } + } + + /** + * @serial + */ + public static class TitledBorderUIResource + extends TitledBorder + implements UIResource, Serializable + { + TitledBorderUIResource(String title) + { + + } + TitledBorderUIResource(Border border) + { + + } + TitledBorderUIResource(Border border, String title) + { + + } + TitledBorderUIResource(Border border, String title, + int titleJustification, int titlePosition) + { + + } + TitledBorderUIResource(Border border, String title, + int titleJustification, int titlePosition, + Font titleFont) + { + + } + TitledBorderUIResource(Border border, String title, + int titleJustification, int titlePosition, + Font titleFont, Color titleColor) + { + + } + } + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ButtonUI.java gcc-3.3/libjava/javax/swing/plaf/ButtonUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ButtonUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ButtonUI.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,5 ---- + package javax.swing.plaf; + + public class ButtonUI extends ComponentUI + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ColorChooserUI.java gcc-3.3/libjava/javax/swing/plaf/ColorChooserUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ColorChooserUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ColorChooserUI.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ColorChooserUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * ColorChooserUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class ColorChooserUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ColorChooserUI + */ + public ColorChooserUI() { + // TODO + } // ColorChooserUI() + + + } // ColorChooserUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ColorUIResource.java gcc-3.3/libjava/javax/swing/plaf/ColorUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/ColorUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ColorUIResource.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,24 ---- + package javax.swing.plaf; + import java.awt.Color; + /** + * STUBBED + */ + public class ColorUIResource extends Color implements UIResource + { + public ColorUIResource(Color c) + { + super(c.getRGB()); + } + public ColorUIResource(float r, float g, float b) + { + super(r, g, b, 1.0f); + } + public ColorUIResource(int rgb) + { + super(rgb, false); + } + public ColorUIResource(int r, int g, int b) + { + super(r, g, b, 255); + } + } // class ColorUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ComboBoxUI.java gcc-3.3/libjava/javax/swing/plaf/ComboBoxUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ComboBoxUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ComboBoxUI.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,88 ---- + /* ComboBoxUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + // Imports + import javax.swing.*; + + /** + * ComboBoxUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class ComboBoxUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ComboBoxUI + */ + public ComboBoxUI() { + // TODO + } // ComboBoxUI() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * setPopupVisible + * @param combobox TODO + * @param visible TODO + */ + public abstract void setPopupVisible(JComboBox combobox, boolean visible); + + /** + * isPopupVisible + * @param combobox TODO + * @returns boolean + */ + public abstract boolean isPopupVisible(JComboBox combobox); + + /** + * isFocusTraversable + * @param combobox TODO + * @returns boolean + */ + public abstract boolean isFocusTraversable(JComboBox combobox); + + + } // ComboBoxUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ComponentInputMapUIResource.java gcc-3.3/libjava/javax/swing/plaf/ComponentInputMapUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/ComponentInputMapUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ComponentInputMapUIResource.java 2002-08-09 04:26:11.000000000 +0000 *************** *** 0 **** --- 1,64 ---- + /* ComponentInputMapUIResource.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + // Imports + import javax.swing.*; + + /** + * ComponentInputMapUIResource + * @author Andrew Selkirk + * @version 1.0 + */ + public class ComponentInputMapUIResource extends ComponentInputMap implements UIResource { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ComponentInputMapUIResource + * @param component TODO + */ + public ComponentInputMapUIResource(JComponent component) { + super(component); + // TODO + } // ComponentInputMapUIResource() + + + } // ComponentInputMapUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ComponentUI.java gcc-3.3/libjava/javax/swing/plaf/ComponentUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ComponentUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ComponentUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,88 ---- + package javax.swing.plaf; + + import java.awt.*; + import javax.swing.border.*; + import javax.swing.*; + + import javax.accessibility.*; + + public abstract class ComponentUI + implements UIResource // ?? + { + boolean contains(JComponent c, int x, int y) + { + return c.inside(x,y); + } + + // this SHOULD thow an error: + public static ComponentUI createUI(JComponent c) + { + Exception e = new Exception("createUI from ComponentUI should never be called"); + e.printStackTrace(); + System.exit(1); + return null; + } + + public Accessible getAccessibleChild(JComponent c, int i) + { + //Return the nth Accessible child of the object. + return null; + } + + public int getAccessibleChildrenCount(JComponent c) + { + //Returns the number of accessible children in the object. + return 0; + } + + public Dimension getMaximumSize(JComponent c) + { + return getPreferredSize(c); + } + + public Dimension getMinimumSize(JComponent c) + { + return getPreferredSize(c); + } + + public Dimension getPreferredSize(JComponent c) + { + return null; + } + + public void installUI(JComponent c) + { + String id = c.getUIClassID() + ".border"; + + Border s = UIManager.getBorder( id ); + + if (s != null) + { + c.setBorder( s ); + //System.out.println("OK-INSTALL: " + this + ", ID=" + id + ",B="+s); + } + else + { + ///System.out.println("FAIL-INSTALL: " + this + ", " + id); + } + } + + public void paint(Graphics g, JComponent c) + { + // System.out.println("UI-COMPONENT-> unimplemented paint: " + c + ", UI="+this); + } + + public void uninstallUI(JComponent c) + { + } + + public void update(Graphics g, JComponent c) { + if (c.isOpaque()) { + g.setColor(c.getBackground()); + g.fillRect(0, 0, c.getWidth(),c.getHeight()); + } + paint(g, c); + } + + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/DesktopIconUI.java gcc-3.3/libjava/javax/swing/plaf/DesktopIconUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/DesktopIconUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/DesktopIconUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* DesktopIconUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * DesktopIconUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class DesktopIconUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DesktopIconUI + */ + public DesktopIconUI() { + // TODO + } // DesktopIconUI() + + + } // DesktopIconUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/DesktopPaneUI.java gcc-3.3/libjava/javax/swing/plaf/DesktopPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/DesktopPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/DesktopPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* DesktopPaneUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * DesktopPaneUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class DesktopPaneUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DesktopPaneUI + */ + public DesktopPaneUI() { + // TODO + } // DesktopPaneUI() + + + } // DesktopPaneUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/DimensionUIResource.java gcc-3.3/libjava/javax/swing/plaf/DimensionUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/DimensionUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/DimensionUIResource.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,12 ---- + package javax.swing.plaf; + import java.awt.Dimension; + /** + * STUBBED + */ + public class DimensionUIResource extends Dimension implements UIResource + { + public DimensionUIResource(int w, int h) + { + super(w, h); + } + } // class DimensionUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/FileChooserUI.java gcc-3.3/libjava/javax/swing/plaf/FileChooserUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/FileChooserUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/FileChooserUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,111 ---- + /* FileChooserUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + // Imports + import java.io.*; + import javax.swing.*; + import javax.swing.filechooser.*; + import javax.swing.filechooser.FileFilter; + + /** + * FileChooserUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class FileChooserUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FileChooserUI + */ + public FileChooserUI() { + // TODO + } // FileChooserUI() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getAcceptAllFileFilter + * @param chooser TODO + * @returns FileFilter + */ + public abstract FileFilter getAcceptAllFileFilter(JFileChooser chooser); + + /** + * getFileView + * @param chooser TODO + * @returns FileView + */ + public abstract FileView getFileView(JFileChooser chooser); + + /** + * getApproveButtonText + * @param chooser TODO + * @returns String + */ + public abstract String getApproveButtonText(JFileChooser chooser); + + /** + * getDialogTitle + * @param chooser TODO + * @returns String + */ + public abstract String getDialogTitle(JFileChooser chooser); + + /** + * rescanCurrentDirectory + * @param value0 TODO + */ + public abstract void rescanCurrentDirectory(JFileChooser chooser); + + /** + * ensureFileIsVisible + * @param chooser TODO + * @param file TODO + */ + public abstract void ensureFileIsVisible(JFileChooser chooser, File file); + + + } // FileChooserUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/FontUIResource.java gcc-3.3/libjava/javax/swing/plaf/FontUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/FontUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/FontUIResource.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,16 ---- + package javax.swing.plaf; + import java.awt.Font; + /** + * STUBBED + */ + public class FontUIResource extends Font implements UIResource + { + public FontUIResource(Font f) + { + super(f.getName(), f.getStyle(), f.getSize()); + } + public FontUIResource(String name, int style, int size) + { + super(name, style, size); + } + } // class FontUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/IconUIResource.java gcc-3.3/libjava/javax/swing/plaf/IconUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/IconUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/IconUIResource.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,25 ---- + package javax.swing.plaf; + import java.awt.Component; + import java.awt.Graphics; + import java.io.Serializable; + import javax.swing.Icon; + /** + * STUBBED + */ + public class IconUIResource implements Icon, UIResource, Serializable + { + public IconUIResource(Icon delegate) + { + } + public void paintIcon(Component c, Graphics g, int x, int y) + { + } + public int getIconWidth() + { + return 0; + } + public int getIconHeight() + { + return 0; + } + } // class IconUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/InputMapUIResource.java gcc-3.3/libjava/javax/swing/plaf/InputMapUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/InputMapUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/InputMapUIResource.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* InputMapUIResource.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + // Imports + import javax.swing.*; + + /** + * InputMapUIResource + * @author Andrew Selkirk + * @version 1.0 + */ + public class InputMapUIResource extends InputMap implements UIResource { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor InputMapUIResource + */ + public InputMapUIResource() { + // TODO + } // InputMapUIResource() + + + } // InputMapUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/InsetsUIResource.java gcc-3.3/libjava/javax/swing/plaf/InsetsUIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/InsetsUIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/InsetsUIResource.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,12 ---- + package javax.swing.plaf; + import java.awt.Insets; + /** + * STUBBED + */ + public class InsetsUIResource extends Insets implements UIResource + { + public InsetsUIResource(int top, int left, int bottom, int right) + { + super(top, left, bottom, right); + } + } // class InsetsUIResource diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/InternalFrameUI.java gcc-3.3/libjava/javax/swing/plaf/InternalFrameUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/InternalFrameUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/InternalFrameUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* InternalFrameUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * InternalFrameUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class InternalFrameUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor InternalFrameUI + */ + public InternalFrameUI() { + // TODO + } // InternalFrameUI() + + + } // InternalFrameUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/LabelUI.java gcc-3.3/libjava/javax/swing/plaf/LabelUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/LabelUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/LabelUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + package javax.swing.plaf; + + + public class LabelUI extends ComponentUI + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ListUI.java gcc-3.3/libjava/javax/swing/plaf/ListUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ListUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ListUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + package javax.swing.plaf; + + + public class ListUI extends ComponentUI + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/MenuBarUI.java gcc-3.3/libjava/javax/swing/plaf/MenuBarUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/MenuBarUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/MenuBarUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* MenuBarUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * MenuBarUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class MenuBarUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor MenuBarUI + */ + public MenuBarUI() { + // TODO + } // MenuBarUI() + + + } // MenuBarUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/MenuItemUI.java gcc-3.3/libjava/javax/swing/plaf/MenuItemUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/MenuItemUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/MenuItemUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* MenuItemUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * MenuItemUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class MenuItemUI extends ButtonUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor MenuItemUI + */ + public MenuItemUI() { + // TODO + } // MenuItemUI() + + + } // MenuItemUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java gcc-3.3/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java *** gcc-3.2.3/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java 2002-08-09 04:45:29.000000000 +0000 *************** *** 0 **** --- 1,31 ---- + package javax.swing.plaf.metal; + + import javax.swing.*; + import javax.swing.plaf.*; + import javax.swing.plaf.basic.*; + + + public class MetalLookAndFeel extends LookAndFeel + { + public boolean isNativeLookAndFeel() { return true; } + public boolean isSupportedLookAndFeel() { return true; } + public String getDescription() { return "Metal look and feel"; } + public String getID() { return "MetalLookAndFeel"; } + public String getName() { return "MetalLookAndFeel"; } + + + UIDefaults LAF_defaults; + + public MetalLookAndFeel() + { + } + + public UIDefaults getDefaults() + { + if (LAF_defaults == null) + LAF_defaults = new BasicDefaults(); + + // Returns the default values for this look and feel. + return LAF_defaults; + } + }; diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/OptionPaneUI.java gcc-3.3/libjava/javax/swing/plaf/OptionPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/OptionPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/OptionPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + package javax.swing.plaf; + import javax.accessibility.*; + + public class OptionPaneUI extends ComponentUI + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/PanelUI.java gcc-3.3/libjava/javax/swing/plaf/PanelUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/PanelUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/PanelUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + package javax.swing.plaf; + + + public class PanelUI extends ComponentUI + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/PopupMenuUI.java gcc-3.3/libjava/javax/swing/plaf/PopupMenuUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/PopupMenuUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/PopupMenuUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,76 ---- + /* PopupMenuUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + // Imports + import java.awt.event.*; + + /** + * PopupMenuUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class PopupMenuUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor PopupMenuUI + */ + public PopupMenuUI() { + // TODO + } // PopupMenuUI() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * isPopupTrigger + * @param event TODO + * @returns boolean + */ + public boolean isPopupTrigger(MouseEvent event) { + return false; // TODO + } // isPopupTrigger() + + + } // PopupMenuUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ProgressBarUI.java gcc-3.3/libjava/javax/swing/plaf/ProgressBarUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ProgressBarUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ProgressBarUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ProgressBarUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * ProgressBarUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class ProgressBarUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ProgressBarUI + */ + public ProgressBarUI() { + // TODO + } // ProgressBarUI() + + + } // ProgressBarUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/RootPaneUI.java gcc-3.3/libjava/javax/swing/plaf/RootPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/RootPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/RootPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* RootPaneUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * RootPaneUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class RootPaneUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor RootPaneUI + */ + public RootPaneUI() { + // TODO + } // RootPaneUI() + + + } // RootPaneUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ScrollBarUI.java gcc-3.3/libjava/javax/swing/plaf/ScrollBarUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ScrollBarUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ScrollBarUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ScrollBarUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * ScrollBarUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class ScrollBarUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ScrollBarUI + */ + public ScrollBarUI() { + // TODO + } // ScrollBarUI() + + + } // ScrollBarUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ScrollPaneUI.java gcc-3.3/libjava/javax/swing/plaf/ScrollPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ScrollPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ScrollPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ScrollPaneUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * ScrollPaneUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class ScrollPaneUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ScrollPaneUI + */ + public ScrollPaneUI() { + // TODO + } // ScrollPaneUI() + + + } // ScrollPaneUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/SeparatorUI.java gcc-3.3/libjava/javax/swing/plaf/SeparatorUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/SeparatorUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/SeparatorUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* SeparatorUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * SeparatorUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class SeparatorUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor SeparatorUI + */ + public SeparatorUI() { + // TODO + } // SeparatorUI() + + + } // SeparatorUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/SliderUI.java gcc-3.3/libjava/javax/swing/plaf/SliderUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/SliderUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/SliderUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* SliderUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * SliderUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class SliderUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor SliderUI + */ + public SliderUI() { + // TODO + } // SliderUI() + + + } // SliderUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/SplitPaneUI.java gcc-3.3/libjava/javax/swing/plaf/SplitPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/SplitPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/SplitPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,111 ---- + /* SplitPaneUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + // Imports + import java.awt.*; + import javax.swing.*; + + /** + * SplitPaneUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class SplitPaneUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor SplitPaneUI + */ + public SplitPaneUI() { + // TODO + } // SplitPaneUI() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * resetToPreferredSizes + * @param splitpane TODO + */ + public abstract void resetToPreferredSizes(JSplitPane splitpane); + + /** + * setDividerLocation + * @param splitpane TODO + * @param location TODO + */ + public abstract void setDividerLocation(JSplitPane splitpane, + int location); + + /** + * getDividerLocation + * @param splitpane TODO + * @returns int + */ + public abstract int getDividerLocation(JSplitPane splitpane); + + /** + * getMinimumDividerLocation + * @param splitpane TODO + * @returns int + */ + public abstract int getMinimumDividerLocation(JSplitPane splitpane); + + /** + * getMaximumDividerLocation + * @param splitpane TODO + * @returns int + */ + public abstract int getMaximumDividerLocation(JSplitPane splitpane); + + /** + * finishedPaintingChildren + * @param splitpane TODO + * @param graphics TODO + */ + public abstract void finishedPaintingChildren(JSplitPane splitpane, + Graphics graphics); + + + } // SplitPaneUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/TabbedPaneUI.java gcc-3.3/libjava/javax/swing/plaf/TabbedPaneUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/TabbedPaneUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/TabbedPaneUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,23 ---- + package javax.swing.plaf; + + import java.awt.*; + import javax.swing.*; + + public class TabbedPaneUI extends ComponentUI + { + public Rectangle getTabBounds(JTabbedPane pane, int index) + { + return null; + } + + public int getTabRunCount(JTabbedPane pane) + { + return 0; + } + + public int tabForCoordinate(JTabbedPane pane, int x, int y) + { + return 0; + } + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/TableHeaderUI.java gcc-3.3/libjava/javax/swing/plaf/TableHeaderUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/TableHeaderUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/TableHeaderUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* TableHeaderUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * TableHeaderUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class TableHeaderUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TableHeaderUI + */ + public TableHeaderUI() { + // TODO + } // TableHeaderUI() + + + } // TableHeaderUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/TableUI.java gcc-3.3/libjava/javax/swing/plaf/TableUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/TableUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/TableUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* TableUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * TableUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class TableUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TableUI + */ + public TableUI() { + // TODO + } // TableUI() + + + } // TableUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/TextUI.java gcc-3.3/libjava/javax/swing/plaf/TextUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/TextUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/TextUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,26 ---- + package javax.swing.plaf; + + import javax.swing.text.*; + import java.awt.*; + + public abstract class TextUI extends ComponentUI + { + public TextUI() + { + } + + public abstract void damageRange(JTextComponent t, int p0, int p1); + public abstract void damageRange(JTextComponent t, int p0, int p1, Position.Bias firstBias, Position.Bias secondBias); + public abstract EditorKit getEditorKit(JTextComponent t); + public abstract int getNextVisualPositionFrom(JTextComponent t, + int pos, + Position.Bias b, + int direction, + Position.Bias[] biasRet); + public abstract View getRootView(JTextComponent t); + public abstract Rectangle modelToView(JTextComponent t, int pos); + public abstract Rectangle modelToView(JTextComponent t, int pos, Position.Bias bias); + public abstract int viewToModel(JTextComponent t, Point pt); + public abstract int viewToModel(JTextComponent t, Point pt, Position.Bias[] biasReturn); + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ToolBarUI.java gcc-3.3/libjava/javax/swing/plaf/ToolBarUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ToolBarUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ToolBarUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ToolBarUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * ToolBarUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class ToolBarUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ToolBarUI + */ + public ToolBarUI() { + // TODO + } // ToolBarUI() + + + } // ToolBarUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ToolTipUI.java gcc-3.3/libjava/javax/swing/plaf/ToolTipUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ToolTipUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ToolTipUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* ToolTipUI.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.plaf; + + /** + * ToolTipUI + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class ToolTipUI extends ComponentUI { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ToolTipUI + */ + public ToolTipUI() { + // TODO + } // ToolTipUI() + + + } // ToolTipUI diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/TreeUI.java gcc-3.3/libjava/javax/swing/plaf/TreeUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/TreeUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/TreeUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + package javax.swing.plaf; + + + public class TreeUI extends ComponentUI + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/UIResource.java gcc-3.3/libjava/javax/swing/plaf/UIResource.java *** gcc-3.2.3/libjava/javax/swing/plaf/UIResource.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/UIResource.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,55 ---- + /* UIResource.java + Copyright (C) 1999 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + + package javax.swing.plaf; + + /** + * This interface is used to designate which objects were created by + * ComponentUI delegates. When uninstalling the user interface + * renderer with ComponentUI.uninstallUI() the renderer + * property is set to null. + *
          + * A comparison against null can be used with all properties except for + * the java.awt.Component properties font, foreground, and + * background. The container can provide the value of the properties if + * they are initialized or set to null. + * + * @author Brian Jones + * @see java.lang.ComponentUI + */ + public interface UIResource { } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/plaf/ViewportUI.java gcc-3.3/libjava/javax/swing/plaf/ViewportUI.java *** gcc-3.2.3/libjava/javax/swing/plaf/ViewportUI.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/plaf/ViewportUI.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + package javax.swing.plaf; + + + public class ViewportUI extends ComponentUI + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ProgressMonitorInputStream.java gcc-3.3/libjava/javax/swing/ProgressMonitorInputStream.java *** gcc-3.2.3/libjava/javax/swing/ProgressMonitorInputStream.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ProgressMonitorInputStream.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,158 ---- + /* ProgressMonitorInputStream.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.io.*; + + /** + * ProgressMonitorInputStream + * @author Andrew Selkirk + * @version 1.0 + */ + public class ProgressMonitorInputStream extends FilterInputStream { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * monitor + */ + private ProgressMonitor monitor; + + /** + * nread + */ + private int nread; + + /** + * size + */ + private int size; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ProgressMonitorInputStream + * @param component TODO + * @param message TODO + * @param stream TODO + */ + public ProgressMonitorInputStream(Component component, Object message, + InputStream stream) { + super(stream); + // TODO + } // ProgressMonitorInputStream() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * reset + * @exception IOException TODO + */ + public synchronized void reset() throws IOException { + // TODO + } // reset() + + /** + * read + * @exception IOException TODO + * @returns int + */ + public int read() throws IOException { + return 0; // TODO + } // read() + + /** + * read + * @param data TODO + * @exception IOException TODO + * @returns int + */ + public int read(byte[] data) throws IOException { + return 0; // TODO + } // read() + + /** + * read + * @param data TODO + * @param offset TODO + * @param length TODO + * @exception IOException TODO + * @returns int + */ + public int read(byte[] data, int offset, int length) throws IOException { + return 0; // TODO + } // read() + + /** + * skip + * @param length TODO + * @exception IOException TODO + * @returns long + */ + public long skip(long length) throws IOException { + return 0; // TODO + } // skip() + + /** + * close + * @exception IOException TODO + */ + public void close() throws IOException { + // TODO + } // close() + + /** + * getProgressMonitor + * @returns ProgressMonitor + */ + public ProgressMonitor getProgressMonitor() { + return null; // TODO + } // getProgressMonitor() + + + } // ProgressMonitorInputStream diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ProgressMonitor.java gcc-3.3/libjava/javax/swing/ProgressMonitor.java *** gcc-3.2.3/libjava/javax/swing/ProgressMonitor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ProgressMonitor.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,229 ---- + /* ProgressMonitor.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + + /** + * ProgressMonitor + * @author Andrew Selkirk + * @version 1.0 + */ + public class ProgressMonitor { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * parentComponent + */ + private Component component; + + /** + * note + */ + private String note; + + /** + * message + */ + private Object message; + + /** + * millisToDecideToPopup + */ + private int millisToDecideToPopup; + + /** + * millisToPopup + */ + private int millisToPopup; + + /** + * min + */ + private int minimum; + + /** + * max + */ + private int maximum; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ProgressMonitor + * @param component TODO + * @param message TODO + * @param note TODO + * @param minimum TODO + * @param maximum TODO + */ + public ProgressMonitor(Component component, Object message, + String note, int minimum, int maximum) { + + // Set Data + this.component = component; + this.message = message; + this.note = note; + this.minimum = minimum; + this.maximum = maximum; + + // TODO + } // ProgressMonitor() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * close + */ + public void close() { + // TODO + } // close() + + /** + * setProgress + * @param progress TODO + */ + public void setProgress(int progress) { + // TODO + } // setProgress() + + /** + * getMinimum + * @returns int + */ + public int getMinimum() { + return minimum; // TODO + } // getMinimum() + + /** + * setMinimum + * @param minimum TODO + */ + public void setMinimum(int minimum) { + this.minimum = minimum; + // TODO + } // setMinimum() + + /** + * getMaximum + * @returns int + */ + public int getMaximum() { + return maximum; // TODO + } // getMaximum() + + /** + * setMaximum + * @param maximum TODO + */ + public void setMaximum(int maximum) { + this.maximum = maximum; + // TODO + } // setMaximum() + + /** + * isCanceled + * @returns boolean + */ + public boolean isCanceled() { + return false; // TODO + } // isCanceled() + + /** + * getMillisToDecideToPopup + * @returns int + */ + public int getMillisToDecideToPopup() { + return millisToDecideToPopup; // TODO + } // getMillisToDecideToPopup() + + /** + * setMillisToDecideToPopup + * @param time TODO + */ + public void setMillisToDecideToPopup(int time) { + millisToDecideToPopup = time; + // TODO + } // setMillisToDecideToPopup() + + /** + * getMillisToPopup + * @returns int + */ + public int getMillisToPopup() { + return millisToPopup; // TODO + } // getMillisToPopup() + + /** + * setMillisToPopup + * @param time TODO + */ + public void setMillisToPopup(int time) { + millisToPopup = time; + // TODO + } // setMillisToPopup() + + /** + * getNote + * @returns String + */ + public String getNote() { + return note; // TODO + } // getNote() + + /** + * setNote + * @param note TODO + */ + public void setNote(String note) { + this.note = note; + // TODO + } // setNote() + + + } // ProgressMonitor diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/Renderer.java gcc-3.3/libjava/javax/swing/Renderer.java *** gcc-3.2.3/libjava/javax/swing/Renderer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/Renderer.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,68 ---- + /* Renderer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + + /** + * Renderer + * @author Andrew Selkirk + * @version 1.0 + */ + public interface Renderer { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * setValue + * @param value TODO + * @param selected TODO + */ + public void setValue(Object value, boolean selected); + + /** + * getComponent + * @returns Component + */ + public Component getComponent(); + + + } // Renderer diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/RepaintManager.java gcc-3.3/libjava/javax/swing/RepaintManager.java *** gcc-3.2.3/libjava/javax/swing/RepaintManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/RepaintManager.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,278 ---- + /* RepaintManager.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.util.*; + + /** + * RepaintManager + * @author Andrew Selkirk + * @version 1.0 + */ + public class RepaintManager { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * dirtyComponents + */ + Hashtable dirtyComponents; + + /** + * tmpDirtyComponents + */ + Hashtable tmpDirtyComponents; + + /** + * invalidComponents + */ + Vector invalidComponents; + + /** + * doubleBufferingEnabled + */ + boolean doubleBufferingEnabled; + + /** + * doubleBuffer + */ + Image doubleBuffer; + + /** + * doubleBufferSize + */ + Dimension doubleBufferSize; + + /** + * doubleBufferMaxSize + */ + private Dimension doubleBufferMaxSize; + + /** + * resetDoubleBuffer + */ + private boolean resetDoubleBuffer; + + /** + * repaintManagerKey + */ + private static final Object repaintManagerKey = null; // TODO + + /** + * tmp + */ + Rectangle tmp; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor RepaintManager + */ + public RepaintManager() { + // TODO + } // RepaintManager() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public synchronized String toString() { + return null; // TODO + } // toString() + + /** + * currentManager + * @param component TODO + * @returns RepaintManager + */ + public static RepaintManager currentManager(Component component) { + return null; // TODO + } // currentManager() + + /** + * currentManager + * @param component TODO + * @returns RepaintManager + */ + public static RepaintManager currentManager(JComponent component) { + return null; // TODO + } // currentManager() + + /** + * setCurrentManager + * @param manager TODO + */ + public static void setCurrentManager(RepaintManager manager) { + // TODO + } // setCurrentManager() + + /** + * addInvalidComponent + * @param component TODO + */ + public synchronized void addInvalidComponent(JComponent component) { + // TODO + } // addInvalidComponent() + + /** + * removeInvalidComponent + * @param component TODO + */ + public synchronized void removeInvalidComponent(JComponent component) { + // TODO + } // removeInvalidComponent() + + /** + * addDirtyRegion + * @param component TODO + * @param x TODO + * @param y TODO + * @param w TODO + * @param h TODO + */ + public synchronized void addDirtyRegion(JComponent component, int x, + int y, int w, int h) { + // TODO + } // addDirtyRegion() + + /** + * getDirtyRegion + * @param component TODO + * @returns Rectangle + */ + public Rectangle getDirtyRegion(JComponent component) { + return null; // TODO + } // getDirtyRegion() + + /** + * markCompletelyDirty + * @param component TODO + */ + public void markCompletelyDirty(JComponent component) { + // TODO + } // markCompletelyDirty() + + /** + * markCompletelyClean + * @param component TODO + */ + public void markCompletelyClean(JComponent component) { + // TODO + } // markCompletelyClean() + + /** + * isCompletelyDirty + * @param component TODO + * @returns boolean + */ + public boolean isCompletelyDirty(JComponent component) { + return false; // TODO + } // isCompletelyDirty() + + /** + * validateInvalidComponents + */ + public void validateInvalidComponents() { + // TODO + } // validateInvalidComponents() + + /** + * paintDirtyRegions + */ + public void paintDirtyRegions() { + // TODO + } // paintDirtyRegions() + + /** + * getOffscreenBuffer + * @param component TODO + * @param proposedWidth TODO + * @param proposedHeight TODO + * @returns Image + */ + public Image getOffscreenBuffer(Component component, + int proposedWidth, int proposedHeight) { + return null; // TODO + } // getOffscreenBuffer() + + /** + * getDoubleBufferMaximumSize + * @returns Dimension + */ + public Dimension getDoubleBufferMaximumSize() { + return null; // TODO + } // getDoubleBufferMaximumSize() + + /** + * setDoubleBufferMaximumSize + * @param size TODO + */ + public void setDoubleBufferMaximumSize(Dimension size) { + // TODO + } // setDoubleBufferMaximumSize() + + /** + * setDoubleBufferingEnabled + * @param buffer TODO + */ + public void setDoubleBufferingEnabled(boolean buffer) { + // TODO + } // setDoubleBufferingEnabled() + + /** + * isDoubleBufferingEnabled + * @returns boolean + */ + public boolean isDoubleBufferingEnabled() { + return false; // TODO + } // isDoubleBufferingEnabled() + + + } // RepaintManager diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/RootPaneContainer.java gcc-3.3/libjava/javax/swing/RootPaneContainer.java *** gcc-3.2.3/libjava/javax/swing/RootPaneContainer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/RootPaneContainer.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,97 ---- + /* RootPaneContainer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + + /** + * RootPaneContainer + * @author Andrew Selkirk + * @version 1.0 + */ + public interface RootPaneContainer { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getRootPane + * @returns JRootPane + */ + public JRootPane getRootPane(); + + /** + * setContentPane + * @param contentPane TODO + */ + public void setContentPane(Container contentPane); + + /** + * getContentPane + * @returns Container + */ + public Container getContentPane(); + + /** + * setLayeredPane + * @param layeredPane TODO + */ + public void setLayeredPane(JLayeredPane layeredPane); + + /** + * getLayeredPane + * @returns JLayeredPane + */ + public JLayeredPane getLayeredPane(); + + /** + * setGlassPane + * @param glassPane TODO + */ + public void setGlassPane(Component glassPane); + + /** + * getGlassPane + * @returns Component + */ + public Component getGlassPane(); + + + } // RootPaneContainer diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/Scrollable.java gcc-3.3/libjava/javax/swing/Scrollable.java *** gcc-3.2.3/libjava/javax/swing/Scrollable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/Scrollable.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,49 ---- + /* Scrollable.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + + public interface Scrollable + { + Dimension getPreferredScrollableViewportSize(); + int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction); + int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction); + boolean getScrollableTracksViewportWidth(); + boolean getScrollableTracksViewportHeight(); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ScrollPaneConstants.java gcc-3.3/libjava/javax/swing/ScrollPaneConstants.java *** gcc-3.2.3/libjava/javax/swing/ScrollPaneConstants.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ScrollPaneConstants.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,157 ---- + /* ScrollPaneConstants.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + /** + * ScrollPaneConstants + * @author Andrew Selkirk + * @version 1.0 + */ + public interface ScrollPaneConstants { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * VIEWPORT + */ + public static final String VIEWPORT = "VIEWPORT"; + + /** + * VERTICAL_SCROLLBAR + */ + public static final String VERTICAL_SCROLLBAR = "VERTICAL_SCROLLBAR"; + + /** + * HORIZONTAL_SCROLLBAR + */ + public static final String HORIZONTAL_SCROLLBAR = "HORIZONTAL_SCROLLBAR"; + + /** + * ROW_HEADER + */ + public static final String ROW_HEADER = "ROW_HEADER"; + + /** + * COLUMN_HEADER + */ + public static final String COLUMN_HEADER = "COLUMN_HEADER"; + + /** + * LOWER_LEFT_CORNER + */ + public static final String LOWER_LEFT_CORNER = "LOWER_LEFT_CORNER"; + + /** + * LOWER_RIGHT_CORNER + */ + public static final String LOWER_RIGHT_CORNER = "LOWER_RIGHT_CORNER"; + + /** + * UPPER_LEFT_CORNER + */ + public static final String UPPER_LEFT_CORNER = "UPPER_LEFT_CORNER"; + + /** + * UPPER_RIGHT_CORNER + */ + public static final String UPPER_RIGHT_CORNER = "UPPER_RIGHT_CORNER"; + + /** + * LOWER_LEADING_CORNER + */ + public static final String LOWER_LEADING_CORNER = "LOWER_LEADING_CORNER"; + + /** + * LOWER_TRAILING_CORNER + */ + public static final String LOWER_TRAILING_CORNER = "LOWER_TRAILING_CORNER"; + + /** + * UPPER_LEADING_CORNER + */ + public static final String UPPER_LEADING_CORNER = "UPPER_LEADING_CORNER"; + + /** + * UPPER_TRAILING_CORNER + */ + public static final String UPPER_TRAILING_CORNER = "UPPER_TRAILING_CORNER"; + + /** + * VERTICAL_SCROLLBAR_POLICY + */ + public static final String VERTICAL_SCROLLBAR_POLICY = "VERTICAL_SCROLLBAR_POLICY"; + + /** + * HORIZONTAL_SCROLLBAR_POLICY + */ + public static final String HORIZONTAL_SCROLLBAR_POLICY = "HORIZONTAL_SCROLLBAR_POLICY"; + + /** + * VERTICAL_SCROLLBAR_AS_NEEDED + */ + public static final int VERTICAL_SCROLLBAR_AS_NEEDED = 20; + + /** + * VERTICAL_SCROLLBAR_NEVER + */ + public static final int VERTICAL_SCROLLBAR_NEVER = 21; + + /** + * VERTICAL_SCROLLBAR_ALWAYS + */ + public static final int VERTICAL_SCROLLBAR_ALWAYS = 22; + + /** + * HORIZONTAL_SCROLLBAR_AS_NEEDED + */ + public static final int HORIZONTAL_SCROLLBAR_AS_NEEDED = 30; + + /** + * HORIZONTAL_SCROLLBAR_NEVER + */ + public static final int HORIZONTAL_SCROLLBAR_NEVER = 31; + + /** + * HORIZONTAL_SCROLLBAR_ALWAYS + */ + public static final int HORIZONTAL_SCROLLBAR_ALWAYS = 32; + + + } // ScrollPaneConstants diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ScrollPaneLayout.java gcc-3.3/libjava/javax/swing/ScrollPaneLayout.java *** gcc-3.2.3/libjava/javax/swing/ScrollPaneLayout.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ScrollPaneLayout.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,306 ---- + /* ScrollPaneLayout.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.io.*; + import javax.swing.plaf.*; + + /** + * ScrollPaneLayout + * @author Andrew Selkirk + * @version 1.0 + */ + public class ScrollPaneLayout implements LayoutManager, ScrollPaneConstants, Serializable { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * UIResource + */ + public static class UIResource extends ScrollPaneLayout + implements javax.swing.plaf.UIResource { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UIResource + */ + public UIResource() { + // TODO + } // UIResource() + + + } // UIResource + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * viewport + */ + protected JViewport viewport; + + /** + * vsb + */ + protected JScrollBar vsb; + + /** + * hsb + */ + protected JScrollBar hsb; + + /** + * rowHead + */ + protected JViewport rowHead; + + /** + * colHead + */ + protected JViewport colHead; + + /** + * lowerLeft + */ + protected Component lowerLeft; + + /** + * lowerRight + */ + protected Component lowerRight; + + /** + * upperLeft + */ + protected Component upperLeft; + + /** + * upperRight + */ + protected Component upperRight; + + /** + * vsbPolicy + */ + protected int vsbPolicy; + + /** + * hsbPolicy + */ + protected int hsbPolicy; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ScrollPaneLayout + */ + public ScrollPaneLayout() { + // TODO + } // ScrollPaneLayout() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * syncWithScrollPane + * @param scrollPane TODO + */ + public void syncWithScrollPane(JScrollPane scrollPane) { + // TODO + } // syncWithScrollPane() + + /** + * addSingletonComponent + * @param oldComponent TODO + * @param newComponent TODO + * @returns Component + */ + protected Component addSingletonComponent(Component oldComponent, + Component newComponent) { + return null; // TODO + } // addSingletonComponent() + + /** + * addLayoutComponent + * @param string TODO + * @param component TODO + */ + public void addLayoutComponent(String string, Component component) { + // TODO + } // addLayoutComponent() + + /** + * removeLayoutComponent + * @param component TODO + */ + public void removeLayoutComponent(Component component) { + // TODO + } // removeLayoutComponent() + + /** + * getVerticalScrollBarPolicy + * @returns int + */ + public int getVerticalScrollBarPolicy() { + return 0; // TODO + } // getVerticalScrollBarPolicy() + + /** + * setVerticalScrollBarPolicy + * @param policy TODO + */ + public void setVerticalScrollBarPolicy(int policy) { + // TODO + } // setVerticalScrollBarPolicy() + + /** + * getHorizontalScrollBarPolicy + * @returns int + */ + public int getHorizontalScrollBarPolicy() { + return 0; // TODO + } // getHorizontalScrollBarPolicy() + + /** + * setHorizontalScrollBarPolicy + * @param policy TODO + */ + public void setHorizontalScrollBarPolicy(int policy) { + // TODO + } // setHorizontalScrollBarPolicy() + + /** + * getViewport + * @returns JViewport + */ + public JViewport getViewport() { + return null; // TODO + } // getViewport() + + /** + * getHorizontalScrollBar + * @returns JScrollBar + */ + public JScrollBar getHorizontalScrollBar() { + return null; // TODO + } // getHorizontalScrollBar() + + /** + * getVerticalScrollBar + * @returns JScrollBar + */ + public JScrollBar getVerticalScrollBar() { + return null; // TODO + } // getVerticalScrollBar() + + /** + * getRowHeader + * @returns JViewport + */ + public JViewport getRowHeader() { + return null; // TODO + } // getRowHeader() + + /** + * getColumnHeader + * @returns JViewport + */ + public JViewport getColumnHeader() { + return null; // TODO + } // getColumnHeader() + + /** + * getCorner + * @param key TODO + * @returns Component + */ + public Component getCorner(String key) { + return null; // TODO + } // getCorner() + + /** + * preferredLayoutSize + * @param parent TODO + * @returns Dimension + */ + public Dimension preferredLayoutSize(Container parent) { + return null; // TODO + } // preferredLayoutSize() + + /** + * minimumLayoutSize + * @param parent TODO + * @returns Dimension + */ + public Dimension minimumLayoutSize(Container parent) { + return null; // TODO + } // minimumLayoutSize() + + /** + * layoutContainer + * @param parent TODO + */ + public void layoutContainer(Container parent) { + // TODO + } // layoutContainer() + + /** + * getViewportBorderBounds + * @param value0 TODO + * @returns Rectangle + */ + public Rectangle getViewportBorderBounds(JScrollPane scrollPane) { + return null; // TODO + } // getViewportBorderBounds() + + + } // ScrollPaneLayout diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/SingleSelectionModel.java gcc-3.3/libjava/javax/swing/SingleSelectionModel.java *** gcc-3.2.3/libjava/javax/swing/SingleSelectionModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/SingleSelectionModel.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,90 ---- + /* SingleSelectionModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import javax.swing.event.*; + + /** + * SingleSelectionModel + * @author Andrew Selkirk + * @version 1.0 + */ + public interface SingleSelectionModel { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getSelectedIndex + * @returns int + */ + public int getSelectedIndex(); + + /** + * setSelectedIndex + * @param index TODO + */ + public void setSelectedIndex(int index); + + /** + * clearSelection + */ + public void clearSelection(); + + /** + * isSelected + * @returns boolean + */ + public boolean isSelected(); + + /** + * addChangeListener + * @param listener TODO + */ + public void addChangeListener(ChangeListener listener); + + /** + * removeChangeListener + * @param listener TODO + */ + public void removeChangeListener(ChangeListener listener); + + + } // SingleSelectionModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/SizeRequirements.java gcc-3.3/libjava/javax/swing/SizeRequirements.java *** gcc-3.2.3/libjava/javax/swing/SizeRequirements.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/SizeRequirements.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,169 ---- + /* SizeRequirements.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.io.*; + + /** + * SizeRequirements + * @author Andrew Selkirk + * @version 1.0 + */ + public class SizeRequirements implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * minimum + */ + public int minimum; + + /** + * preferred + */ + public int preferred; + + /** + * maximum + */ + public int maximum; + + /** + * alignment + */ + public float alignment; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor SizeRequirements + */ + public SizeRequirements() { + // TODO + } // SizeRequirements() + + /** + * Constructor SizeRequirements + * @param min TODO + * @param pref TODO + * @param max TODO + * @param align TODO + */ + public SizeRequirements(int min, int pref, int max, float align) { + // TODO + } // SizeRequirements() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * getTiledSizeRequirements + * @param children TODO + * @returns SizeRequirements + */ + public static SizeRequirements getTiledSizeRequirements( + SizeRequirements[] children) { + return null; // TODO + } // getTiledSizeRequirements() + + /** + * getAlignedSizeRequirements + * @param children TODO + * @returns SizeRequirements + */ + public static SizeRequirements getAlignedSizeRequirements( + SizeRequirements[] children) { + return null; // TODO + } // getAlignedSizeRequirements() + + /** + * calculateTiledPositions + * @param allocated TODO + * @param total TODO + * @param children TODO + * @param offset TODO + * @param spans TODO + */ + public static void calculateTiledPositions(int allocated, + SizeRequirements total, SizeRequirements[] children, + int[] offset, int[] spans) { + // TODO + } // calculateTiledPositions() + + /** + * calculateAlignedPositions + * @param allocated TODO + * @param total TODO + * @param children TODO + * @param offset TODO + * @param spans TODO + */ + public static void calculateAlignedPositions(int allocated, + SizeRequirements total, SizeRequirements[] children, + int[] offset, int[] spans) { + // TODO + } // calculateAlignedPositions() + + /** + * adjustSizes + * @param delta TODO + * @param children TODO + * @returns int[] + */ + public static int[] adjustSizes(int delta, SizeRequirements[] children) { + return null; // TODO + } // adjustSizes() + + + } // SizeRequirements diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/SizeSequence.java gcc-3.3/libjava/javax/swing/SizeSequence.java *** gcc-3.2.3/libjava/javax/swing/SizeSequence.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/SizeSequence.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,249 ---- + /* SizeSequence.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + /** + * SizeSequence + * @author Andrew Selkirk + * @version 1.0 + */ + public class SizeSequence { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * sizes + */ + private int[] sizes = new int[0]; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor SizeSequence + */ + public SizeSequence() { + sizes = new int[0]; + } // SizeSequence() + + /** + * Constructor SizeSequence + * @param numEntries TODO + */ + public SizeSequence(int numEntries) { + this(numEntries, 0); + } // SizeSequence() + + /** + * Constructor SizeSequence + * @param numEntries TODO + * @param value TODO + */ + public SizeSequence(int numEntries, int value) { + insertEntries(0, numEntries, value); + } // SizeSequence() + + /** + * Constructor SizeSequence + * @param sizes TODO + */ + public SizeSequence(int[] sizes) { + setSizes(sizes); + } // SizeSequence() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * setSize + * @param index TODO + * @param size TODO + */ + public void setSize(int index, int size) { + sizes[index] = size; + } // setSize() + + /** + * getIndex + * @param position TODO + * @returns int + */ + public int getIndex(int position) { + return 0; // TODO + } // getIndex() + + /** + * getSize + * @param index TODO + * @returns int + */ + public int getSize(int index) { + return sizes[index]; + } // getSize() + + /** + * setSizes + * @param sizes TODO + */ + public void setSizes(int[] sizes) { + + // Variables + int index; + + // Initialize Sizes + this.sizes = new int[sizes.length]; + for (index = 0; index < sizes.length; index++) { + this.sizes[index] = sizes[index]; + } // for + + } // setSizes() + + /** + * getSizes + * @returns int[] + */ + public int[] getSizes() { + + // Variables + int[] array; + int index; + + // Create New Array + array = new int[sizes.length]; + for (index = 0; index < sizes.length; index++) { + array[index] = sizes[index]; + } // for + + // Return Newly created array + return array; + + } // getSizes() + + /** + * getPosition + * @param index TODO + * @returns int + */ + public int getPosition(int index) { + + // Variables + int position; + int loop; + + // Process Sizes + position = 0; + for (loop = 0; loop < index; loop++) { + position += sizes[loop]; + } // for + + // Return Position + return position; + + } // getPosition() + + /** + * insertEntries + * @param start TODO + * @param length TODO + * @param value TODO + */ + public void insertEntries(int start, int length, int value) { + + // Variables + int[] array; + int index; + int arrayIndex; + int loop; + + // Create New Array + array = new int[sizes.length + length]; + arrayIndex = 0; + for (index = 0; index < sizes.length; index++) { + if (index == start) { + for (loop = 0; loop < length; loop++) { + array[arrayIndex] = value; + arrayIndex++; + } // for + } else { + array[arrayIndex] = sizes[index]; + arrayIndex++; + } // if + } // for + + } // insertEntries() + + /** + * removeEntries + * @param start TODO + * @param length TODO + */ + public void removeEntries(int start, int length) { + + // Variables + int[] array; + int index; + int arrayIndex; + + // Sanity Check + if ((start + length) > sizes.length) { + throw new IllegalArgumentException("Specified start/length that " + + "is greater than available sizes"); + } // if + + // Create New Array + array = new int[sizes.length - length]; + arrayIndex = 0; + for (index = 0; index < sizes.length; index++) { + if (index == start) { + index += length - 1; + } else { + array[arrayIndex] = sizes[index]; + arrayIndex++; + } // if + } // for + + } // removeEntries() + + + } // SizeSequence diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/SwingConstants.java gcc-3.3/libjava/javax/swing/SwingConstants.java *** gcc-3.2.3/libjava/javax/swing/SwingConstants.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/SwingConstants.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,65 ---- + /* SwingConstants.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + + + public interface SwingConstants + { + public static final int CENTER = 0; + public static final int TOP = 1; + public static final int LEFT = 2; + public static final int BOTTOM = 3; + public static final int RIGHT = 4; + + public static final int NORTH = 1; + public static final int NORTH_EAST = 2; + public static final int EAST = 3; + public static final int SOUTH_EAST = 4; + public static final int SOUTH = 5; + public static final int SOUTH_WEST = 6; + public static final int WEST = 7; + public static final int NORTH_WEST = 8; + + public static final int HORIZONTAL = 0; + public static final int VERTICAL = 1; + + public static final int LEADING = 10; + public static final int TRAILING = 11; + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/SwingUtilities.java gcc-3.3/libjava/javax/swing/SwingUtilities.java *** gcc-3.2.3/libjava/javax/swing/SwingUtilities.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/SwingUtilities.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,120 ---- + /* SwingUtilities.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.*; + + + public class SwingUtilities + { + + public static FontMetrics getFontMetrics ( Font font ) { + return Toolkit.getDefaultToolkit().getFontMetrics(font); + } + + + static JRootPane getRootPane(Component a) + { + if (a instanceof JRootPane) + return (JRootPane) a; + + a = a.getParent(); + + if (a != null) + { + return getRootPane(a); + } + + return null; + } + + static void updateComponentTreeUI(JFrame comp) + { + } + + static public String layoutCompoundLabel(JComponent c, + FontMetrics fm, + String text, + Icon i, + int vert_a, + int hor_i, + int vert_text_pos, + int hor_text_pos, + Rectangle vr, + Rectangle ir, + Rectangle tr, + int gap) + { + // view rect 'vr' already ok, + // we need to compute ir (icon rect) and tr (text-rect) + + int next_x = 0;//vr.x; + int next_y = 0;//vr.y; + + ir.height = ir.width = ir.y = ir.x = 0; + + if (i != null) + { + ir.x = vr.x; + ir.y = vr.y; + ir.width = i.getIconWidth(); + ir.height = i.getIconWidth(); + + + next_x += gap + i.getIconWidth(); + next_y += gap + i.getIconHeight(); + } + + tr.x = next_x; + tr.y = vr.y + (vr.height/2); + + tr.width = fm.stringWidth(text); + tr.height = fm.getHeight() + fm.getAscent()/2; + + return text; + } + } + + + + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/AbstractTableModel.java gcc-3.3/libjava/javax/swing/table/AbstractTableModel.java *** gcc-3.2.3/libjava/javax/swing/table/AbstractTableModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/AbstractTableModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,314 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import java.io.*; + import java.util.*; + import javax.swing.event.*; + + /** + * AbstractTableModel + * @author Andrew Selkirk + */ + public abstract class AbstractTableModel implements TableModel, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * listenerList + */ + protected EventListenerList listenerList = new EventListenerList(); + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AbstractTableModel + */ + public AbstractTableModel() { + // TODO + } // AbstractTableModel() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getColumnName + * @param value0 TODO + * @returns String + */ + public String getColumnName(int columnIndex) { + + // Variables + int index; + int left; + int base; + int multiplier; + StringBuffer buffer; + boolean foundFirst; + + // Ok, this is not the best solution in the world + // and it does produce wrong answers starting 1378 + // but it's a start. I sure hope there is a more + // simple algorithm. I started with a base 10 to + // base 26 converter and later found that there + // were so many are exceptions that it has morphed + // into a pile of goop. + + // NOTE2: I have a working algorithm which is much + // much simplier and works for all values...I'll + // be adding it soon... + + // Process Exponent levels + buffer = new StringBuffer(); + left = columnIndex; + foundFirst = false; + for (index = 6; index >= 0; index--) { + base = (int) (Math.pow(26, index)); + if (index > 1) { + base = base + (int) (Math.pow(26, index - 1)); + } + if (base <= left) { + multiplier = left / base; + if (foundFirst == false && index > 0) { + buffer.append((char) (multiplier + 64)); + } else { + buffer.append((char) (multiplier + 65)); + } + left = left - (base * multiplier); + foundFirst = true; + } else if (foundFirst == true || index == 0) { + buffer.append('A'); + } + } // for + + // Return Column Name + return buffer.toString(); + + } // getColumnName() + + /** + * findColumn + * @param value0 TODO + * @returns int + */ + public int findColumn(String columnName) { + + // Variables + int index; + String name; + int count; + + // Process Columns + count = getColumnCount(); + for (index = 0; index < count; index++) { + name = getColumnName(index); + if (columnName.equals(name) == true) { + return index; + } // if + } // for + + // Unable to Locate + return -1; + + } // findColumn() + + /** + * getColumnClass + * @param value0 TODO + * @returns Class + */ + public Class getColumnClass(int columnIndex) { + return Object.class; + } // getColumnClass() + + /** + * isCellEditable + * @param value0 TODO + * @param value1 TODO + * @returns boolean + */ + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } // isCellEditable() + + /** + * setValueAt + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void setValueAt(Object value, int rowIndex, int columnIndex) { + // Do nothing... + } // setValueAt() + + /** + * addTableModelListener + * @param value0 TODO + */ + public void addTableModelListener(TableModelListener listener) { + listenerList.add(TableModelListener.class, listener); + } // addTableModelListener() + + /** + * removeTableModelListener + * @param value0 TODO + */ + public void removeTableModelListener(TableModelListener listener) { + listenerList.remove(TableModelListener.class, listener); + } // removeTableModelListener() + + /** + * fireTableDataChanged + */ + public void fireTableDataChanged() { + fireTableChanged(new TableModelEvent(this)); + } // fireTableDataChanged() + + /** + * fireTableStructureChanged + */ + public void fireTableStructureChanged() { + fireTableChanged(new TableModelEvent(this, + TableModelEvent.HEADER_ROW)); + } // fireTableStructureChanged() + + /** + * fireTableRowsInserted + * @param value0 TODO + * @param value1 TODO + */ + public void fireTableRowsInserted(int firstRow, int lastRow) { + fireTableChanged(new TableModelEvent(this, firstRow, lastRow, + TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT)); + } // fireTableRowsInserted() + + /** + * fireTableRowsUpdated + * @param value0 TODO + * @param value1 TODO + */ + public void fireTableRowsUpdated(int firstRow, int lastRow) { + fireTableChanged(new TableModelEvent(this, firstRow, lastRow, + TableModelEvent.ALL_COLUMNS, TableModelEvent.UPDATE)); + } // fireTableRowsUpdated() + + /** + * fireTableRowsDeleted + * @param value0 TODO + * @param value1 TODO + */ + public void fireTableRowsDeleted(int firstRow, int lastRow) { + fireTableChanged(new TableModelEvent(this, firstRow, lastRow, + TableModelEvent.ALL_COLUMNS, TableModelEvent.DELETE)); + } // fireTableRowsDeleted() + + /** + * fireTableCellUpdated + * @param value0 TODO + * @param value1 TODO + */ + public void fireTableCellUpdated(int row, int column) { + fireTableChanged(new TableModelEvent(this, row, row, column)); + } // fireTableCellUpdated() + + /** + * fireTableChanged + * @param value0 TODO + */ + public void fireTableChanged(TableModelEvent event) { + + // Variables + Object[] list; + int index; + TableModelListener listener; + + // Get Listener List + list = listenerList.getListenerList(); + + for (index = 0; index < list.length; index += 2) { + + // Get Listener + listener = (TableModelListener) list[index + 1]; + + // Notify Listener + listener.tableChanged(event); + + } // for: index + + } // fireTableChanged() + + /** + * getListeners + * @param value0 TODO + * @returns EventListener[] + */ + public EventListener[] getListeners(Class listenerType) { + return listenerList.getListeners(listenerType); + } // getListeners() + + /** + * getValueAt + * @param value0 TODO + * @param value1 TODO + * @returns Object + */ + public abstract Object getValueAt(int row, int column); + + /** + * getColumnCount + * @returns int + */ + public abstract int getColumnCount(); + + /** + * getRowCount + * @returns int + */ + public abstract int getRowCount(); + + + } // AbstractTableModel + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/DefaultTableCellRenderer.java gcc-3.3/libjava/javax/swing/table/DefaultTableCellRenderer.java *** gcc-3.2.3/libjava/javax/swing/table/DefaultTableCellRenderer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/DefaultTableCellRenderer.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,31 ---- + package javax.swing.table; + import java.awt.Component; + import java.io.Serializable; + import javax.swing.JLabel; + import javax.swing.JTable; + /** + * STUBBED + */ + public class DefaultTableCellRenderer extends JLabel + implements TableCellRenderer, Serializable + { + public static class UIResource extends DefaultTableCellRenderer + implements javax.swing.plaf.UIResource + { + public UIResource() + { + } + } // class UIResource + + public DefaultTableCellRenderer() + { + } + + public Component getTableCellRendererComponent(JTable table, Object value, + boolean isSelected, + boolean hasFocus, + int row, int column) + { + return null; + } + } // class DefaultTableCellRenderer diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/DefaultTableColumnModel.java gcc-3.3/libjava/javax/swing/table/DefaultTableColumnModel.java *** gcc-3.2.3/libjava/javax/swing/table/DefaultTableColumnModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/DefaultTableColumnModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,354 ---- + /* DefaultTableColumnModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import java.beans.*; + import java.io.*; + import java.util.*; + import javax.swing.*; + import javax.swing.event.*; + + /** + * DefaultTableColumnModel + * @author Andrew Selkirk + * @version 1.0 + */ + public class DefaultTableColumnModel implements TableColumnModel, PropertyChangeListener, ListSelectionListener, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * tableColumns + */ + protected Vector tableColumns; + + /** + * selectionModel + */ + protected ListSelectionModel selectionModel; + + /** + * columnMargin + */ + protected int columnMargin; + + /** + * listenerList + */ + protected EventListenerList listenerList; + + /** + * changeEvent + */ + protected transient ChangeEvent changeEvent; + + /** + * columnSelectionAllowed + */ + protected boolean columnSelectionAllowed; + + /** + * totalColumnWidth + */ + protected int totalColumnWidth; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultTableColumnModel + */ + public DefaultTableColumnModel() { + // TODO + } // DefaultTableColumnModel() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * addColumn + * @param value0 TODO + */ + public void addColumn(TableColumn value0) { + // TODO + } // addColumn() + + /** + * removeColumn + * @param value0 TODO + */ + public void removeColumn(TableColumn value0) { + // TODO + } // removeColumn() + + /** + * moveColumn + * @param value0 TODO + * @param value1 TODO + */ + public void moveColumn(int value0, int value1) { + // TODO + } // moveColumn() + + /** + * setColumnMargin + * @param value0 TODO + */ + public void setColumnMargin(int value0) { + // TODO + } // setColumnMargin() + + /** + * getColumnCount + * @returns int + */ + public int getColumnCount() { + return 0; // TODO + } // getColumnCount() + + /** + * getColumns + * @returns Enumeration + */ + public Enumeration getColumns() { + return null; // TODO + } // getColumns() + + /** + * getColumnIndex + * @param value0 TODO + * @returns int + */ + public int getColumnIndex(Object value0) { + return 0; // TODO + } // getColumnIndex() + + /** + * getColumn + * @param value0 TODO + * @returns TableColumn + */ + public TableColumn getColumn(int value0) { + return null; // TODO + } // getColumn() + + /** + * getColumnMargin + * @returns int + */ + public int getColumnMargin() { + return 0; // TODO + } // getColumnMargin() + + /** + * getColumnIndexAtX + * @param value0 TODO + * @returns int + */ + public int getColumnIndexAtX(int value0) { + return 0; // TODO + } // getColumnIndexAtX() + + /** + * getTotalColumnWidth + * @returns int + */ + public int getTotalColumnWidth() { + return 0; // TODO + } // getTotalColumnWidth() + + /** + * setSelectionModel + * @param value0 TODO + */ + public void setSelectionModel(ListSelectionModel value0) { + // TODO + } // setSelectionModel() + + /** + * getSelectionModel + * @returns ListSelectionModel + */ + public ListSelectionModel getSelectionModel() { + return null; // TODO + } // getSelectionModel() + + /** + * setColumnSelectionAllowed + * @param value0 TODO + */ + public void setColumnSelectionAllowed(boolean value0) { + // TODO + } // setColumnSelectionAllowed() + + /** + * getColumnSelectionAllowed + * @returns boolean + */ + public boolean getColumnSelectionAllowed() { + return false; // TODO + } // getColumnSelectionAllowed() + + /** + * getSelectedColumns + * @returns int[] + */ + public int[] getSelectedColumns() { + return null; // TODO + } // getSelectedColumns() + + /** + * getSelectedColumnCount + * @returns int + */ + public int getSelectedColumnCount() { + return 0; // TODO + } // getSelectedColumnCount() + + /** + * addColumnModelListener + * @param value0 TODO + */ + public void addColumnModelListener(TableColumnModelListener value0) { + // TODO + } // addColumnModelListener() + + /** + * removeColumnModelListener + * @param value0 TODO + */ + public void removeColumnModelListener(TableColumnModelListener value0) { + // TODO + } // removeColumnModelListener() + + /** + * fireColumnAdded + * @param value0 TODO + */ + protected void fireColumnAdded(TableColumnModelEvent value0) { + // TODO + } // fireColumnAdded() + + /** + * fireColumnRemoved + * @param value0 TODO + */ + protected void fireColumnRemoved(TableColumnModelEvent value0) { + // TODO + } // fireColumnRemoved() + + /** + * fireColumnMoved + * @param value0 TODO + */ + protected void fireColumnMoved(TableColumnModelEvent value0) { + // TODO + } // fireColumnMoved() + + /** + * fireColumnSelectionChanged + * @param value0 TODO + */ + protected void fireColumnSelectionChanged(ListSelectionEvent value0) { + // TODO + } // fireColumnSelectionChanged() + + /** + * fireColumnMarginChanged + */ + protected void fireColumnMarginChanged() { + // TODO + } // fireColumnMarginChanged() + + /** + * getListeners + * @param value0 TODO + * @returns EventListener[] + */ + public EventListener[] getListeners(Class value0) { + return null; // TODO + } // getListeners() + + /** + * propertyChange + * @param value0 TODO + */ + public void propertyChange(PropertyChangeEvent value0) { + // TODO + } // propertyChange() + + /** + * valueChanged + * @param value0 TODO + */ + public void valueChanged(ListSelectionEvent value0) { + // TODO + } // valueChanged() + + /** + * createSelectionModel + * @returns ListSelectionModel + */ + protected ListSelectionModel createSelectionModel() { + return null; // TODO + } // createSelectionModel() + + /** + * recalcWidthCache + */ + protected void recalcWidthCache() { + // TODO + } // recalcWidthCache() + + /** + * invalidateWidthCache + */ + private void invalidateWidthCache() { + // TODO + } // invalidateWidthCache() + + + } // DefaultTableColumnModel + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/DefaultTableModel.java gcc-3.3/libjava/javax/swing/table/DefaultTableModel.java *** gcc-3.2.3/libjava/javax/swing/table/DefaultTableModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/DefaultTableModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,493 ---- + /* DefaultTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import java.io.*; + import java.util.*; + import javax.swing.event.*; + + /** + * DefaultTableModel + * @author Andrew Selkirk + */ + public class DefaultTableModel extends AbstractTableModel implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * dataVector + */ + protected Vector dataVector; + + /** + * columnIdentifiers + */ + protected Vector columnIdentifiers; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultTableModel + */ + public DefaultTableModel() { + this(0, 0); + } // DefaultTableModel() + + /** + * Constructor DefaultTableModel + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTableModel(int numRows, int numColumns) { + + // Variables + int columnIndex; + Vector defaultNames; + + // Create Column Names + defaultNames = new Vector(); + for (columnIndex = 0; columnIndex < numColumns; columnIndex++) { + defaultNames.addElement(super.getColumnName(columnIndex)); + } // for + + // Setup Data + // setDataVector(defaultNames, numRows); + + } // DefaultTableModel() + + /** + * Constructor DefaultTableModel + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTableModel(Vector columnNames, int numRows) { + + // Variables + Vector data; + Vector rowData; + int rowIndex; + int columnIndex; + int numColumns; + + // Create Data + data = new Vector(); + if (columnNames == null) { + numColumns = 0; + } else { + numColumns = columnNames.size(); + } // if + for (rowIndex = 0; rowIndex < numRows; rowIndex++) { + rowData = new Vector(); + rowData.setSize(numColumns); + data.addElement(rowData); + } // for + + // Setup Data + setDataVector(data, columnNames); + + } // DefaultTableModel() + + /** + * Constructor DefaultTableModel + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTableModel(Object[] columnNames, int numRows) { + this(convertToVector(columnNames), numRows); + } // DefaultTableModel() + + /** + * Constructor DefaultTableModel + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTableModel(Vector data, Vector columnNames) { + setDataVector(data, columnNames); + } // DefaultTableModel() + + /** + * Constructor DefaultTableModel + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTableModel(Object[][] data, Object[] columnNames) { + this(convertToVector(data), convertToVector(columnNames)); + } // DefaultTableModel() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getDataVector + * @returns Vector + */ + public Vector getDataVector() { + return dataVector; + } // getDataVector() + + /** + * setDataVector + * @param value0 TODO + * @param value1 TODO + */ + public void setDataVector(Vector data, Vector columnNames) { + + // Variables + int rowIndex; + int columnIndex; + int numRows; + int numColumns; + Vector columnVector; + + // Set Data + dataVector = data; + columnIdentifiers = columnNames; + + // Check Data + numRows = data.size(); + numColumns = columnNames.size(); + for (rowIndex = 0; rowIndex < numRows; rowIndex++) { + columnVector = (Vector) dataVector.get(rowIndex); + columnVector.setSize(numColumns); + } // for + + } // setDataVector() + + /** + * setDataVector + * @param value0 TODO + * @param value1 TODO + */ + public void setDataVector(Object[][] data, Object[] columnNames) { + setDataVector(convertToVector(data), convertToVector(columnNames)); + } // setDataVector() + + /** + * newDataAvailable + * @param value0 TODO + */ + public void newDataAvailable(TableModelEvent event) { + fireTableChanged(event); + } // newDataAvailable() + + /** + * newRowsAdded + * @param value0 TODO + */ + public void newRowsAdded(TableModelEvent event) { + // TODO + } // newRowsAdded() + + /** + * rowsRemoved + * @param value0 TODO + */ + public void rowsRemoved(TableModelEvent event) { + fireTableChanged(event); + } // rowsRemoved() + + /** + * setColumnIdentifiers + * @param value0 TODO + */ + public void setColumnIdentifiers(Vector columnIdentifiers) { + this.columnIdentifiers = columnIdentifiers; + setColumnCount(columnIdentifiers.size()); + } // setColumnIdentifiers() + + /** + * setColumnIdentifiers + * @param value0 TODO + */ + public void setColumnIdentifiers(Object[] columnIdentifiers) { + setColumnIdentifiers(convertToVector(columnIdentifiers)); + } // setColumnIdentifiers() + + /** + * setNumRows + * @param value0 TODO + */ + public void setNumRows(int numRows) { + setRowCount(numRows); + } // setNumRows() + + /** + * setRowCount + * @param value0 TODO + */ + public void setRowCount(int rowCount) { + // TODO + } // setRowCount() + + /** + * setColumnCount + * @param value0 TODO + */ + public void setColumnCount(int columnCount) { + // TODO + } // setColumnCount() + + /** + * addColumn + * @param value0 TODO + */ + public void addColumn(Object columnName) { + addColumn(columnName, new Vector(dataVector.size())); + } // addColumn() + + /** + * addColumn + * @param value0 TODO + * @param value1 TODO + */ + public void addColumn(Object columnName, Vector columnData) { + // TODO + } // addColumn() + + /** + * addColumn + * @param value0 TODO + * @param value1 TODO + */ + public void addColumn(Object columnName, Object[] columnData) { + // TODO + } // addColumn() + + /** + * addRow + * @param value0 TODO + */ + public void addRow(Vector rowData) { + // TODO + } // addRow() + + /** + * addRow + * @param value0 TODO + */ + public void addRow(Object[] rowData) { + addRow(convertToVector(rowData)); + } // addRow() + + /** + * insertRow + * @param value0 TODO + * @param value1 TODO + */ + public void insertRow(int row, Vector rowData) { + dataVector.add(row, rowData); + } // insertRow() + + /** + * insertRow + * @param value0 TODO + * @param value1 TODO + */ + public void insertRow(int row, Object[] rowData) { + insertRow(row, convertToVector(rowData)); + } // insertRow() + + /** + * moveRow + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void moveRow(int startIndex, int endIndex, int toIndex) { + + // Variables + int index; + Vector vector; + + // Move Rows + for (index = 0; index < (endIndex - startIndex); index++) { + vector = (Vector) dataVector.remove(startIndex); + dataVector.add(toIndex, vector); + } // for + + } // moveRow() + + /** + * removeRow + * @param value0 TODO + */ + public void removeRow(int row) { + dataVector.remove(row); + } // removeRow() + + /** + * getRowCount + * @returns int + */ + public int getRowCount() { + return dataVector.size(); + } // getRowCount() + + /** + * getColumnCount + * @returns int + */ + public int getColumnCount() { + return columnIdentifiers.size(); + } // getColumnCount() + + /** + * getColumnName + * @param value0 TODO + * @returns String + */ + public String getColumnName(int column) { + + // Check for Column + if (columnIdentifiers == null || column >= getColumnCount()) { + return super.getColumnName(column); + } // if + + // Return Column name + return (String) columnIdentifiers.get(column); + + } // getColumnName() + + /** + * isCellEditable + * @param value0 TODO + * @param value1 TODO + * @returns boolean + */ + public boolean isCellEditable(int row, int column) { + return true; + } // isCellEditable() + + /** + * getValueAt + * @param value0 TODO + * @param value1 TODO + * @returns Object + */ + public Object getValueAt(int row, int column) { + + // Variables + Vector rowVector; + + // Get Row Vector + rowVector = (Vector) dataVector.get(row); + + // Get Data + return rowVector.get(column); + + } // getValueAt() + + /** + * setValueAt + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void setValueAt(Object value, int row, int column) { + + // Variables + Vector rowVector; + + // Get Row Vector + rowVector = (Vector) dataVector.get(row); + + // Set Data + rowVector.remove(column); + rowVector.add(column, value); + + } // setValueAt() + + /** + * convertToVector + * @param value0 TODO + * @returns Vector + */ + protected static Vector convertToVector(Object[] data) { + + // Variables + int index; + Vector vector; + + // Check for null + if (data == null) { + return null; + } // if + + // Process + vector = new Vector(); + for (index = 0; index < data.length; index++) { + vector.add(data[index]); + } // for: index + + // Return new Vector + return vector; + + } // convertToVector() + + /** + * convertToVector + * @param value0 TODO + * @returns Vector + */ + protected static Vector convertToVector(Object[][] data) { + + // Variables + int index; + Vector vector; + + // Process + vector = new Vector(); + for (index = 0; index < data.length; index++) { + vector.add(convertToVector(data[index])); + } // for: index + + // Return new Vector + return vector; + + } // convertToVector() + + + } // DefaultTableModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/TableCellEditor.java gcc-3.3/libjava/javax/swing/table/TableCellEditor.java *** gcc-3.2.3/libjava/javax/swing/table/TableCellEditor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/TableCellEditor.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,64 ---- + /* TableCellEditor.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import java.awt.Component; + import javax.swing.JTable; + import javax.swing.CellEditor; + + /** + * TableCellEditor interface + * @author Andrew Selkirk + */ + public interface TableCellEditor extends CellEditor { + + /** + * Get table cell editor component + * @param table JTable + * @param value Value of cell + * @param isSelected Cell selected + * @param row Row of cell + * @param column Column of cell + * @returns Component + */ + public Component getTableCellEditorComponent(JTable table, + Object value, boolean isSelected, int row, int column); + + + } // TableCellEditor diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/TableCellRenderer.java gcc-3.3/libjava/javax/swing/table/TableCellRenderer.java *** gcc-3.2.3/libjava/javax/swing/table/TableCellRenderer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/TableCellRenderer.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,65 ---- + /* TableCellRenderer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import java.awt.Component; + import javax.swing.JTable; + + /** + * TableCellRenderer interface + * @author Andrew Selkirk + */ + public interface TableCellRenderer { + + /** + * Get table cell renderer component + * @param table JTable + * @param value Value of cell + * @param isSelected Cell selected + * @param hasFocus Cell has focus + * @param row Row of cell + * @param column Column of cell + * @returns Component + */ + public Component getTableCellRendererComponent(JTable table, + Object value, boolean isSelected, boolean hasFocus, + int row, int column); + + + } // TableCellRenderer diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/TableColumn.java gcc-3.3/libjava/javax/swing/table/TableColumn.java *** gcc-3.2.3/libjava/javax/swing/table/TableColumn.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/TableColumn.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,515 ---- + /* TableColumn.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import java.beans.*; + import java.io.*; + import javax.swing.event.*; + + /** + * TableColumn + * @author Andrew Selkirk + * @version 1.0 + */ + public class TableColumn implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * COLUMN_WIDTH_PROPERTY + */ + public static final String COLUMN_WIDTH_PROPERTY = "columWidth"; + + /** + * HEADER_VALUE_PROPERTY + */ + public static final String HEADER_VALUE_PROPERTY = "headerValue"; + + /** + * HEADER_RENDERER_PROPERTY + */ + public static final String HEADER_RENDERER_PROPERTY = "headerRenderer"; + + /** + * CELL_RENDERER_PROPERTY + */ + public static final String CELL_RENDERER_PROPERTY = "cellRenderer"; + + /** + * modelIndex + */ + protected int modelIndex; + + /** + * identifier + */ + protected Object identifier; + + /** + * width + */ + protected int width; + + /** + * minWidth + */ + protected int minWidth = 15; + + /** + * preferredWidth + */ + private int preferredWidth; + + /** + * maxWidth + */ + protected int maxWidth = Integer.MAX_VALUE; + + /** + * headerRenderer + */ + protected TableCellRenderer headerRenderer; + + /** + * headerValue + */ + protected Object headerValue; + + /** + * cellRenderer + */ + protected TableCellRenderer cellRenderer; + + /** + * cellEditor + */ + protected TableCellEditor cellEditor; + + /** + * isResizable + */ + protected boolean isResizable = true; + + /** + * resizedPostingDisableCount + */ + protected transient int resizedPostingDisableCount; + + /** + * changeSupport + */ + private SwingPropertyChangeSupport changeSupport = new SwingPropertyChangeSupport(this); + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TableColumn + */ + public TableColumn() { + this(0, 75, null, null); + } // TableColumn() + + /** + * Constructor TableColumn + * @param modelIndex TODO + */ + public TableColumn(int modelIndex) { + this(modelIndex, 75, null, null); + } // TableColumn() + + /** + * Constructor TableColumn + * @param modelIndex TODO + * @param width TODO + */ + public TableColumn(int modelIndex, int width) { + this(modelIndex, width, null, null); + } // TableColumn() + + /** + * Constructor TableColumn + * @param modelIndex TODO + * @param width TODO + * @param cellRenderer TODO + * @param cellEditor TODO + */ + public TableColumn(int modelIndex, int width, + TableCellRenderer cellRenderer, TableCellEditor cellEditor) { + this.modelIndex = modelIndex; + this.width = width; + this.preferredWidth = width; + this.cellRenderer = cellRenderer; + this.cellEditor = cellEditor; + this.headerValue = null; + this.identifier = null; + } // TableColumn() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * firePropertyChange + * @param property TODO + * @param oldValue TODO + * @param newValue TODO + */ + private void firePropertyChange(String property, Object oldValue, Object newValue) { + changeSupport.firePropertyChange(property, oldValue, newValue); + } // firePropertyChange() + + /** + * firePropertyChange + * @param property TODO + * @param oldValue TODO + * @param newValue TODO + */ + private void firePropertyChange(String property, int oldValue, int newValue) { + firePropertyChange(property, new Integer(oldValue), new Integer(newValue)); + } // firePropertyChange() + + /** + * firePropertyChange + * @param property TODO + * @param oldValue TODO + * @param newValue TODO + */ + private void firePropertyChange(String property, boolean oldValue, boolean newValue) { + firePropertyChange(property, new Boolean(oldValue), new Boolean(newValue)); + } // firePropertyChange() + + /** + * setModelIndex + * @param modelIndex TODO + */ + public void setModelIndex(int modelIndex) { + this.modelIndex = modelIndex; + } // setModelIndex() + + /** + * getModelIndex + * @returns int + */ + public int getModelIndex() { + return modelIndex; + } // getModelIndex() + + /** + * setIdentifier + * @param identifier TODO + */ + public void setIdentifier(Object identifier) { + this.identifier = identifier; + } // setIdentifier() + + /** + * getIdentifier + * @returns Object + */ + public Object getIdentifier() { + if (identifier == null) { + return getHeaderValue(); + } // if + return identifier; + } // getIdentifier() + + /** + * setHeaderValue + * @param headerValue TODO + */ + public void setHeaderValue(Object headerValue) { + + // Variables + Object oldValue; + + // Get Old Value + oldValue = this.headerValue; + + // Set Propeprty + this.headerValue = headerValue; + + // Notify Listeners of change + firePropertyChange(HEADER_VALUE_PROPERTY, + oldValue, headerValue); + + } // setHeaderValue() + + /** + * getHeaderValue + * @returns Object + */ + public Object getHeaderValue() { + return headerValue; + } // getHeaderValue() + + /** + * setHeaderRenderer + * @param headerRenderer TODO + */ + public void setHeaderRenderer(TableCellRenderer headerRenderer) { + + // Variables + TableCellRenderer oldRenderer; + + // Get Old Renderer + oldRenderer = this.headerRenderer; + + // Set Property + this.headerRenderer = headerRenderer; + + // Notify Listeners of change + firePropertyChange(HEADER_RENDERER_PROPERTY, + oldRenderer, headerRenderer); + + } // setHeaderRenderer() + + /** + * getHeaderRenderer + * @returns TableCellRenderer + */ + public TableCellRenderer getHeaderRenderer() { + return headerRenderer; + } // getHeaderRenderer() + + /** + * setCellRenderer + * @param cellRenderer TODO + */ + public void setCellRenderer(TableCellRenderer cellRenderer) { + + // Variables + TableCellRenderer oldRenderer; + + // Get Old Renderer + oldRenderer = this.cellRenderer; + + // Set Property + this.cellRenderer = cellRenderer; + + // Notify Listeners of change + firePropertyChange(CELL_RENDERER_PROPERTY, + oldRenderer, cellRenderer); + + } // setCellRenderer() + + /** + * getCellRenderer + * @returns TableCellRenderer + */ + public TableCellRenderer getCellRenderer() { + return cellRenderer; + } // getCellRenderer() + + /** + * setCellEditor + * @param cellEditor TODO + */ + public void setCellEditor(TableCellEditor cellEditor) { + this.cellEditor = cellEditor; + } // setCellEditor() + + /** + * getCellEditor + * @returns TableCellEditor + */ + public TableCellEditor getCellEditor() { + return cellEditor; + } // getCellEditor() + + /** + * setWidth + * @param width TODO + */ + public void setWidth(int width) { + + // Variables + int oldWidth; + + // Get Old Width + oldWidth = this.width; + + // Adjust Width within Limits + if (width < minWidth) { + this.width = minWidth; + } else if (width > maxWidth) { + this.width = maxWidth; + } else { + this.width = width; + } // if + + // Fire Property Change + firePropertyChange(COLUMN_WIDTH_PROPERTY, oldWidth, this.width); + + } // setWidth() + + /** + * getWidth + * @returns int + */ + public int getWidth() { + return width; + } // getWidth() + + /** + * setPreferredWidth + * @param preferredWidth TODO + */ + public void setPreferredWidth(int preferredWidth) { + if (preferredWidth < minWidth) { + this.preferredWidth = minWidth; + } else if (preferredWidth > maxWidth) { + this.preferredWidth = maxWidth; + } else { + this.preferredWidth = preferredWidth; + } // if + } // setPreferredWidth() + + /** + * getPreferredWidth + * @returns int + */ + public int getPreferredWidth() { + return preferredWidth; + } // getPreferredWidth() + + /** + * setMinWidth + * @param minWidth TODO + */ + public void setMinWidth(int minWidth) { + this.minWidth = minWidth; + setWidth(getWidth()); + setPreferredWidth(getPreferredWidth()); + } // setMinWidth() + + /** + * getMinWidth + * @returns int + */ + public int getMinWidth() { + return minWidth; + } // getMinWidth() + + /** + * setMaxWidth + * @param maxWidth TODO + */ + public void setMaxWidth(int maxWidth) { + this.maxWidth = maxWidth; + setWidth(getWidth()); + setPreferredWidth(getPreferredWidth()); + } // setMaxWidth() + + /** + * getMaxWidth + * @returns int + */ + public int getMaxWidth() { + return maxWidth; + } // getMaxWidth() + + /** + * setResizable + * @param isResizable TODO + */ + public void setResizable(boolean isResizable) { + this.isResizable = isResizable; + } // setResizable() + + /** + * getResizable + * @returns boolean + */ + public boolean getResizable() { + return isResizable; + } // getResizable() + + /** + * sizeWidthToFit + */ + public void sizeWidthToFit() { + // TODO + } // sizeWidthToFit() + + /** + * disableResizedPosting + */ + public void disableResizedPosting() { + // Does nothing + } // disableResizedPosting() + + /** + * enableResizedPosting + */ + public void enableResizedPosting() { + // Does nothing + } // enableResizedPosting() + + /** + * addPropertyChangeListener + * @param listener TODO + */ + public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { + changeSupport.addPropertyChangeListener(listener); + } // addPropertyChangeListener() + + /** + * removePropertyChangeListener + * @param listener TODO + */ + public synchronized void removePropertyChangeListener(PropertyChangeListener listener) { + changeSupport.removePropertyChangeListener(listener); + } // removePropertyChangeListener() + + /** + * createDefaultHeaderRenderer + * @returns TableCellRenderer + */ + protected TableCellRenderer createDefaultHeaderRenderer() { + return new DefaultTableCellRenderer(); + } // createDefaultHeaderRenderer() + + + } // TableColumn diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/TableColumnModel.java gcc-3.3/libjava/javax/swing/table/TableColumnModel.java *** gcc-3.2.3/libjava/javax/swing/table/TableColumnModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/TableColumnModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,167 ---- + /* TableColumnModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import java.util.Enumeration; + import javax.swing.ListSelectionModel; + import javax.swing.event.TableColumnModelListener; + + /** + * TableColumnModel interface + * @author Andrew Selkirk + */ + public interface TableColumnModel { + + /** + * addColumn + * @param column TableColumn + */ + public void addColumn(TableColumn column); + + /** + * removeColumn + * @param column TableColumn + */ + public void removeColumn(TableColumn column); + + /** + * moveColumn + * @param columnIndex Index of column to move + * @param newIndex New index of column + */ + public void moveColumn(int columnIndex, int newIndex); + + /** + * setColumnMargin + * @param margin Margin of column + */ + public void setColumnMargin(int margin); + + /** + * getColumnCount + * @returns Column count + */ + public int getColumnCount(); + + /** + * getColumns + * @returns Enumeration of columns + */ + public Enumeration getColumns(); + + /** + * getColumnIndex + * @param columnIdentifier Column id + */ + public int getColumnIndex(Object columnIdentifier); + + /** + * getColumn + * @param columnIndex Index of column + */ + public TableColumn getColumn(int columnIndex); + + /** + * getColumnMargin + * @returns Column margin + */ + public int getColumnMargin(); + + /** + * getColumnIndexAtX + * @returns Column index as position x + */ + public int getColumnIndexAtX(int xPosition); + + /** + * getTotalColumnWidth + * @returns Total column width + */ + public int getTotalColumnWidth(); + + /** + * setColumnSelectionAllowed + * @param value Set column selection + */ + public void setColumnSelectionAllowed(boolean value); + + /** + * getColumnSelectionAllowed + * @returns true if column selection allowed, false otherwise + */ + public boolean getColumnSelectionAllowed(); + + /** + * getSelectedColumns + * @returns Selected columns + */ + public int[] getSelectedColumns(); + + /** + * getSelectedColumnCount + * @returns Count of selected columns + */ + public int getSelectedColumnCount(); + + /** + * setSelectionModel + * @param model ListSelectionModel + */ + public void setSelectionModel(ListSelectionModel model); + + /** + * getSelectionModel + * @param column TableColumn + */ + public ListSelectionModel getSelectionModel(); + + /** + * addColumnModelListener + * @param listener TableColumnModelListener + */ + public void addColumnModelListener(TableColumnModelListener listener); + + /** + * removeColumnModelListener + * @param listener TableColumnModelListener + */ + public void removeColumnModelListener(TableColumnModelListener listener); + + + } // TableColumnModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/table/TableModel.java gcc-3.3/libjava/javax/swing/table/TableModel.java *** gcc-3.2.3/libjava/javax/swing/table/TableModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/table/TableModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,112 ---- + /* TableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.table; + + // Imports + import javax.swing.event.TableModelListener; + + /** + * TableModel interface + * @author Andrew Selkirk + */ + public interface TableModel { + + /** + * getRowCount + * @returns row count + */ + public int getRowCount(); + + /** + * getColumnCount + * @returns column count + */ + public int getColumnCount(); + + /** + * getColumnName + * @param columnIndex Column index + * @returns Column name + */ + public String getColumnName(int columnIndex); + + /** + * getColumnClass + * @param columnIndex Column index + * @returns Column class + */ + public Class getColumnClass(int columnIndex); + + /** + * isCellEditable + * @param rowIndex Row index + * @param columnIndex Column index + * @returns true if editable, false otherwise + */ + public boolean isCellEditable(int rowIndex, int columnIndex); + + /** + * getValueAt + * @param rowIndex Row index + * @param columnIndex Column index + * @returns Value at specified indices + */ + public Object getValueAt(int rowIndex, int columnIndex); + + /** + * setValueAt + * @param aValue Value to set + * @param rowIndex Row index + * @param columnIndex Column index + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex); + + /** + * addTableModelListener + * @param listener TableModelListener + */ + public void addTableModelListener(TableModelListener listener); + + /** + * removeTableModelListener + * @param listener TableModelListener + */ + public void removeTableModelListener(TableModelListener listener); + + + } // TableModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/AbstractDocument.java gcc-3.3/libjava/javax/swing/text/AbstractDocument.java *** gcc-3.2.3/libjava/javax/swing/text/AbstractDocument.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/AbstractDocument.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,360 ---- + /* AbstractDocument.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import javax.swing.event.*; + import javax.swing.undo.*; + import java.util.*; + import javax.swing.tree.*; + + public abstract class AbstractDocument implements Document + { + Vector doc_list = new Vector(); + Vector undo_list = new Vector(); + + // these still need to be implemented by a derived class: + public abstract Element getParagraphElement(int pos); + public abstract Element getDefaultRootElement(); + + // some inner classes sun says I should have: + abstract class AbstractElement implements Element, TreeNode + { + int count, offset; + AttributeSet attr; + Vector elts = new Vector(); + String name; + Element parent; + Vector kids = new Vector(); + TreeNode tree_parent; + + public AbstractElement(Element p, AttributeSet s) + { parent = p; attr = s; } + + public Enumeration children() { return kids.elements(); } + public boolean getAllowsChildren() { return true; } + public TreeNode getChildAt(int index) { return (TreeNode) kids.elementAt(index); } + public int getChildCount() { return kids.size(); } + public int getIndex(TreeNode node) { return kids.indexOf(node); } + public TreeNode getParent() { return tree_parent; } + + public AttributeSet getAttributes() { return attr; } + public Document getDocument() { return AbstractDocument.this; } + public Element getElement(int index) { return (Element)elts.elementAt(index); } + public String getName() { return name; } + public Element getParentElement() { return parent; } + + public abstract boolean isLeaf(); + public abstract int getEndOffset(); + public abstract int getElementCount(); + public abstract int getElementIndex(int offset); + public abstract int getStartOffset(); + } + + interface AttributeContext + { + } + + + class BranchElement extends AbstractElement + { + public BranchElement(Element e, AttributeSet a, int s, int end) + { super(e, a); } + + public boolean isLeaf() { return false; } + public int getEndOffset() { return 0; } + public int getElementCount() { return 0; } + public int getElementIndex(int offset) { return 0; } + public int getStartOffset() { return 0; } + } + + public interface Content + { + public Position createPosition(int offset) throws BadLocationException; + public int length(); + public UndoableEdit insertString(int where, String str) throws BadLocationException; + public UndoableEdit remove(int where, int nitems) throws BadLocationException; + public String getString(int where, int len) throws BadLocationException; + public void getChars(int where, int len, Segment txt) throws BadLocationException; + } + + class DefaultDocumentEvent implements DocumentEvent + { + int len, off; + public Document getDocument() { return AbstractDocument.this; } + public int getLength() { return len; } + public int getOffset() { return off; } + public DocumentEvent.EventType getType() { return null; } + public DocumentEvent.ElementChange getChange(Element elem) { return null; } + } + + static class ElementEdit + { + } + + class LeafElement extends AbstractElement + { + LeafElement(Element e, AttributeSet a, int s, int end) + { super(e, a); } + + public boolean isLeaf() { return true; } + public int getEndOffset() { return 0; } + public int getElementCount() { return 0; } + public int getElementIndex(int offset) { return 0; } + public int getStartOffset() { return 0; } + } + + + Content content; + + AbstractDocument(Content doc) + { + content = doc; + } + + /******************************************************** + * + * the meat: + * + ***********/ + + + public void addDocumentListener(DocumentListener listener) + { + doc_list.addElement(listener); + } + + public void addUndoableEditListener(UndoableEditListener listener) + { + undo_list.addElement(listener); + } + + protected Element createBranchElement(Element parent, AttributeSet a) + { + return new BranchElement(parent, a, 0, 0); + } + + protected Element createLeafElement(Element parent, AttributeSet a, int p0, int p1) + { + return new LeafElement(parent, a, p0, p1-p0); + } + + public Position createPosition(int offs) + { + final int a = offs; + return new Position() + { + public int getOffset() + { + return a; + } + }; + } + + protected void fireChangedUpdate(DocumentEvent e) + { + } + + protected void fireInsertUpdate(DocumentEvent e) + { + } + + protected void fireRemoveUpdate(DocumentEvent e) + { + } + + protected void fireUndoableEditUpdate(UndoableEditEvent e) + { + } + int getAsynchronousLoadPriority() + { + return 0; + } + + protected AttributeContext getAttributeContext() + { + return null; + } + + Element getBidiRootElement() + { + return null; + } + + protected Content getContent() + { + return content; + } + + protected Thread getCurrentWriter() + { + return null; + } + + + Dictionary getDocumentProperties() + { + return null; + } + + public Position getEndPosition() + { + return null; + } + + public int getLength() + { + return content.length(); + } + + EventListener[] getListeners(Class listenerType) + { + return null; + } + + public Object getProperty(Object key) + { + return null; + } + + public Element[] getRootElements() + { + return null; + } + + public Position getStartPosition() + { + return null; + } + + public String getText(int offset, int length) + { + try { + return content.getString(offset, length); + } catch (Exception e) { + System.out.println("Hmmm, fail to getText: " + offset + " -> " + length); + return null; + } + } + + public void getText(int offset, int length, Segment txt) + { + String a = getText(offset, length); + + if (a == null) + { + txt.offset = 0; + txt.count = 0; + txt.array = new char[0]; + return; + } + + txt.offset = offset; + txt.count = length; + + char chars[] = new char[ a.length() ]; + + a.getChars(0, a.length(), chars, 0); + + txt.array = chars; + } + + public void insertString(int offs, String str, AttributeSet a) + { + try { + content.insertString(offs, str); + } catch (Exception e) { + System.err.println("FAILED TO INSERT-STRING: " + e + ", at:"+offs); + } + } + + protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr) + { + } + + protected void postRemoveUpdate(DefaultDocumentEvent chng) + { + } + + public void putProperty(Object key, Object value) + { + } + + void readLock() + { + } + + void readUnlock() + { + } + + public void remove(int offs, int len) + { + } + + public void removeDocumentListener(DocumentListener listener) + { + } + + public void removeUndoableEditListener(UndoableEditListener listener) + { + } + + protected void removeUpdate(DefaultDocumentEvent chng) + { + } + + public void render(Runnable r) + { + } + + void setAsynchronousLoadPriority(int p) + { + } + + void setDocumentProperties(Dictionary x) + { + } + + protected void writeLock() + { + } + + protected void writeUnlock() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/AttributeSet.java gcc-3.3/libjava/javax/swing/text/AttributeSet.java *** gcc-3.2.3/libjava/javax/swing/text/AttributeSet.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/AttributeSet.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* AttributeSet.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import java.util.*; + + + public interface AttributeSet + { + boolean containsAttribute(Object name, Object value); + boolean containsAttributes(AttributeSet attributes); + AttributeSet copyAttributes(); + Object getAttribute(Object key); + int getAttributeCount(); + Enumeration getAttributeNames(); + AttributeSet getResolveParent(); + boolean isDefined(Object attrName); + boolean isEqual(AttributeSet attr); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/BadLocationException.java gcc-3.3/libjava/javax/swing/text/BadLocationException.java *** gcc-3.2.3/libjava/javax/swing/text/BadLocationException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/BadLocationException.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,46 ---- + /* BadLocationException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + + public class BadLocationException extends Exception + { + BadLocationException() + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/Caret.java gcc-3.3/libjava/javax/swing/text/Caret.java *** gcc-3.2.3/libjava/javax/swing/text/Caret.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/Caret.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* Caret.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import java.awt.*; + import javax.swing.event.*; + + public interface Caret + { + void addChangeListener(ChangeListener l); + void deinstall(JTextComponent c); + int getBlinkRate(); + int getDot(); + Point getMagicaretPosition(); + int getMark(); + void install(JTextComponent c); + boolean isSelectionVisible(); + boolean isVisible(); + void moveDot(int dot); + void paint(Graphics g); + void removeChangeListener(ChangeListener l); + void setBlinkRate(int rate); + void setDot(int dot); + void setMagicCaretPosition(Point p); + void setSelectionVisible(boolean v); + void setVisible(boolean v); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/CharacterIterator.java gcc-3.3/libjava/javax/swing/text/CharacterIterator.java *** gcc-3.2.3/libjava/javax/swing/text/CharacterIterator.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/CharacterIterator.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,53 ---- + /* CharacterIterator.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + + public interface CharacterIterator extends Cloneable + { + Object clone(); + char current(); + char first(); + int getBeginIndex(); + int getEndIndex(); + int getIndex(); + char last(); + char next(); + char previous(); + char setIndex(int position); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/ComponentView.java gcc-3.3/libjava/javax/swing/text/ComponentView.java *** gcc-3.2.3/libjava/javax/swing/text/ComponentView.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/ComponentView.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,101 ---- + /* ComponentView.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import java.awt.*; + + public class ComponentView extends View + { + public ComponentView(Element elem) + { + super(elem); + } + + + protected Component createComponent() + { + return null; + } + + public float getAlignment(int axis) + { + return 0; + } + + public Component getComponent() + { + return null; + } + + public float getMaximumSpan(int axis) + { + return 0; + } + + public float getMinimumSpan(int axis) + { + return 0; + } + + public float getPreferredSpan(int axis) + { + return 0; + } + + public Shape modelToView(int pos, Shape a, Position.Bias b) + { + return null; + } + + public void paint(Graphics g, Shape a) + { + } + + public void setParent(View p) + { + } + + public void setSize(float width, float height) + { + } + + public int viewToModel(float x, float y, Shape a, Position.Bias[] bias) + { + return 0; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/DefaultCaret.java gcc-3.3/libjava/javax/swing/text/DefaultCaret.java *** gcc-3.2.3/libjava/javax/swing/text/DefaultCaret.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/DefaultCaret.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,172 ---- + /* DefaultCaret.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import java.awt.*; + import java.util.*; + import java.awt.event.*; + import javax.swing.event.*; + + + public class DefaultCaret extends Rectangle implements Caret, FocusListener, MouseListener, MouseMotionListener + { + Color color = new Color(0,0,0); + JTextComponent parent; + + public void mouseDragged(java.awt.event.MouseEvent evt) + { + } + + public void mouseMoved(java.awt.event.MouseEvent evt) + { + } + + public void mouseClicked(java.awt.event.MouseEvent evt) + { + } + + public void mouseEntered(java.awt.event.MouseEvent evt) + { + } + + public void mouseExited(java.awt.event.MouseEvent evt) + { + } + + public void mousePressed(java.awt.event.MouseEvent evt) + { + } + + public void mouseReleased(java.awt.event.MouseEvent evt) + { + } + + public void focusGained(java.awt.event.FocusEvent evt) + { + } + + public void focusLost(java.awt.event.FocusEvent evt) + { + } + + // caret methods: + + public void deinstall(JTextComponent c) + { + parent.removeFocusListener(this); + parent.removeMouseListener(this); + + parent = null; + } + public void install(JTextComponent c) + { + parent.addFocusListener(this); + parent.addMouseListener(this); + parent = c; + repaint(); + } + + Point magic = null; + public void setMagicCaretPosition(Point p) + { magic = p; } + public Point getMagicaretPosition() + { return magic; } + + + int mark = 0; + public int getMark() + { return mark; } + + boolean vis_sel = true; + public void setSelectionVisible(boolean v) + { vis_sel = v; repaint(); } + public boolean isSelectionVisible() + { return vis_sel; } + + private void repaint() + { + if (parent != null) + { + parent.repaint(); + } + } + + public void paint(Graphics g) + { + g.setColor(color); + g.drawLine(x,y, + x,y+height); + } + + + Vector changes = new Vector(); + public void addChangeListener(ChangeListener l) + { changes.addElement(l); } + public void removeChangeListener(ChangeListener l) + { changes.removeElement(l); } + + + int blink = 500; + public int getBlinkRate() + { return blink; } + public void setBlinkRate(int rate) + { blink = rate; } + + int dot = 0; + public int getDot() + { return dot; } + public void moveDot(int dot) + { setDot(dot); } + public void setDot(int dot) + { + this.dot = dot; + repaint(); + } + + boolean vis = true; + public boolean isVisible() + { return vis; } + public void setVisible(boolean v) + { + vis = v; + repaint(); + } + } + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/DefaultEditorKit.java gcc-3.3/libjava/javax/swing/text/DefaultEditorKit.java *** gcc-3.2.3/libjava/javax/swing/text/DefaultEditorKit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/DefaultEditorKit.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,89 ---- + /* DefaultEditorKit.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import javax.swing.*; + import java.io.*; + + public class DefaultEditorKit extends EditorKit + { + void deinstall(JEditorPane c) + { + // Called when the kit is being removed from the JEditorPane. + } + void install(JEditorPane c) + { + } + + Caret createCaret() + { + return null; + } + Document createDefaultDocument() + { + return new PlainDocument(); + } + + Action[] getActions() + { + return null; + } + + String getContentType() + { + return "text/plain"; + } + + ViewFactory getViewFactory() + { + return null; + } + void read(InputStream in, Document doc, int pos) + { + } + void read(Reader in, Document doc, int pos) + { + } + void write(OutputStream out, Document doc, int pos, int len) + { + } + void write(Writer out, Document doc, int pos, int len) + { + } + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/Document.java gcc-3.3/libjava/javax/swing/text/Document.java *** gcc-3.2.3/libjava/javax/swing/text/Document.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/Document.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* Document.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + + import javax.swing.event.*; + + public interface Document + { + void addDocumentListener(DocumentListener listener); + void addUndoableEditListener(UndoableEditListener listener); + Position createPosition(int offs); + Element getDefaultRootElement(); + Position getEndPosition(); + int getLength(); + Object getProperty(Object key); + Element[] getRootElements(); + Position getStartPosition(); + String getText(int offset, int length); + void getText(int offset, int length, Segment txt); + void insertString(int offset, String str, AttributeSet a); + void putProperty(Object key, Object value); + void remove(int offs, int len); + void removeDocumentListener(DocumentListener listener); + void removeUndoableEditListener(UndoableEditListener listener); + void render(Runnable r); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/EditorKit.java gcc-3.3/libjava/javax/swing/text/EditorKit.java *** gcc-3.2.3/libjava/javax/swing/text/EditorKit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/EditorKit.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,71 ---- + /* EditorKit.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import javax.swing.*; + import java.io.*; + + public abstract class EditorKit implements Cloneable + { + EditorKit() + { + } + + EditorKit(EditorKit kit) + { + } + + void deinstall(JEditorPane c) + { + // Called when the kit is being removed from the JEditorPane. + } + void install(JEditorPane c) + { + } + + abstract Caret createCaret(); + abstract Document createDefaultDocument(); + abstract Action[] getActions(); + abstract String getContentType(); + abstract ViewFactory getViewFactory(); + abstract void read(InputStream in, Document doc, int pos); + abstract void read(Reader in, Document doc, int pos); + abstract void write(OutputStream out, Document doc, int pos, int len); + abstract void write(Writer out, Document doc, int pos, int len); + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/Element.java gcc-3.3/libjava/javax/swing/text/Element.java *** gcc-3.2.3/libjava/javax/swing/text/Element.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/Element.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* Element.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + + + public interface Element + { + AttributeSet getAttributes(); + Document getDocument(); + Element getElement(int index); + int getElementCount(); + int getElementIndex(int offset); + int getEndOffset(); + String getName(); + Element getParentElement(); + int getStartOffset(); + boolean isLeaf(); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/GapContent.java gcc-3.3/libjava/javax/swing/text/GapContent.java *** gcc-3.2.3/libjava/javax/swing/text/GapContent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/GapContent.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,104 ---- + /* GapContent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + // too lazy to make a real gapcontent. + // lets just use a stringbuffer instead. + + import javax.swing.undo.*; + + + public class GapContent implements AbstractDocument.Content + { + StringBuffer buf = new StringBuffer(); + + public GapContent() + { + this(10); + } + + public GapContent(int size) + { + } + + public Position createPosition(final int offset) throws BadLocationException + { + return new Position() + { + int off = offset; + public int getOffset() + { + return off; + } + }; + } + + public int length() + { + return buf.length(); + } + + public UndoableEdit insertString(int where, String str) throws BadLocationException + { + buf.insert(where, str); + return null; + } + + public UndoableEdit remove(int where, int nitems) throws BadLocationException + { + buf.delete(where, where + nitems); + return null; + } + + public String getString(int where, int len) throws BadLocationException + { + return buf.toString(); + } + + public void getChars(int where, int len, Segment txt) throws BadLocationException + { + txt.array = new char[len]; + + System.arraycopy(buf.toString().toCharArray(), where, + txt.array, 0, + len); + + txt.count = len; + txt.offset = 0; + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/html/HTML.java gcc-3.3/libjava/javax/swing/text/html/HTML.java *** gcc-3.2.3/libjava/javax/swing/text/html/HTML.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/html/HTML.java 2002-08-09 08:34:16.000000000 +0000 *************** *** 0 **** --- 1,67 ---- + /* HTML.java -- HTML document tag constants + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text.html; + + import java.io.Serializable; + + /** + * Stub implementation. + * Just enough to get gjdoc working. + * + * @author Mark Wielaard (mark@klomp.org) + */ + public class HTML + { + public static class Tag + { + private final String id; + + protected Tag(String id) + { + this.id = id; + } + } + + public static class UnknownTag extends Tag implements Serializable + { + public UnknownTag(String id) + { + super(id); + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/html/parser/ParserDelegator.java gcc-3.3/libjava/javax/swing/text/html/parser/ParserDelegator.java *** gcc-3.2.3/libjava/javax/swing/text/html/parser/ParserDelegator.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/html/parser/ParserDelegator.java 2002-08-09 08:34:17.000000000 +0000 *************** *** 0 **** --- 1,46 ---- + /* ParserDelegator - Delegator for ParserDocument. + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text.html.parser; + + /** + * Stub implementeation to get gjdoc working. + */ + //public class ParserDelegator extends HTMLEditorKit.Parser + public class ParserDelegator + { + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/JTextComponent.java gcc-3.3/libjava/javax/swing/text/JTextComponent.java *** gcc-3.2.3/libjava/javax/swing/text/JTextComponent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/JTextComponent.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,497 ---- + /* JTextComponent.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import java.awt.AWTEvent; + import java.awt.Component; + import java.awt.Dimension; + import java.awt.Image; + import java.awt.Rectangle; + import java.awt.Point; + import javax.accessibility.*; + import javax.swing.Icon; + import javax.swing.JComponent; + import javax.swing.KeyStroke; + import javax.swing.Scrollable; + import javax.swing.UIManager; + import javax.swing.event.*; + import javax.swing.plaf.TextUI; + + public abstract class JTextComponent extends JComponent + implements Scrollable, Accessible + { + // public class AccessibleJTextComponent extends AccessibleJComponent + // implements AccessibleText, CaretListener, DocumentListener, + // AccessibleAction, AccessibleEditableText + // { + // } // class AccessibleJTextComponent + + /** + * AccessibleJTextComponent + */ + public class AccessibleJTextComponent extends AccessibleJComponent + implements AccessibleText, CaretListener, DocumentListener { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * caretPos + */ + int caretPos; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AccessibleJTextComponent + * @param component TODO + */ + public AccessibleJTextComponent(JTextComponent component) { + super(component); + // TODO + } // AccessibleJTextComponent() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getCaretPosition + * @returns int + */ + public int getCaretPosition() { + return 0; // TODO + } // getCaretPosition() + + /** + * getSelectedText + * @returns String + */ + public String getSelectedText() { + return null; // TODO + } // getSelectedText() + + /** + * getSelectionStart + * @returns int + */ + public int getSelectionStart() { + return 0; // TODO + } // getSelectionStart() + + /** + * getSelectionEnd + * @returns int + */ + public int getSelectionEnd() { + return 0; // TODO + } // getSelectionEnd() + + /** + * caretUpdate + * @param value0 TODO + */ + public void caretUpdate(CaretEvent value0) { + // TODO + } // caretUpdate() + + /** + * getAccessibleStateSet + * @returns AccessibleStateSet + */ + public AccessibleStateSet getAccessibleStateSet() { + return null; // TODO + } // getAccessibleStateSet() + + /** + * getAccessibleRole + * @returns AccessibleRole + */ + public AccessibleRole getAccessibleRole() { + return null; // TODO + } // getAccessibleRole() + + /** + * getAccessibleText + * @returns AccessibleText + */ + public AccessibleText getAccessibleText() { + return null; // TODO + } // getAccessibleText() + + /** + * insertUpdate + * @param value0 TODO + */ + public void insertUpdate(DocumentEvent value0) { + // TODO + } // insertUpdate() + + /** + * removeUpdate + * @param value0 TODO + */ + public void removeUpdate(DocumentEvent value0) { + // TODO + } // removeUpdate() + + /** + * changedUpdate + * @param value0 TODO + */ + public void changedUpdate(DocumentEvent value0) { + // TODO + } // changedUpdate() + + /** + * getIndexAtPoint + * @param value0 TODO + * @returns int + */ + public int getIndexAtPoint(Point value0) { + return 0; // TODO + } // getIndexAtPoint() + + /** + * getRootEditorRect + * @returns Rectangle + */ + Rectangle getRootEditorRect() { + return null; // TODO + } // getRootEditorRect() + + /** + * getCharacterBounds + * @param value0 TODO + * @returns Rectangle + */ + public Rectangle getCharacterBounds(int value0) { + return null; // TODO + } // getCharacterBounds() + + /** + * getCharCount + * @returns int + */ + public int getCharCount() { + return 0; // TODO + } // getCharCount() + + /** + * getCharacterAttribute + * @param value0 TODO + * @returns AttributeSet + */ + public AttributeSet getCharacterAttribute(int value0) { + return null; // TODO + } // getCharacterAttribute() + + /** + * getAtIndex + * @param value0 TODO + * @param value1 TODO + * @returns String + */ + public String getAtIndex(int value0, int value1) { + return null; // TODO + } // getAtIndex() + + /** + * getAfterIndex + * @param value0 TODO + * @param value1 TODO + * @returns String + */ + public String getAfterIndex(int value0, int value1) { + return null; // TODO + } // getAfterIndex() + + /** + * getBeforeIndex + * @param value0 TODO + * @param value1 TODO + * @returns String + */ + public String getBeforeIndex(int value0, int value1) { + return null; // TODO + } // getBeforeIndex() + + + } // AccessibleJTextComponent + + + + public static class KeyBinding + { + public KeyStroke key; + public String actionName; + public KeyBinding(KeyStroke key, String actionName) + { + this.key = key; + this.actionName = actionName; + } + } // class KeyBinding + + int icon_gap; + Icon icon; + int align; + Document doc; + + public JTextComponent() + { + this("", null, 0); + } + + public JTextComponent(Icon image) + { + this("", image, 0); + } + + public JTextComponent(Icon image, int horizontalAlignment) + { + this("", image, horizontalAlignment); + } + + public JTextComponent(String text) + { + this(text, null, 0); + } + + public JTextComponent(String text, int horizontalAlignment) + { + this(text, null, horizontalAlignment); + } + + public JTextComponent(String text, Icon icon, int horizontalAlignment) + { + setDocument(new PlainDocument()); + + // do the work..... + setText(text); + this.icon = icon; + this.align = horizontalAlignment; + + // its an editor, so: + enableEvents(AWTEvent.KEY_EVENT_MASK); + updateUI(); + } + + public void setDocument(Document s) + { + doc = s; + revalidate(); + repaint(); + } + + public Document getDocument() + { + if (doc == null) + System.out.println("doc == null !!!"); + return doc; + } + + protected int checkHorizontalKey(int key, String message) + { + // Verify that key is a legal value for the horizontalAlignment properties. + return 0; + } + protected int checkVerticalKey(int key, String message) + { + // Verify that key is a legal value for the verticalAlignment or verticalTextPosition properties. + return 0; + } + public AccessibleContext getAccessibleContext() + { + // Get the AccessibleContext of this object + return null; + } + public Icon getDisabledIcon() + { + return null; + } + public int getDisplayedMnemonic() + { + // Return the keycode that indicates a mnemonic key. + return 0; + } + public int getHorizontalAlignment() + { + // Returns the alignment of the label's contents along the X axis. + return 0; + } + public int getHorizontalTextPosition() + { + // Returns the horizontal position of the label's text, relative to its image. + return 0; + } + + public Icon getIcon() + { return icon; } + public int getIconTextGap() + { return icon_gap; } + + + Component getLabelFor() + { + // Get the component this is labelling. + return null; + } + + public void setText(String text) + { + getDocument().remove(0,doc.getLength()); + getDocument().insertString(0, text, null); + } + + public String getText() + { + return getDocument().getText(0, + getDocument().getLength()); + } + + public String getUIClassID() + { + // Returns a string that specifies the name of the l&f class that renders this component. + return "JTextComponent"; + } + public int getVerticalAlignment() + { + // Returns the alignment of the label's contents along the Y axis. + return 0; + } + public int getVerticalTextPosition() + { + // Returns the vertical position of the label's text, relative to its image. + return 0; + } + + public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) + { + // This is overriden to return false if the current Icon's Image is not equal to the passed in Image img. + return (img == icon); + } + protected String paramString() + { + // Returns a string representation of this JTextComponent. + return "JTextComponent"; + } + void setDisabledIcon(Icon disabledIcon) + { + // Set the icon to be displayed if this JTextComponent is "disabled" (JTextComponent.setEnabled(false)). + } + void setDisplayedMnemonic(char aChar) + { + // Specifies the displayedMnemonic as a char value. + } + void setDisplayedMnemonic(int key) + { + // Specify a keycode that indicates a mnemonic key. + } + void setHorizontalAlignment(int alignment) + { + // Sets the alignment of the label's contents along the X axis. + } + void setHorizontalTextPosition(int textPosition) + { + // Sets the horizontal position of the label's text, relative to its image. + } + void setIcon(Icon icon) + { + // Defines the icon this component will display. + } + public void setIconTextGap(int iconTextGap) + { + // If both the icon and text properties are set, this property defines the space between them. + } + + public void setLabelFor(Component c) + { + // Set the component this is labelling. + } + + public void setVerticalAlignment(int alignment) + { + // Sets the alignment of the label's contents along the Y axis. + } + public void setVerticalTextPosition(int textPosition) + { + // Sets the vertical position of the label's text, relative to its image. + } + + public TextUI getUI() + { return (TextUI) ui; + } + + public void updateUI() + { + TextUI b = (TextUI)UIManager.getUI(this); + setUI(b); + } + + public Dimension getPreferredScrollableViewportSize() + { + return null; + } + public int getScrollableUnitIncrement(Rectangle visible, int orientation, + int direction) + { + return 0; + } + public int getScrollableBlockIncrement(Rectangle visible, int orientation, + int direction) + { + return 0; + } + } // class JTextComponent + + + + + + + + + + + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/Keymap.java gcc-3.3/libjava/javax/swing/text/Keymap.java *** gcc-3.2.3/libjava/javax/swing/text/Keymap.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/Keymap.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,59 ---- + /* Keymap.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import javax.swing.*; + + public interface Keymap + { + void addActionForKeyStroke(KeyStroke key, Action a); + Action getAction(KeyStroke key); + Action[] getBoundActions(); + KeyStroke[] getBoundKeyStrokes(); + Action getDefaultAction(); + KeyStroke[] getKeyStrokesForAction(Action a); + String getName(); + Keymap getResolveParent(); + boolean isLocallyDefined(KeyStroke key); + void removeBindings(); + void removeKeyStrokeBinding(KeyStroke keys); + void setDefaultAction(Action a); + void setResolveParent(Keymap parent); + } + + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/MutableAttributeSet.java gcc-3.3/libjava/javax/swing/text/MutableAttributeSet.java *** gcc-3.2.3/libjava/javax/swing/text/MutableAttributeSet.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/MutableAttributeSet.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,92 ---- + /* MutableAttributeSet.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + // Imports + import java.util.*; + + /** + * MutableAttributeSet + * @author Andrew Selkirk + * @version 1.0 + */ + public interface MutableAttributeSet extends AttributeSet { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * addAttribute + * @param name TODO + * @param value TODO + */ + public void addAttribute(Object name, Object value); + + /** + * addAttributes + * @param attributes TODO + */ + public void addAttributes(AttributeSet attributes); + + /** + * removeAttribute + * @param name TODO + */ + public void removeAttribute(Object name); + + /** + * removeAttributes + * @param names TODO + */ + public void removeAttributes(Enumeration names); + + /** + * removeAttributes + * @param attributes TODO + */ + public void removeAttributes(AttributeSet attributes); + + /** + * setResolveParent + * @param parent TODO + */ + public void setResolveParent(AttributeSet parent); + + + } // MutableAttributeSet diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/PlainDocument.java gcc-3.3/libjava/javax/swing/text/PlainDocument.java *** gcc-3.2.3/libjava/javax/swing/text/PlainDocument.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/PlainDocument.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,58 ---- + /* PlainDocument.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + + public class PlainDocument extends AbstractDocument + { + PlainDocument() + { + super(new GapContent()); + } + + public Element getDefaultRootElement() + { + return null; + } + + public Element getParagraphElement(int pos) + { + return null; + } + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/PlainEditorKit.java gcc-3.3/libjava/javax/swing/text/PlainEditorKit.java *** gcc-3.2.3/libjava/javax/swing/text/PlainEditorKit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/PlainEditorKit.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,99 ---- + /* PlainEditorKit.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import javax.swing.*; + import java.io.*; + + public class PlainEditorKit extends EditorKit + { + public PlainEditorKit() + { + } + + public PlainEditorKit(PlainEditorKit kit) + { + super(kit); + } + + protected Object clone() + { + return new PlainEditorKit(this); + } + void deinstall(JEditorPane c) + { + // Called when the kit is being removed from the JEditorPane. + } + void install(JEditorPane c) + { + } + + Caret createCaret() + { + return null; + } + Document createDefaultDocument() + { + return null; + } + Action[] getActions() + { + return null; + } + String getContentType() + { + return null; + } + ViewFactory getViewFactory() + { + return null; + } + void read(InputStream in, Document doc, int pos) + { + } + void read(Reader in, Document doc, int pos) + { + } + void write(OutputStream out, Document doc, int pos, int len) + { + } + void write(Writer out, Document doc, int pos, int len) + { + } + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/Position.java gcc-3.3/libjava/javax/swing/text/Position.java *** gcc-3.2.3/libjava/javax/swing/text/Position.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/Position.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,48 ---- + /* Position.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + + public interface Position + { + static class Bias + { + } + + int getOffset(); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/Segment.java gcc-3.3/libjava/javax/swing/text/Segment.java *** gcc-3.2.3/libjava/javax/swing/text/Segment.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/Segment.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,110 ---- + /* Segment.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import java.util.*; + + + public class Segment implements Cloneable, CharacterIterator + { + char[] array; + int count; + int offset; + + public Object clone() + { + try { + return super.clone(); + } catch (Exception e) { + System.err.println("Huuuhhh, this class implements cloneable !!!!!!"); + System.err.println("I think there is a bug in this JVM somewhere"); + } + return null; + } + + public char current() + { + return array[getIndex()]; + } + + public char first() + { + offset = getBeginIndex(); + return array[offset]; + } + + public int getBeginIndex() + { + return offset; + } + + public int getEndIndex() + { + return offset + count; + } + public int getIndex() + { + return offset; + } + public char last() + { + offset = getEndIndex() - 1; + return array[offset]; + } + public char next() + { + offset++; + return array[offset]; + } + public char previous() + { + offset--; + return array[offset]; + } + public char setIndex(int position) + { + offset = position; + return array[offset]; + } + + public String toString() + { + return new String(array, offset, count); + } + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/StyledDocument.java gcc-3.3/libjava/javax/swing/text/StyledDocument.java *** gcc-3.2.3/libjava/javax/swing/text/StyledDocument.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/StyledDocument.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,145 ---- + /* StyledDcoument.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + // Imports + import java.awt.*; + + /** + * StyledDocument + * @author Andrew Selkirk + * @version 1.0 + */ + public interface StyledDocument extends Document { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * addStyle + * @param nm TODO + * @param rent TODO + * @returns Style + */ + public Style addStyle(String nm, Style parent); + + /** + * removeStyle + * @param nm TODO + */ + public void removeStyle(String nm); + + /** + * getStyle + * @param nm TODO + * @returns Style + */ + public Style getStyle(String nm); + + /** + * setCharacterAttributes + * @param offset TODO + * @param length TODO + * @param set TODO + * @param replace TODO + */ + public void setCharacterAttributes(int offset, int length, + AttributeSet set, boolean replace); + + /** + * setParagraphAttributes + * @param offset TODO + * @param length TODO + * @param set TODO + * @param replace TODO + */ + public void setParagraphAttributes(int offset, int length, + AttributeSet set, boolean replace); + + /** + * getLogicalStyle + * @param position TODO + * @returns Style + */ + public Style getLogicalStyle(int position); + + /** + * setLogicalStyle + * @param position TODO + * @param style TODO + */ + public void setLogicalStyle(int position, Style style); + + /** + * getParagraphElement + * @param position TODO + * @returns Element + */ + public abstract Element getParagraphElement(int position); + + /** + * getCharacterElement + * @param position TODO + * @returns Element + */ + public Element getCharacterElement(int position); + + /** + * getForeground + * @param set TODO + * @returns Color + */ + public Color getForeground(AttributeSet set); + + /** + * getBackground + * @param set TODO + * @returns Color + */ + public Color getBackground(AttributeSet set); + + /** + * getFont + * @param set TODO + * @returns Font + */ + public Font getFont(AttributeSet set); + + + } // StyledDocument diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/StyledEditorKit.java gcc-3.3/libjava/javax/swing/text/StyledEditorKit.java *** gcc-3.2.3/libjava/javax/swing/text/StyledEditorKit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/StyledEditorKit.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,612 ---- + /* StyledEditorKit.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.beans.*; + import java.io.*; + import javax.swing.*; + import javax.swing.event.*; + + /** + * StyledEditorKit + * @author Andrew Selkirk + * @version 1.0 + */ + public class StyledEditorKit extends DefaultEditorKit { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * UnderlineAction + */ + public static class UnderlineAction extends StyledEditorKit.StyledTextAction { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UnderlineAction + */ + public UnderlineAction() { + super("TODO"); + // TODO + } // UnderlineAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * actionPerformed + * @param event TODO + */ + public void actionPerformed(ActionEvent event) { + // TODO + } // actionPerformed() + + + } // UnderlineAction + + /** + * ItalicAction + */ + public static class ItalicAction extends StyledEditorKit.StyledTextAction { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ItalicAction + */ + public ItalicAction() { + super("TODO"); + // TODO + } // ItalicAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * actionPerformed + * @param event TODO + */ + public void actionPerformed(ActionEvent event) { + // TODO + } // actionPerformed() + + + } // ItalicAction + + /** + * BoldAction + */ + public static class BoldAction extends StyledEditorKit.StyledTextAction { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor BoldAction + */ + public BoldAction() { + super("TODO"); + // TODO + } // BoldAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * actionPerformed + * @param event TODO + */ + public void actionPerformed(ActionEvent event) { + // TODO + } // actionPerformed() + + + } // BoldAction + + /** + * AlignmentAction + */ + public static class AlignmentAction extends StyledEditorKit.StyledTextAction { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * a + */ + private int a; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AlignmentAction + * @param nm TODO + * @param a TODO + */ + public AlignmentAction(String nm, int a) { + super("TODO"); + // TODO + } // AlignmentAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * actionPerformed + * @param event TODO + */ + public void actionPerformed(ActionEvent event) { + // TODO + } // actionPerformed() + + + } // AlignmentAction + + /** + * ForegroundAction + */ + public static class ForegroundAction extends StyledEditorKit.StyledTextAction { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * fg + */ + private Color fg; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ForegroundAction + * @param nm TODO + * @param fg TODO + */ + public ForegroundAction(String nm, Color fg) { + super("TODO"); + // TODO + } // ForegroundAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * actionPerformed + * @param event TODO + */ + public void actionPerformed(ActionEvent event) { + // TODO + } // actionPerformed() + + + } // ForegroundAction + + /** + * FontSizeAction + */ + public static class FontSizeAction extends StyledEditorKit.StyledTextAction { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * size + */ + private int size; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FontSizeAction + * @param nm TODO + * @param size TODO + */ + public FontSizeAction(String nm, int size) { + super("TODO"); + // TODO + } // FontSizeAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * actionPerformed + * @param event TODO + */ + public void actionPerformed(ActionEvent event) { + // TODO + } // actionPerformed() + + + } // FontSizeAction + + /** + * FontFamilyAction + */ + public static class FontFamilyAction extends StyledEditorKit.StyledTextAction { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * family + */ + private String family; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FontFamilyAction + * @param nm TODO + * @param family TODO + */ + public FontFamilyAction(String nm, String family) { + super("TODO"); + // TODO + } // FontFamilyAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * actionPerformed + * @param event TODO + */ + public void actionPerformed(ActionEvent event) { + // TODO + } // actionPerformed() + + + } // FontFamilyAction + + /** + * StyledTextAction + */ + public abstract static class StyledTextAction extends TextAction { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor StyledTextAction + * @param nm TODO + */ + public StyledTextAction(String nm) { + super(nm); + // TODO + } // StyledTextAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getEditor + * @param event TODO + * @returns JEditorPane + */ + protected final JEditorPane getEditor(ActionEvent event) { + return null; // TODO + } // getEditor() + + /** + * setCharacterAttributes + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + protected final void setCharacterAttributes(JEditorPane value0, AttributeSet value1, boolean value2) { + // TODO + } // setCharacterAttributes() + + /** + * getStyledDocument + * @param value0 TODO + * @returns StyledDocument + */ + protected final StyledDocument getStyledDocument(JEditorPane value0) { + return null; // TODO + } // getStyledDocument() + + /** + * getStyledEditorKit + * @param value0 TODO + * @returns StyledEditorKit + */ + protected final StyledEditorKit getStyledEditorKit(JEditorPane value0) { + return null; // TODO + } // getStyledEditorKit() + + /** + * setParagraphAttributes + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + protected final void setParagraphAttributes(JEditorPane value0, AttributeSet value1, boolean value2) { + // TODO + } // setParagraphAttributes() + + + } // StyledTextAction + + /** + * StyledViewFactory + */ + static class StyledViewFactory implements ViewFactory { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor StyledViewFactory + */ + StyledViewFactory() { + // TODO + } // StyledViewFactory() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * create + * @param value0 TODO + * @returns View + */ + public View create(Element value0) { + return null; // TODO + } // create() + + + } // StyledViewFactory + + /** + * AttributeTracker + */ + class AttributeTracker implements CaretListener, PropertyChangeListener, Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor AttributeTracker + * @param value0 TODO + */ + AttributeTracker(StyledEditorKit value0) { + // TODO + } // AttributeTracker() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * updateInputAttributes + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + void updateInputAttributes(int value0, int value1, JTextComponent value2) { + // TODO + } // updateInputAttributes() + + /** + * propertyChange + * @param value0 TODO + */ + public void propertyChange(PropertyChangeEvent value0) { + // TODO + } // propertyChange() + + /** + * caretUpdate + * @param value0 TODO + */ + public void caretUpdate(CaretEvent value0) { + // TODO + } // caretUpdate() + + + } // AttributeTracker + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * currentRun + */ + Element currentRun; + + /** + * currentParagraph + */ + Element currentParagraph; + + /** + * inputAttributes + */ + MutableAttributeSet inputAttributes; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor StyledEditorKit + */ + public StyledEditorKit() { + // TODO + } // StyledEditorKit() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * clone + * @returns Object + */ + public Object clone() { + return null; // TODO + } // clone() + + /** + * getActions + * @returns Action[] + */ + public Action[] getActions() { + return null; // TODO + } // getActions() + + /** + * getInputAttributes + * @returns MutableAttributeSet + */ + public MutableAttributeSet getInputAttributes() { + return null; // TODO + } // getInputAttributes() + + /** + * getCharacterAttributeRun + * @returns Element + */ + public Element getCharacterAttributeRun() { + return null; // TODO + } // getCharacterAttributeRun() + + /** + * createDefaultDocument + * @returns Document + */ + public Document createDefaultDocument() { + return null; // TODO + } // createDefaultDocument() + + /** + * install + * @param component TODO + */ + public void install(JEditorPane component) { + // TODO + } // install() + + /** + * deinstall + * @param component TODO + */ + public void deinstall(JEditorPane component) { + // TODO + } // deinstall() + + /** + * getViewFactory + * @returns ViewFactory + */ + public ViewFactory getViewFactory() { + return null; // TODO + } // getViewFactory() + + /** + * createInputAttributes + * @param element TODO + * @param set TODO + */ + protected void createInputAttributes(Element element, + MutableAttributeSet set) { + // TODO + } // createInputAttributes() + + + } // StyledEditorKit diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/Style.java gcc-3.3/libjava/javax/swing/text/Style.java *** gcc-3.2.3/libjava/javax/swing/text/Style.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/Style.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,47 ---- + /* Style.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import javax.swing.event.*; + + public interface Style + { + void addChangeListener(ChangeListener l); + String getName(); + void removeChangeListener(ChangeListener l); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/TextAction.java gcc-3.3/libjava/javax/swing/text/TextAction.java *** gcc-3.2.3/libjava/javax/swing/text/TextAction.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/TextAction.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,96 ---- + /* TextAction.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + // Imports + import java.awt.event.*; + import javax.swing.*; + + /** + * TextAction + * @author Andrew Selkirk + * @version 1.0 + */ + public abstract class TextAction extends AbstractAction { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TextAction + * @param name TODO + */ + public TextAction(String name) { + // TODO + } // TextAction() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getTextComponent + * @param event TODO + * @returns JTextComponent + */ + protected final JTextComponent getTextComponent(ActionEvent event) { + return null; // TODO + } // getTextComponent() + + /** + * augmentList + * @param list1 TODO + * @param list2 TODO + * @returns Action[] + */ + public static final Action[] augmentList(Action[] list1, Action[] list2) { + return null; // TODO + } // augmentList() + + /** + * getFocusedComponent + * @returns JTextComponent + */ + protected final JTextComponent getFocusedComponent() { + return null; // TODO + } // getFocusedComponent() + + + } // TextAction diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/ViewFactory.java gcc-3.3/libjava/javax/swing/text/ViewFactory.java *** gcc-3.2.3/libjava/javax/swing/text/ViewFactory.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/ViewFactory.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,44 ---- + /* ViewFactory.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + + public interface ViewFactory + { + public View create(Element elem); + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/text/View.java gcc-3.3/libjava/javax/swing/text/View.java *** gcc-3.2.3/libjava/javax/swing/text/View.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/text/View.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,139 ---- + /* View.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.text; + + import java.awt.*; + import javax.swing.*; + import java.util.*; + + public abstract class View implements SwingConstants + { + static int BadBreakWeight; + static int ExcellentBreakWeight; + static int ForcedBreakWeight; + static int GoodBreakWeight; + + public final static int X_AXIS = 0; + public final static int Y_AXIS = 1; + + float width, height; + Element elt; + View parent; + + /** + * this vector contains the views ordered at offsets... + */ + Vector v = new Vector(); + + + public View(Element elem) + { + elt = elem; + } + + public int getViewCount() + { + return v.size(); + } + + public View getView(int a) + { + return (View) v.get(a); + } + + public void remove(int i) + { + v.removeElementAt(i); + } + + public void insert(int off, View view) + { + v.insertElementAt(view, off); + } + + public void append(View view) + { + v.addElement(view); + } + + public void paint(Graphics g, Shape allocation) + { + System.out.println("view.paint() !!!!"); + } + + public void setParent(View a) + { + parent = a; + } + + public View getParent() + { + return parent; + } + + public void setSize(int w, int h) + { + width = w; + height = h; + } + + public Document getDocument() + { + return getElement().getDocument(); + } + + public Element getElement() + { + return elt; + } + + public float getPreferredSpan(int a) + { + switch (a) + { + case X_AXIS: return width; + case Y_AXIS: return height; + default: + { + System.err.println("I sure wish Java had enums !!! "); + return 0; + } + } + } + } + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/Timer.java gcc-3.3/libjava/javax/swing/Timer.java *** gcc-3.2.3/libjava/javax/swing/Timer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/Timer.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,154 ---- + /* Timer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.event.*; + import java.util.*; + + + public class Timer + { + int ticks; + static boolean verbose; + boolean running; + boolean repeat_ticks = true; + long interval, init_delay; + Vector actions = new Vector(); + + class Waker extends Thread + { + public void run() + { + running = true; + try { + sleep(init_delay); + + while (running) + { + sleep(interval); + + if (verbose) + { + System.out.println("javax.swing.Timer -> clocktick"); + } + + ticks++; + fireActionPerformed(); + + if (! repeat_ticks) + break; + } + running = false; + } catch (Exception e) { + System.out.println("swing.Timer::" + e); + } + } + } + + public void addActionListener(ActionListener listener) + { + actions.addElement(listener); + } + public void removeActionListener(ActionListener listener) + { + actions.removeElement(listener); + } + + void fireActionPerformed() + { + for (int i=0;i= 0; index--) { + path[index] = current; + current = current.getParent(); + } // for + + // Return Path + return path; + + } // getPath() + + /** + * children + * @returns Enumeration + */ + public Enumeration children() { + return children.elements(); + } // children() + + /** + * setParent + * @param value0 TODO + */ + public void setParent(MutableTreeNode node) { + parent = node; + } // setParent() + + /** + * getChildAt + * @param value0 TODO + * @returns TreeNode + */ + public TreeNode getChildAt(int index) { + return (TreeNode) children.elementAt(index); + } // getChildAt() + + /** + * getChildCount + * @returns int + */ + public int getChildCount() { + return children.size(); + } // getChildCount() + + /** + * getIndex + * @param value0 TODO + * @returns int + */ + public int getIndex(TreeNode node) { + return children.indexOf(node); + } // getIndex() + + /** + * setAllowsChildren + * @param value0 TODO + */ + public void setAllowsChildren(boolean allowsChildren) { + this.allowsChildren = allowsChildren; + } // setAllowsChildren() + + /** + * getAllowsChildren + * @returns boolean + */ + public boolean getAllowsChildren() { + return allowsChildren; + } // getAllowsChildren() + + /** + * setUserObject + * @param value0 TODO + */ + public void setUserObject(Object userObject) { + this.userObject = userObject; + } // setUserObject() + + /** + * getUserObject + * @returns Object + */ + public Object getUserObject() { + return userObject; + } // getUserObject() + + /** + * removeFromParent + */ + public void removeFromParent() { + parent = null; + // TODO + } // removeFromParent() + + /** + * removeAllChildren + */ + public void removeAllChildren() { + children.removeAllElements(); + } // removeAllChildren() + + /** + * isNodeAncestor + * @param value0 TODO + * @returns boolean + */ + public boolean isNodeAncestor(TreeNode node) { + + // Variables + TreeNode current; + + // Sanity Check + if (node == null) { + return false; + } // if + + // Search For Ancestor + current = this; + while (current != null && current != node) { + current = current.getParent(); + } // while + + // Check for Ancestor + if (current == node) { + return true; + } // if + + // Otherwise, no + return false; + + } // isNodeAncestor() + + /** + * isNodeDescendant + * @param value0 TODO + * @returns boolean + */ + public boolean isNodeDescendant(DefaultMutableTreeNode node) { + + // Variables + TreeNode current; + + // Sanity Check + if (node == null) { + return false; + } // if + + // Search For Descendant + current = node; + while (current != null && current != this) { + current = current.getParent(); + } // while + + // Check for Descendant + if (current == this) { + return true; + } // if + + // Otherwise, no + return false; + + } // isNodeDescendant() + + /** + * getSharedAncestor + * @param value0 TODO + * @returns TreeNode + */ + public TreeNode getSharedAncestor(DefaultMutableTreeNode node) { + + // Variables + ArrayList list; + TreeNode current; + + // Get List of Path Elements for this node + current = this; + list = new ArrayList(); + while (current != null) { + list.add(current); + current = current.getParent(); + } // while + + // Check if any path element of node are in list + current = node; + while (current != null) { + if (list.contains(current) == true) { + return current; + } // if + current = current.getParent(); + } // while + + // Unable to locate shared ancestor + return null; + + } // getSharedAncestor() + + /** + * isNodeRelated + * @param value0 TODO + * @returns boolean + */ + public boolean isNodeRelated(DefaultMutableTreeNode node) { + + // Sanity Check + if (node == null) { + return false; + } // if + + // Check for the same root + if (node.getRoot() == getRoot()) { + return true; + } // if + + // Nodes are not related + return false; + + } // isNodeRelated() + + /** + * getDepth + * @returns int + */ + public int getDepth() { + + // Variables + TreeNode node; + int depth; + int current; + int size; + Stack stack; + int index; + + // Check for children + if (allowsChildren == false || children.size() == 0) { + return 0; + } // if + + // Process Depths + stack = new Stack(); + stack.push(new Integer(0)); + node = getChildAt(0); + //System.out.println(" * Descend: 0-0"); + depth = 0; + current = 1; + while (stack.empty() == false) { + + // Check if node has children + if (node.getChildCount() != 0) { + node = node.getChildAt(0); + stack.push(new Integer(0)); + current++; + // System.out.println(" * Descend: 0-" + current); + + // Check for next sibling + } else { + + // Check Depth + if (current > depth) { + depth = current; + } // if + + do { + + // Traverse to Parent + node = node.getParent(); + size = node.getChildCount(); + current--; + index = ((Integer) stack.pop()).intValue(); + // System.out.println(" * Ascend from: " + index + "-" + current); + index++; + + } while (index >= size && node != this); + + // Check for child + if (index < size) { + node = node.getChildAt(index); + stack.push(new Integer(index)); + current++; + // System.out.println(" * Descend: " + index + "-" + current); + } // if + + } // if + + } // while + + return depth; + + } // getDepth() + + static Random random = new Random(System.currentTimeMillis()); + + public static void growTree(DefaultMutableTreeNode root) { + + // Variables + int size; + int index; + DefaultMutableTreeNode node; + DefaultMutableTreeNode current; + + current = root; + index = 0; + // while (current != root) { + do { + + // if (random.nextInt(3) < 2) { + if (random.nextBoolean()) { + node = new DefaultMutableTreeNode(String.valueOf(index)); + index++; + current.add(node); + current = node; + } else { + current = (DefaultMutableTreeNode) current.getParent(); + } // if + + // } // while + } while (current != root && current != null); + + System.out.println("Number of nodes: " + index); + + /* + // Calc # children + size = random.nextInt(4); + + for (index = 0; index < size; index++) { + + // Create Node + node = new DefaultMutableTreeNode(String.valueOf(index)); + growTree(node); + + // Add Node to root + root.add(node); + + } // for + */ + } // growTree() + + public static void main(String[] argv) { + /* + DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1"); + DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("node2"); + DefaultMutableTreeNode node3 = new DefaultMutableTreeNode("node3"); + DefaultMutableTreeNode node4 = new DefaultMutableTreeNode("node4"); + DefaultMutableTreeNode node5 = new DefaultMutableTreeNode("node5"); + DefaultMutableTreeNode node6 = new DefaultMutableTreeNode("node6"); + DefaultMutableTreeNode node7 = new DefaultMutableTreeNode("node7"); + DefaultMutableTreeNode node8 = new DefaultMutableTreeNode("node8"); + + node1.add(node2); + node1.add(node3); + node2.add(node4); + node2.add(node5); + node3.add(node6); + node3.add(node7); + node5.add(node8); + + System.out.println("Depth (node1): " + node1.getDepth()); + System.out.println("Depth (node2): " + node2.getDepth()); + System.out.println("Depth (node3): " + node3.getDepth()); + */ + + System.out.println("Create tree..."); + DefaultMutableTreeNode root = new DefaultMutableTreeNode("root"); + growTree(root); + System.out.println("Find depth..."); + System.out.println("Depth (root): " + root.getDepth()); + + } // main + + /** + * getLevel + * @returns int + */ + public int getLevel() { + + // Variables + TreeNode current; + int count; + + // Lookup Parent + count = -1; + current = this; + do { + current = current.getParent(); + count++; + } while (current != null); + + return count; + + } // getLevel() + + /** + * getPathToRoot + * @param value0 TODO + * @param value1 TODO + * @returns TreeNode[] + */ + protected TreeNode[] getPathToRoot(TreeNode value0, int value1) { + return null; // TODO + } // getPathToRoot() + + /** + * getUserObjectPath + * @returns Object[] + */ + public Object[] getUserObjectPath() { + + // Variables + TreeNode[] path; + Object[] object; + int size; + int index; + + // Get Path for Tree Nodes + path = getPath(); + + // Construct Object Path + object = new Object[path.length]; + for (index = 0; index < path.length; index++) { + object[index] = ((DefaultMutableTreeNode) path[index]).getUserObject(); + } // for + + // Return Object Path + return object; + + } // getUserObjectPath() + + /** + * getRoot + * @returns TreeNode + */ + public TreeNode getRoot() { + + // Variables + TreeNode current; + TreeNode check; + + // Lookup Parent + current = this; + check = current.getParent(); + while (check != null) { + current = check; + check = current.getParent(); + } // while + + return current; + + } // getRoot() + + /** + * isRoot + * @returns boolean + */ + public boolean isRoot() { + return (parent == null); + } // isRoot() + + /** + * getNextNode + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getNextNode() { + return null; // TODO + } // getNextNode() + + /** + * getPreviousNode + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getPreviousNode() { + return null; // TODO + } // getPreviousNode() + + /** + * preorderEnumeration + * @returns Enumeration + */ + public Enumeration preorderEnumeration() { + return null; // TODO + } // preorderEnumeration() + + /** + * postorderEnumeration + * @returns Enumeration + */ + public Enumeration postorderEnumeration() { + return null; // TODO + } // postorderEnumeration() + + /** + * breadthFirstEnumeration + * @returns Enumeration + */ + public Enumeration breadthFirstEnumeration() { + return null; // TODO + } // breadthFirstEnumeration() + + /** + * depthFirstEnumeration + * @returns Enumeration + */ + public Enumeration depthFirstEnumeration() { + return null; // TODO + } // depthFirstEnumeration() + + /** + * pathFromAncestorEnumeration + * @param value0 TODO + * @returns Enumeration + */ + public Enumeration pathFromAncestorEnumeration(TreeNode value0) { + return null; // TODO + } // pathFromAncestorEnumeration() + + /** + * isNodeChild + * @param value0 TODO + * @returns boolean + */ + public boolean isNodeChild(TreeNode node) { + + // Variables + TreeNode current; + int index; + + // Sanity Check + if (node == null) { + return false; + } // if + + // Process Path + current = node; + while (current != null) { + if (current == this) { + return true; + } // if + current = current.getParent(); + } // while + + // Node not located in path, not child + return false; + + } // isNodeChild() + + /** + * getFirstChild + * @returns TreeNode + */ + public TreeNode getFirstChild() { + return (TreeNode) children.firstElement(); + } // getFirstChild() + + /** + * getLastChild + * @returns TreeNode + */ + public TreeNode getLastChild() { + return (TreeNode) children.lastElement(); + } // getLastChild() + + /** + * getChildAfter + * @param value0 TODO + * @returns TreeNode + */ + public TreeNode getChildAfter(TreeNode node) { + + // Variables + int index; + + // Check node + if (node == null || node.getParent() != this) { + throw new IllegalArgumentException(); + } // if + + // Get index of child node + index = getIndex(node); + + // Check for child after + index++; + if (index == getChildCount()) { + return null; + } // if + + // Retrieve Child After + return getChildAt(index); + + } // getChildAfter() + + /** + * getChildBefore + * @param value0 TODO + * @returns TreeNode + */ + public TreeNode getChildBefore(TreeNode node) { + + // Variables + int index; + + // Check node + if (node == null || node.getParent() != this) { + throw new IllegalArgumentException(); + } // if + + // Get index of child node + index = getIndex(node); + + // Check for child before + index--; + if (index < 0) { + return null; + } // if + + // Retrieve Child Before + return getChildAt(index); + + } // getChildBefore() + + /** + * isNodeSibling + * @param value0 TODO + * @returns boolean + */ + public boolean isNodeSibling(TreeNode node) { + + // Variables + int index; + + // Check for null + if (node == null) { + return false; + } // if + + // Check if nodes share a parent + if (node.getParent() == getParent() && getParent() != null) { + return true; + } // if + + // Nodes are not siblings + return false; + + } // isNodeSibling() + + /** + * getSiblingCount + * @returns int + */ + public int getSiblingCount() { + + // Variables + + // Check for no parent + if (parent == null) { + return 1; + } // if + + // Calculate sibling count from parent's child count + return parent.getChildCount(); + + } // getSiblingCount() + + /** + * getNextSibling + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getNextSibling() { + + // Variables + int index; + int size; + + // Check for Parent + if (parent == null) { + return null; + } // if + + // Get Index of this node + index = parent.getIndex(this); + + // Check for Next Sibling + size = parent.getChildCount(); + index++; + if (index == size) { + return null; + } // if + + return (DefaultMutableTreeNode) parent.getChildAt(index); + + } // getNextSibling() + + /** + * getPreviousSibling + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getPreviousSibling() { + + // Variables + int index; + + // Check for Parent + if (parent == null) { + return null; + } // if + + // Get Index of this node + index = parent.getIndex(this); + + // Check for Previous Sibling + index--; + if (index < 0) { + return null; + } // if + + return (DefaultMutableTreeNode) parent.getChildAt(index); + + } // getPreviousSibling() + + /** + * isLeaf + * @returns boolean + */ + public boolean isLeaf() { + return (children.size() == 0); // TODO: check allowsChildren?? + } // isLeaf() + + /** + * getFirstLeaf + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getFirstLeaf() { + + // Variables + TreeNode current; + + current = this; + while (current.getChildCount() > 0) { + current = current.getChildAt(0); + } // while + + return (DefaultMutableTreeNode) current; + + } // getFirstLeaf() + + /** + * getLastLeaf + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getLastLeaf() { + + // Variables + TreeNode current; + int size; + + current = this; + size = current.getChildCount(); + while (size > 0) { + current = current.getChildAt(size - 1); + size = current.getChildCount(); + } // while + + return (DefaultMutableTreeNode) current; + + } // getLastLeaf() + + /** + * getNextLeaf + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getNextLeaf() { + return null; // TODO + } // getNextLeaf() + + /** + * getPreviousLeaf + * @returns DefaultMutableTreeNode + */ + public DefaultMutableTreeNode getPreviousLeaf() { + return null; // TODO + } // getPreviousLeaf() + + /** + * getLeafCount + * @returns int + */ + public int getLeafCount() { + + // Variables + Enumeration enum; + int count; + TreeNode current; + + // Get Enumeration of all descendants + enum = depthFirstEnumeration(); + + // Process Nodes + count = 0; + while (enum.hasMoreElements() == true) { + current = (TreeNode) enum.nextElement(); + if (current.isLeaf() == true) { + count++; + } // if + } // if + + return count; + + } // getLeafCount() + + + } // DefaultMutableTreeNode diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeCellEditor.java gcc-3.3/libjava/javax/swing/tree/DefaultTreeCellEditor.java *** gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeCellEditor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/DefaultTreeCellEditor.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,489 ---- + /* DefaultTreeCellEditor.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.awt.*; + import java.awt.event.*; + import java.io.*; + import java.util.*; + import javax.swing.*; + import javax.swing.border.*; + import javax.swing.event.*; + + /** + * DefaultTreeCellEditor + * @author Andrew Selkirk + */ + public class DefaultTreeCellEditor implements ActionListener, TreeCellEditor, TreeSelectionListener { + + //------------------------------------------------------------- + // Classes ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * EditorContainer + */ + public class EditorContainer extends Container { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor EditorContainer + * @param value0 TODO + */ + public EditorContainer(DefaultTreeCellEditor value0) { + // TODO + } // EditorContainer() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getPreferredSize + * @returns Dimension + */ + public Dimension getPreferredSize() { + return null; // TODO + } // getPreferredSize() + + /** + * paint + * @param value0 TODO + */ + public void paint(Graphics value0) { + // TODO + } // paint() + + /** + * doLayout + */ + public void doLayout() { + // TODO + } // doLayout() + + + } // EditorContainer + + /** + * DefaultTextField + */ + public class DefaultTextField extends JTextField { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * border + */ + protected Border border; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultTextField + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTextField(DefaultTreeCellEditor value0, Border value1) { + // TODO + } // DefaultTextField() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getFont + * @returns Font + */ + public Font getFont() { + return null; // TODO + } // getFont() + + /** + * getBorder + * @returns Border + */ + public Border getBorder() { + return null; // TODO + } // getBorder() + + /** + * getPreferredSize + * @returns Dimension + */ + public Dimension getPreferredSize() { + return null; // TODO + } // getPreferredSize() + + + } // DefaultTextField + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * realEditor + */ + protected TreeCellEditor realEditor; + + /** + * renderer + */ + protected DefaultTreeCellRenderer renderer; + + /** + * editingContainer + */ + protected Container editingContainer; + + /** + * editingComponent + */ + protected transient Component editingComponent; + + /** + * canEdit + */ + protected boolean canEdit; + + /** + * offset + */ + protected transient int offset; + + /** + * tree + */ + protected transient JTree tree; + + /** + * lastPath + */ + protected transient TreePath lastPath; + + /** + * timer + */ + protected transient javax.swing.Timer timer; // TODO + + /** + * lastRow + */ + protected transient int lastRow; + + /** + * borderSelectionColor + */ + protected Color borderSelectionColor; + + /** + * editingIcon + */ + protected transient Icon editingIcon; + + /** + * font + */ + protected Font font; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultTreeCellEditor + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1) { + // TODO + } // DefaultTreeCellEditor() + + /** + * Constructor DefaultTreeCellEditor + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1, TreeCellEditor value2) { + // TODO + } // DefaultTreeCellEditor() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param value0 TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream value0) throws IOException { + // TODO + } // writeObject() + + /** + * readObject + * @param value0 TODO + * @exception IOException TODO + * @exception ClassNotFoundException TODO + */ + private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException { + // TODO + } // readObject() + + /** + * setBorderSelectionColor + * @param value0 TODO + */ + public void setBorderSelectionColor(Color value0) { + // TODO + } // setBorderSelectionColor() + + /** + * getBorderSelectionColor + * @returns Color + */ + public Color getBorderSelectionColor() { + return null; // TODO + } // getBorderSelectionColor() + + /** + * setFont + * @param value0 TODO + */ + public void setFont(Font value0) { + // TODO + } // setFont() + + /** + * getFont + * @returns Font + */ + public Font getFont() { + return null; // TODO + } // getFont() + + /** + * getTreeCellEditorComponent + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + * @param value4 TODO + * @param value5 TODO + * @returns Component + */ + public Component getTreeCellEditorComponent(JTree value0, Object value1, boolean value2, boolean value3, boolean value4, int value5) { + return null; // TODO + } // getTreeCellEditorComponent() + + /** + * getCellEditorValue + * @returns Object + */ + public Object getCellEditorValue() { + return null; // TODO + } // getCellEditorValue() + + /** + * isCellEditable + * @param value0 TODO + * @returns boolean + */ + public boolean isCellEditable(EventObject value0) { + return false; // TODO + } // isCellEditable() + + /** + * shouldSelectCell + * @param value0 TODO + * @returns boolean + */ + public boolean shouldSelectCell(EventObject value0) { + return false; // TODO + } // shouldSelectCell() + + /** + * stopCellEditing + * @returns boolean + */ + public boolean stopCellEditing() { + return false; // TODO + } // stopCellEditing() + + /** + * cancelCellEditing + */ + public void cancelCellEditing() { + // TODO + } // cancelCellEditing() + + /** + * addCellEditorListener + * @param value0 TODO + */ + public void addCellEditorListener(CellEditorListener value0) { + // TODO + } // addCellEditorListener() + + /** + * removeCellEditorListener + * @param value0 TODO + */ + public void removeCellEditorListener(CellEditorListener value0) { + // TODO + } // removeCellEditorListener() + + /** + * valueChanged + * @param value0 TODO + */ + public void valueChanged(TreeSelectionEvent value0) { + // TODO + } // valueChanged() + + /** + * actionPerformed + * @param value0 TODO + */ + public void actionPerformed(ActionEvent value0) { + // TODO + } // actionPerformed() + + /** + * setTree + * @param value0 TODO + */ + protected void setTree(JTree value0) { + // TODO + } // setTree() + + /** + * shouldStartEditingTimer + * @param value0 TODO + * @returns boolean + */ + protected boolean shouldStartEditingTimer(EventObject value0) { + return false; // TODO + } // shouldStartEditingTimer() + + /** + * startEditingTimer + */ + protected void startEditingTimer() { + // TODO + } // startEditingTimer() + + /** + * canEditImmediately + * @param value0 TODO + * @returns boolean + */ + protected boolean canEditImmediately(EventObject value0) { + return false; // TODO + } // canEditImmediately() + + /** + * inHitRegion + * @param value0 TODO + * @param value1 TODO + * @returns boolean + */ + protected boolean inHitRegion(int value0, int value1) { + return false; // TODO + } // inHitRegion() + + /** + * determineOffset + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + * @param value4 TODO + * @param value5 TODO + */ + protected void determineOffset(JTree value0, Object value1, boolean value2, boolean value3, boolean value4, int value5) { + // TODO + } // determineOffset() + + /** + * prepareForEditing + */ + protected void prepareForEditing() { + // TODO + } // prepareForEditing() + + /** + * createContainer + * @returns Container + */ + protected Container createContainer() { + return null; // TODO + } // createContainer() + + /** + * createTreeCellEditor + * @returns TreeCellEditor + */ + protected TreeCellEditor createTreeCellEditor() { + return null; // TODO + } // createTreeCellEditor() + + + } // DefaultTreeCellEditor diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeCellRenderer.java gcc-3.3/libjava/javax/swing/tree/DefaultTreeCellRenderer.java *** gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeCellRenderer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/DefaultTreeCellRenderer.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,450 ---- + /* DefaultTreeCellRenderer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.awt.*; + import javax.swing.*; + + /** + * DefaultTreeCellRenderer + * @author Andrew Selkirk + */ + public class DefaultTreeCellRenderer extends JLabel implements TreeCellRenderer { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * selected + */ + protected boolean selected; + + /** + * hasFocus + */ + protected boolean hasFocus; + + /** + * drawsFocusBorderAroundIcon + */ + private boolean drawsFocusBorderAroundIcon; + + /** + * closedIcon + */ + protected transient Icon closedIcon; + + /** + * leafIcon + */ + protected transient Icon leafIcon; + + /** + * openIcon + */ + protected transient Icon openIcon; + + /** + * textSelectionColor + */ + protected Color textSelectionColor; + + /** + * textNonSelectionColor + */ + protected Color textNonSelectionColor; + + /** + * backgroundSelectionColor + */ + protected Color backgroundSelectionColor; + + /** + * backgroundNonSelectionColor + */ + protected Color backgroundNonSelectionColor; + + /** + * borderSelectionColor + */ + protected Color borderSelectionColor; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultTreeCellRenderer + */ + public DefaultTreeCellRenderer() { + // TODO + } // DefaultTreeCellRenderer() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getDefaultOpenIcon + * @returns Icon + */ + public Icon getDefaultOpenIcon() { + return null; // TODO + } // getDefaultOpenIcon() + + /** + * getDefaultClosedIcon + * @returns Icon + */ + public Icon getDefaultClosedIcon() { + return null; // TODO + } // getDefaultClosedIcon() + + /** + * getDefaultLeafIcon + * @returns Icon + */ + public Icon getDefaultLeafIcon() { + return null; // TODO + } // getDefaultLeafIcon() + + /** + * setOpenIcon + * @param value0 TODO + */ + public void setOpenIcon(Icon value0) { + // TODO + } // setOpenIcon() + + /** + * getOpenIcon + * @returns Icon + */ + public Icon getOpenIcon() { + return null; // TODO + } // getOpenIcon() + + /** + * setClosedIcon + * @param value0 TODO + */ + public void setClosedIcon(Icon value0) { + // TODO + } // setClosedIcon() + + /** + * getClosedIcon + * @returns Icon + */ + public Icon getClosedIcon() { + return null; // TODO + } // getClosedIcon() + + /** + * setLeafIcon + * @param value0 TODO + */ + public void setLeafIcon(Icon value0) { + // TODO + } // setLeafIcon() + + /** + * getLeafIcon + * @returns Icon + */ + public Icon getLeafIcon() { + return null; // TODO + } // getLeafIcon() + + /** + * setTextSelectionColor + * @param value0 TODO + */ + public void setTextSelectionColor(Color value0) { + // TODO + } // setTextSelectionColor() + + /** + * getTextSelectionColor + * @returns Color + */ + public Color getTextSelectionColor() { + return null; // TODO + } // getTextSelectionColor() + + /** + * setTextNonSelectionColor + * @param value0 TODO + */ + public void setTextNonSelectionColor(Color value0) { + // TODO + } // setTextNonSelectionColor() + + /** + * getTextNonSelectionColor + * @returns Color + */ + public Color getTextNonSelectionColor() { + return null; // TODO + } // getTextNonSelectionColor() + + /** + * setBackgroundSelectionColor + * @param value0 TODO + */ + public void setBackgroundSelectionColor(Color value0) { + // TODO + } // setBackgroundSelectionColor() + + /** + * getBackgroundSelectionColor + * @returns Color + */ + public Color getBackgroundSelectionColor() { + return null; // TODO + } // getBackgroundSelectionColor() + + /** + * setBackgroundNonSelectionColor + * @param value0 TODO + */ + public void setBackgroundNonSelectionColor(Color value0) { + // TODO + } // setBackgroundNonSelectionColor() + + /** + * getBackgroundNonSelectionColor + * @returns Color + */ + public Color getBackgroundNonSelectionColor() { + return null; // TODO + } // getBackgroundNonSelectionColor() + + /** + * setBorderSelectionColor + * @param value0 TODO + */ + public void setBorderSelectionColor(Color value0) { + // TODO + } // setBorderSelectionColor() + + /** + * getBorderSelectionColor + * @returns Color + */ + public Color getBorderSelectionColor() { + return null; // TODO + } // getBorderSelectionColor() + + /** + * setFont + * @param value0 TODO + */ + public void setFont(Font value0) { + // TODO + } // setFont() + + /** + * setBackground + * @param value0 TODO + */ + public void setBackground(Color value0) { + // TODO + } // setBackground() + + /** + * getTreeCellRendererComponent + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + * @param value4 TODO + * @param value5 TODO + * @param value6 TODO + * @returns Component + */ + public Component getTreeCellRendererComponent(JTree value0, Object value1, boolean value2, boolean value3, boolean value4, int value5, boolean value6) { + return null; // TODO + } // getTreeCellRendererComponent() + + /** + * paint + * @param value0 TODO + */ + public void paint(Graphics value0) { + // TODO + } // paint() + + /** + * getPreferredSize + * @returns Dimension + */ + public Dimension getPreferredSize() { + return null; // TODO + } // getPreferredSize() + + /** + * validate + */ + public void validate() { + // TODO + } // validate() + + /** + * revalidate + */ + public void revalidate() { + // TODO + } // revalidate() + + /** + * repaint + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + * @param value4 TODO + */ + public void repaint(long value0, int value1, int value2, int value3, int value4) { + // TODO + } // repaint() + + /** + * repaint + * @param value0 TODO + */ + public void repaint(Rectangle value0) { + // TODO + } // repaint() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + protected void firePropertyChange(String value0, Object value1, Object value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, byte value1, byte value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, char value1, char value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, short value1, short value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, int value1, int value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, long value1, long value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, float value1, float value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, double value1, double value2) { + // TODO + } // firePropertyChange() + + /** + * firePropertyChange + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void firePropertyChange(String value0, boolean value1, boolean value2) { + // TODO + } // firePropertyChange() + + + } // DefaultTreeCellRenderer diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeModel.java gcc-3.3/libjava/javax/swing/tree/DefaultTreeModel.java *** gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/DefaultTreeModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,371 ---- + /* DefaultTreeModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.io.*; + import java.util.*; + import javax.swing.event.*; + + /** + * DefaultTreeModel + * @author Andrew Selkirk + */ + public class DefaultTreeModel implements Serializable, TreeModel { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * root + */ + protected TreeNode root = null; + + /** + * listenerList + */ + protected EventListenerList listenerList = new EventListenerList(); + + /** + * asksAllowsChildren + */ + protected boolean asksAllowsChildren; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultTreeModel + * @param value0 TODO + */ + public DefaultTreeModel(TreeNode root) { + setRoot(root); + } // DefaultTreeModel() + + /** + * Constructor DefaultTreeModel + * @param value0 TODO + * @param value1 TODO + */ + public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren) { + setRoot(root); + this.asksAllowsChildren = asksAllowsChildren; + } // DefaultTreeModel() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * writeObject + * @param value0 TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream value0) throws IOException { + // TODO + } // writeObject() + + /** + * readObject + * @param value0 TODO + * @exception IOException TODO + * @exception ClassNotFoundException TODO + */ + private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException { + // TODO + } // readObject() + + /** + * asksAllowsChildren + * @returns boolean + */ + public boolean asksAllowsChildren() { + return asksAllowsChildren; + } // asksAllowsChildren() + + /** + * setAsksAllowsChildren + * @param value0 TODO + */ + public void setAsksAllowsChildren(boolean value) { + asksAllowsChildren = value; // TODO + } // setAsksAllowsChildren() + + /** + * setRoot + * @param value0 TODO + */ + public void setRoot(TreeNode root) { + + // Sanity Check + if (root == null) { + throw new IllegalArgumentException("null root"); + } // if + + // Set new root + this.root = root; + + // TODO + } // setRoot() + + /** + * getRoot + * @returns Object + */ + public Object getRoot() { + return root; + } // getRoot() + + /** + * getIndexOfChild + * @param value0 TODO + * @param value1 TODO + * @returns int + */ + public int getIndexOfChild(Object parent, Object child) { + return 0; // TODO + } // getIndexOfChild() + + /** + * getChild + * @param value0 TODO + * @param value1 TODO + * @returns Object + */ + public Object getChild(Object value0, int value1) { + return null; // TODO + } // getChild() + + /** + * getChildCount + * @param value0 TODO + * @returns int + */ + public int getChildCount(Object value0) { + return 0; // TODO + } // getChildCount() + + /** + * isLeaf + * @param value0 TODO + * @returns boolean + */ + public boolean isLeaf(Object value0) { + return false; // TODO + } // isLeaf() + + /** + * reload + */ + public void reload() { + // TODO + } // reload() + + /** + * reload + * @param value0 TODO + */ + public void reload(TreeNode value0) { + // TODO + } // reload() + + /** + * valueForPathChanged + * @param value0 TODO + * @param value1 TODO + */ + public void valueForPathChanged(TreePath value0, Object value1) { + // TODO + } // valueForPathChanged() + + /** + * insertNodeInto + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void insertNodeInto(MutableTreeNode value0, MutableTreeNode value1, int value2) { + // TODO + } // insertNodeInto() + + /** + * removeNodeFromParent + * @param value0 TODO + */ + public void removeNodeFromParent(MutableTreeNode value0) { + // TODO + } // removeNodeFromParent() + + /** + * nodeChanged + * @param value0 TODO + */ + public void nodeChanged(TreeNode value0) { + // TODO + } // nodeChanged() + + /** + * nodesWereInserted + * @param value0 TODO + * @param value1 TODO + */ + public void nodesWereInserted(TreeNode value0, int[] value1) { + // TODO + } // nodesWereInserted() + + /** + * nodesWereRemoved + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + */ + public void nodesWereRemoved(TreeNode value0, int[] value1, Object[] value2) { + // TODO + } // nodesWereRemoved() + + /** + * nodesChanged + * @param value0 TODO + * @param value1 TODO + */ + public void nodesChanged(TreeNode value0, int[] value1) { + // TODO + } // nodesChanged() + + /** + * nodeStructureChanged + * @param value0 TODO + */ + public void nodeStructureChanged(TreeNode value0) { + // TODO + } // nodeStructureChanged() + + /** + * getPathToRoot + * @param value0 TODO + * @returns TreeNode[] + */ + public TreeNode[] getPathToRoot(TreeNode value0) { + return null; // TODO + } // getPathToRoot() + + /** + * getPathToRoot + * @param value0 TODO + * @param value1 TODO + * @returns TreeNode[] + */ + protected TreeNode[] getPathToRoot(TreeNode value0, int value1) { + return null; // TODO + } // getPathToRoot() + + /** + * addTreeModelListener + * @param value0 TODO + */ + public void addTreeModelListener(TreeModelListener listener) { + listenerList.add(TreeModelListener.class, listener); + } // addTreeModelListener() + + /** + * removeTreeModelListener + * @param value0 TODO + */ + public void removeTreeModelListener(TreeModelListener listener) { + listenerList.remove(TreeModelListener.class, listener); + } // removeTreeModelListener() + + /** + * fireTreeNodesChanged + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + */ + protected void fireTreeNodesChanged(Object value0, Object[] value1, int[] value2, Object[] value3) { + // TODO + } // fireTreeNodesChanged() + + /** + * fireTreeNodesInserted + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + */ + protected void fireTreeNodesInserted(Object value0, Object[] value1, int[] value2, Object[] value3) { + // TODO + } // fireTreeNodesInserted() + + /** + * fireTreeNodesRemoved + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + */ + protected void fireTreeNodesRemoved(Object value0, Object[] value1, int[] value2, Object[] value3) { + // TODO + } // fireTreeNodesRemoved() + + /** + * fireTreeStructureChanged + * @param value0 TODO + * @param value1 TODO + * @param value2 TODO + * @param value3 TODO + */ + protected void fireTreeStructureChanged(Object value0, Object[] value1, int[] value2, Object[] value3) { + // TODO + } // fireTreeStructureChanged() + + /** + * getListeners + * @param value0 TODO + * @returns EventListener[] + */ + public EventListener[] getListeners(Class classType) { + return listenerList.getListeners(classType); + } // getListeners() + + + } // DefaultTreeModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeSelectionModel.java gcc-3.3/libjava/javax/swing/tree/DefaultTreeSelectionModel.java *** gcc-3.2.3/libjava/javax/swing/tree/DefaultTreeSelectionModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/DefaultTreeSelectionModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,451 ---- + /* DefaultTreeSelectionModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.beans.*; + import java.io.*; + import java.util.*; + import javax.swing.*; + import javax.swing.event.*; + + /** + * DefaultTreeSelectionModel + * @author Andrew Selkirk + */ + public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeSelectionModel { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * SELECTION_MODE_PROPERTY + */ + public static final String SELECTION_MODE_PROPERTY = "selectionMode"; + + /** + * changeSupport + */ + protected SwingPropertyChangeSupport changeSupport; + + /** + * selection + */ + protected TreePath[] selection; + + /** + * listenerList + */ + protected EventListenerList listenerList; + + /** + * rowMapper + */ + protected transient RowMapper rowMapper; + + /** + * listSelectionModel + */ + protected DefaultListSelectionModel listSelectionModel; + + /** + * selectionMode + */ + protected int selectionMode; + + /** + * leadPath + */ + protected TreePath leadPath; + + /** + * leadIndex + */ + protected int leadIndex; + + /** + * leadRow + */ + protected int leadRow; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor DefaultTreeSelectionModel + */ + public DefaultTreeSelectionModel() { + // TODO + } // DefaultTreeSelectionModel() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * clone + * @exception CloneNotSupportedException TODO + * @returns Object + */ + public Object clone() throws CloneNotSupportedException { + return null; // TODO + } // clone() + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * writeObject + * @param value0 TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream value0) throws IOException { + // TODO + } // writeObject() + + /** + * readObject + * @param value0 TODO + * @exception IOException TODO + * @exception ClassNotFoundException TODO + */ + private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException { + // TODO + } // readObject() + + /** + * setRowMapper + * @param value0 TODO + */ + public void setRowMapper(RowMapper value0) { + // TODO + } // setRowMapper() + + /** + * getRowMapper + * @returns RowMapper + */ + public RowMapper getRowMapper() { + return null; // TODO + } // getRowMapper() + + /** + * setSelectionMode + * @param value0 TODO + */ + public void setSelectionMode(int value0) { + // TODO + } // setSelectionMode() + + /** + * getSelectionMode + * @returns int + */ + public int getSelectionMode() { + return 0; // TODO + } // getSelectionMode() + + /** + * setSelectionPath + * @param value0 TODO + */ + public void setSelectionPath(TreePath value0) { + // TODO + } // setSelectionPath() + + /** + * setSelectionPaths + * @param value0 TODO + */ + public void setSelectionPaths(TreePath[] value0) { + // TODO + } // setSelectionPaths() + + /** + * addSelectionPath + * @param value0 TODO + */ + public void addSelectionPath(TreePath value0) { + // TODO + } // addSelectionPath() + + /** + * addSelectionPaths + * @param value0 TODO + */ + public void addSelectionPaths(TreePath[] value0) { + // TODO + } // addSelectionPaths() + + /** + * removeSelectionPath + * @param value0 TODO + */ + public void removeSelectionPath(TreePath value0) { + // TODO + } // removeSelectionPath() + + /** + * removeSelectionPaths + * @param value0 TODO + */ + public void removeSelectionPaths(TreePath[] value0) { + // TODO + } // removeSelectionPaths() + + /** + * getSelectionPath + * @returns TreePath + */ + public TreePath getSelectionPath() { + return null; // TODO + } // getSelectionPath() + + /** + * getSelectionPaths + * @returns TreePath[] + */ + public TreePath[] getSelectionPaths() { + return null; // TODO + } // getSelectionPaths() + + /** + * getSelectionCount + * @returns int + */ + public int getSelectionCount() { + return 0; // TODO + } // getSelectionCount() + + /** + * isPathSelected + * @param value0 TODO + * @returns boolean + */ + public boolean isPathSelected(TreePath value0) { + return false; // TODO + } // isPathSelected() + + /** + * isSelectionEmpty + * @returns boolean + */ + public boolean isSelectionEmpty() { + return false; // TODO + } // isSelectionEmpty() + + /** + * clearSelection + */ + public void clearSelection() { + // TODO + } // clearSelection() + + /** + * addTreeSelectionListener + * @param value0 TODO + */ + public void addTreeSelectionListener(TreeSelectionListener value0) { + // TODO + } // addTreeSelectionListener() + + /** + * removeTreeSelectionListener + * @param value0 TODO + */ + public void removeTreeSelectionListener(TreeSelectionListener value0) { + // TODO + } // removeTreeSelectionListener() + + /** + * fireValueChanged + * @param value0 TODO + */ + protected void fireValueChanged(TreeSelectionEvent value0) { + // TODO + } // fireValueChanged() + + /** + * getListeners + * @param value0 TODO + * @returns EventListener[] + */ + public EventListener[] getListeners(Class value0) { + return null; // TODO + } // getListeners() + + /** + * getSelectionRows + * @returns int[] + */ + public int[] getSelectionRows() { + return null; // TODO + } // getSelectionRows() + + /** + * getMinSelectionRow + * @returns int + */ + public int getMinSelectionRow() { + return 0; // TODO + } // getMinSelectionRow() + + /** + * getMaxSelectionRow + * @returns int + */ + public int getMaxSelectionRow() { + return 0; // TODO + } // getMaxSelectionRow() + + /** + * isRowSelected + * @param value0 TODO + * @returns boolean + */ + public boolean isRowSelected(int value0) { + return false; // TODO + } // isRowSelected() + + /** + * resetRowSelection + */ + public void resetRowSelection() { + // TODO + } // resetRowSelection() + + /** + * getLeadSelectionRow + * @returns int + */ + public int getLeadSelectionRow() { + return 0; // TODO + } // getLeadSelectionRow() + + /** + * getLeadSelectionPath + * @returns TreePath + */ + public TreePath getLeadSelectionPath() { + return null; // TODO + } // getLeadSelectionPath() + + /** + * addPropertyChangeListener + * @param value0 TODO + */ + public synchronized void addPropertyChangeListener(PropertyChangeListener value0) { + // TODO + } // addPropertyChangeListener() + + /** + * removePropertyChangeListener + * @param value0 TODO + */ + public synchronized void removePropertyChangeListener(PropertyChangeListener value0) { + // TODO + } // removePropertyChangeListener() + + /** + * insureRowContinuity + */ + protected void insureRowContinuity() { + // TODO + } // insureRowContinuity() + + /** + * arePathsContiguous + * @param value0 TODO + * @returns boolean + */ + protected boolean arePathsContiguous(TreePath[] value0) { + return false; // TODO + } // arePathsContiguous() + + /** + * canPathsBeAdded + * @param value0 TODO + * @returns boolean + */ + protected boolean canPathsBeAdded(TreePath[] value0) { + return false; // TODO + } // canPathsBeAdded() + + /** + * canPathsBeRemoved + * @param value0 TODO + * @returns boolean + */ + protected boolean canPathsBeRemoved(TreePath[] value0) { + return false; // TODO + } // canPathsBeRemoved() + + /** + * notifyPathChange + * @param value0 TODO + * @param value1 TODO + */ + protected void notifyPathChange(Vector value0, TreePath value1) { + // TODO + } // notifyPathChange() + + /** + * updateLeadIndex + */ + protected void updateLeadIndex() { + // TODO + } // updateLeadIndex() + + /** + * insureUniqueness + */ + protected void insureUniqueness() { + // TODO + } // insureUniqueness() + + + } // DefaultTreeSelectionModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/ExpandVetoException.java gcc-3.3/libjava/javax/swing/tree/ExpandVetoException.java *** gcc-3.2.3/libjava/javax/swing/tree/ExpandVetoException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/ExpandVetoException.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,83 ---- + /* ExpandVetoException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import javax.swing.event.TreeExpansionEvent; + + /** + * ExpandVetoException + * @author Andrew Selkirk + */ + public class ExpandVetoException extends Exception { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * event + */ + protected TreeExpansionEvent event = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ExpandVetoException + * @param event Tree Expansion Event + */ + public ExpandVetoException(TreeExpansionEvent event) { + super(); + this.event = event; + } // ExpandVetoException() + + /** + * Constructor ExpandVetoException + * @param event Tree Expansion Event + * @param message Message + */ + public ExpandVetoException(TreeExpansionEvent event, String message) { + super(message); + this.event = event; + } // ExpandVetoException() + + + } // ExpandVetoException diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/FixedHeightLayoutCache.java gcc-3.3/libjava/javax/swing/tree/FixedHeightLayoutCache.java *** gcc-3.2.3/libjava/javax/swing/tree/FixedHeightLayoutCache.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/FixedHeightLayoutCache.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,235 ---- + /* FixedHeightLayoutCache.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.awt.*; + import java.util.*; + import javax.swing.event.*; + + /** + * FixedHeightLayoutCache + * @author Andrew Selkirk + */ + public class FixedHeightLayoutCache extends AbstractLayoutCache { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor FixedHeightLayoutCache + */ + public FixedHeightLayoutCache() { + // TODO + } // FixedHeightLayoutCache() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * setModel + * @param value0 TODO + */ + public void setModel(TreeModel value0) { + // TODO + } // setModel() + + /** + * setRootVisible + * @param value0 TODO + */ + public void setRootVisible(boolean value0) { + // TODO + } // setRootVisible() + + /** + * setRowHeight + * @param value0 TODO + */ + public void setRowHeight(int value0) { + // TODO + } // setRowHeight() + + /** + * getRowCount + * @returns int + */ + public int getRowCount() { + return 0; // TODO + } // getRowCount() + + /** + * invalidatePathBounds + * @param value0 TODO + */ + public void invalidatePathBounds(TreePath value0) { + // TODO + } // invalidatePathBounds() + + /** + * invalidateSizes + */ + public void invalidateSizes() { + // TODO + } // invalidateSizes() + + /** + * isExpanded + * @param value0 TODO + * @returns boolean + */ + public boolean isExpanded(TreePath value0) { + return false; // TODO + } // isExpanded() + + /** + * getBounds + * @param value0 TODO + * @param value1 TODO + * @returns Rectangle + */ + public Rectangle getBounds(TreePath value0, Rectangle value1) { + return null; // TODO + } // getBounds() + + /** + * getPathForRow + * @param value0 TODO + * @returns TreePath + */ + public TreePath getPathForRow(int value0) { + return null; // TODO + } // getPathForRow() + + /** + * getRowForPath + * @param value0 TODO + * @returns int + */ + public int getRowForPath(TreePath value0) { + return 0; // TODO + } // getRowForPath() + + /** + * getPathClosestTo + * @param value0 TODO + * @param value1 TODO + * @returns TreePath + */ + public TreePath getPathClosestTo(int value0, int value1) { + return null; // TODO + } // getPathClosestTo() + + /** + * getVisibleChildCount + * @param value0 TODO + * @returns int + */ + public int getVisibleChildCount(TreePath value0) { + return 0; // TODO + } // getVisibleChildCount() + + /** + * getVisiblePathsFrom + * @param value0 TODO + * @returns Enumeration + */ + public Enumeration getVisiblePathsFrom(TreePath value0) { + return null; // TODO + } // getVisiblePathsFrom() + + /** + * setExpandedState + * @param value0 TODO + * @param value1 TODO + */ + public void setExpandedState(TreePath value0, boolean value1) { + // TODO + } // setExpandedState() + + /** + * getExpandedState + * @param value0 TODO + * @returns boolean + */ + public boolean getExpandedState(TreePath value0) { + return false; // TODO + } // getExpandedState() + + /** + * treeNodesChanged + * @param value0 TODO + */ + public void treeNodesChanged(TreeModelEvent value0) { + // TODO + } // treeNodesChanged() + + /** + * treeNodesInserted + * @param value0 TODO + */ + public void treeNodesInserted(TreeModelEvent value0) { + // TODO + } // treeNodesInserted() + + /** + * treeNodesRemoved + * @param value0 TODO + */ + public void treeNodesRemoved(TreeModelEvent value0) { + // TODO + } // treeNodesRemoved() + + /** + * treeStructureChanged + * @param value0 TODO + */ + public void treeStructureChanged(TreeModelEvent value0) { + // TODO + } // treeStructureChanged() + + + } // FixedHeightLayoutCache diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/MutableTreeNode.java gcc-3.3/libjava/javax/swing/tree/MutableTreeNode.java *** gcc-3.2.3/libjava/javax/swing/tree/MutableTreeNode.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/MutableTreeNode.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,83 ---- + /* MutableTreeNode.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + /** + * MutableTreeNode interface + * @author Andrew Selkirk + */ + public interface MutableTreeNode extends TreeNode { + + /** + * insert + * @param child MutableTreeNode + * @param index Index + */ + public void insert(MutableTreeNode child, int index); + + /** + * remove + * @param index Index + */ + public void remove(int index); + + /** + * remove + * @param node MutableTreeNode + */ + public void remove(MutableTreeNode node); + + /** + * setUserObject + * @param object Object + */ + public void setUserObject(Object object); + + /** + * removeFromParent + */ + public void removeFromParent(); + + /** + * setParent + * @param parent MutableTreeNode + */ + public void setParent(MutableTreeNode parent); + + + } // MutableTreeNode diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/RowMapper.java gcc-3.3/libjava/javax/swing/tree/RowMapper.java *** gcc-3.2.3/libjava/javax/swing/tree/RowMapper.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/RowMapper.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* RowMapper.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + /** + * RowMapper interface + * @author Andrew Selkirk + */ + public interface RowMapper { + + /** + * getRowsForPaths + * @param path TreePath + * @return TODO + */ + public int[] getRowsForPaths(TreePath[] path); + + + } // RowMapper diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/TreeCellEditor.java gcc-3.3/libjava/javax/swing/tree/TreeCellEditor.java *** gcc-3.2.3/libjava/javax/swing/tree/TreeCellEditor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/TreeCellEditor.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,65 ---- + /* TreeCellEditor.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.awt.Component; + import javax.swing.JTree; + + /** + * TreeCellEditor interface + * @author Andrew Selkirk + */ + public interface TreeCellEditor { + + /** + * getTreeCellEditorComponent + * @param tree TODO + * @param value TODO + * @param isSelected TODO + * @param expanded TODO + * @param leaf TODO + * @param row TODO + * @returns TODO + */ + public Component getTreeCellEditorComponent(JTree tree, + Object value, boolean isSelected, boolean expanded, + boolean leaf, int row); + + + } // TreeCellEditor diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/TreeCellRenderer.java gcc-3.3/libjava/javax/swing/tree/TreeCellRenderer.java *** gcc-3.2.3/libjava/javax/swing/tree/TreeCellRenderer.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/TreeCellRenderer.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,66 ---- + /* TreeCellRenderer.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.awt.Component; + import javax.swing.JTree; + + /** + * TreeCellRenderer interface + * @author Andrew Selkirk + */ + public interface TreeCellRenderer { + + /** + * getTreeCellRendererComponent + * @param tree TODO + * @param value TODO + * @param selected TODO + * @param expanded TODO + * @param leaf TODO + * @param row TODO + * @param us TODO + * @returns TODO + */ + public Component getTreeCellRendererComponent(JTree tree, + Object value, boolean selected, boolean expanded, + boolean leaf, int row, boolean hasFocus); + + + } // TreeCellRenderer diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/TreeModel.java gcc-3.3/libjava/javax/swing/tree/TreeModel.java *** gcc-3.2.3/libjava/javax/swing/tree/TreeModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/TreeModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,109 ---- + /* TreeModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import javax.swing.event.*; + + /** + * TreeModel interface + * @author Andrew Selkirk + */ + public interface TreeModel { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getRoot + * @returns Object + */ + public abstract Object getRoot(); + + /** + * getChild + * @param parent TODO + * @param index TODO + * @returns Object + */ + public abstract Object getChild(Object parent, int index); + + /** + * getChildCount + * @param parent TODO + * @returns int + */ + public abstract int getChildCount(Object parent); + + /** + * isLeaf + * @param node TODO + * @returns boolean + */ + public abstract boolean isLeaf(Object node); + + /** + * valueForPathChanged + * @param path TODO + * @param newvalue TODO + */ + public abstract void valueForPathChanged(TreePath path, Object newvalue); + + /** + * getIndexOfChild + * @param parent TODO + * @param ild TODO + * @returns int + */ + public abstract int getIndexOfChild(Object parent, Object child); + + /** + * addTreeModelListener + * @param listener TODO + */ + public abstract void addTreeModelListener(TreeModelListener listener); + + /** + * removeTreeModelListener + * @param listener TODO + */ + public abstract void removeTreeModelListener(TreeModelListener listener); + + + } // TreeModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/TreeNode.java gcc-3.3/libjava/javax/swing/tree/TreeNode.java *** gcc-3.2.3/libjava/javax/swing/tree/TreeNode.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/TreeNode.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,99 ---- + /* TreeNode.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.util.*; + + /** + * TreeNode interface + * @author Andrew Selkirk + */ + public interface TreeNode { + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * getParent + * @returns TreeNode + */ + public TreeNode getParent(); + + /** + * getIndex + * @param node TODO + * @returns int + */ + public int getIndex(TreeNode node); + + /** + * getChildAt + * @param index TODO + * @returns TreeNode + */ + public TreeNode getChildAt(int index); + + /** + * getChildCount + * @returns int + */ + public int getChildCount(); + + /** + * getAllowsChildren + * @returns boolean + */ + public abstract boolean getAllowsChildren(); + + /** + * isLeaf + * @returns boolean + */ + public boolean isLeaf(); + + /** + * children + * @returns Enumeration + */ + public Enumeration children(); + + + } // TreeNode + diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/TreePath.java gcc-3.3/libjava/javax/swing/tree/TreePath.java *** gcc-3.2.3/libjava/javax/swing/tree/TreePath.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/TreePath.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,295 ---- + /* TreePath.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.io.*; + + /** + * TreePath + * @author Andrew Selkirk + */ + public class TreePath implements Serializable { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * path + */ + private Object[] path = null; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor TreePath + * @param path TODO + */ + public TreePath(Object[] path) { + + // Create Path + this.path = new Object[path.length]; + System.arraycopy(path, 0, this.path, 0, path.length); + + } // TreePath() + + /** + * Constructor TreePath + * @param element TODO + */ + public TreePath(Object element) { + + // Create Path + path = new Object[1]; + path[0] = element; + + } // TreePath() + + /** + * Constructor TreePath + * @param path TODO + * @param element TODO + */ + protected TreePath(TreePath path, Object element) { + + // Variables + Object[] treepath; + + // Get Tree Path + treepath = path.getPath(); + + // Create Tree Path + this.path = new Object[treepath.length + 1]; + System.arraycopy(treepath, 0, this.path, 0, treepath.length); + this.path[treepath.length] = element; + + } // TreePath() + + /** + * Constructor TreePath + * @param path TODO + * @param length TODO + */ + protected TreePath(Object[] path, int length) { + + // Create Path + this.path = new Object[length]; + System.arraycopy(path, 0, this.path, 0, length); + + } // TreePath() + + /** + * Constructor TreePath + */ + protected TreePath() { + path = new Object[0]; + } // TreePath() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * hashCode + * @returns int + */ + public int hashCode() { + return getLastPathComponent().hashCode(); + } // hashCode() + + /** + * equals + * @param object TODO + * @returns boolean + */ + public boolean equals(Object object) { + + // Variables + Object[] treepath; + int index; + + // Check for TreePath + if (object instanceof TreePath) { + + // Get Path Elements + treepath = ((TreePath) object).getPath(); + + // Check length + if (treepath.length != path.length) { + return false; + } // if + + // Check Elements + for (index = 0; index < path.length; index++) { + if (treepath[index] != path[index]) { + return false; + } // if + } // for + + // Tree Path's are equals + return true; + + } // if + + // Unequal + return false; + + } // equals() + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * writeObject + * @param value0 TODO + * @exception IOException TODO + */ + private void writeObject(ObjectOutputStream value0) throws IOException { + // TODO + } // writeObject() + + /** + * readObject + * @param value0 TODO + * @exception IOException TODO + * @exception ClassNotFoundException TODO + */ + private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException { + // TODO + } // readObject() + + /** + * getPath + * @returns Object[] + */ + public Object[] getPath() { + return path; + } // getPath() + + /** + * getLastPathComponent + * @returns Object + */ + public Object getLastPathComponent() { + return path[path.length - 1]; + } // getLastPathComponent() + + /** + * getPathCount + * @returns int + */ + public int getPathCount() { + return path.length; + } // getPathCount() + + /** + * getPathComponent + * @param position TODO + * @returns Object + */ + public Object getPathComponent(int position) { + return path[position]; + } // getPathComponent() + + /** + * isDescendant + * @param path TODO + * @returns boolean + */ + public boolean isDescendant(TreePath path) { + + // Variables + Object[] treepath; + int index; + int index2; + + // Get Descendant path + treepath = path.getPath(); + + // Locate Start Index + index = 0; + index2 = 0; + while (treepath[index] != this.path[index2]) { + index++; + } // while + + // Verify Paths + while (treepath[index] == this.path[index2]) { + index++; + index2++; + } // while + + // Check for descendant + if (index2 != this.path.length) { + return false; + } // if + + // Is Descendant + return true; + + } // isDescendant() + + /** + * pathByAddingChild + * @param element TODO + * @returns TreePath + */ + public TreePath pathByAddingChild(Object element) { + return new TreePath(this, element); + } // pathByAddingChild() + + /** + * getParentPath + * @returns TreePath + */ + public TreePath getParentPath() { + return new TreePath(this.getPath(), path.length - 1); + } // getParentPath() + + + } // TreePath diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/TreeSelectionModel.java gcc-3.3/libjava/javax/swing/tree/TreeSelectionModel.java *** gcc-3.2.3/libjava/javax/swing/tree/TreeSelectionModel.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/TreeSelectionModel.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,83 ---- + /* TreeSelectionModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.beans.PropertyChangeListener; + import javax.swing.event.TreeSelectionListener; + + /** + * TreeSelectionModel interface + * @author Andrew Selkirk + */ + public interface TreeSelectionModel { + + public static final int SINGLE_TREE_SELECTION = 1; + public static final int CONTIGUOUS_TREE_SELECTION = 2; + public static final int DISCONTIGUOUS_TREE_SELECTION = 4; + + public void setSelectionMode(int mode); + public int getSelectionMode(); + public void setSelectionPath(TreePath path); + public void setSelectionPaths(TreePath[] paths); + public void addSelectionPath(TreePath path); + public void addSelectionPaths(TreePath[] paths); + public void removeSelectionPath(TreePath path); + public void removeSelectionPaths(TreePath[] paths); + public TreePath getSelectionPath(); + public TreePath[] getSelectionPaths(); + public int getSelectionCount(); + public boolean isPathSelected(TreePath path); + public boolean isSelectionEmpty(); + public void clearSelection(); + public void setRowMapper(RowMapper newMapper); + public RowMapper getRowMapper(); + public int[] getSelectionRows(); + public int getMinSelectionRow(); + public int getMaxSelectionRow(); + public boolean isRowSelected(int row); + public void resetRowSelection(); + public int getLeadSelectionRow(); + public TreePath getLeadSelectionPath(); + public void addPropertyChangeListener(PropertyChangeListener listener); + public void removePropertyChangeListener(PropertyChangeListener listener); + public void addTreeSelectionListener(TreeSelectionListener x); + public void removeTreeSelectionListener(TreeSelectionListener x); + + + } // TreeSelectionModel diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/tree/VariableHeightLayoutCache.java gcc-3.3/libjava/javax/swing/tree/VariableHeightLayoutCache.java *** gcc-3.2.3/libjava/javax/swing/tree/VariableHeightLayoutCache.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/tree/VariableHeightLayoutCache.java 2002-08-09 04:26:12.000000000 +0000 *************** *** 0 **** --- 1,260 ---- + /* VariableHeightLayoutCache.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.tree; + + // Imports + import java.awt.*; + import java.util.*; + import javax.swing.event.*; + + /** + * VariableHeightLayoutCache + * @author Andrew Selkirk + */ + public class VariableHeightLayoutCache extends AbstractLayoutCache { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor VariableHeightLayoutCache + */ + public VariableHeightLayoutCache() { + // TODO + } // VariableHeightLayoutCache() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * setModel + * @param value0 TODO + */ + public void setModel(TreeModel value0) { + // TODO + } // setModel() + + /** + * setRootVisible + * @param value0 TODO + */ + public void setRootVisible(boolean value0) { + // TODO + } // setRootVisible() + + /** + * setRowHeight + * @param value0 TODO + */ + public void setRowHeight(int value0) { + // TODO + } // setRowHeight() + + /** + * setNodeDimensions + * @param value0 TODO + */ + public void setNodeDimensions(NodeDimensions value0) { + // TODO + } // setNodeDimensions() + + /** + * setExpandedState + * @param value0 TODO + * @param value1 TODO + */ + public void setExpandedState(TreePath value0, boolean value1) { + // TODO + } // setExpandedState() + + /** + * getExpandedState + * @param value0 TODO + * @returns boolean + */ + public boolean getExpandedState(TreePath value0) { + return false; // TODO + } // getExpandedState() + + /** + * getBounds + * @param value0 TODO + * @param value1 TODO + * @returns Rectangle + */ + public Rectangle getBounds(TreePath value0, Rectangle value1) { + return null; // TODO + } // getBounds() + + /** + * getPathForRow + * @param value0 TODO + * @returns TreePath + */ + public TreePath getPathForRow(int value0) { + return null; // TODO + } // getPathForRow() + + /** + * getRowForPath + * @param value0 TODO + * @returns int + */ + public int getRowForPath(TreePath value0) { + return 0; // TODO + } // getRowForPath() + + /** + * getRowCount + * @returns int + */ + public int getRowCount() { + return 0; // TODO + } // getRowCount() + + /** + * invalidatePathBounds + * @param value0 TODO + */ + public void invalidatePathBounds(TreePath value0) { + // TODO + } // invalidatePathBounds() + + /** + * getPreferredHeight + * @returns int + */ + public int getPreferredHeight() { + return 0; // TODO + } // getPreferredHeight() + + /** + * getPreferredWidth + * @param value0 TODO + * @returns int + */ + public int getPreferredWidth(Rectangle value0) { + return 0; // TODO + } // getPreferredWidth() + + /** + * getPathClosestTo + * @param value0 TODO + * @param value1 TODO + * @returns TreePath + */ + public TreePath getPathClosestTo(int value0, int value1) { + return null; // TODO + } // getPathClosestTo() + + /** + * getVisiblePathsFrom + * @param value0 TODO + * @returns Enumeration + */ + public Enumeration getVisiblePathsFrom(TreePath value0) { + return null; // TODO + } // getVisiblePathsFrom() + + /** + * getVisibleChildCount + * @param value0 TODO + * @returns int + */ + public int getVisibleChildCount(TreePath value0) { + return 0; // TODO + } // getVisibleChildCount() + + /** + * invalidateSizes + */ + public void invalidateSizes() { + // TODO + } // invalidateSizes() + + /** + * isExpanded + * @param value0 TODO + * @returns boolean + */ + public boolean isExpanded(TreePath value0) { + return false; // TODO + } // isExpanded() + + /** + * treeNodesChanged + * @param value0 TODO + */ + public void treeNodesChanged(TreeModelEvent value0) { + // TODO + } // treeNodesChanged() + + /** + * treeNodesInserted + * @param value0 TODO + */ + public void treeNodesInserted(TreeModelEvent value0) { + // TODO + } // treeNodesInserted() + + /** + * treeNodesRemoved + * @param value0 TODO + */ + public void treeNodesRemoved(TreeModelEvent value0) { + // TODO + } // treeNodesRemoved() + + /** + * treeStructureChanged + * @param value0 TODO + */ + public void treeStructureChanged(TreeModelEvent value0) { + // TODO + } // treeStructureChanged() + + + } // VariableHeightLayoutCache diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/UIDefaults.java gcc-3.3/libjava/javax/swing/UIDefaults.java *** gcc-3.2.3/libjava/javax/swing/UIDefaults.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/UIDefaults.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,303 ---- + /* UIDefaults.java -- database for all settings and interface bindings. + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.awt.Color; + import java.awt.Dimension; + import java.awt.Font; + import java.awt.Insets; + import java.beans.PropertyChangeListener; + import java.util.Hashtable; + import java.util.Locale; + import javax.swing.border.Border; + import javax.swing.plaf.ComponentUI; + + /** + * UIDefaults is a database where all settings and interface bindings are + * stored into. An PLAF implementation fills one of these (see for example + * plaf/basic/BasicDefaults.java) with "JButton" -> new BasicButtonUI(). + * + * @author Ronald Veldema (rveldema@cs.vu.nl) + */ + public class UIDefaults extends Hashtable + { + public interface ActiveValue + { + Object createValue(UIDefaults table); + } // interface ActiveValue + + public static class LazyInputMap implements LazyValue + { + public LazyInputMap(Object[] bindings) + { + } + public Object createValue(UIDefaults table) + { + throw new Error("not implemented"); + } + } // class LazyInputMap + + public interface LazyValue + { + Object createValue(UIDefaults table); + } // interface LazyValue + + public static class ProxyLazyValue + { + public ProxyLazyValue(String s) + { + throw new Error("not implemented"); + } + public ProxyLazyValue(String c, String m) + { + throw new Error("not implemented"); + } + public ProxyLazyValue(String c, Object[] o) + { + throw new Error("not implemented"); + } + public ProxyLazyValue(String c, String m, Object[] o) + { + throw new Error("not implemented"); + } + public Object createValue(UIDefaults table) + { + throw new Error("not implemented"); + } + } // class ProxyLazyValue + + public UIDefaults() + { + } + + public UIDefaults(Object[] entries) + { + // XXX + } + + public Object get(Object key) + { + // XXX Obey 1.4 specs + return super.get(key); + } + + public Object get(Object key, Locale l) + { + throw new Error("not implemented"); + } + + public Object put(Object key, Object value) + { + throw new Error("not implemented"); + } + + public void putDefaults(Object[] list) + { + throw new Error("not implemented"); + } + + public Font getFont(Object key) + { + Object o = get(key); + return o instanceof Font ? (Font) o : null; + } + + public Font getFont(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof Font ? (Font) o : null; + } + + public Color getColor(Object key) + { + Object o = get(key); + return o instanceof Color ? (Color) o : null; + } + + public Color getColor(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof Color ? (Color) o : null; + } + + public Icon getIcon(Object key) + { + Object o = get(key); + return o instanceof Icon ? (Icon) o : null; + } + + public Icon getIcon(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof Icon ? (Icon) o : null; + } + + public Border getBorder(Object key) + { + Object o = get(key); + return o instanceof Border ? (Border) o : null; + } + + public Border getBorder(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof Border ? (Border) o : null; + } + + public String getString(Object key) + { + Object o = get(key); + return o instanceof String ? (String) o : null; + } + + public String getString(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof String ? (String) o : null; + } + + public int getInt(Object key) + { + Object o = get(key); + return o instanceof Integer ? ((Integer) o).intValue() : 0; + } + + public int getInt(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof Integer ? ((Integer) o).intValue() : 0; + } + + public boolean getBoolean(Object key) + { + return Boolean.TRUE.equals(get(key)); + } + + public boolean getBoolean(Object key, Locale l) + { + return Boolean.TRUE.equals(get(key, l)); + } + + public Insets getInsets(Object key) + { + Object o = get(key); + return o instanceof Insets ? (Insets) o : null; + } + + public Insets getInsets(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof Insets ? (Insets) o : null; + } + + public Dimension getDimension(Object key) + { + Object o = get(key); + return o instanceof Dimension ? (Dimension) o : null; + } + + public Dimension getDimension(Object key, Locale l) + { + Object o = get(key, l); + return o instanceof Dimension ? (Dimension) o : null; + } + + public Class getUIClass(String id, ClassLoader loader) + { + throw new Error("not implemented"); + } + + public Class getUIClass(String id) + { + throw new Error("not implemented"); + } + + protected void getUIError(String msg) + { + // Does nothing unless overridden. + } + + public ComponentUI getUI(JComponent a) + { + String pp = a.getUIClassID(); + ComponentUI p = (ComponentUI) get(pp); + if (p == null) + getUIError("failed to locate UI:" + pp); + return p; + } + + public void addPropertyChangeListener(PropertyChangeListener l) + { + throw new Error("not implemented"); + } + + public void removePropertyChangeListener(PropertyChangeListener l) + { + throw new Error("not implemented"); + } + + public PropertyChangeListener[] getPropertyChangeListeners() + { + throw new Error("not implemented"); + } + + protected void firePropertyChange(String property, Object o, Object n) + { + throw new Error("not implemented"); + } + + public void addResourceBundle(String name) + { + throw new Error("not implemented"); + } + + public void removeResourceBundle(String name) + { + throw new Error("not implemented"); + } + + public void setDefaultLocale(Locale l) + { + throw new Error("not implemented"); + } + + public Locale getDefaultLocale() + { + throw new Error("not implemented"); + } + } // class UIDefaults diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/UIManager.java gcc-3.3/libjava/javax/swing/UIManager.java *** gcc-3.2.3/libjava/javax/swing/UIManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/UIManager.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,282 ---- + /* UIManager.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + import java.io.*; + import java.awt.*; + + import javax.swing.border.*; + import javax.swing.plaf.*; + import javax.swing.plaf.basic.*; + import javax.swing.plaf.metal.*; + + + import java.beans.*; + + + public class UIManager implements Serializable + { + static class LookAndFeelInfo + { + String name, clazz; + + LookAndFeelInfo(String name, + String clazz) + { + this.name = name; + this.clazz = clazz; + } + String getName() { return name; } + String getClassName() { return clazz; } + } + + + static LookAndFeelInfo [] installed = { + new LookAndFeelInfo("Metal", + "javax.swing.plaf.metal.MetalLookAndFeel") + }; + + + static LookAndFeel[] aux_installed; + + static LookAndFeel look_and_feel = new MetalLookAndFeel(); + + + UIManager() + { + } + + public static void addPropertyChangeListener(PropertyChangeListener listener) + { + // Add a PropertyChangeListener to the listener list. + } + + public static void addAuxiliaryLookAndFeel(LookAndFeel l) + { + // Add a LookAndFeel to the list of auxiliary look and feels. + if (aux_installed == null) + { + aux_installed = new LookAndFeel[1]; + aux_installed[0] = l; + return; + } + + LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ]; + System.arraycopy(aux_installed, 0, + T, 0, + aux_installed.length); + aux_installed = T; + aux_installed[aux_installed.length-1] = l; + } + + public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) + { + if (aux_installed == null) + return false; + + for (int i=0;i " + ui + ", for " + target); + return ui; + } + + + public static void installLookAndFeel(String name, String className) + // Creates a new look and feel and adds it to the current array. + { + } + public static void installLookAndFeel(LookAndFeelInfo info) + // Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]). + { + } + public static Object put(Object key, Object value) + // Stores an object in the defaults table. + { + return getLookAndFeel().getDefaults().put(key,value); + } + public static void removePropertyChangeListener(PropertyChangeListener listener) + // Remove a PropertyChangeListener from the listener list. + { + } + public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos) + // Replaces the current array of installed LookAndFeelInfos. + { + } + public static void setLookAndFeel(LookAndFeel newLookAndFeel) + { + if (look_and_feel != null) + look_and_feel.uninitialize(); + + // Set the current default look and feel using a LookAndFeel object. + look_and_feel = newLookAndFeel; + look_and_feel.initialize(); + + // revalidate(); + // repaint(); + } + + public static void setLookAndFeel(String className) + throws ClassNotFoundException, + InstantiationException, + IllegalAccessException, + UnsupportedLookAndFeelException + { + // Set the current default look and feel using a class name. + Class c = Class.forName(className); + LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception + setLookAndFeel(a); + } + + + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/AbstractUndoableEdit.java gcc-3.3/libjava/javax/swing/undo/AbstractUndoableEdit.java *** gcc-3.2.3/libjava/javax/swing/undo/AbstractUndoableEdit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/AbstractUndoableEdit.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,214 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + // Imports + import java.io.Serializable; + + /** + * AbstractUndoableEdit + * @author Andrew Selkirk + */ + public class AbstractUndoableEdit extends Object + implements UndoableEdit, + Serializable { + + //------------------------------------------------------------- + // Constants -------------------------------------------------- + //------------------------------------------------------------- + + /** + * String returned by getRedoPresentationName() + */ + protected static String RedoName = "Redo"; + + /** + * String returned by getUndoPresentationName() + */ + protected static String UndoName = "Undo"; + + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * TODO + */ + private boolean hasBeenDone = false; + + /** + * The edit is alive + */ + private boolean alive = true; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Create new AbstractUndoableEdit + */ + public AbstractUndoableEdit() { + } // AbstractUndoableEdit() + + + //------------------------------------------------------------- + // Interface: UndoableEdit ------------------------------------ + //------------------------------------------------------------- + + /** + * addEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean addEdit(UndoableEdit anEdit) { + return false; + } // addEdit() + + /** + * canRedo() + * @returns true if redoable, false otherwise + */ + public boolean canRedo() { + if (alive == true && hasBeenDone == false) { + return true; + } // if + return false; + } // canRedo() + + /** + * canUndo() + * @returns true if undoable, false otherwise + */ + public boolean canUndo() { + if (alive == true && hasBeenDone == true) { + return true; + } // if + return false; + } // canUndo() + + /** + * die + */ + public void die() { + alive = false; + } // die() + + /** + * getPresentation + * @returns TODO + */ + public String getPresentationName() { + return ""; + } // getPresentationName() + + /** + * getRedoPresentationName + * @returns TODO + */ + public String getRedoPresentationName() { + if (getPresentationName().equals("") == true) { + return RedoName; + } else { + return RedoName + " " + getPresentationName(); + } + } // getRedoPresentationName() + + /** + * getUndoPresentationName + * @returns TODO + */ + public String getUndoPresentationName() { + if (getPresentationName().equals("") == true) { + return UndoName; + } else { + return UndoName + " " + getPresentationName(); + } + } // getUndoPresentationName() + + /** + * isSignificant + * @returns true + */ + public boolean isSignificant() { + return true; + } // isSignificant() + + /** + * redo + * @throws CannotRedoException TODO + */ + public void redo() throws CannotRedoException { + if (canRedo() == false) { + throw new CannotRedoException(); + } + hasBeenDone = true; + } // redo() + + /** + * replaceEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean replaceEdit(UndoableEdit anEdit) { + return false; + } // replaceEdit() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * undo + * @throws CannotUndoException TODO + */ + public void undo() throws CannotUndoException { + if (canUndo() == false) { + throw new CannotUndoException(); + } + hasBeenDone = false; + } // undo() + + + } // AbstractUndoableEdit diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/CannotRedoException.java gcc-3.3/libjava/javax/swing/undo/CannotRedoException.java *** gcc-3.2.3/libjava/javax/swing/undo/CannotRedoException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/CannotRedoException.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + /** + * CannotRedoException + * @author Andrew Selkirk + */ + public class CannotRedoException extends RuntimeException { + + /** + * Create exception + */ + public CannotRedoException() { + super(); + } // CannotRedoException() + + + } // CannotRedoException diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/CannotUndoException.java gcc-3.3/libjava/javax/swing/undo/CannotUndoException.java *** gcc-3.2.3/libjava/javax/swing/undo/CannotUndoException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/CannotUndoException.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,54 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + /** + * CannotUndoException + * @author Andrew Selkirk + */ + public class CannotUndoException extends RuntimeException { + + /** + * Create exception + */ + public CannotUndoException() { + super(); + } // CannotUndoException() + + + } // CannotUndoException diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/CompoundEdit.java gcc-3.3/libjava/javax/swing/undo/CompoundEdit.java *** gcc-3.2.3/libjava/javax/swing/undo/CompoundEdit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/CompoundEdit.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,282 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + // Imports + import java.util.Vector; + + /** + * CompoundEdit + * @author Andrew Selkirk + */ + public class CompoundEdit extends AbstractUndoableEdit { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * The collection of UndoableEdits undone/redone en + * masse by this CompoundEdit + */ + protected Vector edits = new Vector(); + + /** + * TODO + */ + private boolean inProgress = false; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Create new Compound Edit + */ + public CompoundEdit() { + } // CompoundEdit() + + + //------------------------------------------------------------- + // Interface: UndoableEdit ------------------------------------ + //------------------------------------------------------------- + + /** + * addEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean addEdit(UndoableEdit anEdit) { + + // Variables + UndoableEdit lastEdit; + + if (inProgress == true) { + + // Get Last Edit + lastEdit = lastEdit(); + + // Check for null + if (lastEdit != null) { + + if (lastEdit.addEdit(anEdit) == false) { + if (lastEdit.replaceEdit(anEdit) == false) { + edits.add(anEdit); + } + } + + } // if: lastEdit + + return true; + + } else { + return false; + } + } // addEdit() + + /** + * canRedo + * @returns TODO + */ + public boolean canRedo() { + if (isInProgress() == true || super.canRedo() == false) { + return false; + } + return true; + } // canRedo() + + /** + * canUndo + * @returns TODO + */ + public boolean canUndo() { + if (isInProgress() == true || super.canUndo() == false) { + return false; + } + return true; + } // canUndo() + + /** + * die + */ + public void die() { + + // Variables + int index; + UndoableEdit current; + + // Loop through all contained UndoableEdits + for (index = edits.size() - 1; index >= 0; index--) { + current = (UndoableEdit) edits.elementAt(index); + current.die(); + } // for: index + + } // die() + + /** + * end + */ + public void end() { + inProgress = false; + } // end() + + /** + * getPresentationName + * @returns TODO + */ + public String getPresentationName() { + if (edits.size() == 0) { + return super.getPresentationName(); + } else { + return lastEdit().getPresentationName(); + } + } // getPresentationName() + + /** + * getRedoPresentationName + * @returns TODO + */ + public String getRedoPresentationName() { + if (edits.size() == 0) { + return super.getRedoPresentationName(); + } else { + return lastEdit().getRedoPresentationName(); + } + } // getRedoPresentationName() + + /** + * getUndoPresentationName + * @returns TODO + */ + public String getUndoPresentationName() { + if (edits.size() == 0) { + return super.getUndoPresentationName(); + } else { + return lastEdit().getUndoPresentationName(); + } + } // getUndoPresentationName() + + /** + * isInProgress + * @returns TODO + */ + public boolean isInProgress() { + return inProgress; + } // isInProgress() + + + /** + * isSignigicant + * @returns TODO + */ + public boolean isSignificant() { + + // Variables + int index; + UndoableEdit current; + + // Check each edit + for (index = 0; index < edits.size(); index++) { + current = (UndoableEdit) edits.elementAt(index); + if (current.isSignificant() == true) { + return true; + } + } // for: index + + return false; + + } // isSignificant() + + /** + * lastEdit + * @returns TODO + */ + protected UndoableEdit lastEdit() { + if (edits.size() == 0) { + return null; + } + return (UndoableEdit) edits.elementAt(edits.size() - 1); + } // lastEdit() + + /** + * redo + * @throws CannotRedoException TODO + */ + public void redo() throws CannotRedoException { + + // Variables + int index; + UndoableEdit current; + + // Loop through all contained UndoableEdits + for (index = 0; index < edits.size(); index++) { + current = (UndoableEdit) edits.elementAt(index); + current.redo(); + } // for: index + + } // redo() + + /** + * String representation + * @returns String representation + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * undo + * @throws CannotUndoException TODO + */ + public void undo() throws CannotUndoException { + + // Variables + int index; + UndoableEdit current; + + // Loop through all contained UndoableEdits + for (index = edits.size() - 1; index >= 0; index--) { + current = (UndoableEdit) edits.elementAt(index); + current.undo(); + } // for: index + + } // undo() + + + } // CompoundEdit diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/StateEditable.java gcc-3.3/libjava/javax/swing/undo/StateEditable.java *** gcc-3.2.3/libjava/javax/swing/undo/StateEditable.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/StateEditable.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,62 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + // Imports + import java.util.Hashtable; + + /** + * StateEditable interface + * @author Andrew Selkirk + */ + public interface StateEditable { + + /** + * Restore State + * @param state State + */ + public void restoreState(Hashtable state); + + /** + * Store State + * @param state State + */ + public void storeState(Hashtable state); + + + } // StateEditable diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/StateEdit.java gcc-3.3/libjava/javax/swing/undo/StateEdit.java *** gcc-3.2.3/libjava/javax/swing/undo/StateEdit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/StateEdit.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,151 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + // Imports + import java.util.*; + + /** + * StateEdit + * @author Andrew Selkirk + */ + public class StateEdit extends AbstractUndoableEdit { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * RCSID + */ + protected static final String RCSID = ""; // TODO + + /** + * object + */ + protected StateEditable object; + + /** + * preState + */ + protected Hashtable preState; + + /** + * postState + */ + protected Hashtable postState; + + /** + * undoRedoName + */ + protected String undoRedoName; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor StateEdit + * @param value0 TODO + */ + public StateEdit(StateEditable value0) { + // TODO + } // StateEdit() + + /** + * Constructor StateEdit + * @param value0 TODO + * @param value1 TODO + */ + public StateEdit(StateEditable value0, String value1) { + // TODO + } // StateEdit() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * init + * @param value0 TODO + * @param value1 TODO + */ + protected void init(StateEditable value0, String value1) { + // TODO + } // init() + + /** + * end + */ + public void end() { + // TODO + } // end() + + /** + * undo + */ + public void undo() { + // TODO + } // undo() + + /** + * redo + */ + public void redo() { + // TODO + } // redo() + + /** + * getPresentationName + * @returns String + */ + public String getPresentationName() { + return null; // TODO + } // getPresentationName() + + /** + * removeRedundantState + */ + protected void removeRedundantState() { + // TODO + } // removeRedundantState() + + + } // StateEdit diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/UndoableEdit.java gcc-3.3/libjava/javax/swing/undo/UndoableEdit.java *** gcc-3.2.3/libjava/javax/swing/undo/UndoableEdit.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/UndoableEdit.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,114 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + /** + * UndoableEdit interface + * @author Andrew Selkirk + */ + public interface UndoableEdit { + + /** + * anEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean addEdit(UndoableEdit anEdit); + + /** + * canRedo + * @returns TODO + */ + public boolean canRedo(); + + /** + * canRedo + * @returns TODO + */ + public boolean canUndo(); + + /** + * die + */ + public void die(); + + /** + * getPresentationName + * @returns TODO + */ + public String getPresentationName(); + + /** + * getRedoPresentationName + * @returns TODO + */ + public String getRedoPresentationName(); + + /** + * getUndoPresentationName + * @returns TODO + */ + public String getUndoPresentationName(); + + /** + * isSignificant + * @returns TODO + */ + public boolean isSignificant(); + + /** + * redo + * @throws CannotRedoException TODO + */ + public void redo() throws CannotRedoException; + + /** + * replaceEdit + * @param anEdit TODO + * @returns TODO + */ + public boolean replaceEdit(UndoableEdit anEdit); + + /** + * undo + * @throws CannotUndoException TODO + */ + public void undo() throws CannotUndoException; + + + } // UndoableEdit diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/UndoableEditSupport.java gcc-3.3/libjava/javax/swing/undo/UndoableEditSupport.java *** gcc-3.2.3/libjava/javax/swing/undo/UndoableEditSupport.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/UndoableEditSupport.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,170 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + // Imports + import java.util.*; + import javax.swing.event.*; + + /** + * UndoableEditSupport + * @author Andrew Selkirk + */ + public class UndoableEditSupport { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * updateLevel + */ + protected int updateLevel; + + /** + * compoundEdit + */ + protected CompoundEdit compoundEdit; + + /** + * listeners + */ + protected Vector listeners = new Vector(); + + /** + * realSource + */ + protected Object realSource; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UndoableEditSupport + */ + public UndoableEditSupport() { + // TODO + } // UndoableEditSupport() + + /** + * Constructor UndoableEditSupport + * @param object TODO + */ + public UndoableEditSupport(Object object) { + realSource = object; + } // UndoableEditSupport() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * addUndoableEditListener + * @param value0 TODO + */ + public synchronized void addUndoableEditListener(UndoableEditListener value0) { + // TODO + } // addUndoableEditListener() + + /** + * removeUndoableEditListener + * @param value0 TODO + */ + public synchronized void removeUndoableEditListener(UndoableEditListener value0) { + // TODO + } // removeUndoableEditListener() + + /** + * _postEdit + * @param value0 TODO + */ + protected void _postEdit(UndoableEdit value0) { + // TODO + } // _postEdit() + + /** + * postEdit + * @param value0 TODO + */ + public synchronized void postEdit(UndoableEdit value0) { + // TODO + } // postEdit() + + /** + * getUpdateLevel + * @returns int + */ + public int getUpdateLevel() { + return 0; // TODO + } // getUpdateLevel() + + /** + * beginUpdate + */ + public synchronized void beginUpdate() { + // TODO + } // beginUpdate() + + /** + * createCompoundEdit + * @returns CompoundEdit + */ + protected CompoundEdit createCompoundEdit() { + return null; // TODO + } // createCompoundEdit() + + /** + * endUpdate + */ + public synchronized void endUpdate() { + // TODO + } // endUpdate() + + + } // UndoableEditSupport diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/undo/UndoManager.java gcc-3.3/libjava/javax/swing/undo/UndoManager.java *** gcc-3.2.3/libjava/javax/swing/undo/UndoManager.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/undo/UndoManager.java 2002-08-09 04:26:13.000000000 +0000 *************** *** 0 **** --- 1,259 ---- + /* AbstractTableModel.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing.undo; + + // Imports + import javax.swing.event.*; + + /** + * UndoManager + * @author Andrew Selkirk + */ + public class UndoManager extends CompoundEdit implements UndoableEditListener { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * indexOfNextAdd + */ + int indexOfNextAdd; + + /** + * limit + */ + int limit; + + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor UndoManager + */ + public UndoManager() { + // TODO + } // UndoManager() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * toString + * @returns String + */ + public String toString() { + return null; // TODO + } // toString() + + /** + * end + */ + public synchronized void end() { + // TODO + } // end() + + /** + * getLimit + * @returns int + */ + public synchronized int getLimit() { + return 0; // TODO + } // getLimit() + + /** + * discardAllEdits + */ + public synchronized void discardAllEdits() { + // TODO + } // discardAllEdits() + + /** + * trimForLimit + */ + protected void trimForLimit() { + // TODO + } // trimForLimit() + + /** + * trimEdits + * @param value0 TODO + * @param value1 TODO + */ + protected void trimEdits(int value0, int value1) { + // TODO + } // trimEdits() + + /** + * setLimit + * @param value0 TODO + */ + public synchronized void setLimit(int value0) { + // TODO + } // setLimit() + + /** + * editToBeUndone + * @returns UndoableEdit + */ + protected UndoableEdit editToBeUndone() { + return null; // TODO + } // editToBeUndone() + + /** + * editToBeRedone + * @returns UndoableEdit + */ + protected UndoableEdit editToBeRedone() { + return null; // TODO + } // editToBeRedone() + + /** + * undoTo + * @param value0 TODO + * @exception CannotUndoException TODO + */ + protected void undoTo(UndoableEdit value0) throws CannotUndoException { + // TODO + } // undoTo() + + /** + * redoTo + * @param value0 TODO + * @exception CannotRedoException TODO + */ + protected void redoTo(UndoableEdit value0) throws CannotRedoException { + // TODO + } // redoTo() + + /** + * undoOrRedo + * @exception CannotRedoException TODO + * @exception CannotUndoException TODO + */ + public synchronized void undoOrRedo() throws CannotRedoException, CannotUndoException { + // TODO + } // undoOrRedo() + + /** + * canUndoOrRedo + * @returns boolean + */ + public synchronized boolean canUndoOrRedo() { + return false; // TODO + } // canUndoOrRedo() + + /** + * undo + * @exception CannotUndoException TODO + */ + public synchronized void undo() throws CannotUndoException { + // TODO + } // undo() + + /** + * canUndo + * @returns boolean + */ + public synchronized boolean canUndo() { + return false; // TODO + } // canUndo() + + /** + * redo + * @exception CannotRedoException TODO + */ + public synchronized void redo() throws CannotRedoException { + // TODO + } // redo() + + /** + * canRedo + * @returns boolean + */ + public synchronized boolean canRedo() { + return false; // TODO + } // canRedo() + + /** + * addEdit + * @param value0 TODO + * @returns boolean + */ + public synchronized boolean addEdit(UndoableEdit value0) { + return false; // TODO + } // addEdit() + + /** + * getUndoOrRedoPresentationName + * @returns String + */ + public synchronized String getUndoOrRedoPresentationName() { + return null; // TODO + } // getUndoOrRedoPresentationName() + + /** + * getUndoPresentationName + * @returns String + */ + public synchronized String getUndoPresentationName() { + return null; // TODO + } // getUndoPresentationName() + + /** + * getRedoPresentationName + * @returns String + */ + public synchronized String getRedoPresentationName() { + return null; // TODO + } // getRedoPresentationName() + + /** + * undoableEditHappened + * @param value0 TODO + */ + public void undoableEditHappened(UndoableEditEvent value0) { + // TODO + } // undoableEditHappened() + + + } // UndoManager diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/UnsupportedLookAndFeelException.java gcc-3.3/libjava/javax/swing/UnsupportedLookAndFeelException.java *** gcc-3.2.3/libjava/javax/swing/UnsupportedLookAndFeelException.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/UnsupportedLookAndFeelException.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,47 ---- + /* UnsupportedLookAndFeelException.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + + public class UnsupportedLookAndFeelException extends Exception + { + UnsupportedLookAndFeelException(String a) + { + super(a); + } + } diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/ViewportLayout.java gcc-3.3/libjava/javax/swing/ViewportLayout.java *** gcc-3.2.3/libjava/javax/swing/ViewportLayout.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/ViewportLayout.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,111 ---- + /* ViewportLayout.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + // Imports + import java.awt.*; + import java.io.*; + + /** + * ViewportLayout + * @author Andrew Selkirk + * @version 1.0 + */ + public class ViewportLayout implements LayoutManager, Serializable { + + //------------------------------------------------------------- + // Initialization --------------------------------------------- + //------------------------------------------------------------- + + /** + * Constructor ViewportLayout + */ + public ViewportLayout() { + // TODO + } // ViewportLayout() + + + //------------------------------------------------------------- + // Methods ---------------------------------------------------- + //------------------------------------------------------------- + + /** + * addLayoutComponent + * @param name TODO + * @param c TODO + */ + public void addLayoutComponent(String name, Component c) { + // TODO + } // addLayoutComponent() + + /** + * removeLayoutComponent + * @param c TODO + */ + public void removeLayoutComponent(Component c) { + // TODO + } // removeLayoutComponent() + + /** + * preferredLayoutSize + * @param parent TODO + * @returns Dimension + */ + public Dimension preferredLayoutSize(Container parent) { + return null; // TODO + } // preferredLayoutSize() + + /** + * minimumLayoutSize + * @param parent TODO + * @returns Dimension + */ + public Dimension minimumLayoutSize(Container parent) { + return null; // TODO + } // minimumLayoutSize() + + /** + * layoutContainer + * @param parent TODO + */ + public void layoutContainer(Container parent) { + // TODO + } // layoutContainer() + + + } // ViewportLayout diff -Nrc3pad gcc-3.2.3/libjava/javax/swing/WindowConstants.java gcc-3.3/libjava/javax/swing/WindowConstants.java *** gcc-3.2.3/libjava/javax/swing/WindowConstants.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/javax/swing/WindowConstants.java 2002-08-09 04:26:10.000000000 +0000 *************** *** 0 **** --- 1,67 ---- + /* WindowConstants.java -- + Copyright (C) 2002 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + + package javax.swing; + + /** + * WindowConstants + * @author Andrew Selkirk + * @version 1.0 + */ + public interface WindowConstants { + + //------------------------------------------------------------- + // Variables -------------------------------------------------- + //------------------------------------------------------------- + + /** + * DO_NOTHING_ON_CLOSE + */ + public static final int DO_NOTHING_ON_CLOSE = 0; + + /** + * HIDE_ON_CLOSE + */ + public static final int HIDE_ON_CLOSE = 1; + + /** + * DISPOSE_ON_CLOSE + */ + public static final int DISPOSE_ON_CLOSE = 2; + + + } // WindowConstants diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/HeuristicCommitException.java gcc-3.3/libjava/javax/transaction/HeuristicCommitException.java *** gcc-3.2.3/libjava/javax/transaction/HeuristicCommitException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/HeuristicCommitException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* HeuristicCommitException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public class HeuristicCommitException extends java.lang.Exception { public HeuristicCommitException () { --- 43,49 ---- * @date May 25, 2001 */ ! public class HeuristicCommitException extends Exception { public HeuristicCommitException () { diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/HeuristicMixedException.java gcc-3.3/libjava/javax/transaction/HeuristicMixedException.java *** gcc-3.2.3/libjava/javax/transaction/HeuristicMixedException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/HeuristicMixedException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* HeuristicMixedException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public class HeuristicMixedException extends java.lang.Exception { public HeuristicMixedException () { --- 43,49 ---- * @date May 25, 2001 */ ! public class HeuristicMixedException extends Exception { public HeuristicMixedException () { diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/HeuristicRollbackException.java gcc-3.3/libjava/javax/transaction/HeuristicRollbackException.java *** gcc-3.2.3/libjava/javax/transaction/HeuristicRollbackException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/HeuristicRollbackException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* HeuristicRollbackException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public class HeuristicRollbackException extends java.lang.Exception { public HeuristicRollbackException () { --- 43,49 ---- * @date May 25, 2001 */ ! public class HeuristicRollbackException extends Exception { public HeuristicRollbackException () { diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/InvalidTransactionException.java gcc-3.3/libjava/javax/transaction/InvalidTransactionException.java *** gcc-3.2.3/libjava/javax/transaction/InvalidTransactionException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/InvalidTransactionException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.transaction; import java.rmi.RemoteException; --- 1,40 ---- ! /* InvalidTransactionException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + package javax.transaction; import java.rmi.RemoteException; diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/NotSupportedException.java gcc-3.3/libjava/javax/transaction/NotSupportedException.java *** gcc-3.2.3/libjava/javax/transaction/NotSupportedException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/NotSupportedException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* NotSupportedException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public class NotSupportedException extends java.lang.Exception { public NotSupportedException () { --- 43,49 ---- * @date May 25, 2001 */ ! public class NotSupportedException extends Exception { public NotSupportedException () { diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/RollbackException.java gcc-3.3/libjava/javax/transaction/RollbackException.java *** gcc-3.2.3/libjava/javax/transaction/RollbackException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/RollbackException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* RollbackException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public class RollbackException extends java.lang.Exception { public RollbackException () { --- 43,49 ---- * @date May 25, 2001 */ ! public class RollbackException extends Exception { public RollbackException () { diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/Status.java gcc-3.3/libjava/javax/transaction/Status.java *** gcc-3.2.3/libjava/javax/transaction/Status.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/Status.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* Status.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public abstract interface Status { public static final int STATUS_ACTIVE = 0; public static final int STATUS_MARKED_ROLLBACK = 1; --- 43,49 ---- * @date May 25, 2001 */ ! public interface Status { public static final int STATUS_ACTIVE = 0; public static final int STATUS_MARKED_ROLLBACK = 1; diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/Synchronization.java gcc-3.3/libjava/javax/transaction/Synchronization.java *** gcc-3.2.3/libjava/javax/transaction/Synchronization.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/Synchronization.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* Synchronization.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public abstract interface Synchronization { public void beforeCompletion(); public void afterCompletion(int status); --- 43,49 ---- * @date May 25, 2001 */ ! public interface Synchronization { public void beforeCompletion(); public void afterCompletion(int status); diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/SystemException.java gcc-3.3/libjava/javax/transaction/SystemException.java *** gcc-3.2.3/libjava/javax/transaction/SystemException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/SystemException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* SystemException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,19 **** * @date May 25, 2001 */ ! public class SystemException extends java.lang.Exception { public int errorCode; --- 43,49 ---- * @date May 25, 2001 */ ! public class SystemException extends Exception { public int errorCode; diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/Transaction.java gcc-3.3/libjava/javax/transaction/Transaction.java *** gcc-3.2.3/libjava/javax/transaction/Transaction.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/Transaction.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,12 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; import javax.transaction.xa.XAResource; /** --- 1,43 ---- ! /* Transaction.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; + import javax.transaction.xa.XAResource; /** *************** import javax.transaction.xa.XAResource; *** 14,33 **** * @date May 25, 2001 */ ! public abstract interface Transaction { public void commit() throws RollbackException, HeuristicMixedException, ! HeuristicRollbackException, java.lang.SecurityException, SystemException; public boolean delistResource(XAResource xaRes, int flag) ! throws java.lang.IllegalStateException, SystemException; public boolean enlistResource(XAResource xaRes) ! throws RollbackException, java.lang.IllegalStateException, SystemException; public int getStatus() throws SystemException; public void registerSynchronization(Synchronization sync) ! throws RollbackException, java.lang.IllegalStateException, SystemException; public void rollback() ! throws java.lang.IllegalStateException, SystemException; public void setRollbackOnly() ! throws java.lang.IllegalStateException, SystemException; } --- 45,70 ---- * @date May 25, 2001 */ ! public interface Transaction { public void commit() throws RollbackException, HeuristicMixedException, ! HeuristicRollbackException, SecurityException, SystemException; ! public boolean delistResource(XAResource xaRes, int flag) ! throws IllegalStateException, SystemException; ! public boolean enlistResource(XAResource xaRes) ! throws RollbackException, IllegalStateException, SystemException; ! public int getStatus() throws SystemException; + public void registerSynchronization(Synchronization sync) ! throws RollbackException, IllegalStateException, SystemException; ! public void rollback() ! throws IllegalStateException, SystemException; ! public void setRollbackOnly() ! throws IllegalStateException, SystemException; } diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/TransactionManager.java gcc-3.3/libjava/javax/transaction/TransactionManager.java *** gcc-3.2.3/libjava/javax/transaction/TransactionManager.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/TransactionManager.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* TransactionManager.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,35 **** * @date May 25, 2001 */ ! public abstract interface TransactionManager { public void begin() throws NotSupportedException, SystemException; public void commit() throws RollbackException, HeuristicMixedException, ! HeuristicRollbackException, java.lang.SecurityException, ! java.lang.IllegalStateException, SystemException; public int getStatus() throws SystemException; public Transaction getTransaction() throws SystemException; public void resume(Transaction tobj) ! throws InvalidTransactionException, java.lang.IllegalStateException, SystemException; public void rollback() ! throws java.lang.IllegalStateException, java.lang.SecurityException, ! SystemException; public void setRollbackOnly() ! throws java.lang.IllegalStateException, SystemException; public void setTransactionTimeout(int seconds) throws SystemException; public Transaction suspend() throws SystemException; } --- 43,72 ---- * @date May 25, 2001 */ ! public interface TransactionManager { public void begin() throws NotSupportedException, SystemException; + public void commit() throws RollbackException, HeuristicMixedException, ! HeuristicRollbackException, SecurityException, ! IllegalStateException, SystemException; ! public int getStatus() throws SystemException; + public Transaction getTransaction() throws SystemException; + public void resume(Transaction tobj) ! throws InvalidTransactionException, IllegalStateException, SystemException; + public void rollback() ! throws IllegalStateException, SecurityException, SystemException; ! public void setRollbackOnly() ! throws IllegalStateException, SystemException; ! public void setTransactionTimeout(int seconds) throws SystemException; + public Transaction suspend() throws SystemException; } diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/TransactionRequiredException.java gcc-3.3/libjava/javax/transaction/TransactionRequiredException.java *** gcc-3.2.3/libjava/javax/transaction/TransactionRequiredException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/TransactionRequiredException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.transaction; import java.rmi.RemoteException; --- 1,40 ---- ! /* TransactionRequiredException -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + package javax.transaction; import java.rmi.RemoteException; diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/TransactionRolledbackException.java gcc-3.3/libjava/javax/transaction/TransactionRolledbackException.java *** gcc-3.2.3/libjava/javax/transaction/TransactionRolledbackException.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/TransactionRolledbackException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.transaction; import java.rmi.RemoteException; --- 1,40 ---- ! /* TransactionRolledbackException -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + package javax.transaction; import java.rmi.RemoteException; diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/UserTransaction.java gcc-3.3/libjava/javax/transaction/UserTransaction.java *** gcc-3.2.3/libjava/javax/transaction/UserTransaction.java 2001-10-24 21:39:23.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/UserTransaction.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation - This file is part of libgcj. - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - package javax.transaction; /** --- 1,41 ---- ! /* UserTransaction.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! ! This file is part of GNU Classpath. ! ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. ! ! GNU Classpath is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with GNU Classpath; see the file COPYING. If not, write to the ! Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. ! ! Linking this library statically or dynamically with other modules is ! making a combined work based on this library. Thus, the terms and ! conditions of the GNU General Public License cover the whole ! combination. ! ! As a special exception, the copyright holders of this library give you ! permission to link this library with independent modules to produce an ! executable, regardless of the license terms of these independent ! modules, and to copy and distribute the resulting executable under ! terms of your choice, provided that you also meet, for each linked ! independent module, the terms and conditions of the license of that ! module. An independent module is a module which is not derived from ! or based on this library. If you modify this library, you may extend ! this exception to your version of the library, but you are not ! obligated to do so. If you do not wish to do so, delete this ! exception statement from your version. */ package javax.transaction; /** *************** package javax.transaction; *** 13,30 **** * @date May 25, 2001 */ ! public abstract interface UserTransaction { public void begin() throws NotSupportedException, SystemException; public void commit() throws RollbackException, HeuristicMixedException, ! HeuristicRollbackException, java.lang.SecurityException, ! java.lang.IllegalStateException, SystemException; public void rollback() ! throws java.lang.IllegalStateException, java.lang.SecurityException, ! SystemException; public void setRollbackOnly() ! throws java.lang.IllegalStateException, SystemException; public int getStatus() throws SystemException; public void setTransactionTimeout(int seconds) throws SystemException; } --- 43,64 ---- * @date May 25, 2001 */ ! public interface UserTransaction { public void begin() throws NotSupportedException, SystemException; + public void commit() throws RollbackException, HeuristicMixedException, ! HeuristicRollbackException, SecurityException, ! IllegalStateException, SystemException; ! public void rollback() ! throws IllegalStateException, SecurityException, SystemException; ! public void setRollbackOnly() ! throws IllegalStateException, SystemException; ! public int getStatus() throws SystemException; + public void setTransactionTimeout(int seconds) throws SystemException; } diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/xa/XAException.java gcc-3.3/libjava/javax/transaction/xa/XAException.java *** gcc-3.2.3/libjava/javax/transaction/xa/XAException.java 2001-10-24 21:39:24.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/xa/XAException.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.transaction.xa; /** --- 1,40 ---- ! /* XAException.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + package javax.transaction.xa; /** diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/xa/XAResource.java gcc-3.3/libjava/javax/transaction/xa/XAResource.java *** gcc-3.2.3/libjava/javax/transaction/xa/XAResource.java 2001-10-24 21:39:24.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/xa/XAResource.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.transaction.xa; /** --- 1,40 ---- ! /* XAResource.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + package javax.transaction.xa; /** *************** package javax.transaction.xa; *** 13,19 **** * @date May 25, 2001 */ ! public abstract interface XAResource { public static final int TMENDRSCAN = 8388608; public static final int TMFAIL = 536870912; --- 42,48 ---- * @date May 25, 2001 */ ! public interface XAResource { public static final int TMENDRSCAN = 8388608; public static final int TMFAIL = 536870912; diff -Nrc3pad gcc-3.2.3/libjava/javax/transaction/xa/Xid.java gcc-3.3/libjava/javax/transaction/xa/Xid.java *** gcc-3.2.3/libjava/javax/transaction/xa/Xid.java 2001-10-24 21:39:24.000000000 +0000 --- gcc-3.3/libjava/javax/transaction/xa/Xid.java 2002-11-26 22:48:42.000000000 +0000 *************** *** 1,11 **** ! /* Copyright (C) 2001 Free Software Foundation ! This file is part of libgcj. ! This software is copyrighted work licensed under the terms of the ! Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ! details. */ package javax.transaction.xa; /** --- 1,40 ---- ! /* Xid.java -- ! Copyright (C) 2001, 2002 Free Software Foundation, Inc. ! This file is part of GNU Classpath. ! GNU Classpath is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) ! any later version. + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ + package javax.transaction.xa; /** *************** package javax.transaction.xa; *** 13,19 **** * @date May 25, 2001 */ ! public abstract interface Xid { public static final int MAXGTRIDSIZE = 64; public static final int MAXBQUALSIZE = 64; --- 42,48 ---- * @date May 25, 2001 */ ! public interface Xid { public static final int MAXGTRIDSIZE = 64; public static final int MAXBQUALSIZE = 64; diff -Nrc3pad gcc-3.2.3/libjava/jni.cc gcc-3.3/libjava/jni.cc *** gcc-3.2.3/libjava/jni.cc 2002-03-05 22:40:01.000000000 +0000 --- gcc-3.3/libjava/jni.cc 2003-02-12 23:39:12.000000000 +0000 *************** *** 1,6 **** // jni.cc - JNI implementation, including the jump table. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // jni.cc - JNI implementation, including the jump table. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 10,15 **** --- 10,16 ---- #include + #include #include #include *************** unwrap (T *obj) *** 217,223 **** static jobject ! _Jv_JNI_NewGlobalRef (JNIEnv *, jobject obj) { // This seems weird but I think it is correct. obj = unwrap (obj); --- 218,224 ---- static jobject ! (JNICALL _Jv_JNI_NewGlobalRef) (JNIEnv *, jobject obj) { // This seems weird but I think it is correct. obj = unwrap (obj); *************** _Jv_JNI_NewGlobalRef (JNIEnv *, jobject *** 226,232 **** } static void ! _Jv_JNI_DeleteGlobalRef (JNIEnv *, jobject obj) { // This seems weird but I think it is correct. obj = unwrap (obj); --- 227,233 ---- } static void ! (JNICALL _Jv_JNI_DeleteGlobalRef) (JNIEnv *, jobject obj) { // This seems weird but I think it is correct. obj = unwrap (obj); *************** _Jv_JNI_DeleteGlobalRef (JNIEnv *, jobje *** 234,240 **** } static void ! _Jv_JNI_DeleteLocalRef (JNIEnv *env, jobject obj) { _Jv_JNI_LocalFrame *frame; --- 235,241 ---- } static void ! (JNICALL _Jv_JNI_DeleteLocalRef) (JNIEnv *env, jobject obj) { _Jv_JNI_LocalFrame *frame; *************** _Jv_JNI_DeleteLocalRef (JNIEnv *env, job *** 261,267 **** } static jint ! _Jv_JNI_EnsureLocalCapacity (JNIEnv *env, jint size) { // It is easier to just always allocate a new frame of the requested // size. This isn't the most efficient thing, but for now we don't --- 262,268 ---- } static jint ! (JNICALL _Jv_JNI_EnsureLocalCapacity) (JNIEnv *env, jint size) { // It is easier to just always allocate a new frame of the requested // size. This isn't the most efficient thing, but for now we don't *************** _Jv_JNI_EnsureLocalCapacity (JNIEnv *env *** 289,295 **** } static jint ! _Jv_JNI_PushLocalFrame (JNIEnv *env, jint size) { jint r = _Jv_JNI_EnsureLocalCapacity (env, size); if (r < 0) --- 290,296 ---- } static jint ! (JNICALL _Jv_JNI_PushLocalFrame) (JNIEnv *env, jint size) { jint r = _Jv_JNI_EnsureLocalCapacity (env, size); if (r < 0) *************** _Jv_JNI_PushLocalFrame (JNIEnv *env, jin *** 302,308 **** } static jobject ! _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj) { // This seems weird but I think it is correct. obj = unwrap (obj); --- 303,309 ---- } static jobject ! (JNICALL _Jv_JNI_NewLocalRef) (JNIEnv *env, jobject obj) { // This seems weird but I think it is correct. obj = unwrap (obj); *************** _Jv_JNI_NewLocalRef (JNIEnv *env, jobjec *** 343,349 **** } static jobject ! _Jv_JNI_PopLocalFrame (JNIEnv *env, jobject result, int stop) { _Jv_JNI_LocalFrame *rf = env->locals; --- 344,350 ---- } static jobject ! (JNICALL _Jv_JNI_PopLocalFrame) (JNIEnv *env, jobject result, int stop) { _Jv_JNI_LocalFrame *rf = env->locals; *************** _Jv_JNI_PopLocalFrame (JNIEnv *env, jobj *** 378,384 **** } static jobject ! _Jv_JNI_PopLocalFrame (JNIEnv *env, jobject result) { return _Jv_JNI_PopLocalFrame (env, result, MARK_USER); } --- 379,385 ---- } static jobject ! (JNICALL _Jv_JNI_PopLocalFrame) (JNIEnv *env, jobject result) { return _Jv_JNI_PopLocalFrame (env, result, MARK_USER); } *************** wrap_value (JNIEnv *env, T *value) *** 422,440 **** static jint ! _Jv_JNI_GetVersion (JNIEnv *) { ! return JNI_VERSION_1_2; } static jclass ! _Jv_JNI_DefineClass (JNIEnv *env, jobject loader, ! const jbyte *buf, jsize bufLen) { try { loader = unwrap (loader); jbyteArray bytes = JvNewByteArray (bufLen); jbyte *elts = elements (bytes); --- 423,442 ---- static jint ! (JNICALL _Jv_JNI_GetVersion) (JNIEnv *) { ! return JNI_VERSION_1_4; } static jclass ! (JNICALL _Jv_JNI_DefineClass) (JNIEnv *env, const char *name, jobject loader, ! const jbyte *buf, jsize bufLen) { try { loader = unwrap (loader); + jstring sname = JvNewStringUTF (name); jbyteArray bytes = JvNewByteArray (bufLen); jbyte *elts = elements (bytes); *************** _Jv_JNI_DefineClass (JNIEnv *env, jobjec *** 443,449 **** java::lang::ClassLoader *l = reinterpret_cast (loader); ! jclass result = l->defineClass (bytes, 0, bufLen); return (jclass) wrap_value (env, result); } catch (jthrowable t) --- 445,451 ---- java::lang::ClassLoader *l = reinterpret_cast (loader); ! jclass result = l->defineClass (sname, bytes, 0, bufLen); return (jclass) wrap_value (env, result); } catch (jthrowable t) *************** _Jv_JNI_DefineClass (JNIEnv *env, jobjec *** 454,460 **** } static jclass ! _Jv_JNI_FindClass (JNIEnv *env, const char *name) { // FIXME: assume that NAME isn't too long. int len = strlen (name); --- 456,462 ---- } static jclass ! (JNICALL _Jv_JNI_FindClass) (JNIEnv *env, const char *name) { // FIXME: assume that NAME isn't too long. int len = strlen (name); *************** _Jv_JNI_FindClass (JNIEnv *env, const ch *** 490,508 **** } static jclass ! _Jv_JNI_GetSuperclass (JNIEnv *env, jclass clazz) { return (jclass) wrap_value (env, unwrap (clazz)->getSuperclass ()); } static jboolean ! _Jv_JNI_IsAssignableFrom(JNIEnv *, jclass clazz1, jclass clazz2) { return unwrap (clazz1)->isAssignableFrom (unwrap (clazz2)); } static jint ! _Jv_JNI_Throw (JNIEnv *env, jthrowable obj) { // We check in case the user did some funky cast. obj = unwrap (obj); --- 492,510 ---- } static jclass ! (JNICALL _Jv_JNI_GetSuperclass) (JNIEnv *env, jclass clazz) { return (jclass) wrap_value (env, unwrap (clazz)->getSuperclass ()); } static jboolean ! (JNICALL _Jv_JNI_IsAssignableFrom) (JNIEnv *, jclass clazz1, jclass clazz2) { return unwrap (clazz1)->isAssignableFrom (unwrap (clazz2)); } static jint ! (JNICALL _Jv_JNI_Throw) (JNIEnv *env, jthrowable obj) { // We check in case the user did some funky cast. obj = unwrap (obj); *************** _Jv_JNI_Throw (JNIEnv *env, jthrowable o *** 512,518 **** } static jint ! _Jv_JNI_ThrowNew (JNIEnv *env, jclass clazz, const char *message) { using namespace java::lang::reflect; --- 514,520 ---- } static jint ! (JNICALL _Jv_JNI_ThrowNew) (JNIEnv *env, jclass clazz, const char *message) { using namespace java::lang::reflect; *************** _Jv_JNI_ThrowNew (JNIEnv *env, jclass cl *** 549,580 **** } static jthrowable ! _Jv_JNI_ExceptionOccurred (JNIEnv *env) { return (jthrowable) wrap_value (env, env->ex); } static void ! _Jv_JNI_ExceptionDescribe (JNIEnv *env) { if (env->ex != NULL) env->ex->printStackTrace(); } static void ! _Jv_JNI_ExceptionClear (JNIEnv *env) { env->ex = NULL; } static jboolean ! _Jv_JNI_ExceptionCheck (JNIEnv *env) { return env->ex != NULL; } static void ! _Jv_JNI_FatalError (JNIEnv *, const char *message) { JvFail (message); } --- 551,582 ---- } static jthrowable ! (JNICALL _Jv_JNI_ExceptionOccurred) (JNIEnv *env) { return (jthrowable) wrap_value (env, env->ex); } static void ! (JNICALL _Jv_JNI_ExceptionDescribe) (JNIEnv *env) { if (env->ex != NULL) env->ex->printStackTrace(); } static void ! (JNICALL _Jv_JNI_ExceptionClear) (JNIEnv *env) { env->ex = NULL; } static jboolean ! (JNICALL _Jv_JNI_ExceptionCheck) (JNIEnv *env) { return env->ex != NULL; } static void ! (JNICALL _Jv_JNI_FatalError) (JNIEnv *, const char *message) { JvFail (message); } *************** _Jv_JNI_FatalError (JNIEnv *, const char *** 582,594 **** static jboolean ! _Jv_JNI_IsSameObject (JNIEnv *, jobject obj1, jobject obj2) { return unwrap (obj1) == unwrap (obj2); } static jobject ! _Jv_JNI_AllocObject (JNIEnv *env, jclass clazz) { jobject obj = NULL; using namespace java::lang::reflect; --- 584,596 ---- static jboolean ! (JNICALL _Jv_JNI_IsSameObject) (JNIEnv *, jobject obj1, jobject obj2) { return unwrap (obj1) == unwrap (obj2); } static jobject ! (JNICALL _Jv_JNI_AllocObject) (JNIEnv *env, jclass clazz) { jobject obj = NULL; using namespace java::lang::reflect; *************** _Jv_JNI_AllocObject (JNIEnv *env, jclass *** 600,609 **** if (clazz->isInterface() || Modifier::isAbstract(clazz->getModifiers())) env->ex = new java::lang::InstantiationException (); else ! { ! // FIXME: will this work for String? ! obj = JvAllocObject (clazz); ! } } catch (jthrowable t) { --- 602,608 ---- if (clazz->isInterface() || Modifier::isAbstract(clazz->getModifiers())) env->ex = new java::lang::InstantiationException (); else ! obj = JvAllocObject (clazz); } catch (jthrowable t) { *************** _Jv_JNI_AllocObject (JNIEnv *env, jclass *** 614,620 **** } static jclass ! _Jv_JNI_GetObjectClass (JNIEnv *env, jobject obj) { obj = unwrap (obj); JvAssert (obj); --- 613,619 ---- } static jclass ! (JNICALL _Jv_JNI_GetObjectClass) (JNIEnv *env, jobject obj) { obj = unwrap (obj); JvAssert (obj); *************** _Jv_JNI_GetObjectClass (JNIEnv *env, job *** 622,628 **** } static jboolean ! _Jv_JNI_IsInstanceOf (JNIEnv *, jobject obj, jclass clazz) { return unwrap (clazz)->isInstance(unwrap (obj)); } --- 621,627 ---- } static jboolean ! (JNICALL _Jv_JNI_IsInstanceOf) (JNIEnv *, jobject obj, jclass clazz) { return unwrap (clazz)->isInstance(unwrap (obj)); } *************** _Jv_JNI_IsInstanceOf (JNIEnv *, jobject *** 635,642 **** template static jmethodID ! _Jv_JNI_GetAnyMethodID (JNIEnv *env, jclass clazz, ! const char *name, const char *sig) { try { --- 634,641 ---- template static jmethodID ! (JNICALL _Jv_JNI_GetAnyMethodID) (JNIEnv *env, jclass clazz, ! const char *name, const char *sig) { try { *************** array_from_valist (jvalue *values, JArra *** 694,711 **** jclass *arg_elts = elements (arg_types); for (int i = 0; i < arg_types->length; ++i) { if (arg_elts[i] == JvPrimClass (byte)) values[i].b = (jbyte) va_arg (vargs, int); else if (arg_elts[i] == JvPrimClass (short)) values[i].s = (jshort) va_arg (vargs, int); else if (arg_elts[i] == JvPrimClass (int)) ! values[i].i = va_arg (vargs, jint); else if (arg_elts[i] == JvPrimClass (long)) ! values[i].j = va_arg (vargs, jlong); else if (arg_elts[i] == JvPrimClass (float)) ! values[i].f = va_arg (vargs, jfloat); else if (arg_elts[i] == JvPrimClass (double)) ! values[i].d = va_arg (vargs, jdouble); else if (arg_elts[i] == JvPrimClass (boolean)) values[i].z = (jboolean) va_arg (vargs, int); else if (arg_elts[i] == JvPrimClass (char)) --- 693,719 ---- jclass *arg_elts = elements (arg_types); for (int i = 0; i < arg_types->length; ++i) { + // Here we assume that sizeof(int) >= sizeof(jint), because we + // use `int' when decoding the varargs. Likewise for + // float, and double. Also we assume that sizeof(jlong) >= + // sizeof(int), i.e. that jlong values are not further + // promoted. + JvAssert (sizeof (int) >= sizeof (jint)); + JvAssert (sizeof (jlong) >= sizeof (int)); + JvAssert (sizeof (double) >= sizeof (jfloat)); + JvAssert (sizeof (double) >= sizeof (jdouble)); if (arg_elts[i] == JvPrimClass (byte)) values[i].b = (jbyte) va_arg (vargs, int); else if (arg_elts[i] == JvPrimClass (short)) values[i].s = (jshort) va_arg (vargs, int); else if (arg_elts[i] == JvPrimClass (int)) ! values[i].i = (jint) va_arg (vargs, int); else if (arg_elts[i] == JvPrimClass (long)) ! values[i].j = (jlong) va_arg (vargs, jlong); else if (arg_elts[i] == JvPrimClass (float)) ! values[i].f = (jfloat) va_arg (vargs, double); else if (arg_elts[i] == JvPrimClass (double)) ! values[i].d = (jdouble) va_arg (vargs, double); else if (arg_elts[i] == JvPrimClass (boolean)) values[i].z = (jboolean) va_arg (vargs, int); else if (arg_elts[i] == JvPrimClass (char)) *************** array_from_valist (jvalue *values, JArra *** 722,729 **** // constructor. template static T ! _Jv_JNI_CallAnyMethodV (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, va_list vargs) { obj = unwrap (obj); klass = unwrap (klass); --- 730,737 ---- // constructor. template static T ! (JNICALL _Jv_JNI_CallAnyMethodV) (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, va_list vargs) { obj = unwrap (obj); klass = unwrap (klass); *************** _Jv_JNI_CallAnyMethodV (JNIEnv *env, job *** 770,777 **** template static T ! _Jv_JNI_CallAnyMethod (JNIEnv *env, jobject obj, jclass klass, ! jmethodID method, ...) { va_list args; T result; --- 778,785 ---- template static T ! (JNICALL _Jv_JNI_CallAnyMethod) (JNIEnv *env, jobject obj, jclass klass, ! jmethodID method, ...) { va_list args; T result; *************** _Jv_JNI_CallAnyMethod (JNIEnv *env, jobj *** 785,792 **** template static T ! _Jv_JNI_CallAnyMethodA (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, jvalue *args) { obj = unwrap (obj); klass = unwrap (klass); --- 793,800 ---- template static T ! (JNICALL _Jv_JNI_CallAnyMethodA) (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, jvalue *args) { obj = unwrap (obj); klass = unwrap (klass); *************** _Jv_JNI_CallAnyMethodA (JNIEnv *env, job *** 840,847 **** template static void ! _Jv_JNI_CallAnyVoidMethodV (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, va_list vargs) { obj = unwrap (obj); klass = unwrap (klass); --- 848,855 ---- template static void ! (JNICALL _Jv_JNI_CallAnyVoidMethodV) (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, va_list vargs) { obj = unwrap (obj); klass = unwrap (klass); *************** _Jv_JNI_CallAnyVoidMethodV (JNIEnv *env, *** 881,888 **** template static void ! _Jv_JNI_CallAnyVoidMethod (JNIEnv *env, jobject obj, jclass klass, ! jmethodID method, ...) { va_list args; --- 889,896 ---- template static void ! (JNICALL _Jv_JNI_CallAnyVoidMethod) (JNIEnv *env, jobject obj, jclass klass, ! jmethodID method, ...) { va_list args; *************** _Jv_JNI_CallAnyVoidMethod (JNIEnv *env, *** 893,900 **** template static void ! _Jv_JNI_CallAnyVoidMethodA (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, jvalue *args) { if (style == normal) id = _Jv_LookupDeclaredMethod (obj->getClass (), id->name, id->signature); --- 901,908 ---- template static void ! (JNICALL _Jv_JNI_CallAnyVoidMethodA) (JNIEnv *env, jobject obj, jclass klass, ! jmethodID id, jvalue *args) { if (style == normal) id = _Jv_LookupDeclaredMethod (obj->getClass (), id->name, id->signature); *************** _Jv_JNI_CallAnyVoidMethodA (JNIEnv *env, *** 937,943 **** // the CallMethod family. template static T ! _Jv_JNI_CallMethodV (JNIEnv *env, jobject obj, jmethodID id, va_list args) { return _Jv_JNI_CallAnyMethodV (env, obj, NULL, id, args); } --- 945,952 ---- // the CallMethod family. template static T ! (JNICALL _Jv_JNI_CallMethodV) (JNIEnv *env, jobject obj, ! jmethodID id, va_list args) { return _Jv_JNI_CallAnyMethodV (env, obj, NULL, id, args); } *************** _Jv_JNI_CallMethodV (JNIEnv *env, jobjec *** 946,952 **** // the CallMethod family. template static T ! _Jv_JNI_CallMethod (JNIEnv *env, jobject obj, jmethodID id, ...) { va_list args; T result; --- 955,961 ---- // the CallMethod family. template static T ! (JNICALL _Jv_JNI_CallMethod) (JNIEnv *env, jobject obj, jmethodID id, ...) { va_list args; T result; *************** _Jv_JNI_CallMethod (JNIEnv *env, jobject *** 962,980 **** // the CallMethod family. template static T ! _Jv_JNI_CallMethodA (JNIEnv *env, jobject obj, jmethodID id, jvalue *args) { return _Jv_JNI_CallAnyMethodA (env, obj, NULL, id, args); } static void ! _Jv_JNI_CallVoidMethodV (JNIEnv *env, jobject obj, jmethodID id, va_list args) { _Jv_JNI_CallAnyVoidMethodV (env, obj, NULL, id, args); } static void ! _Jv_JNI_CallVoidMethod (JNIEnv *env, jobject obj, jmethodID id, ...) { va_list args; --- 971,991 ---- // the CallMethod family. template static T ! (JNICALL _Jv_JNI_CallMethodA) (JNIEnv *env, jobject obj, ! jmethodID id, jvalue *args) { return _Jv_JNI_CallAnyMethodA (env, obj, NULL, id, args); } static void ! (JNICALL _Jv_JNI_CallVoidMethodV) (JNIEnv *env, jobject obj, ! jmethodID id, va_list args) { _Jv_JNI_CallAnyVoidMethodV (env, obj, NULL, id, args); } static void ! (JNICALL _Jv_JNI_CallVoidMethod) (JNIEnv *env, jobject obj, jmethodID id, ...) { va_list args; *************** _Jv_JNI_CallVoidMethod (JNIEnv *env, job *** 984,990 **** } static void ! _Jv_JNI_CallVoidMethodA (JNIEnv *env, jobject obj, jmethodID id, jvalue *args) { _Jv_JNI_CallAnyVoidMethodA (env, obj, NULL, id, args); } --- 995,1002 ---- } static void ! (JNICALL _Jv_JNI_CallVoidMethodA) (JNIEnv *env, jobject obj, ! jmethodID id, jvalue *args) { _Jv_JNI_CallAnyVoidMethodA (env, obj, NULL, id, args); } *************** _Jv_JNI_CallVoidMethodA (JNIEnv *env, jo *** 993,1000 **** // the CallStaticMethod family. template static T ! _Jv_JNI_CallStaticMethodV (JNIEnv *env, jclass klass, ! jmethodID id, va_list args) { JvAssert (((id->accflags) & java::lang::reflect::Modifier::STATIC)); JvAssert (java::lang::Class::class$.isInstance (unwrap (klass))); --- 1005,1012 ---- // the CallStaticMethod family. template static T ! (JNICALL _Jv_JNI_CallStaticMethodV) (JNIEnv *env, jclass klass, ! jmethodID id, va_list args) { JvAssert (((id->accflags) & java::lang::reflect::Modifier::STATIC)); JvAssert (java::lang::Class::class$.isInstance (unwrap (klass))); *************** _Jv_JNI_CallStaticMethodV (JNIEnv *env, *** 1006,1012 **** // the CallStaticMethod family. template static T ! _Jv_JNI_CallStaticMethod (JNIEnv *env, jclass klass, jmethodID id, ...) { va_list args; T result; --- 1018,1025 ---- // the CallStaticMethod family. template static T ! (JNICALL _Jv_JNI_CallStaticMethod) (JNIEnv *env, jclass klass, ! jmethodID id, ...) { va_list args; T result; *************** _Jv_JNI_CallStaticMethod (JNIEnv *env, j *** 1026,1033 **** // the CallStaticMethod family. template static T ! _Jv_JNI_CallStaticMethodA (JNIEnv *env, jclass klass, jmethodID id, ! jvalue *args) { JvAssert (((id->accflags) & java::lang::reflect::Modifier::STATIC)); JvAssert (java::lang::Class::class$.isInstance (unwrap (klass))); --- 1039,1046 ---- // the CallStaticMethod family. template static T ! (JNICALL _Jv_JNI_CallStaticMethodA) (JNIEnv *env, jclass klass, jmethodID id, ! jvalue *args) { JvAssert (((id->accflags) & java::lang::reflect::Modifier::STATIC)); JvAssert (java::lang::Class::class$.isInstance (unwrap (klass))); *************** _Jv_JNI_CallStaticMethodA (JNIEnv *env, *** 1036,1049 **** } static void ! _Jv_JNI_CallStaticVoidMethodV (JNIEnv *env, jclass klass, jmethodID id, ! va_list args) { _Jv_JNI_CallAnyVoidMethodV (env, NULL, klass, id, args); } static void ! _Jv_JNI_CallStaticVoidMethod (JNIEnv *env, jclass klass, jmethodID id, ...) { va_list args; --- 1049,1063 ---- } static void ! (JNICALL _Jv_JNI_CallStaticVoidMethodV) (JNIEnv *env, jclass klass, ! jmethodID id, va_list args) { _Jv_JNI_CallAnyVoidMethodV (env, NULL, klass, id, args); } static void ! (JNICALL _Jv_JNI_CallStaticVoidMethod) (JNIEnv *env, jclass klass, ! jmethodID id, ...) { va_list args; *************** _Jv_JNI_CallStaticVoidMethod (JNIEnv *en *** 1053,1067 **** } static void ! _Jv_JNI_CallStaticVoidMethodA (JNIEnv *env, jclass klass, jmethodID id, ! jvalue *args) { _Jv_JNI_CallAnyVoidMethodA (env, NULL, klass, id, args); } static jobject ! _Jv_JNI_NewObjectV (JNIEnv *env, jclass klass, ! jmethodID id, va_list args) { JvAssert (klass && ! klass->isArray ()); JvAssert (! strcmp (id->name->data, "") --- 1067,1081 ---- } static void ! (JNICALL _Jv_JNI_CallStaticVoidMethodA) (JNIEnv *env, jclass klass, ! jmethodID id, jvalue *args) { _Jv_JNI_CallAnyVoidMethodA (env, NULL, klass, id, args); } static jobject ! (JNICALL _Jv_JNI_NewObjectV) (JNIEnv *env, jclass klass, ! jmethodID id, va_list args) { JvAssert (klass && ! klass->isArray ()); JvAssert (! strcmp (id->name->data, "") *************** _Jv_JNI_NewObjectV (JNIEnv *env, jclass *** 1075,1081 **** } static jobject ! _Jv_JNI_NewObject (JNIEnv *env, jclass klass, jmethodID id, ...) { JvAssert (klass && ! klass->isArray ()); JvAssert (! strcmp (id->name->data, "") --- 1089,1095 ---- } static jobject ! (JNICALL _Jv_JNI_NewObject) (JNIEnv *env, jclass klass, jmethodID id, ...) { JvAssert (klass && ! klass->isArray ()); JvAssert (! strcmp (id->name->data, "") *************** _Jv_JNI_NewObject (JNIEnv *env, jclass k *** 1096,1103 **** } static jobject ! _Jv_JNI_NewObjectA (JNIEnv *env, jclass klass, jmethodID id, ! jvalue *args) { JvAssert (klass && ! klass->isArray ()); JvAssert (! strcmp (id->name->data, "") --- 1110,1117 ---- } static jobject ! (JNICALL _Jv_JNI_NewObjectA) (JNIEnv *env, jclass klass, jmethodID id, ! jvalue *args) { JvAssert (klass && ! klass->isArray ()); JvAssert (! strcmp (id->name->data, "") *************** _Jv_JNI_NewObjectA (JNIEnv *env, jclass *** 1114,1120 **** template static T ! _Jv_JNI_GetField (JNIEnv *env, jobject obj, jfieldID field) { obj = unwrap (obj); JvAssert (obj); --- 1128,1134 ---- template static T ! (JNICALL _Jv_JNI_GetField) (JNIEnv *env, jobject obj, jfieldID field) { obj = unwrap (obj); JvAssert (obj); *************** _Jv_JNI_GetField (JNIEnv *env, jobject o *** 1124,1130 **** template static void ! _Jv_JNI_SetField (JNIEnv *, jobject obj, jfieldID field, T value) { obj = unwrap (obj); value = unwrap (value); --- 1138,1144 ---- template static void ! (JNICALL _Jv_JNI_SetField) (JNIEnv *, jobject obj, jfieldID field, T value) { obj = unwrap (obj); value = unwrap (value); *************** _Jv_JNI_SetField (JNIEnv *, jobject obj, *** 1136,1143 **** template static jfieldID ! _Jv_JNI_GetAnyFieldID (JNIEnv *env, jclass clazz, ! const char *name, const char *sig) { try { --- 1150,1157 ---- template static jfieldID ! (JNICALL _Jv_JNI_GetAnyFieldID) (JNIEnv *env, jclass clazz, ! const char *name, const char *sig) { try { *************** _Jv_JNI_GetAnyFieldID (JNIEnv *env, jcla *** 1197,1203 **** template static T ! _Jv_JNI_GetStaticField (JNIEnv *env, jclass, jfieldID field) { T *ptr = (T *) field->u.addr; return wrap_value (env, *ptr); --- 1211,1217 ---- template static T ! (JNICALL _Jv_JNI_GetStaticField) (JNIEnv *env, jclass, jfieldID field) { T *ptr = (T *) field->u.addr; return wrap_value (env, *ptr); *************** _Jv_JNI_GetStaticField (JNIEnv *env, jcl *** 1205,1211 **** template static void ! _Jv_JNI_SetStaticField (JNIEnv *, jclass, jfieldID field, T value) { value = unwrap (value); T *ptr = (T *) field->u.addr; --- 1219,1225 ---- template static void ! (JNICALL _Jv_JNI_SetStaticField) (JNIEnv *, jclass, jfieldID field, T value) { value = unwrap (value); T *ptr = (T *) field->u.addr; *************** _Jv_JNI_SetStaticField (JNIEnv *, jclass *** 1213,1219 **** } static jstring ! _Jv_JNI_NewString (JNIEnv *env, const jchar *unichars, jsize len) { try { --- 1227,1233 ---- } static jstring ! (JNICALL _Jv_JNI_NewString) (JNIEnv *env, const jchar *unichars, jsize len) { try { *************** _Jv_JNI_NewString (JNIEnv *env, const jc *** 1228,1240 **** } static jsize ! _Jv_JNI_GetStringLength (JNIEnv *, jstring string) { return unwrap (string)->length(); } static const jchar * ! _Jv_JNI_GetStringChars (JNIEnv *, jstring string, jboolean *isCopy) { string = unwrap (string); jchar *result = _Jv_GetStringChars (string); --- 1242,1254 ---- } static jsize ! (JNICALL _Jv_JNI_GetStringLength) (JNIEnv *, jstring string) { return unwrap (string)->length(); } static const jchar * ! (JNICALL _Jv_JNI_GetStringChars) (JNIEnv *, jstring string, jboolean *isCopy) { string = unwrap (string); jchar *result = _Jv_GetStringChars (string); *************** _Jv_JNI_GetStringChars (JNIEnv *, jstrin *** 1245,1257 **** } static void ! _Jv_JNI_ReleaseStringChars (JNIEnv *, jstring string, const jchar *) { unmark_for_gc (unwrap (string), global_ref_table); } static jstring ! _Jv_JNI_NewStringUTF (JNIEnv *env, const char *bytes) { try { --- 1259,1271 ---- } static void ! (JNICALL _Jv_JNI_ReleaseStringChars) (JNIEnv *, jstring string, const jchar *) { unmark_for_gc (unwrap (string), global_ref_table); } static jstring ! (JNICALL _Jv_JNI_NewStringUTF) (JNIEnv *env, const char *bytes) { try { *************** _Jv_JNI_NewStringUTF (JNIEnv *env, const *** 1266,1278 **** } static jsize ! _Jv_JNI_GetStringUTFLength (JNIEnv *, jstring string) { return JvGetStringUTFLength (unwrap (string)); } static const char * ! _Jv_JNI_GetStringUTFChars (JNIEnv *env, jstring string, jboolean *isCopy) { string = unwrap (string); jsize len = JvGetStringUTFLength (string); --- 1280,1293 ---- } static jsize ! (JNICALL _Jv_JNI_GetStringUTFLength) (JNIEnv *, jstring string) { return JvGetStringUTFLength (unwrap (string)); } static const char * ! (JNICALL _Jv_JNI_GetStringUTFChars) (JNIEnv *env, jstring string, ! jboolean *isCopy) { string = unwrap (string); jsize len = JvGetStringUTFLength (string); *************** _Jv_JNI_GetStringUTFChars (JNIEnv *env, *** 1295,1308 **** } static void ! _Jv_JNI_ReleaseStringUTFChars (JNIEnv *, jstring, const char *utf) { _Jv_Free ((void *) utf); } static void ! _Jv_JNI_GetStringRegion (JNIEnv *env, jstring string, jsize start, jsize len, ! jchar *buf) { string = unwrap (string); jchar *result = _Jv_GetStringChars (string); --- 1310,1323 ---- } static void ! (JNICALL _Jv_JNI_ReleaseStringUTFChars) (JNIEnv *, jstring, const char *utf) { _Jv_Free ((void *) utf); } static void ! (JNICALL _Jv_JNI_GetStringRegion) (JNIEnv *env, jstring string, jsize start, ! jsize len, jchar *buf) { string = unwrap (string); jchar *result = _Jv_GetStringChars (string); *************** _Jv_JNI_GetStringRegion (JNIEnv *env, js *** 1323,1330 **** } static void ! _Jv_JNI_GetStringUTFRegion (JNIEnv *env, jstring str, jsize start, ! jsize len, char *buf) { str = unwrap (str); --- 1338,1345 ---- } static void ! (JNICALL _Jv_JNI_GetStringUTFRegion) (JNIEnv *env, jstring str, jsize start, ! jsize len, char *buf) { str = unwrap (str); *************** _Jv_JNI_GetStringUTFRegion (JNIEnv *env, *** 1345,1351 **** } static const jchar * ! _Jv_JNI_GetStringCritical (JNIEnv *, jstring str, jboolean *isCopy) { jchar *result = _Jv_GetStringChars (unwrap (str)); if (isCopy) --- 1360,1366 ---- } static const jchar * ! (JNICALL _Jv_JNI_GetStringCritical) (JNIEnv *, jstring str, jboolean *isCopy) { jchar *result = _Jv_GetStringChars (unwrap (str)); if (isCopy) *************** _Jv_JNI_GetStringCritical (JNIEnv *, jst *** 1354,1379 **** } static void ! _Jv_JNI_ReleaseStringCritical (JNIEnv *, jstring, const jchar *) { // Nothing. } static jsize ! _Jv_JNI_GetArrayLength (JNIEnv *, jarray array) { return unwrap (array)->length; } static jarray ! _Jv_JNI_NewObjectArray (JNIEnv *env, jsize length, jclass elementClass, ! jobject init) { try { elementClass = unwrap (elementClass); init = unwrap (init); jarray result = JvNewObjectArray (length, elementClass, init); return (jarray) wrap_value (env, result); } --- 1369,1395 ---- } static void ! (JNICALL _Jv_JNI_ReleaseStringCritical) (JNIEnv *, jstring, const jchar *) { // Nothing. } static jsize ! (JNICALL _Jv_JNI_GetArrayLength) (JNIEnv *, jarray array) { return unwrap (array)->length; } static jarray ! (JNICALL _Jv_JNI_NewObjectArray) (JNIEnv *env, jsize length, ! jclass elementClass, jobject init) { try { elementClass = unwrap (elementClass); init = unwrap (init); + _Jv_CheckCast (elementClass, init); jarray result = JvNewObjectArray (length, elementClass, init); return (jarray) wrap_value (env, result); } *************** _Jv_JNI_NewObjectArray (JNIEnv *env, jsi *** 1385,1399 **** } static jobject ! _Jv_JNI_GetObjectArrayElement (JNIEnv *env, jobjectArray array, jsize index) { jobject *elts = elements (unwrap (array)); return wrap_value (env, elts[index]); } static void ! _Jv_JNI_SetObjectArrayElement (JNIEnv *env, jobjectArray array, jsize index, ! jobject value) { try { --- 1401,1418 ---- } static jobject ! (JNICALL _Jv_JNI_GetObjectArrayElement) (JNIEnv *env, jobjectArray array, ! jsize index) { + if ((unsigned) index >= (unsigned) array->length) + _Jv_ThrowBadArrayIndex (index); jobject *elts = elements (unwrap (array)); return wrap_value (env, elts[index]); } static void ! (JNICALL _Jv_JNI_SetObjectArrayElement) (JNIEnv *env, jobjectArray array, ! jsize index, jobject value) { try { *************** _Jv_JNI_SetObjectArrayElement (JNIEnv *e *** 1401,1406 **** --- 1420,1427 ---- value = unwrap (value); _Jv_CheckArrayStore (array, value); + if ((unsigned) index >= (unsigned) array->length) + _Jv_ThrowBadArrayIndex (index); jobject *elts = elements (array); elts[index] = value; } *************** _Jv_JNI_SetObjectArrayElement (JNIEnv *e *** 1412,1418 **** template static JArray * ! _Jv_JNI_NewPrimitiveArray (JNIEnv *env, jsize length) { try { --- 1433,1439 ---- template static JArray * ! (JNICALL _Jv_JNI_NewPrimitiveArray) (JNIEnv *env, jsize length) { try { *************** _Jv_JNI_NewPrimitiveArray (JNIEnv *env, *** 1427,1434 **** template static T * ! _Jv_JNI_GetPrimitiveArrayElements (JNIEnv *, JArray *array, ! jboolean *isCopy) { array = unwrap (array); T *elts = elements (array); --- 1448,1455 ---- template static T * ! (JNICALL _Jv_JNI_GetPrimitiveArrayElements) (JNIEnv *, JArray *array, ! jboolean *isCopy) { array = unwrap (array); T *elts = elements (array); *************** _Jv_JNI_GetPrimitiveArrayElements (JNIEn *** 1443,1450 **** template static void ! _Jv_JNI_ReleasePrimitiveArrayElements (JNIEnv *, JArray *array, ! T *, jint /* mode */) { array = unwrap (array); // Note that we ignore MODE. We can do this because we never copy --- 1464,1471 ---- template static void ! (JNICALL _Jv_JNI_ReleasePrimitiveArrayElements) (JNIEnv *, JArray *array, ! T *, jint /* mode */) { array = unwrap (array); // Note that we ignore MODE. We can do this because we never copy *************** _Jv_JNI_ReleasePrimitiveArrayElements (J *** 1455,1462 **** template static void ! _Jv_JNI_GetPrimitiveArrayRegion (JNIEnv *env, JArray *array, ! jsize start, jsize len, T *buf) { array = unwrap (array); --- 1476,1483 ---- template static void ! (JNICALL _Jv_JNI_GetPrimitiveArrayRegion) (JNIEnv *env, JArray *array, ! jsize start, jsize len, T *buf) { array = unwrap (array); *************** _Jv_JNI_GetPrimitiveArrayRegion (JNIEnv *** 1485,1492 **** template static void ! _Jv_JNI_SetPrimitiveArrayRegion (JNIEnv *env, JArray *array, ! jsize start, jsize len, T *buf) { array = unwrap (array); --- 1506,1513 ---- template static void ! (JNICALL _Jv_JNI_SetPrimitiveArrayRegion) (JNIEnv *env, JArray *array, ! jsize start, jsize len, T *buf) { array = unwrap (array); *************** _Jv_JNI_SetPrimitiveArrayRegion (JNIEnv *** 1512,1519 **** } static void * ! _Jv_JNI_GetPrimitiveArrayCritical (JNIEnv *, jarray array, ! jboolean *isCopy) { array = unwrap (array); // FIXME: does this work? --- 1533,1540 ---- } static void * ! (JNICALL _Jv_JNI_GetPrimitiveArrayCritical) (JNIEnv *, jarray array, ! jboolean *isCopy) { array = unwrap (array); // FIXME: does this work? *************** _Jv_JNI_GetPrimitiveArrayCritical (JNIEn *** 1526,1538 **** } static void ! _Jv_JNI_ReleasePrimitiveArrayCritical (JNIEnv *, jarray, void *, jint) { // Nothing. } static jint ! _Jv_JNI_MonitorEnter (JNIEnv *env, jobject obj) { try { --- 1547,1559 ---- } static void ! (JNICALL _Jv_JNI_ReleasePrimitiveArrayCritical) (JNIEnv *, jarray, void *, jint) { // Nothing. } static jint ! (JNICALL _Jv_JNI_MonitorEnter) (JNIEnv *env, jobject obj) { try { *************** _Jv_JNI_MonitorEnter (JNIEnv *env, jobje *** 1547,1553 **** } static jint ! _Jv_JNI_MonitorExit (JNIEnv *env, jobject obj) { try { --- 1568,1574 ---- } static jint ! (JNICALL _Jv_JNI_MonitorExit) (JNIEnv *env, jobject obj) { try { *************** _Jv_JNI_MonitorExit (JNIEnv *env, jobjec *** 1563,1570 **** // JDK 1.2 jobject ! _Jv_JNI_ToReflectedField (JNIEnv *env, jclass cls, jfieldID fieldID, ! jboolean) { try { --- 1584,1591 ---- // JDK 1.2 jobject ! (JNICALL _Jv_JNI_ToReflectedField) (JNIEnv *env, jclass cls, jfieldID fieldID, ! jboolean) { try { *************** _Jv_JNI_ToReflectedField (JNIEnv *env, j *** 1584,1590 **** // JDK 1.2 static jfieldID ! _Jv_JNI_FromReflectedField (JNIEnv *, jobject f) { using namespace java::lang::reflect; --- 1605,1611 ---- // JDK 1.2 static jfieldID ! (JNICALL _Jv_JNI_FromReflectedField) (JNIEnv *, jobject f) { using namespace java::lang::reflect; *************** _Jv_JNI_FromReflectedField (JNIEnv *, jo *** 1594,1601 **** } jobject ! _Jv_JNI_ToReflectedMethod (JNIEnv *env, jclass klass, jmethodID id, ! jboolean) { using namespace java::lang::reflect; --- 1615,1622 ---- } jobject ! (JNICALL _Jv_JNI_ToReflectedMethod) (JNIEnv *env, jclass klass, jmethodID id, ! jboolean) { using namespace java::lang::reflect; *************** _Jv_JNI_ToReflectedMethod (JNIEnv *env, *** 1629,1635 **** } static jmethodID ! _Jv_JNI_FromReflectedMethod (JNIEnv *, jobject method) { using namespace java::lang::reflect; method = unwrap (method); --- 1650,1656 ---- } static jmethodID ! (JNICALL _Jv_JNI_FromReflectedMethod) (JNIEnv *, jobject method) { using namespace java::lang::reflect; method = unwrap (method); *************** _Jv_JNI_FromReflectedMethod (JNIEnv *, j *** 1641,1647 **** // JDK 1.2. jweak ! _Jv_JNI_NewWeakGlobalRef (JNIEnv *env, jobject obj) { using namespace gnu::gcj::runtime; JNIWeakRef *ref = NULL; --- 1662,1668 ---- // JDK 1.2. jweak ! (JNICALL _Jv_JNI_NewWeakGlobalRef) (JNIEnv *env, jobject obj) { using namespace gnu::gcj::runtime; JNIWeakRef *ref = NULL; *************** _Jv_JNI_NewWeakGlobalRef (JNIEnv *env, j *** 1662,1668 **** } void ! _Jv_JNI_DeleteWeakGlobalRef (JNIEnv *, jweak obj) { using namespace gnu::gcj::runtime; JNIWeakRef *ref = reinterpret_cast (obj); --- 1683,1689 ---- } void ! (JNICALL _Jv_JNI_DeleteWeakGlobalRef) (JNIEnv *, jweak obj) { using namespace gnu::gcj::runtime; JNIWeakRef *ref = reinterpret_cast (obj); *************** _Jv_JNI_DeleteWeakGlobalRef (JNIEnv *, j *** 1672,1677 **** --- 1693,1723 ---- + // Direct byte buffers. + + static jobject + (JNICALL _Jv_JNI_NewDirectByteBuffer) (JNIEnv *, void *, jlong) + { + // For now we don't support this. + return NULL; + } + + static void * + (JNICALL _Jv_JNI_GetDirectBufferAddress) (JNIEnv *, jobject) + { + // For now we don't support this. + return NULL; + } + + static jlong + (JNICALL _Jv_JNI_GetDirectBufferCapacity) (JNIEnv *, jobject) + { + // For now we don't support this. + return -1; + } + + + // Hash table of native methods. static JNINativeMethod *nathash; // Number of slots used. *************** nathash_add (const JNINativeMethod *meth *** 1787,1795 **** } static jint ! _Jv_JNI_RegisterNatives (JNIEnv *env, jclass klass, ! const JNINativeMethod *methods, ! jint nMethods) { // Synchronize while we do the work. This must match // synchronization in some other functions that manipulate or use --- 1833,1841 ---- } static jint ! (JNICALL _Jv_JNI_RegisterNatives) (JNIEnv *env, jclass klass, ! const JNINativeMethod *methods, ! jint nMethods) { // Synchronize while we do the work. This must match // synchronization in some other functions that manipulate or use *************** _Jv_JNI_RegisterNatives (JNIEnv *env, jc *** 1841,1847 **** } static jint ! _Jv_JNI_UnregisterNatives (JNIEnv *, jclass) { // FIXME -- we could implement this. return JNI_ERR; --- 1887,1893 ---- } static jint ! (JNICALL _Jv_JNI_UnregisterNatives) (JNIEnv *, jclass) { // FIXME -- we could implement this. return JNI_ERR; *************** _Jv_GetJNIEnvNewFrame (jclass klass) *** 1953,1961 **** { env = (JNIEnv *) _Jv_MallocUnchecked (sizeof (JNIEnv)); env->p = &_Jv_JNIFunctions; - env->ex = NULL; env->klass = klass; env->locals = NULL; _Jv_SetCurrentJNIEnv (env); } --- 1999,2007 ---- { env = (JNIEnv *) _Jv_MallocUnchecked (sizeof (JNIEnv)); env->p = &_Jv_JNIFunctions; env->klass = klass; env->locals = NULL; + // We set env->ex below. _Jv_SetCurrentJNIEnv (env); } *************** _Jv_GetJNIEnvNewFrame (jclass klass) *** 1968,1978 **** frame->marker = MARK_SYSTEM; frame->size = FRAME_SIZE; frame->next = env->locals; - env->locals = frame; for (int i = 0; i < frame->size; ++i) frame->vec[i] = NULL; return env; } --- 2014,2026 ---- frame->marker = MARK_SYSTEM; frame->size = FRAME_SIZE; frame->next = env->locals; for (int i = 0; i < frame->size; ++i) frame->vec[i] = NULL; + env->locals = frame; + env->ex = NULL; + return env; } *************** _Jv_GetJNIEnvNewFrame (jclass klass) *** 1981,1989 **** // This is `extern "C"' because the compiler uses it. extern "C" void * _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name, ! _Jv_Utf8Const *signature) { ! char buf[10 + 6 * (name->length + signature->length)]; int long_start; void *function; --- 2029,2037 ---- // This is `extern "C"' because the compiler uses it. extern "C" void * _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name, ! _Jv_Utf8Const *signature, int args_size) { ! char buf[10 + 6 * (name->length + signature->length) + 12]; int long_start; void *function; *************** _Jv_LookupJNIMethod (jclass klass, _Jv_U *** 2003,2020 **** return function; // If there was no override, then look in the symbol table. ! mangled_name (klass, name, signature, buf, &long_start); ! char c = buf[long_start]; ! buf[long_start] = '\0'; ! function = _Jv_FindSymbolInExecutable (buf); if (function == NULL) { ! buf[long_start] = c; function = _Jv_FindSymbolInExecutable (buf); if (function == NULL) { ! jstring str = JvNewStringUTF (name->data); ! throw new java::lang::UnsatisfiedLinkError (str); } } --- 2051,2122 ---- return function; // If there was no override, then look in the symbol table. ! buf[0] = '_'; ! mangled_name (klass, name, signature, buf + 1, &long_start); ! char c = buf[long_start + 1]; ! buf[long_start + 1] = '\0'; ! ! function = _Jv_FindSymbolInExecutable (buf + 1); ! #ifdef WIN32 ! // On Win32, we use the "stdcall" calling convention (see JNICALL ! // in jni.h). ! // ! // For a function named 'fooBar' that takes 'nn' bytes as arguments, ! // by default, MinGW GCC exports it as 'fooBar@nn', MSVC exports it ! // as '_fooBar@nn' and Borland C exports it as 'fooBar'. We try to ! // take care of all these variations here. ! ! char asz_buf[12]; /* '@' + '2147483647' (32-bit INT_MAX) + '\0' */ ! char long_nm_sv[11]; /* Ditto, except for the '\0'. */ ! if (function == NULL) { ! // We have tried searching for the 'fooBar' form (BCC) - now ! // try the others. ! ! // First, save the part of the long name that will be damaged ! // by appending '@nn'. ! memcpy (long_nm_sv, (buf + long_start + 1 + 1), sizeof (long_nm_sv)); ! ! sprintf (asz_buf, "@%d", args_size); ! strcat (buf, asz_buf); ! ! // Search for the '_fooBar@nn' form (MSVC). function = _Jv_FindSymbolInExecutable (buf); + + if (function == NULL) + { + // Search for the 'fooBar@nn' form (MinGW GCC). + function = _Jv_FindSymbolInExecutable (buf + 1); + } + } + #else /* WIN32 */ + args_size; /* Dummy statement to avoid unused parameter warning */ + #endif /* ! WIN32 */ + + if (function == NULL) + { + buf[long_start + 1] = c; + #ifdef WIN32 + // Restore the part of the long name that was damaged by + // appending the '@nn'. + memcpy ((buf + long_start + 1 + 1), long_nm_sv, sizeof (long_nm_sv)); + #endif /* WIN32 */ + function = _Jv_FindSymbolInExecutable (buf + 1); if (function == NULL) { ! #ifdef WIN32 ! strcat (buf, asz_buf); ! function = _Jv_FindSymbolInExecutable (buf); ! if (function == NULL) ! function = _Jv_FindSymbolInExecutable (buf + 1); ! ! if (function == NULL) ! #endif /* WIN32 */ ! { ! jstring str = JvNewStringUTF (name->data); ! throw new java::lang::UnsatisfiedLinkError (str); ! } } } *************** _Jv_JNIMethod::call (ffi_cif *, void *re *** 2045,2053 **** // time. JvSynchronize sync (global_ref_table); if (_this->function == NULL) ! _this->function = _Jv_LookupJNIMethod (_this->defining_class, ! _this->self->name, ! _this->self->signature); } JvAssert (_this->args_raw_size % sizeof (ffi_raw) == 0); --- 2147,2163 ---- // time. JvSynchronize sync (global_ref_table); if (_this->function == NULL) ! { ! int args_size = sizeof (JNIEnv *) + _this->args_raw_size; ! ! if (_this->self->accflags & java::lang::reflect::Modifier::STATIC) ! args_size += sizeof (_this->defining_class); ! ! _this->function = _Jv_LookupJNIMethod (_this->defining_class, ! _this->self->name, ! _this->self->signature, ! args_size); ! } } JvAssert (_this->args_raw_size % sizeof (ffi_raw) == 0); *************** _Jv_JNIMethod::call (ffi_cif *, void *re *** 2096,2102 **** // An internal helper function. static jint ! _Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, void *args) { JavaVMAttachArgs *attach = reinterpret_cast (args); java::lang::ThreadGroup *group = NULL; --- 2206,2213 ---- // An internal helper function. static jint ! _Jv_JNI_AttachCurrentThread (JavaVM *, jstring name, void **penv, ! void *args, jboolean is_daemon) { JavaVMAttachArgs *attach = reinterpret_cast (args); java::lang::ThreadGroup *group = NULL; *************** _Jv_JNI_AttachCurrentThread (JavaVM *, j *** 2104,2110 **** if (attach) { // FIXME: do we really want to support 1.1? ! if (attach->version != JNI_VERSION_1_2 && attach->version != JNI_VERSION_1_1) return JNI_EVERSION; --- 2215,2222 ---- if (attach) { // FIXME: do we really want to support 1.1? ! if (attach->version != JNI_VERSION_1_4 ! && attach->version != JNI_VERSION_1_2 && attach->version != JNI_VERSION_1_1) return JNI_EVERSION; *************** _Jv_JNI_AttachCurrentThread (JavaVM *, j *** 2147,2153 **** { try { ! _Jv_AttachCurrentThread (name, group); } catch (jthrowable t) { --- 2259,2268 ---- { try { ! if (is_daemon) ! _Jv_AttachCurrentThreadAsDaemon (name, group); ! else ! _Jv_AttachCurrentThread (name, group); } catch (jthrowable t) { *************** _Jv_JNI_AttachCurrentThread (JavaVM *, j *** 2161,2173 **** // This is the one actually used by JNI. static jint ! _Jv_JNI_AttachCurrentThread (JavaVM *vm, void **penv, void *args) { ! return _Jv_JNI_AttachCurrentThread (vm, NULL, penv, args); } static jint ! _Jv_JNI_DestroyJavaVM (JavaVM *vm) { JvAssert (the_vm && vm == the_vm); --- 2276,2295 ---- // This is the one actually used by JNI. static jint ! (JNICALL _Jv_JNI_AttachCurrentThread) (JavaVM *vm, void **penv, void *args) { ! return _Jv_JNI_AttachCurrentThread (vm, NULL, penv, args, false); } static jint ! (JNICALL _Jv_JNI_AttachCurrentThreadAsDaemon) (JavaVM *vm, void **penv, ! void *args) ! { ! return _Jv_JNI_AttachCurrentThread (vm, NULL, penv, args, true); ! } ! ! static jint ! (JNICALL _Jv_JNI_DestroyJavaVM) (JavaVM *vm) { JvAssert (the_vm && vm == the_vm); *************** _Jv_JNI_DestroyJavaVM (JavaVM *vm) *** 2185,2194 **** return JNI_ERR; } ! jint r = _Jv_JNI_AttachCurrentThread (vm, ! main_name, reinterpret_cast (&env), ! NULL); if (r < 0) return r; } --- 2307,2315 ---- return JNI_ERR; } ! jint r = _Jv_JNI_AttachCurrentThread (vm, main_name, reinterpret_cast (&env), ! NULL, false); if (r < 0) return r; } *************** _Jv_JNI_DestroyJavaVM (JavaVM *vm) *** 2202,2215 **** } jint ! _Jv_JNI_DetachCurrentThread (JavaVM *) { jint code = _Jv_DetachCurrentThread (); return code ? JNI_EDETACHED : 0; } static jint ! _Jv_JNI_GetEnv (JavaVM *, void **penv, jint version) { if (_Jv_ThreadCurrent () == NULL) { --- 2323,2336 ---- } jint ! (JNICALL _Jv_JNI_DetachCurrentThread) (JavaVM *) { jint code = _Jv_DetachCurrentThread (); return code ? JNI_EDETACHED : 0; } static jint ! (JNICALL _Jv_JNI_GetEnv) (JavaVM *, void **penv, jint version) { if (_Jv_ThreadCurrent () == NULL) { *************** _Jv_JNI_GetEnv (JavaVM *, void **penv, j *** 2227,2233 **** #endif // FIXME: do we really want to support 1.1? ! if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_1) { *penv = NULL; return JNI_EVERSION; --- 2348,2355 ---- #endif // FIXME: do we really want to support 1.1? ! if (version != JNI_VERSION_1_4 && version != JNI_VERSION_1_2 ! && version != JNI_VERSION_1_1) { *penv = NULL; return JNI_EVERSION; *************** _Jv_JNI_GetEnv (JavaVM *, void **penv, j *** 2237,2252 **** return 0; } ! jint JNI_GetDefaultJavaVMInitArgs (void *args) { jint version = * (jint *) args; ! // Here we only support 1.2. ! if (version != JNI_VERSION_1_2) return JNI_EVERSION; JavaVMInitArgs *ia = reinterpret_cast (args); ! ia->version = JNI_VERSION_1_2; ia->nOptions = 0; ia->options = NULL; ia->ignoreUnrecognized = true; --- 2359,2374 ---- return 0; } ! JNIEXPORT jint JNICALL JNI_GetDefaultJavaVMInitArgs (void *args) { jint version = * (jint *) args; ! // Here we only support 1.2 and 1.4. ! if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_4) return JNI_EVERSION; JavaVMInitArgs *ia = reinterpret_cast (args); ! ia->version = JNI_VERSION_1_4; ia->nOptions = 0; ia->options = NULL; ia->ignoreUnrecognized = true; *************** JNI_GetDefaultJavaVMInitArgs (void *args *** 2254,2260 **** return 0; } ! jint JNI_CreateJavaVM (JavaVM **vm, void **penv, void *args) { JvAssert (! the_vm); --- 2376,2382 ---- return 0; } ! JNIEXPORT jint JNICALL JNI_CreateJavaVM (JavaVM **vm, void **penv, void *args) { JvAssert (! the_vm); *************** JNI_CreateJavaVM (JavaVM **vm, void **pe *** 2271,2278 **** if (args != NULL) { jint version = * (jint *) args; ! // We only support 1.2. ! if (version != JNI_VERSION_1_2) return JNI_EVERSION; JavaVMInitArgs *ia = reinterpret_cast (args); for (int i = 0; i < ia->nOptions; ++i) --- 2393,2400 ---- if (args != NULL) { jint version = * (jint *) args; ! // We only support 1.2 and 1.4. ! if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_4) return JNI_EVERSION; JavaVMInitArgs *ia = reinterpret_cast (args); for (int i = 0; i < ia->nOptions; ++i) *************** JNI_CreateJavaVM (JavaVM **vm, void **pe *** 2319,2325 **** return 0; } ! jint JNI_GetCreatedJavaVMs (JavaVM **vm_buffer, jsize buf_len, jsize *n_vms) { if (buf_len <= 0) --- 2441,2447 ---- return 0; } ! JNIEXPORT jint JNICALL JNI_GetCreatedJavaVMs (JavaVM **vm_buffer, jsize buf_len, jsize *n_vms) { if (buf_len <= 0) *************** _Jv_GetJavaVM () *** 2360,2366 **** } static jint ! _Jv_JNI_GetJavaVM (JNIEnv *, JavaVM **vm) { *vm = _Jv_GetJavaVM (); return *vm == NULL ? JNI_ERR : JNI_OK; --- 2482,2488 ---- } static jint ! (JNICALL _Jv_JNI_GetJavaVM) (JNIEnv *, JavaVM **vm) { *vm = _Jv_GetJavaVM (); return *vm == NULL ? JNI_ERR : JNI_OK; *************** struct JNINativeInterface _Jv_JNIFunctio *** 2551,2557 **** _Jv_JNI_ReleaseStringChars, // ReleaseStringChars _Jv_JNI_NewStringUTF, // NewStringUTF _Jv_JNI_GetStringUTFLength, // GetStringUTFLength ! _Jv_JNI_GetStringUTFChars, // GetStringUTFLength _Jv_JNI_ReleaseStringUTFChars, // ReleaseStringUTFChars _Jv_JNI_GetArrayLength, // GetArrayLength _Jv_JNI_NewObjectArray, // NewObjectArray --- 2673,2679 ---- _Jv_JNI_ReleaseStringChars, // ReleaseStringChars _Jv_JNI_NewStringUTF, // NewStringUTF _Jv_JNI_GetStringUTFLength, // GetStringUTFLength ! _Jv_JNI_GetStringUTFChars, // GetStringUTFChars _Jv_JNI_ReleaseStringUTFChars, // ReleaseStringUTFChars _Jv_JNI_GetArrayLength, // GetArrayLength _Jv_JNI_NewObjectArray, // NewObjectArray *************** struct JNINativeInterface _Jv_JNIFunctio *** 2614,2620 **** _Jv_JNI_NewWeakGlobalRef, // NewWeakGlobalRef _Jv_JNI_DeleteWeakGlobalRef, // DeleteWeakGlobalRef ! _Jv_JNI_ExceptionCheck }; struct JNIInvokeInterface _Jv_JNI_InvokeFunctions = --- 2736,2746 ---- _Jv_JNI_NewWeakGlobalRef, // NewWeakGlobalRef _Jv_JNI_DeleteWeakGlobalRef, // DeleteWeakGlobalRef ! _Jv_JNI_ExceptionCheck, // ExceptionCheck ! ! _Jv_JNI_NewDirectByteBuffer, // NewDirectByteBuffer ! _Jv_JNI_GetDirectBufferAddress, // GetDirectBufferAddress ! _Jv_JNI_GetDirectBufferCapacity // GetDirectBufferCapacity }; struct JNIInvokeInterface _Jv_JNI_InvokeFunctions = *************** struct JNIInvokeInterface _Jv_JNI_Invoke *** 2626,2630 **** _Jv_JNI_DestroyJavaVM, _Jv_JNI_AttachCurrentThread, _Jv_JNI_DetachCurrentThread, ! _Jv_JNI_GetEnv }; --- 2752,2757 ---- _Jv_JNI_DestroyJavaVM, _Jv_JNI_AttachCurrentThread, _Jv_JNI_DetachCurrentThread, ! _Jv_JNI_GetEnv, ! _Jv_JNI_AttachCurrentThreadAsDaemon }; diff -Nrc3pad gcc-3.2.3/libjava/libgcj.spec.in gcc-3.3/libjava/libgcj.spec.in *** gcc-3.2.3/libjava/libgcj.spec.in 2002-03-31 18:26:31.000000000 +0000 --- gcc-3.3/libjava/libgcj.spec.in 2003-02-13 02:09:27.000000000 +0000 *************** *** 6,9 **** %rename lib liborig *lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig) ! *jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ -fkeep-inline-functions --- 6,9 ---- %rename lib liborig *lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig) ! *jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ @IEEESPEC@ -fkeep-inline-functions diff -Nrc3pad gcc-3.2.3/libjava/libltdl/ChangeLog gcc-3.3/libjava/libltdl/ChangeLog *** gcc-3.2.3/libjava/libltdl/ChangeLog 2003-04-22 06:15:39.000000000 +0000 --- gcc-3.3/libjava/libltdl/ChangeLog 2003-05-14 00:11:07.000000000 +0000 *************** *** 1,38 **** ! 2003-04-22 Release Manager ! ! * GCC 3.2.3 Released. ! ! 2003-02-05 Release Manager ! ! * GCC 3.2.2 Released. ! ! 2002-11-19 Release Manager ! ! * GCC 3.2.1 Released. ! ! 2002-11-19 Release Manager ! ! * GCC 3.2.1 Released. ! ! 2002-11-18 Release Manager ! ! * GCC 3.2.1 Released. ! ! 2002-08-14 Release Manager ! ! * GCC 3.2 Released. ! ! 2002-07-25 Release Manager ! * GCC 3.1.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. 2002-04-28 Mark Mitchell --- 1,14 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. 2002-04-28 Mark Mitchell diff -Nrc3pad gcc-3.2.3/libjava/libtool-version gcc-3.3/libjava/libtool-version *** gcc-3.2.3/libjava/libtool-version 2002-03-17 00:46:00.000000000 +0000 --- gcc-3.3/libjava/libtool-version 2002-12-20 01:47:32.000000000 +0000 *************** *** 3,6 **** # a separate file so that version updates don't involve re-running # automake. # CURRENT:REVISION:AGE ! 3:0:0 --- 3,6 ---- # a separate file so that version updates don't involve re-running # automake. # CURRENT:REVISION:AGE ! 4:0:0 diff -Nrc3pad gcc-3.2.3/libjava/Makefile.am gcc-3.3/libjava/Makefile.am *** gcc-3.2.3/libjava/Makefile.am 2003-01-28 01:44:37.000000000 +0000 --- gcc-3.3/libjava/Makefile.am 2003-03-01 22:57:52.000000000 +0000 *************** endif *** 15,26 **** ## if XLIB_AWT ! cond_x_ltlibrary = libgcjx.la else cond_x_ltlibrary = endif ! toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary) toolexecmainlib_DATA = libgcj.spec jardir = $(datadir)/java --- 15,29 ---- ## if XLIB_AWT ! cond_x_ltlibrary = lib-gnu-awt-xlib.la ! ## We require libstdc++-v3 to be in the same build tree. ! xlib_includes = -I../libstdc++-v3/include -I../libstdc++-v3/include/$(target_alias) -I$(srcdir)/../libstdc++-v3/libsupc++ else cond_x_ltlibrary = + xlib_includes = endif ! toolexeclib_LTLIBRARIES = libgcj.la lib-org-xml-sax.la lib-org-w3c-dom.la $(cond_x_ltlibrary) toolexecmainlib_DATA = libgcj.spec jardir = $(datadir)/java *************** if CANADIAN *** 48,61 **** if NULL_TARGET ## In this case, gcj is found outside the build tree. However, zip is ## found in the build tree. ! ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT) else ZIP = jar endif GCJH = gcjh else # CANADIAN ! GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT) ! ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT) endif # CANADIAN ## The compiler with whatever flags we want for both -c and -C --- 51,64 ---- if NULL_TARGET ## In this case, gcj is found outside the build tree. However, zip is ## found in the build tree. ! ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar else ZIP = jar endif GCJH = gcjh else # CANADIAN ! GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh ! ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar endif # CANADIAN ## The compiler with whatever flags we want for both -c and -C *************** WARNINGS = -W -Wall *** 82,87 **** --- 85,92 ---- AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \ ## Some systems don't allow `$' in identifiers by default, so we force it. -fdollars-in-identifiers \ + ## Detect bugs in the verifier implementation, and maybe other places. + -Wswitch-enum \ @LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \ -DPREFIX="\"$(prefix)\"" if USING_GCC *************** JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS *** 96,105 **** LIBFFIINCS = @LIBFFIINCS@ INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \ ! $(GCINCS) $(THREADINCS) $(INCLTDL) \ $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS) - ## ################################################################ ## --- 101,109 ---- LIBFFIINCS = @LIBFFIINCS@ INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \ ! $(GCINCS) $(THREADINCS) $(INCLTDL) $(xlib_includes) \ $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS) ## ################################################################ ## *************** javao_files = $(java_source_files:.java= *** 117,123 **** x_javao_files = $(x_java_source_files:.java=.lo) libgcj_la_SOURCES = prims.cc jni.cc exception.cc \ ! resolve.cc defineclass.cc interpret.cc name-finder.cc verify.cc \ $(nat_source_files) EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \ win32-threads.cc posix.cc win32.cc \ --- 121,127 ---- x_javao_files = $(x_java_source_files:.java=.lo) libgcj_la_SOURCES = prims.cc jni.cc exception.cc \ ! resolve.cc defineclass.cc interpret.cc verify.cc \ $(nat_source_files) EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \ win32-threads.cc posix.cc win32.cc \ *************** libgcj_la_LDFLAGS = -rpath $(toolexeclib *** 136,162 **** -version-info `grep -v '^\#' $(srcdir)/libtool-version` libgcj_la_LINK = $(LIBLINK) ! libgcjx_la_SOURCES = $(x_nat_source_files) ! EXTRA_libgcjx_la_SOURCES = $(x_java_source_files) ! libgcjx_la_DEPENDENCIES = libgcj-@gcc_version@.jar $(x_javao_files) ! libgcjx_la_LIBADD = $(x_javao_files) ! libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \ -rpath $(toolexeclibdir) \ ## The mysterious backslash is consumed by make. -version-info `grep -v '^\#' $(srcdir)/libtool-version` ! libgcjx_la_LINK = $(LIBLINK) ! ! ## Make a symlink for each `libgcjx' file that was installed. ! install-exec-hook: ! cd $(DESTDIR)$(libdir) && \ ! if test -f libgcjx.la; then \ ! rm -f gnu-awt-xlib.la; \ ! $(LN_S) libgcjx.la gnu-awt-xlib.la; \ ! fi all_java_source_files = \ $(java_source_files) \ $(built_java_source_files) \ $(x_java_source_files) all_java_class_files = $(all_java_source_files:.java=.class) --- 140,218 ---- -version-info `grep -v '^\#' $(srcdir)/libtool-version` libgcj_la_LINK = $(LIBLINK) ! lib_org_w3c_dom_la_SOURCES = org/w3c/dom/Attr.java \ ! org/w3c/dom/CDATASection.java \ ! org/w3c/dom/CharacterData.java \ ! org/w3c/dom/Comment.java \ ! org/w3c/dom/DOMException.java \ ! org/w3c/dom/DOMImplementation.java \ ! org/w3c/dom/Document.java \ ! org/w3c/dom/DocumentFragment.java \ ! org/w3c/dom/DocumentType.java \ ! org/w3c/dom/Element.java \ ! org/w3c/dom/Entity.java \ ! org/w3c/dom/EntityReference.java \ ! org/w3c/dom/NamedNodeMap.java \ ! org/w3c/dom/Node.java \ ! org/w3c/dom/NodeList.java \ ! org/w3c/dom/Notation.java \ ! org/w3c/dom/ProcessingInstruction.java \ ! org/w3c/dom/Text.java \ ! org/w3c/dom/ranges/DocumentRange.java \ ! org/w3c/dom/ranges/Range.java \ ! org/w3c/dom/ranges/RangeException.java \ ! org/w3c/dom/traversal/DocumentTraversal.java \ ! org/w3c/dom/traversal/NodeFilter.java \ ! org/w3c/dom/traversal/NodeIterator.java \ ! org/w3c/dom/traversal/TreeWalker.java ! ! lib_org_xml_sax_la_SOURCES = org/xml/sax/ext/DeclHandler.java \ ! org/xml/sax/ext/LexicalHandler.java \ ! org/xml/sax/helpers/AttributeListImpl.java \ ! org/xml/sax/helpers/AttributesImpl.java \ ! org/xml/sax/helpers/DefaultHandler.java \ ! org/xml/sax/helpers/LocatorImpl.java \ ! org/xml/sax/helpers/NamespaceSupport.java \ ! org/xml/sax/helpers/NewInstance.java \ ! org/xml/sax/helpers/ParserAdapter.java \ ! org/xml/sax/helpers/ParserFactory.java \ ! org/xml/sax/helpers/XMLFilterImpl.java \ ! org/xml/sax/helpers/XMLReaderAdapter.java \ ! org/xml/sax/helpers/XMLReaderFactory.java \ ! org/xml/sax/AttributeList.java \ ! org/xml/sax/Attributes.java \ ! org/xml/sax/ContentHandler.java \ ! org/xml/sax/DTDHandler.java \ ! org/xml/sax/DocumentHandler.java \ ! org/xml/sax/EntityResolver.java \ ! org/xml/sax/ErrorHandler.java \ ! org/xml/sax/HandlerBase.java \ ! org/xml/sax/InputSource.java \ ! org/xml/sax/Locator.java \ ! org/xml/sax/Parser.java \ ! org/xml/sax/SAXException.java \ ! org/xml/sax/SAXNotRecognizedException.java \ ! org/xml/sax/SAXNotSupportedException.java \ ! org/xml/sax/SAXParseException.java \ ! org/xml/sax/XMLFilter.java \ ! org/xml/sax/XMLReader.java ! ! lib_gnu_awt_xlib_la_SOURCES = $(x_nat_source_files) ! EXTRA_lib_gnu_awt_xlib_la_SOURCES = $(x_java_source_files) ! lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-@gcc_version@.jar $(x_javao_files) ! lib_gnu_awt_xlib_la_LIBADD = $(x_javao_files) ! lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \ ! @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \ -rpath $(toolexeclibdir) \ ## The mysterious backslash is consumed by make. -version-info `grep -v '^\#' $(srcdir)/libtool-version` ! lib_gnu_awt_xlib_la_LINK = $(LIBLINK) all_java_source_files = \ $(java_source_files) \ $(built_java_source_files) \ + $(lib_org_xml_sax_la_SOURCES) \ + $(lib_org_w3c_dom_la_SOURCES) \ $(x_java_source_files) all_java_class_files = $(all_java_source_files:.java=.class) *************** $(c_files): %.lo: %.c *** 207,213 **** $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h ## FIXME: GNU make. ! $(javao_files) $(x_javao_files): %.lo: %.java $(GCJCOMPILE) -o $@ $< ## Pass the list of object files to libtool in a temporary file to --- 263,269 ---- $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h ## FIXME: GNU make. ! $(javao_files) $(x_javao_files) $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_xml_sax_la_OBJECTS): %.lo: %.java $(GCJCOMPILE) -o $@ $< ## Pass the list of object files to libtool in a temporary file to *************** libgcj.la: $(libgcj_la_OBJECTS) $(libgcj *** 218,227 **** @GCLIBS@ @LIBFFI@ @ZLIBS@ \ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS) ! libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES) ! @: $(shell echo Creating list of files to link...) $(shell rm -f libgcjx.objectlist || :) $(shell touch libgcjx.objectlist) $(foreach object,$(libgcjx_la_OBJECTS) $(libgcjx_la_LIBADD),$(shell echo $(object) >> libgcjx.objectlist)) ! $(libgcjx_la_LINK) -objectlist libgcjx.objectlist \ ! -rpath $(toolexeclibdir) $(libgcjx_la_LDFLAGS) $(LIBS) ## ################################################################ --- 274,283 ---- @GCLIBS@ @LIBFFI@ @ZLIBS@ \ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS) ! lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES) ! @: $(shell echo Creating list of files to link...) $(shell rm -f lib_gnu_awt_xlib.objectlist || :) $(shell touch lib_gnu_awt_xlib.objectlist) $(foreach object,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),$(shell echo $(object) >> lib_gnu_awt_xlib.objectlist)) ! $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \ ! -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS) ## ################################################################ *************** ordinary_nat_headers = $(ordinary_java_s *** 238,244 **** $(built_java_source_files:.java=.h) inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \ ! java/io/ObjectInputStream$$GetField.h nat_headers = $(ordinary_nat_headers) $(inner_nat_headers) --- 294,302 ---- $(built_java_source_files:.java=.h) inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \ ! java/io/ObjectInputStream$$GetField.h \ ! java/lang/reflect/Proxy$$ProxyData.h \ ! java/lang/reflect/Proxy$$ProxyType.h nat_headers = $(ordinary_nat_headers) $(inner_nat_headers) *************** java/lang/Thread.h: java/lang/Thread.cla *** 262,267 **** --- 320,326 ---- -friend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \ -friend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \ -friend 'java::lang::Thread* _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group);' \ + -friend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group);' \ -friend 'jint _Jv_DetachCurrentThread ();' \ $(basename $<) *************** java/lang/reflect/Method.h: java/lang/re *** 297,302 **** --- 356,373 ---- -friend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \ $(basename $<) + java/lang/reflect/Proxy.h: java/lang/reflect/Proxy.class + $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ + $(basename $<) + + java/lang/reflect/Proxy$$ProxyData.h: java/lang/reflect/Proxy.class + $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ + 'java/lang/reflect/Proxy$$ProxyData' + + java/lang/reflect/Proxy$$ProxyType.h: java/lang/reflect/Proxy.class + $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ + 'java/lang/reflect/Proxy$$ProxyType' + gnu/gcj/runtime/VMClassLoader.h: gnu/gcj/runtime/VMClassLoader.class $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ -friend 'class ::java::lang::ClassLoader;' \ *************** gnu/java/awt/BitMaskExtent.java \ *** 561,566 **** --- 632,640 ---- gnu/java/awt/Buffers.java \ gnu/java/awt/ComponentDataBlitOp.java \ gnu/java/awt/GLightweightPeer.java \ + gnu/java/awt/EventModifier.java \ + gnu/java/awt/image/ImageDecoder.java \ + gnu/java/awt/image/XBMDecoder.java \ gnu/java/beans/editors/ColorEditor.java \ gnu/java/beans/editors/FontEditor.java \ gnu/java/beans/editors/NativeBooleanEditor.java \ *************** java/awt/CheckboxGroup.java \ *** 596,607 **** java/awt/CheckboxMenuItem.java \ java/awt/Choice.java \ java/awt/Color.java \ ! java/awt/Component.java \ java/awt/ComponentOrientation.java \ ! java/awt/Container.java \ java/awt/Cursor.java \ java/awt/Dialog.java \ ! java/awt/Dimension.java \ java/awt/Event.java \ java/awt/EventDispatchThread.java \ java/awt/EventQueue.java \ --- 670,681 ---- java/awt/CheckboxMenuItem.java \ java/awt/Choice.java \ java/awt/Color.java \ ! java/awt/Component.java \ java/awt/ComponentOrientation.java \ ! java/awt/Container.java \ java/awt/Cursor.java \ java/awt/Dialog.java \ ! java/awt/Dimension.java \ java/awt/Event.java \ java/awt/EventDispatchThread.java \ java/awt/EventQueue.java \ *************** java/awt/Graphics.java \ *** 614,619 **** --- 688,694 ---- java/awt/Graphics2D.java \ java/awt/GraphicsConfiguration.java \ java/awt/GridBagConstraints.java \ + java/awt/GridBagLayout.java \ java/awt/GridLayout.java \ java/awt/IllegalComponentStateException.java \ java/awt/Image.java \ *************** java/awt/Label.java \ *** 623,629 **** java/awt/LayoutManager.java \ java/awt/LayoutManager2.java \ java/awt/List.java \ - java/awt/MediaTracker.java \ java/awt/Menu.java \ java/awt/MenuBar.java \ java/awt/MenuComponent.java \ --- 698,703 ---- *************** java/awt/Paint.java \ *** 634,658 **** java/awt/PaintContext.java \ java/awt/Panel.java \ java/awt/Point.java \ ! java/awt/Polygon.java \ ! java/awt/PopupMenu.java \ ! java/awt/PrintGraphics.java \ ! java/awt/PrintJob.java \ ! java/awt/Rectangle.java \ java/awt/RenderingHints.java \ java/awt/ScrollPane.java \ ! java/awt/Scrollbar.java \ java/awt/Shape.java \ - java/awt/SystemColor.java \ java/awt/TextArea.java \ java/awt/TextComponent.java \ ! java/awt/TextField.java \ java/awt/Toolkit.java \ java/awt/Transparency.java \ java/awt/Window.java \ java/awt/color/ColorSpace.java \ java/awt/color/ICC_ColorSpace.java \ ! java/awt/color/ICC_Profile.java \ java/awt/datatransfer/Clipboard.java \ java/awt/datatransfer/ClipboardOwner.java \ java/awt/datatransfer/DataFlavor.java \ --- 708,732 ---- java/awt/PaintContext.java \ java/awt/Panel.java \ java/awt/Point.java \ ! java/awt/PopupMenu.java \ ! java/awt/Rectangle.java \ java/awt/RenderingHints.java \ java/awt/ScrollPane.java \ ! java/awt/Scrollbar.java \ java/awt/Shape.java \ java/awt/TextArea.java \ java/awt/TextComponent.java \ ! java/awt/TextField.java \ java/awt/Toolkit.java \ java/awt/Transparency.java \ java/awt/Window.java \ java/awt/color/ColorSpace.java \ java/awt/color/ICC_ColorSpace.java \ ! java/awt/color/ICC_Profile.java \ ! java/awt/color/ICC_ProfileGray.java \ ! java/awt/color/ICC_ProfileRGB.java \ ! java/awt/color/CMMException.java \ ! java/awt/color/ProfileDataException.java \ java/awt/datatransfer/Clipboard.java \ java/awt/datatransfer/ClipboardOwner.java \ java/awt/datatransfer/DataFlavor.java \ *************** java/awt/datatransfer/FlavorMap.java \ *** 660,669 **** java/awt/datatransfer/MimeTypeParseException.java \ java/awt/datatransfer/StringSelection.java \ java/awt/datatransfer/SystemFlavorMap.java \ ! java/awt/datatransfer/Transferable.java \ java/awt/datatransfer/UnsupportedFlavorException.java \ java/awt/event/AWTEventListener.java \ ! java/awt/event/ActionEvent.java \ java/awt/event/ActionListener.java \ java/awt/event/AdjustmentEvent.java \ java/awt/event/AdjustmentListener.java \ --- 734,744 ---- java/awt/datatransfer/MimeTypeParseException.java \ java/awt/datatransfer/StringSelection.java \ java/awt/datatransfer/SystemFlavorMap.java \ ! java/awt/datatransfer/Transferable.java \ java/awt/datatransfer/UnsupportedFlavorException.java \ + java/awt/datatransfer/FlavorTable.java \ java/awt/event/AWTEventListener.java \ ! java/awt/event/ActionEvent.java \ java/awt/event/ActionListener.java \ java/awt/event/AdjustmentEvent.java \ java/awt/event/AdjustmentListener.java \ *************** java/awt/event/HierarchyEvent.java \ *** 682,747 **** java/awt/event/HierarchyListener.java \ java/awt/event/InputEvent.java \ java/awt/event/InputMethodEvent.java \ ! java/awt/event/InputMethodListener.java \ java/awt/event/InvocationEvent.java \ java/awt/event/ItemEvent.java \ java/awt/event/ItemListener.java \ java/awt/event/KeyAdapter.java \ java/awt/event/KeyEvent.java \ ! java/awt/event/KeyListener.java \ java/awt/event/MouseAdapter.java \ java/awt/event/MouseEvent.java \ java/awt/event/MouseListener.java \ java/awt/event/MouseMotionAdapter.java \ ! java/awt/event/MouseMotionListener.java \ java/awt/event/PaintEvent.java \ java/awt/event/TextEvent.java \ java/awt/event/TextListener.java \ java/awt/event/WindowAdapter.java \ ! java/awt/event/WindowEvent.java \ java/awt/event/WindowListener.java \ java/awt/geom/AffineTransform.java \ java/awt/geom/Dimension2D.java \ java/awt/geom/Ellipse2D.java \ java/awt/geom/IllegalPathStateException.java \ - java/awt/geom/Line2D.java \ java/awt/geom/NoninvertibleTransformException.java \ ! java/awt/geom/PathIterator.java \ java/awt/geom/Point2D.java \ java/awt/geom/Rectangle2D.java \ java/awt/geom/RectangularShape.java \ java/awt/geom/RoundRectangle2D.java \ ! java/awt/image/AreaAveragingScaleFilter.java \ java/awt/image/BufferedImage.java \ java/awt/image/ColorModel.java \ ! java/awt/image/ComponentColorModel.java \ java/awt/image/ComponentSampleModel.java \ - java/awt/image/CropImageFilter.java \ java/awt/image/DataBuffer.java \ java/awt/image/DataBufferByte.java \ java/awt/image/DataBufferInt.java \ java/awt/image/DataBufferUShort.java \ java/awt/image/DirectColorModel.java \ - java/awt/image/FilteredImageSource.java \ java/awt/image/ImageConsumer.java \ - java/awt/image/ImageFilter.java \ java/awt/image/ImageObserver.java \ java/awt/image/ImageProducer.java \ java/awt/image/IndexColorModel.java \ - java/awt/image/MemoryImageSource.java \ java/awt/image/PackedColorModel.java \ - java/awt/image/PixelGrabber.java \ - java/awt/image/RGBImageFilter.java \ java/awt/image/Raster.java \ java/awt/image/RasterOp.java \ ! java/awt/image/ReplicateScaleFilter.java \ ! java/awt/image/SampleModel.java \ java/awt/image/SinglePixelPackedSampleModel.java \ java/awt/image/WritableRaster.java \ java/awt/peer/ButtonPeer.java \ java/awt/peer/CanvasPeer.java \ ! java/awt/peer/CheckboxMenuItemPeer.java \ ! java/awt/peer/CheckboxPeer.java \ java/awt/peer/ChoicePeer.java \ java/awt/peer/ComponentPeer.java \ java/awt/peer/ContainerPeer.java \ --- 757,848 ---- java/awt/event/HierarchyListener.java \ java/awt/event/InputEvent.java \ java/awt/event/InputMethodEvent.java \ ! java/awt/event/InputMethodListener.java \ java/awt/event/InvocationEvent.java \ java/awt/event/ItemEvent.java \ java/awt/event/ItemListener.java \ java/awt/event/KeyAdapter.java \ java/awt/event/KeyEvent.java \ ! java/awt/event/KeyListener.java \ java/awt/event/MouseAdapter.java \ java/awt/event/MouseEvent.java \ java/awt/event/MouseListener.java \ java/awt/event/MouseMotionAdapter.java \ ! java/awt/event/MouseMotionListener.java \ java/awt/event/PaintEvent.java \ java/awt/event/TextEvent.java \ java/awt/event/TextListener.java \ java/awt/event/WindowAdapter.java \ ! java/awt/event/WindowEvent.java \ java/awt/event/WindowListener.java \ + java/awt/event/AWTEventListenerProxy.java \ + java/awt/event/MouseWheelEvent.java \ + java/awt/event/MouseWheelListener.java \ + java/awt/event/WindowFocusListener.java \ + java/awt/event/WindowStateListener.java \ java/awt/geom/AffineTransform.java \ java/awt/geom/Dimension2D.java \ java/awt/geom/Ellipse2D.java \ java/awt/geom/IllegalPathStateException.java \ java/awt/geom/NoninvertibleTransformException.java \ ! java/awt/geom/PathIterator.java \ java/awt/geom/Point2D.java \ java/awt/geom/Rectangle2D.java \ java/awt/geom/RectangularShape.java \ java/awt/geom/RoundRectangle2D.java \ ! java/awt/geom/Line2D.java \ ! java/awt/geom/Arc2D.java \ ! java/awt/geom/Area.java \ ! java/awt/geom/CubicCurve2D.java \ ! java/awt/geom/FlatteningPathIterator.java \ ! java/awt/geom/GeneralPath.java \ ! java/awt/geom/QuadCurve2D.java \ java/awt/image/BufferedImage.java \ java/awt/image/ColorModel.java \ ! java/awt/image/ComponentColorModel.java \ java/awt/image/ComponentSampleModel.java \ java/awt/image/DataBuffer.java \ java/awt/image/DataBufferByte.java \ java/awt/image/DataBufferInt.java \ java/awt/image/DataBufferUShort.java \ java/awt/image/DirectColorModel.java \ java/awt/image/ImageConsumer.java \ java/awt/image/ImageObserver.java \ java/awt/image/ImageProducer.java \ java/awt/image/IndexColorModel.java \ java/awt/image/PackedColorModel.java \ java/awt/image/Raster.java \ java/awt/image/RasterOp.java \ ! java/awt/image/SampleModel.java \ java/awt/image/SinglePixelPackedSampleModel.java \ java/awt/image/WritableRaster.java \ + java/awt/image/AreaAveragingScaleFilter.java \ + java/awt/image/CropImageFilter.java \ + java/awt/image/FilteredImageSource.java \ + java/awt/image/ImageFilter.java \ + java/awt/image/MemoryImageSource.java \ + java/awt/image/PixelGrabber.java \ + java/awt/image/RGBImageFilter.java \ + java/awt/image/ReplicateScaleFilter.java \ + java/awt/image/BufferStrategy.java \ + java/awt/image/BufferedImageOp.java \ + java/awt/image/ImagingOpException.java \ + java/awt/image/RasterFormatException.java \ + java/awt/image/RenderedImage.java \ + java/awt/image/TileObserver.java \ + java/awt/image/VolatileImage.java \ + java/awt/image/WritableRenderedImage.java \ + java/awt/image/renderable/ContextualRenderedImageFactory.java \ + java/awt/image/renderable/ParameterBlock.java \ + java/awt/image/renderable/RenderContext.java \ + java/awt/image/renderable/RenderableImage.java \ + java/awt/image/renderable/RenderableImageOp.java \ + java/awt/image/renderable/RenderableImageProducer.java \ + java/awt/image/renderable/RenderedImageFactory.java \ java/awt/peer/ButtonPeer.java \ java/awt/peer/CanvasPeer.java \ ! java/awt/peer/CheckboxMenuItemPeer.java \ ! java/awt/peer/CheckboxPeer.java \ java/awt/peer/ChoicePeer.java \ java/awt/peer/ComponentPeer.java \ java/awt/peer/ContainerPeer.java \ *************** java/awt/peer/LightweightPeer.java \ *** 754,770 **** java/awt/peer/ListPeer.java \ java/awt/peer/MenuBarPeer.java \ java/awt/peer/MenuComponentPeer.java \ ! java/awt/peer/MenuItemPeer.java \ java/awt/peer/MenuPeer.java \ java/awt/peer/PanelPeer.java \ java/awt/peer/PopupMenuPeer.java \ java/awt/peer/ScrollPanePeer.java \ java/awt/peer/ScrollbarPeer.java \ ! java/awt/peer/TextAreaPeer.java \ java/awt/peer/TextComponentPeer.java \ java/awt/peer/TextFieldPeer.java \ java/awt/peer/WindowPeer.java \ ! java/beans/beancontext/BeanContext.java \ java/beans/beancontext/BeanContextChild.java \ java/beans/beancontext/BeanContextChildComponentProxy.java \ java/beans/beancontext/BeanContextChildSupport.java \ --- 855,947 ---- java/awt/peer/ListPeer.java \ java/awt/peer/MenuBarPeer.java \ java/awt/peer/MenuComponentPeer.java \ ! java/awt/peer/MenuItemPeer.java \ java/awt/peer/MenuPeer.java \ java/awt/peer/PanelPeer.java \ java/awt/peer/PopupMenuPeer.java \ java/awt/peer/ScrollPanePeer.java \ java/awt/peer/ScrollbarPeer.java \ ! java/awt/peer/TextAreaPeer.java \ java/awt/peer/TextComponentPeer.java \ java/awt/peer/TextFieldPeer.java \ java/awt/peer/WindowPeer.java \ ! java/awt/SystemColor.java \ ! java/awt/Polygon.java \ ! java/awt/MediaTracker.java \ ! java/awt/PrintGraphics.java \ ! java/awt/PrintJob.java \ ! java/awt/AWTKeyStroke.java \ ! java/awt/AlphaComposite.java \ ! java/awt/AttributeValue.java \ ! java/awt/BasicStroke.java \ ! java/awt/BufferCapabilities.java \ ! java/awt/ColorPaintContext.java \ ! java/awt/Composite.java \ ! java/awt/CompositeContext.java \ ! java/awt/ContainerOrderFocusTraversalPolicy.java \ ! java/awt/DefaultFocusTraversalPolicy.java \ ! java/awt/DefaultKeyboardFocusManager.java \ ! java/awt/DisplayMode.java \ ! java/awt/FocusTraversalPolicy.java \ ! java/awt/FontFormatException.java \ ! java/awt/GradientPaint.java \ ! java/awt/GraphicsConfigTemplate.java \ ! java/awt/GraphicsDevice.java \ ! java/awt/GraphicsEnvironment.java \ ! java/awt/HeadlessException.java \ ! java/awt/ImageCapabilities.java \ ! java/awt/JobAttributes.java \ ! java/awt/KeyEventDispatcher.java \ ! java/awt/KeyEventPostProcessor.java \ ! java/awt/KeyboardFocusManager.java \ ! java/awt/PageAttributes.java \ ! java/awt/Robot.java \ ! java/awt/ScrollPaneAdjustable.java \ ! java/awt/Stroke.java \ ! java/awt/TexturePaint.java \ ! java/awt/dnd/peer/DragSourceContextPeer.java \ ! java/awt/dnd/peer/DropTargetContextPeer.java \ ! java/awt/dnd/DnDConstants.java \ ! java/awt/dnd/DragGestureEvent.java \ ! java/awt/dnd/DragGestureListener.java \ ! java/awt/dnd/DragGestureRecognizer.java \ ! java/awt/dnd/DragSource.java \ ! java/awt/dnd/DragSourceAdapter.java \ ! java/awt/dnd/DragSourceContext.java \ ! java/awt/dnd/DragSourceDragEvent.java \ ! java/awt/dnd/DragSourceEvent.java \ ! java/awt/dnd/DragSourceListener.java \ ! java/awt/dnd/DragSourceMotionListener.java \ ! java/awt/dnd/DropTarget.java \ ! java/awt/dnd/InvalidDnDOperationException.java \ ! java/awt/dnd/Autoscroll.java \ ! java/awt/dnd/DragSourceDropEvent.java \ ! java/awt/dnd/DropTargetAdapter.java \ ! java/awt/dnd/DropTargetContext.java \ ! java/awt/dnd/DropTargetDragEvent.java \ ! java/awt/dnd/DropTargetDropEvent.java \ ! java/awt/dnd/DropTargetEvent.java \ ! java/awt/dnd/DropTargetListener.java \ ! java/awt/dnd/MouseDragGestureRecognizer.java \ ! java/awt/font/TextHitInfo.java \ ! java/awt/im/spi/InputMethod.java \ ! java/awt/im/spi/InputMethodContext.java \ ! java/awt/im/spi/InputMethodDescriptor.java \ ! java/awt/im/InputContext.java \ ! java/awt/im/InputMethodHighlight.java \ ! java/awt/im/InputMethodRequests.java \ ! java/awt/im/InputSubset.java \ ! java/awt/print/Book.java \ ! java/awt/print/PageFormat.java \ ! java/awt/print/Pageable.java \ ! java/awt/print/Paper.java \ ! java/awt/print/Printable.java \ ! java/awt/print/PrinterAbortException.java \ ! java/awt/print/PrinterException.java \ ! java/awt/print/PrinterGraphics.java \ ! java/awt/print/PrinterIOException.java \ ! java/awt/print/PrinterJob.java \ ! java/beans/beancontext/BeanContext.java \ java/beans/beancontext/BeanContextChild.java \ java/beans/beancontext/BeanContextChildComponentProxy.java \ java/beans/beancontext/BeanContextChildSupport.java \ *************** java/beans/beancontext/BeanContextServic *** 778,792 **** java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \ java/beans/beancontext/BeanContextServiceRevokedEvent.java \ java/beans/beancontext/BeanContextServiceRevokedListener.java \ ! java/beans/beancontext/BeanContextServices.java \ ! java/beans/beancontext/BeanContextServicesListener.java \ ! java/beans/AppletInitializer.java \ java/beans/BeanDescriptor.java \ java/beans/BeanInfo.java \ java/beans/Beans.java \ java/beans/Customizer.java \ java/beans/DesignMode.java \ java/beans/EventSetDescriptor.java \ java/beans/FeatureDescriptor.java \ java/beans/IndexedPropertyDescriptor.java \ java/beans/IntrospectionException.java \ --- 955,969 ---- java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \ java/beans/beancontext/BeanContextServiceRevokedEvent.java \ java/beans/beancontext/BeanContextServiceRevokedListener.java \ ! java/beans/beancontext/BeanContextServices.java \ ! java/beans/beancontext/BeanContextServicesListener.java \ java/beans/BeanDescriptor.java \ java/beans/BeanInfo.java \ java/beans/Beans.java \ java/beans/Customizer.java \ java/beans/DesignMode.java \ java/beans/EventSetDescriptor.java \ + java/beans/ExceptionListener.java \ java/beans/FeatureDescriptor.java \ java/beans/IndexedPropertyDescriptor.java \ java/beans/IntrospectionException.java \ *************** java/beans/MethodDescriptor.java \ *** 795,800 **** --- 972,978 ---- java/beans/ParameterDescriptor.java \ java/beans/PropertyChangeEvent.java \ java/beans/PropertyChangeListener.java \ + java/beans/PropertyChangeListenerProxy.java \ java/beans/PropertyChangeSupport.java \ java/beans/PropertyDescriptor.java \ java/beans/PropertyEditor.java \ *************** java/beans/PropertyEditorSupport.java \ *** 803,810 **** java/beans/PropertyVetoException.java \ java/beans/SimpleBeanInfo.java \ java/beans/VetoableChangeListener.java \ java/beans/VetoableChangeSupport.java \ ! java/beans/Visibility.java rmi_java_source_files = \ java/rmi/activation/Activatable.java \ --- 981,1279 ---- java/beans/PropertyVetoException.java \ java/beans/SimpleBeanInfo.java \ java/beans/VetoableChangeListener.java \ + java/beans/VetoableChangeListenerProxy.java \ java/beans/VetoableChangeSupport.java \ ! java/beans/Visibility.java \ ! java/beans/AppletInitializer.java \ ! javax/swing/border/AbstractBorder.java \ ! javax/swing/border/Border.java \ ! javax/swing/border/CompoundBorder.java \ ! javax/swing/border/EmptyBorder.java \ ! javax/swing/border/MatteBorder.java \ ! javax/swing/border/TitledBorder.java \ ! javax/swing/border/BevelBorder.java \ ! javax/swing/border/EtchedBorder.java \ ! javax/swing/border/LineBorder.java \ ! javax/swing/GrayFilter.java \ ! javax/swing/AbstractAction.java \ ! javax/swing/AbstractButton.java \ ! javax/swing/plaf/basic/BasicButtonUI.java \ ! javax/swing/plaf/basic/BasicCheckBoxUI.java \ ! javax/swing/plaf/basic/BasicDefaults.java \ ! javax/swing/plaf/basic/BasicGraphicsUtils.java \ ! javax/swing/plaf/basic/BasicLabelUI.java \ ! javax/swing/plaf/basic/BasicListUI.java \ ! javax/swing/plaf/basic/BasicOptionPaneUI.java \ ! javax/swing/plaf/basic/BasicPanelUI.java \ ! javax/swing/plaf/basic/BasicRadioButtonUI.java \ ! javax/swing/plaf/basic/BasicScrollPaneUI.java \ ! javax/swing/plaf/basic/BasicTabbedPaneUI.java \ ! javax/swing/plaf/basic/BasicTextUI.java \ ! javax/swing/plaf/basic/BasicToggleButtonUI.java \ ! javax/swing/plaf/basic/BasicTreeUI.java \ ! javax/swing/plaf/basic/BasicViewportUI.java \ ! javax/swing/plaf/basic/BasicLookAndFeel.java \ ! javax/swing/plaf/basic/BasicBorders.java \ ! javax/swing/plaf/basic/BasicIconFactory.java \ ! javax/swing/plaf/BorderUIResource.java \ ! javax/swing/plaf/UIResource.java \ ! javax/swing/plaf/ButtonUI.java \ ! javax/swing/plaf/ComponentUI.java \ ! javax/swing/plaf/LabelUI.java \ ! javax/swing/plaf/ListUI.java \ ! javax/swing/plaf/OptionPaneUI.java \ ! javax/swing/plaf/PanelUI.java \ ! javax/swing/plaf/ScrollPaneUI.java \ ! javax/swing/plaf/TabbedPaneUI.java \ ! javax/swing/plaf/TextUI.java \ ! javax/swing/plaf/TreeUI.java \ ! javax/swing/plaf/ViewportUI.java \ ! javax/swing/plaf/metal/MetalLookAndFeel.java \ ! javax/swing/plaf/ColorUIResource.java \ ! javax/swing/plaf/DimensionUIResource.java \ ! javax/swing/plaf/FontUIResource.java \ ! javax/swing/plaf/IconUIResource.java \ ! javax/swing/plaf/InsetsUIResource.java \ ! javax/swing/plaf/ActionMapUIResource.java \ ! javax/swing/plaf/ColorChooserUI.java \ ! javax/swing/plaf/ComboBoxUI.java \ ! javax/swing/plaf/ComponentInputMapUIResource.java \ ! javax/swing/plaf/DesktopIconUI.java \ ! javax/swing/plaf/DesktopPaneUI.java \ ! javax/swing/plaf/FileChooserUI.java \ ! javax/swing/plaf/InputMapUIResource.java \ ! javax/swing/plaf/InternalFrameUI.java \ ! javax/swing/plaf/MenuBarUI.java \ ! javax/swing/plaf/MenuItemUI.java \ ! javax/swing/plaf/PopupMenuUI.java \ ! javax/swing/plaf/ProgressBarUI.java \ ! javax/swing/plaf/RootPaneUI.java \ ! javax/swing/plaf/ScrollBarUI.java \ ! javax/swing/plaf/SeparatorUI.java \ ! javax/swing/plaf/SliderUI.java \ ! javax/swing/plaf/SplitPaneUI.java \ ! javax/swing/plaf/TableHeaderUI.java \ ! javax/swing/plaf/TableUI.java \ ! javax/swing/plaf/ToolBarUI.java \ ! javax/swing/plaf/ToolTipUI.java \ ! javax/swing/AbstractListModel.java \ ! javax/swing/AbstractSet.java \ ! javax/swing/colorchooser/AbstractColorChooserPanel.java \ ! javax/swing/colorchooser/ColorChooserComponentFactory.java \ ! javax/swing/colorchooser/ColorSelectionModel.java \ ! javax/swing/colorchooser/DefaultColorSelectionModel.java \ ! javax/swing/filechooser/FileFilter.java \ ! javax/swing/filechooser/FileSystemView.java \ ! javax/swing/filechooser/FileView.java \ ! javax/swing/table/AbstractTableModel.java \ ! javax/swing/table/DefaultTableColumnModel.java \ ! javax/swing/table/DefaultTableModel.java \ ! javax/swing/table/TableCellEditor.java \ ! javax/swing/table/TableCellRenderer.java \ ! javax/swing/table/TableColumn.java \ ! javax/swing/table/TableColumnModel.java \ ! javax/swing/table/TableModel.java \ ! javax/swing/table/DefaultTableCellRenderer.java \ ! javax/swing/Action.java \ ! javax/swing/BorderFactory.java \ ! javax/swing/Box.java \ ! javax/swing/BoxLayout.java \ ! javax/swing/ButtonGroup.java \ ! javax/swing/ButtonModel.java \ ! javax/swing/ComponentInputMap.java \ ! javax/swing/DefaultButtonModel.java \ ! javax/swing/DefaultCellRenderer.java \ ! javax/swing/DefaultListModel.java \ ! javax/swing/DefaultListSelectionModel.java \ ! javax/swing/Icon.java \ ! javax/swing/ImageIcon.java \ ! javax/swing/InputMap.java \ ! javax/swing/JApplet.java \ ! javax/swing/JButton.java \ ! javax/swing/JCheckBox.java \ ! javax/swing/JComponent.java \ ! javax/swing/JDialog.java \ ! javax/swing/JEditorPane.java \ ! javax/swing/JFrame.java \ ! javax/swing/JLabel.java \ ! javax/swing/JLayeredPane.java \ ! javax/swing/JList.java \ ! javax/swing/JMenuBar.java \ ! javax/swing/JOptionPane.java \ ! javax/swing/JPanel.java \ ! javax/swing/JRadioButton.java \ ! javax/swing/JRootPane.java \ ! javax/swing/JScrollBar.java \ ! javax/swing/JScrollPane.java \ ! javax/swing/JTabbedPane.java \ ! javax/swing/JTextField.java \ ! javax/swing/JToggleButton.java \ ! javax/swing/JToolTip.java \ ! javax/swing/JTree.java \ ! javax/swing/JViewport.java \ ! javax/swing/JWindow.java \ ! javax/swing/KeyStroke.java \ ! javax/swing/ListCellRenderer.java \ ! javax/swing/ListModel.java \ ! javax/swing/ListSelectionModel.java \ ! javax/swing/LookAndFeel.java \ ! javax/swing/Scrollable.java \ ! javax/swing/SwingConstants.java \ ! javax/swing/SwingUtilities.java \ ! javax/swing/Timer.java \ ! javax/swing/ToggleButtonModel.java \ ! javax/swing/UIDefaults.java \ ! javax/swing/UIManager.java \ ! javax/swing/UnsupportedLookAndFeelException.java \ ! javax/swing/event/AncestorEvent.java \ ! javax/swing/event/AncestorListener.java \ ! javax/swing/event/ChangeEvent.java \ ! javax/swing/event/ChangeListener.java \ ! javax/swing/event/DocumentEvent.java \ ! javax/swing/event/DocumentListener.java \ ! javax/swing/event/HyperlinkEvent.java \ ! javax/swing/event/HyperlinkListener.java \ ! javax/swing/event/ListDataEvent.java \ ! javax/swing/event/ListDataListener.java \ ! javax/swing/event/ListSelectionEvent.java \ ! javax/swing/event/ListSelectionListener.java \ ! javax/swing/event/MenuEvent.java \ ! javax/swing/event/UndoableEditEvent.java \ ! javax/swing/event/UndoableEditListener.java \ ! javax/swing/event/CaretEvent.java \ ! javax/swing/event/CaretListener.java \ ! javax/swing/event/CellEditorListener.java \ ! javax/swing/event/EventListenerList.java \ ! javax/swing/event/InternalFrameAdapter.java \ ! javax/swing/event/InternalFrameEvent.java \ ! javax/swing/event/InternalFrameListener.java \ ! javax/swing/event/MenuDragMouseEvent.java \ ! javax/swing/event/MenuDragMouseListener.java \ ! javax/swing/event/MenuKeyEvent.java \ ! javax/swing/event/MenuKeyListener.java \ ! javax/swing/event/MenuListener.java \ ! javax/swing/event/MouseInputAdapter.java \ ! javax/swing/event/MouseInputListener.java \ ! javax/swing/event/PopupMenuEvent.java \ ! javax/swing/event/PopupMenuListener.java \ ! javax/swing/event/SwingPropertyChangeSupport.java \ ! javax/swing/event/TableColumnModelEvent.java \ ! javax/swing/event/TableColumnModelListener.java \ ! javax/swing/event/TableModelEvent.java \ ! javax/swing/event/TableModelListener.java \ ! javax/swing/event/TreeExpansionEvent.java \ ! javax/swing/event/TreeExpansionListener.java \ ! javax/swing/event/TreeModelEvent.java \ ! javax/swing/event/TreeModelListener.java \ ! javax/swing/event/TreeSelectionEvent.java \ ! javax/swing/event/TreeSelectionListener.java \ ! javax/swing/event/TreeWillExpandListener.java \ ! javax/swing/ActionMap.java \ ! javax/swing/text/AbstractDocument.java \ ! javax/swing/text/AttributeSet.java \ ! javax/swing/text/BadLocationException.java \ ! javax/swing/text/Caret.java \ ! javax/swing/text/CharacterIterator.java \ ! javax/swing/text/ComponentView.java \ ! javax/swing/text/DefaultCaret.java \ ! javax/swing/text/DefaultEditorKit.java \ ! javax/swing/text/Document.java \ ! javax/swing/text/EditorKit.java \ ! javax/swing/text/Element.java \ ! javax/swing/text/GapContent.java \ ! javax/swing/text/JTextComponent.java \ ! javax/swing/text/Keymap.java \ ! javax/swing/text/PlainDocument.java \ ! javax/swing/text/PlainEditorKit.java \ ! javax/swing/text/Position.java \ ! javax/swing/text/Segment.java \ ! javax/swing/text/Style.java \ ! javax/swing/text/View.java \ ! javax/swing/text/ViewFactory.java \ ! javax/swing/text/MutableAttributeSet.java \ ! javax/swing/text/StyledDocument.java \ ! javax/swing/text/StyledEditorKit.java \ ! javax/swing/text/TextAction.java \ ! javax/swing/text/html/HTML.java \ ! javax/swing/text/html/parser/ParserDelegator.java \ ! javax/swing/tree/TreeNode.java \ ! javax/swing/tree/AbstractLayoutCache.java \ ! javax/swing/tree/DefaultMutableTreeNode.java \ ! javax/swing/tree/DefaultTreeCellEditor.java \ ! javax/swing/tree/DefaultTreeCellRenderer.java \ ! javax/swing/tree/DefaultTreeModel.java \ ! javax/swing/tree/DefaultTreeSelectionModel.java \ ! javax/swing/tree/ExpandVetoException.java \ ! javax/swing/tree/FixedHeightLayoutCache.java \ ! javax/swing/tree/MutableTreeNode.java \ ! javax/swing/tree/RowMapper.java \ ! javax/swing/tree/TreeCellEditor.java \ ! javax/swing/tree/TreeCellRenderer.java \ ! javax/swing/tree/TreeModel.java \ ! javax/swing/tree/TreePath.java \ ! javax/swing/tree/TreeSelectionModel.java \ ! javax/swing/tree/VariableHeightLayoutCache.java \ ! javax/swing/undo/UndoableEdit.java \ ! javax/swing/undo/AbstractUndoableEdit.java \ ! javax/swing/undo/CannotRedoException.java \ ! javax/swing/undo/CannotUndoException.java \ ! javax/swing/undo/CompoundEdit.java \ ! javax/swing/undo/StateEdit.java \ ! javax/swing/undo/StateEditable.java \ ! javax/swing/undo/UndoManager.java \ ! javax/swing/undo/UndoableEditSupport.java \ ! javax/swing/BoundedRangeModel.java \ ! javax/swing/CellEditor.java \ ! javax/swing/ComboBoxEditor.java \ ! javax/swing/ComboBoxModel.java \ ! javax/swing/DefaultBoundedRangeModel.java \ ! javax/swing/DesktopManager.java \ ! javax/swing/InputVerifier.java \ ! javax/swing/JInternalFrame.java \ ! javax/swing/JTable.java \ ! javax/swing/MenuElement.java \ ! javax/swing/MenuSelectionManager.java \ ! javax/swing/MutableComboBoxModel.java \ ! javax/swing/Renderer.java \ ! javax/swing/RootPaneContainer.java \ ! javax/swing/ScrollPaneConstants.java \ ! javax/swing/SingleSelectionModel.java \ ! javax/swing/SizeRequirements.java \ ! javax/swing/SizeSequence.java \ ! javax/swing/WindowConstants.java \ ! javax/swing/AbstractCellEditor.java \ ! javax/swing/CellRendererPane.java \ ! javax/swing/DebugGraphics.java \ ! javax/swing/DefaultCellEditor.java \ ! javax/swing/DefaultComboBoxModel.java \ ! javax/swing/DefaultDesktopManager.java \ ! javax/swing/DefaultFocusManager.java \ ! javax/swing/DefaultListCellRenderer.java \ ! javax/swing/DefaultSingleSelectionModel.java \ ! javax/swing/FocusManager.java \ ! javax/swing/JCheckBoxMenuItem.java \ ! javax/swing/JColorChooser.java \ ! javax/swing/JComboBox.java \ ! javax/swing/JDesktopPane.java \ ! javax/swing/JFileChooser.java \ ! javax/swing/JMenu.java \ ! javax/swing/JMenuItem.java \ ! javax/swing/JPasswordField.java \ ! javax/swing/JPopupMenu.java \ ! javax/swing/JProgressBar.java \ ! javax/swing/JRadioButtonMenuItem.java \ ! javax/swing/JSeparator.java \ ! javax/swing/JSlider.java \ ! javax/swing/JSplitPane.java \ ! javax/swing/JTextPane.java \ ! javax/swing/JToolBar.java \ ! javax/swing/OverlayLayout.java \ ! javax/swing/ProgressMonitor.java \ ! javax/swing/ProgressMonitorInputStream.java \ ! javax/swing/RepaintManager.java \ ! javax/swing/ScrollPaneLayout.java \ ! javax/swing/ToolTipManager.java \ ! javax/swing/ViewportLayout.java rmi_java_source_files = \ java/rmi/activation/Activatable.java \ *************** java/rmi/server/LogStream.java \ *** 853,858 **** --- 1322,1328 ---- java/rmi/server/ObjID.java \ java/rmi/server/Operation.java \ java/rmi/server/RMIClassLoader.java \ + java/rmi/server/RMIClassLoaderSpi.java \ java/rmi/server/RMIClientSocketFactory.java \ java/rmi/server/RMIFailureHandler.java \ java/rmi/server/RMIServerSocketFactory.java \ *************** java/rmi/server/SocketSecurityException. *** 872,877 **** --- 1342,1349 ---- java/rmi/server/UID.java \ java/rmi/server/UnicastRemoteObject.java \ java/rmi/server/Unreferenced.java \ + gnu/java/rmi/RMIMarshalledObjectInputStream.java \ + gnu/java/rmi/RMIMarshalledObjectOutputStream.java \ gnu/java/rmi/dgc/DGCImpl.java \ gnu/java/rmi/dgc/DGCImpl_Skel.java \ gnu/java/rmi/dgc/DGCImpl_Stub.java \ *************** gnu/java/rmi/rmic/Compiler.java \ *** 883,888 **** --- 1355,1361 ---- gnu/java/rmi/rmic/CompilerProcess.java \ gnu/java/rmi/rmic/RMIC.java \ gnu/java/rmi/rmic/TabbedWriter.java \ + gnu/java/rmi/server/ConnectionRunnerPool.java \ gnu/java/rmi/server/ProtocolConstants.java \ gnu/java/rmi/server/RMIDefaultSocketFactory.java \ gnu/java/rmi/server/RMIHashes.java \ *************** gnu/java/rmi/server/UnicastServer.java \ *** 897,902 **** --- 1370,1398 ---- gnu/java/rmi/server/UnicastServerRef.java javax_source_files = \ + javax/accessibility/Accessible.java \ + javax/accessibility/AccessibleAction.java \ + javax/accessibility/AccessibleBundle.java \ + javax/accessibility/AccessibleComponent.java \ + javax/accessibility/AccessibleContext.java \ + javax/accessibility/AccessibleEditableText.java \ + javax/accessibility/AccessibleExtendedComponent.java \ + javax/accessibility/AccessibleExtendedTable.java \ + javax/accessibility/AccessibleHyperlink.java \ + javax/accessibility/AccessibleHypertext.java \ + javax/accessibility/AccessibleIcon.java \ + javax/accessibility/AccessibleKeyBinding.java \ + javax/accessibility/AccessibleRelation.java \ + javax/accessibility/AccessibleRelationSet.java \ + javax/accessibility/AccessibleResourceBundle.java \ + javax/accessibility/AccessibleRole.java \ + javax/accessibility/AccessibleSelection.java \ + javax/accessibility/AccessibleState.java \ + javax/accessibility/AccessibleStateSet.java \ + javax/accessibility/AccessibleTable.java \ + javax/accessibility/AccessibleTableModelChange.java \ + javax/accessibility/AccessibleText.java \ + javax/accessibility/AccessibleValue.java \ javax/naming/directory/Attribute.java \ javax/naming/directory/AttributeInUseException.java \ javax/naming/directory/AttributeModificationException.java \ *************** javax/naming/ldap/UnsolicitedNotificatio *** 985,990 **** --- 1481,1500 ---- javax/naming/ldap/UnsolicitedNotificationEvent.java \ javax/naming/ldap/UnsolicitedNotificationListener.java \ javax/naming/OperationNotSupportedException.java \ + javax/sql/ConnectionEvent.java \ + javax/sql/ConnectionEventListener.java \ + javax/sql/ConnectionPoolDataSource.java \ + javax/sql/DataSource.java \ + javax/sql/PooledConnection.java \ + javax/sql/RowSetEvent.java \ + javax/sql/RowSetInternal.java \ + javax/sql/RowSet.java \ + javax/sql/RowSetListener.java \ + javax/sql/RowSetMetaData.java \ + javax/sql/RowSetReader.java \ + javax/sql/RowSetWriter.java \ + javax/sql/XAConnection.java \ + javax/sql/XADataSource.java \ javax/transaction/xa/XAException.java \ javax/transaction/xa/XAResource.java \ javax/transaction/xa/Xid.java \ *************** java/lang/AbstractMethodError.java \ *** 1017,1022 **** --- 1527,1533 ---- java/lang/ArithmeticException.java \ java/lang/ArrayIndexOutOfBoundsException.java \ java/lang/ArrayStoreException.java \ + java/lang/AssertionError.java \ java/lang/Boolean.java \ java/lang/Byte.java \ java/lang/Character.java \ *************** java/lang/SecurityException.java \ *** 1072,1077 **** --- 1583,1589 ---- java/lang/SecurityManager.java \ java/lang/Short.java \ java/lang/StackOverflowError.java \ + java/lang/StackTraceElement.java \ java/lang/StrictMath.java \ java/lang/String.java \ java/lang/StringBuffer.java \ *************** java/lang/VerifyError.java \ *** 1090,1095 **** --- 1602,1608 ---- java/lang/VirtualMachineError.java \ java/lang/VMClassLoader.java \ java/lang/VMSecurityManager.java \ + java/lang/VMThrowable.java \ java/lang/Void.java \ java/io/BufferedInputStream.java \ java/io/BufferedOutputStream.java \ *************** java/io/StringWriter.java \ *** 1163,1168 **** --- 1676,1682 ---- java/io/SyncFailedException.java \ java/io/UTFDataFormatException.java \ java/io/UnsupportedEncodingException.java \ + java/io/VMObjectStreamClass.java \ java/io/WriteAbortedException.java \ java/io/Writer.java \ java/util/AbstractCollection.java \ *************** java/util/AbstractSequentialList.java \ *** 1172,1178 **** java/util/AbstractSet.java \ java/util/ArrayList.java \ java/util/Arrays.java \ - java/util/BasicMapEntry.java \ java/util/BitSet.java \ java/util/Calendar.java \ java/util/Collection.java \ --- 1686,1691 ---- *************** java/util/Dictionary.java \ *** 1184,1189 **** --- 1697,1703 ---- java/util/EmptyStackException.java \ java/util/Enumeration.java \ java/util/EventListener.java \ + java/util/EventListenerProxy.java \ java/util/EventObject.java \ java/util/GregorianCalendar.java \ java/util/HashMap.java \ *************** java/util/Observable.java \ *** 1205,1210 **** --- 1719,1725 ---- java/util/Observer.java \ java/util/Properties.java \ java/util/PropertyPermission.java \ + java/util/PropertyPermissionCollection.java \ java/util/PropertyResourceBundle.java \ java/util/Random.java \ java/util/RandomAccess.java \ *************** java/util/TreeMap.java \ *** 1222,1228 **** java/util/TreeSet.java \ java/util/TooManyListenersException.java \ java/util/Vector.java \ ! java/util/WeakHashMap.java ## List of all .java files to be compiled. Please keep this list ## alphabetical. Please put files from java/lang, java/io, and java/util --- 1737,1746 ---- java/util/TreeSet.java \ java/util/TooManyListenersException.java \ java/util/Vector.java \ ! java/util/WeakHashMap.java \ ! java/util/regex/Matcher.java \ ! java/util/regex/Pattern.java \ ! java/util/regex/PatternSyntaxException.java ## List of all .java files to be compiled. Please keep this list ## alphabetical. Please put files from java/lang, java/io, and java/util *************** gnu/gcj/runtime/FileDeleter.java \ *** 1249,1255 **** --- 1767,1776 ---- gnu/gcj/runtime/FinalizerThread.java \ gnu/gcj/runtime/FirstThread.java \ gnu/gcj/runtime/JNIWeakRef.java \ + gnu/gcj/runtime/MethodRef.java \ + gnu/gcj/runtime/NameFinder.java \ gnu/gcj/runtime/SharedLibLoader.java \ + gnu/gcj/runtime/StackTrace.java \ gnu/gcj/runtime/StringBuffer.java \ gnu/gcj/runtime/VMClassLoader.java \ gnu/java/io/ClassLoaderObjectInputStream.java \ *************** gnu/java/locale/LocaleInformation_zh_HK. *** 1399,1414 **** gnu/java/locale/LocaleInformation_zh_SG.java \ gnu/java/locale/LocaleInformation_zh_TW.java \ gnu/java/math/MPN.java \ gnu/java/security/provider/DefaultPolicy.java \ gnu/java/security/provider/Gnu.java \ gnu/java/security/provider/SHA.java \ gnu/java/security/provider/SHA1PRNG.java \ gnu/java/text/BaseBreakIterator.java \ gnu/java/text/CharacterBreakIterator.java \ gnu/java/text/LineBreakIterator.java \ ! gnu/java/text/SentenceBreakIterator.java \ gnu/java/text/WordBreakIterator.java \ gnu/java/util/DoubleEnumeration.java \ java/lang/ref/PhantomReference.java \ java/lang/ref/Reference.java \ java/lang/ref/ReferenceQueue.java \ --- 1920,1971 ---- gnu/java/locale/LocaleInformation_zh_SG.java \ gnu/java/locale/LocaleInformation_zh_TW.java \ gnu/java/math/MPN.java \ + gnu/java/nio/ByteBufferImpl.java \ + gnu/java/nio/CharBufferImpl.java \ + gnu/java/nio/DatagramChannelImpl.java \ + gnu/java/nio/DoubleBufferImpl.java \ + gnu/java/nio/FileChannelImpl.java \ + gnu/java/nio/FloatBufferImpl.java \ + gnu/java/nio/IntBufferImpl.java \ + gnu/java/nio/LongBufferImpl.java \ + gnu/java/nio/PipeImpl.java \ + gnu/java/nio/SelectionKeyImpl.java \ + gnu/java/nio/SelectorImpl.java \ + gnu/java/nio/SelectorProviderImpl.java \ + gnu/java/nio/ServerSocketChannelImpl.java \ + gnu/java/nio/ShortBufferImpl.java \ + gnu/java/nio/SocketChannelImpl.java \ + gnu/java/nio/charset/ISO_8859_1.java \ + gnu/java/nio/charset/Provider.java \ + gnu/java/nio/charset/US_ASCII.java \ + gnu/java/nio/charset/UTF_16.java \ + gnu/java/nio/charset/UTF_16BE.java \ + gnu/java/nio/charset/UTF_16Decoder.java \ + gnu/java/nio/charset/UTF_16Encoder.java \ + gnu/java/nio/charset/UTF_16LE.java \ + gnu/java/nio/charset/UTF_8.java \ + gnu/java/security/der/DEREncodingException.java \ + gnu/java/security/provider/DERReader.java \ + gnu/java/security/provider/DERWriter.java \ gnu/java/security/provider/DefaultPolicy.java \ + gnu/java/security/provider/DSAKeyPairGenerator.java \ + gnu/java/security/provider/DSAParameterGenerator.java \ + gnu/java/security/provider/DSAParameters.java \ + gnu/java/security/provider/DSASignature.java \ gnu/java/security/provider/Gnu.java \ + gnu/java/security/provider/GnuDSAPrivateKey.java \ + gnu/java/security/provider/GnuDSAPublicKey.java \ + gnu/java/security/provider/MD5.java \ gnu/java/security/provider/SHA.java \ gnu/java/security/provider/SHA1PRNG.java \ + gnu/java/security/util/Prime.java \ gnu/java/text/BaseBreakIterator.java \ gnu/java/text/CharacterBreakIterator.java \ gnu/java/text/LineBreakIterator.java \ ! gnu/java/text/SentenceBreakIterator.java \ gnu/java/text/WordBreakIterator.java \ gnu/java/util/DoubleEnumeration.java \ + gnu/java/util/EmptyEnumeration.java \ java/lang/ref/PhantomReference.java \ java/lang/ref/Reference.java \ java/lang/ref/ReferenceQueue.java \ *************** java/lang/reflect/AccessibleObject.java *** 1418,1428 **** --- 1975,1988 ---- java/lang/reflect/Array.java \ java/lang/reflect/Constructor.java \ java/lang/reflect/Field.java \ + java/lang/reflect/InvocationHandler.java \ java/lang/reflect/InvocationTargetException.java \ java/lang/reflect/Member.java \ java/lang/reflect/Method.java \ java/lang/reflect/Modifier.java \ + java/lang/reflect/Proxy.java \ java/lang/reflect/ReflectPermission.java \ + java/lang/reflect/UndeclaredThrowableException.java \ java/math/BigDecimal.java \ java/math/BigInteger.java \ java/net/Authenticator.java \ *************** java/net/ContentHandlerFactory.java \ *** 1433,1457 **** --- 1993,2027 ---- java/net/DatagramPacket.java \ java/net/DatagramSocket.java \ java/net/DatagramSocketImpl.java \ + java/net/DatagramSocketImplFactory.java \ java/net/FileNameMap.java \ java/net/HttpURLConnection.java \ java/net/InetAddress.java \ + java/net/Inet4Address.java \ + java/net/Inet6Address.java \ + java/net/InetSocketAddress.java \ java/net/JarURLConnection.java \ java/net/MalformedURLException.java \ java/net/MulticastSocket.java \ java/net/NetPermission.java \ + java/net/NetworkInterface.java \ java/net/NoRouteToHostException.java \ java/net/PasswordAuthentication.java \ java/net/PlainDatagramSocketImpl.java \ java/net/PlainSocketImpl.java \ + java/net/PortUnreachableException.java \ java/net/ProtocolException.java \ java/net/ServerSocket.java \ java/net/Socket.java \ + java/net/SocketAddress.java \ java/net/SocketException.java \ java/net/SocketImpl.java \ java/net/SocketImplFactory.java \ java/net/SocketOptions.java \ java/net/SocketPermission.java \ + java/net/SocketTimeoutException.java \ + java/net/URI.java \ + java/net/URISyntaxException.java \ java/net/URL.java \ java/net/URLClassLoader.java \ java/net/URLConnection.java \ *************** java/net/URLStreamHandler.java \ *** 1461,1466 **** --- 2031,2102 ---- java/net/URLStreamHandlerFactory.java \ java/net/UnknownHostException.java \ java/net/UnknownServiceException.java \ + java/nio/Buffer.java \ + java/nio/BufferOverflowException.java \ + java/nio/BufferUnderflowException.java \ + java/nio/ByteBuffer.java \ + java/nio/ByteOrder.java \ + java/nio/CharBuffer.java \ + java/nio/DoubleBuffer.java \ + java/nio/FloatBuffer.java \ + java/nio/IntBuffer.java \ + java/nio/InvalidMarkException.java \ + java/nio/LongBuffer.java \ + java/nio/MappedByteBuffer.java \ + java/nio/ReadOnlyBufferException.java \ + java/nio/ShortBuffer.java \ + java/nio/channels/AlreadyConnectedException.java \ + java/nio/channels/AsynchronousCloseException.java \ + java/nio/channels/ByteChannel.java \ + java/nio/channels/CancelledKeyException.java \ + java/nio/channels/Channel.java \ + java/nio/channels/Channels.java \ + java/nio/channels/ClosedByInterruptException.java \ + java/nio/channels/ClosedChannelException.java \ + java/nio/channels/ClosedSelectorException.java \ + java/nio/channels/ConnectionPendingException.java \ + java/nio/channels/DatagramChannel.java \ + java/nio/channels/FileChannel.java \ + java/nio/channels/FileLock.java \ + java/nio/channels/FileLockInterruptionException.java \ + java/nio/channels/GatheringByteChannel.java \ + java/nio/channels/IllegalBlockingModeException.java \ + java/nio/channels/IllegalSelectorException.java \ + java/nio/channels/InterruptibleChannel.java \ + java/nio/channels/NoConnectionPendingException.java \ + java/nio/channels/NonReadableChannelException.java \ + java/nio/channels/NonWritableChannelException.java \ + java/nio/channels/NotYetBoundException.java \ + java/nio/channels/NotYetConnectedException.java \ + java/nio/channels/OverlappingFileLockException.java \ + java/nio/channels/Pipe.java \ + java/nio/channels/ReadableByteChannel.java \ + java/nio/channels/ScatteringByteChannel.java \ + java/nio/channels/SelectableChannel.java \ + java/nio/channels/SelectionKey.java \ + java/nio/channels/Selector.java \ + java/nio/channels/ServerSocketChannel.java \ + java/nio/channels/SocketChannel.java \ + java/nio/channels/UnresolvedAddressException.java \ + java/nio/channels/UnsupportedAddressTypeException.java \ + java/nio/channels/WritableByteChannel.java \ + java/nio/channels/spi/AbstractSelectableChannel.java \ + java/nio/channels/spi/AbstractInterruptibleChannel.java \ + java/nio/channels/spi/AbstractSelectionKey.java \ + java/nio/channels/spi/AbstractSelector.java \ + java/nio/channels/spi/SelectorProvider.java \ + java/nio/charset/Charset.java \ + java/nio/charset/CharacterCodingException.java \ + java/nio/charset/CharsetDecoder.java \ + java/nio/charset/CharsetEncoder.java \ + java/nio/charset/CoderMalfunctionError.java \ + java/nio/charset/CoderResult.java \ + java/nio/charset/CodingErrorAction.java \ + java/nio/charset/IllegalCharsetNameException.java \ + java/nio/charset/MalformedInputException.java \ + java/nio/charset/UnmappableCharacterException.java \ + java/nio/charset/UnsupportedCharsetException.java \ + java/nio/charset/spi/CharsetProvider.java \ java/security/AccessControlContext.java \ java/security/AccessControlException.java \ java/security/AccessController.java \ *************** java/security/cert/CertificateFactory.ja *** 1545,1550 **** --- 2181,2190 ---- java/security/cert/CertificateFactorySpi.java \ java/security/cert/CertificateNotYetValidException.java \ java/security/cert/CertificateParsingException.java \ + java/security/cert/CertPath.java \ + java/security/cert/CertPathBuilderException.java \ + java/security/cert/CertPathValidatorException.java \ + java/security/cert/CertStoreException.java \ java/security/cert/X509CRL.java \ java/security/cert/X509CRLEntry.java \ java/security/cert/X509Certificate.java \ *************** java/sql/Date.java \ *** 1584,1597 **** --- 2224,2240 ---- java/sql/Driver.java \ java/sql/DriverManager.java \ java/sql/DriverPropertyInfo.java \ + java/sql/ParameterMetaData.java \ java/sql/PreparedStatement.java \ java/sql/Ref.java \ java/sql/ResultSet.java \ java/sql/ResultSetMetaData.java \ + java/sql/Savepoint.java \ java/sql/SQLData.java \ java/sql/SQLException.java \ java/sql/SQLInput.java \ java/sql/SQLOutput.java \ + java/sql/SQLPermission.java \ java/sql/SQLWarning.java \ java/sql/Statement.java \ java/sql/Struct.java \ *************** java/util/zip/ZipException.java \ *** 1646,1705 **** java/util/zip/ZipFile.java \ java/util/zip/ZipInputStream.java \ java/util/zip/ZipOutputStream.java \ - org/w3c/dom/Attr.java \ - org/w3c/dom/CDATASection.java \ - org/w3c/dom/CharacterData.java \ - org/w3c/dom/Comment.java \ - org/w3c/dom/DOMException.java \ - org/w3c/dom/DOMImplementation.java \ - org/w3c/dom/Document.java \ - org/w3c/dom/DocumentFragment.java \ - org/w3c/dom/DocumentType.java \ - org/w3c/dom/Element.java \ - org/w3c/dom/Entity.java \ - org/w3c/dom/EntityReference.java \ - org/w3c/dom/NamedNodeMap.java \ - org/w3c/dom/Node.java \ - org/w3c/dom/NodeList.java \ - org/w3c/dom/Notation.java \ - org/w3c/dom/ProcessingInstruction.java \ - org/w3c/dom/Text.java \ - org/w3c/dom/ranges/DocumentRange.java \ - org/w3c/dom/ranges/Range.java \ - org/w3c/dom/ranges/RangeException.java \ - org/w3c/dom/traversal/DocumentTraversal.java \ - org/w3c/dom/traversal/NodeFilter.java \ - org/w3c/dom/traversal/NodeIterator.java \ - org/w3c/dom/traversal/TreeWalker.java \ - org/xml/sax/ext/DeclHandler.java \ - org/xml/sax/ext/LexicalHandler.java \ - org/xml/sax/helpers/AttributeListImpl.java \ - org/xml/sax/helpers/AttributesImpl.java \ - org/xml/sax/helpers/DefaultHandler.java \ - org/xml/sax/helpers/LocatorImpl.java \ - org/xml/sax/helpers/NamespaceSupport.java \ - org/xml/sax/helpers/ParserAdapter.java \ - org/xml/sax/helpers/ParserFactory.java \ - org/xml/sax/helpers/XMLFilterImpl.java \ - org/xml/sax/helpers/XMLReaderAdapter.java \ - org/xml/sax/helpers/XMLReaderFactory.java \ - org/xml/sax/AttributeList.java \ - org/xml/sax/Attributes.java \ - org/xml/sax/ContentHandler.java \ - org/xml/sax/DTDHandler.java \ - org/xml/sax/DocumentHandler.java \ - org/xml/sax/EntityResolver.java \ - org/xml/sax/ErrorHandler.java \ - org/xml/sax/HandlerBase.java \ - org/xml/sax/InputSource.java \ - org/xml/sax/Locator.java \ - org/xml/sax/Parser.java \ - org/xml/sax/SAXException.java \ - org/xml/sax/SAXNotRecognizedException.java \ - org/xml/sax/SAXNotSupportedException.java \ - org/xml/sax/SAXParseException.java \ - org/xml/sax/XMLFilter.java \ - org/xml/sax/XMLReader.java \ $(rmi_java_source_files) \ $(awt_java_source_files) \ $(convert_source_files) \ --- 2289,2294 ---- *************** gnu/gcj/io/shs.cc \ *** 1742,1753 **** gnu/gcj/protocol/core/natCoreInputStream.cc \ gnu/gcj/runtime/natFinalizerThread.cc \ gnu/gcj/runtime/natFirstThread.cc \ gnu/gcj/runtime/natSharedLibLoader.cc \ gnu/gcj/runtime/natStringBuffer.cc \ java/io/natFile.cc \ java/io/natFileDescriptor.cc \ java/io/natObjectInputStream.cc \ ! java/io/natObjectOutputStream.cc \ java/lang/natCharacter.cc \ java/lang/natClass.cc \ java/lang/natClassLoader.cc \ --- 2331,2355 ---- gnu/gcj/protocol/core/natCoreInputStream.cc \ gnu/gcj/runtime/natFinalizerThread.cc \ gnu/gcj/runtime/natFirstThread.cc \ + gnu/gcj/runtime/natNameFinder.cc \ gnu/gcj/runtime/natSharedLibLoader.cc \ + gnu/gcj/runtime/natStackTrace.cc \ gnu/gcj/runtime/natStringBuffer.cc \ + gnu/gcj/runtime/natVMClassLoader.cc \ + gnu/java/nio/natByteBufferImpl.cc \ + gnu/java/nio/natCharBufferImpl.cc \ + gnu/java/nio/natDoubleBufferImpl.cc \ + gnu/java/nio/natFileChannelImpl.cc \ + gnu/java/nio/natFloatBufferImpl.cc \ + gnu/java/nio/natIntBufferImpl.cc \ + gnu/java/nio/natLongBufferImpl.cc \ + gnu/java/nio/natSelectorImpl.cc \ + gnu/java/nio/natShortBufferImpl.cc \ + gnu/java/nio/natSocketChannelImpl.cc \ java/io/natFile.cc \ java/io/natFileDescriptor.cc \ java/io/natObjectInputStream.cc \ ! java/io/natVMObjectStreamClass.cc \ java/lang/natCharacter.cc \ java/lang/natClass.cc \ java/lang/natClassLoader.cc \ *************** java/lang/natString.cc \ *** 1761,1776 **** java/lang/natStringBuffer.cc \ java/lang/natSystem.cc \ java/lang/natThread.cc \ ! java/lang/natThrowable.cc \ java/lang/ref/natReference.cc \ java/lang/reflect/natArray.cc \ java/lang/reflect/natConstructor.cc \ java/lang/reflect/natField.cc \ java/lang/reflect/natMethod.cc \ java/net/natInetAddress.cc \ java/net/natPlainDatagramSocketImpl.cc \ java/net/natPlainSocketImpl.cc \ java/text/natCollator.cc \ java/util/zip/natDeflater.cc \ java/util/zip/natInflater.cc --- 2363,2382 ---- java/lang/natStringBuffer.cc \ java/lang/natSystem.cc \ java/lang/natThread.cc \ ! java/lang/natVMSecurityManager.cc \ java/lang/ref/natReference.cc \ java/lang/reflect/natArray.cc \ java/lang/reflect/natConstructor.cc \ java/lang/reflect/natField.cc \ java/lang/reflect/natMethod.cc \ + java/lang/reflect/natProxy.cc \ + java/net/natNetworkInterface.cc \ java/net/natInetAddress.cc \ java/net/natPlainDatagramSocketImpl.cc \ java/net/natPlainSocketImpl.cc \ java/text/natCollator.cc \ + java/util/natResourceBundle.cc \ + java/util/natTimeZone.cc \ java/util/zip/natDeflater.cc \ java/util/zip/natInflater.cc *************** AM_MAKEFLAGS = \ *** 1906,1912 **** "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ ! "JC1FLAGS=$(JC1FLAGS)" \ "LDFLAGS=$(LDFLAGS)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ --- 2512,2518 ---- "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ ! "GCJFLAGS=$(GCJFLAGS)" \ "LDFLAGS=$(LDFLAGS)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ *************** AM_MAKEFLAGS = \ *** 1922,1929 **** "prefix=$(prefix)" \ "AR=$(AR)" \ "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \ --- 2528,2533 ---- *************** AM_MAKEFLAGS = \ *** 1931,1936 **** --- 2535,2543 ---- "RANLIB=$(RANLIB)" \ "DESTDIR=$(DESTDIR)" + # Subdir rules rely on $(FLAGS_TO_PASS) + FLAGS_TO_PASS = $(AM_MAKEFLAGS) + CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host MAKEOVERRIDES= diff -Nrc3pad gcc-3.2.3/libjava/Makefile.in gcc-3.3/libjava/Makefile.in *** gcc-3.2.3/libjava/Makefile.in 2003-04-22 06:56:18.000000000 +0000 --- gcc-3.3/libjava/Makefile.in 2003-05-14 00:18:14.000000000 +0000 *************** host_alias = @host_alias@ *** 63,71 **** host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ - AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ AR = @AR@ AS = @AS@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ --- 63,71 ---- host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ AR = @AR@ AS = @AS@ + BACKTRACESPEC = @BACKTRACESPEC@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ *************** GCOBJS = @GCOBJS@ *** 86,92 **** --- 86,94 ---- GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ + IEEESPEC = @IEEESPEC@ INCLTDL = @INCLTDL@ + INTERPRETER = @INTERPRETER@ JC1GCSPEC = @JC1GCSPEC@ LIBFFI = @LIBFFI@ LIBGCJDEBUG = @LIBGCJDEBUG@ *************** toolexecmainlibdir = @toolexecmainlibdir *** 134,143 **** AUTOMAKE_OPTIONS = foreign @TESTSUBDIR_TRUE@SUBDIRS = @TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include @TESTSUBDIR_FALSE@SUBDIRS = @TESTSUBDIR_FALSE@$(DIRLTDL) gcj include ! @XLIB_AWT_TRUE@cond_x_ltlibrary = @XLIB_AWT_TRUE@libgcjx.la @XLIB_AWT_FALSE@cond_x_ltlibrary = ! toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary) toolexecmainlib_DATA = libgcj.spec jardir = $(datadir)/java --- 136,147 ---- AUTOMAKE_OPTIONS = foreign @TESTSUBDIR_TRUE@SUBDIRS = @TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include @TESTSUBDIR_FALSE@SUBDIRS = @TESTSUBDIR_FALSE@$(DIRLTDL) gcj include ! @XLIB_AWT_TRUE@cond_x_ltlibrary = @XLIB_AWT_TRUE@lib-gnu-awt-xlib.la @XLIB_AWT_FALSE@cond_x_ltlibrary = + @XLIB_AWT_TRUE@xlib_includes = @XLIB_AWT_TRUE@-I../libstdc++-v3/include -I../libstdc++-v3/include/$(target_alias) -I$(srcdir)/../libstdc++-v3/libsupc++ + @XLIB_AWT_FALSE@xlib_includes = ! toolexeclib_LTLIBRARIES = libgcj.la lib-org-xml-sax.la lib-org-w3c-dom.la $(cond_x_ltlibrary) toolexecmainlib_DATA = libgcj.spec jardir = $(datadir)/java *************** secdir = $(libdir)/security *** 148,158 **** @NATIVE_TRUE@bin_PROGRAMS = @NATIVE_TRUE@jv-convert gij rmic rmiregistry bin_SCRIPTS = addr2name.awk ! @CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT) @CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_FALSE@jar ! @CANADIAN_FALSE@ZIP = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT) @CANADIAN_TRUE@GCJH = @CANADIAN_TRUE@gcjh ! @CANADIAN_FALSE@GCJH = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT) GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 --- 152,162 ---- @NATIVE_TRUE@bin_PROGRAMS = @NATIVE_TRUE@jv-convert gij rmic rmiregistry bin_SCRIPTS = addr2name.awk ! @CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar @CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = @CANADIAN_TRUE@@NULL_TARGET_FALSE@jar ! @CANADIAN_FALSE@ZIP = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar @CANADIAN_TRUE@GCJH = @CANADIAN_TRUE@gcjh ! @CANADIAN_FALSE@GCJH = @CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 *************** GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE *** 169,174 **** --- 173,179 ---- WARNINGS = -W -Wall AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \ -fdollars-in-identifiers \ + -Wswitch-enum \ @LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \ -DPREFIX="\"$(prefix)\"" *************** JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS *** 181,187 **** LIBFFIINCS = @LIBFFIINCS@ INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \ ! $(GCINCS) $(THREADINCS) $(INCLTDL) \ $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS) --- 186,192 ---- LIBFFIINCS = @LIBFFIINCS@ INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \ ! $(GCINCS) $(THREADINCS) $(INCLTDL) $(xlib_includes) \ $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS) *************** javao_files = $(java_source_files:.java= *** 194,200 **** x_javao_files = $(x_java_source_files:.java=.lo) libgcj_la_SOURCES = prims.cc jni.cc exception.cc \ ! resolve.cc defineclass.cc interpret.cc name-finder.cc verify.cc \ $(nat_source_files) EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \ --- 199,205 ---- x_javao_files = $(x_java_source_files:.java=.lo) libgcj_la_SOURCES = prims.cc jni.cc exception.cc \ ! resolve.cc defineclass.cc interpret.cc verify.cc \ $(nat_source_files) EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \ *************** libgcj_la_LDFLAGS = -rpath $(toolexeclib *** 217,235 **** libgcj_la_LINK = $(LIBLINK) ! libgcjx_la_SOURCES = $(x_nat_source_files) ! EXTRA_libgcjx_la_SOURCES = $(x_java_source_files) ! libgcjx_la_DEPENDENCIES = libgcj-@gcc_version@.jar $(x_javao_files) ! libgcjx_la_LIBADD = $(x_javao_files) ! libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \ -rpath $(toolexeclibdir) \ -version-info `grep -v '^\#' $(srcdir)/libtool-version` ! libgcjx_la_LINK = $(LIBLINK) all_java_source_files = \ $(java_source_files) \ $(built_java_source_files) \ $(x_java_source_files) --- 222,302 ---- libgcj_la_LINK = $(LIBLINK) ! lib_org_w3c_dom_la_SOURCES = org/w3c/dom/Attr.java \ ! org/w3c/dom/CDATASection.java \ ! org/w3c/dom/CharacterData.java \ ! org/w3c/dom/Comment.java \ ! org/w3c/dom/DOMException.java \ ! org/w3c/dom/DOMImplementation.java \ ! org/w3c/dom/Document.java \ ! org/w3c/dom/DocumentFragment.java \ ! org/w3c/dom/DocumentType.java \ ! org/w3c/dom/Element.java \ ! org/w3c/dom/Entity.java \ ! org/w3c/dom/EntityReference.java \ ! org/w3c/dom/NamedNodeMap.java \ ! org/w3c/dom/Node.java \ ! org/w3c/dom/NodeList.java \ ! org/w3c/dom/Notation.java \ ! org/w3c/dom/ProcessingInstruction.java \ ! org/w3c/dom/Text.java \ ! org/w3c/dom/ranges/DocumentRange.java \ ! org/w3c/dom/ranges/Range.java \ ! org/w3c/dom/ranges/RangeException.java \ ! org/w3c/dom/traversal/DocumentTraversal.java \ ! org/w3c/dom/traversal/NodeFilter.java \ ! org/w3c/dom/traversal/NodeIterator.java \ ! org/w3c/dom/traversal/TreeWalker.java ! ! ! lib_org_xml_sax_la_SOURCES = org/xml/sax/ext/DeclHandler.java \ ! org/xml/sax/ext/LexicalHandler.java \ ! org/xml/sax/helpers/AttributeListImpl.java \ ! org/xml/sax/helpers/AttributesImpl.java \ ! org/xml/sax/helpers/DefaultHandler.java \ ! org/xml/sax/helpers/LocatorImpl.java \ ! org/xml/sax/helpers/NamespaceSupport.java \ ! org/xml/sax/helpers/NewInstance.java \ ! org/xml/sax/helpers/ParserAdapter.java \ ! org/xml/sax/helpers/ParserFactory.java \ ! org/xml/sax/helpers/XMLFilterImpl.java \ ! org/xml/sax/helpers/XMLReaderAdapter.java \ ! org/xml/sax/helpers/XMLReaderFactory.java \ ! org/xml/sax/AttributeList.java \ ! org/xml/sax/Attributes.java \ ! org/xml/sax/ContentHandler.java \ ! org/xml/sax/DTDHandler.java \ ! org/xml/sax/DocumentHandler.java \ ! org/xml/sax/EntityResolver.java \ ! org/xml/sax/ErrorHandler.java \ ! org/xml/sax/HandlerBase.java \ ! org/xml/sax/InputSource.java \ ! org/xml/sax/Locator.java \ ! org/xml/sax/Parser.java \ ! org/xml/sax/SAXException.java \ ! org/xml/sax/SAXNotRecognizedException.java \ ! org/xml/sax/SAXNotSupportedException.java \ ! org/xml/sax/SAXParseException.java \ ! org/xml/sax/XMLFilter.java \ ! org/xml/sax/XMLReader.java ! ! ! lib_gnu_awt_xlib_la_SOURCES = $(x_nat_source_files) ! EXTRA_lib_gnu_awt_xlib_la_SOURCES = $(x_java_source_files) ! lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-@gcc_version@.jar $(x_javao_files) ! lib_gnu_awt_xlib_la_LIBADD = $(x_javao_files) ! lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \ ! @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \ -rpath $(toolexeclibdir) \ -version-info `grep -v '^\#' $(srcdir)/libtool-version` ! lib_gnu_awt_xlib_la_LINK = $(LIBLINK) all_java_source_files = \ $(java_source_files) \ $(built_java_source_files) \ + $(lib_org_xml_sax_la_SOURCES) \ + $(lib_org_w3c_dom_la_SOURCES) \ $(x_java_source_files) *************** ordinary_nat_headers = $(ordinary_java_s *** 245,251 **** inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \ ! java/io/ObjectInputStream$$GetField.h nat_headers = $(ordinary_nat_headers) $(inner_nat_headers) --- 312,320 ---- inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \ ! java/io/ObjectInputStream$$GetField.h \ ! java/lang/reflect/Proxy$$ProxyData.h \ ! java/lang/reflect/Proxy$$ProxyType.h nat_headers = $(ordinary_nat_headers) $(inner_nat_headers) *************** gnu/java/awt/BitMaskExtent.java \ *** 341,346 **** --- 410,418 ---- gnu/java/awt/Buffers.java \ gnu/java/awt/ComponentDataBlitOp.java \ gnu/java/awt/GLightweightPeer.java \ + gnu/java/awt/EventModifier.java \ + gnu/java/awt/image/ImageDecoder.java \ + gnu/java/awt/image/XBMDecoder.java \ gnu/java/beans/editors/ColorEditor.java \ gnu/java/beans/editors/FontEditor.java \ gnu/java/beans/editors/NativeBooleanEditor.java \ *************** java/awt/CheckboxGroup.java \ *** 376,387 **** java/awt/CheckboxMenuItem.java \ java/awt/Choice.java \ java/awt/Color.java \ ! java/awt/Component.java \ java/awt/ComponentOrientation.java \ ! java/awt/Container.java \ java/awt/Cursor.java \ java/awt/Dialog.java \ ! java/awt/Dimension.java \ java/awt/Event.java \ java/awt/EventDispatchThread.java \ java/awt/EventQueue.java \ --- 448,459 ---- java/awt/CheckboxMenuItem.java \ java/awt/Choice.java \ java/awt/Color.java \ ! java/awt/Component.java \ java/awt/ComponentOrientation.java \ ! java/awt/Container.java \ java/awt/Cursor.java \ java/awt/Dialog.java \ ! java/awt/Dimension.java \ java/awt/Event.java \ java/awt/EventDispatchThread.java \ java/awt/EventQueue.java \ *************** java/awt/Graphics.java \ *** 394,399 **** --- 466,472 ---- java/awt/Graphics2D.java \ java/awt/GraphicsConfiguration.java \ java/awt/GridBagConstraints.java \ + java/awt/GridBagLayout.java \ java/awt/GridLayout.java \ java/awt/IllegalComponentStateException.java \ java/awt/Image.java \ *************** java/awt/Label.java \ *** 403,409 **** java/awt/LayoutManager.java \ java/awt/LayoutManager2.java \ java/awt/List.java \ - java/awt/MediaTracker.java \ java/awt/Menu.java \ java/awt/MenuBar.java \ java/awt/MenuComponent.java \ --- 476,481 ---- *************** java/awt/Paint.java \ *** 414,438 **** java/awt/PaintContext.java \ java/awt/Panel.java \ java/awt/Point.java \ ! java/awt/Polygon.java \ ! java/awt/PopupMenu.java \ ! java/awt/PrintGraphics.java \ ! java/awt/PrintJob.java \ ! java/awt/Rectangle.java \ java/awt/RenderingHints.java \ java/awt/ScrollPane.java \ ! java/awt/Scrollbar.java \ java/awt/Shape.java \ - java/awt/SystemColor.java \ java/awt/TextArea.java \ java/awt/TextComponent.java \ ! java/awt/TextField.java \ java/awt/Toolkit.java \ java/awt/Transparency.java \ java/awt/Window.java \ java/awt/color/ColorSpace.java \ java/awt/color/ICC_ColorSpace.java \ ! java/awt/color/ICC_Profile.java \ java/awt/datatransfer/Clipboard.java \ java/awt/datatransfer/ClipboardOwner.java \ java/awt/datatransfer/DataFlavor.java \ --- 486,510 ---- java/awt/PaintContext.java \ java/awt/Panel.java \ java/awt/Point.java \ ! java/awt/PopupMenu.java \ ! java/awt/Rectangle.java \ java/awt/RenderingHints.java \ java/awt/ScrollPane.java \ ! java/awt/Scrollbar.java \ java/awt/Shape.java \ java/awt/TextArea.java \ java/awt/TextComponent.java \ ! java/awt/TextField.java \ java/awt/Toolkit.java \ java/awt/Transparency.java \ java/awt/Window.java \ java/awt/color/ColorSpace.java \ java/awt/color/ICC_ColorSpace.java \ ! java/awt/color/ICC_Profile.java \ ! java/awt/color/ICC_ProfileGray.java \ ! java/awt/color/ICC_ProfileRGB.java \ ! java/awt/color/CMMException.java \ ! java/awt/color/ProfileDataException.java \ java/awt/datatransfer/Clipboard.java \ java/awt/datatransfer/ClipboardOwner.java \ java/awt/datatransfer/DataFlavor.java \ *************** java/awt/datatransfer/FlavorMap.java \ *** 440,449 **** java/awt/datatransfer/MimeTypeParseException.java \ java/awt/datatransfer/StringSelection.java \ java/awt/datatransfer/SystemFlavorMap.java \ ! java/awt/datatransfer/Transferable.java \ java/awt/datatransfer/UnsupportedFlavorException.java \ java/awt/event/AWTEventListener.java \ ! java/awt/event/ActionEvent.java \ java/awt/event/ActionListener.java \ java/awt/event/AdjustmentEvent.java \ java/awt/event/AdjustmentListener.java \ --- 512,522 ---- java/awt/datatransfer/MimeTypeParseException.java \ java/awt/datatransfer/StringSelection.java \ java/awt/datatransfer/SystemFlavorMap.java \ ! java/awt/datatransfer/Transferable.java \ java/awt/datatransfer/UnsupportedFlavorException.java \ + java/awt/datatransfer/FlavorTable.java \ java/awt/event/AWTEventListener.java \ ! java/awt/event/ActionEvent.java \ java/awt/event/ActionListener.java \ java/awt/event/AdjustmentEvent.java \ java/awt/event/AdjustmentListener.java \ *************** java/awt/event/HierarchyEvent.java \ *** 462,527 **** java/awt/event/HierarchyListener.java \ java/awt/event/InputEvent.java \ java/awt/event/InputMethodEvent.java \ ! java/awt/event/InputMethodListener.java \ java/awt/event/InvocationEvent.java \ java/awt/event/ItemEvent.java \ java/awt/event/ItemListener.java \ java/awt/event/KeyAdapter.java \ java/awt/event/KeyEvent.java \ ! java/awt/event/KeyListener.java \ java/awt/event/MouseAdapter.java \ java/awt/event/MouseEvent.java \ java/awt/event/MouseListener.java \ java/awt/event/MouseMotionAdapter.java \ ! java/awt/event/MouseMotionListener.java \ java/awt/event/PaintEvent.java \ java/awt/event/TextEvent.java \ java/awt/event/TextListener.java \ java/awt/event/WindowAdapter.java \ ! java/awt/event/WindowEvent.java \ java/awt/event/WindowListener.java \ java/awt/geom/AffineTransform.java \ java/awt/geom/Dimension2D.java \ java/awt/geom/Ellipse2D.java \ java/awt/geom/IllegalPathStateException.java \ - java/awt/geom/Line2D.java \ java/awt/geom/NoninvertibleTransformException.java \ ! java/awt/geom/PathIterator.java \ java/awt/geom/Point2D.java \ java/awt/geom/Rectangle2D.java \ java/awt/geom/RectangularShape.java \ java/awt/geom/RoundRectangle2D.java \ ! java/awt/image/AreaAveragingScaleFilter.java \ java/awt/image/BufferedImage.java \ java/awt/image/ColorModel.java \ ! java/awt/image/ComponentColorModel.java \ java/awt/image/ComponentSampleModel.java \ - java/awt/image/CropImageFilter.java \ java/awt/image/DataBuffer.java \ java/awt/image/DataBufferByte.java \ java/awt/image/DataBufferInt.java \ java/awt/image/DataBufferUShort.java \ java/awt/image/DirectColorModel.java \ - java/awt/image/FilteredImageSource.java \ java/awt/image/ImageConsumer.java \ - java/awt/image/ImageFilter.java \ java/awt/image/ImageObserver.java \ java/awt/image/ImageProducer.java \ java/awt/image/IndexColorModel.java \ - java/awt/image/MemoryImageSource.java \ java/awt/image/PackedColorModel.java \ - java/awt/image/PixelGrabber.java \ - java/awt/image/RGBImageFilter.java \ java/awt/image/Raster.java \ java/awt/image/RasterOp.java \ ! java/awt/image/ReplicateScaleFilter.java \ ! java/awt/image/SampleModel.java \ java/awt/image/SinglePixelPackedSampleModel.java \ java/awt/image/WritableRaster.java \ java/awt/peer/ButtonPeer.java \ java/awt/peer/CanvasPeer.java \ ! java/awt/peer/CheckboxMenuItemPeer.java \ ! java/awt/peer/CheckboxPeer.java \ java/awt/peer/ChoicePeer.java \ java/awt/peer/ComponentPeer.java \ java/awt/peer/ContainerPeer.java \ --- 535,626 ---- java/awt/event/HierarchyListener.java \ java/awt/event/InputEvent.java \ java/awt/event/InputMethodEvent.java \ ! java/awt/event/InputMethodListener.java \ java/awt/event/InvocationEvent.java \ java/awt/event/ItemEvent.java \ java/awt/event/ItemListener.java \ java/awt/event/KeyAdapter.java \ java/awt/event/KeyEvent.java \ ! java/awt/event/KeyListener.java \ java/awt/event/MouseAdapter.java \ java/awt/event/MouseEvent.java \ java/awt/event/MouseListener.java \ java/awt/event/MouseMotionAdapter.java \ ! java/awt/event/MouseMotionListener.java \ java/awt/event/PaintEvent.java \ java/awt/event/TextEvent.java \ java/awt/event/TextListener.java \ java/awt/event/WindowAdapter.java \ ! java/awt/event/WindowEvent.java \ java/awt/event/WindowListener.java \ + java/awt/event/AWTEventListenerProxy.java \ + java/awt/event/MouseWheelEvent.java \ + java/awt/event/MouseWheelListener.java \ + java/awt/event/WindowFocusListener.java \ + java/awt/event/WindowStateListener.java \ java/awt/geom/AffineTransform.java \ java/awt/geom/Dimension2D.java \ java/awt/geom/Ellipse2D.java \ java/awt/geom/IllegalPathStateException.java \ java/awt/geom/NoninvertibleTransformException.java \ ! java/awt/geom/PathIterator.java \ java/awt/geom/Point2D.java \ java/awt/geom/Rectangle2D.java \ java/awt/geom/RectangularShape.java \ java/awt/geom/RoundRectangle2D.java \ ! java/awt/geom/Line2D.java \ ! java/awt/geom/Arc2D.java \ ! java/awt/geom/Area.java \ ! java/awt/geom/CubicCurve2D.java \ ! java/awt/geom/FlatteningPathIterator.java \ ! java/awt/geom/GeneralPath.java \ ! java/awt/geom/QuadCurve2D.java \ java/awt/image/BufferedImage.java \ java/awt/image/ColorModel.java \ ! java/awt/image/ComponentColorModel.java \ java/awt/image/ComponentSampleModel.java \ java/awt/image/DataBuffer.java \ java/awt/image/DataBufferByte.java \ java/awt/image/DataBufferInt.java \ java/awt/image/DataBufferUShort.java \ java/awt/image/DirectColorModel.java \ java/awt/image/ImageConsumer.java \ java/awt/image/ImageObserver.java \ java/awt/image/ImageProducer.java \ java/awt/image/IndexColorModel.java \ java/awt/image/PackedColorModel.java \ java/awt/image/Raster.java \ java/awt/image/RasterOp.java \ ! java/awt/image/SampleModel.java \ java/awt/image/SinglePixelPackedSampleModel.java \ java/awt/image/WritableRaster.java \ + java/awt/image/AreaAveragingScaleFilter.java \ + java/awt/image/CropImageFilter.java \ + java/awt/image/FilteredImageSource.java \ + java/awt/image/ImageFilter.java \ + java/awt/image/MemoryImageSource.java \ + java/awt/image/PixelGrabber.java \ + java/awt/image/RGBImageFilter.java \ + java/awt/image/ReplicateScaleFilter.java \ + java/awt/image/BufferStrategy.java \ + java/awt/image/BufferedImageOp.java \ + java/awt/image/ImagingOpException.java \ + java/awt/image/RasterFormatException.java \ + java/awt/image/RenderedImage.java \ + java/awt/image/TileObserver.java \ + java/awt/image/VolatileImage.java \ + java/awt/image/WritableRenderedImage.java \ + java/awt/image/renderable/ContextualRenderedImageFactory.java \ + java/awt/image/renderable/ParameterBlock.java \ + java/awt/image/renderable/RenderContext.java \ + java/awt/image/renderable/RenderableImage.java \ + java/awt/image/renderable/RenderableImageOp.java \ + java/awt/image/renderable/RenderableImageProducer.java \ + java/awt/image/renderable/RenderedImageFactory.java \ java/awt/peer/ButtonPeer.java \ java/awt/peer/CanvasPeer.java \ ! java/awt/peer/CheckboxMenuItemPeer.java \ ! java/awt/peer/CheckboxPeer.java \ java/awt/peer/ChoicePeer.java \ java/awt/peer/ComponentPeer.java \ java/awt/peer/ContainerPeer.java \ *************** java/awt/peer/LightweightPeer.java \ *** 534,550 **** java/awt/peer/ListPeer.java \ java/awt/peer/MenuBarPeer.java \ java/awt/peer/MenuComponentPeer.java \ ! java/awt/peer/MenuItemPeer.java \ java/awt/peer/MenuPeer.java \ java/awt/peer/PanelPeer.java \ java/awt/peer/PopupMenuPeer.java \ java/awt/peer/ScrollPanePeer.java \ java/awt/peer/ScrollbarPeer.java \ ! java/awt/peer/TextAreaPeer.java \ java/awt/peer/TextComponentPeer.java \ java/awt/peer/TextFieldPeer.java \ java/awt/peer/WindowPeer.java \ ! java/beans/beancontext/BeanContext.java \ java/beans/beancontext/BeanContextChild.java \ java/beans/beancontext/BeanContextChildComponentProxy.java \ java/beans/beancontext/BeanContextChildSupport.java \ --- 633,725 ---- java/awt/peer/ListPeer.java \ java/awt/peer/MenuBarPeer.java \ java/awt/peer/MenuComponentPeer.java \ ! java/awt/peer/MenuItemPeer.java \ java/awt/peer/MenuPeer.java \ java/awt/peer/PanelPeer.java \ java/awt/peer/PopupMenuPeer.java \ java/awt/peer/ScrollPanePeer.java \ java/awt/peer/ScrollbarPeer.java \ ! java/awt/peer/TextAreaPeer.java \ java/awt/peer/TextComponentPeer.java \ java/awt/peer/TextFieldPeer.java \ java/awt/peer/WindowPeer.java \ ! java/awt/SystemColor.java \ ! java/awt/Polygon.java \ ! java/awt/MediaTracker.java \ ! java/awt/PrintGraphics.java \ ! java/awt/PrintJob.java \ ! java/awt/AWTKeyStroke.java \ ! java/awt/AlphaComposite.java \ ! java/awt/AttributeValue.java \ ! java/awt/BasicStroke.java \ ! java/awt/BufferCapabilities.java \ ! java/awt/ColorPaintContext.java \ ! java/awt/Composite.java \ ! java/awt/CompositeContext.java \ ! java/awt/ContainerOrderFocusTraversalPolicy.java \ ! java/awt/DefaultFocusTraversalPolicy.java \ ! java/awt/DefaultKeyboardFocusManager.java \ ! java/awt/DisplayMode.java \ ! java/awt/FocusTraversalPolicy.java \ ! java/awt/FontFormatException.java \ ! java/awt/GradientPaint.java \ ! java/awt/GraphicsConfigTemplate.java \ ! java/awt/GraphicsDevice.java \ ! java/awt/GraphicsEnvironment.java \ ! java/awt/HeadlessException.java \ ! java/awt/ImageCapabilities.java \ ! java/awt/JobAttributes.java \ ! java/awt/KeyEventDispatcher.java \ ! java/awt/KeyEventPostProcessor.java \ ! java/awt/KeyboardFocusManager.java \ ! java/awt/PageAttributes.java \ ! java/awt/Robot.java \ ! java/awt/ScrollPaneAdjustable.java \ ! java/awt/Stroke.java \ ! java/awt/TexturePaint.java \ ! java/awt/dnd/peer/DragSourceContextPeer.java \ ! java/awt/dnd/peer/DropTargetContextPeer.java \ ! java/awt/dnd/DnDConstants.java \ ! java/awt/dnd/DragGestureEvent.java \ ! java/awt/dnd/DragGestureListener.java \ ! java/awt/dnd/DragGestureRecognizer.java \ ! java/awt/dnd/DragSource.java \ ! java/awt/dnd/DragSourceAdapter.java \ ! java/awt/dnd/DragSourceContext.java \ ! java/awt/dnd/DragSourceDragEvent.java \ ! java/awt/dnd/DragSourceEvent.java \ ! java/awt/dnd/DragSourceListener.java \ ! java/awt/dnd/DragSourceMotionListener.java \ ! java/awt/dnd/DropTarget.java \ ! java/awt/dnd/InvalidDnDOperationException.java \ ! java/awt/dnd/Autoscroll.java \ ! java/awt/dnd/DragSourceDropEvent.java \ ! java/awt/dnd/DropTargetAdapter.java \ ! java/awt/dnd/DropTargetContext.java \ ! java/awt/dnd/DropTargetDragEvent.java \ ! java/awt/dnd/DropTargetDropEvent.java \ ! java/awt/dnd/DropTargetEvent.java \ ! java/awt/dnd/DropTargetListener.java \ ! java/awt/dnd/MouseDragGestureRecognizer.java \ ! java/awt/font/TextHitInfo.java \ ! java/awt/im/spi/InputMethod.java \ ! java/awt/im/spi/InputMethodContext.java \ ! java/awt/im/spi/InputMethodDescriptor.java \ ! java/awt/im/InputContext.java \ ! java/awt/im/InputMethodHighlight.java \ ! java/awt/im/InputMethodRequests.java \ ! java/awt/im/InputSubset.java \ ! java/awt/print/Book.java \ ! java/awt/print/PageFormat.java \ ! java/awt/print/Pageable.java \ ! java/awt/print/Paper.java \ ! java/awt/print/Printable.java \ ! java/awt/print/PrinterAbortException.java \ ! java/awt/print/PrinterException.java \ ! java/awt/print/PrinterGraphics.java \ ! java/awt/print/PrinterIOException.java \ ! java/awt/print/PrinterJob.java \ ! java/beans/beancontext/BeanContext.java \ java/beans/beancontext/BeanContextChild.java \ java/beans/beancontext/BeanContextChildComponentProxy.java \ java/beans/beancontext/BeanContextChildSupport.java \ *************** java/beans/beancontext/BeanContextServic *** 558,572 **** java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \ java/beans/beancontext/BeanContextServiceRevokedEvent.java \ java/beans/beancontext/BeanContextServiceRevokedListener.java \ ! java/beans/beancontext/BeanContextServices.java \ ! java/beans/beancontext/BeanContextServicesListener.java \ ! java/beans/AppletInitializer.java \ java/beans/BeanDescriptor.java \ java/beans/BeanInfo.java \ java/beans/Beans.java \ java/beans/Customizer.java \ java/beans/DesignMode.java \ java/beans/EventSetDescriptor.java \ java/beans/FeatureDescriptor.java \ java/beans/IndexedPropertyDescriptor.java \ java/beans/IntrospectionException.java \ --- 733,747 ---- java/beans/beancontext/BeanContextServiceProviderBeanInfo.java \ java/beans/beancontext/BeanContextServiceRevokedEvent.java \ java/beans/beancontext/BeanContextServiceRevokedListener.java \ ! java/beans/beancontext/BeanContextServices.java \ ! java/beans/beancontext/BeanContextServicesListener.java \ java/beans/BeanDescriptor.java \ java/beans/BeanInfo.java \ java/beans/Beans.java \ java/beans/Customizer.java \ java/beans/DesignMode.java \ java/beans/EventSetDescriptor.java \ + java/beans/ExceptionListener.java \ java/beans/FeatureDescriptor.java \ java/beans/IndexedPropertyDescriptor.java \ java/beans/IntrospectionException.java \ *************** java/beans/MethodDescriptor.java \ *** 575,580 **** --- 750,756 ---- java/beans/ParameterDescriptor.java \ java/beans/PropertyChangeEvent.java \ java/beans/PropertyChangeListener.java \ + java/beans/PropertyChangeListenerProxy.java \ java/beans/PropertyChangeSupport.java \ java/beans/PropertyDescriptor.java \ java/beans/PropertyEditor.java \ *************** java/beans/PropertyEditorSupport.java \ *** 583,590 **** java/beans/PropertyVetoException.java \ java/beans/SimpleBeanInfo.java \ java/beans/VetoableChangeListener.java \ java/beans/VetoableChangeSupport.java \ ! java/beans/Visibility.java rmi_java_source_files = \ --- 759,1057 ---- java/beans/PropertyVetoException.java \ java/beans/SimpleBeanInfo.java \ java/beans/VetoableChangeListener.java \ + java/beans/VetoableChangeListenerProxy.java \ java/beans/VetoableChangeSupport.java \ ! java/beans/Visibility.java \ ! java/beans/AppletInitializer.java \ ! javax/swing/border/AbstractBorder.java \ ! javax/swing/border/Border.java \ ! javax/swing/border/CompoundBorder.java \ ! javax/swing/border/EmptyBorder.java \ ! javax/swing/border/MatteBorder.java \ ! javax/swing/border/TitledBorder.java \ ! javax/swing/border/BevelBorder.java \ ! javax/swing/border/EtchedBorder.java \ ! javax/swing/border/LineBorder.java \ ! javax/swing/GrayFilter.java \ ! javax/swing/AbstractAction.java \ ! javax/swing/AbstractButton.java \ ! javax/swing/plaf/basic/BasicButtonUI.java \ ! javax/swing/plaf/basic/BasicCheckBoxUI.java \ ! javax/swing/plaf/basic/BasicDefaults.java \ ! javax/swing/plaf/basic/BasicGraphicsUtils.java \ ! javax/swing/plaf/basic/BasicLabelUI.java \ ! javax/swing/plaf/basic/BasicListUI.java \ ! javax/swing/plaf/basic/BasicOptionPaneUI.java \ ! javax/swing/plaf/basic/BasicPanelUI.java \ ! javax/swing/plaf/basic/BasicRadioButtonUI.java \ ! javax/swing/plaf/basic/BasicScrollPaneUI.java \ ! javax/swing/plaf/basic/BasicTabbedPaneUI.java \ ! javax/swing/plaf/basic/BasicTextUI.java \ ! javax/swing/plaf/basic/BasicToggleButtonUI.java \ ! javax/swing/plaf/basic/BasicTreeUI.java \ ! javax/swing/plaf/basic/BasicViewportUI.java \ ! javax/swing/plaf/basic/BasicLookAndFeel.java \ ! javax/swing/plaf/basic/BasicBorders.java \ ! javax/swing/plaf/basic/BasicIconFactory.java \ ! javax/swing/plaf/BorderUIResource.java \ ! javax/swing/plaf/UIResource.java \ ! javax/swing/plaf/ButtonUI.java \ ! javax/swing/plaf/ComponentUI.java \ ! javax/swing/plaf/LabelUI.java \ ! javax/swing/plaf/ListUI.java \ ! javax/swing/plaf/OptionPaneUI.java \ ! javax/swing/plaf/PanelUI.java \ ! javax/swing/plaf/ScrollPaneUI.java \ ! javax/swing/plaf/TabbedPaneUI.java \ ! javax/swing/plaf/TextUI.java \ ! javax/swing/plaf/TreeUI.java \ ! javax/swing/plaf/ViewportUI.java \ ! javax/swing/plaf/metal/MetalLookAndFeel.java \ ! javax/swing/plaf/ColorUIResource.java \ ! javax/swing/plaf/DimensionUIResource.java \ ! javax/swing/plaf/FontUIResource.java \ ! javax/swing/plaf/IconUIResource.java \ ! javax/swing/plaf/InsetsUIResource.java \ ! javax/swing/plaf/ActionMapUIResource.java \ ! javax/swing/plaf/ColorChooserUI.java \ ! javax/swing/plaf/ComboBoxUI.java \ ! javax/swing/plaf/ComponentInputMapUIResource.java \ ! javax/swing/plaf/DesktopIconUI.java \ ! javax/swing/plaf/DesktopPaneUI.java \ ! javax/swing/plaf/FileChooserUI.java \ ! javax/swing/plaf/InputMapUIResource.java \ ! javax/swing/plaf/InternalFrameUI.java \ ! javax/swing/plaf/MenuBarUI.java \ ! javax/swing/plaf/MenuItemUI.java \ ! javax/swing/plaf/PopupMenuUI.java \ ! javax/swing/plaf/ProgressBarUI.java \ ! javax/swing/plaf/RootPaneUI.java \ ! javax/swing/plaf/ScrollBarUI.java \ ! javax/swing/plaf/SeparatorUI.java \ ! javax/swing/plaf/SliderUI.java \ ! javax/swing/plaf/SplitPaneUI.java \ ! javax/swing/plaf/TableHeaderUI.java \ ! javax/swing/plaf/TableUI.java \ ! javax/swing/plaf/ToolBarUI.java \ ! javax/swing/plaf/ToolTipUI.java \ ! javax/swing/AbstractListModel.java \ ! javax/swing/AbstractSet.java \ ! javax/swing/colorchooser/AbstractColorChooserPanel.java \ ! javax/swing/colorchooser/ColorChooserComponentFactory.java \ ! javax/swing/colorchooser/ColorSelectionModel.java \ ! javax/swing/colorchooser/DefaultColorSelectionModel.java \ ! javax/swing/filechooser/FileFilter.java \ ! javax/swing/filechooser/FileSystemView.java \ ! javax/swing/filechooser/FileView.java \ ! javax/swing/table/AbstractTableModel.java \ ! javax/swing/table/DefaultTableColumnModel.java \ ! javax/swing/table/DefaultTableModel.java \ ! javax/swing/table/TableCellEditor.java \ ! javax/swing/table/TableCellRenderer.java \ ! javax/swing/table/TableColumn.java \ ! javax/swing/table/TableColumnModel.java \ ! javax/swing/table/TableModel.java \ ! javax/swing/table/DefaultTableCellRenderer.java \ ! javax/swing/Action.java \ ! javax/swing/BorderFactory.java \ ! javax/swing/Box.java \ ! javax/swing/BoxLayout.java \ ! javax/swing/ButtonGroup.java \ ! javax/swing/ButtonModel.java \ ! javax/swing/ComponentInputMap.java \ ! javax/swing/DefaultButtonModel.java \ ! javax/swing/DefaultCellRenderer.java \ ! javax/swing/DefaultListModel.java \ ! javax/swing/DefaultListSelectionModel.java \ ! javax/swing/Icon.java \ ! javax/swing/ImageIcon.java \ ! javax/swing/InputMap.java \ ! javax/swing/JApplet.java \ ! javax/swing/JButton.java \ ! javax/swing/JCheckBox.java \ ! javax/swing/JComponent.java \ ! javax/swing/JDialog.java \ ! javax/swing/JEditorPane.java \ ! javax/swing/JFrame.java \ ! javax/swing/JLabel.java \ ! javax/swing/JLayeredPane.java \ ! javax/swing/JList.java \ ! javax/swing/JMenuBar.java \ ! javax/swing/JOptionPane.java \ ! javax/swing/JPanel.java \ ! javax/swing/JRadioButton.java \ ! javax/swing/JRootPane.java \ ! javax/swing/JScrollBar.java \ ! javax/swing/JScrollPane.java \ ! javax/swing/JTabbedPane.java \ ! javax/swing/JTextField.java \ ! javax/swing/JToggleButton.java \ ! javax/swing/JToolTip.java \ ! javax/swing/JTree.java \ ! javax/swing/JViewport.java \ ! javax/swing/JWindow.java \ ! javax/swing/KeyStroke.java \ ! javax/swing/ListCellRenderer.java \ ! javax/swing/ListModel.java \ ! javax/swing/ListSelectionModel.java \ ! javax/swing/LookAndFeel.java \ ! javax/swing/Scrollable.java \ ! javax/swing/SwingConstants.java \ ! javax/swing/SwingUtilities.java \ ! javax/swing/Timer.java \ ! javax/swing/ToggleButtonModel.java \ ! javax/swing/UIDefaults.java \ ! javax/swing/UIManager.java \ ! javax/swing/UnsupportedLookAndFeelException.java \ ! javax/swing/event/AncestorEvent.java \ ! javax/swing/event/AncestorListener.java \ ! javax/swing/event/ChangeEvent.java \ ! javax/swing/event/ChangeListener.java \ ! javax/swing/event/DocumentEvent.java \ ! javax/swing/event/DocumentListener.java \ ! javax/swing/event/HyperlinkEvent.java \ ! javax/swing/event/HyperlinkListener.java \ ! javax/swing/event/ListDataEvent.java \ ! javax/swing/event/ListDataListener.java \ ! javax/swing/event/ListSelectionEvent.java \ ! javax/swing/event/ListSelectionListener.java \ ! javax/swing/event/MenuEvent.java \ ! javax/swing/event/UndoableEditEvent.java \ ! javax/swing/event/UndoableEditListener.java \ ! javax/swing/event/CaretEvent.java \ ! javax/swing/event/CaretListener.java \ ! javax/swing/event/CellEditorListener.java \ ! javax/swing/event/EventListenerList.java \ ! javax/swing/event/InternalFrameAdapter.java \ ! javax/swing/event/InternalFrameEvent.java \ ! javax/swing/event/InternalFrameListener.java \ ! javax/swing/event/MenuDragMouseEvent.java \ ! javax/swing/event/MenuDragMouseListener.java \ ! javax/swing/event/MenuKeyEvent.java \ ! javax/swing/event/MenuKeyListener.java \ ! javax/swing/event/MenuListener.java \ ! javax/swing/event/MouseInputAdapter.java \ ! javax/swing/event/MouseInputListener.java \ ! javax/swing/event/PopupMenuEvent.java \ ! javax/swing/event/PopupMenuListener.java \ ! javax/swing/event/SwingPropertyChangeSupport.java \ ! javax/swing/event/TableColumnModelEvent.java \ ! javax/swing/event/TableColumnModelListener.java \ ! javax/swing/event/TableModelEvent.java \ ! javax/swing/event/TableModelListener.java \ ! javax/swing/event/TreeExpansionEvent.java \ ! javax/swing/event/TreeExpansionListener.java \ ! javax/swing/event/TreeModelEvent.java \ ! javax/swing/event/TreeModelListener.java \ ! javax/swing/event/TreeSelectionEvent.java \ ! javax/swing/event/TreeSelectionListener.java \ ! javax/swing/event/TreeWillExpandListener.java \ ! javax/swing/ActionMap.java \ ! javax/swing/text/AbstractDocument.java \ ! javax/swing/text/AttributeSet.java \ ! javax/swing/text/BadLocationException.java \ ! javax/swing/text/Caret.java \ ! javax/swing/text/CharacterIterator.java \ ! javax/swing/text/ComponentView.java \ ! javax/swing/text/DefaultCaret.java \ ! javax/swing/text/DefaultEditorKit.java \ ! javax/swing/text/Document.java \ ! javax/swing/text/EditorKit.java \ ! javax/swing/text/Element.java \ ! javax/swing/text/GapContent.java \ ! javax/swing/text/JTextComponent.java \ ! javax/swing/text/Keymap.java \ ! javax/swing/text/PlainDocument.java \ ! javax/swing/text/PlainEditorKit.java \ ! javax/swing/text/Position.java \ ! javax/swing/text/Segment.java \ ! javax/swing/text/Style.java \ ! javax/swing/text/View.java \ ! javax/swing/text/ViewFactory.java \ ! javax/swing/text/MutableAttributeSet.java \ ! javax/swing/text/StyledDocument.java \ ! javax/swing/text/StyledEditorKit.java \ ! javax/swing/text/TextAction.java \ ! javax/swing/text/html/HTML.java \ ! javax/swing/text/html/parser/ParserDelegator.java \ ! javax/swing/tree/TreeNode.java \ ! javax/swing/tree/AbstractLayoutCache.java \ ! javax/swing/tree/DefaultMutableTreeNode.java \ ! javax/swing/tree/DefaultTreeCellEditor.java \ ! javax/swing/tree/DefaultTreeCellRenderer.java \ ! javax/swing/tree/DefaultTreeModel.java \ ! javax/swing/tree/DefaultTreeSelectionModel.java \ ! javax/swing/tree/ExpandVetoException.java \ ! javax/swing/tree/FixedHeightLayoutCache.java \ ! javax/swing/tree/MutableTreeNode.java \ ! javax/swing/tree/RowMapper.java \ ! javax/swing/tree/TreeCellEditor.java \ ! javax/swing/tree/TreeCellRenderer.java \ ! javax/swing/tree/TreeModel.java \ ! javax/swing/tree/TreePath.java \ ! javax/swing/tree/TreeSelectionModel.java \ ! javax/swing/tree/VariableHeightLayoutCache.java \ ! javax/swing/undo/UndoableEdit.java \ ! javax/swing/undo/AbstractUndoableEdit.java \ ! javax/swing/undo/CannotRedoException.java \ ! javax/swing/undo/CannotUndoException.java \ ! javax/swing/undo/CompoundEdit.java \ ! javax/swing/undo/StateEdit.java \ ! javax/swing/undo/StateEditable.java \ ! javax/swing/undo/UndoManager.java \ ! javax/swing/undo/UndoableEditSupport.java \ ! javax/swing/BoundedRangeModel.java \ ! javax/swing/CellEditor.java \ ! javax/swing/ComboBoxEditor.java \ ! javax/swing/ComboBoxModel.java \ ! javax/swing/DefaultBoundedRangeModel.java \ ! javax/swing/DesktopManager.java \ ! javax/swing/InputVerifier.java \ ! javax/swing/JInternalFrame.java \ ! javax/swing/JTable.java \ ! javax/swing/MenuElement.java \ ! javax/swing/MenuSelectionManager.java \ ! javax/swing/MutableComboBoxModel.java \ ! javax/swing/Renderer.java \ ! javax/swing/RootPaneContainer.java \ ! javax/swing/ScrollPaneConstants.java \ ! javax/swing/SingleSelectionModel.java \ ! javax/swing/SizeRequirements.java \ ! javax/swing/SizeSequence.java \ ! javax/swing/WindowConstants.java \ ! javax/swing/AbstractCellEditor.java \ ! javax/swing/CellRendererPane.java \ ! javax/swing/DebugGraphics.java \ ! javax/swing/DefaultCellEditor.java \ ! javax/swing/DefaultComboBoxModel.java \ ! javax/swing/DefaultDesktopManager.java \ ! javax/swing/DefaultFocusManager.java \ ! javax/swing/DefaultListCellRenderer.java \ ! javax/swing/DefaultSingleSelectionModel.java \ ! javax/swing/FocusManager.java \ ! javax/swing/JCheckBoxMenuItem.java \ ! javax/swing/JColorChooser.java \ ! javax/swing/JComboBox.java \ ! javax/swing/JDesktopPane.java \ ! javax/swing/JFileChooser.java \ ! javax/swing/JMenu.java \ ! javax/swing/JMenuItem.java \ ! javax/swing/JPasswordField.java \ ! javax/swing/JPopupMenu.java \ ! javax/swing/JProgressBar.java \ ! javax/swing/JRadioButtonMenuItem.java \ ! javax/swing/JSeparator.java \ ! javax/swing/JSlider.java \ ! javax/swing/JSplitPane.java \ ! javax/swing/JTextPane.java \ ! javax/swing/JToolBar.java \ ! javax/swing/OverlayLayout.java \ ! javax/swing/ProgressMonitor.java \ ! javax/swing/ProgressMonitorInputStream.java \ ! javax/swing/RepaintManager.java \ ! javax/swing/ScrollPaneLayout.java \ ! javax/swing/ToolTipManager.java \ ! javax/swing/ViewportLayout.java rmi_java_source_files = \ *************** java/rmi/server/LogStream.java \ *** 634,639 **** --- 1101,1107 ---- java/rmi/server/ObjID.java \ java/rmi/server/Operation.java \ java/rmi/server/RMIClassLoader.java \ + java/rmi/server/RMIClassLoaderSpi.java \ java/rmi/server/RMIClientSocketFactory.java \ java/rmi/server/RMIFailureHandler.java \ java/rmi/server/RMIServerSocketFactory.java \ *************** java/rmi/server/SocketSecurityException. *** 653,658 **** --- 1121,1128 ---- java/rmi/server/UID.java \ java/rmi/server/UnicastRemoteObject.java \ java/rmi/server/Unreferenced.java \ + gnu/java/rmi/RMIMarshalledObjectInputStream.java \ + gnu/java/rmi/RMIMarshalledObjectOutputStream.java \ gnu/java/rmi/dgc/DGCImpl.java \ gnu/java/rmi/dgc/DGCImpl_Skel.java \ gnu/java/rmi/dgc/DGCImpl_Stub.java \ *************** gnu/java/rmi/rmic/Compiler.java \ *** 664,669 **** --- 1134,1140 ---- gnu/java/rmi/rmic/CompilerProcess.java \ gnu/java/rmi/rmic/RMIC.java \ gnu/java/rmi/rmic/TabbedWriter.java \ + gnu/java/rmi/server/ConnectionRunnerPool.java \ gnu/java/rmi/server/ProtocolConstants.java \ gnu/java/rmi/server/RMIDefaultSocketFactory.java \ gnu/java/rmi/server/RMIHashes.java \ *************** gnu/java/rmi/server/UnicastServerRef.jav *** 679,684 **** --- 1150,1178 ---- javax_source_files = \ + javax/accessibility/Accessible.java \ + javax/accessibility/AccessibleAction.java \ + javax/accessibility/AccessibleBundle.java \ + javax/accessibility/AccessibleComponent.java \ + javax/accessibility/AccessibleContext.java \ + javax/accessibility/AccessibleEditableText.java \ + javax/accessibility/AccessibleExtendedComponent.java \ + javax/accessibility/AccessibleExtendedTable.java \ + javax/accessibility/AccessibleHyperlink.java \ + javax/accessibility/AccessibleHypertext.java \ + javax/accessibility/AccessibleIcon.java \ + javax/accessibility/AccessibleKeyBinding.java \ + javax/accessibility/AccessibleRelation.java \ + javax/accessibility/AccessibleRelationSet.java \ + javax/accessibility/AccessibleResourceBundle.java \ + javax/accessibility/AccessibleRole.java \ + javax/accessibility/AccessibleSelection.java \ + javax/accessibility/AccessibleState.java \ + javax/accessibility/AccessibleStateSet.java \ + javax/accessibility/AccessibleTable.java \ + javax/accessibility/AccessibleTableModelChange.java \ + javax/accessibility/AccessibleText.java \ + javax/accessibility/AccessibleValue.java \ javax/naming/directory/Attribute.java \ javax/naming/directory/AttributeInUseException.java \ javax/naming/directory/AttributeModificationException.java \ *************** javax/naming/ldap/UnsolicitedNotificatio *** 767,772 **** --- 1261,1280 ---- javax/naming/ldap/UnsolicitedNotificationEvent.java \ javax/naming/ldap/UnsolicitedNotificationListener.java \ javax/naming/OperationNotSupportedException.java \ + javax/sql/ConnectionEvent.java \ + javax/sql/ConnectionEventListener.java \ + javax/sql/ConnectionPoolDataSource.java \ + javax/sql/DataSource.java \ + javax/sql/PooledConnection.java \ + javax/sql/RowSetEvent.java \ + javax/sql/RowSetInternal.java \ + javax/sql/RowSet.java \ + javax/sql/RowSetListener.java \ + javax/sql/RowSetMetaData.java \ + javax/sql/RowSetReader.java \ + javax/sql/RowSetWriter.java \ + javax/sql/XAConnection.java \ + javax/sql/XADataSource.java \ javax/transaction/xa/XAException.java \ javax/transaction/xa/XAResource.java \ javax/transaction/xa/Xid.java \ *************** java/lang/AbstractMethodError.java \ *** 795,800 **** --- 1303,1309 ---- java/lang/ArithmeticException.java \ java/lang/ArrayIndexOutOfBoundsException.java \ java/lang/ArrayStoreException.java \ + java/lang/AssertionError.java \ java/lang/Boolean.java \ java/lang/Byte.java \ java/lang/Character.java \ *************** java/lang/SecurityException.java \ *** 850,855 **** --- 1359,1365 ---- java/lang/SecurityManager.java \ java/lang/Short.java \ java/lang/StackOverflowError.java \ + java/lang/StackTraceElement.java \ java/lang/StrictMath.java \ java/lang/String.java \ java/lang/StringBuffer.java \ *************** java/lang/VerifyError.java \ *** 868,873 **** --- 1378,1384 ---- java/lang/VirtualMachineError.java \ java/lang/VMClassLoader.java \ java/lang/VMSecurityManager.java \ + java/lang/VMThrowable.java \ java/lang/Void.java \ java/io/BufferedInputStream.java \ java/io/BufferedOutputStream.java \ *************** java/io/StringWriter.java \ *** 941,946 **** --- 1452,1458 ---- java/io/SyncFailedException.java \ java/io/UTFDataFormatException.java \ java/io/UnsupportedEncodingException.java \ + java/io/VMObjectStreamClass.java \ java/io/WriteAbortedException.java \ java/io/Writer.java \ java/util/AbstractCollection.java \ *************** java/util/AbstractSequentialList.java \ *** 950,956 **** java/util/AbstractSet.java \ java/util/ArrayList.java \ java/util/Arrays.java \ - java/util/BasicMapEntry.java \ java/util/BitSet.java \ java/util/Calendar.java \ java/util/Collection.java \ --- 1462,1467 ---- *************** java/util/Dictionary.java \ *** 962,967 **** --- 1473,1479 ---- java/util/EmptyStackException.java \ java/util/Enumeration.java \ java/util/EventListener.java \ + java/util/EventListenerProxy.java \ java/util/EventObject.java \ java/util/GregorianCalendar.java \ java/util/HashMap.java \ *************** java/util/Observable.java \ *** 983,988 **** --- 1495,1501 ---- java/util/Observer.java \ java/util/Properties.java \ java/util/PropertyPermission.java \ + java/util/PropertyPermissionCollection.java \ java/util/PropertyResourceBundle.java \ java/util/Random.java \ java/util/RandomAccess.java \ *************** java/util/TreeMap.java \ *** 1000,1006 **** java/util/TreeSet.java \ java/util/TooManyListenersException.java \ java/util/Vector.java \ ! java/util/WeakHashMap.java ordinary_java_source_files = $(core_java_source_files) \ --- 1513,1522 ---- java/util/TreeSet.java \ java/util/TooManyListenersException.java \ java/util/Vector.java \ ! java/util/WeakHashMap.java \ ! java/util/regex/Matcher.java \ ! java/util/regex/Pattern.java \ ! java/util/regex/PatternSyntaxException.java ordinary_java_source_files = $(core_java_source_files) \ *************** gnu/gcj/runtime/FileDeleter.java \ *** 1022,1028 **** --- 1538,1547 ---- gnu/gcj/runtime/FinalizerThread.java \ gnu/gcj/runtime/FirstThread.java \ gnu/gcj/runtime/JNIWeakRef.java \ + gnu/gcj/runtime/MethodRef.java \ + gnu/gcj/runtime/NameFinder.java \ gnu/gcj/runtime/SharedLibLoader.java \ + gnu/gcj/runtime/StackTrace.java \ gnu/gcj/runtime/StringBuffer.java \ gnu/gcj/runtime/VMClassLoader.java \ gnu/java/io/ClassLoaderObjectInputStream.java \ *************** gnu/java/locale/LocaleInformation_zh_HK. *** 1172,1187 **** gnu/java/locale/LocaleInformation_zh_SG.java \ gnu/java/locale/LocaleInformation_zh_TW.java \ gnu/java/math/MPN.java \ gnu/java/security/provider/DefaultPolicy.java \ gnu/java/security/provider/Gnu.java \ gnu/java/security/provider/SHA.java \ gnu/java/security/provider/SHA1PRNG.java \ gnu/java/text/BaseBreakIterator.java \ gnu/java/text/CharacterBreakIterator.java \ gnu/java/text/LineBreakIterator.java \ ! gnu/java/text/SentenceBreakIterator.java \ gnu/java/text/WordBreakIterator.java \ gnu/java/util/DoubleEnumeration.java \ java/lang/ref/PhantomReference.java \ java/lang/ref/Reference.java \ java/lang/ref/ReferenceQueue.java \ --- 1691,1742 ---- gnu/java/locale/LocaleInformation_zh_SG.java \ gnu/java/locale/LocaleInformation_zh_TW.java \ gnu/java/math/MPN.java \ + gnu/java/nio/ByteBufferImpl.java \ + gnu/java/nio/CharBufferImpl.java \ + gnu/java/nio/DatagramChannelImpl.java \ + gnu/java/nio/DoubleBufferImpl.java \ + gnu/java/nio/FileChannelImpl.java \ + gnu/java/nio/FloatBufferImpl.java \ + gnu/java/nio/IntBufferImpl.java \ + gnu/java/nio/LongBufferImpl.java \ + gnu/java/nio/PipeImpl.java \ + gnu/java/nio/SelectionKeyImpl.java \ + gnu/java/nio/SelectorImpl.java \ + gnu/java/nio/SelectorProviderImpl.java \ + gnu/java/nio/ServerSocketChannelImpl.java \ + gnu/java/nio/ShortBufferImpl.java \ + gnu/java/nio/SocketChannelImpl.java \ + gnu/java/nio/charset/ISO_8859_1.java \ + gnu/java/nio/charset/Provider.java \ + gnu/java/nio/charset/US_ASCII.java \ + gnu/java/nio/charset/UTF_16.java \ + gnu/java/nio/charset/UTF_16BE.java \ + gnu/java/nio/charset/UTF_16Decoder.java \ + gnu/java/nio/charset/UTF_16Encoder.java \ + gnu/java/nio/charset/UTF_16LE.java \ + gnu/java/nio/charset/UTF_8.java \ + gnu/java/security/der/DEREncodingException.java \ + gnu/java/security/provider/DERReader.java \ + gnu/java/security/provider/DERWriter.java \ gnu/java/security/provider/DefaultPolicy.java \ + gnu/java/security/provider/DSAKeyPairGenerator.java \ + gnu/java/security/provider/DSAParameterGenerator.java \ + gnu/java/security/provider/DSAParameters.java \ + gnu/java/security/provider/DSASignature.java \ gnu/java/security/provider/Gnu.java \ + gnu/java/security/provider/GnuDSAPrivateKey.java \ + gnu/java/security/provider/GnuDSAPublicKey.java \ + gnu/java/security/provider/MD5.java \ gnu/java/security/provider/SHA.java \ gnu/java/security/provider/SHA1PRNG.java \ + gnu/java/security/util/Prime.java \ gnu/java/text/BaseBreakIterator.java \ gnu/java/text/CharacterBreakIterator.java \ gnu/java/text/LineBreakIterator.java \ ! gnu/java/text/SentenceBreakIterator.java \ gnu/java/text/WordBreakIterator.java \ gnu/java/util/DoubleEnumeration.java \ + gnu/java/util/EmptyEnumeration.java \ java/lang/ref/PhantomReference.java \ java/lang/ref/Reference.java \ java/lang/ref/ReferenceQueue.java \ *************** java/lang/reflect/AccessibleObject.java *** 1191,1201 **** --- 1746,1759 ---- java/lang/reflect/Array.java \ java/lang/reflect/Constructor.java \ java/lang/reflect/Field.java \ + java/lang/reflect/InvocationHandler.java \ java/lang/reflect/InvocationTargetException.java \ java/lang/reflect/Member.java \ java/lang/reflect/Method.java \ java/lang/reflect/Modifier.java \ + java/lang/reflect/Proxy.java \ java/lang/reflect/ReflectPermission.java \ + java/lang/reflect/UndeclaredThrowableException.java \ java/math/BigDecimal.java \ java/math/BigInteger.java \ java/net/Authenticator.java \ *************** java/net/ContentHandlerFactory.java \ *** 1206,1230 **** --- 1764,1798 ---- java/net/DatagramPacket.java \ java/net/DatagramSocket.java \ java/net/DatagramSocketImpl.java \ + java/net/DatagramSocketImplFactory.java \ java/net/FileNameMap.java \ java/net/HttpURLConnection.java \ java/net/InetAddress.java \ + java/net/Inet4Address.java \ + java/net/Inet6Address.java \ + java/net/InetSocketAddress.java \ java/net/JarURLConnection.java \ java/net/MalformedURLException.java \ java/net/MulticastSocket.java \ java/net/NetPermission.java \ + java/net/NetworkInterface.java \ java/net/NoRouteToHostException.java \ java/net/PasswordAuthentication.java \ java/net/PlainDatagramSocketImpl.java \ java/net/PlainSocketImpl.java \ + java/net/PortUnreachableException.java \ java/net/ProtocolException.java \ java/net/ServerSocket.java \ java/net/Socket.java \ + java/net/SocketAddress.java \ java/net/SocketException.java \ java/net/SocketImpl.java \ java/net/SocketImplFactory.java \ java/net/SocketOptions.java \ java/net/SocketPermission.java \ + java/net/SocketTimeoutException.java \ + java/net/URI.java \ + java/net/URISyntaxException.java \ java/net/URL.java \ java/net/URLClassLoader.java \ java/net/URLConnection.java \ *************** java/net/URLStreamHandler.java \ *** 1234,1239 **** --- 1802,1873 ---- java/net/URLStreamHandlerFactory.java \ java/net/UnknownHostException.java \ java/net/UnknownServiceException.java \ + java/nio/Buffer.java \ + java/nio/BufferOverflowException.java \ + java/nio/BufferUnderflowException.java \ + java/nio/ByteBuffer.java \ + java/nio/ByteOrder.java \ + java/nio/CharBuffer.java \ + java/nio/DoubleBuffer.java \ + java/nio/FloatBuffer.java \ + java/nio/IntBuffer.java \ + java/nio/InvalidMarkException.java \ + java/nio/LongBuffer.java \ + java/nio/MappedByteBuffer.java \ + java/nio/ReadOnlyBufferException.java \ + java/nio/ShortBuffer.java \ + java/nio/channels/AlreadyConnectedException.java \ + java/nio/channels/AsynchronousCloseException.java \ + java/nio/channels/ByteChannel.java \ + java/nio/channels/CancelledKeyException.java \ + java/nio/channels/Channel.java \ + java/nio/channels/Channels.java \ + java/nio/channels/ClosedByInterruptException.java \ + java/nio/channels/ClosedChannelException.java \ + java/nio/channels/ClosedSelectorException.java \ + java/nio/channels/ConnectionPendingException.java \ + java/nio/channels/DatagramChannel.java \ + java/nio/channels/FileChannel.java \ + java/nio/channels/FileLock.java \ + java/nio/channels/FileLockInterruptionException.java \ + java/nio/channels/GatheringByteChannel.java \ + java/nio/channels/IllegalBlockingModeException.java \ + java/nio/channels/IllegalSelectorException.java \ + java/nio/channels/InterruptibleChannel.java \ + java/nio/channels/NoConnectionPendingException.java \ + java/nio/channels/NonReadableChannelException.java \ + java/nio/channels/NonWritableChannelException.java \ + java/nio/channels/NotYetBoundException.java \ + java/nio/channels/NotYetConnectedException.java \ + java/nio/channels/OverlappingFileLockException.java \ + java/nio/channels/Pipe.java \ + java/nio/channels/ReadableByteChannel.java \ + java/nio/channels/ScatteringByteChannel.java \ + java/nio/channels/SelectableChannel.java \ + java/nio/channels/SelectionKey.java \ + java/nio/channels/Selector.java \ + java/nio/channels/ServerSocketChannel.java \ + java/nio/channels/SocketChannel.java \ + java/nio/channels/UnresolvedAddressException.java \ + java/nio/channels/UnsupportedAddressTypeException.java \ + java/nio/channels/WritableByteChannel.java \ + java/nio/channels/spi/AbstractSelectableChannel.java \ + java/nio/channels/spi/AbstractInterruptibleChannel.java \ + java/nio/channels/spi/AbstractSelectionKey.java \ + java/nio/channels/spi/AbstractSelector.java \ + java/nio/channels/spi/SelectorProvider.java \ + java/nio/charset/Charset.java \ + java/nio/charset/CharacterCodingException.java \ + java/nio/charset/CharsetDecoder.java \ + java/nio/charset/CharsetEncoder.java \ + java/nio/charset/CoderMalfunctionError.java \ + java/nio/charset/CoderResult.java \ + java/nio/charset/CodingErrorAction.java \ + java/nio/charset/IllegalCharsetNameException.java \ + java/nio/charset/MalformedInputException.java \ + java/nio/charset/UnmappableCharacterException.java \ + java/nio/charset/UnsupportedCharsetException.java \ + java/nio/charset/spi/CharsetProvider.java \ java/security/AccessControlContext.java \ java/security/AccessControlException.java \ java/security/AccessController.java \ *************** java/security/cert/CertificateFactory.ja *** 1318,1323 **** --- 1952,1961 ---- java/security/cert/CertificateFactorySpi.java \ java/security/cert/CertificateNotYetValidException.java \ java/security/cert/CertificateParsingException.java \ + java/security/cert/CertPath.java \ + java/security/cert/CertPathBuilderException.java \ + java/security/cert/CertPathValidatorException.java \ + java/security/cert/CertStoreException.java \ java/security/cert/X509CRL.java \ java/security/cert/X509CRLEntry.java \ java/security/cert/X509Certificate.java \ *************** java/sql/Date.java \ *** 1357,1370 **** --- 1995,2011 ---- java/sql/Driver.java \ java/sql/DriverManager.java \ java/sql/DriverPropertyInfo.java \ + java/sql/ParameterMetaData.java \ java/sql/PreparedStatement.java \ java/sql/Ref.java \ java/sql/ResultSet.java \ java/sql/ResultSetMetaData.java \ + java/sql/Savepoint.java \ java/sql/SQLData.java \ java/sql/SQLException.java \ java/sql/SQLInput.java \ java/sql/SQLOutput.java \ + java/sql/SQLPermission.java \ java/sql/SQLWarning.java \ java/sql/Statement.java \ java/sql/Struct.java \ *************** java/util/zip/ZipException.java \ *** 1419,1478 **** java/util/zip/ZipFile.java \ java/util/zip/ZipInputStream.java \ java/util/zip/ZipOutputStream.java \ - org/w3c/dom/Attr.java \ - org/w3c/dom/CDATASection.java \ - org/w3c/dom/CharacterData.java \ - org/w3c/dom/Comment.java \ - org/w3c/dom/DOMException.java \ - org/w3c/dom/DOMImplementation.java \ - org/w3c/dom/Document.java \ - org/w3c/dom/DocumentFragment.java \ - org/w3c/dom/DocumentType.java \ - org/w3c/dom/Element.java \ - org/w3c/dom/Entity.java \ - org/w3c/dom/EntityReference.java \ - org/w3c/dom/NamedNodeMap.java \ - org/w3c/dom/Node.java \ - org/w3c/dom/NodeList.java \ - org/w3c/dom/Notation.java \ - org/w3c/dom/ProcessingInstruction.java \ - org/w3c/dom/Text.java \ - org/w3c/dom/ranges/DocumentRange.java \ - org/w3c/dom/ranges/Range.java \ - org/w3c/dom/ranges/RangeException.java \ - org/w3c/dom/traversal/DocumentTraversal.java \ - org/w3c/dom/traversal/NodeFilter.java \ - org/w3c/dom/traversal/NodeIterator.java \ - org/w3c/dom/traversal/TreeWalker.java \ - org/xml/sax/ext/DeclHandler.java \ - org/xml/sax/ext/LexicalHandler.java \ - org/xml/sax/helpers/AttributeListImpl.java \ - org/xml/sax/helpers/AttributesImpl.java \ - org/xml/sax/helpers/DefaultHandler.java \ - org/xml/sax/helpers/LocatorImpl.java \ - org/xml/sax/helpers/NamespaceSupport.java \ - org/xml/sax/helpers/ParserAdapter.java \ - org/xml/sax/helpers/ParserFactory.java \ - org/xml/sax/helpers/XMLFilterImpl.java \ - org/xml/sax/helpers/XMLReaderAdapter.java \ - org/xml/sax/helpers/XMLReaderFactory.java \ - org/xml/sax/AttributeList.java \ - org/xml/sax/Attributes.java \ - org/xml/sax/ContentHandler.java \ - org/xml/sax/DTDHandler.java \ - org/xml/sax/DocumentHandler.java \ - org/xml/sax/EntityResolver.java \ - org/xml/sax/ErrorHandler.java \ - org/xml/sax/HandlerBase.java \ - org/xml/sax/InputSource.java \ - org/xml/sax/Locator.java \ - org/xml/sax/Parser.java \ - org/xml/sax/SAXException.java \ - org/xml/sax/SAXNotRecognizedException.java \ - org/xml/sax/SAXNotSupportedException.java \ - org/xml/sax/SAXParseException.java \ - org/xml/sax/XMLFilter.java \ - org/xml/sax/XMLReader.java \ $(rmi_java_source_files) \ $(awt_java_source_files) \ $(convert_source_files) \ --- 2060,2065 ---- *************** gnu/gcj/io/shs.cc \ *** 1514,1525 **** gnu/gcj/protocol/core/natCoreInputStream.cc \ gnu/gcj/runtime/natFinalizerThread.cc \ gnu/gcj/runtime/natFirstThread.cc \ gnu/gcj/runtime/natSharedLibLoader.cc \ gnu/gcj/runtime/natStringBuffer.cc \ java/io/natFile.cc \ java/io/natFileDescriptor.cc \ java/io/natObjectInputStream.cc \ ! java/io/natObjectOutputStream.cc \ java/lang/natCharacter.cc \ java/lang/natClass.cc \ java/lang/natClassLoader.cc \ --- 2101,2125 ---- gnu/gcj/protocol/core/natCoreInputStream.cc \ gnu/gcj/runtime/natFinalizerThread.cc \ gnu/gcj/runtime/natFirstThread.cc \ + gnu/gcj/runtime/natNameFinder.cc \ gnu/gcj/runtime/natSharedLibLoader.cc \ + gnu/gcj/runtime/natStackTrace.cc \ gnu/gcj/runtime/natStringBuffer.cc \ + gnu/gcj/runtime/natVMClassLoader.cc \ + gnu/java/nio/natByteBufferImpl.cc \ + gnu/java/nio/natCharBufferImpl.cc \ + gnu/java/nio/natDoubleBufferImpl.cc \ + gnu/java/nio/natFileChannelImpl.cc \ + gnu/java/nio/natFloatBufferImpl.cc \ + gnu/java/nio/natIntBufferImpl.cc \ + gnu/java/nio/natLongBufferImpl.cc \ + gnu/java/nio/natSelectorImpl.cc \ + gnu/java/nio/natShortBufferImpl.cc \ + gnu/java/nio/natSocketChannelImpl.cc \ java/io/natFile.cc \ java/io/natFileDescriptor.cc \ java/io/natObjectInputStream.cc \ ! java/io/natVMObjectStreamClass.cc \ java/lang/natCharacter.cc \ java/lang/natClass.cc \ java/lang/natClassLoader.cc \ *************** java/lang/natString.cc \ *** 1533,1548 **** java/lang/natStringBuffer.cc \ java/lang/natSystem.cc \ java/lang/natThread.cc \ ! java/lang/natThrowable.cc \ java/lang/ref/natReference.cc \ java/lang/reflect/natArray.cc \ java/lang/reflect/natConstructor.cc \ java/lang/reflect/natField.cc \ java/lang/reflect/natMethod.cc \ java/net/natInetAddress.cc \ java/net/natPlainDatagramSocketImpl.cc \ java/net/natPlainSocketImpl.cc \ java/text/natCollator.cc \ java/util/zip/natDeflater.cc \ java/util/zip/natInflater.cc --- 2133,2152 ---- java/lang/natStringBuffer.cc \ java/lang/natSystem.cc \ java/lang/natThread.cc \ ! java/lang/natVMSecurityManager.cc \ java/lang/ref/natReference.cc \ java/lang/reflect/natArray.cc \ java/lang/reflect/natConstructor.cc \ java/lang/reflect/natField.cc \ java/lang/reflect/natMethod.cc \ + java/lang/reflect/natProxy.cc \ + java/net/natNetworkInterface.cc \ java/net/natInetAddress.cc \ java/net/natPlainDatagramSocketImpl.cc \ java/net/natPlainSocketImpl.cc \ java/text/natCollator.cc \ + java/util/natResourceBundle.cc \ + java/util/natTimeZone.cc \ java/util/zip/natDeflater.cc \ java/util/zip/natInflater.cc *************** AM_MAKEFLAGS = \ *** 1619,1625 **** "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ ! "JC1FLAGS=$(JC1FLAGS)" \ "LDFLAGS=$(LDFLAGS)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ --- 2223,2229 ---- "INSTALL_DATA=$(INSTALL_DATA)" \ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ ! "GCJFLAGS=$(GCJFLAGS)" \ "LDFLAGS=$(LDFLAGS)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ *************** AM_MAKEFLAGS = \ *** 1635,1642 **** "prefix=$(prefix)" \ "AR=$(AR)" \ "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \ --- 2239,2244 ---- *************** AM_MAKEFLAGS = \ *** 1645,1650 **** --- 2247,2255 ---- "DESTDIR=$(DESTDIR)" + # Subdir rules rely on $(FLAGS_TO_PASS) + FLAGS_TO_PASS = $(AM_MAKEFLAGS) + CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host MAKEOVERRIDES = *************** X_LIBS = @X_LIBS@ *** 1671,1677 **** X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ libgcj_la_OBJECTS = prims.lo jni.lo exception.lo resolve.lo \ ! defineclass.lo interpret.lo name-finder.lo verify.lo gnu/gcj/natCore.lo \ gnu/gcj/convert/JIS0208_to_Unicode.lo \ gnu/gcj/convert/JIS0212_to_Unicode.lo gnu/gcj/convert/Unicode_to_JIS.lo \ gnu/gcj/convert/natIconv.lo gnu/gcj/convert/natInput_EUCJIS.lo \ --- 2276,2282 ---- X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ libgcj_la_OBJECTS = prims.lo jni.lo exception.lo resolve.lo \ ! defineclass.lo interpret.lo verify.lo gnu/gcj/natCore.lo \ gnu/gcj/convert/JIS0208_to_Unicode.lo \ gnu/gcj/convert/JIS0212_to_Unicode.lo gnu/gcj/convert/Unicode_to_JIS.lo \ gnu/gcj/convert/natIconv.lo gnu/gcj/convert/natInput_EUCJIS.lo \ *************** gnu/gcj/convert/natInput_SJIS.lo gnu/gcj *** 1679,1701 **** gnu/gcj/convert/natOutput_SJIS.lo gnu/gcj/io/natSimpleSHSStream.lo \ gnu/gcj/io/shs.lo gnu/gcj/protocol/core/natCoreInputStream.lo \ gnu/gcj/runtime/natFinalizerThread.lo gnu/gcj/runtime/natFirstThread.lo \ ! gnu/gcj/runtime/natSharedLibLoader.lo \ ! gnu/gcj/runtime/natStringBuffer.lo java/io/natFile.lo \ java/io/natFileDescriptor.lo java/io/natObjectInputStream.lo \ ! java/io/natObjectOutputStream.lo java/lang/natCharacter.lo \ java/lang/natClass.lo java/lang/natClassLoader.lo \ java/lang/natConcreteProcess.lo java/lang/natDouble.lo \ java/lang/natFloat.lo java/lang/natMath.lo java/lang/natObject.lo \ java/lang/natRuntime.lo java/lang/natString.lo \ java/lang/natStringBuffer.lo java/lang/natSystem.lo \ ! java/lang/natThread.lo java/lang/natThrowable.lo \ java/lang/ref/natReference.lo java/lang/reflect/natArray.lo \ java/lang/reflect/natConstructor.lo java/lang/reflect/natField.lo \ ! java/lang/reflect/natMethod.lo java/net/natInetAddress.lo \ java/net/natPlainDatagramSocketImpl.lo java/net/natPlainSocketImpl.lo \ ! java/text/natCollator.lo java/util/zip/natDeflater.lo \ java/util/zip/natInflater.lo ! libgcjx_la_OBJECTS = gnu/gcj/xlib/natClip.lo \ gnu/gcj/xlib/natColormap.lo gnu/gcj/xlib/natDisplay.lo \ gnu/gcj/xlib/natDrawable.lo gnu/gcj/xlib/natFont.lo \ gnu/gcj/xlib/natGC.lo gnu/gcj/xlib/natPixmap.lo \ --- 2284,2354 ---- gnu/gcj/convert/natOutput_SJIS.lo gnu/gcj/io/natSimpleSHSStream.lo \ gnu/gcj/io/shs.lo gnu/gcj/protocol/core/natCoreInputStream.lo \ gnu/gcj/runtime/natFinalizerThread.lo gnu/gcj/runtime/natFirstThread.lo \ ! gnu/gcj/runtime/natNameFinder.lo gnu/gcj/runtime/natSharedLibLoader.lo \ ! gnu/gcj/runtime/natStackTrace.lo gnu/gcj/runtime/natStringBuffer.lo \ ! gnu/gcj/runtime/natVMClassLoader.lo gnu/java/nio/natByteBufferImpl.lo \ ! gnu/java/nio/natCharBufferImpl.lo gnu/java/nio/natDoubleBufferImpl.lo \ ! gnu/java/nio/natFileChannelImpl.lo gnu/java/nio/natFloatBufferImpl.lo \ ! gnu/java/nio/natIntBufferImpl.lo gnu/java/nio/natLongBufferImpl.lo \ ! gnu/java/nio/natSelectorImpl.lo gnu/java/nio/natShortBufferImpl.lo \ ! gnu/java/nio/natSocketChannelImpl.lo java/io/natFile.lo \ java/io/natFileDescriptor.lo java/io/natObjectInputStream.lo \ ! java/io/natVMObjectStreamClass.lo java/lang/natCharacter.lo \ java/lang/natClass.lo java/lang/natClassLoader.lo \ java/lang/natConcreteProcess.lo java/lang/natDouble.lo \ java/lang/natFloat.lo java/lang/natMath.lo java/lang/natObject.lo \ java/lang/natRuntime.lo java/lang/natString.lo \ java/lang/natStringBuffer.lo java/lang/natSystem.lo \ ! java/lang/natThread.lo java/lang/natVMSecurityManager.lo \ java/lang/ref/natReference.lo java/lang/reflect/natArray.lo \ java/lang/reflect/natConstructor.lo java/lang/reflect/natField.lo \ ! java/lang/reflect/natMethod.lo java/lang/reflect/natProxy.lo \ ! java/net/natNetworkInterface.lo java/net/natInetAddress.lo \ java/net/natPlainDatagramSocketImpl.lo java/net/natPlainSocketImpl.lo \ ! java/text/natCollator.lo java/util/natResourceBundle.lo \ ! java/util/natTimeZone.lo java/util/zip/natDeflater.lo \ java/util/zip/natInflater.lo ! lib_org_xml_sax_la_LDFLAGS = ! lib_org_xml_sax_la_LIBADD = ! lib_org_xml_sax_la_OBJECTS = org/xml/sax/ext/DeclHandler.lo \ ! org/xml/sax/ext/LexicalHandler.lo \ ! org/xml/sax/helpers/AttributeListImpl.lo \ ! org/xml/sax/helpers/AttributesImpl.lo \ ! org/xml/sax/helpers/DefaultHandler.lo \ ! org/xml/sax/helpers/LocatorImpl.lo \ ! org/xml/sax/helpers/NamespaceSupport.lo \ ! org/xml/sax/helpers/NewInstance.lo org/xml/sax/helpers/ParserAdapter.lo \ ! org/xml/sax/helpers/ParserFactory.lo \ ! org/xml/sax/helpers/XMLFilterImpl.lo \ ! org/xml/sax/helpers/XMLReaderAdapter.lo \ ! org/xml/sax/helpers/XMLReaderFactory.lo org/xml/sax/AttributeList.lo \ ! org/xml/sax/Attributes.lo org/xml/sax/ContentHandler.lo \ ! org/xml/sax/DTDHandler.lo org/xml/sax/DocumentHandler.lo \ ! org/xml/sax/EntityResolver.lo org/xml/sax/ErrorHandler.lo \ ! org/xml/sax/HandlerBase.lo org/xml/sax/InputSource.lo \ ! org/xml/sax/Locator.lo org/xml/sax/Parser.lo \ ! org/xml/sax/SAXException.lo org/xml/sax/SAXNotRecognizedException.lo \ ! org/xml/sax/SAXNotSupportedException.lo \ ! org/xml/sax/SAXParseException.lo org/xml/sax/XMLFilter.lo \ ! org/xml/sax/XMLReader.lo ! lib_org_w3c_dom_la_LDFLAGS = ! lib_org_w3c_dom_la_LIBADD = ! lib_org_w3c_dom_la_OBJECTS = org/w3c/dom/Attr.lo \ ! org/w3c/dom/CDATASection.lo org/w3c/dom/CharacterData.lo \ ! org/w3c/dom/Comment.lo org/w3c/dom/DOMException.lo \ ! org/w3c/dom/DOMImplementation.lo org/w3c/dom/Document.lo \ ! org/w3c/dom/DocumentFragment.lo org/w3c/dom/DocumentType.lo \ ! org/w3c/dom/Element.lo org/w3c/dom/Entity.lo \ ! org/w3c/dom/EntityReference.lo org/w3c/dom/NamedNodeMap.lo \ ! org/w3c/dom/Node.lo org/w3c/dom/NodeList.lo org/w3c/dom/Notation.lo \ ! org/w3c/dom/ProcessingInstruction.lo org/w3c/dom/Text.lo \ ! org/w3c/dom/ranges/DocumentRange.lo org/w3c/dom/ranges/Range.lo \ ! org/w3c/dom/ranges/RangeException.lo \ ! org/w3c/dom/traversal/DocumentTraversal.lo \ ! org/w3c/dom/traversal/NodeFilter.lo \ ! org/w3c/dom/traversal/NodeIterator.lo \ ! org/w3c/dom/traversal/TreeWalker.lo ! lib_gnu_awt_xlib_la_OBJECTS = gnu/gcj/xlib/natClip.lo \ gnu/gcj/xlib/natColormap.lo gnu/gcj/xlib/natDisplay.lo \ gnu/gcj/xlib/natDrawable.lo gnu/gcj/xlib/natFont.lo \ gnu/gcj/xlib/natGC.lo gnu/gcj/xlib/natPixmap.lo \ *************** LINK = $(LIBTOOL) --mode=link $(CCLD) $( *** 1732,1740 **** DATA = $(jar_DATA) $(toolexecmainlib_DATA) DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \ ! THANKS acconfig.h acinclude.m4 aclocal.m4 configure configure.in \ ! gcj/libgcj-config.h.in gcj/stamp-h2.in include/config.h.in \ ! include/stamp-h1.in libgcj-test.spec.in libgcj.spec.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) --- 2385,2392 ---- DATA = $(jar_DATA) $(toolexecmainlib_DATA) DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \ ! THANKS acinclude.m4 aclocal.m4 configure configure.in \ ! libgcj-test.spec.in libgcj.spec.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 1795,1807 **** .deps/gnu/gcj/runtime/FileDeleter.P \ .deps/gnu/gcj/runtime/FinalizerThread.P \ .deps/gnu/gcj/runtime/FirstThread.P .deps/gnu/gcj/runtime/JNIWeakRef.P \ .deps/gnu/gcj/runtime/SharedLibLoader.P \ ! .deps/gnu/gcj/runtime/StringBuffer.P \ .deps/gnu/gcj/runtime/VMClassLoader.P \ .deps/gnu/gcj/runtime/natFinalizerThread.P \ .deps/gnu/gcj/runtime/natFirstThread.P \ .deps/gnu/gcj/runtime/natSharedLibLoader.P \ ! .deps/gnu/gcj/runtime/natStringBuffer.P .deps/gnu/gcj/xlib/Clip.P \ .deps/gnu/gcj/xlib/Colormap.P .deps/gnu/gcj/xlib/Display.P \ .deps/gnu/gcj/xlib/Drawable.P .deps/gnu/gcj/xlib/Font.P \ .deps/gnu/gcj/xlib/GC.P .deps/gnu/gcj/xlib/Pixmap.P \ --- 2447,2463 ---- .deps/gnu/gcj/runtime/FileDeleter.P \ .deps/gnu/gcj/runtime/FinalizerThread.P \ .deps/gnu/gcj/runtime/FirstThread.P .deps/gnu/gcj/runtime/JNIWeakRef.P \ + .deps/gnu/gcj/runtime/MethodRef.P .deps/gnu/gcj/runtime/NameFinder.P \ .deps/gnu/gcj/runtime/SharedLibLoader.P \ ! .deps/gnu/gcj/runtime/StackTrace.P .deps/gnu/gcj/runtime/StringBuffer.P \ .deps/gnu/gcj/runtime/VMClassLoader.P \ .deps/gnu/gcj/runtime/natFinalizerThread.P \ .deps/gnu/gcj/runtime/natFirstThread.P \ + .deps/gnu/gcj/runtime/natNameFinder.P \ .deps/gnu/gcj/runtime/natSharedLibLoader.P \ ! .deps/gnu/gcj/runtime/natStackTrace.P \ ! .deps/gnu/gcj/runtime/natStringBuffer.P \ ! .deps/gnu/gcj/runtime/natVMClassLoader.P .deps/gnu/gcj/xlib/Clip.P \ .deps/gnu/gcj/xlib/Colormap.P .deps/gnu/gcj/xlib/Display.P \ .deps/gnu/gcj/xlib/Drawable.P .deps/gnu/gcj/xlib/Font.P \ .deps/gnu/gcj/xlib/GC.P .deps/gnu/gcj/xlib/Pixmap.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 1826,1832 **** --- 2482,2491 ---- .deps/gnu/gcj/xlib/natXImage.P .deps/gnu/gcj/xlib/natXUnmapEvent.P \ .deps/gnu/java/awt/BitMaskExtent.P .deps/gnu/java/awt/Buffers.P \ .deps/gnu/java/awt/ComponentDataBlitOp.P \ + .deps/gnu/java/awt/EventModifier.P \ .deps/gnu/java/awt/GLightweightPeer.P \ + .deps/gnu/java/awt/image/ImageDecoder.P \ + .deps/gnu/java/awt/image/XBMDecoder.P \ .deps/gnu/java/beans/BeanInfoEmbryo.P \ .deps/gnu/java/beans/EmptyBeanInfo.P \ .deps/gnu/java/beans/ExplicitBeanInfo.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 1985,1992 **** .deps/gnu/java/locale/LocaleInformation_zh_HK.P \ .deps/gnu/java/locale/LocaleInformation_zh_SG.P \ .deps/gnu/java/locale/LocaleInformation_zh_TW.P \ ! .deps/gnu/java/math/MPN.P .deps/gnu/java/rmi/dgc/DGCImpl.P \ ! .deps/gnu/java/rmi/dgc/DGCImpl_Skel.P \ .deps/gnu/java/rmi/dgc/DGCImpl_Stub.P \ .deps/gnu/java/rmi/registry/RegistryImpl.P \ .deps/gnu/java/rmi/registry/RegistryImpl_Skel.P \ --- 2644,2683 ---- .deps/gnu/java/locale/LocaleInformation_zh_HK.P \ .deps/gnu/java/locale/LocaleInformation_zh_SG.P \ .deps/gnu/java/locale/LocaleInformation_zh_TW.P \ ! .deps/gnu/java/math/MPN.P .deps/gnu/java/nio/ByteBufferImpl.P \ ! .deps/gnu/java/nio/CharBufferImpl.P \ ! .deps/gnu/java/nio/DatagramChannelImpl.P \ ! .deps/gnu/java/nio/DoubleBufferImpl.P \ ! .deps/gnu/java/nio/FileChannelImpl.P \ ! .deps/gnu/java/nio/FloatBufferImpl.P .deps/gnu/java/nio/IntBufferImpl.P \ ! .deps/gnu/java/nio/LongBufferImpl.P .deps/gnu/java/nio/PipeImpl.P \ ! .deps/gnu/java/nio/SelectionKeyImpl.P .deps/gnu/java/nio/SelectorImpl.P \ ! .deps/gnu/java/nio/SelectorProviderImpl.P \ ! .deps/gnu/java/nio/ServerSocketChannelImpl.P \ ! .deps/gnu/java/nio/ShortBufferImpl.P \ ! .deps/gnu/java/nio/SocketChannelImpl.P \ ! .deps/gnu/java/nio/charset/ISO_8859_1.P \ ! .deps/gnu/java/nio/charset/Provider.P \ ! .deps/gnu/java/nio/charset/US_ASCII.P \ ! .deps/gnu/java/nio/charset/UTF_16.P \ ! .deps/gnu/java/nio/charset/UTF_16BE.P \ ! .deps/gnu/java/nio/charset/UTF_16Decoder.P \ ! .deps/gnu/java/nio/charset/UTF_16Encoder.P \ ! .deps/gnu/java/nio/charset/UTF_16LE.P \ ! .deps/gnu/java/nio/charset/UTF_8.P \ ! .deps/gnu/java/nio/natByteBufferImpl.P \ ! .deps/gnu/java/nio/natCharBufferImpl.P \ ! .deps/gnu/java/nio/natDoubleBufferImpl.P \ ! .deps/gnu/java/nio/natFileChannelImpl.P \ ! .deps/gnu/java/nio/natFloatBufferImpl.P \ ! .deps/gnu/java/nio/natIntBufferImpl.P \ ! .deps/gnu/java/nio/natLongBufferImpl.P \ ! .deps/gnu/java/nio/natSelectorImpl.P \ ! .deps/gnu/java/nio/natShortBufferImpl.P \ ! .deps/gnu/java/nio/natSocketChannelImpl.P \ ! .deps/gnu/java/rmi/RMIMarshalledObjectInputStream.P \ ! .deps/gnu/java/rmi/RMIMarshalledObjectOutputStream.P \ ! .deps/gnu/java/rmi/dgc/DGCImpl.P .deps/gnu/java/rmi/dgc/DGCImpl_Skel.P \ .deps/gnu/java/rmi/dgc/DGCImpl_Stub.P \ .deps/gnu/java/rmi/registry/RegistryImpl.P \ .deps/gnu/java/rmi/registry/RegistryImpl_Skel.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 1995,2000 **** --- 2686,2692 ---- .deps/gnu/java/rmi/rmic/Compiler.P \ .deps/gnu/java/rmi/rmic/CompilerProcess.P \ .deps/gnu/java/rmi/rmic/RMIC.P .deps/gnu/java/rmi/rmic/TabbedWriter.P \ + .deps/gnu/java/rmi/server/ConnectionRunnerPool.P \ .deps/gnu/java/rmi/server/ProtocolConstants.P \ .deps/gnu/java/rmi/server/RMIDefaultSocketFactory.P \ .deps/gnu/java/rmi/server/RMIHashes.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2007,2072 **** .deps/gnu/java/rmi/server/UnicastRemoteStub.P \ .deps/gnu/java/rmi/server/UnicastServer.P \ .deps/gnu/java/rmi/server/UnicastServerRef.P \ .deps/gnu/java/security/provider/DefaultPolicy.P \ .deps/gnu/java/security/provider/Gnu.P \ .deps/gnu/java/security/provider/SHA.P \ .deps/gnu/java/security/provider/SHA1PRNG.P \ .deps/gnu/java/text/BaseBreakIterator.P \ .deps/gnu/java/text/CharacterBreakIterator.P \ .deps/gnu/java/text/LineBreakIterator.P \ .deps/gnu/java/text/SentenceBreakIterator.P \ .deps/gnu/java/text/WordBreakIterator.P \ ! .deps/gnu/java/util/DoubleEnumeration.P .deps/interpret.P \ .deps/java/applet/Applet.P .deps/java/applet/AppletContext.P \ .deps/java/applet/AppletStub.P .deps/java/applet/AudioClip.P \ .deps/java/awt/AWTError.P .deps/java/awt/AWTEvent.P \ .deps/java/awt/AWTEventMulticaster.P .deps/java/awt/AWTException.P \ ! .deps/java/awt/AWTPermission.P .deps/java/awt/ActiveEvent.P \ ! .deps/java/awt/Adjustable.P .deps/java/awt/BorderLayout.P \ ! .deps/java/awt/Button.P .deps/java/awt/Canvas.P \ ! .deps/java/awt/CardLayout.P .deps/java/awt/Checkbox.P \ ! .deps/java/awt/CheckboxGroup.P .deps/java/awt/CheckboxMenuItem.P \ ! .deps/java/awt/Choice.P .deps/java/awt/Color.P \ .deps/java/awt/Component.P .deps/java/awt/ComponentOrientation.P \ ! .deps/java/awt/Container.P .deps/java/awt/Cursor.P \ ! .deps/java/awt/Dialog.P .deps/java/awt/Dimension.P \ .deps/java/awt/Event.P .deps/java/awt/EventDispatchThread.P \ .deps/java/awt/EventQueue.P .deps/java/awt/FileDialog.P \ ! .deps/java/awt/FlowLayout.P .deps/java/awt/Font.P \ .deps/java/awt/FontMetrics.P .deps/java/awt/Frame.P \ ! .deps/java/awt/Graphics.P .deps/java/awt/Graphics2D.P \ ! .deps/java/awt/GraphicsConfiguration.P \ ! .deps/java/awt/GridBagConstraints.P .deps/java/awt/GridLayout.P \ .deps/java/awt/IllegalComponentStateException.P .deps/java/awt/Image.P \ ! .deps/java/awt/Insets.P .deps/java/awt/ItemSelectable.P \ ! .deps/java/awt/Label.P .deps/java/awt/LayoutManager.P \ ! .deps/java/awt/LayoutManager2.P .deps/java/awt/List.P \ ! .deps/java/awt/MediaTracker.P .deps/java/awt/Menu.P \ ! .deps/java/awt/MenuBar.P .deps/java/awt/MenuComponent.P \ ! .deps/java/awt/MenuContainer.P .deps/java/awt/MenuItem.P \ ! .deps/java/awt/MenuShortcut.P .deps/java/awt/Paint.P \ .deps/java/awt/PaintContext.P .deps/java/awt/Panel.P \ .deps/java/awt/Point.P .deps/java/awt/Polygon.P \ .deps/java/awt/PopupMenu.P .deps/java/awt/PrintGraphics.P \ .deps/java/awt/PrintJob.P .deps/java/awt/Rectangle.P \ ! .deps/java/awt/RenderingHints.P .deps/java/awt/ScrollPane.P \ .deps/java/awt/Scrollbar.P .deps/java/awt/Shape.P \ ! .deps/java/awt/SystemColor.P .deps/java/awt/TextArea.P \ ! .deps/java/awt/TextComponent.P .deps/java/awt/TextField.P \ .deps/java/awt/Toolkit.P .deps/java/awt/Transparency.P \ ! .deps/java/awt/Window.P .deps/java/awt/color/ColorSpace.P \ ! .deps/java/awt/color/ICC_ColorSpace.P \ .deps/java/awt/color/ICC_Profile.P \ .deps/java/awt/datatransfer/Clipboard.P \ .deps/java/awt/datatransfer/ClipboardOwner.P \ .deps/java/awt/datatransfer/DataFlavor.P \ .deps/java/awt/datatransfer/FlavorMap.P \ .deps/java/awt/datatransfer/MimeTypeParseException.P \ .deps/java/awt/datatransfer/StringSelection.P \ .deps/java/awt/datatransfer/SystemFlavorMap.P \ .deps/java/awt/datatransfer/Transferable.P \ .deps/java/awt/datatransfer/UnsupportedFlavorException.P \ .deps/java/awt/event/AWTEventListener.P \ .deps/java/awt/event/ActionEvent.P \ .deps/java/awt/event/ActionListener.P \ .deps/java/awt/event/AdjustmentEvent.P \ --- 2699,2819 ---- .deps/gnu/java/rmi/server/UnicastRemoteStub.P \ .deps/gnu/java/rmi/server/UnicastServer.P \ .deps/gnu/java/rmi/server/UnicastServerRef.P \ + .deps/gnu/java/security/der/DEREncodingException.P \ + .deps/gnu/java/security/provider/DERReader.P \ + .deps/gnu/java/security/provider/DERWriter.P \ + .deps/gnu/java/security/provider/DSAKeyPairGenerator.P \ + .deps/gnu/java/security/provider/DSAParameterGenerator.P \ + .deps/gnu/java/security/provider/DSAParameters.P \ + .deps/gnu/java/security/provider/DSASignature.P \ .deps/gnu/java/security/provider/DefaultPolicy.P \ .deps/gnu/java/security/provider/Gnu.P \ + .deps/gnu/java/security/provider/GnuDSAPrivateKey.P \ + .deps/gnu/java/security/provider/GnuDSAPublicKey.P \ + .deps/gnu/java/security/provider/MD5.P \ .deps/gnu/java/security/provider/SHA.P \ .deps/gnu/java/security/provider/SHA1PRNG.P \ + .deps/gnu/java/security/util/Prime.P \ .deps/gnu/java/text/BaseBreakIterator.P \ .deps/gnu/java/text/CharacterBreakIterator.P \ .deps/gnu/java/text/LineBreakIterator.P \ .deps/gnu/java/text/SentenceBreakIterator.P \ .deps/gnu/java/text/WordBreakIterator.P \ ! .deps/gnu/java/util/DoubleEnumeration.P \ ! .deps/gnu/java/util/EmptyEnumeration.P .deps/interpret.P \ .deps/java/applet/Applet.P .deps/java/applet/AppletContext.P \ .deps/java/applet/AppletStub.P .deps/java/applet/AudioClip.P \ .deps/java/awt/AWTError.P .deps/java/awt/AWTEvent.P \ .deps/java/awt/AWTEventMulticaster.P .deps/java/awt/AWTException.P \ ! .deps/java/awt/AWTKeyStroke.P .deps/java/awt/AWTPermission.P \ ! .deps/java/awt/ActiveEvent.P .deps/java/awt/Adjustable.P \ ! .deps/java/awt/AlphaComposite.P .deps/java/awt/AttributeValue.P \ ! .deps/java/awt/BasicStroke.P .deps/java/awt/BorderLayout.P \ ! .deps/java/awt/BufferCapabilities.P .deps/java/awt/Button.P \ ! .deps/java/awt/Canvas.P .deps/java/awt/CardLayout.P \ ! .deps/java/awt/Checkbox.P .deps/java/awt/CheckboxGroup.P \ ! .deps/java/awt/CheckboxMenuItem.P .deps/java/awt/Choice.P \ ! .deps/java/awt/Color.P .deps/java/awt/ColorPaintContext.P \ .deps/java/awt/Component.P .deps/java/awt/ComponentOrientation.P \ ! .deps/java/awt/Composite.P .deps/java/awt/CompositeContext.P \ ! .deps/java/awt/Container.P \ ! .deps/java/awt/ContainerOrderFocusTraversalPolicy.P \ ! .deps/java/awt/Cursor.P .deps/java/awt/DefaultFocusTraversalPolicy.P \ ! .deps/java/awt/DefaultKeyboardFocusManager.P .deps/java/awt/Dialog.P \ ! .deps/java/awt/Dimension.P .deps/java/awt/DisplayMode.P \ .deps/java/awt/Event.P .deps/java/awt/EventDispatchThread.P \ .deps/java/awt/EventQueue.P .deps/java/awt/FileDialog.P \ ! .deps/java/awt/FlowLayout.P .deps/java/awt/FocusTraversalPolicy.P \ ! .deps/java/awt/Font.P .deps/java/awt/FontFormatException.P \ .deps/java/awt/FontMetrics.P .deps/java/awt/Frame.P \ ! .deps/java/awt/GradientPaint.P .deps/java/awt/Graphics.P \ ! .deps/java/awt/Graphics2D.P .deps/java/awt/GraphicsConfigTemplate.P \ ! .deps/java/awt/GraphicsConfiguration.P .deps/java/awt/GraphicsDevice.P \ ! .deps/java/awt/GraphicsEnvironment.P \ ! .deps/java/awt/GridBagConstraints.P .deps/java/awt/GridBagLayout.P \ ! .deps/java/awt/GridLayout.P .deps/java/awt/HeadlessException.P \ .deps/java/awt/IllegalComponentStateException.P .deps/java/awt/Image.P \ ! .deps/java/awt/ImageCapabilities.P .deps/java/awt/Insets.P \ ! .deps/java/awt/ItemSelectable.P .deps/java/awt/JobAttributes.P \ ! .deps/java/awt/KeyEventDispatcher.P \ ! .deps/java/awt/KeyEventPostProcessor.P \ ! .deps/java/awt/KeyboardFocusManager.P .deps/java/awt/Label.P \ ! .deps/java/awt/LayoutManager.P .deps/java/awt/LayoutManager2.P \ ! .deps/java/awt/List.P .deps/java/awt/MediaTracker.P \ ! .deps/java/awt/Menu.P .deps/java/awt/MenuBar.P \ ! .deps/java/awt/MenuComponent.P .deps/java/awt/MenuContainer.P \ ! .deps/java/awt/MenuItem.P .deps/java/awt/MenuShortcut.P \ ! .deps/java/awt/PageAttributes.P .deps/java/awt/Paint.P \ .deps/java/awt/PaintContext.P .deps/java/awt/Panel.P \ .deps/java/awt/Point.P .deps/java/awt/Polygon.P \ .deps/java/awt/PopupMenu.P .deps/java/awt/PrintGraphics.P \ .deps/java/awt/PrintJob.P .deps/java/awt/Rectangle.P \ ! .deps/java/awt/RenderingHints.P .deps/java/awt/Robot.P \ ! .deps/java/awt/ScrollPane.P .deps/java/awt/ScrollPaneAdjustable.P \ .deps/java/awt/Scrollbar.P .deps/java/awt/Shape.P \ ! .deps/java/awt/Stroke.P .deps/java/awt/SystemColor.P \ ! .deps/java/awt/TextArea.P .deps/java/awt/TextComponent.P \ ! .deps/java/awt/TextField.P .deps/java/awt/TexturePaint.P \ .deps/java/awt/Toolkit.P .deps/java/awt/Transparency.P \ ! .deps/java/awt/Window.P .deps/java/awt/color/CMMException.P \ ! .deps/java/awt/color/ColorSpace.P .deps/java/awt/color/ICC_ColorSpace.P \ .deps/java/awt/color/ICC_Profile.P \ + .deps/java/awt/color/ICC_ProfileGray.P \ + .deps/java/awt/color/ICC_ProfileRGB.P \ + .deps/java/awt/color/ProfileDataException.P \ .deps/java/awt/datatransfer/Clipboard.P \ .deps/java/awt/datatransfer/ClipboardOwner.P \ .deps/java/awt/datatransfer/DataFlavor.P \ .deps/java/awt/datatransfer/FlavorMap.P \ + .deps/java/awt/datatransfer/FlavorTable.P \ .deps/java/awt/datatransfer/MimeTypeParseException.P \ .deps/java/awt/datatransfer/StringSelection.P \ .deps/java/awt/datatransfer/SystemFlavorMap.P \ .deps/java/awt/datatransfer/Transferable.P \ .deps/java/awt/datatransfer/UnsupportedFlavorException.P \ + .deps/java/awt/dnd/Autoscroll.P .deps/java/awt/dnd/DnDConstants.P \ + .deps/java/awt/dnd/DragGestureEvent.P \ + .deps/java/awt/dnd/DragGestureListener.P \ + .deps/java/awt/dnd/DragGestureRecognizer.P \ + .deps/java/awt/dnd/DragSource.P .deps/java/awt/dnd/DragSourceAdapter.P \ + .deps/java/awt/dnd/DragSourceContext.P \ + .deps/java/awt/dnd/DragSourceDragEvent.P \ + .deps/java/awt/dnd/DragSourceDropEvent.P \ + .deps/java/awt/dnd/DragSourceEvent.P \ + .deps/java/awt/dnd/DragSourceListener.P \ + .deps/java/awt/dnd/DragSourceMotionListener.P \ + .deps/java/awt/dnd/DropTarget.P .deps/java/awt/dnd/DropTargetAdapter.P \ + .deps/java/awt/dnd/DropTargetContext.P \ + .deps/java/awt/dnd/DropTargetDragEvent.P \ + .deps/java/awt/dnd/DropTargetDropEvent.P \ + .deps/java/awt/dnd/DropTargetEvent.P \ + .deps/java/awt/dnd/DropTargetListener.P \ + .deps/java/awt/dnd/InvalidDnDOperationException.P \ + .deps/java/awt/dnd/MouseDragGestureRecognizer.P \ + .deps/java/awt/dnd/peer/DragSourceContextPeer.P \ + .deps/java/awt/dnd/peer/DropTargetContextPeer.P \ .deps/java/awt/event/AWTEventListener.P \ + .deps/java/awt/event/AWTEventListenerProxy.P \ .deps/java/awt/event/ActionEvent.P \ .deps/java/awt/event/ActionListener.P \ .deps/java/awt/event/AdjustmentEvent.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2093,2113 **** .deps/java/awt/event/MouseListener.P \ .deps/java/awt/event/MouseMotionAdapter.P \ .deps/java/awt/event/MouseMotionListener.P \ .deps/java/awt/event/PaintEvent.P .deps/java/awt/event/TextEvent.P \ .deps/java/awt/event/TextListener.P \ .deps/java/awt/event/WindowAdapter.P .deps/java/awt/event/WindowEvent.P \ .deps/java/awt/event/WindowListener.P \ ! .deps/java/awt/geom/AffineTransform.P .deps/java/awt/geom/Dimension2D.P \ .deps/java/awt/geom/Ellipse2D.P \ .deps/java/awt/geom/IllegalPathStateException.P \ .deps/java/awt/geom/Line2D.P \ .deps/java/awt/geom/NoninvertibleTransformException.P \ .deps/java/awt/geom/PathIterator.P .deps/java/awt/geom/Point2D.P \ ! .deps/java/awt/geom/Rectangle2D.P \ .deps/java/awt/geom/RectangularShape.P \ ! .deps/java/awt/geom/RoundRectangle2D.P \ .deps/java/awt/image/AreaAveragingScaleFilter.P \ ! .deps/java/awt/image/BufferedImage.P .deps/java/awt/image/ColorModel.P \ .deps/java/awt/image/ComponentColorModel.P \ .deps/java/awt/image/ComponentSampleModel.P \ .deps/java/awt/image/CropImageFilter.P \ --- 2840,2876 ---- .deps/java/awt/event/MouseListener.P \ .deps/java/awt/event/MouseMotionAdapter.P \ .deps/java/awt/event/MouseMotionListener.P \ + .deps/java/awt/event/MouseWheelEvent.P \ + .deps/java/awt/event/MouseWheelListener.P \ .deps/java/awt/event/PaintEvent.P .deps/java/awt/event/TextEvent.P \ .deps/java/awt/event/TextListener.P \ .deps/java/awt/event/WindowAdapter.P .deps/java/awt/event/WindowEvent.P \ + .deps/java/awt/event/WindowFocusListener.P \ .deps/java/awt/event/WindowListener.P \ ! .deps/java/awt/event/WindowStateListener.P \ ! .deps/java/awt/font/TextHitInfo.P .deps/java/awt/geom/AffineTransform.P \ ! .deps/java/awt/geom/Arc2D.P .deps/java/awt/geom/Area.P \ ! .deps/java/awt/geom/CubicCurve2D.P .deps/java/awt/geom/Dimension2D.P \ .deps/java/awt/geom/Ellipse2D.P \ + .deps/java/awt/geom/FlatteningPathIterator.P \ + .deps/java/awt/geom/GeneralPath.P \ .deps/java/awt/geom/IllegalPathStateException.P \ .deps/java/awt/geom/Line2D.P \ .deps/java/awt/geom/NoninvertibleTransformException.P \ .deps/java/awt/geom/PathIterator.P .deps/java/awt/geom/Point2D.P \ ! .deps/java/awt/geom/QuadCurve2D.P .deps/java/awt/geom/Rectangle2D.P \ .deps/java/awt/geom/RectangularShape.P \ ! .deps/java/awt/geom/RoundRectangle2D.P .deps/java/awt/im/InputContext.P \ ! .deps/java/awt/im/InputMethodHighlight.P \ ! .deps/java/awt/im/InputMethodRequests.P .deps/java/awt/im/InputSubset.P \ ! .deps/java/awt/im/spi/InputMethod.P \ ! .deps/java/awt/im/spi/InputMethodContext.P \ ! .deps/java/awt/im/spi/InputMethodDescriptor.P \ .deps/java/awt/image/AreaAveragingScaleFilter.P \ ! .deps/java/awt/image/BufferStrategy.P \ ! .deps/java/awt/image/BufferedImage.P \ ! .deps/java/awt/image/BufferedImageOp.P \ ! .deps/java/awt/image/ColorModel.P \ .deps/java/awt/image/ComponentColorModel.P \ .deps/java/awt/image/ComponentSampleModel.P \ .deps/java/awt/image/CropImageFilter.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2119,2135 **** .deps/java/awt/image/ImageConsumer.P .deps/java/awt/image/ImageFilter.P \ .deps/java/awt/image/ImageObserver.P \ .deps/java/awt/image/ImageProducer.P \ .deps/java/awt/image/IndexColorModel.P \ .deps/java/awt/image/MemoryImageSource.P \ .deps/java/awt/image/PackedColorModel.P \ .deps/java/awt/image/PixelGrabber.P \ .deps/java/awt/image/RGBImageFilter.P .deps/java/awt/image/Raster.P \ ! .deps/java/awt/image/RasterOp.P \ .deps/java/awt/image/ReplicateScaleFilter.P \ .deps/java/awt/image/SampleModel.P \ .deps/java/awt/image/SinglePixelPackedSampleModel.P \ ! .deps/java/awt/image/WritableRaster.P .deps/java/awt/peer/ButtonPeer.P \ ! .deps/java/awt/peer/CanvasPeer.P \ .deps/java/awt/peer/CheckboxMenuItemPeer.P \ .deps/java/awt/peer/CheckboxPeer.P .deps/java/awt/peer/ChoicePeer.P \ .deps/java/awt/peer/ComponentPeer.P .deps/java/awt/peer/ContainerPeer.P \ --- 2882,2910 ---- .deps/java/awt/image/ImageConsumer.P .deps/java/awt/image/ImageFilter.P \ .deps/java/awt/image/ImageObserver.P \ .deps/java/awt/image/ImageProducer.P \ + .deps/java/awt/image/ImagingOpException.P \ .deps/java/awt/image/IndexColorModel.P \ .deps/java/awt/image/MemoryImageSource.P \ .deps/java/awt/image/PackedColorModel.P \ .deps/java/awt/image/PixelGrabber.P \ .deps/java/awt/image/RGBImageFilter.P .deps/java/awt/image/Raster.P \ ! .deps/java/awt/image/RasterFormatException.P \ ! .deps/java/awt/image/RasterOp.P .deps/java/awt/image/RenderedImage.P \ .deps/java/awt/image/ReplicateScaleFilter.P \ .deps/java/awt/image/SampleModel.P \ .deps/java/awt/image/SinglePixelPackedSampleModel.P \ ! .deps/java/awt/image/TileObserver.P \ ! .deps/java/awt/image/VolatileImage.P \ ! .deps/java/awt/image/WritableRaster.P \ ! .deps/java/awt/image/WritableRenderedImage.P \ ! .deps/java/awt/image/renderable/ContextualRenderedImageFactory.P \ ! .deps/java/awt/image/renderable/ParameterBlock.P \ ! .deps/java/awt/image/renderable/RenderContext.P \ ! .deps/java/awt/image/renderable/RenderableImage.P \ ! .deps/java/awt/image/renderable/RenderableImageOp.P \ ! .deps/java/awt/image/renderable/RenderableImageProducer.P \ ! .deps/java/awt/image/renderable/RenderedImageFactory.P \ ! .deps/java/awt/peer/ButtonPeer.P .deps/java/awt/peer/CanvasPeer.P \ .deps/java/awt/peer/CheckboxMenuItemPeer.P \ .deps/java/awt/peer/CheckboxPeer.P .deps/java/awt/peer/ChoicePeer.P \ .deps/java/awt/peer/ComponentPeer.P .deps/java/awt/peer/ContainerPeer.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2144,2153 **** .deps/java/awt/peer/ScrollbarPeer.P .deps/java/awt/peer/TextAreaPeer.P \ .deps/java/awt/peer/TextComponentPeer.P \ .deps/java/awt/peer/TextFieldPeer.P .deps/java/awt/peer/WindowPeer.P \ ! .deps/java/beans/AppletInitializer.P .deps/java/beans/BeanDescriptor.P \ ! .deps/java/beans/BeanInfo.P .deps/java/beans/Beans.P \ ! .deps/java/beans/Customizer.P .deps/java/beans/DesignMode.P \ ! .deps/java/beans/EventSetDescriptor.P \ .deps/java/beans/FeatureDescriptor.P \ .deps/java/beans/IndexedPropertyDescriptor.P \ .deps/java/beans/IntrospectionException.P \ --- 2919,2936 ---- .deps/java/awt/peer/ScrollbarPeer.P .deps/java/awt/peer/TextAreaPeer.P \ .deps/java/awt/peer/TextComponentPeer.P \ .deps/java/awt/peer/TextFieldPeer.P .deps/java/awt/peer/WindowPeer.P \ ! .deps/java/awt/print/Book.P .deps/java/awt/print/PageFormat.P \ ! .deps/java/awt/print/Pageable.P .deps/java/awt/print/Paper.P \ ! .deps/java/awt/print/Printable.P \ ! .deps/java/awt/print/PrinterAbortException.P \ ! .deps/java/awt/print/PrinterException.P \ ! .deps/java/awt/print/PrinterGraphics.P \ ! .deps/java/awt/print/PrinterIOException.P \ ! .deps/java/awt/print/PrinterJob.P .deps/java/beans/AppletInitializer.P \ ! .deps/java/beans/BeanDescriptor.P .deps/java/beans/BeanInfo.P \ ! .deps/java/beans/Beans.P .deps/java/beans/Customizer.P \ ! .deps/java/beans/DesignMode.P .deps/java/beans/EventSetDescriptor.P \ ! .deps/java/beans/ExceptionListener.P \ .deps/java/beans/FeatureDescriptor.P \ .deps/java/beans/IndexedPropertyDescriptor.P \ .deps/java/beans/IntrospectionException.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2155,2160 **** --- 2938,2944 ---- .deps/java/beans/ParameterDescriptor.P \ .deps/java/beans/PropertyChangeEvent.P \ .deps/java/beans/PropertyChangeListener.P \ + .deps/java/beans/PropertyChangeListenerProxy.P \ .deps/java/beans/PropertyChangeSupport.P \ .deps/java/beans/PropertyDescriptor.P .deps/java/beans/PropertyEditor.P \ .deps/java/beans/PropertyEditorManager.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2162,2167 **** --- 2946,2952 ---- .deps/java/beans/PropertyVetoException.P \ .deps/java/beans/SimpleBeanInfo.P \ .deps/java/beans/VetoableChangeListener.P \ + .deps/java/beans/VetoableChangeListenerProxy.P \ .deps/java/beans/VetoableChangeSupport.P .deps/java/beans/Visibility.P \ .deps/java/beans/beancontext/BeanContext.P \ .deps/java/beans/beancontext/BeanContextChild.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2220,2236 **** .deps/java/io/SyncFailedException.P \ .deps/java/io/UTFDataFormatException.P \ .deps/java/io/UnsupportedEncodingException.P \ .deps/java/io/WriteAbortedException.P .deps/java/io/Writer.P \ .deps/java/io/natFile.P .deps/java/io/natFileDescriptor.P \ .deps/java/io/natObjectInputStream.P \ ! .deps/java/io/natObjectOutputStream.P \ .deps/java/lang/AbstractMethodError.P \ .deps/java/lang/ArithmeticException.P \ .deps/java/lang/ArrayIndexOutOfBoundsException.P \ ! .deps/java/lang/ArrayStoreException.P .deps/java/lang/Boolean.P \ ! .deps/java/lang/Byte.P .deps/java/lang/CharSequence.P \ ! .deps/java/lang/Character.P .deps/java/lang/Class.P \ ! .deps/java/lang/ClassCastException.P \ .deps/java/lang/ClassCircularityError.P \ .deps/java/lang/ClassFormatError.P .deps/java/lang/ClassLoader.P \ .deps/java/lang/ClassNotFoundException.P \ --- 3005,3022 ---- .deps/java/io/SyncFailedException.P \ .deps/java/io/UTFDataFormatException.P \ .deps/java/io/UnsupportedEncodingException.P \ + .deps/java/io/VMObjectStreamClass.P \ .deps/java/io/WriteAbortedException.P .deps/java/io/Writer.P \ .deps/java/io/natFile.P .deps/java/io/natFileDescriptor.P \ .deps/java/io/natObjectInputStream.P \ ! .deps/java/io/natVMObjectStreamClass.P \ .deps/java/lang/AbstractMethodError.P \ .deps/java/lang/ArithmeticException.P \ .deps/java/lang/ArrayIndexOutOfBoundsException.P \ ! .deps/java/lang/ArrayStoreException.P .deps/java/lang/AssertionError.P \ ! .deps/java/lang/Boolean.P .deps/java/lang/Byte.P \ ! .deps/java/lang/CharSequence.P .deps/java/lang/Character.P \ ! .deps/java/lang/Class.P .deps/java/lang/ClassCastException.P \ .deps/java/lang/ClassCircularityError.P \ .deps/java/lang/ClassFormatError.P .deps/java/lang/ClassLoader.P \ .deps/java/lang/ClassNotFoundException.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2266,2272 **** .deps/java/lang/Runtime.P .deps/java/lang/RuntimeException.P \ .deps/java/lang/RuntimePermission.P .deps/java/lang/SecurityException.P \ .deps/java/lang/SecurityManager.P .deps/java/lang/Short.P \ ! .deps/java/lang/StackOverflowError.P .deps/java/lang/StrictMath.P \ .deps/java/lang/String.P .deps/java/lang/StringBuffer.P \ .deps/java/lang/StringIndexOutOfBoundsException.P \ .deps/java/lang/System.P .deps/java/lang/Thread.P \ --- 3052,3059 ---- .deps/java/lang/Runtime.P .deps/java/lang/RuntimeException.P \ .deps/java/lang/RuntimePermission.P .deps/java/lang/SecurityException.P \ .deps/java/lang/SecurityManager.P .deps/java/lang/Short.P \ ! .deps/java/lang/StackOverflowError.P \ ! .deps/java/lang/StackTraceElement.P .deps/java/lang/StrictMath.P \ .deps/java/lang/String.P .deps/java/lang/StringBuffer.P \ .deps/java/lang/StringIndexOutOfBoundsException.P \ .deps/java/lang/System.P .deps/java/lang/Thread.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2276,2283 **** .deps/java/lang/UnsupportedClassVersionError.P \ .deps/java/lang/UnsupportedOperationException.P \ .deps/java/lang/VMClassLoader.P .deps/java/lang/VMSecurityManager.P \ ! .deps/java/lang/VerifyError.P .deps/java/lang/VirtualMachineError.P \ ! .deps/java/lang/Void.P .deps/java/lang/dtoa.P .deps/java/lang/e_acos.P \ .deps/java/lang/e_asin.P .deps/java/lang/e_atan2.P \ .deps/java/lang/e_exp.P .deps/java/lang/e_fmod.P \ .deps/java/lang/e_log.P .deps/java/lang/e_pow.P \ --- 3063,3071 ---- .deps/java/lang/UnsupportedClassVersionError.P \ .deps/java/lang/UnsupportedOperationException.P \ .deps/java/lang/VMClassLoader.P .deps/java/lang/VMSecurityManager.P \ ! .deps/java/lang/VMThrowable.P .deps/java/lang/VerifyError.P \ ! .deps/java/lang/VirtualMachineError.P .deps/java/lang/Void.P \ ! .deps/java/lang/dtoa.P .deps/java/lang/e_acos.P \ .deps/java/lang/e_asin.P .deps/java/lang/e_atan2.P \ .deps/java/lang/e_exp.P .deps/java/lang/e_fmod.P \ .deps/java/lang/e_log.P .deps/java/lang/e_pow.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2291,2297 **** .deps/java/lang/natMath.P .deps/java/lang/natObject.P \ .deps/java/lang/natRuntime.P .deps/java/lang/natString.P \ .deps/java/lang/natStringBuffer.P .deps/java/lang/natSystem.P \ ! .deps/java/lang/natThread.P .deps/java/lang/natThrowable.P \ .deps/java/lang/ref/PhantomReference.P .deps/java/lang/ref/Reference.P \ .deps/java/lang/ref/ReferenceQueue.P \ .deps/java/lang/ref/SoftReference.P .deps/java/lang/ref/WeakReference.P \ --- 3079,3085 ---- .deps/java/lang/natMath.P .deps/java/lang/natObject.P \ .deps/java/lang/natRuntime.P .deps/java/lang/natString.P \ .deps/java/lang/natStringBuffer.P .deps/java/lang/natSystem.P \ ! .deps/java/lang/natThread.P .deps/java/lang/natVMSecurityManager.P \ .deps/java/lang/ref/PhantomReference.P .deps/java/lang/ref/Reference.P \ .deps/java/lang/ref/ReferenceQueue.P \ .deps/java/lang/ref/SoftReference.P .deps/java/lang/ref/WeakReference.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2299,2348 **** .deps/java/lang/reflect/AccessibleObject.P \ .deps/java/lang/reflect/Array.P .deps/java/lang/reflect/Constructor.P \ .deps/java/lang/reflect/Field.P \ .deps/java/lang/reflect/InvocationTargetException.P \ .deps/java/lang/reflect/Member.P .deps/java/lang/reflect/Method.P \ ! .deps/java/lang/reflect/Modifier.P \ .deps/java/lang/reflect/ReflectPermission.P \ .deps/java/lang/reflect/natArray.P \ .deps/java/lang/reflect/natConstructor.P \ .deps/java/lang/reflect/natField.P .deps/java/lang/reflect/natMethod.P \ ! .deps/java/lang/s_atan.P .deps/java/lang/s_ceil.P \ ! .deps/java/lang/s_copysign.P .deps/java/lang/s_cos.P \ ! .deps/java/lang/s_fabs.P .deps/java/lang/s_floor.P \ ! .deps/java/lang/s_rint.P .deps/java/lang/s_scalbn.P \ ! .deps/java/lang/s_sin.P .deps/java/lang/s_tan.P \ ! .deps/java/lang/sf_fabs.P .deps/java/lang/sf_rint.P \ ! .deps/java/lang/strtod.P .deps/java/lang/w_acos.P \ ! .deps/java/lang/w_asin.P .deps/java/lang/w_atan2.P \ ! .deps/java/lang/w_exp.P .deps/java/lang/w_fmod.P \ ! .deps/java/lang/w_log.P .deps/java/lang/w_pow.P \ ! .deps/java/lang/w_remainder.P .deps/java/lang/w_sqrt.P \ ! .deps/java/math/BigDecimal.P .deps/java/math/BigInteger.P \ ! .deps/java/net/Authenticator.P .deps/java/net/BindException.P \ ! .deps/java/net/ConnectException.P .deps/java/net/ContentHandler.P \ ! .deps/java/net/ContentHandlerFactory.P .deps/java/net/DatagramPacket.P \ ! .deps/java/net/DatagramSocket.P .deps/java/net/DatagramSocketImpl.P \ ! .deps/java/net/FileNameMap.P .deps/java/net/HttpURLConnection.P \ ! .deps/java/net/InetAddress.P .deps/java/net/JarURLConnection.P \ .deps/java/net/MalformedURLException.P .deps/java/net/MulticastSocket.P \ ! .deps/java/net/NetPermission.P .deps/java/net/NoRouteToHostException.P \ .deps/java/net/PasswordAuthentication.P \ .deps/java/net/PlainDatagramSocketImpl.P \ ! .deps/java/net/PlainSocketImpl.P .deps/java/net/ProtocolException.P \ ! .deps/java/net/ServerSocket.P .deps/java/net/Socket.P \ .deps/java/net/SocketException.P .deps/java/net/SocketImpl.P \ .deps/java/net/SocketImplFactory.P .deps/java/net/SocketOptions.P \ ! .deps/java/net/SocketPermission.P .deps/java/net/URL.P \ .deps/java/net/URLClassLoader.P .deps/java/net/URLConnection.P \ .deps/java/net/URLDecoder.P .deps/java/net/URLEncoder.P \ .deps/java/net/URLStreamHandler.P \ .deps/java/net/URLStreamHandlerFactory.P \ .deps/java/net/UnknownHostException.P \ .deps/java/net/UnknownServiceException.P \ ! .deps/java/net/natInetAddress.P \ .deps/java/net/natPlainDatagramSocketImpl.P \ ! .deps/java/net/natPlainSocketImpl.P .deps/java/rmi/AccessException.P \ ! .deps/java/rmi/AlreadyBoundException.P \ .deps/java/rmi/ConnectException.P .deps/java/rmi/ConnectIOException.P \ .deps/java/rmi/MarshalException.P .deps/java/rmi/MarshalledObject.P \ .deps/java/rmi/Naming.P .deps/java/rmi/NoSuchObjectException.P \ --- 3087,3204 ---- .deps/java/lang/reflect/AccessibleObject.P \ .deps/java/lang/reflect/Array.P .deps/java/lang/reflect/Constructor.P \ .deps/java/lang/reflect/Field.P \ + .deps/java/lang/reflect/InvocationHandler.P \ .deps/java/lang/reflect/InvocationTargetException.P \ .deps/java/lang/reflect/Member.P .deps/java/lang/reflect/Method.P \ ! .deps/java/lang/reflect/Modifier.P .deps/java/lang/reflect/Proxy.P \ .deps/java/lang/reflect/ReflectPermission.P \ + .deps/java/lang/reflect/UndeclaredThrowableException.P \ .deps/java/lang/reflect/natArray.P \ .deps/java/lang/reflect/natConstructor.P \ .deps/java/lang/reflect/natField.P .deps/java/lang/reflect/natMethod.P \ ! .deps/java/lang/reflect/natProxy.P .deps/java/lang/s_atan.P \ ! .deps/java/lang/s_ceil.P .deps/java/lang/s_copysign.P \ ! .deps/java/lang/s_cos.P .deps/java/lang/s_fabs.P \ ! .deps/java/lang/s_floor.P .deps/java/lang/s_rint.P \ ! .deps/java/lang/s_scalbn.P .deps/java/lang/s_sin.P \ ! .deps/java/lang/s_tan.P .deps/java/lang/sf_fabs.P \ ! .deps/java/lang/sf_rint.P .deps/java/lang/strtod.P \ ! .deps/java/lang/w_acos.P .deps/java/lang/w_asin.P \ ! .deps/java/lang/w_atan2.P .deps/java/lang/w_exp.P \ ! .deps/java/lang/w_fmod.P .deps/java/lang/w_log.P \ ! .deps/java/lang/w_pow.P .deps/java/lang/w_remainder.P \ ! .deps/java/lang/w_sqrt.P .deps/java/math/BigDecimal.P \ ! .deps/java/math/BigInteger.P .deps/java/net/Authenticator.P \ ! .deps/java/net/BindException.P .deps/java/net/ConnectException.P \ ! .deps/java/net/ContentHandler.P .deps/java/net/ContentHandlerFactory.P \ ! .deps/java/net/DatagramPacket.P .deps/java/net/DatagramSocket.P \ ! .deps/java/net/DatagramSocketImpl.P \ ! .deps/java/net/DatagramSocketImplFactory.P .deps/java/net/FileNameMap.P \ ! .deps/java/net/HttpURLConnection.P .deps/java/net/Inet4Address.P \ ! .deps/java/net/Inet6Address.P .deps/java/net/InetAddress.P \ ! .deps/java/net/InetSocketAddress.P .deps/java/net/JarURLConnection.P \ .deps/java/net/MalformedURLException.P .deps/java/net/MulticastSocket.P \ ! .deps/java/net/NetPermission.P .deps/java/net/NetworkInterface.P \ ! .deps/java/net/NoRouteToHostException.P \ .deps/java/net/PasswordAuthentication.P \ .deps/java/net/PlainDatagramSocketImpl.P \ ! .deps/java/net/PlainSocketImpl.P \ ! .deps/java/net/PortUnreachableException.P \ ! .deps/java/net/ProtocolException.P .deps/java/net/ServerSocket.P \ ! .deps/java/net/Socket.P .deps/java/net/SocketAddress.P \ .deps/java/net/SocketException.P .deps/java/net/SocketImpl.P \ .deps/java/net/SocketImplFactory.P .deps/java/net/SocketOptions.P \ ! .deps/java/net/SocketPermission.P \ ! .deps/java/net/SocketTimeoutException.P .deps/java/net/URI.P \ ! .deps/java/net/URISyntaxException.P .deps/java/net/URL.P \ .deps/java/net/URLClassLoader.P .deps/java/net/URLConnection.P \ .deps/java/net/URLDecoder.P .deps/java/net/URLEncoder.P \ .deps/java/net/URLStreamHandler.P \ .deps/java/net/URLStreamHandlerFactory.P \ .deps/java/net/UnknownHostException.P \ .deps/java/net/UnknownServiceException.P \ ! .deps/java/net/natInetAddress.P .deps/java/net/natNetworkInterface.P \ .deps/java/net/natPlainDatagramSocketImpl.P \ ! .deps/java/net/natPlainSocketImpl.P .deps/java/nio/Buffer.P \ ! .deps/java/nio/BufferOverflowException.P \ ! .deps/java/nio/BufferUnderflowException.P .deps/java/nio/ByteBuffer.P \ ! .deps/java/nio/ByteOrder.P .deps/java/nio/CharBuffer.P \ ! .deps/java/nio/DoubleBuffer.P .deps/java/nio/FloatBuffer.P \ ! .deps/java/nio/IntBuffer.P .deps/java/nio/InvalidMarkException.P \ ! .deps/java/nio/LongBuffer.P .deps/java/nio/MappedByteBuffer.P \ ! .deps/java/nio/ReadOnlyBufferException.P .deps/java/nio/ShortBuffer.P \ ! .deps/java/nio/channels/AlreadyConnectedException.P \ ! .deps/java/nio/channels/AsynchronousCloseException.P \ ! .deps/java/nio/channels/ByteChannel.P \ ! .deps/java/nio/channels/CancelledKeyException.P \ ! .deps/java/nio/channels/Channel.P .deps/java/nio/channels/Channels.P \ ! .deps/java/nio/channels/ClosedByInterruptException.P \ ! .deps/java/nio/channels/ClosedChannelException.P \ ! .deps/java/nio/channels/ClosedSelectorException.P \ ! .deps/java/nio/channels/ConnectionPendingException.P \ ! .deps/java/nio/channels/DatagramChannel.P \ ! .deps/java/nio/channels/FileChannel.P \ ! .deps/java/nio/channels/FileLock.P \ ! .deps/java/nio/channels/FileLockInterruptionException.P \ ! .deps/java/nio/channels/GatheringByteChannel.P \ ! .deps/java/nio/channels/IllegalBlockingModeException.P \ ! .deps/java/nio/channels/IllegalSelectorException.P \ ! .deps/java/nio/channels/InterruptibleChannel.P \ ! .deps/java/nio/channels/NoConnectionPendingException.P \ ! .deps/java/nio/channels/NonReadableChannelException.P \ ! .deps/java/nio/channels/NonWritableChannelException.P \ ! .deps/java/nio/channels/NotYetBoundException.P \ ! .deps/java/nio/channels/NotYetConnectedException.P \ ! .deps/java/nio/channels/OverlappingFileLockException.P \ ! .deps/java/nio/channels/Pipe.P \ ! .deps/java/nio/channels/ReadableByteChannel.P \ ! .deps/java/nio/channels/ScatteringByteChannel.P \ ! .deps/java/nio/channels/SelectableChannel.P \ ! .deps/java/nio/channels/SelectionKey.P \ ! .deps/java/nio/channels/Selector.P \ ! .deps/java/nio/channels/ServerSocketChannel.P \ ! .deps/java/nio/channels/SocketChannel.P \ ! .deps/java/nio/channels/UnresolvedAddressException.P \ ! .deps/java/nio/channels/UnsupportedAddressTypeException.P \ ! .deps/java/nio/channels/WritableByteChannel.P \ ! .deps/java/nio/channels/spi/AbstractInterruptibleChannel.P \ ! .deps/java/nio/channels/spi/AbstractSelectableChannel.P \ ! .deps/java/nio/channels/spi/AbstractSelectionKey.P \ ! .deps/java/nio/channels/spi/AbstractSelector.P \ ! .deps/java/nio/channels/spi/SelectorProvider.P \ ! .deps/java/nio/charset/CharacterCodingException.P \ ! .deps/java/nio/charset/Charset.P \ ! .deps/java/nio/charset/CharsetDecoder.P \ ! .deps/java/nio/charset/CharsetEncoder.P \ ! .deps/java/nio/charset/CoderMalfunctionError.P \ ! .deps/java/nio/charset/CoderResult.P \ ! .deps/java/nio/charset/CodingErrorAction.P \ ! .deps/java/nio/charset/IllegalCharsetNameException.P \ ! .deps/java/nio/charset/MalformedInputException.P \ ! .deps/java/nio/charset/UnmappableCharacterException.P \ ! .deps/java/nio/charset/UnsupportedCharsetException.P \ ! .deps/java/nio/charset/spi/CharsetProvider.P \ ! .deps/java/rmi/AccessException.P .deps/java/rmi/AlreadyBoundException.P \ .deps/java/rmi/ConnectException.P .deps/java/rmi/ConnectIOException.P \ .deps/java/rmi/MarshalException.P .deps/java/rmi/MarshalledObject.P \ .deps/java/rmi/Naming.P .deps/java/rmi/NoSuchObjectException.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2378,2383 **** --- 3234,3240 ---- .deps/java/rmi/server/LoaderHandler.P .deps/java/rmi/server/LogStream.P \ .deps/java/rmi/server/ObjID.P .deps/java/rmi/server/Operation.P \ .deps/java/rmi/server/RMIClassLoader.P \ + .deps/java/rmi/server/RMIClassLoaderSpi.P \ .deps/java/rmi/server/RMIClientSocketFactory.P \ .deps/java/rmi/server/RMIFailureHandler.P \ .deps/java/rmi/server/RMIServerSocketFactory.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2451,2456 **** --- 3308,3317 ---- .deps/java/security/acl/NotOwnerException.P \ .deps/java/security/acl/Owner.P .deps/java/security/acl/Permission.P \ .deps/java/security/cert/CRL.P .deps/java/security/cert/CRLException.P \ + .deps/java/security/cert/CertPath.P \ + .deps/java/security/cert/CertPathBuilderException.P \ + .deps/java/security/cert/CertPathValidatorException.P \ + .deps/java/security/cert/CertStoreException.P \ .deps/java/security/cert/Certificate.P \ .deps/java/security/cert/CertificateEncodingException.P \ .deps/java/security/cert/CertificateException.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2491,2503 **** .deps/java/sql/Connection.P .deps/java/sql/DataTruncation.P \ .deps/java/sql/DatabaseMetaData.P .deps/java/sql/Date.P \ .deps/java/sql/Driver.P .deps/java/sql/DriverManager.P \ ! .deps/java/sql/DriverPropertyInfo.P .deps/java/sql/PreparedStatement.P \ ! .deps/java/sql/Ref.P .deps/java/sql/ResultSet.P \ ! .deps/java/sql/ResultSetMetaData.P .deps/java/sql/SQLData.P \ ! .deps/java/sql/SQLException.P .deps/java/sql/SQLInput.P \ ! .deps/java/sql/SQLOutput.P .deps/java/sql/SQLWarning.P \ ! .deps/java/sql/Statement.P .deps/java/sql/Struct.P \ ! .deps/java/sql/Time.P .deps/java/sql/Timestamp.P .deps/java/sql/Types.P \ .deps/java/text/Annotation.P \ .deps/java/text/AttributedCharacterIterator.P \ .deps/java/text/AttributedString.P \ --- 3352,3366 ---- .deps/java/sql/Connection.P .deps/java/sql/DataTruncation.P \ .deps/java/sql/DatabaseMetaData.P .deps/java/sql/Date.P \ .deps/java/sql/Driver.P .deps/java/sql/DriverManager.P \ ! .deps/java/sql/DriverPropertyInfo.P .deps/java/sql/ParameterMetaData.P \ ! .deps/java/sql/PreparedStatement.P .deps/java/sql/Ref.P \ ! .deps/java/sql/ResultSet.P .deps/java/sql/ResultSetMetaData.P \ ! .deps/java/sql/SQLData.P .deps/java/sql/SQLException.P \ ! .deps/java/sql/SQLInput.P .deps/java/sql/SQLOutput.P \ ! .deps/java/sql/SQLPermission.P .deps/java/sql/SQLWarning.P \ ! .deps/java/sql/Savepoint.P .deps/java/sql/Statement.P \ ! .deps/java/sql/Struct.P .deps/java/sql/Time.P \ ! .deps/java/sql/Timestamp.P .deps/java/sql/Types.P \ .deps/java/text/Annotation.P \ .deps/java/text/AttributedCharacterIterator.P \ .deps/java/text/AttributedString.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2516,2540 **** .deps/java/util/AbstractCollection.P .deps/java/util/AbstractList.P \ .deps/java/util/AbstractMap.P .deps/java/util/AbstractSequentialList.P \ .deps/java/util/AbstractSet.P .deps/java/util/ArrayList.P \ ! .deps/java/util/Arrays.P .deps/java/util/BasicMapEntry.P \ ! .deps/java/util/BitSet.P .deps/java/util/Calendar.P \ ! .deps/java/util/Collection.P .deps/java/util/Collections.P \ ! .deps/java/util/Comparator.P \ .deps/java/util/ConcurrentModificationException.P \ .deps/java/util/Date.P .deps/java/util/Dictionary.P \ .deps/java/util/EmptyStackException.P .deps/java/util/Enumeration.P \ ! .deps/java/util/EventListener.P .deps/java/util/EventObject.P \ ! .deps/java/util/GregorianCalendar.P .deps/java/util/HashMap.P \ ! .deps/java/util/HashSet.P .deps/java/util/Hashtable.P \ ! .deps/java/util/IdentityHashMap.P .deps/java/util/Iterator.P \ ! .deps/java/util/LinkedHashMap.P .deps/java/util/LinkedHashSet.P \ ! .deps/java/util/LinkedList.P .deps/java/util/List.P \ ! .deps/java/util/ListIterator.P .deps/java/util/ListResourceBundle.P \ ! .deps/java/util/Locale.P .deps/java/util/Map.P \ ! .deps/java/util/MissingResourceException.P \ .deps/java/util/NoSuchElementException.P .deps/java/util/Observable.P \ .deps/java/util/Observer.P .deps/java/util/Properties.P \ .deps/java/util/PropertyPermission.P \ .deps/java/util/PropertyResourceBundle.P .deps/java/util/Random.P \ .deps/java/util/RandomAccess.P .deps/java/util/ResourceBundle.P \ .deps/java/util/Set.P .deps/java/util/SimpleTimeZone.P \ --- 3379,3403 ---- .deps/java/util/AbstractCollection.P .deps/java/util/AbstractList.P \ .deps/java/util/AbstractMap.P .deps/java/util/AbstractSequentialList.P \ .deps/java/util/AbstractSet.P .deps/java/util/ArrayList.P \ ! .deps/java/util/Arrays.P .deps/java/util/BitSet.P \ ! .deps/java/util/Calendar.P .deps/java/util/Collection.P \ ! .deps/java/util/Collections.P .deps/java/util/Comparator.P \ .deps/java/util/ConcurrentModificationException.P \ .deps/java/util/Date.P .deps/java/util/Dictionary.P \ .deps/java/util/EmptyStackException.P .deps/java/util/Enumeration.P \ ! .deps/java/util/EventListener.P .deps/java/util/EventListenerProxy.P \ ! .deps/java/util/EventObject.P .deps/java/util/GregorianCalendar.P \ ! .deps/java/util/HashMap.P .deps/java/util/HashSet.P \ ! .deps/java/util/Hashtable.P .deps/java/util/IdentityHashMap.P \ ! .deps/java/util/Iterator.P .deps/java/util/LinkedHashMap.P \ ! .deps/java/util/LinkedHashSet.P .deps/java/util/LinkedList.P \ ! .deps/java/util/List.P .deps/java/util/ListIterator.P \ ! .deps/java/util/ListResourceBundle.P .deps/java/util/Locale.P \ ! .deps/java/util/Map.P .deps/java/util/MissingResourceException.P \ .deps/java/util/NoSuchElementException.P .deps/java/util/Observable.P \ .deps/java/util/Observer.P .deps/java/util/Properties.P \ .deps/java/util/PropertyPermission.P \ + .deps/java/util/PropertyPermissionCollection.P \ .deps/java/util/PropertyResourceBundle.P .deps/java/util/Random.P \ .deps/java/util/RandomAccess.P .deps/java/util/ResourceBundle.P \ .deps/java/util/Set.P .deps/java/util/SimpleTimeZone.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2548,2553 **** --- 3411,3419 ---- .deps/java/util/jar/JarException.P .deps/java/util/jar/JarFile.P \ .deps/java/util/jar/JarInputStream.P \ .deps/java/util/jar/JarOutputStream.P .deps/java/util/jar/Manifest.P \ + .deps/java/util/natResourceBundle.P .deps/java/util/natTimeZone.P \ + .deps/java/util/regex/Matcher.P .deps/java/util/regex/Pattern.P \ + .deps/java/util/regex/PatternSyntaxException.P \ .deps/java/util/zip/Adler32.P .deps/java/util/zip/CRC32.P \ .deps/java/util/zip/CheckedInputStream.P \ .deps/java/util/zip/CheckedOutputStream.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2563,2568 **** --- 3429,3457 ---- .deps/java/util/zip/ZipInputStream.P \ .deps/java/util/zip/ZipOutputStream.P .deps/java/util/zip/natDeflater.P \ .deps/java/util/zip/natInflater.P \ + .deps/javax/accessibility/Accessible.P \ + .deps/javax/accessibility/AccessibleAction.P \ + .deps/javax/accessibility/AccessibleBundle.P \ + .deps/javax/accessibility/AccessibleComponent.P \ + .deps/javax/accessibility/AccessibleContext.P \ + .deps/javax/accessibility/AccessibleEditableText.P \ + .deps/javax/accessibility/AccessibleExtendedComponent.P \ + .deps/javax/accessibility/AccessibleExtendedTable.P \ + .deps/javax/accessibility/AccessibleHyperlink.P \ + .deps/javax/accessibility/AccessibleHypertext.P \ + .deps/javax/accessibility/AccessibleIcon.P \ + .deps/javax/accessibility/AccessibleKeyBinding.P \ + .deps/javax/accessibility/AccessibleRelation.P \ + .deps/javax/accessibility/AccessibleRelationSet.P \ + .deps/javax/accessibility/AccessibleResourceBundle.P \ + .deps/javax/accessibility/AccessibleRole.P \ + .deps/javax/accessibility/AccessibleSelection.P \ + .deps/javax/accessibility/AccessibleState.P \ + .deps/javax/accessibility/AccessibleStateSet.P \ + .deps/javax/accessibility/AccessibleTable.P \ + .deps/javax/accessibility/AccessibleTableModelChange.P \ + .deps/javax/accessibility/AccessibleText.P \ + .deps/javax/accessibility/AccessibleValue.P \ .deps/javax/naming/AuthenticationException.P \ .deps/javax/naming/AuthenticationNotSupportedException.P \ .deps/javax/naming/BinaryRefAddr.P .deps/javax/naming/Binding.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2644,2649 **** --- 3533,3775 ---- .deps/javax/naming/spi/ObjectFactoryBuilder.P \ .deps/javax/naming/spi/ResolveResult.P \ .deps/javax/naming/spi/Resolver.P .deps/javax/naming/spi/StateFactory.P \ + .deps/javax/sql/ConnectionEvent.P \ + .deps/javax/sql/ConnectionEventListener.P \ + .deps/javax/sql/ConnectionPoolDataSource.P .deps/javax/sql/DataSource.P \ + .deps/javax/sql/PooledConnection.P .deps/javax/sql/RowSet.P \ + .deps/javax/sql/RowSetEvent.P .deps/javax/sql/RowSetInternal.P \ + .deps/javax/sql/RowSetListener.P .deps/javax/sql/RowSetMetaData.P \ + .deps/javax/sql/RowSetReader.P .deps/javax/sql/RowSetWriter.P \ + .deps/javax/sql/XAConnection.P .deps/javax/sql/XADataSource.P \ + .deps/javax/swing/AbstractAction.P .deps/javax/swing/AbstractButton.P \ + .deps/javax/swing/AbstractCellEditor.P \ + .deps/javax/swing/AbstractListModel.P .deps/javax/swing/AbstractSet.P \ + .deps/javax/swing/Action.P .deps/javax/swing/ActionMap.P \ + .deps/javax/swing/BorderFactory.P .deps/javax/swing/BoundedRangeModel.P \ + .deps/javax/swing/Box.P .deps/javax/swing/BoxLayout.P \ + .deps/javax/swing/ButtonGroup.P .deps/javax/swing/ButtonModel.P \ + .deps/javax/swing/CellEditor.P .deps/javax/swing/CellRendererPane.P \ + .deps/javax/swing/ComboBoxEditor.P .deps/javax/swing/ComboBoxModel.P \ + .deps/javax/swing/ComponentInputMap.P .deps/javax/swing/DebugGraphics.P \ + .deps/javax/swing/DefaultBoundedRangeModel.P \ + .deps/javax/swing/DefaultButtonModel.P \ + .deps/javax/swing/DefaultCellEditor.P \ + .deps/javax/swing/DefaultCellRenderer.P \ + .deps/javax/swing/DefaultComboBoxModel.P \ + .deps/javax/swing/DefaultDesktopManager.P \ + .deps/javax/swing/DefaultFocusManager.P \ + .deps/javax/swing/DefaultListCellRenderer.P \ + .deps/javax/swing/DefaultListModel.P \ + .deps/javax/swing/DefaultListSelectionModel.P \ + .deps/javax/swing/DefaultSingleSelectionModel.P \ + .deps/javax/swing/DesktopManager.P .deps/javax/swing/FocusManager.P \ + .deps/javax/swing/GrayFilter.P .deps/javax/swing/Icon.P \ + .deps/javax/swing/ImageIcon.P .deps/javax/swing/InputMap.P \ + .deps/javax/swing/InputVerifier.P .deps/javax/swing/JApplet.P \ + .deps/javax/swing/JButton.P .deps/javax/swing/JCheckBox.P \ + .deps/javax/swing/JCheckBoxMenuItem.P .deps/javax/swing/JColorChooser.P \ + .deps/javax/swing/JComboBox.P .deps/javax/swing/JComponent.P \ + .deps/javax/swing/JDesktopPane.P .deps/javax/swing/JDialog.P \ + .deps/javax/swing/JEditorPane.P .deps/javax/swing/JFileChooser.P \ + .deps/javax/swing/JFrame.P .deps/javax/swing/JInternalFrame.P \ + .deps/javax/swing/JLabel.P .deps/javax/swing/JLayeredPane.P \ + .deps/javax/swing/JList.P .deps/javax/swing/JMenu.P \ + .deps/javax/swing/JMenuBar.P .deps/javax/swing/JMenuItem.P \ + .deps/javax/swing/JOptionPane.P .deps/javax/swing/JPanel.P \ + .deps/javax/swing/JPasswordField.P .deps/javax/swing/JPopupMenu.P \ + .deps/javax/swing/JProgressBar.P .deps/javax/swing/JRadioButton.P \ + .deps/javax/swing/JRadioButtonMenuItem.P .deps/javax/swing/JRootPane.P \ + .deps/javax/swing/JScrollBar.P .deps/javax/swing/JScrollPane.P \ + .deps/javax/swing/JSeparator.P .deps/javax/swing/JSlider.P \ + .deps/javax/swing/JSplitPane.P .deps/javax/swing/JTabbedPane.P \ + .deps/javax/swing/JTable.P .deps/javax/swing/JTextField.P \ + .deps/javax/swing/JTextPane.P .deps/javax/swing/JToggleButton.P \ + .deps/javax/swing/JToolBar.P .deps/javax/swing/JToolTip.P \ + .deps/javax/swing/JTree.P .deps/javax/swing/JViewport.P \ + .deps/javax/swing/JWindow.P .deps/javax/swing/KeyStroke.P \ + .deps/javax/swing/ListCellRenderer.P .deps/javax/swing/ListModel.P \ + .deps/javax/swing/ListSelectionModel.P .deps/javax/swing/LookAndFeel.P \ + .deps/javax/swing/MenuElement.P \ + .deps/javax/swing/MenuSelectionManager.P \ + .deps/javax/swing/MutableComboBoxModel.P \ + .deps/javax/swing/OverlayLayout.P .deps/javax/swing/ProgressMonitor.P \ + .deps/javax/swing/ProgressMonitorInputStream.P \ + .deps/javax/swing/Renderer.P .deps/javax/swing/RepaintManager.P \ + .deps/javax/swing/RootPaneContainer.P \ + .deps/javax/swing/ScrollPaneConstants.P \ + .deps/javax/swing/ScrollPaneLayout.P .deps/javax/swing/Scrollable.P \ + .deps/javax/swing/SingleSelectionModel.P \ + .deps/javax/swing/SizeRequirements.P .deps/javax/swing/SizeSequence.P \ + .deps/javax/swing/SwingConstants.P .deps/javax/swing/SwingUtilities.P \ + .deps/javax/swing/Timer.P .deps/javax/swing/ToggleButtonModel.P \ + .deps/javax/swing/ToolTipManager.P .deps/javax/swing/UIDefaults.P \ + .deps/javax/swing/UIManager.P \ + .deps/javax/swing/UnsupportedLookAndFeelException.P \ + .deps/javax/swing/ViewportLayout.P .deps/javax/swing/WindowConstants.P \ + .deps/javax/swing/border/AbstractBorder.P \ + .deps/javax/swing/border/BevelBorder.P \ + .deps/javax/swing/border/Border.P \ + .deps/javax/swing/border/CompoundBorder.P \ + .deps/javax/swing/border/EmptyBorder.P \ + .deps/javax/swing/border/EtchedBorder.P \ + .deps/javax/swing/border/LineBorder.P \ + .deps/javax/swing/border/MatteBorder.P \ + .deps/javax/swing/border/TitledBorder.P \ + .deps/javax/swing/colorchooser/AbstractColorChooserPanel.P \ + .deps/javax/swing/colorchooser/ColorChooserComponentFactory.P \ + .deps/javax/swing/colorchooser/ColorSelectionModel.P \ + .deps/javax/swing/colorchooser/DefaultColorSelectionModel.P \ + .deps/javax/swing/event/AncestorEvent.P \ + .deps/javax/swing/event/AncestorListener.P \ + .deps/javax/swing/event/CaretEvent.P \ + .deps/javax/swing/event/CaretListener.P \ + .deps/javax/swing/event/CellEditorListener.P \ + .deps/javax/swing/event/ChangeEvent.P \ + .deps/javax/swing/event/ChangeListener.P \ + .deps/javax/swing/event/DocumentEvent.P \ + .deps/javax/swing/event/DocumentListener.P \ + .deps/javax/swing/event/EventListenerList.P \ + .deps/javax/swing/event/HyperlinkEvent.P \ + .deps/javax/swing/event/HyperlinkListener.P \ + .deps/javax/swing/event/InternalFrameAdapter.P \ + .deps/javax/swing/event/InternalFrameEvent.P \ + .deps/javax/swing/event/InternalFrameListener.P \ + .deps/javax/swing/event/ListDataEvent.P \ + .deps/javax/swing/event/ListDataListener.P \ + .deps/javax/swing/event/ListSelectionEvent.P \ + .deps/javax/swing/event/ListSelectionListener.P \ + .deps/javax/swing/event/MenuDragMouseEvent.P \ + .deps/javax/swing/event/MenuDragMouseListener.P \ + .deps/javax/swing/event/MenuEvent.P \ + .deps/javax/swing/event/MenuKeyEvent.P \ + .deps/javax/swing/event/MenuKeyListener.P \ + .deps/javax/swing/event/MenuListener.P \ + .deps/javax/swing/event/MouseInputAdapter.P \ + .deps/javax/swing/event/MouseInputListener.P \ + .deps/javax/swing/event/PopupMenuEvent.P \ + .deps/javax/swing/event/PopupMenuListener.P \ + .deps/javax/swing/event/SwingPropertyChangeSupport.P \ + .deps/javax/swing/event/TableColumnModelEvent.P \ + .deps/javax/swing/event/TableColumnModelListener.P \ + .deps/javax/swing/event/TableModelEvent.P \ + .deps/javax/swing/event/TableModelListener.P \ + .deps/javax/swing/event/TreeExpansionEvent.P \ + .deps/javax/swing/event/TreeExpansionListener.P \ + .deps/javax/swing/event/TreeModelEvent.P \ + .deps/javax/swing/event/TreeModelListener.P \ + .deps/javax/swing/event/TreeSelectionEvent.P \ + .deps/javax/swing/event/TreeSelectionListener.P \ + .deps/javax/swing/event/TreeWillExpandListener.P \ + .deps/javax/swing/event/UndoableEditEvent.P \ + .deps/javax/swing/event/UndoableEditListener.P \ + .deps/javax/swing/filechooser/FileFilter.P \ + .deps/javax/swing/filechooser/FileSystemView.P \ + .deps/javax/swing/filechooser/FileView.P \ + .deps/javax/swing/plaf/ActionMapUIResource.P \ + .deps/javax/swing/plaf/BorderUIResource.P \ + .deps/javax/swing/plaf/ButtonUI.P \ + .deps/javax/swing/plaf/ColorChooserUI.P \ + .deps/javax/swing/plaf/ColorUIResource.P \ + .deps/javax/swing/plaf/ComboBoxUI.P \ + .deps/javax/swing/plaf/ComponentInputMapUIResource.P \ + .deps/javax/swing/plaf/ComponentUI.P \ + .deps/javax/swing/plaf/DesktopIconUI.P \ + .deps/javax/swing/plaf/DesktopPaneUI.P \ + .deps/javax/swing/plaf/DimensionUIResource.P \ + .deps/javax/swing/plaf/FileChooserUI.P \ + .deps/javax/swing/plaf/FontUIResource.P \ + .deps/javax/swing/plaf/IconUIResource.P \ + .deps/javax/swing/plaf/InputMapUIResource.P \ + .deps/javax/swing/plaf/InsetsUIResource.P \ + .deps/javax/swing/plaf/InternalFrameUI.P \ + .deps/javax/swing/plaf/LabelUI.P .deps/javax/swing/plaf/ListUI.P \ + .deps/javax/swing/plaf/MenuBarUI.P .deps/javax/swing/plaf/MenuItemUI.P \ + .deps/javax/swing/plaf/OptionPaneUI.P .deps/javax/swing/plaf/PanelUI.P \ + .deps/javax/swing/plaf/PopupMenuUI.P \ + .deps/javax/swing/plaf/ProgressBarUI.P \ + .deps/javax/swing/plaf/RootPaneUI.P \ + .deps/javax/swing/plaf/ScrollBarUI.P \ + .deps/javax/swing/plaf/ScrollPaneUI.P \ + .deps/javax/swing/plaf/SeparatorUI.P .deps/javax/swing/plaf/SliderUI.P \ + .deps/javax/swing/plaf/SplitPaneUI.P \ + .deps/javax/swing/plaf/TabbedPaneUI.P \ + .deps/javax/swing/plaf/TableHeaderUI.P .deps/javax/swing/plaf/TableUI.P \ + .deps/javax/swing/plaf/TextUI.P .deps/javax/swing/plaf/ToolBarUI.P \ + .deps/javax/swing/plaf/ToolTipUI.P .deps/javax/swing/plaf/TreeUI.P \ + .deps/javax/swing/plaf/UIResource.P .deps/javax/swing/plaf/ViewportUI.P \ + .deps/javax/swing/plaf/basic/BasicBorders.P \ + .deps/javax/swing/plaf/basic/BasicButtonUI.P \ + .deps/javax/swing/plaf/basic/BasicCheckBoxUI.P \ + .deps/javax/swing/plaf/basic/BasicDefaults.P \ + .deps/javax/swing/plaf/basic/BasicGraphicsUtils.P \ + .deps/javax/swing/plaf/basic/BasicIconFactory.P \ + .deps/javax/swing/plaf/basic/BasicLabelUI.P \ + .deps/javax/swing/plaf/basic/BasicListUI.P \ + .deps/javax/swing/plaf/basic/BasicLookAndFeel.P \ + .deps/javax/swing/plaf/basic/BasicOptionPaneUI.P \ + .deps/javax/swing/plaf/basic/BasicPanelUI.P \ + .deps/javax/swing/plaf/basic/BasicRadioButtonUI.P \ + .deps/javax/swing/plaf/basic/BasicScrollPaneUI.P \ + .deps/javax/swing/plaf/basic/BasicTabbedPaneUI.P \ + .deps/javax/swing/plaf/basic/BasicTextUI.P \ + .deps/javax/swing/plaf/basic/BasicToggleButtonUI.P \ + .deps/javax/swing/plaf/basic/BasicTreeUI.P \ + .deps/javax/swing/plaf/basic/BasicViewportUI.P \ + .deps/javax/swing/plaf/metal/MetalLookAndFeel.P \ + .deps/javax/swing/table/AbstractTableModel.P \ + .deps/javax/swing/table/DefaultTableCellRenderer.P \ + .deps/javax/swing/table/DefaultTableColumnModel.P \ + .deps/javax/swing/table/DefaultTableModel.P \ + .deps/javax/swing/table/TableCellEditor.P \ + .deps/javax/swing/table/TableCellRenderer.P \ + .deps/javax/swing/table/TableColumn.P \ + .deps/javax/swing/table/TableColumnModel.P \ + .deps/javax/swing/table/TableModel.P \ + .deps/javax/swing/text/AbstractDocument.P \ + .deps/javax/swing/text/AttributeSet.P \ + .deps/javax/swing/text/BadLocationException.P \ + .deps/javax/swing/text/Caret.P \ + .deps/javax/swing/text/CharacterIterator.P \ + .deps/javax/swing/text/ComponentView.P \ + .deps/javax/swing/text/DefaultCaret.P \ + .deps/javax/swing/text/DefaultEditorKit.P \ + .deps/javax/swing/text/Document.P .deps/javax/swing/text/EditorKit.P \ + .deps/javax/swing/text/Element.P .deps/javax/swing/text/GapContent.P \ + .deps/javax/swing/text/JTextComponent.P .deps/javax/swing/text/Keymap.P \ + .deps/javax/swing/text/MutableAttributeSet.P \ + .deps/javax/swing/text/PlainDocument.P \ + .deps/javax/swing/text/PlainEditorKit.P \ + .deps/javax/swing/text/Position.P .deps/javax/swing/text/Segment.P \ + .deps/javax/swing/text/Style.P .deps/javax/swing/text/StyledDocument.P \ + .deps/javax/swing/text/StyledEditorKit.P \ + .deps/javax/swing/text/TextAction.P .deps/javax/swing/text/View.P \ + .deps/javax/swing/text/ViewFactory.P .deps/javax/swing/text/html/HTML.P \ + .deps/javax/swing/text/html/parser/ParserDelegator.P \ + .deps/javax/swing/tree/AbstractLayoutCache.P \ + .deps/javax/swing/tree/DefaultMutableTreeNode.P \ + .deps/javax/swing/tree/DefaultTreeCellEditor.P \ + .deps/javax/swing/tree/DefaultTreeCellRenderer.P \ + .deps/javax/swing/tree/DefaultTreeModel.P \ + .deps/javax/swing/tree/DefaultTreeSelectionModel.P \ + .deps/javax/swing/tree/ExpandVetoException.P \ + .deps/javax/swing/tree/FixedHeightLayoutCache.P \ + .deps/javax/swing/tree/MutableTreeNode.P \ + .deps/javax/swing/tree/RowMapper.P \ + .deps/javax/swing/tree/TreeCellEditor.P \ + .deps/javax/swing/tree/TreeCellRenderer.P \ + .deps/javax/swing/tree/TreeModel.P .deps/javax/swing/tree/TreeNode.P \ + .deps/javax/swing/tree/TreePath.P \ + .deps/javax/swing/tree/TreeSelectionModel.P \ + .deps/javax/swing/tree/VariableHeightLayoutCache.P \ + .deps/javax/swing/undo/AbstractUndoableEdit.P \ + .deps/javax/swing/undo/CannotRedoException.P \ + .deps/javax/swing/undo/CannotUndoException.P \ + .deps/javax/swing/undo/CompoundEdit.P \ + .deps/javax/swing/undo/StateEdit.P \ + .deps/javax/swing/undo/StateEditable.P \ + .deps/javax/swing/undo/UndoManager.P \ + .deps/javax/swing/undo/UndoableEdit.P \ + .deps/javax/swing/undo/UndoableEditSupport.P \ .deps/javax/transaction/HeuristicCommitException.P \ .deps/javax/transaction/HeuristicMixedException.P \ .deps/javax/transaction/HeuristicRollbackException.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2660,2676 **** .deps/javax/transaction/UserTransaction.P \ .deps/javax/transaction/xa/XAException.P \ .deps/javax/transaction/xa/XAResource.P \ ! .deps/javax/transaction/xa/Xid.P .deps/jni.P .deps/name-finder.P \ ! .deps/no-threads.P .deps/nogc.P .deps/org/w3c/dom/Attr.P \ ! .deps/org/w3c/dom/CDATASection.P .deps/org/w3c/dom/CharacterData.P \ ! .deps/org/w3c/dom/Comment.P .deps/org/w3c/dom/DOMException.P \ ! .deps/org/w3c/dom/DOMImplementation.P .deps/org/w3c/dom/Document.P \ ! .deps/org/w3c/dom/DocumentFragment.P .deps/org/w3c/dom/DocumentType.P \ ! .deps/org/w3c/dom/Element.P .deps/org/w3c/dom/Entity.P \ ! .deps/org/w3c/dom/EntityReference.P .deps/org/w3c/dom/NamedNodeMap.P \ ! .deps/org/w3c/dom/Node.P .deps/org/w3c/dom/NodeList.P \ ! .deps/org/w3c/dom/Notation.P .deps/org/w3c/dom/ProcessingInstruction.P \ ! .deps/org/w3c/dom/Text.P .deps/org/w3c/dom/ranges/DocumentRange.P \ .deps/org/w3c/dom/ranges/Range.P \ .deps/org/w3c/dom/ranges/RangeException.P \ .deps/org/w3c/dom/traversal/DocumentTraversal.P \ --- 3786,3802 ---- .deps/javax/transaction/UserTransaction.P \ .deps/javax/transaction/xa/XAException.P \ .deps/javax/transaction/xa/XAResource.P \ ! .deps/javax/transaction/xa/Xid.P .deps/jni.P .deps/no-threads.P \ ! .deps/nogc.P .deps/org/w3c/dom/Attr.P .deps/org/w3c/dom/CDATASection.P \ ! .deps/org/w3c/dom/CharacterData.P .deps/org/w3c/dom/Comment.P \ ! .deps/org/w3c/dom/DOMException.P .deps/org/w3c/dom/DOMImplementation.P \ ! .deps/org/w3c/dom/Document.P .deps/org/w3c/dom/DocumentFragment.P \ ! .deps/org/w3c/dom/DocumentType.P .deps/org/w3c/dom/Element.P \ ! .deps/org/w3c/dom/Entity.P .deps/org/w3c/dom/EntityReference.P \ ! .deps/org/w3c/dom/NamedNodeMap.P .deps/org/w3c/dom/Node.P \ ! .deps/org/w3c/dom/NodeList.P .deps/org/w3c/dom/Notation.P \ ! .deps/org/w3c/dom/ProcessingInstruction.P .deps/org/w3c/dom/Text.P \ ! .deps/org/w3c/dom/ranges/DocumentRange.P \ .deps/org/w3c/dom/ranges/Range.P \ .deps/org/w3c/dom/ranges/RangeException.P \ .deps/org/w3c/dom/traversal/DocumentTraversal.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2693,2698 **** --- 3819,3825 ---- .deps/org/xml/sax/helpers/DefaultHandler.P \ .deps/org/xml/sax/helpers/LocatorImpl.P \ .deps/org/xml/sax/helpers/NamespaceSupport.P \ + .deps/org/xml/sax/helpers/NewInstance.P \ .deps/org/xml/sax/helpers/ParserAdapter.P \ .deps/org/xml/sax/helpers/ParserFactory.P \ .deps/org/xml/sax/helpers/XMLFilterImpl.P \ *************** DEP_FILES = .deps/$(srcdir)/$(CONVERT_D *** 2700,2707 **** .deps/org/xml/sax/helpers/XMLReaderFactory.P .deps/posix-threads.P \ .deps/posix.P .deps/prims.P .deps/resolve.P .deps/verify.P \ .deps/win32-threads.P .deps/win32.P ! SOURCES = $(libgcj_la_SOURCES) $(EXTRA_libgcj_la_SOURCES) $(libgcjx_la_SOURCES) $(EXTRA_libgcjx_la_SOURCES) $(jv_convert_SOURCES) $(EXTRA_jv_convert_SOURCES) $(gij_SOURCES) $(rmic_SOURCES) $(EXTRA_rmic_SOURCES) $(rmiregistry_SOURCES) $(EXTRA_rmiregistry_SOURCES) $(gen_from_JIS_SOURCES) $(EXTRA_gen_from_JIS_SOURCES) ! OBJECTS = $(libgcj_la_OBJECTS) $(libgcjx_la_OBJECTS) $(jv_convert_OBJECTS) $(gij_OBJECTS) $(rmic_OBJECTS) $(rmiregistry_OBJECTS) $(gen_from_JIS_OBJECTS) all: all-redirect .SUFFIXES: --- 3827,3834 ---- .deps/org/xml/sax/helpers/XMLReaderFactory.P .deps/posix-threads.P \ .deps/posix.P .deps/prims.P .deps/resolve.P .deps/verify.P \ .deps/win32-threads.P .deps/win32.P ! SOURCES = $(libgcj_la_SOURCES) $(EXTRA_libgcj_la_SOURCES) $(lib_org_xml_sax_la_SOURCES) $(lib_org_w3c_dom_la_SOURCES) $(lib_gnu_awt_xlib_la_SOURCES) $(EXTRA_lib_gnu_awt_xlib_la_SOURCES) $(jv_convert_SOURCES) $(EXTRA_jv_convert_SOURCES) $(gij_SOURCES) $(rmic_SOURCES) $(EXTRA_rmic_SOURCES) $(rmiregistry_SOURCES) $(EXTRA_rmiregistry_SOURCES) $(gen_from_JIS_SOURCES) $(EXTRA_gen_from_JIS_SOURCES) ! OBJECTS = $(libgcj_la_OBJECTS) $(lib_org_xml_sax_la_OBJECTS) $(lib_org_w3c_dom_la_OBJECTS) $(lib_gnu_awt_xlib_la_OBJECTS) $(jv_convert_OBJECTS) $(gij_OBJECTS) $(rmic_OBJECTS) $(rmiregistry_OBJECTS) $(gen_from_JIS_OBJECTS) all: all-redirect .SUFFIXES: *************** config.status: $(srcdir)/configure $(CON *** 2720,2772 **** $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) - - include/config.h: include/stamp-h1 - @if test ! -f $@; then \ - rm -f include/stamp-h1; \ - $(MAKE) include/stamp-h1; \ - else :; fi - include/stamp-h1: $(srcdir)/include/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=include/config.h \ - $(SHELL) ./config.status - @echo timestamp > include/stamp-h1 2> /dev/null - $(srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/include/stamp-h1.in - @if test ! -f $@; then \ - rm -f $(srcdir)/include/stamp-h1.in; \ - $(MAKE) $(srcdir)/include/stamp-h1.in; \ - else :; fi - $(srcdir)/include/stamp-h1.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/include/stamp-h1.in 2> /dev/null - - gcj/libgcj-config.h: gcj/stamp-h2 - @if test ! -f $@; then \ - rm -f gcj/stamp-h2; \ - $(MAKE) gcj/stamp-h2; \ - else :; fi - gcj/stamp-h2: $(srcdir)/gcj/libgcj-config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=gcj/libgcj-config.h \ - $(SHELL) ./config.status - @echo timestamp > gcj/stamp-h2 2> /dev/null - $(srcdir)/gcj/libgcj-config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/gcj/stamp-h2.in - @if test ! -f $@; then \ - rm -f $(srcdir)/gcj/stamp-h2.in; \ - $(MAKE) $(srcdir)/gcj/stamp-h2.in; \ - else :; fi - $(srcdir)/gcj/stamp-h2.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/gcj/stamp-h2.in 2> /dev/null - - mostlyclean-hdr: - - clean-hdr: - - distclean-hdr: - -rm -f include/config.h gcj/libgcj-config.h - - maintainer-clean-hdr: libgcj.spec: $(top_builddir)/config.status libgcj.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status libgcj-test.spec: $(top_builddir)/config.status libgcj-test.spec.in --- 3847,3852 ---- *************** distclean-libtool: *** 2835,2840 **** --- 3915,3926 ---- maintainer-clean-libtool: + lib-org-xml-sax.la: $(lib_org_xml_sax_la_OBJECTS) $(lib_org_xml_sax_la_DEPENDENCIES) + $(LINK) -rpath $(toolexeclibdir) $(lib_org_xml_sax_la_LDFLAGS) $(lib_org_xml_sax_la_OBJECTS) $(lib_org_xml_sax_la_LIBADD) $(LIBS) + + lib-org-w3c-dom.la: $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_w3c_dom_la_DEPENDENCIES) + $(LINK) -rpath $(toolexeclibdir) $(lib_org_w3c_dom_la_LDFLAGS) $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_w3c_dom_la_LIBADD) $(LIBS) + mostlyclean-binPROGRAMS: clean-binPROGRAMS: *************** installcheck-am: *** 3165,3172 **** installcheck: installcheck-recursive install-exec-am: install-toolexeclibLTLIBRARIES install-binPROGRAMS \ install-binSCRIPTS install-toolexecmainlibDATA - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-exec: install-exec-recursive install-data-am: install-jarDATA install-data-local --- 4251,4256 ---- *************** distclean-generic: *** 3201,3232 **** -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: ! mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLTLIBRARIES \ ! mostlyclean-compile mostlyclean-libtool \ ! mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \ ! mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive ! clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \ ! clean-libtool clean-binPROGRAMS clean-noinstPROGRAMS \ ! clean-tags clean-depend clean-generic mostlyclean-am \ ! clean-local clean: clean-recursive ! distclean-am: distclean-hdr distclean-toolexeclibLTLIBRARIES \ ! distclean-compile distclean-libtool \ ! distclean-binPROGRAMS distclean-noinstPROGRAMS \ ! distclean-tags distclean-depend distclean-generic \ ! clean-am -rm -f libtool distclean: distclean-recursive -rm -f config.status ! maintainer-clean-am: maintainer-clean-hdr \ ! maintainer-clean-toolexeclibLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-binPROGRAMS \ maintainer-clean-noinstPROGRAMS maintainer-clean-tags \ --- 4285,4313 ---- -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: ! mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \ ! mostlyclean-libtool mostlyclean-binPROGRAMS \ ! mostlyclean-noinstPROGRAMS mostlyclean-tags \ ! mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive ! clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \ ! clean-binPROGRAMS clean-noinstPROGRAMS clean-tags \ ! clean-depend clean-generic mostlyclean-am clean-local clean: clean-recursive ! distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \ ! distclean-libtool distclean-binPROGRAMS \ ! distclean-noinstPROGRAMS distclean-tags \ ! distclean-depend distclean-generic clean-am -rm -f libtool distclean: distclean-recursive -rm -f config.status ! maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-binPROGRAMS \ maintainer-clean-noinstPROGRAMS maintainer-clean-tags \ *************** maintainer-clean-am: maintainer-clean-h *** 3238,3246 **** maintainer-clean: maintainer-clean-recursive -rm -f config.status ! .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ ! mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \ ! clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \ uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ --- 4319,4327 ---- maintainer-clean: maintainer-clean-recursive -rm -f config.status ! .PHONY: mostlyclean-toolexeclibLTLIBRARIES \ ! distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \ ! maintainer-clean-toolexeclibLTLIBRARIES \ uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ *************** installdirs mostlyclean-generic distclea *** 3266,3278 **** maintainer-clean-generic clean mostlyclean distclean maintainer-clean - install-exec-hook: - cd $(DESTDIR)$(libdir) && \ - if test -f libgcjx.la; then \ - rm -f gnu-awt-xlib.la; \ - $(LN_S) libgcjx.la gnu-awt-xlib.la; \ - fi - .java.class: $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) \ -d $(here) $< --- 4347,4352 ---- *************** $(c_files): %.lo: %.c *** 3306,3312 **** $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h ! $(javao_files) $(x_javao_files): %.lo: %.java $(GCJCOMPILE) -o $@ $< libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES) --- 4380,4386 ---- $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h ! $(javao_files) $(x_javao_files) $(lib_org_w3c_dom_la_OBJECTS) $(lib_org_xml_sax_la_OBJECTS): %.lo: %.java $(GCJCOMPILE) -o $@ $< libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES) *************** libgcj.la: $(libgcj_la_OBJECTS) $(libgcj *** 3315,3324 **** @GCLIBS@ @LIBFFI@ @ZLIBS@ \ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS) ! libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES) ! @: $(shell echo Creating list of files to link...) $(shell rm -f libgcjx.objectlist || :) $(shell touch libgcjx.objectlist) $(foreach object,$(libgcjx_la_OBJECTS) $(libgcjx_la_LIBADD),$(shell echo $(object) >> libgcjx.objectlist)) ! $(libgcjx_la_LINK) -objectlist libgcjx.objectlist \ ! -rpath $(toolexeclibdir) $(libgcjx_la_LDFLAGS) $(LIBS) .class.h: $(GCJH) -classpath '' -bootclasspath $(top_builddir) $(basename $<) --- 4389,4398 ---- @GCLIBS@ @LIBFFI@ @ZLIBS@ \ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS) ! lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES) ! @: $(shell echo Creating list of files to link...) $(shell rm -f lib_gnu_awt_xlib.objectlist || :) $(shell touch lib_gnu_awt_xlib.objectlist) $(foreach object,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),$(shell echo $(object) >> lib_gnu_awt_xlib.objectlist)) ! $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \ ! -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS) .class.h: $(GCJH) -classpath '' -bootclasspath $(top_builddir) $(basename $<) *************** java/lang/Thread.h: java/lang/Thread.cla *** 3341,3346 **** --- 4415,4421 ---- -friend 'void _Jv_ThreadRun (java::lang::Thread* thread);' \ -friend 'jint _Jv_AttachCurrentThread(java::lang::Thread* thread);' \ -friend 'java::lang::Thread* _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group);' \ + -friend 'java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group);' \ -friend 'jint _Jv_DetachCurrentThread ();' \ $(basename $<) *************** java/lang/reflect/Method.h: java/lang/re *** 3376,3381 **** --- 4451,4468 ---- -friend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \ $(basename $<) + java/lang/reflect/Proxy.h: java/lang/reflect/Proxy.class + $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ + $(basename $<) + + java/lang/reflect/Proxy$$ProxyData.h: java/lang/reflect/Proxy.class + $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ + 'java/lang/reflect/Proxy$$ProxyData' + + java/lang/reflect/Proxy$$ProxyType.h: java/lang/reflect/Proxy.class + $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ + 'java/lang/reflect/Proxy$$ProxyType' + gnu/gcj/runtime/VMClassLoader.h: gnu/gcj/runtime/VMClassLoader.class $(GCJH) -classpath '' -bootclasspath $(top_builddir) \ -friend 'class ::java::lang::ClassLoader;' \ diff -Nrc3pad gcc-3.2.3/libjava/mauve-libgcj gcc-3.3/libjava/mauve-libgcj *** gcc-3.2.3/libjava/mauve-libgcj 2002-04-21 12:35:21.000000000 +0000 --- gcc-3.3/libjava/mauve-libgcj 2003-04-17 06:09:33.000000000 +0000 *************** JDK1.4 *** 7,28 **** JLS1.0 JLS1.1 JLS1.2 JDBC2.0 - # These 2 are tests that fail with JDBC2.0 but the tags don't seem to - # have the right effect. - !java.sql.Connection.TestJdbc10 - !java.sql.DatabaseMetaData.TestJdbc10 - # Cannot be compiled !java.text.ACIAttribute ! # The following tests seem to (sometimes) hang or crash the testsuite ! !java.io.ObjectInputOutput !java.lang.reflect.Array.newInstance - !java.util.ResourceBundle.getBundle - !java.util.zip.GZIPInputStream.basic - !java.net.DatagramSocket.DatagramSocketTest2 # Character.unicode seems to be very broken (the test) # Does not give meaningfull test results at the moment. --- 7,21 ---- JLS1.0 JLS1.1 JLS1.2 + JDBC1.0 JDBC2.0 # Cannot be compiled !java.text.ACIAttribute ! # The following tests seem to hang or crash the testsuite. ! # This a problem when running Mauve "standalone". !java.lang.reflect.Array.newInstance # Character.unicode seems to be very broken (the test) # Does not give meaningfull test results at the moment. *************** JDBC2.0 *** 30,33 **** # These are almost certainly buggy test cases. # The behaviour of the garbarge collector cannot be predicted. ! !java.lang.ref --- 23,40 ---- # These are almost certainly buggy test cases. # The behaviour of the garbarge collector cannot be predicted. ! # Note the . at the end so we do test java.lang.reflect ! !java.lang.ref. ! ! # There are a bunch of valid tests we can't pass in ! # this release. ! !java.security.Signature.getInstance14 ! !java.security.Security.getProviders ! !java.security.Security.getAlgorithms ! !java.security.MessageDigest.getInstance14 ! !java.security.KeyPairGenerator.getInstance14 ! !java.security.KeyFactory.getInstance14 ! !java.security.AlgorithmParameters.getInstance14 ! !java.security.AlgorithmParameterGenerator.getInstance14 ! !java.lang.String.surrogate ! !java.net.DatagramSocket.DatagramSocketTest2 diff -Nrc3pad gcc-3.2.3/libjava/name-finder.cc gcc-3.3/libjava/name-finder.cc *** gcc-3.2.3/libjava/name-finder.cc 2002-03-23 16:17:07.000000000 +0000 --- gcc-3.3/libjava/name-finder.cc 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,210 **** - // name-finder.cc - Convert addresses to names - - /* Copyright (C) 2000, 2002 Free Software Foundation, Inc - - This file is part of libgcj. - - This software is copyrighted work licensed under the terms of the - Libgcj License. Please consult the file "LIBGCJ_LICENSE" for - details. */ - - /** - * @author Andrew Haley - * @date Jan 6 2000 - */ - - /* _Jv_name_finder is a class wrapper around a mechanism that can - convert address of methods to their names and the names of files in - which they appear. - - Right now, the only implementation of this involves running a copy - of addr2line, but at some point it is worth building this - functionality into libgcj, if only for embedded systems. */ - - - #ifndef _GNU_SOURCE - #define _GNU_SOURCE 1 - #endif - - #include - - #include - - #include - #include - #include - #include - #include - #include - #include - - #include - - #include - #include - - #ifdef HAVE_UNISTD_H - #include - #endif - - #ifdef HAVE_DLFCN_H - #include - #endif - - #include - - /* Create a new name finder which will perform address lookups on an - executable. */ - - _Jv_name_finder::_Jv_name_finder (char *executable) - { - #if defined (HAVE_PIPE) && defined (HAVE_FORK) && defined (HAVE_EXECVP) - error = 0; - - // Initialize file descriptors so that shutdown works properly. - f_pipe[0] = -1; - f_pipe[1] = -1; - b_pipe[0] = -1; - b_pipe[1] = -1; - b_pipe_fd = NULL; - - char *argv[6]; - { - int arg = 0; - #ifdef __ia64__ - argv[arg++] = "addr2name.awk"; - #else - argv[arg++] = "addr2line"; - argv[arg++] = "-C"; - argv[arg++] = "-f"; - argv[arg++] = "-e"; - #endif - argv[arg++] = executable; - argv[arg] = NULL; - } - - error |= pipe (f_pipe) < 0; - error |= pipe (b_pipe) < 0; - - if (error) - return; - - pid = fork (); - if (pid == 0) - { - close (f_pipe[1]); - close (b_pipe[0]); - dup2 (f_pipe[0], fileno (stdin)); - dup2 (b_pipe[1], fileno (stdout)); - execvp (argv[0], argv); - _exit (127); - } - - // Close child end of pipes. Set local descriptors to -1 so we - // don't try to close the fd again. - close (f_pipe [0]); - f_pipe[0] = -1; - close (b_pipe [1]); - b_pipe[1] = -1; - - if (pid < 0) - { - error |= 1; - return; - } - - b_pipe_fd = fdopen (b_pipe[0], "r"); - error |= !b_pipe_fd; - - if (! error) - { - // Don't try to close the fd twice. - b_pipe[0] = -1; - } - #endif - } - - /* Convert a pointer to hex. */ - - void - _Jv_name_finder::toHex (void *p) - { - typedef unsigned word_t __attribute ((mode (word))); - word_t n = (word_t) p; - int digits = sizeof (void *) * 2; - - strcpy (hex, "0x"); - for (int i = digits - 1; i >= 0; i--) - { - int digit = n % 16; - - n /= 16; - hex[i+2] = digit > 9 ? 'a' + digit - 10 : '0' + digit; - } - hex [digits+2] = 0; - } - - /* Given a pointer to a function or method, try to convert it into a - name and the appropriate line and source file. The caller passes - the code pointer in p. - - Returns false if the lookup fails. Even if this happens, the field - he will have been correctly filled in with the pointer. */ - - bool - _Jv_name_finder::lookup (void *p) - { - extern char **_Jv_argv; - toHex (p); - - #if defined (HAVE_DLFCN_H) && defined (HAVE_DLADDR) - { - Dl_info dl_info; - - if (dladdr (p, &dl_info)) - { - if (dl_info.dli_fname) - strncpy (file_name, dl_info.dli_fname, sizeof file_name); - if (dl_info.dli_sname) - strncpy (method_name, dl_info.dli_sname, sizeof method_name); - - /* Don't trust dladdr() if the address is from the main program. */ - if (dl_info.dli_fname != NULL - && dl_info.dli_sname != NULL - && (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0)) - return true; - } - } - #endif - - #if defined (HAVE_PIPE) && defined (HAVE_FORK) && defined (HAVE_EXECVP) - if (error) - return false; - - error |= write (f_pipe[1], hex, strlen (hex)) < 0; - if (error) - return false; - error |= write (f_pipe[1], "\n", 1) < 0; - if (error) - return false; - - error |= (fgets (method_name, sizeof method_name, b_pipe_fd) == NULL); - if (error) - return false; - error |= (fgets (file_name, sizeof file_name, b_pipe_fd) == NULL); - if (error) - return false; - - char *newline = strchr (method_name, '\n'); - if (newline) - *newline = 0; - newline = strchr (file_name, '\n'); - if (newline) - *newline = 0; - - return true; - - #else - return false; - #endif /* defined (HAVE_PIPE) && defined (HAVE_FORK) && defined (HAVE_EXECVP) */ - } --- 0 ---- diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/AttributeList.java gcc-3.3/libjava/org/xml/sax/AttributeList.java *** gcc-3.2.3/libjava/org/xml/sax/AttributeList.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/AttributeList.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,191 **** ! // SAX Attribute List Interface. ! // No warranty; no copyright -- use this as you will. ! // $Id: AttributeList.java,v 1.1 2000/10/02 02:43:16 sboag Exp $ ! ! package org.xml.sax; ! ! /** ! * Interface for an element's attribute specifications. ! * ! *

          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This is the original SAX1 interface for reporting an element's ! * attributes. Unlike the new {@link org.xml.sax.Attributes Attributes} ! * interface, it does not support Namespace-related information.

          ! * ! *

          When an attribute list is supplied as part of a ! * {@link org.xml.sax.DocumentHandler#startElement startElement} ! * event, the list will return valid results only during the ! * scope of the event; once the event handler returns control ! * to the parser, the attribute list is invalid. To save a ! * persistent copy of the attribute list, use the SAX1 ! * {@link org.xml.sax.helpers.AttributeListImpl AttributeListImpl} ! * helper class.

          ! * ! *

          An attribute list includes only attributes that have been ! * specified or defaulted: #IMPLIED attributes will not be included.

          ! * ! *

          There are two ways for the SAX application to obtain information ! * from the AttributeList. First, it can iterate through the entire ! * list:

          ! * ! *
          !  * public void startElement (String name, AttributeList atts) {
          !  *   for (int i = 0; i < atts.getLength(); i++) {
          !  *     String name = atts.getName(i);
          !  *     String type = atts.getType(i);
          !  *     String value = atts.getValue(i);
          !  *     [...]
          !  *   }
          !  * }
          !  * 
          ! * ! *

          (Note that the result of getLength() will be zero if there ! * are no attributes.) ! * ! *

          As an alternative, the application can request the value or ! * type of specific attributes:

          ! * ! *
          !  * public void startElement (String name, AttributeList atts) {
          !  *   String identifier = atts.getValue("id");
          !  *   String label = atts.getValue("label");
          !  *   [...]
          !  * }
          !  * 
          ! * ! * @deprecated This interface has been replaced by the SAX2 ! * {@link org.xml.sax.Attributes Attributes} ! * interface, which includes Namespace support. ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.DocumentHandler#startElement startElement ! * @see org.xml.sax.helpers.AttributeListImpl AttributeListImpl ! */ ! public interface AttributeList { ! ! ! //////////////////////////////////////////////////////////////////// ! // Iteration methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in this list. ! * ! *

          The SAX parser may provide attributes in any ! * arbitrary order, regardless of the order in which they were ! * declared or specified. The number of attributes may be ! * zero.

          ! * ! * @return The number of attributes in the list. ! */ ! public abstract int getLength (); ! ! ! /** ! * Return the name of an attribute in this list (by position). ! * ! *

          The names must be unique: the SAX parser shall not include the ! * same attribute twice. Attributes without values (those declared ! * #IMPLIED without a value specified in the start tag) will be ! * omitted from the list.

          ! * ! *

          If the attribute name has a namespace prefix, the prefix ! * will still be attached.

          ! * ! * @param i The index of the attribute in the list (starting at 0). ! * @return The name of the indexed attribute, or null ! * if the index is out of range. ! * @see #getLength ! */ ! public abstract String getName (int i); ! ! ! /** ! * Return the type of an attribute in the list (by position). ! * ! *

          The attribute type is one of the strings "CDATA", "ID", ! * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", ! * or "NOTATION" (always in upper case).

          ! * ! *

          If the parser has not read a declaration for the attribute, ! * or if the parser does not report attribute types, then it must ! * return the value "CDATA" as stated in the XML 1.0 Recommentation ! * (clause 3.3.3, "Attribute-Value Normalization").

          ! * ! *

          For an enumerated attribute that is not a notation, the ! * parser will report the type as "NMTOKEN".

          ! * ! * @param i The index of the attribute in the list (starting at 0). ! * @return The attribute type as a string, or ! * null if the index is out of range. ! * @see #getLength ! * @see #getType(java.lang.String) ! */ ! public abstract String getType (int i); ! ! ! /** ! * Return the value of an attribute in the list (by position). ! * ! *

          If the attribute value is a list of tokens (IDREFS, ! * ENTITIES, or NMTOKENS), the tokens will be concatenated ! * into a single string separated by whitespace.

          ! * ! * @param i The index of the attribute in the list (starting at 0). ! * @return The attribute value as a string, or ! * null if the index is out of range. ! * @see #getLength ! * @see #getValue(java.lang.String) ! */ ! public abstract String getValue (int i); ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Lookup methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the type of an attribute in the list (by name). ! * ! *

          The return value is the same as the return value for ! * getType(int).

          ! * ! *

          If the attribute name has a namespace prefix in the document, ! * the application must include the prefix here.

          ! * ! * @param name The name of the attribute. ! * @return The attribute type as a string, or null if no ! * such attribute exists. ! * @see #getType(int) ! */ ! public abstract String getType (String name); ! ! ! /** ! * Return the value of an attribute in the list (by name). ! * ! *

          The return value is the same as the return value for ! * getValue(int).

          ! * ! *

          If the attribute name has a namespace prefix in the document, ! * the application must include the prefix here.

          ! * ! * @param i The index of the attribute in the list. ! * @return The attribute value as a string, or null if ! * no such attribute exists. ! * @see #getValue(int) ! */ ! public abstract String getValue (String name); ! ! } ! ! // end of AttributeList.java --- 1,193 ---- ! // SAX Attribute List Interface. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: AttributeList.java,v 1.3.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! /** ! * Interface for an element's attribute specifications. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This is the original SAX1 interface for reporting an element's ! * attributes. Unlike the new {@link org.xml.sax.Attributes Attributes} ! * interface, it does not support Namespace-related information.

          ! * ! *

          When an attribute list is supplied as part of a ! * {@link org.xml.sax.DocumentHandler#startElement startElement} ! * event, the list will return valid results only during the ! * scope of the event; once the event handler returns control ! * to the parser, the attribute list is invalid. To save a ! * persistent copy of the attribute list, use the SAX1 ! * {@link org.xml.sax.helpers.AttributeListImpl AttributeListImpl} ! * helper class.

          ! * ! *

          An attribute list includes only attributes that have been ! * specified or defaulted: #IMPLIED attributes will not be included.

          ! * ! *

          There are two ways for the SAX application to obtain information ! * from the AttributeList. First, it can iterate through the entire ! * list:

          ! * ! *
          !  * public void startElement (String name, AttributeList atts) {
          !  *   for (int i = 0; i < atts.getLength(); i++) {
          !  *     String name = atts.getName(i);
          !  *     String type = atts.getType(i);
          !  *     String value = atts.getValue(i);
          !  *     [...]
          !  *   }
          !  * }
          !  * 
          ! * ! *

          (Note that the result of getLength() will be zero if there ! * are no attributes.) ! * ! *

          As an alternative, the application can request the value or ! * type of specific attributes:

          ! * ! *
          !  * public void startElement (String name, AttributeList atts) {
          !  *   String identifier = atts.getValue("id");
          !  *   String label = atts.getValue("label");
          !  *   [...]
          !  * }
          !  * 
          ! * ! * @deprecated This interface has been replaced by the SAX2 ! * {@link org.xml.sax.Attributes Attributes} ! * interface, which includes Namespace support. ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.DocumentHandler#startElement startElement ! * @see org.xml.sax.helpers.AttributeListImpl AttributeListImpl ! */ ! public interface AttributeList { ! ! ! //////////////////////////////////////////////////////////////////// ! // Iteration methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in this list. ! * ! *

          The SAX parser may provide attributes in any ! * arbitrary order, regardless of the order in which they were ! * declared or specified. The number of attributes may be ! * zero.

          ! * ! * @return The number of attributes in the list. ! */ ! public abstract int getLength (); ! ! ! /** ! * Return the name of an attribute in this list (by position). ! * ! *

          The names must be unique: the SAX parser shall not include the ! * same attribute twice. Attributes without values (those declared ! * #IMPLIED without a value specified in the start tag) will be ! * omitted from the list.

          ! * ! *

          If the attribute name has a namespace prefix, the prefix ! * will still be attached.

          ! * ! * @param i The index of the attribute in the list (starting at 0). ! * @return The name of the indexed attribute, or null ! * if the index is out of range. ! * @see #getLength ! */ ! public abstract String getName (int i); ! ! ! /** ! * Return the type of an attribute in the list (by position). ! * ! *

          The attribute type is one of the strings "CDATA", "ID", ! * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", ! * or "NOTATION" (always in upper case).

          ! * ! *

          If the parser has not read a declaration for the attribute, ! * or if the parser does not report attribute types, then it must ! * return the value "CDATA" as stated in the XML 1.0 Recommentation ! * (clause 3.3.3, "Attribute-Value Normalization").

          ! * ! *

          For an enumerated attribute that is not a notation, the ! * parser will report the type as "NMTOKEN".

          ! * ! * @param i The index of the attribute in the list (starting at 0). ! * @return The attribute type as a string, or ! * null if the index is out of range. ! * @see #getLength ! * @see #getType(java.lang.String) ! */ ! public abstract String getType (int i); ! ! ! /** ! * Return the value of an attribute in the list (by position). ! * ! *

          If the attribute value is a list of tokens (IDREFS, ! * ENTITIES, or NMTOKENS), the tokens will be concatenated ! * into a single string separated by whitespace.

          ! * ! * @param i The index of the attribute in the list (starting at 0). ! * @return The attribute value as a string, or ! * null if the index is out of range. ! * @see #getLength ! * @see #getValue(java.lang.String) ! */ ! public abstract String getValue (int i); ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Lookup methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the type of an attribute in the list (by name). ! * ! *

          The return value is the same as the return value for ! * getType(int).

          ! * ! *

          If the attribute name has a namespace prefix in the document, ! * the application must include the prefix here.

          ! * ! * @param name The name of the attribute. ! * @return The attribute type as a string, or null if no ! * such attribute exists. ! * @see #getType(int) ! */ ! public abstract String getType (String name); ! ! ! /** ! * Return the value of an attribute in the list (by name). ! * ! *

          The return value is the same as the return value for ! * getValue(int).

          ! * ! *

          If the attribute name has a namespace prefix in the document, ! * the application must include the prefix here.

          ! * ! * @param i The index of the attribute in the list. ! * @return The attribute value as a string, or null if ! * no such attribute exists. ! * @see #getValue(int) ! */ ! public abstract String getValue (String name); ! ! } ! ! // end of AttributeList.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/Attributes.java gcc-3.3/libjava/org/xml/sax/Attributes.java *** gcc-3.2.3/libjava/org/xml/sax/Attributes.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/Attributes.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,243 **** ! // Attributes.java - attribute list with Namespace support ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: Attributes.java,v 1.1 2000/10/02 02:43:16 sboag Exp $ ! ! ! package org.xml.sax; ! ! ! /** ! * Interface for a list of XML attributes. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This interface allows access to a list of attributes in ! * three different ways:

          ! * ! *
            ! *
          1. by attribute index;
          2. ! *
          3. by Namespace-qualified name; or
          4. ! *
          5. by qualified (prefixed) name.
          6. ! *
          ! * ! *

          The list will not contain attributes that were declared ! * #IMPLIED but not specified in the start tag. It will also not ! * contain attributes used as Namespace declarations (xmlns*) unless ! * the http://xml.org/sax/features/namespace-prefixes ! * feature is set to true (it is false by ! * default).

          ! * ! *

          If the namespace-prefixes feature (see above) is false, ! * access by qualified name may not be available; if the ! * http://xml.org/sax/features/namespaces ! * feature is false, access by Namespace-qualified names ! * may not be available.

          ! * ! *

          This interface replaces the now-deprecated SAX1 {@link ! * org.xml.sax.AttributeList AttributeList} interface, which does not ! * contain Namespace support. In addition to Namespace support, it ! * adds the getIndex methods (below).

          ! * ! *

          The order of attributes in the list is unspecified, and will ! * vary from implementation to implementation.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.helpers.AttributeListImpl ! */ ! public interface Attributes ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Indexed access. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in the list. ! * ! *

          Once you know the number of attributes, you can iterate ! * through the list.

          ! * ! * @return The number of attributes in the list. ! * @see #getURI(int) ! * @see #getLocalName(int) ! * @see #getQName(int) ! * @see #getType(int) ! * @see #getValue(int) ! */ ! public abstract int getLength (); ! ! ! /** ! * Look up an attribute's Namespace URI by index. ! * ! * @param index The attribute index (zero-based). ! * @return The Namespace URI, or the empty string if none ! * is available, or null if the index is out of ! * range. ! * @see #getLength ! */ ! public abstract String getURI (int index); ! ! ! /** ! * Look up an attribute's local name by index. ! * ! * @param index The attribute index (zero-based). ! * @return The local name, or the empty string if Namespace ! * processing is not being performed, or null ! * if the index is out of range. ! * @see #getLength ! */ ! public abstract String getLocalName (int index); ! ! ! /** ! * Look up an attribute's XML 1.0 qualified name by index. ! * ! * @param index The attribute index (zero-based). ! * @return The XML 1.0 qualified name, or the empty string ! * if none is available, or null if the index ! * is out of range. ! * @see #getLength ! */ ! public abstract String getQName (int index); ! ! ! /** ! * Look up an attribute's type by index. ! * ! *

          The attribute type is one of the strings "CDATA", "ID", ! * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", ! * or "NOTATION" (always in upper case).

          ! * ! *

          If the parser has not read a declaration for the attribute, ! * or if the parser does not report attribute types, then it must ! * return the value "CDATA" as stated in the XML 1.0 Recommentation ! * (clause 3.3.3, "Attribute-Value Normalization").

          ! * ! *

          For an enumerated attribute that is not a notation, the ! * parser will report the type as "NMTOKEN".

          ! * ! * @param index The attribute index (zero-based). ! * @return The attribute's type as a string, or null if the ! * index is out of range. ! * @see #getLength ! */ ! public abstract String getType (int index); ! ! ! /** ! * Look up an attribute's value by index. ! * ! *

          If the attribute value is a list of tokens (IDREFS, ! * ENTITIES, or NMTOKENS), the tokens will be concatenated ! * into a single string with each token separated by a ! * single space.

          ! * ! * @param index The attribute index (zero-based). ! * @return The attribute's value as a string, or null if the ! * index is out of range. ! * @see #getLength ! */ ! public abstract String getValue (int index); ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Name-based query. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Look up the index of an attribute by Namespace name. ! * ! * @param uri The Namespace URI, or the empty string if ! * the name has no Namespace URI. ! * @param localName The attribute's local name. ! * @return The index of the attribute, or -1 if it does not ! * appear in the list. ! */ ! public int getIndex (String uri, String localPart); ! ! ! /** ! * Look up the index of an attribute by XML 1.0 qualified name. ! * ! * @param qName The qualified (prefixed) name. ! * @return The index of the attribute, or -1 if it does not ! * appear in the list. ! */ ! public int getIndex (String qName); ! ! ! /** ! * Look up an attribute's type by Namespace name. ! * ! *

          See {@link #getType(int) getType(int)} for a description ! * of the possible types.

          ! * ! * @param uri The Namespace URI, or the empty String if the ! * name has no Namespace URI. ! * @param localName The local name of the attribute. ! * @return The attribute type as a string, or null if the ! * attribute is not in the list or if Namespace ! * processing is not being performed. ! */ ! public abstract String getType (String uri, String localName); ! ! ! /** ! * Look up an attribute's type by XML 1.0 qualified name. ! * ! *

          See {@link #getType(int) getType(int)} for a description ! * of the possible types.

          ! * ! * @param qName The XML 1.0 qualified name. ! * @return The attribute type as a string, or null if the ! * attribute is not in the list or if qualified names ! * are not available. ! */ ! public abstract String getType (String qName); ! ! ! /** ! * Look up an attribute's value by Namespace name. ! * ! *

          See {@link #getValue(int) getValue(int)} for a description ! * of the possible values.

          ! * ! * @param uri The Namespace URI, or the empty String if the ! * name has no Namespace URI. ! * @param localName The local name of the attribute. ! * @return The attribute value as a string, or null if the ! * attribute is not in the list. ! */ ! public abstract String getValue (String uri, String localName); ! ! ! /** ! * Look up an attribute's value by XML 1.0 qualified name. ! * ! *

          See {@link #getValue(int) getValue(int)} for a description ! * of the possible values.

          ! * ! * @param qName The XML 1.0 qualified name. ! * @return The attribute value as a string, or null if the ! * attribute is not in the list or if qualified names ! * are not available. ! */ ! public abstract String getValue (String qName); ! ! } ! ! // end of Attributes.java --- 1,252 ---- ! // Attributes.java - attribute list with Namespace support ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: Attributes.java,v 1.5.2.4 2002/01/29 21:34:14 dbrownell Exp $ ! ! ! package org.xml.sax; ! ! ! /** ! * Interface for a list of XML attributes. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This interface allows access to a list of attributes in ! * three different ways:

          ! * ! *
            ! *
          1. by attribute index;
          2. ! *
          3. by Namespace-qualified name; or
          4. ! *
          5. by qualified (prefixed) name.
          6. ! *
          ! * ! *

          The list will not contain attributes that were declared ! * #IMPLIED but not specified in the start tag. It will also not ! * contain attributes used as Namespace declarations (xmlns*) unless ! * the http://xml.org/sax/features/namespace-prefixes ! * feature is set to true (it is false by ! * default). ! * Because SAX2 conforms to the "Namespaces in XML" specification, ! * it does not give namespace declaration attributes a namespace URI. ! * Some other W3C specifications are in conflict with that, expecting ! * these declarations to be in a namespace. ! * Handler code may need to resolve that conflict. ! *

          ! * ! *

          If the namespace-prefixes feature (see above) is false, ! * access by qualified name may not be available; if the ! * http://xml.org/sax/features/namespaces ! * feature is false, access by Namespace-qualified names ! * may not be available.

          ! * ! *

          This interface replaces the now-deprecated SAX1 {@link ! * org.xml.sax.AttributeList AttributeList} interface, which does not ! * contain Namespace support. In addition to Namespace support, it ! * adds the getIndex methods (below).

          ! * ! *

          The order of attributes in the list is unspecified, and will ! * vary from implementation to implementation.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.helpers.AttributesImpl ! * @see org.xml.sax.ext.DeclHandler#attributeDecl ! */ ! public interface Attributes ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Indexed access. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in the list. ! * ! *

          Once you know the number of attributes, you can iterate ! * through the list.

          ! * ! * @return The number of attributes in the list. ! * @see #getURI(int) ! * @see #getLocalName(int) ! * @see #getQName(int) ! * @see #getType(int) ! * @see #getValue(int) ! */ ! public abstract int getLength (); ! ! ! /** ! * Look up an attribute's Namespace URI by index. ! * ! * @param index The attribute index (zero-based). ! * @return The Namespace URI, or the empty string if none ! * is available, or null if the index is out of ! * range. ! * @see #getLength ! */ ! public abstract String getURI (int index); ! ! ! /** ! * Look up an attribute's local name by index. ! * ! * @param index The attribute index (zero-based). ! * @return The local name, or the empty string if Namespace ! * processing is not being performed, or null ! * if the index is out of range. ! * @see #getLength ! */ ! public abstract String getLocalName (int index); ! ! ! /** ! * Look up an attribute's XML 1.0 qualified name by index. ! * ! * @param index The attribute index (zero-based). ! * @return The XML 1.0 qualified name, or the empty string ! * if none is available, or null if the index ! * is out of range. ! * @see #getLength ! */ ! public abstract String getQName (int index); ! ! ! /** ! * Look up an attribute's type by index. ! * ! *

          The attribute type is one of the strings "CDATA", "ID", ! * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", ! * or "NOTATION" (always in upper case).

          ! * ! *

          If the parser has not read a declaration for the attribute, ! * or if the parser does not report attribute types, then it must ! * return the value "CDATA" as stated in the XML 1.0 Recommentation ! * (clause 3.3.3, "Attribute-Value Normalization").

          ! * ! *

          For an enumerated attribute that is not a notation, the ! * parser will report the type as "NMTOKEN".

          ! * ! * @param index The attribute index (zero-based). ! * @return The attribute's type as a string, or null if the ! * index is out of range. ! * @see #getLength ! */ ! public abstract String getType (int index); ! ! ! /** ! * Look up an attribute's value by index. ! * ! *

          If the attribute value is a list of tokens (IDREFS, ! * ENTITIES, or NMTOKENS), the tokens will be concatenated ! * into a single string with each token separated by a ! * single space.

          ! * ! * @param index The attribute index (zero-based). ! * @return The attribute's value as a string, or null if the ! * index is out of range. ! * @see #getLength ! */ ! public abstract String getValue (int index); ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Name-based query. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Look up the index of an attribute by Namespace name. ! * ! * @param uri The Namespace URI, or the empty string if ! * the name has no Namespace URI. ! * @param localName The attribute's local name. ! * @return The index of the attribute, or -1 if it does not ! * appear in the list. ! */ ! public int getIndex (String uri, String localName); ! ! ! /** ! * Look up the index of an attribute by XML 1.0 qualified name. ! * ! * @param qName The qualified (prefixed) name. ! * @return The index of the attribute, or -1 if it does not ! * appear in the list. ! */ ! public int getIndex (String qName); ! ! ! /** ! * Look up an attribute's type by Namespace name. ! * ! *

          See {@link #getType(int) getType(int)} for a description ! * of the possible types.

          ! * ! * @param uri The Namespace URI, or the empty String if the ! * name has no Namespace URI. ! * @param localName The local name of the attribute. ! * @return The attribute type as a string, or null if the ! * attribute is not in the list or if Namespace ! * processing is not being performed. ! */ ! public abstract String getType (String uri, String localName); ! ! ! /** ! * Look up an attribute's type by XML 1.0 qualified name. ! * ! *

          See {@link #getType(int) getType(int)} for a description ! * of the possible types.

          ! * ! * @param qName The XML 1.0 qualified name. ! * @return The attribute type as a string, or null if the ! * attribute is not in the list or if qualified names ! * are not available. ! */ ! public abstract String getType (String qName); ! ! ! /** ! * Look up an attribute's value by Namespace name. ! * ! *

          See {@link #getValue(int) getValue(int)} for a description ! * of the possible values.

          ! * ! * @param uri The Namespace URI, or the empty String if the ! * name has no Namespace URI. ! * @param localName The local name of the attribute. ! * @return The attribute value as a string, or null if the ! * attribute is not in the list. ! */ ! public abstract String getValue (String uri, String localName); ! ! ! /** ! * Look up an attribute's value by XML 1.0 qualified name. ! * ! *

          See {@link #getValue(int) getValue(int)} for a description ! * of the possible values.

          ! * ! * @param qName The XML 1.0 qualified name. ! * @return The attribute value as a string, or null if the ! * attribute is not in the list or if qualified names ! * are not available. ! */ ! public abstract String getValue (String qName); ! ! } ! ! // end of Attributes.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/ContentHandler.java gcc-3.3/libjava/org/xml/sax/ContentHandler.java *** gcc-3.2.3/libjava/org/xml/sax/ContentHandler.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/ContentHandler.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,374 **** ! // ContentHandler.java - handle main document content. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: ContentHandler.java,v 1.1 2000/10/02 02:43:16 sboag Exp $ ! ! package org.xml.sax; ! ! ! /** ! * Receive notification of the logical content of a document. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This is the main interface that most SAX applications ! * implement: if the application needs to be informed of basic parsing ! * events, it implements this interface and registers an instance with ! * the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler ! * setContentHandler} method. The parser uses the instance to report ! * basic document-related events like the start and end of elements ! * and character data.

          ! * ! *

          The order of events in this interface is very important, and ! * mirrors the order of information in the document itself. For ! * example, all of an element's content (character data, processing ! * instructions, and/or subelements) will appear, in order, between ! * the startElement event and the corresponding endElement event.

          ! * ! *

          This interface is similar to the now-deprecated SAX 1.0 ! * DocumentHandler interface, but it adds support for Namespaces ! * and for reporting skipped entities (in non-validating XML ! * processors).

          ! * ! *

          Implementors should note that there is also a Java class ! * {@link java.net.ContentHandler ContentHandler} in the java.net ! * package; that means that it's probably a bad idea to do

          ! * ! *
          ! * import java.net.*; ! * import org.xml.sax.*; ! *
          ! * ! *

          In fact, "import ...*" is usually a sign of sloppy programming ! * anyway, so the user should consider this a feature rather than a ! * bug.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.XMLReader ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public interface ContentHandler ! { ! ! /** ! * Receive an object for locating the origin of SAX document events. ! * ! *

          SAX parsers are strongly encouraged (though not absolutely ! * required) to supply a locator: if it does so, it must supply ! * the locator to the application by invoking this method before ! * invoking any of the other methods in the ContentHandler ! * interface.

          ! * ! *

          The locator allows the application to determine the end ! * position of any document-related event, even if the parser is ! * not reporting an error. Typically, the application will ! * use this information for reporting its own errors (such as ! * character content that does not match an application's ! * business rules). The information returned by the locator ! * is probably not sufficient for use with a search engine.

          ! * ! *

          Note that the locator will return correct information only ! * during the invocation of the events in this interface. The ! * application should not attempt to use it at any other time.

          ! * ! * @param locator An object that can return the location of ! * any SAX document event. ! * @see org.xml.sax.Locator ! */ ! public void setDocumentLocator (Locator locator); ! ! ! /** ! * Receive notification of the beginning of a document. ! * ! *

          The SAX parser will invoke this method only once, before any ! * other methods in this interface or in {@link org.xml.sax.DTDHandler ! * DTDHandler} (except for {@link #setDocumentLocator ! * setDocumentLocator}).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #endDocument ! */ ! public void startDocument () ! throws SAXException; ! ! ! /** ! * Receive notification of the end of a document. ! * ! *

          The SAX parser will invoke this method only once, and it will ! * be the last method invoked during the parse. The parser shall ! * not invoke this method until it has either abandoned parsing ! * (because of an unrecoverable error) or reached the end of ! * input.

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #startDocument ! */ ! public void endDocument() ! throws SAXException; ! ! ! /** ! * Begin the scope of a prefix-URI Namespace mapping. ! * ! *

          The information from this event is not necessary for ! * normal Namespace processing: the SAX XML reader will ! * automatically replace prefixes for element and attribute ! * names when the http://xml.org/sax/features/namespaces ! * feature is true (the default).

          ! * ! *

          There are cases, however, when applications need to ! * use prefixes in character data or in attribute values, ! * where they cannot safely be expanded automatically; the ! * start/endPrefixMapping event supplies the information ! * to the application to expand prefixes in those contexts ! * itself, if necessary.

          ! * ! *

          Note that start/endPrefixMapping events are not ! * guaranteed to be properly nested relative to each-other: ! * all startPrefixMapping events will occur before the ! * corresponding {@link #startElement startElement} event, ! * and all {@link #endPrefixMapping endPrefixMapping} ! * events will occur after the corresponding {@link #endElement ! * endElement} event, but their order is not otherwise ! * guaranteed.

          ! * ! *

          There should never be start/endPrefixMapping events for the ! * "xml" prefix, since it is predeclared and immutable.

          ! * ! * @param prefix The Namespace prefix being declared. ! * @param uri The Namespace URI the prefix is mapped to. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see #endPrefixMapping ! * @see #startElement ! */ ! public void startPrefixMapping (String prefix, String uri) ! throws SAXException; ! ! ! /** ! * End the scope of a prefix-URI mapping. ! * ! *

          See {@link #startPrefixMapping startPrefixMapping} for ! * details. This event will always occur after the corresponding ! * {@link #endElement endElement} event, but the order of ! * {@link #endPrefixMapping endPrefixMapping} events is not otherwise ! * guaranteed.

          ! * ! * @param prefix The prefix that was being mapping. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see #startPrefixMapping ! * @see #endElement ! */ ! public void endPrefixMapping (String prefix) ! throws SAXException; ! ! ! /** ! * Receive notification of the beginning of an element. ! * ! *

          The Parser will invoke this method at the beginning of every ! * element in the XML document; there will be a corresponding ! * {@link #endElement endElement} event for every startElement event ! * (even when the element is empty). All of the element's content will be ! * reported, in order, before the corresponding endElement ! * event.

          ! * ! *

          This event allows up to three name components for each ! * element:

          ! * ! *
            ! *
          1. the Namespace URI;
          2. ! *
          3. the local name; and
          4. ! *
          5. the qualified (prefixed) name.
          6. ! *
          ! * ! *

          Any or all of these may be provided, depending on the ! * values of the http://xml.org/sax/features/namespaces ! * and the http://xml.org/sax/features/namespace-prefixes ! * properties:

          ! * ! *
            ! *
          • the Namespace URI and local name are required when ! * the namespaces property is true (the default), and are ! * optional when the namespaces property is false (if one is ! * specified, both must be);
          • ! *
          • the qualified name is required when the namespace-prefixes property ! * is true, and is optional when the namespace-prefixes property ! * is false (the default).
          • ! *
          ! * ! *

          Note that the attribute list provided will contain only ! * attributes with explicit values (specified or defaulted): ! * #IMPLIED attributes will be omitted. The attribute list ! * will contain attributes used for Namespace declarations ! * (xmlns* attributes) only if the ! * http://xml.org/sax/features/namespace-prefixes ! * property is true (it is false by default, and support for a ! * true value is optional).

          ! * ! * @param uri The Namespace URI, or the empty string if the ! * element has no Namespace URI or if Namespace ! * processing is not being performed. ! * @param localName The local name (without prefix), or the ! * empty string if Namespace processing is not being ! * performed. ! * @param qName The qualified name (with prefix), or the ! * empty string if qualified names are not available. ! * @param atts The attributes attached to the element. If ! * there are no attributes, it shall be an empty ! * Attributes object. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #endElement ! * @see org.xml.sax.Attributes ! */ ! public void startElement (String namespaceURI, String localName, ! String qName, Attributes atts) ! throws SAXException; ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          The SAX parser will invoke this method at the end of every ! * element in the XML document; there will be a corresponding ! * {@link #startElement startElement} event for every endElement ! * event (even when the element is empty).

          ! * ! *

          For information on the names, see startElement.

          ! * ! * @param uri The Namespace URI, or the empty string if the ! * element has no Namespace URI or if Namespace ! * processing is not being performed. ! * @param localName The local name (without prefix), or the ! * empty string if Namespace processing is not being ! * performed. ! * @param qName The qualified XML 1.0 name (with prefix), or the ! * empty string if qualified names are not available. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public void endElement (String namespaceURI, String localName, ! String qName) ! throws SAXException; ! ! ! /** ! * Receive notification of character data. ! * ! *

          The Parser will call this method to report each chunk of ! * character data. SAX parsers may return all contiguous character ! * data in a single chunk, or they may split it into several ! * chunks; however, all of the characters in any single event ! * must come from the same external entity so that the Locator ! * provides useful information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! *

          Note that some parsers will report whitespace in element ! * content using the {@link #ignorableWhitespace ignorableWhitespace} ! * method rather than this one (validating parsers must ! * do so).

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #ignorableWhitespace ! * @see org.xml.sax.Locator ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          Validating Parsers must use this method to report each chunk ! * of whitespace in element content (see the W3C XML 1.0 recommendation, ! * section 2.10): non-validating parsers may also use this method ! * if they are capable of parsing and using content models.

          ! * ! *

          SAX parsers may return all contiguous whitespace in a single ! * chunk, or they may split it into several chunks; however, all of ! * the characters in any single event must come from the same ! * external entity, so that the Locator provides useful ! * information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #characters ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          The Parser will invoke this method once for each processing ! * instruction found: note that processing instructions may occur ! * before or after the main document element.

          ! * ! *

          A SAX parser must never report an XML declaration (XML 1.0, ! * section 2.8) or a text declaration (XML 1.0, section 4.3.1) ! * using this method.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none was supplied. The data does not include any ! * whitespace separating it from the target. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public void processingInstruction (String target, String data) ! throws SAXException; ! ! ! /** ! * Receive notification of a skipped entity. ! * ! *

          The Parser will invoke this method once for each entity ! * skipped. Non-validating processors may skip entities if they ! * have not seen the declarations (because, for example, the ! * entity was declared in an external DTD subset). All processors ! * may skip external entities, depending on the values of the ! * http://xml.org/sax/features/external-general-entities ! * and the ! * http://xml.org/sax/features/external-parameter-entities ! * properties.

          ! * ! * @param name The name of the skipped entity. If it is a ! * parameter entity, the name will begin with '%', and if ! * it is the external DTD subset, it will be the string ! * "[dtd]". ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public void skippedEntity (String name) ! throws SAXException; ! } ! ! // end of ContentHandler.java --- 1,408 ---- ! // ContentHandler.java - handle main document content. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: ContentHandler.java,v 1.4.2.9 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! ! /** ! * Receive notification of the logical content of a document. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This is the main interface that most SAX applications ! * implement: if the application needs to be informed of basic parsing ! * events, it implements this interface and registers an instance with ! * the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler ! * setContentHandler} method. The parser uses the instance to report ! * basic document-related events like the start and end of elements ! * and character data.

          ! * ! *

          The order of events in this interface is very important, and ! * mirrors the order of information in the document itself. For ! * example, all of an element's content (character data, processing ! * instructions, and/or subelements) will appear, in order, between ! * the startElement event and the corresponding endElement event.

          ! * ! *

          This interface is similar to the now-deprecated SAX 1.0 ! * DocumentHandler interface, but it adds support for Namespaces ! * and for reporting skipped entities (in non-validating XML ! * processors).

          ! * ! *

          Implementors should note that there is also a Java class ! * {@link java.net.ContentHandler ContentHandler} in the java.net ! * package; that means that it's probably a bad idea to do

          ! * ! *
          ! * import java.net.*; ! * import org.xml.sax.*; ! *
          ! * ! *

          In fact, "import ...*" is usually a sign of sloppy programming ! * anyway, so the user should consider this a feature rather than a ! * bug.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.XMLReader ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public interface ContentHandler ! { ! ! /** ! * Receive an object for locating the origin of SAX document events. ! * ! *

          SAX parsers are strongly encouraged (though not absolutely ! * required) to supply a locator: if it does so, it must supply ! * the locator to the application by invoking this method before ! * invoking any of the other methods in the ContentHandler ! * interface.

          ! * ! *

          The locator allows the application to determine the end ! * position of any document-related event, even if the parser is ! * not reporting an error. Typically, the application will ! * use this information for reporting its own errors (such as ! * character content that does not match an application's ! * business rules). The information returned by the locator ! * is probably not sufficient for use with a search engine.

          ! * ! *

          Note that the locator will return correct information only ! * during the invocation of the events in this interface. The ! * application should not attempt to use it at any other time.

          ! * ! * @param locator An object that can return the location of ! * any SAX document event. ! * @see org.xml.sax.Locator ! */ ! public void setDocumentLocator (Locator locator); ! ! ! /** ! * Receive notification of the beginning of a document. ! * ! *

          The SAX parser will invoke this method only once, before any ! * other event callbacks (except for {@link #setDocumentLocator ! * setDocumentLocator}).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #endDocument ! */ ! public void startDocument () ! throws SAXException; ! ! ! /** ! * Receive notification of the end of a document. ! * ! *

          The SAX parser will invoke this method only once, and it will ! * be the last method invoked during the parse. The parser shall ! * not invoke this method until it has either abandoned parsing ! * (because of an unrecoverable error) or reached the end of ! * input.

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #startDocument ! */ ! public void endDocument() ! throws SAXException; ! ! ! /** ! * Begin the scope of a prefix-URI Namespace mapping. ! * ! *

          The information from this event is not necessary for ! * normal Namespace processing: the SAX XML reader will ! * automatically replace prefixes for element and attribute ! * names when the http://xml.org/sax/features/namespaces ! * feature is true (the default).

          ! * ! *

          There are cases, however, when applications need to ! * use prefixes in character data or in attribute values, ! * where they cannot safely be expanded automatically; the ! * start/endPrefixMapping event supplies the information ! * to the application to expand prefixes in those contexts ! * itself, if necessary.

          ! * ! *

          Note that start/endPrefixMapping events are not ! * guaranteed to be properly nested relative to each other: ! * all startPrefixMapping events will occur immediately before the ! * corresponding {@link #startElement startElement} event, ! * and all {@link #endPrefixMapping endPrefixMapping} ! * events will occur immediately after the corresponding ! * {@link #endElement endElement} event, ! * but their order is not otherwise ! * guaranteed.

          ! * ! *

          There should never be start/endPrefixMapping events for the ! * "xml" prefix, since it is predeclared and immutable.

          ! * ! * @param prefix The Namespace prefix being declared. ! * An empty string is used for the default element namespace, ! * which has no prefix. ! * @param uri The Namespace URI the prefix is mapped to. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see #endPrefixMapping ! * @see #startElement ! */ ! public void startPrefixMapping (String prefix, String uri) ! throws SAXException; ! ! ! /** ! * End the scope of a prefix-URI mapping. ! * ! *

          See {@link #startPrefixMapping startPrefixMapping} for ! * details. These events will always occur immediately after the ! * corresponding {@link #endElement endElement} event, but the order of ! * {@link #endPrefixMapping endPrefixMapping} events is not otherwise ! * guaranteed.

          ! * ! * @param prefix The prefix that was being mapping. ! * This is the empty string when a default mapping scope ends. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see #startPrefixMapping ! * @see #endElement ! */ ! public void endPrefixMapping (String prefix) ! throws SAXException; ! ! ! /** ! * Receive notification of the beginning of an element. ! * ! *

          The Parser will invoke this method at the beginning of every ! * element in the XML document; there will be a corresponding ! * {@link #endElement endElement} event for every startElement event ! * (even when the element is empty). All of the element's content will be ! * reported, in order, before the corresponding endElement ! * event.

          ! * ! *

          This event allows up to three name components for each ! * element:

          ! * ! *
            ! *
          1. the Namespace URI;
          2. ! *
          3. the local name; and
          4. ! *
          5. the qualified (prefixed) name.
          6. ! *
          ! * ! *

          Any or all of these may be provided, depending on the ! * values of the http://xml.org/sax/features/namespaces ! * and the http://xml.org/sax/features/namespace-prefixes ! * properties:

          ! * ! *
            ! *
          • the Namespace URI and local name are required when ! * the namespaces property is true (the default), and are ! * optional when the namespaces property is false (if one is ! * specified, both must be);
          • ! *
          • the qualified name is required when the namespace-prefixes property ! * is true, and is optional when the namespace-prefixes property ! * is false (the default).
          • ! *
          ! * ! *

          Note that the attribute list provided will contain only ! * attributes with explicit values (specified or defaulted): ! * #IMPLIED attributes will be omitted. The attribute list ! * will contain attributes used for Namespace declarations ! * (xmlns* attributes) only if the ! * http://xml.org/sax/features/namespace-prefixes ! * property is true (it is false by default, and support for a ! * true value is optional).

          ! * ! *

          Like {@link #characters characters()}, attribute values may have ! * characters that need more than one char value.

          ! * ! * @param uri The Namespace URI, or the empty string if the ! * element has no Namespace URI or if Namespace ! * processing is not being performed. ! * @param localName The local name (without prefix), or the ! * empty string if Namespace processing is not being ! * performed. ! * @param qName The qualified name (with prefix), or the ! * empty string if qualified names are not available. ! * @param atts The attributes attached to the element. If ! * there are no attributes, it shall be an empty ! * Attributes object. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #endElement ! * @see org.xml.sax.Attributes ! */ ! public void startElement (String uri, String localName, ! String qName, Attributes atts) ! throws SAXException; ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          The SAX parser will invoke this method at the end of every ! * element in the XML document; there will be a corresponding ! * {@link #startElement startElement} event for every endElement ! * event (even when the element is empty).

          ! * ! *

          For information on the names, see startElement.

          ! * ! * @param uri The Namespace URI, or the empty string if the ! * element has no Namespace URI or if Namespace ! * processing is not being performed. ! * @param localName The local name (without prefix), or the ! * empty string if Namespace processing is not being ! * performed. ! * @param qName The qualified XML 1.0 name (with prefix), or the ! * empty string if qualified names are not available. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public void endElement (String uri, String localName, ! String qName) ! throws SAXException; ! ! ! /** ! * Receive notification of character data. ! * ! *

          The Parser will call this method to report each chunk of ! * character data. SAX parsers may return all contiguous character ! * data in a single chunk, or they may split it into several ! * chunks; however, all of the characters in any single event ! * must come from the same external entity so that the Locator ! * provides useful information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! *

          Individual characters may consist of more than one Java ! * char value. There are two important cases where this ! * happens, because characters can't be represented in just sixteen bits. ! * In one case, characters are represented in a Surrogate Pair, ! * using two special Unicode values. Such characters are in the so-called ! * "Astral Planes", with a code point above U+FFFF. A second case involves ! * composite characters, such as a base character combining with one or ! * more accent characters.

          ! * ! *

          Your code should not assume that algorithms using ! * char-at-a-time idioms will be working in character ! * units; in some cases they will split characters. This is relevant ! * wherever XML permits arbitrary characters, such as attribute values, ! * processing instruction data, and comments as well as in data reported ! * from this method. It's also generally relevant whenever Java code ! * manipulates internationalized text; the issue isn't unique to XML.

          ! * ! *

          Note that some parsers will report whitespace in element ! * content using the {@link #ignorableWhitespace ignorableWhitespace} ! * method rather than this one (validating parsers must ! * do so).

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #ignorableWhitespace ! * @see org.xml.sax.Locator ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          Validating Parsers must use this method to report each chunk ! * of whitespace in element content (see the W3C XML 1.0 recommendation, ! * section 2.10): non-validating parsers may also use this method ! * if they are capable of parsing and using content models.

          ! * ! *

          SAX parsers may return all contiguous whitespace in a single ! * chunk, or they may split it into several chunks; however, all of ! * the characters in any single event must come from the same ! * external entity, so that the Locator provides useful ! * information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #characters ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          The Parser will invoke this method once for each processing ! * instruction found: note that processing instructions may occur ! * before or after the main document element.

          ! * ! *

          A SAX parser must never report an XML declaration (XML 1.0, ! * section 2.8) or a text declaration (XML 1.0, section 4.3.1) ! * using this method.

          ! * ! *

          Like {@link #characters characters()}, processing instruction ! * data may have characters that need more than one char ! * value.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none was supplied. The data does not include any ! * whitespace separating it from the target. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public void processingInstruction (String target, String data) ! throws SAXException; ! ! ! /** ! * Receive notification of a skipped entity. ! * This is not called for entity references within markup constructs ! * such as element start tags or markup declarations. (The XML ! * recommendation requires reporting skipped external entities. ! * SAX also reports internal entity expansion/non-expansion, except ! * within markup constructs.) ! * ! *

          The Parser will invoke this method each time the entity is ! * skipped. Non-validating processors may skip entities if they ! * have not seen the declarations (because, for example, the ! * entity was declared in an external DTD subset). All processors ! * may skip external entities, depending on the values of the ! * http://xml.org/sax/features/external-general-entities ! * and the ! * http://xml.org/sax/features/external-parameter-entities ! * properties.

          ! * ! * @param name The name of the skipped entity. If it is a ! * parameter entity, the name will begin with '%', and if ! * it is the external DTD subset, it will be the string ! * "[dtd]". ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public void skippedEntity (String name) ! throws SAXException; ! } ! ! // end of ContentHandler.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/DocumentHandler.java gcc-3.3/libjava/org/xml/sax/DocumentHandler.java *** gcc-3.2.3/libjava/org/xml/sax/DocumentHandler.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/DocumentHandler.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,230 **** ! // SAX document handler. ! // No warranty; no copyright -- use this as you will. ! // $Id: DocumentHandler.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! /** ! * Receive notification of general document events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This was the main event-handling interface for SAX1; in ! * SAX2, it has been replaced by {@link org.xml.sax.ContentHandler ! * ContentHandler}, which provides Namespace support and reporting ! * of skipped entities. This interface is included in SAX2 only ! * to support legacy SAX1 applications.

          ! * ! *

          The order of events in this interface is very important, and ! * mirrors the order of information in the document itself. For ! * example, all of an element's content (character data, processing ! * instructions, and/or subelements) will appear, in order, between ! * the startElement event and the corresponding endElement event.

          ! * ! *

          Application writers who do not want to implement the entire ! * interface can derive a class from HandlerBase, which implements ! * the default functionality; parser writers can instantiate ! * HandlerBase to obtain a default handler. The application can find ! * the location of any document event using the Locator interface ! * supplied by the Parser through the setDocumentLocator method.

          ! * ! * @deprecated This interface has been replaced by the SAX2 ! * {@link org.xml.sax.ContentHandler ContentHandler} ! * interface, which includes Namespace support. ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Parser#setDocumentHandler ! * @see org.xml.sax.Locator ! * @see org.xml.sax.HandlerBase ! */ ! public interface DocumentHandler { ! ! ! /** ! * Receive an object for locating the origin of SAX document events. ! * ! *

          SAX parsers are strongly encouraged (though not absolutely ! * required) to supply a locator: if it does so, it must supply ! * the locator to the application by invoking this method before ! * invoking any of the other methods in the DocumentHandler ! * interface.

          ! * ! *

          The locator allows the application to determine the end ! * position of any document-related event, even if the parser is ! * not reporting an error. Typically, the application will ! * use this information for reporting its own errors (such as ! * character content that does not match an application's ! * business rules). The information returned by the locator ! * is probably not sufficient for use with a search engine.

          ! * ! *

          Note that the locator will return correct information only ! * during the invocation of the events in this interface. The ! * application should not attempt to use it at any other time.

          ! * ! * @param locator An object that can return the location of ! * any SAX document event. ! * @see org.xml.sax.Locator ! */ ! public abstract void setDocumentLocator (Locator locator); ! ! ! /** ! * Receive notification of the beginning of a document. ! * ! *

          The SAX parser will invoke this method only once, before any ! * other methods in this interface or in DTDHandler (except for ! * setDocumentLocator).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void startDocument () ! throws SAXException; ! ! ! /** ! * Receive notification of the end of a document. ! * ! *

          The SAX parser will invoke this method only once, and it will ! * be the last method invoked during the parse. The parser shall ! * not invoke this method until it has either abandoned parsing ! * (because of an unrecoverable error) or reached the end of ! * input.

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void endDocument () ! throws SAXException; ! ! ! /** ! * Receive notification of the beginning of an element. ! * ! *

          The Parser will invoke this method at the beginning of every ! * element in the XML document; there will be a corresponding ! * endElement() event for every startElement() event (even when the ! * element is empty). All of the element's content will be ! * reported, in order, before the corresponding endElement() ! * event.

          ! * ! *

          If the element name has a namespace prefix, the prefix will ! * still be attached. Note that the attribute list provided will ! * contain only attributes with explicit values (specified or ! * defaulted): #IMPLIED attributes will be omitted.

          ! * ! * @param name The element type name. ! * @param atts The attributes attached to the element, if any. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #endElement ! * @see org.xml.sax.AttributeList ! */ ! public abstract void startElement (String name, AttributeList atts) ! throws SAXException; ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          The SAX parser will invoke this method at the end of every ! * element in the XML document; there will be a corresponding ! * startElement() event for every endElement() event (even when the ! * element is empty).

          ! * ! *

          If the element name has a namespace prefix, the prefix will ! * still be attached to the name.

          ! * ! * @param name The element type name ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void endElement (String name) ! throws SAXException; ! ! ! /** ! * Receive notification of character data. ! * ! *

          The Parser will call this method to report each chunk of ! * character data. SAX parsers may return all contiguous character ! * data in a single chunk, or they may split it into several ! * chunks; however, all of the characters in any single event ! * must come from the same external entity, so that the Locator ! * provides useful information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! *

          Note that some parsers will report whitespace using the ! * ignorableWhitespace() method rather than this one (validating ! * parsers must do so).

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #ignorableWhitespace ! * @see org.xml.sax.Locator ! */ ! public abstract void characters (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          Validating Parsers must use this method to report each chunk ! * of ignorable whitespace (see the W3C XML 1.0 recommendation, ! * section 2.10): non-validating parsers may also use this method ! * if they are capable of parsing and using content models.

          ! * ! *

          SAX parsers may return all contiguous whitespace in a single ! * chunk, or they may split it into several chunks; however, all of ! * the characters in any single event must come from the same ! * external entity, so that the Locator provides useful ! * information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #characters ! */ ! public abstract void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          The Parser will invoke this method once for each processing ! * instruction found: note that processing instructions may occur ! * before or after the main document element.

          ! * ! *

          A SAX parser should never report an XML declaration (XML 1.0, ! * section 2.8) or a text declaration (XML 1.0, section 4.3.1) ! * using this method.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none was supplied. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void processingInstruction (String target, String data) ! throws SAXException; ! ! } ! ! // end of DocumentHandler.java --- 1,232 ---- ! // SAX document handler. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: DocumentHandler.java,v 1.3.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! /** ! * Receive notification of general document events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This was the main event-handling interface for SAX1; in ! * SAX2, it has been replaced by {@link org.xml.sax.ContentHandler ! * ContentHandler}, which provides Namespace support and reporting ! * of skipped entities. This interface is included in SAX2 only ! * to support legacy SAX1 applications.

          ! * ! *

          The order of events in this interface is very important, and ! * mirrors the order of information in the document itself. For ! * example, all of an element's content (character data, processing ! * instructions, and/or subelements) will appear, in order, between ! * the startElement event and the corresponding endElement event.

          ! * ! *

          Application writers who do not want to implement the entire ! * interface can derive a class from HandlerBase, which implements ! * the default functionality; parser writers can instantiate ! * HandlerBase to obtain a default handler. The application can find ! * the location of any document event using the Locator interface ! * supplied by the Parser through the setDocumentLocator method.

          ! * ! * @deprecated This interface has been replaced by the SAX2 ! * {@link org.xml.sax.ContentHandler ContentHandler} ! * interface, which includes Namespace support. ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.Parser#setDocumentHandler ! * @see org.xml.sax.Locator ! * @see org.xml.sax.HandlerBase ! */ ! public interface DocumentHandler { ! ! ! /** ! * Receive an object for locating the origin of SAX document events. ! * ! *

          SAX parsers are strongly encouraged (though not absolutely ! * required) to supply a locator: if it does so, it must supply ! * the locator to the application by invoking this method before ! * invoking any of the other methods in the DocumentHandler ! * interface.

          ! * ! *

          The locator allows the application to determine the end ! * position of any document-related event, even if the parser is ! * not reporting an error. Typically, the application will ! * use this information for reporting its own errors (such as ! * character content that does not match an application's ! * business rules). The information returned by the locator ! * is probably not sufficient for use with a search engine.

          ! * ! *

          Note that the locator will return correct information only ! * during the invocation of the events in this interface. The ! * application should not attempt to use it at any other time.

          ! * ! * @param locator An object that can return the location of ! * any SAX document event. ! * @see org.xml.sax.Locator ! */ ! public abstract void setDocumentLocator (Locator locator); ! ! ! /** ! * Receive notification of the beginning of a document. ! * ! *

          The SAX parser will invoke this method only once, before any ! * other methods in this interface or in DTDHandler (except for ! * setDocumentLocator).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void startDocument () ! throws SAXException; ! ! ! /** ! * Receive notification of the end of a document. ! * ! *

          The SAX parser will invoke this method only once, and it will ! * be the last method invoked during the parse. The parser shall ! * not invoke this method until it has either abandoned parsing ! * (because of an unrecoverable error) or reached the end of ! * input.

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void endDocument () ! throws SAXException; ! ! ! /** ! * Receive notification of the beginning of an element. ! * ! *

          The Parser will invoke this method at the beginning of every ! * element in the XML document; there will be a corresponding ! * endElement() event for every startElement() event (even when the ! * element is empty). All of the element's content will be ! * reported, in order, before the corresponding endElement() ! * event.

          ! * ! *

          If the element name has a namespace prefix, the prefix will ! * still be attached. Note that the attribute list provided will ! * contain only attributes with explicit values (specified or ! * defaulted): #IMPLIED attributes will be omitted.

          ! * ! * @param name The element type name. ! * @param atts The attributes attached to the element, if any. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #endElement ! * @see org.xml.sax.AttributeList ! */ ! public abstract void startElement (String name, AttributeList atts) ! throws SAXException; ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          The SAX parser will invoke this method at the end of every ! * element in the XML document; there will be a corresponding ! * startElement() event for every endElement() event (even when the ! * element is empty).

          ! * ! *

          If the element name has a namespace prefix, the prefix will ! * still be attached to the name.

          ! * ! * @param name The element type name ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void endElement (String name) ! throws SAXException; ! ! ! /** ! * Receive notification of character data. ! * ! *

          The Parser will call this method to report each chunk of ! * character data. SAX parsers may return all contiguous character ! * data in a single chunk, or they may split it into several ! * chunks; however, all of the characters in any single event ! * must come from the same external entity, so that the Locator ! * provides useful information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! *

          Note that some parsers will report whitespace using the ! * ignorableWhitespace() method rather than this one (validating ! * parsers must do so).

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #ignorableWhitespace ! * @see org.xml.sax.Locator ! */ ! public abstract void characters (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          Validating Parsers must use this method to report each chunk ! * of ignorable whitespace (see the W3C XML 1.0 recommendation, ! * section 2.10): non-validating parsers may also use this method ! * if they are capable of parsing and using content models.

          ! * ! *

          SAX parsers may return all contiguous whitespace in a single ! * chunk, or they may split it into several chunks; however, all of ! * the characters in any single event must come from the same ! * external entity, so that the Locator provides useful ! * information.

          ! * ! *

          The application must not attempt to read from the array ! * outside of the specified range.

          ! * ! * @param ch The characters from the XML document. ! * @param start The start position in the array. ! * @param length The number of characters to read from the array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #characters ! */ ! public abstract void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException; ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          The Parser will invoke this method once for each processing ! * instruction found: note that processing instructions may occur ! * before or after the main document element.

          ! * ! *

          A SAX parser should never report an XML declaration (XML 1.0, ! * section 2.8) or a text declaration (XML 1.0, section 4.3.1) ! * using this method.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none was supplied. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! */ ! public abstract void processingInstruction (String target, String data) ! throws SAXException; ! ! } ! ! // end of DocumentHandler.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/DTDHandler.java gcc-3.3/libjava/org/xml/sax/DTDHandler.java *** gcc-3.2.3/libjava/org/xml/sax/DTDHandler.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/DTDHandler.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,108 **** ! // SAX DTD handler. ! // No warranty; no copyright -- use this as you will. ! // $Id: DTDHandler.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! /** ! * Receive notification of basic DTD-related events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          If a SAX application needs information about notations and ! * unparsed entities, then the application implements this ! * interface and registers an instance with the SAX parser using ! * the parser's setDTDHandler method. The parser uses the ! * instance to report notation and unparsed entity declarations to ! * the application.

          ! * ! *

          Note that this interface includes only those DTD events that ! * the XML recommendation requires processors to report: ! * notation and unparsed entity declarations.

          ! * ! *

          The SAX parser may report these events in any order, regardless ! * of the order in which the notations and unparsed entities were ! * declared; however, all DTD events must be reported after the ! * document handler's startDocument event, and before the first ! * startElement event.

          ! * ! *

          It is up to the application to store the information for ! * future use (perhaps in a hash table or object tree). ! * If the application encounters attributes of type "NOTATION", ! * "ENTITY", or "ENTITIES", it can use the information that it ! * obtained through this interface to find the entity and/or ! * notation corresponding with the attribute value.

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Parser#setDTDHandler ! * @see org.xml.sax.HandlerBase ! */ ! public interface DTDHandler { ! ! ! /** ! * Receive notification of a notation declaration event. ! * ! *

          It is up to the application to record the notation for later ! * reference, if necessary.

          ! * ! *

          At least one of publicId and systemId must be non-null. ! * If a system identifier is present, and it is a URL, the SAX ! * parser must resolve it fully before passing it to the ! * application through this event.

          ! * ! *

          There is no guarantee that the notation declaration will be ! * reported before any unparsed entities that use it.

          ! * ! * @param name The notation name. ! * @param publicId The notation's public identifier, or null if ! * none was given. ! * @param systemId The notation's system identifier, or null if ! * none was given. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #unparsedEntityDecl ! * @see org.xml.sax.AttributeList ! */ ! public abstract void notationDecl (String name, ! String publicId, ! String systemId) ! throws SAXException; ! ! ! /** ! * Receive notification of an unparsed entity declaration event. ! * ! *

          Note that the notation name corresponds to a notation ! * reported by the {@link #notationDecl notationDecl} event. ! * It is up to the application to record the entity for later ! * reference, if necessary.

          ! * ! *

          If the system identifier is a URL, the parser must resolve it ! * fully before passing it to the application.

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @param name The unparsed entity's name. ! * @param publicId The entity's public identifier, or null if none ! * was given. ! * @param systemId The entity's system identifier. ! * @param notation name The name of the associated notation. ! * @see #notationDecl ! * @see org.xml.sax.AttributeList ! */ ! public abstract void unparsedEntityDecl (String name, ! String publicId, ! String systemId, ! String notationName) ! throws SAXException; ! ! } ! ! // end of DTDHandler.java --- 1,117 ---- ! // SAX DTD handler. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: DTDHandler.java,v 1.5.2.4 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! /** ! * Receive notification of basic DTD-related events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          If a SAX application needs information about notations and ! * unparsed entities, then the application implements this ! * interface and registers an instance with the SAX parser using ! * the parser's setDTDHandler method. The parser uses the ! * instance to report notation and unparsed entity declarations to ! * the application.

          ! * ! *

          Note that this interface includes only those DTD events that ! * the XML recommendation requires processors to report: ! * notation and unparsed entity declarations.

          ! * ! *

          The SAX parser may report these events in any order, regardless ! * of the order in which the notations and unparsed entities were ! * declared; however, all DTD events must be reported after the ! * document handler's startDocument event, and before the first ! * startElement event. ! * (If the {@link org.xml.sax.ext.LexicalHandler LexicalHandler} is ! * used, these events must also be reported before the endDTD event.) ! *

          ! * ! *

          It is up to the application to store the information for ! * future use (perhaps in a hash table or object tree). ! * If the application encounters attributes of type "NOTATION", ! * "ENTITY", or "ENTITIES", it can use the information that it ! * obtained through this interface to find the entity and/or ! * notation corresponding with the attribute value.

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.XMLReader#setDTDHandler ! */ ! public interface DTDHandler { ! ! ! /** ! * Receive notification of a notation declaration event. ! * ! *

          It is up to the application to record the notation for later ! * reference, if necessary; ! * notations may appear as attribute values and in unparsed entity ! * declarations, and are sometime used with processing instruction ! * target names.

          ! * ! *

          At least one of publicId and systemId must be non-null. ! * If a system identifier is present, and it is a URL, the SAX ! * parser must resolve it fully before passing it to the ! * application through this event.

          ! * ! *

          There is no guarantee that the notation declaration will be ! * reported before any unparsed entities that use it.

          ! * ! * @param name The notation name. ! * @param publicId The notation's public identifier, or null if ! * none was given. ! * @param systemId The notation's system identifier, or null if ! * none was given. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see #unparsedEntityDecl ! * @see org.xml.sax.Attributes ! */ ! public abstract void notationDecl (String name, ! String publicId, ! String systemId) ! throws SAXException; ! ! ! /** ! * Receive notification of an unparsed entity declaration event. ! * ! *

          Note that the notation name corresponds to a notation ! * reported by the {@link #notationDecl notationDecl} event. ! * It is up to the application to record the entity for later ! * reference, if necessary; ! * unparsed entities may appear as attribute values. ! *

          ! * ! *

          If the system identifier is a URL, the parser must resolve it ! * fully before passing it to the application.

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @param name The unparsed entity's name. ! * @param publicId The entity's public identifier, or null if none ! * was given. ! * @param systemId The entity's system identifier. ! * @param notationName The name of the associated notation. ! * @see #notationDecl ! * @see org.xml.sax.Attributes ! */ ! public abstract void unparsedEntityDecl (String name, ! String publicId, ! String systemId, ! String notationName) ! throws SAXException; ! ! } ! ! // end of DTDHandler.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/EntityResolver.java gcc-3.3/libjava/org/xml/sax/EntityResolver.java *** gcc-3.2.3/libjava/org/xml/sax/EntityResolver.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/EntityResolver.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,110 **** ! // SAX entity resolver. ! // No warranty; no copyright -- use this as you will. ! // $Id: EntityResolver.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! import java.io.IOException; ! ! ! /** ! * Basic interface for resolving entities. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          If a SAX application needs to implement customized handling ! * for external entities, it must implement this interface and ! * register an instance with the SAX driver using the ! * {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver} ! * method.

          ! * ! *

          The XML reader will then allow the application to intercept any ! * external entities (including the external DTD subset and external ! * parameter entities, if any) before including them.

          ! * ! *

          Many SAX applications will not need to implement this interface, ! * but it will be especially useful for applications that build ! * XML documents from databases or other specialised input sources, ! * or for applications that use URI types other than URLs.

          ! * ! *

          The following resolver would provide the application ! * with a special character stream for the entity with the system ! * identifier "http://www.myhost.com/today":

          ! * ! *
          !  * import org.xml.sax.EntityResolver;
          !  * import org.xml.sax.InputSource;
          !  *
          !  * public class MyResolver implements EntityResolver {
          !  *   public InputSource resolveEntity (String publicId, String systemId)
          !  *   {
          !  *     if (systemId.equals("http://www.myhost.com/today")) {
          !  *              // return a special input source
          !  *       MyReader reader = new MyReader();
          !  *       return new InputSource(reader);
          !  *     } else {
          !  *              // use the default behaviour
          !  *       return null;
          !  *     }
          !  *   }
          !  * }
          !  * 
          ! * ! *

          The application can also use this interface to redirect system ! * identifiers to local URIs or to look up replacements in a catalog ! * (possibly by using the public identifier).

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Parser#setEntityResolver ! * @see org.xml.sax.InputSource ! */ ! public interface EntityResolver { ! ! ! /** ! * Allow the application to resolve external entities. ! * ! *

          The Parser will call this method before opening any external ! * entity except the top-level document entity (including the ! * external DTD subset, external entities referenced within the ! * DTD, and external entities referenced within the document ! * element): the application may request that the parser resolve ! * the entity itself, that it use an alternative URI, or that it ! * use an entirely different input source.

          ! * ! *

          Application writers can use this method to redirect external ! * system identifiers to secure and/or local URIs, to look up ! * public identifiers in a catalogue, or to read an entity from a ! * database or other input source (including, for example, a dialog ! * box).

          ! * ! *

          If the system identifier is a URL, the SAX parser must ! * resolve it fully before reporting it to the application.

          ! * ! * @param publicId The public identifier of the external entity ! * being referenced, or null if none was supplied. ! * @param systemId The system identifier of the external entity ! * being referenced. ! * @return An InputSource object describing the new input source, ! * or null to request that the parser open a regular ! * URI connection to the system identifier. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException A Java-specific IO exception, ! * possibly the result of creating a new InputStream ! * or Reader for the InputSource. ! * @see org.xml.sax.InputSource ! */ ! public abstract InputSource resolveEntity (String publicId, ! String systemId) ! throws SAXException, IOException; ! ! } ! ! // end of EntityResolver.java --- 1,119 ---- ! // SAX entity resolver. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: EntityResolver.java,v 1.7.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! import java.io.IOException; ! ! ! /** ! * Basic interface for resolving entities. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          If a SAX application needs to implement customized handling ! * for external entities, it must implement this interface and ! * register an instance with the SAX driver using the ! * {@link org.xml.sax.XMLReader#setEntityResolver setEntityResolver} ! * method.

          ! * ! *

          The XML reader will then allow the application to intercept any ! * external entities (including the external DTD subset and external ! * parameter entities, if any) before including them.

          ! * ! *

          Many SAX applications will not need to implement this interface, ! * but it will be especially useful for applications that build ! * XML documents from databases or other specialised input sources, ! * or for applications that use URI types other than URLs.

          ! * ! *

          The following resolver would provide the application ! * with a special character stream for the entity with the system ! * identifier "http://www.myhost.com/today":

          ! * ! *
          !  * import org.xml.sax.EntityResolver;
          !  * import org.xml.sax.InputSource;
          !  *
          !  * public class MyResolver implements EntityResolver {
          !  *   public InputSource resolveEntity (String publicId, String systemId)
          !  *   {
          !  *     if (systemId.equals("http://www.myhost.com/today")) {
          !  *              // return a special input source
          !  *       MyReader reader = new MyReader();
          !  *       return new InputSource(reader);
          !  *     } else {
          !  *              // use the default behaviour
          !  *       return null;
          !  *     }
          !  *   }
          !  * }
          !  * 
          ! * ! *

          The application can also use this interface to redirect system ! * identifiers to local URIs or to look up replacements in a catalog ! * (possibly by using the public identifier).

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.XMLReader#setEntityResolver ! * @see org.xml.sax.InputSource ! */ ! public interface EntityResolver { ! ! ! /** ! * Allow the application to resolve external entities. ! * ! *

          The parser will call this method before opening any external ! * entity except the top-level document entity. Such entities include ! * the external DTD subset and external parameter entities referenced ! * within the DTD (in either case, only if the parser reads external ! * parameter entities), and external general entities referenced ! * within the document element (if the parser reads external general ! * entities). The application may request that the parser locate ! * the entity itself, that it use an alternative URI, or that it ! * use data provided by the application (as a character or byte ! * input stream).

          ! * ! *

          Application writers can use this method to redirect external ! * system identifiers to secure and/or local URIs, to look up ! * public identifiers in a catalogue, or to read an entity from a ! * database or other input source (including, for example, a dialog ! * box). Neither XML nor SAX specifies a preferred policy for using ! * public or system IDs to resolve resources. However, SAX specifies ! * how to interpret any InputSource returned by this method, and that ! * if none is returned, then the system ID will be dereferenced as ! * a URL.

          ! * ! *

          If the system identifier is a URL, the SAX parser must ! * resolve it fully before reporting it to the application.

          ! * ! * @param publicId The public identifier of the external entity ! * being referenced, or null if none was supplied. ! * @param systemId The system identifier of the external entity ! * being referenced. ! * @return An InputSource object describing the new input source, ! * or null to request that the parser open a regular ! * URI connection to the system identifier. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException A Java-specific IO exception, ! * possibly the result of creating a new InputStream ! * or Reader for the InputSource. ! * @see org.xml.sax.InputSource ! */ ! public abstract InputSource resolveEntity (String publicId, ! String systemId) ! throws SAXException, IOException; ! ! } ! ! // end of EntityResolver.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/ErrorHandler.java gcc-3.3/libjava/org/xml/sax/ErrorHandler.java *** gcc-3.2.3/libjava/org/xml/sax/ErrorHandler.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/ErrorHandler.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,123 **** ! // SAX error handler. ! // No warranty; no copyright -- use this as you will. ! // $Id: ErrorHandler.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! ! /** ! * Basic interface for SAX error handlers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          If a SAX application needs to implement customized error ! * handling, it must implement this interface and then register an ! * instance with the XML reader using the ! * {@link org.xml.sax.XMLReader#setErrorHandler setErrorHandler} ! * method. The parser will then report all errors and warnings ! * through this interface.

          ! * ! *

          WARNING: If an application does not ! * register an ErrorHandler, XML parsing errors will go unreported ! * and bizarre behaviour may result.

          ! * ! *

          For XML processing errors, a SAX driver must use this interface ! * instead of throwing an exception: it is up to the application ! * to decide whether to throw an exception for different types of ! * errors and warnings. Note, however, that there is no requirement that ! * the parser continue to provide useful information after a call to ! * {@link #fatalError fatalError} (in other words, a SAX driver class ! * could catch an exception and report a fatalError).

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Parser#setErrorHandler ! * @see org.xml.sax.SAXParseException ! */ ! public interface ErrorHandler { ! ! ! /** ! * Receive notification of a warning. ! * ! *

          SAX parsers will use this method to report conditions that ! * are not errors or fatal errors as defined by the XML 1.0 ! * recommendation. The default behaviour is to take no action.

          ! * ! *

          The SAX parser must continue to provide normal parsing events ! * after invoking this method: it should still be possible for the ! * application to process the document through to the end.

          ! * ! *

          Filters may use this method to report other, non-XML warnings ! * as well.

          ! * ! * @param exception The warning information encapsulated in a ! * SAX parse exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void warning (SAXParseException exception) ! throws SAXException; ! ! ! /** ! * Receive notification of a recoverable error. ! * ! *

          This corresponds to the definition of "error" in section 1.2 ! * of the W3C XML 1.0 Recommendation. For example, a validating ! * parser would use this callback to report the violation of a ! * validity constraint. The default behaviour is to take no ! * action.

          ! * ! *

          The SAX parser must continue to provide normal parsing events ! * after invoking this method: it should still be possible for the ! * application to process the document through to the end. If the ! * application cannot do so, then the parser should report a fatal ! * error even if the XML 1.0 recommendation does not require it to ! * do so.

          ! * ! *

          Filters may use this method to report other, non-XML errors ! * as well.

          ! * ! * @param exception The error information encapsulated in a ! * SAX parse exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void error (SAXParseException exception) ! throws SAXException; ! ! ! /** ! * Receive notification of a non-recoverable error. ! * ! *

          This corresponds to the definition of "fatal error" in ! * section 1.2 of the W3C XML 1.0 Recommendation. For example, a ! * parser would use this callback to report the violation of a ! * well-formedness constraint.

          ! * ! *

          The application must assume that the document is unusable ! * after the parser has invoked this method, and should continue ! * (if at all) only for the sake of collecting addition error ! * messages: in fact, SAX parsers are free to stop reporting any ! * other events once this method has been invoked.

          ! * ! * @param exception The error information encapsulated in a ! * SAX parse exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void fatalError (SAXParseException exception) ! throws SAXException; ! ! } ! ! // end of ErrorHandler.java --- 1,125 ---- ! // SAX error handler. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: ErrorHandler.java,v 1.4.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! ! /** ! * Basic interface for SAX error handlers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          If a SAX application needs to implement customized error ! * handling, it must implement this interface and then register an ! * instance with the XML reader using the ! * {@link org.xml.sax.XMLReader#setErrorHandler setErrorHandler} ! * method. The parser will then report all errors and warnings ! * through this interface.

          ! * ! *

          WARNING: If an application does not ! * register an ErrorHandler, XML parsing errors will go unreported ! * and bizarre behaviour may result.

          ! * ! *

          For XML processing errors, a SAX driver must use this interface ! * instead of throwing an exception: it is up to the application ! * to decide whether to throw an exception for different types of ! * errors and warnings. Note, however, that there is no requirement that ! * the parser continue to provide useful information after a call to ! * {@link #fatalError fatalError} (in other words, a SAX driver class ! * could catch an exception and report a fatalError).

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.XMLReader#setErrorHandler ! * @see org.xml.sax.SAXParseException ! */ ! public interface ErrorHandler { ! ! ! /** ! * Receive notification of a warning. ! * ! *

          SAX parsers will use this method to report conditions that ! * are not errors or fatal errors as defined by the XML 1.0 ! * recommendation. The default behaviour is to take no action.

          ! * ! *

          The SAX parser must continue to provide normal parsing events ! * after invoking this method: it should still be possible for the ! * application to process the document through to the end.

          ! * ! *

          Filters may use this method to report other, non-XML warnings ! * as well.

          ! * ! * @param exception The warning information encapsulated in a ! * SAX parse exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void warning (SAXParseException exception) ! throws SAXException; ! ! ! /** ! * Receive notification of a recoverable error. ! * ! *

          This corresponds to the definition of "error" in section 1.2 ! * of the W3C XML 1.0 Recommendation. For example, a validating ! * parser would use this callback to report the violation of a ! * validity constraint. The default behaviour is to take no ! * action.

          ! * ! *

          The SAX parser must continue to provide normal parsing events ! * after invoking this method: it should still be possible for the ! * application to process the document through to the end. If the ! * application cannot do so, then the parser should report a fatal ! * error even if the XML 1.0 recommendation does not require it to ! * do so.

          ! * ! *

          Filters may use this method to report other, non-XML errors ! * as well.

          ! * ! * @param exception The error information encapsulated in a ! * SAX parse exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void error (SAXParseException exception) ! throws SAXException; ! ! ! /** ! * Receive notification of a non-recoverable error. ! * ! *

          This corresponds to the definition of "fatal error" in ! * section 1.2 of the W3C XML 1.0 Recommendation. For example, a ! * parser would use this callback to report the violation of a ! * well-formedness constraint.

          ! * ! *

          The application must assume that the document is unusable ! * after the parser has invoked this method, and should continue ! * (if at all) only for the sake of collecting addition error ! * messages: in fact, SAX parsers are free to stop reporting any ! * other events once this method has been invoked.

          ! * ! * @param exception The error information encapsulated in a ! * SAX parse exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void fatalError (SAXParseException exception) ! throws SAXException; ! ! } ! ! // end of ErrorHandler.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/ext/DeclHandler.java gcc-3.3/libjava/org/xml/sax/ext/DeclHandler.java *** gcc-3.2.3/libjava/org/xml/sax/ext/DeclHandler.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/ext/DeclHandler.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,131 **** ! // DeclHandler.java - Optional handler for DTD declaration events. ! // Public Domain: no warranty. ! // $Id: DeclHandler.java,v 1.1 2000/10/02 02:43:19 sboag Exp $ ! ! package org.xml.sax.ext; ! ! import org.xml.sax.SAXException; ! ! ! /** ! * SAX2 extension handler for DTD declaration events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This is an optional extension handler for SAX2 to provide ! * information about DTD declarations in an XML document. XML ! * readers are not required to support this handler.

          ! * ! *

          Note that data-related DTD declarations (unparsed entities and ! * notations) are already reported through the {@link ! * org.xml.sax.DTDHandler DTDHandler} interface.

          ! * ! *

          If you are using the declaration handler together with a lexical ! * handler, all of the events will occur between the ! * {@link org.xml.sax.ext.LexicalHandler#startDTD startDTD} and the ! * {@link org.xml.sax.ext.LexicalHandler#endDTD endDTD} events.

          ! * ! *

          To set the DeclHandler for an XML reader, use the ! * {@link org.xml.sax.XMLReader#setProperty setProperty} method ! * with the propertyId "http://xml.org/sax/handlers/DeclHandler". ! * If the reader does not support declaration events, it will throw a ! * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException} ! * or a ! * {@link org.xml.sax.SAXNotSupportedException SAXNotSupportedException} ! * when you attempt to register the handler.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0beta ! * @see org.xml.sax.XMLReader ! */ ! public interface DeclHandler ! { ! ! /** ! * Report an element type declaration. ! * ! *

          The content model will consist of the string "EMPTY", the ! * string "ANY", or a parenthesised group, optionally followed ! * by an occurrence indicator. The model will be normalized so ! * that all whitespace is removed,and will include the enclosing ! * parentheses.

          ! * ! * @param name The element type name. ! * @param model The content model as a normalized string. ! * @exception SAXException The application may raise an exception. ! */ ! public abstract void elementDecl (String name, String model) ! throws SAXException; ! ! ! /** ! * Report an attribute type declaration. ! * ! *

          Only the effective (first) declaration for an attribute will ! * be reported. The type will be one of the strings "CDATA", ! * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", ! * "ENTITIES", or "NOTATION", or a parenthesized token group with ! * the separator "|" and all whitespace removed.

          ! * ! * @param eName The name of the associated element. ! * @param aName The name of the attribute. ! * @param type A string representing the attribute type. ! * @param valueDefault A string representing the attribute default ! * ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if ! * none of these applies. ! * @param value A string representing the attribute's default value, ! * or null if there is none. ! * @exception SAXException The application may raise an exception. ! */ ! public abstract void attributeDecl (String eName, ! String aName, ! String type, ! String valueDefault, ! String value) ! throws SAXException; ! ! ! /** ! * Report an internal entity declaration. ! * ! *

          Only the effective (first) declaration for each entity ! * will be reported.

          ! * ! * @param name The name of the entity. If it is a parameter ! * entity, the name will begin with '%'. ! * @param value The replacement text of the entity. ! * @exception SAXException The application may raise an exception. ! * @see #externalEntityDecl ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public abstract void internalEntityDecl (String name, String value) ! throws SAXException; ! ! ! /** ! * Report a parsed external entity declaration. ! * ! *

          Only the effective (first) declaration for each entity ! * will be reported.

          ! * ! * @param name The name of the entity. If it is a parameter ! * entity, the name will begin with '%'. ! * @param publicId The declared public identifier of the entity, or ! * null if none was declared. ! * @param systemId The declared system identifier of the entity. ! * @exception SAXException The application may raise an exception. ! * @see #internalEntityDecl ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public abstract void externalEntityDecl (String name, String publicId, ! String systemId) ! throws SAXException; ! ! } ! ! // end of DeclHandler.java --- 1,143 ---- ! // DeclHandler.java - Optional handler for DTD declaration events. ! // http://www.saxproject.org ! // Public Domain: no warranty. ! // $Id: DeclHandler.java,v 1.2.2.5 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.ext; ! ! import org.xml.sax.SAXException; ! ! ! /** ! * SAX2 extension handler for DTD declaration events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This is an optional extension handler for SAX2 to provide more ! * complete information about DTD declarations in an XML document. ! * XML readers are not required to recognize this handler, and it ! * is not part of core-only SAX2 distributions.

          ! * ! *

          Note that data-related DTD declarations (unparsed entities and ! * notations) are already reported through the {@link ! * org.xml.sax.DTDHandler DTDHandler} interface.

          ! * ! *

          If you are using the declaration handler together with a lexical ! * handler, all of the events will occur between the ! * {@link org.xml.sax.ext.LexicalHandler#startDTD startDTD} and the ! * {@link org.xml.sax.ext.LexicalHandler#endDTD endDTD} events.

          ! * ! *

          To set the DeclHandler for an XML reader, use the ! * {@link org.xml.sax.XMLReader#setProperty setProperty} method ! * with the property name ! * http://xml.org/sax/properties/declaration-handler ! * and an object implementing this interface (or null) as the value. ! * If the reader does not report declaration events, it will throw a ! * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException} ! * when you attempt to register the handler.

          ! * ! * @since SAX 2.0 (extensions 1.0) ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! */ ! public interface DeclHandler ! { ! ! /** ! * Report an element type declaration. ! * ! *

          The content model will consist of the string "EMPTY", the ! * string "ANY", or a parenthesised group, optionally followed ! * by an occurrence indicator. The model will be normalized so ! * that all parameter entities are fully resolved and all whitespace ! * is removed,and will include the enclosing parentheses. Other ! * normalization (such as removing redundant parentheses or ! * simplifying occurrence indicators) is at the discretion of the ! * parser.

          ! * ! * @param name The element type name. ! * @param model The content model as a normalized string. ! * @exception SAXException The application may raise an exception. ! */ ! public abstract void elementDecl (String name, String model) ! throws SAXException; ! ! ! /** ! * Report an attribute type declaration. ! * ! *

          Only the effective (first) declaration for an attribute will ! * be reported. The type will be one of the strings "CDATA", ! * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", ! * "ENTITIES", a parenthesized token group with ! * the separator "|" and all whitespace removed, or the word ! * "NOTATION" followed by a space followed by a parenthesized ! * token group with all whitespace removed.

          ! * ! *

          The value will be the value as reported to applications, ! * appropriately normalized and with entity and character ! * references expanded.

          ! * ! * @param eName The name of the associated element. ! * @param aName The name of the attribute. ! * @param type A string representing the attribute type. ! * @param mode A string representing the attribute defaulting mode ! * ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if ! * none of these applies. ! * @param value A string representing the attribute's default value, ! * or null if there is none. ! * @exception SAXException The application may raise an exception. ! */ ! public abstract void attributeDecl (String eName, ! String aName, ! String type, ! String mode, ! String value) ! throws SAXException; ! ! ! /** ! * Report an internal entity declaration. ! * ! *

          Only the effective (first) declaration for each entity ! * will be reported. All parameter entities in the value ! * will be expanded, but general entities will not.

          ! * ! * @param name The name of the entity. If it is a parameter ! * entity, the name will begin with '%'. ! * @param value The replacement text of the entity. ! * @exception SAXException The application may raise an exception. ! * @see #externalEntityDecl ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public abstract void internalEntityDecl (String name, String value) ! throws SAXException; ! ! ! /** ! * Report a parsed external entity declaration. ! * ! *

          Only the effective (first) declaration for each entity ! * will be reported.

          ! * ! * @param name The name of the entity. If it is a parameter ! * entity, the name will begin with '%'. ! * @param publicId The declared public identifier of the entity, or ! * null if none was declared. ! * @param systemId The declared system identifier of the entity. ! * @exception SAXException The application may raise an exception. ! * @see #internalEntityDecl ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public abstract void externalEntityDecl (String name, String publicId, ! String systemId) ! throws SAXException; ! ! } ! ! // end of DeclHandler.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/ext/LexicalHandler.java gcc-3.3/libjava/org/xml/sax/ext/LexicalHandler.java *** gcc-3.2.3/libjava/org/xml/sax/ext/LexicalHandler.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/ext/LexicalHandler.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,161 **** ! // LexicalHandler.java - optional handler for lexical parse events. ! // Public Domain: no warranty. ! // $Id: LexicalHandler.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.ext; ! ! import org.xml.sax.SAXException; ! ! /** ! * SAX2 extension handler for lexical events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This is an optional extension handler for SAX2 to provide ! * lexical information about an XML document, such as comments ! * and CDATA section boundaries; XML readers are not required to ! * support this handler.

          ! * ! *

          The events in the lexical handler apply to the entire document, ! * not just to the document element, and all lexical handler events ! * must appear between the content handler's startDocument and ! * endDocument events.

          ! * ! *

          To set the LexicalHandler for an XML reader, use the ! * {@link org.xml.sax.XMLReader#setProperty setProperty} method ! * with the propertyId "http://xml.org/sax/handlers/LexicalHandler". ! * If the reader does not support lexical events, it will throw a ! * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException} ! * or a ! * {@link org.xml.sax.SAXNotSupportedException SAXNotSupportedException} ! * when you attempt to register the handler.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0beta ! * @see org.xml.sax.XMLReader#setProperty ! * @see org.xml.sax.SAXNotRecognizedException ! * @see org.xml.sax.SAXNotSupportedException ! */ ! public interface LexicalHandler ! { ! ! /** ! * Report the start of DTD declarations, if any. ! * ! *

          Any declarations are assumed to be in the internal subset ! * unless otherwise indicated by a {@link #startEntity startEntity} ! * event.

          ! * ! *

          Note that the start/endDTD events will appear within ! * the start/endDocument events from ContentHandler and ! * before the first startElement event.

          ! * ! * @param name The document type name. ! * @param publicId The declared public identifier for the ! * external DTD subset, or null if none was declared. ! * @param systemId The declared system identifier for the ! * external DTD subset, or null if none was declared. ! * @exception SAXException The application may raise an ! * exception. ! * @see #endDTD ! * @see #startEntity ! */ ! public abstract void startDTD (String name, String publicId, ! String systemId) ! throws SAXException; ! ! ! /** ! * Report the end of DTD declarations. ! * ! * @exception SAXException The application may raise an exception. ! * @see #startDTD ! */ ! public abstract void endDTD () ! throws SAXException; ! ! ! /** ! * Report the beginning of an entity in content. ! * ! *

          NOTE: entity references in attribute ! * values -- and the start and end of the document entity -- ! * are never reported.

          ! * ! *

          The start and end of the external DTD subset are reported ! * using the pseudo-name "[dtd]". All other events must be ! * properly nested within start/end entity events.

          ! * ! *

          Note that skipped entities will be reported through the ! * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity} ! * event, which is part of the ContentHandler interface.

          ! * ! * @param name The name of the entity. If it is a parameter ! * entity, the name will begin with '%'. ! * @exception SAXException The application may raise an exception. ! * @see #endEntity ! * @see org.xml.sax.ext.DeclHandler#internalEntityDecl ! * @see org.xml.sax.ext.DeclHandler#externalEntityDecl ! */ ! public abstract void startEntity (String name) ! throws SAXException; ! ! ! /** ! * Report the end of an entity. ! * ! * @param name The name of the entity that is ending. ! * @exception SAXException The application may raise an exception. ! * @see #startEntity ! */ ! public abstract void endEntity (String name) ! throws SAXException; ! ! ! /** ! * Report the start of a CDATA section. ! * ! *

          The contents of the CDATA section will be reported through ! * the regular {@link org.xml.sax.ContentHandler#characters ! * characters} event.

          ! * ! * @exception SAXException The application may raise an exception. ! * @see #endCDATA ! */ ! public abstract void startCDATA () ! throws SAXException; ! ! ! /** ! * Report the end of a CDATA section. ! * ! * @exception SAXException The application may raise an exception. ! * @see #startCDATA ! */ ! public abstract void endCDATA () ! throws SAXException; ! ! ! /** ! * Report an XML comment anywhere in the document. ! * ! *

          This callback will be used for comments inside or outside the ! * document element, including comments in the external DTD ! * subset (if read).

          ! * ! * @param ch An array holding the characters in the comment. ! * @param start The starting position in the array. ! * @param length The number of characters to use from the array. ! * @exception SAXException The application may raise an exception. ! */ ! public abstract void comment (char ch[], int start, int length) ! throws SAXException; ! ! } ! ! // end of LexicalHandler.java --- 1,212 ---- ! // LexicalHandler.java - optional handler for lexical parse events. ! // http://www.saxproject.org ! // Public Domain: no warranty. ! // $Id: LexicalHandler.java,v 1.2.2.4 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.ext; ! ! import org.xml.sax.SAXException; ! ! /** ! * SAX2 extension handler for lexical events. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This is an optional extension handler for SAX2 to provide ! * lexical information about an XML document, such as comments ! * and CDATA section boundaries. ! * XML readers are not required to recognize this handler, and it ! * is not part of core-only SAX2 distributions.

          ! * ! *

          The events in the lexical handler apply to the entire document, ! * not just to the document element, and all lexical handler events ! * must appear between the content handler's startDocument and ! * endDocument events.

          ! * ! *

          To set the LexicalHandler for an XML reader, use the ! * {@link org.xml.sax.XMLReader#setProperty setProperty} method ! * with the property name ! * http://xml.org/sax/properties/lexical-handler ! * and an object implementing this interface (or null) as the value. ! * If the reader does not report lexical events, it will throw a ! * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException} ! * when you attempt to register the handler.

          ! * ! * @since SAX 2.0 (extensions 1.0) ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! */ ! public interface LexicalHandler ! { ! ! /** ! * Report the start of DTD declarations, if any. ! * ! *

          This method is intended to report the beginning of the ! * DOCTYPE declaration; if the document has no DOCTYPE declaration, ! * this method will not be invoked.

          ! * ! *

          All declarations reported through ! * {@link org.xml.sax.DTDHandler DTDHandler} or ! * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear ! * between the startDTD and {@link #endDTD endDTD} events. ! * Declarations are assumed to belong to the internal DTD subset ! * unless they appear between {@link #startEntity startEntity} ! * and {@link #endEntity endEntity} events. Comments and ! * processing instructions from the DTD should also be reported ! * between the startDTD and endDTD events, in their original ! * order of (logical) occurrence; they are not required to ! * appear in their correct locations relative to DTDHandler ! * or DeclHandler events, however.

          ! * ! *

          Note that the start/endDTD events will appear within ! * the start/endDocument events from ContentHandler and ! * before the first ! * {@link org.xml.sax.ContentHandler#startElement startElement} ! * event.

          ! * ! * @param name The document type name. ! * @param publicId The declared public identifier for the ! * external DTD subset, or null if none was declared. ! * @param systemId The declared system identifier for the ! * external DTD subset, or null if none was declared. ! * (Note that this is not resolved against the document ! * base URI.) ! * @exception SAXException The application may raise an ! * exception. ! * @see #endDTD ! * @see #startEntity ! */ ! public abstract void startDTD (String name, String publicId, ! String systemId) ! throws SAXException; ! ! ! /** ! * Report the end of DTD declarations. ! * ! *

          This method is intended to report the end of the ! * DOCTYPE declaration; if the document has no DOCTYPE declaration, ! * this method will not be invoked.

          ! * ! * @exception SAXException The application may raise an exception. ! * @see #startDTD ! */ ! public abstract void endDTD () ! throws SAXException; ! ! ! /** ! * Report the beginning of some internal and external XML entities. ! * ! *

          The reporting of parameter entities (including ! * the external DTD subset) is optional, and SAX2 drivers that ! * report LexicalHandler events may not implement it; you can use the ! * http://xml.org/sax/features/lexical-handler/parameter-entities ! * feature to query or control the reporting of parameter entities.

          ! * ! *

          General entities are reported with their regular names, ! * parameter entities have '%' prepended to their names, and ! * the external DTD subset has the pseudo-entity name "[dtd]".

          ! * ! *

          When a SAX2 driver is providing these events, all other ! * events must be properly nested within start/end entity ! * events. There is no additional requirement that events from ! * {@link org.xml.sax.ext.DeclHandler DeclHandler} or ! * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.

          ! * ! *

          Note that skipped entities will be reported through the ! * {@link org.xml.sax.ContentHandler#skippedEntity skippedEntity} ! * event, which is part of the ContentHandler interface.

          ! * ! *

          Because of the streaming event model that SAX uses, some ! * entity boundaries cannot be reported under any ! * circumstances:

          ! * ! *
            ! *
          • general entities within attribute values
          • ! *
          • parameter entities within declarations
          • ! *
          ! * ! *

          These will be silently expanded, with no indication of where ! * the original entity boundaries were.

          ! * ! *

          Note also that the boundaries of character references (which ! * are not really entities anyway) are not reported.

          ! * ! *

          All start/endEntity events must be properly nested. ! * ! * @param name The name of the entity. If it is a parameter ! * entity, the name will begin with '%', and if it is the ! * external DTD subset, it will be "[dtd]". ! * @exception SAXException The application may raise an exception. ! * @see #endEntity ! * @see org.xml.sax.ext.DeclHandler#internalEntityDecl ! * @see org.xml.sax.ext.DeclHandler#externalEntityDecl ! */ ! public abstract void startEntity (String name) ! throws SAXException; ! ! ! /** ! * Report the end of an entity. ! * ! * @param name The name of the entity that is ending. ! * @exception SAXException The application may raise an exception. ! * @see #startEntity ! */ ! public abstract void endEntity (String name) ! throws SAXException; ! ! ! /** ! * Report the start of a CDATA section. ! * ! *

          The contents of the CDATA section will be reported through ! * the regular {@link org.xml.sax.ContentHandler#characters ! * characters} event; this event is intended only to report ! * the boundary.

          ! * ! * @exception SAXException The application may raise an exception. ! * @see #endCDATA ! */ ! public abstract void startCDATA () ! throws SAXException; ! ! ! /** ! * Report the end of a CDATA section. ! * ! * @exception SAXException The application may raise an exception. ! * @see #startCDATA ! */ ! public abstract void endCDATA () ! throws SAXException; ! ! ! /** ! * Report an XML comment anywhere in the document. ! * ! *

          This callback will be used for comments inside or outside the ! * document element, including comments in the external DTD ! * subset (if read). Comments in the DTD must be properly ! * nested inside start/endDTD and start/endEntity events (if ! * used).

          ! * ! * @param ch An array holding the characters in the comment. ! * @param start The starting position in the array. ! * @param length The number of characters to use from the array. ! * @exception SAXException The application may raise an exception. ! */ ! public abstract void comment (char ch[], int start, int length) ! throws SAXException; ! ! } ! ! // end of LexicalHandler.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/ext/package.html gcc-3.3/libjava/org/xml/sax/ext/package.html *** gcc-3.2.3/libjava/org/xml/sax/ext/package.html 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/ext/package.html 2002-12-20 03:50:17.000000000 +0000 *************** *** 0 **** --- 1,49 ---- + + + + +

          + This package contains interfaces to optional SAX2 handlers. + +

          See http://www.saxproject.org + for more information about SAX.

          + +

          + The package is independent of the SAX2 core, though the functionality + exposed generally needs to be implemented within a parser. + That independence has several consequences:

          + +
            + +
          • SAX2 drivers are not required to recognize these handlers, + and you cannot assume that the class files will be present in every SAX2 + installation.
          • + +
          • This package may be updated independently of SAX2 (i.e. new + handlers may be added without updating SAX2 itself).
          • + +
          • The handlers are not implemented by the SAX2 + org.xml.sax.helpers.DefaultHandler or + org.xml.sax.helpers.XMLFilterImpl classes. + You can subclass these if you need such behaviour.
          • + +
          • The handlers need to be registered differently than regular SAX2 + handlers.
          • + +
          + +

          This package, SAX2-ext, is a standardized extension to SAX2. It is + designed both to allow SAX parsers to pass certain types of information + to applications, and to serve as a simple model for other SAX2 parser + extension packages. Not all such extension packages should need to + be recognized directly by parsers, however. + As an example, most schema systems can be cleanly layered on top + of parsers supporting the standardized SAX2 interfaces.

          + +

          NOTE: this package alone does add any + functionality; it simply provides optional interfaces for SAX2 drivers + to use. You must use a SAX2 driver that recognizes these interfaces if + you actually want to have access to lexical and declaration + information.

          + + diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/HandlerBase.java gcc-3.3/libjava/org/xml/sax/HandlerBase.java *** gcc-3.2.3/libjava/org/xml/sax/HandlerBase.java 2001-10-31 00:48:17.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/HandlerBase.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,368 **** ! // SAX default handler base class. ! // No warranty; no copyright -- use this as you will. ! // $Id: HandlerBase.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! /** ! * Default base class for handlers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class implements the default behaviour for four SAX1 ! * interfaces: EntityResolver, DTDHandler, DocumentHandler, ! * and ErrorHandler. It is now obsolete, but is included in SAX2 to ! * support legacy SAX1 applications. SAX2 applications should use ! * the {@link org.xml.sax.helpers.DefaultHandler DefaultHandler} ! * class instead.

          ! * ! *

          Application writers can extend this class when they need to ! * implement only part of an interface; parser writers can ! * instantiate this class to provide default handlers when the ! * application has not supplied its own.

          ! * ! *

          Note that the use of this class is optional.

          ! * ! * @deprecated This class works with the deprecated ! * {@link org.xml.sax.DocumentHandler DocumentHandler} ! * interface. It has been replaced by the SAX2 ! * {@link org.xml.sax.helpers.DefaultHandler DefaultHandler} ! * class. ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.DocumentHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public class HandlerBase ! implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the EntityResolver interface. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Resolve an external entity. ! * ! *

          Always return null, so that the parser will use the system ! * identifier provided in the XML document. This method implements ! * the SAX default behaviour: application writers can override it ! * in a subclass to do special translations such as catalog lookups ! * or URI redirection.

          ! * ! * @param publicId The public identifier, or null if none is ! * available. ! * @param systemId The system identifier provided in the XML ! * document. ! * @return The new input source, or null to require the ! * default behaviour. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.EntityResolver#resolveEntity ! */ ! public InputSource resolveEntity (String publicId, String systemId) ! throws SAXException ! { ! return null; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of DTDHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a notation declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to keep track of the notations ! * declared in a document.

          ! * ! * @param name The notation name. ! * @param publicId The notation public identifier, or null if not ! * available. ! * @param systemId The notation system identifier. ! * @see org.xml.sax.DTDHandler#notationDecl ! */ ! public void notationDecl (String name, String publicId, String systemId) ! { ! // no op ! } ! ! ! /** ! * Receive notification of an unparsed entity declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to keep track of the unparsed entities ! * declared in a document.

          ! * ! * @param name The entity name. ! * @param publicId The entity public identifier, or null if not ! * available. ! * @param systemId The entity system identifier. ! * @param notationName The name of the associated notation. ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public void unparsedEntityDecl (String name, String publicId, ! String systemId, String notationName) ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of DocumentHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive a Locator object for document events. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to store the locator for use ! * with other document events.

          ! * ! * @param locator A locator for all SAX document events. ! * @see org.xml.sax.DocumentHandler#setDocumentLocator ! * @see org.xml.sax.Locator ! */ ! public void setDocumentLocator (Locator locator) ! { ! // no op ! } ! ! ! /** ! * Receive notification of the beginning of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the beginning ! * of a document (such as allocating the root node of a tree or ! * creating an output file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the beginning ! * of a document (such as finalising a tree or closing an output ! * file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the start of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the start of ! * each element (such as allocating a new tree node or writing ! * output to a file).

          ! * ! * @param name The element type name. ! * @param attributes The specified or defaulted attributes. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public void startElement (String name, AttributeList attributes) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end of ! * each element (such as finalising a tree node or writing ! * output to a file).

          ! * ! * @param name The element type name. ! * @param attributes The specified or defaulted attributes. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#endElement ! */ ! public void endElement (String name) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of character data inside an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of character data ! * (such as adding the data to a node or buffer, or printing it to ! * a file).

          ! * ! * @param ch The characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of ignorable ! * whitespace (such as adding data to a node or buffer, or printing ! * it to a file).

          ! * ! * @param ch The whitespace characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions for each ! * processing instruction, such as setting status variables or ! * invoking other methods.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none is supplied. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the ErrorHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a parser warning. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each warning, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void warning (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a recoverable parser error. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each error, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void error (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Report a fatal XML parsing error. ! * ! *

          The default implementation throws a SAXParseException. ! * Application writers may override this method in a subclass if ! * they need to take specific actions for each fatal error (such as ! * collecting all of the errors into a single report): in any case, ! * the application must stop all regular processing when this ! * method is invoked, since the document is no longer reliable, and ! * the parser may no longer report parsing events.

          ! * ! * @param e The error information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#fatalError ! * @see org.xml.sax.SAXParseException ! */ ! public void fatalError (SAXParseException e) ! throws SAXException ! { ! throw e; ! } ! ! } ! ! // end of HandlerBase.java --- 1,370 ---- ! // SAX default handler base class. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: HandlerBase.java,v 1.3.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! /** ! * Default base class for handlers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class implements the default behaviour for four SAX1 ! * interfaces: EntityResolver, DTDHandler, DocumentHandler, ! * and ErrorHandler. It is now obsolete, but is included in SAX2 to ! * support legacy SAX1 applications. SAX2 applications should use ! * the {@link org.xml.sax.helpers.DefaultHandler DefaultHandler} ! * class instead.

          ! * ! *

          Application writers can extend this class when they need to ! * implement only part of an interface; parser writers can ! * instantiate this class to provide default handlers when the ! * application has not supplied its own.

          ! * ! *

          Note that the use of this class is optional.

          ! * ! * @deprecated This class works with the deprecated ! * {@link org.xml.sax.DocumentHandler DocumentHandler} ! * interface. It has been replaced by the SAX2 ! * {@link org.xml.sax.helpers.DefaultHandler DefaultHandler} ! * class. ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.DocumentHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public class HandlerBase ! implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the EntityResolver interface. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Resolve an external entity. ! * ! *

          Always return null, so that the parser will use the system ! * identifier provided in the XML document. This method implements ! * the SAX default behaviour: application writers can override it ! * in a subclass to do special translations such as catalog lookups ! * or URI redirection.

          ! * ! * @param publicId The public identifer, or null if none is ! * available. ! * @param systemId The system identifier provided in the XML ! * document. ! * @return The new input source, or null to require the ! * default behaviour. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.EntityResolver#resolveEntity ! */ ! public InputSource resolveEntity (String publicId, String systemId) ! throws SAXException ! { ! return null; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of DTDHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a notation declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to keep track of the notations ! * declared in a document.

          ! * ! * @param name The notation name. ! * @param publicId The notation public identifier, or null if not ! * available. ! * @param systemId The notation system identifier. ! * @see org.xml.sax.DTDHandler#notationDecl ! */ ! public void notationDecl (String name, String publicId, String systemId) ! { ! // no op ! } ! ! ! /** ! * Receive notification of an unparsed entity declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to keep track of the unparsed entities ! * declared in a document.

          ! * ! * @param name The entity name. ! * @param publicId The entity public identifier, or null if not ! * available. ! * @param systemId The entity system identifier. ! * @param notationName The name of the associated notation. ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public void unparsedEntityDecl (String name, String publicId, ! String systemId, String notationName) ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of DocumentHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive a Locator object for document events. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to store the locator for use ! * with other document events.

          ! * ! * @param locator A locator for all SAX document events. ! * @see org.xml.sax.DocumentHandler#setDocumentLocator ! * @see org.xml.sax.Locator ! */ ! public void setDocumentLocator (Locator locator) ! { ! // no op ! } ! ! ! /** ! * Receive notification of the beginning of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the beginning ! * of a document (such as allocating the root node of a tree or ! * creating an output file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the beginning ! * of a document (such as finalising a tree or closing an output ! * file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the start of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the start of ! * each element (such as allocating a new tree node or writing ! * output to a file).

          ! * ! * @param name The element type name. ! * @param attributes The specified or defaulted attributes. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public void startElement (String name, AttributeList attributes) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end of ! * each element (such as finalising a tree node or writing ! * output to a file).

          ! * ! * @param name The element type name. ! * @param attributes The specified or defaulted attributes. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#endElement ! */ ! public void endElement (String name) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of character data inside an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of character data ! * (such as adding the data to a node or buffer, or printing it to ! * a file).

          ! * ! * @param ch The characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of ignorable ! * whitespace (such as adding data to a node or buffer, or printing ! * it to a file).

          ! * ! * @param ch The whitespace characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions for each ! * processing instruction, such as setting status variables or ! * invoking other methods.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none is supplied. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DocumentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the ErrorHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a parser warning. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each warning, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void warning (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a recoverable parser error. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each error, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void error (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Report a fatal XML parsing error. ! * ! *

          The default implementation throws a SAXParseException. ! * Application writers may override this method in a subclass if ! * they need to take specific actions for each fatal error (such as ! * collecting all of the errors into a single report): in any case, ! * the application must stop all regular processing when this ! * method is invoked, since the document is no longer reliable, and ! * the parser may no longer report parsing events.

          ! * ! * @param e The error information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#fatalError ! * @see org.xml.sax.SAXParseException ! */ ! public void fatalError (SAXParseException e) ! throws SAXException ! { ! throw e; ! } ! ! } ! ! // end of HandlerBase.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/AttributeListImpl.java gcc-3.3/libjava/org/xml/sax/helpers/AttributeListImpl.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/AttributeListImpl.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/AttributeListImpl.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,310 **** ! // SAX default implementation for AttributeList. ! // No warranty; no copyright -- use this as you will. ! // $Id: AttributeListImpl.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import org.xml.sax.AttributeList; ! ! import java.util.Vector; ! ! ! /** ! * Default implementation for AttributeList. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          AttributeList implements the deprecated SAX1 {@link ! * org.xml.sax.AttributeList AttributeList} interface, and has been ! * replaced by the new SAX2 {@link org.xml.sax.helpers.AttributesImpl ! * AttributesImpl} interface.

          ! * ! *

          This class provides a convenience implementation of the SAX ! * {@link org.xml.sax.AttributeList AttributeList} interface. This ! * implementation is useful both for SAX parser writers, who can use ! * it to provide attributes to the application, and for SAX application ! * writers, who can use it to create a persistent copy of an element's ! * attribute specifications:

          ! * ! *
          !  * private AttributeList myatts;
          !  *
          !  * public void startElement (String name, AttributeList atts)
          !  * {
          !  *              // create a persistent copy of the attribute list
          !  *              // for use outside this method
          !  *   myatts = new AttributeListImpl(atts);
          !  *   [...]
          !  * }
          !  * 
          ! * ! *

          Please note that SAX parsers are not required to use this ! * class to provide an implementation of AttributeList; it is ! * supplied only as an optional convenience. In particular, ! * parser writers are encouraged to invent more efficient ! * implementations.

          ! * ! * @deprecated This class implements a deprecated interface, ! * {@link org.xml.sax.AttributeList AttributeList}; ! * that interface has been replaced by ! * {@link org.xml.sax.Attributes Attributes}, ! * which is implemented in the ! * {@link org.xml.sax.helpers.AttributesImpl ! * AttributesImpl} helper class. ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.AttributeList ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public class AttributeListImpl implements AttributeList ! { ! ! /** ! * Create an empty attribute list. ! * ! *

          This constructor is most useful for parser writers, who ! * will use it to create a single, reusable attribute list that ! * can be reset with the clear method between elements.

          ! * ! * @see #addAttribute ! * @see #clear ! */ ! public AttributeListImpl () ! { ! } ! ! ! /** ! * Construct a persistent copy of an existing attribute list. ! * ! *

          This constructor is most useful for application writers, ! * who will use it to create a persistent copy of an existing ! * attribute list.

          ! * ! * @param atts The attribute list to copy ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public AttributeListImpl (AttributeList atts) ! { ! setAttributeList(atts); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Methods specific to this class. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the attribute list, discarding previous contents. ! * ! *

          This method allows an application writer to reuse an ! * attribute list easily.

          ! * ! * @param atts The attribute list to copy. ! */ ! public void setAttributeList (AttributeList atts) ! { ! int count = atts.getLength(); ! ! clear(); ! ! for (int i = 0; i < count; i++) { ! addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i)); ! } ! } ! ! ! /** ! * Add an attribute to an attribute list. ! * ! *

          This method is provided for SAX parser writers, to allow them ! * to build up an attribute list incrementally before delivering ! * it to the application.

          ! * ! * @param name The attribute name. ! * @param type The attribute type ("NMTOKEN" for an enumeration). ! * @param value The attribute value (must not be null). ! * @see #removeAttribute ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public void addAttribute (String name, String type, String value) ! { ! names.addElement(name); ! types.addElement(type); ! values.addElement(value); ! } ! ! ! /** ! * Remove an attribute from the list. ! * ! *

          SAX application writers can use this method to filter an ! * attribute out of an AttributeList. Note that invoking this ! * method will change the length of the attribute list and ! * some of the attribute's indices.

          ! * ! *

          If the requested attribute is not in the list, this is ! * a no-op.

          ! * ! * @param name The attribute name. ! * @see #addAttribute ! */ ! public void removeAttribute (String name) ! { ! int i = names.indexOf(name); ! ! if (i >= 0) { ! names.removeElementAt(i); ! types.removeElementAt(i); ! values.removeElementAt(i); ! } ! } ! ! ! /** ! * Clear the attribute list. ! * ! *

          SAX parser writers can use this method to reset the attribute ! * list between DocumentHandler.startElement events. Normally, ! * it will make sense to reuse the same AttributeListImpl object ! * rather than allocating a new one each time.

          ! * ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public void clear () ! { ! names.removeAllElements(); ! types.removeAllElements(); ! values.removeAllElements(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.AttributeList ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in the list. ! * ! * @return The number of attributes in the list. ! * @see org.xml.sax.AttributeList#getLength ! */ ! public int getLength () ! { ! return names.size(); ! } ! ! ! /** ! * Get the name of an attribute (by position). ! * ! * @param i The position of the attribute in the list. ! * @return The attribute name as a string, or null if there ! * is no attribute at that position. ! * @see org.xml.sax.AttributeList#getName(int) ! */ ! public String getName (int i) ! { ! if (i < 0) { ! return null; ! } ! try { ! return (String)names.elementAt(i); ! } catch (ArrayIndexOutOfBoundsException e) { ! return null; ! } ! } ! ! ! /** ! * Get the type of an attribute (by position). ! * ! * @param i The position of the attribute in the list. ! * @return The attribute type as a string ("NMTOKEN" for an ! * enumeration, and "CDATA" if no declaration was ! * read), or null if there is no attribute at ! * that position. ! * @see org.xml.sax.AttributeList#getType(int) ! */ ! public String getType (int i) ! { ! if (i < 0) { ! return null; ! } ! try { ! return (String)types.elementAt(i); ! } catch (ArrayIndexOutOfBoundsException e) { ! return null; ! } ! } ! ! ! /** ! * Get the value of an attribute (by position). ! * ! * @param i The position of the attribute in the list. ! * @return The attribute value as a string, or null if ! * there is no attribute at that position. ! * @see org.xml.sax.AttributeList#getValue(int) ! */ ! public String getValue (int i) ! { ! if (i < 0) { ! return null; ! } ! try { ! return (String)values.elementAt(i); ! } catch (ArrayIndexOutOfBoundsException e) { ! return null; ! } ! } ! ! ! /** ! * Get the type of an attribute (by name). ! * ! * @param name The attribute name. ! * @return The attribute type as a string ("NMTOKEN" for an ! * enumeration, and "CDATA" if no declaration was ! * read). ! * @see org.xml.sax.AttributeList#getType(java.lang.String) ! */ ! public String getType (String name) ! { ! return getType(names.indexOf(name)); ! } ! ! ! /** ! * Get the value of an attribute (by name). ! * ! * @param name The attribute name. ! * @see org.xml.sax.AttributeList#getValue(java.lang.String) ! */ ! public String getValue (String name) ! { ! return getValue(names.indexOf(name)); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! Vector names = new Vector(); ! Vector types = new Vector(); ! Vector values = new Vector(); ! ! } ! ! // end of AttributeListImpl.java --- 1,312 ---- ! // SAX default implementation for AttributeList. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: AttributeListImpl.java,v 1.3.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import org.xml.sax.AttributeList; ! ! import java.util.Vector; ! ! ! /** ! * Default implementation for AttributeList. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          AttributeList implements the deprecated SAX1 {@link ! * org.xml.sax.AttributeList AttributeList} interface, and has been ! * replaced by the new SAX2 {@link org.xml.sax.helpers.AttributesImpl ! * AttributesImpl} interface.

          ! * ! *

          This class provides a convenience implementation of the SAX ! * {@link org.xml.sax.AttributeList AttributeList} interface. This ! * implementation is useful both for SAX parser writers, who can use ! * it to provide attributes to the application, and for SAX application ! * writers, who can use it to create a persistent copy of an element's ! * attribute specifications:

          ! * ! *
          !  * private AttributeList myatts;
          !  *
          !  * public void startElement (String name, AttributeList atts)
          !  * {
          !  *              // create a persistent copy of the attribute list
          !  *              // for use outside this method
          !  *   myatts = new AttributeListImpl(atts);
          !  *   [...]
          !  * }
          !  * 
          ! * ! *

          Please note that SAX parsers are not required to use this ! * class to provide an implementation of AttributeList; it is ! * supplied only as an optional convenience. In particular, ! * parser writers are encouraged to invent more efficient ! * implementations.

          ! * ! * @deprecated This class implements a deprecated interface, ! * {@link org.xml.sax.AttributeList AttributeList}; ! * that interface has been replaced by ! * {@link org.xml.sax.Attributes Attributes}, ! * which is implemented in the ! * {@link org.xml.sax.helpers.AttributesImpl ! * AttributesImpl} helper class. ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.AttributeList ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public class AttributeListImpl implements AttributeList ! { ! ! /** ! * Create an empty attribute list. ! * ! *

          This constructor is most useful for parser writers, who ! * will use it to create a single, reusable attribute list that ! * can be reset with the clear method between elements.

          ! * ! * @see #addAttribute ! * @see #clear ! */ ! public AttributeListImpl () ! { ! } ! ! ! /** ! * Construct a persistent copy of an existing attribute list. ! * ! *

          This constructor is most useful for application writers, ! * who will use it to create a persistent copy of an existing ! * attribute list.

          ! * ! * @param atts The attribute list to copy ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public AttributeListImpl (AttributeList atts) ! { ! setAttributeList(atts); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Methods specific to this class. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the attribute list, discarding previous contents. ! * ! *

          This method allows an application writer to reuse an ! * attribute list easily.

          ! * ! * @param atts The attribute list to copy. ! */ ! public void setAttributeList (AttributeList atts) ! { ! int count = atts.getLength(); ! ! clear(); ! ! for (int i = 0; i < count; i++) { ! addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i)); ! } ! } ! ! ! /** ! * Add an attribute to an attribute list. ! * ! *

          This method is provided for SAX parser writers, to allow them ! * to build up an attribute list incrementally before delivering ! * it to the application.

          ! * ! * @param name The attribute name. ! * @param type The attribute type ("NMTOKEN" for an enumeration). ! * @param value The attribute value (must not be null). ! * @see #removeAttribute ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public void addAttribute (String name, String type, String value) ! { ! names.addElement(name); ! types.addElement(type); ! values.addElement(value); ! } ! ! ! /** ! * Remove an attribute from the list. ! * ! *

          SAX application writers can use this method to filter an ! * attribute out of an AttributeList. Note that invoking this ! * method will change the length of the attribute list and ! * some of the attribute's indices.

          ! * ! *

          If the requested attribute is not in the list, this is ! * a no-op.

          ! * ! * @param name The attribute name. ! * @see #addAttribute ! */ ! public void removeAttribute (String name) ! { ! int i = names.indexOf(name); ! ! if (i >= 0) { ! names.removeElementAt(i); ! types.removeElementAt(i); ! values.removeElementAt(i); ! } ! } ! ! ! /** ! * Clear the attribute list. ! * ! *

          SAX parser writers can use this method to reset the attribute ! * list between DocumentHandler.startElement events. Normally, ! * it will make sense to reuse the same AttributeListImpl object ! * rather than allocating a new one each time.

          ! * ! * @see org.xml.sax.DocumentHandler#startElement ! */ ! public void clear () ! { ! names.removeAllElements(); ! types.removeAllElements(); ! values.removeAllElements(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.AttributeList ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in the list. ! * ! * @return The number of attributes in the list. ! * @see org.xml.sax.AttributeList#getLength ! */ ! public int getLength () ! { ! return names.size(); ! } ! ! ! /** ! * Get the name of an attribute (by position). ! * ! * @param i The position of the attribute in the list. ! * @return The attribute name as a string, or null if there ! * is no attribute at that position. ! * @see org.xml.sax.AttributeList#getName(int) ! */ ! public String getName (int i) ! { ! if (i < 0) { ! return null; ! } ! try { ! return (String)names.elementAt(i); ! } catch (ArrayIndexOutOfBoundsException e) { ! return null; ! } ! } ! ! ! /** ! * Get the type of an attribute (by position). ! * ! * @param i The position of the attribute in the list. ! * @return The attribute type as a string ("NMTOKEN" for an ! * enumeration, and "CDATA" if no declaration was ! * read), or null if there is no attribute at ! * that position. ! * @see org.xml.sax.AttributeList#getType(int) ! */ ! public String getType (int i) ! { ! if (i < 0) { ! return null; ! } ! try { ! return (String)types.elementAt(i); ! } catch (ArrayIndexOutOfBoundsException e) { ! return null; ! } ! } ! ! ! /** ! * Get the value of an attribute (by position). ! * ! * @param i The position of the attribute in the list. ! * @return The attribute value as a string, or null if ! * there is no attribute at that position. ! * @see org.xml.sax.AttributeList#getValue(int) ! */ ! public String getValue (int i) ! { ! if (i < 0) { ! return null; ! } ! try { ! return (String)values.elementAt(i); ! } catch (ArrayIndexOutOfBoundsException e) { ! return null; ! } ! } ! ! ! /** ! * Get the type of an attribute (by name). ! * ! * @param name The attribute name. ! * @return The attribute type as a string ("NMTOKEN" for an ! * enumeration, and "CDATA" if no declaration was ! * read). ! * @see org.xml.sax.AttributeList#getType(java.lang.String) ! */ ! public String getType (String name) ! { ! return getType(names.indexOf(name)); ! } ! ! ! /** ! * Get the value of an attribute (by name). ! * ! * @param name The attribute name. ! * @see org.xml.sax.AttributeList#getValue(java.lang.String) ! */ ! public String getValue (String name) ! { ! return getValue(names.indexOf(name)); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! Vector names = new Vector(); ! Vector types = new Vector(); ! Vector values = new Vector(); ! ! } ! ! // end of AttributeListImpl.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/AttributesImpl.java gcc-3.3/libjava/org/xml/sax/helpers/AttributesImpl.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/AttributesImpl.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/AttributesImpl.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,606 **** ! // AttributesImpl.java - default implementation of Attributes. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: AttributesImpl.java,v 1.2 2001/05/31 16:03:17 garyp Exp $ ! ! ! package org.xml.sax.helpers; ! ! import org.xml.sax.Attributes; ! ! ! /** ! * Default implementation of the Attributes interface. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class provides a default implementation of the SAX2 ! * {@link org.xml.sax.Attributes Attributes} interface, with the ! * addition of manipulators so that the list can be modified or ! * reused.

          ! * ! *

          There are two typical uses of this class:

          ! * ! *
            ! *
          1. to take a persistent snapshot of an Attributes object ! * in a {@link org.xml.sax.ContentHandler#startElement startElement} event; or
          2. ! *
          3. to construct or modify an Attributes object in a SAX2 driver or filter.
          4. ! *
          ! * ! *

          This class replaces the now-deprecated SAX1 {@link ! * org.xml.sax.helpers.AttributeListImpl AttributeListImpl} ! * class; in addition to supporting the updated Attributes ! * interface rather than the deprecated {@link org.xml.sax.AttributeList ! * AttributeList} interface, it also includes a much more efficient ! * implementation using a single array rather than a set of Vectors.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! */ ! public class AttributesImpl implements Attributes ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructors. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Construct a new, empty AttributesImpl object. ! */ ! public AttributesImpl () ! { ! length = 0; ! data = null; ! } ! ! ! /** ! * Copy an existing Attributes object. ! * ! *

          This constructor is especially useful inside a ! * {@link org.xml.sax.ContentHandler#startElement startElement} event.

          ! * ! * @param atts The existing Attributes object. ! */ ! public AttributesImpl (Attributes atts) ! { ! setAttributes(atts); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.Attributes. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in the list. ! * ! * @return The number of attributes in the list. ! * @see org.xml.sax.Attributes#getLength ! */ ! public int getLength () ! { ! return length; ! } ! ! ! /** ! * Return an attribute's Namespace URI. ! * ! * @param index The attribute's index (zero-based). ! * @return The Namespace URI, the empty string if none is ! * available, or null if the index is out of range. ! * @see org.xml.sax.Attributes#getURI ! */ ! public String getURI (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's local name. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's local name, the empty string if ! * none is available, or null if the index if out of range. ! * @see org.xml.sax.Attributes#getLocalName ! */ ! public String getLocalName (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+1]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's qualified (prefixed) name. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's qualified name, the empty string if ! * none is available, or null if the index is out of bounds. ! * @see org.xml.sax.Attributes#getQName ! */ ! public String getQName (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+2]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's type by index. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's type, "CDATA" if the type is unknown, or null ! * if the index is out of bounds. ! * @see org.xml.sax.Attributes#getType(int) ! */ ! public String getType (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+3]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's value by index. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's value or null if the index is out of bounds. ! * @see org.xml.sax.Attributes#getValue(int) ! */ ! public String getValue (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+4]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Look up an attribute's index by Namespace name. ! * ! *

          In many cases, it will be more efficient to look up the name once and ! * use the index query methods rather than using the name query methods ! * repeatedly.

          ! * ! * @param uri The attribute's Namespace URI, or the empty ! * string if none is available. ! * @param localName The attribute's local name. ! * @return The attribute's index, or -1 if none matches. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String) ! */ ! public int getIndex (String uri, String localName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i].equals(uri) && data[i+1].equals(localName)) { ! return i / 5; ! } ! } ! return -1; ! } ! ! ! /** ! * Look up an attribute's index by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's index, or -1 if none matches. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String) ! */ ! public int getIndex (String qName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i+2].equals(qName)) { ! return i / 5; ! } ! } ! return -1; ! } ! ! ! /** ! * Look up an attribute's type by Namespace-qualified name. ! * ! * @param uri The Namespace URI, or the empty string for a name ! * with no explicit Namespace URI. ! * @param localName The local name. ! * @return The attribute's type, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getType(java.lang.String,java.lang.String) ! */ ! public String getType (String uri, String localName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i].equals(uri) && data[i+1].equals(localName)) { ! return data[i+3]; ! } ! } ! return null; ! } ! ! ! /** ! * Look up an attribute's type by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's type, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getType(java.lang.String) ! */ ! public String getType (String qName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i+2].equals(qName)) { ! return data[i+3]; ! } ! } ! return null; ! } ! ! ! /** ! * Look up an attribute's value by Namespace-qualified name. ! * ! * @param uri The Namespace URI, or the empty string for a name ! * with no explicit Namespace URI. ! * @param localName The local name. ! * @return The attribute's value, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getValue(java.lang.String,java.lang.String) ! */ ! public String getValue (String uri, String localName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i].equals(uri) && data[i+1].equals(localName)) { ! return data[i+4]; ! } ! } ! return null; ! } ! ! ! /** ! * Look up an attribute's value by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's value, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getValue(java.lang.String) ! */ ! public String getValue (String qName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i+2].equals(qName)) { ! return data[i+4]; ! } ! } ! return null; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Manipulators. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Clear the attribute list for reuse. ! * ! *

          Note that no memory is actually freed by this call: ! * the current arrays are kept so that they can be ! * reused.

          ! */ ! public void clear () ! { ! length = 0; ! } ! ! ! /** ! * Copy an entire Attributes object. ! * ! *

          It may be more efficient to reuse an existing object ! * rather than constantly allocating new ones.

          ! * ! * @param atts The attributes to copy. ! */ ! public void setAttributes (Attributes atts) ! { ! clear(); ! length = atts.getLength(); ! data = new String[length*5]; ! for (int i = 0; i < length; i++) { ! data[i*5] = atts.getURI(i); ! data[i*5+1] = atts.getLocalName(i); ! data[i*5+2] = atts.getQName(i); ! data[i*5+3] = atts.getType(i); ! data[i*5+4] = atts.getValue(i); ! } ! } ! ! ! /** ! * Add an attribute to the end of the list. ! * ! *

          For the sake of speed, this method does no checking ! * to see if the attribute is already in the list: that is ! * the responsibility of the application.

          ! * ! * @param uri The Namespace URI, or the empty string if ! * none is available or Namespace processing is not ! * being performed. ! * @param localName The local name, or the empty string if ! * Namespace processing is not being performed. ! * @param qName The qualified (prefixed) name, or the empty string ! * if qualified names are not available. ! * @param type The attribute type as a string. ! * @param value The attribute value. ! */ ! public void addAttribute (String uri, String localName, String qName, ! String type, String value) ! { ! ensureCapacity(length+1); ! data[length*5] = uri; ! data[length*5+1] = localName; ! data[length*5+2] = qName; ! data[length*5+3] = type; ! data[length*5+4] = value; ! length++; ! } ! ! ! /** ! * Set an attribute in the list. ! * ! *

          For the sake of speed, this method does no checking ! * for name conflicts or well-formedness: such checks are the ! * responsibility of the application.

          ! * ! * @param index The index of the attribute (zero-based). ! * @param uri The Namespace URI, or the empty string if ! * none is available or Namespace processing is not ! * being performed. ! * @param localName The local name, or the empty string if ! * Namespace processing is not being performed. ! * @param qName The qualified name, or the empty string ! * if qualified names are not available. ! * @param type The attribute type as a string. ! * @param value The attribute value. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setAttribute (int index, String uri, String localName, ! String qName, String type, String value) ! { ! if (index >= 0 && index < length) { ! data[index*5] = uri; ! data[index*5+1] = localName; ! data[index*5+2] = qName; ! data[index*5+3] = type; ! data[index*5+4] = value; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Remove an attribute from the list. ! * ! * @param index The index of the attribute (zero-based). ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void removeAttribute (int index) ! { ! if (index >= 0 && index < length) { ! data[index*5] = null; ! data[index*5+1] = null; ! data[index*5+2] = null; ! data[index*5+3] = null; ! data[index*5+4] = null; ! if (index < length - 1) { ! System.arraycopy(data, (index+1)*5, data, index*5, ! (length-index-1)*5); ! } ! length--; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the Namespace URI of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param uri The attribute's Namespace URI, or the empty ! * string for none. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setURI (int index, String uri) ! { ! if (index >= 0 && index < length) { ! data[index*5] = uri; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the local name of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param localName The attribute's local name, or the empty ! * string for none. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setLocalName (int index, String localName) ! { ! if (index >= 0 && index < length) { ! data[index*5+1] = localName; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the qualified name of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param qName The attribute's qualified name, or the empty ! * string for none. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setQName (int index, String qName) ! { ! if (index >= 0 && index < length) { ! data[index*5+2] = qName; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the type of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param type The attribute's type. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setType (int index, String type) ! { ! if (index >= 0 && index < length) { ! data[index*5+3] = type; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the value of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param value The attribute's value. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setValue (int index, String value) ! { ! if (index >= 0 && index < length) { ! data[index*5+4] = value; ! } else { ! badIndex(index); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Ensure the internal array's capacity. ! * ! * @param n The minimum number of attributes that the array must ! * be able to hold. ! */ ! private void ensureCapacity (int n) ! { ! if (n > 0 && data == null) { ! data = new String[25]; ! } ! ! int max = data.length; ! if (max >= n * 5) { ! return; ! } ! ! ! while (max < n * 5) { ! max *= 2; ! } ! String newData[] = new String[max]; ! System.arraycopy(data, 0, newData, 0, length*5); ! data = newData; ! } ! ! ! /** ! * Report a bad array index in a manipulator. ! * ! * @param index The index to report. ! * @exception java.lang.ArrayIndexOutOfBoundsException Always. ! */ ! private void badIndex (int index) ! throws ArrayIndexOutOfBoundsException ! { ! String msg = ! "Attempt to modify attribute at illegal index: " + index; ! throw new ArrayIndexOutOfBoundsException(msg); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! int length; ! String data []; ! ! } ! ! // end of AttributesImpl.java ! --- 1,620 ---- ! // AttributesImpl.java - default implementation of Attributes. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: AttributesImpl.java,v 1.6.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! ! package org.xml.sax.helpers; ! ! import org.xml.sax.Attributes; ! ! ! /** ! * Default implementation of the Attributes interface. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class provides a default implementation of the SAX2 ! * {@link org.xml.sax.Attributes Attributes} interface, with the ! * addition of manipulators so that the list can be modified or ! * reused.

          ! * ! *

          There are two typical uses of this class:

          ! * ! *
            ! *
          1. to take a persistent snapshot of an Attributes object ! * in a {@link org.xml.sax.ContentHandler#startElement startElement} event; or
          2. ! *
          3. to construct or modify an Attributes object in a SAX2 driver or filter.
          4. ! *
          ! * ! *

          This class replaces the now-deprecated SAX1 {@link ! * org.xml.sax.helpers.AttributeListImpl AttributeListImpl} ! * class; in addition to supporting the updated Attributes ! * interface rather than the deprecated {@link org.xml.sax.AttributeList ! * AttributeList} interface, it also includes a much more efficient ! * implementation using a single array rather than a set of Vectors.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! */ ! public class AttributesImpl implements Attributes ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructors. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Construct a new, empty AttributesImpl object. ! */ ! public AttributesImpl () ! { ! length = 0; ! data = null; ! } ! ! ! /** ! * Copy an existing Attributes object. ! * ! *

          This constructor is especially useful inside a ! * {@link org.xml.sax.ContentHandler#startElement startElement} event.

          ! * ! * @param atts The existing Attributes object. ! */ ! public AttributesImpl (Attributes atts) ! { ! setAttributes(atts); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.Attributes. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the number of attributes in the list. ! * ! * @return The number of attributes in the list. ! * @see org.xml.sax.Attributes#getLength ! */ ! public int getLength () ! { ! return length; ! } ! ! ! /** ! * Return an attribute's Namespace URI. ! * ! * @param index The attribute's index (zero-based). ! * @return The Namespace URI, the empty string if none is ! * available, or null if the index is out of range. ! * @see org.xml.sax.Attributes#getURI ! */ ! public String getURI (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's local name. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's local name, the empty string if ! * none is available, or null if the index if out of range. ! * @see org.xml.sax.Attributes#getLocalName ! */ ! public String getLocalName (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+1]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's qualified (prefixed) name. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's qualified name, the empty string if ! * none is available, or null if the index is out of bounds. ! * @see org.xml.sax.Attributes#getQName ! */ ! public String getQName (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+2]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's type by index. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's type, "CDATA" if the type is unknown, or null ! * if the index is out of bounds. ! * @see org.xml.sax.Attributes#getType(int) ! */ ! public String getType (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+3]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Return an attribute's value by index. ! * ! * @param index The attribute's index (zero-based). ! * @return The attribute's value or null if the index is out of bounds. ! * @see org.xml.sax.Attributes#getValue(int) ! */ ! public String getValue (int index) ! { ! if (index >= 0 && index < length) { ! return data[index*5+4]; ! } else { ! return null; ! } ! } ! ! ! /** ! * Look up an attribute's index by Namespace name. ! * ! *

          In many cases, it will be more efficient to look up the name once and ! * use the index query methods rather than using the name query methods ! * repeatedly.

          ! * ! * @param uri The attribute's Namespace URI, or the empty ! * string if none is available. ! * @param localName The attribute's local name. ! * @return The attribute's index, or -1 if none matches. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String) ! */ ! public int getIndex (String uri, String localName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i].equals(uri) && data[i+1].equals(localName)) { ! return i / 5; ! } ! } ! return -1; ! } ! ! ! /** ! * Look up an attribute's index by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's index, or -1 if none matches. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String) ! */ ! public int getIndex (String qName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i+2].equals(qName)) { ! return i / 5; ! } ! } ! return -1; ! } ! ! ! /** ! * Look up an attribute's type by Namespace-qualified name. ! * ! * @param uri The Namespace URI, or the empty string for a name ! * with no explicit Namespace URI. ! * @param localName The local name. ! * @return The attribute's type, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getType(java.lang.String,java.lang.String) ! */ ! public String getType (String uri, String localName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i].equals(uri) && data[i+1].equals(localName)) { ! return data[i+3]; ! } ! } ! return null; ! } ! ! ! /** ! * Look up an attribute's type by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's type, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getType(java.lang.String) ! */ ! public String getType (String qName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i+2].equals(qName)) { ! return data[i+3]; ! } ! } ! return null; ! } ! ! ! /** ! * Look up an attribute's value by Namespace-qualified name. ! * ! * @param uri The Namespace URI, or the empty string for a name ! * with no explicit Namespace URI. ! * @param localName The local name. ! * @return The attribute's value, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getValue(java.lang.String,java.lang.String) ! */ ! public String getValue (String uri, String localName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i].equals(uri) && data[i+1].equals(localName)) { ! return data[i+4]; ! } ! } ! return null; ! } ! ! ! /** ! * Look up an attribute's value by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's value, or null if there is no ! * matching attribute. ! * @see org.xml.sax.Attributes#getValue(java.lang.String) ! */ ! public String getValue (String qName) ! { ! int max = length * 5; ! for (int i = 0; i < max; i += 5) { ! if (data[i+2].equals(qName)) { ! return data[i+4]; ! } ! } ! return null; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Manipulators. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Clear the attribute list for reuse. ! * ! *

          Note that little memory is freed by this call: ! * the current array is kept so it can be ! * reused.

          ! */ ! public void clear () ! { ! if (data != null) { ! for (int i = 0; i < (length * 5); i++) ! data [i] = null; ! } ! length = 0; ! } ! ! ! /** ! * Copy an entire Attributes object. ! * ! *

          It may be more efficient to reuse an existing object ! * rather than constantly allocating new ones.

          ! * ! * @param atts The attributes to copy. ! */ ! public void setAttributes (Attributes atts) ! { ! clear(); ! length = atts.getLength(); ! if (length > 0) { ! data = new String[length*5]; ! for (int i = 0; i < length; i++) { ! data[i*5] = atts.getURI(i); ! data[i*5+1] = atts.getLocalName(i); ! data[i*5+2] = atts.getQName(i); ! data[i*5+3] = atts.getType(i); ! data[i*5+4] = atts.getValue(i); ! } ! } ! } ! ! ! /** ! * Add an attribute to the end of the list. ! * ! *

          For the sake of speed, this method does no checking ! * to see if the attribute is already in the list: that is ! * the responsibility of the application.

          ! * ! * @param uri The Namespace URI, or the empty string if ! * none is available or Namespace processing is not ! * being performed. ! * @param localName The local name, or the empty string if ! * Namespace processing is not being performed. ! * @param qName The qualified (prefixed) name, or the empty string ! * if qualified names are not available. ! * @param type The attribute type as a string. ! * @param value The attribute value. ! */ ! public void addAttribute (String uri, String localName, String qName, ! String type, String value) ! { ! ensureCapacity(length+1); ! data[length*5] = uri; ! data[length*5+1] = localName; ! data[length*5+2] = qName; ! data[length*5+3] = type; ! data[length*5+4] = value; ! length++; ! } ! ! ! /** ! * Set an attribute in the list. ! * ! *

          For the sake of speed, this method does no checking ! * for name conflicts or well-formedness: such checks are the ! * responsibility of the application.

          ! * ! * @param index The index of the attribute (zero-based). ! * @param uri The Namespace URI, or the empty string if ! * none is available or Namespace processing is not ! * being performed. ! * @param localName The local name, or the empty string if ! * Namespace processing is not being performed. ! * @param qName The qualified name, or the empty string ! * if qualified names are not available. ! * @param type The attribute type as a string. ! * @param value The attribute value. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setAttribute (int index, String uri, String localName, ! String qName, String type, String value) ! { ! if (index >= 0 && index < length) { ! data[index*5] = uri; ! data[index*5+1] = localName; ! data[index*5+2] = qName; ! data[index*5+3] = type; ! data[index*5+4] = value; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Remove an attribute from the list. ! * ! * @param index The index of the attribute (zero-based). ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void removeAttribute (int index) ! { ! if (index >= 0 && index < length) { ! if (index < length - 1) { ! System.arraycopy(data, (index+1)*5, data, index*5, ! (length-index-1)*5); ! } ! index = (length - 1) * 5; ! data [index++] = null; ! data [index++] = null; ! data [index++] = null; ! data [index++] = null; ! data [index] = null; ! length--; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the Namespace URI of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param uri The attribute's Namespace URI, or the empty ! * string for none. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setURI (int index, String uri) ! { ! if (index >= 0 && index < length) { ! data[index*5] = uri; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the local name of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param localName The attribute's local name, or the empty ! * string for none. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setLocalName (int index, String localName) ! { ! if (index >= 0 && index < length) { ! data[index*5+1] = localName; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the qualified name of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param qName The attribute's qualified name, or the empty ! * string for none. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setQName (int index, String qName) ! { ! if (index >= 0 && index < length) { ! data[index*5+2] = qName; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the type of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param type The attribute's type. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setType (int index, String type) ! { ! if (index >= 0 && index < length) { ! data[index*5+3] = type; ! } else { ! badIndex(index); ! } ! } ! ! ! /** ! * Set the value of a specific attribute. ! * ! * @param index The index of the attribute (zero-based). ! * @param value The attribute's value. ! * @exception java.lang.ArrayIndexOutOfBoundsException When the ! * supplied index does not point to an attribute ! * in the list. ! */ ! public void setValue (int index, String value) ! { ! if (index >= 0 && index < length) { ! data[index*5+4] = value; ! } else { ! badIndex(index); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Ensure the internal array's capacity. ! * ! * @param n The minimum number of attributes that the array must ! * be able to hold. ! */ ! private void ensureCapacity (int n) { ! if (n <= 0) { ! return; ! } ! int max; ! if (data == null || data.length == 0) { ! max = 25; ! } ! else if (data.length >= n * 5) { ! return; ! } ! else { ! max = data.length; ! } ! while (max < n * 5) { ! max *= 2; ! } ! ! String newData[] = new String[max]; ! if (length > 0) { ! System.arraycopy(data, 0, newData, 0, length*5); ! } ! data = newData; ! } ! ! ! /** ! * Report a bad array index in a manipulator. ! * ! * @param index The index to report. ! * @exception java.lang.ArrayIndexOutOfBoundsException Always. ! */ ! private void badIndex (int index) ! throws ArrayIndexOutOfBoundsException ! { ! String msg = ! "Attempt to modify attribute at illegal index: " + index; ! throw new ArrayIndexOutOfBoundsException(msg); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! int length; ! String data []; ! ! } ! ! // end of AttributesImpl.java ! diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/DefaultHandler.java gcc-3.3/libjava/org/xml/sax/helpers/DefaultHandler.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/DefaultHandler.java 2001-10-31 00:48:17.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/DefaultHandler.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,447 **** ! // DefaultHandler.java - default implementation of the core handlers. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: DefaultHandler.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import org.xml.sax.InputSource; ! import org.xml.sax.Locator; ! import org.xml.sax.Attributes; ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! import org.xml.sax.SAXParseException; ! ! ! /** ! * Default base class for SAX2 event handlers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class is available as a convenience base class for SAX2 ! * applications: it provides default implementations for all of the ! * callbacks in the four core SAX2 handler classes:

          ! * ! *
            ! *
          • {@link org.xml.sax.EntityResolver EntityResolver}
          • ! *
          • {@link org.xml.sax.DTDHandler DTDHandler}
          • ! *
          • {@link org.xml.sax.ContentHandler ContentHandler}
          • ! *
          • {@link org.xml.sax.ErrorHandler ErrorHandler}
          • ! *
          ! * ! *

          Application writers can extend this class when they need to ! * implement only part of an interface; parser writers can ! * instantiate this class to provide default handlers when the ! * application has not supplied its own.

          ! * ! *

          This class replaces the deprecated SAX1 ! * {@link org.xml.sax.HandlerBase HandlerBase} class.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.ContentHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public class DefaultHandler ! implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the EntityResolver interface. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Resolve an external entity. ! * ! *

          Always return null, so that the parser will use the system ! * identifier provided in the XML document. This method implements ! * the SAX default behaviour: application writers can override it ! * in a subclass to do special translations such as catalog lookups ! * or URI redirection.

          ! * ! * @param publicId The public identifier, or null if none is ! * available. ! * @param systemId The system identifier provided in the XML ! * document. ! * @return The new input source, or null to require the ! * default behaviour. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.EntityResolver#resolveEntity ! */ ! public InputSource resolveEntity (String publicId, String systemId) ! throws SAXException ! { ! return null; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of DTDHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a notation declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to keep track of the notations ! * declared in a document.

          ! * ! * @param name The notation name. ! * @param publicId The notation public identifier, or null if not ! * available. ! * @param systemId The notation system identifier. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DTDHandler#notationDecl ! */ ! public void notationDecl (String name, String publicId, String systemId) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of an unparsed entity declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to keep track of the unparsed entities ! * declared in a document.

          ! * ! * @param name The entity name. ! * @param publicId The entity public identifier, or null if not ! * available. ! * @param systemId The entity system identifier. ! * @param notationName The name of the associated notation. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public void unparsedEntityDecl (String name, String publicId, ! String systemId, String notationName) ! throws SAXException ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of ContentHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive a Locator object for document events. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to store the locator for use ! * with other document events.

          ! * ! * @param locator A locator for all SAX document events. ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! * @see org.xml.sax.Locator ! */ ! public void setDocumentLocator (Locator locator) ! { ! // no op ! } ! ! ! /** ! * Receive notification of the beginning of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the beginning ! * of a document (such as allocating the root node of a tree or ! * creating an output file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end ! * of a document (such as finalising a tree or closing an output ! * file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the start of a Namespace mapping. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the start of ! * each Namespace prefix scope (such as storing the prefix mapping).

          ! * ! * @param prefix The Namespace prefix being declared. ! * @param uri The Namespace URI mapped to the prefix. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#startPrefixMapping ! */ ! public void startPrefixMapping (String prefix, String uri) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of a Namespace mapping. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end of ! * each prefix mapping.

          ! * ! * @param prefix The Namespace prefix being declared. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#endPrefixMapping ! */ ! public void endPrefixMapping (String prefix) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the start of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the start of ! * each element (such as allocating a new tree node or writing ! * output to a file).

          ! * ! * @param name The element type name. ! * @param attributes The specified or defaulted attributes. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#startElement ! */ ! public void startElement (String uri, String localName, ! String qName, Attributes attributes) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end of ! * each element (such as finalising a tree node or writing ! * output to a file).

          ! * ! * @param name The element type name. ! * @param attributes The specified or defaulted attributes. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#endElement ! */ ! public void endElement (String uri, String localName, String qName) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of character data inside an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of character data ! * (such as adding the data to a node or buffer, or printing it to ! * a file).

          ! * ! * @param ch The characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of ignorable ! * whitespace (such as adding data to a node or buffer, or printing ! * it to a file).

          ! * ! * @param ch The whitespace characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions for each ! * processing instruction, such as setting status variables or ! * invoking other methods.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none is supplied. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a skipped entity. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions for each ! * processing instruction, such as setting status variables or ! * invoking other methods.

          ! * ! * @param name The name of the skipped entity. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#processingInstruction ! */ ! public void skippedEntity (String name) ! throws SAXException ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the ErrorHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a parser warning. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each warning, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void warning (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a recoverable parser error. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each error, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void error (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Report a fatal XML parsing error. ! * ! *

          The default implementation throws a SAXParseException. ! * Application writers may override this method in a subclass if ! * they need to take specific actions for each fatal error (such as ! * collecting all of the errors into a single report): in any case, ! * the application must stop all regular processing when this ! * method is invoked, since the document is no longer reliable, and ! * the parser may no longer report parsing events.

          ! * ! * @param e The error information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#fatalError ! * @see org.xml.sax.SAXParseException ! */ ! public void fatalError (SAXParseException e) ! throws SAXException ! { ! throw e; ! } ! ! } ! ! // end of DefaultHandler.java --- 1,468 ---- ! // DefaultHandler.java - default implementation of the core handlers. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: DefaultHandler.java,v 1.5.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import java.io.IOException; ! ! import org.xml.sax.InputSource; ! import org.xml.sax.Locator; ! import org.xml.sax.Attributes; ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! import org.xml.sax.SAXParseException; ! ! ! /** ! * Default base class for SAX2 event handlers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class is available as a convenience base class for SAX2 ! * applications: it provides default implementations for all of the ! * callbacks in the four core SAX2 handler classes:

          ! * ! *
            ! *
          • {@link org.xml.sax.EntityResolver EntityResolver}
          • ! *
          • {@link org.xml.sax.DTDHandler DTDHandler}
          • ! *
          • {@link org.xml.sax.ContentHandler ContentHandler}
          • ! *
          • {@link org.xml.sax.ErrorHandler ErrorHandler}
          • ! *
          ! * ! *

          Application writers can extend this class when they need to ! * implement only part of an interface; parser writers can ! * instantiate this class to provide default handlers when the ! * application has not supplied its own.

          ! * ! *

          This class replaces the deprecated SAX1 ! * {@link org.xml.sax.HandlerBase HandlerBase} class.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.ContentHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public class DefaultHandler ! implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the EntityResolver interface. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Resolve an external entity. ! * ! *

          Always return null, so that the parser will use the system ! * identifier provided in the XML document. This method implements ! * the SAX default behaviour: application writers can override it ! * in a subclass to do special translations such as catalog lookups ! * or URI redirection.

          ! * ! * @param publicId The public identifer, or null if none is ! * available. ! * @param systemId The system identifier provided in the XML ! * document. ! * @return The new input source, or null to require the ! * default behaviour. ! * @exception java.io.IOException If there is an error setting ! * up the new input source. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.EntityResolver#resolveEntity ! */ ! public InputSource resolveEntity (String publicId, String systemId) ! throws IOException, SAXException ! { ! return null; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of DTDHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a notation declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to keep track of the notations ! * declared in a document.

          ! * ! * @param name The notation name. ! * @param publicId The notation public identifier, or null if not ! * available. ! * @param systemId The notation system identifier. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DTDHandler#notationDecl ! */ ! public void notationDecl (String name, String publicId, String systemId) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of an unparsed entity declaration. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to keep track of the unparsed entities ! * declared in a document.

          ! * ! * @param name The entity name. ! * @param publicId The entity public identifier, or null if not ! * available. ! * @param systemId The entity system identifier. ! * @param notationName The name of the associated notation. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public void unparsedEntityDecl (String name, String publicId, ! String systemId, String notationName) ! throws SAXException ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of ContentHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive a Locator object for document events. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass if they wish to store the locator for use ! * with other document events.

          ! * ! * @param locator A locator for all SAX document events. ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! * @see org.xml.sax.Locator ! */ ! public void setDocumentLocator (Locator locator) ! { ! // no op ! } ! ! ! /** ! * Receive notification of the beginning of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the beginning ! * of a document (such as allocating the root node of a tree or ! * creating an output file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of the document. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end ! * of a document (such as finalising a tree or closing an output ! * file).

          ! * ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the start of a Namespace mapping. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the start of ! * each Namespace prefix scope (such as storing the prefix mapping).

          ! * ! * @param prefix The Namespace prefix being declared. ! * @param uri The Namespace URI mapped to the prefix. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#startPrefixMapping ! */ ! public void startPrefixMapping (String prefix, String uri) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of a Namespace mapping. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end of ! * each prefix mapping.

          ! * ! * @param prefix The Namespace prefix being declared. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#endPrefixMapping ! */ ! public void endPrefixMapping (String prefix) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the start of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the start of ! * each element (such as allocating a new tree node or writing ! * output to a file).

          ! * ! * @param uri The Namespace URI, or the empty string if the ! * element has no Namespace URI or if Namespace ! * processing is not being performed. ! * @param localName The local name (without prefix), or the ! * empty string if Namespace processing is not being ! * performed. ! * @param qName The qualified name (with prefix), or the ! * empty string if qualified names are not available. ! * @param atts The attributes attached to the element. If ! * there are no attributes, it shall be an empty ! * Attributes object. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#startElement ! */ ! public void startElement (String uri, String localName, ! String qName, Attributes attributes) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of the end of an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions at the end of ! * each element (such as finalising a tree node or writing ! * output to a file).

          ! * ! * @param uri The Namespace URI, or the empty string if the ! * element has no Namespace URI or if Namespace ! * processing is not being performed. ! * @param localName The local name (without prefix), or the ! * empty string if Namespace processing is not being ! * performed. ! * @param qName The qualified name (with prefix), or the ! * empty string if qualified names are not available. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#endElement ! */ ! public void endElement (String uri, String localName, String qName) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of character data inside an element. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of character data ! * (such as adding the data to a node or buffer, or printing it to ! * a file).

          ! * ! * @param ch The characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of ignorable whitespace in element content. ! * ! *

          By default, do nothing. Application writers may override this ! * method to take specific actions for each chunk of ignorable ! * whitespace (such as adding data to a node or buffer, or printing ! * it to a file).

          ! * ! * @param ch The whitespace characters. ! * @param start The start position in the character array. ! * @param length The number of characters to use from the ! * character array. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a processing instruction. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions for each ! * processing instruction, such as setting status variables or ! * invoking other methods.

          ! * ! * @param target The processing instruction target. ! * @param data The processing instruction data, or null if ! * none is supplied. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a skipped entity. ! * ! *

          By default, do nothing. Application writers may override this ! * method in a subclass to take specific actions for each ! * processing instruction, such as setting status variables or ! * invoking other methods.

          ! * ! * @param name The name of the skipped entity. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ContentHandler#processingInstruction ! */ ! public void skippedEntity (String name) ! throws SAXException ! { ! // no op ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Default implementation of the ErrorHandler interface. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Receive notification of a parser warning. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each warning, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void warning (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Receive notification of a recoverable parser error. ! * ! *

          The default implementation does nothing. Application writers ! * may override this method in a subclass to take specific actions ! * for each error, such as inserting the message in a log file or ! * printing it to the console.

          ! * ! * @param e The warning information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#warning ! * @see org.xml.sax.SAXParseException ! */ ! public void error (SAXParseException e) ! throws SAXException ! { ! // no op ! } ! ! ! /** ! * Report a fatal XML parsing error. ! * ! *

          The default implementation throws a SAXParseException. ! * Application writers may override this method in a subclass if ! * they need to take specific actions for each fatal error (such as ! * collecting all of the errors into a single report): in any case, ! * the application must stop all regular processing when this ! * method is invoked, since the document is no longer reliable, and ! * the parser may no longer report parsing events.

          ! * ! * @param e The error information encoded as an exception. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @see org.xml.sax.ErrorHandler#fatalError ! * @see org.xml.sax.SAXParseException ! */ ! public void fatalError (SAXParseException e) ! throws SAXException ! { ! throw e; ! } ! ! } ! ! // end of DefaultHandler.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/LocatorImpl.java gcc-3.3/libjava/org/xml/sax/helpers/LocatorImpl.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/LocatorImpl.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/LocatorImpl.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,212 **** ! // SAX default implementation for Locator. ! // No warranty; no copyright -- use this as you will. ! // $Id: LocatorImpl.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import org.xml.sax.Locator; ! ! ! /** ! * Provide an optional convenience implementation of Locator. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class is available mainly for application writers, who ! * can use it to make a persistent snapshot of a locator at any ! * point during a document parse:

          ! * ! *
          !  * Locator locator;
          !  * Locator startloc;
          !  *
          !  * public void setLocator (Locator locator)
          !  * {
          !  *         // note the locator
          !  *   this.locator = locator;
          !  * }
          !  *
          !  * public void startDocument ()
          !  * {
          !  *         // save the location of the start of the document
          !  *         // for future use.
          !  *   Locator startloc = new LocatorImpl(locator);
          !  * }
          !  *
          ! * ! *

          Normally, parser writers will not use this class, since it ! * is more efficient to provide location information only when ! * requested, rather than constantly updating a Locator object.

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Locator Locator ! */ ! public class LocatorImpl implements Locator ! { ! ! ! /** ! * Zero-argument constructor. ! * ! *

          This will not normally be useful, since the main purpose ! * of this class is to make a snapshot of an existing Locator.

          ! */ ! public LocatorImpl () ! { ! } ! ! ! /** ! * Copy constructor. ! * ! *

          Create a persistent copy of the current state of a locator. ! * When the original locator changes, this copy will still keep ! * the original values (and it can be used outside the scope of ! * DocumentHandler methods).

          ! * ! * @param locator The locator to copy. ! */ ! public LocatorImpl (Locator locator) ! { ! setPublicId(locator.getPublicId()); ! setSystemId(locator.getSystemId()); ! setLineNumber(locator.getLineNumber()); ! setColumnNumber(locator.getColumnNumber()); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.Locator ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the saved public identifier. ! * ! * @return The public identifier as a string, or null if none ! * is available. ! * @see org.xml.sax.Locator#getPublicId ! * @see #setPublicId ! */ ! public String getPublicId () ! { ! return publicId; ! } ! ! ! /** ! * Return the saved system identifier. ! * ! * @return The system identifier as a string, or null if none ! * is available. ! * @see org.xml.sax.Locator#getSystemId ! * @see #setSystemId ! */ ! public String getSystemId () ! { ! return systemId; ! } ! ! ! /** ! * Return the saved line number (1-based). ! * ! * @return The line number as an integer, or -1 if none is available. ! * @see org.xml.sax.Locator#getLineNumber ! * @see #setLineNumber ! */ ! public int getLineNumber () ! { ! return lineNumber; ! } ! ! ! /** ! * Return the saved column number (1-based). ! * ! * @return The column number as an integer, or -1 if none is available. ! * @see org.xml.sax.Locator#getColumnNumber ! * @see #setColumnNumber ! */ ! public int getColumnNumber () ! { ! return columnNumber; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Setters for the properties (not in org.xml.sax.Locator) ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the public identifier for this locator. ! * ! * @param publicId The new public identifier, or null ! * if none is available. ! * @see #getPublicId ! */ ! public void setPublicId (String publicId) ! { ! this.publicId = publicId; ! } ! ! ! /** ! * Set the system identifier for this locator. ! * ! * @param systemId The new system identifier, or null ! * if none is available. ! * @see #getSystemId ! */ ! public void setSystemId (String systemId) ! { ! this.systemId = systemId; ! } ! ! ! /** ! * Set the line number for this locator (1-based). ! * ! * @param lineNumber The line number, or -1 if none is available. ! * @see #getLineNumber ! */ ! public void setLineNumber (int lineNumber) ! { ! this.lineNumber = lineNumber; ! } ! ! ! /** ! * Set the column number for this locator (1-based). ! * ! * @param columnNumber The column number, or -1 if none is available. ! * @see #getColumnNumber ! */ ! public void setColumnNumber (int columnNumber) ! { ! this.columnNumber = columnNumber; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private String publicId; ! private String systemId; ! private int lineNumber; ! private int columnNumber; ! ! } ! ! // end of LocatorImpl.java --- 1,214 ---- ! // SAX default implementation for Locator. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: LocatorImpl.java,v 1.3.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import org.xml.sax.Locator; ! ! ! /** ! * Provide an optional convenience implementation of Locator. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class is available mainly for application writers, who ! * can use it to make a persistent snapshot of a locator at any ! * point during a document parse:

          ! * ! *
          !  * Locator locator;
          !  * Locator startloc;
          !  *
          !  * public void setLocator (Locator locator)
          !  * {
          !  *         // note the locator
          !  *   this.locator = locator;
          !  * }
          !  *
          !  * public void startDocument ()
          !  * {
          !  *         // save the location of the start of the document
          !  *         // for future use.
          !  *   Locator startloc = new LocatorImpl(locator);
          !  * }
          !  *
          ! * ! *

          Normally, parser writers will not use this class, since it ! * is more efficient to provide location information only when ! * requested, rather than constantly updating a Locator object.

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.Locator Locator ! */ ! public class LocatorImpl implements Locator ! { ! ! ! /** ! * Zero-argument constructor. ! * ! *

          This will not normally be useful, since the main purpose ! * of this class is to make a snapshot of an existing Locator.

          ! */ ! public LocatorImpl () ! { ! } ! ! ! /** ! * Copy constructor. ! * ! *

          Create a persistent copy of the current state of a locator. ! * When the original locator changes, this copy will still keep ! * the original values (and it can be used outside the scope of ! * DocumentHandler methods).

          ! * ! * @param locator The locator to copy. ! */ ! public LocatorImpl (Locator locator) ! { ! setPublicId(locator.getPublicId()); ! setSystemId(locator.getSystemId()); ! setLineNumber(locator.getLineNumber()); ! setColumnNumber(locator.getColumnNumber()); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.Locator ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Return the saved public identifier. ! * ! * @return The public identifier as a string, or null if none ! * is available. ! * @see org.xml.sax.Locator#getPublicId ! * @see #setPublicId ! */ ! public String getPublicId () ! { ! return publicId; ! } ! ! ! /** ! * Return the saved system identifier. ! * ! * @return The system identifier as a string, or null if none ! * is available. ! * @see org.xml.sax.Locator#getSystemId ! * @see #setSystemId ! */ ! public String getSystemId () ! { ! return systemId; ! } ! ! ! /** ! * Return the saved line number (1-based). ! * ! * @return The line number as an integer, or -1 if none is available. ! * @see org.xml.sax.Locator#getLineNumber ! * @see #setLineNumber ! */ ! public int getLineNumber () ! { ! return lineNumber; ! } ! ! ! /** ! * Return the saved column number (1-based). ! * ! * @return The column number as an integer, or -1 if none is available. ! * @see org.xml.sax.Locator#getColumnNumber ! * @see #setColumnNumber ! */ ! public int getColumnNumber () ! { ! return columnNumber; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Setters for the properties (not in org.xml.sax.Locator) ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the public identifier for this locator. ! * ! * @param publicId The new public identifier, or null ! * if none is available. ! * @see #getPublicId ! */ ! public void setPublicId (String publicId) ! { ! this.publicId = publicId; ! } ! ! ! /** ! * Set the system identifier for this locator. ! * ! * @param systemId The new system identifier, or null ! * if none is available. ! * @see #getSystemId ! */ ! public void setSystemId (String systemId) ! { ! this.systemId = systemId; ! } ! ! ! /** ! * Set the line number for this locator (1-based). ! * ! * @param lineNumber The line number, or -1 if none is available. ! * @see #getLineNumber ! */ ! public void setLineNumber (int lineNumber) ! { ! this.lineNumber = lineNumber; ! } ! ! ! /** ! * Set the column number for this locator (1-based). ! * ! * @param columnNumber The column number, or -1 if none is available. ! * @see #getColumnNumber ! */ ! public void setColumnNumber (int columnNumber) ! { ! this.columnNumber = columnNumber; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private String publicId; ! private String systemId; ! private int lineNumber; ! private int columnNumber; ! ! } ! ! // end of LocatorImpl.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/NamespaceSupport.java gcc-3.3/libjava/org/xml/sax/helpers/NamespaceSupport.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/NamespaceSupport.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/NamespaceSupport.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,689 **** ! // NamespaceSupport.java - generic Namespace support for SAX. ! // Written by David Megginson, sax@megginson.com ! // This class is in the Public Domain. NO WARRANTY! ! ! // $Id: NamespaceSupport.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import java.util.EmptyStackException; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.Vector; ! ! ! /** ! * Encapsulate Namespace logic for use by SAX drivers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class encapsulates the logic of Namespace processing: ! * it tracks the declarations currently in force for each context ! * and automatically processes qualified XML 1.0 names into their ! * Namespace parts; it can also be used in reverse for generating ! * XML 1.0 from Namespaces.

          ! * ! *

          Namespace support objects are reusable, but the reset method ! * must be invoked between each session.

          ! * ! *

          Here is a simple session:

          ! * ! *
          !  * String parts[] = new String[3];
          !  * NamespaceSupport support = new NamespaceSupport();
          !  *
          !  * support.pushContext();
          !  * support.declarePrefix("", "http://www.w3.org/1999/xhtml");
          !  * support.declarePrefix("dc", "http://www.purl.org/dc#");
          !  *
          !  * String parts[] = support.processName("p", parts, false);
          !  * System.out.println("Namespace URI: " + parts[0]);
          !  * System.out.println("Local name: " + parts[1]);
          !  * System.out.println("Raw name: " + parts[2]);
          ! 
          !  * String parts[] = support.processName("dc:title", parts, false);
          !  * System.out.println("Namespace URI: " + parts[0]);
          !  * System.out.println("Local name: " + parts[1]);
          !  * System.out.println("Raw name: " + parts[2]);
          ! 
          !  * support.popContext();
          !  * 
          ! * ! *

          Note that this class is optimized for the use case where most ! * elements do not contain Namespace declarations: if the same ! * prefix/URI mapping is repeated for each context (for example), this ! * class will be somewhat less efficient.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! */ ! public class NamespaceSupport ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constants. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * The XML Namespace as a constant. ! * ! *

          This is the Namespace URI that is automatically mapped ! * to the "xml" prefix.

          ! */ ! public final static String XMLNS = ! "http://www.w3.org/XML/1998/namespace"; ! ! ! /** ! * An empty enumeration. ! */ ! private final static Enumeration EMPTY_ENUMERATION = ! new Vector().elements(); ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructor. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Create a new Namespace support object. ! */ ! public NamespaceSupport () ! { ! reset(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Context management. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Reset this Namespace support object for reuse. ! * ! *

          It is necessary to invoke this method before reusing the ! * Namespace support object for a new session.

          ! */ ! public void reset () ! { ! contexts = new Context[32]; ! contextPos = 0; ! contexts[contextPos] = currentContext = new Context(); ! currentContext.declarePrefix("xml", XMLNS); ! } ! ! ! /** ! * Start a new Namespace context. ! * ! *

          Normally, you should push a new context at the beginning ! * of each XML element: the new context will automatically inherit ! * the declarations of its parent context, but it will also keep ! * track of which declarations were made within this context.

          ! * ! *

          The Namespace support object always starts with a base context ! * already in force: in this context, only the "xml" prefix is ! * declared.

          ! * ! * @see #popContext ! */ ! public void pushContext () ! { ! int max = contexts.length; ! contextPos++; ! ! // Extend the array if necessary ! if (contextPos >= max) { ! Context newContexts[] = new Context[max*2]; ! System.arraycopy(contexts, 0, newContexts, 0, max); ! max *= 2; ! contexts = newContexts; ! } ! ! // Allocate the context if necessary. ! currentContext = contexts[contextPos]; ! if (currentContext == null) { ! contexts[contextPos] = currentContext = new Context(); ! } ! ! // Set the parent, if any. ! if (contextPos > 0) { ! currentContext.setParent(contexts[contextPos - 1]); ! } ! } ! ! ! /** ! * Revert to the previous Namespace context. ! * ! *

          Normally, you should pop the context at the end of each ! * XML element. After popping the context, all Namespace prefix ! * mappings that were previously in force are restored.

          ! * ! *

          You must not attempt to declare additional Namespace ! * prefixes after popping a context, unless you push another ! * context first.

          ! * ! * @see #pushContext ! */ ! public void popContext () ! { ! contextPos--; ! if (contextPos < 0) { ! throw new EmptyStackException(); ! } ! currentContext = contexts[contextPos]; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Operations within a context. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Declare a Namespace prefix. ! * ! *

          This method declares a prefix in the current Namespace ! * context; the prefix will remain in force until this context ! * is popped, unless it is shadowed in a descendant context.

          ! * ! *

          To declare a default Namespace, use the empty string. The ! * prefix must not be "xml" or "xmlns".

          ! * ! *

          Note that you must not declare a prefix after ! * you've pushed and popped another Namespace.

          ! * ! *

          Note that there is an asymmetry in this library: while {@link ! * #getPrefix getPrefix} will not return the default "" prefix, ! * even if you have declared one; to check for a default prefix, ! * you have to look it up explicitly using {@link #getURI getURI}. ! * This asymmetry exists to make it easier to look up prefixes ! * for attribute names, where the default prefix is not allowed.

          ! * ! * @param prefix The prefix to declare, or null for the empty ! * string. ! * @param uri The Namespace URI to associate with the prefix. ! * @return true if the prefix was legal, false otherwise ! * @see #processName ! * @see #getURI ! * @see #getPrefix ! */ ! public boolean declarePrefix (String prefix, String uri) ! { ! if (prefix.equals("xml") || prefix.equals("xmlns")) { ! return false; ! } else { ! currentContext.declarePrefix(prefix, uri); ! return true; ! } ! } ! ! ! /** ! * Process a raw XML 1.0 name. ! * ! *

          This method processes a raw XML 1.0 name in the current ! * context by removing the prefix and looking it up among the ! * prefixes currently declared. The return value will be the ! * array supplied by the caller, filled in as follows:

          ! * ! *
          ! *
          parts[0]
          ! *
          The Namespace URI, or an empty string if none is ! * in use.
          ! *
          parts[1]
          ! *
          The local name (without prefix).
          ! *
          parts[2]
          ! *
          The original raw name.
          ! *
          ! * ! *

          All of the strings in the array will be internalized. If ! * the raw name has a prefix that has not been declared, then ! * the return value will be null.

          ! * ! *

          Note that attribute names are processed differently than ! * element names: an unprefixed element name will received the ! * default Namespace (if any), while an unprefixed element name ! * will not.

          ! * ! * @param qName The raw XML 1.0 name to be processed. ! * @param parts An array supplied by the caller, capable of ! * holding at least three members. ! * @param isAttribute A flag indicating whether this is an ! * attribute name (true) or an element name (false). ! * @return The supplied array holding three internalized strings ! * representing the Namespace URI (or empty string), the ! * local name, and the raw XML 1.0 name; or null if there ! * is an undeclared prefix. ! * @see #declarePrefix ! * @see java.lang.String#intern */ ! public String [] processName (String qName, String parts[], ! boolean isAttribute) ! { ! String myParts[] = currentContext.processName(qName, isAttribute); ! if (myParts == null) { ! return null; ! } else { ! parts[0] = myParts[0]; ! parts[1] = myParts[1]; ! parts[2] = myParts[2]; ! return parts; ! } ! } ! ! ! /** ! * Look up a prefix and get the currently-mapped Namespace URI. ! * ! *

          This method looks up the prefix in the current context. ! * Use the empty string ("") for the default Namespace.

          ! * ! * @param prefix The prefix to look up. ! * @return The associated Namespace URI, or null if the prefix ! * is undeclared in this context. ! * @see #getPrefix ! * @see #getPrefixes ! */ ! public String getURI (String prefix) ! { ! return currentContext.getURI(prefix); ! } ! ! ! /** ! * Return an enumeration of all prefixes currently declared. ! * ! *

          Note: if there is a default prefix, it will not be ! * returned in this enumeration; check for the default prefix ! * using the {@link #getURI getURI} with an argument of "".

          ! * ! * @return An enumeration of all prefixes declared in the ! * current context except for the empty (default) ! * prefix. ! * @see #getDeclaredPrefixes ! * @see #getURI ! */ ! public Enumeration getPrefixes () ! { ! return currentContext.getPrefixes(); ! } ! ! ! /** ! * Return one of the prefixes mapped to a Namespace URI. ! * ! *

          If more than one prefix is currently mapped to the same ! * URI, this method will make an arbitrary selection; if you ! * want all of the prefixes, use the {@link #getPrefixes} ! * method instead.

          ! * ! *

          Note: this will never return the empty (default) prefix; ! * to check for a default prefix, use the {@link #getURI getURI} ! * method with an argument of "".

          ! * ! * @param uri The Namespace URI. ! * @param isAttribute true if this prefix is for an attribute ! * (and the default Namespace is not allowed). ! * @return One of the prefixes currently mapped to the URI supplied, ! * or null if none is mapped or if the URI is assigned to ! * the default Namespace. ! * @see #getPrefixes(java.lang.String) ! * @see #getURI ! */ ! public String getPrefix (String uri) ! { ! return currentContext.getPrefix(uri); ! } ! ! ! /** ! * Return an enumeration of all prefixes currently declared for a URI. ! * ! *

          This method returns prefixes mapped to a specific Namespace ! * URI. The xml: prefix will be included. If you want only one ! * prefix that's mapped to the Namespace URI, and you don't care ! * which one you get, use the {@link #getPrefix getPrefix} ! * method instead.

          ! * ! *

          Note: the empty (default) prefix is never included ! * in this enumeration; to check for the presence of a default ! * Namespace, use the {@link #getURI getURI} method with an ! * argument of "".

          ! * ! * @param uri The Namespace URI. ! * @return An enumeration of all prefixes declared in the ! * current context. ! * @see #getPrefix ! * @see #getDeclaredPrefixes ! * @see #getURI ! */ ! public Enumeration getPrefixes (String uri) ! { ! Vector prefixes = new Vector(); ! Enumeration allPrefixes = getPrefixes(); ! while (allPrefixes.hasMoreElements()) { ! String prefix = (String)allPrefixes.nextElement(); ! if (uri.equals(getURI(prefix))) { ! prefixes.addElement(prefix); ! } ! } ! return prefixes.elements(); ! } ! ! ! /** ! * Return an enumeration of all prefixes declared in this context. ! * ! *

          The empty (default) prefix will be included in this ! * enumeration; note that this behaviour differs from that of ! * {@link #getPrefix} and {@link #getPrefixes}.

          ! * ! * @return An enumeration of all prefixes declared in this ! * context. ! * @see #getPrefixes ! * @see #getURI ! */ ! public Enumeration getDeclaredPrefixes () ! { ! return currentContext.getDeclaredPrefixes(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private Context contexts[]; ! private Context currentContext; ! private int contextPos; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal classes. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Internal class for a single Namespace context. ! * ! *

          This module caches and reuses Namespace contexts, so the number allocated ! * will be equal to the element depth of the document, not to the total ! * number of elements (i.e. 5-10 rather than tens of thousands).

          ! */ ! final class Context { ! ! /** ! * Create the root-level Namespace context. ! */ ! Context () ! { ! copyTables(); ! } ! ! ! /** ! * (Re)set the parent of this Namespace context. ! * ! * @param context The parent Namespace context object. ! */ ! void setParent (Context parent) ! { ! this.parent = parent; ! declarations = null; ! prefixTable = parent.prefixTable; ! uriTable = parent.uriTable; ! elementNameTable = parent.elementNameTable; ! attributeNameTable = parent.attributeNameTable; ! defaultNS = parent.defaultNS; ! tablesDirty = false; ! } ! ! ! /** ! * Declare a Namespace prefix for this context. ! * ! * @param prefix The prefix to declare. ! * @param uri The associated Namespace URI. ! * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix ! */ ! void declarePrefix (String prefix, String uri) ! { ! // Lazy processing... ! if (!tablesDirty) { ! copyTables(); ! } ! if (declarations == null) { ! declarations = new Vector(); ! } ! ! prefix = prefix.intern(); ! uri = uri.intern(); ! if ("".equals(prefix)) { ! if ("".equals(uri)) { ! defaultNS = null; ! } else { ! defaultNS = uri; ! } ! } else { ! prefixTable.put(prefix, uri); ! uriTable.put(uri, prefix); // may wipe out another prefix ! } ! declarations.addElement(prefix); ! } ! ! ! /** ! * Process a raw XML 1.0 name in this context. ! * ! * @param qName The raw XML 1.0 name. ! * @param isAttribute true if this is an attribute name. ! * @return An array of three strings containing the ! * URI part (or empty string), the local part, ! * and the raw name, all internalized, or null ! * if there is an undeclared prefix. ! * @see org.xml.sax.helpers.NamespaceSupport#processName ! */ ! String [] processName (String qName, boolean isAttribute) ! { ! String name[]; ! Hashtable table; ! ! // Select the appropriate table. ! if (isAttribute) { ! table = elementNameTable; ! } else { ! table = attributeNameTable; ! } ! ! // Start by looking in the cache, and ! // return immediately if the name ! // is already known in this content ! name = (String[])table.get(qName); ! if (name != null) { ! return name; ! } ! ! // We haven't seen this name in this ! // context before. ! name = new String[3]; ! int index = qName.indexOf(':'); ! ! ! // No prefix. ! if (index == -1) { ! if (isAttribute || defaultNS == null) { ! name[0] = ""; ! } else { ! name[0] = defaultNS; ! } ! name[1] = qName.intern(); ! name[2] = name[1]; ! } ! ! // Prefix ! else { ! String prefix = qName.substring(0, index); ! String local = qName.substring(index+1); ! String uri; ! if ("".equals(prefix)) { ! uri = defaultNS; ! } else { ! uri = (String)prefixTable.get(prefix); ! } ! if (uri == null) { ! return null; ! } ! name[0] = uri; ! name[1] = local.intern(); ! name[2] = qName.intern(); ! } ! ! // Save in the cache for future use. ! table.put(name[2], name); ! tablesDirty = true; ! return name; ! } ! ! ! /** ! * Look up the URI associated with a prefix in this context. ! * ! * @param prefix The prefix to look up. ! * @return The associated Namespace URI, or null if none is ! * declared. ! * @see org.xml.sax.helpers.NamespaceSupport#getURI ! */ ! String getURI (String prefix) ! { ! if ("".equals(prefix)) { ! return defaultNS; ! } else if (prefixTable == null) { ! return null; ! } else { ! return (String)prefixTable.get(prefix); ! } ! } ! ! ! /** ! * Look up one of the prefixes associated with a URI in this context. ! * ! *

          Since many prefixes may be mapped to the same URI, ! * the return value may be unreliable.

          ! * ! * @param uri The URI to look up. ! * @return The associated prefix, or null if none is declared. ! * @see org.xml.sax.helpers.NamespaceSupport#getPrefix ! */ ! String getPrefix (String uri) ! { ! if (uriTable == null) { ! return null; ! } else { ! return (String)uriTable.get(uri); ! } ! } ! ! ! /** ! * Return an enumeration of prefixes declared in this context. ! * ! * @return An enumeration of prefixes (possibly empty). ! * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes ! */ ! Enumeration getDeclaredPrefixes () ! { ! if (declarations == null) { ! return EMPTY_ENUMERATION; ! } else { ! return declarations.elements(); ! } ! } ! ! ! /** ! * Return an enumeration of all prefixes currently in force. ! * ! *

          The default prefix, if in force, is not ! * returned, and will have to be checked for separately.

          ! * ! * @return An enumeration of prefixes (never empty). ! * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes ! */ ! Enumeration getPrefixes () ! { ! if (prefixTable == null) { ! return EMPTY_ENUMERATION; ! } else { ! return prefixTable.keys(); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////// ! // Internal methods. ! //////////////////////////////////////////////////////////////// ! ! ! /** ! * Copy on write for the internal tables in this context. ! * ! *

          This class is optimized for the normal case where most ! * elements do not contain Namespace declarations.

          ! */ ! private void copyTables () ! { ! if (prefixTable != null) { ! prefixTable = (Hashtable)prefixTable.clone(); ! } else { ! prefixTable = new Hashtable(); ! } ! if (uriTable != null) { ! uriTable = (Hashtable)uriTable.clone(); ! } else { ! uriTable = new Hashtable(); ! } ! elementNameTable = new Hashtable(); ! attributeNameTable = new Hashtable(); ! tablesDirty = true; ! } ! ! ! ! //////////////////////////////////////////////////////////////// ! // Protected state. ! //////////////////////////////////////////////////////////////// ! ! Hashtable prefixTable; ! Hashtable uriTable; ! Hashtable elementNameTable; ! Hashtable attributeNameTable; ! String defaultNS = null; ! ! ! ! //////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////// ! ! private Vector declarations = null; ! private boolean tablesDirty = false; ! private Context parent = null; ! } ! } ! ! // end of NamespaceSupport.java --- 1,770 ---- ! // NamespaceSupport.java - generic Namespace support for SAX. ! // http://www.saxproject.org ! // Written by David Megginson ! // This class is in the Public Domain. NO WARRANTY! ! ! // $Id: NamespaceSupport.java,v 1.6.2.5 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import java.util.EmptyStackException; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.Vector; ! ! ! /** ! * Encapsulate Namespace logic for use by applications using SAX, ! * or internally by SAX drivers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class encapsulates the logic of Namespace processing: ! * it tracks the declarations currently in force for each context ! * and automatically processes qualified XML 1.0 names into their ! * Namespace parts; it can also be used in reverse for generating ! * XML 1.0 from Namespaces.

          ! * ! *

          Namespace support objects are reusable, but the reset method ! * must be invoked between each session.

          ! * ! *

          Here is a simple session:

          ! * ! *
          !  * String parts[] = new String[3];
          !  * NamespaceSupport support = new NamespaceSupport();
          !  *
          !  * support.pushContext();
          !  * support.declarePrefix("", "http://www.w3.org/1999/xhtml");
          !  * support.declarePrefix("dc", "http://www.purl.org/dc#");
          !  *
          !  * parts = support.processName("p", parts, false);
          !  * System.out.println("Namespace URI: " + parts[0]);
          !  * System.out.println("Local name: " + parts[1]);
          !  * System.out.println("Raw name: " + parts[2]);
          !  *
          !  * parts = support.processName("dc:title", parts, false);
          !  * System.out.println("Namespace URI: " + parts[0]);
          !  * System.out.println("Local name: " + parts[1]);
          !  * System.out.println("Raw name: " + parts[2]);
          !  *
          !  * support.popContext();
          !  * 
          ! * ! *

          Note that this class is optimized for the use case where most ! * elements do not contain Namespace declarations: if the same ! * prefix/URI mapping is repeated for each context (for example), this ! * class will be somewhat less efficient.

          ! * ! *

          Although SAX drivers (parsers) may choose to use this class to ! * implement namespace handling, they are not required to do so. ! * Applications must track namespace information themselves if they ! * want to use namespace information. ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! */ ! public class NamespaceSupport ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constants. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * The XML Namespace URI as a constant. ! * The value is http://www.w3.org/XML/1998/namespace ! * as defined in the XML Namespaces specification. ! * ! *

          This is the Namespace URI that is automatically mapped ! * to the "xml" prefix.

          ! */ ! public final static String XMLNS = ! "http://www.w3.org/XML/1998/namespace"; ! ! ! /** ! * An empty enumeration. ! */ ! private final static Enumeration EMPTY_ENUMERATION = ! new Vector().elements(); ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructor. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Create a new Namespace support object. ! */ ! public NamespaceSupport () ! { ! reset(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Context management. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Reset this Namespace support object for reuse. ! * ! *

          It is necessary to invoke this method before reusing the ! * Namespace support object for a new session.

          ! */ ! public void reset () ! { ! contexts = new Context[32]; ! contextPos = 0; ! contexts[contextPos] = currentContext = new Context(); ! currentContext.declarePrefix("xml", XMLNS); ! } ! ! ! /** ! * Start a new Namespace context. ! * The new context will automatically inherit ! * the declarations of its parent context, but it will also keep ! * track of which declarations were made within this context. ! * ! *

          Event callback code should start a new context once per element. ! * This means being ready to call this in either of two places. ! * For elements that don't include namespace declarations, the ! * ContentHandler.startElement() callback is the right place. ! * For elements with such a declaration, it'd done in the first ! * ContentHandler.startPrefixMapping() callback. ! * A boolean flag can be used to ! * track whether a context has been started yet. When either of ! * those methods is called, it checks the flag to see if a new context ! * needs to be started. If so, it starts the context and sets the ! * flag. After ContentHandler.startElement() ! * does that, it always clears the flag. ! * ! *

          Normally, SAX drivers would push a new context at the beginning ! * of each XML element. Then they perform a first pass over the ! * attributes to process all namespace declarations, making ! * ContentHandler.startPrefixMapping() callbacks. ! * Then a second pass is made, to determine the namespace-qualified ! * names for all attributes and for the element name. ! * Finally all the information for the ! * ContentHandler.startElement() callback is available, ! * so it can then be made. ! * ! *

          The Namespace support object always starts with a base context ! * already in force: in this context, only the "xml" prefix is ! * declared.

          ! * ! * @see org.xml.sax.ContentHandler ! * @see #popContext ! */ ! public void pushContext () ! { ! int max = contexts.length; ! ! contexts [contextPos].declsOK = false; ! contextPos++; ! ! // Extend the array if necessary ! if (contextPos >= max) { ! Context newContexts[] = new Context[max*2]; ! System.arraycopy(contexts, 0, newContexts, 0, max); ! max *= 2; ! contexts = newContexts; ! } ! ! // Allocate the context if necessary. ! currentContext = contexts[contextPos]; ! if (currentContext == null) { ! contexts[contextPos] = currentContext = new Context(); ! } ! ! // Set the parent, if any. ! if (contextPos > 0) { ! currentContext.setParent(contexts[contextPos - 1]); ! } ! } ! ! ! /** ! * Revert to the previous Namespace context. ! * ! *

          Normally, you should pop the context at the end of each ! * XML element. After popping the context, all Namespace prefix ! * mappings that were previously in force are restored.

          ! * ! *

          You must not attempt to declare additional Namespace ! * prefixes after popping a context, unless you push another ! * context first.

          ! * ! * @see #pushContext ! */ ! public void popContext () ! { ! contexts[contextPos].clear(); ! contextPos--; ! if (contextPos < 0) { ! throw new EmptyStackException(); ! } ! currentContext = contexts[contextPos]; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Operations within a context. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Declare a Namespace prefix. All prefixes must be declared ! * before they are referenced. For example, a SAX driver (parser) ! * would scan an element's attributes ! * in two passes: first for namespace declarations, ! * then a second pass using {@link #processName processName()} to ! * interpret prefixes against (potentially redefined) prefixes. ! * ! *

          This method declares a prefix in the current Namespace ! * context; the prefix will remain in force until this context ! * is popped, unless it is shadowed in a descendant context.

          ! * ! *

          To declare the default element Namespace, use the empty string as ! * the prefix.

          ! * ! *

          Note that you must not declare a prefix after ! * you've pushed and popped another Namespace context, or ! * treated the declarations phase as complete by processing ! * a prefixed name.

          ! * ! *

          Note that there is an asymmetry in this library: {@link ! * #getPrefix getPrefix} will not return the "" prefix, ! * even if you have declared a default element namespace. ! * To check for a default namespace, ! * you have to look it up explicitly using {@link #getURI getURI}. ! * This asymmetry exists to make it easier to look up prefixes ! * for attribute names, where the default prefix is not allowed.

          ! * ! * @param prefix The prefix to declare, or the empty string to ! * indicate the default element namespace. This may never have ! * the value "xml" or "xmlns". ! * @param uri The Namespace URI to associate with the prefix. ! * @return true if the prefix was legal, false otherwise ! * @exception IllegalStateException when a prefix is declared ! * after looking up a name in the context, or after pushing ! * another context on top of it. ! * ! * @see #processName ! * @see #getURI ! * @see #getPrefix ! */ ! public boolean declarePrefix (String prefix, String uri) ! { ! if (prefix.equals("xml") || prefix.equals("xmlns")) { ! return false; ! } else { ! currentContext.declarePrefix(prefix, uri); ! return true; ! } ! } ! ! ! /** ! * Process a raw XML 1.0 name, after all declarations in the current ! * context have been handled by {@link #declarePrefix declarePrefix()}. ! * ! *

          This method processes a raw XML 1.0 name in the current ! * context by removing the prefix and looking it up among the ! * prefixes currently declared. The return value will be the ! * array supplied by the caller, filled in as follows:

          ! * ! *
          ! *
          parts[0]
          ! *
          The Namespace URI, or an empty string if none is ! * in use.
          ! *
          parts[1]
          ! *
          The local name (without prefix).
          ! *
          parts[2]
          ! *
          The original raw name.
          ! *
          ! * ! *

          All of the strings in the array will be internalized. If ! * the raw name has a prefix that has not been declared, then ! * the return value will be null.

          ! * ! *

          Note that attribute names are processed differently than ! * element names: an unprefixed element name will received the ! * default Namespace (if any), while an unprefixed attribute name ! * will not.

          ! * ! * @param qName The raw XML 1.0 name to be processed. ! * @param parts An array supplied by the caller, capable of ! * holding at least three members. ! * @param isAttribute A flag indicating whether this is an ! * attribute name (true) or an element name (false). ! * @return The supplied array holding three internalized strings ! * representing the Namespace URI (or empty string), the ! * local name, and the raw XML 1.0 name; or null if there ! * is an undeclared prefix. ! * @see #declarePrefix ! * @see java.lang.String#intern */ ! public String [] processName (String qName, String parts[], ! boolean isAttribute) ! { ! String myParts[] = currentContext.processName(qName, isAttribute); ! if (myParts == null) { ! return null; ! } else { ! parts[0] = myParts[0]; ! parts[1] = myParts[1]; ! parts[2] = myParts[2]; ! return parts; ! } ! } ! ! ! /** ! * Look up a prefix and get the currently-mapped Namespace URI. ! * ! *

          This method looks up the prefix in the current context. ! * Use the empty string ("") for the default Namespace.

          ! * ! * @param prefix The prefix to look up. ! * @return The associated Namespace URI, or null if the prefix ! * is undeclared in this context. ! * @see #getPrefix ! * @see #getPrefixes ! */ ! public String getURI (String prefix) ! { ! return currentContext.getURI(prefix); ! } ! ! ! /** ! * Return an enumeration of all prefixes currently declared. ! * ! *

          Note: if there is a default prefix, it will not be ! * returned in this enumeration; check for the default prefix ! * using the {@link #getURI getURI} with an argument of "".

          ! * ! * @return An enumeration of all prefixes declared in the ! * current context except for the empty (default) ! * prefix. ! * @see #getDeclaredPrefixes ! * @see #getURI ! */ ! public Enumeration getPrefixes () ! { ! return currentContext.getPrefixes(); ! } ! ! ! /** ! * Return one of the prefixes mapped to a Namespace URI. ! * ! *

          If more than one prefix is currently mapped to the same ! * URI, this method will make an arbitrary selection; if you ! * want all of the prefixes, use the {@link #getPrefixes} ! * method instead.

          ! * ! *

          Note: this will never return the empty (default) prefix; ! * to check for a default prefix, use the {@link #getURI getURI} ! * method with an argument of "".

          ! * ! * @param uri The Namespace URI. ! * @param isAttribute true if this prefix is for an attribute ! * (and the default Namespace is not allowed). ! * @return One of the prefixes currently mapped to the URI supplied, ! * or null if none is mapped or if the URI is assigned to ! * the default Namespace. ! * @see #getPrefixes(java.lang.String) ! * @see #getURI ! */ ! public String getPrefix (String uri) ! { ! return currentContext.getPrefix(uri); ! } ! ! ! /** ! * Return an enumeration of all prefixes currently declared for a URI. ! * ! *

          This method returns prefixes mapped to a specific Namespace ! * URI. The xml: prefix will be included. If you want only one ! * prefix that's mapped to the Namespace URI, and you don't care ! * which one you get, use the {@link #getPrefix getPrefix} ! * method instead.

          ! * ! *

          Note: the empty (default) prefix is never included ! * in this enumeration; to check for the presence of a default ! * Namespace, use the {@link #getURI getURI} method with an ! * argument of "".

          ! * ! * @param uri The Namespace URI. ! * @return An enumeration of all prefixes declared in the ! * current context. ! * @see #getPrefix ! * @see #getDeclaredPrefixes ! * @see #getURI ! */ ! public Enumeration getPrefixes (String uri) ! { ! Vector prefixes = new Vector(); ! Enumeration allPrefixes = getPrefixes(); ! while (allPrefixes.hasMoreElements()) { ! String prefix = (String)allPrefixes.nextElement(); ! if (uri.equals(getURI(prefix))) { ! prefixes.addElement(prefix); ! } ! } ! return prefixes.elements(); ! } ! ! ! /** ! * Return an enumeration of all prefixes declared in this context. ! * ! *

          The empty (default) prefix will be included in this ! * enumeration; note that this behaviour differs from that of ! * {@link #getPrefix} and {@link #getPrefixes}.

          ! * ! * @return An enumeration of all prefixes declared in this ! * context. ! * @see #getPrefixes ! * @see #getURI ! */ ! public Enumeration getDeclaredPrefixes () ! { ! return currentContext.getDeclaredPrefixes(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private Context contexts[]; ! private Context currentContext; ! private int contextPos; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal classes. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Internal class for a single Namespace context. ! * ! *

          This module caches and reuses Namespace contexts, ! * so the number allocated ! * will be equal to the element depth of the document, not to the total ! * number of elements (i.e. 5-10 rather than tens of thousands). ! * Also, data structures used to represent contexts are shared when ! * possible (child contexts without declarations) to further reduce ! * the amount of memory that's consumed. ! *

          ! */ ! final class Context { ! ! /** ! * Create the root-level Namespace context. ! */ ! Context () ! { ! copyTables(); ! } ! ! ! /** ! * (Re)set the parent of this Namespace context. ! * The context must either have been freshly constructed, ! * or must have been cleared. ! * ! * @param context The parent Namespace context object. ! */ ! void setParent (Context parent) ! { ! this.parent = parent; ! declarations = null; ! prefixTable = parent.prefixTable; ! uriTable = parent.uriTable; ! elementNameTable = parent.elementNameTable; ! attributeNameTable = parent.attributeNameTable; ! defaultNS = parent.defaultNS; ! declSeen = false; ! declsOK = true; ! } ! ! /** ! * Makes associated state become collectible, ! * invalidating this context. ! * {@link #setParent} must be called before ! * this context may be used again. ! */ ! void clear () ! { ! parent = null; ! prefixTable = null; ! uriTable = null; ! elementNameTable = null; ! attributeNameTable = null; ! defaultNS = null; ! } ! ! ! /** ! * Declare a Namespace prefix for this context. ! * ! * @param prefix The prefix to declare. ! * @param uri The associated Namespace URI. ! * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix ! */ ! void declarePrefix (String prefix, String uri) ! { ! // Lazy processing... ! if (!declsOK) ! throw new IllegalStateException ( ! "can't declare any more prefixes in this context"); ! if (!declSeen) { ! copyTables(); ! } ! if (declarations == null) { ! declarations = new Vector(); ! } ! ! prefix = prefix.intern(); ! uri = uri.intern(); ! if ("".equals(prefix)) { ! if ("".equals(uri)) { ! defaultNS = null; ! } else { ! defaultNS = uri; ! } ! } else { ! prefixTable.put(prefix, uri); ! uriTable.put(uri, prefix); // may wipe out another prefix ! } ! declarations.addElement(prefix); ! } ! ! ! /** ! * Process a raw XML 1.0 name in this context. ! * ! * @param qName The raw XML 1.0 name. ! * @param isAttribute true if this is an attribute name. ! * @return An array of three strings containing the ! * URI part (or empty string), the local part, ! * and the raw name, all internalized, or null ! * if there is an undeclared prefix. ! * @see org.xml.sax.helpers.NamespaceSupport#processName ! */ ! String [] processName (String qName, boolean isAttribute) ! { ! String name[]; ! Hashtable table; ! ! // detect errors in call sequence ! declsOK = false; ! ! // Select the appropriate table. ! if (isAttribute) { ! table = attributeNameTable; ! } else { ! table = elementNameTable; ! } ! ! // Start by looking in the cache, and ! // return immediately if the name ! // is already known in this content ! name = (String[])table.get(qName); ! if (name != null) { ! return name; ! } ! ! // We haven't seen this name in this ! // context before. Maybe in the parent ! // context, but we can't assume prefix ! // bindings are the same. ! name = new String[3]; ! name[2] = qName.intern(); ! int index = qName.indexOf(':'); ! ! ! // No prefix. ! if (index == -1) { ! if (isAttribute || defaultNS == null) { ! name[0] = ""; ! } else { ! name[0] = defaultNS; ! } ! name[1] = name[2]; ! } ! ! // Prefix ! else { ! String prefix = qName.substring(0, index); ! String local = qName.substring(index+1); ! String uri; ! if ("".equals(prefix)) { ! uri = defaultNS; ! } else { ! uri = (String)prefixTable.get(prefix); ! } ! if (uri == null) { ! return null; ! } ! name[0] = uri; ! name[1] = local.intern(); ! } ! ! // Save in the cache for future use. ! // (Could be shared with parent context...) ! table.put(name[2], name); ! return name; ! } ! ! ! /** ! * Look up the URI associated with a prefix in this context. ! * ! * @param prefix The prefix to look up. ! * @return The associated Namespace URI, or null if none is ! * declared. ! * @see org.xml.sax.helpers.NamespaceSupport#getURI ! */ ! String getURI (String prefix) ! { ! if ("".equals(prefix)) { ! return defaultNS; ! } else if (prefixTable == null) { ! return null; ! } else { ! return (String)prefixTable.get(prefix); ! } ! } ! ! ! /** ! * Look up one of the prefixes associated with a URI in this context. ! * ! *

          Since many prefixes may be mapped to the same URI, ! * the return value may be unreliable.

          ! * ! * @param uri The URI to look up. ! * @return The associated prefix, or null if none is declared. ! * @see org.xml.sax.helpers.NamespaceSupport#getPrefix ! */ ! String getPrefix (String uri) ! { ! if (uriTable == null) { ! return null; ! } else { ! return (String)uriTable.get(uri); ! } ! } ! ! ! /** ! * Return an enumeration of prefixes declared in this context. ! * ! * @return An enumeration of prefixes (possibly empty). ! * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes ! */ ! Enumeration getDeclaredPrefixes () ! { ! if (declarations == null) { ! return EMPTY_ENUMERATION; ! } else { ! return declarations.elements(); ! } ! } ! ! ! /** ! * Return an enumeration of all prefixes currently in force. ! * ! *

          The default prefix, if in force, is not ! * returned, and will have to be checked for separately.

          ! * ! * @return An enumeration of prefixes (never empty). ! * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes ! */ ! Enumeration getPrefixes () ! { ! if (prefixTable == null) { ! return EMPTY_ENUMERATION; ! } else { ! return prefixTable.keys(); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////// ! // Internal methods. ! //////////////////////////////////////////////////////////////// ! ! ! /** ! * Copy on write for the internal tables in this context. ! * ! *

          This class is optimized for the normal case where most ! * elements do not contain Namespace declarations.

          ! */ ! private void copyTables () ! { ! if (prefixTable != null) { ! prefixTable = (Hashtable)prefixTable.clone(); ! } else { ! prefixTable = new Hashtable(); ! } ! if (uriTable != null) { ! uriTable = (Hashtable)uriTable.clone(); ! } else { ! uriTable = new Hashtable(); ! } ! elementNameTable = new Hashtable(); ! attributeNameTable = new Hashtable(); ! declSeen = true; ! } ! ! ! ! //////////////////////////////////////////////////////////////// ! // Protected state. ! //////////////////////////////////////////////////////////////// ! ! Hashtable prefixTable; ! Hashtable uriTable; ! Hashtable elementNameTable; ! Hashtable attributeNameTable; ! String defaultNS = null; ! boolean declsOK = true; ! ! ! ! //////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////// ! ! private Vector declarations = null; ! private boolean declSeen = false; ! private Context parent = null; ! } ! } ! ! // end of NamespaceSupport.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/NewInstance.java gcc-3.3/libjava/org/xml/sax/helpers/NewInstance.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/NewInstance.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/NewInstance.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 0 **** --- 1,80 ---- + // NewInstance.java - create a new instance of a class by name. + // http://www.saxproject.org + // Written by Edwin Goei, edwingo@apache.org + // and by David Brownell, dbrownell@users.sourceforge.net + // NO WARRANTY! This class is in the Public Domain. + + // $Id: NewInstance.java,v 1.1.2.1 2002/12/20 03:50:17 tromey Exp $ + + package org.xml.sax.helpers; + + import java.lang.reflect.Method; + import java.lang.reflect.InvocationTargetException; + + /** + * Create a new instance of a class by name. + * + *
          + * This module, both source code and documentation, is in the + * Public Domain, and comes with NO WARRANTY. + * See http://www.saxproject.org + * for further information. + *
          + * + *

          This class contains a static method for creating an instance of a + * class from an explicit class name. It tries to use the thread's context + * ClassLoader if possible and falls back to using + * Class.forName(String).

          + * + *

          This code is designed to compile and run on JDK version 1.1 and later + * including versions of Java 2.

          + * + * @author Edwin Goei, David Brownell + * @version 2.0.1 (sax2r2) + */ + class NewInstance { + + /** + * Creates a new instance of the specified class name + * + * Package private so this code is not exposed at the API level. + */ + static Object newInstance (ClassLoader classLoader, String className) + throws ClassNotFoundException, IllegalAccessException, + InstantiationException + { + Class driverClass; + if (classLoader == null) { + driverClass = Class.forName(className); + } else { + driverClass = classLoader.loadClass(className); + } + return driverClass.newInstance(); + } + + /** + * Figure out which ClassLoader to use. For JDK 1.2 and later use + * the context ClassLoader. + */ + static ClassLoader getClassLoader () + { + Method m = null; + + try { + m = Thread.class.getMethod("getContextClassLoader", null); + } catch (NoSuchMethodException e) { + // Assume that we are running JDK 1.1, use the current ClassLoader + return NewInstance.class.getClassLoader(); + } + + try { + return (ClassLoader) m.invoke(Thread.currentThread(), null); + } catch (IllegalAccessException e) { + // assert(false) + throw new UnknownError(e.getMessage()); + } catch (InvocationTargetException e) { + // assert(e.getTargetException() instanceof SecurityException) + throw new UnknownError(e.getMessage()); + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/package.html gcc-3.3/libjava/org/xml/sax/helpers/package.html *** gcc-3.2.3/libjava/org/xml/sax/helpers/package.html 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/package.html 2002-12-20 03:50:17.000000000 +0000 *************** *** 0 **** --- 1,13 ---- + + + + + + +

          This package contains "helper" classes, including + support for bootstrapping SAX-based applications. + +

          See http://www.saxproject.org + for more information about SAX.

          + + diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/ParserAdapter.java gcc-3.3/libjava/org/xml/sax/helpers/ParserAdapter.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/ParserAdapter.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/ParserAdapter.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,1008 **** ! // ParserAdapter.java - adapt a SAX1 Parser to a SAX2 XMLReader. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: ParserAdapter.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import java.io.IOException; ! import java.util.Enumeration; ! ! import org.xml.sax.Parser; // deprecated ! import org.xml.sax.InputSource; ! import org.xml.sax.Locator; ! import org.xml.sax.AttributeList; // deprecated ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.DocumentHandler; // deprecated ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! import org.xml.sax.SAXParseException; ! ! import org.xml.sax.XMLReader; ! import org.xml.sax.Attributes; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.SAXNotRecognizedException; ! import org.xml.sax.SAXNotSupportedException; ! ! ! /** ! * Adapt a SAX1 Parser as a SAX2 XMLReader. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class wraps a SAX1 {@link org.xml.sax.Parser Parser} ! * and makes it act as a SAX2 {@link org.xml.sax.XMLReader XMLReader}, ! * with feature, property, and Namespace support. Note ! * that it is not possible to report {@link org.xml.sax.ContentHandler#skippedEntity ! * skippedEntity} events, since SAX1 does not make that information available.

          ! * ! *

          This adapter does not test for duplicate Namespace-qualified ! * attribute names.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.helpers.XMLReaderAdapter ! * @see org.xml.sax.XMLReader ! * @see org.xml.sax.Parser ! */ ! public class ParserAdapter implements XMLReader, DocumentHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructors. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Construct a new parser adapter. ! * ! *

          Use the "org.xml.sax.parser" property to locate the ! * embedded SAX1 driver.

          ! * ! * @exception org.xml.sax.SAXException If the embedded driver ! * cannot be instantiated or if the ! * org.xml.sax.parser property is not specified. ! */ ! public ParserAdapter () ! throws SAXException ! { ! super(); ! ! String driver = System.getProperty("org.xml.sax.parser"); ! ! try { ! setup(ParserFactory.makeParser()); ! } catch (ClassNotFoundException e1) { ! throw new ! SAXException("Cannot find SAX1 driver class " + ! driver, e1); ! } catch (IllegalAccessException e2) { ! throw new ! SAXException("SAX1 driver class " + ! driver + ! " found but cannot be loaded", e2); ! } catch (InstantiationException e3) { ! throw new ! SAXException("SAX1 driver class " + ! driver + ! " loaded but cannot be instantiated", e3); ! } catch (ClassCastException e4) { ! throw new ! SAXException("SAX1 driver class " + ! driver + ! " does not implement org.xml.sax.Parser"); ! } catch (NullPointerException e5) { ! throw new ! SAXException("System property org.xml.sax.parser not specified"); ! } ! } ! ! ! /** ! * Construct a new parser adapter. ! * ! *

          Note that the embedded parser cannot be changed once the ! * adapter is created; to embed a different parser, allocate ! * a new ParserAdapter.

          ! * ! * @param parser The SAX1 parser to embed. ! * @exception java.lang.NullPointerException If the parser parameter ! * is null. ! */ ! public ParserAdapter (Parser parser) ! { ! super(); ! setup(parser); ! } ! ! ! /** ! * Internal setup method. ! * ! * @param parser The embedded parser. ! * @exception java.lang.NullPointerException If the parser parameter ! * is null. ! */ ! private void setup (Parser parser) ! { ! if (parser == null) { ! throw new ! NullPointerException("Parser argument must not be null"); ! } ! this.parser = parser; ! atts = new AttributesImpl(); ! nsSupport = new NamespaceSupport(); ! attAdapter = new AttributeListAdapter(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.XMLReader. ! //////////////////////////////////////////////////////////////////// ! ! ! // ! // Internal constants for the sake of convenience. ! // ! private final static String FEATURES = "http://xml.org/sax/features/"; ! private final static String NAMESPACES = FEATURES + "namespaces"; ! private final static String NAMESPACE_PREFIXES = FEATURES + "namespace-prefixes"; ! private final static String VALIDATION = FEATURES + "validation"; ! private final static String EXTERNAL_GENERAL = ! FEATURES + "external-general-entities"; ! private final static String EXTERNAL_PARAMETER = ! FEATURES + "external-parameter-entities"; ! ! ! /** ! * Set a feature for the parser. ! * ! *

          The only features supported are namespaces and ! * namespace-prefixes.

          ! * ! * @param name The feature name, as a complete URI. ! * @param state The requested feature state. ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * name is not known. ! * @exception org.xml.sax.SAXNotSupportedException If the feature ! * state is not supported. ! * @see org.xml.sax.XMLReader#setFeature ! */ ! public void setFeature (String name, boolean state) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (name.equals(NAMESPACES)) { ! checkNotParsing("feature", name); ! namespaces = state; ! if (!namespaces && !prefixes) { ! prefixes = true; ! } ! } else if (name.equals(NAMESPACE_PREFIXES)) { ! checkNotParsing("feature", name); ! prefixes = state; ! if (!prefixes && !namespaces) { ! namespaces = true; ! } ! } else if (name.equals(VALIDATION) || ! name.equals(EXTERNAL_GENERAL) || ! name.equals(EXTERNAL_PARAMETER)) { ! throw new SAXNotSupportedException("Feature: " + name); ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Check a parser feature. ! * ! *

          The only features supported are namespaces and ! * namespace-prefixes.

          ! * ! * @param name The feature name, as a complete URI. ! * @return The current feature state. ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * name is not known. ! * @exception org.xml.sax.SAXNotSupportedException If querying the ! * feature state is not supported. ! * @see org.xml.sax.XMLReader#setFeature ! */ ! public boolean getFeature (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (name.equals(NAMESPACES)) { ! return namespaces; ! } else if (name.equals(NAMESPACE_PREFIXES)) { ! return prefixes; ! } else if (name.equals(VALIDATION) || ! name.equals(EXTERNAL_GENERAL) || ! name.equals(EXTERNAL_PARAMETER)) { ! throw new SAXNotSupportedException("Feature: " + name); ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Set a parser property. ! * ! *

          No special properties are currently supported.

          ! * ! * @param name The property name. ! * @param value The property value. ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * name is not known. ! * @exception org.xml.sax.SAXNotSupportedException If the feature ! * state is not supported. ! * @see org.xml.sax.XMLReader#setProperty ! */ ! public void setProperty (String name, Object value) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! ! ! /** ! * Get a parser property. ! * ! *

          No special properties are currently supported.

          ! * ! * @param name The property name. ! * @return The property value. ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * name is not known. ! * @exception org.xml.sax.SAXNotSupportedException If the feature ! * state is not supported. ! * @see org.xml.sax.XMLReader#getProperty ! */ ! public Object getProperty (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! ! ! /** ! * Set the entity resolver. ! * ! * @param resolver The new entity resolver. ! * @exception java.lang.NullPointerException If the entity resolver ! * parameter is null. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setEntityResolver (EntityResolver resolver) ! { ! if (resolver == null) { ! throw new NullPointerException("Null entity resolver"); ! } ! entityResolver = resolver; ! } ! ! ! /** ! * Return the current entity resolver. ! * ! * @return The current entity resolver, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public EntityResolver getEntityResolver () ! { ! return entityResolver; ! } ! ! ! /** ! * Set the DTD handler. ! * ! * @param resolver The new DTD handler. ! * @exception java.lang.NullPointerException If the DTD handler ! * parameter is null. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setDTDHandler (DTDHandler handler) ! { ! if (handler == null) { ! throw new NullPointerException("Null DTD handler"); ! } ! dtdHandler = handler; ! } ! ! ! /** ! * Return the current DTD handler. ! * ! * @return The current DTD handler, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public DTDHandler getDTDHandler () ! { ! return dtdHandler; ! } ! ! ! /** ! * Set the content handler. ! * ! * @param resolver The new content handler. ! * @exception java.lang.NullPointerException If the content handler ! * parameter is null. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setContentHandler (ContentHandler handler) ! { ! if (handler == null) { ! throw new NullPointerException("Null content handler"); ! } ! contentHandler = handler; ! } ! ! ! /** ! * Return the current content handler. ! * ! * @return The current content handler, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public ContentHandler getContentHandler () ! { ! return contentHandler; ! } ! ! ! /** ! * Set the error handler. ! * ! * @param resolver The new error handler. ! * @exception java.lang.NullPointerException If the error handler ! * parameter is null. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setErrorHandler (ErrorHandler handler) ! { ! if (handler == null) { ! throw new NullPointerException("Null error handler"); ! } ! errorHandler = handler; ! } ! ! ! /** ! * Return the current error handler. ! * ! * @return The current error handler, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public ErrorHandler getErrorHandler () ! { ! return errorHandler; ! } ! ! ! /** ! * Parse an XML document. ! * ! * @param systemId The absolute URL of the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception org.xml.sax.SAXException If there is a problem ! * processing the document. ! * @see #parse(org.xml.sax.InputSource) ! * @see org.xml.sax.Parser#parse(java.lang.String) ! */ ! public void parse (String systemId) ! throws IOException, SAXException ! { ! parse(new InputSource(systemId)); ! } ! ! ! /** ! * Parse an XML document. ! * ! * @param input An input source for the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception org.xml.sax.SAXException If there is a problem ! * processing the document. ! * @see #parse(java.lang.String) ! * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource) ! */ ! public void parse (InputSource input) ! throws IOException, SAXException ! { ! if (parsing) { ! throw new SAXException("Parser is already in use"); ! } ! setupParser(); ! parsing = true; ! try { ! parser.parse(input); ! } finally { ! parsing = false; ! } ! parsing = false; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.DocumentHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Adapt a SAX1 document locator event. ! * ! * @param locator A document locator. ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! */ ! public void setDocumentLocator (Locator locator) ! { ! this.locator = locator; ! if (contentHandler != null) { ! contentHandler.setDocumentLocator(locator); ! } ! } ! ! ! /** ! * Adapt a SAX1 start document event. ! * ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startDocument(); ! } ! } ! ! ! /** ! * Adapt a SAX1 end document event. ! * ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endDocument(); ! } ! } ! ! ! /** ! * Adapt a SAX1 startElement event. ! * ! *

          If necessary, perform Namespace processing.

          ! * ! * @param qName The qualified (prefixed) name. ! * @param qAtts The XML 1.0 attribute list (with qnames). ! */ ! public void startElement (String qName, AttributeList qAtts) ! throws SAXException ! { ! // If we're not doing Namespace ! // processing, dispatch this quickly. ! if (!namespaces) { ! if (contentHandler != null) { ! attAdapter.setAttributeList(qAtts); ! contentHandler.startElement("", "", qName.intern(), ! attAdapter); ! } ! return; ! } ! ! ! // OK, we're doing Namespace processing. ! nsSupport.pushContext(); ! boolean seenDecl = false; ! atts.clear(); ! ! // Take a first pass and copy all ! // attributes into the SAX2 attribute ! // list, noting any Namespace ! // declarations. ! int length = qAtts.getLength(); ! for (int i = 0; i < length; i++) { ! String attQName = qAtts.getName(i); ! String type = qAtts.getType(i); ! String value = qAtts.getValue(i); ! ! // Found a declaration... ! if (attQName.startsWith("xmlns")) { ! String prefix; ! int n = attQName.indexOf(':'); ! if (n == -1) { ! prefix = ""; ! } else { ! prefix = attQName.substring(n+1); ! } ! if (!nsSupport.declarePrefix(prefix, value)) { ! reportError("Illegal Namespace prefix: " + prefix); ! } ! if (contentHandler != null) { ! contentHandler.startPrefixMapping(prefix, value); ! } ! // We may still have to add this to ! // the list. ! if (prefixes) { ! atts.addAttribute("", "", attQName.intern(), ! type, value); ! } ! seenDecl = true; ! ! // This isn't a declaration. ! } else { ! String attName[] = processName(attQName, true); ! atts.addAttribute(attName[0], attName[1], attName[2], ! type, value); ! } ! } ! ! // If there was a Namespace declaration, ! // we have to make a second pass just ! // to be safe -- this will happen very ! // rarely, possibly only once for each ! // document. ! if (seenDecl) { ! length = atts.getLength(); ! for (int i = 0; i < length; i++) { ! String attQName = atts.getQName(i); ! if (!attQName.startsWith("xmlns")) { ! String attName[] = processName(attQName, true); ! atts.setURI(i, attName[0]); ! atts.setLocalName(i, attName[1]); ! } ! } ! } ! ! // OK, finally report the event. ! if (contentHandler != null) { ! String name[] = processName(qName, false); ! contentHandler.startElement(name[0], name[1], name[2], atts); ! } ! } ! ! ! /** ! * Adapt a SAX1 end element event. ! * ! * @param qName The qualified (prefixed) name. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#endElement ! */ ! public void endElement (String qName) ! throws SAXException ! { ! // If we're not doing Namespace ! // processing, dispatch this quickly. ! if (!namespaces) { ! if (contentHandler != null) { ! contentHandler.endElement("", "", qName.intern()); ! } ! return; ! } ! ! // Split the name. ! String names[] = processName(qName, false); ! if (contentHandler != null) { ! contentHandler.endElement(names[0], names[1], names[2]); ! Enumeration prefixes = nsSupport.getDeclaredPrefixes(); ! while (prefixes.hasMoreElements()) { ! String prefix = (String)prefixes.nextElement(); ! contentHandler.endPrefixMapping(prefix); ! } ! } ! nsSupport.popContext(); ! } ! ! ! /** ! * Adapt a SAX1 characters event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.characters(ch, start, length); ! } ! } ! ! ! /** ! * Adapt a SAX1 ignorable whitespace event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.ignorableWhitespace(ch, start, length); ! } ! } ! ! ! /** ! * Adapt a SAX1 processing instruction event. ! * ! * @param target The processing instruction target. ! * @param data The remainder of the processing instruction ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.processingInstruction(target, data); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal utility methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Initialize the parser before each run. ! */ ! private void setupParser () ! { ! nsSupport.reset(); ! ! if (entityResolver != null) { ! parser.setEntityResolver(entityResolver); ! } ! if (dtdHandler != null) { ! parser.setDTDHandler(dtdHandler); ! } ! if (errorHandler != null) { ! parser.setErrorHandler(errorHandler); ! } ! parser.setDocumentHandler(this); ! locator = null; ! } ! ! ! /** ! * Process a qualified (prefixed) name. ! * ! *

          If the name has an undeclared prefix, use only the qname ! * and make an ErrorHandler.error callback in case the app is ! * interested.

          ! * ! * @param qName The qualified (prefixed) name. ! * @param isAttribute true if this is an attribute name. ! * @return The name split into three parts. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception if there is an error callback. ! */ ! private String [] processName (String qName, boolean isAttribute) ! throws SAXException ! { ! String parts[] = nsSupport.processName(qName, nameParts, ! isAttribute); ! if (parts == null) { ! parts = new String[3]; ! parts[2] = qName.intern(); ! reportError("Undeclared prefix: " + qName); ! } ! return parts; ! } ! ! ! /** ! * Report a non-fatal error. ! * ! * @param message The error message. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception. ! */ ! void reportError (String message) ! throws SAXException ! { ! if (errorHandler == null) { ! return; ! } ! ! SAXParseException e; ! if (locator != null) { ! e = new SAXParseException(message, locator); ! } else { ! e = new SAXParseException(message, null, null, -1, -1); ! } ! errorHandler.error(e); ! } ! ! ! /** ! * Throw an exception if we are parsing. ! * ! *

          Use this method to detect illegal feature or ! * property changes.

          ! * ! * @param type The type of thing (feature or property). ! * @param name The feature or property name. ! * @exception org.xml.sax.SAXNotSupportedException If a ! * document is currently being parsed. ! */ ! private void checkNotParsing (String type, String name) ! throws SAXNotSupportedException ! { ! if (parsing) { ! throw new SAXNotSupportedException("Cannot change " + ! type + ' ' + ! name + " while parsing"); ! ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private NamespaceSupport nsSupport; ! private AttributeListAdapter attAdapter; ! ! private boolean parsing = false; ! private String nameParts[] = new String[3]; ! ! private Parser parser = null; ! ! private AttributesImpl atts = null; ! ! // Features ! private boolean namespaces = true; ! private boolean prefixes = false; ! ! // Properties ! ! // Handlers ! Locator locator; ! ! EntityResolver entityResolver = null; ! DTDHandler dtdHandler = null; ! ContentHandler contentHandler = null; ! ErrorHandler errorHandler = null; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Inner class to wrap an AttributeList when not doing NS proc. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Adapt a SAX1 AttributeList as a SAX2 Attributes object. ! * ! *

          This class is in the Public Domain, and comes with NO ! * WARRANTY of any kind.

          ! * ! *

          This wrapper class is used only when Namespace support ! * is disabled -- it provides pretty much a direct mapping ! * from SAX1 to SAX2, except that names and types are ! * interned whenever requested.

          ! */ ! final class AttributeListAdapter implements Attributes ! { ! ! /** ! * Construct a new adapter. ! */ ! AttributeListAdapter () ! { ! } ! ! ! /** ! * Set the embedded AttributeList. ! * ! *

          This method must be invoked before any of the others ! * can be used.

          ! * ! * @param The SAX1 attribute list (with qnames). ! */ ! void setAttributeList (AttributeList qAtts) ! { ! this.qAtts = qAtts; ! } ! ! ! /** ! * Return the length of the attribute list. ! * ! * @return The number of attributes in the list. ! * @see org.xml.sax.Attributes#getLength ! */ ! public int getLength () ! { ! return qAtts.getLength(); ! } ! ! ! /** ! * Return the Namespace URI of the specified attribute. ! * ! * @param The attribute's index. ! * @return Always the empty string. ! * @see org.xml.sax.Attributes#getURI ! */ ! public String getURI (int i) ! { ! return ""; ! } ! ! ! /** ! * Return the local name of the specified attribute. ! * ! * @param The attribute's index. ! * @return Always the empty string. ! * @see org.xml.sax.Attributes#getLocalName ! */ ! public String getLocalName (int i) ! { ! return ""; ! } ! ! ! /** ! * Return the qualified (prefixed) name of the specified attribute. ! * ! * @param The attribute's index. ! * @return The attribute's qualified name, internalized. ! */ ! public String getQName (int i) ! { ! return qAtts.getName(i).intern(); ! } ! ! ! /** ! * Return the type of the specified attribute. ! * ! * @param The attribute's index. ! * @return The attribute's type as an internalized string. ! */ ! public String getType (int i) ! { ! return qAtts.getType(i).intern(); ! } ! ! ! /** ! * Return the value of the specified attribute. ! * ! * @param The attribute's index. ! * @return The attribute's value. ! */ ! public String getValue (int i) ! { ! return qAtts.getValue(i); ! } ! ! ! /** ! * Look up an attribute index by Namespace name. ! * ! * @param uri The Namespace URI or the empty string. ! * @param localName The local name. ! * @return The attributes index, or -1 if none was found. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String) ! */ ! public int getIndex (String uri, String localName) ! { ! return -1; ! } ! ! ! /** ! * Look up an attribute index by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attributes index, or -1 if none was found. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String) ! */ ! public int getIndex (String qName) ! { ! int max = atts.getLength(); ! for (int i = 0; i < max; i++) { ! if (qAtts.getName(i).equals(qName)) { ! return i; ! } ! } ! return -1; ! } ! ! ! /** ! * Look up the type of an attribute by Namespace name. ! * ! * @param uri The Namespace URI ! * @param localName The local name. ! * @return The attribute's type as an internalized string. ! */ ! public String getType (String uri, String localName) ! { ! return null; ! } ! ! ! /** ! * Look up the type of an attribute by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's type as an internalized string. ! */ ! public String getType (String qName) ! { ! return qAtts.getType(qName).intern(); ! } ! ! ! /** ! * Look up the value of an attribute by Namespace name. ! * ! * @param uri The Namespace URI ! * @param localName The local name. ! * @return The attribute's value. ! */ ! public String getValue (String uri, String localName) ! { ! return null; ! } ! ! ! /** ! * Look up the value of an attribute by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's value. ! */ ! public String getValue (String qName) ! { ! return qAtts.getValue(qName); ! } ! ! private AttributeList qAtts; ! } ! } ! ! // end of ParserAdapter.java --- 1,1026 ---- ! // ParserAdapter.java - adapt a SAX1 Parser to a SAX2 XMLReader. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: ParserAdapter.java,v 1.8.2.4 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import java.io.IOException; ! import java.util.Enumeration; ! import java.util.Vector; ! ! import org.xml.sax.Parser; // deprecated ! import org.xml.sax.InputSource; ! import org.xml.sax.Locator; ! import org.xml.sax.AttributeList; // deprecated ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.DocumentHandler; // deprecated ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! import org.xml.sax.SAXParseException; ! ! import org.xml.sax.XMLReader; ! import org.xml.sax.Attributes; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.SAXNotRecognizedException; ! import org.xml.sax.SAXNotSupportedException; ! ! ! /** ! * Adapt a SAX1 Parser as a SAX2 XMLReader. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class wraps a SAX1 {@link org.xml.sax.Parser Parser} ! * and makes it act as a SAX2 {@link org.xml.sax.XMLReader XMLReader}, ! * with feature, property, and Namespace support. Note ! * that it is not possible to report {@link org.xml.sax.ContentHandler#skippedEntity ! * skippedEntity} events, since SAX1 does not make that information available.

          ! * ! *

          This adapter does not test for duplicate Namespace-qualified ! * attribute names.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.helpers.XMLReaderAdapter ! * @see org.xml.sax.XMLReader ! * @see org.xml.sax.Parser ! */ ! public class ParserAdapter implements XMLReader, DocumentHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructors. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Construct a new parser adapter. ! * ! *

          Use the "org.xml.sax.parser" property to locate the ! * embedded SAX1 driver.

          ! * ! * @exception SAXException If the embedded driver ! * cannot be instantiated or if the ! * org.xml.sax.parser property is not specified. ! */ ! public ParserAdapter () ! throws SAXException ! { ! super(); ! ! String driver = System.getProperty("org.xml.sax.parser"); ! ! try { ! setup(ParserFactory.makeParser()); ! } catch (ClassNotFoundException e1) { ! throw new ! SAXException("Cannot find SAX1 driver class " + ! driver, e1); ! } catch (IllegalAccessException e2) { ! throw new ! SAXException("SAX1 driver class " + ! driver + ! " found but cannot be loaded", e2); ! } catch (InstantiationException e3) { ! throw new ! SAXException("SAX1 driver class " + ! driver + ! " loaded but cannot be instantiated", e3); ! } catch (ClassCastException e4) { ! throw new ! SAXException("SAX1 driver class " + ! driver + ! " does not implement org.xml.sax.Parser"); ! } catch (NullPointerException e5) { ! throw new ! SAXException("System property org.xml.sax.parser not specified"); ! } ! } ! ! ! /** ! * Construct a new parser adapter. ! * ! *

          Note that the embedded parser cannot be changed once the ! * adapter is created; to embed a different parser, allocate ! * a new ParserAdapter.

          ! * ! * @param parser The SAX1 parser to embed. ! * @exception java.lang.NullPointerException If the parser parameter ! * is null. ! */ ! public ParserAdapter (Parser parser) ! { ! super(); ! setup(parser); ! } ! ! ! /** ! * Internal setup method. ! * ! * @param parser The embedded parser. ! * @exception java.lang.NullPointerException If the parser parameter ! * is null. ! */ ! private void setup (Parser parser) ! { ! if (parser == null) { ! throw new ! NullPointerException("Parser argument must not be null"); ! } ! this.parser = parser; ! atts = new AttributesImpl(); ! nsSupport = new NamespaceSupport(); ! attAdapter = new AttributeListAdapter(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.XMLReader. ! //////////////////////////////////////////////////////////////////// ! ! ! // ! // Internal constants for the sake of convenience. ! // ! private final static String FEATURES = "http://xml.org/sax/features/"; ! private final static String NAMESPACES = FEATURES + "namespaces"; ! private final static String NAMESPACE_PREFIXES = FEATURES + "namespace-prefixes"; ! ! ! /** ! * Set a feature flag for the parser. ! * ! *

          The only features recognized are namespaces and ! * namespace-prefixes.

          ! * ! * @param name The feature name, as a complete URI. ! * @param value The requested feature value. ! * @exception SAXNotRecognizedException If the feature ! * can't be assigned or retrieved. ! * @exception SAXNotSupportedException If the feature ! * can't be assigned that value. ! * @see org.xml.sax.XMLReader#setFeature ! */ ! public void setFeature (String name, boolean value) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (name.equals(NAMESPACES)) { ! checkNotParsing("feature", name); ! namespaces = value; ! if (!namespaces && !prefixes) { ! prefixes = true; ! } ! } else if (name.equals(NAMESPACE_PREFIXES)) { ! checkNotParsing("feature", name); ! prefixes = value; ! if (!prefixes && !namespaces) { ! namespaces = true; ! } ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Check a parser feature flag. ! * ! *

          The only features recognized are namespaces and ! * namespace-prefixes.

          ! * ! * @param name The feature name, as a complete URI. ! * @return The current feature value. ! * @exception SAXNotRecognizedException If the feature ! * value can't be assigned or retrieved. ! * @exception SAXNotSupportedException If the ! * feature is not currently readable. ! * @see org.xml.sax.XMLReader#setFeature ! */ ! public boolean getFeature (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (name.equals(NAMESPACES)) { ! return namespaces; ! } else if (name.equals(NAMESPACE_PREFIXES)) { ! return prefixes; ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Set a parser property. ! * ! *

          No properties are currently recognized.

          ! * ! * @param name The property name. ! * @param value The property value. ! * @exception SAXNotRecognizedException If the property ! * value can't be assigned or retrieved. ! * @exception SAXNotSupportedException If the property ! * can't be assigned that value. ! * @see org.xml.sax.XMLReader#setProperty ! */ ! public void setProperty (String name, Object value) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! ! ! /** ! * Get a parser property. ! * ! *

          No properties are currently recognized.

          ! * ! * @param name The property name. ! * @return The property value. ! * @exception SAXNotRecognizedException If the property ! * value can't be assigned or retrieved. ! * @exception SAXNotSupportedException If the property ! * value is not currently readable. ! * @see org.xml.sax.XMLReader#getProperty ! */ ! public Object getProperty (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! ! ! /** ! * Set the entity resolver. ! * ! * @param resolver The new entity resolver. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setEntityResolver (EntityResolver resolver) ! { ! entityResolver = resolver; ! } ! ! ! /** ! * Return the current entity resolver. ! * ! * @return The current entity resolver, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public EntityResolver getEntityResolver () ! { ! return entityResolver; ! } ! ! ! /** ! * Set the DTD handler. ! * ! * @param resolver The new DTD handler. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setDTDHandler (DTDHandler handler) ! { ! dtdHandler = handler; ! } ! ! ! /** ! * Return the current DTD handler. ! * ! * @return The current DTD handler, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public DTDHandler getDTDHandler () ! { ! return dtdHandler; ! } ! ! ! /** ! * Set the content handler. ! * ! * @param resolver The new content handler. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setContentHandler (ContentHandler handler) ! { ! contentHandler = handler; ! } ! ! ! /** ! * Return the current content handler. ! * ! * @return The current content handler, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public ContentHandler getContentHandler () ! { ! return contentHandler; ! } ! ! ! /** ! * Set the error handler. ! * ! * @param resolver The new error handler. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setErrorHandler (ErrorHandler handler) ! { ! errorHandler = handler; ! } ! ! ! /** ! * Return the current error handler. ! * ! * @return The current error handler, or null if none was supplied. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public ErrorHandler getErrorHandler () ! { ! return errorHandler; ! } ! ! ! /** ! * Parse an XML document. ! * ! * @param systemId The absolute URL of the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception SAXException If there is a problem ! * processing the document. ! * @see #parse(org.xml.sax.InputSource) ! * @see org.xml.sax.Parser#parse(java.lang.String) ! */ ! public void parse (String systemId) ! throws IOException, SAXException ! { ! parse(new InputSource(systemId)); ! } ! ! ! /** ! * Parse an XML document. ! * ! * @param input An input source for the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception SAXException If there is a problem ! * processing the document. ! * @see #parse(java.lang.String) ! * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource) ! */ ! public void parse (InputSource input) ! throws IOException, SAXException ! { ! if (parsing) { ! throw new SAXException("Parser is already in use"); ! } ! setupParser(); ! parsing = true; ! try { ! parser.parse(input); ! } finally { ! parsing = false; ! } ! parsing = false; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.DocumentHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 document locator event. ! * ! * @param locator A document locator. ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! */ ! public void setDocumentLocator (Locator locator) ! { ! this.locator = locator; ! if (contentHandler != null) { ! contentHandler.setDocumentLocator(locator); ! } ! } ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 start document event. ! * ! * @exception SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startDocument(); ! } ! } ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 end document event. ! * ! * @exception SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endDocument(); ! } ! } ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 startElement event. ! * ! *

          If necessary, perform Namespace processing.

          ! * ! * @param qName The qualified (prefixed) name. ! * @param qAtts The XML 1.0 attribute list (with qnames). ! * @exception SAXException The client may raise a ! * processing exception. ! */ ! public void startElement (String qName, AttributeList qAtts) ! throws SAXException ! { ! // These are exceptions from the ! // first pass; they should be ! // ignored if there's a second pass, ! // but reported otherwise. ! Vector exceptions = null; ! ! // If we're not doing Namespace ! // processing, dispatch this quickly. ! if (!namespaces) { ! if (contentHandler != null) { ! attAdapter.setAttributeList(qAtts); ! contentHandler.startElement("", "", qName.intern(), ! attAdapter); ! } ! return; ! } ! ! ! // OK, we're doing Namespace processing. ! nsSupport.pushContext(); ! int length = qAtts.getLength(); ! ! // First pass: handle NS decls ! for (int i = 0; i < length; i++) { ! String attQName = qAtts.getName(i); ! ! if (!attQName.startsWith("xmlns")) ! continue; ! // Could be a declaration... ! String prefix; ! int n = attQName.indexOf(':'); ! ! // xmlns=... ! if (n == -1 && attQName.length () == 5) { ! prefix = ""; ! } else if (n != 5) { ! // XML namespaces spec doesn't discuss "xmlnsf:oo" ! // (and similarly named) attributes ... at most, warn ! continue; ! } else // xmlns:foo=... ! prefix = attQName.substring(n+1); ! ! String value = qAtts.getValue(i); ! if (!nsSupport.declarePrefix(prefix, value)) { ! reportError("Illegal Namespace prefix: " + prefix); ! continue; ! } ! if (contentHandler != null) ! contentHandler.startPrefixMapping(prefix, value); ! } ! ! // Second pass: copy all relevant ! // attributes into the SAX2 AttributeList ! // using updated prefix bindings ! atts.clear(); ! for (int i = 0; i < length; i++) { ! String attQName = qAtts.getName(i); ! String type = qAtts.getType(i); ! String value = qAtts.getValue(i); ! ! // Declaration? ! if (attQName.startsWith("xmlns")) { ! String prefix; ! int n = attQName.indexOf(':'); ! ! if (n == -1 && attQName.length () == 5) { ! prefix = ""; ! } else if (n != 5) { ! // XML namespaces spec doesn't discuss "xmlnsf:oo" ! // (and similarly named) attributes ... ignore ! prefix = null; ! } else { ! prefix = attQName.substring(n+1); ! } ! // Yes, decl: report or prune ! if (prefix != null) { ! if (prefixes) ! atts.addAttribute("", "", attQName.intern(), ! type, value); ! continue; ! } ! } ! ! // Not a declaration -- report ! try { ! String attName[] = processName(attQName, true, true); ! atts.addAttribute(attName[0], attName[1], attName[2], ! type, value); ! } catch (SAXException e) { ! if (exceptions == null) ! exceptions = new Vector(); ! exceptions.addElement(e); ! atts.addAttribute("", attQName, attQName, type, value); ! } ! } ! ! // now handle the deferred exception reports ! if (exceptions != null && errorHandler != null) { ! for (int i = 0; i < exceptions.size(); i++) ! errorHandler.error((SAXParseException) ! (exceptions.elementAt(i))); ! } ! ! // OK, finally report the event. ! if (contentHandler != null) { ! String name[] = processName(qName, false, false); ! contentHandler.startElement(name[0], name[1], name[2], atts); ! } ! } ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 end element event. ! * ! * @param qName The qualified (prefixed) name. ! * @exception SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#endElement ! */ ! public void endElement (String qName) ! throws SAXException ! { ! // If we're not doing Namespace ! // processing, dispatch this quickly. ! if (!namespaces) { ! if (contentHandler != null) { ! contentHandler.endElement("", "", qName.intern()); ! } ! return; ! } ! ! // Split the name. ! String names[] = processName(qName, false, false); ! if (contentHandler != null) { ! contentHandler.endElement(names[0], names[1], names[2]); ! Enumeration prefixes = nsSupport.getDeclaredPrefixes(); ! while (prefixes.hasMoreElements()) { ! String prefix = (String)prefixes.nextElement(); ! contentHandler.endPrefixMapping(prefix); ! } ! } ! nsSupport.popContext(); ! } ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 characters event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.characters(ch, start, length); ! } ! } ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 ignorable whitespace event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.ignorableWhitespace(ch, start, length); ! } ! } ! ! ! /** ! * Adapter implementation method; do not call. ! * Adapt a SAX1 processing instruction event. ! * ! * @param target The processing instruction target. ! * @param data The remainder of the processing instruction ! * @exception SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.DocumentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.processingInstruction(target, data); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal utility methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Initialize the parser before each run. ! */ ! private void setupParser () ! { ! nsSupport.reset(); ! ! if (entityResolver != null) { ! parser.setEntityResolver(entityResolver); ! } ! if (dtdHandler != null) { ! parser.setDTDHandler(dtdHandler); ! } ! if (errorHandler != null) { ! parser.setErrorHandler(errorHandler); ! } ! parser.setDocumentHandler(this); ! locator = null; ! } ! ! ! /** ! * Process a qualified (prefixed) name. ! * ! *

          If the name has an undeclared prefix, use only the qname ! * and make an ErrorHandler.error callback in case the app is ! * interested.

          ! * ! * @param qName The qualified (prefixed) name. ! * @param isAttribute true if this is an attribute name. ! * @return The name split into three parts. ! * @exception SAXException The client may throw ! * an exception if there is an error callback. ! */ ! private String [] processName (String qName, boolean isAttribute, ! boolean useException) ! throws SAXException ! { ! String parts[] = nsSupport.processName(qName, nameParts, ! isAttribute); ! if (parts == null) { ! if (useException) ! throw makeException("Undeclared prefix: " + qName); ! reportError("Undeclared prefix: " + qName); ! parts = new String[3]; ! parts[0] = parts[1] = ""; ! parts[2] = qName.intern(); ! } ! return parts; ! } ! ! ! /** ! * Report a non-fatal error. ! * ! * @param message The error message. ! * @exception SAXException The client may throw ! * an exception. ! */ ! void reportError (String message) ! throws SAXException ! { ! if (errorHandler != null) ! errorHandler.error(makeException(message)); ! } ! ! ! /** ! * Construct an exception for the current context. ! * ! * @param message The error message. ! */ ! private SAXParseException makeException (String message) ! { ! if (locator != null) { ! return new SAXParseException(message, locator); ! } else { ! return new SAXParseException(message, null, null, -1, -1); ! } ! } ! ! ! /** ! * Throw an exception if we are parsing. ! * ! *

          Use this method to detect illegal feature or ! * property changes.

          ! * ! * @param type The type of thing (feature or property). ! * @param name The feature or property name. ! * @exception SAXNotSupportedException If a ! * document is currently being parsed. ! */ ! private void checkNotParsing (String type, String name) ! throws SAXNotSupportedException ! { ! if (parsing) { ! throw new SAXNotSupportedException("Cannot change " + ! type + ' ' + ! name + " while parsing"); ! ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private NamespaceSupport nsSupport; ! private AttributeListAdapter attAdapter; ! ! private boolean parsing = false; ! private String nameParts[] = new String[3]; ! ! private Parser parser = null; ! ! private AttributesImpl atts = null; ! ! // Features ! private boolean namespaces = true; ! private boolean prefixes = false; ! ! // Properties ! ! // Handlers ! Locator locator; ! ! EntityResolver entityResolver = null; ! DTDHandler dtdHandler = null; ! ContentHandler contentHandler = null; ! ErrorHandler errorHandler = null; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Inner class to wrap an AttributeList when not doing NS proc. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Adapt a SAX1 AttributeList as a SAX2 Attributes object. ! * ! *

          This class is in the Public Domain, and comes with NO ! * WARRANTY of any kind.

          ! * ! *

          This wrapper class is used only when Namespace support ! * is disabled -- it provides pretty much a direct mapping ! * from SAX1 to SAX2, except that names and types are ! * interned whenever requested.

          ! */ ! final class AttributeListAdapter implements Attributes ! { ! ! /** ! * Construct a new adapter. ! */ ! AttributeListAdapter () ! { ! } ! ! ! /** ! * Set the embedded AttributeList. ! * ! *

          This method must be invoked before any of the others ! * can be used.

          ! * ! * @param The SAX1 attribute list (with qnames). ! */ ! void setAttributeList (AttributeList qAtts) ! { ! this.qAtts = qAtts; ! } ! ! ! /** ! * Return the length of the attribute list. ! * ! * @return The number of attributes in the list. ! * @see org.xml.sax.Attributes#getLength ! */ ! public int getLength () ! { ! return qAtts.getLength(); ! } ! ! ! /** ! * Return the Namespace URI of the specified attribute. ! * ! * @param The attribute's index. ! * @return Always the empty string. ! * @see org.xml.sax.Attributes#getURI ! */ ! public String getURI (int i) ! { ! return ""; ! } ! ! ! /** ! * Return the local name of the specified attribute. ! * ! * @param The attribute's index. ! * @return Always the empty string. ! * @see org.xml.sax.Attributes#getLocalName ! */ ! public String getLocalName (int i) ! { ! return ""; ! } ! ! ! /** ! * Return the qualified (prefixed) name of the specified attribute. ! * ! * @param The attribute's index. ! * @return The attribute's qualified name, internalized. ! */ ! public String getQName (int i) ! { ! return qAtts.getName(i).intern(); ! } ! ! ! /** ! * Return the type of the specified attribute. ! * ! * @param The attribute's index. ! * @return The attribute's type as an internalized string. ! */ ! public String getType (int i) ! { ! return qAtts.getType(i).intern(); ! } ! ! ! /** ! * Return the value of the specified attribute. ! * ! * @param The attribute's index. ! * @return The attribute's value. ! */ ! public String getValue (int i) ! { ! return qAtts.getValue(i); ! } ! ! ! /** ! * Look up an attribute index by Namespace name. ! * ! * @param uri The Namespace URI or the empty string. ! * @param localName The local name. ! * @return The attributes index, or -1 if none was found. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String) ! */ ! public int getIndex (String uri, String localName) ! { ! return -1; ! } ! ! ! /** ! * Look up an attribute index by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attributes index, or -1 if none was found. ! * @see org.xml.sax.Attributes#getIndex(java.lang.String) ! */ ! public int getIndex (String qName) ! { ! int max = atts.getLength(); ! for (int i = 0; i < max; i++) { ! if (qAtts.getName(i).equals(qName)) { ! return i; ! } ! } ! return -1; ! } ! ! ! /** ! * Look up the type of an attribute by Namespace name. ! * ! * @param uri The Namespace URI ! * @param localName The local name. ! * @return The attribute's type as an internalized string. ! */ ! public String getType (String uri, String localName) ! { ! return null; ! } ! ! ! /** ! * Look up the type of an attribute by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's type as an internalized string. ! */ ! public String getType (String qName) ! { ! return qAtts.getType(qName).intern(); ! } ! ! ! /** ! * Look up the value of an attribute by Namespace name. ! * ! * @param uri The Namespace URI ! * @param localName The local name. ! * @return The attribute's value. ! */ ! public String getValue (String uri, String localName) ! { ! return null; ! } ! ! ! /** ! * Look up the value of an attribute by qualified (prefixed) name. ! * ! * @param qName The qualified name. ! * @return The attribute's value. ! */ ! public String getValue (String qName) ! { ! return qAtts.getValue(qName); ! } ! ! private AttributeList qAtts; ! } ! } ! ! // end of ParserAdapter.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/ParserFactory.java gcc-3.3/libjava/org/xml/sax/helpers/ParserFactory.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/ParserFactory.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/ParserFactory.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,129 **** ! // SAX parser factory. ! // No warranty; no copyright -- use this as you will. ! // $Id: ParserFactory.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import java.lang.ClassNotFoundException; ! import java.lang.IllegalAccessException; ! import java.lang.InstantiationException; ! import java.lang.SecurityException; ! import java.lang.ClassCastException; ! ! import org.xml.sax.Parser; ! ! ! /** ! * Java-specific class for dynamically loading SAX parsers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          Note: This class is designed to work with the now-deprecated ! * SAX1 {@link org.xml.sax.Parser Parser} class. SAX2 applications should use ! * {@link org.xml.sax.helpers.XMLReaderFactory XMLReaderFactory} instead.

          ! * ! *

          ParserFactory is not part of the platform-independent definition ! * of SAX; it is an additional convenience class designed ! * specifically for Java XML application writers. SAX applications ! * can use the static methods in this class to allocate a SAX parser ! * dynamically at run-time based either on the value of the ! * `org.xml.sax.parser' system property or on a string containing the class ! * name.

          ! * ! *

          Note that the application still requires an XML parser that ! * implements SAX1.

          ! * ! * @deprecated This class works with the deprecated ! * {@link org.xml.sax.Parser Parser} ! * interface. ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Parser ! * @see java.lang.Class ! */ ! public class ParserFactory { ! ! ! /** ! * Private null constructor. ! */ ! private ParserFactory () ! { ! } ! ! ! /** ! * Create a new SAX parser using the `org.xml.sax.parser' system property. ! * ! *

          The named class must exist and must implement the ! * {@link org.xml.sax.Parser Parser} interface.

          ! * ! * @exception java.lang.NullPointerException There is no value ! * for the `org.xml.sax.parser' system property. ! * @exception java.lang.ClassNotFoundException The SAX parser ! * class was not found (check your CLASSPATH). ! * @exception IllegalAccessException The SAX parser class was ! * found, but you do not have permission to load ! * it. ! * @exception InstantiationException The SAX parser class was ! * found but could not be instantiated. ! * @exception java.lang.ClassCastException The SAX parser class ! * was found and instantiated, but does not implement ! * org.xml.sax.Parser. ! * @see #makeParser(java.lang.String) ! * @see org.xml.sax.Parser ! */ ! public static Parser makeParser () ! throws ClassNotFoundException, ! IllegalAccessException, ! InstantiationException, ! NullPointerException, ! ClassCastException ! { ! String className = System.getProperty("org.xml.sax.parser"); ! if (className == null) { ! throw new NullPointerException("No value for sax.parser property"); ! } else { ! return makeParser(className); ! } ! } ! ! ! /** ! * Create a new SAX parser object using the class name provided. ! * ! *

          The named class must exist and must implement the ! * {@link org.xml.sax.Parser Parser} interface.

          ! * ! * @param className A string containing the name of the ! * SAX parser class. ! * @exception java.lang.ClassNotFoundException The SAX parser ! * class was not found (check your CLASSPATH). ! * @exception IllegalAccessException The SAX parser class was ! * found, but you do not have permission to load ! * it. ! * @exception InstantiationException The SAX parser class was ! * found but could not be instantiated. ! * @exception java.lang.ClassCastException The SAX parser class ! * was found and instantiated, but does not implement ! * org.xml.sax.Parser. ! * @see #makeParser() ! * @see org.xml.sax.Parser ! */ ! public static Parser makeParser (String className) ! throws ClassNotFoundException, ! IllegalAccessException, ! InstantiationException, ! ClassCastException ! { ! return (Parser)(Class.forName(className).newInstance()); ! } ! ! } ! ! // end of ParserFactory.java --- 1,129 ---- ! // SAX parser factory. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: ParserFactory.java,v 1.4.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import java.lang.ClassNotFoundException; ! import java.lang.IllegalAccessException; ! import java.lang.InstantiationException; ! import java.lang.SecurityException; ! import java.lang.ClassCastException; ! ! import org.xml.sax.Parser; ! ! ! /** ! * Java-specific class for dynamically loading SAX parsers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          Note: This class is designed to work with the now-deprecated ! * SAX1 {@link org.xml.sax.Parser Parser} class. SAX2 applications should use ! * {@link org.xml.sax.helpers.XMLReaderFactory XMLReaderFactory} instead.

          ! * ! *

          ParserFactory is not part of the platform-independent definition ! * of SAX; it is an additional convenience class designed ! * specifically for Java XML application writers. SAX applications ! * can use the static methods in this class to allocate a SAX parser ! * dynamically at run-time based either on the value of the ! * `org.xml.sax.parser' system property or on a string containing the class ! * name.

          ! * ! *

          Note that the application still requires an XML parser that ! * implements SAX1.

          ! * ! * @deprecated This class works with the deprecated ! * {@link org.xml.sax.Parser Parser} ! * interface. ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! */ ! public class ParserFactory { ! ! ! /** ! * Private null constructor. ! */ ! private ParserFactory () ! { ! } ! ! ! /** ! * Create a new SAX parser using the `org.xml.sax.parser' system property. ! * ! *

          The named class must exist and must implement the ! * {@link org.xml.sax.Parser Parser} interface.

          ! * ! * @exception java.lang.NullPointerException There is no value ! * for the `org.xml.sax.parser' system property. ! * @exception java.lang.ClassNotFoundException The SAX parser ! * class was not found (check your CLASSPATH). ! * @exception IllegalAccessException The SAX parser class was ! * found, but you do not have permission to load ! * it. ! * @exception InstantiationException The SAX parser class was ! * found but could not be instantiated. ! * @exception java.lang.ClassCastException The SAX parser class ! * was found and instantiated, but does not implement ! * org.xml.sax.Parser. ! * @see #makeParser(java.lang.String) ! * @see org.xml.sax.Parser ! */ ! public static Parser makeParser () ! throws ClassNotFoundException, ! IllegalAccessException, ! InstantiationException, ! NullPointerException, ! ClassCastException ! { ! String className = System.getProperty("org.xml.sax.parser"); ! if (className == null) { ! throw new NullPointerException("No value for sax.parser property"); ! } else { ! return makeParser(className); ! } ! } ! ! ! /** ! * Create a new SAX parser object using the class name provided. ! * ! *

          The named class must exist and must implement the ! * {@link org.xml.sax.Parser Parser} interface.

          ! * ! * @param className A string containing the name of the ! * SAX parser class. ! * @exception java.lang.ClassNotFoundException The SAX parser ! * class was not found (check your CLASSPATH). ! * @exception IllegalAccessException The SAX parser class was ! * found, but you do not have permission to load ! * it. ! * @exception InstantiationException The SAX parser class was ! * found but could not be instantiated. ! * @exception java.lang.ClassCastException The SAX parser class ! * was found and instantiated, but does not implement ! * org.xml.sax.Parser. ! * @see #makeParser() ! * @see org.xml.sax.Parser ! */ ! public static Parser makeParser (String className) ! throws ClassNotFoundException, ! IllegalAccessException, ! InstantiationException, ! ClassCastException ! { ! return (Parser) NewInstance.newInstance ( ! NewInstance.getClassLoader (), className); ! } ! ! } ! diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/XMLFilterImpl.java gcc-3.3/libjava/org/xml/sax/helpers/XMLFilterImpl.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/XMLFilterImpl.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/XMLFilterImpl.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,769 **** ! // XMLFilterImpl.java - base SAX2 filter implementation. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLFilterImpl.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import java.io.IOException; ! ! import org.xml.sax.XMLReader; ! import org.xml.sax.XMLFilter; ! import org.xml.sax.InputSource; ! import org.xml.sax.Locator; ! import org.xml.sax.Attributes; ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! import org.xml.sax.SAXParseException; ! import org.xml.sax.SAXNotSupportedException; ! import org.xml.sax.SAXNotRecognizedException; ! ! ! /** ! * Base class for deriving an XML filter. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class is designed to sit between an {@link org.xml.sax.XMLReader ! * XMLReader} and the client application's event handlers. By default, it ! * does nothing but pass requests up to the reader and events ! * on to the handlers unmodified, but subclasses can override ! * specific methods to modify the event stream or the configuration ! * requests as they pass through.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.XMLFilter ! * @see org.xml.sax.XMLReader ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.ContentHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public class XMLFilterImpl ! implements XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructors. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Construct an empty XML filter, with no parent. ! * ! *

          This filter will have no parent: you must assign a parent ! * before you start a parse or do any configuration with ! * setFeature or setProperty.

          ! * ! * @see org.xml.sax.XMLReader#setFeature ! * @see org.xml.sax.XMLReader#setProperty ! */ ! public XMLFilterImpl () ! { ! super(); ! } ! ! ! /** ! * Construct an XML filter with the specified parent. ! * ! * @see #setParent ! * @see #getParent ! */ ! public XMLFilterImpl (XMLReader parent) ! { ! super(); ! setParent(parent); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.XMLFilter. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the parent reader. ! * ! *

          This is the {@link org.xml.sax.XMLReader XMLReader} from which ! * this filter will obtain its events and to which it will pass its ! * configuration requests. The parent may itself be another filter.

          ! * ! *

          If there is no parent reader set, any attempt to parse ! * or to set or get a feature or property will fail.

          ! * ! * @param parent The parent XML reader. ! * @exception java.lang.NullPointerException If the parent is null. ! * @see #getParent ! */ ! public void setParent (XMLReader parent) ! { ! if (parent == null) { ! throw new NullPointerException("Null parent"); ! } ! this.parent = parent; ! } ! ! ! /** ! * Get the parent reader. ! * ! * @return The parent XML reader, or null if none is set. ! * @see #setParent ! */ ! public XMLReader getParent () ! { ! return parent; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.XMLReader. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the state of a feature. ! * ! *

          This will always fail if the parent is null.

          ! * ! * @param name The feature name. ! * @param state The requested feature state. ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the feature name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the feature name but ! * cannot set the requested value. ! * @see org.xml.sax.XMLReader#setFeature ! */ ! public void setFeature (String name, boolean state) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! parent.setFeature(name, state); ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Look up the state of a feature. ! * ! *

          This will always fail if the parent is null.

          ! * ! * @param name The feature name. ! * @return The current state of the feature. ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the feature name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the feature name but ! * cannot determine its state at this time. ! * @see org.xml.sax.XMLReader#getFeature ! */ ! public boolean getFeature (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! return parent.getFeature(name); ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Set the value of a property. ! * ! *

          This will always fail if the parent is null.

          ! * ! * @param name The property name. ! * @param state The requested property value. ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the property name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the property name but ! * cannot set the requested value. ! * @see org.xml.sax.XMLReader#setProperty ! */ ! public void setProperty (String name, Object value) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! parent.setProperty(name, value); ! } else { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! } ! ! ! /** ! * Look up the value of a property. ! * ! * @param name The property name. ! * @return The current value of the property. ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the feature name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the property name but ! * cannot determine its value at this time. ! * @see org.xml.sax.XMLReader#setFeature ! */ ! public Object getProperty (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! return parent.getProperty(name); ! } else { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! } ! ! ! /** ! * Set the entity resolver. ! * ! * @param resolver The new entity resolver. ! * @exception java.lang.NullPointerException If the resolver ! * is null. ! * @see org.xml.sax.XMLReader#setEntityResolver ! */ ! public void setEntityResolver (EntityResolver resolver) ! { ! if (resolver == null) { ! throw new NullPointerException("Null entity resolver"); ! } else { ! entityResolver = resolver; ! } ! } ! ! ! /** ! * Get the current entity resolver. ! * ! * @return The current entity resolver, or null if none was set. ! * @see org.xml.sax.XMLReader#getEntityResolver ! */ ! public EntityResolver getEntityResolver () ! { ! return entityResolver; ! } ! ! ! /** ! * Set the DTD event handler. ! * ! * @param resolver The new DTD handler. ! * @exception java.lang.NullPointerException If the handler ! * is null. ! * @see org.xml.sax.XMLReader#setDTDHandler ! */ ! public void setDTDHandler (DTDHandler handler) ! { ! if (handler == null) { ! throw new NullPointerException("Null DTD handler"); ! } else { ! dtdHandler = handler; ! } ! } ! ! ! /** ! * Get the current DTD event handler. ! * ! * @return The current DTD handler, or null if none was set. ! * @see org.xml.sax.XMLReader#getDTDHandler ! */ ! public DTDHandler getDTDHandler () ! { ! return dtdHandler; ! } ! ! ! /** ! * Set the content event handler. ! * ! * @param resolver The new content handler. ! * @exception java.lang.NullPointerException If the handler ! * is null. ! * @see org.xml.sax.XMLReader#setContentHandler ! */ ! public void setContentHandler (ContentHandler handler) ! { ! if (handler == null) { ! throw new NullPointerException("Null content handler"); ! } else { ! contentHandler = handler; ! } ! } ! ! ! /** ! * Get the content event handler. ! * ! * @return The current content handler, or null if none was set. ! * @see org.xml.sax.XMLReader#getContentHandler ! */ ! public ContentHandler getContentHandler () ! { ! return contentHandler; ! } ! ! ! /** ! * Set the error event handler. ! * ! * @param handle The new error handler. ! * @exception java.lang.NullPointerException If the handler ! * is null. ! * @see org.xml.sax.XMLReader#setErrorHandler ! */ ! public void setErrorHandler (ErrorHandler handler) ! { ! if (handler == null) { ! throw new NullPointerException("Null error handler"); ! } else { ! errorHandler = handler; ! } ! } ! ! ! /** ! * Get the current error event handler. ! * ! * @return The current error handler, or null if none was set. ! * @see org.xml.sax.XMLReader#getErrorHandler ! */ ! public ErrorHandler getErrorHandler () ! { ! return errorHandler; ! } ! ! ! /** ! * Parse a document. ! * ! * @param input The input source for the document entity. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see org.xml.sax.XMLReader#parse(org.xml.sax.InputSource) ! */ ! public void parse (InputSource input) ! throws SAXException, IOException ! { ! setupParse(); ! parent.parse(input); ! } ! ! ! /** ! * Parse a document. ! * ! * @param systemId The system identifier as a fully-qualified URI. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see org.xml.sax.XMLReader#parse(java.lang.String) ! */ ! public void parse (String systemId) ! throws SAXException, IOException ! { ! parse(new InputSource(systemId)); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.EntityResolver. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter an external entity resolution. ! * ! * @param publicId The entity's public identifier, or null. ! * @param systemId The entity's system identifier. ! * @return A new InputSource or null for the default. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @exception java.io.IOException The client may throw an ! * I/O-related exception while obtaining the ! * new InputSource. ! * @see org.xml.sax.EntityResolver#resolveEntity ! */ ! public InputSource resolveEntity (String publicId, String systemId) ! throws SAXException, IOException ! { ! if (entityResolver != null) { ! return entityResolver.resolveEntity(publicId, systemId); ! } else { ! return null; ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.DTDHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter a notation declaration event. ! * ! * @param name The notation name. ! * @param publicId The notation's public identifier, or null. ! * @param systemId The notation's system identifier, or null. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.DTDHandler#notationDecl ! */ ! public void notationDecl (String name, String publicId, String systemId) ! throws SAXException ! { ! if (dtdHandler != null) { ! dtdHandler.notationDecl(name, publicId, systemId); ! } ! } ! ! ! /** ! * Filter an unparsed entity declaration event. ! * ! * @param name The entity name. ! * @param publicId The entity's public identifier, or null. ! * @param systemId The entity's system identifier, or null. ! * @param notationName The name of the associated notation. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.DTDHandler#unparsedEntityDecl ! */ ! public void unparsedEntityDecl (String name, String publicId, ! String systemId, String notationName) ! throws SAXException ! { ! if (dtdHandler != null) { ! dtdHandler.unparsedEntityDecl(name, publicId, systemId, ! notationName); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.ContentHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter a new document locator event. ! * ! * @param locator The document locator. ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! */ ! public void setDocumentLocator (Locator locator) ! { ! this.locator = locator; ! if (contentHandler != null) { ! contentHandler.setDocumentLocator(locator); ! } ! } ! ! ! /** ! * Filter a start document event. ! * ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startDocument(); ! } ! } ! ! ! /** ! * Filter an end document event. ! * ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endDocument(); ! } ! } ! ! ! /** ! * Filter a start Namespace prefix mapping event. ! * ! * @param prefix The Namespace prefix. ! * @param uri The Namespace URI. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#startPrefixMapping ! */ ! public void startPrefixMapping (String prefix, String uri) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startPrefixMapping(prefix, uri); ! } ! } ! ! ! /** ! * Filter an end Namespace prefix mapping event. ! * ! * @param prefix The Namespace prefix. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#endPrefixMapping ! */ ! public void endPrefixMapping (String prefix) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endPrefixMapping(prefix); ! } ! } ! ! ! /** ! * Filter a start element event. ! * ! * @param uri The element's Namespace URI, or the empty string. ! * @param localName The element's local name, or the empty string. ! * @param qName The element's qualified (prefixed) name, or the empty ! * string. ! * @param atts The element's attributes. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#startElement ! */ ! public void startElement (String uri, String localName, String qName, ! Attributes atts) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startElement(uri, localName, qName, atts); ! } ! } ! ! ! /** ! * Filter an end element event. ! * ! * @param uri The element's Namespace URI, or the empty string. ! * @param localName The element's local name, or the empty string. ! * @param qName The element's qualified (prefixed) name, or the empty ! * string. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#endElement ! */ ! public void endElement (String uri, String localName, String qName) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endElement(uri, localName, qName); ! } ! } ! ! ! /** ! * Filter a character data event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use from the array. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.characters(ch, start, length); ! } ! } ! ! ! /** ! * Filter an ignorable whitespace event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use from the array. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.ignorableWhitespace(ch, start, length); ! } ! } ! ! ! /** ! * Filter a processing instruction event. ! * ! * @param target The processing instruction target. ! * @param data The text following the target. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.processingInstruction(target, data); ! } ! } ! ! ! /** ! * Filter a skipped entity event. ! * ! * @param name The name of the skipped entity. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ContentHandler#skippedEntity ! */ ! public void skippedEntity (String name) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.skippedEntity(name); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.ErrorHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter a warning event. ! * ! * @param e The nwarning as an exception. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ErrorHandler#warning ! */ ! public void warning (SAXParseException e) ! throws SAXException ! { ! if (errorHandler != null) { ! errorHandler.warning(e); ! } ! } ! ! ! /** ! * Filter an error event. ! * ! * @param e The error as an exception. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ErrorHandler#error ! */ ! public void error (SAXParseException e) ! throws SAXException ! { ! if (errorHandler != null) { ! errorHandler.error(e); ! } ! } ! ! ! /** ! * Filter a fatal error event. ! * ! * @param e The error as an exception. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @see org.xml.sax.ErrorHandler#fatalError ! */ ! public void fatalError (SAXParseException e) ! throws SAXException ! { ! if (errorHandler != null) { ! errorHandler.fatalError(e); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set up before a parse. ! * ! *

          Before every parse, check whether the parent is ! * non-null, and re-register the filter for all of the ! * events.

          ! */ ! private void setupParse () ! { ! if (parent == null) { ! throw new NullPointerException("No parent for filter"); ! } ! parent.setEntityResolver(this); ! parent.setDTDHandler(this); ! parent.setContentHandler(this); ! parent.setErrorHandler(this); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private XMLReader parent = null; ! private Locator locator = null; ! private EntityResolver entityResolver = null; ! private DTDHandler dtdHandler = null; ! private ContentHandler contentHandler = null; ! private ErrorHandler errorHandler = null; ! ! } ! ! // end of XMLFilterImpl.java --- 1,714 ---- ! // XMLFilterImpl.java - base SAX2 filter implementation. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLFilterImpl.java,v 1.3.2.7 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import java.io.IOException; ! ! import org.xml.sax.XMLReader; ! import org.xml.sax.XMLFilter; ! import org.xml.sax.InputSource; ! import org.xml.sax.Locator; ! import org.xml.sax.Attributes; ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! import org.xml.sax.SAXParseException; ! import org.xml.sax.SAXNotSupportedException; ! import org.xml.sax.SAXNotRecognizedException; ! ! ! /** ! * Base class for deriving an XML filter. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class is designed to sit between an {@link org.xml.sax.XMLReader ! * XMLReader} and the client application's event handlers. By default, it ! * does nothing but pass requests up to the reader and events ! * on to the handlers unmodified, but subclasses can override ! * specific methods to modify the event stream or the configuration ! * requests as they pass through.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.XMLFilter ! * @see org.xml.sax.XMLReader ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.ContentHandler ! * @see org.xml.sax.ErrorHandler ! */ ! public class XMLFilterImpl ! implements XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructors. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Construct an empty XML filter, with no parent. ! * ! *

          This filter will have no parent: you must assign a parent ! * before you start a parse or do any configuration with ! * setFeature or setProperty, unless you use this as a pure event ! * consumer rather than as an {@link XMLReader}.

          ! * ! * @see org.xml.sax.XMLReader#setFeature ! * @see org.xml.sax.XMLReader#setProperty ! * @see #setParent ! */ ! public XMLFilterImpl () ! { ! super(); ! } ! ! ! /** ! * Construct an XML filter with the specified parent. ! * ! * @see #setParent ! * @see #getParent ! */ ! public XMLFilterImpl (XMLReader parent) ! { ! super(); ! setParent(parent); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.XMLFilter. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the parent reader. ! * ! *

          This is the {@link org.xml.sax.XMLReader XMLReader} from which ! * this filter will obtain its events and to which it will pass its ! * configuration requests. The parent may itself be another filter.

          ! * ! *

          If there is no parent reader set, any attempt to parse ! * or to set or get a feature or property will fail.

          ! * ! * @param parent The parent XML reader. ! * @see #getParent ! */ ! public void setParent (XMLReader parent) ! { ! this.parent = parent; ! } ! ! ! /** ! * Get the parent reader. ! * ! * @return The parent XML reader, or null if none is set. ! * @see #setParent ! */ ! public XMLReader getParent () ! { ! return parent; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.XMLReader. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the value of a feature. ! * ! *

          This will always fail if the parent is null.

          ! * ! * @param name The feature name. ! * @param value The requested feature value. ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * value can't be assigned or retrieved from the parent. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * parent recognizes the feature name but ! * cannot set the requested value. ! */ ! public void setFeature (String name, boolean value) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! parent.setFeature(name, value); ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Look up the value of a feature. ! * ! *

          This will always fail if the parent is null.

          ! * ! * @param name The feature name. ! * @return The current value of the feature. ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * value can't be assigned or retrieved from the parent. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * parent recognizes the feature name but ! * cannot determine its value at this time. ! */ ! public boolean getFeature (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! return parent.getFeature(name); ! } else { ! throw new SAXNotRecognizedException("Feature: " + name); ! } ! } ! ! ! /** ! * Set the value of a property. ! * ! *

          This will always fail if the parent is null.

          ! * ! * @param name The property name. ! * @param value The requested property value. ! * @exception org.xml.sax.SAXNotRecognizedException If the property ! * value can't be assigned or retrieved from the parent. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * parent recognizes the property name but ! * cannot set the requested value. ! */ ! public void setProperty (String name, Object value) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! parent.setProperty(name, value); ! } else { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! } ! ! ! /** ! * Look up the value of a property. ! * ! * @param name The property name. ! * @return The current value of the property. ! * @exception org.xml.sax.SAXNotRecognizedException If the property ! * value can't be assigned or retrieved from the parent. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * parent recognizes the property name but ! * cannot determine its value at this time. ! */ ! public Object getProperty (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException ! { ! if (parent != null) { ! return parent.getProperty(name); ! } else { ! throw new SAXNotRecognizedException("Property: " + name); ! } ! } ! ! ! /** ! * Set the entity resolver. ! * ! * @param resolver The new entity resolver. ! */ ! public void setEntityResolver (EntityResolver resolver) ! { ! entityResolver = resolver; ! } ! ! ! /** ! * Get the current entity resolver. ! * ! * @return The current entity resolver, or null if none was set. ! */ ! public EntityResolver getEntityResolver () ! { ! return entityResolver; ! } ! ! ! /** ! * Set the DTD event handler. ! * ! * @param resolver The new DTD handler. ! */ ! public void setDTDHandler (DTDHandler handler) ! { ! dtdHandler = handler; ! } ! ! ! /** ! * Get the current DTD event handler. ! * ! * @return The current DTD handler, or null if none was set. ! */ ! public DTDHandler getDTDHandler () ! { ! return dtdHandler; ! } ! ! ! /** ! * Set the content event handler. ! * ! * @param resolver The new content handler. ! */ ! public void setContentHandler (ContentHandler handler) ! { ! contentHandler = handler; ! } ! ! ! /** ! * Get the content event handler. ! * ! * @return The current content handler, or null if none was set. ! */ ! public ContentHandler getContentHandler () ! { ! return contentHandler; ! } ! ! ! /** ! * Set the error event handler. ! * ! * @param handle The new error handler. ! */ ! public void setErrorHandler (ErrorHandler handler) ! { ! errorHandler = handler; ! } ! ! ! /** ! * Get the current error event handler. ! * ! * @return The current error handler, or null if none was set. ! */ ! public ErrorHandler getErrorHandler () ! { ! return errorHandler; ! } ! ! ! /** ! * Parse a document. ! * ! * @param input The input source for the document entity. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! */ ! public void parse (InputSource input) ! throws SAXException, IOException ! { ! setupParse(); ! parent.parse(input); ! } ! ! ! /** ! * Parse a document. ! * ! * @param systemId The system identifier as a fully-qualified URI. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! */ ! public void parse (String systemId) ! throws SAXException, IOException ! { ! parse(new InputSource(systemId)); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.EntityResolver. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter an external entity resolution. ! * ! * @param publicId The entity's public identifier, or null. ! * @param systemId The entity's system identifier. ! * @return A new InputSource or null for the default. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! * @exception java.io.IOException The client may throw an ! * I/O-related exception while obtaining the ! * new InputSource. ! */ ! public InputSource resolveEntity (String publicId, String systemId) ! throws SAXException, IOException ! { ! if (entityResolver != null) { ! return entityResolver.resolveEntity(publicId, systemId); ! } else { ! return null; ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.DTDHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter a notation declaration event. ! * ! * @param name The notation name. ! * @param publicId The notation's public identifier, or null. ! * @param systemId The notation's system identifier, or null. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void notationDecl (String name, String publicId, String systemId) ! throws SAXException ! { ! if (dtdHandler != null) { ! dtdHandler.notationDecl(name, publicId, systemId); ! } ! } ! ! ! /** ! * Filter an unparsed entity declaration event. ! * ! * @param name The entity name. ! * @param publicId The entity's public identifier, or null. ! * @param systemId The entity's system identifier, or null. ! * @param notationName The name of the associated notation. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void unparsedEntityDecl (String name, String publicId, ! String systemId, String notationName) ! throws SAXException ! { ! if (dtdHandler != null) { ! dtdHandler.unparsedEntityDecl(name, publicId, systemId, ! notationName); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.ContentHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter a new document locator event. ! * ! * @param locator The document locator. ! */ ! public void setDocumentLocator (Locator locator) ! { ! this.locator = locator; ! if (contentHandler != null) { ! contentHandler.setDocumentLocator(locator); ! } ! } ! ! ! /** ! * Filter a start document event. ! * ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void startDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startDocument(); ! } ! } ! ! ! /** ! * Filter an end document event. ! * ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void endDocument () ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endDocument(); ! } ! } ! ! ! /** ! * Filter a start Namespace prefix mapping event. ! * ! * @param prefix The Namespace prefix. ! * @param uri The Namespace URI. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void startPrefixMapping (String prefix, String uri) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startPrefixMapping(prefix, uri); ! } ! } ! ! ! /** ! * Filter an end Namespace prefix mapping event. ! * ! * @param prefix The Namespace prefix. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void endPrefixMapping (String prefix) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endPrefixMapping(prefix); ! } ! } ! ! ! /** ! * Filter a start element event. ! * ! * @param uri The element's Namespace URI, or the empty string. ! * @param localName The element's local name, or the empty string. ! * @param qName The element's qualified (prefixed) name, or the empty ! * string. ! * @param atts The element's attributes. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void startElement (String uri, String localName, String qName, ! Attributes atts) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.startElement(uri, localName, qName, atts); ! } ! } ! ! ! /** ! * Filter an end element event. ! * ! * @param uri The element's Namespace URI, or the empty string. ! * @param localName The element's local name, or the empty string. ! * @param qName The element's qualified (prefixed) name, or the empty ! * string. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void endElement (String uri, String localName, String qName) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.endElement(uri, localName, qName); ! } ! } ! ! ! /** ! * Filter a character data event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use from the array. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.characters(ch, start, length); ! } ! } ! ! ! /** ! * Filter an ignorable whitespace event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use from the array. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.ignorableWhitespace(ch, start, length); ! } ! } ! ! ! /** ! * Filter a processing instruction event. ! * ! * @param target The processing instruction target. ! * @param data The text following the target. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.processingInstruction(target, data); ! } ! } ! ! ! /** ! * Filter a skipped entity event. ! * ! * @param name The name of the skipped entity. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void skippedEntity (String name) ! throws SAXException ! { ! if (contentHandler != null) { ! contentHandler.skippedEntity(name); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.ErrorHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Filter a warning event. ! * ! * @param e The warning as an exception. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void warning (SAXParseException e) ! throws SAXException ! { ! if (errorHandler != null) { ! errorHandler.warning(e); ! } ! } ! ! ! /** ! * Filter an error event. ! * ! * @param e The error as an exception. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void error (SAXParseException e) ! throws SAXException ! { ! if (errorHandler != null) { ! errorHandler.error(e); ! } ! } ! ! ! /** ! * Filter a fatal error event. ! * ! * @param e The error as an exception. ! * @exception org.xml.sax.SAXException The client may throw ! * an exception during processing. ! */ ! public void fatalError (SAXParseException e) ! throws SAXException ! { ! if (errorHandler != null) { ! errorHandler.fatalError(e); ! } ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal methods. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set up before a parse. ! * ! *

          Before every parse, check whether the parent is ! * non-null, and re-register the filter for all of the ! * events.

          ! */ ! private void setupParse () ! { ! if (parent == null) { ! throw new NullPointerException("No parent for filter"); ! } ! parent.setEntityResolver(this); ! parent.setDTDHandler(this); ! parent.setContentHandler(this); ! parent.setErrorHandler(this); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private XMLReader parent = null; ! private Locator locator = null; ! private EntityResolver entityResolver = null; ! private DTDHandler dtdHandler = null; ! private ContentHandler contentHandler = null; ! private ErrorHandler errorHandler = null; ! ! } ! ! // end of XMLFilterImpl.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/XMLReaderAdapter.java gcc-3.3/libjava/org/xml/sax/helpers/XMLReaderAdapter.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/XMLReaderAdapter.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/XMLReaderAdapter.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,526 **** ! // XMLReaderAdapter.java - adapt an SAX2 XMLReader to a SAX1 Parser ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: XMLReaderAdapter.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! ! import java.io.IOException; ! import java.util.Locale; ! ! import org.xml.sax.Parser; // deprecated ! import org.xml.sax.Locator; ! import org.xml.sax.InputSource; ! import org.xml.sax.AttributeList; // deprecated ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.DocumentHandler; // deprecated ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! ! import org.xml.sax.XMLReader; ! import org.xml.sax.Attributes; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.SAXNotSupportedException; ! ! ! /** ! * Adapt a SAX2 XMLReader as a SAX1 Parser. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class wraps a SAX2 {@link org.xml.sax.XMLReader XMLReader} ! * and makes it act as a SAX1 {@link org.xml.sax.Parser Parser}. The XMLReader ! * must support a true value for the ! * http://xml.org/sax/features/namespace-prefixes property or parsing will fail ! * with a {@link org.xml.sax.SAXException SAXException}; if the XMLReader ! * supports a false value for the http://xml.org/sax/features/namespaces ! * property, that will also be used to improve efficiency.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Parser ! * @see org.xml.sax.XMLReader ! */ ! public class XMLReaderAdapter implements Parser, ContentHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructor. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Create a new adapter. ! * ! *

          Use the "org.xml.sax.driver" property to locate the SAX2 ! * driver to embed.

          ! * ! * @exception org.xml.sax.SAXException If the embedded driver ! * cannot be instantiated or if the ! * org.xml.sax.driver property is not specified. ! */ ! public XMLReaderAdapter () ! throws SAXException ! { ! setup(XMLReaderFactory.createXMLReader()); ! } ! ! ! /** ! * Create a new adapter. ! * ! *

          Create a new adapter, wrapped around a SAX2 XMLReader. ! * The adapter will make the XMLReader act like a SAX1 ! * Parser.

          ! * ! * @param xmlReader The SAX2 XMLReader to wrap. ! * @exception java.lang.NullPointerException If the argument is null. ! */ ! public XMLReaderAdapter (XMLReader xmlReader) ! { ! setup(xmlReader); ! } ! ! ! ! /** ! * Internal setup. ! * ! * @param xmlReader The embedded XMLReader. ! */ ! private void setup (XMLReader xmlReader) ! { ! if (xmlReader == null) { ! throw new NullPointerException("XMLReader must not be null"); ! } ! this.xmlReader = xmlReader; ! qAtts = new AttributesAdapter(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.Parser. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the locale for error reporting. ! * ! *

          This is not supported in SAX2, and will always throw ! * an exception.

          ! * ! * @param The locale for error reporting. ! * @see org.xml.sax.Parser#setLocale ! */ ! public void setLocale (Locale locale) ! throws SAXException ! { ! throw new SAXNotSupportedException("setLocale not supported"); ! } ! ! ! /** ! * Register the entity resolver. ! * ! * @param resolver The new resolver. ! * @see org.xml.sax.Parser#setEntityResolver ! */ ! public void setEntityResolver (EntityResolver resolver) ! { ! xmlReader.setEntityResolver(resolver); ! } ! ! ! /** ! * Register the DTD event handler. ! * ! * @param handler The new DTD event handler. ! * @see org.xml.sax.Parser#setDTDHandler ! */ ! public void setDTDHandler (DTDHandler handler) ! { ! xmlReader.setDTDHandler(handler); ! } ! ! ! /** ! * Register the SAX1 document event handler. ! * ! *

          Note that the SAX1 document handler has no Namespace ! * support.

          ! * ! * @param handler The new SAX1 document event handler. ! * @see org.xml.sax.Parser#setDocumentHandler ! */ ! public void setDocumentHandler (DocumentHandler handler) ! { ! documentHandler = handler; ! } ! ! ! /** ! * Register the error event handler. ! * ! * @param handler The new error event handler. ! * @see org.xml.sax.Parser#setErrorHandler ! */ ! public void setErrorHandler (ErrorHandler handler) ! { ! xmlReader.setErrorHandler(handler); ! } ! ! ! /** ! * Parse the document. ! * ! *

          This method will throw an exception if the embedded ! * XMLReader does not support the ! * http://xml.org/sax/features/namespace-prefixes property.

          ! * ! * @param systemId The absolute URL of the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception org.xml.sax.SAXException If there is a problem ! * processing the document. ! * @see #parse(org.xml.sax.InputSource) ! * @see org.xml.sax.Parser#parse(java.lang.String) ! */ ! public void parse (String systemId) ! throws IOException, SAXException ! { ! parse(new InputSource(systemId)); ! } ! ! ! /** ! * Parse the document. ! * ! *

          This method will throw an exception if the embedded ! * XMLReader does not support the ! * http://xml.org/sax/features/namespace-prefixes property.

          ! * ! * @param input An input source for the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception org.xml.sax.SAXException If there is a problem ! * processing the document. ! * @see #parse(java.lang.String) ! * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource) ! */ ! public void parse (InputSource input) ! throws IOException, SAXException ! { ! setupXMLReader(); ! xmlReader.parse(input); ! } ! ! ! /** ! * Set up the XML reader. ! */ ! private void setupXMLReader () ! throws SAXException ! { ! xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); ! try { ! xmlReader.setFeature("http://xml.org/sax/features/namespaces", ! false); ! } catch (SAXException e) { ! // NO OP: it's just extra information, and we can ignore it ! } ! xmlReader.setContentHandler(this); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.ContentHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set a document locator. ! * ! * @param locator The document locator. ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! */ ! public void setDocumentLocator (Locator locator) ! { ! documentHandler.setDocumentLocator(locator); ! } ! ! ! /** ! * Start document event. ! * ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! documentHandler.startDocument(); ! } ! ! ! /** ! * End document event. ! * ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! documentHandler.endDocument(); ! } ! ! ! /** ! * Adapt a SAX2 start prefix mapping event. ! * ! * @param prefix The prefix being mapped. ! * @param uri The Namespace URI being mapped to. ! * @see org.xml.sax.ContentHandler#startPrefixMapping ! */ ! public void startPrefixMapping (String prefix, String uri) ! { ! } ! ! ! /** ! * Adapt a SAX2 end prefix mapping event. ! * ! * @param prefix The prefix being mapped. ! * @see org.xml.sax.ContentHandler#endPrefixMapping ! */ ! public void endPrefixMapping (String prefix) ! { ! } ! ! ! /** ! * Adapt a SAX2 start element event. ! * ! * @param uri The Namespace URI. ! * @param localName The Namespace local name. ! * @param qName The qualified (prefixed) name. ! * @param atts The SAX2 attributes. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#endDocument ! */ ! public void startElement (String uri, String localName, ! String qName, Attributes atts) ! throws SAXException ! { ! qAtts.setAttributes(atts); ! documentHandler.startElement(qName, qAtts); ! } ! ! ! /** ! * Adapt a SAX2 end element event. ! * ! * @param uri The Namespace URI. ! * @param localName The Namespace local name. ! * @param qName The qualified (prefixed) name. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#endElement ! */ ! public void endElement (String uri, String localName, ! String qName) ! throws SAXException ! { ! documentHandler.endElement(qName); ! } ! ! ! /** ! * Adapt a SAX2 characters event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! documentHandler.characters(ch, start, length); ! } ! ! ! /** ! * Adapt a SAX2 ignorable whitespace event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! documentHandler.ignorableWhitespace(ch, start, length); ! } ! ! ! /** ! * Adapt a SAX2 processing instruction event. ! * ! * @param target The processing instruction target. ! * @param data The remainder of the processing instruction ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! documentHandler.processingInstruction(target, data); ! } ! ! ! /** ! * Adapt a SAX2 skipped entity event. ! * ! * @param name The name of the skipped entity. ! * @see org.xml.sax.ContentHandler#skippedEntity ! */ ! public void skippedEntity (String name) ! throws SAXException ! { ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! XMLReader xmlReader; ! DocumentHandler documentHandler; ! AttributesAdapter qAtts; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal class. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Internal class to wrap a SAX2 Attributes object for SAX1. ! */ ! final class AttributesAdapter implements AttributeList ! { ! AttributesAdapter () ! { ! } ! ! ! /** ! * Set the embedded Attributes object. ! * ! * @param The embedded SAX2 Attributes. ! */ ! void setAttributes (Attributes attributes) ! { ! this.attributes = attributes; ! } ! ! ! /** ! * Return the number of attributes. ! * ! * @return The length of the attribute list. ! * @see org.xml.sax.AttributeList#getLength ! */ ! public int getLength () ! { ! return attributes.getLength(); ! } ! ! ! /** ! * Return the qualified (prefixed) name of an attribute by position. ! * ! * @return The qualified name. ! * @see org.xml.sax.AttributeList#getName ! */ ! public String getName (int i) ! { ! return attributes.getQName(i); ! } ! ! ! /** ! * Return the type of an attribute by position. ! * ! * @return The type. ! * @see org.xml.sax.AttributeList#getType(int) ! */ ! public String getType (int i) ! { ! return attributes.getType(i); ! } ! ! ! /** ! * Return the value of an attribute by position. ! * ! * @return The value. ! * @see org.xml.sax.AttributeList#getValue(int) ! */ ! public String getValue (int i) ! { ! return attributes.getValue(i); ! } ! ! ! /** ! * Return the type of an attribute by qualified (prefixed) name. ! * ! * @return The type. ! * @see org.xml.sax.AttributeList#getType(java.lang.String) ! */ ! public String getType (String qName) ! { ! return attributes.getType(qName); ! } ! ! ! /** ! * Return the value of an attribute by qualified (prefixed) name. ! * ! * @return The value. ! * @see org.xml.sax.AttributeList#getValue(java.lang.String) ! */ ! public String getValue (String qName) ! { ! return attributes.getValue(qName); ! } ! ! private Attributes attributes; ! } ! ! } ! ! // end of XMLReaderAdapter.java --- 1,539 ---- ! // XMLReaderAdapter.java - adapt an SAX2 XMLReader to a SAX1 Parser ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the public domain. ! ! // $Id: XMLReaderAdapter.java,v 1.5.2.3 2002/01/29 21:34:15 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! ! import java.io.IOException; ! import java.util.Locale; ! ! import org.xml.sax.Parser; // deprecated ! import org.xml.sax.Locator; ! import org.xml.sax.InputSource; ! import org.xml.sax.AttributeList; // deprecated ! import org.xml.sax.EntityResolver; ! import org.xml.sax.DTDHandler; ! import org.xml.sax.DocumentHandler; // deprecated ! import org.xml.sax.ErrorHandler; ! import org.xml.sax.SAXException; ! ! import org.xml.sax.XMLReader; ! import org.xml.sax.Attributes; ! import org.xml.sax.ContentHandler; ! import org.xml.sax.SAXNotSupportedException; ! ! ! /** ! * Adapt a SAX2 XMLReader as a SAX1 Parser. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class wraps a SAX2 {@link org.xml.sax.XMLReader XMLReader} ! * and makes it act as a SAX1 {@link org.xml.sax.Parser Parser}. The XMLReader ! * must support a true value for the ! * http://xml.org/sax/features/namespace-prefixes property or parsing will fail ! * with a {@link org.xml.sax.SAXException SAXException}; if the XMLReader ! * supports a false value for the http://xml.org/sax/features/namespaces ! * property, that will also be used to improve efficiency.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.Parser ! * @see org.xml.sax.XMLReader ! */ ! public class XMLReaderAdapter implements Parser, ContentHandler ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Constructor. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Create a new adapter. ! * ! *

          Use the "org.xml.sax.driver" property to locate the SAX2 ! * driver to embed.

          ! * ! * @exception org.xml.sax.SAXException If the embedded driver ! * cannot be instantiated or if the ! * org.xml.sax.driver property is not specified. ! */ ! public XMLReaderAdapter () ! throws SAXException ! { ! setup(XMLReaderFactory.createXMLReader()); ! } ! ! ! /** ! * Create a new adapter. ! * ! *

          Create a new adapter, wrapped around a SAX2 XMLReader. ! * The adapter will make the XMLReader act like a SAX1 ! * Parser.

          ! * ! * @param xmlReader The SAX2 XMLReader to wrap. ! * @exception java.lang.NullPointerException If the argument is null. ! */ ! public XMLReaderAdapter (XMLReader xmlReader) ! { ! setup(xmlReader); ! } ! ! ! ! /** ! * Internal setup. ! * ! * @param xmlReader The embedded XMLReader. ! */ ! private void setup (XMLReader xmlReader) ! { ! if (xmlReader == null) { ! throw new NullPointerException("XMLReader must not be null"); ! } ! this.xmlReader = xmlReader; ! qAtts = new AttributesAdapter(); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.Parser. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set the locale for error reporting. ! * ! *

          This is not supported in SAX2, and will always throw ! * an exception.

          ! * ! * @param The locale for error reporting. ! * @see org.xml.sax.Parser#setLocale ! * @exception org.xml.sax.SAXException Thrown unless overridden. ! */ ! public void setLocale (Locale locale) ! throws SAXException ! { ! throw new SAXNotSupportedException("setLocale not supported"); ! } ! ! ! /** ! * Register the entity resolver. ! * ! * @param resolver The new resolver. ! * @see org.xml.sax.Parser#setEntityResolver ! */ ! public void setEntityResolver (EntityResolver resolver) ! { ! xmlReader.setEntityResolver(resolver); ! } ! ! ! /** ! * Register the DTD event handler. ! * ! * @param handler The new DTD event handler. ! * @see org.xml.sax.Parser#setDTDHandler ! */ ! public void setDTDHandler (DTDHandler handler) ! { ! xmlReader.setDTDHandler(handler); ! } ! ! ! /** ! * Register the SAX1 document event handler. ! * ! *

          Note that the SAX1 document handler has no Namespace ! * support.

          ! * ! * @param handler The new SAX1 document event handler. ! * @see org.xml.sax.Parser#setDocumentHandler ! */ ! public void setDocumentHandler (DocumentHandler handler) ! { ! documentHandler = handler; ! } ! ! ! /** ! * Register the error event handler. ! * ! * @param handler The new error event handler. ! * @see org.xml.sax.Parser#setErrorHandler ! */ ! public void setErrorHandler (ErrorHandler handler) ! { ! xmlReader.setErrorHandler(handler); ! } ! ! ! /** ! * Parse the document. ! * ! *

          This method will throw an exception if the embedded ! * XMLReader does not support the ! * http://xml.org/sax/features/namespace-prefixes property.

          ! * ! * @param systemId The absolute URL of the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception org.xml.sax.SAXException If there is a problem ! * processing the document. ! * @see #parse(org.xml.sax.InputSource) ! * @see org.xml.sax.Parser#parse(java.lang.String) ! */ ! public void parse (String systemId) ! throws IOException, SAXException ! { ! parse(new InputSource(systemId)); ! } ! ! ! /** ! * Parse the document. ! * ! *

          This method will throw an exception if the embedded ! * XMLReader does not support the ! * http://xml.org/sax/features/namespace-prefixes property.

          ! * ! * @param input An input source for the document. ! * @exception java.io.IOException If there is a problem reading ! * the raw content of the document. ! * @exception org.xml.sax.SAXException If there is a problem ! * processing the document. ! * @see #parse(java.lang.String) ! * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource) ! */ ! public void parse (InputSource input) ! throws IOException, SAXException ! { ! setupXMLReader(); ! xmlReader.parse(input); ! } ! ! ! /** ! * Set up the XML reader. ! */ ! private void setupXMLReader () ! throws SAXException ! { ! xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); ! try { ! xmlReader.setFeature("http://xml.org/sax/features/namespaces", ! false); ! } catch (SAXException e) { ! // NO OP: it's just extra information, and we can ignore it ! } ! xmlReader.setContentHandler(this); ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Implementation of org.xml.sax.ContentHandler. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Set a document locator. ! * ! * @param locator The document locator. ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! */ ! public void setDocumentLocator (Locator locator) ! { ! if (documentHandler != null) ! documentHandler.setDocumentLocator(locator); ! } ! ! ! /** ! * Start document event. ! * ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#startDocument ! */ ! public void startDocument () ! throws SAXException ! { ! if (documentHandler != null) ! documentHandler.startDocument(); ! } ! ! ! /** ! * End document event. ! * ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#endDocument ! */ ! public void endDocument () ! throws SAXException ! { ! if (documentHandler != null) ! documentHandler.endDocument(); ! } ! ! ! /** ! * Adapt a SAX2 start prefix mapping event. ! * ! * @param prefix The prefix being mapped. ! * @param uri The Namespace URI being mapped to. ! * @see org.xml.sax.ContentHandler#startPrefixMapping ! */ ! public void startPrefixMapping (String prefix, String uri) ! { ! } ! ! ! /** ! * Adapt a SAX2 end prefix mapping event. ! * ! * @param prefix The prefix being mapped. ! * @see org.xml.sax.ContentHandler#endPrefixMapping ! */ ! public void endPrefixMapping (String prefix) ! { ! } ! ! ! /** ! * Adapt a SAX2 start element event. ! * ! * @param uri The Namespace URI. ! * @param localName The Namespace local name. ! * @param qName The qualified (prefixed) name. ! * @param atts The SAX2 attributes. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#endDocument ! */ ! public void startElement (String uri, String localName, ! String qName, Attributes atts) ! throws SAXException ! { ! if (documentHandler != null) { ! qAtts.setAttributes(atts); ! documentHandler.startElement(qName, qAtts); ! } ! } ! ! ! /** ! * Adapt a SAX2 end element event. ! * ! * @param uri The Namespace URI. ! * @param localName The Namespace local name. ! * @param qName The qualified (prefixed) name. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#endElement ! */ ! public void endElement (String uri, String localName, ! String qName) ! throws SAXException ! { ! if (documentHandler != null) ! documentHandler.endElement(qName); ! } ! ! ! /** ! * Adapt a SAX2 characters event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#characters ! */ ! public void characters (char ch[], int start, int length) ! throws SAXException ! { ! if (documentHandler != null) ! documentHandler.characters(ch, start, length); ! } ! ! ! /** ! * Adapt a SAX2 ignorable whitespace event. ! * ! * @param ch An array of characters. ! * @param start The starting position in the array. ! * @param length The number of characters to use. ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#ignorableWhitespace ! */ ! public void ignorableWhitespace (char ch[], int start, int length) ! throws SAXException ! { ! if (documentHandler != null) ! documentHandler.ignorableWhitespace(ch, start, length); ! } ! ! ! /** ! * Adapt a SAX2 processing instruction event. ! * ! * @param target The processing instruction target. ! * @param data The remainder of the processing instruction ! * @exception org.xml.sax.SAXException The client may raise a ! * processing exception. ! * @see org.xml.sax.ContentHandler#processingInstruction ! */ ! public void processingInstruction (String target, String data) ! throws SAXException ! { ! if (documentHandler != null) ! documentHandler.processingInstruction(target, data); ! } ! ! ! /** ! * Adapt a SAX2 skipped entity event. ! * ! * @param name The name of the skipped entity. ! * @see org.xml.sax.ContentHandler#skippedEntity ! * @exception org.xml.sax.SAXException Throwable by subclasses. ! */ ! public void skippedEntity (String name) ! throws SAXException ! { ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! XMLReader xmlReader; ! DocumentHandler documentHandler; ! AttributesAdapter qAtts; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal class. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Internal class to wrap a SAX2 Attributes object for SAX1. ! */ ! final class AttributesAdapter implements AttributeList ! { ! AttributesAdapter () ! { ! } ! ! ! /** ! * Set the embedded Attributes object. ! * ! * @param The embedded SAX2 Attributes. ! */ ! void setAttributes (Attributes attributes) ! { ! this.attributes = attributes; ! } ! ! ! /** ! * Return the number of attributes. ! * ! * @return The length of the attribute list. ! * @see org.xml.sax.AttributeList#getLength ! */ ! public int getLength () ! { ! return attributes.getLength(); ! } ! ! ! /** ! * Return the qualified (prefixed) name of an attribute by position. ! * ! * @return The qualified name. ! * @see org.xml.sax.AttributeList#getName ! */ ! public String getName (int i) ! { ! return attributes.getQName(i); ! } ! ! ! /** ! * Return the type of an attribute by position. ! * ! * @return The type. ! * @see org.xml.sax.AttributeList#getType(int) ! */ ! public String getType (int i) ! { ! return attributes.getType(i); ! } ! ! ! /** ! * Return the value of an attribute by position. ! * ! * @return The value. ! * @see org.xml.sax.AttributeList#getValue(int) ! */ ! public String getValue (int i) ! { ! return attributes.getValue(i); ! } ! ! ! /** ! * Return the type of an attribute by qualified (prefixed) name. ! * ! * @return The type. ! * @see org.xml.sax.AttributeList#getType(java.lang.String) ! */ ! public String getType (String qName) ! { ! return attributes.getType(qName); ! } ! ! ! /** ! * Return the value of an attribute by qualified (prefixed) name. ! * ! * @return The value. ! * @see org.xml.sax.AttributeList#getValue(java.lang.String) ! */ ! public String getValue (String qName) ! { ! return attributes.getValue(qName); ! } ! ! private Attributes attributes; ! } ! ! } ! ! // end of XMLReaderAdapter.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/helpers/XMLReaderFactory.java gcc-3.3/libjava/org/xml/sax/helpers/XMLReaderFactory.java *** gcc-3.2.3/libjava/org/xml/sax/helpers/XMLReaderFactory.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/helpers/XMLReaderFactory.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,136 **** ! // XMLReaderFactory.java - factory for creating a new reader. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLReaderFactory.java,v 1.1 2000/10/02 02:43:20 sboag Exp $ ! ! package org.xml.sax.helpers; ! import org.xml.sax.Parser; ! import org.xml.sax.XMLReader; ! import org.xml.sax.SAXException; ! ! ! /** ! * Factory for creating an XML reader. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class contains static methods for creating an XML reader ! * from an explicit class name, or for creating an XML reader based ! * on the value of the org.xml.sax.driver system ! * property:

          ! * ! *
          !  * try {
          !  *   XMLReader myReader = XMLReaderFactory.createXMLReader();
          !  * } catch (SAXException e) {
          !  *   System.err.println(e.getMessage());
          !  * }
          !  * 
          ! * ! *

          Note that these methods will not be usable in environments where ! * system properties are not accessible or where the application or ! * applet is not permitted to load classes dynamically.

          ! * ! *

          Note to implementors: SAX implementations in specialized ! * environments may replace this class with a different one optimized for the ! * environment, as long as its method signatures remain the same.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.XMLReader ! */ ! final public class XMLReaderFactory ! { ! ! /** ! * Private constructor. ! * ! *

          This constructor prevents the class from being instantiated.

          ! */ ! private XMLReaderFactory () ! { ! } ! ! ! /** ! * Attempt to create an XML reader from a system property. ! * ! *

          This method uses the value of the system property ! * "org.xml.sax.driver" as the full name of a Java class ! * and tries to instantiate that class as a SAX2 ! * XMLReader.

          ! * ! *

          Note that many Java interpreters allow system properties ! * to be specified on the command line.

          ! * ! * @return A new XMLReader. ! * @exception org.xml.sax.SAXException If the value of the ! * "org.xml.sax.driver" system property is null, ! * or if the class cannot be loaded and instantiated. ! * @see #createXMLReader(java.lang.String) ! */ ! public static XMLReader createXMLReader () ! throws SAXException ! { ! String className = System.getProperty("org.xml.sax.driver"); ! if (className == null) { ! Parser parser; ! try { ! parser = ParserFactory.makeParser(); ! } catch (Exception e) { ! parser = null; ! } ! if (parser == null) { ! throw new ! SAXException("System property org.xml.sax.driver not specified"); ! } else { ! return new ParserAdapter(parser); ! } ! } else { ! return createXMLReader(className); ! } ! } ! ! ! /** ! * Attempt to create an XML reader from a class name. ! * ! *

          Given a class name, this method attempts to load ! * and instantiate the class as an XML reader.

          ! * ! * @return A new XML reader. ! * @exception org.xml.sax.SAXException If the class cannot be ! * loaded, instantiated, and cast to XMLReader. ! * @see #createXMLReader() ! */ ! public static XMLReader createXMLReader (String className) ! throws SAXException ! { ! try { ! return (XMLReader)(Class.forName(className).newInstance()); ! } catch (ClassNotFoundException e1) { ! throw new SAXException("SAX2 driver class " + className + ! " not found", e1); ! } catch (IllegalAccessException e2) { ! throw new SAXException("SAX2 driver class " + className + ! " found but cannot be loaded", e2); ! } catch (InstantiationException e3) { ! throw new SAXException("SAX2 driver class " + className + ! " loaded but cannot be instantiated (no empty public constructor?)", ! e3); ! } catch (ClassCastException e4) { ! throw new SAXException("SAX2 driver class " + className + ! " does not implement XMLReader", e4); ! } ! ! } ! ! } ! ! // end of XMLReaderFactory.java --- 1,203 ---- ! // XMLReaderFactory.java - factory for creating a new reader. ! // http://www.saxproject.org ! // Written by David Megginson ! // and by David Brownell ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLReaderFactory.java,v 1.5.2.4 2002/01/29 21:34:15 dbrownell Exp $ ! ! package org.xml.sax.helpers; ! import java.io.BufferedReader; ! import java.io.InputStream; ! import java.io.InputStreamReader; ! import org.xml.sax.XMLReader; ! import org.xml.sax.SAXException; ! ! ! /** ! * Factory for creating an XML reader. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class contains static methods for creating an XML reader ! * from an explicit class name, or based on runtime defaults:

          ! * ! *
          !  * try {
          !  *   XMLReader myReader = XMLReaderFactory.createXMLReader();
          !  * } catch (SAXException e) {
          !  *   System.err.println(e.getMessage());
          !  * }
          !  * 
          ! * ! *

          Note to Distributions bundled with parsers: ! * You should modify the implementation of the no-arguments ! * createXMLReader to handle cases where the external ! * configuration mechanisms aren't set up. That method should do its ! * best to return a parser when one is in the class path, even when ! * nothing bound its class name to org.xml.sax.driver so ! * those configuration mechanisms would see it.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, David Brownell ! * @version 2.0.1 (sax2r2) ! */ ! final public class XMLReaderFactory ! { ! /** ! * Private constructor. ! * ! *

          This constructor prevents the class from being instantiated.

          ! */ ! private XMLReaderFactory () ! { ! } ! ! private static final String property = "org.xml.sax.driver"; ! ! /** ! * Attempt to create an XMLReader from system defaults. ! * In environments which can support it, the name of the XMLReader ! * class is determined by trying each these options in order, and ! * using the first one which succeeds:

            ! * ! *
          • If the system property org.xml.sax.driver ! * has a value, that is used as an XMLReader class name.
          • ! * ! *
          • The JAR "Services API" is used to look for a class name ! * in the META-INF/services/org.xml.sax.driver file in ! * jarfiles available to the runtime.
          • ! * ! *
          • SAX parser distributions are strongly encouraged to provide ! * a default XMLReader class name that will take effect only when ! * previous options (on this list) are not successful.
          • ! * ! *
          • Finally, if {@link ParserFactory#makeParser()} can ! * return a system default SAX1 parser, that parser is wrapped in ! * a {@link ParserAdapter}. (This is a migration aid for SAX1 ! * environments, where the org.xml.sax.parser system ! * property will often be usable.)
          • ! * ! *
          ! * ! *

          In environments such as small embedded systems, which can not ! * support that flexibility, other mechanisms to determine the default ! * may be used.

          ! * ! *

          Note that many Java environments allow system properties to be ! * initialized on a command line. This means that in most cases ! * setting a good value for that property ensures that calls to this ! * method will succeed, except when security policies intervene. ! * This will also maximize application portability to older SAX ! * environments, with less robust implementations of this method. ! *

          ! * ! * @return A new XMLReader. ! * @exception org.xml.sax.SAXException If no default XMLReader class ! * can be identified and instantiated. ! * @see #createXMLReader(java.lang.String) ! */ ! public static XMLReader createXMLReader () ! throws SAXException ! { ! String className = null; ! ClassLoader loader = NewInstance.getClassLoader (); ! ! // 1. try the JVM-instance-wide system property ! try { className = System.getProperty (property); } ! catch (Exception e) { /* normally fails for applets */ } ! ! // 2. if that fails, try META-INF/services/ ! if (className == null) { ! try { ! String service = "META-INF/services/" + property; ! InputStream in; ! BufferedReader reader; ! ! if (loader == null) ! in = ClassLoader.getSystemResourceAsStream (service); ! else ! in = loader.getResourceAsStream (service); ! ! if (in != null) { ! reader = new BufferedReader ( ! new InputStreamReader (in, "UTF8")); ! className = reader.readLine (); ! in.close (); ! } ! } catch (Exception e) { ! } ! } ! ! // 3. Distro-specific fallback ! if (className == null) { ! // BEGIN DISTRIBUTION-SPECIFIC ! ! // EXAMPLE: ! // className = "com.example.sax.XmlReader"; ! // or a $JAVA_HOME/jre/lib/*properties setting... ! ! // END DISTRIBUTION-SPECIFIC ! } ! ! // do we know the XMLReader implementation class yet? ! if (className != null) ! return loadClass (loader, className); ! ! // 4. panic -- adapt any SAX1 parser ! try { ! return new ParserAdapter (ParserFactory.makeParser ()); ! } catch (Exception e) { ! throw new SAXException ("Can't create default XMLReader; " ! + "is system property org.xml.sax.driver set?"); ! } ! } ! ! ! /** ! * Attempt to create an XML reader from a class name. ! * ! *

          Given a class name, this method attempts to load ! * and instantiate the class as an XML reader.

          ! * ! *

          Note that this method will not be usable in environments where ! * the caller (perhaps an applet) is not permitted to load classes ! * dynamically.

          ! * ! * @return A new XML reader. ! * @exception org.xml.sax.SAXException If the class cannot be ! * loaded, instantiated, and cast to XMLReader. ! * @see #createXMLReader() ! */ ! public static XMLReader createXMLReader (String className) ! throws SAXException ! { ! return loadClass (NewInstance.getClassLoader (), className); ! } ! ! private static XMLReader loadClass (ClassLoader loader, String className) ! throws SAXException ! { ! try { ! return (XMLReader) NewInstance.newInstance (loader, className); ! } catch (ClassNotFoundException e1) { ! throw new SAXException("SAX2 driver class " + className + ! " not found", e1); ! } catch (IllegalAccessException e2) { ! throw new SAXException("SAX2 driver class " + className + ! " found but cannot be loaded", e2); ! } catch (InstantiationException e3) { ! throw new SAXException("SAX2 driver class " + className + ! " loaded but cannot be instantiated (no empty public constructor?)", ! e3); ! } catch (ClassCastException e4) { ! throw new SAXException("SAX2 driver class " + className + ! " does not implement XMLReader", e4); ! } ! } ! } diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/InputSource.java gcc-3.3/libjava/org/xml/sax/InputSource.java *** gcc-3.2.3/libjava/org/xml/sax/InputSource.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/InputSource.java 2002-12-20 03:50:16.000000000 +0000 *************** *** 1,321 **** ! // SAX input source. ! // No warranty; no copyright -- use this as you will. ! // $Id: InputSource.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! import java.io.Reader; ! import java.io.InputStream; ! ! /** ! * A single input source for an XML entity. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class allows a SAX application to encapsulate information ! * about an input source in a single object, which may include ! * a public identifier, a system identifier, a byte stream (possibly ! * with a specified encoding), and/or a character stream.

          ! * ! *

          There are two places that the application will deliver this ! * input source to the parser: as the argument to the Parser.parse ! * method, or as the return value of the EntityResolver.resolveEntity ! * method.

          ! * ! *

          The SAX parser will use the InputSource object to determine how ! * to read XML input. If there is a character stream available, the ! * parser will read that stream directly; if not, the parser will use ! * a byte stream, if available; if neither a character stream nor a ! * byte stream is available, the parser will attempt to open a URI ! * connection to the resource identified by the system ! * identifier.

          ! * ! *

          An InputSource object belongs to the application: the SAX parser ! * shall never modify it in any way (it may modify a copy if ! * necessary).

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.Parser#parse ! * @see org.xml.sax.EntityResolver#resolveEntity ! * @see java.io.InputStream ! * @see java.io.Reader ! */ ! public class InputSource { ! ! /** ! * Zero-argument default constructor. ! * ! * @see #setPublicId ! * @see #setSystemId ! * @see #setByteStream ! * @see #setCharacterStream ! * @see #setEncoding ! */ ! public InputSource () ! { ! } ! ! ! /** ! * Create a new input source with a system identifier. ! * ! *

          Applications may use setPublicId to include a ! * public identifier as well, or setEncoding to specify ! * the character encoding, if known.

          ! * ! *

          If the system identifier is a URL, it must be full resolved.

          ! * ! * @param systemId The system identifier (URI). ! * @see #setPublicId ! * @see #setSystemId ! * @see #setByteStream ! * @see #setEncoding ! * @see #setCharacterStream ! */ ! public InputSource (String systemId) ! { ! setSystemId(systemId); ! } ! ! ! /** ! * Create a new input source with a byte stream. ! * ! *

          Application writers may use setSystemId to provide a base ! * for resolving relative URIs, setPublicId to include a ! * public identifier, and/or setEncoding to specify the object's ! * character encoding.

          ! * ! * @param byteStream The raw byte stream containing the document. ! * @see #setPublicId ! * @see #setSystemId ! * @see #setEncoding ! * @see #setByteStream ! * @see #setCharacterStream ! */ ! public InputSource (InputStream byteStream) ! { ! setByteStream(byteStream); ! } ! ! ! /** ! * Create a new input source with a character stream. ! * ! *

          Application writers may use setSystemId() to provide a base ! * for resolving relative URIs, and setPublicId to include a ! * public identifier.

          ! * ! *

          The character stream shall not include a byte order mark.

          ! * ! * @see #setPublicId ! * @see #setSystemId ! * @see #setByteStream ! * @see #setCharacterStream ! */ ! public InputSource (Reader characterStream) ! { ! setCharacterStream(characterStream); ! } ! ! ! /** ! * Set the public identifier for this input source. ! * ! *

          The public identifier is always optional: if the application ! * writer includes one, it will be provided as part of the ! * location information.

          ! * ! * @param publicId The public identifier as a string. ! * @see #getPublicId ! * @see org.xml.sax.Locator#getPublicId ! * @see org.xml.sax.SAXParseException#getPublicId ! */ ! public void setPublicId (String publicId) ! { ! this.publicId = publicId; ! } ! ! ! /** ! * Get the public identifier for this input source. ! * ! * @return The public identifier, or null if none was supplied. ! * @see #setPublicId ! */ ! public String getPublicId () ! { ! return publicId; ! } ! ! ! /** ! * Set the system identifier for this input source. ! * ! *

          The system identifier is optional if there is a byte stream ! * or a character stream, but it is still useful to provide one, ! * since the application can use it to resolve relative URIs ! * and can include it in error messages and warnings (the parser ! * will attempt to open a connection to the URI only if ! * there is no byte stream or character stream specified).

          ! * ! *

          If the application knows the character encoding of the ! * object pointed to by the system identifier, it can register ! * the encoding using the setEncoding method.

          ! * ! *

          If the system ID is a URL, it must be fully resolved.

          ! * ! * @param systemId The system identifier as a string. ! * @see #setEncoding ! * @see #getSystemId ! * @see org.xml.sax.Locator#getSystemId ! * @see org.xml.sax.SAXParseException#getSystemId ! */ ! public void setSystemId (String systemId) ! { ! this.systemId = systemId; ! } ! ! ! /** ! * Get the system identifier for this input source. ! * ! *

          The getEncoding method will return the character encoding ! * of the object pointed to, or null if unknown.

          ! * ! *

          If the system ID is a URL, it will be fully resolved.

          ! * ! * @return The system identifier. ! * @see #setSystemId ! * @see #getEncoding ! */ ! public String getSystemId () ! { ! return systemId; ! } ! ! ! /** ! * Set the byte stream for this input source. ! * ! *

          The SAX parser will ignore this if there is also a character ! * stream specified, but it will use a byte stream in preference ! * to opening a URI connection itself.

          ! * ! *

          If the application knows the character encoding of the ! * byte stream, it should set it with the setEncoding method.

          ! * ! * @param byteStream A byte stream containing an XML document or ! * other entity. ! * @see #setEncoding ! * @see #getByteStream ! * @see #getEncoding ! * @see java.io.InputStream ! */ ! public void setByteStream (InputStream byteStream) ! { ! this.byteStream = byteStream; ! } ! ! ! /** ! * Get the byte stream for this input source. ! * ! *

          The getEncoding method will return the character ! * encoding for this byte stream, or null if unknown.

          ! * ! * @return The byte stream, or null if none was supplied. ! * @see #getEncoding ! * @see #setByteStream ! */ ! public InputStream getByteStream () ! { ! return byteStream; ! } ! ! ! /** ! * Set the character encoding, if known. ! * ! *

          The encoding must be a string acceptable for an ! * XML encoding declaration (see section 4.3.3 of the XML 1.0 ! * recommendation).

          ! * ! *

          This method has no effect when the application provides a ! * character stream.

          ! * ! * @param encoding A string describing the character encoding. ! * @see #setSystemId ! * @see #setByteStream ! * @see #getEncoding ! */ ! public void setEncoding (String encoding) ! { ! this.encoding = encoding; ! } ! ! ! /** ! * Get the character encoding for a byte stream or URI. ! * ! * @return The encoding, or null if none was supplied. ! * @see #setByteStream ! * @see #getSystemId ! * @see #getByteStream ! */ ! public String getEncoding () ! { ! return encoding; ! } ! ! ! /** ! * Set the character stream for this input source. ! * ! *

          If there is a character stream specified, the SAX parser ! * will ignore any byte stream and will not attempt to open ! * a URI connection to the system identifier.

          ! * ! * @param characterStream The character stream containing the ! * XML document or other entity. ! * @see #getCharacterStream ! * @see java.io.Reader ! */ ! public void setCharacterStream (Reader characterStream) ! { ! this.characterStream = characterStream; ! } ! ! ! /** ! * Get the character stream for this input source. ! * ! * @return The character stream, or null if none was supplied. ! * @see #setCharacterStream ! */ ! public Reader getCharacterStream () ! { ! return characterStream; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private String publicId; ! private String systemId; ! private InputStream byteStream; ! private String encoding; ! private Reader characterStream; ! ! } ! ! // end of InputSource.java --- 1,336 ---- ! // SAX input source. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: InputSource.java,v 1.5.2.4 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! import java.io.Reader; ! import java.io.InputStream; ! ! /** ! * A single input source for an XML entity. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class allows a SAX application to encapsulate information ! * about an input source in a single object, which may include ! * a public identifier, a system identifier, a byte stream (possibly ! * with a specified encoding), and/or a character stream.

          ! * ! *

          There are two places that the application can deliver an ! * input source to the parser: as the argument to the Parser.parse ! * method, or as the return value of the EntityResolver.resolveEntity ! * method.

          ! * ! *

          The SAX parser will use the InputSource object to determine how ! * to read XML input. If there is a character stream available, the ! * parser will read that stream directly, disregarding any text ! * encoding declaration found in that stream. ! * If there is no character stream, but there is ! * a byte stream, the parser will use that byte stream, using the ! * encoding specified in the InputSource or else (if no encoding is ! * specified) autodetecting the character encoding using an algorithm ! * such as the one in the XML specification. If neither a character ! * stream nor a ! * byte stream is available, the parser will attempt to open a URI ! * connection to the resource identified by the system ! * identifier.

          ! * ! *

          An InputSource object belongs to the application: the SAX parser ! * shall never modify it in any way (it may modify a copy if ! * necessary). However, standard processing of both byte and ! * character streams is to close them on as part of end-of-parse cleanup, ! * so applications should not attempt to re-use such streams after they ! * have been handed to a parser.

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.XMLReader#parse(org.xml.sax.InputSource) ! * @see org.xml.sax.EntityResolver#resolveEntity ! * @see java.io.InputStream ! * @see java.io.Reader ! */ ! public class InputSource { ! ! /** ! * Zero-argument default constructor. ! * ! * @see #setPublicId ! * @see #setSystemId ! * @see #setByteStream ! * @see #setCharacterStream ! * @see #setEncoding ! */ ! public InputSource () ! { ! } ! ! ! /** ! * Create a new input source with a system identifier. ! * ! *

          Applications may use setPublicId to include a ! * public identifier as well, or setEncoding to specify ! * the character encoding, if known.

          ! * ! *

          If the system identifier is a URL, it must be fully ! * resolved (it may not be a relative URL).

          ! * ! * @param systemId The system identifier (URI). ! * @see #setPublicId ! * @see #setSystemId ! * @see #setByteStream ! * @see #setEncoding ! * @see #setCharacterStream ! */ ! public InputSource (String systemId) ! { ! setSystemId(systemId); ! } ! ! ! /** ! * Create a new input source with a byte stream. ! * ! *

          Application writers should use setSystemId() to provide a base ! * for resolving relative URIs, may use setPublicId to include a ! * public identifier, and may use setEncoding to specify the object's ! * character encoding.

          ! * ! * @param byteStream The raw byte stream containing the document. ! * @see #setPublicId ! * @see #setSystemId ! * @see #setEncoding ! * @see #setByteStream ! * @see #setCharacterStream ! */ ! public InputSource (InputStream byteStream) ! { ! setByteStream(byteStream); ! } ! ! ! /** ! * Create a new input source with a character stream. ! * ! *

          Application writers should use setSystemId() to provide a base ! * for resolving relative URIs, and may use setPublicId to include a ! * public identifier.

          ! * ! *

          The character stream shall not include a byte order mark.

          ! * ! * @see #setPublicId ! * @see #setSystemId ! * @see #setByteStream ! * @see #setCharacterStream ! */ ! public InputSource (Reader characterStream) ! { ! setCharacterStream(characterStream); ! } ! ! ! /** ! * Set the public identifier for this input source. ! * ! *

          The public identifier is always optional: if the application ! * writer includes one, it will be provided as part of the ! * location information.

          ! * ! * @param publicId The public identifier as a string. ! * @see #getPublicId ! * @see org.xml.sax.Locator#getPublicId ! * @see org.xml.sax.SAXParseException#getPublicId ! */ ! public void setPublicId (String publicId) ! { ! this.publicId = publicId; ! } ! ! ! /** ! * Get the public identifier for this input source. ! * ! * @return The public identifier, or null if none was supplied. ! * @see #setPublicId ! */ ! public String getPublicId () ! { ! return publicId; ! } ! ! ! /** ! * Set the system identifier for this input source. ! * ! *

          The system identifier is optional if there is a byte stream ! * or a character stream, but it is still useful to provide one, ! * since the application can use it to resolve relative URIs ! * and can include it in error messages and warnings (the parser ! * will attempt to open a connection to the URI only if ! * there is no byte stream or character stream specified).

          ! * ! *

          If the application knows the character encoding of the ! * object pointed to by the system identifier, it can register ! * the encoding using the setEncoding method.

          ! * ! *

          If the system identifier is a URL, it must be fully ! * resolved (it may not be a relative URL).

          ! * ! * @param systemId The system identifier as a string. ! * @see #setEncoding ! * @see #getSystemId ! * @see org.xml.sax.Locator#getSystemId ! * @see org.xml.sax.SAXParseException#getSystemId ! */ ! public void setSystemId (String systemId) ! { ! this.systemId = systemId; ! } ! ! ! /** ! * Get the system identifier for this input source. ! * ! *

          The getEncoding method will return the character encoding ! * of the object pointed to, or null if unknown.

          ! * ! *

          If the system ID is a URL, it will be fully resolved.

          ! * ! * @return The system identifier, or null if none was supplied. ! * @see #setSystemId ! * @see #getEncoding ! */ ! public String getSystemId () ! { ! return systemId; ! } ! ! ! /** ! * Set the byte stream for this input source. ! * ! *

          The SAX parser will ignore this if there is also a character ! * stream specified, but it will use a byte stream in preference ! * to opening a URI connection itself.

          ! * ! *

          If the application knows the character encoding of the ! * byte stream, it should set it with the setEncoding method.

          ! * ! * @param byteStream A byte stream containing an XML document or ! * other entity. ! * @see #setEncoding ! * @see #getByteStream ! * @see #getEncoding ! * @see java.io.InputStream ! */ ! public void setByteStream (InputStream byteStream) ! { ! this.byteStream = byteStream; ! } ! ! ! /** ! * Get the byte stream for this input source. ! * ! *

          The getEncoding method will return the character ! * encoding for this byte stream, or null if unknown.

          ! * ! * @return The byte stream, or null if none was supplied. ! * @see #getEncoding ! * @see #setByteStream ! */ ! public InputStream getByteStream () ! { ! return byteStream; ! } ! ! ! /** ! * Set the character encoding, if known. ! * ! *

          The encoding must be a string acceptable for an ! * XML encoding declaration (see section 4.3.3 of the XML 1.0 ! * recommendation).

          ! * ! *

          This method has no effect when the application provides a ! * character stream.

          ! * ! * @param encoding A string describing the character encoding. ! * @see #setSystemId ! * @see #setByteStream ! * @see #getEncoding ! */ ! public void setEncoding (String encoding) ! { ! this.encoding = encoding; ! } ! ! ! /** ! * Get the character encoding for a byte stream or URI. ! * This value will be ignored when the application provides a ! * character stream. ! * ! * @return The encoding, or null if none was supplied. ! * @see #setByteStream ! * @see #getSystemId ! * @see #getByteStream ! */ ! public String getEncoding () ! { ! return encoding; ! } ! ! ! /** ! * Set the character stream for this input source. ! * ! *

          If there is a character stream specified, the SAX parser ! * will ignore any byte stream and will not attempt to open ! * a URI connection to the system identifier.

          ! * ! * @param characterStream The character stream containing the ! * XML document or other entity. ! * @see #getCharacterStream ! * @see java.io.Reader ! */ ! public void setCharacterStream (Reader characterStream) ! { ! this.characterStream = characterStream; ! } ! ! ! /** ! * Get the character stream for this input source. ! * ! * @return The character stream, or null if none was supplied. ! * @see #setCharacterStream ! */ ! public Reader getCharacterStream () ! { ! return characterStream; ! } ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Internal state. ! //////////////////////////////////////////////////////////////////// ! ! private String publicId; ! private String systemId; ! private InputStream byteStream; ! private String encoding; ! private Reader characterStream; ! ! } ! ! // end of InputSource.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/Locator.java gcc-3.3/libjava/org/xml/sax/Locator.java *** gcc-3.2.3/libjava/org/xml/sax/Locator.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/Locator.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,126 **** ! // SAX locator interface for document events. ! // No warranty; no copyright -- use this as you will. ! // $Id: Locator.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! ! /** ! * Interface for associating a SAX event with a document location. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          If a SAX parser provides location information to the SAX ! * application, it does so by implementing this interface and then ! * passing an instance to the application using the content ! * handler's {@link org.xml.sax.ContentHandler#setDocumentLocator ! * setDocumentLocator} method. The application can use the ! * object to obtain the location of any other content handler event ! * in the XML source document.

          ! * ! *

          Note that the results returned by the object will be valid only ! * during the scope of each content handler method: the application ! * will receive unpredictable results if it attempts to use the ! * locator at any other time.

          ! * ! *

          SAX parsers are not required to supply a locator, but they are ! * very strongly encouraged to do so. If the parser supplies a ! * locator, it must do so before reporting any other document events. ! * If no locator has been set by the time the application receives ! * the {@link org.xml.sax.ContentHandler#startDocument startDocument} ! * event, the application should assume that a locator is not ! * available.

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! */ ! public interface Locator { ! ! ! /** ! * Return the public identifier for the current document event. ! * ! *

          The return value is the public identifier of the document ! * entity or of the external parsed entity in which the markup ! * triggering the event appears.

          ! * ! * @return A string containing the public identifier, or ! * null if none is available. ! * @see #getSystemId ! */ ! public abstract String getPublicId (); ! ! ! /** ! * Return the system identifier for the current document event. ! * ! *

          The return value is the system identifier of the document ! * entity or of the external parsed entity in which the markup ! * triggering the event appears.

          ! * ! *

          If the system identifier is a URL, the parser must resolve it ! * fully before passing it to the application.

          ! * ! * @return A string containing the system identifier, or null ! * if none is available. ! * @see #getPublicId ! */ ! public abstract String getSystemId (); ! ! ! /** ! * Return the line number where the current document event ends. ! * ! *

          Warning: The return value from the method ! * is intended only as an approximation for the sake of error ! * reporting; it is not intended to provide sufficient information ! * to edit the character content of the original XML document.

          ! * ! *

          The return value is an approximation of the line number ! * in the document entity or external parsed entity where the ! * markup triggering the event appears.

          ! * ! *

          If possible, the SAX driver should provide the line position ! * of the first character after the text associated with the document ! * event. The first line in the document is line 1.

          ! * ! * @return The line number, or -1 if none is available. ! * @see #getColumnNumber ! */ ! public abstract int getLineNumber (); ! ! ! /** ! * Return the column number where the current document event ends. ! * ! *

          Warning: The return value from the method ! * is intended only as an approximation for the sake of error ! * reporting; it is not intended to provide sufficient information ! * to edit the character content of the original XML document.

          ! * ! *

          The return value is an approximation of the column number ! * in the document entity or external parsed entity where the ! * markup triggering the event appears.

          ! * ! *

          If possible, the SAX driver should provide the line position ! * of the first character after the text associated with the document ! * event.

          ! * ! *

          If possible, the SAX driver should provide the line position ! * of the first character after the text associated with the document ! * event. The first column in each line is column 1.

          ! * ! * @return The column number, or -1 if none is available. ! * @see #getLineNumber ! */ ! public abstract int getColumnNumber (); ! ! } ! ! // end of Locator.java --- 1,136 ---- ! // SAX locator interface for document events. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: Locator.java,v 1.4.2.5 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! ! /** ! * Interface for associating a SAX event with a document location. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          If a SAX parser provides location information to the SAX ! * application, it does so by implementing this interface and then ! * passing an instance to the application using the content ! * handler's {@link org.xml.sax.ContentHandler#setDocumentLocator ! * setDocumentLocator} method. The application can use the ! * object to obtain the location of any other SAX event ! * in the XML source document.

          ! * ! *

          Note that the results returned by the object will be valid only ! * during the scope of each callback method: the application ! * will receive unpredictable results if it attempts to use the ! * locator at any other time, or after parsing completes.

          ! * ! *

          SAX parsers are not required to supply a locator, but they are ! * very strongly encouraged to do so. If the parser supplies a ! * locator, it must do so before reporting any other document events. ! * If no locator has been set by the time the application receives ! * the {@link org.xml.sax.ContentHandler#startDocument startDocument} ! * event, the application should assume that a locator is not ! * available.

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.ContentHandler#setDocumentLocator ! */ ! public interface Locator { ! ! ! /** ! * Return the public identifier for the current document event. ! * ! *

          The return value is the public identifier of the document ! * entity or of the external parsed entity in which the markup ! * triggering the event appears.

          ! * ! * @return A string containing the public identifier, or ! * null if none is available. ! * @see #getSystemId ! */ ! public abstract String getPublicId (); ! ! ! /** ! * Return the system identifier for the current document event. ! * ! *

          The return value is the system identifier of the document ! * entity or of the external parsed entity in which the markup ! * triggering the event appears.

          ! * ! *

          If the system identifier is a URL, the parser must resolve it ! * fully before passing it to the application. For example, a file ! * name must always be provided as a file:... URL, and other ! * kinds of relative URI are also resolved against their bases.

          ! * ! * @return A string containing the system identifier, or null ! * if none is available. ! * @see #getPublicId ! */ ! public abstract String getSystemId (); ! ! ! /** ! * Return the line number where the current document event ends. ! * Lines are delimited by line ends, which are defined in ! * the XML specification. ! * ! *

          Warning: The return value from the method ! * is intended only as an approximation for the sake of diagnostics; ! * it is not intended to provide sufficient information ! * to edit the character content of the original XML document. ! * In some cases, these "line" numbers match what would be displayed ! * as columns, and in others they may not match the source text ! * due to internal entity expansion.

          ! * ! *

          The return value is an approximation of the line number ! * in the document entity or external parsed entity where the ! * markup triggering the event appears.

          ! * ! *

          If possible, the SAX driver should provide the line position ! * of the first character after the text associated with the document ! * event. The first line is line 1.

          ! * ! * @return The line number, or -1 if none is available. ! * @see #getColumnNumber ! */ ! public abstract int getLineNumber (); ! ! ! /** ! * Return the column number where the current document event ends. ! * This is one-based number of Java char values since ! * the last line end. ! * ! *

          Warning: The return value from the method ! * is intended only as an approximation for the sake of diagnostics; ! * it is not intended to provide sufficient information ! * to edit the character content of the original XML document. ! * For example, when lines contain combining character sequences, wide ! * characters, surrogate pairs, or bi-directional text, the value may ! * not correspond to the column in a text editor's display.

          ! * ! *

          The return value is an approximation of the column number ! * in the document entity or external parsed entity where the ! * markup triggering the event appears.

          ! * ! *

          If possible, the SAX driver should provide the line position ! * of the first character after the text associated with the document ! * event. The first column in each line is column 1.

          ! * ! * @return The column number, or -1 if none is available. ! * @see #getLineNumber ! */ ! public abstract int getColumnNumber (); ! ! } ! ! // end of Locator.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/package.html gcc-3.3/libjava/org/xml/sax/package.html *** gcc-3.2.3/libjava/org/xml/sax/package.html 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/package.html 2002-12-20 03:50:17.000000000 +0000 *************** *** 0 **** --- 1,164 ---- + + + + + + +

          This package provides the core SAX APIs. + Some SAX1 APIs are deprecated to encourage integration of + namespace-awareness into designs of new applications + and into maintainance of existing infrastructure.

          + +

          See http://www.saxproject.org + for more information about SAX.

          + + +

          SAX2 Standard Feature Flags

          + +

          One of the essential characteristics of SAX2 is that it added + feature flags which can be used to examine and perhaps modify + parser modes, in particular modes such as validation. + Since features are identified by (absolute) URIs, anyone + can define such features. + Currently defined standard feature URIs have the prefix + http://xml.org/sax/features/ before an identifier such as + validation. Turn features on or off using + setFeature. Those standard identifiers are:

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Feature IDDefaultDescription
          external-general-entitiesunspecified Reports whether this parser processes external + general entities; always true if validating
          external-parameter-entitiesunspecified Reports whether this parser processes external + parameter entities; always true if validating
          lexical-handler/parameter-entitiesunspecified true indicates that the LexicalHandler will report the + beginning and end of parameter entities +
          namespacestrue true indicates namespace URIs and unprefixed local names + for element and attribute names will be available
          namespace-prefixesfalse true indicates XML 1.0 names (with prefixes) and attributes + (including xmlns* attributes) will be available
          string-interningunspecified true if all XML names (for elements, prefixes, attributes, + entities, notations, and local names), + as well as Namespace URIs, will have been interned + using java.lang.String.intern. This supports fast + testing of equality/inequality against string constants.
          validationunspecified controls whether the parser is reporting all validity + errors; if true, all external entities will be read.
          + +

          Support for the default values of the + namespaces and namespace-prefixes + properties is required. +

          + +

          For default values not specified by SAX2, + each XMLReader implementation specifies its default, + or may choose not to expose the feature flag. + Unless otherwise specified here, + implementations may support changing current values + of these standard feature flags, but not while parsing. +

          + +

          SAX2 Standard Handler and Property IDs

          + +

          For parser interface characteristics that are described + as objects, a separate namespace is defined. The + objects in this namespace are again identified by URI, and + the standard property URIs have the prefix + http://xml.org/sax/properties/ before an identifier such as + lexical-handler or + dom-node. Manage those properties using + setProperty(). Those identifiers are:

          + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Property IDDescription
          declaration-handler Used to see most DTD declarations except those treated + as lexical ("document element name is ...") or which are + mandatory for all SAX parsers (DTDHandler). + The Object must implement org.xml.sax.ext.DeclHandler. +
          dom-node For "DOM Walker" style parsers, which ignore their + parser.parse() parameters, this is used to + specify the DOM (sub)tree being walked by the parser. + The Object must implement the + org.w3c.dom.Node interface. +
          lexical-handler Used to see some syntax events that are essential in some + applications: comments, CDATA delimeters, selected general + entity inclusions, and the start and end of the DTD + (and declaration of document element name). + The Object must implement org.xml.sax.ext.LexicalHandler. +
          xml-string Readable only during a parser callback, this exposes a TBS + chunk of characters responsible for the current event.
          + +

          All of these standard properties are optional; + XMLReader implementations need not support them. +

          + + diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/Parser.java gcc-3.3/libjava/org/xml/sax/Parser.java *** gcc-3.2.3/libjava/org/xml/sax/Parser.java 2001-07-11 03:59:15.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/Parser.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,207 **** ! // SAX parser interface. ! // No warranty; no copyright -- use this as you will. ! // $Id: Parser.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! import java.io.IOException; ! import java.util.Locale; ! ! ! /** ! * Basic interface for SAX (Simple API for XML) parsers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This was the main event supplier interface for SAX1; it has ! * been replaced in SAX2 by {@link org.xml.sax.XMLReader XMLReader}, ! * which includes Namespace support and sophisticated configurability ! * and extensibility.

          ! * ! *

          All SAX1 parsers must implement this basic interface: it allows ! * applications to register handlers for different types of events ! * and to initiate a parse from a URI, or a character stream.

          ! * ! *

          All SAX1 parsers must also implement a zero-argument constructor ! * (though other constructors are also allowed).

          ! * ! *

          SAX1 parsers are reusable but not re-entrant: the application ! * may reuse a parser object (possibly with a different input source) ! * once the first parse has completed successfully, but it may not ! * invoke the parse() methods recursively within a parse.

          ! * ! * @deprecated This interface has been replaced by the SAX2 ! * {@link org.xml.sax.XMLReader XMLReader} ! * interface, which includes Namespace support. ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.DocumentHandler ! * @see org.xml.sax.ErrorHandler ! * @see org.xml.sax.HandlerBase ! * @see org.xml.sax.InputSource ! */ ! public interface Parser ! { ! ! /** ! * Allow an application to request a locale for errors and warnings. ! * ! *

          SAX parsers are not required to provide localisation for errors ! * and warnings; if they cannot support the requested locale, ! * however, they must throw a SAX exception. Applications may ! * not request a locale change in the middle of a parse.

          ! * ! * @param locale A Java Locale object. ! * @exception org.xml.sax.SAXException Throws an exception ! * (using the previous or default locale) if the ! * requested locale is not supported. ! * @see org.xml.sax.SAXException ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void setLocale (Locale locale) ! throws SAXException; ! ! ! /** ! * Allow an application to register a custom entity resolver. ! * ! *

          If the application does not register an entity resolver, the ! * SAX parser will resolve system identifiers and open connections ! * to entities itself (this is the default behaviour implemented in ! * HandlerBase).

          ! * ! *

          Applications may register a new or different entity resolver ! * in the middle of a parse, and the SAX parser must begin using ! * the new resolver immediately.

          ! * ! * @param resolver The object for resolving entities. ! * @see EntityResolver ! * @see HandlerBase ! */ ! public abstract void setEntityResolver (EntityResolver resolver); ! ! ! /** ! * Allow an application to register a DTD event handler. ! * ! *

          If the application does not register a DTD handler, all DTD ! * events reported by the SAX parser will be silently ! * ignored (this is the default behaviour implemented by ! * HandlerBase).

          ! * ! *

          Applications may register a new or different ! * handler in the middle of a parse, and the SAX parser must ! * begin using the new handler immediately.

          ! * ! * @param handler The DTD handler. ! * @see DTDHandler ! * @see HandlerBase ! */ ! public abstract void setDTDHandler (DTDHandler handler); ! ! ! /** ! * Allow an application to register a document event handler. ! * ! *

          If the application does not register a document handler, all ! * document events reported by the SAX parser will be silently ! * ignored (this is the default behaviour implemented by ! * HandlerBase).

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The document handler. ! * @see DocumentHandler ! * @see HandlerBase ! */ ! public abstract void setDocumentHandler (DocumentHandler handler); ! ! ! /** ! * Allow an application to register an error event handler. ! * ! *

          If the application does not register an error event handler, ! * all error events reported by the SAX parser will be silently ! * ignored, except for fatalError, which will throw a SAXException ! * (this is the default behaviour implemented by HandlerBase).

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The error handler. ! * @see ErrorHandler ! * @see SAXException ! * @see HandlerBase ! */ ! public abstract void setErrorHandler (ErrorHandler handler); ! ! ! /** ! * Parse an XML document. ! * ! *

          The application can use this method to instruct the SAX parser ! * to begin parsing an XML document from any valid input ! * source (a character stream, a byte stream, or a URI).

          ! * ! *

          Applications may not invoke this method while a parse is in ! * progress (they should create a new Parser instead for each ! * additional XML document). Once a parse is complete, an ! * application may reuse the same Parser object, possibly with a ! * different input source.

          ! * ! * @param source The input source for the top-level of the ! * XML document. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see org.xml.sax.InputSource ! * @see #parse(java.lang.String) ! * @see #setEntityResolver ! * @see #setDTDHandler ! * @see #setDocumentHandler ! * @see #setErrorHandler ! */ ! public abstract void parse (InputSource source) ! throws SAXException, IOException; ! ! ! /** ! * Parse an XML document from a system identifier (URI). ! * ! *

          This method is a shortcut for the common case of reading a ! * document from a system identifier. It is the exact ! * equivalent of the following:

          ! * ! *
          !      * parse(new InputSource(systemId));
          !      * 
          ! * ! *

          If the system identifier is a URL, it must be fully resolved ! * by the application before it is passed to the parser.

          ! * ! * @param systemId The system identifier (URI). ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see #parse(org.xml.sax.InputSource) ! */ ! public abstract void parse (String systemId) ! throws SAXException, IOException; ! ! } ! ! // end of Parser.java --- 1,209 ---- ! // SAX parser interface. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: Parser.java,v 1.3.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! import java.io.IOException; ! import java.util.Locale; ! ! ! /** ! * Basic interface for SAX (Simple API for XML) parsers. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This was the main event supplier interface for SAX1; it has ! * been replaced in SAX2 by {@link org.xml.sax.XMLReader XMLReader}, ! * which includes Namespace support and sophisticated configurability ! * and extensibility.

          ! * ! *

          All SAX1 parsers must implement this basic interface: it allows ! * applications to register handlers for different types of events ! * and to initiate a parse from a URI, or a character stream.

          ! * ! *

          All SAX1 parsers must also implement a zero-argument constructor ! * (though other constructors are also allowed).

          ! * ! *

          SAX1 parsers are reusable but not re-entrant: the application ! * may reuse a parser object (possibly with a different input source) ! * once the first parse has completed successfully, but it may not ! * invoke the parse() methods recursively within a parse.

          ! * ! * @deprecated This interface has been replaced by the SAX2 ! * {@link org.xml.sax.XMLReader XMLReader} ! * interface, which includes Namespace support. ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.EntityResolver ! * @see org.xml.sax.DTDHandler ! * @see org.xml.sax.DocumentHandler ! * @see org.xml.sax.ErrorHandler ! * @see org.xml.sax.HandlerBase ! * @see org.xml.sax.InputSource ! */ ! public interface Parser ! { ! ! /** ! * Allow an application to request a locale for errors and warnings. ! * ! *

          SAX parsers are not required to provide localisation for errors ! * and warnings; if they cannot support the requested locale, ! * however, they must throw a SAX exception. Applications may ! * not request a locale change in the middle of a parse.

          ! * ! * @param locale A Java Locale object. ! * @exception org.xml.sax.SAXException Throws an exception ! * (using the previous or default locale) if the ! * requested locale is not supported. ! * @see org.xml.sax.SAXException ! * @see org.xml.sax.SAXParseException ! */ ! public abstract void setLocale (Locale locale) ! throws SAXException; ! ! ! /** ! * Allow an application to register a custom entity resolver. ! * ! *

          If the application does not register an entity resolver, the ! * SAX parser will resolve system identifiers and open connections ! * to entities itself (this is the default behaviour implemented in ! * HandlerBase).

          ! * ! *

          Applications may register a new or different entity resolver ! * in the middle of a parse, and the SAX parser must begin using ! * the new resolver immediately.

          ! * ! * @param resolver The object for resolving entities. ! * @see EntityResolver ! * @see HandlerBase ! */ ! public abstract void setEntityResolver (EntityResolver resolver); ! ! ! /** ! * Allow an application to register a DTD event handler. ! * ! *

          If the application does not register a DTD handler, all DTD ! * events reported by the SAX parser will be silently ! * ignored (this is the default behaviour implemented by ! * HandlerBase).

          ! * ! *

          Applications may register a new or different ! * handler in the middle of a parse, and the SAX parser must ! * begin using the new handler immediately.

          ! * ! * @param handler The DTD handler. ! * @see DTDHandler ! * @see HandlerBase ! */ ! public abstract void setDTDHandler (DTDHandler handler); ! ! ! /** ! * Allow an application to register a document event handler. ! * ! *

          If the application does not register a document handler, all ! * document events reported by the SAX parser will be silently ! * ignored (this is the default behaviour implemented by ! * HandlerBase).

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The document handler. ! * @see DocumentHandler ! * @see HandlerBase ! */ ! public abstract void setDocumentHandler (DocumentHandler handler); ! ! ! /** ! * Allow an application to register an error event handler. ! * ! *

          If the application does not register an error event handler, ! * all error events reported by the SAX parser will be silently ! * ignored, except for fatalError, which will throw a SAXException ! * (this is the default behaviour implemented by HandlerBase).

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The error handler. ! * @see ErrorHandler ! * @see SAXException ! * @see HandlerBase ! */ ! public abstract void setErrorHandler (ErrorHandler handler); ! ! ! /** ! * Parse an XML document. ! * ! *

          The application can use this method to instruct the SAX parser ! * to begin parsing an XML document from any valid input ! * source (a character stream, a byte stream, or a URI).

          ! * ! *

          Applications may not invoke this method while a parse is in ! * progress (they should create a new Parser instead for each ! * additional XML document). Once a parse is complete, an ! * application may reuse the same Parser object, possibly with a ! * different input source.

          ! * ! * @param source The input source for the top-level of the ! * XML document. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see org.xml.sax.InputSource ! * @see #parse(java.lang.String) ! * @see #setEntityResolver ! * @see #setDTDHandler ! * @see #setDocumentHandler ! * @see #setErrorHandler ! */ ! public abstract void parse (InputSource source) ! throws SAXException, IOException; ! ! ! /** ! * Parse an XML document from a system identifier (URI). ! * ! *

          This method is a shortcut for the common case of reading a ! * document from a system identifier. It is the exact ! * equivalent of the following:

          ! * ! *
          !      * parse(new InputSource(systemId));
          !      * 
          ! * ! *

          If the system identifier is a URL, it must be fully resolved ! * by the application before it is passed to the parser.

          ! * ! * @param systemId The system identifier (URI). ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see #parse(org.xml.sax.InputSource) ! */ ! public abstract void parse (String systemId) ! throws SAXException, IOException; ! ! } ! ! // end of Parser.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/SAXException.java gcc-3.3/libjava/org/xml/sax/SAXException.java *** gcc-3.2.3/libjava/org/xml/sax/SAXException.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/SAXException.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,144 **** ! // SAX exception class. ! // No warranty; no copyright -- use this as you will. ! // $Id: SAXException.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! /** ! * Encapsulate a general SAX error or warning. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This class can contain basic error or warning information from ! * either the XML parser or the application: a parser writer or ! * application writer can subclass it to provide additional ! * functionality. SAX handlers may throw this exception or ! * any exception subclassed from it.

          ! * ! *

          If the application needs to pass through other types of ! * exceptions, it must wrap those exceptions in a SAXException ! * or an exception derived from a SAXException.

          ! * ! *

          If the parser or application needs to include information about a ! * specific location in an XML document, it should use the ! * {@link org.xml.sax.SAXParseException SAXParseException} subclass.

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.SAXParseException ! */ ! public class SAXException extends Exception { ! ! ! /** ! * Create a new SAXException. ! * ! * @param message The error or warning message. ! * @see org.xml.sax.Parser#setLocale ! */ ! public SAXException (String message) { ! super(message); ! this.exception = null; ! } ! ! ! /** ! * Create a new SAXException wrapping an existing exception. ! * ! *

          The existing exception will be embedded in the new ! * one, and its message will become the default message for ! * the SAXException.

          ! * ! * @param e The exception to be wrapped in a SAXException. ! */ ! public SAXException (Exception e) ! { ! super(); ! this.exception = e; ! } ! ! ! /** ! * Create a new SAXException from an existing exception. ! * ! *

          The existing exception will be embedded in the new ! * one, but the new exception will have its own message.

          ! * ! * @param message The detail message. ! * @param e The exception to be wrapped in a SAXException. ! * @see org.xml.sax.Parser#setLocale ! */ ! public SAXException (String message, Exception e) ! { ! super(message); ! this.exception = e; ! } ! ! ! /** ! * Return a detail message for this exception. ! * ! *

          If there is an embedded exception, and if the SAXException ! * has no detail message of its own, this method will return ! * the detail message from the embedded exception.

          ! * ! * @return The error or warning message. ! * @see org.xml.sax.Parser#setLocale ! */ ! public String getMessage () ! { ! String message = super.getMessage(); ! ! if (message == null && exception != null) { ! return exception.getMessage(); ! } else { ! return message; ! } ! } ! ! ! /** ! * Return the embedded exception, if any. ! * ! * @return The embedded exception, or null if there is none. ! */ ! public Exception getException () ! { ! return exception; ! } ! ! ! /** ! * Override toString to pick up any embedded exception. ! * ! * @return A string representation of this exception. ! */ ! public String toString () ! { ! if (exception != null) { ! return exception.toString(); ! } else { ! return super.toString(); ! } ! } ! ! ! ! ////////////////////////////////////////////////////////////////////// ! // Internal state. ! ////////////////////////////////////////////////////////////////////// ! ! ! /** ! * @serial The embedded exception if tunnelling, or null. ! */ ! private Exception exception; ! ! } ! ! // end of SAXException.java --- 1,153 ---- ! // SAX exception class. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: SAXException.java,v 1.4.2.4 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! /** ! * Encapsulate a general SAX error or warning. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This class can contain basic error or warning information from ! * either the XML parser or the application: a parser writer or ! * application writer can subclass it to provide additional ! * functionality. SAX handlers may throw this exception or ! * any exception subclassed from it.

          ! * ! *

          If the application needs to pass through other types of ! * exceptions, it must wrap those exceptions in a SAXException ! * or an exception derived from a SAXException.

          ! * ! *

          If the parser or application needs to include information about a ! * specific location in an XML document, it should use the ! * {@link org.xml.sax.SAXParseException SAXParseException} subclass.

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.SAXParseException ! */ ! public class SAXException extends Exception { ! ! ! /** ! * Create a new SAXException. ! */ ! public SAXException () ! { ! super(); ! this.exception = null; ! } ! ! ! /** ! * Create a new SAXException. ! * ! * @param message The error or warning message. ! */ ! public SAXException (String message) { ! super(message); ! this.exception = null; ! } ! ! ! /** ! * Create a new SAXException wrapping an existing exception. ! * ! *

          The existing exception will be embedded in the new ! * one, and its message will become the default message for ! * the SAXException.

          ! * ! * @param e The exception to be wrapped in a SAXException. ! */ ! public SAXException (Exception e) ! { ! super(); ! this.exception = e; ! } ! ! ! /** ! * Create a new SAXException from an existing exception. ! * ! *

          The existing exception will be embedded in the new ! * one, but the new exception will have its own message.

          ! * ! * @param message The detail message. ! * @param e The exception to be wrapped in a SAXException. ! */ ! public SAXException (String message, Exception e) ! { ! super(message); ! this.exception = e; ! } ! ! ! /** ! * Return a detail message for this exception. ! * ! *

          If there is an embedded exception, and if the SAXException ! * has no detail message of its own, this method will return ! * the detail message from the embedded exception.

          ! * ! * @return The error or warning message. ! */ ! public String getMessage () ! { ! String message = super.getMessage(); ! ! if (message == null && exception != null) { ! return exception.getMessage(); ! } else { ! return message; ! } ! } ! ! ! /** ! * Return the embedded exception, if any. ! * ! * @return The embedded exception, or null if there is none. ! */ ! public Exception getException () ! { ! return exception; ! } ! ! ! /** ! * Override toString to pick up any embedded exception. ! * ! * @return A string representation of this exception. ! */ ! public String toString () ! { ! if (exception != null) { ! return exception.toString(); ! } else { ! return super.toString(); ! } ! } ! ! ! ! ////////////////////////////////////////////////////////////////////// ! // Internal state. ! ////////////////////////////////////////////////////////////////////// ! ! ! /** ! * @serial The embedded exception if tunnelling, or null. ! */ ! private Exception exception; ! ! } ! ! // end of SAXException.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/SAXNotRecognizedException.java gcc-3.3/libjava/org/xml/sax/SAXNotRecognizedException.java *** gcc-3.2.3/libjava/org/xml/sax/SAXNotRecognizedException.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/SAXNotRecognizedException.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,44 **** ! // SAXNotRecognizedException.java - unrecognized feature or value. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: SAXNotRecognizedException.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! ! package org.xml.sax; ! ! ! /** ! * Exception class for an unrecognized identifier. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          An XMLReader will throw this exception when it finds an ! * unrecognized feature or property identifier; SAX applications and ! * extensions may use this class for other, similar purposes.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.SAXNotSupportedException ! */ ! public class SAXNotRecognizedException extends SAXException ! { ! ! /** ! * Construct a new exception with the given message. ! * ! * @param message The text message of the exception. ! */ ! public SAXNotRecognizedException (String message) ! { ! super(message); ! } ! ! } ! ! // end of SAXNotRecognizedException.java --- 1,55 ---- ! // SAXNotRecognizedException.java - unrecognized feature or value. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: SAXNotRecognizedException.java,v 1.4.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! ! package org.xml.sax; ! ! ! /** ! * Exception class for an unrecognized identifier. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          An XMLReader will throw this exception when it finds an ! * unrecognized feature or property identifier; SAX applications and ! * extensions may use this class for other, similar purposes.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.SAXNotSupportedException ! */ ! public class SAXNotRecognizedException extends SAXException ! { ! ! /** ! * Default constructor. ! */ ! public SAXNotRecognizedException () ! { ! super(); ! } ! ! ! /** ! * Construct a new exception with the given message. ! * ! * @param message The text message of the exception. ! */ ! public SAXNotRecognizedException (String message) ! { ! super(message); ! } ! ! } ! ! // end of SAXNotRecognizedException.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/SAXNotSupportedException.java gcc-3.3/libjava/org/xml/sax/SAXNotSupportedException.java *** gcc-3.2.3/libjava/org/xml/sax/SAXNotSupportedException.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/SAXNotSupportedException.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,44 **** ! // SAXNotSupportedException.java - unsupported feature or value. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: SAXNotSupportedException.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! ! package org.xml.sax; ! ! /** ! * Exception class for an unsupported operation. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          An XMLReader will throw this exception when it recognizes a ! * feature or property identifier, but cannot perform the requested ! * operation (setting a state or value). Other SAX2 applications and ! * extensions may use this class for similar purposes.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.SAXNotRecognizedException ! */ ! public class SAXNotSupportedException extends SAXException ! { ! ! /** ! * Construct a new exception with the given message. ! * ! * @param message The text message of the exception. ! */ ! public SAXNotSupportedException (String message) ! { ! super(message); ! } ! ! } ! ! // end of SAXNotSupportedException.java --- 1,55 ---- ! // SAXNotSupportedException.java - unsupported feature or value. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: SAXNotSupportedException.java,v 1.4.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! ! package org.xml.sax; ! ! /** ! * Exception class for an unsupported operation. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          An XMLReader will throw this exception when it recognizes a ! * feature or property identifier, but cannot perform the requested ! * operation (setting a state or value). Other SAX2 applications and ! * extensions may use this class for similar purposes.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.SAXNotRecognizedException ! */ ! public class SAXNotSupportedException extends SAXException ! { ! ! /** ! * Construct a new exception with no message. ! */ ! public SAXNotSupportedException () ! { ! super(); ! } ! ! ! /** ! * Construct a new exception with the given message. ! * ! * @param message The text message of the exception. ! */ ! public SAXNotSupportedException (String message) ! { ! super(message); ! } ! ! } ! ! // end of SAXNotSupportedException.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/SAXParseException.java gcc-3.3/libjava/org/xml/sax/SAXParseException.java *** gcc-3.2.3/libjava/org/xml/sax/SAXParseException.java 2001-10-31 00:48:17.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/SAXParseException.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,264 **** ! // SAX exception class. ! // No warranty; no copyright -- use this as you will. ! // $Id: SAXParseException.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! /** ! * Encapsulate an XML parse error or warning. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          This exception will include information for locating the error ! * in the original XML document. Note that although the application ! * will receive a SAXParseException as the argument to the handlers ! * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface, ! * the application is not actually required to throw the exception; ! * instead, it can simply read the information in it and take a ! * different action.

          ! * ! *

          Since this exception is a subclass of {@link org.xml.sax.SAXException ! * SAXException}, it inherits the ability to wrap another exception.

          ! * ! * @since SAX 1.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.SAXException ! * @see org.xml.sax.Locator ! * @see org.xml.sax.ErrorHandler ! */ ! public class SAXParseException extends SAXException { ! ! ! ////////////////////////////////////////////////////////////////////// ! // Constructors. ! ////////////////////////////////////////////////////////////////////// ! ! ! /** ! * Create a new SAXParseException from a message and a Locator. ! * ! *

          This constructor is especially useful when an application is ! * creating its own exception from within a {@link org.xml.sax.ContentHandler ! * ContentHandler} callback.

          ! * ! * @param message The error or warning message. ! * @param locator The locator object for the error or warning (may be ! * null). ! * @see org.xml.sax.Locator ! * @see org.xml.sax.Parser#setLocale ! */ ! public SAXParseException (String message, Locator locator) { ! super(message); ! if (locator != null) { ! init(locator.getPublicId(), locator.getSystemId(), ! locator.getLineNumber(), locator.getColumnNumber()); ! } else { ! init(null, null, -1, -1); ! } ! } ! ! ! /** ! * Wrap an existing exception in a SAXParseException. ! * ! *

          This constructor is especially useful when an application is ! * creating its own exception from within a {@link org.xml.sax.ContentHandler ! * ContentHandler} callback, and needs to wrap an existing exception that is not a ! * subclass of {@link org.xml.sax.SAXException SAXException}.

          ! * ! * @param message The error or warning message, or null to ! * use the message from the embedded exception. ! * @param locator The locator object for the error or warning (may be ! * null). ! * @param e Any exception. ! * @see org.xml.sax.Locator ! * @see org.xml.sax.Parser#setLocale ! */ ! public SAXParseException (String message, Locator locator, ! Exception e) { ! super(message, e); ! if (locator != null) { ! init(locator.getPublicId(), locator.getSystemId(), ! locator.getLineNumber(), locator.getColumnNumber()); ! } else { ! init(null, null, -1, -1); ! } ! } ! ! ! /** ! * Create a new SAXParseException. ! * ! *

          This constructor is most useful for parser writers.

          ! * ! *

          If the system identifier is a URL, the parser must resolve it ! * fully before creating the exception.

          ! * ! * @param message The error or warning message. ! * @param publicId The public identifier of the entity that generated ! * the error or warning. ! * @param systemId The system identifier of the entity that generated ! * the error or warning. ! * @param lineNumber The line number of the end of the text that ! * caused the error or warning. ! * @param columnNumber The column number of the end of the text that ! * cause the error or warning. ! * @see org.xml.sax.Parser#setLocale ! */ ! public SAXParseException (String message, String publicId, String systemId, ! int lineNumber, int columnNumber) ! { ! super(message); ! init(publicId, systemId, lineNumber, columnNumber); ! } ! ! ! /** ! * Create a new SAXParseException with an embedded exception. ! * ! *

          This constructor is most useful for parser writers who ! * need to wrap an exception that is not a subclass of ! * {@link org.xml.sax.SAXException SAXException}.

          ! * ! *

          If the system identifier is a URL, the parser must resolve it ! * fully before creating the exception.

          ! * ! * @param message The error or warning message, or null to use ! * the message from the embedded exception. ! * @param publicId The public identifier of the entity that generated ! * the error or warning. ! * @param systemId The system identifier of the entity that generated ! * the error or warning. ! * @param lineNumber The line number of the end of the text that ! * caused the error or warning. ! * @param columnNumber The column number of the end of the text that ! * cause the error or warning. ! * @param e Another exception to embed in this one. ! * @see org.xml.sax.Parser#setLocale ! */ ! public SAXParseException (String message, String publicId, String systemId, ! int lineNumber, int columnNumber, Exception e) ! { ! super(message, e); ! init(publicId, systemId, lineNumber, columnNumber); ! } ! ! ! /** ! * Internal initialization method. ! * ! * @param publicId The public identifier of the entity which generated the exception, ! * or null. ! * @param systemId The system identifier of the entity which generated the exception, ! * or null. ! * @param lineNumber The line number of the error, or -1. ! * @param columnNumber The column number of the error, or -1. ! */ ! private void init (String publicId, String systemId, ! int lineNumber, int columnNumber) ! { ! this.publicId = publicId; ! this.systemId = systemId; ! this.lineNumber = lineNumber; ! this.columnNumber = columnNumber; ! } ! ! ! /** ! * Get the public identifier of the entity where the exception occurred. ! * ! * @return A string containing the public identifier, or null ! * if none is available. ! * @see org.xml.sax.Locator#getPublicId ! */ ! public String getPublicId () ! { ! return this.publicId; ! } ! ! ! /** ! * Get the system identifier of the entity where the exception occurred. ! * ! *

          If the system identifier is a URL, it will be resolved ! * fully.

          ! * ! * @return A string containing the system identifier, or null ! * if none is available. ! * @see org.xml.sax.Locator#getSystemId ! */ ! public String getSystemId () ! { ! return this.systemId; ! } ! ! ! /** ! * The line number of the end of the text where the exception occurred. ! * ! * @return An integer representing the line number, or -1 ! * if none is available. ! * @see org.xml.sax.Locator#getLineNumber ! */ ! public int getLineNumber () ! { ! return this.lineNumber; ! } ! ! ! /** ! * The column number of the end of the text where the exception occurred. ! * ! *

          The first column in a line is position 1.

          ! * ! * @return An integer representing the column number, or -1 ! * if none is available. ! * @see org.xml.sax.Locator#getColumnNumber ! */ ! public int getColumnNumber () ! { ! return this.columnNumber; ! } ! ! ! ! ////////////////////////////////////////////////////////////////////// ! // Internal state. ! ////////////////////////////////////////////////////////////////////// ! ! ! /** ! * @serial The public identifier, or null. ! * @see #getPublicId ! */ ! private String publicId; ! ! ! /** ! * @serial The system identifier, or null. ! * @see #getSystemId ! */ ! private String systemId; ! ! ! /** ! * @serial The line number, or -1. ! * @see #getLineNumber ! */ ! private int lineNumber; ! ! ! /** ! * @serial The column number, or -1. ! * @see #getColumnNumber ! */ ! private int columnNumber; ! ! } ! ! // end of SAXParseException.java --- 1,270 ---- ! // SAX exception class. ! // http://www.saxproject.org ! // No warranty; no copyright -- use this as you will. ! // $Id: SAXParseException.java,v 1.3.2.5 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! /** ! * Encapsulate an XML parse error or warning. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          This exception may include information for locating the error ! * in the original XML document, as if it came from a {@link Locator} ! * object. Note that although the application ! * will receive a SAXParseException as the argument to the handlers ! * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface, ! * the application is not actually required to throw the exception; ! * instead, it can simply read the information in it and take a ! * different action.

          ! * ! *

          Since this exception is a subclass of {@link org.xml.sax.SAXException ! * SAXException}, it inherits the ability to wrap another exception.

          ! * ! * @since SAX 1.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.SAXException ! * @see org.xml.sax.Locator ! * @see org.xml.sax.ErrorHandler ! */ ! public class SAXParseException extends SAXException { ! ! ! ////////////////////////////////////////////////////////////////////// ! // Constructors. ! ////////////////////////////////////////////////////////////////////// ! ! ! /** ! * Create a new SAXParseException from a message and a Locator. ! * ! *

          This constructor is especially useful when an application is ! * creating its own exception from within a {@link org.xml.sax.ContentHandler ! * ContentHandler} callback.

          ! * ! * @param message The error or warning message. ! * @param locator The locator object for the error or warning (may be ! * null). ! * @see org.xml.sax.Locator ! */ ! public SAXParseException (String message, Locator locator) { ! super(message); ! if (locator != null) { ! init(locator.getPublicId(), locator.getSystemId(), ! locator.getLineNumber(), locator.getColumnNumber()); ! } else { ! init(null, null, -1, -1); ! } ! } ! ! ! /** ! * Wrap an existing exception in a SAXParseException. ! * ! *

          This constructor is especially useful when an application is ! * creating its own exception from within a {@link org.xml.sax.ContentHandler ! * ContentHandler} callback, and needs to wrap an existing exception that is not a ! * subclass of {@link org.xml.sax.SAXException SAXException}.

          ! * ! * @param message The error or warning message, or null to ! * use the message from the embedded exception. ! * @param locator The locator object for the error or warning (may be ! * null). ! * @param e Any exception. ! * @see org.xml.sax.Locator ! */ ! public SAXParseException (String message, Locator locator, ! Exception e) { ! super(message, e); ! if (locator != null) { ! init(locator.getPublicId(), locator.getSystemId(), ! locator.getLineNumber(), locator.getColumnNumber()); ! } else { ! init(null, null, -1, -1); ! } ! } ! ! ! /** ! * Create a new SAXParseException. ! * ! *

          This constructor is most useful for parser writers.

          ! * ! *

          All parameters except the message are as if ! * they were provided by a {@link Locator}. For example, if the ! * system identifier is a URL (including relative filename), the ! * caller must resolve it fully before creating the exception.

          ! * ! * ! * @param message The error or warning message. ! * @param publicId The public identifer of the entity that generated ! * the error or warning. ! * @param systemId The system identifer of the entity that generated ! * the error or warning. ! * @param lineNumber The line number of the end of the text that ! * caused the error or warning. ! * @param columnNumber The column number of the end of the text that ! * cause the error or warning. ! */ ! public SAXParseException (String message, String publicId, String systemId, ! int lineNumber, int columnNumber) ! { ! super(message); ! init(publicId, systemId, lineNumber, columnNumber); ! } ! ! ! /** ! * Create a new SAXParseException with an embedded exception. ! * ! *

          This constructor is most useful for parser writers who ! * need to wrap an exception that is not a subclass of ! * {@link org.xml.sax.SAXException SAXException}.

          ! * ! *

          All parameters except the message and exception are as if ! * they were provided by a {@link Locator}. For example, if the ! * system identifier is a URL (including relative filename), the ! * caller must resolve it fully before creating the exception.

          ! * ! * @param message The error or warning message, or null to use ! * the message from the embedded exception. ! * @param publicId The public identifer of the entity that generated ! * the error or warning. ! * @param systemId The system identifer of the entity that generated ! * the error or warning. ! * @param lineNumber The line number of the end of the text that ! * caused the error or warning. ! * @param columnNumber The column number of the end of the text that ! * cause the error or warning. ! * @param e Another exception to embed in this one. ! */ ! public SAXParseException (String message, String publicId, String systemId, ! int lineNumber, int columnNumber, Exception e) ! { ! super(message, e); ! init(publicId, systemId, lineNumber, columnNumber); ! } ! ! ! /** ! * Internal initialization method. ! * ! * @param publicId The public identifier of the entity which generated the exception, ! * or null. ! * @param systemId The system identifier of the entity which generated the exception, ! * or null. ! * @param lineNumber The line number of the error, or -1. ! * @param columnNumber The column number of the error, or -1. ! */ ! private void init (String publicId, String systemId, ! int lineNumber, int columnNumber) ! { ! this.publicId = publicId; ! this.systemId = systemId; ! this.lineNumber = lineNumber; ! this.columnNumber = columnNumber; ! } ! ! ! /** ! * Get the public identifier of the entity where the exception occurred. ! * ! * @return A string containing the public identifier, or null ! * if none is available. ! * @see org.xml.sax.Locator#getPublicId ! */ ! public String getPublicId () ! { ! return this.publicId; ! } ! ! ! /** ! * Get the system identifier of the entity where the exception occurred. ! * ! *

          If the system identifier is a URL, it will have been resolved ! * fully.

          ! * ! * @return A string containing the system identifier, or null ! * if none is available. ! * @see org.xml.sax.Locator#getSystemId ! */ ! public String getSystemId () ! { ! return this.systemId; ! } ! ! ! /** ! * The line number of the end of the text where the exception occurred. ! * ! *

          The first line is line 1.

          ! * ! * @return An integer representing the line number, or -1 ! * if none is available. ! * @see org.xml.sax.Locator#getLineNumber ! */ ! public int getLineNumber () ! { ! return this.lineNumber; ! } ! ! ! /** ! * The column number of the end of the text where the exception occurred. ! * ! *

          The first column in a line is position 1.

          ! * ! * @return An integer representing the column number, or -1 ! * if none is available. ! * @see org.xml.sax.Locator#getColumnNumber ! */ ! public int getColumnNumber () ! { ! return this.columnNumber; ! } ! ! ! ! ////////////////////////////////////////////////////////////////////// ! // Internal state. ! ////////////////////////////////////////////////////////////////////// ! ! ! /** ! * @serial The public identifier, or null. ! * @see #getPublicId ! */ ! private String publicId; ! ! ! /** ! * @serial The system identifier, or null. ! * @see #getSystemId ! */ ! private String systemId; ! ! ! /** ! * @serial The line number, or -1. ! * @see #getLineNumber ! */ ! private int lineNumber; ! ! ! /** ! * @serial The column number, or -1. ! * @see #getColumnNumber ! */ ! private int columnNumber; ! ! } ! ! // end of SAXParseException.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/XMLFilter.java gcc-3.3/libjava/org/xml/sax/XMLFilter.java *** gcc-3.2.3/libjava/org/xml/sax/XMLFilter.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/XMLFilter.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,65 **** ! // XMLFilter.java - filter SAX2 events. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLFilter.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! ! package org.xml.sax; ! ! ! /** ! * Interface for an XML filter. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          An XML filter is like an XML reader, except that it obtains its ! * events from another XML reader rather than a primary source like ! * an XML document or database. Filters can modify a stream of ! * events as they pass on to the final application.

          ! * ! *

          The XMLFilterImpl helper class provides a convenient base ! * for creating SAX2 filters, by passing on all {@link org.xml.sax.EntityResolver ! * EntityResolver}, {@link org.xml.sax.DTDHandler DTDHandler}, ! * {@link org.xml.sax.ContentHandler ContentHandler} and {@link org.xml.sax.ErrorHandler ! * ErrorHandler} events automatically.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.helpers.XMLFilterImpl ! */ ! public interface XMLFilter extends XMLReader ! { ! ! /** ! * Set the parent reader. ! * ! *

          This method allows the application to link the filter to ! * a parent reader (which may be another filter). The argument ! * may not be null.

          ! * ! * @param parent The parent reader. ! */ ! public abstract void setParent (XMLReader parent); ! ! ! /** ! * Get the parent reader. ! * ! *

          This method allows the application to query the parent ! * reader (which may be another filter). It is generally a ! * bad idea to perform any operations on the parent reader ! * directly: they should all pass through this filter.

          ! * ! * @return The parent filter, or null if none has been set. ! */ ! public abstract XMLReader getParent (); ! ! } ! ! // end of XMLFilter.java --- 1,67 ---- ! // XMLFilter.java - filter SAX2 events. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLFilter.java,v 1.3.2.3 2002/01/29 21:34:14 dbrownell Exp $ ! ! ! package org.xml.sax; ! ! ! /** ! * Interface for an XML filter. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          An XML filter is like an XML reader, except that it obtains its ! * events from another XML reader rather than a primary source like ! * an XML document or database. Filters can modify a stream of ! * events as they pass on to the final application.

          ! * ! *

          The XMLFilterImpl helper class provides a convenient base ! * for creating SAX2 filters, by passing on all {@link org.xml.sax.EntityResolver ! * EntityResolver}, {@link org.xml.sax.DTDHandler DTDHandler}, ! * {@link org.xml.sax.ContentHandler ContentHandler} and {@link org.xml.sax.ErrorHandler ! * ErrorHandler} events automatically.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.helpers.XMLFilterImpl ! */ ! public interface XMLFilter extends XMLReader ! { ! ! /** ! * Set the parent reader. ! * ! *

          This method allows the application to link the filter to ! * a parent reader (which may be another filter). The argument ! * may not be null.

          ! * ! * @param parent The parent reader. ! */ ! public abstract void setParent (XMLReader parent); ! ! ! /** ! * Get the parent reader. ! * ! *

          This method allows the application to query the parent ! * reader (which may be another filter). It is generally a ! * bad idea to perform any operations on the parent reader ! * directly: they should all pass through this filter.

          ! * ! * @return The parent filter, or null if none has been set. ! */ ! public abstract XMLReader getParent (); ! ! } ! ! // end of XMLFilter.java diff -Nrc3pad gcc-3.2.3/libjava/org/xml/sax/XMLReader.java gcc-3.3/libjava/org/xml/sax/XMLReader.java *** gcc-3.2.3/libjava/org/xml/sax/XMLReader.java 2001-07-11 03:59:16.000000000 +0000 --- gcc-3.3/libjava/org/xml/sax/XMLReader.java 2002-12-20 03:50:17.000000000 +0000 *************** *** 1,415 **** ! // XMLReader.java - read an XML document. ! // Written by David Megginson, sax@megginson.com ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLReader.java,v 1.1 2000/10/02 02:43:17 sboag Exp $ ! ! package org.xml.sax; ! ! import java.io.IOException; ! ! ! /** ! * Interface for reading an XML document using callbacks. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! *
          ! * ! *

          Note: despite its name, this interface does ! * not extend the standard Java {@link java.io.Reader Reader} ! * interface, because reading XML is a fundamentally different activity ! * than reading character data.

          ! * ! *

          XMLReader is the interface that an XML parser's SAX2 driver must ! * implement. This interface allows an application to set and ! * query features and properties in the parser, to register ! * event handlers for document processing, and to initiate ! * a document parse.

          ! * ! *

          All SAX interfaces are assumed to be synchronous: the ! * {@link #parse parse} methods must not return until parsing ! * is complete, and readers must wait for an event-handler callback ! * to return before reporting the next event.

          ! * ! *

          This interface replaces the (now deprecated) SAX 1.0 {@link ! * org.xml.sax.Parser Parser} interface. The XMLReader interface ! * contains two important enhancements over the old Parser ! * interface:

          ! * ! *
            ! *
          1. it adds a standard way to query and set features and ! * properties; and
          2. ! *
          3. it adds Namespace support, which is required for many ! * higher-level XML standards.
          4. ! *
          ! * ! *

          There are adapters available to convert a SAX1 Parser to ! * a SAX2 XMLReader and vice-versa.

          ! * ! * @since SAX 2.0 ! * @author David Megginson, ! * sax@megginson.com ! * @version 2.0 ! * @see org.xml.sax.XMLFilter ! * @see org.xml.sax.helpers.ParserAdapter ! * @see org.xml.sax.helpers.XMLReaderAdapter ! */ ! public interface XMLReader ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Configuration. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Look up the value of a feature. ! * ! *

          The feature name is any fully-qualified URI. It is ! * possible for an XMLReader to recognize a feature name but ! * to be unable to return its value; this is especially true ! * in the case of an adapter for a SAX1 Parser, which has ! * no way of knowing whether the underlying parser is ! * performing validation or expanding external entities.

          ! * ! *

          All XMLReaders are required to recognize the ! * http://xml.org/sax/features/namespaces and the ! * http://xml.org/sax/features/namespace-prefixes feature names.

          ! * ! *

          Some feature values may be available only in specific ! * contexts, such as before, during, or after a parse.

          ! * ! *

          Typical usage is something like this:

          ! * ! *
          !      * XMLReader r = new MySAXDriver();
          !      *
          !      *                         // try to activate validation
          !      * try {
          !      *   r.setFeature("http://xml.org/sax/features/validation", true);
          !      * } catch (SAXException e) {
          !      *   System.err.println("Cannot activate validation."); 
          !      * }
          !      *
          !      *                         // register event handlers
          !      * r.setContentHandler(new MyContentHandler());
          !      * r.setErrorHandler(new MyErrorHandler());
          !      *
          !      *                         // parse the first document
          !      * try {
          !      *   r.parse("http://www.foo.com/mydoc.xml");
          !      * } catch (IOException e) {
          !      *   System.err.println("I/O exception reading XML document");
          !      * } catch (SAXException e) {
          !      *   System.err.println("XML exception reading document.");
          !      * }
          !      * 
          ! * ! *

          Implementors are free (and encouraged) to invent their own features, ! * using names built on their own URIs.

          ! * ! * @param name The feature name, which is a fully-qualified URI. ! * @return The current state of the feature (true or false). ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the feature name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the feature name but ! * cannot determine its value at this time. ! * @see #setFeature ! */ ! public boolean getFeature (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! /** ! * Set the state of a feature. ! * ! *

          The feature name is any fully-qualified URI. It is ! * possible for an XMLReader to recognize a feature name but ! * to be unable to set its value; this is especially true ! * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser Parser}, ! * which has no way of affecting whether the underlying parser is ! * validating, for example.

          ! * ! *

          All XMLReaders are required to support setting ! * http://xml.org/sax/features/namespaces to true and ! * http://xml.org/sax/features/namespace-prefixes to false.

          ! * ! *

          Some feature values may be immutable or mutable only ! * in specific contexts, such as before, during, or after ! * a parse.

          ! * ! * @param name The feature name, which is a fully-qualified URI. ! * @param state The requested state of the feature (true or false). ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the feature name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the feature name but ! * cannot set the requested value. ! * @see #getFeature ! */ ! public void setFeature (String name, boolean value) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! /** ! * Look up the value of a property. ! * ! *

          The property name is any fully-qualified URI. It is ! * possible for an XMLReader to recognize a property name but ! * to be unable to return its state; this is especially true ! * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser ! * Parser}.

          ! * ! *

          XMLReaders are not required to recognize any specific ! * property names, though an initial core set is documented for ! * SAX2.

          ! * ! *

          Some property values may be available only in specific ! * contexts, such as before, during, or after a parse.

          ! * ! *

          Implementors are free (and encouraged) to invent their own properties, ! * using names built on their own URIs.

          ! * ! * @param name The property name, which is a fully-qualified URI. ! * @return The current value of the property. ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the property name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the property name but ! * cannot determine its value at this time. ! * @see #setProperty ! */ ! public Object getProperty (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! /** ! * Set the value of a property. ! * ! *

          The property name is any fully-qualified URI. It is ! * possible for an XMLReader to recognize a property name but ! * to be unable to set its value; this is especially true ! * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser ! * Parser}.

          ! * ! *

          XMLReaders are not required to recognize setting ! * any specific property names, though a core set is provided with ! * SAX2.

          ! * ! *

          Some property values may be immutable or mutable only ! * in specific contexts, such as before, during, or after ! * a parse.

          ! * ! *

          This method is also the standard mechanism for setting ! * extended handlers.

          ! * ! * @param name The property name, which is a fully-qualified URI. ! * @param state The requested value for the property. ! * @exception org.xml.sax.SAXNotRecognizedException When the ! * XMLReader does not recognize the property name. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the property name but ! * cannot set the requested value. ! */ ! public void setProperty (String name, Object value) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Event handlers. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Allow an application to register an entity resolver. ! * ! *

          If the application does not register an entity resolver, ! * the XMLReader will perform its own default resolution.

          ! * ! *

          Applications may register a new or different resolver in the ! * middle of a parse, and the SAX parser must begin using the new ! * resolver immediately.

          ! * ! * @param resolver The entity resolver. ! * @exception java.lang.NullPointerException If the resolver ! * argument is null. ! * @see #getEntityResolver ! */ ! public void setEntityResolver (EntityResolver resolver); ! ! ! /** ! * Return the current entity resolver. ! * ! * @return The current entity resolver, or null if none ! * has been registered. ! * @see #setEntityResolver ! */ ! public EntityResolver getEntityResolver (); ! ! ! /** ! * Allow an application to register a DTD event handler. ! * ! *

          If the application does not register a DTD handler, all DTD ! * events reported by the SAX parser will be silently ignored.

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The DTD handler. ! * @exception java.lang.NullPointerException If the handler ! * argument is null. ! * @see #getDTDHandler ! */ ! public void setDTDHandler (DTDHandler handler); ! ! ! /** ! * Return the current DTD handler. ! * ! * @return The current DTD handler, or null if none ! * has been registered. ! * @see #setDTDHandler ! */ ! public DTDHandler getDTDHandler (); ! ! ! /** ! * Allow an application to register a content event handler. ! * ! *

          If the application does not register a content handler, all ! * content events reported by the SAX parser will be silently ! * ignored.

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The content handler. ! * @exception java.lang.NullPointerException If the handler ! * argument is null. ! * @see #getContentHandler ! */ ! public void setContentHandler (ContentHandler handler); ! ! ! /** ! * Return the current content handler. ! * ! * @return The current content handler, or null if none ! * has been registered. ! * @see #setContentHandler ! */ ! public ContentHandler getContentHandler (); ! ! ! /** ! * Allow an application to register an error event handler. ! * ! *

          If the application does not register an error handler, all ! * error events reported by the SAX parser will be silently ! * ignored; however, normal processing may not continue. It is ! * highly recommended that all SAX applications implement an ! * error handler to avoid unexpected bugs.

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The error handler. ! * @exception java.lang.NullPointerException If the handler ! * argument is null. ! * @see #getErrorHandler ! */ ! public void setErrorHandler (ErrorHandler handler); ! ! ! /** ! * Return the current error handler. ! * ! * @return The current error handler, or null if none ! * has been registered. ! * @see #setErrorHandler ! */ ! public ErrorHandler getErrorHandler (); ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Parsing. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Parse an XML document. ! * ! *

          The application can use this method to instruct the XML ! * reader to begin parsing an XML document from any valid input ! * source (a character stream, a byte stream, or a URI).

          ! * ! *

          Applications may not invoke this method while a parse is in ! * progress (they should create a new XMLReader instead for each ! * nested XML document). Once a parse is complete, an ! * application may reuse the same XMLReader object, possibly with a ! * different input source.

          ! * ! *

          During the parse, the XMLReader will provide information ! * about the XML document through the registered event ! * handlers.

          ! * ! *

          This method is synchronous: it will not return until parsing ! * has ended. If a client application wants to terminate ! * parsing early, it should throw an exception.

          ! * ! * @param source The input source for the top-level of the ! * XML document. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see org.xml.sax.InputSource ! * @see #parse(java.lang.String) ! * @see #setEntityResolver ! * @see #setDTDHandler ! * @see #setContentHandler ! * @see #setErrorHandler ! */ ! public void parse (InputSource input) ! throws IOException, SAXException; ! ! ! /** ! * Parse an XML document from a system identifier (URI). ! * ! *

          This method is a shortcut for the common case of reading a ! * document from a system identifier. It is the exact ! * equivalent of the following:

          ! * ! *
          !      * parse(new InputSource(systemId));
          !      * 
          ! * ! *

          If the system identifier is a URL, it must be fully resolved ! * by the application before it is passed to the parser.

          ! * ! * @param systemId The system identifier (URI). ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see #parse(org.xml.sax.InputSource) ! */ ! public void parse (String systemId) ! throws IOException, SAXException; ! ! } ! ! // end of XMLReader.java --- 1,398 ---- ! // XMLReader.java - read an XML document. ! // http://www.saxproject.org ! // Written by David Megginson ! // NO WARRANTY! This class is in the Public Domain. ! ! // $Id: XMLReader.java,v 1.3.2.5 2002/01/29 21:34:14 dbrownell Exp $ ! ! package org.xml.sax; ! ! import java.io.IOException; ! ! ! /** ! * Interface for reading an XML document using callbacks. ! * ! *
          ! * This module, both source code and documentation, is in the ! * Public Domain, and comes with NO WARRANTY. ! * See http://www.saxproject.org ! * for further information. ! *
          ! * ! *

          Note: despite its name, this interface does ! * not extend the standard Java {@link java.io.Reader Reader} ! * interface, because reading XML is a fundamentally different activity ! * than reading character data.

          ! * ! *

          XMLReader is the interface that an XML parser's SAX2 driver must ! * implement. This interface allows an application to set and ! * query features and properties in the parser, to register ! * event handlers for document processing, and to initiate ! * a document parse.

          ! * ! *

          All SAX interfaces are assumed to be synchronous: the ! * {@link #parse parse} methods must not return until parsing ! * is complete, and readers must wait for an event-handler callback ! * to return before reporting the next event.

          ! * ! *

          This interface replaces the (now deprecated) SAX 1.0 {@link ! * org.xml.sax.Parser Parser} interface. The XMLReader interface ! * contains two important enhancements over the old Parser ! * interface (as well as some minor ones):

          ! * ! *
            ! *
          1. it adds a standard way to query and set features and ! * properties; and
          2. ! *
          3. it adds Namespace support, which is required for many ! * higher-level XML standards.
          4. ! *
          ! * ! *

          There are adapters available to convert a SAX1 Parser to ! * a SAX2 XMLReader and vice-versa.

          ! * ! * @since SAX 2.0 ! * @author David Megginson ! * @version 2.0.1 (sax2r2) ! * @see org.xml.sax.XMLFilter ! * @see org.xml.sax.helpers.ParserAdapter ! * @see org.xml.sax.helpers.XMLReaderAdapter ! */ ! public interface XMLReader ! { ! ! ! //////////////////////////////////////////////////////////////////// ! // Configuration. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Look up the value of a feature flag. ! * ! *

          The feature name is any fully-qualified URI. It is ! * possible for an XMLReader to recognize a feature name but ! * temporarily be unable to return its value. ! * Some feature values may be available only in specific ! * contexts, such as before, during, or after a parse. ! * Also, some feature values may not be programmatically accessible. ! * (In the case of an adapter for SAX1 {@link Parser}, there is no ! * implementation-independent way to expose whether the underlying ! * parser is performing validation, expanding external entities, ! * and so forth.)

          ! * ! *

          All XMLReaders are required to recognize the ! * http://xml.org/sax/features/namespaces and the ! * http://xml.org/sax/features/namespace-prefixes feature names.

          ! * ! *

          Typical usage is something like this:

          ! * ! *
          !      * XMLReader r = new MySAXDriver();
          !      *
          !      *                         // try to activate validation
          !      * try {
          !      *   r.setFeature("http://xml.org/sax/features/validation", true);
          !      * } catch (SAXException e) {
          !      *   System.err.println("Cannot activate validation."); 
          !      * }
          !      *
          !      *                         // register event handlers
          !      * r.setContentHandler(new MyContentHandler());
          !      * r.setErrorHandler(new MyErrorHandler());
          !      *
          !      *                         // parse the first document
          !      * try {
          !      *   r.parse("http://www.foo.com/mydoc.xml");
          !      * } catch (IOException e) {
          !      *   System.err.println("I/O exception reading XML document");
          !      * } catch (SAXException e) {
          !      *   System.err.println("XML exception reading document.");
          !      * }
          !      * 
          ! * ! *

          Implementors are free (and encouraged) to invent their own features, ! * using names built on their own URIs.

          ! * ! * @param name The feature name, which is a fully-qualified URI. ! * @return The current value of the feature (true or false). ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * value can't be assigned or retrieved. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the feature name but ! * cannot determine its value at this time. ! * @see #setFeature ! */ ! public boolean getFeature (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! /** ! * Set the value of a feature flag. ! * ! *

          The feature name is any fully-qualified URI. It is ! * possible for an XMLReader to expose a feature value but ! * to be unable to change the current value. ! * Some feature values may be immutable or mutable only ! * in specific contexts, such as before, during, or after ! * a parse.

          ! * ! *

          All XMLReaders are required to support setting ! * http://xml.org/sax/features/namespaces to true and ! * http://xml.org/sax/features/namespace-prefixes to false.

          ! * ! * @param name The feature name, which is a fully-qualified URI. ! * @param value The requested value of the feature (true or false). ! * @exception org.xml.sax.SAXNotRecognizedException If the feature ! * value can't be assigned or retrieved. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the feature name but ! * cannot set the requested value. ! * @see #getFeature ! */ ! public void setFeature (String name, boolean value) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! /** ! * Look up the value of a property. ! * ! *

          The property name is any fully-qualified URI. It is ! * possible for an XMLReader to recognize a property name but ! * temporarily be unable to return its value. ! * Some property values may be available only in specific ! * contexts, such as before, during, or after a parse.

          ! * ! *

          XMLReaders are not required to recognize any specific ! * property names, though an initial core set is documented for ! * SAX2.

          ! * ! *

          Implementors are free (and encouraged) to invent their own properties, ! * using names built on their own URIs.

          ! * ! * @param name The property name, which is a fully-qualified URI. ! * @return The current value of the property. ! * @exception org.xml.sax.SAXNotRecognizedException If the property ! * value can't be assigned or retrieved. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the property name but ! * cannot determine its value at this time. ! * @see #setProperty ! */ ! public Object getProperty (String name) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! /** ! * Set the value of a property. ! * ! *

          The property name is any fully-qualified URI. It is ! * possible for an XMLReader to recognize a property name but ! * to be unable to change the current value. ! * Some property values may be immutable or mutable only ! * in specific contexts, such as before, during, or after ! * a parse.

          ! * ! *

          XMLReaders are not required to recognize setting ! * any specific property names, though a core set is defined by ! * SAX2.

          ! * ! *

          This method is also the standard mechanism for setting ! * extended handlers.

          ! * ! * @param name The property name, which is a fully-qualified URI. ! * @param value The requested value for the property. ! * @exception org.xml.sax.SAXNotRecognizedException If the property ! * value can't be assigned or retrieved. ! * @exception org.xml.sax.SAXNotSupportedException When the ! * XMLReader recognizes the property name but ! * cannot set the requested value. ! */ ! public void setProperty (String name, Object value) ! throws SAXNotRecognizedException, SAXNotSupportedException; ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Event handlers. ! //////////////////////////////////////////////////////////////////// ! ! ! /** ! * Allow an application to register an entity resolver. ! * ! *

          If the application does not register an entity resolver, ! * the XMLReader will perform its own default resolution.

          ! * ! *

          Applications may register a new or different resolver in the ! * middle of a parse, and the SAX parser must begin using the new ! * resolver immediately.

          ! * ! * @param resolver The entity resolver. ! * @see #getEntityResolver ! */ ! public void setEntityResolver (EntityResolver resolver); ! ! ! /** ! * Return the current entity resolver. ! * ! * @return The current entity resolver, or null if none ! * has been registered. ! * @see #setEntityResolver ! */ ! public EntityResolver getEntityResolver (); ! ! ! /** ! * Allow an application to register a DTD event handler. ! * ! *

          If the application does not register a DTD handler, all DTD ! * events reported by the SAX parser will be silently ignored.

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The DTD handler. ! * @see #getDTDHandler ! */ ! public void setDTDHandler (DTDHandler handler); ! ! ! /** ! * Return the current DTD handler. ! * ! * @return The current DTD handler, or null if none ! * has been registered. ! * @see #setDTDHandler ! */ ! public DTDHandler getDTDHandler (); ! ! ! /** ! * Allow an application to register a content event handler. ! * ! *

          If the application does not register a content handler, all ! * content events reported by the SAX parser will be silently ! * ignored.

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The content handler. ! * @see #getContentHandler ! */ ! public void setContentHandler (ContentHandler handler); ! ! ! /** ! * Return the current content handler. ! * ! * @return The current content handler, or null if none ! * has been registered. ! * @see #setContentHandler ! */ ! public ContentHandler getContentHandler (); ! ! ! /** ! * Allow an application to register an error event handler. ! * ! *

          If the application does not register an error handler, all ! * error events reported by the SAX parser will be silently ! * ignored; however, normal processing may not continue. It is ! * highly recommended that all SAX applications implement an ! * error handler to avoid unexpected bugs.

          ! * ! *

          Applications may register a new or different handler in the ! * middle of a parse, and the SAX parser must begin using the new ! * handler immediately.

          ! * ! * @param handler The error handler. ! * @see #getErrorHandler ! */ ! public void setErrorHandler (ErrorHandler handler); ! ! ! /** ! * Return the current error handler. ! * ! * @return The current error handler, or null if none ! * has been registered. ! * @see #setErrorHandler ! */ ! public ErrorHandler getErrorHandler (); ! ! ! ! //////////////////////////////////////////////////////////////////// ! // Parsing. ! //////////////////////////////////////////////////////////////////// ! ! /** ! * Parse an XML document. ! * ! *

          The application can use this method to instruct the XML ! * reader to begin parsing an XML document from any valid input ! * source (a character stream, a byte stream, or a URI).

          ! * ! *

          Applications may not invoke this method while a parse is in ! * progress (they should create a new XMLReader instead for each ! * nested XML document). Once a parse is complete, an ! * application may reuse the same XMLReader object, possibly with a ! * different input source.

          ! * ! *

          During the parse, the XMLReader will provide information ! * about the XML document through the registered event ! * handlers.

          ! * ! *

          This method is synchronous: it will not return until parsing ! * has ended. If a client application wants to terminate ! * parsing early, it should throw an exception.

          ! * ! * @param source The input source for the top-level of the ! * XML document. ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see org.xml.sax.InputSource ! * @see #parse(java.lang.String) ! * @see #setEntityResolver ! * @see #setDTDHandler ! * @see #setContentHandler ! * @see #setErrorHandler ! */ ! public void parse (InputSource input) ! throws IOException, SAXException; ! ! ! /** ! * Parse an XML document from a system identifier (URI). ! * ! *

          This method is a shortcut for the common case of reading a ! * document from a system identifier. It is the exact ! * equivalent of the following:

          ! * ! *
          !      * parse(new InputSource(systemId));
          !      * 
          ! * ! *

          If the system identifier is a URL, it must be fully resolved ! * by the application before it is passed to the parser.

          ! * ! * @param systemId The system identifier (URI). ! * @exception org.xml.sax.SAXException Any SAX exception, possibly ! * wrapping another exception. ! * @exception java.io.IOException An IO exception from the parser, ! * possibly from a byte stream or character stream ! * supplied by the application. ! * @see #parse(org.xml.sax.InputSource) ! */ ! public void parse (String systemId) ! throws IOException, SAXException; ! ! } diff -Nrc3pad gcc-3.2.3/libjava/posix.cc gcc-3.3/libjava/posix.cc *** gcc-3.2.3/libjava/posix.cc 2002-04-07 11:30:07.000000000 +0000 --- gcc-3.3/libjava/posix.cc 2003-04-25 16:02:21.000000000 +0000 *************** details. */ *** 25,30 **** --- 25,47 ---- extern "C" unsigned long long _clock (void); #endif + #if defined(HAVE_PROC_SELF_EXE) + static char exec_name[20]; + // initialized in _Jv_platform_initialize() + #endif + + const char *_Jv_ThisExecutable (void) + { + #if defined(DISABLE_MAIN_ARGS) + return "[Embedded App]"; + #elif defined(HAVE_PROC_SELF_EXE) + return exec_name; + // initialized in _Jv_platform_initialize() + #else + return _Jv_GetSafeArg (0); + #endif + } + // gettimeofday implementation. jlong _Jv_platform_gettimeofday () *************** _Jv_platform_initialize (void) *** 62,67 **** --- 79,89 ---- #else signal (SIGPIPE, SIG_IGN); #endif + + #if defined (HAVE_PROC_SELF_EXE) + // Compute our executable name + sprintf (exec_name, "/proc/%d/exe", getpid ()); + #endif } // Set platform-specific System properties. diff -Nrc3pad gcc-3.2.3/libjava/posix-threads.cc gcc-3.3/libjava/posix-threads.cc *** gcc-3.2.3/libjava/posix-threads.cc 2002-03-21 00:34:57.000000000 +0000 --- gcc-3.3/libjava/posix-threads.cc 2003-03-02 01:26:20.000000000 +0000 *************** details. */ *** 24,29 **** --- 24,32 ---- #include #include #include + #ifdef HAVE_UNISTD_H + #include // To test for _POSIX_THREAD_PRIORITY_SCHEDULING + #endif #include #include *************** _Jv_ThreadDestroyData (_Jv_Thread_t *dat *** 318,323 **** --- 321,327 ---- void _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio) { + #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING if (data->flags & FLAG_START) { struct sched_param param; *************** _Jv_ThreadSetPriority (_Jv_Thread_t *dat *** 325,330 **** --- 329,335 ---- param.sched_priority = prio; pthread_setschedparam (data->thread, SCHED_RR, ¶m); } + #endif } void diff -Nrc3pad gcc-3.2.3/libjava/prims.cc gcc-3.3/libjava/prims.cc *** gcc-3.2.3/libjava/prims.cc 2002-03-10 03:30:48.000000000 +0000 --- gcc-3.3/libjava/prims.cc 2003-04-25 16:02:21.000000000 +0000 *************** details. */ *** 53,58 **** --- 53,59 ---- #include #include #include + #include #include #include #include *************** const char *_Jv_Jar_Class_Path; *** 85,97 **** property_pair *_Jv_Environment_Properties; #endif - // The name of this executable. - static char *_Jv_execName; - // Stash the argv pointer to benefit native libraries that need it. const char **_Jv_argv; int _Jv_argc; #ifdef ENABLE_JVMPI // Pointer to JVMPI notification functions. void (*_Jv_JVMPI_Notify_OBJECT_ALLOC) (JVMPI_Event *event); --- 86,119 ---- property_pair *_Jv_Environment_Properties; #endif // Stash the argv pointer to benefit native libraries that need it. const char **_Jv_argv; int _Jv_argc; + // Argument support. + int + _Jv_GetNbArgs (void) + { + // _Jv_argc is 0 if not explicitly initialized. + return _Jv_argc; + } + + const char * + _Jv_GetSafeArg (int index) + { + if (index >=0 && index < _Jv_GetNbArgs ()) + return _Jv_argv[index]; + else + return ""; + } + + void + _Jv_SetArgs (int argc, const char **argv) + { + _Jv_argc = argc; + _Jv_argv = argv; + } + #ifdef ENABLE_JVMPI // Pointer to JVMPI notification functions. void (*_Jv_JVMPI_Notify_OBJECT_ALLOC) (JVMPI_Event *event); *************** _Jv_AllocObject (jclass klass, jint size *** 396,402 **** // if there really is an interesting finalizer. // Unfortunately, we still have to the dynamic test, since there may // be cni calls to this routine. ! // Nore that on IA64 get_finalizer() returns the starting address of the // function, not a function pointer. Thus this still works. if (klass->vtable->get_finalizer () != java::lang::Object::class$.vtable->get_finalizer ()) --- 418,424 ---- // if there really is an interesting finalizer. // Unfortunately, we still have to the dynamic test, since there may // be cni calls to this routine. ! // Note that on IA64 get_finalizer() returns the starting address of the // function, not a function pointer. Thus this still works. if (klass->vtable->get_finalizer () != java::lang::Object::class$.vtable->get_finalizer ()) *************** _Jv_NewObjectArray (jsize count, jclass *** 457,464 **** size_t size = (size_t) elements (obj); size += count * sizeof (jobject); ! // FIXME: second argument should be "current loader" ! jclass klass = _Jv_GetArrayClass (elementClass, 0); obj = (jobjectArray) _Jv_AllocArray (size, klass); // Cast away const. --- 479,486 ---- size_t size = (size_t) elements (obj); size += count * sizeof (jobject); ! jclass klass = _Jv_GetArrayClass (elementClass, ! elementClass->getClassLoaderInternal()); obj = (jobjectArray) _Jv_AllocArray (size, klass); // Cast away const. *************** _Jv_FindClassFromSignature (char *sig, j *** 656,662 **** ; _Jv_Utf8Const *name = _Jv_makeUtf8Const (&sig[1], i - 1); return _Jv_FindClass (name, loader); - } case '[': { --- 678,683 ---- *************** static JArray *arg_vec; *** 707,728 **** // The primary thread. static java::lang::Thread *main_thread; - char * - _Jv_ThisExecutable (void) - { - return _Jv_execName; - } - - void - _Jv_ThisExecutable (const char *name) - { - if (name) - { - _Jv_execName = (char *) _Jv_Malloc (strlen (name) + 1); - strcpy (_Jv_execName, name); - } - } - #ifndef DISABLE_GETENV_PROPERTIES static char * --- 728,733 ---- *************** _Jv_CreateJavaVM (void* /*vm_args*/) *** 910,917 **** _Jv_InitPrimClass (&_Jv_voidClass, "void", 'V', 0, &_Jv_voidVTable); // Turn stack trace generation off while creating exception objects. ! _Jv_InitClass (&java::lang::Throwable::class$); ! java::lang::Throwable::trace_enabled = 0; INIT_SEGV; #ifdef HANDLE_FPE --- 915,922 ---- _Jv_InitPrimClass (&_Jv_voidClass, "void", 'V', 0, &_Jv_voidVTable); // Turn stack trace generation off while creating exception objects. ! _Jv_InitClass (&java::lang::VMThrowable::class$); ! java::lang::VMThrowable::trace_enabled = 0; INIT_SEGV; #ifdef HANDLE_FPE *************** _Jv_CreateJavaVM (void* /*vm_args*/) *** 920,930 **** arithexception = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero")); #endif ! no_memory = new java::lang::OutOfMemoryError; ! ! java::lang::Throwable::trace_enabled = 1; ! #ifdef USE_LTDL LTDL_SET_PRELOADED_SYMBOLS (); #endif --- 925,935 ---- arithexception = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero")); #endif ! no_memory = new java::lang::OutOfMemoryError; ! ! java::lang::VMThrowable::trace_enabled = 1; ! #ifdef USE_LTDL LTDL_SET_PRELOADED_SYMBOLS (); #endif *************** void *** 955,978 **** _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar) { ! _Jv_argv = argv; ! _Jv_argc = argc; java::lang::Runtime *runtime = NULL; - - #ifdef DISABLE_MAIN_ARGS - _Jv_ThisExecutable ("[Embedded App]"); - #else - #ifdef HAVE_PROC_SELF_EXE - char exec_name[20]; - sprintf (exec_name, "/proc/%d/exe", getpid ()); - _Jv_ThisExecutable (exec_name); - #else - _Jv_ThisExecutable (argv[0]); - #endif /* HAVE_PROC_SELF_EXE */ - #endif /* DISABLE_MAIN_ARGS */ - try { // Set this very early so that it is seen when java.lang.System --- 960,969 ---- _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar) { ! _Jv_SetArgs (argc, argv); java::lang::Runtime *runtime = NULL; try { // Set this very early so that it is seen when java.lang.System diff -Nrc3pad gcc-3.2.3/libjava/resolve.cc gcc-3.3/libjava/resolve.cc *** gcc-3.2.3/libjava/resolve.cc 2002-01-08 20:51:45.000000000 +0000 --- gcc-3.3/libjava/resolve.cc 2003-02-03 21:04:50.000000000 +0000 *************** *** 1,6 **** // resolve.cc - Code for linking and resolving classes and pool entries. ! /* Copyright (C) 1999, 2000, 2001 , 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // resolve.cc - Code for linking and resolving classes and pool entries. ! /* Copyright (C) 1999, 2000, 2001 , 2002, 2003 Free Software Foundation This file is part of libgcj. *************** details. */ *** 20,25 **** --- 20,26 ---- #include #include #include + #include #include #include #include *************** details. */ *** 28,34 **** #include #include #include ! #include #include #include --- 29,35 ---- #include #include #include ! #include #include #include *************** static void throw_class_format_error (js *** 54,63 **** static void throw_class_format_error (char *msg) __attribute__ ((__noreturn__)); - // Exceptional return values for _Jv_DetermineVTableIndex - #define METHOD_NOT_THERE (-2) - #define METHOD_INACCESSIBLE (-1) - static int get_alignment_from_class (jclass); static _Jv_ResolvedMethod* --- 55,60 ---- *************** _Jv_ResolvePoolEntry (jclass klass, int *** 97,103 **** if (! found) { jstring str = _Jv_NewStringUTF (name->data); ! throw new java::lang::ClassNotFoundException (str); } if ((found->accflags & Modifier::PUBLIC) == Modifier::PUBLIC --- 94,101 ---- if (! found) { jstring str = _Jv_NewStringUTF (name->data); ! // This exception is specified in JLS 2nd Ed, section 5.1. ! throw new java::lang::NoClassDefFoundError (str); } if ((found->accflags & Modifier::PUBLIC) == Modifier::PUBLIC *************** _Jv_ResolvePoolEntry (jclass klass, int *** 201,212 **** end_of_field_search: if (the_field == 0) { ! jstring msg = JvNewStringLatin1 ("field "); ! msg = msg->concat (owner->getName ()); ! msg = msg->concat (JvNewStringLatin1(".")); ! msg = msg->concat (_Jv_NewStringUTF (field_name->data)); ! msg = msg->concat (JvNewStringLatin1(" was not found.")); ! throw_incompatible_class_change_error (msg); } pool->data[index].field = the_field; --- 199,211 ---- end_of_field_search: if (the_field == 0) { ! java::lang::StringBuffer *sb = new java::lang::StringBuffer(); ! sb->append(JvNewStringLatin1("field ")); ! sb->append(owner->getName()); ! sb->append(JvNewStringLatin1(".")); ! sb->append(_Jv_NewStringUTF(field_name->data)); ! sb->append(JvNewStringLatin1(" was not found.")); ! throw_incompatible_class_change_error(sb->toString()); } pool->data[index].field = the_field; *************** _Jv_ResolvePoolEntry (jclass klass, int *** 234,246 **** _Jv_Utf8Const *method_name = pool->data[name_index].utf8; _Jv_Utf8Const *method_signature = pool->data[type_index].utf8; - int vtable_index = -1; _Jv_Method *the_method = 0; jclass found_class = 0; // First search the class itself. the_method = _Jv_SearchMethodInClass (owner, klass, ! method_name, method_signature); if (the_method != 0) { --- 233,244 ---- _Jv_Utf8Const *method_name = pool->data[name_index].utf8; _Jv_Utf8Const *method_signature = pool->data[type_index].utf8; _Jv_Method *the_method = 0; jclass found_class = 0; // First search the class itself. the_method = _Jv_SearchMethodInClass (owner, klass, ! method_name, method_signature); if (the_method != 0) { *************** _Jv_ResolvePoolEntry (jclass klass, int *** 248,256 **** goto end_of_method_search; } ! // If we are resolving an interface method, search the interface's ! // superinterfaces (A superinterface is not an interface's superclass - ! // a superinterface is implemented by the interface). if (pool->tags[index] == JV_CONSTANT_InterfaceMethodref) { _Jv_ifaces ifaces; --- 246,255 ---- goto end_of_method_search; } ! // If we are resolving an interface method, search the ! // interface's superinterfaces (A superinterface is not an ! // interface's superclass - a superinterface is implemented by ! // the interface). if (pool->tags[index] == JV_CONSTANT_InterfaceMethodref) { _Jv_ifaces ifaces; *************** _Jv_ResolvePoolEntry (jclass klass, int *** 259,266 **** ifaces.list = (jclass *) _Jv_Malloc (ifaces.len * sizeof (jclass *)); _Jv_GetInterfaces (owner, &ifaces); ! ! for (int i=0; i < ifaces.count; i++) { jclass cls = ifaces.list[i]; the_method = _Jv_SearchMethodInClass (cls, klass, method_name, --- 258,265 ---- ifaces.list = (jclass *) _Jv_Malloc (ifaces.len * sizeof (jclass *)); _Jv_GetInterfaces (owner, &ifaces); ! ! for (int i = 0; i < ifaces.count; i++) { jclass cls = ifaces.list[i]; the_method = _Jv_SearchMethodInClass (cls, klass, method_name, *************** _Jv_ResolvePoolEntry (jclass klass, int *** 271,279 **** break; } } ! _Jv_Free (ifaces.list); ! if (the_method != 0) goto end_of_method_search; } --- 270,278 ---- break; } } ! _Jv_Free (ifaces.list); ! if (the_method != 0) goto end_of_method_search; } *************** _Jv_ResolvePoolEntry (jclass klass, int *** 283,289 **** cls = cls->getSuperclass ()) { the_method = _Jv_SearchMethodInClass (cls, klass, ! method_name, method_signature); if (the_method != 0) { found_class = cls; --- 282,288 ---- cls = cls->getSuperclass ()) { the_method = _Jv_SearchMethodInClass (cls, klass, ! method_name, method_signature); if (the_method != 0) { found_class = cls; *************** _Jv_ResolvePoolEntry (jclass klass, int *** 300,325 **** // with either loader should produce the same result, // i.e., exactly the same jclass object. JVMS 5.4.3.3 - if (pool->tags[index] == JV_CONSTANT_InterfaceMethodref) - vtable_index = -1; - else - vtable_index = _Jv_DetermineVTableIndex - (found_class, method_name, method_signature); - - if (vtable_index == METHOD_NOT_THERE) - throw_incompatible_class_change_error - (JvNewStringLatin1 ("method not found")); - if (the_method == 0) { ! jstring msg = JvNewStringLatin1 ("method "); ! msg = msg->concat (owner->getName ()); ! msg = msg->concat (JvNewStringLatin1(".")); ! msg = msg->concat (_Jv_NewStringUTF (method_name->data)); ! msg = msg->concat (JvNewStringLatin1(" was not found.")); ! throw new java::lang::NoSuchMethodError (msg); } pool->data[index].rmethod = _Jv_BuildResolvedMethod(the_method, found_class, --- 299,319 ---- // with either loader should produce the same result, // i.e., exactly the same jclass object. JVMS 5.4.3.3 if (the_method == 0) { ! java::lang::StringBuffer *sb = new java::lang::StringBuffer(); ! sb->append(JvNewStringLatin1("method ")); ! sb->append(owner->getName()); ! sb->append(JvNewStringLatin1(".")); ! sb->append(_Jv_NewStringUTF(method_name->data)); ! sb->append(JvNewStringLatin1(" was not found.")); ! throw new java::lang::NoSuchMethodError (sb->toString()); } + int vtable_index = -1; + if (pool->tags[index] != JV_CONSTANT_InterfaceMethodref) + vtable_index = (jshort)the_method->index; + pool->data[index].rmethod = _Jv_BuildResolvedMethod(the_method, found_class, *************** _Jv_SearchMethodInClass (jclass cls, jcl *** 370,490 **** return 0; } ! /** FIXME: this is a terribly inefficient algorithm! It would improve ! things if compiled classes to know vtable offset, and _Jv_Method had ! a field for this. ! ! Returns METHOD_NOT_THERE if this class does not declare the given method. ! Returns METHOD_INACCESSIBLE if the given method does not appear in the ! vtable, i.e., it is static, private, final or a constructor. ! Otherwise, returns the vtable index. */ ! int ! _Jv_DetermineVTableIndex (jclass klass, ! _Jv_Utf8Const *name, ! _Jv_Utf8Const *signature) { ! using namespace java::lang::reflect; ! ! jclass super_class = klass->getSuperclass (); ! ! if (super_class != NULL) ! { ! int prev = _Jv_DetermineVTableIndex (super_class, ! name, ! signature); ! if (prev != METHOD_NOT_THERE) ! return prev; ! } ! ! /* at this point, we know that the super-class does not declare ! * the method. Otherwise, the above call would have found it, and ! * determined the result of this function (-1 or some positive ! * number). ! */ ! ! _Jv_Method *meth = _Jv_GetMethodLocal (klass, name, signature); ! ! /* now, if we do not declare this method, return zero */ ! if (meth == NULL) ! return METHOD_NOT_THERE; ! ! /* so now, we know not only that the super class does not declare the ! * method, but we do! So, this is a first declaration of the method. */ ! ! /* now, the checks for things that are declared in this class, but do ! * not go into the vtable. There are three cases. ! * 1) the method is static, private or final ! * 2) the class itself is final, or ! * 3) it is the method ! */ ! ! if ((meth->accflags & (Modifier::STATIC ! | Modifier::PRIVATE ! | Modifier::FINAL)) != 0 ! || (klass->accflags & Modifier::FINAL) != 0 ! || _Jv_equalUtf8Consts (name, init_name)) ! return METHOD_INACCESSIBLE; ! ! /* reaching this point, we know for sure, that the method in question ! * will be in the vtable. The question is where. */ ! ! /* the base offset, is where we will start assigning vtable ! * indexes for this class. It is 0 for base classes ! * and for non-base classes it is the ! * number of entries in the super class' vtable. */ ! ! int base_offset; ! if (super_class == 0) ! base_offset = 0; ! else ! base_offset = super_class->vtable_method_count; ! ! /* we will consider methods 0..this_method_index-1. And for each one, ! * determine if it is new (i.e., if it appears in the super class), ! * and if it should go in the vtable. If so, increment base_offset */ ! ! int this_method_index = meth - (&klass->methods[0]); ! ! for (int i = 0; i < this_method_index; i++) { ! _Jv_Method *m = &klass->methods[i]; ! /* fist some checks for things that surely do not go in the ! * vtable */ ! if ((m->accflags & (Modifier::STATIC | Modifier::PRIVATE)) != 0) ! continue; ! if (_Jv_equalUtf8Consts (m->name, init_name)) ! continue; ! ! /* Then, we need to know if this method appears in the ! superclass. (This is where this function gets expensive) */ ! _Jv_Method *sm = _Jv_LookupDeclaredMethod (super_class, ! m->name, ! m->signature); ! ! /* if it was somehow declared in the superclass, skip this */ ! if (sm != NULL) ! continue; ! /* but if it is final, and not declared in the super class, ! * then we also skip it */ ! if ((m->accflags & Modifier::FINAL) != 0) ! continue; ! /* finally, we can assign the index of this method */ ! /* m->vtable_index = base_offset */ ! base_offset += 1; } - - return base_offset; - } - - /* this is installed in place of abstract methods */ - static void - _Jv_abstractMethodError () - { - throw new java::lang::AbstractMethodError; } void --- 364,419 ---- return 0; } ! // A helper for _Jv_PrepareClass. This adds missing `Miranda methods' ! // to a class. ! void ! _Jv_PrepareMissingMethods (jclass base2, jclass iface_class) { ! _Jv_InterpClass *base = reinterpret_cast<_Jv_InterpClass *> (base2); ! for (int i = 0; i < iface_class->interface_count; ++i) { ! for (int j = 0; j < iface_class->interfaces[i]->method_count; ++j) ! { ! _Jv_Method *meth = &iface_class->interfaces[i]->methods[j]; ! // Don't bother with . ! if (meth->name->data[0] == '<') ! continue; ! _Jv_Method *new_meth = _Jv_LookupDeclaredMethod (base, meth->name, ! meth->signature); ! if (! new_meth) ! { ! // We assume that such methods are very unlikely, so we ! // just reallocate the method array each time one is ! // found. This greatly simplifies the searching -- ! // otherwise we have to make sure that each such method ! // found is really unique among all superinterfaces. ! int new_count = base->method_count + 1; ! _Jv_Method *new_m ! = (_Jv_Method *) _Jv_AllocBytes (sizeof (_Jv_Method) ! * new_count); ! memcpy (new_m, base->methods, ! sizeof (_Jv_Method) * base->method_count); ! // Add new method. ! new_m[base->method_count] = *meth; ! new_m[base->method_count].index = (_Jv_ushort) -1; ! new_m[base->method_count].accflags ! |= java::lang::reflect::Modifier::INVISIBLE; ! _Jv_MethodBase **new_im ! = (_Jv_MethodBase **) _Jv_AllocBytes (sizeof (_Jv_MethodBase *) ! * new_count); ! memcpy (new_im, base->interpreted_methods, ! sizeof (_Jv_MethodBase *) * base->method_count); ! base->methods = new_m; ! base->interpreted_methods = new_im; ! base->method_count = new_count; ! } ! } ! _Jv_PrepareMissingMethods (base, iface_class->interfaces[i]); } } void *************** _Jv_PrepareClass(jclass klass) *** 516,526 **** if (klass->state >= JV_STATE_PREPARED) return; ! // make sure super-class is linked. This involves taking a lock on ! // the super class, so we use the Java method resolveClass, which will ! // unlock it properly, should an exception happen. ! java::lang::ClassLoader::resolveClass0 (klass->superclass); _Jv_InterpClass *clz = (_Jv_InterpClass*)klass; --- 445,458 ---- if (klass->state >= JV_STATE_PREPARED) return; ! // Make sure super-class is linked. This involves taking a lock on ! // the super class, so we use the Java method resolveClass, which ! // will unlock it properly, should an exception happen. If there's ! // no superclass, do nothing -- Object will already have been ! // resolved. ! if (klass->superclass) ! java::lang::ClassLoader::resolveClass0 (klass->superclass); _Jv_InterpClass *clz = (_Jv_InterpClass*)klass; *************** _Jv_PrepareClass(jclass klass) *** 529,536 **** int instance_size; int static_size; ! // java.lang.Object is never interpreted! ! instance_size = clz->superclass->size (); static_size = 0; for (int i = 0; i < clz->field_count; i++) --- 461,472 ---- int instance_size; int static_size; ! // Although java.lang.Object is never interpreted, an interface can ! // have a null superclass. ! if (clz->superclass) ! instance_size = clz->superclass->size(); ! else ! instance_size = java::lang::Object::class$.size(); static_size = 0; for (int i = 0; i < clz->field_count; i++) *************** _Jv_PrepareClass(jclass klass) *** 633,745 **** } } ! if (clz->accflags & Modifier::INTERFACE) { clz->state = JV_STATE_PREPARED; clz->notifyAll (); return; } ! /* Now onto the actual job: vtable layout. First, count how many new ! methods we have */ ! int new_method_count = 0; ! ! jclass super_class = clz->getSuperclass (); ! ! if (super_class == 0) ! throw_internal_error ("cannot handle interpreted base classes"); ! ! for (int i = 0; i < clz->method_count; i++) ! { ! _Jv_Method *this_meth = &clz->methods[i]; ! ! if ((this_meth->accflags & (Modifier::STATIC | Modifier::PRIVATE)) != 0 ! || _Jv_equalUtf8Consts (this_meth->name, init_name)) ! { ! /* skip this, it doesn't go in the vtable */ ! continue; ! } ! ! _Jv_Method *orig_meth = _Jv_LookupDeclaredMethod (super_class, ! this_meth->name, ! this_meth->signature); ! ! if (orig_meth == 0) ! { ! // new methods that are final, also don't go in the vtable ! if ((this_meth->accflags & Modifier::FINAL) != 0) ! continue; ! ! new_method_count += 1; ! continue; ! } ! ! if ((orig_meth->accflags & (Modifier::STATIC ! | Modifier::PRIVATE ! | Modifier::FINAL)) != 0 ! || ((orig_meth->accflags & Modifier::ABSTRACT) == 0 ! && (this_meth->accflags & Modifier::ABSTRACT) != 0 ! && (klass->accflags & Modifier::ABSTRACT) == 0)) ! { ! clz->state = JV_STATE_ERROR; ! clz->notifyAll (); ! throw new java::lang::IncompatibleClassChangeError (clz->getName ()); ! } ! ! /* FIXME: At this point, if (loader != super_class->loader), we ! * need to "impose class loader constraints" for the types ! * involved in the signature of this method */ ! } ! ! /* determine size */ ! int vtable_count = (super_class->vtable_method_count) + new_method_count; ! clz->vtable_method_count = vtable_count; ! ! /* allocate vtable structure */ ! _Jv_VTable *vtable = _Jv_VTable::new_vtable (vtable_count); ! vtable->clas = clz; ! vtable->gc_descr = _Jv_BuildGCDescr(clz); ! ! { ! jclass effective_superclass = super_class; ! ! /* If super_class is abstract or an interface it has no vtable. ! We need to find a real one... */ ! while (effective_superclass && effective_superclass->vtable == NULL) ! effective_superclass = effective_superclass->superclass; ! ! /* copy super class' vtable entries. */ ! if (effective_superclass && effective_superclass->vtable) ! for (int i = 0; i < effective_superclass->vtable_method_count; ++i) ! vtable->set_method (i, effective_superclass->vtable->get_method (i)); ! } ! ! /* now, install our own vtable entries, reprise... */ ! for (int i = 0; i < clz->method_count; i++) ! { ! _Jv_Method *this_meth = &clz->methods[i]; ! ! int index = _Jv_DetermineVTableIndex (clz, ! this_meth->name, ! this_meth->signature); ! ! if (index == METHOD_NOT_THERE) ! throw_internal_error ("method now found in own class"); ! ! if (index != METHOD_INACCESSIBLE) ! { ! if (index > clz->vtable_method_count) ! throw_internal_error ("vtable problem..."); ! ! if (clz->interpreted_methods[i] == 0) ! vtable->set_method(index, (void*)&_Jv_abstractMethodError); ! else ! vtable->set_method(index, this_meth->ncode); ! } ! } ! /* finally, assign the vtable! */ ! clz->vtable = vtable; /* wooha! we're done. */ clz->state = JV_STATE_PREPARED; --- 569,594 ---- } } ! if ((clz->accflags & Modifier::INTERFACE)) { clz->state = JV_STATE_PREPARED; clz->notifyAll (); return; } ! // A class might have so-called "Miranda methods". This is a method ! // that is declared in an interface and not re-declared in an ! // abstract class. Some compilers don't emit declarations for such ! // methods in the class; this will give us problems since we expect ! // a declaration for any method requiring a vtable entry. We handle ! // this here by searching for such methods and constructing new ! // internal declarations for them. We only need to do this for ! // abstract classes. ! if ((clz->accflags & Modifier::ABSTRACT)) ! _Jv_PrepareMissingMethods (clz, clz); ! clz->vtable_method_count = -1; ! _Jv_MakeVTable (clz); /* wooha! we're done. */ clz->state = JV_STATE_PREPARED; *************** _Jv_JNIMethod::ncode () *** 1152,1158 **** memcpy (&jni_arg_types[offset], &closure->arg_types[0], arg_count * sizeof (ffi_type *)); ! if (ffi_prep_cif (&jni_cif, FFI_DEFAULT_ABI, extra_args + arg_count, rtype, jni_arg_types) != FFI_OK) throw_internal_error ("ffi_prep_cif failed for JNI function"); --- 1001,1014 ---- memcpy (&jni_arg_types[offset], &closure->arg_types[0], arg_count * sizeof (ffi_type *)); ! // NOTE: This must agree with the JNICALL definition in jni.h ! #ifdef WIN32 ! #define FFI_JNI_ABI FFI_STDCALL ! #else ! #define FFI_JNI_ABI FFI_DEFAULT_ABI ! #endif ! ! if (ffi_prep_cif (&jni_cif, FFI_JNI_ABI, extra_args + arg_count, rtype, jni_arg_types) != FFI_OK) throw_internal_error ("ffi_prep_cif failed for JNI function"); diff -Nrc3pad gcc-3.2.3/libjava/sysdep/powerpc/locks.h gcc-3.3/libjava/sysdep/powerpc/locks.h *** gcc-3.2.3/libjava/sysdep/powerpc/locks.h 2002-03-21 00:34:57.000000000 +0000 --- gcc-3.3/libjava/sysdep/powerpc/locks.h 2002-07-29 23:26:27.000000000 +0000 *************** details. */ *** 11,36 **** #ifndef __SYSDEP_LOCKS_H__ #define __SYSDEP_LOCKS_H__ typedef size_t obj_addr_t; /* Integer type big enough for object */ /* address. */ inline static bool ! compare_and_swap(volatile obj_addr_t *addr, ! obj_addr_t old, ! obj_addr_t new_val) { int ret; __asm__ __volatile__ ( ! "0: lwarx %0,0,%1 ;" " xor. %0,%3,%0;" " bne 1f;" ! " stwcx. %2,0,%1;" " bne- 0b;" "1: " ! : "=&r"(ret) ! : "r"(addr), "r"(new_val), "r"(old) : "cr0", "memory"); /* This version of __compare_and_swap is to be used when acquiring a lock, so we don't need to worry about whether other memory operations have completed, but we do need to be sure that any loads --- 11,48 ---- #ifndef __SYSDEP_LOCKS_H__ #define __SYSDEP_LOCKS_H__ + #ifdef __powerpc64__ + #define _LARX "ldarx " + #define _STCX "stdcx. " + #else + #define _LARX "lwarx " + #ifdef __PPC405__ + #define _STCX "sync; stwcx. " + #else + #define _STCX "stwcx. " + #endif + #endif + typedef size_t obj_addr_t; /* Integer type big enough for object */ /* address. */ inline static bool ! compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old, ! obj_addr_t new_val) { int ret; __asm__ __volatile__ ( ! "0: " _LARX "%0,0,%1 ;" " xor. %0,%3,%0;" " bne 1f;" ! " " _STCX "%2,0,%1;" " bne- 0b;" "1: " ! : "=&r" (ret) ! : "r" (addr), "r" (new_val), "r" (old) : "cr0", "memory"); + /* This version of __compare_and_swap is to be used when acquiring a lock, so we don't need to worry about whether other memory operations have completed, but we do need to be sure that any loads *************** compare_and_swap(volatile obj_addr_t *ad *** 40,76 **** } inline static void ! release_set(volatile obj_addr_t *addr, obj_addr_t new_val) { __asm__ __volatile__ ("sync" : : : "memory"); ! *(addr) = new_val; } inline static bool ! compare_and_swap_release(volatile obj_addr_t *addr, ! obj_addr_t old, ! obj_addr_t new_val) { int ret; __asm__ __volatile__ ("sync" : : : "memory"); __asm__ __volatile__ ( ! "0: lwarx %0,0,%1 ;" " xor. %0,%3,%0;" " bne 1f;" ! " stwcx. %2,0,%1;" " bne- 0b;" "1: " ! : "=&r"(ret) ! : "r"(addr), "r"(new_val), "r"(old) : "cr0", "memory"); return ret == 0; } // Ensure that subsequent instructions do not execute on stale // data that was loaded from memory before the barrier. inline static void ! read_barrier() { __asm__ __volatile__ ("isync" : : : "memory"); } --- 52,89 ---- } inline static void ! release_set (volatile obj_addr_t *addr, obj_addr_t new_val) { __asm__ __volatile__ ("sync" : : : "memory"); ! *addr = new_val; } inline static bool ! compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old, ! obj_addr_t new_val) { int ret; __asm__ __volatile__ ("sync" : : : "memory"); + __asm__ __volatile__ ( ! "0: " _LARX "%0,0,%1 ;" " xor. %0,%3,%0;" " bne 1f;" ! " " _STCX "%2,0,%1;" " bne- 0b;" "1: " ! : "=&r" (ret) ! : "r" (addr), "r" (new_val), "r" (old) : "cr0", "memory"); + return ret == 0; } // Ensure that subsequent instructions do not execute on stale // data that was loaded from memory before the barrier. inline static void ! read_barrier () { __asm__ __volatile__ ("isync" : : : "memory"); } *************** read_barrier() *** 78,84 **** // Ensure that prior stores to memory are completed with respect to other // processors. inline static void ! write_barrier() { __asm__ __volatile__ ("sync" : : : "memory"); } --- 91,97 ---- // Ensure that prior stores to memory are completed with respect to other // processors. inline static void ! write_barrier () { __asm__ __volatile__ ("sync" : : : "memory"); } diff -Nrc3pad gcc-3.2.3/libjava/sysdep/s390/locks.h gcc-3.3/libjava/sysdep/s390/locks.h *** gcc-3.2.3/libjava/sysdep/s390/locks.h 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/sysdep/s390/locks.h 2002-10-08 14:57:37.000000000 +0000 *************** *** 0 **** --- 1,77 ---- + // locks.h - Thread synchronization primitives. S/390 implementation. + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #ifndef __SYSDEP_LOCKS_H__ + #define __SYSDEP_LOCKS_H__ + + typedef size_t obj_addr_t; /* Integer type big enough for object */ + /* address. */ + + // Atomically replace *addr by new_val if it was initially equal to old. + // Return true if the comparison succeeded. + // Assumed to have acquire semantics, i.e. later memory operations + // cannot execute before the compare_and_swap finishes. + inline static bool + compare_and_swap(volatile obj_addr_t *addr, + obj_addr_t old, obj_addr_t new_val) + { + int result; + + __asm__ __volatile__ ( + #ifndef __s390x__ + " cs %1,%2,0(%3)\n" + #else + " csg %1,%2,0(%3)\n" + #endif + " ipm %0\n" + " srl %0,28\n" + : "=&d" (result), "+d" (old) + : "d" (new_val), "a" (addr) + : "cc", "memory"); + + return result == 0; + } + + // Set *addr to new_val with release semantics, i.e. making sure + // that prior loads and stores complete before this + // assignment. + inline static void + release_set(volatile obj_addr_t *addr, obj_addr_t new_val) + { + __asm__ __volatile__("bcr 15,0" : : : "memory"); + *(addr) = new_val; + } + + // Compare_and_swap with release semantics instead of acquire semantics. + // On many architecture, the operation makes both guarantees, so the + // implementation can be the same. + inline static bool + compare_and_swap_release(volatile obj_addr_t *addr, + obj_addr_t old, obj_addr_t new_val) + { + return compare_and_swap(addr, old, new_val); + } + + // Ensure that subsequent instructions do not execute on stale + // data that was loaded from memory before the barrier. + inline static void + read_barrier() + { + __asm__ __volatile__("bcr 15,0" : : : "memory"); + } + + // Ensure that prior stores to memory are completed with respect to other + // processors. + inline static void + write_barrier() + { + __asm__ __volatile__("bcr 15,0" : : : "memory"); + } + #endif diff -Nrc3pad gcc-3.2.3/libjava/sysdep/sh/locks.h gcc-3.3/libjava/sysdep/sh/locks.h *** gcc-3.2.3/libjava/sysdep/sh/locks.h 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/sysdep/sh/locks.h 2002-08-01 05:34:54.000000000 +0000 *************** *** 0 **** --- 1,72 ---- + // locks.h - Thread synchronization primitives. SuperH implementation. + + /* Copyright (C) 2002 Free Software Foundation + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #ifndef __SYSDEP_LOCKS_H__ + #define __SYSDEP_LOCKS_H__ + + typedef size_t obj_addr_t; /* Integer type big enough for object */ + /* address. */ + + static unsigned char __cas_lock = 0; + + inline static void + __cas_start_atomic (void) + { + unsigned int val; + + do + __asm__ __volatile__ ("tas.b @%1; movt %0" + : "=r" (val) + : "r" (&__cas_lock) + : "memory"); + while (val == 0); + } + + inline static void + __cas_end_atomic (void) + { + __asm__ __volatile__ (" " : : : "memory"); + __cas_lock = 0; + } + + inline static bool + compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old, + obj_addr_t new_val) + { + bool ret; + + __cas_start_atomic (); + if (*addr != old) + ret = false; + else + { + *addr = new_val; + ret = true; + } + __cas_end_atomic (); + + return ret; + } + + inline static void + release_set (volatile obj_addr_t *addr, obj_addr_t new_val) + { + __asm__ __volatile__ (" " : : : "memory"); + *(addr) = new_val; + } + + inline static bool + compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old, + obj_addr_t new_val) + { + return compare_and_swap (addr, old, new_val); + } + + #endif /* ! __SYSDEP_LOCKS_H__ */ diff -Nrc3pad gcc-3.2.3/libjava/sysdep/x86-64/locks.h gcc-3.3/libjava/sysdep/x86-64/locks.h *** gcc-3.2.3/libjava/sysdep/x86-64/locks.h 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/sysdep/x86-64/locks.h 2002-10-01 09:02:08.000000000 +0000 *************** *** 0 **** --- 1,81 ---- + /* locks.h - Thread synchronization primitives. x86-64 implementation. + + Copyright (C) 2002 Free Software Foundation + + Contributed by Bo Thorsen . + + This file is part of libgcj. + + This software is copyrighted work licensed under the terms of the + Libgcj License. Please consult the file "LIBGCJ_LICENSE" for + details. */ + + #ifndef __SYSDEP_LOCKS_H__ + #define __SYSDEP_LOCKS_H__ + + typedef size_t obj_addr_t; /* Integer type big enough for object */ + /* address. */ + + // Atomically replace *addr by new_val if it was initially equal to old. + // Return true if the comparison succeeded. + // Assumed to have acquire semantics, i.e. later memory operations + // cannot execute before the compare_and_swap finishes. + inline static bool + compare_and_swap(volatile obj_addr_t *addr, obj_addr_t old, obj_addr_t new_val) + { + char result; + #ifdef __x86_64__ + __asm__ __volatile__("lock; cmpxchgq %2, %0; setz %1" + : "+m"(*(addr)), "=q"(result) + : "r" (new_val), "a"(old) + : "memory"); + #else + __asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1" + : "+m"(*(addr)), "=q"(result) + : "r" (new_val), "a"(old) + : "memory"); + #endif + return (bool) result; + } + + // Set *addr to new_val with release semantics, i.e. making sure + // that prior loads and stores complete before this + // assignment. + // On x86-64, the hardware shouldn't reorder reads and writes, + // so we just have to convince gcc not to do it either. + inline static void + release_set(volatile obj_addr_t *addr, obj_addr_t new_val) + { + __asm__ __volatile__(" " : : : "memory"); + *(addr) = new_val; + } + + // Compare_and_swap with release semantics instead of acquire semantics. + // On many architecture, the operation makes both guarantees, so the + // implementation can be the same. + inline static bool + compare_and_swap_release(volatile obj_addr_t *addr, + obj_addr_t old, + obj_addr_t new_val) + { + return compare_and_swap(addr, old, new_val); + } + + // Ensure that subsequent instructions do not execute on stale + // data that was loaded from memory before the barrier. + // On x86-64, the hardware ensures that reads are properly ordered. + inline static void + read_barrier() + { + } + + // Ensure that prior stores to memory are completed with respect to other + // processors. + inline static void + write_barrier() + { + /* x86-64 does not reorder writes. We just need to ensure that gcc also + doesn't. */ + __asm__ __volatile__(" " : : : "memory"); + } + #endif diff -Nrc3pad gcc-3.2.3/libjava/testsuite/ChangeLog gcc-3.3/libjava/testsuite/ChangeLog *** gcc-3.2.3/libjava/testsuite/ChangeLog 2003-04-22 06:15:42.000000000 +0000 --- gcc-3.3/libjava/testsuite/ChangeLog 2003-05-14 00:11:11.000000000 +0000 *************** *** 1,28 **** ! 2003-04-22 Release Manager ! * GCC 3.2.3 Released. ! 2003-02-05 Release Manager ! * GCC 3.2.2 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-19 Release Manager ! * GCC 3.2.1 Released. ! 2002-11-18 Release Manager ! * GCC 3.2.1 Released. 2002-10-24 Tom Tromey * libjava.lang/Primes.java: Removed. * libjava.lang/Primes.out: Removed. 2002-08-16 H.J. Lu * lib/libjava.exp (gcc_version): Removed. --- 1,308 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-06 Tom Tromey ! * libjava.lang/verify.java: New file. ! * libjava.lang/verify.out: New file. ! 2003-05-02 Tom Tromey ! PR java/10459: ! * libjava.compile/pr10459_2.java: New file. ! * libjava.compile/pr10459.java: New file. ! ! 2003-05-01 Tom Tromey ! ! PR libgcj/10582: ! * libjava.lang/assign.java: New file. ! * libjava.lang/assign.out: New file. ! ! 2003-04-16 Tom Tromey ! ! * libjava.mauve/xfails: Added some more failing tests. ! ! 2003-04-16 Mark Mitchell ! ! PR middle-end/8866 ! * libjava.lang/PR8866.java: New test. ! ! 2003-04-16 Andrew Haley ! ! * libjava.lang/Throw_2.java (main): Make a successful test produce ! some output. ! ! 2003-03-10 Tom Tromey ! ! * libjava.lang/initfield.java: New file. ! * libjava.lang/initfield.out: New file. ! ! 2003-03-10 Tom Tromey ! ! * libjava.jacks/jacks.xfail: Updated to reflect reality. ! ! 2003-03-02 Mark Wielaard ! ! * libjava.mauve/xfails: Remove all AcuniaPropertiesTest failures ! ! 2003-02-16 Mark Wielaard ! ! * libjava.mauve/xfails: Add Class.reflect2 and String.getBytes FAILs. ! ! 2003-02-15 Mark Wielaard ! ! * lib/libjava.exp (test_libjava_from_javac): Use regsub not string map. ! * libjava.mauve/mauve.exp (mauve_compute_uses): Likewise. ! (test_mauve): Likewise. ! ! 2003-02-14 Mark Wielaard ! ! * lib/libjava.exp (test_libjava_from_javac): Don't create .o files ! containing $ characters and always quote class files with "'"s. ! ! 2003-02-14 Mark Wielaard ! ! * libjava.mauve/mauve.exp (mauve_compute_uses): Add inner class ! object files by changing all occurances of $ to ^. ! (test_mauve): Replace ^ with $ for class file names and quote ! them with "'"s. ! ! 2003-02-13 Tom Tromey ! ! * libjava.mauve/xfails: Added entries for an unimplemented Class ! method. ! ! 2003-02-07 Mark Wielaard ! ! * libjava.mauve/xfails: Add new entries for ! gnu.testlet.java.text.CollationElementIterator.jdk11 ! ! 2003-02-03 Ulrich Weigand ! ! * libjava.jacks/jacks.exp (gcj_jacks_write): Set LD_LIBRARY_PATH ! to find libgcc_s. Set JAVA_CLASSPATH to find libgcj.jar. ! ! 2003-01-31 Mark Wielaard ! ! * lib/libjava.exp (libjava_prune_warnings): Remove all unreachable ! bytecode warnings. ! ! 2003-01-28 Tom Tromey ! ! * libjava.jacks/jacks.xfail: More lexer tests now pass. ! ! 2003-01-27 Tom Tromey ! ! * libjava.compile/consthrow.java: New file. ! * libjava.compile/consthrow.xfail: New file. ! ! 2003-01-27 Kaveh R. Ghazi ! ! * libjava.lang/pr8823.xfail: New file, add "xfail-byte". ! ! 2003-01-24 Ranjit Mathew ! ! * libjava.jni/calls.c (Java_calls_docall): Define with ! JNIEXPORT and JNICALL method attributes. ! * libjava.jni/field.c (Java_field_fetch): Likewise. ! * libjava.jni/final_method.c (Java_final_1method_meth): Likewise. ! * libjava.jni/findclass.c (Java_findclass_doit): Likewise. ! * libjava.jni/invoke.c (Java_invoke_val): Likewise. ! * libjava.jni/martin.c (Java_martin_myNative): Likewise. ! * libjava.jni/noclass.c (Java_noclass_find_1it): Likewise. ! * libjava.jni/overload.c (Java_overload_over__I): Likewise. ! (Java_overload_over__II): Likewise. ! * libjava.jni/register.c (JNI_OnLoad): Likewise. ! * libjava.jni/simple_int.c (Java_simple_1int_nat): Likewise. ! * libjava.jni/throwit.c (Java_throwit_throwit): Likewise. ! * libjava.jni/virtual.c (Java_virtual_equals): Likewise. ! ! 2003-01-21 Tom Tromey ! ! * libjava.jacks/jacks.xfail: All 8.4.3 tests and 9.4-modifier-10 ! now pass. ! ! 2003-01-12 Tom Tromey ! ! Fix for PR libgcj/9139: ! * lib/libjava.exp (find_javac): Put value of libgcj_jar into ! return value when gcj is used. ! * libjava.mauve/mauve.exp (test_mauve): Use libgcj_jar global. ! ! 2003-01-03 Tom Tromey ! ! * libjava.compile/pr8712.java: New file, for PR java/8712. ! ! 2003-01-01 Tom Tromey ! ! * libjava.compile/pr8955.java: New test, for PR java/8955. ! ! 2002-12-19 Tom Tromey ! ! * libjava.jacks/jacks.xfail: Updated. ! ! 2002-12-18 Tom Tromey ! ! * libjava.lang/pr8945.java: New file. ! * libjava.lang/pr8945.out: New file. ! ! 2002-12-12 Tom Tromey ! ! * libjava.loader/loader.exp (gcj_loader_test_one): Use ! libjava_prune_warnings. ! (gcj_loader_run): Likewise. ! * libjava.mauve/mauve.exp (test_mauve): Use ! libjava_prune_warnings. ! (test_mauve_sim): Likewise. ! * libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Use ! libjava_prune_warnings. ! (gcj_jni_build_header): Likewise. ! * lib/libjava.exp (libjava_prune_warnings): New proc. ! (gcj_link): Use it. ! (test_libjava_from_source): Likewise. ! (test_libjava_from_javac): Likewise. ! ! 2002-12-08 Tom Tromey ! ! Test for PR libgcj/8823: ! * libjava.lang/pr8823.java: New file. ! * libjava.lang/pr8823.out: New file. ! ! 2002-12-05 Tom Tromey ! ! * libjava.lang/override.java: New file. ! * libjava.lang/override.out: New file. ! ! 2002-12-01 Tom Tromey ! ! * libjava.jacks/jacks.exp (gcj_jacks_setup_xfail): New function. ! (gcj_jacks_parse): Use it; set up xfails. ! * libjava.jacks/jacks.xfail: New file. ! ! 2002-12-01 Mark Wielaard ! ! * libjava.mauve/xfails: Remove Inspector FAILs that now PASS. ! ! 2002-11-21 Tom Tromey ! ! For PR java/8676: ! * libjava.lang/pr8676.java: New file. ! * libjava.lang/pr8676.out: New file. ! ! 2002-11-21 Ulrich Weigand ! ! * libjava.loader/loader.exp (gcj_loader_test_one): Fix typo in ! 'type' argument to libjava_tcompile. ! (gcj_loader_run): Use libjava_tcompile instead of running ! GCJ_UNDER_TEST directly. ! ! 2002-11-05 Tom Tromey ! ! * libjava.jacks/jacks.exp: New file. ! ! 2002-11-04 Tom Tromey ! ! * libjava.compile/pr7912.java: New file. ! ! 2002-11-04 Andrew Haley ! ! * libjava.lang/utilTest.java: New. ! * libjava.lang/utilTest.out: New. ! ! 2002-11-04 Anthony Green ! ! * libjava.loader/MyLoader.java: New constructor. ! * libjava.loader/TestParent.java: New file. ! * libjava.loader/TestParent.out: New file. ! ! 2002-11-04 Anthony Green ! ! * libjava.loader/TestEarlyGC.java, ! libjava.loader/TestEarlyGC.out: New files (from ! Jeff Sturm). ! ! 2002-11-04 Anthony Green ! ! * libjava.loader/dummy.java, libjava.loader/loader.exp, ! libjava.loader/MyLoader.java, libjava.loader/TestLeak.java, ! libjava.loader/TestLeak.out, libjava.loader/TestMultiple.java, ! libjava.loader/TestMultiple.out: New files. ! ! 2002-11-02 Tom Tromey ! ! * libjava.lang/initexc.java (fail): Static initializers must be ! able to complete normally. From Eric Blake. ! ! * libjava.lang/initexc.java: New file. ! * libjava.lang/initexc.out: New file. ! ! 2002-11-01 Tom Tromey ! ! For PR java/8415: ! * libjava.lang/pr8415.java: New file. ! * libjava.lang/pr8415.out: New file. ! ! * libjava.mauve/mauve.exp (find_mauve_sources): New proc. ! (test_mauve): Use it. ! (test_mauve_sim): Likewise. 2002-10-24 Tom Tromey * libjava.lang/Primes.java: Removed. * libjava.lang/Primes.out: Removed. + 2002-10-23 Tom Tromey + + For PR java/6388: + * libjava.lang/pr6388.java: New file. + * libjava.lang/pr6388.out: New file. + + 2002-10-15 Andrew Haley + + * libjava.lang/EvaluationOrder.java (EvaluationOrder): New. + * libjava.lang/EvaluationOrder.out (EvaluationOrder): New. + + 2002-10-14 Andrew Haley + + * libjava.lang/StaticConstructor.java: New. + * libjava.lang/StaticConstructor.out: New. + + 2002-10-13 Mark Wielaard + + * libjava.mauve/xfails: Remove tests that now XPASS. + + 2002-10-03 Andrew Haley + + * libjava.lang/Array_3.java (baz): New. + (main): Call baz. + + 2002-09-29 Anthony Green + + * libjava.lang/TestProxy.java: New file. + * libjava.lang/TestProxy.out: Ditto. + + 2002-09-29 Anthony Green + + * libjava.lang/utf8concat.java: New file. + * libjava.lang/utf8concat.out: Ditto. + + 2002-08-26 Tom Tromey + + * libjava.compile/narrow_case.java: New file. + + 2002-08-25 Adam Megacz + + * lib/libjava.exp: don't apply -no-install when platform is mingw. + 2002-08-16 H.J. Lu * lib/libjava.exp (gcc_version): Removed. *************** *** 30,54 **** (libjava_init): Set libgcj_jar with tcl glob. (libjava_arguments): Use libgcj_jar. ! 2002-08-14 Release Manager ! * GCC 3.2 Released. ! 2002-07-25 Release Manager ! * GCC 3.1.1 Released. ! 2002-04-12 Anthony Green ! * lib/libjava.exp: Use libgcj-VERSION.jar, not libgcj-3.1.jar. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-14 Release Manager ! * GCC 3.1 Released. 2002-04-21 Mark Wielaard --- 310,390 ---- (libjava_init): Set libgcj_jar with tcl glob. (libjava_arguments): Use libgcj_jar. ! 2002-07-22 Tom Tromey ! * libjava.compile/zeroexp.java: New file. ! 2002-07-18 Rainer Orth ! * libjava.compile/compile.exp: Sort sources. ! * libjava.jni/jni.exp (gcj_jni_run): Likewise. ! * libjava.lang/lang.exp: Likewise. ! 2002-07-02 Andrew Haley ! * libjava.lang/inline.java: New file. ! * libjava.lang/inline.out: Likewise. ! * libjava.lang/Array_3.java: Add another case. ! 2002-06-23 Tom Tromey ! * Makefile.in: Rebuilt. ! * Makefile.am (RUNTEST): Added AM_RUNTESTFLAGS. ! (AM_RUNTESTFLAGS): New variable. ! (RUNTESTFLAGS): Don't define. ! * lib/libjava.exp (libjava_invoke): New proc. ! (test_libjava_from_source): Use it. ! (test_libjava_from_javac): Likewise. ! (libjava_find_gij): New proc. ! 2002-06-12 Tom Tromey ! ! * lib/libjava.exp (test_libjava): Fixed typo. ! * libjava.compile/PR6865.xfail: New file. ! ! 2002-06-11 Tom Tromey ! ! * libjava.compile/PR6865.java: New file. For PR java/6865. ! ! * libjava.lang/PR6520.java: Fixed typo. ! ! 2002-06-10 Tom Tromey ! ! * libjava.lang/PR6520.java: New file. For PR java/6520. ! ! 2002-06-04 Tom Tromey ! ! * libjava.compile/T20020604.java: New file. ! ! For PR libgcj/6389: ! * libjava.mauve/xfails: Now passes System.getProperty test. ! ! For PR java/1343 and PR java/6336: ! * libjava.compile/PR1343.java: New file. ! ! For PR java/5913: ! * libjava.compile/PR5913.xfail: Removed. ! ! 2002-05-29 Bryce McKinlay ! ! * libjava.compile/T20020529.java: New file. ! ! 2002-05-27 Bryce McKinlay ! ! * libjava.lang/PR6820.java: New file. ! * libjava.lang/PR6820.out: New file. ! ! 2002-05-23 Bryce McKinlay ! ! * libjava.lang/PR6729.java: New file. ! * libjava.lang/PR6729.out: New file. ! ! 2002-05-04 Mark Wielaard ! ! For PR java/6519: ! * libjava.lang/emptystring.java: New. ! * libjava.lang/emptystring.out: New. 2002-04-21 Mark Wielaard *************** *** 62,78 **** 2002-04-14 Mark Wielaard ! * libjava.mauve/xfails: Expect failures for PR libgcj/6302 and ! libgcj/6298. 2002-04-14 Mark Wielaard * libjava.mauve/xfails: Expect failures for PR libgcj/6293, libgcj/6295, libgcj/6296 and libgcj/6297. ! 2002-04-11 Anthony Green ! * lib/libjava.exp: Use libgcj-3.1.jar, not libgcj.jar. 2002-04-07 Mark Wielaard --- 398,424 ---- 2002-04-14 Mark Wielaard ! * libjava.mauve/xfails: Expect failures for PR libgcj/6302 and ! libgcj/6298. 2002-04-14 Mark Wielaard * libjava.mauve/xfails: Expect failures for PR libgcj/6293, libgcj/6295, libgcj/6296 and libgcj/6297. ! 2002-04-12 Anthony Green ! * lib/libjava.exp: Use libgcj-VERSION.jar, not libgcj.jar. ! ! 2002-04-12 Loren J. Rittle ! ! * libjava.lang/SyncGlobal.java, libjava.lang/SyncGlobal.out: ! New test case. ! ! 2002-04-09 Bryce McKinlay ! ! * libjava.lang/PR6204.java, libjava.lang/PR6204.out: New test case. ! * libjava.lang/PR6085.java, libjava.lang/PR6085.out: Likewise. 2002-04-07 Mark Wielaard diff -Nrc3pad gcc-3.2.3/libjava/testsuite/lib/libjava.exp gcc-3.3/libjava/testsuite/lib/libjava.exp *** gcc-3.2.3/libjava/testsuite/lib/libjava.exp 2002-08-16 21:08:37.000000000 +0000 --- gcc-3.3/libjava/testsuite/lib/libjava.exp 2003-02-15 16:47:37.000000000 +0000 *************** *** 1,4 **** ! # Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation load_lib "libgloss.exp" --- 1,4 ---- ! # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation load_lib "libgloss.exp" *************** if ![info exists tmpdir] { *** 10,15 **** --- 10,37 ---- set tmpdir "/tmp" } + # This is like `prune_warnings', but it also prunes away a warning + # from the bytecode front end that we don't care about. + proc libjava_prune_warnings {text} { + set text [prune_warnings $text] + set tlist [split $text \n] + set len [llength $tlist] + for {set i [expr {$len - 1}]} {$i >= 2} {incr i -1} { + if {[string match "*unreachable bytecode*" [lindex $tlist $i]]} { + # Delete this line, all other unreachable warnings and the previous + # two lines containing the method and class. + set j [expr {$i - 1}] + while {[string match "*unreachable bytecode*" [lindex $tlist $j]]} { + incr j -1 + } + incr j -1 + set tlist [lreplace $tlist $j $i] + set i $j + } + } + return [join $tlist \n] + } + # This is like `target_compile' but it does some surgery to work # around stupid DejaGNU bugs. In particular DejaGNU has very poor # quoting, so for instance a `$' will be re-evaluated at spawn time. *************** proc find_gcjh {} { *** 58,64 **** } proc find_javac {} { ! global SUN_JAVAC GCJ_UNDER_TEST env # If JDK doesn't run on your platform but some other # JDK-compatible javac does, you may set SUN_JAVAC to point to it. # One of the most important properties of a SUN_JAVAC is that it --- 80,86 ---- } proc find_javac {} { ! global SUN_JAVAC GCJ_UNDER_TEST env libgcj_jar # If JDK doesn't run on your platform but some other # JDK-compatible javac does, you may set SUN_JAVAC to point to it. # One of the most important properties of a SUN_JAVAC is that it *************** proc find_javac {} { *** 71,77 **** if {[info exists env(SUN_JAVAC)]} { set SUN_JAVAC $env(SUN_JAVAC) } else { ! set SUN_JAVAC "$GCJ_UNDER_TEST -C" } } return $SUN_JAVAC --- 93,99 ---- if {[info exists env(SUN_JAVAC)]} { set SUN_JAVAC $env(SUN_JAVAC) } else { ! set SUN_JAVAC "$GCJ_UNDER_TEST -C -I$libgcj_jar" } } return $SUN_JAVAC *************** proc libjava_init { args } { *** 204,209 **** --- 226,236 ---- # find the appropriate libraries so we must add -L options for their # paths. However we can't simply use those libraries; we still need # libtool for linking. + # Don't return the the lib${name}.la files here, since this causes the + # libraries to be linked twice: once as lib${name}.so and another time + # via gcj's implicit -l${name}. This is both unnecessary and causes the + # Solaris ld to warn: attempted multiple inclusion of file. This warning + # is not ignored by the dejagnu framework and cannot be disabled. proc libjava_find_lib {dir name} { global base_dir set gp [get_multilibs] *************** proc libjava_find_spec {} { *** 240,245 **** --- 267,288 ---- return "$objdir/../" } + # Find `gij'. + proc libjava_find_gij {} { + global base_dir + set gp [get_multilibs] + if {$gp != ""} { + set file $gp/libjava/gij + } else { + set file $base_dir/../gij + } + + if {[file exists $file]} { + return $file + } + return gij + } + # Remove a bunch of files. proc gcj_cleanup {args} { foreach file $args { *************** proc libjava_arguments {{mode compile}} *** 382,389 **** } # Avoid libtool wrapper scripts when possible. if {$mode == "link"} { ! lappend args "additional_flags=-no-install" } return $args --- 425,435 ---- } # Avoid libtool wrapper scripts when possible. + # but not if libtool warnings results in FAILs if {$mode == "link"} { ! if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } { ! lappend args "additional_flags=-no-install" ! } } return $args *************** proc gcj_link {program main files {optio *** 397,404 **** eval lappend arguments $options } lappend arguments "additional_flags=--main=$main" ! set x [prune_warnings [libjava_tcompile $files $program executable \ ! $arguments]] if {$x != ""} { verbose "link failure: $x" 2 fail "linking $program" --- 443,450 ---- eval lappend arguments $options } lappend arguments "additional_flags=--main=$main" ! set x [libjava_prune_warnings \ ! [libjava_tcompile $files $program executable $arguments]] if {$x != ""} { verbose "link failure: $x" 2 fail "linking $program" *************** proc gcj_link {program main files {optio *** 411,416 **** --- 457,529 ---- return 1 } + # Invoke a program and check its output. EXECUTABLE is the program; + # ARGS are the arguments to the program. Returns 1 if tests passed + # (or things were left untested), 0 otherwise. + proc libjava_invoke {errname testName optName executable inpfile resultfile args} { + upvar $optName opts + + if {[info exists opts(no-exec)]} { + if {[info exists opts(need-threads)]} { + # This means we wanted to try to run it but we couldn't + # because threads aren't supported. So we have to + # generate an `untested'. + untested "$errname execution - $testName" + untested "$errname output - $testName" + } + return 1 + } + + set result [libjava_load $executable $args "$inpfile"] + set status [lindex $result 0] + set output [lindex $result 1] + if {[info exists opts(xfail-exec)]} then { + setup_xfail *-*-* + } + $status "$errname execution - $testName" + if { $status != "pass" } { + untested "$errname output - $testName" + return 0 + } + + verbose "resultfile is $resultfile" + set id [open $resultfile r] + set expected "" + append expected [read $id] + regsub -all "\r" "$output" "" output + regsub "\n*$" $expected "" expected + regsub "\n*$" $output "" output + regsub "^\n*" $expected "" expected + regsub "^\n*" $output "" output + regsub -all "\[ \t\]\[ \t\]*" $expected " " expected + regsub -all "\[ \t\]*\n\n*" $expected "\n" expected + regsub -all "\[ \t\]\[ \t\]*" $output " " output + regsub -all "\[ \t\]*\n\n*" $output "\n" output + verbose "expected is $expected" + verbose "actual is $output" + set passed 0 + if {[info exists opts(regexp_match)]} { + if [regexp $expected $output] { + set passed 1 + } + } else { + if { $expected == $output } { + set passed 1 + } + } + if {[info exists opts(xfail-output)]} { + setup_xfail *-*-* + } + if { $passed == 1 } { + pass "$errname output - $testName" + } else { + fail "$errname output - $testName" + } + close $id + + return $passed + } + # # Run the test specified by srcfile and resultfile. compile_args and # exec_args are options telling this proc how to work. *************** proc test_libjava_from_source { options *** 466,471 **** --- 579,588 ---- append executable ".o" set target object } else { + # DOS/win32 targets default to .exe if no suffix is given + # We then try to delete a file that doesn't exist. It is + # simpler to add the suffix everywhere. + append executable ".exe" set target executable } if { $compile_args != "" } { *************** proc test_libjava_from_source { options *** 474,480 **** set removeList [list $executable] ! set x [prune_warnings \ [libjava_tcompile $srcfile "$executable" $target $args]] if {[info exists opts(xfail-gcj)]} { setup_xfail *-*-* --- 591,597 ---- set removeList [list $executable] ! set x [libjava_prune_warnings \ [libjava_tcompile $srcfile "$executable" $target $args]] if {[info exists opts(xfail-gcj)]} { setup_xfail *-*-* *************** proc test_libjava_from_source { options *** 503,574 **** } pass "$errname compilation from source" ! if {[info exists opts(no-exec)]} { ! if {[info exists opts(need-threads)]} { ! # This means we wanted to try to run it but we couldn't ! # because threads aren't supported. So we have to ! # generate an `untested'. ! untested "$errname execution from source compiled test" ! untested "$errname output from source compiled test" ! } ! eval gcj_cleanup $removeList ! return ! } ! if {[info exists opts(no-link)]} { ! eval gcj_cleanup $removeList ! return ! } ! ! set result [libjava_load $executable "" "$inpfile"]; ! set status [lindex $result 0]; ! set output [lindex $result 1]; ! if {[info exists opts(xfail-exec)]} then { ! setup_xfail *-*-* ! } ! $status "$errname execution from source compiled test" ! if { $status != "pass" } { ! untested "$errname output from source compiled test" ! return; ! } ! ! verbose "resultfile is $resultfile" ! set id [open $resultfile r]; ! set expected "" ! append expected [read $id]; ! regsub -all "\r" "$output" "" output; ! regsub "\n*$" $expected "" expected ! regsub "\n*$" $output "" output ! regsub "^\n*" $expected "" expected ! regsub "^\n*" $output "" output ! regsub -all "\[ \t\]\[ \t\]*" $expected " " expected ! regsub -all "\[ \t\]*\n\n*" $expected "\n" expected ! regsub -all "\[ \t\]\[ \t\]*" $output " " output ! regsub -all "\[ \t\]*\n\n*" $output "\n" output ! verbose "expected is $expected" ! verbose "actual is $output" ! set passed 0; ! if {$options == "regexp_match"} { ! if [regexp $expected $output] { ! set passed 1; ! } ! } else { ! if { $expected == $output } { ! set passed 1; ! } ! } ! if {[info exists opts(xfail-output)]} { ! setup_xfail *-*-* ! } if {[info exists opts(xfail-source-output)]} { ! setup_xfail *-*-* } ! if { $passed == 1 } { ! pass "$errname output from source compiled test" eval gcj_cleanup $removeList - } else { - fail "$errname output from source compiled test" } - close $id; } # --- 620,634 ---- } pass "$errname compilation from source" ! # Set up the options the way they are expected by libjava_invoke. if {[info exists opts(xfail-source-output)]} { ! set opts(xfail-output) x } ! if {[libjava_invoke $errname "source compiled test" opts $executable \ ! $inpfile $resultfile]} { ! # Everything ok, so clean up. eval gcj_cleanup $removeList } } # *************** proc test_libjava_from_javac { options s *** 584,589 **** --- 644,650 ---- global GCJ_UNDER_TEST global tmpdir global runtests + global INTERPRETER # Make opts into an array. set opts(_) x *************** proc test_libjava_from_javac { options s *** 644,654 **** set jvscan [find_jvscan] verbose "jvscan is $jvscan" set main_name [string trim \ ! [prune_warnings \ [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --print-main" "" "" 300] 1]]] verbose "main name is $main_name" set class_out [string trim \ ! [prune_warnings \ [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --list-class" "" "" 300] 1]]] verbose "class list is $class_out" --- 705,715 ---- set jvscan [find_jvscan] verbose "jvscan is $jvscan" set main_name [string trim \ ! [libjava_prune_warnings \ [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --print-main" "" "" 300] 1]]] verbose "main name is $main_name" set class_out [string trim \ ! [libjava_prune_warnings \ [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --list-class" "" "" 300] 1]]] verbose "class list is $class_out" *************** proc test_libjava_from_javac { options s *** 690,699 **** } else { set type executable lappend largs "additional_flags=--main=$main_name" ! set executable "${objdir}/$main_name" set mode link } # Initial arguments. set args [libjava_arguments $mode] eval lappend args $largs --- 751,773 ---- } else { set type executable lappend largs "additional_flags=--main=$main_name" ! # DOS/win32 targets default to .exe if no suffix is given ! # We then try to delete a file that doesn't exist. It is ! # simpler to add the suffix everywhere. ! set executable "${objdir}/${main_name}.exe" set mode link } + # We purposely ignore errors here; we still want to run the other + # appropriate tests. + set gij [libjava_find_gij] + # libjava_find_gij will return `gij' if it couldn't find the + # program; in this case we want to skip the test. + if {$INTERPRETER == "yes" && $gij != "gij"} { + libjava_invoke $errname "gij test" opts $gij \ + $inpfile $resultfile $main_name + } + # Initial arguments. set args [libjava_arguments $mode] eval lappend args $largs *************** proc test_libjava_from_javac { options s *** 713,720 **** if {$mode == "compile"} { foreach c_file $class_files { set executable [file rootname [file tail $c_file]].o ! set x [prune_warnings \ ! [libjava_tcompile $c_file "$executable" $type $args]] lappend removeList $executable if {$x != ""} { break --- 787,796 ---- if {$mode == "compile"} { foreach c_file $class_files { set executable [file rootname [file tail $c_file]].o ! # Don't write files which contain $ chars. ! regsub -all "\\$" $executable "\^" executable ! set x [libjava_prune_warnings \ ! [libjava_tcompile '$c_file' "$executable" $type $args]] lappend removeList $executable if {$x != ""} { break *************** proc test_libjava_from_javac { options s *** 729,735 **** set hack "$hack $stupid" } lappend removeList $executable ! set x [prune_warnings \ [libjava_tcompile $hack "$executable" $type $args]] } if {[info exists opts(xfail-byte)]} { --- 805,811 ---- set hack "$hack $stupid" } lappend removeList $executable ! set x [libjava_prune_warnings \ [libjava_tcompile $hack "$executable" $type $args]] } if {[info exists opts(xfail-byte)]} { *************** proc test_libjava_from_javac { options s *** 747,811 **** } pass "$errname compilation from bytecode" ! if {[info exists opts(no-exec)]} { ! if {[info exists opts(need-threads)]} { ! untested "$errname execution from bytecode->native test" ! untested "$errname output from bytecode->native test" ! } ! eval gcj_cleanup $removeList ! return ! } ! ! set result [libjava_load $executable "" "$inpfile"]; ! set status [lindex $result 0]; ! set output [lindex $result 1]; ! if {[info exists opts(xfail-exec)]} { ! setup_xfail *-*-* ! } ! $status "$errname execution from bytecode->native test" ! if { $status != "pass" } { ! untested "$errname output from bytecode->native test" ! return ! } ! ! verbose "resultfile is $resultfile" ! set id [open $resultfile r]; ! set expected "" ! append expected [read $id]; ! regsub -all "\r" "$output" "" output; ! regsub "\n*$" $expected "" expected ! regsub "\n*$" $output "" output ! regsub "^\n*" $expected "" expected ! regsub "^\n*" $output "" output ! regsub -all "\[ \t\]\[ \t\]*" $expected " " expected ! regsub -all "\[ \t\]*\n\n*" $expected "\n" expected ! regsub -all "\[ \t\]\[ \t\]*" $output " " output ! regsub -all "\[ \t\]*\n\n*" $output "\n" output ! verbose "expected is $expected" ! verbose "actual is $output" ! set passed 0; ! if {[info exists opts(xfail-output)]} { ! setup_xfail *-*-* ! } if {[info exists opts(xfail-byte-output)]} { ! setup_xfail *-*-* ! } ! if {$options == "regexp_match"} { ! if [regexp $expected $output] { ! set passed 1; ! } ! } else { ! if { $expected == $output } { ! set passed 1; ! } } ! if { $passed == 1 } { ! pass "$errname output from bytecode->native test" eval gcj_cleanup $removeList - } else { - fail "$errname output from bytecode->native test" } - close $id; } # --- 823,837 ---- } pass "$errname compilation from bytecode" ! # Set up the options the way they are expected by libjava_invoke. if {[info exists opts(xfail-byte-output)]} { ! set opts(xfail-output) x } ! if {[libjava_invoke $errname "bytecode->native test" opts $executable \ ! $inpfile $resultfile]} { ! # Everything ok, so clean up. eval gcj_cleanup $removeList } } # *************** proc test_libjava_from_javac { options s *** 818,824 **** # `xfail-gcjC' compilation with gcj -C will fail # `shouldfail' compilation from source is supposed to fail # This is different from xfail, which marks a known ! # failure that we just havne't fixed. # A compilation marked this way should fail with any # front end. # `xfail-byte' compilation from bytecode will fail --- 844,850 ---- # `xfail-gcjC' compilation with gcj -C will fail # `shouldfail' compilation from source is supposed to fail # This is different from xfail, which marks a known ! # failure that we just haven't fixed. # A compilation marked this way should fail with any # front end. # `xfail-byte' compilation from bytecode will fail diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/compile.exp gcc-3.3/libjava/testsuite/libjava.compile/compile.exp *** gcc-3.2.3/libjava/testsuite/libjava.compile/compile.exp 2000-05-17 15:48:44.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/compile.exp 2002-07-18 17:42:31.000000000 +0000 *************** *** 1,6 **** global srcdir subdir ! catch "glob -nocomplain ${srcdir}/${subdir}/*.java" srcfiles verbose "srcfiles are $srcfiles" set prefix "" --- 1,6 ---- global srcdir subdir ! catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.java] } srcfiles verbose "srcfiles are $srcfiles" set prefix "" diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/consthrow.java gcc-3.3/libjava/testsuite/libjava.compile/consthrow.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/consthrow.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/consthrow.java 2003-01-28 06:19:35.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + public class consthrow + { + public consthrow () throws Object + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/consthrow.xfail gcc-3.3/libjava/testsuite/libjava.compile/consthrow.xfail *** gcc-3.2.3/libjava/testsuite/libjava.compile/consthrow.xfail 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/consthrow.xfail 2003-01-28 06:19:35.000000000 +0000 *************** *** 0 **** --- 1,2 ---- + no-link + shouldfail diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/narrow_case.java gcc-3.3/libjava/testsuite/libjava.compile/narrow_case.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/narrow_case.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/narrow_case.java 2002-08-27 16:07:02.000000000 +0000 *************** *** 0 **** --- 1,11 ---- + public class narrow_case + { + private int test(byte b) + { + switch (b) + { + case '0' :return 0; + } + return 99; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/pr10459_2.java gcc-3.3/libjava/testsuite/libjava.compile/pr10459_2.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/pr10459_2.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/pr10459_2.java 2003-05-03 00:36:07.000000000 +0000 *************** *** 0 **** --- 1,10 ---- + public class pr10459_2 + { + pr10459_2 x; + + public void aMethod() throws Throwable + { + for (; ;x.clone().clone()) + break; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/pr10459.java gcc-3.3/libjava/testsuite/libjava.compile/pr10459.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/pr10459.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/pr10459.java 2003-05-03 00:36:07.000000000 +0000 *************** *** 0 **** --- 1,10 ---- + public class pr10459 + { + pr10459 x; + + public void aMethod() throws Throwable + { + for (; ;x.clone().clone()) + ; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/PR1343.java gcc-3.3/libjava/testsuite/libjava.compile/PR1343.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/PR1343.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/PR1343.java 2002-06-04 19:38:59.000000000 +0000 *************** *** 0 **** --- 1,17 ---- + import java.util.Vector; + + public class PR1343 + { + void f(Object[] l) + { + class x1 + { + }; + } + void f(Vector l) + { + class x1 + { + }; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/PR5913.xfail gcc-3.3/libjava/testsuite/libjava.compile/PR5913.xfail *** gcc-3.2.3/libjava/testsuite/libjava.compile/PR5913.xfail 2002-03-12 07:20:43.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/PR5913.xfail 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,2 **** - xfail-gcj - xfail-gcjC --- 0 ---- diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/PR6865.java gcc-3.3/libjava/testsuite/libjava.compile/PR6865.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/PR6865.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/PR6865.java 2002-06-11 14:46:11.000000000 +0000 *************** *** 0 **** --- 1,5 ---- + // gcj crashes on this + public class PR6865 + { + private foo; + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/PR6865.xfail gcc-3.3/libjava/testsuite/libjava.compile/PR6865.xfail *** gcc-3.2.3/libjava/testsuite/libjava.compile/PR6865.xfail 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/PR6865.xfail 2002-06-13 17:34:49.000000000 +0000 *************** *** 0 **** --- 1 ---- + shouldfail diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/pr7912.java gcc-3.3/libjava/testsuite/libjava.compile/pr7912.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/pr7912.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/pr7912.java 2002-11-05 04:07:39.000000000 +0000 *************** *** 0 **** --- 1,8 ---- + public class pr7912 + { + static Cloneable c; + public static void main(String[] args) + { + c = new int[1]; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/pr8712.java gcc-3.3/libjava/testsuite/libjava.compile/pr8712.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/pr8712.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/pr8712.java 2003-01-03 23:06:58.000000000 +0000 *************** *** 0 **** --- 1,7 ---- + public class pr8712 + { + boolean x(pr8712 a) + { + return (!(a instanceof pr8712)); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/pr8955.java gcc-3.3/libjava/testsuite/libjava.compile/pr8955.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/pr8955.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/pr8955.java 2003-01-02 00:05:49.000000000 +0000 *************** *** 0 **** --- 1,13 ---- + public class pr8955 + { + static final int val = Integer.MIN_VALUE; + void foo() + { + switch(1) { + case val: + break; + case 1: + break; + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/T20020529.java gcc-3.3/libjava/testsuite/libjava.compile/T20020529.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/T20020529.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/T20020529.java 2002-05-30 02:53:13.000000000 +0000 *************** *** 0 **** --- 1,23 ---- + public class T20020529 + { + public void checkXMLLangAttributeValue(String lang) + { + int offset = -1; + if (lang.length() >= 2) { + char ch0 = lang.charAt(0); + } + if (offset > 0) { + char ch = lang.charAt(offset++); + if (ch != '-') { + offset = -1; + } else { + while (true) + { + if (ch == '-') + ch = lang.charAt(offset++); + ch = lang.charAt(offset++); + } + } + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/T20020604.java gcc-3.3/libjava/testsuite/libjava.compile/T20020604.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/T20020604.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/T20020604.java 2002-06-04 19:39:00.000000000 +0000 *************** *** 0 **** --- 1,17 ---- + // Regression test for gcj crash, when compiled with -O2 on + // i686-pc-linux-gnu. + public class T20020604 + { + static double d2 = 0.0; + + static Object lockObject = new Object(); + + public static double f(double d1) { + + synchronized (lockObject){ + d2 = Math.max(d1, d2); + } + + return d2; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.compile/zeroexp.java gcc-3.3/libjava/testsuite/libjava.compile/zeroexp.java *** gcc-3.2.3/libjava/testsuite/libjava.compile/zeroexp.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.compile/zeroexp.java 2002-07-23 03:15:02.000000000 +0000 *************** *** 0 **** --- 1,10 ---- + public class zeroexp + { + public static void main (String[] argv) + { + // gcj used to give an error about this literal. + float f = 0E-6F; + double d = 0E-9; + System.out.println ("" + f + " " + d); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jacks/jacks.exp gcc-3.3/libjava/testsuite/libjava.jacks/jacks.exp *** gcc-3.2.3/libjava/testsuite/libjava.jacks/jacks.exp 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jacks/jacks.exp 2003-02-03 16:21:29.000000000 +0000 *************** *** 0 **** --- 1,104 ---- + # Run the Jacks test suite. + # See http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html + + proc gcj_jacks_setup_xfail {ary} { + upvar $ary array + global srcdir + + set fd [open $srcdir/libjava.jacks/jacks.xfail] + while {! [eof $fd]} { + set array([gets $fd]) {} + } + close $fd + } + + proc gcj_jacks_write {filename} { + global GCJ_UNDER_TEST + global libgcj_jar + global libjava_libgcc_s_path + global original_ld_library_path + + set gcjl [split $GCJ_UNDER_TEST] + set gcj_cmd [lindex $gcjl 0] + set rest [join [lreplace $gcjl 0 0]] + append rest " -C" + + set fd [open $filename w] + puts $fd "set JAVAC $gcj_cmd" + puts $fd "set JAVA_CLASSPATH \"$libgcj_jar\"" + puts $fd "set JAVAC_FLAGS [list $rest]" + puts $fd "set JAVA [list [libjava_find_gij]]" + puts $fd "set JAVA_FLAGS \"\"" + puts $fd "set JAVAC_ENCODING_FLAG --encoding=" + puts $fd "set tcltest::testConstraints(encoding) 1" + puts $fd "set tcltest::testConstraints(gcj) 1" + # "Time-consuming JVM limitation tests". + # puts $fd "set tcltest::testConstraints(jvm) 1" + close $fd + + setenv LD_LIBRARY_PATH $libjava_libgcc_s_path:$original_ld_library_path + } + + proc gcj_jacks_parse {file} { + if {[catch {open $file} fd]} { + verbose "couldn't parse Jacks output: $fd" + return + } + + verbose "Reading jacks.xfail" + gcj_jacks_setup_xfail xfails + + while {! [eof $fd]} { + set line [gets $fd] + if {[string match RESULT* $line]} { + set linelist [split $line] + set test [lindex $linelist 1] + if {[info exists xfails($test)]} { + setup_xfail "*-*-*" + } + if {[lindex $linelist 2] == "PASSED"} { + pass $test + } else { + fail $test + } + } + } + + close $fd + } + + proc gcj_jacks_run {} { + global srcdir + + if {! [file isdirectory $srcdir/libjava.jacks/jacks]} { + # No tests. + verbose "Jacks tests not found" + return + } + + # Jacks forces us to do this. You can't run it from a separate + # tree. + verbose "Copying Jacks..." + catch {system "rm -rf jacks"} + catch {system "cp -r $srcdir/libjava.jacks/jacks jacks"} + + set here [pwd] + cd jacks + + verbose "Writing Jacks setup file" + gcj_jacks_write gcj_setup + + verbose "Running Jacks..." + if {[catch {exec ./jacks gcj} msg]} { + verbose "jacks invocation failure: $msg" + fail "running jacks" + } else { + pass "running jacks" + + gcj_jacks_parse logging/gcj.log + } + + cd $here + } + + gcj_jacks_run diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jacks/jacks.xfail gcc-3.3/libjava/testsuite/libjava.jacks/jacks.xfail *** gcc-3.2.3/libjava/testsuite/libjava.jacks/jacks.xfail 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jacks/jacks.xfail 2003-03-10 16:39:31.000000000 +0000 *************** *** 0 **** --- 1,815 ---- + 14.14-plain-2 + 14.14-plain-5 + 14.14-label-1 + 14.14-label-2 + 14.14-label-5 + 14.14-label-8 + 14.7-shadow-3 + 14.3-1 + 14.3-scope-2 + 14.3-scope-4 + 14.3-scope-5 + 14.3-scope-9 + 14.3-scope-11 + 14.4.2-shadow-5 + 14.4.2-shadow-6 + 14.4.2-shadow-7 + 14.4.2-shadow-9 + 14.19-shadow-4 + 14.19-shadow-5 + 14.19-shadow-6 + 14.19-shadow-7 + 14.19-shadow-12 + 14.19-shadow-13 + 14.19-shadow-14 + 14.19-shadow-15 + 14.19.exception-13 + 14.19.exception-14 + 14.19.exception-15 + 14.19.exception-16 + 14.19.exception-21 + 14.19.exception-22 + 14.19.exception-23 + 14.19.exception-24 + 14.20-block-4 + 14.20-block-5 + 14.20-block-9 + 14.20-block-10 + 14.20-local-2 + 14.20-label-5 + 14.20-label-6 + 14.20-label-8 + 14.20-label-9 + 14.20-label-10 + 14.20-label-11 + 14.20-label-12 + 14.20-label-13 + 14.20-label-14 + 14.20-label-15 + 14.20-switch-8 + 14.20-switch-9 + 14.20-switch-14 + 14.20-switch-15 + 14.20-switch-17 + 14.20-switch-18 + 14.20-switch-19 + 14.20-switch-20 + 14.20-switch-21 + 14.20-switch-22 + 14.20-switch-23 + 14.20-switch-24 + 14.20-while-4 + 14.20-while-5 + 14.20-while-12 + 14.20-while-13 + 14.20-while-14 + 14.20-while-15 + 14.20-while-16 + 14.20-while-17 + 14.20-while-18 + 14.20-while-19 + 14.20-do-6 + 14.20-do-7 + 14.20-do-9 + 14.20-do-10 + 14.20-do-11 + 14.20-do-12 + 14.20-do-13 + 14.20-do-14 + 14.20-do-15 + 14.20-do-16 + 14.20-do-17 + 14.20-do-18 + 14.20-do-19 + 14.20-do-20 + 14.20-do-21 + 14.20-do-22 + 14.20-do-23 + 14.20-do-24 + 14.20-do-25 + 14.20-do-26 + 14.20-do-27 + 14.20-do-28 + 14.20-do-29 + 14.20-do-30 + 14.20-do-31 + 14.20-do-32 + 14.20-do-33 + 14.20-for-4 + 14.20-for-5 + 14.20-for-8 + 14.20-for-9 + 14.20-for-15 + 14.20-for-16 + 14.20-for-17 + 14.20-for-18 + 14.20-for-19 + 14.20-for-20 + 14.20-for-21 + 14.20-for-22 + 14.20-abrupt-2 + 14.20-abrupt-3 + 14.20-abrupt-6 + 14.20-abrupt-7 + 14.20-abrupt-10 + 14.20-abrupt-11 + 14.20-abrupt-14 + 14.20-abrupt-15 + 14.20-synchronized-3 + 14.20-synchronized-4 + 14.20-try-3 + 14.20-try-4 + 14.20-try-9 + 14.20-try-10 + 14.20-try-14 + 14.20-try-15 + 14.20-try-18 + 14.20-try-19 + 14.20-try-22 + 14.20-try-23 + 14.20-try-27 + 14.20-try-28 + 14.20-try-31 + 14.20-try-32 + 14.20-catch-15 + 14.20-catch-17 + 14.20-if-6 + 14.20-if-7 + 14.20-for-update-1 + 8.1.1.1-default-abstract-11 + 8.1.1.1-default-abstract-13 + 8.1.1.1-default-abstract-15 + 8.1.1.1-default-abstract-19 + 8.1.1.1-default-abstract-21 + 8.1.1.1-default-abstract-22 + 8.1.1.1-default-abstract-24 + 8.1.1.1-default-abstract-25 + 8.1.2-static-1 + 8.1.2-static-11 + 8.1.2-static-16 + 8.1.2-enclosing-4 + 8.1.2-enclosing-5 + 8.1.3-object-3 + 8.1.3-superclass-5 + 8.1.3-superclass-6 + 8.2-accessibility-inherited-member-5 + 8.8.5.1-example-1 + 8.8.5.1-example-3 + 8.8.5.1-qualified-1 + 8.8.5.1-qualified-2 + 8.8.5.1-qualified-3 + 8.8.5.1-qualified-4 + 8.8.5.1-qualified-10 + 8.8.5.1-qualified-11 + 8.8.5.1-qualified-12 + 8.8.5.1-qualified-13 + 8.8.5.1-qualified-15 + 8.8.7-inaccessible-default-constructor-toplevel-2 + 8.8.7-accessible-default-constructor-inner-18 + 8.8.7-accessible-default-constructor-inner-26 + 8.3-inheritance-1 + 8.3-inheritance-2 + 8.3-inheritance-3 + 8.3-inheritance-5 + 8.3-inheritance-6 + 8.3.1.2-final-2 + 8.3.1.2-final-17 + 8.3.1.2-final-19 + 8.3.1.2-final-21 + 8.3.1.2-final-24 + 8.3.1.2-final-27 + 8.3.1.2-final-28 + 8.3.1.2-final-29 + 8.3.2-abrupt-3 + 8.3.2-abrupt-5 + 8.3.2-abrupt-6 + 8.3.2-abrupt-7 + 8.3.2.2-super-2 + 8.3.2.3-illegal-forward-instance-1 + 8.3.2.3-illegal-forward-instance-2 + 8.3.2.3-illegal-forward-instance-3 + 8.3.2.3-illegal-forward-instance-4 + 8.3.2.3-illegal-forward-instance-5 + 8.3.2.3-illegal-forward-instance-6 + 8.3.2.3-illegal-forward-instance-7 + 8.3.2.3-illegal-forward-instance-8 + 8.3.2.3-illegal-forward-instance-9 + 8.3.2.3-legal-forward-instance-11 + 8.3.2.3-illegal-forward-static-1 + 8.3.2.3-illegal-forward-static-2 + 8.3.2.3-illegal-forward-static-3 + 8.3.2.3-illegal-forward-static-4 + 8.3.2.3-illegal-forward-static-5 + 8.3.2.3-illegal-forward-static-6 + 8.3.2.3-illegal-forward-static-7 + 8.3.2.3-illegal-forward-static-8 + 8.3.2.3-illegal-forward-static-9 + 8.3.2.3-illegal-forward-static-10 + 8.6-checked-exception-2 + 8.6-checked-exception-4 + 8.6-checked-exception-5 + 8.6-checked-exception-6 + 8.6-checked-exception-8 + 8.6-checked-exception-10 + 8.6-checked-exception-11 + 8.6-checked-exception-12 + 8.6-complete-1 + 8.6-complete-4 + 8.6-complete-5 + 8.6-abrupt-1 + 8.6-abrupt-4 + 8.5-inheritance-1 + 8.5-inheritance-2 + 8.5-inheritance-3 + 8.5-inheritance-6 + 8.5.2-non-static-member-usage-2 + 8.4.6-miranda-2 + 8.4.6-miranda-3 + 8.4.6-miranda-4 + 8.4.6-inheritance-1 + 8.4.6-inheritance-2 + 8.4.6.2-hiding-3 + 8.4.6.4-multiple-3 + 8.4.6.4-multiple-4 + 8.4.6.4-multiple-5 + 8.4.6.4-multiple-7 + 8.4.6.4-multiple-8 + 8.4.6.4-abstract-1 + 8.4.6.4-abstract-2 + 8.4.6.4-abstract-4 + 8.4.6.4-abstract-9 + 8.4.6.4-abstract-10 + 8.4.6.1-override-3 + 8.4.6.3-modifier-8 + 8.4.6.3-modifier-9 + 8.4.6.3-modifier-10 + 8.4.6.3-modifier-11 + 8.4.6.3-modifier-12 + 8.4.6.3-modifier-13 + 8.4.6.3-default-4 + 8.4.6.3-default-6 + 8.4.6.3-default-10 + 8.4.6.3-default-12 + 8.4.6.3-default-14 + 8.4.6.3-signature-4 + 8.4.6.3-signature-7 + 8.4.6.3-signature-9 + 8.4.6.3-signature-10 + 8.4.6.3-signature-12 + 8.4.6.3-signature-15 + 8.7-abrupt-1 + 8.7-complete-1 + 8.7-complete-3 + 5.1.3-dti-1 + 5.1.3-dti-2 + 5.1.3-fti-1 + 5.1.3-fti-2 + 5.1.2-bts-1 + 5.1.2-bts-2 + 5.1.2-bts-3 + 5.1.2-bts-4 + 5.1.2-bts-5 + 5.1.2-bti-1 + 5.1.2-bti-3 + 5.1.2-bti-5 + 5.1.2-btl-1 + 5.1.2-btl-3 + 5.1.2-btl-5 + 5.1.2-btf-1 + 5.1.2-btf-3 + 5.1.2-btf-5 + 5.1.2-btd-1 + 5.1.2-btd-3 + 5.1.2-btd-5 + 5.1.2-sti-1 + 5.1.2-sti-5 + 5.1.2-stl-1 + 5.1.2-stl-3 + 5.1.2-stl-5 + 5.1.2-stf-1 + 5.1.2-stf-3 + 5.1.2-stf-5 + 5.1.2-std-3 + 5.1.2-std-5 + 16-static-1 + 16-static-2 + 16-instance-5 + 16-instance-6 + 16-instance-7 + 16.5-anonymous-3 + 16.8-constructor-6 + 16.8-constructor-7 + 16.8-constructor-8 + 16.1.7-simple-definite-assignment-fail-8 + 16.1.7-simple-definite-assignment-fail-9 + 16.1.7-compound-definite-assignment-fail-8 + 16.1.7-compound-definite-assignment-fail-9 + 16.1.7-simple-definite-unassignment-fail-1 + 16.1.7-compound-definite-unassignment-fail-1 + 16.1.7-compound-definite-unassignment-fail-6 + 16.1.7-compound-definite-unassignment-pass-6 + 16.1.7-compound-definite-unassignment-pass-7 + 16.1.2-definite-unassignment-fail-6 + 16.1.5-definite-unassignment-pass-4 + 16.1.5-definite-unassignment-pass-7 + 16.1.5-not-assignable-7 + 16.1.5-not-assignable-8 + 16.1.3-definite-unassignment-fail-6 + 16.1.8-definite-unassign-fail-1 + 16.1.8-definite-unassign-fail-2 + 16.1.8-definite-unassign-fail-3 + 16.1.8-definite-unassign-fail-4 + 16.2.10-definite-unassign-pass-1 + 16.2.10-definite-unassign-pass-2 + 16.2.10-definite-unassign-pass-4 + 16.2.10-definite-unassign-pass-5 + 16.2.10-definite-unassign-pass-6 + 16.2.10-definite-unassign-pass-7 + 16.2.10-definite-unassign-pass-8 + 16.2.10-definite-unassign-pass-9 + 16.2.10-definite-unassign-fail-6 + 16.2.10-definite-unassign-fail-7 + 16.2.10-definite-unassign-fail-8 + 16.2.10-definite-unassign-fail-9 + 16.2.10-definite-assign-pass-2 + 16.2.10-definite-assign-fail-2 + 16.2.11-definite-unassign-pass-1 + 16.2.11-definite-unassign-pass-2 + 16.2.11-definite-unassign-pass-4 + 16.2.11-definite-unassign-pass-5 + 16.2.11-definite-unassign-pass-6 + 16.2.11-definite-unassign-pass-7 + 16.2.11-definite-unassign-pass-8 + 16.2.11-definite-unassign-fail-7 + 16.2.11-definite-unassign-fail-8 + 16.2.11-definite-unassign-fail-9 + 16.2.11-definite-assign-pass-2 + 16.2.11-definite-assign-fail-3 + 16.2.7-final-4 + 16.2.7-final-6 + 16.2.5-definite-unassign-pass-1 + 16.2.5-definite-unassign-pass-2 + 16.2.5-definite-unassign-pass-3 + 16.2.3-switch-1 + 16.2.8-final-1 + 16.2.8-final-2 + 16.2.8-unassigned-1 + 16.2.8-unassigned-6 + 16.2.8-unassigned-8 + 16.2.14-definite-unassign-fail-5 + 16.2.14-definite-unassign-fail-6 + 16.2.14-definite-unassign-fail-7 + 16.2.14-definite-unassign-fail-8 + 16.2.14-definite-unassign-fail-12 + 16.2.14-definite-unassign-fail-13 + 16.2.9-definite-unassign-pass-1 + 16.2.9-definite-unassign-pass-2 + 16.2.9-definite-unassign-pass-4 + 16.2.9-definite-unassign-pass-5 + 16.2.9-definite-unassign-pass-6 + 16.2.9-definite-unassign-pass-7 + 16.2.9-definite-unassign-pass-8 + 16.2.9-definite-unassign-fail-5 + 16.2.9-definite-unassign-fail-6 + 16.2.9-definite-unassign-fail-7 + 16.2.9-definite-assign-pass-2 + 16.2.9-definite-assign-fail-3 + 15.18.1-float-1 + 15.18.1-float-2 + 15.18.1-float-3 + 15.18.1-float-4 + 15.18.1-float-5 + 15.18.1-float-6 + 15.18.1-float-7 + 15.18.1-float-8 + 15.18.1-float-9 + 15.18.1-float-10 + 15.18.1-float-11 + 15.18.1-float-12 + 15.18.1-double-1 + 15.18.1-double-2 + 15.18.1-double-3 + 15.18.1-double-4 + 15.18.1-double-5 + 15.18.1-double-6 + 15.18.1-double-7 + 15.18.1-double-8 + 15.18.1-double-9 + 15.18.1-double-10 + 15.18.1-double-11 + 15.18.1-double-12 + 15.18.1-double-13 + 15.18.1-valid-1 + 15.13-anon-1 + 15.26.2-mult-12 + 15.26.2-div-12 + 15.26.2-mod-12 + 15.26.2-add-12 + 15.26.2-sub-12 + 15.26.2-left-shift-12 + 15.26.2-signed-right-shift-12 + 15.26.2-unsigned-right-shift-12 + 15.26.2-and-10 + 15.26.2-and-12 + 15.26.2-xor-10 + 15.26.2-xor-12 + 15.26.2-or-10 + 15.26.2-or-12 + 15.16-value-1 + 15.16-value-2 + 15.16-semantic-5 + 15.9.5.1-superconstructor-2 + 15.9.5.1-superconstructor-4 + 15.9.5.1-superconstructor-7 + 15.9.5.1-superconstructor-8 + 15.9.5.1-exception-1 + 15.9.5.1-exception-3 + 15.9.5.1-exception-4 + 15.9.3-choosing-4 + 15.9.1-unqualified-anonymous-2 + 15.9.1-unqualified-anonymous-4 + 15.9.1-unqualified-anonymous-5 + 15.9.1-unqualified-anonymous-12 + 15.9.1-unqualified-anonymous-14 + 15.9.1-unqualified-anonymous-15 + 15.9.1-unqualified-anonymous-23 + 15.9.1-unqualified-anonymous-24 + 15.9.1-unqualified-anonymous-26 + 15.9.1-unqualified-anonymous-27 + 15.9.1-qualified-anonymous-2 + 15.9.1-qualified-anonymous-4 + 15.9.1-qualified-anonymous-5 + 15.9.1-qualified-anonymous-10 + 15.9.1-qualified-anonymous-12 + 15.9.1-qualified-anonymous-13 + 15.9.1-qualified-anonymous-14 + 15.9.1-qualified-anonymous-17 + 15.9.1-qualified-anonymous-18 + 15.9.1-qualified-anonymous-20 + 15.9.1-qualified-anonymous-22 + 15.9.1-qualified-anonymous-26 + 15.9.1-qualified-anonymous-28 + 15.9.1-unqualified-concrete-2 + 15.9.1-unqualified-concrete-4 + 15.9.1-unqualified-concrete-5 + 15.9.1-unqualified-concrete-10 + 15.9.1-unqualified-concrete-14 + 15.9.1-unqualified-concrete-15 + 15.9.1-qualified-concrete-4 + 15.9.1-qualified-concrete-5 + 15.9.1-qualified-concrete-10 + 15.9.1-qualified-concrete-12 + 15.9.1-qualified-concrete-14 + 15.9.1-qualified-concrete-16 + 15.9.1-qualified-concrete-20 + 15.9.1-qualified-concrete-24 + 15.28-primitive-9 + 15.28-primitive-15 + 15.28-primitive-16 + 15.28-primitive-17 + 15.28-simple-name-6 + 15.28-simple-name-8 + 15.28-uninitialized-simple-name-3 + 15.28-cast-simple-name-1 + 15.28-cast-simple-name-2 + 15.28-cast-simple-name-3 + 15.28-qualified-name-5 + 15.28-qualified-name-6 + 15.28-qualified-name-7 + 15.28-qualified-name-8 + 15.28-qualified-name-9 + 15.28-qualified-name-10 + 15.28-string-2 + 15.28-string-5 + 15.28-string-9 + 15.28-string-11 + 15.28-string-13 + 15.28-string-15 + 15.28-string-16 + 15.28-string-17 + 15.28-string-18 + 15.28-simple-namestr-1 + 15.28-simple-namestr-2 + 15.28-simple-namestr-3 + 15.28-simple-namestr-4 + 15.28-qualified-namestr-7 + 15.28-qualified-namestr-8 + 15.28-qualified-namestr-9 + 15.28-notstring-1 + 15.28-null-1 + 15.28-null-3 + 15.28-instanceof-3 + 15.21-assoc-7 + 15.21-assoc-8 + 15.21-equal-3 + 15.21-type-7 + 15.21-type-17 + 15.21-type-21 + 15.21-type-22 + 15.21-type-23 + 15.21-type-24 + 15.21-type-30 + 15.11.2-syntax-1 + 15.11.2-explicit-constructor-2 + 15.11.2-meaning-3 + 15.11.2-meaning-6 + 15.11.2-meaning-8 + 15.11.2-meaning-9 + 15.11.2-meaning-10 + 15.11.2-meaning-11 + 15.11.2-meaning-13 + 15.11.2-meaning-14 + 15.11.2-meaning-17 + 15.11.1-ambiguous-2 + 15.11.1-ambiguous-3 + 15.11.1-explicit-constructor-3 + 15.12.3-explicit-constructor-3 + 15.12.3-explicit-constructor-4 + 15.12.3-explicit-constructor-5 + 15.12.3-explicit-constructor-7 + 15.12.3-explicit-constructor-10 + 15.12.3-abstract-1 + 15.12.3-abstract-2 + 15.12.3-abstract-3 + 15.12.1-syntax-1 + 15.12.1-type-14 + 15.12.2.1-accessibility-method-2 + 15.12.2.1-accessibility-method-4 + 15.12.2.1-accessibility-method-6 + 15.12.2.2-ambiguous-1 + 15.12.2.2-ambiguous-2 + 15.12.2.2-ambiguous-6 + 15.12.2.2-ambiguous-9 + 15.12.2.2-ambiguous-10 + 15.12.2.2-ambiguous-12 + 15.12.2.2-ambiguous-14 + 15.12.2.2-ambiguous-18 + 15.12.2.2-ambiguous-21 + 15.17-mod-3 + 15.17-mod-4 + 15.17.3-assoc-2 + 15.17.3-float-1 + 15.17.3-float-2 + 15.17.3-float-3 + 15.17.3-float-4 + 15.17.3-float-5 + 15.17.3-float-6 + 15.17.3-float-7 + 15.17.3-float-8 + 15.17.3-float-9 + 15.17.3-float-10 + 15.17.3-float-11 + 15.17.3-float-12 + 15.17.3-float-13 + 15.17.3-float-14 + 15.17.3-double-1 + 15.17.3-double-2 + 15.17.3-double-3 + 15.17.3-double-4 + 15.17.3-double-5 + 15.17.3-double-6 + 15.17.3-double-7 + 15.17.3-double-8 + 15.17.3-double-9 + 15.17.3-double-10 + 15.17.3-double-11 + 15.17.3-double-12 + 15.17.3-double-13 + 15.17.3-double-14 + 15.14.2-final-2 + 15.14.2-final-3 + 15.14.1-final-2 + 15.14.1-final-3 + 15.8.2-synthetic-1 + 15.8.2-type-11 + 15.8.2-type-12 + 15.8.2-type-13 + 15.8.2-type-14 + 15.8.5-field-expression-6 + 15.8.5-method-expression-8 + 15.8.5-variable-5 + 15.8.5-variable-6 + 15.8.5-variable-7 + 15.8.5-variable-8 + 15.15-precedence-5 + 15.15.2-final-2 + 15.15.2-final-3 + 15.15.1-final-2 + 15.15.1-final-3 + 9.4.1-conflict-2 + 9.3.1-init-1 + 9.3.1-illegal-forward-1 + 9.3.1-illegal-forward-2 + 9.1.3-body-5 + 9.1.1-in-class-17 + 9.1.1-in-class-24 + 9.1.1-in-interface-2 + 9.1.1-in-interface-3 + 9.1.1-in-interface-9 + 9.1.1-in-interface-16 + 9.1.2-supertype-1 + 9.2-implicit-2 + 9.2-implicit-3 + 9.2-implicit-4 + 9.2-implicit-6 + 9.2-implicit-7 + 9.2-implicit-11 + 9.2-implicit-12 + 9.2-implicit-15 + 9.2-implicit-17 + 9.2-implicit-18 + 9.2-implicit-19 + 3.2-valid-1 + 3.10.2-round-6 + 3.10.2-round-7 + 3.10.2-round-9 + 3.10.2-round-10 + 3.10.2-round-11 + 3.10.2-round-12 + 3.10.2-double-13 + 3.10.2-double-14 + 3.10.1-invalid-3 + 3.10.1-invalid-4 + 6.6.2.2-protected-creation-3 + 6.6.2.1-protected-instance-field-3 + 6.6.2.1-protected-instance-field-4 + 6.6.2.1-protected-instance-field-6 + 6.6.2.1-protected-instance-field-7 + 6.6.2.1-protected-instance-method-3 + 6.6.2.1-protected-instance-method-5 + 6.6.2.1-protected-instance-method-6 + 6.6.2.1-protected-instance-method-7 + 6.6.2.1-protected-type-2 + 6.6.1-8 + 6.6.1-11 + 6.6.1-array-2 + 6.6.1-array-3 + 6.6.1-array-5 + 6.6.1-array-8 + 6.6.1-array-11 + 6.6.1-array-13 + 6.6.1-array-14 + 6.6.1-array-17 + 6.6.1-array-20 + 6.6.1-array-22 + 6.6.1-array-23 + 6.6.1-array-26 + 6.6.1-array-29 + 6.6.1-array-31 + 6.6.1-array-32 + 6.6.1-array-35 + 6.5.6.2-type-2 + 6.5.6.2-type-6 + 6.5.6.2-type-8 + 6.5.6.2-type-9 + 6.5.6.2-expression-6 + 6.5.6.1-local-3 + 6.5.6.1-local-4 + 6.5.6.1-field-6 + 6.5.6.1-explicit-constructor-2 + 6.5.4.1-simple-6 + 6.5.4.1-simple-10 + 6.5.4.1-simple-11 + 6.5.1-type-15 + 6.5.1-type-16 + 6.5.1-typeorpackage-2 + 6.5.5.2-type-4 + 6.5.5.2-type-5 + 6.5.5.2-type-6 + 6.5.5.2-type-7 + 6.5.5.2-type-8 + 6.5.5.1-import-2 + 6.5.5.1-import-3 + 6.5.5.1-nested-4 + 6.5.5.1-nested-7 + 6.5.5.1-nested-8 + 6.5.5.1-nested-9 + 6.5.5.1-nested-14 + 6.5.5.1-nested-16 + 6.5.5.1-nested-17 + 6.5.5.1-nested-19 + 6.5.5.1-nested-20 + 6.5.5.1-nested-21 + 6.5.5.1-nested-23 + 6.3-1 + 7.4.2-2 + 7.5.1-canonical-3 + 7.5.1-accessible-4 + 7.5.1-accessible-5 + 7.5.1-duplicate-4 + 7.5.1-shadow-2 + 7.5.2-canonical-2 + 7.5.2-canonical-3 + 7.5.2-accessible-1 + 7.5.2-accessible-3 + 7.5.2-accessible-4 + 7.5.2-duplicate-1 + 7.5.2-duplicate-2 + 7.5.2-duplicate-3 + 7.5.2-duplicate-4 + 7.1-named-5 + 7.1-named-6 + 7.1-named-7 + 7.6-optional-restrictions-1 + 7.6-unnamed-scope-1 + 7.6-unnamed-scope-2 + 4.5.4-static-1 + 4.5.4-static-5 + 4.5.4-parameter-2 + 4.5.4-parameter-3 + 4.7.10-jvms-class-1 + 4.7.10-jvms-class-2 + 4.7.10-jvms-class-3 + 4.7.10-jvms-class-4 + 4.7.10-jvms-class-5 + 4.7.10-jvms-class-10 + 4.7.10-jvms-class-11 + 4.7.10-jvms-class-12 + 4.7.10-jvms-class-13 + 4.7.10-jvms-class-14 + 4.7.10-jvms-class-17 + 4.7.10-jvms-class-18 + 4.7.10-jvms-class-19 + 4.7.10-jvms-method-1 + 4.7.10-jvms-method-2 + 4.7.10-jvms-method-3 + 4.7.10-jvms-method-4 + 4.7.10-jvms-method-5 + 4.7.10-jvms-method-10 + 4.7.10-jvms-constructor-1 + 4.7.10-jvms-constructor-2 + 4.7.10-jvms-constructor-3 + 4.7.10-jvms-constructor-4 + 4.7.10-jvms-constructor-5 + 4.7.10-jvms-constructor-10 + 4.7.10-jvms-constructor-11 + 4.7.10-jvms-constructor-12 + 4.7.10-jvms-field-1 + 4.7.10-jvms-field-2 + 4.7.10-jvms-field-3 + 4.7.10-jvms-field-4 + 4.7.10-jvms-field-5 + 4.7.10-jvms-field-10 + 4.7.10-jvms-field-11 + 4.7.10-jvms-lex-6 + 4.7.10-jvms-lex-7 + 4.7.10-jvms-lex-8 + 4.7.10-jvms-lex-9 + 4.7.10-jvms-lex-10 + non-jls-argument-expansion-11 + non-jls-argument-expansion-12 + non-jls-argument-expansion-13 + non-jls-argument-expansion-error-2 + non-jls-argument-expansion-tokens-1 + non-jls-argument-expansion-tokens-2 + non-jls-argument-expansion-tokens-4 + non-jls-argument-expansion-tokens-5 + non-jls-zip-2 + 13.1-runtime-constant-1 + 13.1-runtime-constant-3 + 13.1-runtime-field-1 + 13.4.8-constant-runtime-1 + 14-runtime-jump-1 + 14-runtime-jump-2 + 14.3.1-runtime-3 + 8.1.2-runtime-1 + 6.6.1-runtime-privateconstructor-1 + 8.8.3-runtime-inner-4 + 8.8.7-runtime-accessible-default-1 + 8.3-runtime-1 + 8.4.6.4-multiple-runtime-1 + 16.5-runtime-1 + 16.5-runtime-2 + 16.5-runtime-3 + 16.5-runtime-4 + 16.5-runtime-5 + 12.4.1-runtime-1 + 12.4.1-runtime-2 + 12.4.1-runtime-3 + 12.4.1-runtime-4 + 15.9-runtime-numcalls-1 + 15.9.4-runtime-creation-1 + 15.9.4-runtime-creation-2 + 15.9.4-runtime-creation-5 + 15.25-runtime-1 + 15.11.2-runtime-1 + 15.11.2-runtime-2 + 15.11.1-runtime-static-1 + 15.11.1-runtime-static-2 + 15.11.1-runtime-static-3 + 15.11.1-runtime-static-4 + 15.12.3-runtime-mode-1 + 15.12.3-runtime-mode-2 + 15.12.3-runtime-mode-3 + 15.12.3-runtime-mode-4 + 15.12.3-runtime-mode-6 + 15.12.4.1-runtime-static-1 + 15.12.4.1-runtime-static-2 + 15.12.4.1-runtime-super-1 + 15.12.4.1-runtime-super-2 + 15.14-runtime-3 + 15.14-runtime-4 + 15.20-2-runtime-1 + 15.15-runtime-3 + 15.15-runtime-4 + 14.19.2-runtime-try-1 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/calls.c gcc-3.3/libjava/testsuite/libjava.jni/calls.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/calls.c 2001-08-03 16:21:23.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/calls.c 2003-02-28 17:57:58.000000000 +0000 *************** *** 1,7 **** #include #include ! jint Java_calls_docall (JNIEnv *env, jobject _this) { jmethodID method; --- 1,7 ---- #include #include ! JNIEXPORT jint JNICALL Java_calls_docall (JNIEnv *env, jobject _this) { jmethodID method; *************** Java_calls_docall (JNIEnv *env, jobject *** 47,52 **** --- 47,58 ---- if (l != 2033) ++fails; + method = (*env)->GetStaticMethodID (env, klass, "longpb_f", "(BJBJBJ)J"); + l = (*env)->CallStaticLongMethod (env, klass, method, (jbyte) 13, (jlong) 3, + (jbyte) 13, (jlong) 3, (jbyte) 13, (jlong) 4); + if (l != 3033) + ++fails; + method = (*env)->GetMethodID (env, klass, "void_f", "()V"); (*env)->CallVoidMethod (env, _this, method); diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/calls.java gcc-3.3/libjava/testsuite/libjava.jni/calls.java *** gcc-3.2.3/libjava/testsuite/libjava.jni/calls.java 2000-02-17 00:49:27.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/calls.java 2003-02-28 17:57:58.000000000 +0000 *************** public class calls extends base *** 37,42 **** --- 37,48 ---- return q + 2023; } + public static long longpb_f (byte b1, long q1, byte b2, long q2, + byte b3, long q3) + { + return q1 + q2 + q3 + 3023; + } + public void void_f () { System.out.println ("void"); diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/field.c gcc-3.3/libjava/testsuite/libjava.jni/field.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/field.c 2001-03-23 05:57:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/field.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,7 **** #include #include ! jobjectArray Java_field_fetch (JNIEnv *env, jobject this) { jclass cls; --- 1,7 ---- #include #include ! JNIEXPORT jobjectArray JNICALL Java_field_fetch (JNIEnv *env, jobject this) { jclass cls; diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/final_method.c gcc-3.3/libjava/testsuite/libjava.jni/final_method.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/final_method.c 2000-02-16 00:19:55.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/final_method.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,6 **** #include ! jstring Java_final_1method_meth (JNIEnv *env, jobject thisv) { return (*env)->NewStringUTF (env, "zardoz has spoken"); --- 1,6 ---- #include ! JNIEXPORT jstring JNICALL Java_final_1method_meth (JNIEnv *env, jobject thisv) { return (*env)->NewStringUTF (env, "zardoz has spoken"); diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/findclass.c gcc-3.3/libjava/testsuite/libjava.jni/findclass.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/findclass.c 2000-02-16 18:35:05.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/findclass.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 2,8 **** #include ! jclass Java_findclass_doit (JNIEnv *env, jclass klass, jstring name) { const char *buf = (*env)->GetStringUTFChars (env, name, NULL); --- 2,8 ---- #include ! JNIEXPORT jclass JNICALL Java_findclass_doit (JNIEnv *env, jclass klass, jstring name) { const char *buf = (*env)->GetStringUTFChars (env, name, NULL); diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/invoke.c gcc-3.3/libjava/testsuite/libjava.jni/invoke.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/invoke.c 2000-02-16 00:19:55.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/invoke.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,6 **** #include ! jint Java_invoke_val (JNIEnv *env, jclass klass) { return 23; --- 1,6 ---- #include ! JNIEXPORT jint JNICALL Java_invoke_val (JNIEnv *env, jclass klass) { return 23; diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/jni.exp gcc-3.3/libjava/testsuite/libjava.jni/jni.exp *** gcc-3.2.3/libjava/testsuite/libjava.jni/jni.exp 2002-03-27 16:28:23.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/jni.exp 2002-12-13 05:00:14.000000000 +0000 *************** proc gcj_jni_compile_c_to_so {file {opti *** 15,21 **** # Find jni.h. lappend options "additional_flags=-I$srcdir/../include" ! set x [prune_warnings [target_compile $file $soname executable $options]] if {$x != ""} { verbose "target_compile failed: $x" 2 fail "$name.c compilation" --- 15,22 ---- # Find jni.h. lappend options "additional_flags=-I$srcdir/../include" ! set x [libjava_prune_warnings \ ! [target_compile $file $soname executable $options]] if {$x != ""} { verbose "target_compile failed: $x" 2 fail "$name.c compilation" *************** proc gcj_jni_compile_c_to_so {file {opti *** 30,36 **** proc gcj_jni_build_header {file} { set gcjh [find_gcjh] set file [file rootname $file] ! set x [string trim [prune_warnings \ [lindex [local_exec "$gcjh -jni $file" "" "" 300] 1]]] if {$x != ""} { verbose "local_exec failed: $x" 2 --- 31,37 ---- proc gcj_jni_build_header {file} { set gcjh [find_gcjh] set file [file rootname $file] ! set x [string trim [libjava_prune_warnings \ [lindex [local_exec "$gcjh -jni $file" "" "" 300] 1]]] if {$x != ""} { verbose "local_exec failed: $x" 2 *************** proc gcj_jni_run {} { *** 167,173 **** # For now we only test JNI on native builds. if {$build_triplet == $host_triplet} { ! catch "glob -nocomplain ${srcdir}/${subdir}/*.java" srcfiles foreach x $srcfiles { gcj_jni_test_one $x --- 168,174 ---- # For now we only test JNI on native builds. if {$build_triplet == $host_triplet} { ! catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.java] } srcfiles foreach x $srcfiles { gcj_jni_test_one $x diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/martin.c gcc-3.3/libjava/testsuite/libjava.jni/martin.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/martin.c 2001-01-26 22:52:19.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/martin.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 2,8 **** #include "martin.h" #include ! void Java_martin_myNative(JNIEnv* env, jobject this, jstring s) { jclass cls; jfieldID fid; --- 2,9 ---- #include "martin.h" #include ! JNIEXPORT void JNICALL ! Java_martin_myNative(JNIEnv* env, jobject this, jstring s) { jclass cls; jfieldID fid; diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/noclass.c gcc-3.3/libjava/testsuite/libjava.jni/noclass.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/noclass.c 2000-02-27 21:42:40.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/noclass.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,6 **** #include ! void Java_noclass_find_1it (JNIEnv *env, jclass k) { /* We cause an exception by asking for a class we know does not --- 1,6 ---- #include ! JNIEXPORT void JNICALL Java_noclass_find_1it (JNIEnv *env, jclass k) { /* We cause an exception by asking for a class we know does not diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/overload.c gcc-3.3/libjava/testsuite/libjava.jni/overload.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/overload.c 2000-02-16 00:19:55.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/overload.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,13 **** #include ! jint Java_overload_over__I (JNIEnv *env, jclass klass, jint val) { return val; } ! jint Java_overload_over__II (JNIEnv *env, jclass klass, jint one, jint two) { return one + two; --- 1,13 ---- #include ! JNIEXPORT jint JNICALL Java_overload_over__I (JNIEnv *env, jclass klass, jint val) { return val; } ! JNIEXPORT jint JNICALL Java_overload_over__II (JNIEnv *env, jclass klass, jint one, jint two) { return one + two; diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/register.c gcc-3.3/libjava/testsuite/libjava.jni/register.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/register.c 2000-02-18 21:15:31.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/register.c 2003-01-24 17:40:05.000000000 +0000 *************** some_random_name (JNIEnv *env, jclass k, *** 8,14 **** return v - 1; } ! jint JNI_OnLoad (JavaVM *vm, void *nothing) { JNIEnv *env; --- 8,14 ---- return v - 1; } ! JNIEXPORT jint JNICALL JNI_OnLoad (JavaVM *vm, void *nothing) { JNIEnv *env; diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/simple_int.c gcc-3.3/libjava/testsuite/libjava.jni/simple_int.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/simple_int.c 2000-02-16 00:19:55.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/simple_int.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,6 **** #include ! jint Java_simple_1int_nat (JNIEnv *env, jclass klass, jint val) { return 2 * val; --- 1,6 ---- #include ! JNIEXPORT jint JNICALL Java_simple_1int_nat (JNIEnv *env, jclass klass, jint val) { return 2 * val; diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/throwit.c gcc-3.3/libjava/testsuite/libjava.jni/throwit.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/throwit.c 2000-02-16 22:39:36.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/throwit.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,7 **** #include #include ! void Java_throwit_throwit (JNIEnv *env, jclass klass, jstring name, jboolean is_new) { --- 1,7 ---- #include #include ! JNIEXPORT void JNICALL Java_throwit_throwit (JNIEnv *env, jclass klass, jstring name, jboolean is_new) { diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.jni/virtual.c gcc-3.3/libjava/testsuite/libjava.jni/virtual.c *** gcc-3.2.3/libjava/testsuite/libjava.jni/virtual.c 2000-02-16 00:19:55.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.jni/virtual.c 2003-01-24 17:40:05.000000000 +0000 *************** *** 1,6 **** #include ! jboolean Java_virtual_equals (JNIEnv *env, jobject thisv, jobject other) { return JNI_FALSE; --- 1,6 ---- #include ! JNIEXPORT jboolean JNICALL Java_virtual_equals (JNIEnv *env, jobject thisv, jobject other) { return JNI_FALSE; diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/Array_3.java gcc-3.3/libjava/testsuite/libjava.lang/Array_3.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/Array_3.java 2001-12-20 14:09:03.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/Array_3.java 2002-10-03 13:12:01.000000000 +0000 *************** public class Array_3 *** 12,17 **** --- 12,24 ---- return null; } + static int baz () + { + int[] x = (int[])null; + int nn = x.length; + return 5; + } + public static void main(String args[]) { boolean ok = false; *************** public class Array_3 *** 27,33 **** ok = true; } if (!ok) ! throw new RuntimeException("test failed"); ok = false; try --- 34,40 ---- ok = true; } if (!ok) ! throw new RuntimeException("test failed:1"); ok = false; try *************** public class Array_3 *** 40,46 **** ok = true; } if (!ok) ! throw new RuntimeException("test failed"); ok = false; try --- 47,53 ---- ok = true; } if (!ok) ! throw new RuntimeException("test failed:2"); ok = false; try *************** public class Array_3 *** 54,59 **** } if (!ok || nn != 0) ! throw new RuntimeException("test failed"); } } --- 61,91 ---- } if (!ok || nn != 0) ! throw new RuntimeException("test failed:3"); ! ! ok = false; ! try ! { ! int[] x = (int[])null; ! nn = x.length; ! } ! catch (NullPointerException _) ! { ! ok = true; ! } ! if (!ok) ! throw new RuntimeException("test failed:4"); ! ! ok = false; ! try ! { ! nn = baz (); ! } ! catch (NullPointerException _) ! { ! ok = true; ! } ! if (!ok) ! throw new RuntimeException("test failed:5"); } } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/assign.java gcc-3.3/libjava/testsuite/libjava.lang/assign.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/assign.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/assign.java 2003-05-01 21:51:32.000000000 +0000 *************** *** 0 **** --- 1,19 ---- + // Test for an array assignment bug we've had. + + public class assign + { + public static class base + { + } + + public static class derived extends base + { + } + + public static void main(String[] args) + { + base[][] x1 = new base[3][3]; + derived[] x2 = new derived[3]; + x1[0] = x2; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/emptystring.java gcc-3.3/libjava/testsuite/libjava.lang/emptystring.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/emptystring.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/emptystring.java 2002-05-04 13:24:40.000000000 +0000 *************** *** 0 **** --- 1,15 ---- + public class emptystring + { + public static void main(String[] args) + { + System.out.println("null".equals(n(0) + "")); + System.out.println("null".equals("" + n(0))); + System.out.println("x".equals(n(1) + "")); + System.out.println("x".equals("" + n(1))); + } + + static String n(int i) + { + if (i==0) return null; else return "x"; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/emptystring.out gcc-3.3/libjava/testsuite/libjava.lang/emptystring.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/emptystring.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/emptystring.out 2002-05-04 13:24:40.000000000 +0000 *************** *** 0 **** --- 1,4 ---- + true + true + true + true diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/EvaluationOrder.java gcc-3.3/libjava/testsuite/libjava.lang/EvaluationOrder.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/EvaluationOrder.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/EvaluationOrder.java 2002-10-15 18:43:11.000000000 +0000 *************** *** 0 **** --- 1,22 ---- + public class EvaluationOrder + { + private static int first (int x, int y) + { + return x; + } + + public static void main (String[] args) + { + int l = args.length; + + /* This should print: + 0 + 0 + 1 + */ + System.out.println (l); + System.out.println (first (l, ++l)); + System.out.println (l); + } + } + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/EvaluationOrder.out gcc-3.3/libjava/testsuite/libjava.lang/EvaluationOrder.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/EvaluationOrder.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/EvaluationOrder.out 2002-10-15 18:43:11.000000000 +0000 *************** *** 0 **** --- 1,3 ---- + 0 + 0 + 1 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/initexc.java gcc-3.3/libjava/testsuite/libjava.lang/initexc.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/initexc.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/initexc.java 2002-11-03 01:30:28.000000000 +0000 *************** *** 0 **** --- 1,37 ---- + public class initexc + { + public static class fail + { + static + { + // Static initializers must be able to complete normally. + if (true) + throw new NullPointerException("nope"); + } + + public static int val () + { + return 23; + } + } + + public static void main (String[] args) + { + try + { + System.out.println (fail.val ()); + } + catch (ExceptionInInitializerError _) + { + // Ok. + } + try + { + System.out.println (fail.val ()); + } + catch (NoClassDefFoundError _) + { + // Ok. + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/initfield.java gcc-3.3/libjava/testsuite/libjava.lang/initfield.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/initfield.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/initfield.java 2003-03-11 20:34:05.000000000 +0000 *************** *** 0 **** --- 1,20 ---- + // gcj generated buggy code when we reference a field of a + // non-constant member that we inherit from an interface. + + interface iface + { + final value x = new value(); + } + + final class value + { + Object field = "maude"; + } + + public class initfield implements iface + { + public static void main(String[] args) + { + System.out.println(x.field); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/initfield.out gcc-3.3/libjava/testsuite/libjava.lang/initfield.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/initfield.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/initfield.out 2003-03-11 20:34:05.000000000 +0000 *************** *** 0 **** --- 1 ---- + maude diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/inline.java gcc-3.3/libjava/testsuite/libjava.lang/inline.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/inline.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/inline.java 2002-07-02 17:21:10.000000000 +0000 *************** *** 0 **** --- 1,35 ---- + public class inline + { + static int factorial_1 (int n) + { + if (n > 0) + return n * factorial_1(n-1); + return 1; + } + + static int factorial_2 (int n) + { + if (n > 0) + return n * factorial_3(n-1); + return 1; + } + + static int factorial_3 (int n) + { + if (n > 0) + return n * factorial_2(n-1); + return 1; + } + + public static void main(String args[]) + { + if (factorial_1 (5) != 120) + System.out.println("This should not happen"); + else + System.out.println("OK"); + if (factorial_2 (5) != 120) + System.out.println("This should not happen"); + else + System.out.println("OK"); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/inline.out gcc-3.3/libjava/testsuite/libjava.lang/inline.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/inline.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/inline.out 2002-07-02 17:21:10.000000000 +0000 *************** *** 0 **** --- 1,2 ---- + OK + OK diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/lang.exp gcc-3.3/libjava/testsuite/libjava.lang/lang.exp *** gcc-3.2.3/libjava/testsuite/libjava.lang/lang.exp 1999-10-04 03:30:54.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/lang.exp 2002-07-18 17:42:31.000000000 +0000 *************** *** 1,6 **** global srcdir subdir ! catch "glob -nocomplain ${srcdir}/${subdir}/*.out" srcfiles verbose "srcfiles are $srcfiles" set prefix "" --- 1,6 ---- global srcdir subdir ! catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.out] } srcfiles verbose "srcfiles are $srcfiles" set prefix "" diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/override.java gcc-3.3/libjava/testsuite/libjava.lang/override.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/override.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/override.java 2002-12-05 08:06:10.000000000 +0000 *************** *** 0 **** --- 1,19 ---- + // Regression test that overrides a virtual method with a final one. + + class override1 + { + public int x1 () { return 3; } + } + + public class override extends override1 + { + public final int x1() { return 5; } + public final int x2() { return 7; } + + public static void main(String[] args) + { + override z = new override(); + System.out.println(z.x1()); + System.out.println(z.x2()); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/override.out gcc-3.3/libjava/testsuite/libjava.lang/override.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/override.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/override.out 2002-12-05 08:06:10.000000000 +0000 *************** *** 0 **** --- 1,2 ---- + 5 + 7 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6085.java gcc-3.3/libjava/testsuite/libjava.lang/PR6085.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6085.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6085.java 2002-04-09 05:25:11.000000000 +0000 *************** *** 0 **** --- 1,35 ---- + public class PR6085 + { + public static void main(String[] args) + { + F1 f1 = new F1(); + } + + static class F1 + { + F11 f11; + F12 f12; + + F1() + { + f12 = new F12(); + System.out.println (f12.i); + System.out.println (f12.k); + } + + class F11 + { + int k = 90; + F11() {} + } + + class F12 extends F11 + { + int i; + F12() + { + i = 17; + } + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6085.out gcc-3.3/libjava/testsuite/libjava.lang/PR6085.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6085.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6085.out 2002-04-09 05:25:11.000000000 +0000 *************** *** 0 **** --- 1,2 ---- + 17 + 90 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6204.java gcc-3.3/libjava/testsuite/libjava.lang/PR6204.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6204.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6204.java 2002-04-09 05:25:11.000000000 +0000 *************** *** 0 **** --- 1,38 ---- + class X + { + public Y getY() + { + return new Y(1); + } + } + + class Y extends X + { + int i; + + Y(int i) + { + this.i = i; + } + + public Y getY() + { + return new Y(2); + } + } + + class A + { + X x = new Y(-1); + public X getX() { return x; } + } + + public class PR6204 extends A + { + public Y getY() { return super.getX().getY(); } + + public static void main(String[] args) + { + System.out.println (new PR6204().getY().i); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6204.out gcc-3.3/libjava/testsuite/libjava.lang/PR6204.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6204.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6204.out 2002-04-09 05:25:11.000000000 +0000 *************** *** 0 **** --- 1 ---- + 2 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr6388.java gcc-3.3/libjava/testsuite/libjava.lang/pr6388.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr6388.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr6388.java 2002-10-23 22:56:13.000000000 +0000 *************** *** 0 **** --- 1,10 ---- + public class pr6388 + { + public static void main (String[] args) + { + System.out.println (Integer.MIN_VALUE); + System.out.println (0x80000000); + System.out.println (Integer.MIN_VALUE == 0x80000000); + System.out.println (0x80000000 == 0x80000000); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr6388.out gcc-3.3/libjava/testsuite/libjava.lang/pr6388.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr6388.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr6388.out 2002-10-23 22:56:13.000000000 +0000 *************** *** 0 **** --- 1,4 ---- + -2147483648 + -2147483648 + true + true diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6520.java gcc-3.3/libjava/testsuite/libjava.lang/PR6520.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6520.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6520.java 2002-06-11 14:38:44.000000000 +0000 *************** *** 0 **** --- 1,13 ---- + public class PR6520 + { + public static void check (double x, double y) + { + System.out.println (x == y); + } + + public static void main(String[] args) + { + check (Math.min (2.0f, Float.NaN), Float.NaN); + } + } + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6729.java gcc-3.3/libjava/testsuite/libjava.lang/PR6729.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6729.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6729.java 2002-05-23 03:30:13.000000000 +0000 *************** *** 0 **** --- 1,13 ---- + public class PR6729 + { + static int attr = 0x9; + + public static void main(String [] args) { + boolean res = ( ( 1 << attr ) & 0x1000 ) != 0 ; + System.out.println("this should be "+res+": "+isWhite()); + } + + public static boolean isWhite() { + return ( ( 1 << attr ) & 0x1000 ) != 0 ; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6729.out gcc-3.3/libjava/testsuite/libjava.lang/PR6729.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6729.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6729.out 2002-05-23 03:32:05.000000000 +0000 *************** *** 0 **** --- 1 ---- + this should be false: false diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6820.java gcc-3.3/libjava/testsuite/libjava.lang/PR6820.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6820.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6820.java 2002-05-27 05:47:40.000000000 +0000 *************** *** 0 **** --- 1,15 ---- + public class PR6820 + { + static void m(int a, int b) { + System.out.println("a="+a+" b="+b); + } + + static int a = 10; + + public static void main(String[] args) { + int b = 10; + m(a,++a); + m(b,++b); + } + } + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR6820.out gcc-3.3/libjava/testsuite/libjava.lang/PR6820.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR6820.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR6820.out 2002-05-27 05:47:40.000000000 +0000 *************** *** 0 **** --- 1,2 ---- + a=10 b=11 + a=10 b=11 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8415.java gcc-3.3/libjava/testsuite/libjava.lang/pr8415.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8415.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8415.java 2002-11-02 00:19:52.000000000 +0000 *************** *** 0 **** --- 1,15 ---- + import java.lang.reflect.*; + public class pr8415 + { + public static void meth () throws NullPointerException + { + throw new NullPointerException(); + } + + public static void main(String[] args) throws Throwable + { + Class k = pr8415.class; + Method m = k.getMethod ("meth", new Class[0]); + System.out.println(m); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8415.out gcc-3.3/libjava/testsuite/libjava.lang/pr8415.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8415.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8415.out 2002-11-02 00:19:52.000000000 +0000 *************** *** 0 **** --- 1 ---- + public static void pr8415.meth() throws java.lang.NullPointerException diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8676.java gcc-3.3/libjava/testsuite/libjava.lang/pr8676.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8676.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8676.java 2002-11-22 16:54:22.000000000 +0000 *************** *** 0 **** --- 1,11 ---- + public class pr8676 { + // The problem here was that this function couldn't be compiled to + // bytecode. + private void f(long j) { + boolean x = (1 << j) != 0; + } + + public static void main(String[] args) + { + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8823.java gcc-3.3/libjava/testsuite/libjava.lang/pr8823.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8823.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8823.java 2002-12-09 01:20:38.000000000 +0000 *************** *** 0 **** --- 1,24 ---- + interface I + { + public void m(); + } + + abstract class A implements I + { + // But doesn't define m() + } + + public class pr8823 extends A // which means it implements I + { + public static void main(String[] args) + { + // Defining c as either I or C will work. + A c = new pr8823(); + c.m(); + } + + public void m() + { + System.out.println("Hello World!"); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8823.out gcc-3.3/libjava/testsuite/libjava.lang/pr8823.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8823.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8823.out 2002-12-09 01:20:38.000000000 +0000 *************** *** 0 **** --- 1 ---- + Hello World! diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8823.xfail gcc-3.3/libjava/testsuite/libjava.lang/pr8823.xfail *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8823.xfail 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8823.xfail 2003-01-28 01:35:48.000000000 +0000 *************** *** 0 **** --- 1 ---- + xfail-byte diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/PR8866.java gcc-3.3/libjava/testsuite/libjava.lang/PR8866.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/PR8866.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/PR8866.java 2003-04-16 20:45:32.000000000 +0000 *************** *** 0 **** --- 1,22 ---- + public class PR8866 + { + public static void main (String args[]) + { + String attTypeString = ""; + + switch (args.length) { + case 1: + attTypeString = "string"; + case 4: + attTypeString = "ID";; + case 5: + attTypeString = "IDREF";; + case 6: + attTypeString = "NMTOKEN";; + case 7: + attTypeString = "NOTATION";; + default: + ; + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8945.java gcc-3.3/libjava/testsuite/libjava.lang/pr8945.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8945.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8945.java 2002-12-19 06:41:19.000000000 +0000 *************** *** 0 **** --- 1,9 ---- + public class pr8945 + { + public static void main(String[] args) + { + String foo = "hello"; + int pos = 3; + System.out.println(foo.substring(pos,++pos)); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/pr8945.out gcc-3.3/libjava/testsuite/libjava.lang/pr8945.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/pr8945.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/pr8945.out 2002-12-19 06:41:19.000000000 +0000 *************** *** 0 **** --- 1 ---- + l diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/StaticConstructor.java gcc-3.3/libjava/testsuite/libjava.lang/StaticConstructor.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/StaticConstructor.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/StaticConstructor.java 2002-10-15 19:00:24.000000000 +0000 *************** *** 0 **** --- 1,29 ---- + // Test to make sure static initializers are called + + class bar + { + public static int zog; + public static int zag; + + static + { + zog = 12; + zag = 2; + } + + public bar() { } + } + + public class StaticConstructor + { + static int foo () + { + return new bar().zog; + } + + public static void main(String args[]) + { + System.out.println ("" + (foo() + bar.zag)); + } + } + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/StaticConstructor.out gcc-3.3/libjava/testsuite/libjava.lang/StaticConstructor.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/StaticConstructor.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/StaticConstructor.out 2002-10-15 19:25:13.000000000 +0000 *************** *** 0 **** --- 1 ---- + 14 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/SyncGlobal.java gcc-3.3/libjava/testsuite/libjava.lang/SyncGlobal.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/SyncGlobal.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/SyncGlobal.java 2002-04-12 08:33:13.000000000 +0000 *************** *** 0 **** --- 1,24 ---- + // Test suitability of alignment of statically-allocated Objects. + class SyncGlobal + { + private static final byte[] global_1 = { 1 }; + private static final byte[] global_2 = { 2, 3 }; + private static final byte[] global_3 = { 4, 5, 6 }; + private static final byte[] global_4 = { 7, 8, 9, 10 }; + private static final byte[] global_5 = { 11, 12, 13, 14, 15 }; + private static final byte[] global_6 = { 16, 17, 18, 19, 20, 21 }; + private static final byte[] global_7 = { 22, 23, 24, 25, 26, 27, 28 }; + private static final byte[] global_8 = { 29, 30, 31, 32, 33, 34, 35, 36 }; + + public static void main (String args[]) + { + synchronized (global_1) { System.out.println ("PASS1"); } + synchronized (global_2) { System.out.println ("PASS2"); } + synchronized (global_3) { System.out.println ("PASS3"); } + synchronized (global_4) { System.out.println ("PASS4"); } + synchronized (global_5) { System.out.println ("PASS5"); } + synchronized (global_6) { System.out.println ("PASS6"); } + synchronized (global_7) { System.out.println ("PASS7"); } + synchronized (global_8) { System.out.println ("PASS8"); } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/SyncGlobal.out gcc-3.3/libjava/testsuite/libjava.lang/SyncGlobal.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/SyncGlobal.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/SyncGlobal.out 2002-04-12 08:33:13.000000000 +0000 *************** *** 0 **** --- 1,8 ---- + PASS1 + PASS2 + PASS3 + PASS4 + PASS5 + PASS6 + PASS7 + PASS8 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/TestProxy.java gcc-3.3/libjava/testsuite/libjava.lang/TestProxy.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/TestProxy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/TestProxy.java 2002-09-30 05:19:09.000000000 +0000 *************** *** 0 **** --- 1,34 ---- + import java.lang.reflect.*; + import java.net.*; + + public class TestProxy + { + public class MyInvocationHandler implements InvocationHandler + { + public Object invoke (Object proxy, + Method method, + Object[] args) + throws Throwable + { + System.out.println (args[0]); + return null; + } + } + + public static void main (String[] args) + { + try { + InvocationHandler ih = new MyInvocationHandler(); + + SocketOptions c = (SocketOptions) + Proxy.newProxyInstance (SocketOptions.class.getClassLoader(), + new Class[]{SocketOptions.class}, + ih); + + c.getOption (555); + + } catch (Exception e) { + e.printStackTrace (); + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/TestProxy.out gcc-3.3/libjava/testsuite/libjava.lang/TestProxy.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/TestProxy.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/TestProxy.out 2002-09-30 05:19:09.000000000 +0000 *************** *** 0 **** --- 1 ---- + 555 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/Throw_2.java gcc-3.3/libjava/testsuite/libjava.lang/Throw_2.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/Throw_2.java 2002-03-28 16:21:56.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/Throw_2.java 2003-04-16 11:45:59.000000000 +0000 *************** public class Throw_2 *** 34,39 **** --- 34,40 ---- } catch (NullPointerException _) { + System.out.println ("1"); } catch (Throwable _) { *************** public class Throw_2 *** 48,53 **** --- 49,55 ---- } catch (NullPointerException _) { + System.out.println ("2"); } catch (Throwable _) { diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/Throw_2.out gcc-3.3/libjava/testsuite/libjava.lang/Throw_2.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/Throw_2.out 2002-03-28 16:21:56.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/Throw_2.out 2003-04-16 11:45:59.000000000 +0000 *************** *** 0 **** --- 1,2 ---- + 1 + 2 diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/utf8concat.java gcc-3.3/libjava/testsuite/libjava.lang/utf8concat.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/utf8concat.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/utf8concat.java 2002-09-30 05:19:09.000000000 +0000 *************** *** 0 **** --- 1,11 ---- + public class utf8concat + { + private static String s; + + public static void main (String[] args) + { + // This causes a crash at runtime because the compiler is + // producing an invalid UTF-8 string literal. + s = "abc" + (char)183; + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/utilTest.java gcc-3.3/libjava/testsuite/libjava.lang/utilTest.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/utilTest.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/utilTest.java 2002-11-04 17:34:09.000000000 +0000 *************** *** 0 **** --- 1,58 ---- + class utilTest { + + public static void main(String[] argv) throws Throwable { + byte[] b = new byte[] { + 0x01, 0x23, 0x45, 0x67, (byte) 0x89, (byte) 0xab, + (byte) 0xcd, (byte) 0xef + }; + String s = "0123456789ABCDEF"; + System.out.println(toString(b)); + System.out.println(s); + System.out.println(toString(toBytesFromString(s))); + } + + // The following comes from the GNU Crypto project gnu.crypto.util.Util + + private static final char[] HEX_DIGITS = { + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' + }; + + public static byte[] toBytesFromString(String s) { + int limit = s.length(); + byte[] result = new byte[((limit + 1) / 2)]; + int i = 0, j = 0; + if ((limit % 2) == 1) { + result[j++] = (byte) fromDigit(s.charAt(i++)); + } + while (i < limit) { + result[j++] = + (byte)((fromDigit(s.charAt(i++)) << 4) | fromDigit(s.charAt(i++))); + } + return result; + } + + public static int fromDigit(char c) { + if (c >= '0' && c <= '9') { + return c - '0'; + } else if (c >= 'A' && c <= 'F') { + return c - 'A' + 10; + } else if (c >= 'a' && c <= 'f') { + return c - 'a' + 10; + } else + throw new IllegalArgumentException("Invalid hexadecimal digit: " + c); + } + + public static String toString(byte[] ba) { + return toString(ba, 0, ba.length); + } + + public static final String toString(byte[] ba, int offset, int length) { + char[] buf = new char[length * 2]; + for (int i = 0, j = 0, k; i < length; ) { + k = ba[offset + i++]; + buf[j++] = HEX_DIGITS[(k >>> 4) & 0x0F]; + buf[j++] = HEX_DIGITS[ k & 0x0F]; + } + return new String(buf); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/utilTest.out gcc-3.3/libjava/testsuite/libjava.lang/utilTest.out *** gcc-3.2.3/libjava/testsuite/libjava.lang/utilTest.out 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/utilTest.out 2002-11-04 17:34:09.000000000 +0000 *************** *** 0 **** --- 1,3 ---- + 0123456789ABCDEF + 0123456789ABCDEF + 0123456789ABCDEF diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.lang/verify.java gcc-3.3/libjava/testsuite/libjava.lang/verify.java *** gcc-3.2.3/libjava/testsuite/libjava.lang/verify.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.lang/verify.java 2003-05-07 01:22:01.000000000 +0000 *************** *** 0 **** --- 1,20 ---- + // Test for a verification regression. + + interface I { } + class D implements I { } + class E extends D { } + + public class verify + { + static void call(I v) { } + + static void doit (Object x) + { + call ((x instanceof I) ? (I) x : new E ()); + } + + public static void main(String[] args) + { + doit(null); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.loader/dummy.java gcc-3.3/libjava/testsuite/libjava.loader/dummy.java *** gcc-3.2.3/libjava/testsuite/libjava.loader/dummy.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.loader/dummy.java 2002-11-04 01:31:12.000000000 +0000 *************** *** 0 **** --- 1,6 ---- + // A dummy class + + public class dummy + { + } + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.loader/loader.exp gcc-3.3/libjava/testsuite/libjava.loader/loader.exp *** gcc-3.2.3/libjava/testsuite/libjava.loader/loader.exp 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.loader/loader.exp 2002-12-13 05:00:14.000000000 +0000 *************** *** 0 **** --- 1,67 ---- + # Tests for ClassLoader and native library loader code. + + # Do all the work for a single JNI test. Return 0 on failure. + proc gcj_loader_test_one {srcfile} { + global objdir srcdir subdir + + set resfile $srcdir/$subdir/[file rootname [file tail $srcfile]].out + + regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out + set executable "${objdir}/$out.exe" + + set errname [file rootname [file tail $srcfile]] + set args [libjava_arguments link] + lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/dummy.o" + set x [libjava_prune_warnings \ + [libjava_tcompile $srcfile "$executable" executable $args]] + + if { $x != "" } { + verbose "target_compile failed: $x" 2 + + fail "$errname compilation from source" + untested "$errname execution from source compiled test" + return + } + pass "$errname compilation from source" + + libjava_invoke $executable $executable "" $executable "" $resfile "" + + return 1 + } + + # Run the bytecode loader tests. + proc gcj_loader_run {} { + global srcdir subdir objdir + global build_triplet host_triplet + global GCJ_UNDER_TEST + + set file "${srcdir}/${subdir}/dummy.java" + if {! [bytecompile_file $file [pwd]]} { + fail "bytecompile $file" + # FIXME - should use `untested' on all remaining tests. + # But that is hard. + return 0 + } + pass "bytecompile $file" + + set args [libjava_arguments compile] + lappend args "additional_flags=--resource $objdir/dummy.class" + set x [libjava_prune_warnings \ + [libjava_tcompile "$objdir/dummy.class" "$objdir/dummy.o" object $args]] + + if { $x != "" } { + verbose "resource compilation failed: $x" 2 + + fail "resource compilation dummy.class" + return 0; + } + pass "resource compilation: dummy.class" + + catch { lsort [glob -nocomplain ${srcdir}/${subdir}/Test*.java] } srcfiles + + foreach x $srcfiles { + gcj_loader_test_one $x + } + } + + gcj_loader_run diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.loader/MyLoader.java gcc-3.3/libjava/testsuite/libjava.loader/MyLoader.java *** gcc-3.2.3/libjava/testsuite/libjava.loader/MyLoader.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.loader/MyLoader.java 2002-11-04 14:00:15.000000000 +0000 *************** *** 0 **** --- 1,14 ---- + import java.net.*; + + public class MyLoader extends URLClassLoader + { + public MyLoader (URL urls[]) + { + super (urls); + } + + public MyLoader (URL urls[], ClassLoader parent) + { + super (urls, parent); + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.loader/TestEarlyGC.java gcc-3.3/libjava/testsuite/libjava.loader/TestEarlyGC.java *** gcc-3.2.3/libjava/testsuite/libjava.loader/TestEarlyGC.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.loader/TestEarlyGC.java 2002-11-04 04:17:38.000000000 +0000 *************** *** 0 **** --- 1,52 ---- + public class TestEarlyGC extends ClassLoader { + + static TestEarlyGC[] a = new TestEarlyGC[10]; + + byte[] code = { + -54,-2,-70,-66,0,3,0,45,0,32,1,0,1,67,7,0, + 1,1,0,16,106,97,118,97,47,108,97,110,103,47,79,98, + 106,101,99,116,7,0,3,1,0,1,99,1,0,3,76,67, + 59,1,0,6,60,105,110,105,116,62,1,0,3,40,41,86, + 1,0,4,67,111,100,101,12,0,7,0,8,10,0,4,0, + 10,12,0,5,0,6,9,0,2,0,12,1,0,15,76,105, + 110,101,78,117,109,98,101,114,84,97,98,108,101,1,0,8, + 102,105,110,97,108,105,122,101,1,0,16,106,97,118,97,47, + 108,97,110,103,47,83,121,115,116,101,109,7,0,16,1,0, + 3,111,117,116,1,0,21,76,106,97,118,97,47,105,111,47, + 80,114,105,110,116,83,116,114,101,97,109,59,12,0,18,0, + 19,9,0,17,0,20,1,0,9,102,105,110,97,108,105,122, + 101,100,8,0,22,1,0,19,106,97,118,97,47,105,111,47, + 80,114,105,110,116,83,116,114,101,97,109,7,0,24,1,0, + 7,112,114,105,110,116,108,110,1,0,21,40,76,106,97,118, + 97,47,108,97,110,103,47,83,116,114,105,110,103,59,41,86, + 12,0,26,0,27,10,0,25,0,28,1,0,10,83,111,117, + 114,99,101,70,105,108,101,1,0,6,67,46,106,97,118,97, + 0,33,0,2,0,4,0,0,0,1,0,10,0,5,0,6, + 0,0,0,2,0,1,0,7,0,8,0,1,0,9,0,0, + 0,33,0,1,0,1,0,0,0,9,42,-73,0,11,42,-77, + 0,13,-79,0,0,0,1,0,14,0,0,0,6,0,1,0, + 4,0,5,0,4,0,15,0,8,0,1,0,9,0,0,0, + 33,0,2,0,1,0,0,0,9,-78,0,21,18,23,-74,0, + 29,-79,0,0,0,1,0,14,0,0,0,6,0,1,0,0, + 0,9,0,1,0,30,0,0,0,2,0,31 + }; + + TestEarlyGC() throws Throwable { + defineClass("C", code, 0, code.length).newInstance(); + } + + public static void main(String[] args) { + Runtime r = Runtime.getRuntime(); + + try { + for (int n = 0; n < a.length; n++) { + a[n] = new TestEarlyGC(); + r.gc(); + r.runFinalization(); + Thread.yield(); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } + } diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.loader/TestLeak.java gcc-3.3/libjava/testsuite/libjava.loader/TestLeak.java *** gcc-3.2.3/libjava/testsuite/libjava.loader/TestLeak.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.loader/TestLeak.java 2002-11-04 01:31:12.000000000 +0000 *************** *** 0 **** --- 1,33 ---- + import java.net.*; + import java.lang.reflect.*; + + public class TestLeak + { + class MyLoader extends URLClassLoader + { + public MyLoader (URL urls[]) + { + super (urls); + } + } + + public static void main (String[] args) + { + URLClassLoader ucl = + (URLClassLoader) ClassLoader.getSystemClassLoader(); + URL urls[] = ucl.getURLs (); + Class ifaces[] = new Class[1]; + ifaces[0] = java.lang.Comparable.class; + + try { + for (int i = 0; i < 100; i++) + { + Proxy.getProxyClass (new MyLoader (urls), ifaces); + } + } catch (Exception e) { + e.printStackTrace (); + } + } + } + + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.loader/TestMultiple.java gcc-3.3/libjava/testsuite/libjava.loader/TestMultiple.java *** gcc-3.2.3/libjava/testsuite/libjava.loader/TestMultiple.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.loader/TestMultiple.java 2002-11-04 01:31:12.000000000 +0000 *************** *** 0 **** --- 1,28 ---- + import java.net.*; + + public class TestMultiple + { + public static void main (String[] args) + { + URLClassLoader ucl = + (URLClassLoader) ClassLoader.getSystemClassLoader(); + URL urls[] = ucl.getURLs (); + + MyLoader t1 = new MyLoader (urls); + MyLoader t2 = new MyLoader (urls); + + Class c1, c2; + + try { + + c1 = t1.loadClass ("dummy"); + c2 = t2.loadClass ("dummy"); + + } + catch (Exception e) { + e.printStackTrace (); + } + } + } + + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.loader/TestParent.java gcc-3.3/libjava/testsuite/libjava.loader/TestParent.java *** gcc-3.2.3/libjava/testsuite/libjava.loader/TestParent.java 1970-01-01 00:00:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.loader/TestParent.java 2002-11-04 14:00:15.000000000 +0000 *************** *** 0 **** --- 1,29 ---- + import java.net.*; + + public class TestParent + { + public static void main (String[] args) + { + URLClassLoader ucl = + (URLClassLoader) ClassLoader.getSystemClassLoader(); + URL urls[] = ucl.getURLs (); + + MyLoader parent = new MyLoader (urls); + + MyLoader t1 = new MyLoader (urls, parent); + MyLoader t2 = new MyLoader (urls, parent); + + Class c1, c2; + + try { + + c1 = t1.loadClass ("dummy"); + c2 = t2.loadClass ("dummy"); + + } + catch (Exception e) { + e.printStackTrace (); + } + } + } + diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.mauve/mauve.exp gcc-3.3/libjava/testsuite/libjava.mauve/mauve.exp *** gcc-3.2.3/libjava/testsuite/libjava.mauve/mauve.exp 2002-04-07 09:22:00.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.mauve/mauve.exp 2003-02-15 16:47:37.000000000 +0000 *************** *** 1,4 **** ! # Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation. # Written by Tom Tromey . # Incorporate Mauve into libjava's DejaGNU test suite framework. --- 1,4 ---- ! # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation. # Written by Tom Tromey . # Incorporate Mauve into libjava's DejaGNU test suite framework. *************** proc mauve_compute_uses {aName} { *** 46,63 **** foreach file $ufiles { set file [file rootname $file].o lappend uses($item) $file } } return [lsort [array names uses]] } # Run all the Mauve tests. Return 1 on success, 0 on any failure. If # the tests are skipped, that is treated like success. proc test_mauve {} { global srcdir objdir subdir env ! if {! [info exists env(MAUVEDIR)]} then { verbose "MAUVEDIR not set; not running Mauve tests" return 1 } --- 46,85 ---- foreach file $ufiles { set file [file rootname $file].o lappend uses($item) $file + # Now add all inner classes + foreach inner [glob -nocomplain [file rootname $file]$*.class] { + # Prevent excessive escaping by replacing $ with a ^ in the .o name + set inner [file rootname $inner].o + regsub -all "\\$" $inner "\^" inner + lappend uses($item) $inner + } } } return [lsort [array names uses]] } + # Find Mauve sources. At end, env(MAUVEDIR) points to sources. + # Returns 0 if sources not found, 1 otherwise. + proc find_mauve_sources {} { + global env srcdir + + if {[info exists env(MAUVEDIR)]} { + return 1 + } elseif {[file isdirectory $srcdir/libjava.mauve/mauve]} { + set env(MAUVEDIR) $srcdir/libjava.mauve/mauve + return 1 + } + + return 0 + } + # Run all the Mauve tests. Return 1 on success, 0 on any failure. If # the tests are skipped, that is treated like success. proc test_mauve {} { global srcdir objdir subdir env ! if {! [find_mauve_sources]} then { verbose "MAUVEDIR not set; not running Mauve tests" return 1 } *************** proc test_mauve {} { *** 71,95 **** set full_srcdir [pwd] cd $here/mauve-build ! global env ! global GCJ_UNDER_TEST ! global TOOL_EXECUTABLE ! if ![info exists GCJ_UNDER_TEST] { ! if [info exists TOOL_EXECUTABLE] { ! set GCJ_UNDER_TEST $TOOL_EXECUTABLE; ! } else { ! if [info exists env(GCJ)] { ! set GCJ_UNDER_TEST env(GCJ) ! } else { ! set GCJ_UNDER_TEST "[find_gcj]" ! } ! } } ! # Append -B and -I so that libgcj.spec and libgcj.zip are found ! # before they're installed. ! set env(GCJ) "$GCJ_UNDER_TEST -B$objdir/../ -I$objdir/../libgcj.jar" if {[catch { system "$env(MAUVEDIR)/configure --with-gcj 2>&1" --- 93,117 ---- set full_srcdir [pwd] cd $here/mauve-build ! global env libgcj_jar ! global GCJ_UNDER_TEST ! global TOOL_EXECUTABLE ! if ![info exists GCJ_UNDER_TEST] { ! if [info exists TOOL_EXECUTABLE] { ! set GCJ_UNDER_TEST $TOOL_EXECUTABLE; ! } else { ! if [info exists env(GCJ)] { ! set GCJ_UNDER_TEST env(GCJ) ! } else { ! set GCJ_UNDER_TEST "[find_gcj]" ! } } + } ! # Append -B and -I so that libgcj.spec and libgcj.jar are found ! # before they're installed. ! set env(GCJ) "$GCJ_UNDER_TEST -B$objdir/../ -I$libgcj_jar" if {[catch { system "$env(MAUVEDIR)/configure --with-gcj 2>&1" *************** proc test_mauve {} { *** 139,145 **** foreach base {DejaGNUTestHarness gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException gnu/testlet/config} { set file $base.class set obj $base.o ! set x [prune_warnings \ [target_compile [pwd]/$file $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj" --- 161,167 ---- foreach base {DejaGNUTestHarness gnu/testlet/SimpleTestHarness gnu/testlet/TestHarness gnu/testlet/Testlet gnu/testlet/ResourceNotFoundException gnu/testlet/config} { set file $base.class set obj $base.o ! set x [libjava_prune_warnings \ [target_compile [pwd]/$file $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj" *************** proc test_mauve {} { *** 164,172 **** foreach obj $uses($file) { if {! [file exists $obj]} then { verbose "compiling $obj for test of $class" set srcfile [file rootname $obj].class ! set x [prune_warnings \ ! [target_compile [pwd]/$srcfile $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj for $class" set ok 0 --- 186,196 ---- foreach obj $uses($file) { if {! [file exists $obj]} then { verbose "compiling $obj for test of $class" + # The .class file does contain a $, but we can quote it between "'"s. set srcfile [file rootname $obj].class ! regsub -all "\\^" $srcfile "\$" srcfile ! set x [libjava_prune_warnings \ ! [libjava_tcompile '[pwd]/$srcfile' $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj for $class" set ok 0 *************** proc test_mauve {} { *** 180,187 **** continue } ! set x [prune_warnings [target_compile [concat $uses($file) $objlist] \ ! $Executable executable $link_args]] if {$x != ""} then { set proc_ok 0 fail "Link for $class" --- 204,212 ---- continue } ! set x [libjava_prune_warnings \ ! [libjava_tcompile [concat $uses($file) $objlist] \ ! $Executable executable $link_args]] if {$x != ""} then { set proc_ok 0 fail "Link for $class" *************** proc test_mauve {} { *** 220,226 **** proc test_mauve_sim {} { global srcdir subdir env ! if {! [info exists env(MAUVEDIR)]} then { verbose "MAUVEDIR not set; not running Mauve tests" return 1 } --- 245,251 ---- proc test_mauve_sim {} { global srcdir subdir env ! if {! [find_mauve_sources]} then { verbose "MAUVEDIR not set; not running Mauve tests" return 1 } *************** proc test_mauve_sim {} { *** 277,283 **** gnu/testlet/config} { set file $base.class set obj $base.o ! set x [prune_warnings \ [target_compile [pwd]/$file $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj" --- 302,308 ---- gnu/testlet/config} { set file $base.class set obj $base.o ! set x [libjava_prune_warnings \ [target_compile [pwd]/$file $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj" *************** proc test_mauve_sim {} { *** 306,312 **** if {! [file exists $obj]} then { verbose "compiling $obj for test of $class" set srcfile [file rootname $obj].class ! set x [prune_warnings \ [target_compile [pwd]/$srcfile $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj for $class" --- 331,337 ---- if {! [file exists $obj]} then { verbose "compiling $obj for test of $class" set srcfile [file rootname $obj].class ! set x [libjava_prune_warnings \ [target_compile [pwd]/$srcfile $obj object $compile_args]] if {$x != ""} then { fail "Compile $obj for $class" *************** proc test_mauve_sim {} { *** 342,348 **** return 0 } ! set x [prune_warnings \ [target_compile gnu/testlet/DejaGNUTestHarness.class \ gnu/testlet/DejaGNUTestHarness.o object $compile_args]] if {$x != ""} then { --- 367,373 ---- return 0 } ! set x [libjava_prune_warnings \ [target_compile gnu/testlet/DejaGNUTestHarness.class \ gnu/testlet/DejaGNUTestHarness.o object $compile_args]] if {$x != ""} then { *************** proc test_mauve_sim {} { *** 351,358 **** continue } ! set x [prune_warnings [target_compile [concat $uses($file) $objlist] \ ! $Executable executable $link_args]] if {$x != ""} then { set proc_ok 0 fail "Link for $class" --- 376,384 ---- continue } ! set x [libjava_prune_warnings \ ! [target_compile [concat $uses($file) $objlist] \ ! $Executable executable $link_args]] if {$x != ""} then { set proc_ok 0 fail "Link for $class" diff -Nrc3pad gcc-3.2.3/libjava/testsuite/libjava.mauve/xfails gcc-3.3/libjava/testsuite/libjava.mauve/xfails *** gcc-3.2.3/libjava/testsuite/libjava.mauve/xfails 2002-04-21 12:35:22.000000000 +0000 --- gcc-3.3/libjava/testsuite/libjava.mauve/xfails 2003-04-17 06:08:02.000000000 +0000 *************** *** 1,12 **** - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 1) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 2) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 4) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 9) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 10) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 12) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 13) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 14) - FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 15) FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 16) FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 17) FAIL: gnu.testlet.java.beans.Introspector.jdk11: getBeanInfo (number 19) --- 1,3 ---- *************** FAIL: gnu.testlet.java.lang.Character.ge *** 34,45 **** FAIL: gnu.testlet.java.lang.Character.getType (number 22) FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 1 (number 1) FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 2 (number 1) FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_intValue returned wrong results CYGNUS: Float to int conversions - 1 (number 1) - FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_longValue returned wrong results CYGNUS: Float to int conversions - 1 (number 1) FAIL: gnu.testlet.java.lang.Float.FloatTest: Error: test_intValue returned wrong results - 1 (number 1) ! FAIL: gnu.testlet.java.lang.String.CASE_INSENSITIVE_ORDER: unicode mappings (number 1) ! FAIL: gnu.testlet.java.lang.String.CASE_INSENSITIVE_ORDER: unicode mappings (number 2) ! FAIL: gnu.testlet.java.lang.System.getProperty: '' (number 1) FAIL: gnu.testlet.java.text.AttributedString.Test: Attribute key count (number 1) FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: patterns (number 2) FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: equals() (number 1) --- 25,49 ---- FAIL: gnu.testlet.java.lang.Character.getType (number 22) FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 1 (number 1) FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 2 (number 1) + FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 2) + FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 3) + FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 5) + FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaringClass (number 3) + FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaringClass (number 4) + FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaringClass (number 5) + FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 1) + FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 2) + FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 3) FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_intValue returned wrong results CYGNUS: Float to int conversions - 1 (number 1) FAIL: gnu.testlet.java.lang.Float.FloatTest: Error: test_intValue returned wrong results - 1 (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UTF-16") (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeBig") (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeBigUnmarked") (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeLittle") (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeLittleUnmarked") (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("ISO8859_15") (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16BE") (number 1) ! FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16LE") (number 1) FAIL: gnu.testlet.java.text.AttributedString.Test: Attribute key count (number 1) FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: patterns (number 2) FAIL: gnu.testlet.java.text.SimpleDateFormat.Test: equals() (number 1) *************** FAIL: gnu.testlet.java.text.SimpleDateFo *** 50,55 **** --- 54,93 ---- FAIL: gnu.testlet.java.text.SimpleDateFormat.regress: EST (number 1) FAIL: gnu.testlet.java.text.SimpleDateFormat.regress: PDT (number 1) FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: invalid locale (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: CollationElementIterator (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 0 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 1 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 10 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 11 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 12 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 13 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 2 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 3 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 4 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 5 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 6 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 7 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 8 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 9 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 0 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 1 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 10 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 11 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 12 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 13 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 2 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 3 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 4 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 5 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 6 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 7 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: primaryOrder() 8 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 12 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 4 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 5 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 7 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 9 (number 1) + FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: tertiaryOrder() 10 (number 1) FAIL: gnu.testlet.java.net.ServerSocket.ServerSocketTest: Error : test_params failed - 5getInetAddress did not return proper values (number 1) FAIL: gnu.testlet.java.net.Socket.SocketTest: Error : test_BasicServer failed - 11 exception was thrown :Illegal seek (number 1) FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_Basics - 2 should not have raised Throwable here (number 1) *************** FAIL: gnu.testlet.java.net.URL.URLTest: *** 62,71 **** FAIL: gnu.testlet.java.net.URL.URLTest: new URL(protocol, host, file) (number 26) FAIL: gnu.testlet.java.net.URL.URLTest: new URL(protocol, host, file) (number 54) FAIL: gnu.testlet.java.net.MulticastSocket.MulticastSocketTest: joinGroup() twice. (number 1) ! FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: should throw NullPointerException -- 1 (number 1) ! FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: v does not contain:$longvalue=I'mtryingtogiveavaluelongerthen40characters$ (number 1) ! FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: should throw NullPointerException -- 1 (number 1) ! FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: all elements are the same (number 1) ! FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: checkvalue -- got:$ents=$ (number 1) ! FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: checkvalue -- got:$dog=nocat $ (number 1) ! FAIL: gnu.testlet.java.util.Properties.AcuniaPropertiesTest: check if all elements were found -- got: [dog=no\cat ] (number 1) --- 100,130 ---- FAIL: gnu.testlet.java.net.URL.URLTest: new URL(protocol, host, file) (number 26) FAIL: gnu.testlet.java.net.URL.URLTest: new URL(protocol, host, file) (number 54) FAIL: gnu.testlet.java.net.MulticastSocket.MulticastSocketTest: joinGroup() twice. (number 1) ! FAIL: gnu.testlet.java.io.File.jdk11: getCanonicalPath () (number 1) ! FAIL: gnu.testlet.java.io.ObjectInputOutput.InputTest: gnu.testlet.java.io.ObjectInputOutput.Test$GetPutField (number 1) ! FAIL: gnu.testlet.java.io.ObjectInputOutput.OutputTest: Serializable: gnu.testlet.java.io.ObjectInputOutput.Test$Extern () (number 2) ! FAIL: gnu.testlet.java.io.ObjectInputOutput.OutputTest: Serializable: test(str=null, x=0) (number 2) ! FAIL: gnu.testlet.java.io.OutputStreamWriter.jdk11: OutputStreamWriter(writer, encoding) (number 1) ! FAIL: gnu.testlet.java.io.OutputStreamWriter.jdk11: OutputStreamWriter(writer, encoding) // alias (number 1) ! FAIL: gnu.testlet.java.lang.Double.DoubleTest: Error: test_shortbyteValue failed - 5 (number 1) ! FAIL: gnu.testlet.java.lang.Float.FloatTest: Error: test_shortbyteValue failed - 5 (number 1) ! FAIL: gnu.testlet.java.net.DatagramSocket.DatagramSocketTest2: Expected IOException (number 1) ! FAIL: gnu.testlet.java.net.Socket.SocketTest: Error : test_params failed - 1 get port did not return proper values (number 1) ! FAIL: gnu.testlet.java.net.Socket.jdk13: unexpected error: Success (number 1) ! FAIL: gnu.testlet.java.sql.Date.DateTest: getHours (number 1) ! FAIL: gnu.testlet.java.sql.Date.DateTest: getMinutes (number 1) ! FAIL: gnu.testlet.java.sql.Date.DateTest: getSeconds (number 1) ! FAIL: gnu.testlet.java.sql.Date.DateTest: setHours (number 1) ! FAIL: gnu.testlet.java.sql.Date.DateTest: setMinutes (number 1) ! FAIL: gnu.testlet.java.sql.Date.DateTest: setSeconds (number 1) ! FAIL: gnu.testlet.java.sql.Date.DateTest: valueOf (number 1) ! FAIL: gnu.testlet.java.sql.DriverManager.DriverManagerTest: getDriver (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: getDate (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: getDay (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: getMonth (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: getYear (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: setDate (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: setMonth (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: setYear (number 1) ! FAIL: gnu.testlet.java.sql.Time.TimeTest: valueOf (number 1) ! FAIL: gnu.testlet.java.sql.Timestamp.TimestampTest: valueOf (number 1) diff -Nrc3pad gcc-3.2.3/libjava/testsuite/Makefile.am gcc-3.3/libjava/testsuite/Makefile.am *** gcc-3.2.3/libjava/testsuite/Makefile.am 2001-04-04 23:38:53.000000000 +0000 --- gcc-3.3/libjava/testsuite/Makefile.am 2002-06-24 04:44:51.000000000 +0000 *************** EXPECT = `if [ -f $(top_builddir)/../exp *** 7,15 **** echo $(top_builddir)/../expect/expect ; \ else echo expect ; fi` ! RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ echo $(top_srcdir)/../dejagnu/runtest ; \ ! else echo runtest; fi` ! ! RUNTESTFLAGS = @AM_RUNTESTFLAGS@ --- 7,15 ---- echo $(top_builddir)/../expect/expect ; \ else echo expect ; fi` ! RUNTEST = "`if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ echo $(top_srcdir)/../dejagnu/runtest ; \ ! else echo runtest; fi` $(AM_RUNTESTFLAGS)" + ## Tell dejagnu whether the interpreter is enabled. + AM_RUNTESTFLAGS = INTERPRETER=$(INTERPRETER) diff -Nrc3pad gcc-3.2.3/libjava/testsuite/Makefile.in gcc-3.3/libjava/testsuite/Makefile.in *** gcc-3.2.3/libjava/testsuite/Makefile.in 2002-04-10 13:10:16.000000000 +0000 --- gcc-3.3/libjava/testsuite/Makefile.in 2003-03-01 22:57:53.000000000 +0000 *************** *** 1,6 **** ! # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. --- 1,6 ---- ! # Makefile.in generated automatically by automake 1.4 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. *************** host_alias = @host_alias@ *** 63,71 **** host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ - AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ AR = @AR@ AS = @AS@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ --- 63,71 ---- host_triplet = @host@ target_alias = @target_alias@ target_triplet = @target@ AR = @AR@ AS = @AS@ + BACKTRACESPEC = @BACKTRACESPEC@ CC = @CC@ CHECKREFSPEC = @CHECKREFSPEC@ COMPPATH = @COMPPATH@ *************** GCOBJS = @GCOBJS@ *** 87,93 **** --- 87,95 ---- GCSPEC = @GCSPEC@ GCTESTSPEC = @GCTESTSPEC@ HASH_SYNC_SPEC = @HASH_SYNC_SPEC@ + IEEESPEC = @IEEESPEC@ INCLTDL = @INCLTDL@ + INTERPRETER = @INTERPRETER@ JC1GCSPEC = @JC1GCSPEC@ LIBFFI = @LIBFFI@ LIBFFIINCS = @LIBFFIINCS@ *************** here = @here@ *** 129,134 **** --- 131,139 ---- libgcj_basedir = @libgcj_basedir@ mkinstalldirs = @mkinstalldirs@ tool_include_dir = @tool_include_dir@ + toolexecdir = @toolexecdir@ + toolexeclibdir = @toolexeclibdir@ + toolexecmainlibdir = @toolexecmainlibdir@ AUTOMAKE_OPTIONS = foreign dejagnu *************** EXPECT = `if [ -f $(top_builddir)/../exp *** 138,149 **** else echo expect ; fi` ! RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ echo $(top_srcdir)/../dejagnu/runtest ; \ ! else echo runtest; fi` ! RUNTESTFLAGS = @AM_RUNTESTFLAGS@ CONFIG_HEADER = ../include/config.h ../gcj/libgcj-config.h CONFIG_CLEAN_FILES = DIST_COMMON = ChangeLog Makefile.am Makefile.in --- 143,154 ---- else echo expect ; fi` ! RUNTEST = "`if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ echo $(top_srcdir)/../dejagnu/runtest ; \ ! else echo runtest; fi` $(AM_RUNTESTFLAGS)" ! AM_RUNTESTFLAGS = INTERPRETER=$(INTERPRETER) CONFIG_HEADER = ../include/config.h ../gcj/libgcj-config.h CONFIG_CLEAN_FILES = DIST_COMMON = ChangeLog Makefile.am Makefile.in *************** distdir: $(DISTFILES) *** 187,192 **** --- 192,199 ---- fi; \ done + RUNTESTFLAGS = + DEJATOOL = $(PACKAGE) RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir diff -Nrc3pad gcc-3.2.3/libjava/verify.cc gcc-3.3/libjava/verify.cc *** gcc-3.2.3/libjava/verify.cc 2002-03-10 04:50:55.000000000 +0000 --- gcc-3.3/libjava/verify.cc 2003-05-07 01:22:24.000000000 +0000 *************** *** 1,6 **** // defineclass.cc - defining a class from .class format. ! /* Copyright (C) 2001, 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // defineclass.cc - defining a class from .class format. ! /* Copyright (C) 2001, 2002, 2003 Free Software Foundation This file is part of libgcj. *************** private: *** 128,133 **** --- 128,161 ---- return r; } + __attribute__ ((__noreturn__)) void verify_fail (char *s, jint pc = -1) + { + using namespace java::lang; + StringBuffer *buf = new StringBuffer (); + + buf->append (JvNewStringLatin1 ("verification failed")); + if (pc == -1) + pc = start_PC; + if (pc != -1) + { + buf->append (JvNewStringLatin1 (" at PC ")); + buf->append (pc); + } + + _Jv_InterpMethod *method = current_method; + buf->append (JvNewStringLatin1 (" in ")); + buf->append (current_class->getName()); + buf->append ((jchar) ':'); + buf->append (JvNewStringUTF (method->get_method()->name->data)); + buf->append ((jchar) '('); + buf->append (JvNewStringUTF (method->get_method()->signature->data)); + buf->append ((jchar) ')'); + + buf->append (JvNewStringLatin1 (": ")); + buf->append (JvNewStringLatin1 (s)); + throw new java::lang::VerifyError (buf->toString ()); + } + // This enum holds a list of tags for all the different types we // need to handle. Reference types are treated specially by the // type class. *************** private: *** 405,411 **** using namespace java::lang; java::lang::ClassLoader *loader ! = verifier->current_class->getClassLoader(); // We might see either kind of name. Sigh. if (data.name->data[0] == 'L' && data.name->data[data.name->length - 1] == ';') --- 433,439 ---- using namespace java::lang; java::lang::ClassLoader *loader ! = verifier->current_class->getClassLoaderInternal(); // We might see either kind of name. Sigh. if (data.name->data[0] == 'L' && data.name->data[data.name->length - 1] == ';') *************** private: *** 458,465 **** if (key < reference_type || k.key < reference_type) return key == k.key; ! // The `null' type is convertible to any reference type. ! // FIXME: is this correct for THIS? if (key == null_type || k.key == null_type) return true; --- 486,493 ---- if (key < reference_type || k.key < reference_type) return key == k.key; ! // The `null' type is convertible to any initialized reference ! // type. if (key == null_type || k.key == null_type) return true; *************** private: *** 571,577 **** if (key == reference_type) return type (_Jv_GetArrayClass (data.klass, ! data.klass->getClassLoader ())); else verifier->verify_fail ("internal error in type::to_array()"); } --- 599,605 ---- if (key == reference_type) return type (_Jv_GetArrayClass (data.klass, ! data.klass->getClassLoaderInternal())); else verifier->verify_fail ("internal error in type::to_array()"); } *************** private: *** 695,701 **** while (arraycount > 0) { java::lang::ClassLoader *loader ! = verifier->current_class->getClassLoader(); k = _Jv_GetArrayClass (k, loader); --arraycount; } --- 723,729 ---- while (arraycount > 0) { java::lang::ClassLoader *loader ! = verifier->current_class->getClassLoaderInternal(); k = _Jv_GetArrayClass (k, loader); --arraycount; } *************** private: *** 793,798 **** --- 821,832 ---- // assigns to locals[0] (overwriting `this') and then returns // without really initializing. type this_type; + // This is a list of all subroutines that have been seen at this + // point. Ordinarily this is NULL; it is only allocated and used + // in relatively weird situations involving non-ret exit from a + // subroutine. We have to keep track of this in this way to avoid + // endless recursion in these cases. + subr_info *seen_subrs; // INVALID marks a state which is not on the linked list of states // requiring reverification. *************** private: *** 811,816 **** --- 845,851 ---- stack = NULL; locals = NULL; local_changed = NULL; + seen_subrs = NULL; } state (int max_stack, int max_locals) *************** private: *** 823,828 **** --- 858,864 ---- stack[i] = unsuitable_type; locals = new type[max_locals]; local_changed = (bool *) _Jv_Malloc (sizeof (bool) * max_locals); + seen_subrs = NULL; for (int i = 0; i < max_locals; ++i) { locals[i] = unsuitable_type; *************** private: *** 838,843 **** --- 874,880 ---- stack = new type[max_stack]; locals = new type[max_locals]; local_changed = (bool *) _Jv_Malloc (sizeof (bool) * max_locals); + seen_subrs = NULL; copy (orig, max_stack, max_locals, ret_semantics); next = INVALID; } *************** private: *** 850,855 **** --- 887,893 ---- delete[] locals; if (local_changed) _Jv_Free (local_changed); + clean_subrs (); } void *operator new[] (size_t bytes) *************** private: *** 872,877 **** --- 910,926 ---- _Jv_Free (mem); } + void clean_subrs () + { + subr_info *info = seen_subrs; + while (info != NULL) + { + subr_info *next = info->next; + _Jv_Free (info); + info = next; + } + } + void copy (const state *copy, int max_stack, int max_locals, bool ret_semantics = false) { *************** private: *** 891,896 **** --- 940,955 ---- locals[i] = copy->locals[i]; local_changed[i] = copy->local_changed[i]; } + + clean_subrs (); + if (copy->seen_subrs) + { + for (subr_info *info = seen_subrs; info != NULL; info = info->next) + add_subr (info->pc); + } + else + seen_subrs = NULL; + this_type = copy->this_type; // Don't modify `next'. } *************** private: *** 917,922 **** --- 976,990 ---- local_changed[i] = false; } + // Indicate that we've been in this this subroutine. + void add_subr (int pc) + { + subr_info *n = (subr_info *) _Jv_Malloc (sizeof (subr_info)); + n->pc = pc; + n->next = seen_subrs; + seen_subrs = n; + } + // Merge STATE_OLD into this state. Destructively modifies this // state. Returns true if the new state was in fact changed. // Will throw an exception if the states are not mergeable. *************** private: *** 944,953 **** } else { ! // If the subroutines differ, indicate that the state ! // changed. This is needed to detect when subroutines have ! // merged. ! changed = true; } // Merge stacks. Special handling for NO_STACK case. --- 1012,1034 ---- } else { ! // If the subroutines differ, and we haven't seen this ! // subroutine before, indicate that the state changed. This ! // is needed to detect when subroutines have merged. ! bool found = false; ! for (subr_info *info = seen_subrs; info != NULL; info = info->next) ! { ! if (info->pc == state_old->subroutine) ! { ! found = true; ! break; ! } ! } ! if (! found) ! { ! add_subr (state_old->subroutine); ! changed = true; ! } } // Merge stacks. Special handling for NO_STACK case. *************** private: *** 1121,1134 **** return r; } - type pop64 () - { - type r = pop_raw (); - if (! r.iswide ()) - verify_fail ("wide pop of narrow type"); - return r; - } - type pop_type (type match) { match.promote (); --- 1202,1207 ---- *************** private: *** 1138,1143 **** --- 1211,1229 ---- return t; } + // Pop a reference which is guaranteed to be initialized. MATCH + // doesn't have to be a reference type; in this case this acts like + // pop_type. + type pop_init_ref (type match) + { + type t = pop_raw (); + if (t.isreference () && ! t.isinitialized ()) + verify_fail ("initialized reference required"); + else if (! match.compatible (t, this)) + verify_fail ("incompatible type on stack"); + return t; + } + // Pop a reference type or a return address. type pop_ref_or_return () { *************** private: *** 1338,1344 **** { int *prev_loc = &next_verify_pc; int npc = next_verify_pc; - bool skipped = false; while (npc != state::NO_NEXT) { --- 1424,1429 ---- *************** private: *** 1355,1361 **** return npc; } - skipped = true; prev_loc = &states[npc]->next; npc = states[npc]->next; } --- 1440,1445 ---- *************** private: *** 1434,1439 **** --- 1518,1529 ---- for (subr_info *subr = jsr_ptrs[csub]; subr != NULL; subr = subr->next) { + // We might be returning to a `jsr' that is at the end of the + // bytecode. This is ok if we never return from the called + // subroutine, but if we see this here it is an error. + if (subr->pc >= current_method->code_length) + verify_fail ("fell off end"); + // Temporarily modify the current state so it looks like we're // in the enclosing context. current_state->subroutine = get_subroutine (subr->pc); *************** private: *** 1483,1498 **** // the local variable state across the jsr, but the subroutine // might change the stack depth, so we can't make any assumptions // about it. So we have yet another special case. We know that ! // at this point PC points to the instruction after the jsr. ! ! // FIXME: what if we have a jsr at the end of the code, but that ! // jsr has no corresponding ret? Is this verifiable, or is it ! // not? If it is then we need a special case here. ! if (PC >= current_method->code_length) ! verify_fail ("fell off end"); ! ! current_state->stacktop = state::NO_STACK; ! push_jump_merge (PC, current_state); invalidate_pc (); } --- 1573,1587 ---- // the local variable state across the jsr, but the subroutine // might change the stack depth, so we can't make any assumptions // about it. So we have yet another special case. We know that ! // at this point PC points to the instruction after the jsr. Note ! // that it is ok to have a `jsr' at the end of the bytecode, ! // provided that the called subroutine never returns. So, we have ! // a special case here and another one when we handle the ret. ! if (PC < current_method->code_length) ! { ! current_state->stacktop = state::NO_STACK; ! push_jump_merge (PC, current_state); ! } invalidate_pc (); } *************** private: *** 1525,1530 **** --- 1614,1632 ---- case long_type: k = JvPrimClass (long); break; + + // These aren't used here but we call them out to avoid + // warnings. + case void_type: + case unsuitable_type: + case return_address_type: + case continuation_type: + case unused_by_subroutine_type: + case reference_type: + case null_type: + case unresolved_reference_type: + case uninitialized_reference_type: + case uninitialized_unresolved_reference_type: default: verify_fail ("unknown type in construct_primitive_array_type"); } *************** private: *** 1828,1833 **** --- 1930,1959 ---- note_branch_target (compute_jump (get_int ()), last_was_jsr); break; + // These are unused here, but we call them out explicitly + // so that -Wswitch-enum doesn't complain. + case op_putfield_1: + case op_putfield_2: + case op_putfield_4: + case op_putfield_8: + case op_putfield_a: + case op_putstatic_1: + case op_putstatic_2: + case op_putstatic_4: + case op_putstatic_8: + case op_putstatic_a: + case op_getfield_1: + case op_getfield_2s: + case op_getfield_2u: + case op_getfield_4: + case op_getfield_8: + case op_getfield_a: + case op_getstatic_1: + case op_getstatic_2s: + case op_getstatic_2u: + case op_getstatic_4: + case op_getstatic_8: + case op_getstatic_a: default: verify_fail ("unrecognized instruction in branch_prepass", start_PC); *************** private: *** 1845,1862 **** // Verify exception handlers. for (int i = 0; i < current_method->exc_count; ++i) { ! if (! (flags[exception[i].handler_pc] & FLAG_INSN_START)) verify_fail ("exception handler not at instruction start", ! exception[i].handler_pc); ! if (! (flags[exception[i].start_pc] & FLAG_INSN_START)) verify_fail ("exception start not at instruction start", ! exception[i].start_pc); ! if (exception[i].end_pc != current_method->code_length ! && ! (flags[exception[i].end_pc] & FLAG_INSN_START)) verify_fail ("exception end not at instruction start", ! exception[i].end_pc); ! flags[exception[i].handler_pc] |= FLAG_BRANCH_TARGET; } } --- 1971,1988 ---- // Verify exception handlers. for (int i = 0; i < current_method->exc_count; ++i) { ! if (! (flags[exception[i].handler_pc.i] & FLAG_INSN_START)) verify_fail ("exception handler not at instruction start", ! exception[i].handler_pc.i); ! if (! (flags[exception[i].start_pc.i] & FLAG_INSN_START)) verify_fail ("exception start not at instruction start", ! exception[i].start_pc.i); ! if (exception[i].end_pc.i != current_method->code_length ! && ! (flags[exception[i].end_pc.i] & FLAG_INSN_START)) verify_fail ("exception end not at instruction start", ! exception[i].end_pc.i); ! flags[exception[i].handler_pc.i] |= FLAG_BRANCH_TARGET; } } *************** private: *** 2026,2046 **** bool initialize_stack () { int var = 0; ! bool is_init = false; using namespace java::lang::reflect; if (! Modifier::isStatic (current_method->self->accflags)) { type kurr (current_class); ! if (_Jv_equalUtf8Consts (current_method->self->name, gcj::init_name)) { kurr.set_uninitialized (type::SELF, this); is_init = true; } set_variable (0, kurr); current_state->set_this_type (kurr); ++var; } // We have to handle wide arguments specially here. int arg_count = _Jv_count_arguments (current_method->self->signature); --- 2152,2182 ---- bool initialize_stack () { int var = 0; ! bool is_init = _Jv_equalUtf8Consts (current_method->self->name, ! gcj::init_name); ! bool is_clinit = _Jv_equalUtf8Consts (current_method->self->name, ! gcj::clinit_name); using namespace java::lang::reflect; if (! Modifier::isStatic (current_method->self->accflags)) { type kurr (current_class); ! if (is_init) { kurr.set_uninitialized (type::SELF, this); is_init = true; } + else if (is_clinit) + verify_fail (" method must be static"); set_variable (0, kurr); current_state->set_this_type (kurr); ++var; } + else + { + if (is_init) + verify_fail (" method must be non-static"); + } // We have to handle wide arguments specially here. int arg_count = _Jv_count_arguments (current_method->self->signature); *************** private: *** 2149,2160 **** // through them all. for (int i = 0; i < current_method->exc_count; ++i) { ! if (PC >= exception[i].start_pc && PC < exception[i].end_pc) { type handler (&java::lang::Throwable::class$); ! if (exception[i].handler_type != 0) ! handler = check_class_constant (exception[i].handler_type); ! push_exception_jump (handler, exception[i].handler_pc); } } --- 2285,2296 ---- // through them all. for (int i = 0; i < current_method->exc_count; ++i) { ! if (PC >= exception[i].start_pc.i && PC < exception[i].end_pc.i) { type handler (&java::lang::Throwable::class$); ! if (exception[i].handler_type.i != 0) ! handler = check_class_constant (exception[i].handler_type.i); ! push_exception_jump (handler, exception[i].handler_pc.i); } } *************** private: *** 2264,2305 **** break; case op_iaload: pop_type (int_type); ! push_type (require_array_type (pop_type (reference_type), int_type)); break; case op_laload: pop_type (int_type); ! push_type (require_array_type (pop_type (reference_type), long_type)); break; case op_faload: pop_type (int_type); ! push_type (require_array_type (pop_type (reference_type), float_type)); break; case op_daload: pop_type (int_type); ! push_type (require_array_type (pop_type (reference_type), double_type)); break; case op_aaload: pop_type (int_type); ! push_type (require_array_type (pop_type (reference_type), reference_type)); break; case op_baload: pop_type (int_type); ! require_array_type (pop_type (reference_type), byte_type); push_type (int_type); break; case op_caload: pop_type (int_type); ! require_array_type (pop_type (reference_type), char_type); push_type (int_type); break; case op_saload: pop_type (int_type); ! require_array_type (pop_type (reference_type), short_type); push_type (int_type); break; case op_istore: --- 2400,2441 ---- break; case op_iaload: pop_type (int_type); ! push_type (require_array_type (pop_init_ref (reference_type), int_type)); break; case op_laload: pop_type (int_type); ! push_type (require_array_type (pop_init_ref (reference_type), long_type)); break; case op_faload: pop_type (int_type); ! push_type (require_array_type (pop_init_ref (reference_type), float_type)); break; case op_daload: pop_type (int_type); ! push_type (require_array_type (pop_init_ref (reference_type), double_type)); break; case op_aaload: pop_type (int_type); ! push_type (require_array_type (pop_init_ref (reference_type), reference_type)); break; case op_baload: pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), byte_type); push_type (int_type); break; case op_caload: pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), char_type); push_type (int_type); break; case op_saload: pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), short_type); push_type (int_type); break; case op_istore: *************** private: *** 2350,2397 **** case op_iastore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), int_type); break; case op_lastore: pop_type (long_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), long_type); break; case op_fastore: pop_type (float_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), float_type); break; case op_dastore: pop_type (double_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), double_type); break; case op_aastore: pop_type (reference_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), reference_type); break; case op_bastore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), byte_type); break; case op_castore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), char_type); break; case op_sastore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_type (reference_type), short_type); break; case op_pop: pop32 (); break; case op_pop2: ! pop64 (); break; case op_dup: { --- 2486,2537 ---- case op_iastore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), int_type); break; case op_lastore: pop_type (long_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), long_type); break; case op_fastore: pop_type (float_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), float_type); break; case op_dastore: pop_type (double_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), double_type); break; case op_aastore: pop_type (reference_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), reference_type); break; case op_bastore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), byte_type); break; case op_castore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), char_type); break; case op_sastore: pop_type (int_type); pop_type (int_type); ! require_array_type (pop_init_ref (reference_type), short_type); break; case op_pop: pop32 (); break; case op_pop2: ! { ! type t = pop_raw (); ! if (! t.iswide ()) ! pop32 (); ! } break; case op_dup: { *************** private: *** 2723,2729 **** invalidate_pc (); break; case op_areturn: ! check_return_type (pop_type (reference_type)); invalidate_pc (); break; case op_return: --- 2863,2869 ---- invalidate_pc (); break; case op_areturn: ! check_return_type (pop_init_ref (reference_type)); invalidate_pc (); break; case op_return: *************** private: *** 2805,2811 **** // This is only used for verifying the byte for // invokeinterface. nargs -= arg_types[i].depth (); ! pop_type (arg_types[i]); } if (opcode == op_invokeinterface --- 2945,2951 ---- // This is only used for verifying the byte for // invokeinterface. nargs -= arg_types[i].depth (); ! pop_init_ref (arg_types[i]); } if (opcode == op_invokeinterface *************** private: *** 2822,2828 **** } type raw = pop_raw (); bool ok = false; ! if (t.compatible (raw, this)) { ok = true; } --- 2962,2976 ---- } type raw = pop_raw (); bool ok = false; ! if (! is_init && ! raw.isinitialized ()) ! { ! // This is a failure. ! } ! else if (is_init && raw.isnull ()) ! { ! // Another failure. ! } ! else if (t.compatible (raw, this)) { ok = true; } *************** private: *** 2878,2884 **** break; case op_arraylength: { ! type t = pop_type (reference_type); if (! t.isarray () && ! t.isnull ()) verify_fail ("array type expected"); push_type (int_type); --- 3026,3032 ---- break; case op_arraylength: { ! type t = pop_init_ref (reference_type); if (! t.isarray () && ! t.isnull ()) verify_fail ("array type expected"); push_type (int_type); *************** private: *** 2889,2907 **** invalidate_pc (); break; case op_checkcast: ! pop_type (reference_type); push_type (check_class_constant (get_ushort ())); break; case op_instanceof: ! pop_type (reference_type); check_class_constant (get_ushort ()); push_type (int_type); break; case op_monitorenter: ! pop_type (reference_type); break; case op_monitorexit: ! pop_type (reference_type); break; case op_wide: { --- 3037,3055 ---- invalidate_pc (); break; case op_checkcast: ! pop_init_ref (reference_type); push_type (check_class_constant (get_ushort ())); break; case op_instanceof: ! pop_init_ref (reference_type); check_class_constant (get_ushort ()); push_type (int_type); break; case op_monitorenter: ! pop_init_ref (reference_type); break; case op_monitorexit: ! pop_init_ref (reference_type); break; case op_wide: { *************** private: *** 2935,2941 **** set_variable (get_ushort (), pop_type (double_type)); break; case op_astore: ! set_variable (get_ushort (), pop_type (reference_type)); break; case op_ret: handle_ret_insn (get_short ()); --- 3083,3089 ---- set_variable (get_ushort (), pop_type (double_type)); break; case op_astore: ! set_variable (get_ushort (), pop_init_ref (reference_type)); break; case op_ret: handle_ret_insn (get_short ()); *************** private: *** 2974,2979 **** --- 3122,3151 ---- handle_jsr_insn (get_int ()); break; + // These are unused here, but we call them out explicitly + // so that -Wswitch-enum doesn't complain. + case op_putfield_1: + case op_putfield_2: + case op_putfield_4: + case op_putfield_8: + case op_putfield_a: + case op_putstatic_1: + case op_putstatic_2: + case op_putstatic_4: + case op_putstatic_8: + case op_putstatic_a: + case op_getfield_1: + case op_getfield_2s: + case op_getfield_2u: + case op_getfield_4: + case op_getfield_8: + case op_getfield_a: + case op_getstatic_1: + case op_getstatic_2s: + case op_getstatic_2u: + case op_getstatic_4: + case op_getstatic_8: + case op_getstatic_a: default: // Unrecognized opcode. verify_fail ("unrecognized instruction in verify_instructions_0", *************** private: *** 2982,3015 **** } } - __attribute__ ((__noreturn__)) void verify_fail (char *s, jint pc = -1) - { - using namespace java::lang; - StringBuffer *buf = new StringBuffer (); - - buf->append (JvNewStringLatin1 ("verification failed")); - if (pc == -1) - pc = start_PC; - if (pc != -1) - { - buf->append (JvNewStringLatin1 (" at PC ")); - buf->append (pc); - } - - _Jv_InterpMethod *method = current_method; - buf->append (JvNewStringLatin1 (" in ")); - buf->append (current_class->getName()); - buf->append ((jchar) ':'); - buf->append (JvNewStringUTF (method->get_method()->name->data)); - buf->append ((jchar) '('); - buf->append (JvNewStringUTF (method->get_method()->signature->data)); - buf->append ((jchar) ')'); - - buf->append (JvNewStringLatin1 (": ")); - buf->append (JvNewStringLatin1 (s)); - throw new java::lang::VerifyError (buf->toString ()); - } - public: void verify_instructions () --- 3154,3159 ---- diff -Nrc3pad gcc-3.2.3/libjava/win32.cc gcc-3.3/libjava/win32.cc *** gcc-3.2.3/libjava/win32.cc 2002-04-24 01:04:44.000000000 +0000 --- gcc-3.3/libjava/win32.cc 2003-04-29 13:58:51.000000000 +0000 *************** *** 1,6 **** // win32.cc - Helper functions for Microsoft-flavored OSs. ! /* Copyright (C) 2002 Free Software Foundation This file is part of libgcj. --- 1,6 ---- // win32.cc - Helper functions for Microsoft-flavored OSs. ! /* Copyright (C) 2002, 2003 Free Software Foundation This file is part of libgcj. *************** Libgcj License. Please consult the file *** 9,20 **** details. */ #include #include #include #include - #include "platform.h" #include #include static LONG CALLBACK --- 9,21 ---- details. */ #include + #include #include #include #include #include + #include #include static LONG CALLBACK *************** win32_exception_handler (LPEXCEPTION_POI *** 28,33 **** --- 29,43 ---- return EXCEPTION_CONTINUE_SEARCH; } + // Platform-specific executable name + static char exec_name[MAX_PATH]; + // initialized in _Jv_platform_initialize() + + const char *_Jv_ThisExecutable (void) + { + return exec_name; + } + // Platform-specific VM initialization. void _Jv_platform_initialize (void) *************** _Jv_platform_initialize (void) *** 37,44 **** --- 47,58 ---- if (WSAStartup (MAKEWORD (1, 1), &data)) MessageBox (NULL, "Error initialising winsock library.", "Error", MB_OK | MB_ICONEXCLAMATION); + // Install exception handler SetUnhandledExceptionFilter (win32_exception_handler); + + // Initialize our executable name + GetModuleFileName(NULL, exec_name, sizeof(exec_name)); } // gettimeofday implementation. *************** _Jv_platform_initProperties (java::util: *** 90,96 **** _Jv_Free (buffer); } ! // Use GetUserName to set 'user.name'. buflen = 257; // UNLEN + 1 buffer = (char *) _Jv_MallocUnchecked (buflen); --- 104,110 ---- _Jv_Free (buffer); } ! // Use GetUserName to set 'user.name'. buflen = 257; // UNLEN + 1 buffer = (char *) _Jv_MallocUnchecked (buflen); *************** _Jv_platform_initProperties (java::util: *** 101,108 **** _Jv_Free (buffer); } ! // According to the api documentation for 'GetWindowsDirectory()', the ! // environmental variable HOMEPATH always specifies the user's home // directory or a default directory. On the 3 windows machines I checked // only 1 had it set. If it's not set, JDK1.3.1 seems to set it to // the windows directory, so we'll do the same. --- 115,122 ---- _Jv_Free (buffer); } ! // According to the api documentation for 'GetWindowsDirectory()', the ! // environmental variable HOMEPATH always specifies the user's home // directory or a default directory. On the 3 windows machines I checked // only 1 had it set. If it's not set, JDK1.3.1 seems to set it to // the windows directory, so we'll do the same. *************** _Jv_platform_initProperties (java::util: *** 117,123 **** if (winHome != NULL) { if (GetWindowsDirectory (winHome, MAX_PATH)) ! SET ("user.home", winHome); _Jv_Free (winHome); } } --- 131,137 ---- if (winHome != NULL) { if (GetWindowsDirectory (winHome, MAX_PATH)) ! SET ("user.home", winHome); _Jv_Free (winHome); } } *************** _Jv_platform_initProperties (java::util: *** 135,141 **** if (buffer != NULL) { sprintf (buffer, "%d.%d", (int) osvi.dwMajorVersion, ! (int) osvi.dwMinorVersion); SET ("os.version", buffer); _Jv_Free (buffer); } --- 149,155 ---- if (buffer != NULL) { sprintf (buffer, "%d.%d", (int) osvi.dwMajorVersion, ! (int) osvi.dwMinorVersion); SET ("os.version", buffer); _Jv_Free (buffer); } *************** _Jv_platform_initProperties (java::util: *** 150,156 **** else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) SET ("os.name", "Windows Me"); else ! SET ("os.name", "Windows ??"); break; case VER_PLATFORM_WIN32_NT: --- 164,170 ---- else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) SET ("os.name", "Windows Me"); else ! SET ("os.name", "Windows ??"); break; case VER_PLATFORM_WIN32_NT: *************** _Jv_platform_initProperties (java::util: *** 173,195 **** // Set the OS architecture. SYSTEM_INFO si; GetSystemInfo (&si); ! switch (si.dwProcessorType) { ! case PROCESSOR_INTEL_386: ! SET ("os.arch", "i386"); break; ! case PROCESSOR_INTEL_486: ! SET ("os.arch", "i486"); break; ! case PROCESSOR_INTEL_PENTIUM: ! SET ("os.arch", "i586"); break; ! case PROCESSOR_MIPS_R4000: ! SET ("os.arch", "MIPS4000"); break; ! case PROCESSOR_ALPHA_21064: ! SET ("os.arch", "ALPHA"); break; default: SET ("os.arch", "unknown"); break; --- 187,210 ---- // Set the OS architecture. SYSTEM_INFO si; GetSystemInfo (&si); ! switch (si.wProcessorArchitecture) { ! case PROCESSOR_ARCHITECTURE_INTEL: ! SET ("os.arch", "x86"); break; ! case PROCESSOR_ARCHITECTURE_MIPS: ! SET ("os.arch", "mips"); break; ! case PROCESSOR_ARCHITECTURE_ALPHA: ! SET ("os.arch", "alpha"); break; ! case PROCESSOR_ARCHITECTURE_PPC: ! SET ("os.arch", "ppc"); break; ! case PROCESSOR_ARCHITECTURE_IA64: ! SET ("os.arch", "ia64"); break; + case PROCESSOR_ARCHITECTURE_UNKNOWN: default: SET ("os.arch", "unknown"); break; *************** backtrace (void **__array, int __size) *** 217,219 **** --- 232,242 ---- } return i; } + + /* Placeholder implementation */ + int + _Jv_select (int, fd_set *, fd_set *, fd_set *, struct timeval *) + { + throw new java::lang::UnsupportedOperationException(JvNewStringUTF("_Jv_select() not implemented in Win32")); + return 0; + } diff -Nrc3pad gcc-3.2.3/libjava/win32-threads.cc gcc-3.3/libjava/win32-threads.cc *** gcc-3.2.3/libjava/win32-threads.cc 2002-02-25 02:01:29.000000000 +0000 --- gcc-3.3/libjava/win32-threads.cc 2003-01-28 22:23:08.000000000 +0000 *************** *** 1,6 **** // win32-threads.cc - interface between libjava and Win32 threads. ! /* Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of libgcj. --- 1,7 ---- // win32-threads.cc - interface between libjava and Win32 threads. ! /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software ! Foundation, Inc. This file is part of libgcj. *************** DWORD _Jv_ThreadDataKey; *** 70,81 **** inline void ensure_condvar_initialized(_Jv_ConditionVariable_t *cv) { ! if (cv->ev[0] == 0) { ! cv->ev[0] = CreateEvent (NULL, 0, 0, NULL); ! if (cv->ev[0] == 0) JvFail("CreateEvent() failed"); ! cv->ev[1] = CreateEvent (NULL, 1, 0, NULL); ! if (cv->ev[1] == 0) JvFail("CreateEvent() failed"); ! } } // Reimplementation of the general algorithm described at --- 71,84 ---- inline void ensure_condvar_initialized(_Jv_ConditionVariable_t *cv) { ! if (cv->ev[0] == 0) ! { ! cv->ev[0] = CreateEvent (NULL, 0, 0, NULL); ! if (cv->ev[0] == 0) JvFail("CreateEvent() failed"); ! ! cv->ev[1] = CreateEvent (NULL, 1, 0, NULL); ! if (cv->ev[1] == 0) JvFail("CreateEvent() failed"); ! } } // Reimplementation of the general algorithm described at *************** ensure_condvar_initialized(_Jv_Condition *** 85,95 **** int _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint nanos) { ! EnterCriticalSection(&cv->count_mutex); ! ensure_condvar_initialized(cv); cv->blocked_count++; ! LeaveCriticalSection(&cv->count_mutex); DWORD time; if ((millis == 0) && (nanos > 0)) time = 1; --- 88,100 ---- int _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint nanos) { + if (mu->owner != GetCurrentThreadId ( )) + return _JV_NOT_OWNER; ! EnterCriticalSection (&cv->count_mutex); ! ensure_condvar_initialized (cv); cv->blocked_count++; ! LeaveCriticalSection (&cv->count_mutex); DWORD time; if ((millis == 0) && (nanos > 0)) time = 1; *************** _Jv_CondWait(_Jv_ConditionVariable_t *cv *** 102,119 **** EnterCriticalSection(&cv->count_mutex); cv->blocked_count--; ! // If we were unblocked by the second event (the broadcast one) and nobody is ! // left, then reset the signal. ! int last_waiter = rval == WAIT_OBJECT_0 + 1 && cv->blocked_count == 0; LeaveCriticalSection(&cv->count_mutex); ! if (last_waiter) ResetEvent(&cv->ev[1]); _Jv_MutexLock (mu); ! if (rval == WAIT_FAILED) return GetLastError(); ! else if (rval == WAIT_TIMEOUT) return ETIMEDOUT; ! else return 0; } void --- 107,123 ---- EnterCriticalSection(&cv->count_mutex); cv->blocked_count--; ! // If we were unblocked by the second event (the broadcast one) ! // and nobody is left, then reset the event. ! int last_waiter = (rval == (WAIT_OBJECT_0 + 1)) && (cv->blocked_count == 0); LeaveCriticalSection(&cv->count_mutex); ! if (last_waiter) ! ResetEvent (cv->ev[1]); _Jv_MutexLock (mu); ! return 0; } void *************** _Jv_CondInit (_Jv_ConditionVariable_t *c *** 121,159 **** { // we do lazy creation of Events since CreateEvent() is insanely expensive cv->ev[0] = 0; ! InitializeCriticalSection(&cv->count_mutex); cv->blocked_count = 0; } void _Jv_CondDestroy (_Jv_ConditionVariable_t *cv) { ! if (cv->ev[0] != 0) CloseHandle(cv->ev[0]); ! cv = NULL; } int ! _Jv_CondNotify (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *) { ! EnterCriticalSection(&cv->count_mutex); ! ensure_condvar_initialized(cv); int somebody_is_blocked = cv->blocked_count > 0; ! LeaveCriticalSection(&cv->count_mutex); ! if (somebody_is_blocked) return SetEvent (cv->ev[0]) ? 0 : GetLastError(); ! else return 0; } int ! _Jv_CondNotifyAll (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *) { ! EnterCriticalSection(&cv->count_mutex); ! ensure_condvar_initialized(cv); int somebody_is_blocked = cv->blocked_count > 0; ! LeaveCriticalSection(&cv->count_mutex); ! if (somebody_is_blocked) return SetEvent (cv->ev[1]) ? 0 : GetLastError(); ! else return 0; } // --- 125,180 ---- { // we do lazy creation of Events since CreateEvent() is insanely expensive cv->ev[0] = 0; ! InitializeCriticalSection (&cv->count_mutex); cv->blocked_count = 0; } void _Jv_CondDestroy (_Jv_ConditionVariable_t *cv) { ! if (cv->ev[0] != 0) ! { ! CloseHandle (cv->ev[0]); ! CloseHandle (cv->ev[1]); ! ! cv->ev[0] = 0; ! } ! ! DeleteCriticalSection (&cv->count_mutex); } int ! _Jv_CondNotify (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu) { ! if (mu->owner != GetCurrentThreadId ( )) ! return _JV_NOT_OWNER; ! ! EnterCriticalSection (&cv->count_mutex); ! ensure_condvar_initialized (cv); int somebody_is_blocked = cv->blocked_count > 0; ! LeaveCriticalSection (&cv->count_mutex); ! if (somebody_is_blocked) ! SetEvent (cv->ev[0]); ! ! return 0; } int ! _Jv_CondNotifyAll (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu) { ! if (mu->owner != GetCurrentThreadId ( )) ! return _JV_NOT_OWNER; ! ! EnterCriticalSection (&cv->count_mutex); ! ensure_condvar_initialized (cv); int somebody_is_blocked = cv->blocked_count > 0; ! LeaveCriticalSection (&cv->count_mutex); ! if (somebody_is_blocked) ! SetEvent (cv->ev[1]); ! ! return 0; } // *************** _Jv_InitThreads (void) *** 165,172 **** { _Jv_ThreadKey = TlsAlloc(); _Jv_ThreadDataKey = TlsAlloc(); ! daemon_mutex = CreateMutex(NULL, 0, NULL); ! daemon_cond = CreateEvent(NULL, 0, 0, NULL); non_daemon_count = 0; } --- 186,193 ---- { _Jv_ThreadKey = TlsAlloc(); _Jv_ThreadDataKey = TlsAlloc(); ! daemon_mutex = CreateMutex (NULL, 0, NULL); ! daemon_cond = CreateEvent (NULL, 1, 0, NULL); non_daemon_count = 0; } *************** really_start (void* x) *** 255,261 **** WaitForSingleObject (daemon_mutex, INFINITE); non_daemon_count--; if (! non_daemon_count) ! PulseEvent (daemon_cond); ReleaseMutex (daemon_mutex); } --- 276,282 ---- WaitForSingleObject (daemon_mutex, INFINITE); non_daemon_count--; if (! non_daemon_count) ! SetEvent (daemon_cond); ReleaseMutex (daemon_mutex); } *************** _Jv_ThreadStart (java::lang::Thread *thr *** 297,306 **** void _Jv_ThreadWait (void) { ! WaitForSingleObject(daemon_mutex, INFINITE); ! if(non_daemon_count) ! SignalObjectAndWait(daemon_mutex, daemon_cond, INFINITE, 0); ! ReleaseMutex(daemon_mutex); } void --- 318,329 ---- void _Jv_ThreadWait (void) { ! WaitForSingleObject (daemon_mutex, INFINITE); ! if (non_daemon_count) ! { ! ReleaseMutex (daemon_mutex); ! WaitForSingleObject (daemon_cond, INFINITE); ! } } void diff -Nrc3pad gcc-3.2.3/zlib/adler32.c gcc-3.3/zlib/adler32.c *** gcc-3.2.3/zlib/adler32.c 2002-03-11 22:18:17.000000000 +0000 --- gcc-3.3/zlib/adler32.c 2002-03-11 22:11:16.000000000 +0000 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: adler32.c,v 1.1.26.1 2002/03/11 22:18:17 tromey Exp $ */ #include "zlib.h" --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: adler32.c,v 1.3 2002/03/11 22:11:16 tromey Exp $ */ #include "zlib.h" diff -Nrc3pad gcc-3.2.3/zlib/ChangeLog gcc-3.3/zlib/ChangeLog *** gcc-3.2.3/zlib/ChangeLog 2003-04-22 06:15:59.000000000 +0000 --- gcc-3.3/zlib/ChangeLog 2003-05-14 00:11:34.000000000 +0000 *************** *** 1,54 **** ! 2003-04-22 Release Manager ! ! * GCC 3.2.3 Released. ! ! 2003-02-05 Release Manager ! ! * GCC 3.2.2 Released. ! ! 2002-11-19 Release Manager ! ! * GCC 3.2.1 Released. ! ! 2002-11-19 Release Manager ! ! * GCC 3.2.1 Released. ! ! 2002-11-18 Release Manager ! ! * GCC 3.2.1 Released. ! ! 2002-10-07 Kaveh R. Ghazi ! ! * Makefile.am (all-multi): Fix multilib parallel build. ! ! 2002-08-14 Release Manager ! ! * GCC 3.2 Released. ! ! 2002-07-25 Release Manager ! ! * GCC 3.1.1 Released. ! ! 2002-05-14 Release Manager ! ! * GCC 3.1 Released. ! ! 2002-05-14 Release Manager ! * GCC 3.1 Released. ! 2002-05-08 Alexandre Oliva ! * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at ! script entry, and set LD to it when configuring multilibs. ! * configure: Rebuilt. ! 2001-06-09 Alexandre Oliva , Stephen L Moshier ! * configure.in (AC_EXEEXT): Work around in case it expands to ! nothing, as in autoconf 2.50. ! * configure: Rebuilt. ChangeLog file for zlib --- 1,14 ---- ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ! 2003-05-13 Release Manager ! * GCC 3.3 Released. ChangeLog file for zlib *************** Changes in 1.0.6 (19 Jan 1998) *** 277,283 **** - use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) - added makelcc.bat for lcc-win32 (Tom St Denis) - in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) ! - Avoid expanded $Id: ChangeLog,v 1.2.16.5.2.7 2003/04/22 06:15:59 gdr Exp $. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. - check for unistd.h in configure (for off_t) - remove useless check parameter in inflate_blocks_free - avoid useless assignment of s->check to itself in inflate_blocks_new --- 237,243 ---- - use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) - added makelcc.bat for lcc-win32 (Tom St Denis) - in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) ! - Avoid expanded $Id: ChangeLog,v 1.6.20.3 2003/05/14 00:11:34 mmitchel Exp $. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. - check for unistd.h in configure (for off_t) - remove useless check parameter in inflate_blocks_free - avoid useless assignment of s->check to itself in inflate_blocks_new diff -Nrc3pad gcc-3.2.3/zlib/ChangeLog.gcj gcc-3.3/zlib/ChangeLog.gcj *** gcc-3.2.3/zlib/ChangeLog.gcj 2003-02-20 02:32:58.000000000 +0000 --- gcc-3.3/zlib/ChangeLog.gcj 2003-02-20 09:12:19.000000000 +0000 *************** *** 1,3 **** --- 1,9 ---- + 2003-02-20 Alexandre Oliva + + * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to + config.status. + * configure: Rebuilt. + 2003-02-19 Alexandre Oliva * configure.in (multiosdir): Set to nothing if compiler is not GCC *************** *** 11,16 **** --- 17,39 ---- * Makefile.am (toolexecdir, toolexeclibdir): Don't override. * Makefile.in, configure: Rebuilt. + 2002-09-22 Kaveh R. Ghazi + + * Makefile.am (all-multi): Fix multilib parallel build. + + 2002-05-16 Rainer Orth + + * configure.in: Allow for PWDCMD to override hardcoded pwd. + * configure: Regenerate. + + * ChangeLog: Move entries to ChangeLog.gcj. + + 2002-05-08 Alexandre Oliva + + * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at + script entry, and set LD to it when configuring multilibs. + * configure: Rebuilt. + 2002-03-17 Bryce McKinlay * Makefile.am: Make target library a convenience library. *************** *** 26,31 **** --- 49,60 ---- * configure, Makefile.in: Rebuilt. * configure.in: Set mkinstalldirs, for in-tree build. + 2001-06-09 Alexandre Oliva , Stephen L Moshier + + * configure.in (AC_EXEEXT): Work around in case it expands to + nothing, as in autoconf 2.50. + * configure: Rebuilt. + 2001-05-13 Alexandre Oliva * acinclude.m4: Use ../libtool.m4. diff -Nrc3pad gcc-3.2.3/zlib/compress.c gcc-3.3/zlib/compress.c *** gcc-3.2.3/zlib/compress.c 2002-03-11 22:18:17.000000000 +0000 --- gcc-3.3/zlib/compress.c 2002-03-11 22:11:16.000000000 +0000 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: compress.c,v 1.1.26.1 2002/03/11 22:18:17 tromey Exp $ */ #include "zlib.h" --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: compress.c,v 1.3 2002/03/11 22:11:16 tromey Exp $ */ #include "zlib.h" diff -Nrc3pad gcc-3.2.3/zlib/configure gcc-3.3/zlib/configure *** gcc-3.2.3/zlib/configure 2003-02-20 02:32:58.000000000 +0000 --- gcc-3.3/zlib/configure 2003-02-20 09:12:20.000000000 +0000 *************** test "$host_alias" != "$target_alias" && *** 698,704 **** # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" # Find a good install program. We prefer a C program (faster), --- 698,704 ---- # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" # Find a good install program. We prefer a C program (faster), *************** gnu*) *** 1542,1550 **** ;; hpux10.20*|hpux11*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) --- 1542,1559 ---- ;; hpux10.20*|hpux11*) ! case $host_cpu in ! hppa*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/libc.sl ! ;; ! ia64*) ! lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' ! lt_cv_file_magic_cmd=/usr/bin/file ! lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ! ;; ! esac ;; irix5* | irix6*) *************** file_magic_cmd=$lt_cv_file_magic_cmd *** 1634,1646 **** deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:1638: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:1644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; --- 1643,1655 ---- deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 ! echo "configure:1647: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext ! if { (eval echo configure:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *************** case $deplibs_check_method in *** 1670,1676 **** file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:1674: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1679,1685 ---- file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 ! echo "configure:1683: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1732,1738 **** if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:1736: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1741,1747 ---- if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 ! echo "configure:1745: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** esac *** 1803,1809 **** # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1807: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1812,1818 ---- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1816: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 1835,1841 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1839: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1844,1850 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1848: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** fi *** 1870,1876 **** # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1874: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1879,1885 ---- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1883: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** if test -n "$ac_tool_prefix"; then *** 1902,1908 **** # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1906: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1911,1917 ---- # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1915: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** test x"$pic_mode" = xno && libtool_flags *** 1969,1976 **** case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 1973 "configure"' > conftest.$ac_ext ! if { (eval echo configure:1974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" --- 1978,1998 ---- case $host in *-*-irix6*) # Find out which ABI we are using. ! echo '#line 1982 "configure"' > conftest.$ac_ext ! if { (eval echo configure:1983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ! if test "$lt_cv_prog_gnu_ld" = yes; then ! case `/usr/bin/file conftest.$ac_objext` in ! *32-bit*) ! LD="${LD-ld} -melf32bsmip" ! ;; ! *N32*) ! LD="${LD-ld} -melf32bmipn32" ! ;; ! *64-bit*) ! LD="${LD-ld} -melf64bmip" ! ;; ! esac ! else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" *************** case $host in *** 1982,1987 **** --- 2004,2068 ---- LD="${LD-ld} -64" ;; esac + fi + fi + rm -rf conftest* + ;; + + ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:2016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; + + x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:2032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac fi rm -rf conftest* ;; *************** case $host in *** 1991,1997 **** SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:1995: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2072,2078 ---- SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 ! echo "configure:2076: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** ac_link='${CC-cc} -o conftest${ac_exeext *** 2004,2017 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else --- 2085,2098 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else *************** fi *** 2137,2143 **** # Find CPP now so that any conditional tests below won't do it and # thereby make the resulting definitions conditional. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:2141: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 2218,2224 ---- # Find CPP now so that any conditional tests below won't do it and # thereby make the resulting definitions conditional. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:2222: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** else *** 2152,2164 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2233,2245 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** else *** 2169,2181 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2250,2262 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** else *** 2186,2198 **** rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : --- 2267,2279 ---- rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : *************** else *** 2240,2256 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2244: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 2321,2337 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2325: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** done *** 2279,2290 **** for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2283: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2364: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2388,2394 ---- ; return 0; } EOF ! if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** fi *** 2332,2338 **** done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 ! echo "configure:2336: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2413,2419 ---- done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 ! echo "configure:2417: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** else *** 2340,2346 **** ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else --- 2574,2580 ---- } EOF ! if { (eval echo configure:2578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else *************** fi *** 2518,2529 **** for ac_func in memcpy strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2522: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2603: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 2627,2633 ---- ; return 0; } EOF ! if { (eval echo configure:2631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** done *** 2573,2579 **** if test "$with_system_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 ! echo "configure:2577: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2654,2660 ---- if test "$with_system_zlib" = yes; then echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 ! echo "configure:2658: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** else *** 2581,2587 **** ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2673,2679 ---- deflate() ; return 0; } EOF ! if { (eval echo configure:2677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** for ac_hdr in unistd.h *** 2624,2640 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2628: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 2705,2721 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2709: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2719: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} *** 3014,3019 **** --- 3095,3101 ---- zlib_basedir=${zlib_basedir} CC="${CC}" CXX="${CXX}" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" EOF cat >> $CONFIG_STATUS <<\EOF diff -Nrc3pad gcc-3.2.3/zlib/configure.in gcc-3.3/zlib/configure.in *** gcc-3.2.3/zlib/configure.in 2003-02-20 02:32:58.000000000 +0000 --- gcc-3.3/zlib/configure.in 2003-02-20 09:12:20.000000000 +0000 *************** fi *** 32,38 **** AC_CANONICAL_SYSTEM # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" AC_SUBST(mkinstalldirs) AM_INIT_AUTOMAKE(zlib, 1.1.3) --- 32,38 ---- AC_CANONICAL_SYSTEM # This works around an automake problem. ! mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" AC_SUBST(mkinstalldirs) AM_INIT_AUTOMAKE(zlib, 1.1.3) *************** CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} *** 152,155 **** --- 152,156 ---- zlib_basedir=${zlib_basedir} CC="${CC}" CXX="${CXX}" + ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" ) diff -Nrc3pad gcc-3.2.3/zlib/contrib/iostream2/zstream.h gcc-3.3/zlib/contrib/iostream2/zstream.h *** gcc-3.2.3/zlib/contrib/iostream2/zstream.h 2002-03-11 22:18:23.000000000 +0000 --- gcc-3.3/zlib/contrib/iostream2/zstream.h 2002-03-11 21:49:46.000000000 +0000 *************** *** 21,27 **** /* * zstream.h - C++ interface to the 'zlib' general purpose compression library ! * $Id: zstream.h,v 1.1.26.1 2002/03/11 22:18:23 tromey Exp $ */ #include --- 21,27 ---- /* * zstream.h - C++ interface to the 'zlib' general purpose compression library ! * $Id: zstream.h,v 1.2 2002/03/11 21:49:46 tromey Exp $ */ #include diff -Nrc3pad gcc-3.2.3/zlib/crc32.c gcc-3.3/zlib/crc32.c *** gcc-3.2.3/zlib/crc32.c 2002-03-11 22:18:17.000000000 +0000 --- gcc-3.3/zlib/crc32.c 2002-03-11 22:11:16.000000000 +0000 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: crc32.c,v 1.1.26.1 2002/03/11 22:18:17 tromey Exp $ */ #include "zlib.h" --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: crc32.c,v 1.3 2002/03/11 22:11:16 tromey Exp $ */ #include "zlib.h" diff -Nrc3pad gcc-3.2.3/zlib/deflate.c gcc-3.3/zlib/deflate.c *** gcc-3.2.3/zlib/deflate.c 2002-03-11 22:18:17.000000000 +0000 --- gcc-3.3/zlib/deflate.c 2002-03-11 22:11:16.000000000 +0000 *************** *** 47,53 **** * */ ! /* @(#) $Id: deflate.c,v 1.1.26.1 2002/03/11 22:18:17 tromey Exp $ */ #include "deflate.h" --- 47,53 ---- * */ ! /* @(#) $Id: deflate.c,v 1.3 2002/03/11 22:11:16 tromey Exp $ */ #include "deflate.h" diff -Nrc3pad gcc-3.2.3/zlib/deflate.h gcc-3.3/zlib/deflate.h *** gcc-3.2.3/zlib/deflate.h 2002-03-11 22:18:17.000000000 +0000 --- gcc-3.3/zlib/deflate.h 2002-03-11 22:11:16.000000000 +0000 *************** *** 8,14 **** subject to change. Applications should only use zlib.h. */ ! /* @(#) $Id: deflate.h,v 1.1.26.1 2002/03/11 22:18:17 tromey Exp $ */ #ifndef _DEFLATE_H #define _DEFLATE_H --- 8,14 ---- subject to change. Applications should only use zlib.h. */ ! /* @(#) $Id: deflate.h,v 1.3 2002/03/11 22:11:16 tromey Exp $ */ #ifndef _DEFLATE_H #define _DEFLATE_H diff -Nrc3pad gcc-3.2.3/zlib/example.c gcc-3.3/zlib/example.c *** gcc-3.2.3/zlib/example.c 2002-03-11 22:18:18.000000000 +0000 --- gcc-3.3/zlib/example.c 2002-03-11 22:11:16.000000000 +0000 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: example.c,v 1.1.26.1 2002/03/11 22:18:18 tromey Exp $ */ #include #include "zlib.h" --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: example.c,v 1.3 2002/03/11 22:11:16 tromey Exp $ */ #include #include "zlib.h" diff -Nrc3pad gcc-3.2.3/zlib/gzio.c gcc-3.3/zlib/gzio.c *** gcc-3.2.3/zlib/gzio.c 2002-03-11 22:18:18.000000000 +0000 --- gcc-3.3/zlib/gzio.c 2002-03-11 22:11:17.000000000 +0000 *************** *** 5,11 **** * Compile this file with -DNO_DEFLATE to avoid the compression code. */ ! /* @(#) $Id: gzio.c,v 1.1.26.1 2002/03/11 22:18:18 tromey Exp $ */ #include --- 5,11 ---- * Compile this file with -DNO_DEFLATE to avoid the compression code. */ ! /* @(#) $Id: gzio.c,v 1.3 2002/03/11 22:11:17 tromey Exp $ */ #include diff -Nrc3pad gcc-3.2.3/zlib/minigzip.c gcc-3.3/zlib/minigzip.c *** gcc-3.2.3/zlib/minigzip.c 2002-03-11 22:18:19.000000000 +0000 --- gcc-3.3/zlib/minigzip.c 2002-03-11 22:11:17.000000000 +0000 *************** *** 13,19 **** * or in pipe mode. */ ! /* @(#) $Id: minigzip.c,v 1.1.26.1 2002/03/11 22:18:19 tromey Exp $ */ #include #include "zlib.h" --- 13,19 ---- * or in pipe mode. */ ! /* @(#) $Id: minigzip.c,v 1.3 2002/03/11 22:11:17 tromey Exp $ */ #include #include "zlib.h" diff -Nrc3pad gcc-3.2.3/zlib/trees.c gcc-3.3/zlib/trees.c *** gcc-3.2.3/zlib/trees.c 2002-03-11 22:18:19.000000000 +0000 --- gcc-3.3/zlib/trees.c 2002-03-11 22:11:17.000000000 +0000 *************** *** 29,35 **** * Addison-Wesley, 1983. ISBN 0-201-06672-6. */ ! /* @(#) $Id: trees.c,v 1.1.26.1 2002/03/11 22:18:19 tromey Exp $ */ /* #define GEN_TREES_H */ --- 29,35 ---- * Addison-Wesley, 1983. ISBN 0-201-06672-6. */ ! /* @(#) $Id: trees.c,v 1.3 2002/03/11 22:11:17 tromey Exp $ */ /* #define GEN_TREES_H */ diff -Nrc3pad gcc-3.2.3/zlib/uncompr.c gcc-3.3/zlib/uncompr.c *** gcc-3.2.3/zlib/uncompr.c 2002-03-11 22:18:19.000000000 +0000 --- gcc-3.3/zlib/uncompr.c 2002-03-11 22:11:18.000000000 +0000 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: uncompr.c,v 1.1.26.1 2002/03/11 22:18:19 tromey Exp $ */ #include "zlib.h" --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: uncompr.c,v 1.3 2002/03/11 22:11:18 tromey Exp $ */ #include "zlib.h" diff -Nrc3pad gcc-3.2.3/zlib/zconf.h gcc-3.3/zlib/zconf.h *** gcc-3.2.3/zlib/zconf.h 2002-03-11 22:18:19.000000000 +0000 --- gcc-3.3/zlib/zconf.h 2002-03-11 22:11:18.000000000 +0000 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: zconf.h,v 1.1.26.1 2002/03/11 22:18:19 tromey Exp $ */ #ifndef _ZCONF_H #define _ZCONF_H --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: zconf.h,v 1.3 2002/03/11 22:11:18 tromey Exp $ */ #ifndef _ZCONF_H #define _ZCONF_H diff -Nrc3pad gcc-3.2.3/zlib/zutil.c gcc-3.3/zlib/zutil.c *** gcc-3.2.3/zlib/zutil.c 2002-03-11 22:18:20.000000000 +0000 --- gcc-3.3/zlib/zutil.c 2002-03-11 22:11:18.000000000 +0000 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: zutil.c,v 1.1.26.1 2002/03/11 22:18:20 tromey Exp $ */ #include "zutil.h" --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* @(#) $Id: zutil.c,v 1.3 2002/03/11 22:11:18 tromey Exp $ */ #include "zutil.h" diff -Nrc3pad gcc-3.2.3/zlib/zutil.h gcc-3.3/zlib/zutil.h *** gcc-3.2.3/zlib/zutil.h 2002-03-11 22:18:20.000000000 +0000 --- gcc-3.3/zlib/zutil.h 2002-03-11 22:11:18.000000000 +0000 *************** *** 8,14 **** subject to change. Applications should only use zlib.h. */ ! /* @(#) $Id: zutil.h,v 1.1.26.1 2002/03/11 22:18:20 tromey Exp $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H --- 8,14 ---- subject to change. Applications should only use zlib.h. */ ! /* @(#) $Id: zutil.h,v 1.3 2002/03/11 22:11:18 tromey Exp $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H